|
| 1 | +import type { IntegrationPlugin } from "../registry"; |
| 2 | +import { registerIntegration } from "../registry"; |
| 3 | +import { WebflowIcon } from "./icon"; |
| 4 | + |
| 5 | +const webflowPlugin: IntegrationPlugin = { |
| 6 | + type: "webflow", |
| 7 | + label: "Webflow", |
| 8 | + description: "Publish and manage Webflow sites", |
| 9 | + |
| 10 | + icon: WebflowIcon, |
| 11 | + |
| 12 | + formFields: [ |
| 13 | + { |
| 14 | + id: "apiKey", |
| 15 | + label: "API Token", |
| 16 | + type: "password", |
| 17 | + placeholder: "your-api-token", |
| 18 | + configKey: "apiKey", |
| 19 | + envVar: "WEBFLOW_API_KEY", |
| 20 | + helpText: "Generate an API token from ", |
| 21 | + helpLink: { |
| 22 | + text: "Webflow Dashboard", |
| 23 | + url: "https://webflow.com/dashboard", |
| 24 | + }, |
| 25 | + }, |
| 26 | + ], |
| 27 | + |
| 28 | + testConfig: { |
| 29 | + getTestFunction: async () => { |
| 30 | + const { testWebflow } = await import("./test"); |
| 31 | + return testWebflow; |
| 32 | + }, |
| 33 | + }, |
| 34 | + |
| 35 | + actions: [ |
| 36 | + { |
| 37 | + slug: "list-sites", |
| 38 | + label: "List Sites", |
| 39 | + description: "Get all sites accessible with the API token", |
| 40 | + category: "Webflow", |
| 41 | + stepFunction: "listSitesStep", |
| 42 | + stepImportPath: "list-sites", |
| 43 | + outputFields: [ |
| 44 | + { field: "sites", description: "Array of site objects" }, |
| 45 | + { field: "count", description: "Number of sites returned" }, |
| 46 | + ], |
| 47 | + configFields: [], |
| 48 | + }, |
| 49 | + { |
| 50 | + slug: "get-site", |
| 51 | + label: "Get Site", |
| 52 | + description: "Get details of a specific Webflow site", |
| 53 | + category: "Webflow", |
| 54 | + stepFunction: "getSiteStep", |
| 55 | + stepImportPath: "get-site", |
| 56 | + outputFields: [ |
| 57 | + { field: "id", description: "Site ID" }, |
| 58 | + { field: "displayName", description: "Display name of the site" }, |
| 59 | + { field: "shortName", description: "Short name (subdomain)" }, |
| 60 | + { field: "previewUrl", description: "Preview URL" }, |
| 61 | + { field: "lastPublished", description: "Last published timestamp" }, |
| 62 | + { field: "customDomains", description: "Array of custom domains" }, |
| 63 | + ], |
| 64 | + configFields: [ |
| 65 | + { |
| 66 | + key: "siteId", |
| 67 | + label: "Site ID", |
| 68 | + type: "template-input", |
| 69 | + placeholder: "site-id or {{NodeName.id}}", |
| 70 | + example: "580e63e98c9a982ac9b8b741", |
| 71 | + required: true, |
| 72 | + }, |
| 73 | + ], |
| 74 | + }, |
| 75 | + { |
| 76 | + slug: "publish-site", |
| 77 | + label: "Publish Site", |
| 78 | + description: "Publish a site to one or more domains", |
| 79 | + category: "Webflow", |
| 80 | + stepFunction: "publishSiteStep", |
| 81 | + stepImportPath: "publish-site", |
| 82 | + outputFields: [ |
| 83 | + { field: "publishedDomains", description: "Array of published domain URLs" }, |
| 84 | + { field: "publishedToSubdomain", description: "Whether published to Webflow subdomain" }, |
| 85 | + ], |
| 86 | + configFields: [ |
| 87 | + { |
| 88 | + key: "siteId", |
| 89 | + label: "Site ID", |
| 90 | + type: "template-input", |
| 91 | + placeholder: "site-id or {{NodeName.id}}", |
| 92 | + example: "580e63e98c9a982ac9b8b741", |
| 93 | + required: true, |
| 94 | + }, |
| 95 | + { |
| 96 | + key: "publishToWebflowSubdomain", |
| 97 | + label: "Publish to Webflow Subdomain", |
| 98 | + type: "select", |
| 99 | + options: [ |
| 100 | + { value: "true", label: "Yes" }, |
| 101 | + { value: "false", label: "No" }, |
| 102 | + ], |
| 103 | + defaultValue: "true", |
| 104 | + }, |
| 105 | + { |
| 106 | + key: "customDomainIds", |
| 107 | + label: "Custom Domain IDs (comma-separated)", |
| 108 | + type: "template-input", |
| 109 | + placeholder: "domain-id-1, domain-id-2", |
| 110 | + example: "589a331aa51e760df7ccb89d", |
| 111 | + }, |
| 112 | + ], |
| 113 | + }, |
| 114 | + ], |
| 115 | +}; |
| 116 | + |
| 117 | +registerIntegration(webflowPlugin); |
| 118 | + |
| 119 | +export default webflowPlugin; |
0 commit comments