diff --git a/components/billbee/actions/add-shipment-to-order/add-shipment-to-order.mjs b/components/billbee/actions/add-shipment-to-order/add-shipment-to-order.mjs new file mode 100644 index 0000000000000..e39ef5be934f3 --- /dev/null +++ b/components/billbee/actions/add-shipment-to-order/add-shipment-to-order.mjs @@ -0,0 +1,103 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-add-shipment-to-order", + name: "Add Shipment To Order", + description: "Add a shipment to an existing order. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_AddShipment)", + type: "action", + version: "0.0.1", + props: { + app, + orderId: { + propDefinition: [ + app, + "orderId", + ], + }, + shippingProviderId: { + propDefinition: [ + app, + "shippingProviderId", + ], + }, + shippingProviderProductId: { + label: "Shipping Provider Product ID", + description: "The ID of the shipping provider product/service", + propDefinition: [ + app, + "shipment", + ({ + orderId, shippingProviderId, + }) => ({ + orderId, + shippingProviderId, + mapper: ({ ShippingProviderProductId: value }) => value, + }), + ], + }, + shippingId: { + label: "Shipping ID", + description: "The ID of the shipment", + propDefinition: [ + app, + "shipment", + ({ + orderId, shippingProviderId, + }) => ({ + orderId, + shippingProviderId, + mapper: ({ ShippingId: value }) => value, + }), + ], + }, + carrierId: { + propDefinition: [ + app, + "carrierId", + ], + }, + shipmentType: { + propDefinition: [ + app, + "shipmentType", + ], + }, + comment: { + type: "string", + label: "Comment", + description: "Additional comment for the shipment", + optional: true, + }, + }, + async run({ $ }) { + const { + app, + orderId, + shippingProviderId, + shippingProviderProductId, + comment, + shippingId, + carrierId, + shipmentType, + } = this; + + await app.addShipmentToOrder({ + $, + orderId, + data: { + ShippingProviderId: shippingProviderId, + ShippingProviderProductId: shippingProviderProductId, + Comment: comment, + ShippingId: shippingId, + CarrierId: carrierId, + ShipmentType: shipmentType, + }, + }); + + $.export("$summary", `Successfully added shipment to order \`${orderId}\``); + + return { + success: true, + }; + }, +}; diff --git a/components/billbee/actions/change-order-state/change-order-state.mjs b/components/billbee/actions/change-order-state/change-order-state.mjs new file mode 100644 index 0000000000000..7defa22508374 --- /dev/null +++ b/components/billbee/actions/change-order-state/change-order-state.mjs @@ -0,0 +1,49 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-change-order-state", + name: "Change Order State", + description: "Change the state of an order. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_UpdateState)", + type: "action", + version: "0.0.1", + props: { + app, + orderId: { + propDefinition: [ + app, + "orderId", + ], + }, + newStateId: { + type: "string", + label: "New Order State", + description: "The new state for the order", + optional: false, + propDefinition: [ + app, + "orderStateId", + ], + }, + }, + async run({ $ }) { + const { + app, + orderId, + newStateId, + } = this; + + await app.changeOrderState({ + $, + orderId, + data: { + NewStateId: parseInt(newStateId), + }, + }); + + $.export("$summary", "Successfully changed order state"); + + return { + success: true, + }; + }, +}; diff --git a/components/billbee/actions/create-invoice-for-order/create-invoice-for-order.mjs b/components/billbee/actions/create-invoice-for-order/create-invoice-for-order.mjs new file mode 100644 index 0000000000000..d77144f94d7cc --- /dev/null +++ b/components/billbee/actions/create-invoice-for-order/create-invoice-for-order.mjs @@ -0,0 +1,62 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-create-invoice-for-order", + name: "Create Invoice For Order", + description: "Create an invoice for an existing order. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_CreateInvoice)", + type: "action", + version: "0.0.1", + props: { + app, + orderId: { + propDefinition: [ + app, + "orderId", + ], + }, + templateId: { + type: "string", + label: "Template ID", + description: "The ID of the invoice template to use", + optional: true, + }, + includeInvoicePdf: { + type: "boolean", + label: "Include Invoice PDF", + description: "If true, the PDF is included in the response as base64 encoded string", + optional: true, + }, + sendToCloudId: { + label: "Send To Cloud ID", + propDefinition: [ + app, + "cloudStorageId", + ], + }, + }, + async run({ $ }) { + const { + app, + orderId, + templateId, + includeInvoicePdf, + sendToCloudId, + } = this; + + await app.createInvoiceForOrder({ + $, + orderId, + data: { + TemplateId: templateId, + IncludeInvoicePdf: includeInvoicePdf, + SendToCloudId: sendToCloudId, + }, + }); + + $.export("$summary", `Successfully created invoice for order \`${orderId}\``); + + return { + success: true, + }; + }, +}; diff --git a/components/billbee/actions/create-order/create-order.mjs b/components/billbee/actions/create-order/create-order.mjs new file mode 100644 index 0000000000000..b20de24140fc3 --- /dev/null +++ b/components/billbee/actions/create-order/create-order.mjs @@ -0,0 +1,55 @@ +import app from "../../billbee.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "billbee-create-order", + name: "Create Order", + description: "Create a new order. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_PostNewOrder)", + type: "action", + version: "0.0.1", + props: { + app, + orderData: { + type: "object", + label: "Order Data", + description: `The data for the order. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_PostNewOrder) + +**Example:** +\`\`\`json +{ + "State": 1, + "CreatedAt": "2025-09-04T00:00:00.000Z", + "PaymentMethod": 1, + "ShippingCost": 0, + "TotalCost": 0, + "OrderItems": [ + { + "Product": { + "Title": "Test 1" + }, + "Quantity": 1, + "TotalPrice": 0, + "TaxAmount": 0, + "TaxIndex": 19 + } + ] +} +\`\`\``, + }, + }, + async run({ $ }) { + const { + app, + orderData, + } = this; + + const response = await app.createOrder({ + $, + data: utils.parse(orderData), + }); + + $.export("$summary", `Successfully created order with ID \`${response.Data?.BillBeeOrderId}\``); + + return response; + }, +}; diff --git a/components/billbee/actions/get-order-by-id/get-order-by-id.mjs b/components/billbee/actions/get-order-by-id/get-order-by-id.mjs new file mode 100644 index 0000000000000..2c9b4192cf718 --- /dev/null +++ b/components/billbee/actions/get-order-by-id/get-order-by-id.mjs @@ -0,0 +1,33 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-get-order-by-id", + name: "Get Order By ID", + description: "Retrieve a specific order by its ID from Billbee. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_Get)", + type: "action", + version: "0.0.1", + props: { + app, + orderId: { + propDefinition: [ + app, + "orderId", + ], + }, + }, + async run({ $ }) { + const { + app, + orderId, + } = this; + + const response = await app.getOrder({ + $, + orderId, + }); + + $.export("$summary", `Successfully retrieved order with ID \`${response.Data?.BillBeeOrderId}\``); + + return response; + }, +}; diff --git a/components/billbee/actions/list-customers/list-customers.mjs b/components/billbee/actions/list-customers/list-customers.mjs new file mode 100644 index 0000000000000..bbe2fa9ef8312 --- /dev/null +++ b/components/billbee/actions/list-customers/list-customers.mjs @@ -0,0 +1,37 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-list-customers", + name: "List Customers", + description: "Retrieve a list of customers. [See the documentation](https://app.billbee.io/swagger/ui/index#/Customers/Customer_GetAll)", + type: "action", + version: "0.0.1", + props: { + app, + max: { + type: "integer", + label: "Maximum Results", + description: "Maximum number of customers to return", + optional: true, + }, + }, + async run({ $ }) { + const { + app, + max, + } = this; + + const customers = await app.paginate({ + resourcesFn: app.listCustomers, + resourcesFnArgs: { + $, + }, + resourceName: "Data", + max, + }); + + $.export("$summary", `Successfully retrieved \`${customers.length}\` customers`); + + return customers; + }, +}; diff --git a/components/billbee/actions/list-orders/list-orders.mjs b/components/billbee/actions/list-orders/list-orders.mjs new file mode 100644 index 0000000000000..4f86e4ed5c6f6 --- /dev/null +++ b/components/billbee/actions/list-orders/list-orders.mjs @@ -0,0 +1,139 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-list-orders", + name: "List Orders", + description: "Retrieve a list of orders. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_GetList)", + type: "action", + version: "0.0.1", + props: { + app, + minOrderDate: { + type: "string", + label: "Minimum Order Date", + description: "Specifies the oldest order date to include in the response (ISO format). Eg. `2025-01-01`", + optional: true, + }, + maxOrderDate: { + type: "string", + label: "Maximum Order Date", + description: "Specifies the newest order date to include in the response (ISO format). Eg. `2025-01-01`", + optional: true, + }, + shopId: { + type: "string[]", + label: "Shop IDs", + description: "Specifies a list of shop IDs for which orders should be included", + propDefinition: [ + app, + "shopId", + ], + }, + orderStateId: { + type: "string[]", + label: "Order State IDs", + description: "Specifies a list of state IDs to include in the response", + propDefinition: [ + app, + "orderStateId", + ], + }, + tag: { + type: "string[]", + label: "Tags", + description: "Specifies a list of tags the order must have attached to be included in the response", + optional: true, + }, + minimumBillBeeOrderId: { + type: "integer", + label: "Minimum Billbee Order ID", + description: "If given, all delivered orders have an ID greater than or equal to the given minimumOrderId", + optional: true, + }, + modifiedAtMin: { + type: "string", + label: "Modified At Minimum", + description: "If given, the last modification has to be newer than the given date (ISO format). Eg. `2025-01-01`", + optional: true, + }, + modifiedAtMax: { + type: "string", + label: "Modified At Maximum", + description: "If given, the last modification has to be older or equal than the given date (ISO format). Eg. `2025-01-01`", + optional: true, + }, + articleTitleSource: { + type: "integer", + label: "Article Title Source", + description: "The source field for the article title", + optional: true, + options: [ + { + label: "Order Position (default)", + value: 0, + }, + { + label: "Article Title", + value: 1, + }, + { + label: "Article Invoice Text", + value: 2, + }, + ], + }, + excludeTags: { + type: "boolean", + label: "Exclude Tags", + description: "If `true` the list of tags passed to the call are used to filter orders to not include these tags", + optional: true, + }, + max: { + type: "integer", + label: "Maximum Results", + description: "Maximum number of orders to return", + optional: true, + }, + }, + async run({ $ }) { + const { + app, + max, + minOrderDate, + maxOrderDate, + shopId, + orderStateId, + tag, + minimumBillBeeOrderId, + modifiedAtMin, + modifiedAtMax, + articleTitleSource, + excludeTags, + } = this; + + const orders = await app.paginate({ + resourcesFn: app.listOrders, + resourcesFnArgs: { + $, + params: { + minOrderDate, + maxOrderDate, + shopId, + orderStateId, + tag, + minimumBillBeeOrderId, + modifiedAtMin, + modifiedAtMax, + articleTitleSource, + excludeTags, + }, + }, + resourceName: "Data", + max, + }); + + $.export("$summary", `Successfully retrieved \`${orders.length}\` orders`); + + return orders; + }, +}; diff --git a/components/billbee/actions/list-products/list-products.mjs b/components/billbee/actions/list-products/list-products.mjs new file mode 100644 index 0000000000000..a02e5b9b839a3 --- /dev/null +++ b/components/billbee/actions/list-products/list-products.mjs @@ -0,0 +1,63 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-list-products", + name: "List Products", + description: "Retrieve a list of products. [See the documentation](https://app.billbee.io//swagger/ui/index#/Products/Article_GetList)", + type: "action", + version: "0.0.1", + props: { + app, + minCreatedAt: { + type: "string", + label: "Minimum Created Date", + description: "Filter products created after this date (ISO format). Eg. `2025-01-01`", + optional: true, + }, + minimumBillBeeArticleId: { + type: "integer", + label: "Minimum Billbee Article ID", + description: "Filter products with Billbee article ID greater than or equal to this value", + optional: true, + }, + maximumBillBeeArticleId: { + type: "integer", + label: "Maximum Billbee Article ID", + description: "Filter products with Billbee article ID less than or equal to this value", + optional: true, + }, + max: { + type: "integer", + label: "Maximum Results", + description: "Maximum number of products to return", + optional: true, + }, + }, + async run({ $ }) { + const { + app, + max, + minCreatedAt, + minimumBillBeeArticleId, + maximumBillBeeArticleId, + } = this; + + const products = await app.paginate({ + resourcesFn: app.listProducts, + resourcesFnArgs: { + $, + params: { + minCreatedAt, + minimumBillBeeArticleId, + maximumBillBeeArticleId, + }, + }, + resourceName: "Data", + max, + }); + + $.export("$summary", `Successfully retrieved \`${products.length}\` products`); + + return products; + }, +}; diff --git a/components/billbee/actions/update-order/update-order.mjs b/components/billbee/actions/update-order/update-order.mjs new file mode 100644 index 0000000000000..ce667824935a8 --- /dev/null +++ b/components/billbee/actions/update-order/update-order.mjs @@ -0,0 +1,121 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-update-order", + name: "Update Order", + description: "Partially update an existing order. [See the documentation](https://app.billbee.io//swagger/ui/index#/Orders/OrderApi_PatchOrder)", + type: "action", + version: "0.0.1", + props: { + app, + orderId: { + propDefinition: [ + app, + "orderId", + ], + }, + orderNumber: { + type: "string", + label: "Order Number", + description: "The order number", + optional: true, + }, + vatMode: { + type: "integer", + label: "VAT Mode", + description: "VAT mode for the order", + optional: true, + }, + shippedAt: { + type: "string", + label: "Shipped At", + description: "Order shipped date (ISO format). Eg. `2025-01-01T00:00:00.000Z`", + optional: true, + }, + payedAt: { + type: "string", + label: "Payed At", + description: "Order payment date (ISO format). Eg. `2025-01-01T00:00:00.000Z`", + optional: true, + }, + sellerComment: { + type: "string", + label: "Seller Comment", + description: "Comment from the seller", + optional: true, + }, + invoiceNumber: { + type: "integer", + label: "Invoice Number", + description: "The invoice number", + optional: true, + }, + invoiceDate: { + type: "string", + label: "Invoice Date", + description: "Invoice date (ISO format). Eg. `2025-01-01T00:00:00.000Z`", + optional: true, + }, + shippingCost: { + type: "string", + label: "Shipping Cost", + description: "Shipping cost for the order", + optional: true, + }, + taxRate1: { + type: "string", + label: "Tax Rate 1", + description: "First tax rate", + optional: true, + }, + taxRate2: { + type: "string", + label: "Tax Rate 2", + description: "Second tax rate", + optional: true, + }, + }, + async run({ $ }) { + const { + app, + orderId, + orderNumber, + vatMode, + shippedAt, + payedAt, + sellerComment, + invoiceNumber, + invoiceDate, + shippingCost, + taxRate1, + taxRate2, + } = this; + + const response = await app.updateOrder({ + $, + orderId, + data: { + OrderNumber: orderNumber, + VatMode: vatMode, + ShippedAt: shippedAt, + PayedAt: payedAt, + SellerComment: sellerComment, + InvoiceNumber: invoiceNumber, + InvoiceDate: invoiceDate, + ...(shippingCost && { + ShippingCost: parseFloat(shippingCost), + }), + ...(taxRate1 && { + TaxRate1: parseFloat(taxRate1), + }), + ...(taxRate2 && { + TaxRate2: parseFloat(taxRate2), + }), + }, + }); + + $.export("$summary", `Successfully updated order \`${response.Data?.BillBeeOrderId}\``); + + return response; + }, +}; diff --git a/components/billbee/actions/update-stock/update-stock.mjs b/components/billbee/actions/update-stock/update-stock.mjs new file mode 100644 index 0000000000000..afd0ec4b88c27 --- /dev/null +++ b/components/billbee/actions/update-stock/update-stock.mjs @@ -0,0 +1,105 @@ +import app from "../../billbee.app.mjs"; + +export default { + key: "billbee-update-stock", + name: "Update Stock", + description: "Update the stock level for a single product. [See the documentation](https://app.billbee.io//swagger/ui/index#/Products/Article_UpdateStock)", + type: "action", + version: "0.0.1", + props: { + app, + sku: { + type: "string", + label: "SKU", + description: "The SKU of the product to update", + propDefinition: [ + app, + "product", + () => ({ + filter: ({ SKU: sku }) => !!sku, + mapper: ({ + SKU: value, Title: title, + }) => ({ + value, + label: title?.[0]?.Text || "Untitled", + }), + }), + ], + }, + stockId: { + propDefinition: [ + app, + "stockId", + ], + }, + billbeeId: { + description: "The Billbee ID of the product to update", + optional: true, + propDefinition: [ + app, + "product", + ], + }, + reason: { + type: "string", + label: "Reason", + description: "Reason for the stock update", + optional: true, + }, + oldQuantity: { + type: "string", + label: "Old Quantity", + description: "The old stock quantity to set", + optional: true, + }, + newQuantity: { + type: "string", + label: "New Quantity", + description: "The new stock quantity to set", + optional: true, + }, + forceSendStockToShops: { + type: "boolean", + label: "Force Send Stock To Shops", + description: "If true, every sent stockchange is stored and transmitted to the connected shop, even if the value has not changed", + optional: true, + }, + autosubtractReservedAmount: { + type: "boolean", + label: "Autosubtract Reserved Amount", + description: "Automatically reduce the NewQuantity by the currently not fulfilled amount", + optional: true, + }, + }, + async run({ $ }) { + const { + app, + stockId, + billbeeId, + sku, + reason, + oldQuantity, + newQuantity, + forceSendStockToShops, + autosubtractReservedAmount, + } = this; + + const response = await app.updateStock({ + $, + data: { + StockId: stockId, + BillbeeId: billbeeId, + Sku: sku, + Reason: reason, + OldQuantity: oldQuantity, + NewQuantity: newQuantity, + ForceSendStockToShops: forceSendStockToShops, + AutosubtractReservedAmount: autosubtractReservedAmount, + }, + }); + + $.export("$summary", "Successfully updated stock"); + + return response; + }, +}; diff --git a/components/billbee/billbee.app.mjs b/components/billbee/billbee.app.mjs index cd6f4a992bf02..afed119aa7622 100644 --- a/components/billbee/billbee.app.mjs +++ b/components/billbee/billbee.app.mjs @@ -1,11 +1,453 @@ +import { axios } from "@pipedream/platform"; +import constants from "./common/constants.mjs"; +import utils from "./common/utils.mjs"; + export default { type: "app", app: "billbee", - propDefinitions: {}, + propDefinitions: { + orderId: { + type: "string", + label: "Order ID", + description: "The ID of the order", + async options({ page }) { + const { Data: orders } = await this.listOrders({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + return orders?.map(({ BillBeeOrderId: value }) => String(value)) || []; + }, + }, + customerId: { + type: "string", + label: "Customer ID", + description: "The ID of the customer", + async options({ page }) { + const { Data: customers } = await this.listCustomers({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + return customers?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + product: { + type: "string", + label: "Product ID", + description: "The ID of the product", + async options({ + page, + filter = () => true, + mapper = ({ + Id: value, Title: title, + }) => ({ + value, + label: title?.[0]?.Text || "Untitled", + }), + }) { + const { Data: products } = await this.listProducts({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + return products?.filter(filter).map(mapper) || []; + }, + }, + shopId: { + type: "string", + label: "Shop ID", + description: "Specifies a shop ID for which orders should be included", + optional: true, + async options({ page }) { + const { Data: shopAccounts } = await this.listShopAccounts({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + return shopAccounts?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + orderStateId: { + type: "string", + label: "Order State ID", + description: "Specifies a state ID to include in the response", + optional: true, + async options({ page }) { + const orderStates = await this.listOrderStates({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + return orderStates?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + tag: { + type: "string", + label: "Tag", + description: "Specifies a tag the order must have attached to be included in the response", + optional: true, + }, + stockId: { + type: "string", + label: "Stock ID", + description: "The ID of the stock.", + optional: true, + async options({ page }) { + const { Data: stocks } = await this.listStocks({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + return stocks?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + cloudStorageId: { + type: "string", + label: "Cloud Storage ID", + description: "The ID of the connected cloud printer/storage to send the invoice to", + optional: true, + async options() { + const { Data: sendToClouds } = await this.listCloudStorages(); + return sendToClouds?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + shippingProviderId: { + type: "string", + label: "Shipping Provider ID", + description: "The ID of the shipping provider", + optional: true, + async options() { + const { Data: shippingProviders } = await this.listShippingProviders(); + return shippingProviders?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + shipment: { + type: "string", + label: "Shipment ID", + description: "The ID of the shipment", + optional: true, + async options({ + page, + orderId, + shippingProviderId, + mapper = ({ BillbeeId: value }) => value, + }) { + const { Data: shippingProviderProducts } = await this.listShipments({ + params: { + page: page + 1, + pageSize: constants.DEFAULT_LIMIT, + orderId, + shippingProviderId, + }, + }); + return shippingProviderProducts?.map(mapper) || []; + }, + }, + carrierId: { + type: "string", + label: "Carrier ID", + description: "The ID of the carrier", + optional: true, + async options() { + const carriers = await this.listShippingCarriers(); + return carriers?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + shipmentType: { + type: "string", + label: "Shipment Type", + description: "The type of the shipment", + optional: true, + async options() { + const shipmentTypes = await this.listShipmentTypes(); + return shipmentTypes?.map(({ + Id: value, Name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + getBaseUrl() { + return `${constants.BASE_URL}${constants.VERSION_PATH}`; + }, + getUrl(path, url) { + return url || `${this.getBaseUrl()}${path}`; + }, + getHeaders(headers) { + return { + ...headers, + "x-billbee-api-key": this.$auth.api_key, + }; + }, + getAuth() { + const { + username, + api_password: password, + } = this.$auth; + + return { + username, + password, + }; + }, + makeRequest({ + $ = this, path, headers, url, ...args + } = {}) { + const { + getUrl, + getHeaders, + getAuth, + } = this; + + return axios($, { + headers: getHeaders(headers), + url: getUrl(path, url), + auth: getAuth(), + ...args, + }); + }, + post(args = {}) { + return this.makeRequest({ + method: "post", + ...args, + }); + }, + put(args = {}) { + return this.makeRequest({ + method: "put", + ...args, + }); + }, + delete(args = {}) { + return this.makeRequest({ + method: "delete", + ...args, + }); + }, + patch(args = {}) { + return this.makeRequest({ + method: "patch", + ...args, + }); + }, + // Orders + listOrders(args = {}) { + return this.makeRequest({ + path: "/orders", + ...args, + }); + }, + getOrder({ + orderId, ...args + } = {}) { + return this.makeRequest({ + path: `/orders/${orderId}`, + ...args, + }); + }, + createOrder(args = {}) { + return this.post({ + path: "/orders", + ...args, + }); + }, + updateOrder({ + orderId, ...args + } = {}) { + return this.patch({ + path: `/orders/${orderId}`, + ...args, + }); + }, + changeOrderState({ + orderId, ...args + } = {}) { + return this.put({ + path: `/orders/${orderId}/orderstate`, + ...args, + }); + }, + addShipmentToOrder({ + orderId, ...args + } = {}) { + return this.post({ + path: `/orders/${orderId}/shipment`, + ...args, + }); + }, + createInvoiceForOrder({ + orderId, ...args + } = {}) { + return this.post({ + path: `/orders/CreateInvoice/${orderId}`, + ...args, + }); + }, + // Products + listProducts(args = {}) { + return this.makeRequest({ + path: "/products", + ...args, + }); + }, + updateStock(args = {}) { + return this.post({ + path: "/products/updatestock", + ...args, + }); + }, + listStocks(args = {}) { + return this.makeRequest({ + path: "/products/stocks", + ...args, + }); + }, + // Customers + listCustomers(args = {}) { + return this.makeRequest({ + path: "/customers", + ...args, + }); + }, + listShopAccounts(args = {}) { + return this.makeRequest({ + path: "/shopaccounts", + ...args, + }); + }, + listOrderStates(args = {}) { + return this.makeRequest({ + path: "/enums/orderstates", + ...args, + }); + }, + listCloudStorages(args = {}) { + return this.makeRequest({ + path: "/cloudstorages", + ...args, + }); + }, + listShippingProviders(args = {}) { + return this.makeRequest({ + path: "/shipment/shippingproviders", + ...args, + }); + }, + listShipments(args = {}) { + return this.makeRequest({ + path: "/shipment/shipments", + ...args, + }); + }, + listShippingCarriers(args = {}) { + return this.makeRequest({ + path: "/shipment/shippingcarriers", + ...args, + }); + }, + listShipmentTypes(args = {}) { + return this.makeRequest({ + path: "/enums/shipmenttypes", + ...args, + }); + }, + async *getIterations({ + resourcesFn, resourcesFnArgs, resourceName, + lastDateAt, dateField, + max = constants.DEFAULT_MAX, + }) { + let page = 1; + let resourcesCount = 0; + + while (true) { + const response = + await resourcesFn({ + ...resourcesFnArgs, + params: { + ...resourcesFnArgs?.params, + page, + pageSize: constants.DEFAULT_LIMIT, + }, + }); + + const nextResources = utils.getNestedProperty(response, resourceName); + + if (!nextResources?.length) { + console.log("No more resources found"); + return; + } + + for (const resource of nextResources) { + const isDateGreater = + lastDateAt + && Date.parse(resource[dateField]) >= Date.parse(lastDateAt); + + if (!lastDateAt || isDateGreater) { + yield resource; + resourcesCount += 1; + } + + if (resourcesCount >= max) { + console.log("Reached max resources"); + return; + } + } + + if (nextResources.length < constants.DEFAULT_LIMIT) { + console.log("No next page found"); + return; + } + + page += 1; + } + }, + paginate(args = {}) { + return utils.iterate(this.getIterations(args)); }, }, -}; \ No newline at end of file +}; diff --git a/components/billbee/common/constants.mjs b/components/billbee/common/constants.mjs new file mode 100644 index 0000000000000..5503789054c8e --- /dev/null +++ b/components/billbee/common/constants.mjs @@ -0,0 +1,11 @@ +const BASE_URL = "https://app.billbee.io"; +const VERSION_PATH = "/api/v1"; +const DEFAULT_MAX = 300; +const DEFAULT_LIMIT = 100; + +export default { + BASE_URL, + VERSION_PATH, + DEFAULT_MAX, + DEFAULT_LIMIT, +}; diff --git a/components/billbee/common/utils.mjs b/components/billbee/common/utils.mjs new file mode 100644 index 0000000000000..5123be7bf2f4e --- /dev/null +++ b/components/billbee/common/utils.mjs @@ -0,0 +1,47 @@ +import { ConfigurationError } from "@pipedream/platform"; + +function emptyStrToUndefined(value) { + const trimmed = typeof(value) === "string" && value.trim(); + return trimmed === "" + ? undefined + : value; +} + +function parse(value) { + const valueToParse = emptyStrToUndefined(value); + if (valueToParse === undefined || valueToParse === null) { + return undefined; + } + if (typeof(valueToParse) === "object") { + return valueToParse; + } + try { + const parsed = JSON.parse(valueToParse); + if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) { + throw new Error("Not an object"); + } + return parsed; + } catch (e) { + throw new ConfigurationError("Make sure the custom expression contains a valid object"); + } +} + +async function iterate(iterations) { + const items = []; + for await (const item of iterations) { + items.push(item); + } + return items; +} + +function getNestedProperty(obj, propertyString) { + const properties = propertyString.split("."); + return properties.reduce((prev, curr) => prev?.[curr], obj); +} + +export default { + emptyStrToUndefined, + parse, + iterate, + getNestedProperty, +}; diff --git a/components/billbee/package.json b/components/billbee/package.json index 87dc2ecd9c97d..6eac3d530afe7 100644 --- a/components/billbee/package.json +++ b/components/billbee/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/billbee", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Billbee Components", "main": "billbee.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 +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48fcea4d2c2ca..dfdfd9601ba66 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,7 +107,7 @@ importers: version: 4.0.0 ts-jest: specifier: ^29.1.1 - 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) + 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) tsc-esm-fix: specifier: ^2.18.0 version: 2.20.27 @@ -1637,7 +1637,11 @@ importers: components/bill: {} - components/billbee: {} + components/billbee: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/billplz: {} @@ -16745,7 +16749,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))(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))(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) 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) @@ -34606,7 +34610,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.0 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -34877,45 +34881,21 @@ 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 @@ -34926,34 +34906,16 @@ 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 @@ -34964,89 +34926,41 @@ 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 @@ -36076,7 +35990,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -40786,7 +40700,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@9.4.0) + debug: 4.3.7(supports-color@5.5.0) eslint: 8.57.1 optionalDependencies: typescript: 5.6.3 @@ -41648,20 +41562,6 @@ 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 @@ -41728,39 +41628,12 @@ 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 @@ -43937,7 +43810,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -45769,7 +45642,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -48351,7 +48224,7 @@ snapshots: dependencies: '@tediousjs/connection-string': 0.5.0 commander: 11.1.0 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) rfdc: 1.4.1 tarn: 3.0.2 tedious: 16.7.1 @@ -50109,7 +49982,7 @@ snapshots: ajv: 8.17.1 chalk: 5.3.0 ci-info: 4.1.0 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) deepmerge: 4.3.1 escalade: 3.2.0 fast-glob: 3.3.2 @@ -52235,7 +52108,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))(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))(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): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -52253,8 +52126,9 @@ 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@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): + 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): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -52268,10 +52142,10 @@ snapshots: typescript: 5.6.3 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 8.0.0-alpha.13 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) + babel-jest: 29.7.0(@babel/core@7.26.0) ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2): dependencies: @@ -52441,7 +52315,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.0 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -52469,7 +52343,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.0 - debug: 4.3.7(supports-color@9.4.0) + debug: 4.3.7(supports-color@5.5.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -53070,7 +52944,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@9.4.0) + debug: 4.3.7(supports-color@5.5.0) kolorist: 1.8.0 local-pkg: 0.5.1 magic-string: 0.30.13