From c29877bbd7063069953929c473a469791f72fbbf Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 27 Feb 2023 11:29:11 -0500 Subject: [PATCH 1/4] new source product-added-to-custom-collection --- components/shopify/shopify.app.mjs | 4 ++ .../product-added-to-custom-collection.mjs | 44 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 components/shopify/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs diff --git a/components/shopify/shopify.app.mjs b/components/shopify/shopify.app.mjs index 863588de565fa..ff90686ff69c5 100644 --- a/components/shopify/shopify.app.mjs +++ b/components/shopify/shopify.app.mjs @@ -674,6 +674,10 @@ export default { this.getSinceParams(sinceId, useCreatedAt, null, params); return this.getObjects("product", params); }, + async getCollects(sinceId) { + const params = this.getSinceParams(sinceId, true); + return this.getObjects("collect", params); + }, async getProduct(productId, params) { return this.resourceAction("product", "get", params, productId); }, diff --git a/components/shopify/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs b/components/shopify/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs new file mode 100644 index 0000000000000..12d37feb079db --- /dev/null +++ b/components/shopify/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs @@ -0,0 +1,44 @@ +import shopify from "../../shopify.app.mjs"; +import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; + +export default { + key: "shopify-product-added-to-custom-collection", + name: "Product Added to Custom Collection", + description: "Emit new event each time a product is added to a custom collection.", + version: "0.0.1", + type: "source", + dedupe: "unique", + props: { + shopify, + db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, + }, + }, + }, + methods: { + _getSinceId() { + return this.db.get("sinceId") || null; + }, + _setSinceId(sinceId) { + this.db.set("sinceId", sinceId); + }, + }, + async run() { + const sinceId = this._getSinceId(); + const results = await this.shopify.getCollects(sinceId); + + for (const collect of results) { + this.$emit(collect, { + id: collect.id, + summary: `Product ${collect.product_id} added to collection ${collect.collection_id}`, + ts: Date.parse(collect.created_at), + }); + } + + if (results.length > 0) + this._setSinceId(results[results.length - 1].id); + }, +}; From f081da82bf0a6331958df704e1d392f3aaedf45a Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 27 Feb 2023 13:00:38 -0500 Subject: [PATCH 2/4] new actions --- .../add-product-to-custom-collection.mjs | 36 +++++++++++ .../create-custom-collection.mjs | 64 +++++++++++++++++++ components/shopify/shopify.app.mjs | 12 ++++ 3 files changed, 112 insertions(+) create mode 100644 components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs create mode 100644 components/shopify/actions/create-custom-collection/create-custom-collection.mjs diff --git a/components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs b/components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs new file mode 100644 index 0000000000000..a60606de21cfb --- /dev/null +++ b/components/shopify/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs @@ -0,0 +1,36 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-add-product-to-custom-collection", + name: "Add Product to Custom Collection", + description: "Adds a product to a custom collection. [See the docs](https://shopify.dev/docs/api/admin-rest/2023-01/resources/collect#post-collects)", + version: "0.0.1", + type: "action", + props: { + shopify, + productId: { + propDefinition: [ + shopify, + "productId", + ], + }, + collectionId: { + propDefinition: [ + shopify, + "collectionId", + ], + description: "ID of the collection that the product will be added to", + optional: false, + }, + }, + async run({ $ }) { + const data = { + product_id: this.productId, + collection_id: this.collectionId, + }; + + const { result } = await this.shopify.createCollect(data); + $.export("$summary", `Added product with ID \`${result.product_id}\` to collection with ID \`${result.collection_id}\``); + return result; + }, +}; diff --git a/components/shopify/actions/create-custom-collection/create-custom-collection.mjs b/components/shopify/actions/create-custom-collection/create-custom-collection.mjs new file mode 100644 index 0000000000000..908d7bccf59da --- /dev/null +++ b/components/shopify/actions/create-custom-collection/create-custom-collection.mjs @@ -0,0 +1,64 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-create-custom-collection", + name: "Create Custom Collection", + description: "Create a new custom collection. [See the docs](https://shopify.dev/docs/api/admin-rest/2023-01/resources/customcollection#post-custom-collections)", + version: "0.0.1", + type: "action", + props: { + shopify, + title: { + propDefinition: [ + shopify, + "title", + ], + description: "The name of the custom collection", + }, + products: { + propDefinition: [ + shopify, + "productId", + ], + type: "string[]", + optional: true, + }, + imageUrl: { + type: "string", + label: "Image URL", + description: "The source URL that specifies the location of the image", + optional: true, + }, + published: { + type: "boolean", + label: "Published", + description: "Whether the custom collection is published to the Online Store channel", + optional: true, + }, + metafields: { + propDefinition: [ + shopify, + "metafields", + ], + }, + }, + async run({ $ }) { + const collects = this.products?.map((product) => ({ + product_id: product, + })) || []; + + const data = { + title: this.title, + collects, + image: { + src: this.imageUrl, + }, + published: this.published, + metafields: this.shopify.parseArrayOfJSONStrings(this.metafields), + }; + + const { result } = await this.shopify.createCustomCollection(data); + $.export("$summary", `Created new custom collection \`${result.title}\` with ID \`${result.id}\``); + return result; + }, +}; diff --git a/components/shopify/shopify.app.mjs b/components/shopify/shopify.app.mjs index ff90686ff69c5..b75a355023c7b 100644 --- a/components/shopify/shopify.app.mjs +++ b/components/shopify/shopify.app.mjs @@ -320,6 +320,12 @@ export default { return this.getDraftOrderOptions(); }, }, + metafields: { + type: "string[]", + label: "Metafields", + description: "An array of objects, each one representing a metafield. If adding a new metafield, the object should contain `key`, `value`, `type`, and `namespace`. Example: `{{ [{ \"key\": \"new\", \"value\": \"newvalue\", \"type\": \"single_line_text_field\", \"namespace\": \"global\" }] }}`. To update an existing metafield, use the `id` and `value`. Example: `{{ [{ \"id\": \"28408051400984\", \"value\": \"updatedvalue\" }] }}`", + optional: true, + }, }, methods: { getShopId() { @@ -678,6 +684,12 @@ export default { const params = this.getSinceParams(sinceId, true); return this.getObjects("collect", params); }, + async createCollect(params) { + return this.resourceAction("collect", "create", params); + }, + async createCustomCollection(params) { + return this.resourceAction("customCollection", "create", params); + }, async getProduct(productId, params) { return this.resourceAction("product", "get", params, productId); }, From 8c5f383e811241f956e0f75918c667488225db17 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 27 Feb 2023 13:06:53 -0500 Subject: [PATCH 3/4] update versions --- components/shopify/actions/add-tags/add-tags.mjs | 2 +- components/shopify/actions/create-customer/create-customer.mjs | 2 +- .../shopify/actions/create-metafield/create-metafield.mjs | 2 +- components/shopify/actions/create-order/create-order.mjs | 2 +- .../actions/create-product-variant/create-product-variant.mjs | 2 +- components/shopify/actions/create-product/create-product.mjs | 2 +- .../actions/create-smart-collection/create-smart-collection.mjs | 2 +- .../shopify/actions/delete-metafield/delete-metafield.mjs | 2 +- components/shopify/actions/get-metafields/get-metafields.mjs | 2 +- .../shopify/actions/search-customers/search-customers.mjs | 2 +- .../actions/search-product-variant/search-product-variant.mjs | 2 +- components/shopify/actions/search-products/search-products.mjs | 2 +- components/shopify/actions/update-customer/update-customer.mjs | 2 +- .../actions/update-inventory-level/update-inventory-level.mjs | 2 +- .../shopify/actions/update-metafield/update-metafield.mjs | 2 +- .../actions/update-product-variant/update-product-variant.mjs | 2 +- components/shopify/actions/update-product/update-product.mjs | 2 +- components/shopify/package.json | 2 +- .../sources/customer-data-request/customer-data-request.mjs | 2 +- .../shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs | 2 +- components/shopify/sources/new-article/new-article.mjs | 2 +- .../shopify/sources/new-cancelled-order/new-cancelled-order.mjs | 2 +- .../sources/new-customer-created/new-customer-created.mjs | 2 +- components/shopify/sources/new-draft-order/new-draft-order.mjs | 2 +- .../shopify/sources/new-event-emitted/new-event-emitted.mjs | 2 +- .../shopify/sources/new-order-created/new-order-created.mjs | 2 +- components/shopify/sources/new-page/new-page.mjs | 2 +- components/shopify/sources/new-paid-order/new-paid-order.mjs | 2 +- .../shopify/sources/new-product-created/new-product-created.mjs | 2 +- components/shopify/sources/new-shipment/new-shipment.mjs | 2 +- .../sources/new-updated-customer/new-updated-customer.mjs | 2 +- .../shopify/sources/new-updated-order/new-updated-order.mjs | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/components/shopify/actions/add-tags/add-tags.mjs b/components/shopify/actions/add-tags/add-tags.mjs index 48eb84ceb354f..d14329c17e0b9 100644 --- a/components/shopify/actions/add-tags/add-tags.mjs +++ b/components/shopify/actions/add-tags/add-tags.mjs @@ -2,7 +2,7 @@ import shopify from "../../shopify.app.mjs"; export default { name: "Add Tags", - version: "0.0.6", + version: "0.0.7", key: "shopify-add-tags", description: "Add tags. [See the docs](https://shopify.dev/api/admin-graphql/2022-07/mutations/tagsadd)", props: { diff --git a/components/shopify/actions/create-customer/create-customer.mjs b/components/shopify/actions/create-customer/create-customer.mjs index 1919c980c6633..0a2e4a28a5b2b 100644 --- a/components/shopify/actions/create-customer/create-customer.mjs +++ b/components/shopify/actions/create-customer/create-customer.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-create-customer", name: "Create Customer", description: "Create a new customer. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[post]/admin/api/2022-01/customers.json)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/create-metafield/create-metafield.mjs b/components/shopify/actions/create-metafield/create-metafield.mjs index ba1d253fe96e1..f7ea0724f923e 100644 --- a/components/shopify/actions/create-metafield/create-metafield.mjs +++ b/components/shopify/actions/create-metafield/create-metafield.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-create-metafield", name: "Create Metafield", description: "Creates a metafield belonging to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#post-blogs-blog-id-metafields)", - version: "0.0.4", + version: "0.0.5", type: "action", props: { ...common.props, diff --git a/components/shopify/actions/create-order/create-order.mjs b/components/shopify/actions/create-order/create-order.mjs index baf88676e148c..4d0ef0c27c1c3 100644 --- a/components/shopify/actions/create-order/create-order.mjs +++ b/components/shopify/actions/create-order/create-order.mjs @@ -8,7 +8,7 @@ export default { For full order object details [see the docs](https://shopify.dev/api/admin-rest/2022-01/resources/order#[post]/admin/api/2022-01/orders.json) or [see examples](https://shopify.dev/api/admin-rest/2022-01/resources/order#[post]/admin/api/#{api_version}/orders.json_examples) `), - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/create-product-variant/create-product-variant.mjs b/components/shopify/actions/create-product-variant/create-product-variant.mjs index 34e58c44591ff..0e578ea8c43c3 100644 --- a/components/shopify/actions/create-product-variant/create-product-variant.mjs +++ b/components/shopify/actions/create-product-variant/create-product-variant.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-create-product-variant", name: "Create Product Variant", description: "Create a new product variant. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#[post]/admin/api/2022-01/products/{product_id}/variants.json)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/create-product/create-product.mjs b/components/shopify/actions/create-product/create-product.mjs index a09788ec77a43..59dc213820d4d 100644 --- a/components/shopify/actions/create-product/create-product.mjs +++ b/components/shopify/actions/create-product/create-product.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-create-product", name: "Create Product", description: "Create a new product. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product#[post]/admin/api/2022-01/products.json)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/create-smart-collection/create-smart-collection.mjs b/components/shopify/actions/create-smart-collection/create-smart-collection.mjs index 5b74397415ae8..2daa3a884d563 100644 --- a/components/shopify/actions/create-smart-collection/create-smart-collection.mjs +++ b/components/shopify/actions/create-smart-collection/create-smart-collection.mjs @@ -10,7 +10,7 @@ export default { You can fill in any number of rules by selecting more than one option in each prop. [See docs](https://shopify.dev/api/admin-rest/2021-10/resources/smartcollection#post-smart-collections) `), - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/delete-metafield/delete-metafield.mjs b/components/shopify/actions/delete-metafield/delete-metafield.mjs index d5d5544687683..5e29b928c77fe 100644 --- a/components/shopify/actions/delete-metafield/delete-metafield.mjs +++ b/components/shopify/actions/delete-metafield/delete-metafield.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-delete-metafield", name: "Delete Metafield", description: "Deletes a metafield belonging to a resource. [See the docs](https://shopify.dev/docs/api/admin-rest/2023-01/resources/metafield#delete-blogs-blog-id-metafields-metafield-id)", - version: "0.0.2", + version: "0.0.3", type: "action", async additionalProps() { const props = await this.getOwnerIdProp(this.ownerResource); diff --git a/components/shopify/actions/get-metafields/get-metafields.mjs b/components/shopify/actions/get-metafields/get-metafields.mjs index 35bcda3284669..7288b1df37c54 100644 --- a/components/shopify/actions/get-metafields/get-metafields.mjs +++ b/components/shopify/actions/get-metafields/get-metafields.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-get-metafields", name: "Get Metafields", description: "Retrieves a list of metafields that belong to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#get-metafields?metafield[owner-id]=382285388&metafield[owner-resource]=blog)", - version: "0.0.4", + version: "0.0.5", type: "action", async additionalProps() { return this.getOwnerIdProp(this.ownerResource); diff --git a/components/shopify/actions/search-customers/search-customers.mjs b/components/shopify/actions/search-customers/search-customers.mjs index c8c5dad737e3d..b54195338e7f0 100644 --- a/components/shopify/actions/search-customers/search-customers.mjs +++ b/components/shopify/actions/search-customers/search-customers.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-search-customers", name: "Search for Customers", description: "Search for a customer or a list of customers. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[get]/admin/api/2022-01/customers.json)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/search-product-variant/search-product-variant.mjs b/components/shopify/actions/search-product-variant/search-product-variant.mjs index e830212871311..24ac3e83c71e3 100644 --- a/components/shopify/actions/search-product-variant/search-product-variant.mjs +++ b/components/shopify/actions/search-product-variant/search-product-variant.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-search-product-variant", name: "Search for Product Variant", description: "Search for product variants or create one if not found. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#top)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/search-products/search-products.mjs b/components/shopify/actions/search-products/search-products.mjs index 75f58eb4ac45e..bcd30241f4734 100644 --- a/components/shopify/actions/search-products/search-products.mjs +++ b/components/shopify/actions/search-products/search-products.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-search-products", name: "Search for Products", description: "Search for products. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product#[get]/admin/api/2022-01/products.json)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/update-customer/update-customer.mjs b/components/shopify/actions/update-customer/update-customer.mjs index 241fd531ed8b3..89d2dc718904c 100644 --- a/components/shopify/actions/update-customer/update-customer.mjs +++ b/components/shopify/actions/update-customer/update-customer.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-update-customer", name: "Update Customer", description: "Update a existing customer. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/customer#[put]/admin/api/2022-01/customers/{customer_id}.json)", - version: "0.0.8", + version: "0.0.9", type: "action", props: { shopify, diff --git a/components/shopify/actions/update-inventory-level/update-inventory-level.mjs b/components/shopify/actions/update-inventory-level/update-inventory-level.mjs index 04a2a18be53c7..93bcafee7834d 100644 --- a/components/shopify/actions/update-inventory-level/update-inventory-level.mjs +++ b/components/shopify/actions/update-inventory-level/update-inventory-level.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-update-inventory-level", name: "Update Inventory Level", description: "Sets the inventory level for an inventory item at a location. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/inventorylevel#[post]/admin/api/2022-01/inventory_levels/set.json)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify/actions/update-metafield/update-metafield.mjs b/components/shopify/actions/update-metafield/update-metafield.mjs index 94d292900c3d9..262941693e6e4 100644 --- a/components/shopify/actions/update-metafield/update-metafield.mjs +++ b/components/shopify/actions/update-metafield/update-metafield.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-update-metafield", name: "Update Metafield", description: "Updates a metafield belonging to a resource. [See the docs](https://shopify.dev/api/admin-rest/2023-01/resources/metafield#put-blogs-blog-id-metafields-metafield-id)", - version: "0.0.4", + version: "0.0.5", type: "action", async additionalProps() { const props = await this.getOwnerIdProp(this.ownerResource); diff --git a/components/shopify/actions/update-product-variant/update-product-variant.mjs b/components/shopify/actions/update-product-variant/update-product-variant.mjs index 5c2c28c36f11c..c0a10991b8feb 100644 --- a/components/shopify/actions/update-product-variant/update-product-variant.mjs +++ b/components/shopify/actions/update-product-variant/update-product-variant.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-update-product-variant", name: "Update Product Variant", description: "Update an existing product variant. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#[put]/admin/api/2022-01/variants/{variant_id}.json)", - version: "0.0.8", + version: "0.0.9", type: "action", props: { shopify, diff --git a/components/shopify/actions/update-product/update-product.mjs b/components/shopify/actions/update-product/update-product.mjs index 72c92a0b55b07..913478e202231 100644 --- a/components/shopify/actions/update-product/update-product.mjs +++ b/components/shopify/actions/update-product/update-product.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-update-product", name: "Update Product", description: "Update an existing product. [See the docs](https://shopify.dev/api/admin-rest/2022-01/resources/product#[put]/admin/api/2022-01/products/{product_id}.json)", - version: "0.0.8", + version: "0.0.9", type: "action", props: { shopify, diff --git a/components/shopify/package.json b/components/shopify/package.json index e095f0a21725d..27476f71b3e79 100644 --- a/components/shopify/package.json +++ b/components/shopify/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/shopify", - "version": "0.3.17", + "version": "0.3.18", "description": "Pipedream Shopify Components", "main": "shopify.app.mjs", "keywords": [ diff --git a/components/shopify/sources/customer-data-request/customer-data-request.mjs b/components/shopify/sources/customer-data-request/customer-data-request.mjs index c60951c011c88..93baceb59e2ea 100644 --- a/components/shopify/sources/customer-data-request/customer-data-request.mjs +++ b/components/shopify/sources/customer-data-request/customer-data-request.mjs @@ -2,7 +2,7 @@ import shopify from "../../shopify.app.mjs"; export default { name: "New Customer Data Request", - version: "0.0.7", + version: "0.0.8", key: "shopify-customer-data-request", description: "Emit new customer data requests for data via a GDPR request.", type: "source", diff --git a/components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs b/components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs index 84ea6bfdfd767..8bc18a45b7380 100644 --- a/components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs +++ b/components/shopify/sources/new-abandoned-cart/new-abandoned-cart.mjs @@ -6,7 +6,7 @@ export default { name: "New Abandoned Cart", type: "source", description: "Emit new event each time a user abandons their cart.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", props: { db: "$.service.db", diff --git a/components/shopify/sources/new-article/new-article.mjs b/components/shopify/sources/new-article/new-article.mjs index 8ccb744eefe29..f55a81fd95669 100644 --- a/components/shopify/sources/new-article/new-article.mjs +++ b/components/shopify/sources/new-article/new-article.mjs @@ -6,7 +6,7 @@ export default { name: "New Article", type: "source", description: "Emit new event for each new article in a blog.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", props: { db: "$.service.db", diff --git a/components/shopify/sources/new-cancelled-order/new-cancelled-order.mjs b/components/shopify/sources/new-cancelled-order/new-cancelled-order.mjs index 86699684edb53..5b1612039063f 100644 --- a/components/shopify/sources/new-cancelled-order/new-cancelled-order.mjs +++ b/components/shopify/sources/new-cancelled-order/new-cancelled-order.mjs @@ -7,7 +7,7 @@ export default { name: "New Cancelled Order (Instant)", type: "source", description: "Emit new event each time a new order is cancelled.", - version: "0.0.11", + version: "0.0.12", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-customer-created/new-customer-created.mjs b/components/shopify/sources/new-customer-created/new-customer-created.mjs index 842c304d2c5d1..a1da3c186aaa8 100644 --- a/components/shopify/sources/new-customer-created/new-customer-created.mjs +++ b/components/shopify/sources/new-customer-created/new-customer-created.mjs @@ -7,7 +7,7 @@ export default { name: "New Customer Created (Instant)", type: "source", description: "Emit new event for each new customer added to a store.", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-draft-order/new-draft-order.mjs b/components/shopify/sources/new-draft-order/new-draft-order.mjs index ee4e14b490775..3108ddead5460 100644 --- a/components/shopify/sources/new-draft-order/new-draft-order.mjs +++ b/components/shopify/sources/new-draft-order/new-draft-order.mjs @@ -7,7 +7,7 @@ export default { name: "New Draft Order (Instant)", type: "source", description: "Emit new event for each new draft order submitted to a store.", - version: "0.0.8", + version: "0.0.9", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-event-emitted/new-event-emitted.mjs b/components/shopify/sources/new-event-emitted/new-event-emitted.mjs index 3fae214b8b224..85da5af92b6ee 100644 --- a/components/shopify/sources/new-event-emitted/new-event-emitted.mjs +++ b/components/shopify/sources/new-event-emitted/new-event-emitted.mjs @@ -7,7 +7,7 @@ export default { name: "New Event Emitted (Instant)", type: "source", description: "Emit new event for each new Shopify event.", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", props: { ...common.props, diff --git a/components/shopify/sources/new-order-created/new-order-created.mjs b/components/shopify/sources/new-order-created/new-order-created.mjs index e64bb7e823bdb..89ae060b887c7 100644 --- a/components/shopify/sources/new-order-created/new-order-created.mjs +++ b/components/shopify/sources/new-order-created/new-order-created.mjs @@ -7,7 +7,7 @@ export default { name: "New Order Created (Instant)", type: "source", description: "Emit new event for each new order submitted to a store.", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-page/new-page.mjs b/components/shopify/sources/new-page/new-page.mjs index 9425d0c0b9bba..811eefecabce7 100644 --- a/components/shopify/sources/new-page/new-page.mjs +++ b/components/shopify/sources/new-page/new-page.mjs @@ -6,7 +6,7 @@ export default { name: "New Page", type: "source", description: "Emit new event for each new page published.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", props: { db: "$.service.db", diff --git a/components/shopify/sources/new-paid-order/new-paid-order.mjs b/components/shopify/sources/new-paid-order/new-paid-order.mjs index dccb021e12cb5..9df8baa7e2e69 100644 --- a/components/shopify/sources/new-paid-order/new-paid-order.mjs +++ b/components/shopify/sources/new-paid-order/new-paid-order.mjs @@ -7,7 +7,7 @@ export default { name: "New Paid Order (Instant)", type: "source", description: "Emit new event each time a new order is paid.", - version: "0.0.10", + version: "0.0.11", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-product-created/new-product-created.mjs b/components/shopify/sources/new-product-created/new-product-created.mjs index ff27b839420a3..721c547079bfc 100644 --- a/components/shopify/sources/new-product-created/new-product-created.mjs +++ b/components/shopify/sources/new-product-created/new-product-created.mjs @@ -7,7 +7,7 @@ export default { name: "New Product Created (Instant)", type: "source", description: "Emit new event for each product added to a store.", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-shipment/new-shipment.mjs b/components/shopify/sources/new-shipment/new-shipment.mjs index ebacab1bcc545..9e32cd8542210 100644 --- a/components/shopify/sources/new-shipment/new-shipment.mjs +++ b/components/shopify/sources/new-shipment/new-shipment.mjs @@ -7,7 +7,7 @@ export default { name: "New Shipment (Instant)", type: "source", description: "Emit new event for each new fulfillment event for a store.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-updated-customer/new-updated-customer.mjs b/components/shopify/sources/new-updated-customer/new-updated-customer.mjs index 14aeeb607bbea..7e82266fffb78 100644 --- a/components/shopify/sources/new-updated-customer/new-updated-customer.mjs +++ b/components/shopify/sources/new-updated-customer/new-updated-customer.mjs @@ -7,7 +7,7 @@ export default { name: "New Updated Customer (Instant)", type: "source", description: "Emit new event each time a customer's information is updated.", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify/sources/new-updated-order/new-updated-order.mjs b/components/shopify/sources/new-updated-order/new-updated-order.mjs index 8217f30e8f9ca..7d8cbd15dab48 100644 --- a/components/shopify/sources/new-updated-order/new-updated-order.mjs +++ b/components/shopify/sources/new-updated-order/new-updated-order.mjs @@ -7,7 +7,7 @@ export default { name: "New Updated Order (Instant)", type: "source", description: "Emit new event each time an order is updated.", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, From c7dea9f8ad68a1e88050c682a48e4142f0a6dd4c Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 27 Feb 2023 13:11:24 -0500 Subject: [PATCH 4/4] update metafields props --- .../shopify/actions/update-customer/update-customer.mjs | 8 ++++---- .../update-product-variant/update-product-variant.mjs | 8 ++++---- .../shopify/actions/update-product/update-product.mjs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/shopify/actions/update-customer/update-customer.mjs b/components/shopify/actions/update-customer/update-customer.mjs index 89d2dc718904c..eaa3dd318b93e 100644 --- a/components/shopify/actions/update-customer/update-customer.mjs +++ b/components/shopify/actions/update-customer/update-customer.mjs @@ -78,10 +78,10 @@ export default { ], }, metafields: { - type: "string[]", - label: "Metafields", - description: "An array of objects, each one representing a metafield. If adding a new metafield, the object should contain `key`, `value`, `type`, and `namespace`. Example: `{{ [{ \"key\": \"new\", \"value\": \"newvalue\", \"type\": \"single_line_text_field\", \"namespace\": \"global\" }] }}`. To update an existing metafield, use the `id` and `value`. Example: `{{ [{ \"id\": \"28408051400984\", \"value\": \"updatedvalue\" }] }}`", - optional: true, + propDefinition: [ + shopify, + "metafields", + ], }, }, async run({ $ }) { diff --git a/components/shopify/actions/update-product-variant/update-product-variant.mjs b/components/shopify/actions/update-product-variant/update-product-variant.mjs index c0a10991b8feb..e018b52f63a29 100644 --- a/components/shopify/actions/update-product-variant/update-product-variant.mjs +++ b/components/shopify/actions/update-product-variant/update-product-variant.mjs @@ -47,10 +47,10 @@ export default { ], }, metafields: { - type: "string[]", - label: "Metafields", - description: "An array of objects, each one representing a metafield. If adding a new metafield, the object should contain `key`, `value`, `type`, and `namespace`. Example: `{{ [{ \"key\": \"new\", \"value\": \"newvalue\", \"type\": \"single_line_text_field\", \"namespace\": \"global\" }] }}`. To update an existing metafield, use the `id` and `value`. Example: `{{ [{ \"id\": \"28408051400984\", \"value\": \"updatedvalue\" }] }}`", - optional: true, + propDefinition: [ + shopify, + "metafields", + ], }, }, async run({ $ }) { diff --git a/components/shopify/actions/update-product/update-product.mjs b/components/shopify/actions/update-product/update-product.mjs index 913478e202231..4ad5cfcd73bee 100644 --- a/components/shopify/actions/update-product/update-product.mjs +++ b/components/shopify/actions/update-product/update-product.mjs @@ -72,10 +72,10 @@ export default { ], }, metafields: { - type: "string[]", - label: "Metafields", - description: "An array of objects, each one representing a metafield. If adding a new metafield, the object should contain `key`, `value`, `type`, and `namespace`. Example: `{{ [{ \"key\": \"new\", \"value\": \"newvalue\", \"type\": \"single_line_text_field\", \"namespace\": \"global\" }] }}`. To update an existing metafield, use the `id` and `value`. Example: `{{ [{ \"id\": \"28408051400984\", \"value\": \"updatedvalue\" }] }}`", - optional: true, + propDefinition: [ + shopify, + "metafields", + ], }, seoTitle: { type: "string",