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 index 83744e447e5ed..50a8d7725bb36 100644 --- 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 @@ -4,7 +4,7 @@ export default { key: "shopify-add-product-to-custom-collection", name: "Add Products to Custom Collection", description: "Adds a product or products to a custom collection. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionAddProductsV2)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/add-tags/add-tags.mjs b/components/shopify/actions/add-tags/add-tags.mjs index 3ee3dbba9459a..89b121de378e5 100644 --- a/components/shopify/actions/add-tags/add-tags.mjs +++ b/components/shopify/actions/add-tags/add-tags.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-add-tags", name: "Add Tags", description: "Add tags. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/tagsAdd)", - version: "0.0.14", + version: "0.0.15", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/bulk-import/bulk-import.mjs b/components/shopify/actions/bulk-import/bulk-import.mjs index c95cbe272bd63..7406e2a35e926 100644 --- a/components/shopify/actions/bulk-import/bulk-import.mjs +++ b/components/shopify/actions/bulk-import/bulk-import.mjs @@ -7,7 +7,7 @@ export default { key: "shopify-bulk-import", name: "Bulk Import", description: "Execute bulk mutations by uploading a JSONL file containing mutation variables. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/bulkoperationrunmutation)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-article/create-article.mjs b/components/shopify/actions/create-article/create-article.mjs index c135407dbde8c..9a2c7aa56884c 100644 --- a/components/shopify/actions/create-article/create-article.mjs +++ b/components/shopify/actions/create-article/create-article.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-create-article", name: "Create Article", description: "Create a new blog article. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/articleCreate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-blog/create-blog.mjs b/components/shopify/actions/create-blog/create-blog.mjs index 351c2f4083587..59a4565ea25e2 100644 --- a/components/shopify/actions/create-blog/create-blog.mjs +++ b/components/shopify/actions/create-blog/create-blog.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-create-blog", name: "Create Blog", description: "Create a new blog. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/blogCreate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-custom-collection/create-custom-collection.mjs b/components/shopify/actions/create-custom-collection/create-custom-collection.mjs index 3ba041af08dc1..ffbd60c7c6110 100644 --- a/components/shopify/actions/create-custom-collection/create-custom-collection.mjs +++ b/components/shopify/actions/create-custom-collection/create-custom-collection.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-create-custom-collection", name: "Create Custom Collection", description: "Create a new custom collection. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionCreate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-metafield/create-metafield.mjs b/components/shopify/actions/create-metafield/create-metafield.mjs index 1e6509d5e6fd0..1e334e19ca2fa 100644 --- a/components/shopify/actions/create-metafield/create-metafield.mjs +++ b/components/shopify/actions/create-metafield/create-metafield.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-create-metafield", name: "Create Metafield", description: "Creates a metafield belonging to a resource. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/metafieldDefinitionCreate)", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-metaobject/create-metaobject.mjs b/components/shopify/actions/create-metaobject/create-metaobject.mjs index 25b25ed381dc7..c62cd3dd85a3f 100644 --- a/components/shopify/actions/create-metaobject/create-metaobject.mjs +++ b/components/shopify/actions/create-metaobject/create-metaobject.mjs @@ -7,7 +7,7 @@ export default { key: "shopify-create-metaobject", name: "Create Metaobject", description: "Creates a metaobject. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/metaobjectCreate)", - version: "0.0.7", + version: "0.0.8", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-page/create-page.mjs b/components/shopify/actions/create-page/create-page.mjs index 9bdc145618fb5..48fb425c6adf9 100644 --- a/components/shopify/actions/create-page/create-page.mjs +++ b/components/shopify/actions/create-page/create-page.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-create-page", name: "Create Page", description: "Create a new page. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/pageCreate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, 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 637081ddbc476..47dcc36756c12 100644 --- a/components/shopify/actions/create-product-variant/create-product-variant.mjs +++ b/components/shopify/actions/create-product-variant/create-product-variant.mjs @@ -9,7 +9,7 @@ export default { key: "shopify-create-product-variant", name: "Create Product Variant", description: "Create a new product variant. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productVariantsBulkCreate)", - version: "0.0.15", + version: "0.0.16", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/create-product/create-product.mjs b/components/shopify/actions/create-product/create-product.mjs index 1e44f5a9fceee..516ddae740128 100644 --- a/components/shopify/actions/create-product/create-product.mjs +++ b/components/shopify/actions/create-product/create-product.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-create-product", name: "Create Product", description: "Create a new product. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productCreate)", - version: "0.0.14", + version: "0.0.15", annotations: { destructiveHint: false, openWorldHint: true, 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 e0ecb76b5fa4a..c785daa640b59 100644 --- a/components/shopify/actions/create-smart-collection/create-smart-collection.mjs +++ b/components/shopify/actions/create-smart-collection/create-smart-collection.mjs @@ -7,7 +7,7 @@ export default { key: "shopify-create-smart-collection", name: "Create Smart Collection", description: "Creates a smart collection. You can fill in any number of rules by selecting more than one option in each prop.[See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/collectionCreate)", - version: "0.0.14", + version: "0.0.15", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/delete-article/delete-article.mjs b/components/shopify/actions/delete-article/delete-article.mjs index 7dae63c8e615a..ad91c99910887 100644 --- a/components/shopify/actions/delete-article/delete-article.mjs +++ b/components/shopify/actions/delete-article/delete-article.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-delete-article", name: "Delete Article", description: "Delete an existing blog article. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/articleDelete)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/delete-blog/delete-blog.mjs b/components/shopify/actions/delete-blog/delete-blog.mjs index 303722f3df334..cb153e583fc9d 100644 --- a/components/shopify/actions/delete-blog/delete-blog.mjs +++ b/components/shopify/actions/delete-blog/delete-blog.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-delete-blog", name: "Delete Blog", description: "Delete an existing blog. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/blogDelete)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/delete-metafield/delete-metafield.mjs b/components/shopify/actions/delete-metafield/delete-metafield.mjs index aa0314d7ff1e7..7cbc56a661ede 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 documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/metafieldsDelete)", - version: "0.0.10", + version: "0.0.11", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/delete-page/delete-page.mjs b/components/shopify/actions/delete-page/delete-page.mjs index bba5291aefbd9..6e4beb75e490c 100644 --- a/components/shopify/actions/delete-page/delete-page.mjs +++ b/components/shopify/actions/delete-page/delete-page.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-delete-page", name: "Delete Page", description: "Delete an existing page. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/pageDelete)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/get-articles/get-articles.mjs b/components/shopify/actions/get-articles/get-articles.mjs index f751ef8736046..5f80dc7cf90a8 100644 --- a/components/shopify/actions/get-articles/get-articles.mjs +++ b/components/shopify/actions/get-articles/get-articles.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-get-articles", name: "Get Articles", description: "Retrieve a list of all articles from a blog. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/articles)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs b/components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs new file mode 100644 index 0000000000000..e74273b61408c --- /dev/null +++ b/components/shopify/actions/get-assigned-fulfillment-orders/get-assigned-fulfillment-orders.mjs @@ -0,0 +1,59 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-get-assigned-fulfillment-orders", + name: "Get Assigned Fulfillment Orders", + description: "Retrieve a list of fulfillment orders assigned to a merchant location. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/assignedfulfillmentorders)", + version: "0.0.3", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has fulfillment services properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/admin-api/access-scopes)", + }, + sortKey: { + propDefinition: [ + shopify, + "sortKey", + ], + description: "The key to sort the results by. Options: `ID`", + }, + maxResults: { + propDefinition: [ + shopify, + "maxResults", + ], + }, + reverse: { + propDefinition: [ + shopify, + "reverse", + ], + }, + }, + async run({ $ }) { + const fulfillmentOrders = await this.shopify.getPaginated({ + resourceFn: this.shopify.listAssignedFulfillmentOrders, + resourceKeys: [ + "assignedFulfillmentOrders", + ], + variables: { + sortKey: this.sortKey, + reverse: this.reverse, + }, + max: this.maxResults, + }); + $.export("$summary", `Successfully retrieved ${fulfillmentOrders.length} fulfillment order${fulfillmentOrders.length === 1 + ? "" + : "s"}`); + return fulfillmentOrders; + }, +}; diff --git a/components/shopify/actions/get-customer/get-customer.mjs b/components/shopify/actions/get-customer/get-customer.mjs new file mode 100644 index 0000000000000..80bb6213d1382 --- /dev/null +++ b/components/shopify/actions/get-customer/get-customer.mjs @@ -0,0 +1,36 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-get-customer", + name: "Get Customer", + description: "Retrieve a single customer by ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customer)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", + }, + customerId: { + propDefinition: [ + shopify, + "customerId", + ], + }, + }, + async run({ $ }) { + const { customer } = await this.shopify.getCustomer({ + id: this.customerId, + }); + $.export("$summary", `Successfully retrieved customer \`${customer.email || customer.id}\``); + return customer; + }, +}; diff --git a/components/shopify/actions/get-customers/get-customers.mjs b/components/shopify/actions/get-customers/get-customers.mjs new file mode 100644 index 0000000000000..a20e1125d42ef --- /dev/null +++ b/components/shopify/actions/get-customers/get-customers.mjs @@ -0,0 +1,67 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-get-customers", + name: "Get Customers", + description: "Retrieve a list of customers. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers)", + version: "0.0.2", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // This app is not approved to access the Customer object. See https://shopify.dev/docs/apps/launch/protected-customer-data for more details." + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", + }, + query: { + type: "string", + label: "Query", + description: "The query string to filter customers. Example: `email:customer@example.com` or `state:ENABLED`. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/customers#argument-customers-query)", + optional: true, + }, + sortKey: { + propDefinition: [ + shopify, + "sortKey", + ], + description: "The key to sort the results by. Options: `CREATED_AT`, `ID`, `NAME`, `ORDERS_COUNT`, `STATE`, `TOTAL_SPENT`, `UPDATED_AT`", + }, + maxResults: { + propDefinition: [ + shopify, + "maxResults", + ], + }, + reverse: { + propDefinition: [ + shopify, + "reverse", + ], + }, + }, + async run({ $ }) { + const customers = await this.shopify.getPaginated({ + resourceFn: this.shopify.listCustomers, + resourceKeys: [ + "customers", + ], + variables: { + query: this.query, + sortKey: this.sortKey, + reverse: this.reverse, + }, + max: this.maxResults, + }); + $.export("$summary", `Successfully retrieved ${customers.length} customer${customers.length === 1 + ? "" + : "s"}`); + return customers; + }, +}; diff --git a/components/shopify/actions/get-draft-order/get-draft-order.mjs b/components/shopify/actions/get-draft-order/get-draft-order.mjs new file mode 100644 index 0000000000000..fa009b20810b6 --- /dev/null +++ b/components/shopify/actions/get-draft-order/get-draft-order.mjs @@ -0,0 +1,36 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-get-draft-order", + name: "Get Draft Order", + description: "Retrieve a single draft order by ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/draftorder)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has customer data properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", + }, + draftOrderId: { + propDefinition: [ + shopify, + "draftOrderId", + ], + }, + }, + async run({ $ }) { + const { draftOrder } = await this.shopify.getDraftOrder({ + id: this.draftOrderId, + }); + $.export("$summary", `Successfully retrieved draft order \`${draftOrder.name || draftOrder.id}\``); + return draftOrder; + }, +}; diff --git a/components/shopify/actions/get-draft-orders/get-draft-orders.mjs b/components/shopify/actions/get-draft-orders/get-draft-orders.mjs new file mode 100644 index 0000000000000..ab13a09f63a44 --- /dev/null +++ b/components/shopify/actions/get-draft-orders/get-draft-orders.mjs @@ -0,0 +1,66 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-get-draft-orders", + name: "Get Draft Orders", + description: "Retrieve a list of draft orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/draftorders)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has draft orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", + }, + query: { + type: "string", + label: "Query", + description: "Filter draft orders using [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). Available filters: `created_at` (time), `customer_id` (id), `id` (id with range support like `id:>=1234`), `status` (string, e.g., `status:OPEN`), `tag` (string), `updated_at` (time), `source` (string), or default search (case-insensitive multi-field search). Examples: `status:OPEN`, `created_at:>2019-12-01`, `customer_id:544365967`, `tag:fraud`. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/draftorders#argument-draftorders-query)", + optional: true, + }, + sortKey: { + propDefinition: [ + shopify, + "sortKey", + ], + description: "The key to sort the results by. Options: `CREATED_AT`, `ID`, `NUMBER`, `STATUS`, `TOTAL_PRICE`, `UPDATED_AT`, `CUSTOMER_NAME`", + }, + maxResults: { + propDefinition: [ + shopify, + "maxResults", + ], + }, + reverse: { + propDefinition: [ + shopify, + "reverse", + ], + }, + }, + async run({ $ }) { + const draftOrders = await this.shopify.getPaginated({ + resourceFn: this.shopify.listDraftOrders, + resourceKeys: [ + "draftOrders", + ], + variables: { + query: this.query, + sortKey: this.sortKey, + reverse: this.reverse, + }, + max: this.maxResults, + }); + $.export("$summary", `Successfully retrieved ${draftOrders.length} draft order${draftOrders.length === 1 + ? "" + : "s"}`); + return draftOrders; + }, +}; diff --git a/components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs b/components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs new file mode 100644 index 0000000000000..f5c6a39d6b847 --- /dev/null +++ b/components/shopify/actions/get-fulfillment-order/get-fulfillment-order.mjs @@ -0,0 +1,38 @@ +import shopify from "../../shopify.app.mjs"; +import { MAX_LIMIT } from "../../common/constants.mjs"; + +export default { + key: "shopify-get-fulfillment-order", + name: "Get Fulfillment Order", + description: "Retrieve a single fulfillment order by ID. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/fulfillmentorder)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has fulfillment orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/admin-api/access-scopes)", + }, + fulfillmentOrderId: { + propDefinition: [ + shopify, + "fulfillmentOrderId", + ], + }, + }, + async run({ $ }) { + const { fulfillmentOrder } = await this.shopify.getFulfillmentOrder({ + id: this.fulfillmentOrderId, + first: MAX_LIMIT, + }); + $.export("$summary", `Successfully retrieved fulfillment order \`${fulfillmentOrder.id}\``); + return fulfillmentOrder; + }, +}; diff --git a/components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs b/components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs new file mode 100644 index 0000000000000..a425b1fa36f31 --- /dev/null +++ b/components/shopify/actions/get-fulfillment-orders/get-fulfillment-orders.mjs @@ -0,0 +1,74 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-get-fulfillment-orders", + name: "Get Fulfillment Orders", + description: "Retrieve a list of fulfillment orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/fulfillmentorders)", + version: "0.0.5", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "This query retrieves fulfillment orders filtered according to the fulfillment order access scopes granted to the app. Use this to retrieve fulfillment orders assigned to merchant-managed locations, third-party fulfillment service locations, or all kinds of locations together. Requires `read_assigned_fulfillment_orders`, `read_merchant_managed_fulfillment_orders`, `read_third_party_fulfillment_orders`, or `read_marketplace_fulfillment_orders` access scope. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/objects/fulfillmentorder#api-access-scopes)", + }, + query: { + type: "string", + label: "Query", + description: "Filter fulfillment orders using [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). Available filters: `assigned_location_id` (id), `id` (id with range support like `id:>=1234`), `status` (string, e.g., `status:open`), `updated_at` (time), or default search (case-insensitive multi-field search). Examples: `status:open`, `assigned_location_id:12345`, `id:>=1000`, `updated_at:>2024-01-01`. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/fulfillmentorders#argument-fulfillmentorders-query)", + optional: true, + }, + includeClosed: { + type: "boolean", + label: "Include Closed", + description: "Whether to include closed fulfillment orders in the results. Defaults to false.", + optional: true, + default: false, + }, + sortKey: { + propDefinition: [ + shopify, + "sortKey", + ], + description: "The key to sort the results by. Options: `ID`", + }, + maxResults: { + propDefinition: [ + shopify, + "maxResults", + ], + }, + reverse: { + propDefinition: [ + shopify, + "reverse", + ], + }, + }, + async run({ $ }) { + const fulfillmentOrders = await this.shopify.getPaginated({ + resourceFn: this.shopify.listFulfillmentOrders, + resourceKeys: [ + "fulfillmentOrders", + ], + variables: { + query: this.query, + sortKey: this.sortKey, + reverse: this.reverse, + includeClosed: this.includeClosed, + }, + max: this.maxResults, + }); + $.export("$summary", `Successfully retrieved ${fulfillmentOrders.length} fulfillment order${fulfillmentOrders.length === 1 + ? "" + : "s"}`); + return fulfillmentOrders; + }, +}; diff --git a/components/shopify/actions/get-metafields/get-metafields.mjs b/components/shopify/actions/get-metafields/get-metafields.mjs index e28e3bed4a45e..ffc653c53af8d 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 documentation](https://shopify.dev/docs/api/admin-graphql/unstable/queries/metafields)", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/get-metaobjects/get-metaobjects.mjs b/components/shopify/actions/get-metaobjects/get-metaobjects.mjs index 2fe7156db2a69..0daa0df2ae156 100644 --- a/components/shopify/actions/get-metaobjects/get-metaobjects.mjs +++ b/components/shopify/actions/get-metaobjects/get-metaobjects.mjs @@ -7,7 +7,7 @@ export default { key: "shopify-get-metaobjects", name: "Get Metaobjects", description: "Retrieves a list of metaobjects. [See the documentation](https://shopify.dev/docs/api/admin-graphql/unstable/queries/metaobjects)", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/get-pages/get-pages.mjs b/components/shopify/actions/get-pages/get-pages.mjs index b5eaf70523d0d..fb36b42915232 100644 --- a/components/shopify/actions/get-pages/get-pages.mjs +++ b/components/shopify/actions/get-pages/get-pages.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-get-pages", name: "Get Pages", description: "Retrieve a list of all pages. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/pages)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs b/components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs index e035d81bcaa09..a3c8135a7219f 100644 --- a/components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs +++ b/components/shopify/actions/search-custom-collection-by-name/search-custom-collection-by-name.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-search-custom-collection-by-name", name: "Search Custom Collection by Name", description: "Search for a custom collection by name/title. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/collections)", - version: "0.0.7", + version: "0.0.8", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/search-orders/search-orders.mjs b/components/shopify/actions/search-orders/search-orders.mjs new file mode 100644 index 0000000000000..44ce9a4dd7240 --- /dev/null +++ b/components/shopify/actions/search-orders/search-orders.mjs @@ -0,0 +1,51 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-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.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", + }, + query: { + type: "string", + label: "Query", + description: "The search query. [See the documentation](https://shopify.dev/docs/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.listOrders, + resourceKeys: [ + "orders", + ], + variables: { + query: this.query, + }, + max: this.max, + }); + $.export("$summary", `Found ${orders.length} order${orders.length === 1 + ? "" + : "s"}`); + return orders; + }, +}; 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 61482a02334e9..2d8caf914df56 100644 --- a/components/shopify/actions/search-product-variant/search-product-variant.mjs +++ b/components/shopify/actions/search-product-variant/search-product-variant.mjs @@ -7,7 +7,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 documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/productVariants)", - version: "0.0.14", + version: "0.0.15", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/search-products/search-products.mjs b/components/shopify/actions/search-products/search-products.mjs index 93c73b50923ac..a02094fe6322d 100644 --- a/components/shopify/actions/search-products/search-products.mjs +++ b/components/shopify/actions/search-products/search-products.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-search-products", name: "Search for Products", description: "Search for products. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/queries/products)", - version: "0.0.14", + version: "0.0.15", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/shopify/actions/update-article/update-article.mjs b/components/shopify/actions/update-article/update-article.mjs index 041e9cc5ff18d..6f8ef2d12c3c7 100644 --- a/components/shopify/actions/update-article/update-article.mjs +++ b/components/shopify/actions/update-article/update-article.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-update-article", name: "Update Article", description: "Update a blog article. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/articleUpdate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, 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 4d16ee26717a2..cd989f718295b 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 documenation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetOnHandQuantities)", - version: "0.0.14", + version: "0.0.15", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/update-metafield/update-metafield.mjs b/components/shopify/actions/update-metafield/update-metafield.mjs index e80cb5082746a..2ba55be5bbf7a 100644 --- a/components/shopify/actions/update-metafield/update-metafield.mjs +++ b/components/shopify/actions/update-metafield/update-metafield.mjs @@ -5,7 +5,7 @@ export default { key: "shopify-update-metafield", name: "Update Metafield", description: "Updates a metafield belonging to a resource. [See the documentation]()", - version: "0.0.12", + version: "0.0.13", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/update-metaobject/update-metaobject.mjs b/components/shopify/actions/update-metaobject/update-metaobject.mjs index 7edcfd3edbf20..e7856ca32cb86 100644 --- a/components/shopify/actions/update-metaobject/update-metaobject.mjs +++ b/components/shopify/actions/update-metaobject/update-metaobject.mjs @@ -7,7 +7,7 @@ export default { key: "shopify-update-metaobject", name: "Update Metaobject", description: "Updates a metaobject. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/metaobjectUpdate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/update-order/update-order.mjs b/components/shopify/actions/update-order/update-order.mjs new file mode 100644 index 0000000000000..20ca97e46fcff --- /dev/null +++ b/components/shopify/actions/update-order/update-order.mjs @@ -0,0 +1,84 @@ +import shopify from "../../shopify.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "shopify-update-order", + name: "Update Order", + description: "Update an existing order. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderupdate)", + version: "0.0.1", + annotations: { + destructiveHint: true, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + shopify, + // eslint-disable-next-line pipedream/props-label, pipedream/props-description + info: { + type: "alert", + alertType: "info", + content: "Please verify that the Shopify shop has orders properly defined and that your API credentials have been granted this access scope. [See the documentation](https://shopify.dev/docs/apps/launch/protected-customer-data)", + }, + orderId: { + propDefinition: [ + shopify, + "orderId", + ], + }, + email: { + type: "string", + label: "Email", + description: "The email address associated with the order", + optional: true, + }, + note: { + type: "string", + label: "Note", + description: "An optional note to attach to the order", + optional: true, + }, + tags: { + propDefinition: [ + shopify, + "tags", + ], + optional: true, + }, + metafields: { + propDefinition: [ + shopify, + "metafields", + ], + }, + }, + async run({ $ }) { + const input = { + id: this.orderId, + }; + + if (this.email) { + input.email = this.email; + } + if (this.note) { + input.note = this.note; + } + if (this.tags) { + input.tags = this.tags; + } + if (this.metafields) { + input.metafields = utils.parseJson(this.metafields); + } + + const response = await this.shopify.updateOrder({ + input, + }); + + if (response.orderUpdate.userErrors.length > 0) { + throw new Error(response.orderUpdate.userErrors[0].message); + } + + $.export("$summary", `Successfully updated order \`${response.orderUpdate.order.name}\``); + return response; + }, +}; diff --git a/components/shopify/actions/update-page/update-page.mjs b/components/shopify/actions/update-page/update-page.mjs index 2eb2f9ded1ab1..af4edf4c85730 100644 --- a/components/shopify/actions/update-page/update-page.mjs +++ b/components/shopify/actions/update-page/update-page.mjs @@ -4,7 +4,7 @@ export default { key: "shopify-update-page", name: "Update Page", description: "Update an existing page. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/pageUpdate)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, 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 dd448abff3bb0..7cd961aa24071 100644 --- a/components/shopify/actions/update-product-variant/update-product-variant.mjs +++ b/components/shopify/actions/update-product-variant/update-product-variant.mjs @@ -9,7 +9,7 @@ export default { key: "shopify-update-product-variant", name: "Update Product Variant", description: "Update an existing product variant. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productVariantsBulkUpdate)", - version: "0.0.17", + version: "0.0.18", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/actions/update-product/update-product.mjs b/components/shopify/actions/update-product/update-product.mjs index 8e0976e024752..255f978fa9235 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 documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productUpdate)", - version: "0.1.6", + version: "0.1.7", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/shopify/common/mutations.mjs b/components/shopify/common/mutations.mjs index 6190d6e2b0404..28f58b570b6d4 100644 --- a/components/shopify/common/mutations.mjs +++ b/components/shopify/common/mutations.mjs @@ -415,6 +415,24 @@ const DELETE_METAFIELD = ` } `; +const UPDATE_ORDER = ` + mutation orderUpdate($input: OrderInput!) { + orderUpdate(input: $input) { + order { + id + name + email + tags + note + } + userErrors { + field + message + } + } + } +`; + export default { CREATE_WEBHOOK, DELETE_WEBHOOK, @@ -439,4 +457,5 @@ export default { DELETE_BLOG, DELETE_PAGE, DELETE_METAFIELD, + UPDATE_ORDER, }; diff --git a/components/shopify/common/queries.mjs b/components/shopify/common/queries.mjs index 8fffc59ac91fb..3bc7e5adb5198 100644 --- a/components/shopify/common/queries.mjs +++ b/components/shopify/common/queries.mjs @@ -467,6 +467,685 @@ const GET_METAOBJECT = ` } `; +const LIST_ORDERS = ` + query ($first: Int, $after: String, $reverse: Boolean, $query: String){ + orders(first: $first, after: $after, reverse: $reverse, query: $query) { + nodes { + id + name + createdAt + updatedAt + processedAt + currencyCode + displayFinancialStatus + displayFulfillmentStatus + closed + confirmed + test + note + tags + totalPriceSet { + shopMoney { + amount + currencyCode + } + presentmentMoney { + amount + currencyCode + } + } + subtotalPriceSet { + shopMoney { + amount + currencyCode + } + presentmentMoney { + amount + currencyCode + } + } + totalTaxSet { + shopMoney { + amount + currencyCode + } + presentmentMoney { + amount + currencyCode + } + } + totalShippingPriceSet { + shopMoney { + amount + currencyCode + } + presentmentMoney { + amount + currencyCode + } + } + customer { + id + displayName + firstName + lastName + email + phone + defaultAddress { + id + address1 + address2 + city + province + zip + country + company + } + } + shippingAddress { + address1 + address2 + city + province + zip + country + company + firstName + lastName + } + lineItems(first: 50) { + edges { + node { + id + title + quantity + variantTitle + vendor + fulfillmentStatus + originalUnitPriceSet { + shopMoney { + amount + currencyCode + } + presentmentMoney { + amount + currencyCode + } + } + variant { + id + title + sku + price + image { + url + altText + } + } + product { + id + title + handle + vendor + productType + images(first: 1) { + edges { + node { + url + altText + } + } + } + } + } + } + } + fulfillments { + id + status + displayStatus + } + metafields (first: $first) { + nodes { + id + key + namespace + value + type + } + } + } + pageInfo { + endCursor + hasNextPage + } + } + } +`; + +const GET_DRAFT_ORDER = ` + query ($id: ID!) { + draftOrder(id: $id) { + id + name + email + note2 + createdAt + updatedAt + completedAt + invoiceSentAt + status + totalPriceSet + subtotalPriceSet + totalShippingPriceSet + totalTaxSet + currencyCode + taxExempt + taxesIncluded + invoiceUrl + billingAddress { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + name + latitude + longitude + } + shippingAddress { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + name + latitude + longitude + } + customer { + id + defaultEmailAddress + firstName + lastName + phone + state + tags + } + lineItems(first: 250) { + nodes { + id + name + quantity + sku + vendor + title + requiresShipping + taxable + weight { + unit + value + } + product { + id + title + } + variant { + id + title + } + } + } + appliedDiscount { + title + value + valueType + } + order { + id + name + } + shippingLine { + id + title + code + source + custom + carrierIdentifier + deliveryCategory + discountedPriceSet { + presentmentMoney { + amount + currencyCode + } + shopMoney { + amount + currencyCode + } + } + } + taxLines { + title + rate + ratePercentage + priceSet { + presentmentMoney { + amount + currencyCode + } + shopMoney { + amount + currencyCode + } + } + } + tags + } + } +`; + +const LIST_DRAFT_ORDERS = ` + query ($first: Int, $after: String, $reverse: Boolean, $sortKey: DraftOrderSortKeys, $query: String) { + draftOrders(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey, query: $query) { + nodes { + id + name + email + note2 + createdAt + updatedAt + completedAt + invoiceSentAt + status + totalPrice + subtotalPrice + totalShippingPrice + totalTax + currencyCode + taxExempt + taxesIncluded + invoiceUrl + billingAddress { + address1 + address2 + city + company + country + countryCode + firstName + lastName + phone + province + provinceCode + zip + name + latitude + longitude + } + shippingAddress { + address1 + address2 + city + company + country + countryCode + firstName + lastName + phone + province + provinceCode + zip + name + latitude + longitude + } + customer { + id + email + firstName + lastName + phone + state + tags + } + lineItems(first: 250) { + nodes { + id + name + quantity + sku + vendor + title + requiresShipping + taxable + weight { + unit + value + } + product { + id + title + } + variant { + id + title + } + } + } + appliedDiscount { + title + value + valueType + } + order { + id + name + } + shippingLine { + id + title + code + source + custom + carrierIdentifier + deliveryCategory + discountedPriceSet { + presentmentMoney { + amount + currencyCode + } + shopMoney { + amount + currencyCode + } + } + } + taxLines { + title + rate + ratePercentage + priceSet { + presentmentMoney { + amount + currencyCode + } + shopMoney { + amount + currencyCode + } + } + } + tags + } + pageInfo { + endCursor + hasNextPage + } + } + } +`; + +const GET_CUSTOMER = ` + query ($id: ID!) { + customer(id: $id) { + id + firstName + lastName + createdAt + updatedAt + state + note + verifiedEmail + taxExempt + tags + addresses { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + } + defaultAddress { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + } + } + } +`; + +const LIST_CUSTOMERS = ` + query ($first: Int, $after: String, $reverse: Boolean, $sortKey: CustomerSortKeys, $query: String) { + customers(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey, query: $query) { + nodes { + id + email + firstName + lastName + phone + createdAt + updatedAt + state + note + verifiedEmail + taxExempt + tags + addresses { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + } + defaultAddress { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + } + } + pageInfo { + endCursor + } + } + } +`; + +const LIST_ASSIGNED_FULFILLMENT_ORDERS = ` + query ($first: Int, $after: String, $reverse: Boolean, $sortKey: FulfillmentOrderSortKeys) { + assignedFulfillmentOrders(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey) { + nodes { + id + status + createdAt + updatedAt + requestStatus + order { + id + name + } + assignedLocation { + location { + id + name + } + } + destination { + address1 + address2 + city + company + countryCodeV2 + firstName + lastName + phone + province + zip + } + lineItems(first: $first) { + nodes { + id + remainingQuantity + totalQuantity + lineItem { + id + name + sku + } + } + } + } + pageInfo { + endCursor + } + } + } +`; + +const GET_FULFILLMENT_ORDER = ` + query ($id: ID!, $first: Int) { + fulfillmentOrder(id: $id) { + id + status + createdAt + updatedAt + requestStatus + order { + id + name + } + assignedLocation { + location { + id + name + } + } + destination { + address1 + address2 + city + company + country + countryCodeV2 + firstName + lastName + phone + province + provinceCode + zip + } + lineItems(first: $first) { + nodes { + id + remainingQuantity + totalQuantity + lineItem { + id + name + sku + } + } + } + } + } +`; + +const LIST_FULFILLMENT_ORDERS = ` + query ($first: Int, $after: String, $reverse: Boolean, $sortKey: FulfillmentOrderSortKeys, $query: String) { + fulfillmentOrders(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey, query: $query) { + nodes { + id + status + createdAt + updatedAt + requestStatus + order { + id + name + } + assignedLocation { + location { + id + name + } + } + destination { + address1 + address2 + city + company + countryCodeV2 + firstName + lastName + phone + province + zip + } + lineItems(first: $first) { + nodes { + id + remainingQuantity + totalQuantity + lineItem { + id + name + sku + } + } + } + } + pageInfo { + endCursor + } + } + } +`; + export default { LIST_ABANDONED_CHECKOUTS, LIST_BLOG_ARTICLES, @@ -485,4 +1164,12 @@ export default { GET_PAGE, GET_ARTICLE, GET_METAOBJECT, + LIST_ORDERS, + GET_DRAFT_ORDER, + LIST_DRAFT_ORDERS, + GET_CUSTOMER, + LIST_CUSTOMERS, + LIST_ASSIGNED_FULFILLMENT_ORDERS, + GET_FULFILLMENT_ORDER, + LIST_FULFILLMENT_ORDERS, }; diff --git a/components/shopify/package.json b/components/shopify/package.json index 4d8a401b32b39..b816c664f0b57 100644 --- a/components/shopify/package.json +++ b/components/shopify/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/shopify", - "version": "0.7.2", + "version": "0.8.0", "description": "Pipedream Shopify Components", "main": "shopify.app.mjs", "keywords": [ diff --git a/components/shopify/shopify.app.mjs b/components/shopify/shopify.app.mjs index fc261c0952cbe..d8a2f162f8942 100644 --- a/components/shopify/shopify.app.mjs +++ b/components/shopify/shopify.app.mjs @@ -244,6 +244,66 @@ export default { 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, }, + orderId: { + type: "string", + label: "Order ID", + description: "The identifier of an order", + async options({ prevContext }) { + return this.getPropOptions({ + resourceFn: this.listOrders, + resourceKeys: [ + "orders", + ], + labelKey: "name", + prevContext, + }); + }, + }, + draftOrderId: { + type: "string", + label: "Draft Order ID", + description: "The identifier of a draft order", + async options({ prevContext }) { + return this.getPropOptions({ + resourceFn: this.listDraftOrders, + resourceKeys: [ + "draftOrders", + ], + labelKey: "name", + prevContext, + }); + }, + }, + customerId: { + type: "string", + label: "Customer ID", + description: "The identifier of a customer", + async options({ prevContext }) { + return this.getPropOptions({ + resourceFn: this.listCustomers, + resourceKeys: [ + "customers", + ], + labelKey: "email", + prevContext, + }); + }, + }, + fulfillmentOrderId: { + type: "string", + label: "Fulfillment Order ID", + description: "The identifier of a fulfillment order", + async options({ prevContext }) { + return this.getPropOptions({ + resourceFn: this.listAssignedFulfillmentOrders, + resourceKeys: [ + "assignedFulfillmentOrders", + ], + labelKey: "id", + prevContext, + }); + }, + }, }, methods: { getShopId() { @@ -457,6 +517,33 @@ export default { deleteMetafield(variables) { return this._makeGraphQlRequest(mutations.DELETE_METAFIELD, variables); }, + listOrders(variables) { + return this._makeGraphQlRequest(queries.LIST_ORDERS, variables); + }, + getDraftOrder(variables) { + return this._makeGraphQlRequest(queries.GET_DRAFT_ORDER, variables); + }, + listDraftOrders(variables) { + return this._makeGraphQlRequest(queries.LIST_DRAFT_ORDERS, variables); + }, + updateOrder(variables) { + return this._makeGraphQlRequest(mutations.UPDATE_ORDER, variables); + }, + getCustomer(variables) { + return this._makeGraphQlRequest(queries.GET_CUSTOMER, variables); + }, + listCustomers(variables) { + return this._makeGraphQlRequest(queries.LIST_CUSTOMERS, variables); + }, + listAssignedFulfillmentOrders(variables) { + return this._makeGraphQlRequest(queries.LIST_ASSIGNED_FULFILLMENT_ORDERS, variables); + }, + getFulfillmentOrder(variables) { + return this._makeGraphQlRequest(queries.GET_FULFILLMENT_ORDER, variables); + }, + listFulfillmentOrders(variables) { + return this._makeGraphQlRequest(queries.LIST_FULFILLMENT_ORDERS, variables); + }, async *paginate({ resourceFn, resourceKeys = [], variables = {}, max, }) { diff --git a/components/shopify/sources/collection-updated/collection-updated.mjs b/components/shopify/sources/collection-updated/collection-updated.mjs index 2cb16d123e55f..55a50cdf8474b 100644 --- a/components/shopify/sources/collection-updated/collection-updated.mjs +++ b/components/shopify/sources/collection-updated/collection-updated.mjs @@ -6,7 +6,7 @@ export default { key: "shopify-collection-updated", name: "Collection Updated (Instant)", description: "Emit new event whenever a collection is updated, including whenever products are added or removed from a collection.", - version: "0.0.7", + version: "0.0.8", type: "source", dedupe: "unique", methods: { 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 1b34da849c3b5..f204c0a91da40 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.14", + version: "0.0.15", 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 a9aa10a856b6b..5cafb6ecb8697 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 { key: "shopify-new-abandoned-cart", name: "New Abandoned Cart", description: "Emit new event each time a user abandons their cart.", - version: "0.0.20", + version: "0.0.21", type: "source", dedupe: "unique", methods: { diff --git a/components/shopify/sources/new-article/new-article.mjs b/components/shopify/sources/new-article/new-article.mjs index 7dac9adcaaf8c..4daf97c47334d 100644 --- a/components/shopify/sources/new-article/new-article.mjs +++ b/components/shopify/sources/new-article/new-article.mjs @@ -7,7 +7,7 @@ export default { name: "New Article", type: "source", description: "Emit new event for each new article in a blog.", - version: "0.0.19", + version: "0.0.20", dedupe: "unique", props: { ...common.props, 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 60adf344928ed..5e2a955e3ebcb 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.15", + version: "0.0.16", dedupe: "unique", props: { ...common.props, diff --git a/components/shopify/sources/new-page/new-page.mjs b/components/shopify/sources/new-page/new-page.mjs index 60ce927cb473d..e3bcd1e60275b 100644 --- a/components/shopify/sources/new-page/new-page.mjs +++ b/components/shopify/sources/new-page/new-page.mjs @@ -7,7 +7,7 @@ export default { name: "New Page", type: "source", description: "Emit new event for each new page published.", - version: "0.0.19", + version: "0.0.20", 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 00a00a66a7fbe..bc60c95e276fb 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.15", + version: "0.0.16", dedupe: "unique", methods: { ...common.methods,