diff --git a/components/alttextify/alttextify.app.mjs b/components/alttextify/alttextify.app.mjs index a171b942a7232..5e78812a0d315 100644 --- a/components/alttextify/alttextify.app.mjs +++ b/components/alttextify/alttextify.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/amazon_redshift/amazon_redshift.app.mjs b/components/amazon_redshift/amazon_redshift.app.mjs index 78135b3e5272c..5519ed71c5e35 100644 --- a/components/amazon_redshift/amazon_redshift.app.mjs +++ b/components/amazon_redshift/amazon_redshift.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/capgo/capgo.app.mjs b/components/capgo/capgo.app.mjs index a1326ede17fcd..2900abca8b30d 100644 --- a/components/capgo/capgo.app.mjs +++ b/components/capgo/capgo.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/codeberg/codeberg.app.mjs b/components/codeberg/codeberg.app.mjs index b07f5e808a78a..06754e0ea84e2 100644 --- a/components/codeberg/codeberg.app.mjs +++ b/components/codeberg/codeberg.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/codeqr/codeqr.app.mjs b/components/codeqr/codeqr.app.mjs index 99bac672df3e3..0e92598ab4fdc 100644 --- a/components/codeqr/codeqr.app.mjs +++ b/components/codeqr/codeqr.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/deepsouce/deepsouce.app.mjs b/components/deepsouce/deepsouce.app.mjs index 1c2a013642beb..c22c89f2ad614 100644 --- a/components/deepsouce/deepsouce.app.mjs +++ b/components/deepsouce/deepsouce.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/finalscout/finalscout.app.mjs b/components/finalscout/finalscout.app.mjs index 788e7eb202635..a0f7f37915684 100644 --- a/components/finalscout/finalscout.app.mjs +++ b/components/finalscout/finalscout.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/keboola/keboola.app.mjs b/components/keboola/keboola.app.mjs index 52f7ee7ceb5fd..c296ca71ef70a 100644 --- a/components/keboola/keboola.app.mjs +++ b/components/keboola/keboola.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/picqer/picqer.app.mjs b/components/picqer/picqer.app.mjs index b06b45747d3d8..930696c76057f 100644 --- a/components/picqer/picqer.app.mjs +++ b/components/picqer/picqer.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/predictleads/predictleads.app.mjs b/components/predictleads/predictleads.app.mjs index 9ffd37fa104ee..46b3bef6f030c 100644 --- a/components/predictleads/predictleads.app.mjs +++ b/components/predictleads/predictleads.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs b/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs index 74bfef08d4dc7..f9b5c51383f90 100644 --- a/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs +++ b/components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-ap-aging-report", name: "Create AP Aging Detail Report", description: "Creates an AP aging report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/apagingdetail#query-a-report)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-bill/create-bill.mjs b/components/quickbooks/actions/create-bill/create-bill.mjs index 67ff7d2a72224..be455097b90ac 100644 --- a/components/quickbooks/actions/create-bill/create-bill.mjs +++ b/components/quickbooks/actions/create-bill/create-bill.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-create-bill", name: "Create Bill", description: "Creates a bill. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#create-a-bill)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, @@ -40,7 +40,7 @@ export default { props.lineItems = { type: "string[]", label: "Line Items", - description: "Line items of a bill. Set DetailType to `AccountBasedExpenseLineDetail`. Example: `{ \"DetailType\": \"AccountBasedExpenseLineDetail\", \"Amount\": 100.0, \"AccountBasedExpenseLineDetail\": { \"AccountRef\": { \"name\": \"Advertising\", \"value\": \"1\" } } }`", + description: "Line items of a bill. Set DetailType to `AccountBasedExpenseLineDetail`. Example: `{ \"DetailType\": \"AccountBasedExpenseLineDetail\", \"Amount\": 100.0, \"AccountBasedExpenseLineDetail\": { \"AccountRef\": { \"name\": \"Advertising\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#create-a-bill) for more information.", }; return props; } diff --git a/components/quickbooks/actions/create-customer/create-customer.mjs b/components/quickbooks/actions/create-customer/create-customer.mjs index d2128293bb329..b0a4dfa530af7 100644 --- a/components/quickbooks/actions/create-customer/create-customer.mjs +++ b/components/quickbooks/actions/create-customer/create-customer.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-create-customer", name: "Create Customer", description: "Creates a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#create-a-customer)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-estimate/create-estimate.mjs b/components/quickbooks/actions/create-estimate/create-estimate.mjs new file mode 100644 index 0000000000000..bf167149333c5 --- /dev/null +++ b/components/quickbooks/actions/create-estimate/create-estimate.mjs @@ -0,0 +1,295 @@ +import { ConfigurationError } from "@pipedream/platform"; +import quickbooks from "../../quickbooks.app.mjs"; +import { + parseLineItems, + buildSalesLineItems, +} from "../../common/utils.mjs"; + +export default { + key: "quickbooks-create-estimate", + name: "Create Estimate", + description: "Creates an estimate. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#create-an-estimate)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + customerRefValue: { + propDefinition: [ + quickbooks, + "customer", + ], + }, + billEmail: { + type: "string", + label: "Bill Email", + description: "Email address where the estimate should be sent", + optional: true, + }, + expirationDate: { + type: "string", + label: "Expiration Date", + description: "Date when the estimate expires (YYYY-MM-DD)", + optional: true, + }, + acceptedBy: { + type: "string", + label: "Accepted By", + description: "Name of the customer who accepted the estimate", + optional: true, + }, + acceptedDate: { + type: "string", + label: "Accepted Date", + description: "Date when the estimate was accepted (YYYY-MM-DD)", + optional: true, + }, + currencyRefValue: { + propDefinition: [ + quickbooks, + "currency", + ], + optional: true, + }, + docNumber: { + type: "string", + label: "Document Number", + description: "Reference number for the transaction", + optional: true, + }, + billingStreetAddress: { + propDefinition: [ + quickbooks, + "billingStreetAddress", + ], + }, + billingCity: { + propDefinition: [ + quickbooks, + "billingCity", + ], + }, + billingState: { + propDefinition: [ + quickbooks, + "billingState", + ], + }, + billingZip: { + propDefinition: [ + quickbooks, + "billingZip", + ], + }, + billingLatitude: { + propDefinition: [ + quickbooks, + "billingLatitude", + ], + }, + billingLongitude: { + propDefinition: [ + quickbooks, + "billingLongitude", + ], + }, + shippingStreetAddress: { + propDefinition: [ + quickbooks, + "shippingStreetAddress", + ], + }, + shippingCity: { + propDefinition: [ + quickbooks, + "shippingCity", + ], + }, + shippingState: { + propDefinition: [ + quickbooks, + "shippingState", + ], + }, + shippingZip: { + propDefinition: [ + quickbooks, + "shippingZip", + ], + }, + shippingLatitude: { + propDefinition: [ + quickbooks, + "shippingLatitude", + ], + }, + shippingLongitude: { + propDefinition: [ + quickbooks, + "shippingLongitude", + ], + }, + privateNote: { + type: "string", + label: "Private Note", + description: "Private note for internal use", + optional: true, + }, + customerMemo: { + type: "string", + label: "Customer Memo", + description: "Memo visible to customer", + optional: true, + }, + taxCodeId: { + propDefinition: [ + quickbooks, + "taxCodeId", + ], + }, + lineItemsAsObjects: { + propDefinition: [ + quickbooks, + "lineItemsAsObjects", + ], + reloadProps: true, + }, + }, + async additionalProps() { + const props = {}; + if (this.lineItemsAsObjects) { + props.lineItems = { + type: "string[]", + label: "Line Items", + description: "Line items of an estimate. Set DetailType to `SalesItemLineDetail`, `GroupLineDetail`, or `DescriptionOnly`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#create-an-estimate) for more information.", + }; + return props; + } + props.numLineItems = { + type: "integer", + label: "Number of Line Items", + description: "The number of line items to enter", + reloadProps: true, + }; + if (!this.numLineItems) { + return props; + } + for (let i = 1; i <= this.numLineItems; i++) { + props[`item_${i}`] = { + type: "string", + label: `Line ${i} - Item ID`, + options: async ({ page }) => { + return this.quickbooks.getPropOptions({ + page, + resource: "Item", + mapper: ({ + Id: value, Name: label, + }) => ({ + value, + label, + }), + }); + }, + }; + props[`amount_${i}`] = { + type: "string", + label: `Line ${i} - Amount`, + }; + } + return props; + }, + methods: { + buildLineItems() { + return buildSalesLineItems(this.numLineItems, this); + }, + }, + async run({ $ }) { + if ((!this.numLineItems && !this.lineItemsAsObjects) || !this.customerRefValue) { + throw new ConfigurationError("Must provide lineItems and customerRefValue parameters."); + } + + const lines = this.lineItemsAsObjects + ? parseLineItems(this.lineItems) + : this.buildLineItems(); + + lines.forEach((line, index) => { + if (line.DetailType !== "SalesItemLineDetail" && line.DetailType !== "GroupLineDetail" && line.DetailType !== "DescriptionOnly") { + throw new ConfigurationError(`Line Item at index ${index + 1} has invalid DetailType '${line.DetailType}'. Must be 'SalesItemLineDetail', 'GroupLineDetail', or 'DescriptionOnly'`); + } + }); + + const hasBillingAddress = this.billingStreetAddress + || this.billingCity + || this.billingState + || this.billingZip + || this.billingLatitude + || this.billingLongitude; + const hasShippingAddress = this.shippingStreetAddress + || this.shippingCity + || this.shippingState + || this.shippingZip + || this.shippingLatitude + || this.shippingLongitude; + + const params = {}; + const data = { + Line: lines, + CustomerRef: { + value: this.customerRefValue, + }, + ExpirationDate: this.expirationDate, + AcceptedBy: this.acceptedBy, + AcceptedDate: this.acceptedDate, + DocNumber: this.docNumber, + BillAddr: hasBillingAddress + ? { + Line1: this.billingStreetAddress, + City: this.billingCity, + CountrySubDivisionCode: this.billingState, + PostalCode: this.billingZip, + Lat: this.billingLatitude, + Long: this.billingLongitude, + } + : undefined, + ShipAddr: hasShippingAddress + ? { + Line1: this.shippingStreetAddress, + City: this.shippingCity, + CountrySubDivisionCode: this.shippingState, + PostalCode: this.shippingZip, + Lat: this.shippingLatitude, + Long: this.shippingLongitude, + } + : undefined, + PrivateNote: this.privateNote, + }; + + if (this.billEmail) { + params.include = "estimateLink"; + data.BillEmail = { + Address: this.billEmail, + }; + } + if (this.currencyRefValue) { + data.CurrencyRef = { + value: this.currencyRefValue, + }; + } + if (this.customerMemo) { + data.CustomerMemo = { + value: this.customerMemo, + }; + } + + const response = await this.quickbooks.createEstimate({ + $, + params, + data, + }); + + if (response) { + $.export("$summary", `Successfully created estimate with ID ${response.Estimate.Id}`); + } + + return response; + }, +}; diff --git a/components/quickbooks/actions/create-invoice/create-invoice.mjs b/components/quickbooks/actions/create-invoice/create-invoice.mjs index 63791beca9f50..e8248d0ec6d5b 100644 --- a/components/quickbooks/actions/create-invoice/create-invoice.mjs +++ b/components/quickbooks/actions/create-invoice/create-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-create-invoice", name: "Create Invoice", description: "Creates an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice)", - version: "0.2.2", + version: "0.2.3", type: "action", props: { quickbooks, @@ -102,7 +102,7 @@ export default { props.lineItems = { type: "string[]", label: "Line Items", - description: "Line items of an invoice. Set DetailType to `SalesItemLineDetail`, `GroupLineDetail`, or `DescriptionOnly`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }`", + description: "Line items of an invoice. Set DetailType to `SalesItemLineDetail`, `GroupLineDetail`, or `DescriptionOnly`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice) for more information.", }; return props; } diff --git a/components/quickbooks/actions/create-payment/create-payment.mjs b/components/quickbooks/actions/create-payment/create-payment.mjs index 569ea05d946d1..6cd876ad1b196 100644 --- a/components/quickbooks/actions/create-payment/create-payment.mjs +++ b/components/quickbooks/actions/create-payment/create-payment.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-create-payment", name: "Create Payment", description: "Creates a payment. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#create-a-payment)", - version: "0.0.7", + version: "0.0.8", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-pl-report/create-pl-report.mjs b/components/quickbooks/actions/create-pl-report/create-pl-report.mjs index 87dbf1c088a17..664ab68073ebb 100644 --- a/components/quickbooks/actions/create-pl-report/create-pl-report.mjs +++ b/components/quickbooks/actions/create-pl-report/create-pl-report.mjs @@ -7,7 +7,7 @@ export default { key: "quickbooks-create-pl-report", name: "Create Profit and Loss Detail Report", description: "Creates a profit and loss report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/profitandloss#query-a-report)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs b/components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs new file mode 100644 index 0000000000000..10b2d5b959ed2 --- /dev/null +++ b/components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs @@ -0,0 +1,236 @@ +import { ConfigurationError } from "@pipedream/platform"; +import quickbooks from "../../quickbooks.app.mjs"; +import { + parseLineItems, + buildPurchaseLineItems, +} from "../../common/utils.mjs"; + +export default { + key: "quickbooks-create-purchase-order", + name: "Create Purchase Order", + description: "Creates a purchase order. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder#create-a-purchaseorder)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + accountId: { + propDefinition: [ + quickbooks, + "accountIds", + ], + type: "string", + label: "Account ID", + description: "The ID of the account to use for the purchase order", + }, + vendorRefValue: { + propDefinition: [ + quickbooks, + "vendor", + ], + }, + dueDate: { + type: "string", + label: "Due Date", + description: "Date when the purchase order is due (YYYY-MM-DD)", + optional: true, + }, + currencyRefValue: { + propDefinition: [ + quickbooks, + "currency", + ], + }, + docNumber: { + type: "string", + label: "Document Number", + description: "Reference number for the transaction", + optional: true, + }, + shippingStreetAddress: { + propDefinition: [ + quickbooks, + "shippingStreetAddress", + ], + }, + shippingCity: { + propDefinition: [ + quickbooks, + "shippingCity", + ], + }, + shippingState: { + propDefinition: [ + quickbooks, + "shippingState", + ], + }, + shippingZip: { + propDefinition: [ + quickbooks, + "shippingZip", + ], + }, + shippingLatitude: { + propDefinition: [ + quickbooks, + "shippingLatitude", + ], + }, + shippingLongitude: { + propDefinition: [ + quickbooks, + "shippingLongitude", + ], + }, + memo: { + type: "string", + label: "Memo", + description: "Memo or note for the purchase order", + optional: true, + }, + lineItemsAsObjects: { + propDefinition: [ + quickbooks, + "lineItemsAsObjects", + ], + reloadProps: true, + }, + }, + async additionalProps() { + const props = {}; + if (this.lineItemsAsObjects) { + props.lineItems = { + type: "string[]", + label: "Line Items", + description: "Line items of a purchase order. Set DetailType to `ItemBasedExpenseLineDetail` or `AccountBasedExpenseLineDetail`. Example: `{ \"DetailType\": \"ItemBasedExpenseLineDetail\", \"Amount\": 100.0, \"ItemBasedExpenseLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder#create-a-purchaseorder) for more information.", + }; + return props; + } + props.numLineItems = { + type: "integer", + label: "Number of Line Items", + description: "The number of line items to enter", + reloadProps: true, + }; + if (!this.numLineItems) { + return props; + } + for (let i = 1; i <= this.numLineItems; i++) { + props[`detailType_${i}`] = { + type: "string", + label: `Line ${i} - Detail Type`, + options: [ + { + label: "Item Based Expense", + value: "ItemBasedExpenseLineDetail", + }, + { + label: "Account Based Expense", + value: "AccountBasedExpenseLineDetail", + }, + ], + default: "ItemBasedExpenseLineDetail", + }; + props[`item_${i}`] = { + type: "string", + label: `Line ${i} - Item/Account ID`, + options: async ({ page }) => { + return this.quickbooks.getPropOptions({ + page, + resource: "Item", + mapper: ({ + Id: value, Name: label, + }) => ({ + value, + label, + }), + }); + }, + }; + props[`amount_${i}`] = { + type: "string", + label: `Line ${i} - Amount`, + }; + props[`quantity_${i}`] = { + type: "string", + label: `Line ${i} - Quantity`, + }; + } + return props; + }, + methods: { + buildLineItems() { + return buildPurchaseLineItems(this.numLineItems, this); + }, + }, + async run({ $ }) { + if (!this.vendorRefValue) { + throw new ConfigurationError("Vendor is required to create a purchase order."); + } + + if (!this.numLineItems && !this.lineItemsAsObjects) { + throw new ConfigurationError("At least one line item is required. Either specify the number of line items or provide line items as objects."); + } + + const lines = this.lineItemsAsObjects + ? parseLineItems(this.lineItems) + : this.buildLineItems(); + + if (!lines || lines.length === 0) { + throw new ConfigurationError("No valid line items were provided."); + } + + lines.forEach((line, index) => { + if (line.DetailType !== "ItemBasedExpenseLineDetail" && line.DetailType !== "AccountBasedExpenseLineDetail") { + throw new ConfigurationError(`Line Item at index ${index + 1} has invalid DetailType '${line.DetailType}'. Must be 'ItemBasedExpenseLineDetail' or 'AccountBasedExpenseLineDetail'`); + } + }); + + const hasShippingAddress = this.shippingStreetAddress + || this.shippingCity + || this.shippingState + || this.shippingZip + || this.shippingLatitude + || this.shippingLongitude; + + const data = { + Line: lines, + VendorRef: { + value: this.vendorRefValue, + }, + DueDate: this.dueDate, + DocNumber: this.docNumber, + ShipAddr: hasShippingAddress + ? { + Line1: this.shippingStreetAddress, + City: this.shippingCity, + CountrySubDivisionCode: this.shippingState, + PostalCode: this.shippingZip, + Lat: this.shippingLatitude, + Long: this.shippingLongitude, + } + : undefined, + Memo: this.memo, + APAccountRef: { + value: this.accountId, + }, + }; + + if (this.currencyRefValue) { + data.CurrencyRef = { + value: this.currencyRefValue, + }; + } + + const response = await this.quickbooks.createPurchaseOrder({ + $, + data, + }); + + if (response) { + $.export("$summary", `Successfully created purchase order with ID ${response.PurchaseOrder.Id}`); + } + + return response; + }, +}; diff --git a/components/quickbooks/actions/create-purchase/create-purchase.mjs b/components/quickbooks/actions/create-purchase/create-purchase.mjs index 7fb08e7855cfe..cd81546038d88 100644 --- a/components/quickbooks/actions/create-purchase/create-purchase.mjs +++ b/components/quickbooks/actions/create-purchase/create-purchase.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-create-purchase", name: "Create Purchase", description: "Creates a new purchase. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#create-a-purchase)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { quickbooks, @@ -50,7 +50,7 @@ export default { props.lineItems = { type: "string[]", label: "Line Items", - description: "Line items of a purchase. Set DetailType to `AccountBasedExpenseLineDetail`. Example: `{ \"DetailType\": \"AccountBasedExpenseLineDetail\", \"Amount\": 100.0, \"AccountBasedExpenseLineDetail\": { \"AccountRef\": { \"name\": \"Advertising\", \"value\": \"1\" } } }`", + description: "Line items of a purchase. Set DetailType to `AccountBasedExpenseLineDetail`. Example: `{ \"DetailType\": \"AccountBasedExpenseLineDetail\", \"Amount\": 100.0, \"AccountBasedExpenseLineDetail\": { \"AccountRef\": { \"name\": \"Advertising\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#create-a-purchase) for more information.", }; return props; } diff --git a/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs b/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs index ab80a8995bf2d..6e121d79b38ec 100644 --- a/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs +++ b/components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-create-sales-receipt", name: "Create Sales Receipt", description: "Creates a sales receipt. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#create-a-salesreceipt)", - version: "0.0.7", + version: "0.0.8", type: "action", props: { quickbooks, @@ -31,7 +31,7 @@ export default { props.lineItems = { type: "string[]", label: "Line Items", - description: "Line items of a sales receipt. Set DetailType to `SalesItemLineDetail` or `GroupLineDetail`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }`", + description: "Line items of a sales receipt. Set DetailType to `SalesItemLineDetail` or `GroupLineDetail`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#create-a-salesreceipt) for more information.", }; return props; } diff --git a/components/quickbooks/actions/delete-purchase/delete-purchase.mjs b/components/quickbooks/actions/delete-purchase/delete-purchase.mjs index 7d5cdfdd0e90a..575cc1c939212 100644 --- a/components/quickbooks/actions/delete-purchase/delete-purchase.mjs +++ b/components/quickbooks/actions/delete-purchase/delete-purchase.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-delete-purchase", name: "Delete Purchase", description: "Delete a specific purchase. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#delete-a-purchase)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-bill/get-bill.mjs b/components/quickbooks/actions/get-bill/get-bill.mjs index 66ed1327a727d..628a47c560960 100644 --- a/components/quickbooks/actions/get-bill/get-bill.mjs +++ b/components/quickbooks/actions/get-bill/get-bill.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-bill", name: "Get Bill", description: "Returns info about a bill. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#read-a-bill)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-customer/get-customer.mjs b/components/quickbooks/actions/get-customer/get-customer.mjs index 5b4dff74892ec..a8623e2c87c18 100644 --- a/components/quickbooks/actions/get-customer/get-customer.mjs +++ b/components/quickbooks/actions/get-customer/get-customer.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-customer", name: "Get Customer", description: "Returns info about a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#read-a-customer)", - version: "0.3.8", + version: "0.3.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-invoice/get-invoice.mjs b/components/quickbooks/actions/get-invoice/get-invoice.mjs index 5b1dc82329dd1..1048d1e41905a 100644 --- a/components/quickbooks/actions/get-invoice/get-invoice.mjs +++ b/components/quickbooks/actions/get-invoice/get-invoice.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-invoice", name: "Get Invoice", description: "Returns info about an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#read-an-invoice)", - version: "0.2.9", + version: "0.2.10", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-my-company/get-my-company.mjs b/components/quickbooks/actions/get-my-company/get-my-company.mjs index 88526024ebe70..c5d757f5d1985 100644 --- a/components/quickbooks/actions/get-my-company/get-my-company.mjs +++ b/components/quickbooks/actions/get-my-company/get-my-company.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-get-my-company", name: "Get My Company", description: "Gets info about a company. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/companyinfo)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-payment/get-payment.mjs b/components/quickbooks/actions/get-payment/get-payment.mjs index 18adb32660e28..017395168ad1a 100644 --- a/components/quickbooks/actions/get-payment/get-payment.mjs +++ b/components/quickbooks/actions/get-payment/get-payment.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-payment", name: "Get Payment", description: "Returns info about a payment. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#read-a-payment)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs b/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs index 643ef5046dbee..e7d4bfd2dbad6 100644 --- a/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs +++ b/components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-purchase-order", name: "Get Purchase Order", description: "Returns details about a purchase order. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder#read-a-purchase-order)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-purchase/get-purchase.mjs b/components/quickbooks/actions/get-purchase/get-purchase.mjs index eb618dfb0d26d..093e5b701fcc7 100644 --- a/components/quickbooks/actions/get-purchase/get-purchase.mjs +++ b/components/quickbooks/actions/get-purchase/get-purchase.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-purchase", name: "Get Purchase", description: "Returns info about a purchase. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#read-a-purchase)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs b/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs index 04f9cfa0a7587..8fb2eda77c7a4 100644 --- a/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs +++ b/components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-sales-receipt", name: "Get Sales Receipt", description: "Returns details about a sales receipt. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#read-a-salesreceipt)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/get-time-activity/get-time-activity.mjs b/components/quickbooks/actions/get-time-activity/get-time-activity.mjs index 42b0d364a0365..857a6992ca704 100644 --- a/components/quickbooks/actions/get-time-activity/get-time-activity.mjs +++ b/components/quickbooks/actions/get-time-activity/get-time-activity.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-get-time-activity", name: "Get Time Activity", description: "Returns info about an activity. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#read-a-timeactivity-object)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-accounts/search-accounts.mjs b/components/quickbooks/actions/search-accounts/search-accounts.mjs index 6fa0ab6f8acbd..73ffc601fb58a 100644 --- a/components/quickbooks/actions/search-accounts/search-accounts.mjs +++ b/components/quickbooks/actions/search-accounts/search-accounts.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-accounts", name: "Search Accounts", description: "Search for accounts. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/account#query-an-account)", - version: "0.2.8", + version: "0.2.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-customers/search-customers.mjs b/components/quickbooks/actions/search-customers/search-customers.mjs index 282572de8d85d..473718799621d 100644 --- a/components/quickbooks/actions/search-customers/search-customers.mjs +++ b/components/quickbooks/actions/search-customers/search-customers.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-customers", name: "Search Customers", description: "Searches for customers. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#query-a-customer)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-invoices/search-invoices.mjs b/components/quickbooks/actions/search-invoices/search-invoices.mjs index 1f15fe471dd60..852fbe2a288d1 100644 --- a/components/quickbooks/actions/search-invoices/search-invoices.mjs +++ b/components/quickbooks/actions/search-invoices/search-invoices.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-invoices", name: "Search Invoices", description: "Searches for invoices. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#query-an-invoice)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-items/search-items.mjs b/components/quickbooks/actions/search-items/search-items.mjs index c4e4a02f6deb6..9d01b7cb40ee0 100644 --- a/components/quickbooks/actions/search-items/search-items.mjs +++ b/components/quickbooks/actions/search-items/search-items.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-items", name: "Search Items", description: "Searches for items. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-products/search-products.mjs b/components/quickbooks/actions/search-products/search-products.mjs index cdb26ce45509f..89ea67d1ad2ff 100644 --- a/components/quickbooks/actions/search-products/search-products.mjs +++ b/components/quickbooks/actions/search-products/search-products.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-products", name: "Search Products", description: "Search for products. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-purchases/search-purchases.mjs b/components/quickbooks/actions/search-purchases/search-purchases.mjs index e6d8a645d03f8..39e6fe9663d38 100644 --- a/components/quickbooks/actions/search-purchases/search-purchases.mjs +++ b/components/quickbooks/actions/search-purchases/search-purchases.mjs @@ -4,7 +4,7 @@ export default { key: "quickbooks-search-purchases", name: "Search Purchases", description: "Searches for purchases. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#query-a-purchase)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-query/search-query.mjs b/components/quickbooks/actions/search-query/search-query.mjs index f111541f82b2d..1471782c42be4 100644 --- a/components/quickbooks/actions/search-query/search-query.mjs +++ b/components/quickbooks/actions/search-query/search-query.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-query", name: "Search Query", description: "Performs a search query against a Quickbooks entity. [See the documentation](https://developer.intuit.com/app/develophttps://developer.intuit.com/app/developer/qbo/docs/develop/explore-the-quickbooks-online-api/data-queries)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-services/search-services.mjs b/components/quickbooks/actions/search-services/search-services.mjs index aeb790b9ff8dc..386c050e6eab0 100644 --- a/components/quickbooks/actions/search-services/search-services.mjs +++ b/components/quickbooks/actions/search-services/search-services.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-services", name: "Search Services", description: "Search for services. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-time-activities/search-time-activities.mjs b/components/quickbooks/actions/search-time-activities/search-time-activities.mjs index 206fdbac32fa4..4f1866d05e727 100644 --- a/components/quickbooks/actions/search-time-activities/search-time-activities.mjs +++ b/components/quickbooks/actions/search-time-activities/search-time-activities.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-time-activities", name: "Search Time Activities", description: "Searches for time activities. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#query-a-timeactivity-object)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/search-vendors/search-vendors.mjs b/components/quickbooks/actions/search-vendors/search-vendors.mjs index 4e682be2f4ebd..7d2d5d8d6b4d6 100644 --- a/components/quickbooks/actions/search-vendors/search-vendors.mjs +++ b/components/quickbooks/actions/search-vendors/search-vendors.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-search-vendors", name: "Search Vendors", description: "Searches for vendors. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/vendor#query-a-vendor)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/send-estimate/send-estimate.mjs b/components/quickbooks/actions/send-estimate/send-estimate.mjs new file mode 100644 index 0000000000000..3093556392f4b --- /dev/null +++ b/components/quickbooks/actions/send-estimate/send-estimate.mjs @@ -0,0 +1,42 @@ +import quickbooks from "../../quickbooks.app.mjs"; + +export default { + key: "quickbooks-send-estimate", + name: "Send Estimate", + description: "Sends an estimate by email. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#send-an-estimate)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + estimateId: { + propDefinition: [ + quickbooks, + "estimateId", + ], + }, + email: { + type: "string", + label: "Email Address", + description: "Email address to send the estimate to (optional - if not provided, uses the customer's email address)", + }, + }, + async run({ $ }) { + const params = {}; + + if (this.email) { + params.sendTo = this.email; + } + + const response = await this.quickbooks.sendEstimate({ + $, + estimateId: this.estimateId, + params, + }); + + if (response) { + $.export("$summary", `Successfully sent estimate with ID ${this.estimateId}`); + } + + return response; + }, +}; diff --git a/components/quickbooks/actions/send-invoice/send-invoice.mjs b/components/quickbooks/actions/send-invoice/send-invoice.mjs new file mode 100644 index 0000000000000..0093c41d10c54 --- /dev/null +++ b/components/quickbooks/actions/send-invoice/send-invoice.mjs @@ -0,0 +1,42 @@ +import quickbooks from "../../quickbooks.app.mjs"; + +export default { + key: "quickbooks-send-invoice", + name: "Send Invoice", + description: "Sends an invoice by email. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#send-an-invoice)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + invoiceId: { + propDefinition: [ + quickbooks, + "invoiceId", + ], + }, + email: { + type: "string", + label: "Email Address", + description: "Email address to send the invoice to", + }, + }, + async run({ $ }) { + const params = {}; + + if (this.email) { + params.sendTo = this.email; + } + + const response = await this.quickbooks.sendInvoice({ + $, + invoiceId: this.invoiceId, + params, + }); + + if (response) { + $.export("$summary", `Successfully sent invoice with ID ${this.invoiceId}`); + } + + return response; + }, +}; diff --git a/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs b/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs index c4f5372e8d13c..de0efeabe5e2e 100644 --- a/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs +++ b/components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-sparse-update-invoice", name: "Sparse Update Invoice", description: "Sparse updating provides the ability to update a subset of properties for a given object; only elements specified in the request are updated. Missing elements are left untouched. The ID of the object to update is specified in the request body.​ [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#sparse-update-an-invoice)", - version: "0.1.6", + version: "0.1.7", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/update-customer/update-customer.mjs b/components/quickbooks/actions/update-customer/update-customer.mjs index aa2c4572fcc1b..acdcf4dae1ae8 100644 --- a/components/quickbooks/actions/update-customer/update-customer.mjs +++ b/components/quickbooks/actions/update-customer/update-customer.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-update-customer", name: "Update Customer", description: "Updates a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#full-update-a-customer)", - version: "0.1.8", + version: "0.1.9", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/update-estimate/update-estimate.mjs b/components/quickbooks/actions/update-estimate/update-estimate.mjs new file mode 100644 index 0000000000000..906740b05db81 --- /dev/null +++ b/components/quickbooks/actions/update-estimate/update-estimate.mjs @@ -0,0 +1,336 @@ +import { ConfigurationError } from "@pipedream/platform"; +import quickbooks from "../../quickbooks.app.mjs"; +import { + parseLineItems, + buildSalesLineItems, +} from "../../common/utils.mjs"; + +export default { + key: "quickbooks-update-estimate", + name: "Update Estimate", + description: "Updates an estimate. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#update-an-estimate)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + estimateId: { + propDefinition: [ + quickbooks, + "estimateId", + ], + }, + customerRefValue: { + propDefinition: [ + quickbooks, + "customer", + ], + }, + billEmail: { + type: "string", + label: "Bill Email", + description: "Email address where the estimate should be sent", + optional: true, + }, + expirationDate: { + type: "string", + label: "Expiration Date", + description: "Date when the estimate expires (YYYY-MM-DD)", + optional: true, + }, + acceptedBy: { + type: "string", + label: "Accepted By", + description: "Name of the customer who accepted the estimate", + optional: true, + }, + acceptedDate: { + type: "string", + label: "Accepted Date", + description: "Date when the estimate was accepted (YYYY-MM-DD)", + optional: true, + }, + currencyRefValue: { + propDefinition: [ + quickbooks, + "currency", + ], + optional: true, + }, + docNumber: { + type: "string", + label: "Document Number", + description: "Reference number for the transaction", + optional: true, + }, + billingStreetAddress: { + propDefinition: [ + quickbooks, + "billingStreetAddress", + ], + }, + billingCity: { + propDefinition: [ + quickbooks, + "billingCity", + ], + }, + billingState: { + propDefinition: [ + quickbooks, + "billingState", + ], + }, + billingZip: { + propDefinition: [ + quickbooks, + "billingZip", + ], + }, + billingLatitude: { + propDefinition: [ + quickbooks, + "billingLatitude", + ], + }, + billingLongitude: { + propDefinition: [ + quickbooks, + "billingLongitude", + ], + }, + shippingStreetAddress: { + propDefinition: [ + quickbooks, + "shippingStreetAddress", + ], + }, + shippingCity: { + propDefinition: [ + quickbooks, + "shippingCity", + ], + }, + shippingState: { + propDefinition: [ + quickbooks, + "shippingState", + ], + }, + shippingZip: { + propDefinition: [ + quickbooks, + "shippingZip", + ], + }, + shippingLatitude: { + propDefinition: [ + quickbooks, + "shippingLatitude", + ], + }, + shippingLongitude: { + propDefinition: [ + quickbooks, + "shippingLongitude", + ], + }, + privateNote: { + type: "string", + label: "Private Note", + description: "Private note for internal use", + optional: true, + }, + customerMemo: { + type: "string", + label: "Customer Memo", + description: "Memo visible to customer", + optional: true, + }, + taxCodeId: { + propDefinition: [ + quickbooks, + "taxCodeId", + ], + optional: true, + }, + lineItemsAsObjects: { + propDefinition: [ + quickbooks, + "lineItemsAsObjects", + ], + reloadProps: true, + }, + }, + async additionalProps() { + const props = {}; + if (this.lineItemsAsObjects) { + props.lineItems = { + type: "string[]", + label: "Line Items", + description: "Line items of an estimate. Set DetailType to `SalesItemLineDetail`, `GroupLineDetail`, or `DescriptionOnly`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#update-an-estimate) for more information.", + }; + return props; + } + props.numLineItems = { + type: "integer", + label: "Number of Line Items", + description: "The number of line items to enter", + reloadProps: true, + }; + if (!this.numLineItems) { + return props; + } + for (let i = 1; i <= this.numLineItems; i++) { + props[`item_${i}`] = { + type: "string", + label: `Line ${i} - Item ID`, + options: async ({ page }) => { + return this.quickbooks.getPropOptions({ + page, + resource: "Item", + mapper: ({ + Id: value, Name: label, + }) => ({ + value, + label, + }), + }); + }, + }; + props[`amount_${i}`] = { + type: "string", + label: `Line ${i} - Amount`, + }; + } + return props; + }, + methods: { + buildLineItems() { + return buildSalesLineItems(this.numLineItems, this); + }, + // Helper function to conditionally add properties + addIfDefined(target, source, mappings) { + Object.entries(mappings).forEach(([ + sourceKey, + targetConfig, + ]) => { + const value = source[sourceKey]; + if (value !== undefined && value !== null) { + if (typeof targetConfig === "string") { + target[targetConfig] = value; + } else if (typeof targetConfig === "object") { + target[targetConfig.key] = targetConfig.transform + ? targetConfig.transform(value) + : value; + } + } + }); + }, + }, + async run({ $ }) { + // Get the current estimate to obtain SyncToken + const { Estimate: estimate } = await this.quickbooks.getEstimate({ + $, + estimateId: this.estimateId, + }); + + const hasBillingAddress = this.billingStreetAddress + || this.billingCity + || this.billingState + || this.billingZip + || this.billingLatitude + || this.billingLongitude; + const hasShippingAddress = this.shippingStreetAddress + || this.shippingCity + || this.shippingState + || this.shippingZip + || this.shippingLatitude + || this.shippingLongitude; + + const data = { + Id: this.estimateId, + SyncToken: estimate.SyncToken, + BillAddr: hasBillingAddress + ? { + Line1: this.billingStreetAddress, + City: this.billingCity, + CountrySubDivisionCode: this.billingState, + PostalCode: this.billingZip, + Lat: this.billingLatitude, + Long: this.billingLongitude, + } + : undefined, + ShipAddr: hasShippingAddress + ? { + Line1: this.shippingStreetAddress, + City: this.shippingCity, + CountrySubDivisionCode: this.shippingState, + PostalCode: this.shippingZip, + Lat: this.shippingLatitude, + Long: this.shippingLongitude, + } + : undefined, + }; + + // Only update fields that are provided + if (this.customerRefValue) { + data.CustomerRef = { + value: this.customerRefValue, + }; + } + + if (this.lineItemsAsObjects || this.numLineItems) { + const lines = this.lineItemsAsObjects + ? parseLineItems(this.lineItems) + : this.buildLineItems(); + + lines.forEach((line, index) => { + if (line.DetailType !== "SalesItemLineDetail" && line.DetailType !== "GroupLineDetail" && line.DetailType !== "DescriptionOnly") { + throw new ConfigurationError(`Line Item at index ${index + 1} has invalid DetailType '${line.DetailType}'. Must be 'SalesItemLineDetail', 'GroupLineDetail', or 'DescriptionOnly'`); + } + }); + + data.Line = lines; + } + + // Add simple field mapping + this.addIfDefined(data, this, { + expirationDate: "ExpirationDate", + acceptedBy: "AcceptedBy", + acceptedDate: "AcceptedDate", + docNumber: "DocNumber", + privateNote: "PrivateNote", + }); + + if (this.billEmail) { + data.BillEmail = { + Address: this.billEmail, + }; + } + + if (this.currencyRefValue) { + data.CurrencyRef = { + value: this.currencyRefValue, + }; + } + + if (this.customerMemo) { + data.CustomerMemo = { + value: this.customerMemo, + }; + } + + const response = await this.quickbooks.updateEstimate({ + $, + data, + }); + + if (response?.Estimate?.Id) { + $.export("$summary", `Successfully updated estimate with ID ${response.Estimate.Id}`); + } else { + throw new ConfigurationError("Failed to update estimate: Invalid response from QuickBooks API"); + } + + return response; + }, +}; diff --git a/components/quickbooks/actions/update-invoice/update-invoice.mjs b/components/quickbooks/actions/update-invoice/update-invoice.mjs new file mode 100644 index 0000000000000..464f7e2b5d67b --- /dev/null +++ b/components/quickbooks/actions/update-invoice/update-invoice.mjs @@ -0,0 +1,362 @@ +import { ConfigurationError } from "@pipedream/platform"; +import quickbooks from "../../quickbooks.app.mjs"; +import { + parseLineItems, + buildSalesLineItems, +} from "../../common/utils.mjs"; + +export default { + key: "quickbooks-update-invoice", + name: "Update Invoice", + description: "Updates an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#update-an-invoice)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + invoiceId: { + propDefinition: [ + quickbooks, + "invoiceId", + ], + }, + customerRefValue: { + propDefinition: [ + quickbooks, + "customer", + ], + }, + billEmail: { + type: "string", + label: "Bill Email", + description: "Email address where the invoice should be sent", + optional: true, + }, + dueDate: { + type: "string", + label: "Due Date", + description: "Date when the payment of the transaction is due (YYYY-MM-DD)", + optional: true, + }, + allowOnlineCreditCardPayment: { + type: "boolean", + label: "Allow Online Credit Card Payment", + description: "Allow online credit card payment", + optional: true, + }, + allowOnlineACHPayment: { + type: "boolean", + label: "Allow Online Bank Transfer Payment", + description: "Allow online bank transfer payment", + optional: true, + }, + currencyRefValue: { + propDefinition: [ + quickbooks, + "currency", + ], + optional: true, + }, + docNumber: { + type: "string", + label: "Document Number", + description: "Reference number for the transaction", + optional: true, + }, + billingStreetAddress: { + propDefinition: [ + quickbooks, + "billingStreetAddress", + ], + }, + billingCity: { + propDefinition: [ + quickbooks, + "billingCity", + ], + }, + billingState: { + propDefinition: [ + quickbooks, + "billingState", + ], + }, + billingZip: { + propDefinition: [ + quickbooks, + "billingZip", + ], + }, + billingLatitude: { + propDefinition: [ + quickbooks, + "billingLatitude", + ], + }, + billingLongitude: { + propDefinition: [ + quickbooks, + "billingLongitude", + ], + }, + shippingStreetAddress: { + propDefinition: [ + quickbooks, + "shippingStreetAddress", + ], + }, + shippingCity: { + propDefinition: [ + quickbooks, + "shippingCity", + ], + }, + shippingState: { + propDefinition: [ + quickbooks, + "shippingState", + ], + }, + shippingZip: { + propDefinition: [ + quickbooks, + "shippingZip", + ], + }, + shippingLatitude: { + propDefinition: [ + quickbooks, + "shippingLatitude", + ], + }, + shippingLongitude: { + propDefinition: [ + quickbooks, + "shippingLongitude", + ], + }, + trackingNum: { + type: "string", + label: "Tracking Number", + description: "Shipping tracking number", + optional: true, + }, + privateNote: { + type: "string", + label: "Private Note", + description: "Private note for internal use", + optional: true, + }, + customerMemo: { + type: "string", + label: "Customer Memo", + description: "Memo visible to customer", + optional: true, + }, + taxCodeId: { + propDefinition: [ + quickbooks, + "taxCodeId", + ], + optional: true, + }, + lineItemsAsObjects: { + propDefinition: [ + quickbooks, + "lineItemsAsObjects", + ], + reloadProps: true, + }, + }, + async additionalProps() { + const props = {}; + if (this.lineItemsAsObjects) { + props.lineItems = { + type: "string[]", + label: "Line Items", + description: "Line items of an invoice. Set DetailType to `SalesItemLineDetail`, `GroupLineDetail`, or `DescriptionOnly`. Example: `{ \"DetailType\": \"SalesItemLineDetail\", \"Amount\": 100.0, \"SalesItemLineDetail\": { \"ItemRef\": { \"name\": \"Services\", \"value\": \"1\" } } }` [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#update-an-invoice) for more information", + }; + return props; + } + props.numLineItems = { + type: "integer", + label: "Number of Line Items", + description: "The number of line items to enter", + reloadProps: true, + }; + if (!this.numLineItems) { + return props; + } + for (let i = 1; i <= this.numLineItems; i++) { + props[`item_${i}`] = { + type: "string", + label: `Line ${i} - Item ID`, + options: async ({ page }) => { + return this.quickbooks.getPropOptions({ + page, + resource: "Item", + mapper: ({ + Id: value, Name: label, + }) => ({ + value, + label, + }), + }); + }, + }; + props[`amount_${i}`] = { + type: "string", + label: `Line ${i} - Amount`, + }; + } + return props; + }, + methods: { + buildLineItems() { + return buildSalesLineItems(this.numLineItems, this); + }, + addIfDefined(target, source, mappings) { + Object.entries(mappings).forEach(([ + sourceKey, + targetConfig, + ]) => { + const value = source[sourceKey]; + if (value !== undefined && value !== null) { + if (typeof targetConfig === "string") { + target[targetConfig] = value; + } else if (typeof targetConfig === "object") { + target[targetConfig.key] = targetConfig.transform + ? targetConfig.transform(value) + : value; + } + } + }); + }, + }, + async run({ $ }) { + // Get the current invoice to obtain SyncToken + const response = await this.quickbooks.getInvoice({ + $, + invoiceId: this.invoiceId, + }); + + // Validate that the invoice was found and is valid + if (!response || !response.Invoice) { + throw new ConfigurationError(`Invoice with ID '${this.invoiceId}' not found. Please verify the invoice ID is correct.`); + } + + const invoice = response.Invoice; + + // Validate that the invoice has required properties + if (!invoice.Id) { + throw new ConfigurationError("Invalid invoice data received: missing Invoice ID"); + } + + if (!invoice.SyncToken) { + throw new ConfigurationError("Invalid invoice data received: missing SyncToken. This may indicate the invoice is in an invalid state."); + } + + const hasBillingAddress = this.billingStreetAddress + || this.billingCity + || this.billingState + || this.billingZip + || this.billingLatitude + || this.billingLongitude; + const hasShippingAddress = this.shippingStreetAddress + || this.shippingCity + || this.shippingState + || this.shippingZip + || this.shippingLatitude + || this.shippingLongitude; + + const data = { + Id: this.invoiceId, + SyncToken: invoice.SyncToken, + BillAddr: hasBillingAddress + ? { + Line1: this.billingStreetAddress, + City: this.billingCity, + CountrySubDivisionCode: this.billingState, + PostalCode: this.billingZip, + Lat: this.billingLatitude, + Long: this.billingLongitude, + } + : undefined, + ShipAddr: hasShippingAddress + ? { + Line1: this.shippingStreetAddress, + City: this.shippingCity, + CountrySubDivisionCode: this.shippingState, + PostalCode: this.shippingZip, + Lat: this.shippingLatitude, + Long: this.shippingLongitude, + } + : undefined, + }; + + // Only update fields that are provided + if (this.customerRefValue) { + data.CustomerRef = { + value: this.customerRefValue, + }; + } + + if (this.lineItemsAsObjects || this.numLineItems) { + const lines = this.lineItemsAsObjects + ? parseLineItems(this.lineItems) + : this.buildLineItems(); + + lines.forEach((line, index) => { + if (line.DetailType !== "SalesItemLineDetail" && line.DetailType !== "GroupLineDetail" && line.DetailType !== "DescriptionOnly") { + throw new ConfigurationError(`Line Item at index ${index + 1} has invalid DetailType '${line.DetailType}'. Must be 'SalesItemLineDetail', 'GroupLineDetail', or 'DescriptionOnly'`); + } + }); + + data.Line = lines; + } + + this.addIfDefined(data, this, { + dueDate: "DueDate", + docNumber: "DocNumber", + trackingNum: "TrackingNum", + privateNote: "PrivateNote", + }); + + if (typeof this.allowOnlineCreditCardPayment === "boolean") { + data.AllowOnlineCreditCardPayment = this.allowOnlineCreditCardPayment; + } + if (typeof this.allowOnlineACHPayment === "boolean") { + data.AllowOnlineACHPayment = this.allowOnlineACHPayment; + } + + if (this.billEmail) { + data.BillEmail = { + Address: this.billEmail, + }; + } + + if (this.currencyRefValue) { + data.CurrencyRef = { + value: this.currencyRefValue, + }; + } + + if (this.customerMemo) { + data.CustomerMemo = { + value: this.customerMemo, + }; + } + + const updateResponse = await this.quickbooks.updateInvoice({ + $, + data, + }); + + if (updateResponse?.Invoice?.Id) { + $.export("$summary", `Successfully updated invoice with ID ${updateResponse.Invoice.Id}`); + } else { + throw new ConfigurationError("Failed to update invoice: Invalid response from QuickBooks API"); + } + + return updateResponse; + }, +}; diff --git a/components/quickbooks/actions/update-item/update-item.mjs b/components/quickbooks/actions/update-item/update-item.mjs index 6aeb093cd91f0..97ca7402754a4 100644 --- a/components/quickbooks/actions/update-item/update-item.mjs +++ b/components/quickbooks/actions/update-item/update-item.mjs @@ -5,7 +5,7 @@ export default { key: "quickbooks-update-item", name: "Update Item", description: "Updates an item. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#full-update-an-item)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { quickbooks, diff --git a/components/quickbooks/actions/void-invoice/void-invoice.mjs b/components/quickbooks/actions/void-invoice/void-invoice.mjs new file mode 100644 index 0000000000000..3fe697a8250a3 --- /dev/null +++ b/components/quickbooks/actions/void-invoice/void-invoice.mjs @@ -0,0 +1,55 @@ +import { ConfigurationError } from "@pipedream/platform"; +import quickbooks from "../../quickbooks.app.mjs"; + +export default { + key: "quickbooks-void-invoice", + name: "Void Invoice", + description: "Voids an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#void-an-invoice)", + version: "0.0.1", + type: "action", + props: { + quickbooks, + invoiceId: { + propDefinition: [ + quickbooks, + "invoiceId", + ], + }, + }, + async run({ $ }) { + // Get the current invoice to obtain SyncToken + const invoiceResponse = await this.quickbooks.getInvoice({ + $, + invoiceId: this.invoiceId, + }); + + if (!invoiceResponse?.Invoice) { + throw new ConfigurationError(`Invoice with ID ${this.invoiceId} not found or could not be retrieved.`); + } + + const invoice = invoiceResponse.Invoice; + if (!invoice.SyncToken) { + throw new ConfigurationError(`Invoice ${this.invoiceId} is missing required SyncToken.`); + } + + const data = { + Id: this.invoiceId, + SyncToken: invoice.SyncToken, + }; + + const response = await this.quickbooks.voidInvoice({ + $, + data, + }); + + if (response) { + if (response.Invoice?.Id) { + $.export("summary", `Successfully voided invoice with ID ${response.Invoice.Id}`); + } else { + $.export("summary", `Invoice void operation completed for ID ${this.invoiceId}`); + } + } + + return response; + }, +}; diff --git a/components/quickbooks/common/utils.mjs b/components/quickbooks/common/utils.mjs index fb0d909f06b08..8b2f9a1b0921a 100644 --- a/components/quickbooks/common/utils.mjs +++ b/components/quickbooks/common/utils.mjs @@ -14,6 +14,37 @@ export const parseOne = (obj) => { return parsed; }; +export function parseObject(obj) { + if (!obj) { + return undefined; + } + + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch { + return obj; + } + } + + if (Array.isArray(obj)) { + return obj.map(parseObject); + } + + if (typeof obj === "object") { + const parsed = {}; + for (const [ + key, + value, + ] of Object.entries(obj)) { + parsed[key] = parseObject(value); + } + return parsed; + } + + return obj; +} + export async function retryWithExponentialBackoff( requestFn, retries = MAX_RETRIES, backoff = INITIAL_BACKOFF_MILLISECONDS, ) { @@ -44,3 +75,145 @@ export function parseLineItems(arr) { throw new ConfigurationError(`We got an error trying to parse the LineItems. Error: ${error}`); } } + +export function buildSalesLineItems(numLineItems, context) { + // Validate numLineItems parameter + if (typeof numLineItems !== "number" || !Number.isInteger(numLineItems) || numLineItems <= 0) { + throw new ConfigurationError("numLineItems must be a positive integer"); + } + + // Validate context parameter + if (!context || typeof context !== "object" || Array.isArray(context)) { + throw new ConfigurationError("context must be an object"); + } + + // Validate required keys exist for each line item + const missingKeys = []; + for (let i = 1; i <= numLineItems; i++) { + if (!Object.prototype.hasOwnProperty.call(context, `amount_${i}`)) { + missingKeys.push(`amount_${i}`); + } + if (!Object.prototype.hasOwnProperty.call(context, `item_${i}`)) { + missingKeys.push(`item_${i}`); + } + } + + if (missingKeys.length > 0) { + throw new ConfigurationError(`Missing required keys in context: ${missingKeys.join(", ")}`); + } + + // Validate amount values are valid numbers + const invalidAmounts = []; + for (let i = 1; i <= numLineItems; i++) { + const amount = context[`amount_${i}`]; + if (amount !== undefined && amount !== null && amount !== "" && + (typeof amount !== "number" && (typeof amount !== "string" || isNaN(parseFloat(amount))))) { + invalidAmounts.push(`amount_${i}`); + } + } + + if (invalidAmounts.length > 0) { + throw new ConfigurationError(`Invalid amount values for: ${invalidAmounts.join(", ")}. Amounts must be valid numbers.`); + } + + const lineItems = []; + for (let i = 1; i <= numLineItems; i++) { + lineItems.push({ + DetailType: "SalesItemLineDetail", + Amount: context[`amount_${i}`], + SalesItemLineDetail: { + ItemRef: { + value: context[`item_${i}`], + }, + }, + }); + } + return lineItems; +} + +export function buildPurchaseLineItems(numLineItems, context) { + // Validate numLineItems parameter + if (typeof numLineItems !== "number" || !Number.isInteger(numLineItems) || numLineItems <= 0) { + throw new ConfigurationError("numLineItems must be a positive integer"); + } + + // Validate context parameter + if (!context || typeof context !== "object" || Array.isArray(context)) { + throw new ConfigurationError("context must be an object"); + } + + // Validate required keys exist for each line item + const missingKeys = []; + for (let i = 1; i <= numLineItems; i++) { + if (!Object.prototype.hasOwnProperty.call(context, `amount_${i}`)) { + missingKeys.push(`amount_${i}`); + } + if (!Object.prototype.hasOwnProperty.call(context, `item_${i}`)) { + missingKeys.push(`item_${i}`); + } + } + + if (missingKeys.length > 0) { + throw new ConfigurationError(`Missing required keys in context: ${missingKeys.join(", ")}`); + } + + // Validate amount values are valid numbers + const invalidAmounts = []; + for (let i = 1; i <= numLineItems; i++) { + const amount = context[`amount_${i}`]; + if (amount !== undefined && amount !== null && amount !== "" && + (typeof amount !== "number" && (typeof amount !== "string" || isNaN(parseFloat(amount))))) { + invalidAmounts.push(`amount_${i}`); + } + } + + if (invalidAmounts.length > 0) { + throw new ConfigurationError(`Invalid amount values for: ${invalidAmounts.join(", ")}. Amounts must be valid numbers.`); + } + + // Validate detailType values if provided + const validDetailTypes = [ + "ItemBasedExpenseLineDetail", + "AccountBasedExpenseLineDetail", + ]; + const invalidDetailTypes = []; + for (let i = 1; i <= numLineItems; i++) { + const detailType = context[`detailType_${i}`]; + if (detailType && !validDetailTypes.includes(detailType)) { + invalidDetailTypes.push(`detailType_${i}: ${detailType}`); + } + } + + if (invalidDetailTypes.length > 0) { + throw new ConfigurationError(`Invalid detailType values for: ${invalidDetailTypes.join(", ")}. Valid types are: ${validDetailTypes.join(", ")}`); + } + + const lineItems = []; + for (let i = 1; i <= numLineItems; i++) { + const detailType = context[`detailType_${i}`] || "ItemBasedExpenseLineDetail"; + + // Extract conditional logic into clear variables + const isItemBased = detailType === "ItemBasedExpenseLineDetail"; + const detailPropertyName = isItemBased + ? "ItemBasedExpenseLineDetail" + : "AccountBasedExpenseLineDetail"; + const refPropertyName = isItemBased + ? "ItemRef" + : "AccountRef"; + + // Build line item with clearer structure + const lineItem = { + DetailType: detailType, + Amount: context[`amount_${i}`], + [detailPropertyName]: { + [refPropertyName]: { + value: context[`item_${i}`], + }, + Qty: context[`quantity_${i}`], + }, + }; + + lineItems.push(lineItem); + } + return lineItems; +} diff --git a/components/quickbooks/package.json b/components/quickbooks/package.json index 2d08f37d6dc54..c42d7faecd0f7 100644 --- a/components/quickbooks/package.json +++ b/components/quickbooks/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/quickbooks", - "version": "0.5.4", + "version": "0.6.0", "description": "Pipedream Quickbooks Components", "main": "quickbooks.app.mjs", "keywords": [ diff --git a/components/quickbooks/quickbooks.app.mjs b/components/quickbooks/quickbooks.app.mjs index 96307d7354d84..8e750d2affbfb 100644 --- a/components/quickbooks/quickbooks.app.mjs +++ b/components/quickbooks/quickbooks.app.mjs @@ -9,7 +9,7 @@ export default { invoiceId: { label: "Invoice ID", type: "string", - description: "Id of the invoice to get details of", + description: "ID of the invoice to get details of", async options({ page }) { return this.getPropOptions({ page, @@ -116,6 +116,42 @@ export default { }); }, }, + estimateId: { + label: "Estimate ID", + type: "string", + description: "ID of the estimate to get details of", + async options({ page }) { + return this.getPropOptions({ + page, + resource: "Estimate", + mapper: ({ + Id: value, DocNumber: docNumber, CustomerRef: customerRef, + }) => ({ + label: `${docNumber + ? `(${docNumber}) ` + : ""}${customerRef.name}`, + value, + }), + }); + }, + }, + vendor: { + label: "Vendor Reference", + type: "string", + description: "Reference to a vendor", + async options({ page }) { + return this.getPropOptions({ + page, + resource: "Vendor", + mapper: ({ + Id: id, DisplayName: label, + }) => ({ + label, + value: id, + }), + }); + }, + }, termIds: { type: "string[]", label: "Term IDs", @@ -437,6 +473,78 @@ export default { description: "Column types to be shown in the report", optional: true, }, + billingStreetAddress: { + type: "string", + label: "Billing Street Address", + description: "The street address of the billing address", + optional: true, + }, + billingCity: { + type: "string", + label: "Billing City", + description: "The city of the billing address", + optional: true, + }, + billingState: { + type: "string", + label: "Billing State", + description: "The state of the billing address", + optional: true, + }, + billingZip: { + type: "string", + label: "Billing Zip", + description: "The zip code of the billing address", + optional: true, + }, + billingLatitude: { + type: "string", + label: "Billing Latitude", + description: "The latitude of the billing address", + optional: true, + }, + billingLongitude: { + type: "string", + label: "Billing Longitude", + description: "The longitude of the billing address", + optional: true, + }, + shippingStreetAddress: { + type: "string", + label: "Shipping Street Address", + description: "The street address of the shipping address", + optional: true, + }, + shippingCity: { + type: "string", + label: "Shipping City", + description: "The city of the shipping address", + optional: true, + }, + shippingState: { + type: "string", + label: "Shipping State", + description: "The state of the shipping address", + optional: true, + }, + shippingZip: { + type: "string", + label: "Shipping Zip", + description: "The zip code of the shipping address", + optional: true, + }, + shippingLatitude: { + type: "string", + label: "Shipping Latitude", + description: "The latitude of the shipping address", + optional: true, + }, + shippingLongitude: { + type: "string", + label: "Shipping Longitude", + description: "The longitude of the shipping address", + optional: true, + }, }, methods: { _companyId() { @@ -519,6 +627,76 @@ export default { ...opts, }); }, + sendInvoice({ + invoiceId, ...opts + }) { + return this._makeRequest({ + path: `company/${this._companyId()}/invoice/${invoiceId}/send`, + method: "post", + ...opts, + }); + }, + updateInvoice(opts = {}) { + return this._makeRequest({ + path: `company/${this._companyId()}/invoice`, + method: "post", + params: { + operation: "update", + }, + ...opts, + }); + }, + voidInvoice(opts = {}) { + return this._makeRequest({ + path: `company/${this._companyId()}/invoice`, + method: "post", + params: { + operation: "void", + }, + ...opts, + }); + }, + createPurchaseOrder(opts = {}) { + return this._makeRequest({ + path: `company/${this._companyId()}/purchaseorder`, + method: "post", + ...opts, + }); + }, + createEstimate(opts = {}) { + return this._makeRequest({ + path: `company/${this._companyId()}/estimate`, + method: "post", + ...opts, + }); + }, + sendEstimate({ + estimateId, ...opts + }) { + return this._makeRequest({ + path: `company/${this._companyId()}/estimate/${estimateId}/send`, + method: "post", + ...opts, + }); + }, + updateEstimate(opts = {}) { + return this._makeRequest({ + path: `company/${this._companyId()}/estimate`, + method: "post", + params: { + operation: "update", + }, + ...opts, + }); + }, + getEstimate({ + estimateId, ...opts + }) { + return this._makeRequest({ + path: `company/${this._companyId()}/estimate/${estimateId}`, + ...opts, + }); + }, createSalesReceipt(opts = {}) { return this._makeRequest({ path: `company/${this._companyId()}/salesreceipt`, diff --git a/components/quickbooks/sources/new-customer-created/new-customer-created.mjs b/components/quickbooks/sources/new-customer-created/new-customer-created.mjs index 037f81e135afa..ec7fb31b29311 100644 --- a/components/quickbooks/sources/new-customer-created/new-customer-created.mjs +++ b/components/quickbooks/sources/new-customer-created/new-customer-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-customer-created", name: "New Customer Created", description: "Emit new event when a new customer is created.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs b/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs index 5f7ec1477b9d7..9ad50717b2ca6 100644 --- a/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs +++ b/components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-customer-updated", name: "New Customer Updated", description: "Emit new event when a customer is updated.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-employee-created/new-employee-created.mjs b/components/quickbooks/sources/new-employee-created/new-employee-created.mjs index 4a7b938a7de96..02530898c4660 100644 --- a/components/quickbooks/sources/new-employee-created/new-employee-created.mjs +++ b/components/quickbooks/sources/new-employee-created/new-employee-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-employee-created", name: "New Employee Created", description: "Emit new event when a new employee is created.", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-employee-updated/new-employee-updated.mjs b/components/quickbooks/sources/new-employee-updated/new-employee-updated.mjs index 4de774c06a07f..3d1a03d86b4f3 100644 --- a/components/quickbooks/sources/new-employee-updated/new-employee-updated.mjs +++ b/components/quickbooks/sources/new-employee-updated/new-employee-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-employee-updated", name: "New Employee Updated", description: "Emit new event when an employee is updated.", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs b/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs index 44205dabe3a07..f43afbdf65ad6 100644 --- a/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs +++ b/components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-invoice-created", name: "New Invoice Created", description: "Emit new event when a new invoice is created.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs b/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs index 8e584ee018a40..7744a2232ff6c 100644 --- a/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs +++ b/components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-invoice-updated", name: "New Invoice Updated", description: "Emit new event when an invoice is updated.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-item-created/new-item-created.mjs b/components/quickbooks/sources/new-item-created/new-item-created.mjs index 0436825e02d80..faf6739009b74 100644 --- a/components/quickbooks/sources/new-item-created/new-item-created.mjs +++ b/components/quickbooks/sources/new-item-created/new-item-created.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-item-created", name: "New Item Created", description: "Emit new event when a new item is created.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/quickbooks/sources/new-item-updated/new-item-updated.mjs b/components/quickbooks/sources/new-item-updated/new-item-updated.mjs index dff39f0ec7208..a2c6cdfe1ef45 100644 --- a/components/quickbooks/sources/new-item-updated/new-item-updated.mjs +++ b/components/quickbooks/sources/new-item-updated/new-item-updated.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-new-item-updated", name: "New Item Updated", description: "Emit new event when an item is updated.", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", methods: { diff --git a/components/v1ce/v1ce.app.mjs b/components/v1ce/v1ce.app.mjs index bc0c1a1fbf347..8b35cdb193e30 100644 --- a/components/v1ce/v1ce.app.mjs +++ b/components/v1ce/v1ce.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/yay_com/yay_com.app.mjs b/components/yay_com/yay_com.app.mjs index c6bfe307b8444..0218c54955d7f 100644 --- a/components/yay_com/yay_com.app.mjs +++ b/components/yay_com/yay_com.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a0e6f69d632c..1b6cf38d31fc9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -751,8 +751,7 @@ importers: components/amazon_polly: {} - components/amazon_redshift: - specifiers: {} + components/amazon_redshift: {} components/amazon_selling_partner: {} @@ -36089,6 +36088,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: