AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(webflow): let AI agents manage Webflow sites, CMS, pages, assets and forms (#17069)
Kishan Parmar2963619bcdc0
diff --git a/bun.lock b/bun.lockindex 1ca87b0fcc6..5014ec127ce 100644--- a/bun.lock+++ b/bun.lock@@ -9986,7 +9986,7 @@},"packages/pieces/community/webflow": {"name": "@activepieces/piece-webflow",- "version": "0.3.0",+ "version": "0.4.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*",diff --git a/docs/install/reference/breaking-changes-unreleased.mdx b/docs/install/reference/breaking-changes-unreleased.mdxindex 029594e3366..f40896716dd 100644--- a/docs/install/reference/breaking-changes-unreleased.mdx+++ b/docs/install/reference/breaking-changes-unreleased.mdx@@ -8,6 +8,27 @@ Entries here move to [Breaking Changes](/install/reference/breaking-changes) aut## What has changed?+#### Webflow 0.4.0: moves to Webflow API v2, connections need reconnecting, and step outputs change++Webflow switched off its v1 API, which every Webflow action and the New Submission trigger used. They now call v2, and the connection asks for the v2 permissions (CMS, sites, pages, forms, assets, custom code, comments, components and ecommerce).++After you upgrade a Webflow step:++- Collection item steps return `id`, `isDraft`, `isArchived` and the field values under `fieldData` (before: `_id`, `_draft`, `_archived` and the fields at the top level). Find Collection Item returns items in the same shape.+- List Sites and List Collections return `id` and `displayName` instead of `_id` and `name`.+- Delete Collection Item returns `success` and `collectionItemId`.+- Update Collection Item changes only the fields you fill in, instead of replacing the whole item.+- New Submission delivers `siteId`, `submittedAt`, `id` and `formId` (before: `site`, `d` and `_id`). The submitted values stay under `data`.+- List Sites, List Collections and the collection item actions are now shown only in the flow builder; AI agents and MCP clients get the new Webflow AI actions instead.++#### What you need to do++- Reconnect each Webflow connection once, and pick the sites it may reach on the Webflow consent screen.+- Remap later steps that read `_id`, `name`, `_draft`, `_archived`, `site`, `d` or item fields at the top level.+- Turn flows that use New Submission off and on again so the webhook is registered through v2.++Steps keep running on the version they were built with until you upgrade them.+#### Audit logs: SAML and embedded sign-ins no longer send `user.signed.up` on every sign-in`user.signed.up` used to fire on every SAML and embedded (JWT) sign-in, even for existing members. It now fires once, when the member is created. Later SAML sign-ins, and sign-ins with email or Google, send the new `user.signed.in` event, which carries the sign-in method. Later embedded sign-ins send no event.diff --git a/packages/pieces/community/webflow/package.json b/packages/pieces/community/webflow/package.jsonindex 56f7b9dd68e..0f71a9ce11d 100644--- a/packages/pieces/community/webflow/package.json+++ b/packages/pieces/community/webflow/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-webflow",- "version": "0.3.0",+ "version": "0.4.0","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","scripts": {diff --git a/packages/pieces/community/webflow/src/index.ts b/packages/pieces/community/webflow/src/index.tsindex 18d1673c93e..01afec2a56a 100644--- a/packages/pieces/community/webflow/src/index.ts+++ b/packages/pieces/community/webflow/src/index.ts@@ -1,32 +1,26 @@import { createCustomApiCallAction } from '@activepieces/pieces-common';-import { OAuth2PropertyValue, PieceAuth, createPiece } from '@activepieces/pieces-framework';-import { PieceCategory } from '@activepieces/pieces-framework';-import { webflowCreateCollectionItemAction } from './lib/actions/create-collection-item';-import { webflowDeleteCollectionItem } from './lib/actions/delete-collection-item';-import { webflowFindCollectionItem } from './lib/actions/find-collection-item';-import { webflowFindOrder } from './lib/actions/find-order';-import { webflowFulfillOrder } from './lib/actions/fulfill-order';-import { webflowGetCollectionItem } from './lib/actions/get-collection-item';-import { webflowRefundOrder } from './lib/actions/refund-order';-import { webflowUnfulfillOrder } from './lib/actions/unfulfill-order';-import { webflowUpdateCollectionItem } from './lib/actions/update-collection-item';-import { webflowPublishCollectionItem } from './lib/actions/publish-collection-item';-import { webflowListSites } from './lib/actions/list-sites';-import { webflowListCollections } from './lib/actions/list-collections';-import { webflowNewSubmission } from './lib/triggers/new-form-submitted';--export const webflowAuth = PieceAuth.OAuth2({- description: '',- authUrl: 'https://webflow.com/oauth/authorize',- tokenUrl: 'https://api.webflow.com/oauth/access_token',- required: true,- scope: ['webhooks:write', 'forms:read'],-});+import { createPiece, PieceCategory } from '@activepieces/pieces-framework';+import { createCollectionItemAction } from './lib/actions/create-collection-item';+import { deleteCollectionItemAction } from './lib/actions/delete-collection-item';+import { findCollectionItemAction } from './lib/actions/find-collection-item';+import { findOrderAction } from './lib/actions/find-order';+import { fulfillOrderAction } from './lib/actions/fulfill-order';+import { getCollectionItemAction } from './lib/actions/get-collection-item';+import { listCollectionsAction } from './lib/actions/list-collections';+import { listSitesAction } from './lib/actions/list-sites';+import { publishCollectionItemAction } from './lib/actions/publish-collection-item';+import { refundOrderAction } from './lib/actions/refund-order';+import { unfulfillOrderAction } from './lib/actions/unfulfill-order';+import { updateCollectionItemAction } from './lib/actions/update-collection-item';+import { webflowAiActions } from './lib/actions/ai';+import { webflowAuth } from './lib/auth';+import { webflowClient } from './lib/common/client';+import { formSubmittedTrigger } from './lib/triggers/form-submitted';export const webflow = createPiece({displayName: 'Webflow',description: 'Design, build, and launch responsive websites visually',- minimumSupportedRelease: '0.5.0',+ minimumSupportedRelease: '0.88.2',logoUrl: 'https://cdn.activepieces.com/pieces/webflow.png',categories: [PieceCategory.MARKETING],authors: [@@ -40,25 +34,26 @@ export const webflow = createPiece({],auth: webflowAuth,actions: [- webflowCreateCollectionItemAction,- webflowDeleteCollectionItem,- webflowUpdateCollectionItem,- webflowFindCollectionItem,- webflowGetCollectionItem,- webflowFulfillOrder,- webflowUnfulfillOrder,- webflowRefundOrder,- webflowFindOrder,- webflowPublishCollectionItem,- webflowListSites,- webflowListCollections,+ createCollectionItemAction,+ deleteCollectionItemAction,+ updateCollectionItemAction,+ findCollectionItemAction,+ getCollectionItemAction,+ fulfillOrderAction,+ unfulfillOrderAction,+ refundOrderAction,+ findOrderAction,+ publishCollectionItemAction,+ listSitesAction,+ listCollectionsAction,+ ...webflowAiActions,createCustomApiCallAction({- baseUrl: () => 'https://api.webflow.com',+ baseUrl: () => webflowClient.baseUrl(),auth: webflowAuth,authMapping: async (auth) => ({- Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`,+ Authorization: `Bearer ${auth.access_token}`,}),}),],- triggers: [webflowNewSubmission],+ triggers: [formSubmittedTrigger],});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/create-asset-folder.ts b/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/create-asset-folder.tsnew file mode 100644index 00000000000..77ea6f10297--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/create-asset-folder.ts@@ -0,0 +1,46 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateAssetFolderOutputSchema } from '../../../output-schemas';++export const createAssetFolderAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_asset_folder',+ outputSchema: webflowCreateAssetFolderOutputSchema,+ displayName: 'Create Asset Folder',+ description: 'Creates an asset folder on a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates an asset folder on a site, at the root or inside another folder. Upload Asset can then put files in it. Get the site id from List Sites and the parent folder id from List Asset Folders.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ displayName: Property.ShortText({+ displayName: 'Name',+ description: 'Name of the folder, e.g. "Blog images".',+ required: true,+ }),+ parentFolder: Property.ShortText({+ displayName: 'Parent Folder ID',+ description: 'Asset folder to create this folder in. Use List Asset Folders to find it. Defaults to the root.',+ required: false,+ }),+ },+ async run(context) {+ const { siteId, displayName, parentFolder } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/asset_folders`,+ body: {+ displayName,+ ...(parentFolder ? { parentFolder } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/get-asset-folder.ts b/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/get-asset-folder.tsnew file mode 100644index 00000000000..cc70cdb3f06--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/get-asset-folder.ts@@ -0,0 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowCreateAssetFolderOutputSchema } from '../../../output-schemas';++export const getAssetFolderAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_asset_folder',+ outputSchema: webflowCreateAssetFolderOutputSchema,+ displayName: 'Get Asset Folder',+ description: 'Gets the details of an asset folder.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one asset folder's name, parent folder and the ids of the assets it holds. Get the folder id from List Asset Folders or Create Asset Folder.",+ idempotent: true,+ },+ props: {+ assetFolderId: Property.ShortText({+ displayName: 'Asset Folder ID',+ description: 'Asset folder ID. Use List Asset Folders to find it.',+ required: true,+ }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/asset_folders/${encodeURIComponent(context.propsValue.assetFolderId)}`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/list-asset-folders.ts b/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/list-asset-folders.tsnew file mode 100644index 00000000000..d5df78f89ec--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/asset-folders/list-asset-folders.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListAssetFoldersOutputSchema } from '../../../output-schemas';++export const listAssetFoldersAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_asset_folders',+ outputSchema: webflowListAssetFoldersOutputSchema,+ displayName: 'List Asset Folders',+ description: 'Lists the asset folders of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the asset folders of a site, with each folder's id, name, parent folder and the asset ids it holds. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/asset_folders`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/assets/delete-asset.ts b/packages/pieces/community/webflow/src/lib/actions/ai/assets/delete-asset.tsnew file mode 100644index 00000000000..4b0fb5f0c40--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/assets/delete-asset.ts@@ -0,0 +1,36 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowDeleteAssetOutputSchema } from '../../../output-schemas';++export const deleteAssetAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_asset',+ outputSchema: webflowDeleteAssetOutputSchema,+ displayName: 'Delete Asset',+ description: 'Permanently deletes an asset.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes an asset from the site; it cannot be restored. Get the asset id from List Assets or Upload Asset.',+ idempotent: false,+ },+ props: {+ assetId: Property.ShortText({+ displayName: 'Asset ID',+ description: 'Asset ID. Use List Assets to find it.',+ required: true,+ }),+ },+ async run(context) {+ const { assetId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/assets/${encodeURIComponent(assetId)}`,+ });+ return { success: true, assetId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/assets/get-asset.ts b/packages/pieces/community/webflow/src/lib/actions/ai/assets/get-asset.tsnew file mode 100644index 00000000000..3daec8adb02--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/assets/get-asset.ts@@ -0,0 +1,43 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowGetAssetOutputSchema } from '../../../output-schemas';++export const getAssetAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_asset',+ outputSchema: webflowGetAssetOutputSchema,+ displayName: 'Get Asset',+ description: 'Gets the details of an asset.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one asset's details: file name, display name, alt text, hosted URL, size, content type, folder and image variants. Get the asset id from List Assets or Upload Asset.",+ idempotent: true,+ },+ props: {+ assetId: Property.ShortText({+ displayName: 'Asset ID',+ description: 'Asset ID. Use List Assets to find it.',+ required: true,+ }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read the localized alt text for. Get Site returns the site locales. Defaults to the primary locale.',+ required: false,+ }),+ },+ async run(context) {+ const { assetId, localeId } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/assets/${encodeURIComponent(assetId)}`,+ query: {+ ...(localeId ? { localeId } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/assets/list-assets.ts b/packages/pieces/community/webflow/src/lib/actions/ai/assets/list-assets.tsnew file mode 100644index 00000000000..a410458d81d--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/assets/list-assets.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListAssetsOutputSchema } from '../../../output-schemas';++export const listAssetsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_assets',+ outputSchema: webflowListAssetsOutputSchema,+ displayName: 'List Assets',+ description: 'Lists the assets of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the images and files uploaded to a site, with each asset's id, file name, hosted URL, size and folder. Pages with limit and offset. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/assets`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/assets/update-asset.ts b/packages/pieces/community/webflow/src/lib/actions/ai/assets/update-asset.tsnew file mode 100644index 00000000000..148ad8bfbe7--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/assets/update-asset.ts@@ -0,0 +1,60 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowGetAssetOutputSchema } from '../../../output-schemas';++export const updateAssetAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_asset',+ outputSchema: webflowGetAssetOutputSchema,+ displayName: 'Update Asset',+ description: 'Updates the display name or alt text of an asset.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Sets an asset's display name and/or alt text; fields left empty keep their value. Set at least one. Alt text is per locale, the display name is not. Get the asset id from List Assets or Upload Asset.",+ idempotent: true,+ },+ props: {+ assetId: Property.ShortText({+ displayName: 'Asset ID',+ description: 'Asset ID. Use List Assets to find it.',+ required: true,+ }),+ displayName: Property.ShortText({+ displayName: 'Display Name',+ description: 'New human-readable name for the asset.',+ required: false,+ }),+ altText: Property.ShortText({+ displayName: 'Alt Text',+ description: 'New alternate text describing the image.',+ required: false,+ }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to set the alt text for. Get Site returns the site locales. Defaults to the primary locale.',+ required: false,+ }),+ },+ async run(context) {+ const { assetId, displayName, altText, localeId } = context.propsValue;+ if (displayName === undefined && altText === undefined) {+ throw new Error('Set displayName or altText.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/assets/${encodeURIComponent(assetId)}`,+ query: {+ ...(localeId ? { localeId } : {}),+ },+ body: {+ ...(displayName !== undefined ? { displayName } : {}),+ ...(altText !== undefined ? { altText } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/assets/upload-asset.ts b/packages/pieces/community/webflow/src/lib/actions/ai/assets/upload-asset.tsnew file mode 100644index 00000000000..706e1aea0ee--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/assets/upload-asset.ts@@ -0,0 +1,70 @@+import { createHash } from 'node:crypto';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property, tryCatch } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowUploadAssetOutputSchema } from '../../../output-schemas';++export const uploadAssetAction = createAction({+ auth: webflowAuth,+ name: 'webflow_upload_asset',+ outputSchema: webflowUploadAssetOutputSchema,+ displayName: 'Upload Asset',+ description: 'Uploads a file to the assets of a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Uploads a file as a new site asset: creates the asset record, then uploads the file bytes to Webflow storage. If the upload fails the asset record still exists; the error gives its id so it can be removed with Delete Asset. Get the site id from List Sites and the folder id from List Asset Folders or Create Asset Folder.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ file: Property.File({+ displayName: 'File',+ description: 'The file to upload.',+ required: true,+ }),+ fileName: Property.ShortText({+ displayName: 'File Name',+ description: 'File name with extension, under 100 characters, e.g. "hero.png". Defaults to the uploaded file name.',+ required: false,+ }),+ parentFolder: Property.ShortText({+ displayName: 'Asset Folder ID',+ description: 'Asset folder to put the asset in. Use List Asset Folders to find it. Defaults to the root.',+ required: false,+ }),+ },+ async run(context) {+ const { siteId, file, fileName, parentFolder } = context.propsValue;+ const { uploadUrl, uploadDetails, ...asset } = await webflowClient.request<CreateAssetResponse>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/assets`,+ body: {+ fileName: fileName ?? file.filename,+ fileHash: createHash('md5').update(file.data).digest('hex'),+ ...(parentFolder ? { parentFolder } : {}),+ },+ });+ const { error } = await tryCatch(() =>+ webflowClient.uploadFile({ url: uploadUrl, fields: uploadDetails, data: file.data, fileName: fileName ?? file.filename, contentType: asset.contentType }),+ );+ if (error) {+ throw new Error(+ `The asset record was created (id ${asset.id}) but the file upload failed: ${error.message}. Delete Asset removes the empty record.`,+ );+ }+ return asset;+ },+});++type CreateAssetResponse = {+ id: string;+ contentType?: string;+ uploadUrl: string;+ uploadDetails: Record<string, unknown>;+ [key: string]: unknown;+};diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/create-collection-field.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/create-collection-field.tsnew file mode 100644index 00000000000..7043ba35446--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/create-collection-field.ts@@ -0,0 +1,101 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCollectionFieldOutputSchema } from '../../../output-schemas';++export const createCollectionFieldAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_collection_field',+ outputSchema: webflowCreateCollectionFieldOutputSchema,+ displayName: 'Create Collection Field',+ description: 'Adds a custom field to a CMS collection.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Adds one custom field to a CMS collection. Option fields need Options; Reference and MultiReference fields need Referenced Collection ID. To add several fields at once, pass them to Create Collection instead. Get the collection id from List Collections.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ type: Property.StaticDropdown({+ displayName: 'Type',+ description: 'Field type.',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Color', value: 'Color' },+ { label: 'DateTime', value: 'DateTime' },+ { label: 'Email', value: 'Email' },+ { label: 'File', value: 'File' },+ { label: 'Image', value: 'Image' },+ { label: 'Link', value: 'Link' },+ { label: 'MultiImage', value: 'MultiImage' },+ { label: 'MultiReference', value: 'MultiReference' },+ { label: 'Number', value: 'Number' },+ { label: 'Option', value: 'Option' },+ { label: 'Phone', value: 'Phone' },+ { label: 'PlainText', value: 'PlainText' },+ { label: 'Reference', value: 'Reference' },+ { label: 'RichText', value: 'RichText' },+ { label: 'Switch', value: 'Switch' },+ { label: 'VideoLink', value: 'VideoLink' },+ ],+ },+ }),+ displayName: Property.ShortText({+ displayName: 'Name',+ description: 'Name of the field, e.g. "Post Body".',+ required: true,+ }),+ isRequired: webflowAiProps.flag({+ required: false,+ displayName: 'Required',+ description: 'Whether items must have a value for this field.',+ }),+ helpText: Property.ShortText({+ displayName: 'Help Text',+ description: 'Hint shown to whoever fills in the field.',+ required: false,+ }),+ options: Property.Array({+ displayName: 'Options',+ description: 'Choice names for an Option field, e.g. ["Feature", "News"]. Only for type Option.',+ required: false,+ }),+ referencedCollectionId: Property.ShortText({+ displayName: 'Referenced Collection ID',+ description:+ 'Collection the field points to. Only for type Reference or MultiReference. Use List Collections to find it.',+ required: false,+ }),+ },+ async run(context) {+ const { collectionId, type, displayName, isRequired, helpText, options, referencedCollectionId } =+ context.propsValue;+ const optionNames = options ?? [];+ const isReference = type === 'Reference' || type === 'MultiReference';+ if ((type === 'Option') !== optionNames.length > 0) {+ throw new Error('options is required for type Option and only allowed for it.');+ }+ if (isReference !== Boolean(referencedCollectionId)) {+ throw new Error('referencedCollectionId is required for type Reference or MultiReference and only allowed for them.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/fields`,+ body: {+ type,+ displayName,+ ...(isRequired !== undefined ? { isRequired: isRequired === 'true' } : {}),+ ...(helpText ? { helpText } : {}),+ ...(type === 'Option' ? { metadata: { options: optionNames.map((name) => ({ name })) } } : {}),+ ...(isReference ? { metadata: { collectionId: referencedCollectionId } } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/create-collection.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/create-collection.tsnew file mode 100644index 00000000000..5ea700692d9--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/create-collection.ts@@ -0,0 +1,62 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCollectionOutputSchema } from '../../../output-schemas';++export const createCollectionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_collection',+ outputSchema: webflowCreateCollectionOutputSchema,+ displayName: 'Create Collection',+ description: 'Creates a CMS collection on a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a CMS collection on a site, optionally with its custom fields. Webflow adds the Name and Slug fields itself. Add more fields later with Create Collection Field. Collection names must be unique on the site. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ displayName: Property.ShortText({+ displayName: 'Name',+ description: 'Plural name of the collection, e.g. "Blog Posts". Must be unique on the site.',+ required: true,+ }),+ singularName: Property.ShortText({+ displayName: 'Singular Name',+ description: 'Name of one item, e.g. "Blog Post".',+ required: true,+ }),+ slug: Property.ShortText({+ displayName: 'Slug',+ description: 'URL part for the collection, e.g. "blog-posts". Webflow derives it from the name when empty.',+ required: false,+ }),+ fields: Property.Json({+ displayName: 'Fields',+ description:+ 'Custom fields as a JSON array, each {"type", "displayName", "isRequired"?, "helpText"?}. type is one of Color, DateTime, Email, File, Image, Link, MultiImage, Number, Phone, PlainText, RichText, Switch, VideoLink; Option needs "metadata": {"options": [{"name": "..."}]}; Reference and MultiReference need "metadata": {"collectionId": "..."}.',+ required: false,+ }),+ },+ async run(context) {+ const { siteId, displayName, singularName, slug, fields } = context.propsValue;+ if (fields !== undefined && !Array.isArray(fields)) {+ throw new Error('fields must be a JSON array of field objects.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/collections`,+ body: {+ displayName,+ singularName,+ ...(slug ? { slug } : {}),+ ...(fields && fields.length > 0 ? { fields } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/delete-collection-field.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/delete-collection-field.tsnew file mode 100644index 00000000000..51700360f34--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/delete-collection-field.ts@@ -0,0 +1,38 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCollectionFieldOutputSchema } from '../../../output-schemas';++export const deleteCollectionFieldAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_collection_field',+ outputSchema: webflowDeleteCollectionFieldOutputSchema,+ displayName: 'Delete Collection Field',+ description: 'Deletes a custom field from a CMS collection.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ "Permanently deletes a custom field and its values on every item of the collection; there is no undo. Webflow's own Name and Slug fields cannot be deleted. Get the collection id from List Collections and the field id from Get Collection.",+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ fieldId: Property.ShortText({+ displayName: 'Field ID',+ description: 'Field to delete. Use Get Collection to find it.',+ required: true,+ }),+ },+ async run(context) {+ const { collectionId, fieldId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}`,+ });+ return { success: true, collectionId, fieldId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/delete-collection.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/delete-collection.tsnew file mode 100644index 00000000000..cc92aedfacc--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/delete-collection.ts@@ -0,0 +1,32 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCollectionOutputSchema } from '../../../output-schemas';++export const deleteCollectionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_collection',+ outputSchema: webflowDeleteCollectionOutputSchema,+ displayName: 'Delete Collection',+ description: 'Deletes a CMS collection and all of its items.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a CMS collection together with all of its items and fields; there is no undo. Get the collection id from List Collections.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ },+ async run(context) {+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(context.propsValue.collectionId)}`,+ });+ return { success: true, collectionId: context.propsValue.collectionId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/get-collection.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/get-collection.tsnew file mode 100644index 00000000000..2c24269fb20--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/get-collection.ts@@ -0,0 +1,29 @@+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowApi } from '../../../common/api';+import { webflowCreateCollectionOutputSchema } from '../../../output-schemas';++export const getCollectionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_collection',+ outputSchema: webflowCreateCollectionOutputSchema,+ displayName: 'Get Collection',+ description: 'Gets a CMS collection with its fields.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one CMS collection's name, slug, field groups and every field with its id, slug, type, required flag and validations (Option choices, Reference target). Read it before writing items to learn the field slugs. Get the collection id from List Collections.",+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ },+ async run(context) {+ return await webflowApi.getCollection({+ auth: context.auth,+ collectionId: context.propsValue.collectionId,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/list-collections.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/list-collections.tsnew file mode 100644index 00000000000..c59365c9576--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/list-collections.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCollectionsOutputSchema } from '../../../output-schemas';++export const listCollectionsAiAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_collections',+ outputSchema: webflowListCollectionsOutputSchema,+ displayName: 'List Collections',+ description: 'Lists the CMS collections of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the CMS collections of a site with each collection's id, name and slug. Use Get Collection for a collection's fields. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/collections`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/update-collection-field.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/update-collection-field.tsnew file mode 100644index 00000000000..c55ff0917d2--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/update-collection-field.ts@@ -0,0 +1,60 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCollectionFieldOutputSchema } from '../../../output-schemas';++export const updateCollectionFieldAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_collection_field',+ outputSchema: webflowCreateCollectionFieldOutputSchema,+ displayName: 'Update Collection Field',+ description: "Updates a collection field's name, help text or required flag.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Changes a custom field's name, help text or required flag; only the values given are changed and the type cannot change. Get the collection id from List Collections and the field id from Get Collection.",+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ fieldId: Property.ShortText({+ displayName: 'Field ID',+ description: 'Field to update. Use Get Collection to find it.',+ required: true,+ }),+ displayName: Property.ShortText({+ displayName: 'Name',+ description: 'New name of the field.',+ required: false,+ }),+ helpText: Property.ShortText({+ displayName: 'Help Text',+ description: 'New hint shown to whoever fills in the field.',+ required: false,+ }),+ isRequired: webflowAiProps.flag({+ required: false,+ displayName: 'Required',+ description: 'Whether items must have a value for this field.',+ }),+ },+ async run(context) {+ const { collectionId, fieldId, displayName, helpText, isRequired } = context.propsValue;+ if (displayName === undefined && helpText === undefined && isRequired === undefined) {+ throw new Error('Set at least one of displayName, helpText or isRequired.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}`,+ body: {+ ...(displayName !== undefined ? { displayName } : {}),+ ...(helpText !== undefined ? { helpText } : {}),+ ...(isRequired !== undefined ? { isRequired: isRequired === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/collections/update-collection.ts b/packages/pieces/community/webflow/src/lib/actions/ai/collections/update-collection.tsnew file mode 100644index 00000000000..bde200198a7--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/collections/update-collection.ts@@ -0,0 +1,65 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowUpdateCollectionOutputSchema } from '../../../output-schemas';++export const updateCollectionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_collection',+ outputSchema: webflowUpdateCollectionOutputSchema,+ displayName: 'Update Collection',+ description: "Updates a CMS collection's name, singular name, slug or field groups.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Changes a CMS collection's name, singular name, slug or field groups; only the values given are changed. Field Groups replaces all existing groups. To change fields use Update Collection Field. Get the collection id from List Collections and field ids from Get Collection.",+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ displayName: Property.ShortText({+ displayName: 'Name',+ description: 'New plural name of the collection, e.g. "Blog Posts".',+ required: false,+ }),+ singularName: Property.ShortText({+ displayName: 'Singular Name',+ description: 'New name of one item, e.g. "Blog Post".',+ required: false,+ }),+ slug: Property.ShortText({+ displayName: 'Slug',+ description: 'New URL part for the collection, e.g. "blog-posts".',+ required: false,+ }),+ fieldGroups: Property.Json({+ displayName: 'Field Groups',+ description:+ 'Replaces all field groups. JSON array, each {"displayName", "fieldIds": [...], "description"?}. Names and field ids must be unique across groups; at most 50 groups. Not supported on Ecommerce collections.',+ required: false,+ }),+ },+ async run(context) {+ const { collectionId, displayName, singularName, slug, fieldGroups } = context.propsValue;+ if (fieldGroups !== undefined && !Array.isArray(fieldGroups)) {+ throw new Error('fieldGroups must be a JSON array of field group objects.');+ }+ if (displayName === undefined && singularName === undefined && slug === undefined && fieldGroups === undefined) {+ throw new Error('Set at least one of displayName, singularName, slug or fieldGroups.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}`,+ body: {+ ...(displayName !== undefined ? { displayName } : {}),+ ...(singularName !== undefined ? { singularName } : {}),+ ...(slug !== undefined ? { slug } : {}),+ ...(fieldGroups !== undefined ? { fieldGroups } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/comments/create-comment-reply.ts b/packages/pieces/community/webflow/src/lib/actions/ai/comments/create-comment-reply.tsnew file mode 100644index 00000000000..bb1db6b1ff1--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/comments/create-comment-reply.ts@@ -0,0 +1,43 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCommentReplyOutputSchema } from '../../../output-schemas';++export const createCommentReplyAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_comment_reply',+ outputSchema: webflowCreateCommentReplyOutputSchema,+ displayName: 'Create Comment Reply',+ description: 'Replies to a comment thread.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Adds a reply to a Designer comment thread; each call adds another reply. Mention a user with [[userId]] in the content. Get the site id from List Sites and the thread id from List Comment Threads.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ commentThreadId: Property.ShortText({+ displayName: 'Comment Thread ID',+ description: 'Comment thread ID. Use List Comment Threads to find it.',+ required: true,+ }),+ content: Property.LongText({+ displayName: 'Content',+ description: 'Reply text, up to 2040 characters. To @mention a user, include their user ID as [[userId]].',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, commentThreadId, content } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}/replies`,+ body: { content },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/comments/get-comment-thread.ts b/packages/pieces/community/webflow/src/lib/actions/ai/comments/get-comment-thread.tsnew file mode 100644index 00000000000..f9de68f35a3--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/comments/get-comment-thread.ts@@ -0,0 +1,45 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetCommentThreadOutputSchema } from '../../../output-schemas';++export const getCommentThreadAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_comment_thread',+ outputSchema: webflowGetCommentThreadOutputSchema,+ displayName: 'Get Comment Thread',+ description: 'Gets one comment thread on a site.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one Designer comment thread by id, with its page, content, author and resolved state. Use List Comment Replies for the replies. Get the site id from List Sites and the thread id from List Comment Threads.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ commentThreadId: Property.ShortText({+ displayName: 'Comment Thread ID',+ description: 'Comment thread ID. Use List Comment Threads to find it.',+ required: true,+ }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read the thread in. Leave empty for the primary locale.',+ required: false,+ }),+ },+ async run(context) {+ const { siteId, commentThreadId, localeId } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}`,+ query: {+ ...(localeId ? { localeId } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/comments/list-comment-replies.ts b/packages/pieces/community/webflow/src/lib/actions/ai/comments/list-comment-replies.tsnew file mode 100644index 00000000000..60cb85dc870--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/comments/list-comment-replies.ts@@ -0,0 +1,75 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCommentRepliesOutputSchema } from '../../../output-schemas';++export const listCommentRepliesAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_comment_replies',+ outputSchema: webflowListCommentRepliesOutputSchema,+ displayName: 'List Comment Replies',+ description: 'Lists the replies in a comment thread.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the replies in a Designer comment thread with each reply's id, content, author and timestamps. Pages with limit and offset. Get the site id from List Sites and the thread id from List Comment Threads.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ commentThreadId: Property.ShortText({+ displayName: 'Comment Thread ID',+ description: 'Comment thread ID. Use List Comment Threads to find it.',+ required: true,+ }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read the replies in. Leave empty for the primary locale.',+ required: false,+ }),+ sortBy: Property.StaticDropdown({+ displayName: 'Sort By',+ description: 'Field to sort by. Needs Sort Order.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Created On', value: 'createdOn' },+ { label: 'Last Updated', value: 'lastUpdated' },+ ],+ },+ }),+ sortOrder: Property.StaticDropdown({+ displayName: 'Sort Order',+ description: 'Sort direction.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Ascending', value: 'asc' },+ { label: 'Descending', value: 'desc' },+ ],+ },+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { siteId, commentThreadId, localeId, sortBy, sortOrder, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}/replies`,+ query: {+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ ...(localeId ? { localeId } : {}),+ ...(sortBy ? { sortBy } : {}),+ ...(sortOrder ? { sortOrder } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/comments/list-comment-threads.ts b/packages/pieces/community/webflow/src/lib/actions/ai/comments/list-comment-threads.tsnew file mode 100644index 00000000000..e531c73aa2a--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/comments/list-comment-threads.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCommentThreadsOutputSchema } from '../../../output-schemas';++export const listCommentThreadsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_comment_threads',+ outputSchema: webflowListCommentThreadsOutputSchema,+ displayName: 'List Comment Threads',+ description: 'Lists the comment threads on a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the Designer comment threads on a site with each thread's id, page, content and resolved state. Pages with limit and offset. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/comments`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/comments/resolve-comment-thread.ts b/packages/pieces/community/webflow/src/lib/actions/ai/comments/resolve-comment-thread.tsnew file mode 100644index 00000000000..113b2cd03e0--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/comments/resolve-comment-thread.ts@@ -0,0 +1,46 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetCommentThreadOutputSchema } from '../../../output-schemas';++export const resolveCommentThreadAction = createAction({+ auth: webflowAuth,+ name: 'webflow_resolve_comment_thread',+ outputSchema: webflowGetCommentThreadOutputSchema,+ displayName: 'Resolve Comment Thread',+ description: 'Resolves or reopens a comment thread on a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets a Designer comment thread to resolved ("true") or reopens it ("false"). Get the site id from List Sites and the thread id from List Comment Threads.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ commentThreadId: Property.ShortText({+ displayName: 'Comment Thread ID',+ description: 'Comment thread ID. Use List Comment Threads to find it.',+ required: true,+ }),+ resolved: webflowAiProps.flag({+ required: true,+ displayName: 'Resolved',+ description: '"true" resolves the thread, "false" reopens it.',+ }),+ },+ async run(context) {+ const { siteId, commentThreadId, resolved } = context.propsValue;+ if (resolved !== 'true' && resolved !== 'false') {+ throw new Error('resolved must be "true" or "false".');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}`,+ body: { resolved: resolved === 'true' },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/components/get-component-content.ts b/packages/pieces/community/webflow/src/lib/actions/ai/components/get-component-content.tsnew file mode 100644index 00000000000..578230bd5ba--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/components/get-component-content.ts@@ -0,0 +1,61 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetComponentContentOutputSchema } from '../../../output-schemas';++export const getComponentContentAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_component_content',+ outputSchema: webflowGetComponentContentOutputSchema,+ displayName: 'Get Component Content',+ description: 'Gets the content nodes of a component.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Gets a component's content as nodes (text, images, nested component instances) with their ids. Pages with limit and offset. Use Get Component Properties for its property defaults. Get the site id from List Sites and the component id from List Components.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ componentId: Property.ShortText({+ displayName: 'Component ID',+ description: 'Component ID. Use List Components to find it.',+ required: true,+ }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read. Leave empty for the primary locale.',+ required: false,+ }),+ translatable: Property.ShortText({+ displayName: 'Translatable Into Locale ID',+ description: 'Secondary locale ID you are translating into. Returns only content not excluded from translation for that locale.',+ required: false,+ }),+ branchId: Property.ShortText({+ displayName: 'Branch ID',+ description: 'Page branch ID to read from. Leave empty for the main site.',+ required: false,+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { siteId, componentId, localeId, translatable, branchId, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`,+ query: {+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ ...(localeId ? { localeId } : {}),+ ...(translatable ? { translatable } : {}),+ ...(branchId ? { branchId } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/components/get-component-properties.ts b/packages/pieces/community/webflow/src/lib/actions/ai/components/get-component-properties.tsnew file mode 100644index 00000000000..f7d288b85c7--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/components/get-component-properties.ts@@ -0,0 +1,61 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetComponentPropertiesOutputSchema } from '../../../output-schemas';++export const getComponentPropertiesAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_component_properties',+ outputSchema: webflowGetComponentPropertiesOutputSchema,+ displayName: 'Get Component Properties',+ description: 'Gets the properties of a component.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Gets a component's properties with each property's id, type, label and default text. Pages with limit and offset. Use Get Component Content for its nodes. Get the site id from List Sites and the component id from List Components.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ componentId: Property.ShortText({+ displayName: 'Component ID',+ description: 'Component ID. Use List Components to find it.',+ required: true,+ }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read. Leave empty for the primary locale.',+ required: false,+ }),+ translatable: Property.ShortText({+ displayName: 'Translatable Into Locale ID',+ description: 'Secondary locale ID you are translating into. Returns only content not excluded from translation for that locale.',+ required: false,+ }),+ branchId: Property.ShortText({+ displayName: 'Branch ID',+ description: 'Page branch ID to read from. Leave empty for the main site.',+ required: false,+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { siteId, componentId, localeId, translatable, branchId, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`,+ query: {+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ ...(localeId ? { localeId } : {}),+ ...(translatable ? { translatable } : {}),+ ...(branchId ? { branchId } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/components/list-components.ts b/packages/pieces/community/webflow/src/lib/actions/ai/components/list-components.tsnew file mode 100644index 00000000000..72e47fb4061--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/components/list-components.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListComponentsOutputSchema } from '../../../output-schemas';++export const listComponentsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_components',+ outputSchema: webflowListComponentsOutputSchema,+ displayName: 'List Components',+ description: 'Lists the components of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the reusable components of a site with each component's id, name and group. Pages with limit and offset. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/components`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/delete-page-custom-code.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/delete-page-custom-code.tsnew file mode 100644index 00000000000..fd633476eb7--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/delete-page-custom-code.ts@@ -0,0 +1,32 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeletePageCustomCodeOutputSchema } from '../../../output-schemas';++export const deletePageCustomCodeAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_page_custom_code',+ outputSchema: webflowDeletePageCustomCodeOutputSchema,+ displayName: 'Delete Page Custom Code',+ description: 'Removes all scripts this app applied to a page.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Removes every script this app applied to a page. The scripts stay registered on the site and can be applied again with Upsert Page Custom Code; to remove only some scripts, use Upsert Page Custom Code without them. Get the page id from List Pages.',+ idempotent: false,+ },+ props: {+ pageId: webflowAiProps.pageId({ required: true }),+ },+ async run(context) {+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/pages/${encodeURIComponent(context.propsValue.pageId)}/custom_code`,+ });+ return { success: true, pageId: context.propsValue.pageId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/delete-site-custom-code.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/delete-site-custom-code.tsnew file mode 100644index 00000000000..56ea7c8eec2--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/delete-site-custom-code.ts@@ -0,0 +1,32 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteGoogleTagsOutputSchema } from '../../../output-schemas';++export const deleteSiteCustomCodeAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_site_custom_code',+ outputSchema: webflowDeleteGoogleTagsOutputSchema,+ displayName: 'Delete Site Custom Code',+ description: 'Removes all scripts this app applied to a site.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Removes every script this app applied to a site. The scripts stay registered on the site and can be applied again with Upsert Site Custom Code; to remove only some scripts, use Upsert Site Custom Code without them. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/custom_code`,+ });+ return { success: true, siteId: context.propsValue.siteId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/get-page-custom-code.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/get-page-custom-code.tsnew file mode 100644index 00000000000..bdaf63e5cce--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/get-page-custom-code.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageCustomCodeOutputSchema } from '../../../output-schemas';++export const getPageCustomCodeAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_page_custom_code',+ outputSchema: webflowGetPageCustomCodeOutputSchema,+ displayName: 'Get Page Custom Code',+ description: 'Gets the registered scripts applied to a page.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns the registered scripts applied to one page, with each script's id, version and location (header or footer). A 404 means no custom code is applied to the page yet. Get the page id from List Pages.",+ idempotent: true,+ },+ props: {+ pageId: webflowAiProps.pageId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/pages/${encodeURIComponent(context.propsValue.pageId)}/custom_code`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/get-site-custom-code.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/get-site-custom-code.tsnew file mode 100644index 00000000000..4f4581c37e9--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/get-site-custom-code.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageCustomCodeOutputSchema } from '../../../output-schemas';++export const getSiteCustomCodeAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_site_custom_code',+ outputSchema: webflowGetPageCustomCodeOutputSchema,+ displayName: 'Get Site Custom Code',+ description: 'Gets the registered scripts applied to a site.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns the registered scripts applied site-wide, with each script's id, version and location (header or footer). A 404 means no custom code is applied to the site yet. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/custom_code`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/list-custom-code-blocks.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/list-custom-code-blocks.tsnew file mode 100644index 00000000000..3c2cf1a6d26--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/list-custom-code-blocks.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCustomCodeBlocksOutputSchema } from '../../../output-schemas';++export const listCustomCodeBlocksAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_custom_code_blocks',+ outputSchema: webflowListCustomCodeBlocksOutputSchema,+ displayName: 'List Custom Code Blocks',+ description: 'Lists the scripts applied to a site and its pages.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists every custom code block on a site, one per site or page that has scripts applied, each with its page id (for page blocks) and scripts. Pages with limit and offset. Get the site id from List Sites.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/custom_code/blocks`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/list-registered-scripts.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/list-registered-scripts.tsnew file mode 100644index 00000000000..326d4f8c852--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/list-registered-scripts.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListRegisteredScriptsOutputSchema } from '../../../output-schemas';++export const listRegisteredScriptsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_registered_scripts',+ outputSchema: webflowListRegisteredScriptsOutputSchema,+ displayName: 'List Registered Scripts',+ description: 'Lists the scripts registered to a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the scripts registered to a site (up to 800), with each script's id, version, display name and hosted location. Registered scripts are not live until applied with Upsert Site Custom Code or Upsert Page Custom Code. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/registered_scripts`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/register-hosted-script.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/register-hosted-script.tsnew file mode 100644index 00000000000..396650df15a--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/register-hosted-script.ts@@ -0,0 +1,64 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowRegisterHostedScriptOutputSchema } from '../../../output-schemas';++export const registerHostedScriptAction = createAction({+ auth: webflowAuth,+ name: 'webflow_register_hosted_script',+ outputSchema: webflowRegisterHostedScriptOutputSchema,+ displayName: 'Register Hosted Script',+ description: 'Registers an externally hosted script to a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Registers a script hosted at an external URL to a site and returns its id and version. Registering does not apply it: pass the id and version to Upsert Site Custom Code or Upsert Page Custom Code. For code Webflow should host, use Register Inline Script. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ displayName: Property.ShortText({+ displayName: 'Display Name',+ description: 'Name of the script, 1-50 alphanumeric characters.',+ required: true,+ }),+ version: Property.ShortText({+ displayName: 'Version',+ description: 'Semantic version of the script, e.g. "1.0.0".',+ required: true,+ }),+ hostedLocation: Property.ShortText({+ displayName: 'Hosted Location',+ description: 'URL of the hosted script, e.g. "https://cdn.example.com/app.js".',+ required: true,+ }),+ integrityHash: Property.ShortText({+ displayName: 'Integrity Hash',+ description: 'Sub-Resource Integrity hash of the script, e.g. "sha384-...".',+ required: true,+ }),+ canCopy: webflowAiProps.flag({+ required: false,+ displayName: 'Can Copy',+ description: 'Whether the script is copied when the site is duplicated or transferred. Webflow defaults to No.',+ }),+ },+ async run(context) {+ const { siteId, displayName, version, hostedLocation, integrityHash, canCopy } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/registered_scripts/hosted`,+ body: {+ displayName,+ version,+ hostedLocation,+ integrityHash,+ ...(canCopy !== undefined ? { canCopy: canCopy === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/register-inline-script.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/register-inline-script.tsnew file mode 100644index 00000000000..37e1dbae34b--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/register-inline-script.ts@@ -0,0 +1,64 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowRegisterHostedScriptOutputSchema } from '../../../output-schemas';++export const registerInlineScriptAction = createAction({+ auth: webflowAuth,+ name: 'webflow_register_inline_script',+ outputSchema: webflowRegisterHostedScriptOutputSchema,+ displayName: 'Register Inline Script',+ description: 'Registers an inline script, hosted by Webflow, to a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Registers JavaScript source code (up to 2000 characters) that Webflow hosts, and returns its id and version. Registering does not apply it: pass the id and version to Upsert Site Custom Code or Upsert Page Custom Code. For a script at an external URL, use Register Hosted Script. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ displayName: Property.ShortText({+ displayName: 'Display Name',+ description: 'Name of the script, 1-50 alphanumeric characters.',+ required: true,+ }),+ version: Property.ShortText({+ displayName: 'Version',+ description: 'Semantic version of the script, e.g. "1.0.0".',+ required: true,+ }),+ sourceCode: Property.LongText({+ displayName: 'Source Code',+ description: 'The JavaScript to host, without <script> tags. Up to 2000 characters.',+ required: true,+ }),+ integrityHash: Property.ShortText({+ displayName: 'Integrity Hash',+ description: 'Optional Sub-Resource Integrity hash of the script, e.g. "sha384-...".',+ required: false,+ }),+ canCopy: webflowAiProps.flag({+ required: false,+ displayName: 'Can Copy',+ description: 'Whether the script is copied when the site is duplicated or transferred. Webflow defaults to No.',+ }),+ },+ async run(context) {+ const { siteId, displayName, version, sourceCode, integrityHash, canCopy } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/registered_scripts/inline`,+ body: {+ displayName,+ version,+ sourceCode,+ ...(integrityHash ? { integrityHash } : {}),+ ...(canCopy !== undefined ? { canCopy: canCopy === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/upsert-page-custom-code.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/upsert-page-custom-code.tsnew file mode 100644index 00000000000..39796b07136--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/upsert-page-custom-code.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageCustomCodeOutputSchema } from '../../../output-schemas';++export const upsertPageCustomCodeAction = createAction({+ auth: webflowAuth,+ name: 'webflow_upsert_page_custom_code',+ outputSchema: webflowGetPageCustomCodeOutputSchema,+ displayName: 'Upsert Page Custom Code',+ description: 'Applies registered scripts to a page, replacing the scripts applied before.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the registered scripts applied to a page. The PUT replaces the whole list, so include every script that should stay applied (read them first with Get Page Custom Code); a script left out is removed. Register a script first with Register Hosted Script or Register Inline Script. Get the page id from List Pages.',+ idempotent: true,+ },+ props: {+ pageId: webflowAiProps.pageId({ required: true }),+ scripts: Property.Json({+ displayName: 'Scripts',+ description:+ 'The full list of scripts to apply, as a JSON array of {"id", "version", "location": "header" | "footer", "attributes"?: {}}. id and version come from Register Hosted Script, Register Inline Script or List Registered Scripts. Send [] to remove all.',+ required: true,+ }),+ },+ async run(context) {+ const { pageId, scripts } = context.propsValue;+ if (!Array.isArray(scripts)) {+ throw new Error('scripts must be a JSON array of {"id", "version", "location"} objects.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PUT,+ path: `/v2/pages/${encodeURIComponent(pageId)}/custom_code`,+ body: { scripts },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/upsert-site-custom-code.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/upsert-site-custom-code.tsnew file mode 100644index 00000000000..c05e278ee1c--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-code/upsert-site-custom-code.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageCustomCodeOutputSchema } from '../../../output-schemas';++export const upsertSiteCustomCodeAction = createAction({+ auth: webflowAuth,+ name: 'webflow_upsert_site_custom_code',+ outputSchema: webflowGetPageCustomCodeOutputSchema,+ displayName: 'Upsert Site Custom Code',+ description: 'Applies registered scripts to a site, replacing the scripts applied before.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the registered scripts applied to a site. The PUT replaces the whole list, so include every script that should stay applied (read them first with Get Site Custom Code); a script left out is removed. Register a script first with Register Hosted Script or Register Inline Script. Get the site id from List Sites.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ scripts: Property.Json({+ displayName: 'Scripts',+ description:+ 'The full list of scripts to apply, as a JSON array of {"id", "version", "location": "header" | "footer", "attributes"?: {}}. id and version come from Register Hosted Script, Register Inline Script or List Registered Scripts. Send [] to remove all.',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, scripts } = context.propsValue;+ if (!Array.isArray(scripts)) {+ throw new Error('scripts must be a JSON array of {"id", "version", "location"} objects.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PUT,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_code`,+ body: { scripts },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/create-custom-font.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/create-custom-font.tsnew file mode 100644index 00000000000..5c267bafe93--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/create-custom-font.ts@@ -0,0 +1,96 @@+import { createHash } from 'node:crypto';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property, tryCatch } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCustomFontOutputSchema } from '../../../output-schemas';++export const createCustomFontAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_custom_font',+ outputSchema: webflowCreateCustomFontOutputSchema,+ displayName: 'Create Custom Font',+ description: 'Uploads a font file as a custom font on a site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a custom font on a site from a font file (woff2, woff, ttf or otf): creates the font record, then uploads the file to Webflow storage. If the upload fails the font record still exists; the error gives its id so it can be removed with Delete Custom Font. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ file: Property.File({+ displayName: 'Font File',+ description: 'The font file: woff2, woff, ttf or otf.',+ required: true,+ }),+ fontFamily: Property.ShortText({+ displayName: 'Font Family',+ description: 'CSS font-family name, e.g. "Inter".',+ required: true,+ }),+ weight: Property.Number({+ displayName: 'Weight',+ description: 'CSS font-weight, 1-1000, e.g. 400 for regular or 700 for bold.',+ required: true,+ }),+ italic: webflowAiProps.flag({+ required: true,+ displayName: 'Italic',+ description: 'Whether the font is italic.',+ }),+ fontDisplay: Property.StaticDropdown({+ displayName: 'Font Display',+ description: 'CSS font-display value.',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Auto', value: 'auto' },+ { label: 'Block', value: 'block' },+ { label: 'Swap', value: 'swap' },+ { label: 'Fallback', value: 'fallback' },+ { label: 'Optional', value: 'optional' },+ ],+ },+ }),+ },+ async run(context) {+ const { siteId, file, fontFamily, weight, italic, fontDisplay } = context.propsValue;+ const { customFont, upload } = await webflowClient.request<CustomFontUploadResponse>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts`,+ body: {+ fileName: file.filename,+ fileHash: createHash('md5').update(file.data).digest('hex'),+ fontFamily,+ weight,+ italic: italic === 'true',+ fontDisplay,+ },+ });+ const { error } = await tryCatch(() =>+ webflowClient.uploadFile({+ url: upload.url,+ fields: upload.fields,+ data: file.data,+ fileName: file.filename,+ contentType: undefined,+ }),+ );+ if (error) {+ throw new Error(+ `The custom font record was created (id ${customFont.id}) but the file upload failed: ${error.message}. Delete Custom Font removes the empty record.`,+ );+ }+ return { customFont };+ },+});++type CustomFontUploadResponse = {+ customFont: { id: string };+ upload: { url: string; fields: Record<string, unknown> };+};diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/create-custom-fonts-batch.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/create-custom-fonts-batch.tsnew file mode 100644index 00000000000..bb050b37cfa--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/create-custom-fonts-batch.ts@@ -0,0 +1,149 @@+import { createHash } from 'node:crypto';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property, tryCatch } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCustomFontsBatchOutputSchema } from '../../../output-schemas';++export const createCustomFontsBatchAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_custom_fonts_batch',+ outputSchema: webflowCreateCustomFontsBatchOutputSchema,+ displayName: 'Create Custom Fonts (Batch)',+ description: 'Uploads 1 to 25 font files as custom fonts on a site in one call.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates 1-25 custom fonts on a site (e.g. the Regular, Bold and Italic files of one family): registers them in one request, then uploads each file to Webflow storage. Fonts Webflow rejects come back in failed (e.g. FontLimitReached) and are not uploaded. If an upload fails the error lists which font records exist without a file, for Delete Custom Font. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ fonts: Property.Array({+ displayName: 'Fonts',+ description: '1-25 fonts, each a file (woff2, woff, ttf or otf) with its family, weight, italic and font-display.',+ required: true,+ properties: {+ file: Property.File({ displayName: 'Font File', required: true }),+ fontFamily: Property.ShortText({ displayName: 'Font Family', required: true }),+ weight: Property.Number({ displayName: 'Weight', description: 'CSS font-weight, 1-1000.', required: true }),+ italic: webflowAiProps.flag({ required: true, displayName: 'Italic' }),+ fontDisplay: Property.StaticDropdown({+ displayName: 'Font Display',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Auto', value: 'auto' },+ { label: 'Block', value: 'block' },+ { label: 'Swap', value: 'swap' },+ { label: 'Fallback', value: 'fallback' },+ { label: 'Optional', value: 'optional' },+ ],+ },+ }),+ },+ }),+ },+ async run(context) {+ const { siteId, fonts } = context.propsValue;+ if (fonts.length < 1 || fonts.length > 25) {+ throw new Error('fonts must hold between 1 and 25 fonts.');+ }+ const items = fonts.map((font, index) => toFontItem({ font, index }));+ const response = await webflowClient.request<BatchCreateResponse>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts/batchCreate`,+ body: {+ items: items.map(({ file, ...font }) => ({ ...font, fileName: file.filename })),+ },+ });+ const uploads = await Promise.all(+ response.created.map(async ({ customFont, upload }) => {+ const item = items.find((candidate) => candidate.fileHash === customFont.fileHash);+ if (!item) {+ return { customFont, error: 'no matching file in the input' };+ }+ const { error } = await tryCatch(() =>+ webflowClient.uploadFile({+ url: upload.url,+ fields: upload.fields,+ data: item.file.data,+ fileName: item.file.filename,+ contentType: undefined,+ }),+ );+ return { customFont, error: error ? error.message : null };+ }),+ );+ const uploadFailures = uploads.filter((upload) => upload.error !== null);+ if (uploadFailures.length > 0) {+ const list = uploadFailures.map((upload) => `${upload.customFont.id} (${upload.customFont.fileName}): ${upload.error}`).join('; ');+ throw new Error(+ `${response.created.length} font records were created, but ${uploadFailures.length} file uploads failed: ${list}. Delete Custom Font removes those records.`,+ );+ }+ return {+ created: response.created.map(({ customFont }) => customFont),+ failed: response.failed,+ };+ },+});++function toFontItem({ font, index }: { font: unknown; index: number }): FontItem {+ if (+ typeof font !== 'object' ||+ font === null ||+ !('file' in font) ||+ !isFontFile(font.file) ||+ !('fontFamily' in font) ||+ typeof font.fontFamily !== 'string' ||+ !('weight' in font) ||+ typeof font.weight !== 'number' ||+ !('fontDisplay' in font) ||+ typeof font.fontDisplay !== 'string'+ ) {+ throw new Error(`fonts[${index}] needs a file, fontFamily, weight and fontDisplay.`);+ }+ return {+ file: font.file,+ fileHash: createHash('md5').update(font.file.data).digest('hex'),+ fontFamily: font.fontFamily,+ weight: font.weight,+ italic: 'italic' in font && font.italic === 'true',+ fontDisplay: font.fontDisplay,+ };+}++function isFontFile(value: unknown): value is FontFile {+ return (+ typeof value === 'object' &&+ value !== null &&+ 'filename' in value &&+ typeof value.filename === 'string' &&+ 'data' in value &&+ Buffer.isBuffer(value.data)+ );+}++type FontFile = {+ filename: string;+ data: Buffer;+};++type FontItem = {+ file: FontFile;+ fileHash: string;+ fontFamily: string;+ weight: number;+ italic: boolean;+ fontDisplay: string;+};++type BatchCreateResponse = {+ created: { customFont: { id: string; fileName: string; fileHash: string }; upload: { url: string; fields: Record<string, unknown> } }[];+ failed: unknown[];+};diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/delete-custom-font.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/delete-custom-font.tsnew file mode 100644index 00000000000..a1ac8a8c707--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/delete-custom-font.ts@@ -0,0 +1,38 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCustomFontOutputSchema } from '../../../output-schemas';++export const deleteCustomFontAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_custom_font',+ outputSchema: webflowDeleteCustomFontOutputSchema,+ displayName: 'Delete Custom Font',+ description: 'Permanently deletes a custom font from a site.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes one custom font from a site; it cannot be restored. To delete several at once, use Delete Custom Fonts Batch. Get the site id from List Sites and the font id from List Custom Fonts.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ fontId: Property.ShortText({+ displayName: 'Font ID',+ description: 'Custom font ID. Use List Custom Fonts to find it.',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, fontId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts/${encodeURIComponent(fontId)}`,+ });+ return { success: true, siteId, fontId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/delete-custom-fonts-batch.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/delete-custom-fonts-batch.tsnew file mode 100644index 00000000000..90dac18e4dc--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/delete-custom-fonts-batch.ts@@ -0,0 +1,38 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCustomFontsBatchOutputSchema } from '../../../output-schemas';++export const deleteCustomFontsBatchAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_custom_fonts_batch',+ outputSchema: webflowDeleteCustomFontsBatchOutputSchema,+ displayName: 'Delete Custom Fonts (Batch)',+ description: 'Permanently deletes up to 100 custom fonts from a site.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes 1-100 custom fonts from a site in one request. Webflow reports each font in deleted or failed (a missing font fails with NotFound) instead of failing the whole call, so check failed and resend only those ids. Get the site id from List Sites and the font ids from List Custom Fonts.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ fontIds: Property.Array({+ displayName: 'Font IDs',+ description: 'Ids of the custom fonts to delete, 1-100. Use List Custom Fonts to find them.',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, fontIds } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts/batchDelete`,+ body: { items: fontIds.map((id) => ({ id: String(id) })) },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/get-custom-font.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/get-custom-font.tsnew file mode 100644index 00000000000..f08247a7f8b--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/get-custom-font.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCustomFontOutputSchema } from '../../../output-schemas';++export const getCustomFontAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_custom_font',+ outputSchema: webflowCreateCustomFontOutputSchema,+ displayName: 'Get Custom Font',+ description: 'Gets one custom font on a site.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one custom font on a site, with its family, weight, style, font-display, variable axes and hosted URL. Get the site id from List Sites and the font id from List Custom Fonts.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ fontId: Property.ShortText({+ displayName: 'Font ID',+ description: 'Custom font ID. Use List Custom Fonts to find it.',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, fontId } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts/${encodeURIComponent(fontId)}`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/list-custom-fonts.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/list-custom-fonts.tsnew file mode 100644index 00000000000..57142aa4cb9--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/list-custom-fonts.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCustomFontsOutputSchema } from '../../../output-schemas';++export const listCustomFontsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_custom_fonts',+ outputSchema: webflowListCustomFontsOutputSchema,+ displayName: 'List Custom Fonts',+ description: 'Lists the custom fonts uploaded to a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the custom fonts uploaded to a site, with each font's id, family, weight, style and hosted URL. Pages with limit and offset. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/custom_fonts`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/replace-custom-font-file.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/replace-custom-font-file.tsnew file mode 100644index 00000000000..28792e0ef00--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/replace-custom-font-file.ts@@ -0,0 +1,67 @@+import { createHash } from 'node:crypto';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property, tryCatch } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCustomFontOutputSchema } from '../../../output-schemas';++export const replaceCustomFontFileAction = createAction({+ auth: webflowAuth,+ name: 'webflow_replace_custom_font_file',+ outputSchema: webflowCreateCustomFontOutputSchema,+ displayName: 'Replace Custom Font File',+ description: 'Replaces the file behind an existing custom font.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Replaces a custom font's file, keeping its id, family, weight and style: registers the new file, then uploads it to Webflow storage. Get the site id from List Sites and the font id from List Custom Fonts.",+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ fontId: Property.ShortText({+ displayName: 'Font ID',+ description: 'Custom font ID. Use List Custom Fonts to find it.',+ required: true,+ }),+ file: Property.File({+ displayName: 'Font File',+ description: 'The new font file: woff2, woff, ttf or otf.',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, fontId, file } = context.propsValue;+ const { customFont, upload } = await webflowClient.request<CustomFontUploadResponse>({+ auth: context.auth,+ method: HttpMethod.PUT,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts/${encodeURIComponent(fontId)}/file`,+ body: {+ fileName: file.filename,+ fileHash: createHash('md5').update(file.data).digest('hex'),+ },+ });+ const { error } = await tryCatch(() =>+ webflowClient.uploadFile({+ url: upload.url,+ fields: upload.fields,+ data: file.data,+ fileName: file.filename,+ contentType: undefined,+ }),+ );+ if (error) {+ throw new Error(+ `Webflow accepted the new file for font ${customFont.id} but the upload failed: ${error.message}. Run Replace Custom Font File again.`,+ );+ }+ return { customFont };+ },+});++type CustomFontUploadResponse = {+ customFont: { id: string };+ upload: { url: string; fields: Record<string, unknown> };+};diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/update-custom-font.ts b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/update-custom-font.tsnew file mode 100644index 00000000000..0b2828ad8ee--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/custom-fonts/update-custom-font.ts@@ -0,0 +1,73 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCustomFontOutputSchema } from '../../../output-schemas';++export const updateCustomFontAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_custom_font',+ outputSchema: webflowCreateCustomFontOutputSchema,+ displayName: 'Update Custom Font',+ description: "Updates a custom font's family, weight, style or font-display.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Changes a custom font's metadata; only the fields set are sent and at least one is required. The font file itself is not changed. Get the site id from List Sites and the font id from List Custom Fonts.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ fontId: Property.ShortText({+ displayName: 'Font ID',+ description: 'Custom font ID. Use List Custom Fonts to find it.',+ required: true,+ }),+ fontFamily: Property.ShortText({+ displayName: 'Font Family',+ description: 'CSS font-family name, 1-256 characters. Webflow strips commas.',+ required: false,+ }),+ weight: Property.Number({+ displayName: 'Weight',+ description: 'CSS font-weight, 1-1000, e.g. 400 for regular or 700 for bold.',+ required: false,+ }),+ italic: webflowAiProps.flag({+ required: false,+ displayName: 'Italic',+ description: 'Whether the font is italic.',+ }),+ fontDisplay: Property.StaticDropdown({+ displayName: 'Font Display',+ description: 'CSS font-display value.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Auto', value: 'auto' },+ { label: 'Block', value: 'block' },+ { label: 'Swap', value: 'swap' },+ { label: 'Fallback', value: 'fallback' },+ { label: 'Optional', value: 'optional' },+ ],+ },+ }),+ },+ async run(context) {+ const { siteId, fontId, fontFamily, weight, italic, fontDisplay } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/sites/${encodeURIComponent(siteId)}/custom_fonts/${encodeURIComponent(fontId)}`,+ body: {+ ...(fontFamily !== undefined ? { fontFamily } : {}),+ ...(weight !== undefined ? { weight } : {}),+ ...(italic !== undefined ? { italic: italic === 'true' } : {}),+ ...(fontDisplay !== undefined ? { fontDisplay } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/delete-form-submission.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/delete-form-submission.tsnew file mode 100644index 00000000000..fa8f7032acd--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/delete-form-submission.ts@@ -0,0 +1,36 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowDeleteFormSubmissionOutputSchema } from '../../../output-schemas';++export const deleteFormSubmissionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_form_submission',+ outputSchema: webflowDeleteFormSubmissionOutputSchema,+ displayName: 'Delete Form Submission',+ description: 'Permanently deletes a form submission.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a form submission; it cannot be restored. Get the submission id from List Form Submissions or List Site Form Submissions. Webflow answers 409 until the site has been published, so run Publish Site first if it does.',+ idempotent: false,+ },+ props: {+ formSubmissionId: Property.ShortText({+ displayName: 'Form Submission ID',+ description: 'Form submission ID. Use List Form Submissions to find it.',+ required: true,+ }),+ },+ async run(context) {+ const { formSubmissionId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/form_submissions/${encodeURIComponent(formSubmissionId)}`,+ });+ return { success: true, formSubmissionId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/get-form-submission.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/get-form-submission.tsnew file mode 100644index 00000000000..65a631333c8--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/get-form-submission.ts@@ -0,0 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowGetFormSubmissionOutputSchema } from '../../../output-schemas';++export const getFormSubmissionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_form_submission',+ outputSchema: webflowGetFormSubmissionOutputSchema,+ displayName: 'Get Form Submission',+ description: 'Gets one form submission.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one form submission: its form name, submit date, locale and field values. Get the submission id from List Form Submissions or List Site Form Submissions. Webflow answers 409 until the site has been published, so run Publish Site first if it does.",+ idempotent: true,+ },+ props: {+ formSubmissionId: Property.ShortText({+ displayName: 'Form Submission ID',+ description: 'Form submission ID. Use List Form Submissions to find it.',+ required: true,+ }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/form_submissions/${encodeURIComponent(context.propsValue.formSubmissionId)}`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/get-form.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/get-form.tsnew file mode 100644index 00000000000..e85cae980f3--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/get-form.ts@@ -0,0 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowGetFormOutputSchema } from '../../../output-schemas';++export const getFormAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_form',+ outputSchema: webflowGetFormOutputSchema,+ displayName: 'Get Form',+ description: 'Gets the schema of a form.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one form's schema: name, page, form element id, response settings and its fields with their types, including hidden fields. Get the form id from List Forms. Webflow answers 409 until the site has been published, so run Publish Site first if it does.",+ idempotent: true,+ },+ props: {+ formId: Property.ShortText({+ displayName: 'Form ID',+ description: 'Form ID. Use List Forms to find it.',+ required: true,+ }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/forms/${encodeURIComponent(context.propsValue.formId)}`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-form-submissions.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-form-submissions.tsnew file mode 100644index 00000000000..a739b943575--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-form-submissions.ts@@ -0,0 +1,41 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListFormSubmissionsOutputSchema } from '../../../output-schemas';++export const listFormSubmissionsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_form_submissions',+ outputSchema: webflowListFormSubmissionsOutputSchema,+ displayName: 'List Form Submissions',+ description: 'Lists the submissions of a form.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the submissions of one form, each with its id, submit date and field values. Pages with limit and offset. A form inside a component counts as a separate form per instance; use List Site Form Submissions with the form element id to get them all. Get the form id from List Forms. Webflow answers 409 until the site has been published, so run Publish Site first if it does.',+ idempotent: true,+ },+ props: {+ formId: Property.ShortText({+ displayName: 'Form ID',+ description: 'Form ID. Use List Forms to find it.',+ required: true,+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/forms/${encodeURIComponent(context.propsValue.formId)}/submissions`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-forms.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-forms.tsnew file mode 100644index 00000000000..caa6f60018c--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-forms.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListFormsOutputSchema } from '../../../output-schemas';++export const listFormsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_forms',+ outputSchema: webflowListFormsOutputSchema,+ displayName: 'List Forms',+ description: 'Lists the forms on a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the forms on a site, with each form's id, name, page, fields and form element id. Pages with limit and offset. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/forms`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-site-form-submissions.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-site-form-submissions.tsnew file mode 100644index 00000000000..c9ee3d5a35d--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/list-site-form-submissions.ts@@ -0,0 +1,44 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListFormSubmissionsOutputSchema } from '../../../output-schemas';++export const listSiteFormSubmissionsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_site_form_submissions',+ outputSchema: webflowListFormSubmissionsOutputSchema,+ displayName: 'List Site Form Submissions',+ description: 'Lists the form submissions of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the form submissions across a whole site, optionally only those of one form element, which also gathers every component instance of that form. Pages with limit and offset. Get the site id from List Sites and the element id (formElementId) from List Forms. Webflow answers 409 until the site has been published, so run Publish Site first if it does.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ elementId: Property.ShortText({+ displayName: 'Form Element ID',+ description: 'Only return submissions of this form element: the formElementId from List Forms.',+ required: false,+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { siteId, elementId, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/form_submissions`,+ query: {+ ...(elementId ? { elementId } : {}),+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/forms/update-form-submission.ts b/packages/pieces/community/webflow/src/lib/actions/ai/forms/update-form-submission.tsnew file mode 100644index 00000000000..3830709557a--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/forms/update-form-submission.ts@@ -0,0 +1,44 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowUpdateFormSubmissionOutputSchema } from '../../../output-schemas';++export const updateFormSubmissionAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_form_submission',+ outputSchema: webflowUpdateFormSubmissionOutputSchema,+ displayName: 'Update Form Submission',+ description: 'Sets hidden field values on a form submission.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the values of hidden fields on a form submission; only hidden fields already defined on the form can be set, and fields not given keep their value. Get Form lists the form fields. Get the submission id from List Form Submissions or List Site Form Submissions. Webflow answers 409 until the site has been published, so run Publish Site first if it does.',+ idempotent: true,+ },+ props: {+ formSubmissionId: Property.ShortText({+ displayName: 'Form Submission ID',+ description: 'Form submission ID. Use List Form Submissions to find it.',+ required: true,+ }),+ formSubmissionData: Property.Json({+ displayName: 'Hidden Field Values',+ description: 'JSON object mapping each hidden field name on the form to its new value, e.g. {"status": "contacted"}.',+ required: true,+ }),+ },+ async run(context) {+ const { formSubmissionId, formSubmissionData } = context.propsValue;+ if (Array.isArray(formSubmissionData) || Object.keys(formSubmissionData).length === 0) {+ throw new Error('formSubmissionData must be a JSON object with at least one hidden field.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/form_submissions/${encodeURIComponent(formSubmissionId)}`,+ body: { formSubmissionData },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/index.ts b/packages/pieces/community/webflow/src/lib/actions/ai/index.tsnew file mode 100644index 00000000000..d81533628dc--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/index.ts@@ -0,0 +1,159 @@+import { getAuthorizedUserAction } from './meta/get-authorized-user';+import { getTokenInfoAction } from './meta/get-token-info';+import { deleteGoogleTagAction } from './sites/delete-google-tag';+import { deleteGoogleTagsAction } from './sites/delete-google-tags';+import { getSiteAction } from './sites/get-site';+import { listCustomDomainsAction } from './sites/list-custom-domains';+import { listGoogleTagsAction } from './sites/list-google-tags';+import { listSitesAiAction } from './sites/list-sites';+import { publishSiteAction } from './sites/publish-site';+import { upsertGoogleTagsAction } from './sites/upsert-google-tags';+import { createCollectionFieldAction } from './collections/create-collection-field';+import { createCollectionAction } from './collections/create-collection';+import { deleteCollectionFieldAction } from './collections/delete-collection-field';+import { deleteCollectionAction } from './collections/delete-collection';+import { getCollectionAction } from './collections/get-collection';+import { listCollectionsAiAction } from './collections/list-collections';+import { updateCollectionFieldAction } from './collections/update-collection-field';+import { updateCollectionAction } from './collections/update-collection';+import { createCollectionItemAiAction } from './items/create-collection-item';+import { createLiveCollectionItemAction } from './items/create-live-collection-item';+import { deleteCollectionItemAiAction } from './items/delete-collection-item';+import { deleteCollectionItemsAction } from './items/delete-collection-items';+import { getCollectionItemAiAction } from './items/get-collection-item';+import { getLiveCollectionItemAction } from './items/get-live-collection-item';+import { listCollectionItemsAction } from './items/list-collection-items';+import { listLiveCollectionItemsAction } from './items/list-live-collection-items';+import { publishCollectionItemsAction } from './items/publish-collection-items';+import { unpublishLiveCollectionItemAction } from './items/unpublish-live-collection-item';+import { unpublishLiveCollectionItemsAction } from './items/unpublish-live-collection-items';+import { updateCollectionItemAiAction } from './items/update-collection-item';+import { updateCollectionItemsAction } from './items/update-collection-items';+import { updateLiveCollectionItemAction } from './items/update-live-collection-item';+import { updateLiveCollectionItemsAction } from './items/update-live-collection-items';+import { createCommentReplyAction } from './comments/create-comment-reply';+import { getCommentThreadAction } from './comments/get-comment-thread';+import { listCommentRepliesAction } from './comments/list-comment-replies';+import { listCommentThreadsAction } from './comments/list-comment-threads';+import { resolveCommentThreadAction } from './comments/resolve-comment-thread';+import { getPageContentAction } from './pages/get-page-content';+import { getPageAction } from './pages/get-page';+import { listPagesAction } from './pages/list-pages';+import { updatePageAction } from './pages/update-page';+import { getComponentContentAction } from './components/get-component-content';+import { getComponentPropertiesAction } from './components/get-component-properties';+import { listComponentsAction } from './components/list-components';+import { deletePageCustomCodeAction } from './custom-code/delete-page-custom-code';+import { deleteSiteCustomCodeAction } from './custom-code/delete-site-custom-code';+import { getPageCustomCodeAction } from './custom-code/get-page-custom-code';+import { getSiteCustomCodeAction } from './custom-code/get-site-custom-code';+import { listCustomCodeBlocksAction } from './custom-code/list-custom-code-blocks';+import { listRegisteredScriptsAction } from './custom-code/list-registered-scripts';+import { registerHostedScriptAction } from './custom-code/register-hosted-script';+import { registerInlineScriptAction } from './custom-code/register-inline-script';+import { upsertPageCustomCodeAction } from './custom-code/upsert-page-custom-code';+import { upsertSiteCustomCodeAction } from './custom-code/upsert-site-custom-code';+import { deleteAssetAction } from './assets/delete-asset';+import { getAssetAction } from './assets/get-asset';+import { listAssetsAction } from './assets/list-assets';+import { updateAssetAction } from './assets/update-asset';+import { uploadAssetAction } from './assets/upload-asset';+import { createAssetFolderAction } from './asset-folders/create-asset-folder';+import { getAssetFolderAction } from './asset-folders/get-asset-folder';+import { listAssetFoldersAction } from './asset-folders/list-asset-folders';+import { createCustomFontAction } from './custom-fonts/create-custom-font';+import { createCustomFontsBatchAction } from './custom-fonts/create-custom-fonts-batch';+import { deleteCustomFontAction } from './custom-fonts/delete-custom-font';+import { deleteCustomFontsBatchAction } from './custom-fonts/delete-custom-fonts-batch';+import { getCustomFontAction } from './custom-fonts/get-custom-font';+import { listCustomFontsAction } from './custom-fonts/list-custom-fonts';+import { replaceCustomFontFileAction } from './custom-fonts/replace-custom-font-file';+import { updateCustomFontAction } from './custom-fonts/update-custom-font';+import { deleteFormSubmissionAction } from './forms/delete-form-submission';+import { getFormSubmissionAction } from './forms/get-form-submission';+import { getFormAction } from './forms/get-form';+import { listFormSubmissionsAction } from './forms/list-form-submissions';+import { listFormsAction } from './forms/list-forms';+import { listSiteFormSubmissionsAction } from './forms/list-site-form-submissions';+import { updateFormSubmissionAction } from './forms/update-form-submission';++export const webflowAiActions = [+ getAuthorizedUserAction,+ getTokenInfoAction,+ deleteGoogleTagAction,+ deleteGoogleTagsAction,+ getSiteAction,+ listCustomDomainsAction,+ listGoogleTagsAction,+ listSitesAiAction,+ publishSiteAction,+ upsertGoogleTagsAction,+ createCollectionFieldAction,+ createCollectionAction,+ deleteCollectionFieldAction,+ deleteCollectionAction,+ getCollectionAction,+ listCollectionsAiAction,+ updateCollectionFieldAction,+ updateCollectionAction,+ createCollectionItemAiAction,+ createLiveCollectionItemAction,+ deleteCollectionItemAiAction,+ deleteCollectionItemsAction,+ getCollectionItemAiAction,+ getLiveCollectionItemAction,+ listCollectionItemsAction,+ listLiveCollectionItemsAction,+ publishCollectionItemsAction,+ unpublishLiveCollectionItemAction,+ unpublishLiveCollectionItemsAction,+ updateCollectionItemAiAction,+ updateCollectionItemsAction,+ updateLiveCollectionItemAction,+ updateLiveCollectionItemsAction,+ createCommentReplyAction,+ getCommentThreadAction,+ listCommentRepliesAction,+ listCommentThreadsAction,+ resolveCommentThreadAction,+ getPageContentAction,+ getPageAction,+ listPagesAction,+ updatePageAction,+ getComponentContentAction,+ getComponentPropertiesAction,+ listComponentsAction,+ deletePageCustomCodeAction,+ deleteSiteCustomCodeAction,+ getPageCustomCodeAction,+ getSiteCustomCodeAction,+ listCustomCodeBlocksAction,+ listRegisteredScriptsAction,+ registerHostedScriptAction,+ registerInlineScriptAction,+ upsertPageCustomCodeAction,+ upsertSiteCustomCodeAction,+ deleteAssetAction,+ getAssetAction,+ listAssetsAction,+ updateAssetAction,+ uploadAssetAction,+ createAssetFolderAction,+ getAssetFolderAction,+ listAssetFoldersAction,+ createCustomFontAction,+ createCustomFontsBatchAction,+ deleteCustomFontAction,+ deleteCustomFontsBatchAction,+ getCustomFontAction,+ listCustomFontsAction,+ replaceCustomFontFileAction,+ updateCustomFontAction,+ deleteFormSubmissionAction,+ getFormSubmissionAction,+ getFormAction,+ listFormSubmissionsAction,+ listFormsAction,+ listSiteFormSubmissionsAction,+ updateFormSubmissionAction,+];diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/create-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/create-collection-item.tsnew file mode 100644index 00000000000..fc0167d8406--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/create-collection-item.ts@@ -0,0 +1,53 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCollectionItemOutputSchema } from '../../../output-schemas';++export const createCollectionItemAiAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_collection_item',+ outputSchema: webflowCreateCollectionItemOutputSchema,+ displayName: 'Create Collection Item',+ description: 'Creates a staged item in a CMS collection.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates one staged item in a CMS collection. Field Data is keyed by field slug (from Get Collection) and must include name and slug; Option fields take the option id, Reference fields the referenced item id, Image and File fields {"url": "..."}. New items are drafts unless isDraft is "false". The item reaches the live site with Publish Collection Items or a site publish; use Create Live Collection Item to publish at once. Get the collection id from List Collections.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ fieldData: Property.Json({+ displayName: 'Field Data',+ description:+ 'Field values keyed by field slug, e.g. {"name": "My post", "slug": "my-post", "summary": "..."}. name and slug are required.',+ required: true,+ }),+ isDraft: webflowAiProps.flag({+ required: false,+ displayName: 'Is Draft',+ description: 'Webflow creates items as drafts unless this is "false". Drafts are not published with the site.',+ }),+ isArchived: webflowAiProps.flag({+ required: false,+ displayName: 'Is Archived',+ description: 'Archived items are hidden from the site. Defaults to false.',+ }),+ },+ async run(context) {+ const { collectionId, fieldData, isDraft, isArchived } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items`,+ body: {+ fieldData,+ ...(isDraft !== undefined ? { isDraft: isDraft === 'true' } : {}),+ ...(isArchived !== undefined ? { isArchived: isArchived === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/create-live-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/create-live-collection-item.tsnew file mode 100644index 00000000000..cd8cd2a5c71--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/create-live-collection-item.ts@@ -0,0 +1,47 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateLiveCollectionItemOutputSchema } from '../../../output-schemas';++export const createLiveCollectionItemAction = createAction({+ auth: webflowAuth,+ name: 'webflow_create_live_collection_item',+ outputSchema: webflowCreateLiveCollectionItemOutputSchema,+ displayName: 'Create Live Collection Item',+ description: 'Creates an item in a CMS collection and publishes it to the live site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates one CMS collection item and publishes it to the live site at once. Field Data is keyed by field slug (from Get Collection) and must include name and slug; Option fields take the option id, Reference fields the referenced item id, Image and File fields {"url": "..."}. Use Create Collection Item to create a draft without publishing. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ fieldData: Property.Json({+ displayName: 'Field Data',+ description:+ 'Field values keyed by field slug, e.g. {"name": "My post", "slug": "my-post", "summary": "..."}. name and slug are required.',+ required: true,+ }),+ isArchived: webflowAiProps.flag({+ required: false,+ displayName: 'Is Archived',+ description: 'Archived items are hidden from the site. Defaults to false.',+ }),+ },+ async run(context) {+ const { collectionId, fieldData, isArchived } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/live`,+ body: {+ fieldData,+ ...(isArchived !== undefined ? { isArchived: isArchived === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/delete-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/delete-collection-item.tsnew file mode 100644index 00000000000..caeed559c47--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/delete-collection-item.ts@@ -0,0 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCollectionItemOutputSchema } from '../../../output-schemas';++export const deleteCollectionItemAiAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_collection_item',+ outputSchema: webflowDeleteCollectionItemOutputSchema,+ displayName: 'Delete Collection Item',+ description: 'Permanently deletes an item from a CMS collection.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes one item from a CMS collection; it cannot be restored. To only take an item off the live site and keep it in the CMS, use Unpublish Live Collection Item; to delete several at once use Delete Collection Items. Get the collection id from List Collections and the item id from List Collection Items.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemId: webflowAiProps.itemId({ required: true }),+ },+ async run(context) {+ const { collectionId, itemId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`,+ });+ return { success: true, collectionId, itemId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/delete-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/delete-collection-items.tsnew file mode 100644index 00000000000..e9b66100751--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/delete-collection-items.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCollectionOutputSchema } from '../../../output-schemas';++export const deleteCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_collection_items',+ outputSchema: webflowDeleteCollectionOutputSchema,+ displayName: 'Delete Collection Items',+ description: 'Permanently deletes several items from a CMS collection.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes several items of one CMS collection in one request; they cannot be restored. To only take items off the live site and keep them in the CMS, use Unpublish Live Collection Items; for one item use Delete Collection Item. Get the collection id from List Collections and the item ids from List Collection Items.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ items: Property.Json({+ displayName: 'Items',+ description: 'Non-empty JSON array of the items to delete, e.g. [{"id": "<item id>"}, {"id": "<item id>"}].',+ required: true,+ }),+ },+ async run(context) {+ const { collectionId, items } = context.propsValue;+ if (!Array.isArray(items) || items.length === 0) {+ throw new Error('Items must be a non-empty JSON array of items, each with an id.');+ }+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items`,+ body: { items },+ });+ return { success: true, collectionId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/get-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/get-collection-item.tsnew file mode 100644index 00000000000..88991d09919--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/get-collection-item.ts@@ -0,0 +1,33 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCollectionItemOutputSchema } from '../../../output-schemas';++export const getCollectionItemAiAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_collection_item',+ outputSchema: webflowCreateCollectionItemOutputSchema,+ displayName: 'Get Collection Item',+ description: 'Gets the staged item from a CMS collection.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets one staged item of a CMS collection by id, with its field data (keyed by field slug) and draft, archived and publish state, including unpublished changes. For the version on the live site use Get Live Collection Item. Get the collection id from List Collections and the item id from List Collection Items.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemId: webflowAiProps.itemId({ required: true }),+ },+ async run(context) {+ const { collectionId, itemId } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/get-live-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/get-live-collection-item.tsnew file mode 100644index 00000000000..43528450d3c--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/get-live-collection-item.ts@@ -0,0 +1,33 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateLiveCollectionItemOutputSchema } from '../../../output-schemas';++export const getLiveCollectionItemAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_live_collection_item',+ outputSchema: webflowCreateLiveCollectionItemOutputSchema,+ displayName: 'Get Live Collection Item',+ description: 'Gets the published version of a CMS collection item.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Gets the live (published) version of one CMS collection item by id, with its field data keyed by field slug. For the staged version, including unpublished changes, use Get Collection Item. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections and the item id from List Live Collection Items.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemId: webflowAiProps.itemId({ required: true }),+ },+ async run(context) {+ const { collectionId, itemId } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/list-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/list-collection-items.tsnew file mode 100644index 00000000000..79cfae55532--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/list-collection-items.ts@@ -0,0 +1,77 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCollectionItemsOutputSchema } from '../../../output-schemas';++export const listCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_collection_items',+ outputSchema: webflowListCollectionItemsOutputSchema,+ displayName: 'List Collection Items',+ description: 'Lists the staged (draft and published) items of a CMS collection.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the staged items of a CMS collection, including drafts, with each item's id, field data (keyed by field slug) and draft, archived and publish state. Filter by exact name or slug, sort, and page with limit and offset. For only what is live on the site use List Live Collection Items. Get the collection id from List Collections.",+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Return only items whose name is exactly this.',+ required: false,+ }),+ slug: Property.ShortText({+ displayName: 'Slug',+ description: 'Return only the item with this slug.',+ required: false,+ }),+ sortBy: Property.StaticDropdown({+ displayName: 'Sort By',+ description: 'Field to sort by. Defaults to the order Webflow returns.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Last Published', value: 'lastPublished' },+ { label: 'Name', value: 'name' },+ { label: 'Slug', value: 'slug' },+ ],+ },+ }),+ sortOrder: Property.StaticDropdown({+ displayName: 'Sort Order',+ description: 'asc or desc.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Ascending', value: 'asc' },+ { label: 'Descending', value: 'desc' },+ ],+ },+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { collectionId, name, slug, sortBy, sortOrder, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items`,+ query: {+ ...(name ? { name } : {}),+ ...(slug ? { slug } : {}),+ ...(sortBy ? { sortBy } : {}),+ ...(sortOrder ? { sortOrder } : {}),+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/list-live-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/list-live-collection-items.tsnew file mode 100644index 00000000000..f4c8844ee4f--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/list-live-collection-items.ts@@ -0,0 +1,77 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListLiveCollectionItemsOutputSchema } from '../../../output-schemas';++export const listLiveCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_live_collection_items',+ outputSchema: webflowListLiveCollectionItemsOutputSchema,+ displayName: 'List Live Collection Items',+ description: 'Lists the published items of a CMS collection as they appear on the live site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the live (published) items of a CMS collection with each item's id and published field data (keyed by field slug); drafts and unpublished changes are left out. Filter by exact name or slug, sort, and page with limit and offset. For the staged items, including drafts, use List Collection Items. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections.",+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Return only items whose name is exactly this.',+ required: false,+ }),+ slug: Property.ShortText({+ displayName: 'Slug',+ description: 'Return only the item with this slug.',+ required: false,+ }),+ sortBy: Property.StaticDropdown({+ displayName: 'Sort By',+ description: 'Field to sort by. Defaults to the order Webflow returns.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Last Published', value: 'lastPublished' },+ { label: 'Name', value: 'name' },+ { label: 'Slug', value: 'slug' },+ ],+ },+ }),+ sortOrder: Property.StaticDropdown({+ displayName: 'Sort Order',+ description: 'asc or desc.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Ascending', value: 'asc' },+ { label: 'Descending', value: 'desc' },+ ],+ },+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { collectionId, name, slug, sortBy, sortOrder, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/live`,+ query: {+ ...(name ? { name } : {}),+ ...(slug ? { slug } : {}),+ ...(sortBy ? { sortBy } : {}),+ ...(sortOrder ? { sortOrder } : {}),+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/publish-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/publish-collection-items.tsnew file mode 100644index 00000000000..b64671dcd6c--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/publish-collection-items.ts@@ -0,0 +1,41 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { publishCollectionItemOutputSchema } from '../../../output-schemas';++export const publishCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_publish_collection_items',+ outputSchema: publishCollectionItemOutputSchema,+ displayName: 'Publish Collection Items',+ description: 'Publishes staged CMS collection items to the live site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Publishes the staged version of one or more items of a CMS collection to the live site, without publishing the rest of the site. The response lists the published item ids and any per-item errors. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections and the item ids from List Collection Items or Create Collection Item.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemIds: Property.Array({+ displayName: 'Item IDs',+ description: 'IDs of the items to publish, all from this collection.',+ required: true,+ }),+ },+ async run(context) {+ const { collectionId, itemIds } = context.propsValue;+ if (!Array.isArray(itemIds) || itemIds.length === 0) {+ throw new Error('Item IDs must be a non-empty array of item ids.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/publish`,+ body: { itemIds },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/unpublish-live-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/unpublish-live-collection-item.tsnew file mode 100644index 00000000000..73debd0ccf9--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/unpublish-live-collection-item.ts@@ -0,0 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCollectionItemOutputSchema } from '../../../output-schemas';++export const unpublishLiveCollectionItemAction = createAction({+ auth: webflowAuth,+ name: 'webflow_unpublish_live_collection_item',+ outputSchema: webflowDeleteCollectionItemOutputSchema,+ displayName: 'Unpublish Live Collection Item',+ description: 'Removes an item from the live site and keeps it in the CMS.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Removes one published item from the live site; the item stays in the CMS and can be published again with Publish Collection Items. Use Unpublish Live Collection Items for several at once, or Delete Collection Item to remove it for good. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections and the item id from List Live Collection Items.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemId: webflowAiProps.itemId({ required: true }),+ },+ async run(context) {+ const { collectionId, itemId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`,+ });+ return { success: true, collectionId, itemId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/unpublish-live-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/unpublish-live-collection-items.tsnew file mode 100644index 00000000000..8e372d2188b--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/unpublish-live-collection-items.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteCollectionOutputSchema } from '../../../output-schemas';++export const unpublishLiveCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_unpublish_live_collection_items',+ outputSchema: webflowDeleteCollectionOutputSchema,+ displayName: 'Unpublish Live Collection Items',+ description: 'Removes several items from the live site and keeps them in the CMS.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Removes several published items of one CMS collection from the live site in one request; the items stay in the CMS and can be published again with Publish Collection Items. Use Delete Collection Items to remove them for good, or Unpublish Live Collection Item for one item. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections and the item ids from List Live Collection Items.',+ idempotent: false,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ items: Property.Json({+ displayName: 'Items',+ description: 'Non-empty JSON array of the items to unpublish, e.g. [{"id": "<item id>"}, {"id": "<item id>"}].',+ required: true,+ }),+ },+ async run(context) {+ const { collectionId, items } = context.propsValue;+ if (!Array.isArray(items) || items.length === 0) {+ throw new Error('Items must be a non-empty JSON array of items, each with an id.');+ }+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/live`,+ body: { items },+ });+ return { success: true, collectionId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/update-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-collection-item.tsnew file mode 100644index 00000000000..003ca4d527d--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-collection-item.ts@@ -0,0 +1,58 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateCollectionItemOutputSchema } from '../../../output-schemas';++export const updateCollectionItemAiAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_collection_item',+ outputSchema: webflowCreateCollectionItemOutputSchema,+ displayName: 'Update Collection Item',+ description: 'Updates the staged version of a CMS collection item.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates the staged version of one CMS collection item: only the fields in Field Data (keyed by field slug) and the flags you set change. Changes reach the live site after Publish Collection Items or a site publish; use Update Live Collection Item to change and publish at once. Set at least one of Field Data, Is Draft or Is Archived. Get the collection id from List Collections and the item id from List Collection Items.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemId: webflowAiProps.itemId({ required: true }),+ fieldData: Property.Json({+ displayName: 'Field Data',+ description:+ 'Only the field values to change, keyed by field slug, e.g. {"summary": "..."}. Option fields take the option id, Reference fields the referenced item id, Image and File fields {"url": "..."}.',+ required: false,+ }),+ isDraft: webflowAiProps.flag({+ required: false,+ displayName: 'Is Draft',+ description: '"true" holds the changes back from publishing; it never unpublishes a live item.',+ }),+ isArchived: webflowAiProps.flag({+ required: false,+ displayName: 'Is Archived',+ description: 'Archived items are hidden from the site.',+ }),+ },+ async run(context) {+ const { collectionId, itemId, fieldData, isDraft, isArchived } = context.propsValue;+ const hasFieldData = fieldData !== undefined && fieldData !== null && Object.keys(fieldData).length > 0;+ if (!hasFieldData && isDraft === undefined && isArchived === undefined) {+ throw new Error('Set at least one of Field Data, Is Draft or Is Archived.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`,+ body: {+ ...(hasFieldData ? { fieldData } : {}),+ ...(isDraft !== undefined ? { isDraft: isDraft === 'true' } : {}),+ ...(isArchived !== undefined ? { isArchived: isArchived === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/update-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-collection-items.tsnew file mode 100644index 00000000000..3da80dc54e0--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-collection-items.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowUpdateCollectionItemsOutputSchema } from '../../../output-schemas';++export const updateCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_collection_items',+ outputSchema: webflowUpdateCollectionItemsOutputSchema,+ displayName: 'Update Collection Items',+ description: 'Updates the staged version of several CMS collection items in one request.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates the staged version of several items of one CMS collection in one request; each entry changes only the fields and flags it carries. Changes reach the live site after Publish Collection Items or a site publish; use Update Live Collection Items to change and publish at once, or Update Collection Item for a single item. Get the collection id from List Collections and the item ids from List Collection Items.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ items: Property.Json({+ displayName: 'Items',+ description:+ 'Non-empty JSON array, one entry per item: {"id": "<item id>", "fieldData": {<field slug>: <value>}, "isDraft": false, "isArchived": false}. Only id is required; fieldData holds only the fields to change.',+ required: true,+ }),+ },+ async run(context) {+ const { collectionId, items } = context.propsValue;+ if (!Array.isArray(items) || items.length === 0) {+ throw new Error('Items must be a non-empty JSON array of items, each with an id.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items`,+ body: { items },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/update-live-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-live-collection-item.tsnew file mode 100644index 00000000000..021faff042f--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-live-collection-item.ts@@ -0,0 +1,58 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowCreateLiveCollectionItemOutputSchema } from '../../../output-schemas';++export const updateLiveCollectionItemAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_live_collection_item',+ outputSchema: webflowCreateLiveCollectionItemOutputSchema,+ displayName: 'Update Live Collection Item',+ description: 'Updates a CMS collection item and publishes the change to the live site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates one CMS collection item and publishes the change to the live site at once: only the fields in Field Data (keyed by field slug) and the flags you set change. Use Update Collection Item to change the staged version without publishing. Set at least one of Field Data, Is Draft or Is Archived. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections and the item id from List Live Collection Items.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ itemId: webflowAiProps.itemId({ required: true }),+ fieldData: Property.Json({+ displayName: 'Field Data',+ description:+ 'Only the field values to change, keyed by field slug, e.g. {"summary": "..."}. Option fields take the option id, Reference fields the referenced item id, Image and File fields {"url": "..."}.',+ required: false,+ }),+ isDraft: webflowAiProps.flag({+ required: false,+ displayName: 'Is Draft',+ description: 'Sets the item\'s draft state.',+ }),+ isArchived: webflowAiProps.flag({+ required: false,+ displayName: 'Is Archived',+ description: 'Archived items are hidden from the site.',+ }),+ },+ async run(context) {+ const { collectionId, itemId, fieldData, isDraft, isArchived } = context.propsValue;+ const hasFieldData = fieldData !== undefined && fieldData !== null && Object.keys(fieldData).length > 0;+ if (!hasFieldData && isDraft === undefined && isArchived === undefined) {+ throw new Error('Set at least one of Field Data, Is Draft or Is Archived.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`,+ body: {+ ...(hasFieldData ? { fieldData } : {}),+ ...(isDraft !== undefined ? { isDraft: isDraft === 'true' } : {}),+ ...(isArchived !== undefined ? { isArchived: isArchived === 'true' } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/items/update-live-collection-items.ts b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-live-collection-items.tsnew file mode 100644index 00000000000..9a942fe6db3--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/items/update-live-collection-items.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowUpdateLiveCollectionItemsOutputSchema } from '../../../output-schemas';++export const updateLiveCollectionItemsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_live_collection_items',+ outputSchema: webflowUpdateLiveCollectionItemsOutputSchema,+ displayName: 'Update Live Collection Items',+ description: 'Updates several CMS collection items and publishes the changes to the live site.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates several items of one CMS collection and publishes the changes to the live site in one request; each entry changes only the fields and flags it carries. Use Update Collection Items to change the staged versions without publishing, or Update Live Collection Item for a single item. A collection created since the last site publish returns 404 here until a site publish finishes (Publish Site returns before the publish is done; retry after a few seconds). Get the collection id from List Collections and the item ids from List Live Collection Items.',+ idempotent: true,+ },+ props: {+ collectionId: webflowAiProps.collectionId({ required: true }),+ items: Property.Json({+ displayName: 'Items',+ description:+ 'Non-empty JSON array, one entry per item: {"id": "<item id>", "fieldData": {<field slug>: <value>}, "isArchived": false}. Only id is required; fieldData holds only the fields to change.',+ required: true,+ }),+ },+ async run(context) {+ const { collectionId, items } = context.propsValue;+ if (!Array.isArray(items) || items.length === 0) {+ throw new Error('Items must be a non-empty JSON array of items, each with an id.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/live`,+ body: { items },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/meta/get-authorized-user.ts b/packages/pieces/community/webflow/src/lib/actions/ai/meta/get-authorized-user.tsnew file mode 100644index 00000000000..43818191b20--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/meta/get-authorized-user.ts@@ -0,0 +1,28 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowGetAuthorizedUserOutputSchema } from '../../../output-schemas';++export const getAuthorizedUserAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_authorized_user',+ outputSchema: webflowGetAuthorizedUserOutputSchema,+ displayName: 'Get Authorized User',+ description: 'Gets the Webflow user who authorized this connection.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns the id, email and name of the Webflow user who authorized this connection. Use it to confirm which account the connection acts as.',+ idempotent: true,+ },+ props: {},+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: '/v2/token/authorized_by',+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/meta/get-token-info.ts b/packages/pieces/community/webflow/src/lib/actions/ai/meta/get-token-info.tsnew file mode 100644index 00000000000..b5d5f637a04--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/meta/get-token-info.ts@@ -0,0 +1,28 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowGetTokenInfoOutputSchema } from '../../../output-schemas';++export const getTokenInfoAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_token_info',+ outputSchema: webflowGetTokenInfoOutputSchema,+ displayName: 'Get Token Info',+ description: 'Gets the workspaces, sites and scopes this connection can access.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns what this connection is authorized for: its scopes, the workspace and site ids it can reach, and the app it belongs to. Use it to check access before calling site or workspace actions.',+ idempotent: true,+ },+ props: {},+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: '/v2/token/introspect',+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/pages/get-page-content.ts b/packages/pieces/community/webflow/src/lib/actions/ai/pages/get-page-content.tsnew file mode 100644index 00000000000..0afd2c51f98--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/pages/get-page-content.ts@@ -0,0 +1,50 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageContentOutputSchema } from '../../../output-schemas';++export const getPageContentAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_page_content',+ outputSchema: webflowGetPageContentOutputSchema,+ displayName: 'Get Page Content',+ description: 'Gets the content nodes of a page.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Gets a static page's content as nodes (text, images, component instances, form elements) with their ids. Pages with limit and offset. Use Get Page for title, slug and SEO. Get the page id from List Pages.",+ idempotent: true,+ },+ props: {+ pageId: webflowAiProps.pageId({ required: true }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read. Leave empty for the primary locale.',+ required: false,+ }),+ translatable: Property.ShortText({+ displayName: 'Translatable Into Locale ID',+ description: 'Secondary locale ID you are translating into. Returns only content not excluded from translation for that locale.',+ required: false,+ }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ const { pageId, localeId, translatable, limit, offset } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/pages/${encodeURIComponent(pageId)}/dom`,+ query: {+ limit: String(limit ?? 100),+ offset: String(offset ?? 0),+ ...(localeId ? { localeId } : {}),+ ...(translatable ? { translatable } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/pages/get-page.ts b/packages/pieces/community/webflow/src/lib/actions/ai/pages/get-page.tsnew file mode 100644index 00000000000..8c9478116a6--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/pages/get-page.ts@@ -0,0 +1,46 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageOutputSchema } from '../../../output-schemas';++export const getPageAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_page',+ outputSchema: webflowGetPageOutputSchema,+ displayName: 'Get Page',+ description: 'Gets the metadata of a page.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Gets one page's metadata: title, slug, parent folder, SEO and Open Graph settings, draft and archived state. Use Get Page Content for its text nodes. Get the page id from List Pages.",+ idempotent: true,+ },+ props: {+ pageId: webflowAiProps.pageId({ required: true }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to read. Leave empty for the primary locale.',+ required: false,+ }),+ translatable: Property.ShortText({+ displayName: 'Translatable Into Locale ID',+ description: 'Secondary locale ID you are translating into. Returns only content not excluded from translation for that locale.',+ required: false,+ }),+ },+ async run(context) {+ const { pageId, localeId, translatable } = context.propsValue;+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/pages/${encodeURIComponent(pageId)}`,+ query: {+ ...(localeId ? { localeId } : {}),+ ...(translatable ? { translatable } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/pages/list-pages.ts b/packages/pieces/community/webflow/src/lib/actions/ai/pages/list-pages.tsnew file mode 100644index 00000000000..0b4befd42a2--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/pages/list-pages.ts@@ -0,0 +1,37 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListPagesOutputSchema } from '../../../output-schemas';++export const listPagesAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_pages',+ outputSchema: webflowListPagesOutputSchema,+ displayName: 'List Pages',+ description: 'Lists the pages of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the pages of a site with each page's id, title, slug, parent folder and draft or archived state. Pages with limit and offset. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ limit: webflowAiProps.limit({ required: false }),+ offset: webflowAiProps.offset({ required: false }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/pages`,+ query: {+ limit: String(context.propsValue.limit ?? 100),+ offset: String(context.propsValue.offset ?? 0),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/pages/update-page.ts b/packages/pieces/community/webflow/src/lib/actions/ai/pages/update-page.tsnew file mode 100644index 00000000000..b3bd2f5f9c4--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/pages/update-page.ts@@ -0,0 +1,82 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetPageOutputSchema } from '../../../output-schemas';++export const updatePageAction = createAction({+ auth: webflowAuth,+ name: 'webflow_update_page',+ outputSchema: webflowGetPageOutputSchema,+ displayName: 'Update Page',+ description: 'Updates the title, slug, SEO or Open Graph settings of a page.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Updates a page's metadata (title, slug, SEO, Open Graph); only the fields given change, and at least one is required. Does not change page content or publish the site. Get the page id from List Pages.",+ idempotent: true,+ },+ props: {+ pageId: webflowAiProps.pageId({ required: true }),+ localeId: Property.ShortText({+ displayName: 'Locale ID',+ description: 'Locale ID to update. Leave empty for the primary locale.',+ required: false,+ }),+ title: Property.ShortText({+ displayName: 'Title',+ description: 'New page title.',+ required: false,+ }),+ slug: Property.ShortText({+ displayName: 'Slug',+ description: 'New page slug. Ignored for the home page, collection template pages and utility pages.',+ required: false,+ }),+ seo: Property.Json({+ displayName: 'SEO',+ description: 'SEO fields as an object, e.g. {"title": "...", "description": "..."}.',+ required: false,+ }),+ openGraph: Property.Json({+ displayName: 'Open Graph',+ description:+ 'Open Graph fields as an object, e.g. {"title": "...", "description": "...", "titleCopied": false, "descriptionCopied": false}.',+ required: false,+ }),+ },+ async run(context) {+ const { pageId, localeId, title, slug, seo, openGraph } = context.propsValue;+ const seoGiven = hasKeys({ name: 'seo', value: seo });+ const openGraphGiven = hasKeys({ name: 'openGraph', value: openGraph });+ if (title === undefined && slug === undefined && !seoGiven && !openGraphGiven) {+ throw new Error('Set at least one of title, slug, seo or openGraph.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PUT,+ path: `/v2/pages/${encodeURIComponent(pageId)}`,+ query: {+ ...(localeId ? { localeId } : {}),+ },+ body: {+ ...(title !== undefined ? { title } : {}),+ ...(slug !== undefined ? { slug } : {}),+ ...(seoGiven ? { seo } : {}),+ ...(openGraphGiven ? { openGraph } : {}),+ },+ });+ },+});++function hasKeys({ name, value }: { name: string; value: unknown }): boolean {+ if (value === undefined || value === null) {+ return false;+ }+ if (typeof value !== 'object' || Array.isArray(value)) {+ throw new Error(`${name} must be a JSON object.`);+ }+ return Object.keys(value).length > 0;+}diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/delete-google-tag.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/delete-google-tag.tsnew file mode 100644index 00000000000..f9d589ae989--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/delete-google-tag.ts@@ -0,0 +1,38 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteGoogleTagOutputSchema } from '../../../output-schemas';++export const deleteGoogleTagAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_google_tag',+ outputSchema: webflowDeleteGoogleTagOutputSchema,+ displayName: 'Delete Google Tag',+ description: 'Removes one Google Tag ID from a site.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently removes one Google Tag ID from a site and renumbers the order of the rest. Get the tag id from List Google Tags and the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ tagId: Property.ShortText({+ displayName: 'Tag ID',+ description: 'Google Tag ID to remove, e.g. "G-1234567890". Use List Google Tags to find it.',+ required: true,+ }),+ },+ async run(context) {+ const { siteId, tagId } = context.propsValue;+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/sites/${encodeURIComponent(siteId)}/integrations/google_tags/${encodeURIComponent(tagId)}`,+ });+ return { success: true, siteId, tagId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/delete-google-tags.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/delete-google-tags.tsnew file mode 100644index 00000000000..c54c66d349c--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/delete-google-tags.ts@@ -0,0 +1,32 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowDeleteGoogleTagsOutputSchema } from '../../../output-schemas';++export const deleteGoogleTagsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_delete_google_tags',+ outputSchema: webflowDeleteGoogleTagsOutputSchema,+ displayName: 'Delete All Google Tags',+ description: 'Removes every Google Tag ID from a site.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently removes every Google Tag ID from a site. To remove a single tag use Delete Google Tag. Get the site id from List Sites.',+ idempotent: false,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/integrations/google_tags`,+ });+ return { success: true, siteId: context.propsValue.siteId };+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/get-site.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/get-site.tsnew file mode 100644index 00000000000..0ad9d071ea2--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/get-site.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowGetSiteOutputSchema } from '../../../output-schemas';++export const getSiteAction = createAction({+ auth: webflowAuth,+ name: 'webflow_get_site',+ outputSchema: webflowGetSiteOutputSchema,+ displayName: 'Get Site',+ description: 'Gets the details of a Webflow site.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns one site's details: name, short name, preview URL, time zone, locales, custom domains and last publish time. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-custom-domains.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-custom-domains.tsnew file mode 100644index 00000000000..c2237c9ef68--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-custom-domains.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListCustomDomainsOutputSchema } from '../../../output-schemas';++export const listCustomDomainsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_custom_domains',+ outputSchema: webflowListCustomDomainsOutputSchema,+ displayName: 'List Custom Domains',+ description: 'Lists the custom domains of a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the custom domains attached to a site, with each domain's id, URL and last publish time. Use the ids with Publish Site to publish to specific domains. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/custom_domains`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-google-tags.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-google-tags.tsnew file mode 100644index 00000000000..5f5c59fab98--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-google-tags.ts@@ -0,0 +1,31 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowListGoogleTagsOutputSchema } from '../../../output-schemas';++export const listGoogleTagsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_google_tags',+ outputSchema: webflowListGoogleTagsOutputSchema,+ displayName: 'List Google Tags',+ description: 'Lists the Google Tag IDs configured on a site.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists the Google Tag IDs (G-, GT-, AW-, DC-) configured on a site, with each tag's display name and order. Get the site id from List Sites.",+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ },+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.siteId)}/integrations/google_tags`,+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-sites.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-sites.tsnew file mode 100644index 00000000000..9dce73cd5fb--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/list-sites.ts@@ -0,0 +1,28 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowClient } from '../../../common/client';+import { webflowListSitesOutputSchema } from '../../../output-schemas';++export const listSitesAiAction = createAction({+ auth: webflowAuth,+ name: 'webflow_list_sites',+ outputSchema: webflowListSitesOutputSchema,+ displayName: 'List Sites',+ description: 'Lists the Webflow sites this connection can access.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists every Webflow site this connection can access, with each site\'s id, name, domains and locales. Start here to get the site id other actions need.',+ idempotent: true,+ },+ props: {},+ async run(context) {+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: '/v2/sites',+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/publish-site.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/publish-site.tsnew file mode 100644index 00000000000..938265facea--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/publish-site.ts@@ -0,0 +1,58 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowPublishSiteOutputSchema } from '../../../output-schemas';++export const publishSiteAction = createAction({+ auth: webflowAuth,+ name: 'webflow_publish_site',+ outputSchema: webflowPublishSiteOutputSchema,+ displayName: 'Publish Site',+ description: 'Publishes a site, or one page of it, to its webflow.io subdomain and custom domains.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Publishes the current version of a site live, to its webflow.io subdomain and/or the custom domains given (ids from List Custom Domains). Set Page ID to publish one page only. At least one target is required. Webflow allows one publish per minute per site.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ publishToWebflowSubdomain: webflowAiProps.flag({+ required: false,+ displayName: 'Publish to webflow.io Subdomain',+ description: "Whether to publish to the site's webflow.io subdomain.",+ }),+ customDomainIds: Property.Array({+ displayName: 'Custom Domain IDs',+ description: 'Ids of the custom domains to publish to. Use List Custom Domains to find them.',+ required: false,+ }),+ pageId: Property.ShortText({+ displayName: 'Page ID',+ description: 'Publish only this page. Use List Pages to find it. Leave empty to publish the whole site.',+ required: false,+ }),+ },+ async run(context) {+ const { siteId, publishToWebflowSubdomain, customDomainIds, pageId } = context.propsValue;+ const customDomains = (customDomainIds ?? []).map((id) => String(id));+ if (publishToWebflowSubdomain !== 'true' && customDomains.length === 0) {+ throw new Error('Set publishToWebflowSubdomain to "true" or give at least one id in customDomainIds.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/publish`,+ body: {+ customDomains,+ ...(publishToWebflowSubdomain !== undefined+ ? { publishToWebflowSubdomain: publishToWebflowSubdomain === 'true' }+ : {}),+ ...(pageId ? { pageId } : {}),+ },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/ai/sites/upsert-google-tags.ts b/packages/pieces/community/webflow/src/lib/actions/ai/sites/upsert-google-tags.tsnew file mode 100644index 00000000000..66c6bc08344--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/actions/ai/sites/upsert-google-tags.ts@@ -0,0 +1,58 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../../../auth';+import { webflowAiProps } from '../../../common/ai-props';+import { webflowClient } from '../../../common/client';+import { webflowUpsertGoogleTagsOutputSchema } from '../../../output-schemas';++export const upsertGoogleTagsAction = createAction({+ auth: webflowAuth,+ name: 'webflow_upsert_google_tags',+ outputSchema: webflowUpsertGoogleTagsOutputSchema,+ displayName: 'Add or Update Google Tags',+ description: 'Adds Google Tag IDs to a site, or updates the ones it already has.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Adds the given Google Tag IDs to a site or updates their display name and order; tags not listed are kept. Use Delete Google Tag to remove one. Accepts G-, GT-, AW- and DC- ids, not UA-; a site holds at most 25 tags. Get the site id from List Sites.',+ idempotent: true,+ },+ props: {+ siteId: webflowAiProps.siteId({ required: true }),+ googleTagIds: Property.Array({+ displayName: 'Google Tags',+ description: 'Tags to add or update.',+ required: true,+ properties: {+ tagId: Property.ShortText({+ displayName: 'Tag ID',+ description: 'Google Tag ID, e.g. "G-1234567890".',+ required: true,+ }),+ displayName: Property.ShortText({+ displayName: 'Display Name',+ description: 'Label for the tag, e.g. "Main Analytics Tag".',+ required: true,+ }),+ order: Property.Number({+ displayName: 'Order',+ description: 'Display order. Webflow assigns one to new tags when empty.',+ required: false,+ }),+ },+ }),+ },+ async run(context) {+ const { siteId, googleTagIds } = context.propsValue;+ if (!googleTagIds || googleTagIds.length === 0) {+ throw new Error('googleTagIds must hold at least one tag.');+ }+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/sites/${encodeURIComponent(siteId)}/integrations/google_tags`,+ body: { googleTagIds },+ });+ },+});diff --git a/packages/pieces/community/webflow/src/lib/actions/create-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/create-collection-item.tsindex d2ac09cdb89..344b511dd42 100644--- a/packages/pieces/community/webflow/src/lib/actions/create-collection-item.ts+++ b/packages/pieces/community/webflow/src/lib/actions/create-collection-item.ts@@ -1,21 +1,25 @@-import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../auth';+import { webflowApi } from '../common/api';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { webflowUtils } from '../common/utils';+import { createCollectionItemOutputSchema } from '../output-schemas';-export const webflowCreateCollectionItemAction = createAction({+export const createCollectionItemAction = createAction({auth: webflowAuth,name: 'create_collection_item',+ outputSchema: createCollectionItemOutputSchema,classification: 'WRITE',displayName: 'Create Collection Item',description: 'Creates new collection item.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Creates a new item in a Webflow CMS collection. Provide the collection ID and the field values (keyed by field slug); optionally mark the item as archived or draft. Use to add CMS content like blog posts or products. Each call creates a distinct item, so it is not idempotent.', idempotent: false },props: {- site_id: webflowProps.site_id,- collection_id: webflowProps.collection_id,- collection_fields: webflowProps.collection_fields,+ site_id: webflowProps.siteId({ required: true }),+ collection_id: webflowProps.collectionId({ required: true }),+ collection_fields: webflowProps.collectionFields({ required: true }),is_archived: Property.Checkbox({displayName: 'Is Archived',description: 'Whether the item is archived or not',@@ -33,33 +37,20 @@ export const webflowCreateCollectionItemAction = createAction({const isDraft = context.propsValue.is_draft;const collectionInputFields = context.propsValue.collection_fields;- const client = new WebflowApiClient(context.auth.access_token);- const { fields: CollectionFields } = await client.getCollection(collectionId);-- const formattedCollectionFields: DynamicPropsValue = {};- for (const field of CollectionFields) {- const fieldValue = collectionInputFields[field.slug];-- if (fieldValue !== undefined && fieldValue !== '') {- switch (field.type) {- case 'ImageRef':- case 'FileRef':- formattedCollectionFields[field.slug] = { url: fieldValue };- break;- case 'Set':- formattedCollectionFields[field.slug] = fieldValue.map((url: string) => ({ url: url }));- break;- case 'Number':- formattedCollectionFields[field.slug] = Number(fieldValue);- break;- default:- formattedCollectionFields[field.slug] = fieldValue;- }- }- }+ const { fields } = await webflowApi.getCollection({+ auth: context.auth,+ collectionId,+ });- return await client.createCollectionItem(collectionId, {- fields: { ...formattedCollectionFields, _archived: isArchived, _draft: isDraft },+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items`,+ body: {+ isArchived: isArchived ?? false,+ isDraft: isDraft ?? false,+ fieldData: webflowUtils.formatFieldData({ fields, values: collectionInputFields }),+ },});},});diff --git a/packages/pieces/community/webflow/src/lib/actions/delete-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/delete-collection-item.tsindex 2d3f8bb525a..14fd93b7dac 100644--- a/packages/pieces/community/webflow/src/lib/actions/delete-collection-item.ts+++ b/packages/pieces/community/webflow/src/lib/actions/delete-collection-item.ts@@ -1,29 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { deleteCollectionItemOutputSchema } from '../output-schemas';-export const webflowDeleteCollectionItem = createAction({+export const deleteCollectionItemAction = createAction({auth: webflowAuth,name: 'delete_collection_item',+ outputSchema: deleteCollectionItemOutputSchema,classification: 'DESTRUCTIVE',description: 'Delete collection item',displayName: 'Delete an item in a collection',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Permanently deletes a single item from a Webflow CMS collection, identified by collection ID and item ID. Use when an agent needs to remove existing CMS content. Repeating the call after the item is gone has no further effect, so it is effectively idempotent on the same item ID.', idempotent: true },props: {- site_id: webflowProps.site_id,- collection_id: webflowProps.collection_id,- collection_item_id: webflowProps.collection_item_id,+ site_id: webflowProps.siteId({ required: true }),+ collection_id: webflowProps.collectionId({ required: true }),+ collection_item_id: webflowProps.collectionItemId({ required: true }),},async run(context) {const collectionId = context.propsValue.collection_id;const collectionItemId = context.propsValue.collection_item_id;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.deleteCollectionItem(collectionId, collectionItemId);+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(collectionItemId)}`,+ });+ return { success: true, collectionItemId };},});diff --git a/packages/pieces/community/webflow/src/lib/actions/find-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/find-collection-item.tsindex 2545c50e617..a6688daba44 100644--- a/packages/pieces/community/webflow/src/lib/actions/find-collection-item.ts+++ b/packages/pieces/community/webflow/src/lib/actions/find-collection-item.ts@@ -1,24 +1,23 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';-import {- HttpRequest,- HttpMethod,- httpClient,- AuthenticationType,-} from '@activepieces/pieces-common';-import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';+import type { WebflowCollectionItemsPage } from '../common/types';+import { findCollectionItemOutputSchema } from '../output-schemas';-export const webflowFindCollectionItem = createAction({+export const findCollectionItemAction = createAction({auth: webflowAuth,name: 'find_collection_item',+ outputSchema: findCollectionItemOutputSchema,classification: 'SEARCH',description: 'Find collection item in a collection by field',displayName: 'Find a Collection Item by Field',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Searches a Webflow CMS collection for items whose given field name exactly matches the supplied value, optionally capped by a max-results limit. Use to look up an item by a known field value (e.g. slug or name) before reading or updating it. Read-only and idempotent. Note: matching is an exact equality filter applied client-side over the fetched items, not a fuzzy or paginated server search.', idempotent: true },props: {- site_id: webflowProps.site_id,- collection_id: webflowProps.collection_id,+ site_id: webflowProps.siteId({ required: true }),+ collection_id: webflowProps.collectionId({ required: true }),field_name: Property.ShortText({displayName: 'Field Name',description: 'The name of the field to search by',@@ -37,31 +36,22 @@ export const webflowFindCollectionItem = createAction({},async run(configValue) {- const accessToken = configValue.auth['access_token'];const collectionId = configValue.propsValue['collection_id'];const fieldName = configValue.propsValue['field_name'];const fieldValue = configValue.propsValue['field_value'];const maxResults = configValue.propsValue['max_results'];- const request: HttpRequest = {- method: HttpMethod.GET,- url: `https://api.webflow.com/collections/${collectionId}/items`,- authentication: {- type: AuthenticationType.BEARER_TOKEN,- token: accessToken,- },- };-try {- const res = await httpClient.sendRequest(request);- if (res.status !== 200) {- throw new Error('Failed to fetch collection items');- }+ const res = await webflowClient.request<WebflowCollectionItemsPage>({+ auth: configValue.auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items`,+ });- const items = res.body.items;+ const items = res.items;const matches = items- .filter((item: any) => {- return item.fields[fieldName] === fieldValue;+ .filter((item) => {+ return item.fieldData[fieldName] === fieldValue;}).slice(0, maxResults);diff --git a/packages/pieces/community/webflow/src/lib/actions/find-order.ts b/packages/pieces/community/webflow/src/lib/actions/find-order.tsindex 66cb520e73e..5fe423518a9 100644--- a/packages/pieces/community/webflow/src/lib/actions/find-order.ts+++ b/packages/pieces/community/webflow/src/lib/actions/find-order.ts@@ -1,11 +1,13 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { orderOutputSchema } from '../output-schemas';-export const webflowFindOrder = createAction({+export const findOrderAction = createAction({auth: webflowAuth,+ outputSchema: orderOutputSchema,name: 'find_order',classification: 'READ',description: 'Find order',@@ -13,16 +15,18 @@ export const webflowFindOrder = createAction({audience: 'both',aiMetadata: { description: 'Retrieves a single Webflow Ecommerce order by its site ID and order ID. Use to look up order details before fulfilling, refunding, or unfulfilling it. Read-only and idempotent.', idempotent: true },props: {- site_id: webflowProps.site_id,- order_id: webflowProps.order_id,+ site_id: webflowProps.siteId({ required: true }),+ order_id: webflowProps.orderId({ required: true }),},async run(context) {const orderId = context.propsValue.order_id;const siteId = context.propsValue.site_id;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.getOrder(siteId, orderId);+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}`,+ });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/fulfill-order.ts b/packages/pieces/community/webflow/src/lib/actions/fulfill-order.tsindex d5a03a3738a..a32bd0d55fa 100644--- a/packages/pieces/community/webflow/src/lib/actions/fulfill-order.ts+++ b/packages/pieces/community/webflow/src/lib/actions/fulfill-order.ts@@ -1,11 +1,13 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { orderOutputSchema } from '../output-schemas';-export const webflowFulfillOrder = createAction({+export const fulfillOrderAction = createAction({auth: webflowAuth,+ outputSchema: orderOutputSchema,name: 'fulfill_order',classification: 'WRITE',description: 'Fulfill order',@@ -13,8 +15,8 @@ export const webflowFulfillOrder = createAction({audience: 'both',aiMetadata: { description: 'Marks an existing Webflow Ecommerce order as fulfilled, identified by site ID and order ID, optionally sending the customer a fulfillment email. Use after shipping or completing an order. Setting fulfilled state is idempotent, but enabling the email may resend a notification, so prefer leaving it off when retrying.', idempotent: false },props: {- site_id: webflowProps.site_id,- order_id: webflowProps.order_id,+ site_id: webflowProps.siteId({ required: true }),+ order_id: webflowProps.orderId({ required: true }),send_order_fulfilled_email: Property.Checkbox({displayName: 'Send Order Fulfilled Email',description: 'Send an email to the customer that their order has been fulfilled',@@ -27,8 +29,11 @@ export const webflowFulfillOrder = createAction({const siteId = context.propsValue.site_id;const sendOrderFulfilledEmail = context.propsValue.send_order_fulfilled_email;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.fulfillOrder(siteId, orderId, { sendOrderFulfilledEmail });+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/fulfill`,+ body: { sendOrderFulfilledEmail },+ });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/get-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/get-collection-item.tsindex fba12acaf88..7018a4b6f36 100644--- a/packages/pieces/community/webflow/src/lib/actions/get-collection-item.ts+++ b/packages/pieces/community/webflow/src/lib/actions/get-collection-item.ts@@ -1,29 +1,33 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { getCollectionItemOutputSchema } from '../output-schemas';-export const webflowGetCollectionItem = createAction({+export const getCollectionItemAction = createAction({auth: webflowAuth,name: 'get_collection_item',+ outputSchema: getCollectionItemOutputSchema,classification: 'READ',description: 'Get collection item in a collection by ID',displayName: 'Get a Collection Item by ID',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Retrieves a single Webflow CMS collection item by its collection ID and item ID. Use when the agent already knows the item ID and needs its full field data; if the ID is unknown, find it first with Find a Collection Item by Field. Read-only and idempotent.', idempotent: true },props: {- site_id: webflowProps.site_id,- collection_id: webflowProps.collection_id,- collection_item_id: webflowProps.collection_item_id,+ site_id: webflowProps.siteId({ required: true }),+ collection_id: webflowProps.collectionId({ required: true }),+ collection_item_id: webflowProps.collectionItemId({ required: true }),},async run(context) {const collectionId = context.propsValue.collection_id;const collectionItemId = context.propsValue.collection_item_id;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.getCollectionItem(collectionId, collectionItemId);+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(collectionItemId)}`,+ });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/list-collections.ts b/packages/pieces/community/webflow/src/lib/actions/list-collections.tsindex 34678ba649c..ec4ddd39dd0 100644--- a/packages/pieces/community/webflow/src/lib/actions/list-collections.ts+++ b/packages/pieces/community/webflow/src/lib/actions/list-collections.ts@@ -1,21 +1,22 @@import { createAction } from '@activepieces/pieces-framework';-import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowApi } from '../common/api';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { listCollectionsOutputSchema } from '../output-schemas';-export const webflowListCollections = createAction({+export const listCollectionsAction = createAction({auth: webflowAuth,name: 'list_collections',+ outputSchema: listCollectionsOutputSchema,classification: 'SEARCH',description: 'List all collections in a site',displayName: 'List Collections',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Lists all CMS collections within a given Webflow site, identified by site ID, returning their IDs and metadata. Use to discover a collection ID before reading, creating, or updating collection items. Read-only and idempotent.', idempotent: true },props: {- site_id: webflowProps.site_id,+ site_id: webflowProps.siteId({ required: true }),},async run(context) {- const client = new WebflowApiClient(context.auth.access_token);- return await client.listCollections(context.propsValue.site_id);+ return await webflowApi.listCollections({ auth: context.auth, siteId: context.propsValue.site_id });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/list-sites.ts b/packages/pieces/community/webflow/src/lib/actions/list-sites.tsindex 2e605579328..2ad6cffee65 100644--- a/packages/pieces/community/webflow/src/lib/actions/list-sites.ts+++ b/packages/pieces/community/webflow/src/lib/actions/list-sites.ts@@ -1,18 +1,19 @@import { createAction } from '@activepieces/pieces-framework';-import { webflowAuth } from '../..';-import { WebflowApiClient } from '../common/client';+import { webflowAuth } from '../auth';+import { webflowApi } from '../common/api';+import { listSitesOutputSchema } from '../output-schemas';-export const webflowListSites = createAction({+export const listSitesAction = createAction({auth: webflowAuth,name: 'list_sites',+ outputSchema: listSitesOutputSchema,classification: 'SEARCH',description: 'List all sites',displayName: 'List Sites',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Lists all Webflow sites accessible to the authenticated account, returning their IDs and metadata. Use to discover a site ID needed by other actions (collections, orders, form-submission trigger). Read-only and idempotent; takes no input.', idempotent: true },props: {},async run(context) {- const client = new WebflowApiClient(context.auth.access_token);- return await client.listSites();+ return await webflowApi.listSites({ auth: context.auth });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/publish-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/publish-collection-item.tsindex 0bbcac65b8c..f67fddbbf24 100644--- a/packages/pieces/community/webflow/src/lib/actions/publish-collection-item.ts+++ b/packages/pieces/community/webflow/src/lib/actions/publish-collection-item.ts@@ -1,29 +1,34 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { publishCollectionItemOutputSchema } from '../output-schemas';-export const webflowPublishCollectionItem = createAction({+export const publishCollectionItemAction = createAction({auth: webflowAuth,name: 'publish_collection_item',+ outputSchema: publishCollectionItemOutputSchema,classification: 'WRITE',description: 'Publish collection item',displayName: 'Publish a Collection Item',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Publishes a Webflow CMS collection item live, identified by collection ID and item ID, so its current content goes to the live site. Use after creating or updating a draft item to make it public. Idempotent: re-publishing the same item again leaves it published.', idempotent: true },props: {- site_id: webflowProps.site_id,- collection_id: webflowProps.collection_id,- collection_item_id: webflowProps.collection_item_id,+ site_id: webflowProps.siteId({ required: true }),+ collection_id: webflowProps.collectionId({ required: true }),+ collection_item_id: webflowProps.collectionItemId({ required: true }),},async run(context) {const collectionId = context.propsValue.collection_id;const collectionItemId = context.propsValue.collection_item_id;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.publishCollectionItem(collectionId, collectionItemId);+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/publish`,+ body: { itemIds: [collectionItemId] },+ });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/refund-order.ts b/packages/pieces/community/webflow/src/lib/actions/refund-order.tsindex 6bd4412c00f..ab96a78c404 100644--- a/packages/pieces/community/webflow/src/lib/actions/refund-order.ts+++ b/packages/pieces/community/webflow/src/lib/actions/refund-order.ts@@ -1,11 +1,13 @@-import { createAction, Property } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction } from '@activepieces/pieces-framework';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { orderOutputSchema } from '../output-schemas';-export const webflowRefundOrder = createAction({+export const refundOrderAction = createAction({auth: webflowAuth,+ outputSchema: orderOutputSchema,name: 'refund_order',classification: 'DESTRUCTIVE',description: 'Refund order',@@ -13,38 +15,18 @@ export const webflowRefundOrder = createAction({audience: 'both',aiMetadata: { description: 'Issues a refund for an existing Webflow Ecommerce order, identified by site ID and order ID. Use to reverse a customer payment. This moves money and is not idempotent — repeating it risks duplicate refund attempts, so call it once per order.', idempotent: false },props: {- site_id: webflowProps.site_id,- order_id: webflowProps.order_id,- // reason: Property.StaticDropdown({- // displayName: 'Reason',- // description: 'The reason for the refund',- // required: false,- // options: {- // disabled: false,- // options: [- // {- // label: 'Duplicate',- // value: 'duplicate',- // },- // {- // label: 'Fraudulent',- // value: 'fraudulent',- // },- // {- // label: 'Requested',- // value: 'requested',- // },- // ],- // },- // }),+ site_id: webflowProps.siteId({ required: true }),+ order_id: webflowProps.orderId({ required: true }),},async run(context) {const orderId = context.propsValue.order_id;const siteId = context.propsValue.site_id;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.refundOrder(siteId, orderId);+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/refund`,+ });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/unfulfill-order.ts b/packages/pieces/community/webflow/src/lib/actions/unfulfill-order.tsindex 3ade03fc63c..fb248407c83 100644--- a/packages/pieces/community/webflow/src/lib/actions/unfulfill-order.ts+++ b/packages/pieces/community/webflow/src/lib/actions/unfulfill-order.ts@@ -1,11 +1,13 @@+import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { orderOutputSchema } from '../output-schemas';-export const webflowUnfulfillOrder = createAction({+export const unfulfillOrderAction = createAction({auth: webflowAuth,+ outputSchema: orderOutputSchema,name: 'unfulfill_order',classification: 'WRITE',description: 'Unfulfill order',@@ -13,16 +15,18 @@ export const webflowUnfulfillOrder = createAction({audience: 'both',aiMetadata: { description: 'Reverts an existing Webflow Ecommerce order back to an unfulfilled state, identified by site ID and order ID. Use to undo a fulfillment marking. Idempotent: re-running on an already-unfulfilled order leaves it unfulfilled.', idempotent: true },props: {- site_id: webflowProps.site_id,- order_id: webflowProps.order_id,+ site_id: webflowProps.siteId({ required: true }),+ order_id: webflowProps.orderId({ required: true }),},async run(context) {const orderId = context.propsValue.order_id;const siteId = context.propsValue.site_id;- const client = new WebflowApiClient(context.auth.access_token);-- return await client.unfulfillOrder(siteId, orderId);+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/unfulfill`,+ });},});diff --git a/packages/pieces/community/webflow/src/lib/actions/update-collection-item.ts b/packages/pieces/community/webflow/src/lib/actions/update-collection-item.tsindex 90f3838866b..4deadff08ff 100644--- a/packages/pieces/community/webflow/src/lib/actions/update-collection-item.ts+++ b/packages/pieces/community/webflow/src/lib/actions/update-collection-item.ts@@ -1,22 +1,26 @@-import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';--import { webflowAuth } from '../..';+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { webflowAuth } from '../auth';+import { webflowApi } from '../common/api';+import { webflowClient } from '../common/client';import { webflowProps } from '../common/props';-import { WebflowApiClient } from '../common/client';+import { webflowUtils } from '../common/utils';+import { getCollectionItemOutputSchema } from '../output-schemas';-export const webflowUpdateCollectionItem = createAction({+export const updateCollectionItemAction = createAction({auth: webflowAuth,name: 'update_collection_item',+ outputSchema: getCollectionItemOutputSchema,classification: 'WRITE',description: 'Update collection item',displayName: 'Update an item in a collection',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Updates an existing Webflow CMS collection item, identified by collection ID and item ID, overwriting the supplied field values (keyed by field slug) and the archived/draft flags. Use to edit existing CMS content. Idempotent: applying the same field values repeatedly yields the same item state.', idempotent: true },props: {- site_id: webflowProps.site_id,- collection_id: webflowProps.collection_id,- collection_item_id: webflowProps.collection_item_id,- collection_fields: webflowProps.collection_fields,+ site_id: webflowProps.siteId({ required: true }),+ collection_id: webflowProps.collectionId({ required: true }),+ collection_item_id: webflowProps.collectionItemId({ required: true }),+ collection_fields: webflowProps.collectionFields({ required: true, optionalFields: true }),is_archived: Property.Checkbox({displayName: 'Is Archived',description: 'Whether the item is archived or not',@@ -36,42 +40,20 @@ export const webflowUpdateCollectionItem = createAction({const isDraft = context.propsValue.is_draft;const collectionInputFields = context.propsValue.collection_fields;- const client = new WebflowApiClient(context.auth.access_token);- const { fields: CollectionFields } = await client.getCollection(collectionId);-- const formattedCollectionFields: DynamicPropsValue = {};- for (const field of CollectionFields) {- const fieldValue = collectionInputFields[field.slug];-- if (fieldValue !== undefined && fieldValue !== '') {- switch (field.type) {- case 'ImageRef':- case 'FileRef':- formattedCollectionFields[field.slug] = { url: fieldValue };- break;- case 'Set':- if (fieldValue.length > 0) {- formattedCollectionFields[field.slug] = fieldValue.map((url: string) => ({- url: url,- }));- }- break;- case 'ItemRefSet':- if (fieldValue.length > 0) {- formattedCollectionFields[field.slug] = fieldValue;- }- break;- case 'Number':- formattedCollectionFields[field.slug] = Number(fieldValue);- break;- default:- formattedCollectionFields[field.slug] = fieldValue;- }- }- }+ const { fields } = await webflowApi.getCollection({+ auth: context.auth,+ collectionId,+ });- return await client.updateCollectionItem(collectionId, collectionItemId, {- fields: { ...formattedCollectionFields, _archived: isArchived, _draft: isDraft },+ return await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.PATCH,+ path: `/v2/collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(collectionItemId)}`,+ body: {+ ...(isArchived !== undefined ? { isArchived } : {}),+ ...(isDraft !== undefined ? { isDraft } : {}),+ fieldData: webflowUtils.formatFieldData({ fields, values: collectionInputFields }),+ },});},});diff --git a/packages/pieces/community/webflow/src/lib/auth.ts b/packages/pieces/community/webflow/src/lib/auth.tsnew file mode 100644index 00000000000..3acbf499ca5--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/auth.ts@@ -0,0 +1,30 @@+import { PieceAuth } from '@activepieces/pieces-framework';++export const webflowAuth = PieceAuth.OAuth2({+ description:+ 'Connect your Webflow account. On the Webflow consent screen, pick every site you want Activepieces to reach; sites you leave out stay invisible to every action and trigger. Connections made before the move to Webflow API v2 need to be reconnected.',+ authUrl: 'https://webflow.com/oauth/authorize',+ tokenUrl: 'https://api.webflow.com/oauth/access_token',+ required: true,+ scope: [+ 'forms:read',+ 'forms:write',+ 'authorized_user:read',+ 'sites:read',+ 'sites:write',+ 'cms:read',+ 'cms:write',+ 'pages:read',+ 'pages:write',+ 'components:read',+ 'components:write',+ 'custom_code:read',+ 'custom_code:write',+ 'assets:read',+ 'assets:write',+ 'comments:read',+ 'comments:write',+ 'ecommerce:read',+ 'ecommerce:write',+ ],+});diff --git a/packages/pieces/community/webflow/src/lib/common/ai-props.ts b/packages/pieces/community/webflow/src/lib/common/ai-props.tsnew file mode 100644index 00000000000..b8233052a10--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/common/ai-props.ts@@ -0,0 +1,67 @@+import { Property } from '@activepieces/pieces-framework';+import type { PropParams } from './props';++function siteId<R extends boolean>({+ required,+ displayName = 'Site ID',+ description = 'Webflow site ID, e.g. "580e63e98c9a982ac9b8b741". Use List Sites to find it.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function collectionId<R extends boolean>({+ required,+ displayName = 'Collection ID',+ description = 'CMS collection ID. Use List Collections to find it.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function itemId<R extends boolean>({+ required,+ displayName = 'Item ID',+ description = 'CMS collection item ID. Use List Collection Items to find it.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function pageId<R extends boolean>({+ required,+ displayName = 'Page ID',+ description = 'Page ID. Use List Pages to find it.',+}: PropParams<R>) {+ return Property.ShortText({ displayName, description, required });+}++function limit<R extends boolean>({+ required,+ displayName = 'Limit',+ description = 'Maximum number of records to return (1-100). Defaults to 100.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function offset<R extends boolean>({+ required,+ displayName = 'Offset',+ description = 'Number of records to skip, for paging. Use the previous response\'s pagination.offset + limit. Defaults to 0.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function flag<R extends boolean>({ required, displayName = 'Enabled', description }: PropParams<R>) {+ return Property.StaticDropdown({+ displayName,+ description,+ required,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ });+}++export const webflowAiProps = { siteId, collectionId, itemId, pageId, limit, offset, flag };diff --git a/packages/pieces/community/webflow/src/lib/common/api.ts b/packages/pieces/community/webflow/src/lib/common/api.tsnew file mode 100644index 00000000000..680450aaf73--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/common/api.ts@@ -0,0 +1,42 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { webflowClient } from './client';+import type {+ WebflowAuthValue,+ WebflowCollection,+ WebflowCollectionDetails,+ WebflowSite,+} from './types';++async function listSites({ auth }: { auth: WebflowAuthValue }): Promise<WebflowSite[]> {+ const response = await webflowClient.request<{ sites: WebflowSite[] }>({+ auth,+ method: HttpMethod.GET,+ path: '/v2/sites',+ });+ return response.sites;+}++async function listCollections({ auth, siteId }: { auth: WebflowAuthValue; siteId: string }): Promise<WebflowCollection[]> {+ const response = await webflowClient.request<{ collections: WebflowCollection[] }>({+ auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(siteId)}/collections`,+ });+ return response.collections;+}++async function getCollection({+ auth,+ collectionId,+}: {+ auth: WebflowAuthValue;+ collectionId: string;+}): Promise<WebflowCollectionDetails> {+ return await webflowClient.request<WebflowCollectionDetails>({+ auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(collectionId)}`,+ });+}++export const webflowApi = { listSites, listCollections, getCollection };diff --git a/packages/pieces/community/webflow/src/lib/common/client.ts b/packages/pieces/community/webflow/src/lib/common/client.tsindex c8440e064f3..0cc76254211 100644--- a/packages/pieces/community/webflow/src/lib/common/client.ts+++ b/packages/pieces/community/webflow/src/lib/common/client.ts@@ -1,148 +1,59 @@-import {- AuthenticationType,- httpClient,- HttpMethod,- HttpRequest,- QueryParams,-} from '@activepieces/pieces-common';+import { AuthenticationType, httpClient, HttpHeaders, HttpMethod, QueryParams } from '@activepieces/pieces-common';+import type { WebflowAuthValue } from './types';-export class WebflowApiClient {- constructor(private accessToken: string) {}-- async makeRequest(- method: HttpMethod,- resourceUri: string,- query?: Record<string, string | number | string[] | undefined>,- body: any | undefined = undefined,- ): Promise<any> {- const apiUrl = 'https://api.webflow.com';- const params: QueryParams = {};-- if (query) {- for (const [key, value] of Object.entries(query)) {- if (value !== null && value !== undefined) {- params[key] = String(value);- }- }- }-- const request: HttpRequest = {- method: method,- url: apiUrl + resourceUri,- authentication: {- type: AuthenticationType.BEARER_TOKEN,- token: this.accessToken,- },- queryParams: params,- body: body,- };-- const response = await httpClient.sendRequest(request);- return response.body;- }-- async listSites() {- return await this.makeRequest(HttpMethod.GET, '/sites');- }-- async listCollections(siteId: string) {- return await this.makeRequest(HttpMethod.GET, `/sites/${siteId}/collections`);- }-- async getCollection(collectionId: string) {- return await this.makeRequest(HttpMethod.GET, `/collections/${collectionId}`);- }-- async createCollectionItem(collectionId: string, request: Record<string, any>) {- return await this.makeRequest(- HttpMethod.POST,- `/collections/${collectionId}/items`,- undefined,- request,- );- }-- async updateCollectionItem(collectionId: string, itemId: string, request: Record<string, any>) {- return await this.makeRequest(- HttpMethod.PUT,- `/collections/${collectionId}/items/${itemId}`,- undefined,- request,- );- }-- async getCollectionItem(collectionId: string, itemId: string) {- return await this.makeRequest(HttpMethod.GET, `/collections/${collectionId}/items/${itemId}`);- }-- async deleteCollectionItem(collectionId: string, itemId: string) {- return await this.makeRequest(- HttpMethod.DELETE,- `/collections/${collectionId}/items/${itemId}`,- );- }-- async publishCollectionItem(collectionId: string, itemId: string) {- return await this.makeRequest(- HttpMethod.POST,- `/collections/${collectionId}/items/publish`,- undefined,- { itemIds: [itemId] },- );- }-- async listCollectionItems(collectionId: string, page: number, limit: number) {- return await this.makeRequest(HttpMethod.GET, `/collections/${collectionId}/items`, {- offset: page,- limit,- });- }-- async getOrder(siteId: string, orderId: string) {- return await this.makeRequest(HttpMethod.GET, `/sites/${siteId}/orders/${orderId}`);- }-- async fulfillOrder(siteId: string, orderId: string, request: Record<string, any>) {- return await this.makeRequest(- HttpMethod.POST,- `/sites/${siteId}/orders/${orderId}/fulfill`,- undefined,- request,- );- }-- async unfulfillOrder(siteId: string, orderId: string) {- return await this.makeRequest(- HttpMethod.POST,- `/sites/${siteId}/orders/${orderId}/unfulfill`,- undefined,- );- }-- async refundOrder(siteId: string, orderId: string) {- return await this.makeRequest(HttpMethod.POST, `/sites/${siteId}/orders/${orderId}/refund`);- }-- async listOrders(siteId: string, page: number, limit: number) {- return await this.makeRequest(HttpMethod.GET, `/sites/${siteId}/orders`, {- offset: page,- limit,- });- }+function baseUrl(): string {+ return 'https://api.webflow.com';+}- async createWebhook(siteId: string, triggerType: string, webhookUrl: string) {- return await this.makeRequest(- HttpMethod.POST,- `'/sites/${siteId}/webhooks`,- {},- {- triggerType,- url: webhookUrl,- },- );- }+async function request<T>({+ auth,+ method,+ path,+ query,+ body,+ headers,+}: RequestParams & { auth: WebflowAuthValue }): Promise<T> {+ const response = await httpClient.sendRequest<T>({+ method,+ url: `${baseUrl()}${path}`,+ authentication: {+ type: AuthenticationType.BEARER_TOKEN,+ token: auth.access_token,+ },+ headers,+ queryParams: query,+ body,+ });+ return response.body;+}- async deleteWebhook(webhookId: string) {- return await this.makeRequest(HttpMethod.DELETE, `/webhooks/${webhookId}`);- }+async function uploadFile({ url, fields, data, fileName, contentType }: UploadFileParams): Promise<void> {+ const form = new FormData();+ for (const [key, value] of Object.entries(fields)) {+ form.append(key, String(value));+ }+ form.append('file', new Blob([new Uint8Array(data)], { type: contentType ?? 'application/octet-stream' }), fileName);+ await httpClient.sendRequest({+ method: HttpMethod.POST,+ url,+ body: form,+ });}++export const webflowClient = { baseUrl, request, uploadFile };++type RequestParams = {+ method: HttpMethod;+ path: string;+ query?: QueryParams;+ body?: unknown;+ headers?: HttpHeaders;+};++type UploadFileParams = {+ url: string;+ fields: Record<string, unknown>;+ data: Buffer;+ fileName: string;+ contentType: string | undefined;+};diff --git a/packages/pieces/community/webflow/src/lib/common/common.ts b/packages/pieces/community/webflow/src/lib/common/common.tsdeleted file mode 100644index e9e592f6870..00000000000--- a/packages/pieces/community/webflow/src/lib/common/common.ts+++ /dev/null@@ -1,52 +0,0 @@-import { Property, OAuth2PropertyValue, DynamicPropsValue } from '@activepieces/pieces-framework';-import {- HttpRequest,- HttpMethod,- AuthenticationType,- httpClient,-} from '@activepieces/pieces-common';--export const webflowCommon = {- baseUrl: 'https://api.webflow.com/',- subscribeWebhook: async (- siteId: string,- tag: string,- webhookUrl: string,- accessToken: string,- ) => {- const request: HttpRequest = {- method: HttpMethod.POST,- url: `https://api.webflow.com/sites/${siteId}/webhooks`,- headers: {- 'Content-Type': 'application/json',- },- body: {- triggerType: tag,- url: webhookUrl,- },- authentication: {- type: AuthenticationType.BEARER_TOKEN,- token: accessToken,- },- queryParams: {},- };-- const res = await httpClient.sendRequest(request);- return res;- },- unsubscribeWebhook: async (siteId: string, webhookId: string, accessToken: string) => {- const request: HttpRequest = {- method: HttpMethod.DELETE,- url: `https://api.webflow.com/sites/${siteId}/webhooks/${webhookId}`,-- headers: {- 'Content-Type': 'application/json',- },- authentication: {- type: AuthenticationType.BEARER_TOKEN,- token: accessToken,- },- };- return await httpClient.sendRequest(request);- },-};diff --git a/packages/pieces/community/webflow/src/lib/common/props.ts b/packages/pieces/community/webflow/src/lib/common/props.tsindex 734609cfacb..89292534231 100644--- a/packages/pieces/community/webflow/src/lib/common/props.ts+++ b/packages/pieces/community/webflow/src/lib/common/props.ts@@ -1,237 +1,238 @@+import { HttpMethod } from '@activepieces/pieces-common';import {DropdownOption,+ DropdownState,DynamicPropsValue,- PiecePropValueSchema,Property,} from '@activepieces/pieces-framework';+import { webflowAuth } from '../auth';+import { webflowApi } from './api';+import { webflowClient } from './client';+import type { WebflowCollectionItemsPage, WebflowOrdersPage } from './types';-import { WebflowApiClient } from './client';-import { webflowAuth } from '../..';--export const webflowProps = {- site_id: Property.Dropdown({-auth: webflowAuth,-- displayName: 'Site',- required: true,+function siteId<R extends boolean>({ required, displayName = 'Site', description }: PropParams<R>) {+ return Property.Dropdown({+ auth: webflowAuth,+ displayName,+ description,+ required,refreshers: [],options: async ({ auth }) => {if (!auth) {- return {- disabled: true,- options: [],- placeholder: 'Please connect account first.',- };- }- const authValue = auth;- const client = new WebflowApiClient(authValue.access_token);-- const sites = await client.listSites();-- const options: DropdownOption<string>[] = [];- for (const site of sites) {- options.push({ label: site.name, value: site._id });+ return disabledOptions({ placeholder: 'Please connect account first.' });}-+ const sites = await webflowApi.listSites({ auth });return {disabled: false,- options,+ options: sites.map((site) => ({ label: site.displayName, value: site.id })),};},- }),- collection_id: Property.Dropdown({-auth: webflowAuth,+ });+}- displayName: 'Collection',- required: true,+function collectionId<R extends boolean>({ required, displayName = 'Collection', description }: PropParams<R>) {+ return Property.Dropdown({+ auth: webflowAuth,+ displayName,+ description,+ required,refreshers: ['site_id'],options: async ({ auth, site_id }) => {if (!auth || !site_id) {- return {- disabled: true,- options: [],- placeholder: 'Please connect account first.',- };- }- const authValue = auth as PiecePropValueSchema<typeof webflowAuth>;- const client = new WebflowApiClient(authValue.access_token);-- const collections = await client.listCollections(site_id as string);-- const options: DropdownOption<string>[] = [];- for (const collection of collections) {- options.push({ label: collection.name, value: collection._id });+ return disabledOptions({ placeholder: 'Please connect account first.' });}-+ const collections = await webflowApi.listCollections({ auth, siteId: String(site_id) });return {disabled: false,- options,+ options: collections.map((collection) => ({ label: collection.displayName, value: collection.id })),};},- }),- collection_fields: Property.DynamicProperties({+ });+}++function collectionFields<R extends boolean>({+ required,+ displayName = 'Collection Fields',+ description,+ optionalFields = false,+}: PropParams<R> & { optionalFields?: boolean }) {+ return Property.DynamicProperties({auth: webflowAuth,- displayName: 'Collection Fields',- required: true,+ displayName,+ description,+ required,refreshers: ['collection_id'],props: async ({ auth, collection_id }) => {if (!auth) return {};if (!collection_id) return {};const collectionFields: DynamicPropsValue = {};- const authValue = auth as PiecePropValueSchema<typeof webflowAuth>;- const client = new WebflowApiClient(authValue.access_token);-- const { fields } = await client.getCollection(collection_id as unknown as string);+ const { fields } = await webflowApi.getCollection({ auth, collectionId: String(collection_id) });for (const field of fields) {- if (field.editable && field.slug !== '_archived' && field.slug !== '_draft') {- switch (field.type) {- case 'Option':- collectionFields[field.slug] = Property.StaticDropdown({- displayName: field.name,- required: field.required,- options: {- disabled: false,- options: field.validations.options.map((option: { name: string }) => {- return {- label: option.name,- value: option.name,- };- }),- },- });- break;- case 'RichText':- case 'Email':- case 'PlainText':- case 'Phone':- case 'Link':- case 'Video':- case 'Color':- case 'ItemRef':- case 'FileRef':- collectionFields[field.slug] = Property.ShortText({- displayName: field.name,- required: field.required,- });- break;- case 'ImageRef':- collectionFields[field.slug] = Property.ShortText({- displayName: field.name,- required: field.required,- description:- 'Images must be hosted on a publicly accessible URL to be uploaded via the API.The maximum file size for images is 4MB.',- });- break;- case 'Set':- collectionFields[field.slug] = Property.Array({- displayName: field.name,- required: field.required,- description:- ' Images must be hosted on a publicly accessible URL to be uploaded via the API.The maximum file size for images is 4MB.',- });- break;- case 'ItemRefSet':- collectionFields[field.slug] = Property.Array({- displayName: field.name,- required: field.required,- });- break;- case 'Number':- collectionFields[field.slug] = Property.Number({- displayName: field.name,- required: field.required,- });- break;- case 'Date':- collectionFields[field.slug] = Property.DateTime({- displayName: field.name,- required: field.required,- });- break;- case 'Bool':- collectionFields[field.slug] = Property.Checkbox({- displayName: field.name,- required: false,- });- break;- }+ if (!field.isEditable) {+ continue;+ }+ switch (field.type) {+ case 'Option':+ collectionFields[field.slug] = Property.StaticDropdown({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ options: {+ disabled: false,+ options: (field.validations?.options ?? []).map((option) => ({+ label: option.name,+ value: option.name,+ })),+ },+ });+ break;+ case 'RichText':+ case 'Email':+ case 'PlainText':+ case 'Phone':+ case 'Link':+ case 'VideoLink':+ case 'Color':+ case 'Reference':+ case 'File':+ collectionFields[field.slug] = Property.ShortText({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ });+ break;+ case 'Image':+ collectionFields[field.slug] = Property.ShortText({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ description:+ 'Images must be hosted on a publicly accessible URL to be uploaded via the API.The maximum file size for images is 4MB.',+ });+ break;+ case 'MultiImage':+ collectionFields[field.slug] = Property.Array({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ description:+ ' Images must be hosted on a publicly accessible URL to be uploaded via the API.The maximum file size for images is 4MB.',+ });+ break;+ case 'MultiReference':+ collectionFields[field.slug] = Property.Array({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ });+ break;+ case 'Number':+ collectionFields[field.slug] = Property.Number({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ });+ break;+ case 'DateTime':+ collectionFields[field.slug] = Property.DateTime({+ displayName: field.displayName,+ required: !optionalFields && field.isRequired,+ });+ break;+ case 'Switch':+ collectionFields[field.slug] = Property.Checkbox({+ displayName: field.displayName,+ required: false,+ });+ break;}}return collectionFields;},- }),- collection_item_id: Property.Dropdown({-auth: webflowAuth,-- displayName: 'Collection Item',- required: true,+ });+}++function collectionItemId<R extends boolean>({+ required,+ displayName = 'Collection Item',+ description,+}: PropParams<R>) {+ return Property.Dropdown({+ auth: webflowAuth,+ displayName,+ description,+ required,refreshers: ['collection_id'],options: async ({ auth, collection_id }) => {if (!auth || !collection_id) {- return {- disabled: true,- options: [],- placeholder: 'Please connect account first.',- };+ return disabledOptions({ placeholder: 'Please connect account first.' });}- const authValue = auth as PiecePropValueSchema<typeof webflowAuth>;- const client = new WebflowApiClient(authValue.access_token);-const options: DropdownOption<string>[] = [];- let page = 0;- let response;+ let offset = 0;+ let response: WebflowCollectionItemsPage;do {- response = await client.listCollectionItems(collection_id as string, page, 100);- page += 100;+ response = await webflowClient.request<WebflowCollectionItemsPage>({+ auth,+ method: HttpMethod.GET,+ path: `/v2/collections/${encodeURIComponent(String(collection_id))}/items`,+ query: { offset: String(offset), limit: String(PAGE_SIZE) },+ });+ offset += PAGE_SIZE;for (const item of response.items) {- options.push({ label: item.name, value: item._id });+ options.push({ label: item.fieldData.name ?? item.id, value: item.id });}- } while (response.items.length > 0);+ } while (response.items.length > 0 && offset < Math.min(response.pagination.total, MAX_OPTIONS));return {disabled: false,options,};},- }),- order_id: Property.Dropdown({-auth: webflowAuth,+ });+}- displayName: 'Order',- required: true,+function orderId<R extends boolean>({ required, displayName = 'Order', description }: PropParams<R>) {+ return Property.Dropdown({+ auth: webflowAuth,+ displayName,+ description,+ required,refreshers: ['site_id'],options: async ({ auth, site_id }) => {if (!auth || !site_id) {- return {- disabled: true,- options: [],- placeholder: 'Please connect account first.',- };+ return disabledOptions({ placeholder: 'Please connect account first.' });}- const authValue = auth as PiecePropValueSchema<typeof webflowAuth>;- const client = new WebflowApiClient(authValue.access_token);-const options: DropdownOption<string>[] = [];- let page = 0;- let response;+ let offset = 0;+ let response: WebflowOrdersPage;do {- response = await client.listOrders(site_id as string, page, 100);- page += 100;-- for (const order of response) {+ response = await webflowClient.request<WebflowOrdersPage>({+ auth,+ method: HttpMethod.GET,+ path: `/v2/sites/${encodeURIComponent(String(site_id))}/orders`,+ query: { offset: String(offset), limit: String(PAGE_SIZE) },+ });+ offset += PAGE_SIZE;++ for (const order of response.orders) {options.push({ label: order.orderId, value: order.orderId });}- } while (response.length > 0);+ } while (response.orders.length > 0 && offset < Math.min(response.pagination.total, MAX_OPTIONS));return {disabled: false,options,};},- }),-};+ });+}++function disabledOptions({ placeholder }: { placeholder: string }): DropdownState<never> {+ return { disabled: true, options: [], placeholder };+}++export const webflowProps = { siteId, collectionId, collectionFields, collectionItemId, orderId };++const PAGE_SIZE = 100;+const MAX_OPTIONS = 2000;++export type PropParams<R extends boolean> = { required: R; displayName?: string; description?: string };diff --git a/packages/pieces/community/webflow/src/lib/common/types.ts b/packages/pieces/community/webflow/src/lib/common/types.tsnew file mode 100644index 00000000000..e48caa3a854--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/common/types.ts@@ -0,0 +1,35 @@+export type WebflowAuthValue = { access_token: string };++export type WebflowSite = { id: string; displayName: string };++export type WebflowCollection = { id: string; displayName: string };++export type WebflowCollectionField = {+ id: string;+ slug: string;+ displayName: string;+ type: string;+ isEditable: boolean;+ isRequired: boolean;+ validations?: { options?: { id: string; name: string }[] } | null;+};++export type WebflowCollectionDetails = WebflowCollection & { fields: WebflowCollectionField[] };++export type WebflowCollectionItem = {+ id: string;+ fieldData: Record<string, unknown> & { name?: string };+};++export type WebflowPagination = { limit: number; offset: number; total: number };++export type WebflowCollectionItemsPage = {+ items: WebflowCollectionItem[];+ pagination: WebflowPagination;+};++export type WebflowOrder = { orderId: string };++export type WebflowOrdersPage = { orders: WebflowOrder[]; pagination: WebflowPagination };++export type WebflowWebhook = { id: string };diff --git a/packages/pieces/community/webflow/src/lib/common/utils.ts b/packages/pieces/community/webflow/src/lib/common/utils.tsnew file mode 100644index 00000000000..0b747656a4a--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/common/utils.ts@@ -0,0 +1,37 @@+import type { WebflowCollectionField } from './types';++function formatFieldData({+ fields,+ values,+}: {+ fields: WebflowCollectionField[];+ values: Record<string, unknown>;+}): Record<string, unknown> {+ return fields.reduce<Record<string, unknown>>((fieldData, field) => {+ const value = values[field.slug];+ if (value === undefined || value === '') {+ return fieldData;+ }+ switch (field.type) {+ case 'Image':+ case 'File':+ return { ...fieldData, [field.slug]: { url: value } };+ case 'MultiImage':+ return Array.isArray(value) && value.length > 0+ ? { ...fieldData, [field.slug]: value.map((url) => ({ url })) }+ : fieldData;+ case 'MultiReference':+ return Array.isArray(value) && value.length > 0 ? { ...fieldData, [field.slug]: value } : fieldData;+ case 'Number':+ return { ...fieldData, [field.slug]: Number(value) };+ case 'Option': {+ const option = field.validations?.options?.find((candidate) => candidate.name === value || candidate.id === value);+ return { ...fieldData, [field.slug]: option ? option.id : value };+ }+ default:+ return { ...fieldData, [field.slug]: value };+ }+ }, {});+}++export const webflowUtils = { formatFieldData };diff --git a/packages/pieces/community/webflow/src/lib/output-schemas.ts b/packages/pieces/community/webflow/src/lib/output-schemas.tsnew file mode 100644index 00000000000..9c230564fd3--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/output-schemas.ts@@ -0,0 +1,991 @@+import { OutputSchema } from '@activepieces/pieces-framework';++const paginationField: OutputSchema['fields'][number] = {+ key: 'pagination',+ label: 'Pagination',+ children: [+ { key: 'limit', label: 'Page Size', format: 'number' },+ { key: 'offset', label: 'Offset', format: 'number' },+ { key: 'total', label: 'Total Count', format: 'number' },+ ],+};++const moneyFields: OutputSchema['fields'] = [+ { key: 'value', label: 'Amount', format: 'number' },+ { key: 'unit', label: 'Currency' },+ { key: 'string', label: 'Formatted Amount' },+];++const collectionItemFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Item ID' },+ { key: 'cmsLocaleId', label: 'Locale ID' },+ { key: 'lastPublished', label: 'Last Published', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'isArchived', label: 'Archived', format: 'boolean' },+ { key: 'isDraft', label: 'Draft', format: 'boolean' },+ { key: 'fieldData', label: 'Field Data', dynamicKey: true },+];++const collectionFieldBaseFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Field ID' },+ { key: 'isEditable', label: 'Editable', format: 'boolean' },+ { key: 'isRequired', label: 'Required', format: 'boolean' },+ { key: 'type', label: 'Field Type' },+ { key: 'slug', label: 'Slug' },+ { key: 'displayName', label: 'Name' },+ { key: 'helpText', label: 'Help Text' },+];++const textValidationFields: OutputSchema['fields'] = [+ { key: 'maxLength', label: 'Maximum Length', format: 'number' },+ { key: 'pattern', label: 'Pattern' },+ {+ key: 'messages',+ label: 'Validation Messages',+ children: [+ { key: 'pattern', label: 'Pattern Message' },+ { key: 'maxLength', label: 'Maximum Length Message' },+ ],+ },+];++const collectionFieldFields: OutputSchema['fields'] = [+ ...collectionFieldBaseFields,+ {+ key: 'validations',+ label: 'Validations',+ children: [+ ...textValidationFields,+ { key: 'format', label: 'Format' },+ { key: 'allowNegative', label: 'Allow Negative', format: 'boolean' },+ { key: 'precision', label: 'Precision', format: 'number' },+ {+ key: 'options',+ label: 'Options',+ labelKey: 'name',+ listItems: [+ { key: 'name', label: 'Name' },+ { key: 'id', label: 'Option ID' },+ ],+ },+ ],+ },+];++const collectionFieldUpdateFields: OutputSchema['fields'] = [+ ...collectionFieldBaseFields,+ { key: 'validations', label: 'Validations', children: textValidationFields },+];++const collectionSummaryFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Collection ID' },+ { key: 'displayName', label: 'Name' },+ { key: 'singularName', label: 'Singular Name' },+ { key: 'slug', label: 'Slug' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+];++const collectionFields: OutputSchema['fields'] = [+ ...collectionSummaryFields,+ {+ key: 'fields',+ label: 'Fields',+ labelKey: 'displayName',+ listItems: collectionFieldFields,+ },+ { key: 'fieldGroups', label: 'Field Groups' },+];++const collectionUpdateFields: OutputSchema['fields'] = [+ ...collectionSummaryFields,+ {+ key: 'fields',+ label: 'Fields',+ labelKey: 'displayName',+ listItems: collectionFieldUpdateFields,+ },+ { key: 'fieldGroups', label: 'Field Groups' },+];++const assetFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Asset ID' },+ { key: 'originalFileName', label: 'Original File Name' },+ { key: 'displayName', label: 'Name' },+ { key: 'contentType', label: 'Content Type' },+ { key: 'size', label: 'File Size', format: 'filesize' },+ { key: 'siteId', label: 'Site ID' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ { key: 'hostedUrl', label: 'Hosted URL', format: 'image' },+ { key: 'variants', label: 'Variants' },+ { key: 'altText', label: 'Alt Text' },+];++const assetFolderFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Folder ID' },+ { key: 'displayName', label: 'Name' },+ { key: 'parentFolder', label: 'Parent Folder ID' },+ { key: 'assets', label: 'Asset IDs' },+ { key: 'siteId', label: 'Site ID' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+];++const customFontFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Font ID' },+ { key: 'fontFamily', label: 'Font Family' },+ { key: 'weight', label: 'Weight', format: 'number' },+ { key: 'italic', label: 'Italic', format: 'boolean' },+ { key: 'fontDisplay', label: 'Font Display' },+ { key: 'format', label: 'File Format' },+ { key: 'fileName', label: 'File Name' },+ { key: 'hostedUrl', label: 'Hosted URL', format: 'url' },+ { key: 'axes', label: 'Variable Axes' },+ { key: 'fileHash', label: 'File Hash' },+ { key: 'uploadedOn', label: 'Uploaded On', format: 'datetime' },+];++const commentAuthorField: OutputSchema['fields'][number] = {+ key: 'author',+ label: 'Author',+ children: [+ { key: 'userId', label: 'User ID' },+ { key: 'name', label: 'Name' },+ { key: 'email', label: 'Email', format: 'email' },+ { key: 'verified', label: 'Verified', format: 'boolean' },+ ],+};++const commentBodyFields: OutputSchema['fields'] = [+ { key: 'siteId', label: 'Site ID' },+ { key: 'pageId', label: 'Page ID' },+ { key: 'localeId', label: 'Locale ID' },+ { key: 'elementId', label: 'Element ID' },+ { key: 'objectId', label: 'Object ID' },+ { key: 'objectType', label: 'Object Type' },+ { key: 'itemId', label: 'Item ID' },+ { key: 'breakpoint', label: 'Breakpoint' },+ { key: 'url', label: 'Comment URL', format: 'url' },+ { key: 'content', label: 'Content' },+ { key: 'isResolved', label: 'Resolved', format: 'boolean' },+ commentAuthorField,+ { key: 'mentionedUsers', label: 'Mentioned Users' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+];++const commentThreadFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Thread ID' },+ ...commentBodyFields,+];++const commentReplyFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Reply ID' },+ { key: 'commentId', label: 'Thread ID' },+ ...commentBodyFields,+];++const pageFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Page ID' },+ { key: 'siteId', label: 'Site ID' },+ { key: 'parentId', label: 'Parent Page ID' },+ { key: 'collectionId', label: 'Collection ID' },+ { key: 'title', label: 'Title' },+ { key: 'slug', label: 'Slug' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ { key: 'archived', label: 'Archived', format: 'boolean' },+ { key: 'draft', label: 'Draft', format: 'boolean' },+ { key: 'shouldPublish', label: 'Should Publish', format: 'boolean' },+ { key: 'canBranch', label: 'Can Branch', format: 'boolean' },+ { key: 'isBranch', label: 'Is Branch', format: 'boolean' },+ { key: 'branchId', label: 'Branch ID' },+ {+ key: 'seo',+ label: 'SEO',+ children: [+ { key: 'title', label: 'SEO Title' },+ { key: 'description', label: 'SEO Description' },+ ],+ },+ {+ key: 'openGraph',+ label: 'Open Graph',+ children: [+ { key: 'title', label: 'Title' },+ { key: 'titleCopied', label: 'Title Copied From SEO', format: 'boolean' },+ { key: 'description', label: 'Description' },+ {+ key: 'descriptionCopied',+ label: 'Description Copied From SEO',+ format: 'boolean',+ },+ { key: 'imageUrl', label: 'Image URL', format: 'image' },+ { key: 'imageAssetId', label: 'Image Asset ID' },+ ],+ },+ { key: 'publishedPath', label: 'Published Path' },+ { key: 'localeId', label: 'Locale ID' },+];++const siteFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Site ID' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'displayName', label: 'Name' },+ { key: 'shortName', label: 'Short Name' },+ { key: 'previewUrl', label: 'Preview Image', format: 'image' },+ { key: 'timeZone', label: 'Time Zone' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ { key: 'lastPublished', label: 'Last Published', format: 'datetime' },+ { key: 'fullSiteCompiledAt', label: 'Last Full Compile', format: 'datetime' },+ { key: 'parentFolderId', label: 'Parent Folder ID' },+ { key: 'customDomains', label: 'Custom Domains' },+ {+ key: 'locales',+ label: 'Locales',+ children: [+ {+ key: 'primary',+ label: 'Primary Locale',+ children: [+ { key: 'id', label: 'Locale ID' },+ { key: 'cmsLocaleId', label: 'CMS Locale ID' },+ { key: 'enabled', label: 'Enabled', format: 'boolean' },+ { key: 'displayName', label: 'Name' },+ { key: 'displayImageId', label: 'Display Image ID' },+ { key: 'redirect', label: 'Redirect', format: 'boolean' },+ { key: 'subdirectory', label: 'Subdirectory' },+ { key: 'tag', label: 'Language Tag' },+ ],+ },+ { key: 'secondary', label: 'Secondary Locales' },+ ],+ },+ {+ key: 'dataCollectionEnabled',+ label: 'Data Collection Enabled',+ format: 'boolean',+ },+ { key: 'dataCollectionType', label: 'Data Collection Type' },+];++const formFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Form ID' },+ { key: 'displayName', label: 'Name' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ {+ key: 'fields',+ label: 'Form Fields',+ dynamicKey: true,+ labelKey: 'displayName',+ children: [+ { key: 'displayName', label: 'Name' },+ { key: 'type', label: 'Field Type' },+ { key: 'placeholder', label: 'Placeholder' },+ { key: 'userVisible', label: 'Visible To User', format: 'boolean' },+ { key: 'fieldElementId', label: 'Field Element ID' },+ ],+ },+ {+ key: 'responseSettings',+ label: 'Response Settings',+ children: [+ { key: 'redirectUrl', label: 'Redirect URL', format: 'url' },+ { key: 'redirectMethod', label: 'Redirect Method' },+ { key: 'redirectAction', label: 'Redirect Action' },+ {+ key: 'sendEmailConfirmation',+ label: 'Send Email Confirmation',+ format: 'boolean',+ },+ ],+ },+ { key: 'siteId', label: 'Site ID' },+ { key: 'siteDomainId', label: 'Site Domain ID' },+ { key: 'pageId', label: 'Page ID' },+ { key: 'formElementId', label: 'Form Element ID' },+ { key: 'pageName', label: 'Page Name' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'componentId', label: 'Component ID' },+ { key: 'componentElementId', label: 'Component Element ID' },+];++const submissionSchemaField: OutputSchema['fields'][number] = {+ key: 'schema',+ label: 'Field Schema',+ labelKey: 'fieldName',+ listItems: [+ { key: 'fieldName', label: 'Field Name' },+ { key: 'fieldType', label: 'Field Type' },+ { key: 'fieldElementId', label: 'Field Element ID' },+ ],+};++const formSubmissionFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Submission ID' },+ { key: 'formId', label: 'Form ID' },+ { key: 'displayName', label: 'Form Name' },+ { key: 'siteId', label: 'Site ID' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'formResponse', label: 'Form Response', dynamicKey: true },+ { key: 'dateSubmitted', label: 'Submitted At', format: 'datetime' },+ { key: 'pageId', label: 'Page ID' },+ { key: 'publishedPath', label: 'Published Path' },+ { key: 'localeId', label: 'Locale ID' },+];++const formSubmissionElementFields: OutputSchema['fields'] = [+ { key: 'formElementId', label: 'Form Element ID' },+ { key: 'componentElementId', label: 'Component Element ID' },+];++const googleTagFields: OutputSchema['fields'] = [+ { key: 'tagId', label: 'Tag ID' },+ { key: 'displayName', label: 'Name' },+ { key: 'order', label: 'Order', format: 'number' },+];++const customCodeScriptFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Script ID' },+ { key: 'displayName', label: 'Name' },+ { key: 'version', label: 'Version' },+ { key: 'location', label: 'Location' },+ { key: 'attributes', label: 'Attributes' },+];++const deletedFields: OutputSchema['fields'] = [+ { key: 'success', label: 'Success', format: 'boolean' },+];++export const createCollectionItemOutputSchema: OutputSchema = {+ fields: collectionItemFields,+};++export const findCollectionItemOutputSchema: OutputSchema = {+ fields: [+ { key: 'success', label: 'Found', format: 'boolean' },+ {+ key: 'result',+ label: 'Matching Items',+ labelKey: 'id',+ listItems: collectionItemFields,+ },+ ],+};++export const getCollectionItemOutputSchema: OutputSchema = {+ fields: collectionItemFields,+};++export const listCollectionsOutputSchema: OutputSchema = {+ itemLabel: '{displayName}',+ fields: [+ {+ key: 'collections',+ label: 'Collections',+ value: '',+ listItems: collectionSummaryFields,+ },+ ],+};++export const listSitesOutputSchema: OutputSchema = {+ itemLabel: '{displayName}',+ fields: [{ key: 'sites', label: 'Sites', value: '', listItems: siteFields }],+};++export const newSubmissionOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Submission ID' },+ { key: 'name', label: 'Form Name' },+ { key: 'siteId', label: 'Site ID' },+ { key: 'data', label: 'Submitted Data', dynamicKey: true },+ { key: 'submittedAt', label: 'Submitted At', format: 'datetime' },+ { key: 'formId', label: 'Form ID' },+ { key: 'formElementId', label: 'Form Element ID' },+ { key: 'pageId', label: 'Page ID' },+ { key: 'publishedPath', label: 'Published Path' },+ { key: 'pageUrl', label: 'Page URL', format: 'url' },+ submissionSchemaField,+ { key: 'localeId', label: 'Locale ID' },+ ],+};++export const publishCollectionItemOutputSchema: OutputSchema = {+ fields: [+ { key: 'publishedItemIds', label: 'Published Item IDs' },+ { key: 'errors', label: 'Errors' },+ ],+};++export const webflowCreateAssetFolderOutputSchema: OutputSchema = {+ fields: assetFolderFields,+};++export const webflowCreateCollectionOutputSchema: OutputSchema = {+ fields: collectionFields,+};++export const webflowCreateCollectionFieldOutputSchema: OutputSchema = {+ fields: [+ ...collectionFieldBaseFields,+ { key: 'validations', label: 'Validations' },+ ],+};++export const webflowCreateCollectionItemOutputSchema: OutputSchema = {+ fields: collectionItemFields,+};++export const webflowCreateCommentReplyOutputSchema: OutputSchema = {+ fields: commentReplyFields,+};++export const webflowCreateCustomFontOutputSchema: OutputSchema = {+ fields: [+ { key: 'customFont', label: 'Custom Font', children: customFontFields },+ ],+};++export const webflowCreateCustomFontsBatchOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'created',+ label: 'Created Fonts',+ labelKey: 'fontFamily',+ listItems: customFontFields,+ },+ { key: 'failed', label: 'Failed' },+ ],+};++export const webflowCreateLiveCollectionItemOutputSchema: OutputSchema = {+ fields: collectionItemFields,+};++export const webflowDeleteAssetOutputSchema: OutputSchema = {+ fields: [...deletedFields, { key: 'assetId', label: 'Asset ID' }],+};++export const webflowDeleteCustomFontsBatchOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'deleted',+ label: 'Deleted Fonts',+ labelKey: 'id',+ listItems: [{ key: 'id', label: 'Font ID' }],+ },+ { key: 'failed', label: 'Failed' },+ ],+};++export const webflowDeleteFormSubmissionOutputSchema: OutputSchema = {+ fields: [+ ...deletedFields,+ { key: 'formSubmissionId', label: 'Submission ID' },+ ],+};++export const webflowGetAssetOutputSchema: OutputSchema = {+ fields: assetFields,+};++export const webflowGetAuthorizedUserOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'User ID' },+ { key: 'email', label: 'Email', format: 'email' },+ { key: 'firstName', label: 'First Name' },+ { key: 'lastName', label: 'Last Name' },+ ],+};++export const webflowGetCommentThreadOutputSchema: OutputSchema = {+ fields: commentThreadFields,+};++export const webflowGetComponentContentOutputSchema: OutputSchema = {+ fields: [+ { key: 'componentId', label: 'Component ID' },+ { key: 'nodes', label: 'Nodes' },+ paginationField,+ ],+};++export const webflowGetComponentPropertiesOutputSchema: OutputSchema = {+ fields: [+ { key: 'componentId', label: 'Component ID' },+ {+ key: 'properties',+ label: 'Properties',+ labelKey: 'label',+ listItems: [+ { key: 'propertyId', label: 'Property ID' },+ { key: 'type', label: 'Property Type' },+ { key: 'label', label: 'Label' },+ {+ key: 'text',+ label: 'Text',+ children: [+ { key: 'html', label: 'HTML', format: 'html' },+ { key: 'text', label: 'Plain Text' },+ ],+ },+ ],+ },+ paginationField,+ ],+};++export const webflowGetFormOutputSchema: OutputSchema = { fields: formFields };++export const webflowGetFormSubmissionOutputSchema: OutputSchema = {+ fields: [+ ...formSubmissionFields,+ submissionSchemaField,+ ...formSubmissionElementFields,+ ],+};++export const webflowGetPageOutputSchema: OutputSchema = { fields: pageFields };++export const webflowGetPageContentOutputSchema: OutputSchema = {+ fields: [+ { key: 'pageId', label: 'Page ID' },+ { key: 'branchId', label: 'Branch ID' },+ { key: 'nodes', label: 'Nodes' },+ paginationField,+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ ],+};++export const webflowGetPageCustomCodeOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'scripts',+ label: 'Scripts',+ labelKey: 'displayName',+ listItems: customCodeScriptFields,+ },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ ],+};++export const webflowGetSiteOutputSchema: OutputSchema = {+ fields: [...siteFields, { key: 'googleTagIds', label: 'Google Tag IDs' }],+};++export const webflowGetTokenInfoOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'authorization',+ label: 'Authorization',+ children: [+ { key: 'id', label: 'Authorization ID' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUsed', label: 'Last Used', format: 'datetime' },+ { key: 'grantType', label: 'Grant Type' },+ { key: 'rateLimit', label: 'Rate Limit Per Minute', format: 'number' },+ { key: 'scope', label: 'Scopes' },+ {+ key: 'authorizedTo',+ label: 'Authorized To',+ children: [+ { key: 'siteIds', label: 'Site IDs' },+ { key: 'workspaceIds', label: 'Workspace IDs' },+ { key: 'userIds', label: 'User IDs' },+ ],+ },+ ],+ },+ {+ key: 'application',+ label: 'Application',+ children: [+ { key: 'id', label: 'Application ID' },+ { key: 'description', label: 'Description' },+ { key: 'homepage', label: 'Homepage', format: 'url' },+ { key: 'displayName', label: 'Name' },+ ],+ },+ ],+};++export const webflowListAssetFoldersOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'assetFolders',+ label: 'Asset Folders',+ labelKey: 'displayName',+ listItems: assetFolderFields,+ },+ paginationField,+ ],+};++export const webflowListAssetsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'assets',+ label: 'Assets',+ labelKey: 'displayName',+ listItems: [...assetFields, { key: 'folderId', label: 'Folder ID' }],+ },+ paginationField,+ ],+};++export const webflowListCollectionItemsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'items',+ label: 'Items',+ labelKey: 'id',+ listItems: collectionItemFields,+ },+ paginationField,+ ],+};++export const webflowListCollectionsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'collections',+ label: 'Collections',+ labelKey: 'displayName',+ listItems: collectionSummaryFields,+ },+ ],+};++export const webflowListCommentRepliesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'comments',+ label: 'Replies',+ labelKey: 'id',+ listItems: commentReplyFields,+ },+ paginationField,+ ],+};++export const webflowListCommentThreadsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'comments',+ label: 'Comment Threads',+ labelKey: 'id',+ listItems: commentThreadFields,+ },+ paginationField,+ ],+};++export const webflowListComponentsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'components',+ label: 'Components',+ labelKey: 'name',+ listItems: [+ { key: 'id', label: 'Component ID' },+ { key: 'name', label: 'Name' },+ { key: 'description', label: 'Description' },+ { key: 'group', label: 'Group' },+ ],+ },+ paginationField,+ ],+};++export const webflowListCustomCodeBlocksOutputSchema: OutputSchema = {+ fields: [{ key: 'blocks', label: 'Code Blocks' }, paginationField],+};++export const webflowListCustomDomainsOutputSchema: OutputSchema = {+ fields: [{ key: 'customDomains', label: 'Custom Domains' }],+};++export const webflowListCustomFontsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'customFonts',+ label: 'Custom Fonts',+ labelKey: 'fontFamily',+ listItems: customFontFields,+ },+ paginationField,+ ],+};++export const webflowListFormSubmissionsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'formSubmissions',+ label: 'Form Submissions',+ labelKey: 'displayName',+ listItems: [+ ...formSubmissionFields,+ submissionSchemaField,+ ...formSubmissionElementFields,+ ],+ },+ paginationField,+ ],+};++export const webflowListFormsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'forms',+ label: 'Forms',+ labelKey: 'displayName',+ listItems: formFields,+ },+ paginationField,+ ],+};++export const webflowListGoogleTagsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'googleTagIds',+ label: 'Google Tags',+ labelKey: 'displayName',+ listItems: googleTagFields,+ },+ ],+};++export const webflowListLiveCollectionItemsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'items',+ label: 'Items',+ labelKey: 'id',+ listItems: collectionItemFields,+ },+ paginationField,+ ],+};++export const webflowListPagesOutputSchema: OutputSchema = {+ fields: [+ { key: 'pages', label: 'Pages', labelKey: 'title', listItems: pageFields },+ paginationField,+ ],+};++export const webflowListRegisteredScriptsOutputSchema: OutputSchema = {+ fields: [+ { key: 'registeredScripts', label: 'Registered Scripts' },+ paginationField,+ ],+};++export const webflowListSitesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'sites',+ label: 'Sites',+ labelKey: 'displayName',+ listItems: siteFields,+ },+ ],+};++export const webflowPublishSiteOutputSchema: OutputSchema = {+ fields: [+ { key: 'customDomains', label: 'Custom Domains' },+ {+ key: 'publishToWebflowSubdomain',+ label: 'Published To Webflow Subdomain',+ format: 'boolean',+ },+ { key: 'publishTaskId', label: 'Publish Task ID' },+ { key: 'publishScope', label: 'Publish Scope' },+ ],+};++export const webflowRegisterHostedScriptOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Script ID' },+ { key: 'canCopy', label: 'Can Copy', format: 'boolean' },+ { key: 'displayName', label: 'Name' },+ { key: 'hostedLocation', label: 'Hosted Location', format: 'url' },+ { key: 'integrityHash', label: 'Integrity Hash' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'version', label: 'Version' },+ ],+};++export const webflowUpdateCollectionOutputSchema: OutputSchema = {+ fields: collectionUpdateFields,+};++export const webflowUpdateCollectionItemsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'items',+ label: 'Items',+ labelKey: 'id',+ listItems: collectionItemFields,+ },+ ],+};++export const webflowUpdateFormSubmissionOutputSchema: OutputSchema = {+ fields: [...formSubmissionFields, ...formSubmissionElementFields],+};++export const webflowUpdateLiveCollectionItemsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'items',+ label: 'Items',+ labelKey: 'id',+ listItems: collectionItemFields,+ },+ ],+};++export const webflowUploadAssetOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Asset ID' },+ { key: 'contentType', label: 'Content Type' },+ { key: 'parentFolder', label: 'Parent Folder ID' },+ { key: 'assetUrl', label: 'Asset URL', format: 'image' },+ { key: 'hostedUrl', label: 'Hosted URL', format: 'image' },+ { key: 'originalFileName', label: 'Original File Name' },+ { key: 'createdOn', label: 'Created On', format: 'datetime' },+ { key: 'lastUpdated', label: 'Last Updated', format: 'datetime' },+ ],+};++export const webflowUpsertGoogleTagsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'googleTagIds',+ label: 'Google Tags',+ labelKey: 'displayName',+ listItems: googleTagFields,+ },+ ],+};++export const deleteCollectionItemOutputSchema: OutputSchema = {+ fields: [...deletedFields, { key: 'collectionItemId', label: 'Item ID' }],+};++export const webflowDeleteCollectionOutputSchema: OutputSchema = {+ fields: [...deletedFields, { key: 'collectionId', label: 'Collection ID' }],+};++export const webflowDeleteCollectionFieldOutputSchema: OutputSchema = {+ fields: [+ ...deletedFields,+ { key: 'collectionId', label: 'Collection ID' },+ { key: 'fieldId', label: 'Field ID' },+ ],+};++export const webflowDeleteCollectionItemOutputSchema: OutputSchema = {+ fields: [+ ...deletedFields,+ { key: 'collectionId', label: 'Collection ID' },+ { key: 'itemId', label: 'Item ID' },+ ],+};++export const webflowDeleteCustomFontOutputSchema: OutputSchema = {+ fields: [+ ...deletedFields,+ { key: 'siteId', label: 'Site ID' },+ { key: 'fontId', label: 'Font ID' },+ ],+};++export const webflowDeleteGoogleTagOutputSchema: OutputSchema = {+ fields: [+ ...deletedFields,+ { key: 'siteId', label: 'Site ID' },+ { key: 'tagId', label: 'Tag ID' },+ ],+};++export const webflowDeleteGoogleTagsOutputSchema: OutputSchema = {+ fields: [...deletedFields, { key: 'siteId', label: 'Site ID' }],+};++export const webflowDeletePageCustomCodeOutputSchema: OutputSchema = {+ fields: [...deletedFields, { key: 'pageId', label: 'Page ID' }],+};++export const orderOutputSchema: OutputSchema = {+ fields: [+ { key: 'orderId', label: 'Order ID' },+ { key: 'status', label: 'Status' },+ { key: 'comment', label: 'Comment' },+ { key: 'orderComment', label: 'Customer Comment' },+ { key: 'acceptedOn', label: 'Accepted On', format: 'datetime' },+ { key: 'fulfilledOn', label: 'Fulfilled On', format: 'datetime' },+ { key: 'refundedOn', label: 'Refunded On', format: 'datetime' },+ { key: 'disputedOn', label: 'Disputed On', format: 'datetime' },+ { key: 'disputeLastStatus', label: 'Dispute Status' },+ { key: 'customerPaid', label: 'Customer Paid', children: moneyFields },+ { key: 'netAmount', label: 'Net Amount', children: moneyFields },+ {+ key: 'customerInfo',+ label: 'Customer',+ children: [+ { key: 'fullName', label: 'Full Name' },+ { key: 'email', label: 'Email', format: 'email' },+ ],+ },+ {+ key: 'shippingAddress',+ label: 'Shipping Address',+ children: [+ { key: 'addressee', label: 'Addressee' },+ { key: 'line1', label: 'Line 1' },+ { key: 'line2', label: 'Line 2' },+ { key: 'city', label: 'City' },+ { key: 'state', label: 'State' },+ { key: 'country', label: 'Country' },+ { key: 'postalCode', label: 'Postal Code' },+ ],+ },+ { key: 'shippingProvider', label: 'Shipping Provider' },+ { key: 'shippingTracking', label: 'Tracking Number' },+ { key: 'shippingTrackingURL', label: 'Tracking URL', format: 'url' },+ {+ key: 'purchasedItems',+ label: 'Purchased Items',+ labelKey: 'productName',+ listItems: [+ { key: 'productId', label: 'Product ID' },+ { key: 'productName', label: 'Product Name' },+ { key: 'variantId', label: 'Variant ID' },+ { key: 'variantName', label: 'Variant Name' },+ { key: 'variantSKU', label: 'Variant SKU' },+ { key: 'count', label: 'Quantity', format: 'number' },+ ],+ },+ {+ key: 'purchasedItemsCount',+ label: 'Purchased Items Count',+ format: 'number',+ },+ {+ key: 'isShippingRequired',+ label: 'Shipping Required',+ format: 'boolean',+ },+ { key: 'paymentProcessor', label: 'Payment Processor' },+ ],+};diff --git a/packages/pieces/community/webflow/src/lib/triggers/form-submitted.ts b/packages/pieces/community/webflow/src/lib/triggers/form-submitted.tsnew file mode 100644index 00000000000..a0f73651e8f--- /dev/null+++ b/packages/pieces/community/webflow/src/lib/triggers/form-submitted.ts@@ -0,0 +1,91 @@+import { HttpError, HttpMethod } from '@activepieces/pieces-common';+import { createTrigger, Property, TriggerStrategy } from '@activepieces/pieces-framework';+import { webflowAuth } from '../auth';+import { webflowClient } from '../common/client';+import { webflowProps } from '../common/props';+import type { WebflowWebhook } from '../common/types';+import { newSubmissionOutputSchema } from '../output-schemas';++const triggerNameInStore = 'webflow_created_form_submissions_trigger';++export const formSubmittedTrigger = createTrigger({+ auth: webflowAuth,+ name: 'new_submission',+ outputSchema: newSubmissionOutputSchema,+ classification: 'READ',+ displayName: 'New Submission',+ description: 'Triggers when Webflow Site receives a new submission',+ aiMetadata: {+ description: 'Fires when a form on the selected Webflow site receives a new submission, delivering the submitted form data. Optionally scoped to a single form by name; if no form name is given, it fires for submissions from any form on the site.',+ },+ props: {+ site_id: webflowProps.siteId({ required: true }),+ formName: Property.ShortText({+ displayName: 'Form Name',+ required: false,+ description: 'Copy from the form settings, or from one of the responses',+ }),+ },+ type: TriggerStrategy.WEBHOOK,+ sampleData: {+ name: 'Sample Form',+ siteId: '62749158efef318abc8d5a0f',+ data: {+ name: 'Arthur Dent',+ email: '[email protected]',+ },+ submittedAt: '2022-09-14T12:35:16.117Z',+ id: '6321ca84df3949bfc6752327',+ formId: '6321ca84df3949bfc6752328',+ formElementId: '4e038d2c-6a1e-4953-7be9-a59a2b453177',+ },+ async onEnable(context) {+ const webhook = await webflowClient.request<WebflowWebhook>({+ auth: context.auth,+ method: HttpMethod.POST,+ path: `/v2/sites/${encodeURIComponent(context.propsValue.site_id)}/webhooks`,+ body: {+ triggerType: 'form_submission',+ url: context.webhookUrl,+ },+ });+ await context.store?.put<WebhookInformation>(triggerNameInStore, {+ webhookId: webhook.id,+ });+ },+ async onDisable(context) {+ const response = await context.store?.get<WebhookInformation>(triggerNameInStore);+ if (response === null || response === undefined) {+ return;+ }+ try {+ await webflowClient.request<unknown>({+ auth: context.auth,+ method: HttpMethod.DELETE,+ path: `/v2/webhooks/${encodeURIComponent(response.webhookId)}`,+ });+ } catch (error: unknown) {+ if (!(error instanceof HttpError && error.response.status === 404)) {+ throw error;+ }+ }+ },+ async run(context) {+ const body = context.payload.body;+ const submission =+ typeof body === 'object' && body !== null && 'payload' in body ? body.payload : body;+ const { formName } = context.propsValue;+ if (formName) {+ const name =+ typeof submission === 'object' && submission !== null && 'name' in submission+ ? submission.name+ : undefined;+ return name == formName ? [submission] : [];+ }+ return [submission];+ },+});++type WebhookInformation = {+ webhookId: string;+};diff --git a/packages/pieces/community/webflow/src/lib/triggers/new-form-submitted.ts b/packages/pieces/community/webflow/src/lib/triggers/new-form-submitted.tsdeleted file mode 100644index 4aedbe8f119..00000000000--- a/packages/pieces/community/webflow/src/lib/triggers/new-form-submitted.ts+++ /dev/null@@ -1,83 +0,0 @@-import { webflowCommon } from '../common/common';-import { createTrigger, TriggerStrategy, Property } from '@activepieces/pieces-framework';-import { getAccessTokenOrThrow } from '@activepieces/pieces-common';-import { webflowAuth } from '../..';-import { webflowProps } from '../common/props';--const triggerNameInStore = 'webflow_created_form_submissions_trigger';--export const webflowNewSubmission = createTrigger({- auth: webflowAuth,-- name: 'new_submission',- classification: 'READ',- displayName: 'New Submission',- description: 'Triggers when Webflow Site receives a new submission',- aiMetadata: {- description: 'Fires when a form on the selected Webflow site receives a new submission, delivering the submitted form data. Optionally scoped to a single form by name; if no form name is given, it fires for submissions from any form on the site.',- },- props: {- site_id: webflowProps.site_id,- formName: Property.ShortText({- displayName: 'Form Name',- required: false,- description: 'Copy from the form settings, or from one of the responses',- }),- },- type: TriggerStrategy.WEBHOOK,- // TODO remove and force testing as the data can be custom.- sampleData: {- name: 'Sample Form',- site: '62749158efef318abc8d5a0f',- data: {- field_one: 'mock valued',- },- d: '2022-09-14T12:35:16.117Z',- _id: '6321ca84df3949bfc6752327',- },- async onEnable(context) {- const formSubmissionTag = 'form_submission';-- const res = await webflowCommon.subscribeWebhook(- context.propsValue['site_id']!,- formSubmissionTag,- context.webhookUrl,- getAccessTokenOrThrow(context.auth),- );- await context.store?.put<WebhookInformation>(triggerNameInStore, {- webhookId: res.body._id,- });- },- async onDisable(context) {- const response = await context.store?.get<WebhookInformation>(triggerNameInStore);- if (response !== null && response !== undefined) {- await webflowCommon.unsubscribeWebhook(- context.propsValue['site_id']!,- response.webhookId,- getAccessTokenOrThrow(context.auth),- );- }- },- async run(context) {- const body = context.payload.body as PayloadBody;- const { formName } = context.propsValue;- //if formName provided, trigger only required formName if it's matched; else trigger all forms in selected webflow site.- if (formName) {- if (body.name == formName) {- return [body];- } else {- return [];- }- } else {- return [body];- }- },-});--interface WebhookInformation {- webhookId: string;-}--type PayloadBody = {- name: string;-};