From 3c67ef4d93c3517c7d22b5ad9f2df4d5c77a82ea Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 15:32:17 -0300 Subject: [PATCH 1/6] Add Shopware actions for order management - Implemented actions to create, retrieve, list, update orders, and manage payment and shipping methods. - Introduced utility functions for parsing objects and constants for pagination limits. - Enhanced prop definitions in the Shopware app for better integration and usability. --- .../actions/create-order/create-order.mjs | 106 +++++++ .../shopware/actions/get-order/get-order.mjs | 32 +++ .../actions/list-orders/list-orders.mjs | 38 +++ .../list-payment-methods.mjs | 39 +++ .../list-shipping-methods.mjs | 39 +++ .../actions/update-order/update-order.mjs | 95 +++++++ components/shopware/common/constants.mjs | 1 + components/shopware/common/utils.mjs | 24 ++ components/shopware/shopware.app.mjs | 263 +++++++++++++++++- 9 files changed, 633 insertions(+), 4 deletions(-) create mode 100644 components/shopware/actions/create-order/create-order.mjs create mode 100644 components/shopware/actions/get-order/get-order.mjs create mode 100644 components/shopware/actions/list-orders/list-orders.mjs create mode 100644 components/shopware/actions/list-payment-methods/list-payment-methods.mjs create mode 100644 components/shopware/actions/list-shipping-methods/list-shipping-methods.mjs create mode 100644 components/shopware/actions/update-order/update-order.mjs create mode 100644 components/shopware/common/constants.mjs create mode 100644 components/shopware/common/utils.mjs diff --git a/components/shopware/actions/create-order/create-order.mjs b/components/shopware/actions/create-order/create-order.mjs new file mode 100644 index 0000000000000..95a08b8460ecd --- /dev/null +++ b/components/shopware/actions/create-order/create-order.mjs @@ -0,0 +1,106 @@ +import { parseObject } from "../../common/utils.mjs"; +import shopware from "../../shopware.app.mjs"; + +export default { + key: "shopware-create-order", + name: "Create Order", + description: "Create a new order. [See the documentation](https://shopware.stoplight.io/docs/admin-api/52ce9936f6ea4-create-a-new-order-resources)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + shopware, + billingAddressId: { + propDefinition: [ + shopware, + "customerAddressId", + ], + label: "Billing Address ID", + description: "The ID of the billing address to use for the order", + }, + currencyId: { + propDefinition: [ + shopware, + "currencyId", + ], + }, + salesChannelId: { + propDefinition: [ + shopware, + "salesChannelId", + ], + }, + stateId: { + propDefinition: [ + shopware, + "stateId", + () => ({ + type: "order.state", + }), + ], + }, + orderDateTime: { + type: "string", + label: "Order Date Time", + description: "The date and time the order was created", + }, + priceObject: { + type: "object", + label: "Price Object", + description: "Price object to use for the order. Example: `{ \"netPrice\": 1.00, \"totalPrice\": 1.00, \"positionPrice\": 1.00, \"rawTotal\": 1.00, \"taxStatus\": \"Free\", \"calculatedTaxes\": {}, \"taxRules\": {} }` [See the documentation](https://shopware.stoplight.io/docs/admin-api/52ce9936f6ea4-create-a-new-order-resources) for more information.", + }, + shippingCostsObject: { + type: "object", + label: "Shipping Costs Object", + description: "Shipping costs object to use for the order. Example: `{ \"unitPrice\": 1.00, \"totalPrice\": 1.00, \"quantity\": 1, \"calculatedTaxes\": {}, \"taxRules\": {} }` [See the documentation](https://shopware.stoplight.io/docs/admin-api/52ce9936f6ea4-create-a-new-order-resources) for more information.", + }, + currencyObject: { + type: "object", + label: "Currency Object", + description: "Currency object to use for the order. Example: `{ \"factor\": 1.0, \"symbol\": \"€\", \"isoCode\": \"EUR\", \"itemRounding\": { \"decimals\": 2, \"interval\": 1.0, \"roundForNet\": true }, \"totalRounding\": { \"decimals\": 2, \"interval\": 1.0, \"roundForNet\": true } }` [See the documentation](https://shopware.stoplight.io/docs/admin-api/52ce9936f6ea4-create-a-new-order-resources) for more information.", + }, + currencyFactor: { + type: "string", + label: "Currency Factor", + description: "Rate at which currency is exchanged", + }, + itemRounding: { + type: "object", + label: "Item Rounding", + description: "The rounding method to use for the order items", + }, + totalRounding: { + type: "object", + label: "Total Rounding", + description: "The rounding method to use for the order total", + }, + }, + async run({ $ }) { + const { data } = await this.shopware.createOrder({ + $, + params: { + _response: "json", + }, + data: { + billingAddressId: this.billingAddressId, + currencyId: this.currencyId, + salesChannelId: this.salesChannelId, + stateId: this.stateId, + orderDateTime: this.orderDateTime, + price: parseObject(this.priceObject), + shippingCosts: parseObject(this.shippingCostsObject), + currencyFactor: parseFloat(this.currencyFactor), + currency: parseObject(this.currency), + itemRounding: parseObject(this.itemRounding), + totalRounding: parseObject(this.totalRounding), + }, + }); + + $.export("$summary", `Successfully created order with ID: ${data.id}`); + return data; + }, +}; diff --git a/components/shopware/actions/get-order/get-order.mjs b/components/shopware/actions/get-order/get-order.mjs new file mode 100644 index 0000000000000..75d9de03950f2 --- /dev/null +++ b/components/shopware/actions/get-order/get-order.mjs @@ -0,0 +1,32 @@ +import shopware from "../../shopware.app.mjs"; + +export default { + key: "shopware-get-order", + name: "Get Order", + description: "Get an order by ID. [See the documentation](https://shopware.stoplight.io/docs/admin-api/0b7d9d489b841-search-for-the-order-resources)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + shopware, + orderId: { + propDefinition: [ + shopware, + "orderId", + ], + }, + }, + async run({ $ }) { + const { data } = await this.shopware.getOrder({ + $, + orderId: this.orderId, + }); + + $.export("$summary", `Successfully retrieved order with ID: ${data.id}`); + return data; + }, +}; diff --git a/components/shopware/actions/list-orders/list-orders.mjs b/components/shopware/actions/list-orders/list-orders.mjs new file mode 100644 index 0000000000000..b745df0e066e9 --- /dev/null +++ b/components/shopware/actions/list-orders/list-orders.mjs @@ -0,0 +1,38 @@ +import shopware from "../../shopware.app.mjs"; + +export default { + key: "shopware-list-orders", + name: "List Orders", + description: "List all orders. [See the documentation](https://shopware.stoplight.io/docs/admin-api/f95b395c5ae73-list-with-basic-information-of-order-resources)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + shopware, + maxResults: { + type: "integer", + label: "Max Results", + description: "The maximum number of orders to return", + default: 100, + optional: true, + }, + }, + async run({ $ }) { + const orders = this.shopware.paginate({ + $, + fn: this.shopware.listOrders, + maxResults: this.maxResults, + }); + + const data = []; + for await (const order of orders) { + data.push(order); + } + $.export("$summary", `Successfully retrieved ${data.length} orders`); + return data; + }, +}; diff --git a/components/shopware/actions/list-payment-methods/list-payment-methods.mjs b/components/shopware/actions/list-payment-methods/list-payment-methods.mjs new file mode 100644 index 0000000000000..afda2687fb596 --- /dev/null +++ b/components/shopware/actions/list-payment-methods/list-payment-methods.mjs @@ -0,0 +1,39 @@ +import shopware from "../../shopware.app.mjs"; + +export default { + key: "shopware-list-payment-methods", + name: "List Payment Methods", + description: "List all payment methods. [See the documentation](https://shopware.stoplight.io/docs/admin-api/0ffc5a34d40e4-list-with-basic-information-of-payment-method-resources)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + shopware, + maxResults: { + type: "integer", + label: "Max Results", + description: "The maximum number of payment methods to return", + default: 100, + optional: true, + }, + }, + async run({ $ }) { + const response = this.shopware.paginate({ + $, + fn: this.shopware.listPaymentMethods, + maxResults: this.maxResults, + }); + + const data = []; + for await (const paymentMethod of response) { + data.push(paymentMethod); + } + + $.export("$summary", `Successfully retrieved ${data.length} payment methods`); + return data; + }, +}; diff --git a/components/shopware/actions/list-shipping-methods/list-shipping-methods.mjs b/components/shopware/actions/list-shipping-methods/list-shipping-methods.mjs new file mode 100644 index 0000000000000..77d0a51bc2758 --- /dev/null +++ b/components/shopware/actions/list-shipping-methods/list-shipping-methods.mjs @@ -0,0 +1,39 @@ +import shopware from "../../shopware.app.mjs"; + +export default { + key: "shopware-list-shipping-methods", + name: "List Shipping Methods", + description: "List all shipping methods. [See the documentation](https://shopware.stoplight.io/docs/admin-api/7d33c6b3c151d-list-with-basic-information-of-shipping-method-resources)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + shopware, + maxResults: { + type: "integer", + label: "Max Results", + description: "The maximum number of shipping methods to return", + default: 100, + optional: true, + }, + }, + async run({ $ }) { + const response = this.shopware.paginate({ + $, + fn: this.shopware.listShippingMethods, + maxResults: this.maxResults, + }); + + const data = []; + for await (const shippingMethod of response) { + data.push(shippingMethod); + } + + $.export("$summary", `Successfully retrieved ${data.length} shipping methods`); + return data; + }, +}; diff --git a/components/shopware/actions/update-order/update-order.mjs b/components/shopware/actions/update-order/update-order.mjs new file mode 100644 index 0000000000000..cd08f301acd63 --- /dev/null +++ b/components/shopware/actions/update-order/update-order.mjs @@ -0,0 +1,95 @@ +import { parseObject } from "../../common/utils.mjs"; +import shopware from "../../shopware.app.mjs"; + +export default { + key: "shopware-update-order", + name: "Update Order", + description: "Partially update information about a Order resource. [See the documentation](https://shopware.stoplight.io/docs/admin-api/3cc867261ff28-partially-update-information-about-a-order-resource)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + shopware, + orderId: { + propDefinition: [ + shopware, + "orderId", + ], + }, + tagIds: { + propDefinition: [ + shopware, + "tagIds", + ], + withLabel: true, + optional: true, + }, + ruleIds: { + propDefinition: [ + shopware, + "ruleIds", + ], + optional: true, + }, + orderNumber: { + type: "string", + label: "Order Number", + description: "Unique number associated with every order", + optional: true, + }, + affiliateCode: { + type: "string", + label: "Affiliate Code", + description: "An affiliate code is an identification option with which website operators can mark outgoing links", + optional: true, + }, + campaignCode: { + type: "string", + label: "Campaign Code", + description: "A campaign code is the globally unique identifier for a campaign", + optional: true, + }, + customerComment: { + type: "string", + label: "Customer Comment", + description: "Comments given by comments", + optional: true, + }, + internalComment: { + type: "string", + label: "Internal Comment", + description: "Comments given by the internal user", + optional: true, + }, + }, + async run({ $ }) { + const data = await this.shopware.updateOrder({ + $, + orderId: this.orderId, + params: { + _response: "json", + }, + data: { + tags: parseObject(this.tagIds)?.map(({ + value, label, + }) => ({ + id: value, + name: label, + })), + rules: parseObject(this.ruleIds), + orderNumber: this.orderNumber, + affiliateCode: this.affiliateCode, + campaignCode: this.campaignCode, + customerComment: this.customerComment, + internalComment: this.internalComment, + }, + }); + + $.export("$summary", `Successfully retrieved order with ID: ${this.orderId}`); + return data; + }, +}; diff --git a/components/shopware/common/constants.mjs b/components/shopware/common/constants.mjs new file mode 100644 index 0000000000000..ea830c15a04cb --- /dev/null +++ b/components/shopware/common/constants.mjs @@ -0,0 +1 @@ +export const LIMIT = 100; diff --git a/components/shopware/common/utils.mjs b/components/shopware/common/utils.mjs new file mode 100644 index 0000000000000..dcc9cc61f6f41 --- /dev/null +++ b/components/shopware/common/utils.mjs @@ -0,0 +1,24 @@ +export const parseObject = (obj) => { + if (!obj) return undefined; + + if (Array.isArray(obj)) { + return obj.map((item) => { + if (typeof item === "string") { + try { + return JSON.parse(item); + } catch (e) { + return item; + } + } + return item; + }); + } + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + return obj; +}; diff --git a/components/shopware/shopware.app.mjs b/components/shopware/shopware.app.mjs index 6642bccf02b7f..8d32ce723dc4b 100644 --- a/components/shopware/shopware.app.mjs +++ b/components/shopware/shopware.app.mjs @@ -1,11 +1,266 @@ +import { axios } from "@pipedream/platform"; +import { LIMIT } from "./common/constants.mjs"; + export default { type: "app", app: "shopware", - propDefinitions: {}, + propDefinitions: { + orderId: { + type: "string", + label: "Order ID", + description: "The ID of the order to get", + async options({ + page, field = "id", + }) { + const { data } = await this.listOrders({ + params: { + limit: LIMIT, + offset: (page - 1) * LIMIT, + }, + }); + + return data.map((item) => ({ + label: `Order #${item.orderNumber}`, + value: item[field], + })); + }, + }, + tagIds: { + type: "string[]", + label: "Tag IDs", + description: "The IDs of the tags to get", + async options({ page }) { + const { data } = await this.listTags({ + params: { + page: page + 1, + }, + }); + return data.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + ruleIds: { + type: "string[]", + label: "Rule IDs", + description: "The IDs of the rules to get", + async options({ page }) { + const { data } = await this.listRules({ + params: { + page: page + 1, + }, + }); + return data.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + currencyId: { + type: "string", + label: "Currency ID", + description: "The ID of the currency to use for the order", + async options({ page }) { + const { data } = await this.listCurrencies({ + params: { + page: page + 1, + }, + }); + return data.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + salesChannelId: { + type: "string", + label: "Sales Channel ID", + description: "The ID of the sales channel to use for the order", + async options({ page }) { + const { data } = await this.listSalesChannels({ + params: { + page: page + 1, + }, + }); + return data.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + stateId: { + type: "string", + label: "State ID", + description: "The ID of the state to use for the order", + async options({ type }) { + const { data } = await this.listStates(); + const stateId = data.find(({ technicalName }) => technicalName === type)?.id; + const { data: machineStates } = await this.listMachineStates(); + const machineStateIds = machineStates + .filter(({ stateMachineId }) => stateMachineId === stateId); + return machineStateIds.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + customerAddressId: { + type: "string", + label: "Customer Address ID", + description: "The ID of the customer address to use for the order", + async options({ page }) { + const { data } = await this.listCustomerAddresses({ + params: { + page: page + 1, + }, + }); + return data.map(({ + firstName, lastName, street, city, zipcode, id: value, + }) => ({ + label: `${firstName} ${lastName} - ${street} ${city} ${zipcode}`, + value, + })); + }, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _apiUrl() { + return `${this.$auth.server_url}/api`; + }, + _getHeaders() { + return { + Authorization: `Bearer ${this.$auth.oauth_access_token}`, + }; + }, + _makeRequest({ + $ = this, path, ...opts + }) { + return axios($, { + url: `${this._apiUrl()}/${path}`, + headers: this._getHeaders(), + ...opts, + }); + }, + listOrders(args = {}) { + return this._makeRequest({ + path: "order", + ...args, + }); + }, + listTags(args = {}) { + return this._makeRequest({ + path: "tag", + ...args, + }); + }, + listRules(args = {}) { + return this._makeRequest({ + path: "rule", + ...args, + }); + }, + listCurrencies(args = {}) { + return this._makeRequest({ + path: "currency", + ...args, + }); + }, + listCustomerAddresses(args = {}) { + return this._makeRequest({ + path: "customer-address", + ...args, + }); + }, + listSalesChannels(args = {}) { + return this._makeRequest({ + path: "sales-channel", + ...args, + }); + }, + listStates(args = {}) { + return this._makeRequest({ + path: "state-machine", + ...args, + }); + }, + listMachineStates(args = {}) { + return this._makeRequest({ + path: "state-machine-state", + ...args, + }); + }, + getOrder({ + orderId, ...args + } = {}) { + return this._makeRequest({ + path: `order/${orderId}`, + ...args, + }); + }, + createOrder(args = {}) { + return this._makeRequest({ + path: "order", + method: "POST", + ...args, + }); + }, + listPaymentMethods(args = {}) { + return this._makeRequest({ + path: "payment-method", + ...args, + }); + }, + listShippingMethods(args = {}) { + return this._makeRequest({ + path: "shipping-method", + ...args, + }); + }, + updateOrder({ + orderId, ...args + }) { + return this._makeRequest({ + path: `order/${orderId}`, + method: "PATCH", + ...args, + }); + }, + async *paginate({ + fn, params = {}, maxResults = null, ...opts + }) { + let hasMore = false; + let count = 0; + let page = 0; + + do { + params.page = ++page; + params.limit = LIMIT; + const { data } = await fn({ + params, + ...opts, + }); + for (const d of data) { + yield d; + + if (maxResults && ++count === maxResults) { + return count; + } + } + + hasMore = data.length; + + } while (hasMore); }, }, }; From 01dbb82562ecdb393a86278158ece52d6f1b0a2d Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 15:42:23 -0300 Subject: [PATCH 2/6] Bump Shopware component version to 0.1.0 and add dependency on @pipedream/platform --- components/shopware/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/shopware/package.json b/components/shopware/package.json index cf6c437862624..c8e06279092eb 100644 --- a/components/shopware/package.json +++ b/components/shopware/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/shopware", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Shopware Components", "main": "shopware.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} From 71e770e04e76e94de5e974cd7ceb9b94e76c8c54 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 15:44:27 -0300 Subject: [PATCH 3/6] pnpm update --- pnpm-lock.yaml | 184 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 158 insertions(+), 26 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc1b2c546bcb0..d1c7fa1a5fbb3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,7 +104,7 @@ importers: version: 4.0.0 ts-jest: specifier: ^29.1.1 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3) tsc-esm-fix: specifier: ^2.18.0 version: 2.20.27 @@ -2870,8 +2870,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/cloud_66: - specifiers: {} + components/cloud_66: {} components/cloud_convert: dependencies: @@ -3180,8 +3179,7 @@ importers: specifier: ^1.4.0 version: 1.6.6 - components/configcat: - specifiers: {} + components/configcat: {} components/confluence: dependencies: @@ -3400,8 +3398,7 @@ importers: components/cronly: {} - components/crossmint: - specifiers: {} + components/crossmint: {} components/crove_app: dependencies: @@ -3824,8 +3821,7 @@ importers: specifier: ^4.0.4 version: 4.0.4 - components/devolens: - specifiers: {} + components/devolens: {} components/devrev: dependencies: @@ -13171,7 +13167,11 @@ importers: specifier: 1.6.0 version: 1.6.0 - components/shopware: {} + components/shopware: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/short: dependencies: @@ -17005,7 +17005,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2)))(typescript@5.7.2) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2)))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.30))(jiti@2.4.2)(postcss@8.5.6)(tsx@4.19.4)(typescript@5.7.2)(yaml@2.8.0) @@ -35841,7 +35841,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.0 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -36112,21 +36112,45 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-import-assertions@7.26.0(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -36137,16 +36161,34 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -36157,41 +36199,89 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-typescript@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -37254,7 +37344,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -39760,6 +39850,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: @@ -42320,7 +42412,7 @@ snapshots: '@typescript-eslint/types': 8.15.0 '@typescript-eslint/typescript-estree': 8.15.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.15.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) eslint: 8.57.1 optionalDependencies: typescript: 5.6.3 @@ -43214,6 +43306,20 @@ snapshots: transitivePeerDependencies: - supports-color + babel-jest@29.7.0(@babel/core@8.0.0-alpha.13): + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@8.0.0-alpha.13) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + optional: true + babel-plugin-istanbul@6.1.1: dependencies: '@babel/helper-plugin-utils': 7.25.9 @@ -43280,12 +43386,39 @@ snapshots: '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.26.0) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.26.0) + babel-preset-current-node-syntax@1.1.0(@babel/core@8.0.0-alpha.13): + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@8.0.0-alpha.13) + optional: true + babel-preset-jest@29.6.3(@babel/core@7.26.0): dependencies: '@babel/core': 7.26.0 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.1.0(@babel/core@7.26.0) + babel-preset-jest@29.6.3(@babel/core@8.0.0-alpha.13): + dependencies: + '@babel/core': 8.0.0-alpha.13 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.1.0(@babel/core@8.0.0-alpha.13) + optional: true + backoff@2.5.0: dependencies: precond: 0.2.3 @@ -45494,7 +45627,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -47355,7 +47488,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) transitivePeerDependencies: - supports-color @@ -49936,7 +50069,7 @@ snapshots: dependencies: '@tediousjs/connection-string': 0.5.0 commander: 11.1.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) rfdc: 1.4.1 tarn: 3.0.2 tedious: 16.7.1 @@ -51685,7 +51818,7 @@ snapshots: ajv: 8.17.1 chalk: 5.3.0 ci-info: 4.1.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) deepmerge: 4.3.1 escalade: 3.2.0 fast-glob: 3.3.2 @@ -53821,7 +53954,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2)))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2)))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -53839,9 +53972,8 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) - esbuild: 0.24.2 - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -53855,10 +53987,10 @@ snapshots: typescript: 5.6.3 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.26.0 + '@babel/core': 8.0.0-alpha.13 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) + babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2): dependencies: @@ -54030,7 +54162,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -54058,7 +54190,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -54682,7 +54814,7 @@ snapshots: '@volar/typescript': 2.4.10 '@vue/language-core': 2.1.6(typescript@5.9.2) compare-versions: 6.1.1 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) kolorist: 1.8.0 local-pkg: 0.5.1 magic-string: 0.30.13 From cef35d475c644eaa1f70c0afe24d9b4f797e7493 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 16:14:52 -0300 Subject: [PATCH 4/6] Fix currency factor parsing in create-order action and update description and variable names in update-order action for clarity. --- components/shopware/actions/create-order/create-order.mjs | 2 +- components/shopware/actions/update-order/update-order.mjs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/shopware/actions/create-order/create-order.mjs b/components/shopware/actions/create-order/create-order.mjs index 95a08b8460ecd..70317c328bf89 100644 --- a/components/shopware/actions/create-order/create-order.mjs +++ b/components/shopware/actions/create-order/create-order.mjs @@ -93,7 +93,7 @@ export default { orderDateTime: this.orderDateTime, price: parseObject(this.priceObject), shippingCosts: parseObject(this.shippingCostsObject), - currencyFactor: parseFloat(this.currencyFactor), + currencyFactor: this.currencyFactor && parseFloat(this.currencyFactor), currency: parseObject(this.currency), itemRounding: parseObject(this.itemRounding), totalRounding: parseObject(this.totalRounding), diff --git a/components/shopware/actions/update-order/update-order.mjs b/components/shopware/actions/update-order/update-order.mjs index cd08f301acd63..4f3a62f5a5a18 100644 --- a/components/shopware/actions/update-order/update-order.mjs +++ b/components/shopware/actions/update-order/update-order.mjs @@ -4,7 +4,7 @@ import shopware from "../../shopware.app.mjs"; export default { key: "shopware-update-order", name: "Update Order", - description: "Partially update information about a Order resource. [See the documentation](https://shopware.stoplight.io/docs/admin-api/3cc867261ff28-partially-update-information-about-a-order-resource)", + description: "Partially update information about an order resource. [See the documentation](https://shopware.stoplight.io/docs/admin-api/3cc867261ff28-partially-update-information-about-a-order-resource)", version: "0.0.1", type: "action", annotations: { @@ -67,7 +67,7 @@ export default { }, }, async run({ $ }) { - const data = await this.shopware.updateOrder({ + const { data } = await this.shopware.updateOrder({ $, orderId: this.orderId, params: { @@ -80,7 +80,7 @@ export default { id: value, name: label, })), - rules: parseObject(this.ruleIds), + ruleIds: parseObject(this.ruleIds), orderNumber: this.orderNumber, affiliateCode: this.affiliateCode, campaignCode: this.campaignCode, @@ -89,7 +89,7 @@ export default { }, }); - $.export("$summary", `Successfully retrieved order with ID: ${this.orderId}`); + $.export("$summary", `Successfully updated order with ID: ${this.orderId}`); return data; }, }; From dd98cb4ad281549f50b271258f2817068e90a55a Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 28 Oct 2025 09:26:18 -0300 Subject: [PATCH 5/6] Update components/shopware/actions/update-order/update-order.mjs Co-authored-by: michelle0927 --- components/shopware/actions/update-order/update-order.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/shopware/actions/update-order/update-order.mjs b/components/shopware/actions/update-order/update-order.mjs index 4f3a62f5a5a18..e8bdfe4dc5e97 100644 --- a/components/shopware/actions/update-order/update-order.mjs +++ b/components/shopware/actions/update-order/update-order.mjs @@ -56,7 +56,7 @@ export default { customerComment: { type: "string", label: "Customer Comment", - description: "Comments given by comments", + description: "Comments given by the customer", optional: true, }, internalComment: { From fefe757ba695bc9b02360c6bd86bc4286f1f34e2 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 28 Oct 2025 09:30:21 -0300 Subject: [PATCH 6/6] Update descriptions for item and total rounding in create-order action to include examples for better clarity. --- components/shopware/actions/create-order/create-order.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/shopware/actions/create-order/create-order.mjs b/components/shopware/actions/create-order/create-order.mjs index 70317c328bf89..94ecf635c7725 100644 --- a/components/shopware/actions/create-order/create-order.mjs +++ b/components/shopware/actions/create-order/create-order.mjs @@ -71,12 +71,12 @@ export default { itemRounding: { type: "object", label: "Item Rounding", - description: "The rounding method to use for the order items", + description: "The rounding method to use for the order items. Example: {\"extensions\":[],\"decimals\":2,\"interval\":0.01,\"roundForNet\":true}", }, totalRounding: { type: "object", label: "Total Rounding", - description: "The rounding method to use for the order total", + description: "The rounding method to use for the order total. Example: {\"extensions\":[],\"decimals\":2,\"interval\":0.01,\"roundForNet\":true}", }, }, async run({ $ }) {