diff --git a/components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs b/components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs index 6e9c27d7ad808..dc37c4f2762d2 100644 --- a/components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs +++ b/components/shopify_developer_app/actions/add-product-to-custom-collection/add-product-to-custom-collection.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-add-product-to-custom-collection", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/add-tags/add-tags.mjs b/components/shopify_developer_app/actions/add-tags/add-tags.mjs index a2c24eef3dd3e..b5fca539e041d 100644 --- a/components/shopify_developer_app/actions/add-tags/add-tags.mjs +++ b/components/shopify_developer_app/actions/add-tags/add-tags.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-add-tags", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/create-article/create-article.mjs b/components/shopify_developer_app/actions/create-article/create-article.mjs index debde389a6a09..6f593d8387826 100644 --- a/components/shopify_developer_app/actions/create-article/create-article.mjs +++ b/components/shopify_developer_app/actions/create-article/create-article.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-article", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/create-blog/create-blog.mjs b/components/shopify_developer_app/actions/create-blog/create-blog.mjs index d9226857e2141..09438f6a51c29 100644 --- a/components/shopify_developer_app/actions/create-blog/create-blog.mjs +++ b/components/shopify_developer_app/actions/create-blog/create-blog.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-blog", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs b/components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs index 187dfcf7c767a..0034f10fd8382 100644 --- a/components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs +++ b/components/shopify_developer_app/actions/create-custom-collection/create-custom-collection.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-custom-collection", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/create-customer/create-customer.mjs b/components/shopify_developer_app/actions/create-customer/create-customer.mjs index f49d37d49a2a3..a313f2f63987f 100644 --- a/components/shopify_developer_app/actions/create-customer/create-customer.mjs +++ b/components/shopify_developer_app/actions/create-customer/create-customer.mjs @@ -4,7 +4,7 @@ export default { key: "shopify_developer_app-create-customer", name: "Create Customer", description: "Create a new customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customercreate)", - version: "0.0.8", + version: "0.0.9", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/actions/create-fulfillment/create-fulfillment.mjs b/components/shopify_developer_app/actions/create-fulfillment/create-fulfillment.mjs new file mode 100644 index 0000000000000..4cc195234fc05 --- /dev/null +++ b/components/shopify_developer_app/actions/create-fulfillment/create-fulfillment.mjs @@ -0,0 +1,77 @@ +import shopify from "../../shopify_developer_app.app.mjs"; + +export default { + key: "shopify_developer_app-create-fulfillment", + name: "Create Fulfillment", + description: "Create a fulfillment. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/fulfillmentcreate)", + version: "0.0.1", + type: "action", + props: { + shopify, + fulfillmentOrderId: { + propDefinition: [ + shopify, + "fulfillmentOrderId", + ], + }, + fulfillmentOrderLineItemIds: { + propDefinition: [ + shopify, + "fulfillmentOrderLineItemIds", + (c) => ({ + fulfillmentOrderId: c.fulfillmentOrderId, + }), + ], + reloadProps: true, + }, + notifyCustomer: { + type: "boolean", + label: "Notify Customer", + description: "Whether to notify the customer", + optional: true, + }, + message: { + type: "string", + label: "Message", + description: "An optional message for the fulfillment request.", + optional: true, + }, + }, + async additionalProps() { + const props = {}; + if (!this.fulfillmentOrderLineItemIds) { + return props; + } + + for (const id of this.fulfillmentOrderLineItemIds) { + props[`quantity_${id}`] = { + type: "integer", + label: `Quantity for Line Item - ${id}`, + description: "The quantity of the line item to fulfill", + }; + } + return props; + }, + async run({ $ }) { + const fulfillment = await this.shopify.createFulfillment({ + fulfillment: { + lineItemsByFulfillmentOrder: [ + { + fulfillmentOrderId: this.fulfillmentOrderId, + fulfillmentOrderLineItems: this.fulfillmentOrderLineItemIds.map((id) => ({ + id, + quantity: this[`quantity_${id}`], + })), + }, + ], + notifyCustomer: this.notifyCustomer, + }, + message: this.message, + }); + if (fulfillment.fulfillmentCreate.userErrors.length > 0) { + throw new Error(fulfillment.fulfillmentCreate.userErrors[0].message); + } + $.export("$summary", `Created fulfillment with ID: ${fulfillment.fulfillmentCreate.fulfillment.id}`); + return fulfillment; + }, +}; diff --git a/components/shopify_developer_app/actions/create-metafield/create-metafield.mjs b/components/shopify_developer_app/actions/create-metafield/create-metafield.mjs index c9ae60a3ce329..4f9e288532896 100644 --- a/components/shopify_developer_app/actions/create-metafield/create-metafield.mjs +++ b/components/shopify_developer_app/actions/create-metafield/create-metafield.mjs @@ -10,7 +10,7 @@ const { export default { ...others, key: "shopify_developer_app-create-metafield", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs b/components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs index 91c519fa50e18..306873170ec90 100644 --- a/components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs +++ b/components/shopify_developer_app/actions/create-metaobject/create-metaobject.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-metaobject", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/create-order/create-order.mjs b/components/shopify_developer_app/actions/create-order/create-order.mjs index 429a1fed1a50a..28833d32e406d 100644 --- a/components/shopify_developer_app/actions/create-order/create-order.mjs +++ b/components/shopify_developer_app/actions/create-order/create-order.mjs @@ -5,7 +5,7 @@ export default { key: "shopify_developer_app-create-order", name: "Create Order", description: "Creates a new order. For full order object details [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/ordercreate)", - version: "0.0.8", + version: "0.0.9", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/actions/create-page/create-page.mjs b/components/shopify_developer_app/actions/create-page/create-page.mjs index 1260ff8e59b43..03d306210928f 100644 --- a/components/shopify_developer_app/actions/create-page/create-page.mjs +++ b/components/shopify_developer_app/actions/create-page/create-page.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-page", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs b/components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs index 9e69b969ce82e..b6d6342c775ea 100644 --- a/components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs +++ b/components/shopify_developer_app/actions/create-product-variant/create-product-variant.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-product-variant", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/actions/create-product/create-product.mjs b/components/shopify_developer_app/actions/create-product/create-product.mjs index c73d052cc688b..8ef5eb9fde153 100644 --- a/components/shopify_developer_app/actions/create-product/create-product.mjs +++ b/components/shopify_developer_app/actions/create-product/create-product.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-product", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs b/components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs index 5fbf51587198c..51cf7a4011f5b 100644 --- a/components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs +++ b/components/shopify_developer_app/actions/create-smart-collection/create-smart-collection.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-create-smart-collection", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/delete-article/delete-article.mjs b/components/shopify_developer_app/actions/delete-article/delete-article.mjs index 14d630c241892..20f9b461fcc56 100644 --- a/components/shopify_developer_app/actions/delete-article/delete-article.mjs +++ b/components/shopify_developer_app/actions/delete-article/delete-article.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-delete-article", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/delete-blog/delete-blog.mjs b/components/shopify_developer_app/actions/delete-blog/delete-blog.mjs index cf997d0bdd748..f11d55a3ef590 100644 --- a/components/shopify_developer_app/actions/delete-blog/delete-blog.mjs +++ b/components/shopify_developer_app/actions/delete-blog/delete-blog.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-delete-blog", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs b/components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs index 0a80a250ee38a..80ed50f0bcce4 100644 --- a/components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs +++ b/components/shopify_developer_app/actions/delete-metafield/delete-metafield.mjs @@ -9,7 +9,7 @@ const { export default { ...others, key: "shopify_developer_app-delete-metafield", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/actions/delete-page/delete-page.mjs b/components/shopify_developer_app/actions/delete-page/delete-page.mjs index d6c25b167cbb0..9a120378b1e02 100644 --- a/components/shopify_developer_app/actions/delete-page/delete-page.mjs +++ b/components/shopify_developer_app/actions/delete-page/delete-page.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-delete-page", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/get-articles/get-articles.mjs b/components/shopify_developer_app/actions/get-articles/get-articles.mjs index 010cb74355b88..09e7c5b5d0352 100644 --- a/components/shopify_developer_app/actions/get-articles/get-articles.mjs +++ b/components/shopify_developer_app/actions/get-articles/get-articles.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-get-articles", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/get-metafields/get-metafields.mjs b/components/shopify_developer_app/actions/get-metafields/get-metafields.mjs index e54d4c820209e..ae4c7037f21b9 100644 --- a/components/shopify_developer_app/actions/get-metafields/get-metafields.mjs +++ b/components/shopify_developer_app/actions/get-metafields/get-metafields.mjs @@ -8,7 +8,7 @@ const { export default { key: "shopify_developer_app-get-metafields", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs b/components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs index 5ae007c73630e..818f6cd99d5df 100644 --- a/components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs +++ b/components/shopify_developer_app/actions/get-metaobjects/get-metaobjects.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-get-metaobjects", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/actions/get-order/get-order.mjs b/components/shopify_developer_app/actions/get-order/get-order.mjs index ed248b6721d11..e65f746f0b628 100644 --- a/components/shopify_developer_app/actions/get-order/get-order.mjs +++ b/components/shopify_developer_app/actions/get-order/get-order.mjs @@ -5,7 +5,7 @@ export default { key: "shopify_developer_app-get-order", name: "Get Order", description: "Retrieve an order by specifying the order ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/order)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/actions/get-pages/get-pages.mjs b/components/shopify_developer_app/actions/get-pages/get-pages.mjs index ba2b992f79705..8f1c2da9d503a 100644 --- a/components/shopify_developer_app/actions/get-pages/get-pages.mjs +++ b/components/shopify_developer_app/actions/get-pages/get-pages.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-get-pages", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/refund-order/refund-order.mjs b/components/shopify_developer_app/actions/refund-order/refund-order.mjs new file mode 100644 index 0000000000000..2e2b3ab20ea08 --- /dev/null +++ b/components/shopify_developer_app/actions/refund-order/refund-order.mjs @@ -0,0 +1,100 @@ +import shopify from "../../shopify_developer_app.app.mjs"; +import { MAX_LIMIT } from "@pipedream/shopify/common/constants.mjs"; + +export default { + key: "shopify_developer_app-refund-order", + name: "Refund Order", + description: "Refund an order. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/refundcreate)", + version: "0.0.1", + type: "action", + props: { + shopify, + orderId: { + propDefinition: [ + shopify, + "orderId", + ], + }, + note: { + type: "string", + label: "Note", + description: "An optional note that's attached to the refund", + optional: true, + }, + lineItemIds: { + propDefinition: [ + shopify, + "lineItemIds", + (c) => ({ + orderId: c.orderId, + }), + ], + reloadProps: true, + }, + }, + async additionalProps() { + const props = {}; + if (!this.lineItemIds) { + return props; + } + const order = await this.shopify.getOrder({ + id: this.orderId, + first: MAX_LIMIT, + }); + for (const id of this.lineItemIds) { + const lineItem = order.order.lineItems.edges.find((item) => item.node.id === id); + props[`quantity_${id}`] = { + type: "integer", + label: `Quantity for line item - ${lineItem.node.title}`, + description: "The quantity of the line item to refund", + }; + props[`restockType_${id}`] = { + type: "string", + label: `Restock type for line item - ${lineItem.node.title}`, + description: "The restock type for the line item", + options: [ + "CANCEL", + "NO_RESTOCK", + "RETURN", + ], + default: "RETURN", + }; + props[`locationId_${id}`] = { + type: "string", + label: `Location ID for line item - ${lineItem.node.title}`, + description: "The location ID for the line item", + options: async ({ prevContext }) => { + return this.shopify.getPropOptions({ + resourceFn: this.shopify.listLocations, + resourceKeys: [ + "locations", + ], + labelKey: "name", + prevContext, + }); + }, + }; + } + return props; + }, + async run({ $ }) { + const response = await this.shopify.refundOrder({ + input: { + note: this.note, + orderId: this.orderId, + refundLineItems: this.lineItemIds.map((id) => ({ + lineItemId: id, + quantity: this[`quantity_${id}`], + locationId: this[`locationId_${id}`], + restockType: this[`restockType_${id}`], + })), + }, + }); + + if (response.refundCreate.userErrors.length > 0) { + throw new Error(response.refundCreate.userErrors[0].message); + } + $.export("$summary", `Refunded order with ID: ${this.orderId}`); + return response; + }, +}; diff --git a/components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs b/components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs index 12bef60f13068..e2e3cbb6b299c 100644 --- a/components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +++ b/components/shopify_developer_app/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-search-custom-collection-by-name", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/search-customers/search-customers.mjs b/components/shopify_developer_app/actions/search-customers/search-customers.mjs index 755a008ca2c4c..7529d63d20481 100644 --- a/components/shopify_developer_app/actions/search-customers/search-customers.mjs +++ b/components/shopify_developer_app/actions/search-customers/search-customers.mjs @@ -4,7 +4,7 @@ export default { key: "shopify_developer_app-search-customers", name: "Search for Customers", description: "Search for a customer or a list of customers. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers)", - version: "0.0.8", + version: "0.0.9", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/actions/search-fulfillment-orders/search-fulfillment-orders.mjs b/components/shopify_developer_app/actions/search-fulfillment-orders/search-fulfillment-orders.mjs new file mode 100644 index 0000000000000..1458e830ac599 --- /dev/null +++ b/components/shopify_developer_app/actions/search-fulfillment-orders/search-fulfillment-orders.mjs @@ -0,0 +1,40 @@ +import shopify from "../../shopify_developer_app.app.mjs"; + +export default { + key: "shopify_developer_app-search-fulfillment-orders", + name: "Search for Fulfillment Orders", + description: "Search for a fulfillment order or a list of fulfillment orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/queries/fulfillmentorders)", + version: "0.0.1", + type: "action", + props: { + shopify, + query: { + type: "string", + label: "Query", + description: "A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).", + optional: true, + }, + max: { + type: "integer", + label: "Max Records", + description: "Optionally limit the maximum number of records to return. Leave blank to retrieve all records.", + optional: true, + }, + }, + async run({ $ }) { + const orders = await this.shopify.getPaginated({ + resourceFn: this.shopify.listFulfillmentOrders, + resourceKeys: [ + "fulfillmentOrders", + ], + variables: { + query: this.query, + }, + max: this.max, + }); + $.export("$summary", `Found ${orders.length} fulfillment order${orders.length === 1 + ? "" + : "s"}`); + return orders; + }, +}; diff --git a/components/shopify_developer_app/actions/search-orders/search-orders.mjs b/components/shopify_developer_app/actions/search-orders/search-orders.mjs index 0f2064b848613..5222deccd35c7 100644 --- a/components/shopify_developer_app/actions/search-orders/search-orders.mjs +++ b/components/shopify_developer_app/actions/search-orders/search-orders.mjs @@ -4,7 +4,7 @@ export default { key: "shopify_developer_app-search-orders", name: "Search for Orders", description: "Search for an order or a list of orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/orders)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs b/components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs index ee3602d6f4eb5..1178182bfd8be 100644 --- a/components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs +++ b/components/shopify_developer_app/actions/search-product-variant/search-product-variant.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-search-product-variant", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/search-products/search-products.mjs b/components/shopify_developer_app/actions/search-products/search-products.mjs index c9df2c433fbaf..4058b9fbe69bb 100644 --- a/components/shopify_developer_app/actions/search-products/search-products.mjs +++ b/components/shopify_developer_app/actions/search-products/search-products.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-search-products", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/update-article/update-article.mjs b/components/shopify_developer_app/actions/update-article/update-article.mjs index a84a299aa2ff0..42c0561cd65c8 100644 --- a/components/shopify_developer_app/actions/update-article/update-article.mjs +++ b/components/shopify_developer_app/actions/update-article/update-article.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-update-article", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/update-customer/update-customer.mjs b/components/shopify_developer_app/actions/update-customer/update-customer.mjs index 016282ec0f37e..4386589469b08 100644 --- a/components/shopify_developer_app/actions/update-customer/update-customer.mjs +++ b/components/shopify_developer_app/actions/update-customer/update-customer.mjs @@ -6,7 +6,7 @@ export default { key: "shopify_developer_app-update-customer", name: "Update Customer", description: "Update a existing customer. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/customerupdate)", - version: "0.0.9", + version: "0.0.10", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/actions/update-fulfillment-tracking-info/update-fulfillment-tracking-info.mjs b/components/shopify_developer_app/actions/update-fulfillment-tracking-info/update-fulfillment-tracking-info.mjs new file mode 100644 index 0000000000000..a9e27265b63b8 --- /dev/null +++ b/components/shopify_developer_app/actions/update-fulfillment-tracking-info/update-fulfillment-tracking-info.mjs @@ -0,0 +1,68 @@ +import shopify from "../../shopify_developer_app.app.mjs"; + +export default { + key: "shopify_developer_app-update-fulfillment-tracking-info", + name: "Update Fulfillment Tracking Info", + description: "Update the tracking info for a fulfillment. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/fulfillmenttrackinginfoupdate)", + version: "0.0.1", + type: "action", + props: { + shopify, + orderId: { + propDefinition: [ + shopify, + "orderId", + ], + }, + fulfillmentId: { + propDefinition: [ + shopify, + "fulfillmentId", + (c) => ({ + orderId: c.orderId, + }), + ], + }, + company: { + type: "string", + label: "Company", + description: "The name of the tracking company", + optional: true, + }, + number: { + type: "string", + label: "Tracking Number", + description: "The tracking number for the fulfillment", + optional: true, + }, + url: { + type: "string", + label: "Tracking URL", + description: "The URL for the tracking information", + optional: true, + }, + notifyCustomer: { + type: "boolean", + label: "Notify Customer", + description: "Whether to notify the customer", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.shopify.updateFulfillmentTrackingInfo({ + fulfillmentId: this.fulfillmentId, + trackingInfoInput: { + company: this.company, + number: this.number, + url: this.url, + }, + notifyCustomer: this.notifyCustomer, + }); + + if (response.fulfillmentTrackingInfoUpdate.userErrors.length > 0) { + throw new Error(response.fulfillmentTrackingInfoUpdate.userErrors[0].message); + } + $.export("$summary", `Updated fulfillment tracking info for fulfillment with ID: ${this.fulfillmentId}`); + return response; + }, +}; diff --git a/components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs b/components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs index e92211c10b673..d66287eaac240 100644 --- a/components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs +++ b/components/shopify_developer_app/actions/update-inventory-level/update-inventory-level.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-update-inventory-level", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/actions/update-metafield/update-metafield.mjs b/components/shopify_developer_app/actions/update-metafield/update-metafield.mjs index 46ae87efc1700..c92b1c5511877 100644 --- a/components/shopify_developer_app/actions/update-metafield/update-metafield.mjs +++ b/components/shopify_developer_app/actions/update-metafield/update-metafield.mjs @@ -9,7 +9,7 @@ const { export default { ...others, key: "shopify_developer_app-update-metafield", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs b/components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs index e80f5ba5f3a3d..8fa70df502af3 100644 --- a/components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs +++ b/components/shopify_developer_app/actions/update-metaobject/update-metaobject.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-update-metaobject", - version: "0.0.11", + version: "0.0.12", name, description, type, diff --git a/components/shopify_developer_app/actions/update-page/update-page.mjs b/components/shopify_developer_app/actions/update-page/update-page.mjs index 9e05598276d58..be852f56bd13f 100644 --- a/components/shopify_developer_app/actions/update-page/update-page.mjs +++ b/components/shopify_developer_app/actions/update-page/update-page.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-update-page", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs b/components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs index 466f9e3190afb..3beaf41c28c9c 100644 --- a/components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs +++ b/components/shopify_developer_app/actions/update-product-variant/update-product-variant.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-update-product-variant", - version: "0.0.10", + version: "0.0.11", name, description, type, diff --git a/components/shopify_developer_app/actions/update-product/update-product.mjs b/components/shopify_developer_app/actions/update-product/update-product.mjs index 846bf8da56357..6c94428fd7dda 100644 --- a/components/shopify_developer_app/actions/update-product/update-product.mjs +++ b/components/shopify_developer_app/actions/update-product/update-product.mjs @@ -6,7 +6,7 @@ export default { key: "shopify_developer_app-update-product", name: "Update Product", description: "Update an existing product. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productupdate)", - version: "0.0.9", + version: "0.0.10", type: "action", props: { shopify, diff --git a/components/shopify_developer_app/common/mutations.mjs b/components/shopify_developer_app/common/mutations.mjs index 1c675dac8cd6e..7314daf0616c3 100644 --- a/components/shopify_developer_app/common/mutations.mjs +++ b/components/shopify_developer_app/common/mutations.mjs @@ -116,9 +116,97 @@ const UPDATE_PRODUCT = ` } `; +const REFUND_ORDER = ` +mutation RefundLineItem($input: RefundInput!) { + refundCreate(input: $input) { + refund { + id + totalRefundedSet { + presentmentMoney { + amount + currencyCode + } + } + order { + id + totalPriceSet { + presentmentMoney { + amount + currencyCode + } + } + } + refundLineItems(first: 10) { + nodes { + id + lineItem { + id + title + quantity + product { + id + title + } + variant { + id + title + price + } + } + } + } + } + userErrors { + field + message + } + } + } +`; + +const UPDATE_FULFILLMENT_TRACKING_INFO = ` + mutation FulfillmentTrackingInfoUpdate($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) { + fulfillmentTrackingInfoUpdate(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) { + fulfillment { + id + status + trackingInfo { + company + number + url + } + } + userErrors { + field + message + } + } + } +`; + +const CREATE_FULFILLMENT = ` +mutation fulfillmentCreate($fulfillment: FulfillmentInput!, $message: String) { + fulfillmentCreate(fulfillment: $fulfillment, message: $message) { + fulfillment { + id + name + status + createdAt + } + userErrors { + field + message + } + } +} +`; + export default { CREATE_ORDER, CREATE_CUSTOMER, UPDATE_CUSTOMER, UPDATE_PRODUCT, + REFUND_ORDER, + UPDATE_FULFILLMENT_TRACKING_INFO, + CREATE_FULFILLMENT, }; diff --git a/components/shopify_developer_app/common/queries.mjs b/components/shopify_developer_app/common/queries.mjs index 53e2943ee44f4..aa48bd8c6364f 100644 --- a/components/shopify_developer_app/common/queries.mjs +++ b/components/shopify_developer_app/common/queries.mjs @@ -543,6 +543,18 @@ const GET_DRAFT_ORDER = ` } `; +const GET_FULFILLMENT_ORDER = ` + query LocationsForMoveList($fulfillmentOrderId: ID!, $first: Int) { + fulfillmentOrder(id: $fulfillmentOrderId) { + lineItems (first: $first) { + nodes { + id + } + } + } + } +`; + const LIST_ORDERS = ` query ($first: Int, $after: String, $reverse: Boolean, $query: String){ orders(first: $first, after: $after, reverse: $reverse, query: $query) { @@ -759,11 +771,46 @@ const LIST_CUSTOMERS = ` } `; +const LIST_FULFILLMENT_ORDERS = ` + query ($first: Int, $after: String, $query: String) { + fulfillmentOrders(first: $first, after: $after, query: $query) { + nodes { + id + status + createdAt + updatedAt + fulfillAt + orderId + orderName + fulfillments (first: $first) { + nodes { + id + name + } + } + lineItems (first: $first) { + nodes { + id + productTitle + totalQuantity + } + } + } + pageInfo { + endCursor + hasNextPage + } + } + } +`; + export default { GET_ORDER, GET_CUSTOMER, GET_DRAFT_ORDER, + GET_FULFILLMENT_ORDER, LIST_ORDERS, LIST_DRAFT_ORDERS, LIST_CUSTOMERS, + LIST_FULFILLMENT_ORDERS, }; diff --git a/components/shopify_developer_app/package.json b/components/shopify_developer_app/package.json index e25bfddc7d89f..9be81670b14eb 100644 --- a/components/shopify_developer_app/package.json +++ b/components/shopify_developer_app/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/shopify_developer_app", - "version": "0.8.1", + "version": "0.9.0", "description": "Pipedream Shopify (Developer App) Components", "main": "shopify_developer_app.app.mjs", "keywords": [ diff --git a/components/shopify_developer_app/shopify_developer_app.app.mjs b/components/shopify_developer_app/shopify_developer_app.app.mjs index bf383457409f4..110f451f49125 100644 --- a/components/shopify_developer_app/shopify_developer_app.app.mjs +++ b/components/shopify_developer_app/shopify_developer_app.app.mjs @@ -2,7 +2,9 @@ import commonApp from "@pipedream/shopify"; import Shopify from "shopify-api-node"; import queries from "./common/queries.mjs"; import mutations from "./common/mutations.mjs"; -import { API_VERSION } from "@pipedream/shopify/common/constants.mjs"; +import { + API_VERSION, MAX_LIMIT, +} from "@pipedream/shopify/common/constants.mjs"; export default { ...commonApp, @@ -40,6 +42,60 @@ export default { }); }, }, + lineItemIds: { + type: "string[]", + label: "Line Item IDs", + description: "An array of line item IDs", + async options({ orderId }) { + const order = await this.getOrder({ + id: orderId, + first: MAX_LIMIT, + }); + return order.order.lineItems.edges.map(({ node }) => ({ + label: node.title, + value: node.id, + })); + }, + }, + fulfillmentId: { + type: "string", + label: "Fulfillment ID", + description: "The identifier of a fulfillment", + async options({ orderId }) { + const order = await this.getOrder({ + id: orderId, + first: MAX_LIMIT, + }); + return order.order.fulfillments?.map(({ id }) => id) ?? []; + }, + }, + fulfillmentOrderId: { + type: "string", + label: "Fulfillment Order ID", + description: "The identifier of a fulfillment order", + async options({ prevContext }) { + return this.getPropOptions({ + resourceFn: this.listFulfillmentOrders, + resourceKeys: [ + "fulfillmentOrders", + ], + labelKey: "id", + prevContext, + }); + }, + }, + fulfillmentOrderLineItemIds: { + type: "string[]", + label: "Fulfillment Order Line Item IDs", + description: "An array of fulfillment order line item IDs", + async options({ fulfillmentOrderId }) { + const fulfillmentOrder = await this.getFulfillmentOrder({ + fulfillmentOrderId, + first: MAX_LIMIT, + }); + return fulfillmentOrder.fulfillmentOrder.lineItems.nodes.map(({ id }) => id); + }, + }, firstName: { type: "string", label: "First Name", @@ -122,6 +178,9 @@ export default { getDraftOrder(variables) { return this._makeGraphQlRequest(queries.GET_DRAFT_ORDER, variables); }, + getFulfillmentOrder(variables) { + return this._makeGraphQlRequest(queries.GET_FULFILLMENT_ORDER, variables); + }, getCustomer(variables) { return this._makeGraphQlRequest(queries.GET_CUSTOMER, variables); }, @@ -134,14 +193,26 @@ export default { listCustomers(variables) { return this._makeGraphQlRequest(queries.LIST_CUSTOMERS, variables); }, + listFulfillmentOrders(variables) { + return this._makeGraphQlRequest(queries.LIST_FULFILLMENT_ORDERS, variables); + }, createOrder(variables) { return this._makeGraphQlRequest(mutations.CREATE_ORDER, variables); }, createCustomer(variables) { return this._makeGraphQlRequest(mutations.CREATE_CUSTOMER, variables); }, + createFulfillment(variables) { + return this._makeGraphQlRequest(mutations.CREATE_FULFILLMENT, variables); + }, updateCustomer(variables) { return this._makeGraphQlRequest(mutations.UPDATE_CUSTOMER, variables); }, + refundOrder(variables) { + return this._makeGraphQlRequest(mutations.REFUND_ORDER, variables); + }, + updateFulfillmentTrackingInfo(variables) { + return this._makeGraphQlRequest(mutations.UPDATE_FULFILLMENT_TRACKING_INFO, variables); + }, }, }; diff --git a/components/shopify_developer_app/sources/cart-updated/cart-updated.mjs b/components/shopify_developer_app/sources/cart-updated/cart-updated.mjs new file mode 100644 index 0000000000000..d5a0dfe9cb959 --- /dev/null +++ b/components/shopify_developer_app/sources/cart-updated/cart-updated.mjs @@ -0,0 +1,25 @@ +import common from "../common/webhook.mjs"; + +export default { + ...common, + key: "shopify_developer_app-cart-updated", + name: "Cart Updated (Instant)", + description: "Emit new event when a cart is updated.", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTopic() { + return "CARTS_UPDATE"; + }, + generateMeta(resource) { + const ts = Date.parse(resource.updated_at); + return { + id: `${resource.id}-${ts}`, + summary: `Cart Updated ${resource.id}`, + ts, + }; + }, + }, +}; diff --git a/components/shopify_developer_app/sources/inventory-level-updated/inventory-level-updated.mjs b/components/shopify_developer_app/sources/inventory-level-updated/inventory-level-updated.mjs new file mode 100644 index 0000000000000..e46e2b8cbd262 --- /dev/null +++ b/components/shopify_developer_app/sources/inventory-level-updated/inventory-level-updated.mjs @@ -0,0 +1,25 @@ +import common from "../common/webhook.mjs"; + +export default { + ...common, + key: "shopify_developer_app-inventory-level-updated", + name: "Inventory Level Updated (Instant)", + description: "Emit new event when an inventory level is updated.", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTopic() { + return "INVENTORY_LEVELS_UPDATE"; + }, + generateMeta(resource) { + const ts = Date.parse(resource.updated_at); + return { + id: `${resource.inventory_item_id}-${ts}`, + summary: `Inventory Level Updated ${resource.inventory_item_id}`, + ts, + }; + }, + }, +}; diff --git a/components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs b/components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs index 6f7f59efeee3d..a045afd7c8d5d 100644 --- a/components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs +++ b/components/shopify_developer_app/sources/new-abandoned-cart/new-abandoned-cart.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-new-abandoned-cart", - version: "0.0.9", + version: "0.0.10", name, description, type, diff --git a/components/shopify_developer_app/sources/new-article/new-article.mjs b/components/shopify_developer_app/sources/new-article/new-article.mjs index 6d0666da7a1ef..db8980dc35a15 100644 --- a/components/shopify_developer_app/sources/new-article/new-article.mjs +++ b/components/shopify_developer_app/sources/new-article/new-article.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-new-article", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs b/components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs index 7700908c2258c..8bac6f71742f9 100644 --- a/components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs +++ b/components/shopify_developer_app/sources/new-cancelled-order/new-cancelled-order.mjs @@ -6,7 +6,7 @@ export default { name: "New Cancelled Order (Instant)", type: "source", description: "Emit new event each time a new order is cancelled.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-cart-created/new-cart-created.mjs b/components/shopify_developer_app/sources/new-cart-created/new-cart-created.mjs new file mode 100644 index 0000000000000..ed6f0859dbe50 --- /dev/null +++ b/components/shopify_developer_app/sources/new-cart-created/new-cart-created.mjs @@ -0,0 +1,25 @@ +import common from "../common/webhook.mjs"; + +export default { + ...common, + key: "shopify_developer_app-new-cart-created", + name: "New Cart Created (Instant)", + description: "Emit new event when a new cart is created.", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTopic() { + return "CARTS_CREATE"; + }, + generateMeta(resource) { + const ts = Date.parse(resource.created_at); + return { + id: `${resource.id}-${ts}`, + summary: `Cart Created ${resource.id}`, + ts, + }; + }, + }, +}; diff --git a/components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs b/components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs index cf30073fe7750..33b1d069ca8de 100644 --- a/components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs +++ b/components/shopify_developer_app/sources/new-customer-created/new-customer-created.mjs @@ -6,7 +6,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.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs b/components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs index 3656b7dd55d52..db77a30725ae0 100644 --- a/components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs +++ b/components/shopify_developer_app/sources/new-draft-order/new-draft-order.mjs @@ -6,7 +6,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.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs b/components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs index 76fa288ea5c89..d922c88fb577f 100644 --- a/components/shopify_developer_app/sources/new-event-emitted/new-event-emitted.mjs +++ b/components/shopify_developer_app/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.13", + version: "0.0.14", dedupe: "unique", props: { ...common.props, diff --git a/components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs b/components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs index 7a960fc8e4592..a92ef8a578608 100644 --- a/components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs +++ b/components/shopify_developer_app/sources/new-fulfillment-event/new-fulfillment-event.mjs @@ -6,7 +6,7 @@ export default { name: "New Fulfillment Event (Instant)", type: "source", description: "Emit new event for each new fulfillment event for a store.", - version: "0.0.10", + version: "0.0.11", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-order-created/new-order-created.mjs b/components/shopify_developer_app/sources/new-order-created/new-order-created.mjs index eff5c4d83e33a..86d3fbeaa632f 100644 --- a/components/shopify_developer_app/sources/new-order-created/new-order-created.mjs +++ b/components/shopify_developer_app/sources/new-order-created/new-order-created.mjs @@ -6,7 +6,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.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs b/components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs index a959489b00734..af6a09ecee503 100644 --- a/components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs +++ b/components/shopify_developer_app/sources/new-order-fulfilled/new-order-fulfilled.mjs @@ -6,7 +6,7 @@ export default { name: "New Order Fulfilled (Instant)", type: "source", description: "Emit new event whenever an order is fulfilled.", - version: "0.0.9", + version: "0.0.10", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-page/new-page.mjs b/components/shopify_developer_app/sources/new-page/new-page.mjs index 4e3eda17cdc73..9af3340eadf5b 100644 --- a/components/shopify_developer_app/sources/new-page/new-page.mjs +++ b/components/shopify_developer_app/sources/new-page/new-page.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-new-page", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs b/components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs index 38d8640aa47ff..dca04d21bf2db 100644 --- a/components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs +++ b/components/shopify_developer_app/sources/new-paid-order/new-paid-order.mjs @@ -6,7 +6,7 @@ export default { name: "New Paid Order (Instant)", type: "source", description: "Emit new event each time a new order is paid.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-product-created/new-product-created.mjs b/components/shopify_developer_app/sources/new-product-created/new-product-created.mjs index 401d8c2d9f470..912decb8f91a6 100644 --- a/components/shopify_developer_app/sources/new-product-created/new-product-created.mjs +++ b/components/shopify_developer_app/sources/new-product-created/new-product-created.mjs @@ -6,7 +6,7 @@ export default { name: "New Product Created (Instant)", type: "source", description: "Emit new event for each product added to a store.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs b/components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs index eef7ca763522c..1b730e17acc82 100644 --- a/components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs +++ b/components/shopify_developer_app/sources/new-product-updated/new-product-updated.mjs @@ -5,7 +5,7 @@ export default { key: "shopify_developer_app-new-product-updated", name: "New Product Updated (Instant)", description: "Emit new event for each product updated in a store.", - version: "0.0.10", + version: "0.0.11", type: "source", dedupe: "unique", props: { diff --git a/components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs b/components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs index 3e835e9507510..833519b7749c3 100644 --- a/components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs +++ b/components/shopify_developer_app/sources/new-refund-created/new-refund-created.mjs @@ -5,7 +5,7 @@ export default { key: "shopify_developer_app-new-refund-created", name: "New Refund Created (Instant)", description: "Emit new event when a new refund is created.", - version: "0.0.9", + version: "0.0.10", type: "source", dedupe: "unique", methods: { diff --git a/components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs b/components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs index 489135bc69110..85ac02fe619c7 100644 --- a/components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs +++ b/components/shopify_developer_app/sources/new-updated-customer/new-updated-customer.mjs @@ -6,7 +6,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.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs b/components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs index 5c9429d683230..46c8026c95741 100644 --- a/components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs +++ b/components/shopify_developer_app/sources/new-updated-order/new-updated-order.mjs @@ -6,7 +6,7 @@ export default { name: "New Updated Order (Instant)", type: "source", description: "Emit new event each time an order is updated.", - version: "0.0.12", + version: "0.0.13", dedupe: "unique", methods: { ...common.methods, diff --git a/components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs b/components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs index f1eb158292623..9f8c33b1c7698 100644 --- a/components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs +++ b/components/shopify_developer_app/sources/product-added-to-custom-collection/product-added-to-custom-collection.mjs @@ -11,7 +11,7 @@ const props = adjustPropDefinitions(others.props, shopify); export default { ...others, key: "shopify_developer_app-product-added-to-custom-collection", - version: "0.0.8", + version: "0.0.9", name, description, type, diff --git a/components/shopify_developer_app/sources/shop-update/shop-update.mjs b/components/shopify_developer_app/sources/shop-update/shop-update.mjs new file mode 100644 index 0000000000000..0d8f04f428826 --- /dev/null +++ b/components/shopify_developer_app/sources/shop-update/shop-update.mjs @@ -0,0 +1,25 @@ +import common from "../common/webhook.mjs"; + +export default { + ...common, + key: "shopify_developer_app-shop-update", + name: "Shop Updated (Instant)", + description: "Emit new event when a shop is updated.", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTopic() { + return "SHOP_UPDATE"; + }, + generateMeta(resource) { + const ts = Date.parse(resource.updated_at); + return { + id: `${resource.id}-${ts}`, + summary: `Shop Updated ${resource.id}`, + ts, + }; + }, + }, +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32f37eda31fa1..5f16cdca7748a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4073,8 +4073,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/dynamic_content_snippet: - specifiers: {} + components/dynamic_content_snippet: {} components/dynamics_365_business_central_api: dependencies: @@ -37315,6 +37314,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: