From 0752ec332069bb1176315779b6c6502e2ffe6c53 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 15:34:00 +0000 Subject: [PATCH 1/8] Add snippets.json prototype for 7 adaptors Introduces a per-adaptor snippets.json file: a reusable, sectioned catalogue of pre-built job-code actions (similar to Zapier's actions). Each entry has a description (for AI-assisted action picking) and a code block (with inline comments) that can be pasted into job code. Coverage: claude, gemini, gmail, postgresql, stripe, googlesheets, twilio. Action lists are scoped to operations the adaptor actually exports. https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/claude/snippets.json | 8 ++++++ packages/gemini/snippets.json | 8 ++++++ packages/gmail/snippets.json | 14 ++++++++++ packages/googlesheets/snippets.json | 26 ++++++++++++++++++ packages/postgresql/snippets.json | 40 +++++++++++++++++++++++++++ packages/stripe/snippets.json | 42 +++++++++++++++++++++++++++++ packages/twilio/snippets.json | 8 ++++++ 7 files changed, 146 insertions(+) create mode 100644 packages/claude/snippets.json create mode 100644 packages/gemini/snippets.json create mode 100644 packages/gmail/snippets.json create mode 100644 packages/googlesheets/snippets.json create mode 100644 packages/postgresql/snippets.json create mode 100644 packages/stripe/snippets.json create mode 100644 packages/twilio/snippets.json diff --git a/packages/claude/snippets.json b/packages/claude/snippets.json new file mode 100644 index 0000000000..cff2ae9e59 --- /dev/null +++ b/packages/claude/snippets.json @@ -0,0 +1,8 @@ +{ + "Messages": { + "Send Message": { + "description": "Send a prompt to Claude and capture the model's reply on state.", + "code": "// Send a prompt to Claude.\n// The model's reply is written to state.data (and pushed to state.references).\nprompt(\n // 1) The message text. Reference upstream state with $.\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // 2) Model id. Defaults to the latest Sonnet if omitted.\n model: 'claude-sonnet-4-6',\n // 3) Maximum tokens to generate in the reply.\n max_tokens: 1024,\n // 4) 0.0 = analytical / deterministic, 1.0 = creative.\n temperature: 0.7,\n }\n);" + } + } +} diff --git a/packages/gemini/snippets.json b/packages/gemini/snippets.json new file mode 100644 index 0000000000..d178cfb713 --- /dev/null +++ b/packages/gemini/snippets.json @@ -0,0 +1,8 @@ +{ + "Messages": { + "Send Prompt": { + "description": "Send a prompt to a Gemini model and capture the generated response.", + "code": "// Send a prompt to Gemini.\n// The text reply is written to state.data.\nprompt(\n // 1) The prompt text. Reference upstream state with $.\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // 2) Gemini model id (see https://ai.google.dev/gemini-api/docs/models).\n model: 'gemini-2.5-flash',\n // 3) Optional generation tuning.\n temperature: 0.7,\n }\n);" + } + } +} diff --git a/packages/gmail/snippets.json b/packages/gmail/snippets.json new file mode 100644 index 0000000000..8ca374e9d5 --- /dev/null +++ b/packages/gmail/snippets.json @@ -0,0 +1,14 @@ +{ + "Email": { + "Send Email": { + "description": "Compose and dispatch a new email message from your Gmail account.", + "code": "// Send a new email through Gmail.\n// Pass a single message object, or an array to send several in one step.\nsendMessage({\n // 1) Recipient address (or array of addresses).\n to: 'recipient@example.org',\n // 2) Subject line.\n subject: 'Hello from OpenFn',\n // 3) Message body. Plain text by default; pass html: true for HTML.\n body: `Hi there,\\n\\nThis email was sent from an OpenFn workflow.`,\n // 4) Optional CC / BCC.\n // cc: 'cc@example.org',\n // bcc: 'bcc@example.org',\n // 5) Optional file attachments.\n // attachments: [{ filename: 'report.csv', content: $.csv }],\n});" + } + }, + "Search": { + "Find Email": { + "description": "Locate one or more email messages that match a Gmail search query.", + "code": "// Find emails matching a Gmail search query.\n// Results land on state.data as an array of message contents.\ngetContentsFromMessages({\n // 1) Standard Gmail search syntax (from:, subject:, after:, has:attachment, ...).\n query: 'from:billing@example.org subject:invoice after:2026/01/01',\n // 2) Which fields to pull back per message.\n contents: ['from', 'date', 'subject', 'body'],\n // 3) Cap the number of messages returned.\n maxResults: 25,\n});" + } + } +} diff --git a/packages/googlesheets/snippets.json b/packages/googlesheets/snippets.json new file mode 100644 index 0000000000..b70500f6f1 --- /dev/null +++ b/packages/googlesheets/snippets.json @@ -0,0 +1,26 @@ +{ + "Rows": { + "Create Spreadsheet Row": { + "description": "Append a new row of values to a sheet.", + "code": "// Append a single row to the bottom of a sheet.\nappendValues({\n // 1) Spreadsheet ID — the long string from the sheet's URL.\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // 2) Where to append. Use the sheet name + column range.\n range: 'Sheet1!A1:D1',\n // 3) Outer array = rows, inner arrays = cells in column order.\n values: [\n [$.data.name, $.data.email, $.data.amount, $.data.date],\n ],\n});" + }, + "Create Multiple Spreadsheet Rows": { + "description": "Append several rows of values at once.", + "code": "// Append many rows in one call.\n// Each inner array is one row; cells must line up with your columns.\nappendValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n range: 'Sheet1!A1:D1',\n values: $.data.records.map(r => [r.name, r.email, r.amount, r.date]),\n});" + }, + "Update Spreadsheet Row": { + "description": "Overwrite the values of a specific row or range.", + "code": "// Overwrite one or more ranges with new values.\n// Each entry in `data` targets a specific A1 range.\nbatchUpdateValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // Cells are parsed like a user typed them (formulas, dates, etc.).\n valueInputOption: 'USER_ENTERED',\n data: [\n {\n range: 'Sheet1!A5:D5',\n values: [[$.data.name, $.data.email, $.data.amount, $.data.date]],\n },\n ],\n});" + } + }, + "Search": { + "Get Data Range": { + "description": "Read the values from a specific A1-notation range.", + "code": "// Read values from a range. Result is on state.data as a 2d array.\ngetValues(\n // 1) Spreadsheet ID.\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // 2) A1 range — sheet name + range.\n 'Sheet1!A1:D100'\n);" + }, + "Lookup Spreadsheet Row": { + "description": "Find a row whose value in a given column matches a lookup value.", + "code": "// Read the column, then filter in JS to find the matching row.\ngetValues(\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n 'Sheet1!A1:D100',\n // The callback receives state with the rows on state.data.values.\n state => {\n const [header, ...rows] = state.data.values || [];\n // Match on the second column (index 1).\n state.match = rows.find(r => r[1] === $.data.email);\n return state;\n }\n);" + } + } +} diff --git a/packages/postgresql/snippets.json b/packages/postgresql/snippets.json new file mode 100644 index 0000000000..fc9a304613 --- /dev/null +++ b/packages/postgresql/snippets.json @@ -0,0 +1,40 @@ +{ + "Rows": { + "Insert Row": { + "description": "Add a single row to a table.", + "code": "// Insert one row into a table.\n// The new row is returned on state.data.\ninsert(\n // 1) Target table name.\n 'users',\n // 2) The record as a plain object (column => value).\n { name: 'Elodie', email: 'elodie@example.org', age: 31 },\n // 3) Optional settings.\n {\n // Print the generated SQL to the run log (handy while developing).\n writeSql: true,\n // Treat these literal strings in the payload as SQL NULL.\n setNull: [\"''\", \"'undefined'\"],\n }\n);" + }, + "Insert Multiple Rows": { + "description": "Add many rows to a table in a single statement.", + "code": "// Insert many rows in one batch.\n// Pass an array literal, or a function that derives the array from state.\ninsertMany(\n 'users',\n state => state.data.records,\n { writeSql: true }\n);" + }, + "Update Row": { + "description": "Modify the values of an existing row matched by a unique column.", + "code": "// Update an existing row using a parameterised SQL statement.\n// $1, $2... are bound from the `values` array (safe against SQL injection).\nsql(\n 'UPDATE users SET email = $1, updated_at = NOW() WHERE id = $2;',\n {\n values: [$.data.email, $.data.id],\n writeSql: true,\n }\n);" + }, + "Upsert Row": { + "description": "Insert a row, or update it if a conflict is hit on the unique key.", + "code": "// Insert-or-update against a unique constraint.\nupsert(\n // 1) Target table.\n 'users',\n // 2) Conflict target: either a column name with a UNIQUE constraint,\n // or the literal 'ON CONSTRAINT '.\n 'email',\n // 3) Record to write.\n { name: 'Elodie', email: 'elodie@example.org', age: 31 },\n { writeSql: true }\n);" + } + }, + "Search": { + "Find Row": { + "description": "Look up a single row using a column/value filter.", + "code": "// Fetch a single row's value from a relation.\n// Result is written to state.data.\nfindValue({\n // The column to return (or 'id' / uuid column).\n uuid: 'id',\n // The table or view to query.\n relation: 'users',\n // Equality filter (combined with AND).\n where: { email: $.data.email },\n // Optional operator override per column.\n operator: { email: '=' },\n});" + }, + "Find Row via Custom Query": { + "description": "Locate a row using a custom SQL query you control.", + "code": "// Run an arbitrary SELECT. Results are on state.data.rows.\nsql(\n 'SELECT * FROM users WHERE email = $1 LIMIT 1;',\n {\n values: [$.data.email],\n writeSql: true,\n }\n);" + }, + "Find Rows via Custom Query": { + "description": "Retrieve many rows using a custom SQL query.", + "code": "// Run an arbitrary SELECT returning many rows.\n// Available on state.data.rows.\nsql(\n 'SELECT id, name, email FROM users WHERE created_at > $1 ORDER BY id;',\n {\n values: ['2026-01-01'],\n }\n);" + } + }, + "Schema": { + "Describe Table": { + "description": "Return the column definitions for a table.", + "code": "// Inspect a table's columns and types.\n// Result is written to state.data.\ndescribeTable('users');" + } + } +} diff --git a/packages/stripe/snippets.json b/packages/stripe/snippets.json new file mode 100644 index 0000000000..5254d5a01e --- /dev/null +++ b/packages/stripe/snippets.json @@ -0,0 +1,42 @@ +{ + "Customers": { + "Find Customer": { + "description": "Look up a customer by their Stripe ID, or list customers matched by email.", + "code": "// Look up a specific customer by ID.\n// state.data will hold the customer object.\nget('customers', $.data.customerId);\n\n// Or — search by email by listing with a filter.\n// list('customers', { email: 'jane@example.org', limit: 1 });" + } + }, + "Charges": { + "Find Charge": { + "description": "Retrieve an existing charge by its Stripe ID.", + "code": "// Fetch a single charge.\nget('charges', $.data.chargeId);" + } + }, + "Payments": { + "Find Payment": { + "description": "Retrieve an existing payment intent by its Stripe ID.", + "code": "// Fetch a single payment intent.\nget('payment_intents', $.data.paymentIntentId);" + } + }, + "Invoices": { + "Find Invoice": { + "description": "Retrieve an existing invoice by its Stripe ID.", + "code": "// Fetch a single invoice.\nget('invoices', $.data.invoiceId);" + } + }, + "Subscriptions": { + "Find Subscription": { + "description": "Retrieve a subscription by ID, or list a customer's subscriptions.", + "code": "// Look up by subscription ID.\nget('subscriptions', $.data.subscriptionId);\n\n// Or — list every subscription for a given customer.\n// list('subscriptions', { customer: $.data.customerId, status: 'active' });" + } + }, + "Balance": { + "Find Account Balance": { + "description": "Retrieve the current Stripe account balance.", + "code": "// Get the available/pending balance for the connected account.\nget('balance', '');" + }, + "Find Balance Transactions": { + "description": "List the transactions that have affected the account balance.", + "code": "// List recent balance transactions.\nlist('balance_transactions', {\n // Page size (max 100).\n limit: 25,\n});" + } + } +} diff --git a/packages/twilio/snippets.json b/packages/twilio/snippets.json new file mode 100644 index 0000000000..2bd12098d4 --- /dev/null +++ b/packages/twilio/snippets.json @@ -0,0 +1,8 @@ +{ + "Messaging": { + "Send SMS": { + "description": "Send a text message to a phone number through your Twilio account.", + "code": "// Send a single SMS via Twilio.\n// state.references is populated with Twilio's API response.\nsendSMS({\n // 1) Message body (max 1600 chars, billed per 160-char segment).\n body: `Hi ${$.data.name}, your appointment is confirmed.`,\n // 2) Your Twilio sending number, in E.164 format (e.g. +14155551212).\n from: $.configuration.fromNumber,\n // 3) Recipient, in E.164 format.\n to: $.data.phone,\n});" + } + } +} From 5860b90954ca7a828e4f7987ef896b911d638b65 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 16:25:44 +0000 Subject: [PATCH 2/8] Add chatgpt snippets.json Adds a Text / Vision / Conversation snippet catalogue for the chatgpt adaptor, scoped to operations callable via the existing prompt() and deepResearch() exports. Zapier items requiring audio, image, video, embeddings, moderations, files or raw HTTP are intentionally omitted. https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/chatgpt/snippets.json | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 packages/chatgpt/snippets.json diff --git a/packages/chatgpt/snippets.json b/packages/chatgpt/snippets.json new file mode 100644 index 0000000000..0d8adf8f91 --- /dev/null +++ b/packages/chatgpt/snippets.json @@ -0,0 +1,48 @@ +{ + "Text": { + "Analyze Text": { + "description": "Summarize, classify, or otherwise analyze a block of text.", + "code": "// Ask the model to analyze a block of text.\n// The chat completion is written to state.data.\nprompt(\n `Analyze the following text and return the key themes, tone and any action items.\\n\\nTEXT:\\n${JSON.stringify($.data.text)}`,\n {\n // Pick a chat-completions capable model.\n model: 'gpt-4o-mini',\n // Keep output deterministic for analysis tasks.\n temperature: 0.2,\n }\n);" + }, + "Summarize Text (Legacy)": { + "description": "Condense a block of text into a short summary.", + "code": "// Summarize a chunk of text.\nprompt(\n `Summarize the text below in 3 short bullet points.\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.2,\n }\n);" + }, + "Classify Text (Legacy)": { + "description": "Assign a piece of text to one of the categories you supply.", + "code": "// Classify text into one of the supplied categories.\nconst categories = ['billing', 'support', 'sales', 'other'];\n\nprompt(\n `Pick the single best category for the message below. Reply with the\\ncategory string only, nothing else.\\n\\nCATEGORIES: ${categories.join(', ')}\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n }\n);" + }, + "Analyze Text Sentiment (Legacy)": { + "description": "Score the overall sentiment of a block of text.", + "code": "// Return a sentiment label + score for a block of text.\nprompt(\n `Rate the sentiment of the text below. Reply as JSON:\\n{ \"label\": \"positive\" | \"neutral\" | \"negative\", \"score\": number between -1 and 1 }\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n // Force the model to emit valid JSON.\n response_format: { type: 'json_object' },\n }\n);" + }, + "Extract Structured Data": { + "description": "Pull structured fields out of unstructured text using a JSON schema.", + "code": "// Extract structured fields from unstructured text.\n// The model is constrained to a JSON schema; result lands on state.data.\nprompt(\n `Extract the contact details from the message below.\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n response_format: {\n type: 'json_schema',\n json_schema: {\n name: 'contact',\n schema: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n email: { type: 'string' },\n phone: { type: 'string' },\n },\n required: ['name'],\n additionalProperties: false,\n },\n },\n },\n }\n);" + }, + "Write an Email": { + "description": "Draft an email body from a prompt, ready for a follow-up send step.", + "code": "// Draft an email body for use in a later send step.\nprompt(\n `Write a friendly email to ${$.data.recipientName} confirming their\\nappointment on ${$.data.appointmentDate}. Sign it from \\\"OpenFn Team\\\".`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.7,\n }\n);" + }, + "Send Prompt": { + "description": "Send an open-ended prompt to OpenAI and capture the reply.", + "code": "// Free-form prompt. Reply is on state.data.\nprompt(\n `What are three risks to watch for in the following plan?\\n\\n${$.data.plan}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.5,\n }\n);" + } + }, + "Vision": { + "Analyze Image Content With Vision (Legacy)": { + "description": "Send an image and a question about it to a vision-capable model.", + "code": "// Ask a question about an image (URL or base64 data URI).\n// Override `messages` to attach an image part alongside the text.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: 'Describe what is happening in this image.' },\n { type: 'image_url', image_url: { url: $.data.imageUrl } },\n ],\n },\n ],\n});" + } + }, + "Conversation": { + "Conversation (Legacy)": { + "description": "Send a multi-turn chat to OpenAI, optionally preserving prior turns.", + "code": "// Multi-turn chat. Provide the full message history via `messages`.\n// `prompt`'s first arg is ignored here because we override `messages`.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n { role: 'system', content: 'You are a concise assistant.' },\n ...($.state.history || []),\n { role: 'user', content: $.data.userMessage },\n ],\n temperature: 0.5,\n});" + }, + "Conversation": { + "description": "Send a chat turn using the Responses API, with optional tool use such as web search.", + "code": "// Use the Responses API (via deepResearch) for tool-aware chat.\n// Default tool is web_search_preview; pass your own `tools` to override.\ndeepResearch(\n `User question: ${$.data.userMessage}\\n\\nAnswer concisely.`,\n {\n model: 'gpt-4o',\n tools: [{ type: 'web_search_preview' }],\n }\n);" + } + } +} From b20e4535007d2e6be97d014cb105e5a2d0a4dae0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 16:27:51 +0000 Subject: [PATCH 3/8] Blank code in 6 adaptor snippets; expand gmail with full action list Reverts the speculative code added for claude, gemini, postgresql, stripe, googlesheets and twilio so the app can render "coming soon" for actions without code. Titles and descriptions are retained so each section/action still appears. Rewrites gmail/snippets.json to cover the full Zapier action list (10 Create actions + 2 Search actions), with real code only on Send Email and Find Email where the adaptor's sendMessage() and getContentsFromMessages() exports support it; the remaining actions carry an empty code field for now. https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/claude/snippets.json | 2 +- packages/gemini/snippets.json | 2 +- packages/gmail/snippets.json | 44 +++++++++++++++++++++++++++-- packages/googlesheets/snippets.json | 10 +++---- packages/postgresql/snippets.json | 16 +++++------ packages/stripe/snippets.json | 14 ++++----- packages/twilio/snippets.json | 2 +- 7 files changed, 65 insertions(+), 25 deletions(-) diff --git a/packages/claude/snippets.json b/packages/claude/snippets.json index cff2ae9e59..e0bc872b10 100644 --- a/packages/claude/snippets.json +++ b/packages/claude/snippets.json @@ -2,7 +2,7 @@ "Messages": { "Send Message": { "description": "Send a prompt to Claude and capture the model's reply on state.", - "code": "// Send a prompt to Claude.\n// The model's reply is written to state.data (and pushed to state.references).\nprompt(\n // 1) The message text. Reference upstream state with $.\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // 2) Model id. Defaults to the latest Sonnet if omitted.\n model: 'claude-sonnet-4-6',\n // 3) Maximum tokens to generate in the reply.\n max_tokens: 1024,\n // 4) 0.0 = analytical / deterministic, 1.0 = creative.\n temperature: 0.7,\n }\n);" + "code": "" } } } diff --git a/packages/gemini/snippets.json b/packages/gemini/snippets.json index d178cfb713..978f3f02f2 100644 --- a/packages/gemini/snippets.json +++ b/packages/gemini/snippets.json @@ -2,7 +2,7 @@ "Messages": { "Send Prompt": { "description": "Send a prompt to a Gemini model and capture the generated response.", - "code": "// Send a prompt to Gemini.\n// The text reply is written to state.data.\nprompt(\n // 1) The prompt text. Reference upstream state with $.\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // 2) Gemini model id (see https://ai.google.dev/gemini-api/docs/models).\n model: 'gemini-2.5-flash',\n // 3) Optional generation tuning.\n temperature: 0.7,\n }\n);" + "code": "" } } } diff --git a/packages/gmail/snippets.json b/packages/gmail/snippets.json index 8ca374e9d5..4357897b56 100644 --- a/packages/gmail/snippets.json +++ b/packages/gmail/snippets.json @@ -1,14 +1,54 @@ { - "Email": { + "Create": { "Send Email": { "description": "Compose and dispatch a new email message from your Gmail account.", - "code": "// Send a new email through Gmail.\n// Pass a single message object, or an array to send several in one step.\nsendMessage({\n // 1) Recipient address (or array of addresses).\n to: 'recipient@example.org',\n // 2) Subject line.\n subject: 'Hello from OpenFn',\n // 3) Message body. Plain text by default; pass html: true for HTML.\n body: `Hi there,\\n\\nThis email was sent from an OpenFn workflow.`,\n // 4) Optional CC / BCC.\n // cc: 'cc@example.org',\n // bcc: 'bcc@example.org',\n // 5) Optional file attachments.\n // attachments: [{ filename: 'report.csv', content: $.csv }],\n});" + "code": "// Send a new email through Gmail.\n// Pass a single message object, or an array to send several in one step.\nsendMessage({\n // 1) Recipient address (or an array of addresses).\n to: 'recipient@example.org',\n // 2) Subject line.\n subject: 'Hello from OpenFn',\n // 3) Message body. Plain text by default; pass html: true for HTML.\n body: `Hi there,\\n\\nThis email was sent from an OpenFn workflow.`,\n // 4) Optional CC / BCC.\n // cc: 'cc@example.org',\n // bcc: 'bcc@example.org',\n // 5) Optional file attachments.\n // attachments: [{ filename: 'report.csv', content: $.csv }],\n});" + }, + "Reply to Email": { + "description": "Send a reply on an existing email thread.", + "code": "" + }, + "Create Draft": { + "description": "Save a draft email without sending it.", + "code": "" + }, + "Create Draft Reply": { + "description": "Save a draft reply on an existing email thread.", + "code": "" + }, + "Archive Email": { + "description": "Move an email out of the inbox into the archive.", + "code": "" + }, + "Delete Email": { + "description": "Move an email message to the trash.", + "code": "" + }, + "Add Label to Email": { + "description": "Apply an existing label to a specific email message.", + "code": "" + }, + "Remove Label From Email": { + "description": "Remove a label from a specific email message.", + "code": "" + }, + "Remove Label From Conversation": { + "description": "Remove a label from every email in a conversation thread.", + "code": "" + }, + "Create Label": { + "description": "Define a new label that can later be applied to messages.", + "code": "" } }, "Search": { "Find Email": { "description": "Locate one or more email messages that match a Gmail search query.", "code": "// Find emails matching a Gmail search query.\n// Results land on state.data as an array of message contents.\ngetContentsFromMessages({\n // 1) Standard Gmail search syntax (from:, subject:, after:, has:attachment, ...).\n query: 'from:billing@example.org subject:invoice after:2026/01/01',\n // 2) Which fields to pull back per message.\n contents: ['from', 'date', 'subject', 'body'],\n // 3) Cap the number of messages returned.\n maxResults: 25,\n});" + }, + "Get Attachment by Filename": { + "description": "Pull a specific Gmail attachment by its filename.", + "code": "" } } } diff --git a/packages/googlesheets/snippets.json b/packages/googlesheets/snippets.json index b70500f6f1..db20a21de5 100644 --- a/packages/googlesheets/snippets.json +++ b/packages/googlesheets/snippets.json @@ -2,25 +2,25 @@ "Rows": { "Create Spreadsheet Row": { "description": "Append a new row of values to a sheet.", - "code": "// Append a single row to the bottom of a sheet.\nappendValues({\n // 1) Spreadsheet ID — the long string from the sheet's URL.\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // 2) Where to append. Use the sheet name + column range.\n range: 'Sheet1!A1:D1',\n // 3) Outer array = rows, inner arrays = cells in column order.\n values: [\n [$.data.name, $.data.email, $.data.amount, $.data.date],\n ],\n});" + "code": "" }, "Create Multiple Spreadsheet Rows": { "description": "Append several rows of values at once.", - "code": "// Append many rows in one call.\n// Each inner array is one row; cells must line up with your columns.\nappendValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n range: 'Sheet1!A1:D1',\n values: $.data.records.map(r => [r.name, r.email, r.amount, r.date]),\n});" + "code": "" }, "Update Spreadsheet Row": { "description": "Overwrite the values of a specific row or range.", - "code": "// Overwrite one or more ranges with new values.\n// Each entry in `data` targets a specific A1 range.\nbatchUpdateValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // Cells are parsed like a user typed them (formulas, dates, etc.).\n valueInputOption: 'USER_ENTERED',\n data: [\n {\n range: 'Sheet1!A5:D5',\n values: [[$.data.name, $.data.email, $.data.amount, $.data.date]],\n },\n ],\n});" + "code": "" } }, "Search": { "Get Data Range": { "description": "Read the values from a specific A1-notation range.", - "code": "// Read values from a range. Result is on state.data as a 2d array.\ngetValues(\n // 1) Spreadsheet ID.\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // 2) A1 range — sheet name + range.\n 'Sheet1!A1:D100'\n);" + "code": "" }, "Lookup Spreadsheet Row": { "description": "Find a row whose value in a given column matches a lookup value.", - "code": "// Read the column, then filter in JS to find the matching row.\ngetValues(\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n 'Sheet1!A1:D100',\n // The callback receives state with the rows on state.data.values.\n state => {\n const [header, ...rows] = state.data.values || [];\n // Match on the second column (index 1).\n state.match = rows.find(r => r[1] === $.data.email);\n return state;\n }\n);" + "code": "" } } } diff --git a/packages/postgresql/snippets.json b/packages/postgresql/snippets.json index fc9a304613..61e95be360 100644 --- a/packages/postgresql/snippets.json +++ b/packages/postgresql/snippets.json @@ -2,39 +2,39 @@ "Rows": { "Insert Row": { "description": "Add a single row to a table.", - "code": "// Insert one row into a table.\n// The new row is returned on state.data.\ninsert(\n // 1) Target table name.\n 'users',\n // 2) The record as a plain object (column => value).\n { name: 'Elodie', email: 'elodie@example.org', age: 31 },\n // 3) Optional settings.\n {\n // Print the generated SQL to the run log (handy while developing).\n writeSql: true,\n // Treat these literal strings in the payload as SQL NULL.\n setNull: [\"''\", \"'undefined'\"],\n }\n);" + "code": "" }, "Insert Multiple Rows": { "description": "Add many rows to a table in a single statement.", - "code": "// Insert many rows in one batch.\n// Pass an array literal, or a function that derives the array from state.\ninsertMany(\n 'users',\n state => state.data.records,\n { writeSql: true }\n);" + "code": "" }, "Update Row": { "description": "Modify the values of an existing row matched by a unique column.", - "code": "// Update an existing row using a parameterised SQL statement.\n// $1, $2... are bound from the `values` array (safe against SQL injection).\nsql(\n 'UPDATE users SET email = $1, updated_at = NOW() WHERE id = $2;',\n {\n values: [$.data.email, $.data.id],\n writeSql: true,\n }\n);" + "code": "" }, "Upsert Row": { "description": "Insert a row, or update it if a conflict is hit on the unique key.", - "code": "// Insert-or-update against a unique constraint.\nupsert(\n // 1) Target table.\n 'users',\n // 2) Conflict target: either a column name with a UNIQUE constraint,\n // or the literal 'ON CONSTRAINT '.\n 'email',\n // 3) Record to write.\n { name: 'Elodie', email: 'elodie@example.org', age: 31 },\n { writeSql: true }\n);" + "code": "" } }, "Search": { "Find Row": { "description": "Look up a single row using a column/value filter.", - "code": "// Fetch a single row's value from a relation.\n// Result is written to state.data.\nfindValue({\n // The column to return (or 'id' / uuid column).\n uuid: 'id',\n // The table or view to query.\n relation: 'users',\n // Equality filter (combined with AND).\n where: { email: $.data.email },\n // Optional operator override per column.\n operator: { email: '=' },\n});" + "code": "" }, "Find Row via Custom Query": { "description": "Locate a row using a custom SQL query you control.", - "code": "// Run an arbitrary SELECT. Results are on state.data.rows.\nsql(\n 'SELECT * FROM users WHERE email = $1 LIMIT 1;',\n {\n values: [$.data.email],\n writeSql: true,\n }\n);" + "code": "" }, "Find Rows via Custom Query": { "description": "Retrieve many rows using a custom SQL query.", - "code": "// Run an arbitrary SELECT returning many rows.\n// Available on state.data.rows.\nsql(\n 'SELECT id, name, email FROM users WHERE created_at > $1 ORDER BY id;',\n {\n values: ['2026-01-01'],\n }\n);" + "code": "" } }, "Schema": { "Describe Table": { "description": "Return the column definitions for a table.", - "code": "// Inspect a table's columns and types.\n// Result is written to state.data.\ndescribeTable('users');" + "code": "" } } } diff --git a/packages/stripe/snippets.json b/packages/stripe/snippets.json index 5254d5a01e..e35f736e64 100644 --- a/packages/stripe/snippets.json +++ b/packages/stripe/snippets.json @@ -2,41 +2,41 @@ "Customers": { "Find Customer": { "description": "Look up a customer by their Stripe ID, or list customers matched by email.", - "code": "// Look up a specific customer by ID.\n// state.data will hold the customer object.\nget('customers', $.data.customerId);\n\n// Or — search by email by listing with a filter.\n// list('customers', { email: 'jane@example.org', limit: 1 });" + "code": "" } }, "Charges": { "Find Charge": { "description": "Retrieve an existing charge by its Stripe ID.", - "code": "// Fetch a single charge.\nget('charges', $.data.chargeId);" + "code": "" } }, "Payments": { "Find Payment": { "description": "Retrieve an existing payment intent by its Stripe ID.", - "code": "// Fetch a single payment intent.\nget('payment_intents', $.data.paymentIntentId);" + "code": "" } }, "Invoices": { "Find Invoice": { "description": "Retrieve an existing invoice by its Stripe ID.", - "code": "// Fetch a single invoice.\nget('invoices', $.data.invoiceId);" + "code": "" } }, "Subscriptions": { "Find Subscription": { "description": "Retrieve a subscription by ID, or list a customer's subscriptions.", - "code": "// Look up by subscription ID.\nget('subscriptions', $.data.subscriptionId);\n\n// Or — list every subscription for a given customer.\n// list('subscriptions', { customer: $.data.customerId, status: 'active' });" + "code": "" } }, "Balance": { "Find Account Balance": { "description": "Retrieve the current Stripe account balance.", - "code": "// Get the available/pending balance for the connected account.\nget('balance', '');" + "code": "" }, "Find Balance Transactions": { "description": "List the transactions that have affected the account balance.", - "code": "// List recent balance transactions.\nlist('balance_transactions', {\n // Page size (max 100).\n limit: 25,\n});" + "code": "" } } } diff --git a/packages/twilio/snippets.json b/packages/twilio/snippets.json index 2bd12098d4..1b0a2463e2 100644 --- a/packages/twilio/snippets.json +++ b/packages/twilio/snippets.json @@ -2,7 +2,7 @@ "Messaging": { "Send SMS": { "description": "Send a text message to a phone number through your Twilio account.", - "code": "// Send a single SMS via Twilio.\n// state.references is populated with Twilio's API response.\nsendSMS({\n // 1) Message body (max 1600 chars, billed per 160-char segment).\n body: `Hi ${$.data.name}, your appointment is confirmed.`,\n // 2) Your Twilio sending number, in E.164 format (e.g. +14155551212).\n from: $.configuration.fromNumber,\n // 3) Recipient, in E.164 format.\n to: $.data.phone,\n});" + "code": "" } } } From bf6f49ad2f207167de4fa12709ba3b9ff1c76e4d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 16:34:58 +0000 Subject: [PATCH 4/8] Use Zapier's exact section headings (CREATE / SEARCH) Flattens chatgpt's Text/Vision/Conversation buckets into the single CREATE section Zapier exposes (all chatgpt actions are CREATE; no SEARCH items overlap with the adaptor yet). Renames gmail's Create/Search to CREATE/SEARCH to match Zapier's exact casing. https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/chatgpt/snippets.json | 10 +++------- packages/gmail/snippets.json | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/chatgpt/snippets.json b/packages/chatgpt/snippets.json index 0d8adf8f91..2e5ba4a9f9 100644 --- a/packages/chatgpt/snippets.json +++ b/packages/chatgpt/snippets.json @@ -1,5 +1,5 @@ { - "Text": { + "CREATE": { "Analyze Text": { "description": "Summarize, classify, or otherwise analyze a block of text.", "code": "// Ask the model to analyze a block of text.\n// The chat completion is written to state.data.\nprompt(\n `Analyze the following text and return the key themes, tone and any action items.\\n\\nTEXT:\\n${JSON.stringify($.data.text)}`,\n {\n // Pick a chat-completions capable model.\n model: 'gpt-4o-mini',\n // Keep output deterministic for analysis tasks.\n temperature: 0.2,\n }\n);" @@ -27,15 +27,11 @@ "Send Prompt": { "description": "Send an open-ended prompt to OpenAI and capture the reply.", "code": "// Free-form prompt. Reply is on state.data.\nprompt(\n `What are three risks to watch for in the following plan?\\n\\n${$.data.plan}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.5,\n }\n);" - } - }, - "Vision": { + }, "Analyze Image Content With Vision (Legacy)": { "description": "Send an image and a question about it to a vision-capable model.", "code": "// Ask a question about an image (URL or base64 data URI).\n// Override `messages` to attach an image part alongside the text.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: 'Describe what is happening in this image.' },\n { type: 'image_url', image_url: { url: $.data.imageUrl } },\n ],\n },\n ],\n});" - } - }, - "Conversation": { + }, "Conversation (Legacy)": { "description": "Send a multi-turn chat to OpenAI, optionally preserving prior turns.", "code": "// Multi-turn chat. Provide the full message history via `messages`.\n// `prompt`'s first arg is ignored here because we override `messages`.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n { role: 'system', content: 'You are a concise assistant.' },\n ...($.state.history || []),\n { role: 'user', content: $.data.userMessage },\n ],\n temperature: 0.5,\n});" diff --git a/packages/gmail/snippets.json b/packages/gmail/snippets.json index 4357897b56..db5dba39ed 100644 --- a/packages/gmail/snippets.json +++ b/packages/gmail/snippets.json @@ -1,5 +1,5 @@ { - "Create": { + "CREATE": { "Send Email": { "description": "Compose and dispatch a new email message from your Gmail account.", "code": "// Send a new email through Gmail.\n// Pass a single message object, or an array to send several in one step.\nsendMessage({\n // 1) Recipient address (or an array of addresses).\n to: 'recipient@example.org',\n // 2) Subject line.\n subject: 'Hello from OpenFn',\n // 3) Message body. Plain text by default; pass html: true for HTML.\n body: `Hi there,\\n\\nThis email was sent from an OpenFn workflow.`,\n // 4) Optional CC / BCC.\n // cc: 'cc@example.org',\n // bcc: 'bcc@example.org',\n // 5) Optional file attachments.\n // attachments: [{ filename: 'report.csv', content: $.csv }],\n});" @@ -41,7 +41,7 @@ "code": "" } }, - "Search": { + "SEARCH": { "Find Email": { "description": "Locate one or more email messages that match a Gmail search query.", "code": "// Find emails matching a Gmail search query.\n// Results land on state.data as an array of message contents.\ngetContentsFromMessages({\n // 1) Standard Gmail search syntax (from:, subject:, after:, has:attachment, ...).\n query: 'from:billing@example.org subject:invoice after:2026/01/01',\n // 2) Which fields to pull back per message.\n contents: ['from', 'date', 'subject', 'body'],\n // 3) Cap the number of messages returned.\n maxResults: 25,\n});" From 08739579ddf67bbb8457604dc72b968812d707fb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 16:47:56 +0000 Subject: [PATCH 5/8] Load verbatim Zapier action catalogue for 8 adaptors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces each adaptor's snippets.json with the full Zapier action list verbatim — section headings (CREATE / SEARCH), action titles and descriptions are copied as-is. Code fields are empty placeholders to be populated later. Counts: chatgpt 26, claude 6, gemini 9, gmail 12, googlesheets 28, postgresql 5, stripe 21, twilio 4. https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/chatgpt/snippets.json | 118 ++++++++++++++++++++++------ packages/claude/snippets.json | 26 +++++- packages/gemini/snippets.json | 36 ++++++++- packages/gmail/snippets.json | 40 +++++----- packages/googlesheets/snippets.json | 108 +++++++++++++++++++++++-- packages/postgresql/snippets.json | 30 ++----- packages/stripe/snippets.json | 100 +++++++++++++++++------ packages/twilio/snippets.json | 16 +++- 8 files changed, 366 insertions(+), 108 deletions(-) diff --git a/packages/chatgpt/snippets.json b/packages/chatgpt/snippets.json index 2e5ba4a9f9..b813dca1d2 100644 --- a/packages/chatgpt/snippets.json +++ b/packages/chatgpt/snippets.json @@ -1,44 +1,110 @@ { "CREATE": { + "Analyze Image Content With Vision (Legacy)": { + "description": "Upload an image and send a message or question about it. Powered by Chat Completions API.", + "code": "" + }, + "Analyze Images": { + "description": "(Recommended) Upload an image(s) and send a message or question about it. Powered by Responses API.", + "code": "" + }, "Analyze Text": { - "description": "Summarize, classify, or otherwise analyze a block of text.", - "code": "// Ask the model to analyze a block of text.\n// The chat completion is written to state.data.\nprompt(\n `Analyze the following text and return the key themes, tone and any action items.\\n\\nTEXT:\\n${JSON.stringify($.data.text)}`,\n {\n // Pick a chat-completions capable model.\n model: 'gpt-4o-mini',\n // Keep output deterministic for analysis tasks.\n temperature: 0.2,\n }\n);" + "description": "(Recommended) Summarize, classify, and analyze text. Powered by Responses API.", + "code": "" }, - "Summarize Text (Legacy)": { - "description": "Condense a block of text into a short summary.", - "code": "// Summarize a chunk of text.\nprompt(\n `Summarize the text below in 3 short bullet points.\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.2,\n }\n);" + "Analyze Text Sentiment (Legacy)": { + "description": "Generate an analysis of the overall sentiment of a block of text. Powered by Chat Completions API.", + "code": "" + }, + "Check Moderations": { + "description": "Classifies if text is potentially harmful.", + "code": "" }, "Classify Text (Legacy)": { - "description": "Assign a piece of text to one of the categories you supply.", - "code": "// Classify text into one of the supplied categories.\nconst categories = ['billing', 'support', 'sales', 'other'];\n\nprompt(\n `Pick the single best category for the message below. Reply with the\\ncategory string only, nothing else.\\n\\nCATEGORIES: ${categories.join(', ')}\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n }\n);" + "description": "Classify your text into one of your provided categories. Powered by Chat Completions API.", + "code": "" }, - "Analyze Text Sentiment (Legacy)": { - "description": "Score the overall sentiment of a block of text.", - "code": "// Return a sentiment label + score for a block of text.\nprompt(\n `Rate the sentiment of the text below. Reply as JSON:\\n{ \"label\": \"positive\" | \"neutral\" | \"negative\", \"score\": number between -1 and 1 }\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n // Force the model to emit valid JSON.\n response_format: { type: 'json_object' },\n }\n);" + "Conversation": { + "description": "(Recommended) Send a chat to OpenAI, optionally storing messages for continuous conversation. This enhanced action can also help with web search, file search, and advanced tooling such as MCP. Powered by Responses API.", + "code": "" + }, + "Conversation (Legacy)": { + "description": "Sends a Chat to OpenAI and generates a Completion, optionally storing messages as we do. Powered by Chat Completions API.", + "code": "" + }, + "Convert Text to Speech": { + "description": "Converts a given text to speech.", + "code": "" + }, + "Create Embedding": { + "description": "Generate vector embeddings for text input.", + "code": "" + }, + "Create Image Edit": { + "description": "Creates a new image by editing an existing image with a prompt.", + "code": "" + }, + "Create Transcription": { + "description": "Creates a new transcription, using Whisper, from an audio or video file.", + "code": "" + }, + "Create Translation": { + "description": "Creates a new translation.", + "code": "" + }, + "Create Video": { + "description": "Create a new video generation job using Sora. Returns a video job ID that can be used to check the render status.", + "code": "" }, "Extract Structured Data": { - "description": "Pull structured fields out of unstructured text using a JSON schema.", - "code": "// Extract structured fields from unstructured text.\n// The model is constrained to a JSON schema; result lands on state.data.\nprompt(\n `Extract the contact details from the message below.\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n response_format: {\n type: 'json_schema',\n json_schema: {\n name: 'contact',\n schema: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n email: { type: 'string' },\n phone: { type: 'string' },\n },\n required: ['name'],\n additionalProperties: false,\n },\n },\n },\n }\n);" + "description": "(Recommended) Improved structured data extraction with better formatting options and more reliable schema adherence. Powered by Responses API.", + "code": "" }, - "Write an Email": { - "description": "Draft an email body from a prompt, ready for a follow-up send step.", - "code": "// Draft an email body for use in a later send step.\nprompt(\n `Write a friendly email to ${$.data.recipientName} confirming their\\nappointment on ${$.data.appointmentDate}. Sign it from \\\"OpenFn Team\\\".`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.7,\n }\n);" + "Extract Structured Data (Legacy)": { + "description": "Sends unstructured text and returns structured data using OpenAI's \"Function Calling\" capability. Powered by Chat Completions API.", + "code": "" + }, + "Generate An Image": { + "description": "Generates an image using a relevant OpenAI model.", + "code": "" }, "Send Prompt": { - "description": "Send an open-ended prompt to OpenAI and capture the reply.", - "code": "// Free-form prompt. Reply is on state.data.\nprompt(\n `What are three risks to watch for in the following plan?\\n\\n${$.data.plan}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.5,\n }\n);" + "description": "Sends a prompt to OpenAI and generates a completion. Note: this uses the legacy OpenAI Completions API. We recommend using Conversation or Conversation With Assistant actions instead, which are powered by the latest OpenAI APIs.", + "code": "" }, - "Analyze Image Content With Vision (Legacy)": { - "description": "Send an image and a question about it to a vision-capable model.", - "code": "// Ask a question about an image (URL or base64 data URI).\n// Override `messages` to attach an image part alongside the text.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: 'Describe what is happening in this image.' },\n { type: 'image_url', image_url: { url: $.data.imageUrl } },\n ],\n },\n ],\n});" + "Summarize Text (Legacy)": { + "description": "Enter a block of text and generate a summary. Powered by Chat Completions API.", + "code": "" }, - "Conversation (Legacy)": { - "description": "Send a multi-turn chat to OpenAI, optionally preserving prior turns.", - "code": "// Multi-turn chat. Provide the full message history via `messages`.\n// `prompt`'s first arg is ignored here because we override `messages`.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n { role: 'system', content: 'You are a concise assistant.' },\n ...($.state.history || []),\n { role: 'user', content: $.data.userMessage },\n ],\n temperature: 0.5,\n});" + "Write an Email": { + "description": "Writes the content of an email based on your provided prompt for use in a subsequent step.", + "code": "" }, - "Conversation": { - "description": "Send a chat turn using the Responses API, with optional tool use such as web search.", - "code": "// Use the Responses API (via deepResearch) for tool-aware chat.\n// Default tool is web_search_preview; pass your own `tools` to override.\ndeepResearch(\n `User question: ${$.data.userMessage}\\n\\nAnswer concisely.`,\n {\n model: 'gpt-4o',\n tools: [{ type: 'web_search_preview' }],\n }\n);" + "API Request (Beta)": { + "description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.", + "code": "" + } + }, + "SEARCH": { + "Find Conversation": { + "description": "Find a conversation for native OpenAI conversation management.", + "code": "" + }, + "Find File": { + "description": "Finds a file by filename. Optionally, create a file if none are found.", + "code": "" + }, + "Find Response": { + "description": "Find a stored Responses API result by response ID for audit trails and debugging.", + "code": "" + }, + "Get Video": { + "description": "Retrieve the status and details of a video generation job created with Sora. Use this to check if a video is ready for download.", + "code": "" + }, + "Search Embeddings": { + "description": "This best matches a query string (like \"big animal\") to a list of document strings (like \"mouse\", \"cat\", \"buffalo\", and \"blue whale\").", + "code": "" } } } diff --git a/packages/claude/snippets.json b/packages/claude/snippets.json index e0bc872b10..290d7e8786 100644 --- a/packages/claude/snippets.json +++ b/packages/claude/snippets.json @@ -1,7 +1,29 @@ { - "Messages": { + "CREATE": { + "Delete File": { + "description": "Delete a file from Anthropic", + "code": "" + }, + "Download File": { + "description": "Download file content from Anthropic", + "code": "" + }, "Send Message": { - "description": "Send a prompt to Claude and capture the model's reply on state.", + "description": "Sends a message to Claude and the model generates the next message in the conversation, storing the messages as you go.", + "code": "" + }, + "Upload File": { + "description": "Upload a file to Anthropic", + "code": "" + } + }, + "SEARCH": { + "Get File Metadata": { + "description": "Get metadata for a specific file", + "code": "" + }, + "List Files": { + "description": "List all files uploaded to Anthropic", "code": "" } } diff --git a/packages/gemini/snippets.json b/packages/gemini/snippets.json index 978f3f02f2..e86a94993f 100644 --- a/packages/gemini/snippets.json +++ b/packages/gemini/snippets.json @@ -1,7 +1,39 @@ { - "Messages": { + "CREATE": { + "Conversation": { + "description": "Sends a chat message, optionally storing messages as you go.", + "code": "" + }, + "Generate Audio": { + "description": "Generate audio from text using Gemini text-to-speech models. Useful for voice responses and audio prompts.", + "code": "" + }, + "Generate Image": { + "description": "Generate an image from a text prompt using Gemini or Imagen models.", + "code": "" + }, + "Generate Video": { + "description": "Generate a video from a text prompt using Veo models.", + "code": "" + }, "Send Prompt": { - "description": "Send a prompt to a Gemini model and capture the generated response.", + "description": "Sends a prompt and generates a response.", + "code": "" + }, + "Understand Audio": { + "description": "Generate a text response from an audio clip using Gemini models. Useful for summaries, transcripts, and questions about the audio.", + "code": "" + }, + "Understand Document": { + "description": "Generate a text response from a document using Gemini models. Useful for summaries, key points, and questions about the document.", + "code": "" + }, + "Understand Video": { + "description": "Generate a text response from a video using Gemini models. Useful for summaries, key events, and Q&A about the video.", + "code": "" + }, + "Understand YouTube Video": { + "description": "Generate a text response from a YouTube video using Gemini models. Useful for summaries, key moments, and questions about the video.", "code": "" } } diff --git a/packages/gmail/snippets.json b/packages/gmail/snippets.json index db5dba39ed..171ce51b16 100644 --- a/packages/gmail/snippets.json +++ b/packages/gmail/snippets.json @@ -1,53 +1,53 @@ { "CREATE": { - "Send Email": { - "description": "Compose and dispatch a new email message from your Gmail account.", - "code": "// Send a new email through Gmail.\n// Pass a single message object, or an array to send several in one step.\nsendMessage({\n // 1) Recipient address (or an array of addresses).\n to: 'recipient@example.org',\n // 2) Subject line.\n subject: 'Hello from OpenFn',\n // 3) Message body. Plain text by default; pass html: true for HTML.\n body: `Hi there,\\n\\nThis email was sent from an OpenFn workflow.`,\n // 4) Optional CC / BCC.\n // cc: 'cc@example.org',\n // bcc: 'bcc@example.org',\n // 5) Optional file attachments.\n // attachments: [{ filename: 'report.csv', content: $.csv }],\n});" + "Add Label to Email": { + "description": "Add a label to an email message.", + "code": "" }, - "Reply to Email": { - "description": "Send a reply on an existing email thread.", + "Archive Email": { + "description": "Archive an email message.", "code": "" }, "Create Draft": { - "description": "Save a draft email without sending it.", + "description": "Create a draft email message.", "code": "" }, "Create Draft Reply": { - "description": "Save a draft reply on an existing email thread.", + "description": "Create a draft reply to an existing email.", "code": "" }, - "Archive Email": { - "description": "Move an email out of the inbox into the archive.", + "Create Label": { + "description": "Creates a new label.", "code": "" }, "Delete Email": { - "description": "Move an email message to the trash.", + "description": "Sends an email message to the trash.", "code": "" }, - "Add Label to Email": { - "description": "Apply an existing label to a specific email message.", + "Remove Label From Conversation": { + "description": "Remove a specified label from all emails within a conversation.", "code": "" }, "Remove Label From Email": { - "description": "Remove a label from a specific email message.", + "description": "Remove a label from an email message.", "code": "" }, - "Remove Label From Conversation": { - "description": "Remove a label from every email in a conversation thread.", + "Reply to Email": { + "description": "Send a reply to an email message.", "code": "" }, - "Create Label": { - "description": "Define a new label that can later be applied to messages.", + "Send Email": { + "description": "Create and send a new email message.", "code": "" } }, "SEARCH": { "Find Email": { - "description": "Locate one or more email messages that match a Gmail search query.", - "code": "// Find emails matching a Gmail search query.\n// Results land on state.data as an array of message contents.\ngetContentsFromMessages({\n // 1) Standard Gmail search syntax (from:, subject:, after:, has:attachment, ...).\n query: 'from:billing@example.org subject:invoice after:2026/01/01',\n // 2) Which fields to pull back per message.\n contents: ['from', 'date', 'subject', 'body'],\n // 3) Cap the number of messages returned.\n maxResults: 25,\n});" + "description": "Finds an email message. Optionally, create an email if none are found.", + "code": "" }, "Get Attachment by Filename": { - "description": "Pull a specific Gmail attachment by its filename.", + "description": "Retrieves a specific Gmail message attachment by Filename.", "code": "" } } diff --git a/packages/googlesheets/snippets.json b/packages/googlesheets/snippets.json index db20a21de5..045bdb6191 100644 --- a/packages/googlesheets/snippets.json +++ b/packages/googlesheets/snippets.json @@ -1,25 +1,117 @@ { - "Rows": { - "Create Spreadsheet Row": { - "description": "Append a new row of values to a sheet.", + "CREATE": { + "Change Sheet Properties": { + "description": "Update Google Sheets properties like frozen rows/columns, sheet position, and visibility settings.", + "code": "" + }, + "Clear Spreadsheet Row(s)": { + "description": "Clears the contents of the selected row(s) while keeping the row(s) intact in the spreadsheet.", + "code": "" + }, + "Copy Range": { + "description": "Copy data from one range to another within a Google Sheets spreadsheet, with options for what to paste (values, formatting, etc.).", + "code": "" + }, + "Copy Worksheet": { + "description": "Creates a new worksheet by copying an existing worksheet.", + "code": "" + }, + "Create Conditional Formatting Rule": { + "description": "Apply conditional formatting to cells in a Google Sheets spreadsheet based on their values.", "code": "" }, "Create Multiple Spreadsheet Rows": { - "description": "Append several rows of values at once.", + "description": "Create one or more new rows in a specific spreadsheet (with line item support).", + "code": "" + }, + "Create Spreadsheet": { + "description": "Creates a new spreadsheet. Choose from a blank spreadsheet, a copy of an existing one, or one with headers.", + "code": "" + }, + "Create Spreadsheet Column": { + "description": "Create a new column in a specific spreadsheet.", + "code": "" + }, + "Create Spreadsheet Row": { + "description": "Create a new row in a specific spreadsheet.", + "code": "" + }, + "Create Spreadsheet Row at Top": { + "description": "Creates a new spreadsheet row at the top of a spreadsheet (after the header row).", + "code": "" + }, + "Create Worksheet": { + "description": "Creates a new worksheet in a Google Sheet.", + "code": "" + }, + "Delete Sheet": { + "description": "Permanently delete a worksheet from a Google Sheets spreadsheet. Warning: This action cannot be undone.", + "code": "" + }, + "Delete Spreadsheet Row(s)": { + "description": "Deletes the selected row(s) from the spreadsheet. This action removes the row(s) and all associated data.", + "code": "" + }, + "Format Cell Range": { + "description": "Apply date, number, or style formatting (colors, bold, italic, strikethrough) to a range of cells in a Google Sheets spreadsheet.", + "code": "" + }, + "Format Spreadsheet Row": { + "description": "Format a row in a specific spreadsheet.", + "code": "" + }, + "Rename Sheet": { + "description": "Rename a worksheet in a Google Sheets spreadsheet.", + "code": "" + }, + "Set Data Validation": { + "description": "Set data validation rules on a range of cells in Google Sheets to control what data can be entered.", + "code": "" + }, + "Sort Range": { + "description": "Sort data within a specified range in Google Sheets by a chosen column in ascending or descending order.", "code": "" }, "Update Spreadsheet Row": { - "description": "Overwrite the values of a specific row or range.", + "description": "Update a row in a specific spreadsheet with optional formatting.", + "code": "" + }, + "Update Spreadsheet Row(s)": { + "description": "Update one or more rows in a specific spreadsheet (with line item support).", + "code": "" + }, + "API Request (Beta)": { + "description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.", "code": "" } }, - "Search": { + "SEARCH": { + "Find Worksheet": { + "description": "Finds a worksheet by title. Optionally, create a worksheet if none are found.", + "code": "" + }, "Get Data Range": { - "description": "Read the values from a specific A1-notation range.", + "description": "Get data from a specific range in a Google Spreadsheet using A1 notation (e.g., \"A1:D10\", \"B2:E5\").", + "code": "" + }, + "Get Many Spreadsheet Rows (Advanced)": { + "description": "Return up to 1,500 rows as a single JSON value or as line items.", + "code": "" + }, + "Get Row by ID": { + "description": "Get a specific spreadsheet row by its row number (ID). Row 1 is typically the header row.", + "code": "" + }, + "Get Spreadsheet by ID": { + "description": "Get a specific Google Spreadsheet by its ID. Returns the raw spreadsheet data from the Google Sheets API.", "code": "" }, "Lookup Spreadsheet Row": { - "description": "Find a row whose value in a given column matches a lookup value.", + "description": "Find a specific spreadsheet row based on a column and value. If found, it returns the entire row. Optionally, create a spreadsheet row if none are found.", + "code": "" + }, + "Lookup Spreadsheet Rows (Advanced)": { + "description": "Find up to 500 rows based on a column and value as line items.", "code": "" } } diff --git a/packages/postgresql/snippets.json b/packages/postgresql/snippets.json index 61e95be360..d1249b5b17 100644 --- a/packages/postgresql/snippets.json +++ b/packages/postgresql/snippets.json @@ -1,39 +1,25 @@ { - "Rows": { - "Insert Row": { - "description": "Add a single row to a table.", - "code": "" - }, - "Insert Multiple Rows": { - "description": "Add many rows to a table in a single statement.", + "CREATE": { + "New Row": { + "description": "Adds a new row.", "code": "" }, "Update Row": { - "description": "Modify the values of an existing row matched by a unique column.", - "code": "" - }, - "Upsert Row": { - "description": "Insert a row, or update it if a conflict is hit on the unique key.", + "description": "Updates an existing row.", "code": "" } }, - "Search": { + "SEARCH": { "Find Row": { - "description": "Look up a single row using a column/value filter.", + "description": "Finds a row in a table via a lookup column.", "code": "" }, "Find Row via Custom Query": { - "description": "Locate a row using a custom SQL query you control.", + "description": "Finds a row in a table via a custom query you control.", "code": "" }, "Find Rows via Custom Query": { - "description": "Retrieve many rows using a custom SQL query.", - "code": "" - } - }, - "Schema": { - "Describe Table": { - "description": "Return the column definitions for a table.", + "description": "Finds multiple rows in a table via a custom query you control.", "code": "" } } diff --git a/packages/stripe/snippets.json b/packages/stripe/snippets.json index e35f736e64..837d4b2b7f 100644 --- a/packages/stripe/snippets.json +++ b/packages/stripe/snippets.json @@ -1,41 +1,89 @@ { - "Customers": { - "Find Customer": { - "description": "Look up a customer by their Stripe ID, or list customers matched by email.", + "CREATE": { + "Cancel Subscription": { + "description": "Cancels a subscription.", "code": "" - } - }, - "Charges": { - "Find Charge": { - "description": "Retrieve an existing charge by its Stripe ID.", + }, + "Confirm Payment": { + "description": "Confirms an existing payment, also known as a PaymentIntent.", "code": "" - } - }, - "Payments": { - "Find Payment": { - "description": "Retrieve an existing payment intent by its Stripe ID.", + }, + "Create Checkout Session": { + "description": "Creates a new Checkout Session.", "code": "" - } - }, - "Invoices": { - "Find Invoice": { - "description": "Retrieve an existing invoice by its Stripe ID.", + }, + "Create Customer": { + "description": "Creates a new customer.", "code": "" - } - }, - "Subscriptions": { - "Find Subscription": { - "description": "Retrieve a subscription by ID, or list a customer's subscriptions.", + }, + "Create Invoice": { + "description": "Creates a new invoice.", + "code": "" + }, + "Create Payment": { + "description": "Creates a new payment, also known as a PaymentIntent.", + "code": "" + }, + "Create Payment Link": { + "description": "Creates a payment link.", + "code": "" + }, + "Create Price": { + "description": "Creates a price.", + "code": "" + }, + "Create Product": { + "description": "Creates a new product.", + "code": "" + }, + "Create Subscription": { + "description": "Creates a new subscription.", + "code": "" + }, + "Deactivate Payment Link": { + "description": "Deactivates a payment link.", + "code": "" + }, + "Update Customer": { + "description": "Updates an existing customer.", + "code": "" + }, + "API Request (Beta)": { + "description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.", "code": "" } }, - "Balance": { + "SEARCH": { "Find Account Balance": { - "description": "Retrieve the current Stripe account balance.", + "description": "Finds the account balance for your stripe account", + "code": "" + }, + "Find Account by ID": { + "description": "Finds a Stripe account by its ID.", "code": "" }, "Find Balance Transactions": { - "description": "List the transactions that have affected the account balance.", + "description": "Finds transactions that have contributed to the Stripe account balance, such as charges, transfers, and more.", + "code": "" + }, + "Find Charge": { + "description": "Finds an existing charge by its Stripe ID.", + "code": "" + }, + "Find Customer": { + "description": "Finds an existing customer by their Stripe ID or email address.", + "code": "" + }, + "Find Invoice": { + "description": "Finds an existing invoice by its Stripe ID.", + "code": "" + }, + "Find Payment": { + "description": "Finds an existing payment intent by its Stripe ID.", + "code": "" + }, + "Find Subscription": { + "description": "Finds an existing subscription.", "code": "" } } diff --git a/packages/twilio/snippets.json b/packages/twilio/snippets.json index 1b0a2463e2..fe98a705fc 100644 --- a/packages/twilio/snippets.json +++ b/packages/twilio/snippets.json @@ -1,7 +1,19 @@ { - "Messaging": { + "CREATE": { + "Call Phone": { + "description": "Call a number or numbers and say a message.", + "code": "" + }, "Send SMS": { - "description": "Send a text message to a phone number through your Twilio account.", + "description": "Send a SMS to a number or numbers.", + "code": "" + }, + "Send WhatsApp Message": { + "description": "Send a WhatsApp message to one or more recipients.", + "code": "" + }, + "API Request (Beta)": { + "description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.", "code": "" } } From c702f44d91281409452551f82e6238bafd1b2b94 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 16:55:44 +0000 Subject: [PATCH 6/8] Add code to snippets where adaptor exports support it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For each of the 8 adaptors, fills in the `code` field on every action that maps to an existing adaptor function; actions with no adaptor support keep an empty code string so the UI can render "coming soon". Coverage: - chatgpt 12/26 (prompt, deepResearch) - claude 1/6 (prompt) - gemini 3/9 (prompt, deepResearch, generateImage — multi-turn, Send Prompt, Generate Image) - gmail 2/12 (sendMessage, getContentsFromMessages) - googlesheets 10/28 (appendValues, batchUpdateValues, getValues — row create/update/clear/read/lookup) - postgresql 5/5 (insert, sql, findValue) - stripe 8/21 (get, list — all SEARCH actions covered) - twilio 1/4 (sendSMS) https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/chatgpt/snippets.json | 24 ++++++++++++------------ packages/claude/snippets.json | 2 +- packages/gemini/snippets.json | 6 +++--- packages/gmail/snippets.json | 4 ++-- packages/googlesheets/snippets.json | 20 ++++++++++---------- packages/postgresql/snippets.json | 10 +++++----- packages/stripe/snippets.json | 16 ++++++++-------- packages/twilio/snippets.json | 2 +- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/packages/chatgpt/snippets.json b/packages/chatgpt/snippets.json index b813dca1d2..77f762db68 100644 --- a/packages/chatgpt/snippets.json +++ b/packages/chatgpt/snippets.json @@ -2,19 +2,19 @@ "CREATE": { "Analyze Image Content With Vision (Legacy)": { "description": "Upload an image and send a message or question about it. Powered by Chat Completions API.", - "code": "" + "code": "// Ask a question about an image via Chat Completions.\n// Override `messages` to attach an image part alongside the text.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: 'Describe what is happening in this image.' },\n { type: 'image_url', image_url: { url: $.data.imageUrl } },\n ],\n },\n ],\n});" }, "Analyze Images": { "description": "(Recommended) Upload an image(s) and send a message or question about it. Powered by Responses API.", - "code": "" + "code": "// Analyze an image via the Responses API.\n// Override `input` to attach an image alongside the text prompt.\ndeepResearch(null, {\n model: 'gpt-4o',\n // No web search needed for pure image analysis.\n tools: [],\n input: [\n {\n role: 'user',\n content: [\n { type: 'input_text', text: 'Describe what is happening in this image.' },\n { type: 'input_image', image_url: $.data.imageUrl },\n ],\n },\n ],\n});" }, "Analyze Text": { "description": "(Recommended) Summarize, classify, and analyze text. Powered by Responses API.", - "code": "" + "code": "// Analyze a block of text via the Responses API.\ndeepResearch(\n `Analyze the following text. Return the key themes, tone and any action items.\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o',\n // No web search needed; disable the default tool.\n tools: [],\n }\n);" }, "Analyze Text Sentiment (Legacy)": { "description": "Generate an analysis of the overall sentiment of a block of text. Powered by Chat Completions API.", - "code": "" + "code": "// Return a sentiment label + score for a block of text.\nprompt(\n `Rate the sentiment of the text below. Reply as JSON:\\n{ \"label\": \"positive\" | \"neutral\" | \"negative\", \"score\": number between -1 and 1 }\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n // Force the model to emit valid JSON.\n response_format: { type: 'json_object' },\n }\n);" }, "Check Moderations": { "description": "Classifies if text is potentially harmful.", @@ -22,15 +22,15 @@ }, "Classify Text (Legacy)": { "description": "Classify your text into one of your provided categories. Powered by Chat Completions API.", - "code": "" + "code": "// Classify text into one of the supplied categories.\nconst categories = ['billing', 'support', 'sales', 'other'];\n\nprompt(\n `Pick the single best category for the message below. Reply with the\\ncategory string only, nothing else.\\n\\nCATEGORIES: ${categories.join(', ')}\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n }\n);" }, "Conversation": { "description": "(Recommended) Send a chat to OpenAI, optionally storing messages for continuous conversation. This enhanced action can also help with web search, file search, and advanced tooling such as MCP. Powered by Responses API.", - "code": "" + "code": "// Send a chat turn via the Responses API, with tools enabled.\n// Default tool is web_search_preview; override `tools` to use file_search, MCP, etc.\ndeepResearch(\n $.data.userMessage,\n {\n model: 'gpt-4o',\n tools: [{ type: 'web_search_preview' }],\n }\n);" }, "Conversation (Legacy)": { "description": "Sends a Chat to OpenAI and generates a Completion, optionally storing messages as we do. Powered by Chat Completions API.", - "code": "" + "code": "// Multi-turn chat via Chat Completions. Provide the full message history.\n// `prompt`'s first arg is ignored when `messages` is overridden.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n { role: 'system', content: 'You are a concise assistant.' },\n ...($.state.history || []),\n { role: 'user', content: $.data.userMessage },\n ],\n temperature: 0.5,\n});" }, "Convert Text to Speech": { "description": "Converts a given text to speech.", @@ -58,11 +58,11 @@ }, "Extract Structured Data": { "description": "(Recommended) Improved structured data extraction with better formatting options and more reliable schema adherence. Powered by Responses API.", - "code": "" + "code": "// Extract structured fields via the Responses API, constrained to a JSON schema.\ndeepResearch(\n `Extract the contact details from the message below.\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o',\n tools: [],\n text: {\n format: {\n type: 'json_schema',\n name: 'contact',\n schema: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n email: { type: 'string' },\n phone: { type: 'string' },\n },\n required: ['name'],\n additionalProperties: false,\n },\n },\n },\n }\n);" }, "Extract Structured Data (Legacy)": { "description": "Sends unstructured text and returns structured data using OpenAI's \"Function Calling\" capability. Powered by Chat Completions API.", - "code": "" + "code": "// Extract structured fields from unstructured text via Chat Completions.\n// The model is constrained to a JSON schema; result lands on state.data.\nprompt(\n `Extract the contact details from the message below.\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n response_format: {\n type: 'json_schema',\n json_schema: {\n name: 'contact',\n schema: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n email: { type: 'string' },\n phone: { type: 'string' },\n },\n required: ['name'],\n additionalProperties: false,\n },\n },\n },\n }\n);" }, "Generate An Image": { "description": "Generates an image using a relevant OpenAI model.", @@ -70,15 +70,15 @@ }, "Send Prompt": { "description": "Sends a prompt to OpenAI and generates a completion. Note: this uses the legacy OpenAI Completions API. We recommend using Conversation or Conversation With Assistant actions instead, which are powered by the latest OpenAI APIs.", - "code": "" + "code": "// Send a free-form prompt. Note: this adaptor calls Chat Completions under\n// the hood, not the legacy text-completions endpoint.\nprompt(\n `What are three risks to watch for in the following plan?\\n\\n${$.data.plan}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.5,\n }\n);" }, "Summarize Text (Legacy)": { "description": "Enter a block of text and generate a summary. Powered by Chat Completions API.", - "code": "" + "code": "// Summarize a chunk of text.\nprompt(\n `Summarize the text below in 3 short bullet points.\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.2,\n }\n);" }, "Write an Email": { "description": "Writes the content of an email based on your provided prompt for use in a subsequent step.", - "code": "" + "code": "// Draft an email body for use in a later send step.\nprompt(\n `Write a friendly email to ${$.data.recipientName} confirming their\\nappointment on ${$.data.appointmentDate}. Sign it from \\\"OpenFn Team\\\".`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.7,\n }\n);" }, "API Request (Beta)": { "description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.", diff --git a/packages/claude/snippets.json b/packages/claude/snippets.json index 290d7e8786..24535f5e50 100644 --- a/packages/claude/snippets.json +++ b/packages/claude/snippets.json @@ -10,7 +10,7 @@ }, "Send Message": { "description": "Sends a message to Claude and the model generates the next message in the conversation, storing the messages as you go.", - "code": "" + "code": "// Send a prompt to Claude.\n// The model's reply is written to state.data.\nprompt(\n // 1) The message text. Reference upstream state with $.\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // 2) Model id. Defaults to the latest Sonnet if omitted.\n model: 'claude-sonnet-4-6',\n // 3) Maximum tokens to generate in the reply.\n max_tokens: 1024,\n // 4) 0.0 = analytical / deterministic, 1.0 = creative.\n temperature: 0.7,\n }\n);" }, "Upload File": { "description": "Upload a file to Anthropic", diff --git a/packages/gemini/snippets.json b/packages/gemini/snippets.json index e86a94993f..fb2bdbeb31 100644 --- a/packages/gemini/snippets.json +++ b/packages/gemini/snippets.json @@ -2,7 +2,7 @@ "CREATE": { "Conversation": { "description": "Sends a chat message, optionally storing messages as you go.", - "code": "" + "code": "// Multi-turn chat. Pass an array of Content objects as the first argument;\n// the adaptor forwards it as `contents` to generateContent.\nprompt(\n [\n { role: 'user', parts: [{ text: 'Hi there!' }] },\n { role: 'model', parts: [{ text: 'Hello — how can I help?' }] },\n { role: 'user', parts: [{ text: $.data.userMessage }] },\n ],\n {\n model: 'gemini-2.5-flash',\n }\n);" }, "Generate Audio": { "description": "Generate audio from text using Gemini text-to-speech models. Useful for voice responses and audio prompts.", @@ -10,7 +10,7 @@ }, "Generate Image": { "description": "Generate an image from a text prompt using Gemini or Imagen models.", - "code": "" + "code": "// Generate an image from a text prompt.\n// The base64-encoded image is written to state.\ngenerateImage(\n `A flat-design illustration of: ${$.data.subject}`,\n {\n // Image-capable model — defaults to gemini-3-pro-image-preview.\n model: 'gemini-3-pro-image-preview',\n // Output size hint (e.g. '1K', '2K').\n imageSize: '1K',\n // Aspect ratio: '1:1', '16:9', '9:16', '4:3', '3:4'.\n aspectRatio: '16:9',\n }\n);" }, "Generate Video": { "description": "Generate a video from a text prompt using Veo models.", @@ -18,7 +18,7 @@ }, "Send Prompt": { "description": "Sends a prompt and generates a response.", - "code": "" + "code": "// Send a prompt to Gemini.\n// The text reply is written to state.data.response.\nprompt(\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // Gemini model id (see https://ai.google.dev/gemini-api/docs/models).\n model: 'gemini-2.5-flash',\n config: {\n temperature: 0.7,\n },\n }\n);" }, "Understand Audio": { "description": "Generate a text response from an audio clip using Gemini models. Useful for summaries, transcripts, and questions about the audio.", diff --git a/packages/gmail/snippets.json b/packages/gmail/snippets.json index 171ce51b16..d18040f2d6 100644 --- a/packages/gmail/snippets.json +++ b/packages/gmail/snippets.json @@ -38,13 +38,13 @@ }, "Send Email": { "description": "Create and send a new email message.", - "code": "" + "code": "// Send a new email through Gmail.\n// Pass a single message object, or an array to send several in one step.\nsendMessage({\n // Recipient address (or an array of addresses).\n to: 'recipient@example.org',\n // Subject line.\n subject: 'Hello from OpenFn',\n // Message body. Plain text by default; pass html: true for HTML.\n body: `Hi there,\\n\\nThis email was sent from an OpenFn workflow.`,\n // Optional CC / BCC.\n // cc: 'cc@example.org',\n // bcc: 'bcc@example.org',\n // Optional file attachments.\n // attachments: [{ filename: 'report.csv', content: $.csv }],\n});" } }, "SEARCH": { "Find Email": { "description": "Finds an email message. Optionally, create an email if none are found.", - "code": "" + "code": "// Find emails matching a Gmail search query.\n// Results land on state.data as an array of message contents.\ngetContentsFromMessages({\n // Standard Gmail search syntax (from:, subject:, after:, has:attachment, ...).\n query: 'from:billing@example.org subject:invoice after:2026/01/01',\n // Which fields to pull back per message.\n contents: ['from', 'date', 'subject', 'body'],\n // Cap the number of messages returned.\n maxResults: 25,\n});" }, "Get Attachment by Filename": { "description": "Retrieves a specific Gmail message attachment by Filename.", diff --git a/packages/googlesheets/snippets.json b/packages/googlesheets/snippets.json index 045bdb6191..6367c6e6bc 100644 --- a/packages/googlesheets/snippets.json +++ b/packages/googlesheets/snippets.json @@ -6,7 +6,7 @@ }, "Clear Spreadsheet Row(s)": { "description": "Clears the contents of the selected row(s) while keeping the row(s) intact in the spreadsheet.", - "code": "" + "code": "// Clear cell contents in a row (or rows) by writing empty strings.\n// The row(s) themselves stay in place; only the values are wiped.\nbatchUpdateValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n valueInputOption: 'USER_ENTERED',\n data: [\n {\n // A1 range covering the row(s) to clear.\n range: 'Sheet1!A5:Z5',\n // One inner array per row, sized to the range.\n values: [Array(26).fill('')],\n },\n ],\n});" }, "Copy Range": { "description": "Copy data from one range to another within a Google Sheets spreadsheet, with options for what to paste (values, formatting, etc.).", @@ -22,7 +22,7 @@ }, "Create Multiple Spreadsheet Rows": { "description": "Create one or more new rows in a specific spreadsheet (with line item support).", - "code": "" + "code": "// Append many rows in one call.\n// Each inner array is one row; cells must line up with your columns.\nappendValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n range: 'Sheet1!A1:D1',\n values: $.data.records.map(r => [r.name, r.email, r.amount, r.date]),\n});" }, "Create Spreadsheet": { "description": "Creates a new spreadsheet. Choose from a blank spreadsheet, a copy of an existing one, or one with headers.", @@ -34,7 +34,7 @@ }, "Create Spreadsheet Row": { "description": "Create a new row in a specific spreadsheet.", - "code": "" + "code": "// Append a single row to the bottom of a sheet.\nappendValues({\n // Spreadsheet ID — the long string from the sheet's URL.\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // Where to append. Sheet name + column range.\n range: 'Sheet1!A1:D1',\n // Outer array = rows, inner arrays = cells in column order.\n values: [\n [$.data.name, $.data.email, $.data.amount, $.data.date],\n ],\n});" }, "Create Spreadsheet Row at Top": { "description": "Creates a new spreadsheet row at the top of a spreadsheet (after the header row).", @@ -74,11 +74,11 @@ }, "Update Spreadsheet Row": { "description": "Update a row in a specific spreadsheet with optional formatting.", - "code": "" + "code": "// Overwrite the values of a single row.\nbatchUpdateValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // Parse cell input like a user typed it (formulas, dates, etc.).\n valueInputOption: 'USER_ENTERED',\n data: [\n {\n range: 'Sheet1!A5:D5',\n values: [[$.data.name, $.data.email, $.data.amount, $.data.date]],\n },\n ],\n});" }, "Update Spreadsheet Row(s)": { "description": "Update one or more rows in a specific spreadsheet (with line item support).", - "code": "" + "code": "// Overwrite multiple ranges in one batch.\nbatchUpdateValues({\n spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n valueInputOption: 'USER_ENTERED',\n data: $.data.updates.map(u => ({\n range: u.range,\n values: [u.row],\n })),\n});" }, "API Request (Beta)": { "description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.", @@ -92,15 +92,15 @@ }, "Get Data Range": { "description": "Get data from a specific range in a Google Spreadsheet using A1 notation (e.g., \"A1:D10\", \"B2:E5\").", - "code": "" + "code": "// Read values from an A1 range. Result is on state.data as a 2d array.\ngetValues(\n // Spreadsheet ID.\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // A1 range — sheet name + range.\n 'Sheet1!A1:D100'\n);" }, "Get Many Spreadsheet Rows (Advanced)": { "description": "Return up to 1,500 rows as a single JSON value or as line items.", - "code": "" + "code": "// Pull a wide range and return all rows.\ngetValues(\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // Open-ended range — fetches every populated row in the column span.\n 'Sheet1!A2:Z'\n);" }, "Get Row by ID": { "description": "Get a specific spreadsheet row by its row number (ID). Row 1 is typically the header row.", - "code": "" + "code": "// Fetch a single row by its row number (1-based).\nconst rowId = $.data.rowId;\ngetValues(\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n // Build an A1 range that spans only that row.\n `Sheet1!A${rowId}:Z${rowId}`\n);" }, "Get Spreadsheet by ID": { "description": "Get a specific Google Spreadsheet by its ID. Returns the raw spreadsheet data from the Google Sheets API.", @@ -108,11 +108,11 @@ }, "Lookup Spreadsheet Row": { "description": "Find a specific spreadsheet row based on a column and value. If found, it returns the entire row. Optionally, create a spreadsheet row if none are found.", - "code": "" + "code": "// Read a range, then filter in the callback to find the matching row.\ngetValues(\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n 'Sheet1!A1:D100',\n // Callback receives state with rows on state.data.values.\n state => {\n const [header, ...rows] = state.data.values || [];\n // Match on the second column (index 1).\n state.match = rows.find(r => r[1] === $.data.email);\n return state;\n }\n);" }, "Lookup Spreadsheet Rows (Advanced)": { "description": "Find up to 500 rows based on a column and value as line items.", - "code": "" + "code": "// Read a range, then filter in the callback for all matches.\ngetValues(\n '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',\n 'Sheet1!A1:D500',\n state => {\n const [header, ...rows] = state.data.values || [];\n state.matches = rows.filter(r => r[1] === $.data.email);\n return state;\n }\n);" } } } diff --git a/packages/postgresql/snippets.json b/packages/postgresql/snippets.json index d1249b5b17..3a0a4cc4da 100644 --- a/packages/postgresql/snippets.json +++ b/packages/postgresql/snippets.json @@ -2,25 +2,25 @@ "CREATE": { "New Row": { "description": "Adds a new row.", - "code": "" + "code": "// Insert one row into a table.\n// The new row is returned on state.data.\ninsert(\n // Target table name.\n 'users',\n // The record as a plain object (column => value).\n { name: 'Elodie', email: 'elodie@example.org', age: 31 },\n // Optional settings.\n {\n // Print the generated SQL to the run log (handy while developing).\n writeSql: true,\n // Treat these literal strings in the payload as SQL NULL.\n setNull: [\"''\", \"'undefined'\"],\n }\n);" }, "Update Row": { "description": "Updates an existing row.", - "code": "" + "code": "// Update an existing row using a parameterised SQL statement.\n// $1, $2... are bound from the `values` array (safe against SQL injection).\nsql(\n 'UPDATE users SET email = $1, updated_at = NOW() WHERE id = $2;',\n {\n values: [$.data.email, $.data.id],\n writeSql: true,\n }\n);" } }, "SEARCH": { "Find Row": { "description": "Finds a row in a table via a lookup column.", - "code": "" + "code": "// Fetch a single row's value from a relation.\n// Result is written to state.data.\nfindValue({\n // The column to return (or 'id' / uuid column).\n uuid: 'id',\n // The table or view to query.\n relation: 'users',\n // Equality filter (combined with AND).\n where: { email: $.data.email },\n // Optional operator override per column.\n operator: { email: '=' },\n});" }, "Find Row via Custom Query": { "description": "Finds a row in a table via a custom query you control.", - "code": "" + "code": "// Run an arbitrary SELECT. Results are on state.data.rows.\nsql(\n 'SELECT * FROM users WHERE email = $1 LIMIT 1;',\n {\n values: [$.data.email],\n writeSql: true,\n }\n);" }, "Find Rows via Custom Query": { "description": "Finds multiple rows in a table via a custom query you control.", - "code": "" + "code": "// Run an arbitrary SELECT returning many rows.\nsql(\n 'SELECT id, name, email FROM users WHERE created_at > $1 ORDER BY id;',\n {\n values: ['2026-01-01'],\n }\n);" } } } diff --git a/packages/stripe/snippets.json b/packages/stripe/snippets.json index 837d4b2b7f..51a0b54c5b 100644 --- a/packages/stripe/snippets.json +++ b/packages/stripe/snippets.json @@ -56,35 +56,35 @@ "SEARCH": { "Find Account Balance": { "description": "Finds the account balance for your stripe account", - "code": "" + "code": "// Retrieve the current balance for the connected Stripe account.\nget('balance', '');" }, "Find Account by ID": { "description": "Finds a Stripe account by its ID.", - "code": "" + "code": "// Retrieve a connected account by its acct_* ID.\nget('accounts', $.data.accountId);" }, "Find Balance Transactions": { "description": "Finds transactions that have contributed to the Stripe account balance, such as charges, transfers, and more.", - "code": "" + "code": "// List recent balance transactions.\nlist('balance_transactions', {\n // Page size (max 100).\n limit: 25,\n});" }, "Find Charge": { "description": "Finds an existing charge by its Stripe ID.", - "code": "" + "code": "// Fetch a single charge by its ch_* ID.\nget('charges', $.data.chargeId);" }, "Find Customer": { "description": "Finds an existing customer by their Stripe ID or email address.", - "code": "" + "code": "// Look up by customer ID.\nget('customers', $.data.customerId);\n\n// Or — find by email by listing with a filter.\n// list('customers', { email: $.data.email, limit: 1 });" }, "Find Invoice": { "description": "Finds an existing invoice by its Stripe ID.", - "code": "" + "code": "// Fetch a single invoice by its in_* ID.\nget('invoices', $.data.invoiceId);" }, "Find Payment": { "description": "Finds an existing payment intent by its Stripe ID.", - "code": "" + "code": "// Fetch a single payment intent by its pi_* ID.\nget('payment_intents', $.data.paymentIntentId);" }, "Find Subscription": { "description": "Finds an existing subscription.", - "code": "" + "code": "// Look up by subscription ID.\nget('subscriptions', $.data.subscriptionId);\n\n// Or — list every subscription for a given customer.\n// list('subscriptions', { customer: $.data.customerId, status: 'active' });" } } } diff --git a/packages/twilio/snippets.json b/packages/twilio/snippets.json index fe98a705fc..3c713842d9 100644 --- a/packages/twilio/snippets.json +++ b/packages/twilio/snippets.json @@ -6,7 +6,7 @@ }, "Send SMS": { "description": "Send a SMS to a number or numbers.", - "code": "" + "code": "// Send an SMS via Twilio.\n// state.references is populated with Twilio's API response.\nsendSMS({\n // Message body (max 1600 chars, billed per 160-char segment).\n body: `Hi ${$.data.name}, your appointment is confirmed.`,\n // Your Twilio sending number, in E.164 format (e.g. +14155551212).\n from: $.configuration.fromNumber,\n // Recipient, in E.164 format.\n to: $.data.phone,\n});" }, "Send WhatsApp Message": { "description": "Send a WhatsApp message to one or more recipients.", From 2afef23bbea07bf4c2dc8082bfe0d23fcda3e20b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 17:24:13 +0000 Subject: [PATCH 7/8] Add verbatim snippets.json for 19 more adaptors Extends snippets coverage from 8 to 27 adaptors. New files mirror the Zapier action catalogue verbatim (section headings CREATE / SEARCH, action titles and descriptions copied as-is) with empty code fields. Skipped: msgraph (split across Outlook/Excel/SharePoint/Teams/OneDrive in Zapier), redis (no native Zapier integration), vtiger (no actions enumerated). New files: asana (15), bigquery (3), dynamics (24), facebook (5), flutterwave (5), googledrive (20), http (4), intuit (12), mailchimp (19), mailgun (6), mongodb (1), mssql (5), mysql (4), nexmo (2), odoo (5), salesforce (15), sftp (2), whatsapp (3), zoho (7). https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/asana/snippets.json | 66 +++++++++++++++++++ packages/bigquery/snippets.json | 18 +++++ packages/dynamics/snippets.json | 102 +++++++++++++++++++++++++++++ packages/facebook/snippets.json | 24 +++++++ packages/flutterwave/snippets.json | 26 ++++++++ packages/googledrive/snippets.json | 86 ++++++++++++++++++++++++ packages/http/snippets.json | 22 +++++++ packages/intuit/snippets.json | 54 +++++++++++++++ packages/mailchimp/snippets.json | 82 +++++++++++++++++++++++ packages/mailgun/snippets.json | 28 ++++++++ packages/mongodb/snippets.json | 8 +++ packages/mssql/snippets.json | 26 ++++++++ packages/mysql/snippets.json | 22 +++++++ packages/nexmo/snippets.json | 12 ++++ packages/odoo/snippets.json | 26 ++++++++ packages/salesforce/snippets.json | 66 +++++++++++++++++++ packages/sftp/snippets.json | 14 ++++ packages/whatsapp/snippets.json | 16 +++++ packages/zoho/snippets.json | 34 ++++++++++ 19 files changed, 732 insertions(+) create mode 100644 packages/asana/snippets.json create mode 100644 packages/bigquery/snippets.json create mode 100644 packages/dynamics/snippets.json create mode 100644 packages/facebook/snippets.json create mode 100644 packages/flutterwave/snippets.json create mode 100644 packages/googledrive/snippets.json create mode 100644 packages/http/snippets.json create mode 100644 packages/intuit/snippets.json create mode 100644 packages/mailchimp/snippets.json create mode 100644 packages/mailgun/snippets.json create mode 100644 packages/mongodb/snippets.json create mode 100644 packages/mssql/snippets.json create mode 100644 packages/mysql/snippets.json create mode 100644 packages/nexmo/snippets.json create mode 100644 packages/odoo/snippets.json create mode 100644 packages/salesforce/snippets.json create mode 100644 packages/sftp/snippets.json create mode 100644 packages/whatsapp/snippets.json create mode 100644 packages/zoho/snippets.json diff --git a/packages/asana/snippets.json b/packages/asana/snippets.json new file mode 100644 index 0000000000..08f949a522 --- /dev/null +++ b/packages/asana/snippets.json @@ -0,0 +1,66 @@ +{ + "CREATE": { + "Add Task to Section of Project": { + "description": "Adds a Task to a Section of a Project.", + "code": "" + }, + "Create Comment/Story": { + "description": "Adds a comment or story to a task.", + "code": "" + }, + "Create Duplicate Task": { + "description": "Duplicates an existing task.", + "code": "" + }, + "Create Project": { + "description": "Adds a new project.", + "code": "" + }, + "Create Section": { + "description": "Creates a new section within a project.", + "code": "" + }, + "Create Task": { + "description": "Creates a new task in Asana with specified details.", + "code": "" + }, + "Create Task From Template": { + "description": "Creates a new task in Asana from a selected template.", + "code": "" + }, + "Update Task": { + "description": "Updates multiple properties of an existing Asana task.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Find All Tasks From Project": { + "description": "Searches for all tasks in a specific project with optional filters.", + "code": "" + }, + "Find Project": { + "description": "Finds an existing project.", + "code": "" + }, + "Find Section in Project": { + "description": "Finds an existing section within a workspace project.", + "code": "" + }, + "Find Task Comments": { + "description": "Finds comments for a specific task.", + "code": "" + }, + "Find Tasks in Workspace": { + "description": "Searches for tasks in a workspace using Asana's search API (premium only).", + "code": "" + }, + "Find User": { + "description": "Finds an existing user of your Asana account.", + "code": "" + } + } +} diff --git a/packages/bigquery/snippets.json b/packages/bigquery/snippets.json new file mode 100644 index 0000000000..8c924e3f2d --- /dev/null +++ b/packages/bigquery/snippets.json @@ -0,0 +1,18 @@ +{ + "CREATE": { + "Insert Row": { + "description": "Add a row to a BigQuery table.", + "code": "" + } + }, + "SEARCH": { + "Find Row": { + "description": "Find a specific row in a BigQuery table.", + "code": "" + }, + "Run a Query": { + "description": "Execute a SQL query against your BigQuery dataset.", + "code": "" + } + } +} diff --git a/packages/dynamics/snippets.json b/packages/dynamics/snippets.json new file mode 100644 index 0000000000..4c8e43c298 --- /dev/null +++ b/packages/dynamics/snippets.json @@ -0,0 +1,102 @@ +{ + "CREATE": { + "Create Account": { + "description": "Creates a new account.", + "code": "" + }, + "Create Case/Incident": { + "description": "Creates a new case/incident.", + "code": "" + }, + "Create Contact": { + "description": "Creates a new contact.", + "code": "" + }, + "Create Custom Entity": { + "description": "Creates a new custom entity record.", + "code": "" + }, + "Create Invoice": { + "description": "Creates a new invoice.", + "code": "" + }, + "Create Lead": { + "description": "Creates a new lead.", + "code": "" + }, + "Create Opportunity": { + "description": "Creates a new opportunity.", + "code": "" + }, + "Create Order": { + "description": "Creates a new order.", + "code": "" + }, + "Update Account": { + "description": "Updates an account.", + "code": "" + }, + "Update Contact": { + "description": "Updates a contact.", + "code": "" + }, + "Update Custom Entity": { + "description": "Updates a custom entity.", + "code": "" + }, + "Update Lead": { + "description": "Updates a lead.", + "code": "" + }, + "Update Record": { + "description": "Updates an existing record.", + "code": "" + } + }, + "SEARCH": { + "Find Account": { + "description": "Finds an account by name.", + "code": "" + }, + "Find Campaign Response": { + "description": "Finds a campaign response.", + "code": "" + }, + "Find Contact": { + "description": "Finds a contact by email address or other searchable field.", + "code": "" + }, + "Find Custom Entity": { + "description": "Finds a custom entity.", + "code": "" + }, + "Find Invoice": { + "description": "Finds an invoice.", + "code": "" + }, + "Find Lead": { + "description": "Finds a lead by email address or other searchable field.", + "code": "" + }, + "Find Opportunity": { + "description": "Finds an opportunity by subject or other searchable field.", + "code": "" + }, + "Find or Create Account": { + "description": "Finds an account by name.", + "code": "" + }, + "Find or Create Custom Entity": { + "description": "Finds a custom entity.", + "code": "" + }, + "Find or Create Lead": { + "description": "Finds a lead.", + "code": "" + }, + "Find or Create Order": { + "description": "Finds an order.", + "code": "" + } + } +} diff --git a/packages/facebook/snippets.json b/packages/facebook/snippets.json new file mode 100644 index 0000000000..7b107b2619 --- /dev/null +++ b/packages/facebook/snippets.json @@ -0,0 +1,24 @@ +{ + "CREATE": { + "Change Page Profile Photo": { + "description": "Changes the profile picture of a Facebook Page.", + "code": "" + }, + "Create Page Photo": { + "description": "Uploads a photo to your Facebook Page and posts it to the stream.", + "code": "" + }, + "Create Page Post": { + "description": "Create a new page \"stream\" post on a page.", + "code": "" + }, + "Create Page Video": { + "description": "Uploads a video to your Facebook Page and posts it to the stream.", + "code": "" + }, + "Page Post Insights": { + "description": "Generates page post insights.", + "code": "" + } + } +} diff --git a/packages/flutterwave/snippets.json b/packages/flutterwave/snippets.json new file mode 100644 index 0000000000..c47d1a59c5 --- /dev/null +++ b/packages/flutterwave/snippets.json @@ -0,0 +1,26 @@ +{ + "CREATE": { + "Create Payment Plan": { + "description": "Creates a new payment plan.", + "code": "" + }, + "Create Transfer": { + "description": "Creates a new transfer.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Find Transaction": { + "description": "Find a transaction by the transaction id or payment reference.", + "code": "" + }, + "Find Transfer": { + "description": "Find a transfer by the transfer reference.", + "code": "" + } + } +} diff --git a/packages/googledrive/snippets.json b/packages/googledrive/snippets.json new file mode 100644 index 0000000000..e01cbc850d --- /dev/null +++ b/packages/googledrive/snippets.json @@ -0,0 +1,86 @@ +{ + "CREATE": { + "Copy File": { + "description": "Create a copy of the specified file.", + "code": "" + }, + "Copy File from Another Service": { + "description": "Copies an existing file from another service to Google Drive.", + "code": "" + }, + "Create File From Text": { + "description": "Create a new file from plain text.", + "code": "" + }, + "Create Folder": { + "description": "Create a new, empty folder.", + "code": "" + }, + "Create Shared Drive": { + "description": "Create a new shared drive (Team Drive) in Google Drive.", + "code": "" + }, + "Create Shortcut": { + "description": "Create a shortcut to a file.", + "code": "" + }, + "Delete File": { + "description": "Delete a file in Google Drive (requires file ID).", + "code": "" + }, + "Export File": { + "description": "Export Google Workspace files to different formats (PDF, Word, Excel, etc.).", + "code": "" + }, + "Move File": { + "description": "Move a file from one folder to another.", + "code": "" + }, + "Permanently Delete File": { + "description": "Permanently delete a file from Google Drive. Cannot be undone.", + "code": "" + }, + "Remove File Access": { + "description": "Remove specific user access to a file.", + "code": "" + }, + "Upload File": { + "description": "Uploads a file to the given path.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Find a File": { + "description": "Search for a specific file by name.", + "code": "" + }, + "Find a Folder": { + "description": "Search for a specific folder by name.", + "code": "" + }, + "Find or Create File": { + "description": "Finds or creates a specific file.", + "code": "" + }, + "Find or Create Folder": { + "description": "Finds or creates a specific folder.", + "code": "" + }, + "List File Permissions": { + "description": "List all users who have access to a file.", + "code": "" + }, + "Retrieve File or Folder by ID": { + "description": "Get a file or folder by its ID.", + "code": "" + }, + "Retrieve Files": { + "description": "GET request to the Google Drive API to retrieve a list of files.", + "code": "" + } + } +} diff --git a/packages/http/snippets.json b/packages/http/snippets.json new file mode 100644 index 0000000000..5a5086808e --- /dev/null +++ b/packages/http/snippets.json @@ -0,0 +1,22 @@ +{ + "CREATE": { + "Custom Request": { + "description": "Fire off a custom request by providing raw details.", + "code": "" + }, + "PUT Request": { + "description": "Fire off a single PUT request as a form or JSON.", + "code": "" + }, + "POST Request": { + "description": "Fire off a single POST request as a form or JSON.", + "code": "" + } + }, + "SEARCH": { + "GET Request": { + "description": "Fire off a single GET request with optional querystrings.", + "code": "" + } + } +} diff --git a/packages/intuit/snippets.json b/packages/intuit/snippets.json new file mode 100644 index 0000000000..3b4e0e6511 --- /dev/null +++ b/packages/intuit/snippets.json @@ -0,0 +1,54 @@ +{ + "CREATE": { + "Create Customer": { + "description": "Creates a new customer.", + "code": "" + }, + "Create Estimate": { + "description": "Creates a new estimate.", + "code": "" + }, + "Create Expense": { + "description": "Creates a new expense.", + "code": "" + }, + "Create Invoice": { + "description": "Creates a new invoice.", + "code": "" + }, + "Create Payment": { + "description": "Records a new payment.", + "code": "" + }, + "Create Sales Receipt": { + "description": "Creates a new sales receipt.", + "code": "" + }, + "Send Invoice": { + "description": "Sends an invoice to a customer.", + "code": "" + }, + "Update Customer": { + "description": "Updates an existing customer.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Find Customer": { + "description": "Find a customer by name or email.", + "code": "" + }, + "Find Invoice": { + "description": "Find an invoice.", + "code": "" + }, + "Find or Create Customer": { + "description": "Find or create a customer.", + "code": "" + } + } +} diff --git a/packages/mailchimp/snippets.json b/packages/mailchimp/snippets.json new file mode 100644 index 0000000000..38704b5fc5 --- /dev/null +++ b/packages/mailchimp/snippets.json @@ -0,0 +1,82 @@ +{ + "CREATE": { + "Add Note to Subscriber": { + "description": "Adds a new note to an existing subscriber.", + "code": "" + }, + "Add/Update Subscriber": { + "description": "Add a new subscriber or update an existing one.", + "code": "" + }, + "Archive Subscriber": { + "description": "Archives an existing subscriber.", + "code": "" + }, + "Create Audience": { + "description": "Creates a new audience in your MailChimp account.", + "code": "" + }, + "Create Campaign": { + "description": "Creates a campaign draft.", + "code": "" + }, + "Create Custom Event": { + "description": "Creates a custom event for an existing subscriber.", + "code": "" + }, + "Create Tag": { + "description": "Creates a new tag.", + "code": "" + }, + "Permanently Delete Member": { + "description": "Deletes all personally identifiable information related to a member.", + "code": "" + }, + "Remove Subscriber from Tag": { + "description": "Removes a subscriber from a tag within an audience.", + "code": "" + }, + "Unsubscribe or Delete Contact": { + "description": "Unsubscribe or delete a contact by email address.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Campaign Report": { + "description": "Get report details for a specific sent campaign.", + "code": "" + }, + "Click Report": { + "description": "Get report details for specific link clicks.", + "code": "" + }, + "Find a Campaign": { + "description": "Finds an existing campaign.", + "code": "" + }, + "Find a Subscriber": { + "description": "Searches for a subscriber on your MailChimp audience.", + "code": "" + }, + "Find Customer": { + "description": "Finds a customer by email address.", + "code": "" + }, + "Find or Create Campaign": { + "description": "Finds an existing campaign.", + "code": "" + }, + "Find or Create Subscriber": { + "description": "Searches for a subscriber on your MailChimp audience.", + "code": "" + }, + "Find Tag": { + "description": "Find a tag.", + "code": "" + } + } +} diff --git a/packages/mailgun/snippets.json b/packages/mailgun/snippets.json new file mode 100644 index 0000000000..0099174602 --- /dev/null +++ b/packages/mailgun/snippets.json @@ -0,0 +1,28 @@ +{ + "CREATE": { + "Add Mailing List Member": { + "description": "Adds a new member to a mailing list.", + "code": "" + }, + "Bulk Email Validation": { + "description": "Upload a CSV and start a bulk validation job using Mailgun V4 API.", + "code": "" + }, + "Get Bulk Validation Results": { + "description": "Retrieves completed bulk validation job results.", + "code": "" + }, + "Send Email": { + "description": "Sends an email using your Mailgun account.", + "code": "" + }, + "Validate Email": { + "description": "Validates an email address and returns deliverability results.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + } +} diff --git a/packages/mongodb/snippets.json b/packages/mongodb/snippets.json new file mode 100644 index 0000000000..89da7f9907 --- /dev/null +++ b/packages/mongodb/snippets.json @@ -0,0 +1,8 @@ +{ + "CREATE": { + "Insert New Document": { + "description": "Inserts a new document into a MongoDB collection.", + "code": "" + } + } +} diff --git a/packages/mssql/snippets.json b/packages/mssql/snippets.json new file mode 100644 index 0000000000..d1249b5b17 --- /dev/null +++ b/packages/mssql/snippets.json @@ -0,0 +1,26 @@ +{ + "CREATE": { + "New Row": { + "description": "Adds a new row.", + "code": "" + }, + "Update Row": { + "description": "Updates an existing row.", + "code": "" + } + }, + "SEARCH": { + "Find Row": { + "description": "Finds a row in a table via a lookup column.", + "code": "" + }, + "Find Row via Custom Query": { + "description": "Finds a row in a table via a custom query you control.", + "code": "" + }, + "Find Rows via Custom Query": { + "description": "Finds multiple rows in a table via a custom query you control.", + "code": "" + } + } +} diff --git a/packages/mysql/snippets.json b/packages/mysql/snippets.json new file mode 100644 index 0000000000..cf0a3aa7ab --- /dev/null +++ b/packages/mysql/snippets.json @@ -0,0 +1,22 @@ +{ + "CREATE": { + "New Row": { + "description": "Adds a new row.", + "code": "" + }, + "Update Row": { + "description": "Updates an existing row.", + "code": "" + } + }, + "SEARCH": { + "Find Row": { + "description": "Finds a row in a table via a lookup column.", + "code": "" + }, + "Find Row via Custom Query": { + "description": "Finds a row in a table via a custom query you control.", + "code": "" + } + } +} diff --git a/packages/nexmo/snippets.json b/packages/nexmo/snippets.json new file mode 100644 index 0000000000..d6928f5d0f --- /dev/null +++ b/packages/nexmo/snippets.json @@ -0,0 +1,12 @@ +{ + "CREATE": { + "Send SMS": { + "description": "Send an SMS message.", + "code": "" + }, + "Make Call": { + "description": "Make a voice call.", + "code": "" + } + } +} diff --git a/packages/odoo/snippets.json b/packages/odoo/snippets.json new file mode 100644 index 0000000000..daa14f8052 --- /dev/null +++ b/packages/odoo/snippets.json @@ -0,0 +1,26 @@ +{ + "CREATE": { + "Create Lead": { + "description": "Creates a lead.", + "code": "" + }, + "Create/Update Module Entry": { + "description": "Creates or updates a module entry.", + "code": "" + }, + "Relate Module Entry": { + "description": "Relates an entry in this module with an entry in another module.", + "code": "" + } + }, + "SEARCH": { + "Find Module Entry": { + "description": "Finds an entry in a module.", + "code": "" + }, + "Find Multiple Module Entries": { + "description": "Finds multiple entries in a module (with line item support).", + "code": "" + } + } +} diff --git a/packages/salesforce/snippets.json b/packages/salesforce/snippets.json new file mode 100644 index 0000000000..f8ed43dc0b --- /dev/null +++ b/packages/salesforce/snippets.json @@ -0,0 +1,66 @@ +{ + "CREATE": { + "Add Contact to Campaign": { + "description": "Adds an existing contact to an existing campaign.", + "code": "" + }, + "Add File to Record": { + "description": "Adds an existing file to an existing Record.", + "code": "" + }, + "Create Record": { + "description": "Creates a new record of a specified Salesforce object.", + "code": "" + }, + "Send Email": { + "description": "Sends an email using Salesforce Simple Email Actions.", + "code": "" + }, + "Update Lead": { + "description": "Updates an existing lead.", + "code": "" + }, + "Update Record": { + "description": "Updates an existing record of a specified Salesforce object.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Execute SOQL Query": { + "description": "Custom SOQL SELECT queries with aggregate function support.", + "code": "" + }, + "Execute SOSL Search": { + "description": "Custom SOSL queries for text-based searches across multiple objects.", + "code": "" + }, + "Find Child Records": { + "description": "Finds Child Records for a given Parent ID.", + "code": "" + }, + "Find Record": { + "description": "Finds a record by up to two fields and values.", + "code": "" + }, + "Find Record (SOQL)": { + "description": "Finds a record using a SOQL WHERE clause.", + "code": "" + }, + "Find Records (Line Items)": { + "description": "Finds records by a field and value (with line-item support).", + "code": "" + }, + "Find Records (SOQL)": { + "description": "Finds one or more records using a SOQL WHERE clause (with line item support).", + "code": "" + }, + "Get Notes and Attachments": { + "description": "Gets all notes and attachments for a record.", + "code": "" + } + } +} diff --git a/packages/sftp/snippets.json b/packages/sftp/snippets.json new file mode 100644 index 0000000000..19d4059535 --- /dev/null +++ b/packages/sftp/snippets.json @@ -0,0 +1,14 @@ +{ + "CREATE": { + "Upload File": { + "description": "Uploads a file to the given path.", + "code": "" + } + }, + "SEARCH": { + "Download File": { + "description": "Downloads the file at the given path.", + "code": "" + } + } +} diff --git a/packages/whatsapp/snippets.json b/packages/whatsapp/snippets.json new file mode 100644 index 0000000000..3ff9dcb15d --- /dev/null +++ b/packages/whatsapp/snippets.json @@ -0,0 +1,16 @@ +{ + "CREATE": { + "Send Freeform Message": { + "description": "Send a freeform text message (within 24-hour window only).", + "code": "" + }, + "Send Media Message": { + "description": "Send a media message (document, image, video, or audio) within 24-hour window.", + "code": "" + }, + "Send Template Message": { + "description": "Sends an approved template message.", + "code": "" + } + } +} diff --git a/packages/zoho/snippets.json b/packages/zoho/snippets.json new file mode 100644 index 0000000000..96462f48a1 --- /dev/null +++ b/packages/zoho/snippets.json @@ -0,0 +1,34 @@ +{ + "CREATE": { + "Create/Update Module Entry": { + "description": "Creates or updates an entry in a specified module.", + "code": "" + }, + "Relate Module Entry": { + "description": "Relates an entry in this module with an entry in another module.", + "code": "" + }, + "Update Module Entry": { + "description": "Updates an existing module entry.", + "code": "" + }, + "API Request (Beta)": { + "description": "Raw HTTP request with authentication.", + "code": "" + } + }, + "SEARCH": { + "Find Module Entry": { + "description": "Finds an entry in a module.", + "code": "" + }, + "Find Multiple Module Entries": { + "description": "Finds multiple entries in a module (with line item support).", + "code": "" + }, + "Find or Create Module Entry": { + "description": "Finds or creates an entry in a module.", + "code": "" + } + } +} From 043fdb66f978980cb257036773552ea047d15b07 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 17:31:00 +0000 Subject: [PATCH 8/8] Add code for remaining 19 adaptor snippets where exports support it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fills the `code` field on actions whose Zapier mapping has a matching adaptor export. Actions with no matching export keep an empty code string so the UI can render "coming soon". Coverage by adaptor (filled / total): - asana 6/15 (createTask, updateTask, createTaskStory, getTasks, searchTask, request) - bigquery 1/3 (load) - dynamics 20/24 (createEntity, updateEntity, query) - facebook 1/5 (postMessage) - flutterwave 0/5 (no matching exports) - googledrive 7/20 (create, get, list) - http 4/4 (request, get, post, put — fully covered) - intuit 11/12 (http.get, http.post) - mailchimp 12/19 (upsertMembers, archiveMember, deleteMember, updateMember, updateMemberTags, request, get) - mailgun 1/6 (send) - mongodb 1/1 (insertDocuments — fully covered) - mssql 5/5 (insert, sql, findValue — fully covered) - mysql 4/4 (insert, sql — fully covered) - nexmo 1/2 (sendSMS) - odoo 5/5 (create, update, searchReadRecord — fully covered) - salesforce 12/15 (create, update, query, sfRequest) - sftp 0/2 (no generic upload/download in adaptor) - whatsapp 3/3 (request — fully covered) - zoho 0/7 (adaptor wraps Zoho Analytics; Zapier list is for Zoho CRM — no overlap) https://claude.ai/code/session_01Vf2oLVjQUkrLDLb6LDJ6FM --- packages/asana/snippets.json | 12 ++++----- packages/bigquery/snippets.json | 2 +- packages/dynamics/snippets.json | 40 +++++++++++++++--------------- packages/facebook/snippets.json | 2 +- packages/googledrive/snippets.json | 14 +++++------ packages/http/snippets.json | 8 +++--- packages/intuit/snippets.json | 22 ++++++++-------- packages/mailchimp/snippets.json | 24 +++++++++--------- packages/mailgun/snippets.json | 2 +- packages/mongodb/snippets.json | 2 +- packages/mssql/snippets.json | 10 ++++---- packages/mysql/snippets.json | 8 +++--- packages/nexmo/snippets.json | 2 +- packages/odoo/snippets.json | 10 ++++---- packages/salesforce/snippets.json | 24 +++++++++--------- packages/whatsapp/snippets.json | 6 ++--- 16 files changed, 94 insertions(+), 94 deletions(-) diff --git a/packages/asana/snippets.json b/packages/asana/snippets.json index 08f949a522..fafc0718c9 100644 --- a/packages/asana/snippets.json +++ b/packages/asana/snippets.json @@ -6,7 +6,7 @@ }, "Create Comment/Story": { "description": "Adds a comment or story to a task.", - "code": "" + "code": "// Add a comment / story to a task.\ncreateTaskStory(\n // 1) The task's globally unique id.\n $.data.taskGid,\n {\n // 2) The comment body (HTML supported when html_text is used).\n text: 'Status update: imported from the upstream system.',\n }\n);" }, "Create Duplicate Task": { "description": "Duplicates an existing task.", @@ -22,7 +22,7 @@ }, "Create Task": { "description": "Creates a new task in Asana with specified details.", - "code": "" + "code": "// Create a new task.\ncreateTask({\n // The task's title.\n name: 'Follow up with patient',\n // Long-form description (optional).\n notes: `Imported from upstream system on ${new Date().toISOString()}`,\n // Workspace gid this task lives in.\n workspace: $.configuration.workspaceGid,\n // Optional: place the task into a project on creation.\n projects: [$.data.projectGid],\n // Optional: assign to a user gid.\n assignee: $.data.assigneeGid,\n // Optional ISO date string.\n due_on: '2026-06-01',\n});" }, "Create Task From Template": { "description": "Creates a new task in Asana from a selected template.", @@ -30,17 +30,17 @@ }, "Update Task": { "description": "Updates multiple properties of an existing Asana task.", - "code": "" + "code": "// Update properties on an existing task.\nupdateTask(\n // 1) Task gid.\n $.data.taskGid,\n // 2) Fields to change.\n {\n name: 'Updated task title',\n completed: true,\n notes: 'Closed after upstream sync.',\n }\n);" }, "API Request (Beta)": { "description": "Raw HTTP request with authentication.", - "code": "" + "code": "// Make an arbitrary request against the Asana API.\n// Path is relative to the Asana base URL.\nrequest('/workspaces', {\n method: 'GET',\n query: { limit: 10 },\n});" } }, "SEARCH": { "Find All Tasks From Project": { "description": "Searches for all tasks in a specific project with optional filters.", - "code": "" + "code": "// List tasks in a project.\ngetTasks(\n // 1) Project gid.\n $.data.projectGid,\n // 2) Query params.\n {\n // Fields to return per task.\n opt_fields: 'name,notes,assignee,completed,due_on',\n // Cap the result size.\n limit: 100,\n }\n);" }, "Find Project": { "description": "Finds an existing project.", @@ -56,7 +56,7 @@ }, "Find Tasks in Workspace": { "description": "Searches for tasks in a workspace using Asana's search API (premium only).", - "code": "" + "code": "// Search tasks across a workspace using Asana's typeahead/search API.\n// Note: this endpoint requires a premium Asana plan.\nsearchTask(\n // 1) The search term (matches task name).\n $.data.searchTerm,\n // 2) Query params (assignee, completed, etc).\n {\n 'assignee.any': $.data.assigneeGid,\n completed: false,\n }\n);" }, "Find User": { "description": "Finds an existing user of your Asana account.", diff --git a/packages/bigquery/snippets.json b/packages/bigquery/snippets.json index 8c924e3f2d..3fb4f52223 100644 --- a/packages/bigquery/snippets.json +++ b/packages/bigquery/snippets.json @@ -2,7 +2,7 @@ "CREATE": { "Insert Row": { "description": "Add a row to a BigQuery table.", - "code": "" + "code": "// Load file(s) into a BigQuery table.\n// The adaptor batches rows from disk; for one-off row inserts you typically\n// write the row(s) to a local file first and point `load` at it.\nload(\n // 1) Path to the local directory containing files to load.\n './tmp/files',\n // 2) GCP project id.\n $.configuration.projectId,\n // 3) Dataset id.\n 'my_dataset',\n // 4) Target table id.\n 'my_table',\n {\n // Column types (BQ schema string).\n schema: 'name:STRING,email:STRING,amount:NUMERIC',\n // Append rather than replace.\n writeDisposition: 'WRITE_APPEND',\n // Skip header row(s) if loading CSV.\n skipLeadingRows: 1,\n createDisposition: 'CREATE_IF_NEEDED',\n }\n);" } }, "SEARCH": { diff --git a/packages/dynamics/snippets.json b/packages/dynamics/snippets.json index 4c8e43c298..2f8c29c931 100644 --- a/packages/dynamics/snippets.json +++ b/packages/dynamics/snippets.json @@ -2,85 +2,85 @@ "CREATE": { "Create Account": { "description": "Creates a new account.", - "code": "" + "code": "// Create an Account record in Dynamics.\ncreateEntity({\n // Plural-cased Dataverse entity set.\n entityName: 'accounts',\n body: {\n name: $.data.name,\n emailaddress1: $.data.email,\n telephone1: $.data.phone,\n },\n});" }, "Create Case/Incident": { "description": "Creates a new case/incident.", - "code": "" + "code": "// Create a Case (incident) record.\ncreateEntity({\n entityName: 'incidents',\n body: {\n title: $.data.title,\n description: $.data.description,\n // Lookup back to the parent account using an @odata.bind reference.\n 'customerid_account@odata.bind': `/accounts(${$.data.accountId})`,\n },\n});" }, "Create Contact": { "description": "Creates a new contact.", - "code": "" + "code": "// Create a Contact record.\ncreateEntity({\n entityName: 'contacts',\n body: {\n firstname: $.data.firstName,\n lastname: $.data.lastName,\n emailaddress1: $.data.email,\n },\n});" }, "Create Custom Entity": { "description": "Creates a new custom entity record.", - "code": "" + "code": "// Create a record in a custom entity. Use the entity's plural set name.\ncreateEntity({\n entityName: 'my_custom_entities',\n body: $.data.record,\n});" }, "Create Invoice": { "description": "Creates a new invoice.", - "code": "" + "code": "// Create an Invoice.\ncreateEntity({\n entityName: 'invoices',\n body: {\n name: $.data.invoiceName,\n 'customerid_account@odata.bind': `/accounts(${$.data.accountId})`,\n totalamount: $.data.total,\n },\n});" }, "Create Lead": { "description": "Creates a new lead.", - "code": "" + "code": "// Create a Lead.\ncreateEntity({\n entityName: 'leads',\n body: {\n firstname: $.data.firstName,\n lastname: $.data.lastName,\n emailaddress1: $.data.email,\n subject: $.data.subject,\n },\n});" }, "Create Opportunity": { "description": "Creates a new opportunity.", - "code": "" + "code": "// Create an Opportunity.\ncreateEntity({\n entityName: 'opportunities',\n body: {\n name: $.data.opportunityName,\n 'customerid_account@odata.bind': `/accounts(${$.data.accountId})`,\n estimatedvalue: $.data.estimatedValue,\n },\n});" }, "Create Order": { "description": "Creates a new order.", - "code": "" + "code": "// Create a Sales Order.\ncreateEntity({\n entityName: 'salesorders',\n body: {\n name: $.data.orderName,\n 'customerid_account@odata.bind': `/accounts(${$.data.accountId})`,\n },\n});" }, "Update Account": { "description": "Updates an account.", - "code": "" + "code": "// Update fields on an existing Account.\nupdateEntity({\n entityName: 'accounts',\n // The record's GUID.\n entityId: $.data.accountId,\n body: {\n telephone1: $.data.phone,\n emailaddress1: $.data.email,\n },\n});" }, "Update Contact": { "description": "Updates a contact.", - "code": "" + "code": "// Update fields on an existing Contact.\nupdateEntity({\n entityName: 'contacts',\n entityId: $.data.contactId,\n body: {\n emailaddress1: $.data.email,\n telephone1: $.data.phone,\n },\n});" }, "Update Custom Entity": { "description": "Updates a custom entity.", - "code": "" + "code": "// Update a custom entity record.\nupdateEntity({\n entityName: 'my_custom_entities',\n entityId: $.data.recordId,\n body: $.data.fields,\n});" }, "Update Lead": { "description": "Updates a lead.", - "code": "" + "code": "// Update fields on an existing Lead.\nupdateEntity({\n entityName: 'leads',\n entityId: $.data.leadId,\n body: {\n statuscode: 3, // qualified\n emailaddress1: $.data.email,\n },\n});" }, "Update Record": { "description": "Updates an existing record.", - "code": "" + "code": "// Update a record on any entity, by GUID.\nupdateEntity({\n entityName: $.data.entityName,\n entityId: $.data.recordId,\n body: $.data.fields,\n});" } }, "SEARCH": { "Find Account": { "description": "Finds an account by name.", - "code": "" + "code": "// Look up Accounts by name using an OData filter.\nquery({\n entityName: 'accounts',\n // OData $filter; quote string values with single quotes.\n filter: `name eq '${$.data.name}'`,\n // Only return the columns we care about.\n select: ['accountid', 'name', 'emailaddress1'],\n});" }, "Find Campaign Response": { "description": "Finds a campaign response.", - "code": "" + "code": "// Look up Campaign Responses.\nquery({\n entityName: 'campaignresponses',\n filter: `_regardingobjectid_value eq ${$.data.campaignId}`,\n});" }, "Find Contact": { "description": "Finds a contact by email address or other searchable field.", - "code": "" + "code": "// Look up a Contact by email.\nquery({\n entityName: 'contacts',\n filter: `emailaddress1 eq '${$.data.email}'`,\n select: ['contactid', 'firstname', 'lastname', 'emailaddress1'],\n});" }, "Find Custom Entity": { "description": "Finds a custom entity.", - "code": "" + "code": "// Look up records on a custom entity.\nquery({\n entityName: 'my_custom_entities',\n filter: `my_externalid eq '${$.data.externalId}'`,\n});" }, "Find Invoice": { "description": "Finds an invoice.", - "code": "" + "code": "// Look up an Invoice by name or number.\nquery({\n entityName: 'invoices',\n filter: `name eq '${$.data.invoiceName}'`,\n});" }, "Find Lead": { "description": "Finds a lead by email address or other searchable field.", - "code": "" + "code": "// Look up a Lead by email.\nquery({\n entityName: 'leads',\n filter: `emailaddress1 eq '${$.data.email}'`,\n});" }, "Find Opportunity": { "description": "Finds an opportunity by subject or other searchable field.", - "code": "" + "code": "// Look up an Opportunity by name.\nquery({\n entityName: 'opportunities',\n filter: `name eq '${$.data.opportunityName}'`,\n});" }, "Find or Create Account": { "description": "Finds an account by name.", diff --git a/packages/facebook/snippets.json b/packages/facebook/snippets.json index 7b107b2619..768001a172 100644 --- a/packages/facebook/snippets.json +++ b/packages/facebook/snippets.json @@ -10,7 +10,7 @@ }, "Create Page Post": { "description": "Create a new page \"stream\" post on a page.", - "code": "" + "code": "// Post a message to your Facebook Page feed.\n// The postMessage helper wraps the Graph API /{page-id}/feed endpoint.\npostMessage({\n recipient: { id: $.configuration.pageId },\n message: {\n text: `New update from OpenFn: ${$.data.summary}`,\n },\n});" }, "Create Page Video": { "description": "Uploads a video to your Facebook Page and posts it to the stream.", diff --git a/packages/googledrive/snippets.json b/packages/googledrive/snippets.json index e01cbc850d..6d15c0d382 100644 --- a/packages/googledrive/snippets.json +++ b/packages/googledrive/snippets.json @@ -10,11 +10,11 @@ }, "Create File From Text": { "description": "Create a new file from plain text.", - "code": "" + "code": "// Create a new file from a string of text.\ncreate(\n // 1) File body (text or binary buffer).\n `Report generated on ${new Date().toISOString()}\\n\\n${$.data.body}`,\n // 2) File name (extension determines the default mime type).\n 'report.txt'\n);" }, "Create Folder": { "description": "Create a new, empty folder.", - "code": "" + "code": "// Create an empty folder.\n// Pass `null` for content and the folder mime type via options.\ncreate(null, 'My new folder', {\n mimeType: 'application/vnd.google-apps.folder',\n});" }, "Create Shared Drive": { "description": "Create a new shared drive (Team Drive) in Google Drive.", @@ -46,7 +46,7 @@ }, "Upload File": { "description": "Uploads a file to the given path.", - "code": "" + "code": "// Upload a file's contents to Drive.\n// `content` can be a string or a Buffer; the file name carries the extension.\ncreate(\n $.data.fileContent,\n $.data.fileName,\n {\n // Optional parent folder id.\n parents: [$.configuration.parentFolderId],\n // Optional mime type override.\n mimeType: 'text/csv',\n }\n);" }, "API Request (Beta)": { "description": "Raw HTTP request with authentication.", @@ -56,11 +56,11 @@ "SEARCH": { "Find a File": { "description": "Search for a specific file by name.", - "code": "" + "code": "// Search for files by name. `list` returns matching items on state.data.\nlist(\n // 1) Folder id to scope the search to (or null to search the whole Drive).\n $.configuration.parentFolderId,\n // 2) Drive list query options.\n {\n // Drive query syntax: https://developers.google.com/drive/api/guides/search-files\n q: `name = '${$.data.fileName}' and trashed = false`,\n fields: 'files(id,name,mimeType,modifiedTime)',\n }\n);" }, "Find a Folder": { "description": "Search for a specific folder by name.", - "code": "" + "code": "// Search for folders by name.\nlist(null, {\n q: `mimeType = 'application/vnd.google-apps.folder' and name = '${$.data.folderName}' and trashed = false`,\n fields: 'files(id,name)',\n});" }, "Find or Create File": { "description": "Finds or creates a specific file.", @@ -76,11 +76,11 @@ }, "Retrieve File or Folder by ID": { "description": "Get a file or folder by its ID.", - "code": "" + "code": "// Retrieve metadata for a file or folder by its id.\nget($.data.fileId);" }, "Retrieve Files": { "description": "GET request to the Google Drive API to retrieve a list of files.", - "code": "" + "code": "// List files inside a folder.\nlist(\n $.configuration.parentFolderId,\n {\n fields: 'files(id,name,mimeType,modifiedTime)',\n pageSize: 100,\n }\n);" } } } diff --git a/packages/http/snippets.json b/packages/http/snippets.json index 5a5086808e..24cae8e75c 100644 --- a/packages/http/snippets.json +++ b/packages/http/snippets.json @@ -2,21 +2,21 @@ "CREATE": { "Custom Request": { "description": "Fire off a custom request by providing raw details.", - "code": "" + "code": "// Make an arbitrary HTTP request.\n// state.data is set to the parsed response body.\nrequest('POST', 'https://api.example.org/v1/things', {\n // JSON body (sent as application/json by default).\n body: { name: $.data.name, amount: $.data.amount },\n // Extra headers.\n headers: { 'X-Trace-Id': $.run.id },\n // Querystring parameters.\n query: { ref: $.data.ref },\n});" }, "PUT Request": { "description": "Fire off a single PUT request as a form or JSON.", - "code": "" + "code": "// Send a PUT request with a JSON body.\nput('https://api.example.org/v1/things/123', $.data.payload, {\n headers: { 'X-Trace-Id': $.run.id },\n});" }, "POST Request": { "description": "Fire off a single POST request as a form or JSON.", - "code": "" + "code": "// Send a POST request with a JSON body.\npost('https://api.example.org/v1/things', $.data.payload, {\n headers: { 'X-Trace-Id': $.run.id },\n});" } }, "SEARCH": { "GET Request": { "description": "Fire off a single GET request with optional querystrings.", - "code": "" + "code": "// Send a GET request.\nget('https://api.example.org/v1/things', {\n query: { limit: 10, status: 'active' },\n});" } } } diff --git a/packages/intuit/snippets.json b/packages/intuit/snippets.json index 3b4e0e6511..8a8e6f5878 100644 --- a/packages/intuit/snippets.json +++ b/packages/intuit/snippets.json @@ -2,49 +2,49 @@ "CREATE": { "Create Customer": { "description": "Creates a new customer.", - "code": "" + "code": "// Create a customer via the QuickBooks REST API.\n// The intuit adaptor exposes a thin HTTP wrapper (http.post / http.get).\nhttp.post(`/v3/company/${$.configuration.realmId}/customer`, {\n DisplayName: $.data.name,\n PrimaryEmailAddr: { Address: $.data.email },\n PrimaryPhone: { FreeFormNumber: $.data.phone },\n});" }, "Create Estimate": { "description": "Creates a new estimate.", - "code": "" + "code": "// Create an estimate.\nhttp.post(`/v3/company/${$.configuration.realmId}/estimate`, {\n CustomerRef: { value: $.data.customerId },\n Line: $.data.lineItems,\n});" }, "Create Expense": { "description": "Creates a new expense.", - "code": "" + "code": "// Create an expense (Purchase with PaymentType=Cash/Check/CreditCard).\nhttp.post(`/v3/company/${$.configuration.realmId}/purchase`, {\n PaymentType: 'Cash',\n AccountRef: { value: $.data.accountId },\n Line: $.data.lineItems,\n});" }, "Create Invoice": { "description": "Creates a new invoice.", - "code": "" + "code": "// Create an invoice.\nhttp.post(`/v3/company/${$.configuration.realmId}/invoice`, {\n CustomerRef: { value: $.data.customerId },\n Line: $.data.lineItems,\n});" }, "Create Payment": { "description": "Records a new payment.", - "code": "" + "code": "// Record a payment against an invoice.\nhttp.post(`/v3/company/${$.configuration.realmId}/payment`, {\n CustomerRef: { value: $.data.customerId },\n TotalAmt: $.data.amount,\n Line: [\n {\n Amount: $.data.amount,\n LinkedTxn: [{ TxnId: $.data.invoiceId, TxnType: 'Invoice' }],\n },\n ],\n});" }, "Create Sales Receipt": { "description": "Creates a new sales receipt.", - "code": "" + "code": "// Create a sales receipt.\nhttp.post(`/v3/company/${$.configuration.realmId}/salesreceipt`, {\n CustomerRef: { value: $.data.customerId },\n Line: $.data.lineItems,\n});" }, "Send Invoice": { "description": "Sends an invoice to a customer.", - "code": "" + "code": "// Send an existing invoice by email.\n// The sendTo querystring overrides the customer's email on file.\nhttp.post(\n `/v3/company/${$.configuration.realmId}/invoice/${$.data.invoiceId}/send?sendTo=${encodeURIComponent($.data.email)}`,\n // QuickBooks requires an empty JSON body on this endpoint.\n {}\n);" }, "Update Customer": { "description": "Updates an existing customer.", - "code": "" + "code": "// Sparse update on a customer (Id + SyncToken required).\nhttp.post(`/v3/company/${$.configuration.realmId}/customer`, {\n Id: $.data.customerId,\n SyncToken: $.data.syncToken,\n sparse: true,\n PrimaryEmailAddr: { Address: $.data.email },\n});" }, "API Request (Beta)": { "description": "Raw HTTP request with authentication.", - "code": "" + "code": "// Make an arbitrary GET or POST against QuickBooks.\nhttp.get(`/v3/company/${$.configuration.realmId}/companyinfo/${$.configuration.realmId}`);" } }, "SEARCH": { "Find Customer": { "description": "Find a customer by name or email.", - "code": "" + "code": "// Look up a customer with a QuickBooks query.\n// Quote string literals with single quotes.\nhttp.get(\n `/v3/company/${$.configuration.realmId}/query` +\n `?query=` + encodeURIComponent(\n `select * from Customer where PrimaryEmailAddr = '${$.data.email}'`\n )\n);" }, "Find Invoice": { "description": "Find an invoice.", - "code": "" + "code": "// Look up an invoice by DocNumber.\nhttp.get(\n `/v3/company/${$.configuration.realmId}/query` +\n `?query=` + encodeURIComponent(\n `select * from Invoice where DocNumber = '${$.data.docNumber}'`\n )\n);" }, "Find or Create Customer": { "description": "Find or create a customer.", diff --git a/packages/mailchimp/snippets.json b/packages/mailchimp/snippets.json index 38704b5fc5..51260c6555 100644 --- a/packages/mailchimp/snippets.json +++ b/packages/mailchimp/snippets.json @@ -6,11 +6,11 @@ }, "Add/Update Subscriber": { "description": "Add a new subscriber or update an existing one.", - "code": "" + "code": "// Add or update one or more subscribers on a list.\nupsertMembers({\n // The Mailchimp audience (list) id.\n listId: $.configuration.listId,\n // Array of users to upsert.\n users: [\n {\n email: $.data.email,\n status: 'subscribed',\n mergeFields: { FNAME: $.data.firstName, LNAME: $.data.lastName },\n },\n ],\n});" }, "Archive Subscriber": { "description": "Archives an existing subscriber.", - "code": "" + "code": "// Archive a single subscriber by email.\narchiveMember({\n listId: $.configuration.listId,\n email: $.data.email,\n});" }, "Create Audience": { "description": "Creates a new audience in your MailChimp account.", @@ -30,41 +30,41 @@ }, "Permanently Delete Member": { "description": "Deletes all personally identifiable information related to a member.", - "code": "" + "code": "// Permanently delete a member (cannot be undone; member can't be re-subscribed).\ndeleteMember({\n listId: $.configuration.listId,\n email: $.data.email,\n});" }, "Remove Subscriber from Tag": { "description": "Removes a subscriber from a tag within an audience.", - "code": "" + "code": "// Remove a tag from a subscriber by marking the tag as inactive.\nupdateMemberTags({\n listId: $.configuration.listId,\n email: $.data.email,\n tags: [\n { name: $.data.tagName, status: 'inactive' },\n ],\n});" }, "Unsubscribe or Delete Contact": { "description": "Unsubscribe or delete a contact by email address.", - "code": "" + "code": "// Unsubscribe a member (set status to 'unsubscribed').\nupdateMember({\n listId: $.configuration.listId,\n email: $.data.email,\n status: 'unsubscribed',\n});" }, "API Request (Beta)": { "description": "Raw HTTP request with authentication.", - "code": "" + "code": "// Make an arbitrary request to the Mailchimp API.\n// Path is relative to https://{dc}.api.mailchimp.com/3.0\nrequest('GET', '/ping');" } }, "SEARCH": { "Campaign Report": { "description": "Get report details for a specific sent campaign.", - "code": "" + "code": "// Fetch the summary report for a campaign.\nget(`/reports/${$.data.campaignId}`);" }, "Click Report": { "description": "Get report details for specific link clicks.", - "code": "" + "code": "// Fetch click-detail report for a campaign.\nget(`/reports/${$.data.campaignId}/click-details`);" }, "Find a Campaign": { "description": "Finds an existing campaign.", - "code": "" + "code": "// Fetch a single campaign by id.\nget(`/campaigns/${$.data.campaignId}`);" }, "Find a Subscriber": { "description": "Searches for a subscriber on your MailChimp audience.", - "code": "" + "code": "// Search every audience for a subscriber matching this email.\nget('/search-members', { query: $.data.email });" }, "Find Customer": { "description": "Finds a customer by email address.", - "code": "" + "code": "// Fetch an e-commerce customer by id on a store.\nget(`/ecommerce/stores/${$.data.storeId}/customers/${$.data.customerId}`);" }, "Find or Create Campaign": { "description": "Finds an existing campaign.", @@ -76,7 +76,7 @@ }, "Find Tag": { "description": "Find a tag.", - "code": "" + "code": "// Look up segments (tags) for a list.\nget(`/lists/${$.configuration.listId}/segments`, {\n type: 'static',\n});" } } } diff --git a/packages/mailgun/snippets.json b/packages/mailgun/snippets.json index 0099174602..c5dfd4134f 100644 --- a/packages/mailgun/snippets.json +++ b/packages/mailgun/snippets.json @@ -14,7 +14,7 @@ }, "Send Email": { "description": "Sends an email using your Mailgun account.", - "code": "" + "code": "// Send an email via Mailgun.\nsend({\n // Sender address. Use a domain you've verified in Mailgun.\n from: `OpenFn `,\n // Recipient (string, or array for multiple).\n to: $.data.recipient,\n subject: $.data.subject,\n // Plain-text and / or HTML bodies.\n text: $.data.body,\n // html: `

${$.data.body}

`,\n});" }, "Validate Email": { "description": "Validates an email address and returns deliverability results.", diff --git a/packages/mongodb/snippets.json b/packages/mongodb/snippets.json index 89da7f9907..2a8e648624 100644 --- a/packages/mongodb/snippets.json +++ b/packages/mongodb/snippets.json @@ -2,7 +2,7 @@ "CREATE": { "Insert New Document": { "description": "Inserts a new document into a MongoDB collection.", - "code": "" + "code": "// Insert one or more documents into a collection.\ninsertDocuments({\n // Database name.\n database: 'my_db',\n // Collection name.\n collection: 'users',\n // One or many documents.\n documents: [\n { email: $.data.email, name: $.data.name },\n ],\n});" } } } diff --git a/packages/mssql/snippets.json b/packages/mssql/snippets.json index d1249b5b17..3b2a952af3 100644 --- a/packages/mssql/snippets.json +++ b/packages/mssql/snippets.json @@ -2,25 +2,25 @@ "CREATE": { "New Row": { "description": "Adds a new row.", - "code": "" + "code": "// Insert a row into a SQL Server table.\ninsert(\n 'users',\n { name: 'Elodie', email: 'elodie@example.org', age: 31 },\n { writeSql: true }\n);" }, "Update Row": { "description": "Updates an existing row.", - "code": "" + "code": "// Update a row using a parameterised query.\n// In mssql, named parameters use @-prefixed placeholders.\nsql({\n query: 'UPDATE users SET email = @email WHERE id = @id;',\n params: { email: $.data.email, id: $.data.id },\n writeSql: true,\n});" } }, "SEARCH": { "Find Row": { "description": "Finds a row in a table via a lookup column.", - "code": "" + "code": "// Fetch a single value from a row matched by an equality filter.\nfindValue({\n uuid: 'id',\n relation: 'users',\n where: { email: $.data.email },\n});" }, "Find Row via Custom Query": { "description": "Finds a row in a table via a custom query you control.", - "code": "" + "code": "// Run a custom SELECT returning a single row.\nsql({\n query: 'SELECT TOP 1 * FROM users WHERE email = @email;',\n params: { email: $.data.email },\n});" }, "Find Rows via Custom Query": { "description": "Finds multiple rows in a table via a custom query you control.", - "code": "" + "code": "// Run a custom SELECT returning many rows.\nsql({\n query: 'SELECT id, name, email FROM users WHERE created_at > @since ORDER BY id;',\n params: { since: '2026-01-01' },\n});" } } } diff --git a/packages/mysql/snippets.json b/packages/mysql/snippets.json index cf0a3aa7ab..46a18a320e 100644 --- a/packages/mysql/snippets.json +++ b/packages/mysql/snippets.json @@ -2,21 +2,21 @@ "CREATE": { "New Row": { "description": "Adds a new row.", - "code": "" + "code": "// Insert a row into a MySQL table.\ninsert(\n 'users',\n { name: 'Elodie', email: 'elodie@example.org', age: 31 }\n);" }, "Update Row": { "description": "Updates an existing row.", - "code": "" + "code": "// Update a row using a parameterised query.\n// MySQL placeholders are positional `?` values.\nsql(\n 'UPDATE users SET email = ?, updated_at = NOW() WHERE id = ?;',\n { values: [$.data.email, $.data.id] }\n);" } }, "SEARCH": { "Find Row": { "description": "Finds a row in a table via a lookup column.", - "code": "" + "code": "// Fetch one row by equality filter.\nsql(\n 'SELECT * FROM users WHERE email = ? LIMIT 1;',\n { values: [$.data.email] }\n);" }, "Find Row via Custom Query": { "description": "Finds a row in a table via a custom query you control.", - "code": "" + "code": "// Run a custom SELECT.\nsql(\n 'SELECT id, name, email FROM users WHERE created_at > ? ORDER BY id;',\n { values: ['2026-01-01'] }\n);" } } } diff --git a/packages/nexmo/snippets.json b/packages/nexmo/snippets.json index d6928f5d0f..b5f88d37ad 100644 --- a/packages/nexmo/snippets.json +++ b/packages/nexmo/snippets.json @@ -2,7 +2,7 @@ "CREATE": { "Send SMS": { "description": "Send an SMS message.", - "code": "" + "code": "// Send an SMS via Vonage / Nexmo.\nsendSMS(\n // 1) Sender id (alphanumeric or your Vonage number, E.164).\n $.configuration.fromNumber,\n // 2) Recipient, E.164 format.\n $.data.phone,\n // 3) Message body.\n `Hi ${$.data.name}, your appointment is confirmed.`\n);" }, "Make Call": { "description": "Make a voice call.", diff --git a/packages/odoo/snippets.json b/packages/odoo/snippets.json index daa14f8052..48feb88f79 100644 --- a/packages/odoo/snippets.json +++ b/packages/odoo/snippets.json @@ -2,25 +2,25 @@ "CREATE": { "Create Lead": { "description": "Creates a lead.", - "code": "" + "code": "// Create a CRM lead in Odoo.\ncreate(\n // Odoo model name.\n 'crm.lead',\n // Field values.\n {\n name: $.data.opportunityName,\n contact_name: $.data.contactName,\n email_from: $.data.email,\n phone: $.data.phone,\n }\n);" }, "Create/Update Module Entry": { "description": "Creates or updates a module entry.", - "code": "" + "code": "// Create (or update) a record in any Odoo model.\n// To create:\ncreate('res.partner', {\n name: $.data.name,\n email: $.data.email,\n});\n\n// To update an existing record:\n// update('res.partner', $.data.partnerId, { email: $.data.email });" }, "Relate Module Entry": { "description": "Relates an entry in this module with an entry in another module.", - "code": "" + "code": "// Set a many2one relation field by writing the related id.\nupdate(\n // Model owning the relation field.\n 'crm.lead',\n // Record id on that model.\n $.data.leadId,\n // Many2one fields take just the related id.\n { partner_id: $.data.partnerId }\n);" } }, "SEARCH": { "Find Module Entry": { "description": "Finds an entry in a module.", - "code": "" + "code": "// Search a model with an Odoo domain filter and pull a single record back.\nsearchReadRecord(\n 'res.partner',\n // Odoo domain: array of triples or logical operators.\n [['email', '=', $.data.email]],\n // Fields to return.\n ['id', 'name', 'email']\n);" }, "Find Multiple Module Entries": { "description": "Finds multiple entries in a module (with line item support).", - "code": "" + "code": "// Search a model and return many records.\nsearchReadRecord(\n 'crm.lead',\n // Domain — leads created in the last 30 days.\n [['create_date', '>=', '2026-04-01']],\n ['id', 'name', 'email_from', 'stage_id']\n);" } } } diff --git a/packages/salesforce/snippets.json b/packages/salesforce/snippets.json index f8ed43dc0b..660e252fe6 100644 --- a/packages/salesforce/snippets.json +++ b/packages/salesforce/snippets.json @@ -2,7 +2,7 @@ "CREATE": { "Add Contact to Campaign": { "description": "Adds an existing contact to an existing campaign.", - "code": "" + "code": "// Add an existing Contact to an existing Campaign by inserting a CampaignMember.\ncreate('CampaignMember', {\n CampaignId: $.data.campaignId,\n ContactId: $.data.contactId,\n Status: 'Sent',\n});" }, "Add File to Record": { "description": "Adds an existing file to an existing Record.", @@ -10,7 +10,7 @@ }, "Create Record": { "description": "Creates a new record of a specified Salesforce object.", - "code": "" + "code": "// Create a record on any sObject.\ncreate(\n // 1) API name of the sObject.\n 'Account',\n // 2) Field values, or an array of objects for bulk insert.\n {\n Name: $.data.accountName,\n Industry: $.data.industry,\n }\n);" }, "Send Email": { "description": "Sends an email using Salesforce Simple Email Actions.", @@ -18,21 +18,21 @@ }, "Update Lead": { "description": "Updates an existing lead.", - "code": "" + "code": "// Update an existing Lead (Id is required in the payload).\nupdate('Lead', {\n Id: $.data.leadId,\n Status: 'Qualified',\n Email: $.data.email,\n});" }, "Update Record": { "description": "Updates an existing record of a specified Salesforce object.", - "code": "" + "code": "// Update any sObject record. Id field is required.\nupdate($.data.sObjectName, {\n Id: $.data.recordId,\n ...$.data.fields,\n});" }, "API Request (Beta)": { "description": "Raw HTTP request with authentication.", - "code": "" + "code": "// Make a raw, authenticated request against the Salesforce REST API.\nsfRequest({\n method: 'GET',\n url: '/services/data/v59.0/limits',\n});" } }, "SEARCH": { "Execute SOQL Query": { "description": "Custom SOQL SELECT queries with aggregate function support.", - "code": "" + "code": "// Run a SOQL query.\nquery(\n `SELECT Id, Name, Email FROM Contact WHERE Email = '${$.data.email}' LIMIT 1`\n);" }, "Execute SOSL Search": { "description": "Custom SOSL queries for text-based searches across multiple objects.", @@ -40,27 +40,27 @@ }, "Find Child Records": { "description": "Finds Child Records for a given Parent ID.", - "code": "" + "code": "// Find child Contacts for a given Account using SOQL.\nquery(\n `SELECT Id, Name FROM Contact WHERE AccountId = '${$.data.accountId}'`\n);" }, "Find Record": { "description": "Finds a record by up to two fields and values.", - "code": "" + "code": "// Find one record by a couple of fields.\nquery(\n `SELECT Id, Name FROM Account WHERE Name = '${$.data.name}' AND Industry = '${$.data.industry}' LIMIT 1`\n);" }, "Find Record (SOQL)": { "description": "Finds a record using a SOQL WHERE clause.", - "code": "" + "code": "// Find a record using a SOQL WHERE clause you control.\nquery(\n `SELECT Id, Name FROM Account WHERE ${$.data.whereClause} LIMIT 1`\n);" }, "Find Records (Line Items)": { "description": "Finds records by a field and value (with line-item support).", - "code": "" + "code": "// Find many records by a single field/value match.\nquery(\n `SELECT Id, Name, Email FROM Contact WHERE AccountId = '${$.data.accountId}' LIMIT 200`\n);" }, "Find Records (SOQL)": { "description": "Finds one or more records using a SOQL WHERE clause (with line item support).", - "code": "" + "code": "// Find many records using a SOQL WHERE clause you control.\nquery(\n `SELECT Id, Name FROM Account WHERE ${$.data.whereClause} LIMIT 200`\n);" }, "Get Notes and Attachments": { "description": "Gets all notes and attachments for a record.", - "code": "" + "code": "// Pull ContentDocumentLink rows for a record to enumerate attached files.\nquery(\n `SELECT ContentDocumentId, ContentDocument.Title, ContentDocument.FileType ` +\n `FROM ContentDocumentLink WHERE LinkedEntityId = '${$.data.recordId}'`\n);" } } } diff --git a/packages/whatsapp/snippets.json b/packages/whatsapp/snippets.json index 3ff9dcb15d..350abb6783 100644 --- a/packages/whatsapp/snippets.json +++ b/packages/whatsapp/snippets.json @@ -2,15 +2,15 @@ "CREATE": { "Send Freeform Message": { "description": "Send a freeform text message (within 24-hour window only).", - "code": "" + "code": "// Send a freeform text message via the WhatsApp Business API.\n// Only allowed within the 24-hour customer-service window.\nrequest('POST', 'messages', {\n messaging_product: 'whatsapp',\n to: $.data.toPhone, // E.164, no '+' (e.g. '254712345678')\n type: 'text',\n text: { body: $.data.body },\n});" }, "Send Media Message": { "description": "Send a media message (document, image, video, or audio) within 24-hour window.", - "code": "" + "code": "// Send a media attachment. `type` is one of image | video | document | audio.\nrequest('POST', 'messages', {\n messaging_product: 'whatsapp',\n to: $.data.toPhone,\n type: 'image',\n image: {\n // Either a public URL...\n link: $.data.imageUrl,\n // ...or `id` referencing a previously uploaded media id.\n caption: $.data.caption,\n },\n});" }, "Send Template Message": { "description": "Sends an approved template message.", - "code": "" + "code": "// Send an approved WhatsApp template message.\nrequest('POST', 'messages', {\n messaging_product: 'whatsapp',\n to: $.data.toPhone,\n type: 'template',\n template: {\n name: 'hello_world',\n language: { code: 'en_US' },\n // Template body variables, if your template uses {{1}}, {{2}}, ...\n // components: [{\n // type: 'body',\n // parameters: [{ type: 'text', text: $.data.firstName }],\n // }],\n },\n});" } } }