diff --git a/components/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs b/components/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs index 8d3bdee81861b..6fb1b53fd5d33 100644 --- a/components/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs +++ b/components/apify/actions/set-key-value-store-record/set-key-value-store-record.mjs @@ -4,7 +4,7 @@ export default { key: "apify-set-key-value-store-record", name: "Set Key-Value Store Record", description: "Create or update a record in an Apify Key-Value Store. Supports strings, numbers, booleans, null, arrays, and objects. Automatically infers content type (JSON vs. plain text).", - version: "0.2.3", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -30,10 +30,10 @@ export default { optional: false, }, value: { - type: "any", + type: "string", label: "Value", description: - "String, number, boolean, null, array, or object. Strings that are valid JSON will be stored as JSON; otherwise as plain text.", + "The record value. JSON text (e.g. `{\"a\":1}`, `[1,2]`, `true`, `42`, `null`) is stored as JSON; anything else is stored as plain text.", optional: false, }, }, diff --git a/components/apify/package.json b/components/apify/package.json index cb76c3c2c8ac6..fb6117b85bfd3 100644 --- a/components/apify/package.json +++ b/components/apify/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/apify", - "version": "0.5.0", + "version": "1.0.0", "description": "Pipedream Apify Components", "main": "apify.app.mjs", "keywords": [ diff --git a/components/arcgis_online/actions/update-row-by-object-id/update-row-by-object-id.mjs b/components/arcgis_online/actions/update-row-by-object-id/update-row-by-object-id.mjs index 040ba5516b92b..daf39cb8dd840 100644 --- a/components/arcgis_online/actions/update-row-by-object-id/update-row-by-object-id.mjs +++ b/components/arcgis_online/actions/update-row-by-object-id/update-row-by-object-id.mjs @@ -6,7 +6,7 @@ export default { name: "Update Row by Object ID", description: "Update a single attribute on a feature identified by OBJECTID using the applyEdits operation. Dropdowns filter to editable layers and fields. [See the documentation](https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service-layer-.htm)", - version: "0.2.0", + version: "1.0.0", type: "action", annotations: { destructiveHint: false, @@ -59,11 +59,24 @@ export default { "Editable field to update (system fields like OBJECTID and GlobalID are excluded)", }, newValue: { - type: "any", + type: "string", label: "New Value", description: - "New value for the attribute. Pass string, number, boolean, or other JSON-serializable " + - "primitive. Use null to clear nullable fields. ArcGIS coerces values to field type.", + "New value for the attribute. JSON text is sent as the parsed value, so `42`, `true` and " + + "`null` become a number, a boolean and null respectively (use `null` to clear nullable " + + "fields); anything else is sent as text. ArcGIS coerces values to the field type.", + }, + }, + methods: { + parseValue(value) { + if (typeof value !== "string") { + return value; + } + try { + return JSON.parse(value); + } catch (error) { + return value; + } }, }, async run({ $ }) { @@ -129,7 +142,7 @@ export default { layerId: ctx.layerId, attributes: { [ctx.objectIdField]: objectIdNum, - [fieldName]: newValue, + [fieldName]: this.parseValue(newValue), }, }); diff --git a/components/arcgis_online/package.json b/components/arcgis_online/package.json index 69368c09fddc7..0601f579ea5c9 100644 --- a/components/arcgis_online/package.json +++ b/components/arcgis_online/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/arcgis_online", - "version": "0.2.0", + "version": "1.0.0", "description": "Pipedream ArcGIS Online Components", "main": "arcgis_online.app.mjs", "keywords": [ diff --git a/components/bigcommerce/actions/common/product.mjs b/components/bigcommerce/actions/common/product.mjs index c9214220efbf5..f6a71512bae36 100644 --- a/components/bigcommerce/actions/common/product.mjs +++ b/components/bigcommerce/actions/common/product.mjs @@ -4,6 +4,46 @@ import app from "../../bigcommerce.app.mjs"; import constants from "../../common/constants.mjs"; import utils from "../../common/utils.mjs"; +// BigCommerce declares these fields as `type: number` / `format: float`, so they +// must accept decimals. There is no float prop type, so they are declared as +// `string` and coerced back to numbers before the request is sent. +const DECIMAL_FIELDS = [ + "weight", + "width", + "depth", + "height", + "price", + "cost_price", + "retail_price", + "sale_price", + "fixed_cost_shipping_price", +]; + +const toNumber = (fieldName, value) => { + // `Number()` maps a whitespace-only string to 0 and "Infinity" to Infinity, so neither + // can be caught by `Number.isNaN` alone. + const trimmed = typeof value === "string" + ? value.trim() + : value; + const number = trimmed === "" + ? NaN + : Number(trimmed); + if (!Number.isFinite(number)) { + throw new ConfigurationError(`${fieldName}: \`${value}\` is not a valid number`); + } + return number; +}; + +const coerceDecimalFields = (data) => Object.fromEntries(Object.entries(data).map(([ + key, + value, +]) => [ + key, + DECIMAL_FIELDS.includes(key) && value !== undefined && value !== null && value !== "" + ? toNumber(key, value) + : value, +])); + export default { props: { app, @@ -37,57 +77,57 @@ export default { optional: true, }, weight: { - type: "any", + type: "string", label: "Weight", description: - "Weight of the product, which can be used when calculating shipping costs. This is based on the unit set on the store >= 0 and <= 9999999999", + "Weight of the product, which can be used when calculating shipping costs. This is based on the unit set on the store >= 0 and <= 9999999999. Accepts decimal values, e.g. `19.99`.", }, width: { - type: "any", + type: "string", label: "Width", description: - "Width of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999", + "Width of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999. Accepts decimal values, e.g. `19.99`.", optional: true, }, depth: { - type: "any", + type: "string", label: "Depth", description: - "Depth of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999", + "Depth of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999. Accepts decimal values, e.g. `19.99`.", optional: true, }, height: { - type: "any", + type: "string", label: "Height", description: - "Height of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999", + "Height of the product, which can be used when calculating shipping costs. >= 0 and <= 9999999999. Accepts decimal values, e.g. `19.99`.", optional: true, }, price: { - type: "any", + type: "string", label: "Price", description: - "The price of the product. The price should include or exclude tax, based on the store settings. >= 0", + "The price of the product. The price should include or exclude tax, based on the store settings. >= 0. Accepts decimal values, e.g. `19.99`.", }, cost_price: { - type: "any", + type: "string", label: "Cost Price", description: - "The cost price of the product. Stored for reference only; it is not used or displayed anywhere on the store. >=0", + "The cost price of the product. Stored for reference only; it is not used or displayed anywhere on the store. >=0. Accepts decimal values, e.g. `19.99`.", optional: true, }, retail_price: { - type: "any", + type: "string", label: "Retail Price", description: - "The retail cost of the product. If entered, the retail cost price will be shown on the product page. >=0", + "The retail cost of the product. If entered, the retail cost price will be shown on the product page. >=0. Accepts decimal values, e.g. `19.99`.", optional: true, }, sale_price: { - type: "any", + type: "string", label: "Sale Price", description: - "If entered, the sale price will be used instead of value in the price field when calculating the product's cost. >=0", + "If entered, the sale price will be used instead of value in the price field when calculating the product's cost. >=0. Accepts decimal values, e.g. `19.99`.", optional: true, }, map_price: { @@ -179,10 +219,10 @@ export default { ], }, fixed_cost_shipping_price: { - type: "any", + type: "string", label: "Fixed cost shipping price", description: - "A fixed shipping cost for the product. If defined, this value will be used during checkout instead of normal shipping-cost calculation. >= 0", + "A fixed shipping cost for the product. If defined, this value will be used during checkout instead of normal shipping-cost calculation. >= 0. Accepts decimal values, e.g. `19.99`.", optional: true, }, is_free_shipping: { @@ -469,7 +509,7 @@ export default { optional: true, }, reviews_rating_sum: { - type: "any", + type: "integer", label: "Reviews rating sum", description: "The total rating for the product.", optional: true, @@ -525,7 +565,7 @@ export default { const args = getRequestFnArgs({ $, data: { - ...data, + ...coerceDecimalFields(data), images: imageUrls .map((imageUrl, idx) => ({ image_url: imageUrl, diff --git a/components/bigcommerce/actions/create-product/create-product.mjs b/components/bigcommerce/actions/create-product/create-product.mjs index f84ccb68b3960..60d2d8b1ceacb 100644 --- a/components/bigcommerce/actions/create-product/create-product.mjs +++ b/components/bigcommerce/actions/create-product/create-product.mjs @@ -6,7 +6,7 @@ export default { name: "Create Product", description: "Create a product. [See the docs here](https://developer.bigcommerce.com/api-reference/366928572e59e-create-a-product)", - version: "0.0.4", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/bigcommerce/actions/update-product/update-product.mjs b/components/bigcommerce/actions/update-product/update-product.mjs index 75e6645ed7497..4376cb8c8ff26 100644 --- a/components/bigcommerce/actions/update-product/update-product.mjs +++ b/components/bigcommerce/actions/update-product/update-product.mjs @@ -8,7 +8,7 @@ export default { name: "Update Product", description: "Update a product by Id. [See the docs here](https://developer.bigcommerce.com/api-reference/6f05c1244d972-update-a-product)", - version: "0.0.4", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/bigcommerce/package.json b/components/bigcommerce/package.json index 755edf5717f8b..6670dfb275359 100644 --- a/components/bigcommerce/package.json +++ b/components/bigcommerce/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/bigcommerce", - "version": "0.1.0", + "version": "1.0.0", "description": "Pipedream BigCommerce Components", "main": "bigcommerce.app.mjs", "keywords": [ diff --git a/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs b/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs index 031ef55d4fbae..5d65c0f340643 100644 --- a/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs +++ b/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs @@ -5,7 +5,7 @@ export default { key: "clickup-update-task-custom-field", name: "Update Task Custom Field", description: "Update custom field value of a task. [See the documentation](https://clickup.com/api) in **Custom Fields / Set Custom Field Value** section.", - version: "0.0.12", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -16,8 +16,8 @@ export default { ...common.props, value: { label: "Value", - type: "any", - description: "The value of custom field", + type: "string", + description: "The value of the custom field. JSON text is sent as the parsed value, so use e.g. `42` for a number field, `true` for a checkbox, or `[\"uuid-1\",\"uuid-2\"]` for a labels field; anything else is sent as text.", }, folderId: { propDefinition: [ @@ -61,6 +61,18 @@ export default { ], }, }, + methods: { + parseValue(value) { + if (typeof value !== "string") { + return value; + } + try { + return JSON.parse(value); + } catch (error) { + return value; + } + }, + }, async run({ $ }) { const { taskId, @@ -78,7 +90,7 @@ export default { taskId, customFieldId, data: { - value, + value: this.parseValue(value), }, params, }); diff --git a/components/clickup/package.json b/components/clickup/package.json index 806c728e1c33b..8851f208aed20 100644 --- a/components/clickup/package.json +++ b/components/clickup/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/clickup", - "version": "0.5.0", + "version": "1.0.0", "description": "Pipedream Clickup Components", "main": "clickup.app.mjs", "keywords": [ diff --git a/components/easybroker/actions/create-property/create-property.mjs b/components/easybroker/actions/create-property/create-property.mjs index 3feef6deb42fc..ff90ac630bed7 100644 --- a/components/easybroker/actions/create-property/create-property.mjs +++ b/components/easybroker/actions/create-property/create-property.mjs @@ -5,7 +5,7 @@ export default { key: "easybroker-create-property", name: "Create Property", description: "Creates a new property listing in EasyBroker with full details including title, price, location, bedrooms, bathrooms, parking, size, description, amenities, photos, and status. [See the documentation](https://dev.easybroker.com/reference/post_properties)", - version: "0.0.1", + version: "1.0.0", type: "action", annotations: { destructiveHint: false, @@ -43,9 +43,9 @@ export default { ], }, operations: { - type: "any", + type: "string[]", label: "Operations", - description: "An array of operation objects. For a sale or rental: `[{\"type\":\"sale\",\"currency\":\"USD\",\"amount\":250000,\"active\":true}]`. For a temporary rental: `[{\"type\":\"temporary_rental\",\"currency\":\"USD\",\"active\":true,\"rates\":[{\"type\":\"daily\",\"amount\":150}]}]`. Accepted `type` values: `sale`, `rental`, `temporary_rental`. Optional fields per operation: `unit` (enum: `total`, `square_meter`, `hectare`), `commission` ({`type`: `amount`|`percentage`|`months`, `value`: number, `currency`: string}), `foreclosure` (boolean, Mexico only)", + description: "One JSON string per operation. Each entry is a single operation object, **not** an array — do not wrap the entries in `[ ]`. Required keys: `type` (one of `sale`, `rental`, `temporary_rental`), `currency` (ISO code, e.g. `USD`) and `active` (boolean). For `sale` and `rental`, also pass `amount` (number). For `temporary_rental`, pass `rates` instead — an array of rate objects, each `{\"type\":\"daily\",\"amount\":150}`. Optional keys: `unit` (one of `total`, `square_meter`, `hectare`), `commission` (`{\"type\":\"amount\"|\"percentage\"|\"months\",\"value\":10,\"currency\":\"USD\"}`) and `foreclosure` (boolean, Mexico only). Example entry: `{\"type\":\"sale\",\"currency\":\"USD\",\"amount\":250000,\"active\":true}`. Example temporary rental entry: `{\"type\":\"temporary_rental\",\"currency\":\"USD\",\"active\":true,\"rates\":[{\"type\":\"daily\",\"amount\":150}]}`", }, locationName: { type: "string", @@ -192,9 +192,9 @@ export default { optional: true, }, images: { - type: "any", + type: "string[]", label: "Images", - description: "An array of image objects. Each object requires a `url` (valid HTTP/HTTPS URL with `.jpg`, `.png`, `.gif`, `.bmp`, or `.heic` extension) and accepts an optional `title`. Maximum 50 images, 6MB per image, minimum 500px. Example: `[{\"url\":\"https://example.com/image.jpg\",\"title\":\"Front view\"}]`", + description: "One JSON string per image. Each entry is a single image object, **not** an array — do not wrap the entries in `[ ]`. Required key: `url` (an HTTP/HTTPS URL ending in `.jpg`, `.png`, `.gif`, `.bmp` or `.heic`). Optional key: `title`. Up to 50 images; each must be under 6MB and at least 500px. Example entry: `{\"url\":\"https://example.com/image.jpg\",\"title\":\"Front view\"}`", optional: true, }, videos: { @@ -264,6 +264,20 @@ export default { optional: true, }, }, + methods: { + parseJsonArray(items, fieldName) { + return items?.map((item) => { + if (typeof item !== "string") { + return item; + } + try { + return JSON.parse(item); + } catch (error) { + throw new ConfigurationError(`${fieldName}: \`${item}\` is not valid JSON`); + } + }); + }, + }, async run({ $ }) { if (this.locationLatitude !== undefined && isNaN(Number(this.locationLatitude))) { throw new ConfigurationError("**Location Latitude** must be a valid number. Example: `25.6866142`"); @@ -306,7 +320,7 @@ export default { title: this.title, description: this.description, status: this.status, - operations: this.operations, + operations: this.parseJsonArray(this.operations, "Operations"), location, ...(this.privateDescription && { private_description: this.privateDescription, @@ -357,7 +371,7 @@ export default { collaboration_notes: this.collaborationNotes, }), ...(this.images && { - images: this.images, + images: this.parseJsonArray(this.images, "Images"), }), ...(this.videos && { videos: this.videos, diff --git a/components/easybroker/package.json b/components/easybroker/package.json index a0b713f6b7d6f..561acf41c9279 100644 --- a/components/easybroker/package.json +++ b/components/easybroker/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/easybroker", - "version": "0.3.0", + "version": "1.0.0", "description": "Pipedream EasyBroker Components", "main": "easybroker.app.mjs", "keywords": [ diff --git a/components/linkedin/actions/create-comment/create-comment.mjs b/components/linkedin/actions/create-comment/create-comment.mjs index 77be4e702568f..fe35046df971b 100644 --- a/components/linkedin/actions/create-comment/create-comment.mjs +++ b/components/linkedin/actions/create-comment/create-comment.mjs @@ -1,10 +1,11 @@ +import { ConfigurationError } from "@pipedream/platform"; import linkedin from "../../linkedin.app.mjs"; export default { key: "linkedin-create-comment", name: "Create Comment", - description: "Create a comment on a share or user generated content post. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#create-comment)", - version: "0.1.13", + description: "Create a comment on a share or user generated content post. [See the documentation](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#create-comment)", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -29,9 +30,9 @@ export default { description: "Text of the comment. May contain attributes such as links to people and organizations.", }, content: { - type: "any", + type: "string[]", label: "Content", - description: "Array of a media content entities.", + description: "Array of media content entities, one JSON string per entry, e.g. `{\"entity\":{\"image\":\"urn:li:image:ABC123\"}}`.", optional: true, }, parentComment: { @@ -41,6 +42,20 @@ export default { optional: true, }, }, + methods: { + parseContent(items) { + return items?.map((item) => { + if (typeof item !== "string") { + return item; + } + try { + return JSON.parse(item); + } catch (error) { + throw new ConfigurationError(`Content: \`${item}\` is not valid JSON`); + } + }); + }, + }, async run({ $ }) { const data = { object: this.urnToComment, @@ -48,7 +63,7 @@ export default { message: { text: this.message, }, - content: this.content, + content: this.parseContent(this.content), parentComment: this.parentComment, }; const response = await this.linkedin.createComment(encodeURIComponent(this.urnToComment), { diff --git a/components/linkedin/package.json b/components/linkedin/package.json index f6b45200394e3..3520919c96bac 100644 --- a/components/linkedin/package.json +++ b/components/linkedin/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/linkedin", - "version": "1.3.2", + "version": "2.0.0", "description": "Pipedream Linkedin Components", "main": "linkedin.app.mjs", "keywords": [ diff --git a/components/mailchimp/actions/add-or-update-subscriber/add-or-update-subscriber.mjs b/components/mailchimp/actions/add-or-update-subscriber/add-or-update-subscriber.mjs index 396a969ba601b..5627a5152c5d4 100644 --- a/components/mailchimp/actions/add-or-update-subscriber/add-or-update-subscriber.mjs +++ b/components/mailchimp/actions/add-or-update-subscriber/add-or-update-subscriber.mjs @@ -6,7 +6,7 @@ export default { key: "mailchimp-add-or-update-subscriber", name: "Add or Update Subscriber", description: "Adds a new subscriber to an audience or updates existing subscriber. [See docs here](https://mailchimp.com/developer/marketing/api/list-members/add-or-update-list-member/)", - version: "0.2.4", + version: "0.2.5", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/mailchimp/actions/add-remove-member-tags/add-remove-member-tags.mjs b/components/mailchimp/actions/add-remove-member-tags/add-remove-member-tags.mjs index 98c0d9825a7c4..4a5092d247b79 100644 --- a/components/mailchimp/actions/add-remove-member-tags/add-remove-member-tags.mjs +++ b/components/mailchimp/actions/add-remove-member-tags/add-remove-member-tags.mjs @@ -8,7 +8,7 @@ export default { key: "mailchimp-add-remove-member-tags", name: "Add Or Remove Members Tags", description: "Add or remove member tags. [See docs here](https://mailchimp.com/developer/marketing/api/list-member-tags/add-or-remove-member-tags/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/mailchimp/actions/add-subscriber-to-tag/add-subscriber-to-tag.mjs b/components/mailchimp/actions/add-subscriber-to-tag/add-subscriber-to-tag.mjs index 49a4e9115d23b..53a52ecd5ae32 100644 --- a/components/mailchimp/actions/add-subscriber-to-tag/add-subscriber-to-tag.mjs +++ b/components/mailchimp/actions/add-subscriber-to-tag/add-subscriber-to-tag.mjs @@ -8,7 +8,7 @@ export default { key: "mailchimp-add-subscriber-to-tag", name: "Add Subscriber To Tag", description: "Adds an email address to a tag within an audience. [See docs here](https://mailchimp.com/developer/marketing/api/list-member-tags/add-or-remove-member-tags/)", - version: "0.2.4", + version: "0.2.5", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/mailchimp/actions/create-campaign/create-campaign.mjs b/components/mailchimp/actions/create-campaign/create-campaign.mjs index d79ed89ae0a73..7577bc970a72d 100644 --- a/components/mailchimp/actions/create-campaign/create-campaign.mjs +++ b/components/mailchimp/actions/create-campaign/create-campaign.mjs @@ -1,12 +1,14 @@ import mailchimp from "../../mailchimp.app.mjs"; -import { removeNullEntries } from "../../common/utils.mjs"; +import { + parseObjectArray, removeNullEntries, +} from "../../common/utils.mjs"; import constants from "../../common/constants.mjs"; export default { key: "mailchimp-create-campaign", name: "Create Campaign", - description: "Creates a new campaign draft. [See docs here](https://mailchimp.com/developer/marketing/api/campaigns/add-campaign/)", - version: "0.2.4", + description: "Creates a new campaign draft. [See the documentation](https://mailchimp.com/developer/marketing/api/campaigns/add-campaign/)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -53,8 +55,8 @@ export default { }, segmentConditions: { label: "Segment conditions", - type: "any", - description: "Segment match conditions.", + type: "string[]", + description: "Array of segment condition objects. Each item must be a JSON string, e.g. `{\"condition_type\":\"TextMerge\",\"field\":\"EMAIL\",\"op\":\"contains\",\"value\":\"@example.com\"}`. [See the documentation](https://mailchimp.com/developer/marketing/docs/alternative-schemas/#segment-condition-schemas).", optional: true, }, subjectLine: { @@ -131,8 +133,8 @@ export default { }, autoFbPost: { label: "Auto fb post", - type: "any", - description: "An array of Facebook page ID to auto-post to.", + type: "string[]", + description: "An array of Facebook page IDs to auto-post to.", optional: true, }, fbComments: { @@ -231,7 +233,6 @@ export default { }, }, async run({ $ }) { - const payload = removeNullEntries({ "type": this.type, "recipients": { @@ -240,7 +241,7 @@ export default { "saved_segment_id": this.savedSegmentId, "prebuilt_segment_id": this.prebuiltSegmentId, "match": this.segmentMatch, - "conditions": this.segmentConditions, + "conditions": parseObjectArray(this.segmentConditions, "Segment conditions"), }, }, "settings": { diff --git a/components/mailchimp/actions/create-list/create-list.mjs b/components/mailchimp/actions/create-list/create-list.mjs index 0604f39837df1..7f998177d0f78 100644 --- a/components/mailchimp/actions/create-list/create-list.mjs +++ b/components/mailchimp/actions/create-list/create-list.mjs @@ -5,7 +5,7 @@ export default { key: "mailchimp-create-list", name: "Create List", description: "Creates a new list. [See docs here](https://mailchimp.com/developer/marketing/api/lists/add-list/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/edit-campaign-template-content/edit-campaign-template-content.mjs b/components/mailchimp/actions/edit-campaign-template-content/edit-campaign-template-content.mjs index b1a4d39bf4a42..f31341cbfcc39 100644 --- a/components/mailchimp/actions/edit-campaign-template-content/edit-campaign-template-content.mjs +++ b/components/mailchimp/actions/edit-campaign-template-content/edit-campaign-template-content.mjs @@ -8,7 +8,7 @@ export default { key: "mailchimp-edit-campaign-template-content", name: "Edit A Campaign Template Content", description: "Edits a defined content area of a custom HTML template. [See docs here](https://mailchimp.com/developer/marketing/api/campaign-content/set-campaign-content/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/mailchimp/actions/get-campaign-report/get-campaign-report.mjs b/components/mailchimp/actions/get-campaign-report/get-campaign-report.mjs index f8620f359be23..6d07db9fbd563 100644 --- a/components/mailchimp/actions/get-campaign-report/get-campaign-report.mjs +++ b/components/mailchimp/actions/get-campaign-report/get-campaign-report.mjs @@ -7,7 +7,7 @@ export default { key: "mailchimp-get-campaign-report", name: "Get A Campaign Report", description: "Gets a campaign report. [See docs here](https://mailchimp.com/developer/marketing/api/campaign-advice/)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/get-campaign/get-campaign.mjs b/components/mailchimp/actions/get-campaign/get-campaign.mjs index ceb88778848d5..a2096c85d1cfa 100644 --- a/components/mailchimp/actions/get-campaign/get-campaign.mjs +++ b/components/mailchimp/actions/get-campaign/get-campaign.mjs @@ -7,7 +7,7 @@ export default { key: "mailchimp-get-campaign", name: "Get Campaign", description: "Gets metadata of a specific campaign. [See docs here](https://mailchimp.com/developer/marketing/api/campaigns/get-campaign-info/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/get-list-activities/get-list-activities.mjs b/components/mailchimp/actions/get-list-activities/get-list-activities.mjs index d958462f7e44b..b94e742c3afd7 100644 --- a/components/mailchimp/actions/get-list-activities/get-list-activities.mjs +++ b/components/mailchimp/actions/get-list-activities/get-list-activities.mjs @@ -7,7 +7,7 @@ export default { key: "mailchimp-get-list-activities", name: "Get List Activities", description: "Retrieves up to the previous 180 days of daily detailed aggregated activity stats for a list. [See docs here](https://mailchimp.com/developer/marketing/api/list-activity/list-recent-activity/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/get-list-member-activity/get-list-member-activity.mjs b/components/mailchimp/actions/get-list-member-activity/get-list-member-activity.mjs index 31b8c62277d3a..2bf22e9650f16 100644 --- a/components/mailchimp/actions/get-list-member-activity/get-list-member-activity.mjs +++ b/components/mailchimp/actions/get-list-member-activity/get-list-member-activity.mjs @@ -8,7 +8,7 @@ export default { key: "mailchimp-get-list-member-activity", name: "Get List Member Activities", description: "Get the last 50 events of a member's activity on a specific list. [See docs here](https://mailchimp.com/developer/marketing/api/list-activity/view-recent-activity-50/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/get-list-member-tags/get-list-member-tags.mjs b/components/mailchimp/actions/get-list-member-tags/get-list-member-tags.mjs index 31273ad66af6f..43e3e4259c6c3 100644 --- a/components/mailchimp/actions/get-list-member-tags/get-list-member-tags.mjs +++ b/components/mailchimp/actions/get-list-member-tags/get-list-member-tags.mjs @@ -7,7 +7,7 @@ export default { key: "mailchimp-get-list-member-tags", name: "Get List Member Tags", description: "Retrieves a list of all member tags. [See docs here](https://mailchimp.com/developer/marketing/api/list-member-tags/list-member-tags/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/get-list/get-list.mjs b/components/mailchimp/actions/get-list/get-list.mjs index 4bbd9029d4232..6736569252beb 100644 --- a/components/mailchimp/actions/get-list/get-list.mjs +++ b/components/mailchimp/actions/get-list/get-list.mjs @@ -7,7 +7,7 @@ export default { key: "mailchimp-get-list", name: "Get List", description: "Searches for lists. [See docs here](https://mailchimp.com/developer/marketing/api/lists/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/list-segment-member/list-segment-member.mjs b/components/mailchimp/actions/list-segment-member/list-segment-member.mjs index 670d0c70845a2..6a181927c1582 100644 --- a/components/mailchimp/actions/list-segment-member/list-segment-member.mjs +++ b/components/mailchimp/actions/list-segment-member/list-segment-member.mjs @@ -5,7 +5,7 @@ export default { key: "mailchimp-list-segment-member", name: "List Segment Members", description: "Retrieves a list of all segment members. [See docs here](https://mailchimp.com/developer/marketing/api/list-segment-members/list-members-in-segment/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/search-campaign/search-campaign.mjs b/components/mailchimp/actions/search-campaign/search-campaign.mjs index 6ef147ed2ba87..9cd6dfe1cb66b 100644 --- a/components/mailchimp/actions/search-campaign/search-campaign.mjs +++ b/components/mailchimp/actions/search-campaign/search-campaign.mjs @@ -7,7 +7,7 @@ export default { key: "mailchimp-search-campaign", name: "Search Campaigns", description: "Searches for the campaigns. [See docs here](https://mailchimp.com/developer/marketing/api/search-campaigns/search-campaigns/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/search-lists/search-lists.mjs b/components/mailchimp/actions/search-lists/search-lists.mjs index 54cbb289935b3..e4e1fec503a6a 100644 --- a/components/mailchimp/actions/search-lists/search-lists.mjs +++ b/components/mailchimp/actions/search-lists/search-lists.mjs @@ -8,7 +8,7 @@ export default { key: "mailchimp-search-lists", name: "Search Lists", description: "Searches for lists. [See docs here](https://mailchimp.com/developer/marketing/api/lists/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/search-member/search-member.mjs b/components/mailchimp/actions/search-member/search-member.mjs index d0187245fb753..5f15af08f108d 100644 --- a/components/mailchimp/actions/search-member/search-member.mjs +++ b/components/mailchimp/actions/search-member/search-member.mjs @@ -7,7 +7,7 @@ export default { description: `Searches for a subscriber. The search can be restricted to a specific list, or can be used to search across all lists in an account. [See docs here](https://mailchimp.com/developer/marketing/api/search-members/) `, - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/mailchimp/actions/update-campaign/update-campaign.mjs b/components/mailchimp/actions/update-campaign/update-campaign.mjs index 3028466465fec..5f1c3da8aa68f 100644 --- a/components/mailchimp/actions/update-campaign/update-campaign.mjs +++ b/components/mailchimp/actions/update-campaign/update-campaign.mjs @@ -1,12 +1,14 @@ import mailchimp from "../../mailchimp.app.mjs"; -import { removeNullEntries } from "../../common/utils.mjs"; +import { + parseObjectArray, removeNullEntries, +} from "../../common/utils.mjs"; import constants from "../../common/constants.mjs"; export default { key: "mailchimp-update-campaign", name: "Update Campaign", - description: "Update a campaign. [See docs here](https://mailchimp.com/developer/marketing/api/campaigns/update-campaign-settings/)", - version: "0.0.3", + description: "Update a campaign. [See the documentation](https://mailchimp.com/developer/marketing/api/campaigns/update-campaign-settings/)", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -55,9 +57,9 @@ export default { options: constants.SEGMENT_MATCHES, }, segmentConditions: { - type: "any", - label: "Segment condition", - description: "Segment match conditions.", + type: "string[]", + label: "Segment conditions", + description: "Array of segment condition objects. Each item must be a JSON string, e.g. `{\"condition_type\":\"TextMerge\",\"field\":\"EMAIL\",\"op\":\"contains\",\"value\":\"@example.com\"}`. [See the documentation](https://mailchimp.com/developer/marketing/docs/alternative-schemas/#segment-condition-schemas).", optional: true, }, subjectLine: { @@ -239,7 +241,7 @@ export default { saved_segment_id: this.savedSegmentId, prebuilt_segment_id: this.prebuiltSegmentId, match: this.segmentMatch, - conditions: this.segmentConditions, + conditions: parseObjectArray(this.segmentConditions, "Segment conditions"), }, }, settings: { diff --git a/components/mailchimp/actions/update-list/update-list.mjs b/components/mailchimp/actions/update-list/update-list.mjs index d60e6bb878a0c..2c14afcfd9339 100644 --- a/components/mailchimp/actions/update-list/update-list.mjs +++ b/components/mailchimp/actions/update-list/update-list.mjs @@ -5,7 +5,7 @@ export default { key: "mailchimp-update-list", name: "Update List", description: "Updates an existing list. [See docs here](https://mailchimp.com/developer/marketing/api/lists/update-lists/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/mailchimp/common/utils.mjs b/components/mailchimp/common/utils.mjs index 6e574142654cb..b9de68403c1fb 100644 --- a/components/mailchimp/common/utils.mjs +++ b/components/mailchimp/common/utils.mjs @@ -80,6 +80,22 @@ const formatArrayStrings = (objectArray, ALLOWED_KEYS, fieldName, allowedValues return updatedArray; }; +/** + * Parses a `string[]` prop whose entries are JSON-serialized objects, leaving + * already-parsed objects untouched. Use `formatArrayStrings` instead when the + * entries also need key/value validation. + */ +const parseObjectArray = (items, fieldName) => items?.map((item) => { + if (typeof item !== "string") { + return item; + } + try { + return JSON.parse(item); + } catch { + throw new ConfigurationError(`${fieldName}: \`${item}\` is not valid JSON`); + } +}); + const commaSeparateArray = (arr) => arr?.length && arr.join(","); const md5Hash = (str) => crypto @@ -88,5 +104,6 @@ const md5Hash = (str) => crypto .digest("hex"); export { - removeNullEntries, formatArrayStrings, validateObject, commaSeparateArray, md5Hash, + removeNullEntries, formatArrayStrings, parseObjectArray, validateObject, commaSeparateArray, + md5Hash, }; diff --git a/components/mailchimp/package.json b/components/mailchimp/package.json index e943cd4a372f6..05e613bce3d33 100644 --- a/components/mailchimp/package.json +++ b/components/mailchimp/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/mailchimp", - "version": "1.1.0", + "version": "2.0.0", "description": "Pipedream Mailchimp Components", "main": "mailchimp.app.mjs", "keywords": [ diff --git a/components/medium/actions/create-post/create-post.mjs b/components/medium/actions/create-post/create-post.mjs index 85dae3f879999..786c1a6220519 100644 --- a/components/medium/actions/create-post/create-post.mjs +++ b/components/medium/actions/create-post/create-post.mjs @@ -5,7 +5,7 @@ import { axios } from "@pipedream/platform"; export default { key: "medium-create-post", name: "Create a post", - version: "0.1.4", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -35,7 +35,8 @@ export default { description: "The body of the post, in a valid, semantic, HTML fragment, or Markdown. Further markups may be supported in the future. For a full list of accepted HTML tags, see here. If you want your title to appear on the post page, you must also include it as part of the post content.", }, tags: { - type: "any", + type: "string[]", + label: "Tags", description: "Tags to classify the post. Only the first three will be used. Tags longer than 25 characters will be ignored.", optional: true, }, diff --git a/components/medium/package.json b/components/medium/package.json index 51515a2e774fc..41fc670f501b1 100644 --- a/components/medium/package.json +++ b/components/medium/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/medium", - "version": "0.6.0", + "version": "1.0.0", "description": "Pipedream medium Components", "main": "medium.app.mjs", "keywords": [ diff --git a/components/rev_ai/actions/submit-transcription-job/submit-transcription-job.mjs b/components/rev_ai/actions/submit-transcription-job/submit-transcription-job.mjs index 8dd2b43f12dd9..b88692e4679fc 100644 --- a/components/rev_ai/actions/submit-transcription-job/submit-transcription-job.mjs +++ b/components/rev_ai/actions/submit-transcription-job/submit-transcription-job.mjs @@ -5,7 +5,7 @@ export default { key: "rev_ai-submit-transcription-job", name: "Submit Transcription Job", description: "Starts an asynchronous job to transcribe speech-to-text for a media file. Add an optional callback URL to invoke when processing is complete.", - version: "0.1.2", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -62,7 +62,8 @@ export default { optional: true, }, phrases: { - type: "any", + type: "string[]", + label: "Phrases", description: "Array of phrases not found in normal dictionary. Add technical jargon, proper nouns and uncommon phrases as strings in this array to add them to the lexicon for this job.\n\nA phrase must contain at least 1 alpha character but may contain any non-numeric character from the Basic Latin set. A phrase can contain up to 12 words. Each word can contain up to 34 characters.", optional: true, }, diff --git a/components/rev_ai/package.json b/components/rev_ai/package.json index 63f2bf429bbab..2914d337d24ef 100644 --- a/components/rev_ai/package.json +++ b/components/rev_ai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/rev_ai", - "version": "0.6.0", + "version": "1.0.0", "description": "Pipedream rev_ai Components", "main": "rev_ai.app.mjs", "keywords": [ diff --git a/components/ringcentral/actions/create-meeting/create-meeting.mjs b/components/ringcentral/actions/create-meeting/create-meeting.mjs index d2731c3ff831f..d032d95dcc88b 100644 --- a/components/ringcentral/actions/create-meeting/create-meeting.mjs +++ b/components/ringcentral/actions/create-meeting/create-meeting.mjs @@ -4,7 +4,7 @@ export default { key: "ringcentral-create-meeting", name: "Create Meeting", description: "Creates a new meeting. See the API docs [here](https://developers.ringcentral.com/api-reference/Meeting-Management/createMeeting).", - version: "0.2.2", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -72,7 +72,14 @@ export default { optional: true, }, audioOptions: { - type: "any", + type: "string[]", + label: "Audio Options", + description: "How participants can join the meeting audio.", + options: [ + "Phone", + "ComputerAudio", + "ThirdParty", + ], optional: true, }, recurrence: { diff --git a/components/ringcentral/package.json b/components/ringcentral/package.json index 5269cbdc729fe..bb2db5822b447 100644 --- a/components/ringcentral/package.json +++ b/components/ringcentral/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/ringcentral", - "version": "0.6.0", + "version": "1.0.0", "description": "Pipedream Ringcentral Components", "main": "ringcentral.app.mjs", "keywords": [ diff --git a/components/rockset/actions/add-documents/add-documents.mjs b/components/rockset/actions/add-documents/add-documents.mjs index 4da7a923cf530..6517930d33d60 100644 --- a/components/rockset/actions/add-documents/add-documents.mjs +++ b/components/rockset/actions/add-documents/add-documents.mjs @@ -1,11 +1,13 @@ // legacy_hash_id: a_bKiPAo -import { axios } from "@pipedream/platform"; +import { + axios, ConfigurationError, +} from "@pipedream/platform"; export default { key: "rockset-add-documents", name: "Add Documents", - description: "Add documents to a collection in Rockset. Learn more at https://docs.rockset.com/rest/#adddocuments.", - version: "0.1.2", + description: "Add documents to a collection in Rockset. [See the documentation](https://docs.rockset.com/rest/#adddocuments)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -18,8 +20,9 @@ export default { app: "rockset", }, data: { - type: "any", - description: "Array of JSON documents. Learn more at https://docs.rockset.com/rest/#adddocuments.", + type: "string[]", + label: "Documents", + description: "Array of JSON documents to add, one JSON string per entry, e.g. `{\"field\":\"value\"}`. Learn more at https://docs.rockset.com/rest/#adddocuments.", }, workspace: { type: "string", @@ -30,9 +33,23 @@ export default { description: "Name of the collection.", }, }, + methods: { + parseDocuments(items) { + return items?.map((item) => { + if (typeof item !== "string") { + return item; + } + try { + return JSON.parse(item); + } catch (error) { + throw new ConfigurationError(`Documents: \`${item}\` is not valid JSON`); + } + }); + }, + }, async run({ $ }) { const data = { - "data": this.data, + "data": this.parseDocuments(this.data), }; return await axios($, { diff --git a/components/rockset/package.json b/components/rockset/package.json index bbc7b47d6ab16..9bd84f468c1a7 100644 --- a/components/rockset/package.json +++ b/components/rockset/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/rockset", - "version": "0.6.0", + "version": "1.0.0", "description": "Pipedream rockset Components", "main": "rockset.app.mjs", "keywords": [ diff --git a/components/sendfox_personal_access_token/actions/create-contact/create-contact.mjs b/components/sendfox_personal_access_token/actions/create-contact/create-contact.mjs index 34b6ef8a2d7cb..1fb9b60de4f91 100644 --- a/components/sendfox_personal_access_token/actions/create-contact/create-contact.mjs +++ b/components/sendfox_personal_access_token/actions/create-contact/create-contact.mjs @@ -5,7 +5,7 @@ export default { key: "sendfox_personal_access_token-create-contact", name: "Create contact", description: "Creates new contact", - version: "0.1.2", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -29,7 +29,9 @@ export default { optional: true, }, lists: { - type: "any", + type: "integer[]", + label: "Lists", + description: "IDs of the SendFox lists to add the contact to, as integers, e.g. `[123, 456]`. Get a list ID from the `id` field of `GET https://api.sendfox.com/lists`, or from the numeric segment of the list's URL in the SendFox dashboard.", optional: true, }, }, diff --git a/components/sendfox_personal_access_token/package.json b/components/sendfox_personal_access_token/package.json index b04520f899879..1f87b1a526c8a 100644 --- a/components/sendfox_personal_access_token/package.json +++ b/components/sendfox_personal_access_token/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sendfox_personal_access_token", - "version": "0.6.0", + "version": "1.0.0", "description": "Pipedream sendfox_personal_access_token Components", "main": "sendfox_personal_access_token.app.mjs", "keywords": [ diff --git a/components/slack_v2/actions/verify-slack-signature/verify-slack-signature.mjs b/components/slack_v2/actions/verify-slack-signature/verify-slack-signature.mjs index 721e87d9932ee..4b93f4d0c61c6 100644 --- a/components/slack_v2/actions/verify-slack-signature/verify-slack-signature.mjs +++ b/components/slack_v2/actions/verify-slack-signature/verify-slack-signature.mjs @@ -5,7 +5,7 @@ export default { key: "slack_v2-verify-slack-signature", name: "Verify Slack Signature", description: "Verifying requests from Slack, slack signs its requests using a secret that's unique to your app. `Request Body` must be the raw request body as a string (not a parsed object) — Slack computes its signature over the exact raw bytes it sent, so re-serializing a parsed object will not match. [See the documentation](https://api.slack.com/authentication/verifying-requests-from-slack)", - version: "1.0.2", + version: "1.0.3", annotations: { destructiveHint: false, openWorldHint: true, @@ -34,7 +34,7 @@ export default { requestBody: { type: "string", label: "Request Body", - description: "The body of the request to be verified.", + description: "The raw body of the request to be verified. This must be the verbatim body Slack sent, not a re-serialized object.", }, }, async run({ $ }) { diff --git a/components/slack_v2/package.json b/components/slack_v2/package.json index 8f7d52cdddfa6..2f6947926c16e 100644 --- a/components/slack_v2/package.json +++ b/components/slack_v2/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/slack_v2", - "version": "1.1.2", + "version": "1.1.3", "description": "Pipedream Slack_v2 Components", "main": "slack_v2.app.mjs", "keywords": [ diff --git a/components/telegram_bot_api/actions/send-album/send-album.mjs b/components/telegram_bot_api/actions/send-album/send-album.mjs index 10eaa12bf6921..b015db3c856b3 100644 --- a/components/telegram_bot_api/actions/send-album/send-album.mjs +++ b/components/telegram_bot_api/actions/send-album/send-album.mjs @@ -5,7 +5,7 @@ export default { key: "telegram_bot_api-send-album", name: "Send an Album (Media Group)", description: "Sends a group of photos or videos as an album. [See the docs](https://core.telegram.org/bots/api#sendmediagroup) for more information", - version: "0.0.9", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -21,7 +21,7 @@ export default { ], }, media: { - type: "any", + type: "string", label: "Media", description: toSingleLineString(` A JSON-serialized array describing photos and videos to be sent, must include 2–10 items diff --git a/components/telegram_bot_api/package.json b/components/telegram_bot_api/package.json index fc1e2e99fe8f5..d3f4fe036ccf0 100644 --- a/components/telegram_bot_api/package.json +++ b/components/telegram_bot_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/telegram_bot_api", - "version": "0.5.2", + "version": "1.0.0", "description": "Pipedream Telegram_bot_api Components", "main": "telegram_bot_api.app.mjs", "keywords": [ diff --git a/components/twist/actions/add-comment/add-comment.mjs b/components/twist/actions/add-comment/add-comment.mjs index 1480efe2bab4e..0483c7f71bed8 100644 --- a/components/twist/actions/add-comment/add-comment.mjs +++ b/components/twist/actions/add-comment/add-comment.mjs @@ -1,11 +1,14 @@ // legacy_hash_id: a_a4irNP import { axios } from "@pipedream/platform"; +import { + parseObjectArray, parseRecipients, +} from "../../common/utils.mjs"; export default { key: "twist-add-comment", name: "Add Comment", - description: "Adds a new comment to a thread.", - version: "0.2.2", + description: "Adds a new comment to a thread. [See the documentation](https://api.twistapp.com/v3/#add-comment)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -26,32 +29,38 @@ export default { description: "The content of the new comment. Mentions can be used as `[Name](twist-mention://user_id)` for users or `[Group name](twist-group-mention://group_id)` for groups. Check [limits](https://api.twistapp.com/v3/#limits) for size restrictions for the content.", }, attachments: { - type: "any", - description: "List of attachments to the new comment. It must follow the JSON format returned by [attachment#upload](https://api.twistapp.com/v3/#upload-an-attachment).", + type: "string[]", + label: "Attachments", + description: "List of attachments to add. Each item must be a JSON string following the format returned by [attachment#upload](https://api.twistapp.com/v3/#upload-an-attachment).", optional: true, }, actions: { - type: "string", - description: "List of action to the new comment. More information about the format of the object available at the [add an action button submenu](https://api.twistapp.com/v3/#add-an-action-button).", + type: "string[]", + label: "Actions", + description: "List of action buttons to add. Each item must be a JSON string, e.g. `{\"action\":\"open_url\",\"type\":\"action\",\"button_text\":\"View\",\"url\":\"https://example.com\"}`. See the [action button submenu](https://api.twistapp.com/v3/#add-an-action-button).", optional: true, }, direct_mentions: { - type: "any", + type: "integer[]", + label: "Direct Mentions", description: "The users that are directly mentioned.", optional: true, }, direct_group_mentions: { - type: "any", + type: "integer[]", + label: "Direct Group Mentions", description: "The groups that are directly mentioned.", optional: true, }, recipients: { - type: "any", - description: "An array of users (e.g. recipients: `[10000, 10001]`) to notify. It also accepts the strings `EVERYONE` or `EVERYONE_IN_THREAD`, which notifies everyone in the workspace or everyone mentioned in previous posts of this thread. If not provided, `EVERYONE_IN_THREAD` will be used.", + type: "string[]", + label: "Recipients", + description: "The users to notify, as user IDs (e.g. `10000`, `10001`). Also accepts the single value `EVERYONE` or `EVERYONE_IN_THREAD`, which notifies everyone in the workspace or everyone mentioned in previous posts of this thread. If not provided, `EVERYONE_IN_THREAD` is used.", optional: true, }, groups: { - type: "any", + type: "integer[]", + label: "Groups", description: "The groups that will be notified.", optional: true, }, @@ -78,7 +87,7 @@ export default { throw new Error("Must provide thread_id, and content parameters."); } - return await axios($, { + const response = await axios($, { method: "post", url: "https://api.twist.com/api/v3/comments/add", headers: { @@ -87,16 +96,20 @@ export default { data: { thread_id: this.thread_id, content: this.content, - attachments: this.attachments, - actions: this.actions, + attachments: parseObjectArray(this.attachments, "Attachments"), + actions: parseObjectArray(this.actions, "Actions"), direct_mentions: this.direct_mentions, direct_group_mentions: this.direct_group_mentions, - recipients: this.recipients, + recipients: parseRecipients(this.recipients), groups: this.groups, temp_id: this.temp_id, mark_thread_position: this.mark_thread_position, send_as_integration: this.send_as_integration, }, }); + + $.export("$summary", `Successfully added comment ${response.id} to thread ${this.thread_id}`); + + return response; }, }; diff --git a/components/twist/actions/add-message-to-conversation/add-message-to-conversation.mjs b/components/twist/actions/add-message-to-conversation/add-message-to-conversation.mjs index a13d4cfb16971..39a8ceeccffd3 100644 --- a/components/twist/actions/add-message-to-conversation/add-message-to-conversation.mjs +++ b/components/twist/actions/add-message-to-conversation/add-message-to-conversation.mjs @@ -1,11 +1,12 @@ // legacy_hash_id: a_zNiVnJ import { axios } from "@pipedream/platform"; +import { parseObjectArray } from "../../common/utils.mjs"; export default { key: "twist-add-message-to-conversation", name: "Add Message To Conversation", - description: "Adds a message to an existing conversation.", - version: "0.1.2", + description: "Adds a message to an existing conversation. [See the documentation](https://api.twistapp.com/v3/#add-message-to-conversation)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -26,22 +27,26 @@ export default { description: "The content of the new message. Mentions can be used as `[Name](twist-mention://user_id)` for users or `[Group name](twist-group-mention://group_id)` for groups. Check [limits](https://api.twistapp.com/v3/#limits) for size restrictions for the content.", }, attachments: { - type: "any", - description: "List of attachments to the new comment. It must follow the JSON format returned by [attachment#upload](https://api.twistapp.com/v3/#upload-an-attachment).", + type: "string[]", + label: "Attachments", + description: "List of attachments to add. Each item must be a JSON string following the format returned by [attachment#upload](https://api.twistapp.com/v3/#upload-an-attachment).", optional: true, }, actions: { - type: "any", - description: "List of action to the new comment. More information about the format of the object available at the [add an action button submenu](https://api.twistapp.com/v3/#add-an-action-button).", + type: "string[]", + label: "Actions", + description: "List of action buttons to add. Each item must be a JSON string, e.g. `{\"action\":\"open_url\",\"type\":\"action\",\"button_text\":\"View\",\"url\":\"https://example.com\"}`. See the [action button submenu](https://api.twistapp.com/v3/#add-an-action-button).", optional: true, }, direct_mentions: { - type: "any", + type: "integer[]", + label: "Direct Mentions", description: "The users that are directly mentioned.", optional: true, }, direct_group_mentions: { - type: "string", + type: "integer[]", + label: "Direct Group Mentions", description: "The groups that are directly mentioned.", optional: true, }, @@ -53,7 +58,7 @@ export default { throw new Error("Must provide conversation_id, content parameter."); } - return await axios($, { + const response = await axios($, { method: "post", url: "https://api.twist.com/api/v3/conversation_messages/add", headers: { @@ -62,11 +67,15 @@ export default { data: { conversation_id: this.conversation_id, content: this.content, - attachments: this.attachments, - actions: this.actions, + attachments: parseObjectArray(this.attachments, "Attachments"), + actions: parseObjectArray(this.actions, "Actions"), direct_mentions: this.direct_mentions, direct_group_mentions: this.direct_group_mentions, }, }); + + $.export("$summary", `Successfully added message ${response.id} to conversation ${this.conversation_id}`); + + return response; }, }; diff --git a/components/twist/actions/add-thread/add-thread.mjs b/components/twist/actions/add-thread/add-thread.mjs index b04e17f291c18..1f97bc99928d2 100644 --- a/components/twist/actions/add-thread/add-thread.mjs +++ b/components/twist/actions/add-thread/add-thread.mjs @@ -1,11 +1,14 @@ // legacy_hash_id: a_elirJ5 import { axios } from "@pipedream/platform"; +import { + parseObjectArray, parseRecipients, +} from "../../common/utils.mjs"; export default { key: "twist-add-thread", name: "Add Thread", - description: "Adds a new thread to a channel.", - version: "0.2.2", + description: "Adds a new thread to a channel. [See the documentation](https://api.twistapp.com/v3/#add-thread)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -30,32 +33,38 @@ export default { description: "The title of the new thread.", }, actions: { - type: "any", - description: "List of action to the new thread. More information about the format of the object available at the add an [action button submenu](https://api.twistapp.com/v3/#add-an-action-button).", + type: "string[]", + label: "Actions", + description: "List of action buttons to add. Each item must be a JSON string, e.g. `{\"action\":\"open_url\",\"type\":\"action\",\"button_text\":\"View\",\"url\":\"https://example.com\"}`. See the [action button submenu](https://api.twistapp.com/v3/#add-an-action-button).", optional: true, }, attachments: { - type: "any", - description: "List of attachments to the new thread. It must follow the JSON format returned by [attachment#upload.](https://api.twistapp.com/v3/#upload-an-attachment)", + type: "string[]", + label: "Attachments", + description: "List of attachments to add. Each item must be a JSON string following the format returned by [attachment#upload](https://api.twistapp.com/v3/#upload-an-attachment).", optional: true, }, direct_mentions: { - type: "any", + type: "integer[]", + label: "Direct Mentions", description: "The users that are directly mentioned.", optional: true, }, direct_group_mentions: { - type: "any", + type: "integer[]", + label: "Direct Group Mentions", description: "The groups that are directly mentioned.", optional: true, }, recipients: { - type: "any", - description: "An array of users (e.g. recipients: `[10000, 10001]`) that will be attached to the thread. It also accepts the string `EVERYONE`, which notifies everyone in the workspace. If not included, the value will default to `user_ids` of the target channel. If you specify `[]`, no Twist users will be notified, and the thread creator will become the sole participant.", + type: "string[]", + label: "Recipients", + description: "The users that will be attached to the thread, as user IDs (e.g. `10000`, `10001`). Also accepts the single value `EVERYONE`, which notifies everyone in the workspace. If not included, defaults to the `user_ids` of the target channel. If you specify an empty list, no Twist users will be notified and the thread creator becomes the sole participant.", optional: true, }, groups: { - type: "any", + type: "integer[]", + label: "Groups", description: "The groups that will be notified.", optional: true, }, @@ -77,25 +86,29 @@ export default { throw new Error("Must provide thread_id, content, and title parameters."); } - return await axios($, { + const response = await axios($, { method: "post", url: "https://api.twist.com/api/v3/threads/add", headers: { Authorization: `Bearer ${this.twist.$auth.oauth_access_token}`, }, data: { - actions: this.actions, - attachments: this.attachments, + actions: parseObjectArray(this.actions, "Actions"), + attachments: parseObjectArray(this.attachments, "Attachments"), channel_id: this.channel_id, content: this.content, direct_mentions: this.direct_mentions, direct_group_mentions: this.direct_group_mentions, - recipients: this.recipients, + recipients: parseRecipients(this.recipients), groups: this.groups, temp_id: this.temp_id, title: this.title, send_as_integration: this.send_as_integration, }, }); + + $.export("$summary", `Successfully added thread ${response.id} to channel ${this.channel_id}`); + + return response; }, }; diff --git a/components/twist/common/utils.mjs b/components/twist/common/utils.mjs new file mode 100644 index 0000000000000..4eb19f3e49cdf --- /dev/null +++ b/components/twist/common/utils.mjs @@ -0,0 +1,41 @@ +import { ConfigurationError } from "@pipedream/platform"; + +const toArray = (value) => Array.isArray(value) + ? value + : [ + value, + ]; + +/** + * Parses a `string[]` prop whose entries are JSON-serialized objects, leaving + * already-parsed objects untouched. + */ +export const parseObjectArray = (value, fieldName) => { + if (!value) { + return undefined; + } + return toArray(value).map((item) => { + if (typeof item !== "string") { + return item; + } + try { + return JSON.parse(item); + } catch (error) { + throw new ConfigurationError(`${fieldName}: \`${item}\` is not valid JSON`); + } + }); +}; + +/** + * Twist notification targets accept either numeric IDs or a sentinel string such + * as `EVERYONE`. A `string[]` prop carries both, so coerce the numeric entries + * back to numbers and pass the sentinels through unchanged. + */ +export const parseRecipients = (value) => { + if (!value) { + return undefined; + } + return toArray(value).map((item) => typeof item === "string" && /^\d+$/.test(item.trim()) + ? Number(item.trim()) + : item); +}; diff --git a/components/twist/package.json b/components/twist/package.json index 29e91628ca17d..6a723ed57f7ad 100644 --- a/components/twist/package.json +++ b/components/twist/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/twist", - "version": "0.0.2", + "version": "1.0.0", "description": "Pipedream Twist Components", "main": "twist.app.mjs", "keywords": [ diff --git a/components/wildberries/actions/update-order-status/update-order-status.ts b/components/wildberries/actions/update-order-status/update-order-status.ts index 8def3d60dbd50..e989870e2e354 100644 --- a/components/wildberries/actions/update-order-status/update-order-status.ts +++ b/components/wildberries/actions/update-order-status/update-order-status.ts @@ -5,7 +5,7 @@ export default defineAction({ name: "Update Order Status", description: "Update a order status. [See docs here](https://suppliers-api.wildberries.ru/swagger/index.html#/Marketplace/put_api_v2_orders)", key: "wildberries-update-order-status", - version: "0.0.2", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -27,9 +27,9 @@ export default defineAction({ ], }, sgtin: { - type: "any", + type: "object", label: "SGTIN", - description: "Array required only for pharmaceutical products when they are transferred to status `Customer received the goods`.\n\n**Example:** `[{ code: string, numerator: integer, denominator: integer, sid: integer }]`\n\n[See docs here](https://suppliers-api.wildberries.ru/swagger/index.html#/Marketplace/put_api_v2_orders)", + description: "SGTIN object, required only for pharmaceutical products when they are transferred to status `Customer received the goods`.\n\n**Example:** `{ \"code\": \"01234567890123\", \"numerator\": 1, \"denominator\": 1, \"sid\": 1 }`\n\n[See docs here](https://suppliers-api.wildberries.ru/swagger/index.html#/Marketplace/put_api_v2_orders)", optional: true, }, }, diff --git a/components/wildberries/package.json b/components/wildberries/package.json index 62f157b94513e..2c2b89a5f2591 100644 --- a/components/wildberries/package.json +++ b/components/wildberries/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/wildberries", - "version": "0.0.4", + "version": "1.0.0", "description": "Pipedream Wildberries Components", "main": "dist/app/wildberries.app.mjs", "keywords": [ diff --git a/components/wordpress_com/actions/upload-media/upload-media.mjs b/components/wordpress_com/actions/upload-media/upload-media.mjs index bc368a11e1b2e..852a9ad2fd36b 100644 --- a/components/wordpress_com/actions/upload-media/upload-media.mjs +++ b/components/wordpress_com/actions/upload-media/upload-media.mjs @@ -1,3 +1,4 @@ +import { ConfigurationError } from "@pipedream/platform"; import { prepareMediaUpload } from "../../common/utils.mjs"; import wordpress from "../../wordpress_com.app.mjs"; @@ -5,7 +6,7 @@ export default { key: "wordpress_com-upload-media", name: "Upload Media", description: "Uploads a media file from a URL to the specified WordPress.com site. [See the documentation](https://developer.wordpress.com/docs/api/1.1/post/sites/%24site/media/new/)", - version: "0.0.4", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -21,9 +22,9 @@ export default { ], }, media: { - type: "any", + type: "string", label: "Media URL", - description: "A direct media URL, or a FormData object with the file attached under the field name 'media[]'.", + description: "A direct HTTPS URL to the media file to upload, e.g. `https://example.com/image.jpg`. The URL must point at the file itself, not at a page containing it.", }, title: { type: "string", @@ -45,24 +46,24 @@ export default { }, }, async run({ $ }) { + const { + wordpress, + site, + media, + ...fields + } = this; - const - { - wordpress, - site, - media, - ...fields - } = this; - - let form; - - // If not form data - if (wordpress.isFormData(media)) { - form = media; - - } else { - form = await prepareMediaUpload(media, fields, $); + let mediaUrl; + try { + mediaUrl = new URL(media); + } catch { + throw new ConfigurationError(`**Media URL** must be a direct HTTPS URL to the file, e.g. \`https://example.com/image.jpg\`. Received: \`${media}\``); } + if (mediaUrl.protocol !== "https:") { + throw new ConfigurationError(`**Media URL** must use the \`https\` protocol. Received: \`${media}\``); + } + + const form = await prepareMediaUpload(media, fields); const response = await wordpress.uploadWordpressMedia({ $, diff --git a/components/wordpress_com/package.json b/components/wordpress_com/package.json index cd45363763fbc..c44d98ba4c623 100644 --- a/components/wordpress_com/package.json +++ b/components/wordpress_com/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/wordpress_com", - "version": "0.8.0", + "version": "1.0.0", "description": "Pipedream wordpress_com Components", "main": "wordpress_com.app.mjs", "keywords": [ diff --git a/components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs b/components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs index 97a4b76a19e13..35bfd200bb67a 100644 --- a/components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs +++ b/components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs @@ -8,7 +8,7 @@ export default { key: "xero_accounting_api-add-line-item-to-invoice", name: "Add Items to Existing Sales Invoice", description: "Adds line items to an existing sales invoice. [See the docs here](https://developer.xero.com/documentation/api/accounting/invoices#post-invoices)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs b/components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs index 77099e9c27a22..46ad3a47371d4 100644 --- a/components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs +++ b/components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-create-bank-transaction", name: "Create Bank Transaction", description: "Create a new bank transaction [See the documentation](https://developer.xero.com/documentation/api/accounting/banktransactions#put-banktransactions)", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-bill/create-bill.mjs b/components/xero_accounting_api/actions/create-bill/create-bill.mjs index 67ae383868a53..96b559e6912b0 100644 --- a/components/xero_accounting_api/actions/create-bill/create-bill.mjs +++ b/components/xero_accounting_api/actions/create-bill/create-bill.mjs @@ -9,7 +9,7 @@ export default { key: "xero_accounting_api-create-bill", name: "Create Bill", description: "Creates a new bill (Accounts Payable)[See the docs here](https://developer.xero.com/documentation/api/accounting/invoices)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs b/components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs index e548de13d5598..45e9a4ac90f14 100644 --- a/components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs +++ b/components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-create-credit-note", name: "Create Credit Note", description: "Creates a new credit note.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-history-note/create-history-note.mjs b/components/xero_accounting_api/actions/create-history-note/create-history-note.mjs index 3d5d443f4de0a..57e25eaa29b2d 100644 --- a/components/xero_accounting_api/actions/create-history-note/create-history-note.mjs +++ b/components/xero_accounting_api/actions/create-history-note/create-history-note.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-create-history-note", name: "Create History Note", description: "Creates a new note adding it to a document.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-item/create-item.mjs b/components/xero_accounting_api/actions/create-item/create-item.mjs index 89ab14ea000ff..9f012c34a0cc4 100644 --- a/components/xero_accounting_api/actions/create-item/create-item.mjs +++ b/components/xero_accounting_api/actions/create-item/create-item.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-create-item", name: "Create Item", description: "Creates a new item.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-payment/create-payment.mjs b/components/xero_accounting_api/actions/create-payment/create-payment.mjs index 0217131de875a..f144e7b3cfd02 100644 --- a/components/xero_accounting_api/actions/create-payment/create-payment.mjs +++ b/components/xero_accounting_api/actions/create-payment/create-payment.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-create-payment", name: "Create Payment", description: "Creates a new payment", - version: "0.1.5", + version: "0.1.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs b/components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs index 6fdd6b836bb2a..f2e355e7404b7 100644 --- a/components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs +++ b/components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-create-tracking-category", name: "Create tracking category", description: "Create a new tracking category [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#put-trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs b/components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs index a32c5a54f23b8..59a0a57ca6aa5 100644 --- a/components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs +++ b/components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-create-update-contact", name: "Create or update contact ", description: "Creates a new contact or updates a contact if a contact already exists. [See the docs here](https://developer.xero.com/documentation/api/accounting/contacts)", - version: "0.1.2", + version: "0.1.3", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs b/components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs index 5dd317f071f9a..91e28340db675 100644 --- a/components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs +++ b/components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-delete-tracking-category-option", name: "Delete tracking category option", description: "Delete a tracking category option by ID [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#delete-trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/delete-tracking-category/delete-tracking-category.mjs b/components/xero_accounting_api/actions/delete-tracking-category/delete-tracking-category.mjs index e44283993d363..93c5ca354a33a 100644 --- a/components/xero_accounting_api/actions/delete-tracking-category/delete-tracking-category.mjs +++ b/components/xero_accounting_api/actions/delete-tracking-category/delete-tracking-category.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-delete-tracking-category", name: "Delete tracking category", description: "Delete a tracking category by ID [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#delete-trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/download-invoice/download-invoice.mjs b/components/xero_accounting_api/actions/download-invoice/download-invoice.mjs index c4970a575611d..bf0e8144ba1b1 100644 --- a/components/xero_accounting_api/actions/download-invoice/download-invoice.mjs +++ b/components/xero_accounting_api/actions/download-invoice/download-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-download-invoice", name: "Download Invoice", description: "Downloads an invoice as pdf file. File will be placed at the action's associated workflow temporary folder.", - version: "0.2.4", + version: "0.2.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/email-an-invoice/email-an-invoice.mjs b/components/xero_accounting_api/actions/email-an-invoice/email-an-invoice.mjs index b5f95a8304eed..3f71745628d41 100644 --- a/components/xero_accounting_api/actions/email-an-invoice/email-an-invoice.mjs +++ b/components/xero_accounting_api/actions/email-an-invoice/email-an-invoice.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-email-an-invoice", name: "Email an Invoice", description: "Triggers the email of a sales invoice out of Xero.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/find-invoice/find-invoice.mjs b/components/xero_accounting_api/actions/find-invoice/find-invoice.mjs index c405ced99fee8..dfa16522f6741 100644 --- a/components/xero_accounting_api/actions/find-invoice/find-invoice.mjs +++ b/components/xero_accounting_api/actions/find-invoice/find-invoice.mjs @@ -8,7 +8,7 @@ export default { key: "xero_accounting_api-find-invoice", name: "Find Invoice", description: "Finds an invoice by number or reference.[See the docs here](https://developer.xero.com/documentation/api/accounting/invoices/#get-invoices)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/find-or-create-contact/find-or-create-contact.mjs b/components/xero_accounting_api/actions/find-or-create-contact/find-or-create-contact.mjs index a380b03425504..fe9206a256cee 100644 --- a/components/xero_accounting_api/actions/find-or-create-contact/find-or-create-contact.mjs +++ b/components/xero_accounting_api/actions/find-or-create-contact/find-or-create-contact.mjs @@ -9,7 +9,7 @@ export default { key: "xero_accounting_api-find-or-create-contact", name: "Find or Create Contact", description: "Finds a contact by name or email address. Optionally, create one if none are found. [See the docs here](https://developer.xero.com/documentation/api/accounting/contacts/#get-contacts)", - version: "0.1.2", + version: "0.1.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-bank-statements-report/get-bank-statements-report.mjs b/components/xero_accounting_api/actions/get-bank-statements-report/get-bank-statements-report.mjs index 83d3ea9598201..db6621d202cde 100644 --- a/components/xero_accounting_api/actions/get-bank-statements-report/get-bank-statements-report.mjs +++ b/components/xero_accounting_api/actions/get-bank-statements-report/get-bank-statements-report.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-get-bank-statements-report", name: "Bank Statements Report", description: "Gets bank statements for the specified bank account.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-bank-summary/get-bank-summary.mjs b/components/xero_accounting_api/actions/get-bank-summary/get-bank-summary.mjs index 53d35bcfd46fb..b00b4b3ea9bf2 100644 --- a/components/xero_accounting_api/actions/get-bank-summary/get-bank-summary.mjs +++ b/components/xero_accounting_api/actions/get-bank-summary/get-bank-summary.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-get-bank-summary", name: "Get Bank Summary", description: "Gets the balances and cash movements for each bank account.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-contact/get-contact.mjs b/components/xero_accounting_api/actions/get-contact/get-contact.mjs index fa1b81bcfb71e..79e9aa5c325d0 100644 --- a/components/xero_accounting_api/actions/get-contact/get-contact.mjs +++ b/components/xero_accounting_api/actions/get-contact/get-contact.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-get-contact", name: "Get Contact", description: "Gets details of a contact.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-history-of-changes/get-history-of-changes.mjs b/components/xero_accounting_api/actions/get-history-of-changes/get-history-of-changes.mjs index e9069e2659e7f..d7d1fbca6a273 100644 --- a/components/xero_accounting_api/actions/get-history-of-changes/get-history-of-changes.mjs +++ b/components/xero_accounting_api/actions/get-history-of-changes/get-history-of-changes.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-get-history-of-changes", name: "Get History of Changes", description: "Gets the history of changes to a single existing document.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-invoice-online-url/get-invoice-online-url.mjs b/components/xero_accounting_api/actions/get-invoice-online-url/get-invoice-online-url.mjs index 668291fc3680c..1430be81736dc 100644 --- a/components/xero_accounting_api/actions/get-invoice-online-url/get-invoice-online-url.mjs +++ b/components/xero_accounting_api/actions/get-invoice-online-url/get-invoice-online-url.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-get-invoice-online-url", name: "Get Sales Invoice Online URL", description: "Retrieves the online sales invoice URL.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-invoice/get-invoice.mjs b/components/xero_accounting_api/actions/get-invoice/get-invoice.mjs index 16b18f442039f..085d69f6e082c 100644 --- a/components/xero_accounting_api/actions/get-invoice/get-invoice.mjs +++ b/components/xero_accounting_api/actions/get-invoice/get-invoice.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-get-invoice", name: "Get Invoice", description: "Gets details of an invoice.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-item/get-item.mjs b/components/xero_accounting_api/actions/get-item/get-item.mjs index ca24776b45ee6..f72cc21a6903b 100644 --- a/components/xero_accounting_api/actions/get-item/get-item.mjs +++ b/components/xero_accounting_api/actions/get-item/get-item.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-get-item", name: "Get Item", description: "Gets details of an item.", - version: "0.2.4", + version: "0.2.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-tenant-connections/get-tenant-connections.mjs b/components/xero_accounting_api/actions/get-tenant-connections/get-tenant-connections.mjs index 8f4bc3e047ddd..42ebaaf2cc31f 100644 --- a/components/xero_accounting_api/actions/get-tenant-connections/get-tenant-connections.mjs +++ b/components/xero_accounting_api/actions/get-tenant-connections/get-tenant-connections.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-get-tenant-connections", name: "Get Tenant Connections", description: "Gets the tenants connections the user is authorized to access", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/get-tracking-category/get-tracking-category.mjs b/components/xero_accounting_api/actions/get-tracking-category/get-tracking-category.mjs index eb0b1e642ac84..fe83525ce24b9 100644 --- a/components/xero_accounting_api/actions/get-tracking-category/get-tracking-category.mjs +++ b/components/xero_accounting_api/actions/get-tracking-category/get-tracking-category.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-get-tracking-category", name: "Get tracking category", description: "Get information from a tracking category by ID [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#get-trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/list-contacts/list-contacts.mjs b/components/xero_accounting_api/actions/list-contacts/list-contacts.mjs index 8f18bd84e476a..f3febfe87fe88 100644 --- a/components/xero_accounting_api/actions/list-contacts/list-contacts.mjs +++ b/components/xero_accounting_api/actions/list-contacts/list-contacts.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-list-contacts", name: "List Contacts", description: "Lists information from contacts in the given tenant id as per filter parameters.", - version: "0.2.2", + version: "0.2.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs b/components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs index 0184efcae61c9..ae2862bfa1ad6 100644 --- a/components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs +++ b/components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-list-credit-notes", name: "List Credit Notes", description: "Lists information from credit notes in the given tenant id as per filter parameters.", - version: "0.2.2", + version: "0.2.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/list-invoices/list-invoices.mjs b/components/xero_accounting_api/actions/list-invoices/list-invoices.mjs index 2f910c57b4904..38d8f6fc1f9f9 100644 --- a/components/xero_accounting_api/actions/list-invoices/list-invoices.mjs +++ b/components/xero_accounting_api/actions/list-invoices/list-invoices.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-list-invoices", name: "List Invoices", description: "Lists information from invoices in the given tenant id as per filter parameters.", - version: "0.3.2", + version: "0.3.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs b/components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs index a79c720296f11..e6e5f98b84e1c 100644 --- a/components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs +++ b/components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-list-manual-journals", name: "List Manual Journals", description: "Lists information from manual journals in the given tenant id as per filter parameters.", - version: "0.2.2", + version: "0.2.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/list-tracking-categories/list-tracking-categories.mjs b/components/xero_accounting_api/actions/list-tracking-categories/list-tracking-categories.mjs index e59dd19303eda..a9397630418a2 100644 --- a/components/xero_accounting_api/actions/list-tracking-categories/list-tracking-categories.mjs +++ b/components/xero_accounting_api/actions/list-tracking-categories/list-tracking-categories.mjs @@ -4,7 +4,7 @@ export default { key: "xero_accounting_api-list-tracking-categories", name: "List tracking categories", description: "Lists information from tracking categories [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs b/components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs index 494543a0c8935..f29660fb07e3a 100644 --- a/components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs +++ b/components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-make-an-api-call", name: "Make API Call", description: "Makes an aribitrary call to Xero Accounting API.", - version: "0.1.4", + version: "0.1.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/update-tracking-category-option/update-tracking-category-option.mjs b/components/xero_accounting_api/actions/update-tracking-category-option/update-tracking-category-option.mjs index 542d3fb96b2bd..fb4e15786f10c 100644 --- a/components/xero_accounting_api/actions/update-tracking-category-option/update-tracking-category-option.mjs +++ b/components/xero_accounting_api/actions/update-tracking-category-option/update-tracking-category-option.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-update-tracking-category-option", name: "Update tracking category option", description: "Update a tracking category by ID [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#post-trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/update-tracking-category/update-tracking-category.mjs b/components/xero_accounting_api/actions/update-tracking-category/update-tracking-category.mjs index 05a695c382d97..5c2cd476c8009 100644 --- a/components/xero_accounting_api/actions/update-tracking-category/update-tracking-category.mjs +++ b/components/xero_accounting_api/actions/update-tracking-category/update-tracking-category.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-update-tracking-category", name: "Update tracking category", description: "Update a tracking category by ID [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#post-trackingcategories).", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/upload-file/upload-file.mjs b/components/xero_accounting_api/actions/upload-file/upload-file.mjs index c9bbcda185636..1548dc9372cd2 100644 --- a/components/xero_accounting_api/actions/upload-file/upload-file.mjs +++ b/components/xero_accounting_api/actions/upload-file/upload-file.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-upload-file", name: "Upload File", description: "Uploads a file to the specified document. [See the documentation](https://developer.xero.com/documentation/api/accounting/invoices#upload-attachment)", - version: "1.0.5", + version: "1.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/xero-accounting-create-employee/xero-accounting-create-employee.mjs b/components/xero_accounting_api/actions/xero-accounting-create-employee/xero-accounting-create-employee.mjs index fa60b3a1a410b..990a254e14f02 100644 --- a/components/xero_accounting_api/actions/xero-accounting-create-employee/xero-accounting-create-employee.mjs +++ b/components/xero_accounting_api/actions/xero-accounting-create-employee/xero-accounting-create-employee.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-xero-accounting-create-employee", name: "Create Employee", description: "Creates a new employee.", - version: "0.3.4", + version: "0.3.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/actions/xero-accounting-create-or-update-contact/xero-accounting-create-or-update-contact.mjs b/components/xero_accounting_api/actions/xero-accounting-create-or-update-contact/xero-accounting-create-or-update-contact.mjs index a4b55c0f21905..6599fa953b57b 100644 --- a/components/xero_accounting_api/actions/xero-accounting-create-or-update-contact/xero-accounting-create-or-update-contact.mjs +++ b/components/xero_accounting_api/actions/xero-accounting-create-or-update-contact/xero-accounting-create-or-update-contact.mjs @@ -1,11 +1,11 @@ -import { parseObject } from "../../common/util.mjs"; +import { parseObjectArray } from "../../common/util.mjs"; import xeroAccountingApi from "../../xero_accounting_api.app.mjs"; export default { key: "xero_accounting_api-xero-accounting-create-or-update-contact", name: "Create or Update Contact", description: "Creates a new contact or updates if the contact exists.", - version: "0.1.5", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -85,8 +85,8 @@ export default { }, contactPersons: { label: "Contact Persons", - type: "any", - description: "See [contact persons](https://developer.xero.com/documentation/api/contacts#contact-persons)", + type: "string[]", + description: "Array of contact person objects. Each item must be a JSON string, e.g. `{\"FirstName\":\"John\",\"LastName\":\"Smith\",\"EmailAddress\":\"john.smith@example.com\",\"IncludeInEmails\":true}`. See [contact persons](https://developer.xero.com/documentation/api/contacts#contact-persons)", optional: true, }, bankAccountDetails: { @@ -115,14 +115,14 @@ export default { }, addresses: { label: "Addresses", - type: "any", - description: "Store certain address types for a contact - see address types", + type: "string[]", + description: "Array of address objects. Each item must be a JSON string, e.g. `{\"AddressType\":\"STREET\",\"AddressLine1\":\"123 Main St\",\"City\":\"Auckland\",\"PostalCode\":\"1010\",\"Country\":\"NZ\"}`. See [address types](https://developer.xero.com/documentation/api/accounting/types#addresses)", optional: true, }, phones: { label: "Phones", - type: "any", - description: "Store certain phone types for a contact - see phone types", + type: "string[]", + description: "Array of phone objects. Each item must be a JSON string, e.g. `{\"PhoneType\":\"MOBILE\",\"PhoneNumber\":\"555 1234\",\"PhoneAreaCode\":\"415\",\"PhoneCountryCode\":\"1\"}`. See [phone types](https://developer.xero.com/documentation/api/accounting/types#phones)", optional: true, }, isSupplier: { @@ -230,13 +230,13 @@ export default { LastName: this.lastName, EmailAddress: this.emailAddress, SkypeUserName: this.skypeUserName, - ContactPersons: parseObject(this.contactPersons), + ContactPersons: parseObjectArray(this.contactPersons, "Contact Persons"), BankAccountDetails: this.bankAccountDetails, TaxNumber: this.taxNumber, AccountsReceivableTaxType: this.accountReceivableTaxType, AccountsPayableTaxType: this.accountPayableType, - Addresses: parseObject(this.addresses), - Phones: parseObject(this.phones), + Addresses: parseObjectArray(this.addresses, "Addresses"), + Phones: parseObjectArray(this.phones, "Phones"), IsSupplier: this.isSupplier, IsCustomer: this.isCustomer, DefaultCurrency: this.defaultCurrency, diff --git a/components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs b/components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs index c16f26a07f413..8585d05a2c436 100644 --- a/components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs +++ b/components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs @@ -1,12 +1,12 @@ import { ConfigurationError } from "@pipedream/platform"; -import { parseObject } from "../../common/util.mjs"; +import { parseObjectArray } from "../../common/util.mjs"; import xeroAccountingApi from "../../xero_accounting_api.app.mjs"; export default { key: "xero_accounting_api-xero-accounting-update-contact", name: "Update Contact", description: "Updates a contact given its identifier.", - version: "0.1.5", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -86,8 +86,8 @@ export default { }, contactPersons: { label: "Contact Persons", - type: "any", - description: "See [contact persons](https://developer.xero.com/documentation/api/contacts#contact-persons)", + type: "string[]", + description: "Array of contact person objects. Each item must be a JSON string, e.g. `{\"FirstName\":\"John\",\"LastName\":\"Smith\",\"EmailAddress\":\"john.smith@example.com\",\"IncludeInEmails\":true}`. See [contact persons](https://developer.xero.com/documentation/api/contacts#contact-persons)", optional: true, }, bankAccountDetails: { @@ -116,14 +116,14 @@ export default { }, addresses: { label: "Addresses", - type: "any", - description: "Store certain address types for a contact - see address types", + type: "string[]", + description: "Array of address objects. Each item must be a JSON string, e.g. `{\"AddressType\":\"STREET\",\"AddressLine1\":\"123 Main St\",\"City\":\"Auckland\",\"PostalCode\":\"1010\",\"Country\":\"NZ\"}`. See [address types](https://developer.xero.com/documentation/api/accounting/types#addresses)", optional: true, }, phones: { label: "Phones", - type: "any", - description: "Store certain phone types for a contact - see phone types", + type: "string[]", + description: "Array of phone objects. Each item must be a JSON string, e.g. `{\"PhoneType\":\"MOBILE\",\"PhoneNumber\":\"555 1234\",\"PhoneAreaCode\":\"415\",\"PhoneCountryCode\":\"1\"}`. See [phone types](https://developer.xero.com/documentation/api/accounting/types#phones)", optional: true, }, isSupplier: { @@ -236,13 +236,13 @@ export default { LastName: this.lastName, EmailAddress: this.emailAddress, SkypeUserName: this.skypeUserName, - ContactPersons: parseObject(this.contactPersons), + ContactPersons: parseObjectArray(this.contactPersons, "Contact Persons"), BankAccountDetails: this.bankAccountDetails, TaxNumber: this.taxNumber, AccountsReceivableTaxType: this.accountReceivableTaxType, AccountsPayableTaxType: this.accountPayableType, - Addresses: parseObject(this.addresses), - Phones: parseObject(this.phones), + Addresses: parseObjectArray(this.addresses, "Addresses"), + Phones: parseObjectArray(this.phones, "Phones"), IsSupplier: this.isSupplier, IsCustomer: this.isCustomer, DefaultCurrency: this.defaultCurrency, diff --git a/components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs b/components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs index ce9a2ea9f4c18..b15f34c1af609 100644 --- a/components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs +++ b/components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-xero-create-purchase-bill", name: "Create Purchase Bill", description: "Creates a new purchase bill.", - version: "0.1.4", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -40,8 +40,8 @@ export default { }, lineItems: { label: "Line Items", - type: "any", - description: "See [LineItems](https://developer.xero.com/documentation/api/invoices#LineItemsPOST). The LineItems collection can contain any number of individual LineItem sub-elements. At least * **one** * is required to create a complete Invoice.", + type: "string[]", + description: "Array of line item objects; at least **one** is required to create a complete invoice. Each item must be a JSON string, e.g. `{\"Description\":\"Consulting\",\"Quantity\":2,\"UnitAmount\":100,\"AccountCode\":\"400\"}`. See [LineItems](https://developer.xero.com/documentation/api/invoices#LineItemsPOST).", }, date: { label: "Date", diff --git a/components/xero_accounting_api/actions/xero-create-sales-invoice/xero-create-sales-invoice.mjs b/components/xero_accounting_api/actions/xero-create-sales-invoice/xero-create-sales-invoice.mjs index 7b7dee18d5d1f..5b823f4fdf685 100644 --- a/components/xero_accounting_api/actions/xero-create-sales-invoice/xero-create-sales-invoice.mjs +++ b/components/xero_accounting_api/actions/xero-create-sales-invoice/xero-create-sales-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-xero-create-sales-invoice", name: "Create Sales Invoice", description: "Creates a new sales invoice. [See the documentation](https://developer.xero.com/documentation/api/invoices#post)", - version: "0.3.5", + version: "0.3.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/xero_accounting_api/common/util.mjs b/components/xero_accounting_api/common/util.mjs index 5e261f7cb9ca5..c405b36b4a09b 100644 --- a/components/xero_accounting_api/common/util.mjs +++ b/components/xero_accounting_api/common/util.mjs @@ -19,26 +19,50 @@ const removeNullEntries = (obj) => : acc; }, {}); -const formatLineItems = (lineItems) => { - if (!lineItems) { - return []; +// For props declared as `string[]` whose entries must each be a JSON object. Unlike +// `parseObject`, malformed JSON is reported as a `ConfigurationError` instead of a bare +// `SyntaxError`, and a non-object entry is rejected instead of being forwarded to Xero as +// a string. An entry holding a whole JSON array is flattened rather than rejected — some +// prop descriptions show their example wrapped in `[ ]`, so that mistake is common. +const parseObjectArray = (values, fieldName) => { + if (!values) { + return undefined; } - if (typeof (lineItems) === "string") { - return JSON.parse(lineItems); - } - let parsedLineItems = []; - for (let lineItem of lineItems) { - if (!lineItem) { - continue; - } - if (typeof (lineItem) === "string") { - lineItem = JSON.parse(lineItem); - } - parsedLineItems.push(lineItem); - } - return parsedLineItems; + + const entries = Array.isArray(values) + ? values + : [ + values, + ]; + + const parsedEntries = entries + .filter((entry) => entry !== undefined && entry !== null && entry !== "") + .flatMap((entry) => { + if (typeof entry !== "string") { + return entry; + } + try { + return JSON.parse(entry); + } catch { + throw new ConfigurationError(`${fieldName}: \`${entry}\` is not valid JSON. Provide one JSON object per entry.`); + } + }) + .map((parsed) => { + if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { + throw new ConfigurationError(`${fieldName}: \`${JSON.stringify(parsed)}\` is not a JSON object. Provide one JSON object per entry.`); + } + return parsed; + }); + + // Left as `undefined` rather than `[]` so an unset prop stays absent from the request + // body — Xero treats an empty collection as "remove everything in it". + return parsedEntries.length + ? parsedEntries + : undefined; }; +const formatLineItems = (lineItems) => parseObjectArray(lineItems, "Line Items") ?? []; + const deleteKeys = (mainObject, keys = []) => { return Object.keys(mainObject) .filter((key) => !keys.includes(key)) @@ -141,6 +165,7 @@ export { formatQueryString, isValidDate, parseObject, + parseObjectArray, removeNullEntries, }; diff --git a/components/xero_accounting_api/package.json b/components/xero_accounting_api/package.json index 09f6cee5a89c5..7e231728bf82c 100644 --- a/components/xero_accounting_api/package.json +++ b/components/xero_accounting_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/xero_accounting_api", - "version": "0.5.3", + "version": "1.0.0", "description": "Pipedream Xero Components", "main": "xero_accounting_api.app.mjs", "keywords": [ diff --git a/components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs b/components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs index 6703eaaba8442..b8baf5336f209 100644 --- a/components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs +++ b/components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-new-or-updated-quote", name: "New or Updated Quote", description: "Emit new event each time a quote is added or updated. [See the documentation](https://developer.xero.com/documentation/api/accounting/quotes)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", async run() { diff --git a/components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs b/components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs index 5d1fcae814f45..707b708d5d812 100644 --- a/components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs +++ b/components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-new-updated-contact", name: "New or Updated Contact", description: "Emit new notifications when you create a new or update existing contact", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", async run() { diff --git a/components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs b/components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs index 5e6e09c04acd2..e56ce248535e3 100644 --- a/components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs +++ b/components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "xero_accounting_api-new-updated-invoice", name: "New or updated invoice", description: "Emit new notifications when you create a new or update existing invoice", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", async run() { diff --git a/components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs b/components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs index e42445b59fe17..b668c211aee20 100644 --- a/components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs +++ b/components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs @@ -5,7 +5,7 @@ export default { key: "xero_accounting_api-webhook-event-received", name: "Webhook Event Received (Instant)", description: "Emit new event for each incoming webhook notification. To create a Xero Webhook, please follow [the instructions here](https://developer.xero.com/documentation/guides/webhooks/creating-webhooks/).", - version: "0.0.3", + version: "0.0.4", type: "source", props: { xeroAccountingApi, diff --git a/components/zoom/actions/add-meeting-registrant/add-meeting-registrant.mjs b/components/zoom/actions/add-meeting-registrant/add-meeting-registrant.mjs index 4f440e5e21bcb..f3bc74d689970 100644 --- a/components/zoom/actions/add-meeting-registrant/add-meeting-registrant.mjs +++ b/components/zoom/actions/add-meeting-registrant/add-meeting-registrant.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-add-meeting-registrant", name: "Add Meeting Registrant", description: "Registers a participant or multiple participants for a meeting. [See the documentation](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingRegistrantCreate)", - version: "0.3.12", + version: "0.3.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/add-webinar-registrant/add-webinar-registrant.mjs b/components/zoom/actions/add-webinar-registrant/add-webinar-registrant.mjs index a615ca517d8d5..7b682705795a1 100644 --- a/components/zoom/actions/add-webinar-registrant/add-webinar-registrant.mjs +++ b/components/zoom/actions/add-webinar-registrant/add-webinar-registrant.mjs @@ -4,7 +4,7 @@ export default { key: "zoom-add-webinar-registrant", name: "Add Webinar Registrant", description: "Registers a participant for a webinar. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarregistrantcreate).", - version: "0.3.12", + version: "0.3.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/create-meeting/create-meeting.mjs b/components/zoom/actions/create-meeting/create-meeting.mjs index 523e745c4e586..98f10ecfec03f 100644 --- a/components/zoom/actions/create-meeting/create-meeting.mjs +++ b/components/zoom/actions/create-meeting/create-meeting.mjs @@ -1,11 +1,12 @@ // legacy_hash_id: a_l0i2Mn import { axios } from "@pipedream/platform"; +import utils from "../../common/utils.mjs"; export default { key: "zoom-create-meeting", name: "Create Meeting", description: "Creates a meeting for a user. A maximum of 100 meetings can be created for a user in a day.", - version: "0.1.6", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -53,8 +54,9 @@ export default { optional: true, }, tracking_fields: { - type: "any", - description: "Tracking fields.", + type: "string[]", + label: "Tracking Fields", + description: "Tracking fields to attach, one JSON string per entry, e.g. `{\"field\":\"Department\",\"value\":\"Sales\"}`.", optional: true, }, recurrence: { @@ -81,21 +83,19 @@ export default { timezone: this.timezone, password: this.password, agenda: this.agenda, - tracking_fields: typeof this.tracking_fields == "undefined" - ? this.tracking_fields - : JSON.parse(this.tracking_fields), - recurrence: typeof this.recurrence == "undefined" - ? this.recurrence - : JSON.parse(this.recurrence), - settings: typeof this.settings == "undefined" - ? this.settings - : JSON.parse(this.settings), + tracking_fields: utils.parseJsonArray(this.tracking_fields, "Tracking Fields"), + recurrence: utils.parseJson(this.recurrence, "Recurrence"), + settings: utils.parseJson(this.settings, "Settings"), }, headers: { "Authorization": `Bearer ${this.zoom.$auth.oauth_access_token}`, "Content-Type": "application/json", }, }; - return await axios($, config); + const response = await axios($, config); + + $.export("$summary", `Successfully created meeting ${response.id}`); + + return response; }, }; diff --git a/components/zoom/actions/delete-meeting/delete-meeting.mjs b/components/zoom/actions/delete-meeting/delete-meeting.mjs index de860c1ea1795..52176e3da7c4b 100644 --- a/components/zoom/actions/delete-meeting/delete-meeting.mjs +++ b/components/zoom/actions/delete-meeting/delete-meeting.mjs @@ -4,7 +4,7 @@ export default { key: "zoom-delete-meeting", name: "Delete Meeting", description: "Delete a meeting. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/meetings/delete/meetings/{meetingId})", - version: "0.0.7", + version: "0.0.8", type: "action", annotations: { destructiveHint: true, diff --git a/components/zoom/actions/get-current-user/get-current-user.mjs b/components/zoom/actions/get-current-user/get-current-user.mjs index d66f8476a48ec..f4e5fc82ea9f2 100644 --- a/components/zoom/actions/get-current-user/get-current-user.mjs +++ b/components/zoom/actions/get-current-user/get-current-user.mjs @@ -4,7 +4,7 @@ export default { key: "zoom-get-current-user", name: "Get Current User", description: "Returns the authenticated Zoom user's ID, name, email, account ID, and timezone. Call this first when the user says 'my meetings', 'my recordings', or needs their Zoom identity. Use `id` with **Create Meeting**, `account_id` to scope queries, and `email` to match participants in **List Past Meeting Participants**. [See the documentation](https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}).", - version: "0.0.2", + version: "0.0.3", type: "action", annotations: { destructiveHint: false, diff --git a/components/zoom/actions/get-meeting-details/get-meeting-details.mjs b/components/zoom/actions/get-meeting-details/get-meeting-details.mjs index 901dbe9cd4cb5..6ace7cff8027d 100644 --- a/components/zoom/actions/get-meeting-details/get-meeting-details.mjs +++ b/components/zoom/actions/get-meeting-details/get-meeting-details.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-get-meeting-details", name: "Get Meeting Details", description: "Retrieves the details of a meeting.", - version: "0.3.8", + version: "0.3.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/get-meeting-recordings/get-meeting-recordings.mjs b/components/zoom/actions/get-meeting-recordings/get-meeting-recordings.mjs index 9dc4276d556d0..417a3b4cc8287 100644 --- a/components/zoom/actions/get-meeting-recordings/get-meeting-recordings.mjs +++ b/components/zoom/actions/get-meeting-recordings/get-meeting-recordings.mjs @@ -13,7 +13,7 @@ export default { + " `{ id: \"a1b2c3d4-5e6f-7890-abcd-ef1234567890\", file_type: \"MP4\", recording_type: \"shared_screen_with_speaker_view\", file_size: 148203910, status: \"completed\" }`." + " A meeting with no cloud recordings returns an empty `recording_files` array rather than an error, so check the array's length before reporting a failure." + " [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/cloud-recording/get/meetings/{meetingId}/recordings)", - version: "0.1.1", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/get-meeting-summary/get-meeting-summary.mjs b/components/zoom/actions/get-meeting-summary/get-meeting-summary.mjs index f4bb1632763c0..fa269139194f6 100644 --- a/components/zoom/actions/get-meeting-summary/get-meeting-summary.mjs +++ b/components/zoom/actions/get-meeting-summary/get-meeting-summary.mjs @@ -4,7 +4,7 @@ export default { key: "zoom-get-meeting-summary", name: "Get Meeting Summary", description: "Retrieve the summary of a meeting or webinar. [See the documentation](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/Getameetingsummary)", - version: "0.0.2", + version: "0.0.3", type: "action", annotations: { destructiveHint: false, diff --git a/components/zoom/actions/get-meeting-transcript/get-meeting-transcript.mjs b/components/zoom/actions/get-meeting-transcript/get-meeting-transcript.mjs index 83b3159dc609e..40f2d2ef13c09 100644 --- a/components/zoom/actions/get-meeting-transcript/get-meeting-transcript.mjs +++ b/components/zoom/actions/get-meeting-transcript/get-meeting-transcript.mjs @@ -7,7 +7,7 @@ export default { key: "zoom-get-meeting-transcript", name: "Get Meeting Transcript", description: "Get the transcript of a past meeting. Fetches the VTT file server-side using your OAuth token and returns speaker-attributed plain text alongside the original authenticated URL. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/cloud-recording/get/meetings/{meetingId}/transcript)", - version: "0.1.1", + version: "0.1.2", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/get-webinar-details/get-webinar-details.mjs b/components/zoom/actions/get-webinar-details/get-webinar-details.mjs index 3624ced99b746..0cff8e7b37e53 100644 --- a/components/zoom/actions/get-webinar-details/get-webinar-details.mjs +++ b/components/zoom/actions/get-webinar-details/get-webinar-details.mjs @@ -4,7 +4,7 @@ export default { key: "zoom-get-webinar-details", name: "Get Webinar Details", description: "Gets details of a scheduled webinar. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/webinar).", - version: "0.3.12", + version: "0.3.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/list-all-recordings/list-all-recordings.mjs b/components/zoom/actions/list-all-recordings/list-all-recordings.mjs index 001146a9c533f..c98d14cb4e595 100644 --- a/components/zoom/actions/list-all-recordings/list-all-recordings.mjs +++ b/components/zoom/actions/list-all-recordings/list-all-recordings.mjs @@ -5,7 +5,7 @@ export default { key: "zoom-list-all-recordings", name: "List All Recordings", description: "List all cloud recordings for a user. Returns recording metadata only — to obtain a download link for a given recording, use **Get Recording Download Link**. [See the documentation](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/recordingsList)", - version: "0.0.2", + version: "0.0.3", type: "action", annotations: { destructiveHint: false, diff --git a/components/zoom/actions/list-call-recordings/list-call-recordings.mjs b/components/zoom/actions/list-call-recordings/list-call-recordings.mjs index 6d00d81dca196..92ac2947bb40a 100644 --- a/components/zoom/actions/list-call-recordings/list-call-recordings.mjs +++ b/components/zoom/actions/list-call-recordings/list-call-recordings.mjs @@ -4,7 +4,7 @@ export default { name: "List Call Recordings", description: "Get your account's call recordings. [See the documentation](https://developers.zoom.us/docs/api/rest/reference/phone/methods/#operation/getPhoneRecordings)", key: "zoom-list-call-recordings", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/list-meetings/list-meetings.mjs b/components/zoom/actions/list-meetings/list-meetings.mjs index 0e6762a71c3e6..7986dc9c7fb75 100644 --- a/components/zoom/actions/list-meetings/list-meetings.mjs +++ b/components/zoom/actions/list-meetings/list-meetings.mjs @@ -5,7 +5,7 @@ export default { name: "List Meetings", description: "List meetings for a user. [See the documentation](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings)", key: "zoom-list-meetings", - version: "0.0.6", + version: "0.0.7", type: "action", annotations: { destructiveHint: false, diff --git a/components/zoom/actions/list-past-meeting-participants/list-past-meeting-participants.mjs b/components/zoom/actions/list-past-meeting-participants/list-past-meeting-participants.mjs index 60b9d8660beff..c74f125525ee4 100644 --- a/components/zoom/actions/list-past-meeting-participants/list-past-meeting-participants.mjs +++ b/components/zoom/actions/list-past-meeting-participants/list-past-meeting-participants.mjs @@ -5,7 +5,7 @@ export default { key: "zoom-list-past-meeting-participants", name: "List Past Meeting Participants", description: "Retrieve information on participants from a past meeting. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/pastMeetingParticipants).", - version: "0.2.12", + version: "0.2.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/list-past-webinar-qa/list-past-webinar-qa.mjs b/components/zoom/actions/list-past-webinar-qa/list-past-webinar-qa.mjs index e1586fccf1205..ef28be825c3ba 100644 --- a/components/zoom/actions/list-past-webinar-qa/list-past-webinar-qa.mjs +++ b/components/zoom/actions/list-past-webinar-qa/list-past-webinar-qa.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-list-past-webinar-qa", name: "List Past Webinar Q&A", description: "The feature for Webinars allows attendees to ask questions during the Webinar and for the panelists, co-hosts and host to answer their questions. Use this API to list Q&A of a specific Webinar.", - version: "0.1.8", + version: "0.1.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/list-user-call-logs/list-user-call-logs.mjs b/components/zoom/actions/list-user-call-logs/list-user-call-logs.mjs index fd5c370202719..fa3592b0ec5a1 100644 --- a/components/zoom/actions/list-user-call-logs/list-user-call-logs.mjs +++ b/components/zoom/actions/list-user-call-logs/list-user-call-logs.mjs @@ -4,7 +4,7 @@ export default { name: "List User's Call Logs", description: "Gets a user's Zoom phone call logs. [See the documentation](https://developers.zoom.us/docs/zoom-phone/apis/#operation/phoneUserCallLogs)", key: "zoom-list-user-call-logs", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/list-webinar-participants-report/list-webinar-participants-report.mjs b/components/zoom/actions/list-webinar-participants-report/list-webinar-participants-report.mjs index c528e9e07982f..ecf5543b8bfde 100644 --- a/components/zoom/actions/list-webinar-participants-report/list-webinar-participants-report.mjs +++ b/components/zoom/actions/list-webinar-participants-report/list-webinar-participants-report.mjs @@ -5,7 +5,7 @@ export default { key: "zoom-list-webinar-participants-report", name: "List Webinar Participants Report", description: "Retrieves detailed report on each webinar attendee. You can get webinar participant reports for the last 6 months. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/reportWebinarParticipants).", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoom/actions/update-meeting/update-meeting.mjs b/components/zoom/actions/update-meeting/update-meeting.mjs index db39fedea0f85..5623278b935f7 100644 --- a/components/zoom/actions/update-meeting/update-meeting.mjs +++ b/components/zoom/actions/update-meeting/update-meeting.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-update-meeting", name: "Update Meeting", description: "Updates an existing Zoom meeting", - version: "0.1.8", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -59,8 +59,9 @@ export default { optional: true, }, tracking_fields: { - type: "any", - description: "Tracking fields.", + type: "string[]", + label: "Tracking Fields", + description: "Tracking fields to attach, one JSON string per entry, e.g. `{\"field\":\"Department\",\"value\":\"Sales\"}`.", optional: true, }, recurrence: { @@ -87,21 +88,19 @@ export default { timezone: this.timezone, password: this.password, agenda: this.agenda, - tracking_fields: typeof this.tracking_fields == "undefined" - ? this.tracking_fields - : JSON.parse(this.tracking_fields), - recurrence: typeof this.recurrence == "undefined" - ? this.recurrence - : JSON.parse(this.recurrence), - settings: typeof this.settings == "undefined" - ? this.settings - : JSON.parse(this.settings), + tracking_fields: utils.parseJsonArray(this.tracking_fields, "Tracking Fields"), + recurrence: utils.parseJson(this.recurrence, "Recurrence"), + settings: utils.parseJson(this.settings, "Settings"), }, headers: { "Authorization": `Bearer ${this.zoom.$auth.oauth_access_token}`, "Content-Type": "application/json", }, }; - return await axios($, config); + const response = await axios($, config); + + $.export("$summary", `Successfully updated meeting ${this.meetingId}`); + + return response; }, }; diff --git a/components/zoom/actions/update-webinar/update-webinar.mjs b/components/zoom/actions/update-webinar/update-webinar.mjs index f6b8c94d59c0a..94ede0ac57737 100644 --- a/components/zoom/actions/update-webinar/update-webinar.mjs +++ b/components/zoom/actions/update-webinar/update-webinar.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-update-webinar", name: "Update Webinar", description: "Update a webinar's topic, start time, or other settings", - version: "0.1.8", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -59,8 +59,9 @@ export default { optional: true, }, tracking_fields: { - type: "any", - description: "Tracking fields.", + type: "string[]", + label: "Tracking Fields", + description: "Tracking fields to attach, one JSON string per entry, e.g. `{\"field\":\"Department\",\"value\":\"Sales\"}`.", optional: true, }, recurrence: { @@ -87,21 +88,19 @@ export default { timezone: this.timezone, password: this.password, agenda: this.agenda, - tracking_fields: typeof this.tracking_fields == "undefined" - ? this.tracking_fields - : JSON.parse(this.tracking_fields), - recurrence: typeof this.recurrence == "undefined" - ? this.recurrence - : JSON.parse(this.recurrence), - settings: typeof this.settings == "undefined" - ? this.settings - : JSON.parse(this.settings), + tracking_fields: utils.parseJsonArray(this.tracking_fields, "Tracking Fields"), + recurrence: utils.parseJson(this.recurrence, "Recurrence"), + settings: utils.parseJson(this.settings, "Settings"), }, headers: { "Authorization": `Bearer ${this.zoom.$auth.oauth_access_token}`, "Content-Type": "application/json", }, }; - return await axios($, config); + const response = await axios($, config); + + $.export("$summary", `Successfully updated webinar ${this.webinarID}`); + + return response; }, }; diff --git a/components/zoom/common/utils.mjs b/components/zoom/common/utils.mjs index 351e1267704b7..6e46311d566b0 100644 --- a/components/zoom/common/utils.mjs +++ b/components/zoom/common/utils.mjs @@ -66,10 +66,29 @@ function parseArray(value) { } } +function parseJson(value, fieldName) { + if (typeof value !== "string") { + return value; + } + try { + return JSON.parse(value); + } catch { + throw new ConfigurationError(`${fieldName}: \`${value}\` is not valid JSON`); + } +} + +// Parses a `string[]` prop whose entries are JSON-serialized objects, leaving +// already-parsed objects untouched. +function parseJsonArray(values, fieldName) { + return values?.map((value) => parseJson(value, fieldName)); +} + export default { streamIterator, summaryEnd, doubleEncode, selectRecordingFile, parseArray, + parseJson, + parseJsonArray, }; diff --git a/components/zoom/package.json b/components/zoom/package.json index 89cee2fe4430f..ef1a3646fa89b 100644 --- a/components/zoom/package.json +++ b/components/zoom/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zoom", - "version": "0.12.1", + "version": "1.0.0", "description": "Pipedream Zoom Components", "main": "zoom.app.mjs", "keywords": [ diff --git a/components/zoom/sources/custom-event/custom-event.mjs b/components/zoom/sources/custom-event/custom-event.mjs index 96f2fe9867907..167c39ac8ddfd 100644 --- a/components/zoom/sources/custom-event/custom-event.mjs +++ b/components/zoom/sources/custom-event/custom-event.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-custom-event", name: "Custom Events (Instant)", description: "Emit new events tied to your Zoom user or resources you own", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/meeting-created/meeting-created.mjs b/components/zoom/sources/meeting-created/meeting-created.mjs index f6620325be744..4e45570691d72 100644 --- a/components/zoom/sources/meeting-created/meeting-created.mjs +++ b/components/zoom/sources/meeting-created/meeting-created.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-meeting-created", name: "Meeting Created (Instant)", description: "Emit new event each time a meeting is created where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/meeting-deleted/meeting-deleted.mjs b/components/zoom/sources/meeting-deleted/meeting-deleted.mjs index 074de91691913..abe6fc04acb9e 100644 --- a/components/zoom/sources/meeting-deleted/meeting-deleted.mjs +++ b/components/zoom/sources/meeting-deleted/meeting-deleted.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-meeting-deleted", name: "Meeting Deleted (Instant)", description: "Emit new event each time a meeting is deleted where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/meeting-ended/meeting-ended.mjs b/components/zoom/sources/meeting-ended/meeting-ended.mjs index 1966170928b15..220a28b3daa04 100644 --- a/components/zoom/sources/meeting-ended/meeting-ended.mjs +++ b/components/zoom/sources/meeting-ended/meeting-ended.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-meeting-ended", name: "Meeting Ended (Instant)", description: "Emit new event each time a meeting ends where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/meeting-started/meeting-started.mjs b/components/zoom/sources/meeting-started/meeting-started.mjs index dba2ab353f7e5..c18517927b2fd 100644 --- a/components/zoom/sources/meeting-started/meeting-started.mjs +++ b/components/zoom/sources/meeting-started/meeting-started.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-meeting-started", name: "Meeting Started (Instant)", description: "Emit new event each time a meeting starts where you're the host", - version: "0.1.12", + version: "0.1.13", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/meeting-updated/meeting-updated.mjs b/components/zoom/sources/meeting-updated/meeting-updated.mjs index 6dbb62747c8c1..d1522047c4761 100644 --- a/components/zoom/sources/meeting-updated/meeting-updated.mjs +++ b/components/zoom/sources/meeting-updated/meeting-updated.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-meeting-updated", name: "Meeting Updated (Instant)", description: "Emit new event each time a meeting is updated where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/new-recording-transcript-completed/new-recording-transcript-completed.mjs b/components/zoom/sources/new-recording-transcript-completed/new-recording-transcript-completed.mjs index b9658d98d8819..0e34888baab2e 100644 --- a/components/zoom/sources/new-recording-transcript-completed/new-recording-transcript-completed.mjs +++ b/components/zoom/sources/new-recording-transcript-completed/new-recording-transcript-completed.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-new-recording-transcript-completed", name: "New Recording Transcript Completed (Instant)", description: "Emit new event each time a recording transcript is completed", - version: "0.0.9", + version: "0.0.10", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/phone-event/phone-event.mjs b/components/zoom/sources/phone-event/phone-event.mjs index 26ecbe3e21943..649c6555f9676 100644 --- a/components/zoom/sources/phone-event/phone-event.mjs +++ b/components/zoom/sources/phone-event/phone-event.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-phone-event", name: "Zoom Phone Events (Instant)", description: "Emit new Zoom Phone event tied to your Zoom user or resources you own", - version: "0.1.11", + version: "0.1.12", type: "source", props: { ...common.props, diff --git a/components/zoom/sources/recording-completed/recording-completed.mjs b/components/zoom/sources/recording-completed/recording-completed.mjs index 79a115f263572..0a8895a9a73f3 100644 --- a/components/zoom/sources/recording-completed/recording-completed.mjs +++ b/components/zoom/sources/recording-completed/recording-completed.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-recording-completed", name: "Recording Completed (Instant)", description: "Emit new event each time a new recording completes for a meeting or webinar where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/webinar-created/webinar-created.mjs b/components/zoom/sources/webinar-created/webinar-created.mjs index 73d2f472499ec..21c5b3d154f1f 100644 --- a/components/zoom/sources/webinar-created/webinar-created.mjs +++ b/components/zoom/sources/webinar-created/webinar-created.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-webinar-created", name: "Webinar Created (Instant)", description: "Emit new event each time a webinar is created where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/webinar-deleted/webinar-deleted.mjs b/components/zoom/sources/webinar-deleted/webinar-deleted.mjs index 94528047b49d2..3329d4ea2f6ed 100644 --- a/components/zoom/sources/webinar-deleted/webinar-deleted.mjs +++ b/components/zoom/sources/webinar-deleted/webinar-deleted.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-webinar-deleted", name: "Webinar Deleted (Instant)", description: "Emit new event each time a webinar is deleted where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/webinar-ended/webinar-ended.mjs b/components/zoom/sources/webinar-ended/webinar-ended.mjs index 28954715b7ee1..f84c76ff1a589 100644 --- a/components/zoom/sources/webinar-ended/webinar-ended.mjs +++ b/components/zoom/sources/webinar-ended/webinar-ended.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-webinar-ended", name: "Webinar Ended (Instant)", description: "Emit new event each time a webinar ends where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/webinar-started/webinar-started.mjs b/components/zoom/sources/webinar-started/webinar-started.mjs index fef13ba57c702..2d825a26a12b5 100644 --- a/components/zoom/sources/webinar-started/webinar-started.mjs +++ b/components/zoom/sources/webinar-started/webinar-started.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-webinar-started", name: "Webinar Started (Instant)", description: "Emit new event each time a webinar starts where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: { diff --git a/components/zoom/sources/webinar-updated/webinar-updated.mjs b/components/zoom/sources/webinar-updated/webinar-updated.mjs index 129de5eb8ce13..56dc980df3f12 100644 --- a/components/zoom/sources/webinar-updated/webinar-updated.mjs +++ b/components/zoom/sources/webinar-updated/webinar-updated.mjs @@ -6,7 +6,7 @@ export default { key: "zoom-webinar-updated", name: "Webinar Updated (Instant)", description: "Emit new event each time a webinar is updated where you're the host", - version: "0.1.11", + version: "0.1.12", type: "source", dedupe: "unique", props: {