modern-treasury 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/README.md +43 -15
- package/_shims/ReadableStream-node.d.ts +6 -0
- package/_shims/ReadableStream-node.d.ts.map +1 -0
- package/_shims/ReadableStream-node.js +14 -0
- package/_shims/ReadableStream-node.js.map +1 -0
- package/_shims/ReadableStream-node.mjs +3 -0
- package/_shims/ReadableStream-node.mjs.map +1 -0
- package/_shims/ReadableStream.d.ts +38 -0
- package/_shims/ReadableStream.js +5 -0
- package/_shims/ReadableStream.mjs +7 -0
- package/_shims/{agent.node.d.ts → agent-node.d.ts} +1 -1
- package/_shims/agent-node.d.ts.map +1 -0
- package/_shims/{agent.node.js → agent-node.js} +1 -1
- package/_shims/{agent.node.js.map → agent-node.js.map} +1 -1
- package/_shims/{agent.node.mjs → agent-node.mjs} +1 -1
- package/_shims/{agent.node.mjs.map → agent-node.mjs.map} +1 -1
- package/_shims/agent.d.ts +1 -1
- package/_shims/agent.js +1 -1
- package/_shims/agent.mjs +1 -1
- package/_shims/{fetch.node.d.ts → fetch-node.d.ts} +12 -1
- package/_shims/fetch.d.ts +9 -1
- package/_shims/{fileFromPath.node.d.ts → fileFromPath-node.d.ts} +2 -2
- package/_shims/{fileFromPath.node.d.ts.map → fileFromPath-node.d.ts.map} +1 -1
- package/_shims/{fileFromPath.node.js → fileFromPath-node.js} +1 -1
- package/_shims/{fileFromPath.node.js.map → fileFromPath-node.js.map} +1 -1
- package/_shims/{fileFromPath.node.mjs → fileFromPath-node.mjs} +1 -1
- package/_shims/{fileFromPath.node.mjs.map → fileFromPath-node.mjs.map} +1 -1
- package/_shims/fileFromPath.d.ts +2 -2
- package/_shims/fileFromPath.d.ts.map +1 -1
- package/_shims/fileFromPath.js +1 -1
- package/_shims/fileFromPath.mjs +1 -1
- package/_shims/form-data.js +17 -0
- package/_shims/form-data.mjs +20 -0
- package/_shims/{getMultipartRequestOptions.node.d.ts → getMultipartRequestOptions-node.d.ts} +2 -2
- package/_shims/getMultipartRequestOptions-node.d.ts.map +1 -0
- package/_shims/{getMultipartRequestOptions.node.js → getMultipartRequestOptions-node.js} +1 -1
- package/_shims/{getMultipartRequestOptions.node.js.map → getMultipartRequestOptions-node.js.map} +1 -1
- package/_shims/{getMultipartRequestOptions.node.mjs → getMultipartRequestOptions-node.mjs} +1 -1
- package/_shims/{getMultipartRequestOptions.node.mjs.map → getMultipartRequestOptions-node.mjs.map} +1 -1
- package/_shims/getMultipartRequestOptions.d.ts +1 -1
- package/_shims/getMultipartRequestOptions.d.ts.map +1 -1
- package/_shims/{node-readable.node.d.ts → node-readable-node.d.ts} +1 -1
- package/_shims/{node-readable.node.d.ts.map → node-readable-node.d.ts.map} +1 -1
- package/_shims/{node-readable.node.js → node-readable-node.js} +1 -1
- package/_shims/node-readable-node.js.map +1 -0
- package/_shims/{node-readable.node.mjs → node-readable-node.mjs} +1 -1
- package/_shims/node-readable-node.mjs.map +1 -0
- package/core.d.ts +91 -34
- package/core.d.ts.map +1 -1
- package/core.js +201 -70
- package/core.js.map +1 -1
- package/core.mjs +195 -70
- package/core.mjs.map +1 -1
- package/index.d.mts +19 -7
- package/index.d.ts +19 -7
- package/index.d.ts.map +1 -1
- package/index.js +23 -9
- package/index.js.map +1 -1
- package/index.mjs +23 -9
- package/index.mjs.map +1 -1
- package/package.json +32 -9
- package/pagination.d.ts +2 -2
- package/pagination.d.ts.map +1 -1
- package/pagination.js +5 -5
- package/pagination.js.map +1 -1
- package/pagination.mjs +5 -5
- package/pagination.mjs.map +1 -1
- package/resources/account-collection-flows.d.ts +8 -33
- package/resources/account-collection-flows.d.ts.map +1 -1
- package/resources/account-collection-flows.js +22 -17
- package/resources/account-collection-flows.js.map +1 -1
- package/resources/account-collection-flows.mjs +22 -17
- package/resources/account-collection-flows.mjs.map +1 -1
- package/resources/account-details.d.ts +8 -13
- package/resources/account-details.d.ts.map +1 -1
- package/resources/account-details.js +10 -4
- package/resources/account-details.js.map +1 -1
- package/resources/account-details.mjs +10 -4
- package/resources/account-details.mjs.map +1 -1
- package/resources/connections.d.ts +5 -2
- package/resources/connections.d.ts.map +1 -1
- package/resources/connections.js +3 -3
- package/resources/connections.js.map +1 -1
- package/resources/connections.mjs +3 -3
- package/resources/connections.mjs.map +1 -1
- package/resources/counterparties.d.ts +37 -51
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/counterparties.js +17 -5
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs +17 -5
- package/resources/counterparties.mjs.map +1 -1
- package/resources/documents.d.ts +6 -17
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js +13 -7
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +13 -7
- package/resources/documents.mjs.map +1 -1
- package/resources/events.d.ts +3 -3
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +3 -3
- package/resources/events.mjs +3 -3
- package/resources/expected-payments.d.ts +30 -39
- package/resources/expected-payments.d.ts.map +1 -1
- package/resources/expected-payments.js +10 -4
- package/resources/expected-payments.js.map +1 -1
- package/resources/expected-payments.mjs +10 -4
- package/resources/expected-payments.mjs.map +1 -1
- package/resources/external-accounts.d.ts +27 -61
- package/resources/external-accounts.d.ts.map +1 -1
- package/resources/external-accounts.js +24 -6
- package/resources/external-accounts.js.map +1 -1
- package/resources/external-accounts.mjs +24 -6
- package/resources/external-accounts.mjs.map +1 -1
- package/resources/incoming-payment-details.d.ts +20 -21
- package/resources/incoming-payment-details.d.ts.map +1 -1
- package/resources/incoming-payment-details.js +10 -4
- package/resources/incoming-payment-details.js.map +1 -1
- package/resources/incoming-payment-details.mjs +10 -4
- package/resources/incoming-payment-details.mjs.map +1 -1
- package/resources/index.d.ts +0 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/internal-accounts/balance-reports.d.ts +6 -3
- package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
- package/resources/internal-accounts/balance-reports.js +3 -3
- package/resources/internal-accounts/balance-reports.js.map +1 -1
- package/resources/internal-accounts/balance-reports.mjs +3 -3
- package/resources/internal-accounts/balance-reports.mjs.map +1 -1
- package/resources/internal-accounts/internal-accounts.d.ts +16 -21
- package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
- package/resources/internal-accounts/internal-accounts.js +10 -4
- package/resources/internal-accounts/internal-accounts.js.map +1 -1
- package/resources/internal-accounts/internal-accounts.mjs +10 -4
- package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
- package/resources/invoices/invoices.d.ts +67 -42
- package/resources/invoices/invoices.d.ts.map +1 -1
- package/resources/invoices/invoices.js +10 -4
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs +10 -4
- package/resources/invoices/invoices.mjs.map +1 -1
- package/resources/invoices/line-items.d.ts +32 -185
- package/resources/invoices/line-items.d.ts.map +1 -1
- package/resources/invoices/line-items.js +10 -4
- package/resources/invoices/line-items.js.map +1 -1
- package/resources/invoices/line-items.mjs +10 -4
- package/resources/invoices/line-items.mjs.map +1 -1
- package/resources/ledger-account-categories.d.ts +47 -87
- package/resources/ledger-account-categories.d.ts.map +1 -1
- package/resources/ledger-account-categories.js +21 -17
- package/resources/ledger-account-categories.js.map +1 -1
- package/resources/ledger-account-categories.mjs +21 -17
- package/resources/ledger-account-categories.mjs.map +1 -1
- package/resources/ledger-account-payouts.d.ts +33 -22
- package/resources/ledger-account-payouts.d.ts.map +1 -1
- package/resources/ledger-account-payouts.js +10 -4
- package/resources/ledger-account-payouts.js.map +1 -1
- package/resources/ledger-account-payouts.mjs +10 -4
- package/resources/ledger-account-payouts.mjs.map +1 -1
- package/resources/ledger-account-statements.d.ts +11 -16
- package/resources/ledger-account-statements.d.ts.map +1 -1
- package/resources/ledger-account-statements.js +8 -2
- package/resources/ledger-account-statements.js.map +1 -1
- package/resources/ledger-account-statements.mjs +8 -2
- package/resources/ledger-account-statements.mjs.map +1 -1
- package/resources/ledger-accounts.d.ts +30 -30
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js +10 -4
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs +10 -4
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/ledger-entries.d.ts +20 -6
- package/resources/ledger-entries.d.ts.map +1 -1
- package/resources/ledger-entries.js +3 -3
- package/resources/ledger-entries.js.map +1 -1
- package/resources/ledger-entries.mjs +3 -3
- package/resources/ledger-entries.mjs.map +1 -1
- package/resources/ledger-event-handlers.d.ts +12 -24
- package/resources/ledger-event-handlers.d.ts.map +1 -1
- package/resources/ledger-event-handlers.js +10 -4
- package/resources/ledger-event-handlers.js.map +1 -1
- package/resources/ledger-event-handlers.mjs +10 -4
- package/resources/ledger-event-handlers.mjs.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.d.ts +48 -37
- package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.js +13 -7
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs +13 -7
- package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
- package/resources/ledger-transactions/versions.d.ts +4 -2
- package/resources/ledger-transactions/versions.d.ts.map +1 -1
- package/resources/ledger-transactions/versions.js +3 -3
- package/resources/ledger-transactions/versions.js.map +1 -1
- package/resources/ledger-transactions/versions.mjs +3 -3
- package/resources/ledger-transactions/versions.mjs.map +1 -1
- package/resources/ledgerable-events.d.ts +13 -18
- package/resources/ledgerable-events.d.ts.map +1 -1
- package/resources/ledgerable-events.js +8 -2
- package/resources/ledgerable-events.js.map +1 -1
- package/resources/ledgerable-events.mjs +8 -2
- package/resources/ledgerable-events.mjs.map +1 -1
- package/resources/ledgers.d.ts +16 -20
- package/resources/ledgers.d.ts.map +1 -1
- package/resources/ledgers.js +10 -4
- package/resources/ledgers.js.map +1 -1
- package/resources/ledgers.mjs +10 -4
- package/resources/ledgers.mjs.map +1 -1
- package/resources/line-items.d.ts +5 -5
- package/resources/line-items.d.ts.map +1 -1
- package/resources/line-items.js +3 -3
- package/resources/line-items.mjs +3 -3
- package/resources/paper-items.d.ts +6 -3
- package/resources/paper-items.d.ts.map +1 -1
- package/resources/paper-items.js +3 -3
- package/resources/paper-items.js.map +1 -1
- package/resources/paper-items.mjs +3 -3
- package/resources/paper-items.mjs.map +1 -1
- package/resources/payment-flows.d.ts +18 -42
- package/resources/payment-flows.d.ts.map +1 -1
- package/resources/payment-flows.js +22 -17
- package/resources/payment-flows.js.map +1 -1
- package/resources/payment-flows.mjs +22 -17
- package/resources/payment-flows.mjs.map +1 -1
- package/resources/payment-orders/payment-orders.d.ts +172 -191
- package/resources/payment-orders/payment-orders.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.js +21 -11
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs +21 -11
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +21 -22
- package/resources/payment-orders/reversals.d.ts.map +1 -1
- package/resources/payment-orders/reversals.js +10 -4
- package/resources/payment-orders/reversals.js.map +1 -1
- package/resources/payment-orders/reversals.mjs +10 -4
- package/resources/payment-orders/reversals.mjs.map +1 -1
- package/resources/payment-references.d.ts +3 -3
- package/resources/payment-references.d.ts.map +1 -1
- package/resources/payment-references.js +3 -3
- package/resources/payment-references.mjs +3 -3
- package/resources/returns.d.ts +16 -19
- package/resources/returns.d.ts.map +1 -1
- package/resources/returns.js +10 -4
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs +10 -4
- package/resources/returns.mjs.map +1 -1
- package/resources/routing-details.d.ts +9 -15
- package/resources/routing-details.d.ts.map +1 -1
- package/resources/routing-details.js +10 -4
- package/resources/routing-details.js.map +1 -1
- package/resources/routing-details.mjs +10 -4
- package/resources/routing-details.mjs.map +1 -1
- package/resources/transactions/line-items.d.ts +5 -2
- package/resources/transactions/line-items.d.ts.map +1 -1
- package/resources/transactions/line-items.js +3 -3
- package/resources/transactions/line-items.js.map +1 -1
- package/resources/transactions/line-items.mjs +3 -3
- package/resources/transactions/line-items.mjs.map +1 -1
- package/resources/transactions/transactions.d.ts +8 -5
- package/resources/transactions/transactions.d.ts.map +1 -1
- package/resources/transactions/transactions.js +3 -3
- package/resources/transactions/transactions.js.map +1 -1
- package/resources/transactions/transactions.mjs +3 -3
- package/resources/transactions/transactions.mjs.map +1 -1
- package/resources/validations.d.ts +1 -1
- package/resources/validations.d.ts.map +1 -1
- package/resources/validations.js +1 -1
- package/resources/validations.mjs +1 -1
- package/resources/virtual-accounts.d.ts +19 -28
- package/resources/virtual-accounts.d.ts.map +1 -1
- package/resources/virtual-accounts.js +10 -4
- package/resources/virtual-accounts.js.map +1 -1
- package/resources/virtual-accounts.mjs +10 -4
- package/resources/virtual-accounts.mjs.map +1 -1
- package/resources/webhooks.js +2 -2
- package/resources/webhooks.mjs +2 -2
- package/src/_shims/ReadableStream-node.ts +6 -0
- package/src/_shims/ReadableStream.d.ts +38 -0
- package/src/_shims/ReadableStream.js +5 -0
- package/src/_shims/ReadableStream.mjs +7 -0
- package/src/_shims/agent.ts +1 -1
- package/src/_shims/{fetch.node.d.ts → fetch-node.d.ts} +20 -9
- package/src/_shims/fetch.d.ts +18 -10
- package/src/_shims/{fileFromPath.node.ts → fileFromPath-node.ts} +1 -1
- package/src/_shims/fileFromPath.ts +2 -2
- package/src/_shims/{formdata.node.d.ts → form-data-node.d.ts} +4 -4
- package/src/_shims/{formdata.d.ts → form-data.d.ts} +4 -4
- package/src/_shims/form-data.js +17 -0
- package/src/_shims/form-data.mjs +20 -0
- package/src/_shims/{getMultipartRequestOptions.node.ts → getMultipartRequestOptions-node.ts} +3 -3
- package/src/_shims/getMultipartRequestOptions.ts +3 -3
- package/src/core.ts +275 -97
- package/src/error.ts +1 -1
- package/src/index.ts +31 -18
- package/src/pagination.ts +6 -6
- package/src/resource.ts +1 -1
- package/src/resources/account-collection-flows.ts +29 -57
- package/src/resources/account-details.ts +22 -22
- package/src/resources/connections.ts +11 -8
- package/src/resources/counterparties.ts +61 -65
- package/src/resources/documents.ts +21 -30
- package/src/resources/events.ts +9 -9
- package/src/resources/expected-payments.ts +45 -49
- package/src/resources/external-accounts.ts +59 -78
- package/src/resources/incoming-payment-details.ts +38 -33
- package/src/resources/index.ts +39 -36
- package/src/resources/internal-accounts/balance-reports.ts +13 -10
- package/src/resources/internal-accounts/index.ts +2 -2
- package/src/resources/internal-accounts/internal-accounts.ts +35 -35
- package/src/resources/invoices/index.ts +2 -2
- package/src/resources/invoices/invoices.ts +91 -54
- package/src/resources/invoices/line-items.ts +46 -228
- package/src/resources/ledger-account-categories.ts +67 -111
- package/src/resources/ledger-account-payouts.ts +49 -30
- package/src/resources/ledger-account-statements.ts +21 -21
- package/src/resources/ledger-accounts.ts +46 -40
- package/src/resources/ledger-entries.ts +29 -13
- package/src/resources/ledger-event-handlers.ts +25 -35
- package/src/resources/ledger-transactions/index.ts +2 -2
- package/src/resources/ledger-transactions/ledger-transactions.ts +73 -53
- package/src/resources/ledger-transactions/versions.ts +10 -8
- package/src/resources/ledgerable-events.ts +23 -23
- package/src/resources/ledgers.ts +31 -29
- package/src/resources/line-items.ts +12 -12
- package/src/resources/paper-items.ts +13 -10
- package/src/resources/payment-flows.ts +39 -66
- package/src/resources/payment-orders/index.ts +2 -2
- package/src/resources/payment-orders/payment-orders.ts +204 -216
- package/src/resources/payment-orders/reversals.ts +36 -31
- package/src/resources/payment-references.ts +9 -9
- package/src/resources/returns.ts +30 -28
- package/src/resources/routing-details.ts +23 -24
- package/src/resources/top-level.ts +1 -1
- package/src/resources/transactions/index.ts +7 -2
- package/src/resources/transactions/line-items.ts +11 -8
- package/src/resources/transactions/transactions.ts +17 -14
- package/src/resources/validations.ts +4 -4
- package/src/resources/virtual-accounts.ts +35 -39
- package/src/resources/webhooks.ts +3 -3
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +6 -6
- package/src/version.ts +1 -1
- package/uploads.d.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +7 -7
- package/uploads.js.map +1 -1
- package/uploads.mjs +4 -4
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/agent.node.d.ts.map +0 -1
- package/_shims/formdata.js +0 -9
- package/_shims/formdata.mjs +0 -11
- package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
- package/_shims/node-readable.node.js.map +0 -1
- package/_shims/node-readable.node.mjs.map +0 -1
- package/src/_shims/fetch.deno.ts +0 -23
- package/src/_shims/formdata.deno.ts +0 -16
- package/src/_shims/formdata.js +0 -9
- package/src/_shims/formdata.mjs +0 -11
- /package/_shims/{fetch.node.js → fetch-node.js} +0 -0
- /package/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
- /package/_shims/{formdata.node.d.ts → form-data-node.d.ts} +0 -0
- /package/_shims/{formdata.node.js → form-data-node.js} +0 -0
- /package/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
- /package/_shims/{formdata.d.ts → form-data.d.ts} +0 -0
- /package/src/_shims/{agent.node.ts → agent-node.ts} +0 -0
- /package/src/_shims/{fetch.node.js → fetch-node.js} +0 -0
- /package/src/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
- /package/src/_shims/{formdata.node.js → form-data-node.js} +0 -0
- /package/src/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
- /package/src/_shims/{node-readable.node.ts → node-readable-node.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
3
|
-
import { isRequestOptions } from 'modern-treasury/core';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
|
+
import { isRequestOptions } from 'modern-treasury/core.mjs';
|
|
4
4
|
import { LineItems } from './line-items.mjs';
|
|
5
5
|
import * as API from './index.mjs';
|
|
6
|
-
import { Page } from 'modern-treasury/pagination';
|
|
6
|
+
import { Page } from 'modern-treasury/pagination.mjs';
|
|
7
7
|
export class Invoices extends APIResource {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
@@ -13,12 +13,18 @@ export class Invoices extends APIResource {
|
|
|
13
13
|
* create invoice
|
|
14
14
|
*/
|
|
15
15
|
create(params, options) {
|
|
16
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
16
17
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
|
+
if (idempotencyKey) {
|
|
19
|
+
console.warn(
|
|
20
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
21
|
+
);
|
|
22
|
+
}
|
|
17
23
|
return this.post('/api/invoices', {
|
|
18
24
|
body,
|
|
19
25
|
...options,
|
|
20
26
|
headers: {
|
|
21
|
-
'Idempotency-Key': idempotencyKey
|
|
27
|
+
'Idempotency-Key': idempotencyKey,
|
|
22
28
|
...(options === null || options === void 0 ? void 0 : options.headers),
|
|
23
29
|
},
|
|
24
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../../src/resources/invoices/invoices.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAE,gBAAgB,EAAE,MAAM,sBAAsB;OAGhD,EAAE,SAAS,EAAE;OACb,KAAK,GAAG;OACR,EAAE,IAAI,EAAc,MAAM,4BAA4B;AAE7D,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,cAAS,GAAc,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../../src/resources/invoices/invoices.ts"],"names":[],"mappings":"AAAA,qDAAq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I,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,IAAa;CAAG;AAkrBlD,WAAiB,QAAQ;IAOT,kBAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAE1B,6BAAoB,GAAG,GAAG,CAAC,oBAAoB,CAAC;AAIhE,CAAC,EAbgB,QAAQ,KAAR,QAAQ,QAaxB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Core from 'modern-treasury/core';
|
|
2
2
|
import { APIResource } from 'modern-treasury/resource';
|
|
3
|
-
import * as Shared from 'modern-treasury/resources/shared';
|
|
4
3
|
import * as API from './index.js';
|
|
5
4
|
import { Page, PageParams } from 'modern-treasury/pagination';
|
|
6
5
|
export declare class LineItems extends APIResource {
|
|
@@ -11,15 +10,11 @@ export declare class LineItems extends APIResource {
|
|
|
11
10
|
invoiceId: string,
|
|
12
11
|
params: LineItemCreateParams,
|
|
13
12
|
options?: Core.RequestOptions,
|
|
14
|
-
):
|
|
13
|
+
): Core.APIPromise<InvoiceLineItem>;
|
|
15
14
|
/**
|
|
16
15
|
* get invoice_line_item
|
|
17
16
|
*/
|
|
18
|
-
retrieve(
|
|
19
|
-
invoiceId: string,
|
|
20
|
-
id: string,
|
|
21
|
-
options?: Core.RequestOptions,
|
|
22
|
-
): Promise<Core.APIResponse<InvoiceLineItem>>;
|
|
17
|
+
retrieve(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem>;
|
|
23
18
|
/**
|
|
24
19
|
* update invoice_line_item
|
|
25
20
|
*/
|
|
@@ -28,12 +23,8 @@ export declare class LineItems extends APIResource {
|
|
|
28
23
|
id: string,
|
|
29
24
|
body?: LineItemUpdateParams,
|
|
30
25
|
options?: Core.RequestOptions,
|
|
31
|
-
):
|
|
32
|
-
update(
|
|
33
|
-
invoiceId: string,
|
|
34
|
-
id: string,
|
|
35
|
-
options?: Core.RequestOptions,
|
|
36
|
-
): Promise<Core.APIResponse<InvoiceLineItem>>;
|
|
26
|
+
): Core.APIPromise<InvoiceLineItem>;
|
|
27
|
+
update(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem>;
|
|
37
28
|
/**
|
|
38
29
|
* list invoice_line_items
|
|
39
30
|
*/
|
|
@@ -41,16 +32,15 @@ export declare class LineItems extends APIResource {
|
|
|
41
32
|
invoiceId: string,
|
|
42
33
|
query?: LineItemListParams,
|
|
43
34
|
options?: Core.RequestOptions,
|
|
44
|
-
): Core.PagePromise<InvoiceLineItemsPage>;
|
|
45
|
-
list(
|
|
35
|
+
): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem>;
|
|
36
|
+
list(
|
|
37
|
+
invoiceId: string,
|
|
38
|
+
options?: Core.RequestOptions,
|
|
39
|
+
): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem>;
|
|
46
40
|
/**
|
|
47
41
|
* delete invoice_line_item
|
|
48
42
|
*/
|
|
49
|
-
del(
|
|
50
|
-
invoiceId: string,
|
|
51
|
-
id: string,
|
|
52
|
-
options?: Core.RequestOptions,
|
|
53
|
-
): Promise<Core.APIResponse<InvoiceLineItem>>;
|
|
43
|
+
del(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem>;
|
|
54
44
|
}
|
|
55
45
|
export declare class InvoiceLineItemsPage extends Page<InvoiceLineItem> {}
|
|
56
46
|
type _InvoiceLineItemsPage = InvoiceLineItemsPage;
|
|
@@ -96,198 +86,55 @@ export interface InvoiceLineItem {
|
|
|
96
86
|
}
|
|
97
87
|
export interface LineItemCreateParams {
|
|
98
88
|
/**
|
|
99
|
-
*
|
|
89
|
+
* The name of the line item, typically a product or SKU name.
|
|
100
90
|
*/
|
|
101
91
|
name: string;
|
|
102
92
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
93
|
+
* The cost per unit of the product or service that this line item is for,
|
|
94
|
+
* specified in the invoice currency's smallest unit.
|
|
105
95
|
*/
|
|
106
96
|
unit_amount: number;
|
|
107
97
|
/**
|
|
108
|
-
*
|
|
98
|
+
* An optional free-form description of the line item.
|
|
109
99
|
*/
|
|
110
100
|
description?: string;
|
|
111
101
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
102
|
+
* Either `debit` or `credit`. `debit` indicates that a client owes the business
|
|
103
|
+
* money and increases the invoice's `total_amount` due. `credit` has the opposite
|
|
104
|
+
* intention and effect.
|
|
115
105
|
*/
|
|
116
106
|
direction?: string;
|
|
117
107
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
108
|
+
* The number of units of a product or service that this line item is for. Must be
|
|
109
|
+
* a whole number. Defaults to 1 if not provided.
|
|
120
110
|
*/
|
|
121
111
|
quantity?: number;
|
|
122
|
-
/**
|
|
123
|
-
* Header param: This key should be something unique, preferably something like an
|
|
124
|
-
* UUID.
|
|
125
|
-
*/
|
|
126
|
-
'Idempotency-Key'?: string;
|
|
127
112
|
}
|
|
128
113
|
export interface LineItemUpdateParams {
|
|
129
114
|
/**
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
contact_details?: Array<LineItemUpdateParams.ContactDetail>;
|
|
133
|
-
/**
|
|
134
|
-
* The counterparty's billing address.
|
|
135
|
-
*/
|
|
136
|
-
counterparty_billing_address?: LineItemUpdateParams.CounterpartyBillingAddress | null;
|
|
137
|
-
/**
|
|
138
|
-
* The ID of the counterparty receiving the invoice.
|
|
139
|
-
*/
|
|
140
|
-
counterparty_id?: string;
|
|
141
|
-
/**
|
|
142
|
-
* The counterparty's shipping address where physical goods should be delivered.
|
|
143
|
-
*/
|
|
144
|
-
counterparty_shipping_address?: LineItemUpdateParams.CounterpartyShippingAddress | null;
|
|
145
|
-
/**
|
|
146
|
-
* Currency that the invoice is denominated in. Defaults to `USD` if not provided.
|
|
147
|
-
*/
|
|
148
|
-
currency?: Shared.Currency | null;
|
|
149
|
-
/**
|
|
150
|
-
* A free-form description of the invoice.
|
|
115
|
+
* An optional free-form description of the line item.
|
|
151
116
|
*/
|
|
152
117
|
description?: string;
|
|
153
118
|
/**
|
|
154
|
-
*
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The invoice issuer's business address.
|
|
159
|
-
*/
|
|
160
|
-
invoicer_address?: LineItemUpdateParams.InvoicerAddress | null;
|
|
161
|
-
/**
|
|
162
|
-
* The ID of the internal account the invoice should be paid to.
|
|
163
|
-
*/
|
|
164
|
-
originating_account_id?: string;
|
|
165
|
-
/**
|
|
166
|
-
* Date transactions are to be posted to the participants' account. Defaults to the
|
|
167
|
-
* current business day or the next business day if the current day is a bank
|
|
168
|
-
* holiday or weekend. Format: yyyy-mm-dd.
|
|
169
|
-
*/
|
|
170
|
-
payment_effective_date?: string;
|
|
171
|
-
/**
|
|
172
|
-
* The method by which the invoice can be paid. `ui` will show the embedded payment
|
|
173
|
-
* collection flow. `automatic` will automatically initiate payment based upon the
|
|
174
|
-
* account details of the receiving_account id.\nIf the invoice amount is positive,
|
|
175
|
-
* the automatically initiated payment order's direction will be debit. If the
|
|
176
|
-
* invoice amount is negative, the automatically initiated payment order's
|
|
177
|
-
* direction will be credit. One of `manual`, `ui`, or `automatic`.
|
|
178
|
-
*/
|
|
179
|
-
payment_method?: 'ui' | 'manual' | 'automatic';
|
|
180
|
-
/**
|
|
181
|
-
* One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
|
|
182
|
-
* `au_becs`, `interac`, `signet`, `provexchange`.
|
|
183
|
-
*/
|
|
184
|
-
payment_type?:
|
|
185
|
-
| 'ach'
|
|
186
|
-
| 'au_becs'
|
|
187
|
-
| 'bacs'
|
|
188
|
-
| 'book'
|
|
189
|
-
| 'card'
|
|
190
|
-
| 'check'
|
|
191
|
-
| 'eft'
|
|
192
|
-
| 'cross_border'
|
|
193
|
-
| 'interac'
|
|
194
|
-
| 'masav'
|
|
195
|
-
| 'neft'
|
|
196
|
-
| 'provxchange'
|
|
197
|
-
| 'rtp'
|
|
198
|
-
| 'sen'
|
|
199
|
-
| 'sepa'
|
|
200
|
-
| 'signet'
|
|
201
|
-
| 'wire';
|
|
202
|
-
/**
|
|
203
|
-
* The receiving account ID. Can be an `external_account`.
|
|
119
|
+
* Either `debit` or `credit`. `debit` indicates that a client owes the business
|
|
120
|
+
* money and increases the invoice's `total_amount` due. `credit` has the opposite
|
|
121
|
+
* intention and effect.
|
|
204
122
|
*/
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
export declare namespace LineItemUpdateParams {
|
|
208
|
-
interface ContactDetail {
|
|
209
|
-
id: string;
|
|
210
|
-
contact_identifier: string;
|
|
211
|
-
contact_identifier_type: 'email' | 'phone_number' | 'website';
|
|
212
|
-
created_at: string;
|
|
213
|
-
discarded_at: string | null;
|
|
214
|
-
/**
|
|
215
|
-
* This field will be true if this object exists in the live environment or false
|
|
216
|
-
* if it exists in the test environment.
|
|
217
|
-
*/
|
|
218
|
-
live_mode: boolean;
|
|
219
|
-
object: string;
|
|
220
|
-
updated_at: string;
|
|
221
|
-
}
|
|
123
|
+
direction?: string;
|
|
222
124
|
/**
|
|
223
|
-
* The
|
|
125
|
+
* The name of the line item, typically a product or SKU name.
|
|
224
126
|
*/
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
228
|
-
*/
|
|
229
|
-
country: string;
|
|
230
|
-
line1: string;
|
|
231
|
-
/**
|
|
232
|
-
* Locality or City.
|
|
233
|
-
*/
|
|
234
|
-
locality: string;
|
|
235
|
-
/**
|
|
236
|
-
* The postal code of the address.
|
|
237
|
-
*/
|
|
238
|
-
postal_code: string;
|
|
239
|
-
/**
|
|
240
|
-
* Region or State.
|
|
241
|
-
*/
|
|
242
|
-
region: string;
|
|
243
|
-
line2?: string;
|
|
244
|
-
}
|
|
127
|
+
name?: string;
|
|
245
128
|
/**
|
|
246
|
-
* The
|
|
129
|
+
* The number of units of a product or service that this line item is for. Must be
|
|
130
|
+
* a whole number. Defaults to 1 if not provided.
|
|
247
131
|
*/
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
251
|
-
*/
|
|
252
|
-
country: string;
|
|
253
|
-
line1: string;
|
|
254
|
-
/**
|
|
255
|
-
* Locality or City.
|
|
256
|
-
*/
|
|
257
|
-
locality: string;
|
|
258
|
-
/**
|
|
259
|
-
* The postal code of the address.
|
|
260
|
-
*/
|
|
261
|
-
postal_code: string;
|
|
262
|
-
/**
|
|
263
|
-
* Region or State.
|
|
264
|
-
*/
|
|
265
|
-
region: string;
|
|
266
|
-
line2?: string;
|
|
267
|
-
}
|
|
132
|
+
quantity?: number;
|
|
268
133
|
/**
|
|
269
|
-
* The
|
|
134
|
+
* The cost per unit of the product or service that this line item is for,
|
|
135
|
+
* specified in the invoice currency's smallest unit.
|
|
270
136
|
*/
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
274
|
-
*/
|
|
275
|
-
country: string;
|
|
276
|
-
line1: string;
|
|
277
|
-
/**
|
|
278
|
-
* Locality or City.
|
|
279
|
-
*/
|
|
280
|
-
locality: string;
|
|
281
|
-
/**
|
|
282
|
-
* The postal code of the address.
|
|
283
|
-
*/
|
|
284
|
-
postal_code: string;
|
|
285
|
-
/**
|
|
286
|
-
* Region or State.
|
|
287
|
-
*/
|
|
288
|
-
region: string;
|
|
289
|
-
line2?: string;
|
|
290
|
-
}
|
|
137
|
+
unit_amount?: number;
|
|
291
138
|
}
|
|
292
139
|
export interface LineItemListParams extends PageParams {}
|
|
293
140
|
export declare namespace LineItems {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-items.d.ts","sourceRoot":"","sources":["../../src/resources/invoices/line-items.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"line-items.d.ts","sourceRoot":"","sources":["../../src/resources/invoices/line-items.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE9D,qBAAa,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IAenC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IAIxG;;OAEG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,oBAAoB,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IACnC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IAatG;;OAEG;IACH,IAAI,CACF,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OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAmB,SAAQ,UAAU;CAAG;AAEzD,yBAAiB,SAAS,CAAC;IACzB,MAAM,QAAQ,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC;IACpD,KAAY,oBAAoB,GAAG,qBAAqB,CAAC;IACzD,MAAM,QAAQ,oBAAoB,GAAG,GAAG,CAAC,oBAAoB,CAAC;IAC9D,MAAM,QAAQ,oBAAoB,GAAG,GAAG,CAAC,oBAAoB,CAAC;IAC9D,MAAM,QAAQ,kBAAkB,GAAG,GAAG,CAAC,kBAAkB,CAAC;CAC3D"}
|
|
@@ -2,20 +2,26 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
exports.InvoiceLineItemsPage = exports.LineItems = void 0;
|
|
5
|
-
const resource_1 = require('modern-treasury/resource');
|
|
6
|
-
const core_1 = require('modern-treasury/core');
|
|
7
|
-
const pagination_1 = require('modern-treasury/pagination');
|
|
5
|
+
const resource_1 = require('modern-treasury/resource.js');
|
|
6
|
+
const core_1 = require('modern-treasury/core.js');
|
|
7
|
+
const pagination_1 = require('modern-treasury/pagination.js');
|
|
8
8
|
class LineItems extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* create invoice_line_item
|
|
11
11
|
*/
|
|
12
12
|
create(invoiceId, params, options) {
|
|
13
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
13
14
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
15
|
+
if (idempotencyKey) {
|
|
16
|
+
console.warn(
|
|
17
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
18
|
+
);
|
|
19
|
+
}
|
|
14
20
|
return this.post(`/api/invoices/${invoiceId}/invoice_line_items`, {
|
|
15
21
|
body,
|
|
16
22
|
...options,
|
|
17
23
|
headers: {
|
|
18
|
-
'Idempotency-Key': idempotencyKey
|
|
24
|
+
'Idempotency-Key': idempotencyKey,
|
|
19
25
|
...(options === null || options === void 0 ? void 0 : options.headers),
|
|
20
26
|
},
|
|
21
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-items.js","sourceRoot":"","sources":["../../src/resources/invoices/line-items.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,uDAAuD;AACvD,+CAAwD;
|
|
1
|
+
{"version":3,"file":"line-items.js","sourceRoot":"","sources":["../../src/resources/invoices/line-items.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,uDAAuD;AACvD,+CAAwD;AAExD,2DAA8D;AAE9D,MAAa,SAAU,SAAQ,sBAAW;IACxC;;OAEG;IACH,MAAM,CACJ,SAAiB,EACjB,MAA4B,EAC5B,OAA6B;QAE7B,qGAAqG;QACrG,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,IAAI,cAAc,EAAE;YAClB,OAAO,CAAC,IAAI,CACV,sGAAsG,CACvG,CAAC;SACH;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,SAAS,qBAAqB,EAAE;YAChE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAE;SACpE,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;I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
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
3
|
-
import { isRequestOptions } from 'modern-treasury/core';
|
|
4
|
-
import { Page } from 'modern-treasury/pagination';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
|
+
import { isRequestOptions } from 'modern-treasury/core.mjs';
|
|
4
|
+
import { Page } from 'modern-treasury/pagination.mjs';
|
|
5
5
|
export class LineItems extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* create invoice_line_item
|
|
8
8
|
*/
|
|
9
9
|
create(invoiceId, params, options) {
|
|
10
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
10
11
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
12
|
+
if (idempotencyKey) {
|
|
13
|
+
console.warn(
|
|
14
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
15
|
+
);
|
|
16
|
+
}
|
|
11
17
|
return this.post(`/api/invoices/${invoiceId}/invoice_line_items`, {
|
|
12
18
|
body,
|
|
13
19
|
...options,
|
|
14
20
|
headers: {
|
|
15
|
-
'Idempotency-Key': idempotencyKey
|
|
21
|
+
'Idempotency-Key': idempotencyKey,
|
|
16
22
|
...(options === null || options === void 0 ? void 0 : options.headers),
|
|
17
23
|
},
|
|
18
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-items.mjs","sourceRoot":"","sources":["../../src/resources/invoices/line-items.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAE,gBAAgB,EAAE,MAAM,sBAAsB;
|
|
1
|
+
{"version":3,"file":"line-items.mjs","sourceRoot":"","sources":["../../src/resources/invoices/line-items.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAE,gBAAgB,EAAE,MAAM,sBAAsB;OAEhD,EAAE,IAAI,E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