@revenexx/node 0.1.0 → 0.1.1
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/README.md +3 -0
- package/dist/client.d.mts +25 -0
- package/dist/client.d.ts +25 -0
- package/dist/client.js +39 -18
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +35 -14
- package/dist/client.mjs.map +1 -1
- package/dist/enums/approval-rule-approver-type.d.mts +7 -0
- package/dist/enums/approval-rule-approver-type.d.ts +7 -0
- package/dist/enums/approval-rule-approver-type.js +12 -0
- package/dist/enums/approval-rule-approver-type.js.map +1 -0
- package/dist/enums/approval-rule-approver-type.mjs +11 -0
- package/dist/enums/approval-rule-approver-type.mjs.map +1 -0
- package/dist/enums/approval-rule-condition.d.mts +10 -0
- package/dist/enums/approval-rule-condition.d.ts +10 -0
- package/dist/enums/approval-rule-condition.js +15 -0
- package/dist/enums/approval-rule-condition.js.map +1 -0
- package/dist/enums/approval-rule-condition.mjs +14 -0
- package/dist/enums/approval-rule-condition.mjs.map +1 -0
- package/dist/enums/approval-rule-create-request-approver-type.d.mts +7 -0
- package/dist/enums/approval-rule-create-request-approver-type.d.ts +7 -0
- package/dist/enums/approval-rule-create-request-approver-type.js +12 -0
- package/dist/enums/approval-rule-create-request-approver-type.js.map +1 -0
- package/dist/enums/approval-rule-create-request-approver-type.mjs +11 -0
- package/dist/enums/approval-rule-create-request-approver-type.mjs.map +1 -0
- package/dist/enums/approval-rule-create-request-condition.d.mts +10 -0
- package/dist/enums/approval-rule-create-request-condition.d.ts +10 -0
- package/dist/enums/approval-rule-create-request-condition.js +15 -0
- package/dist/enums/approval-rule-create-request-condition.js.map +1 -0
- package/dist/enums/approval-rule-create-request-condition.mjs +14 -0
- package/dist/enums/approval-rule-create-request-condition.mjs.map +1 -0
- package/dist/enums/approval-rule-create-request-effect.d.mts +7 -0
- package/dist/enums/approval-rule-create-request-effect.d.ts +7 -0
- package/dist/enums/approval-rule-create-request-effect.js +12 -0
- package/dist/enums/approval-rule-create-request-effect.js.map +1 -0
- package/dist/enums/approval-rule-create-request-effect.mjs +11 -0
- package/dist/enums/approval-rule-create-request-effect.mjs.map +1 -0
- package/dist/enums/approval-rule-effect.d.mts +7 -0
- package/dist/enums/approval-rule-effect.d.ts +7 -0
- package/dist/enums/approval-rule-effect.js +12 -0
- package/dist/enums/approval-rule-effect.js.map +1 -0
- package/dist/enums/approval-rule-effect.mjs +11 -0
- package/dist/enums/approval-rule-effect.mjs.map +1 -0
- package/dist/enums/approval-rule-update-request-approver-type.d.mts +7 -0
- package/dist/enums/approval-rule-update-request-approver-type.d.ts +7 -0
- package/dist/enums/approval-rule-update-request-approver-type.js +12 -0
- package/dist/enums/approval-rule-update-request-approver-type.js.map +1 -0
- package/dist/enums/approval-rule-update-request-approver-type.mjs +11 -0
- package/dist/enums/approval-rule-update-request-approver-type.mjs.map +1 -0
- package/dist/enums/approval-rule-update-request-condition.d.mts +10 -0
- package/dist/enums/approval-rule-update-request-condition.d.ts +10 -0
- package/dist/enums/approval-rule-update-request-condition.js +15 -0
- package/dist/enums/approval-rule-update-request-condition.js.map +1 -0
- package/dist/enums/approval-rule-update-request-condition.mjs +14 -0
- package/dist/enums/approval-rule-update-request-condition.mjs.map +1 -0
- package/dist/enums/approval-rule-update-request-effect.d.mts +7 -0
- package/dist/enums/approval-rule-update-request-effect.d.ts +7 -0
- package/dist/enums/approval-rule-update-request-effect.js +12 -0
- package/dist/enums/approval-rule-update-request-effect.js.map +1 -0
- package/dist/enums/approval-rule-update-request-effect.mjs +11 -0
- package/dist/enums/approval-rule-update-request-effect.mjs.map +1 -0
- package/dist/enums/approver-type.d.mts +7 -0
- package/dist/enums/approver-type.d.ts +7 -0
- package/dist/enums/approver-type.js +12 -0
- package/dist/enums/approver-type.js.map +1 -0
- package/dist/enums/approver-type.mjs +11 -0
- package/dist/enums/approver-type.mjs.map +1 -0
- package/dist/enums/condition.d.mts +10 -0
- package/dist/enums/condition.d.ts +10 -0
- package/dist/enums/condition.js +15 -0
- package/dist/enums/condition.js.map +1 -0
- package/dist/enums/condition.mjs +14 -0
- package/dist/enums/condition.mjs.map +1 -0
- package/dist/enums/effect.d.mts +7 -0
- package/dist/enums/effect.d.ts +7 -0
- package/dist/enums/effect.js +12 -0
- package/dist/enums/effect.js.map +1 -0
- package/dist/enums/effect.mjs +11 -0
- package/dist/enums/effect.mjs.map +1 -0
- package/dist/enums/pending-approval-approver-type.d.mts +7 -0
- package/dist/enums/pending-approval-approver-type.d.ts +7 -0
- package/dist/enums/pending-approval-approver-type.js +12 -0
- package/dist/enums/pending-approval-approver-type.js.map +1 -0
- package/dist/enums/pending-approval-approver-type.mjs +11 -0
- package/dist/enums/pending-approval-approver-type.mjs.map +1 -0
- package/dist/enums/pending-approval-status.d.mts +7 -0
- package/dist/enums/pending-approval-status.d.ts +7 -0
- package/dist/enums/pending-approval-status.js +12 -0
- package/dist/enums/pending-approval-status.js.map +1 -0
- package/dist/enums/pending-approval-status.mjs +11 -0
- package/dist/enums/pending-approval-status.mjs.map +1 -0
- package/dist/enums/procurement-purchase-request-items-create-type.d.mts +7 -0
- package/dist/enums/procurement-purchase-request-items-create-type.d.ts +7 -0
- package/dist/enums/procurement-purchase-request-items-create-type.js +12 -0
- package/dist/enums/procurement-purchase-request-items-create-type.js.map +1 -0
- package/dist/enums/procurement-purchase-request-items-create-type.mjs +11 -0
- package/dist/enums/procurement-purchase-request-items-create-type.mjs.map +1 -0
- package/dist/enums/purchase-request-event-name.d.mts +12 -0
- package/dist/enums/purchase-request-event-name.d.ts +12 -0
- package/dist/enums/purchase-request-event-name.js +17 -0
- package/dist/enums/purchase-request-event-name.js.map +1 -0
- package/dist/enums/purchase-request-event-name.mjs +16 -0
- package/dist/enums/purchase-request-event-name.mjs.map +1 -0
- package/dist/enums/purchase-request-item-create-request-type.d.mts +7 -0
- package/dist/enums/purchase-request-item-create-request-type.d.ts +7 -0
- package/dist/enums/purchase-request-item-create-request-type.js +12 -0
- package/dist/enums/purchase-request-item-create-request-type.js.map +1 -0
- package/dist/enums/purchase-request-item-create-request-type.mjs +11 -0
- package/dist/enums/purchase-request-item-create-request-type.mjs.map +1 -0
- package/dist/enums/purchase-request-item-type.d.mts +7 -0
- package/dist/enums/purchase-request-item-type.d.ts +7 -0
- package/dist/enums/purchase-request-item-type.js +12 -0
- package/dist/enums/purchase-request-item-type.js.map +1 -0
- package/dist/enums/purchase-request-item-type.mjs +11 -0
- package/dist/enums/purchase-request-item-type.mjs.map +1 -0
- package/dist/enums/purchase-request-item-update-request-type.d.mts +7 -0
- package/dist/enums/purchase-request-item-update-request-type.d.ts +7 -0
- package/dist/enums/purchase-request-item-update-request-type.js +12 -0
- package/dist/enums/purchase-request-item-update-request-type.js.map +1 -0
- package/dist/enums/purchase-request-item-update-request-type.mjs +11 -0
- package/dist/enums/purchase-request-item-update-request-type.mjs.map +1 -0
- package/dist/enums/purchase-request-status.d.mts +9 -0
- package/dist/enums/purchase-request-status.d.ts +9 -0
- package/dist/enums/purchase-request-status.js +14 -0
- package/dist/enums/purchase-request-status.js.map +1 -0
- package/dist/enums/purchase-request-status.mjs +13 -0
- package/dist/enums/purchase-request-status.mjs.map +1 -0
- package/dist/enums/submit-item-type.d.mts +7 -0
- package/dist/enums/submit-item-type.d.ts +7 -0
- package/dist/enums/submit-item-type.js +12 -0
- package/dist/enums/submit-item-type.js.map +1 -0
- package/dist/enums/submit-item-type.mjs +11 -0
- package/dist/enums/submit-item-type.mjs.map +1 -0
- package/dist/enums/submit-result-outcome.d.mts +9 -0
- package/dist/enums/submit-result-outcome.d.ts +9 -0
- package/dist/enums/submit-result-outcome.js +14 -0
- package/dist/enums/submit-result-outcome.js.map +1 -0
- package/dist/enums/submit-result-outcome.mjs +13 -0
- package/dist/enums/submit-result-outcome.mjs.map +1 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +115 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -0
- package/dist/index.mjs.map +1 -1
- package/dist/inputFile.js +1 -2
- package/dist/inputFile.js.map +1 -1
- package/dist/inputFile.mjs +0 -1
- package/dist/inputFile.mjs.map +1 -1
- package/dist/models.d.mts +1027 -36
- package/dist/models.d.ts +1027 -36
- package/dist/operator.js +243 -204
- package/dist/operator.js.map +1 -1
- package/dist/operator.mjs +242 -203
- package/dist/operator.mjs.map +1 -1
- package/dist/permission.js +58 -48
- package/dist/permission.js.map +1 -1
- package/dist/permission.mjs +58 -48
- package/dist/permission.mjs.map +1 -1
- package/dist/query.js +525 -422
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +524 -421
- package/dist/query.mjs.map +1 -1
- package/dist/services/apps.d.mts +18 -0
- package/dist/services/apps.d.ts +18 -0
- package/dist/services/avatars.d.mts +18 -0
- package/dist/services/avatars.d.ts +18 -0
- package/dist/services/carts-io.d.mts +46 -28
- package/dist/services/carts-io.d.ts +46 -28
- package/dist/services/carts-io.js.map +1 -1
- package/dist/services/carts-io.mjs.map +1 -1
- package/dist/services/carts-items.d.mts +42 -24
- package/dist/services/carts-items.d.ts +42 -24
- package/dist/services/carts-items.js.map +1 -1
- package/dist/services/carts-items.mjs.map +1 -1
- package/dist/services/carts.d.mts +70 -52
- package/dist/services/carts.d.ts +70 -52
- package/dist/services/carts.js.map +1 -1
- package/dist/services/carts.mjs.map +1 -1
- package/dist/services/channels.d.mts +64 -46
- package/dist/services/channels.d.ts +64 -46
- package/dist/services/channels.js +1 -1
- package/dist/services/channels.js.map +1 -1
- package/dist/services/channels.mjs +1 -1
- package/dist/services/channels.mjs.map +1 -1
- package/dist/services/cost-centers.d.mts +18 -0
- package/dist/services/cost-centers.d.ts +18 -0
- package/dist/services/customers-contacts.d.mts +62 -44
- package/dist/services/customers-contacts.d.ts +62 -44
- package/dist/services/customers-contacts.js.map +1 -1
- package/dist/services/customers-contacts.mjs.map +1 -1
- package/dist/services/customers-organizations.d.mts +58 -40
- package/dist/services/customers-organizations.d.ts +58 -40
- package/dist/services/customers-organizations.js.map +1 -1
- package/dist/services/customers-organizations.mjs.map +1 -1
- package/dist/services/customers-roles.d.mts +26 -8
- package/dist/services/customers-roles.d.ts +26 -8
- package/dist/services/customers-roles.js.map +1 -1
- package/dist/services/customers-roles.mjs.map +1 -1
- package/dist/services/customers-segments.d.mts +62 -44
- package/dist/services/customers-segments.d.ts +62 -44
- package/dist/services/customers-segments.js.map +1 -1
- package/dist/services/customers-segments.mjs.map +1 -1
- package/dist/services/customers-value-lists.d.mts +90 -72
- package/dist/services/customers-value-lists.d.ts +90 -72
- package/dist/services/customers-value-lists.js.map +1 -1
- package/dist/services/customers-value-lists.mjs.map +1 -1
- package/dist/services/customers.d.mts +78 -60
- package/dist/services/customers.d.ts +78 -60
- package/dist/services/customers.js.map +1 -1
- package/dist/services/customers.mjs.map +1 -1
- package/dist/services/events.d.mts +18 -0
- package/dist/services/events.d.ts +18 -0
- package/dist/services/forms.d.mts +66 -48
- package/dist/services/forms.d.ts +66 -48
- package/dist/services/forms.js.map +1 -1
- package/dist/services/forms.mjs.map +1 -1
- package/dist/services/health.d.mts +18 -0
- package/dist/services/health.d.ts +18 -0
- package/dist/services/inventories-locations.d.mts +38 -20
- package/dist/services/inventories-locations.d.ts +38 -20
- package/dist/services/inventories-locations.js.map +1 -1
- package/dist/services/inventories-locations.mjs.map +1 -1
- package/dist/services/inventories-reservations.d.mts +38 -20
- package/dist/services/inventories-reservations.d.ts +38 -20
- package/dist/services/inventories-reservations.js.map +1 -1
- package/dist/services/inventories-reservations.mjs.map +1 -1
- package/dist/services/inventories-stock.d.mts +70 -52
- package/dist/services/inventories-stock.d.ts +70 -52
- package/dist/services/inventories-stock.js.map +1 -1
- package/dist/services/inventories-stock.mjs.map +1 -1
- package/dist/services/io.d.mts +66 -48
- package/dist/services/io.d.ts +66 -48
- package/dist/services/io.js +2 -2
- package/dist/services/io.js.map +1 -1
- package/dist/services/io.mjs +2 -2
- package/dist/services/io.mjs.map +1 -1
- package/dist/services/locale.d.mts +18 -0
- package/dist/services/locale.d.ts +18 -0
- package/dist/services/markets.d.mts +122 -104
- package/dist/services/markets.d.ts +122 -104
- package/dist/services/markets.js.map +1 -1
- package/dist/services/markets.mjs.map +1 -1
- package/dist/services/messaging.d.mts +194 -176
- package/dist/services/messaging.d.ts +194 -176
- package/dist/services/messaging.js +3 -3
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +3 -3
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/orderlists.d.mts +96 -78
- package/dist/services/orderlists.d.ts +96 -78
- package/dist/services/orderlists.js +1 -1
- package/dist/services/orderlists.js.map +1 -1
- package/dist/services/orderlists.mjs +1 -1
- package/dist/services/orderlists.mjs.map +1 -1
- package/dist/services/orders.d.mts +114 -96
- package/dist/services/orders.d.ts +114 -96
- package/dist/services/orders.js.map +1 -1
- package/dist/services/orders.mjs.map +1 -1
- package/dist/services/pages-collaboration.d.mts +34 -16
- package/dist/services/pages-collaboration.d.ts +34 -16
- package/dist/services/pages-collaboration.js.map +1 -1
- package/dist/services/pages-collaboration.mjs.map +1 -1
- package/dist/services/pages-delivery.d.mts +26 -8
- package/dist/services/pages-delivery.d.ts +26 -8
- package/dist/services/pages-delivery.js.map +1 -1
- package/dist/services/pages-delivery.mjs.map +1 -1
- package/dist/services/pages-editor.d.mts +34 -16
- package/dist/services/pages-editor.d.ts +34 -16
- package/dist/services/pages-editor.js.map +1 -1
- package/dist/services/pages-editor.mjs.map +1 -1
- package/dist/services/pages.d.mts +82 -64
- package/dist/services/pages.d.ts +82 -64
- package/dist/services/pages.js.map +1 -1
- package/dist/services/pages.mjs.map +1 -1
- package/dist/services/payments-ledger.d.mts +54 -36
- package/dist/services/payments-ledger.d.ts +54 -36
- package/dist/services/payments-ledger.js.map +1 -1
- package/dist/services/payments-ledger.mjs.map +1 -1
- package/dist/services/payments-methods.d.mts +34 -16
- package/dist/services/payments-methods.d.ts +34 -16
- package/dist/services/payments-methods.js.map +1 -1
- package/dist/services/payments-methods.mjs.map +1 -1
- package/dist/services/payments-providers.d.mts +38 -20
- package/dist/services/payments-providers.d.ts +38 -20
- package/dist/services/payments-providers.js.map +1 -1
- package/dist/services/payments-providers.mjs.map +1 -1
- package/dist/services/prices.d.mts +86 -68
- package/dist/services/prices.d.ts +86 -68
- package/dist/services/prices.js.map +1 -1
- package/dist/services/prices.mjs.map +1 -1
- package/dist/services/procurement.d.mts +991 -0
- package/dist/services/procurement.d.ts +991 -0
- package/dist/services/procurement.js +1185 -0
- package/dist/services/procurement.js.map +1 -0
- package/dist/services/procurement.mjs +1184 -0
- package/dist/services/procurement.mjs.map +1 -0
- package/dist/services/products-assets.d.mts +34 -16
- package/dist/services/products-assets.d.ts +34 -16
- package/dist/services/products-assets.js.map +1 -1
- package/dist/services/products-assets.mjs.map +1 -1
- package/dist/services/products-categories.d.mts +66 -48
- package/dist/services/products-categories.d.ts +66 -48
- package/dist/services/products-categories.js.map +1 -1
- package/dist/services/products-categories.mjs.map +1 -1
- package/dist/services/products-data-model.d.mts +166 -148
- package/dist/services/products-data-model.d.ts +166 -148
- package/dist/services/products-data-model.js.map +1 -1
- package/dist/services/products-data-model.mjs.map +1 -1
- package/dist/services/products-references.d.mts +50 -32
- package/dist/services/products-references.d.ts +50 -32
- package/dist/services/products-references.js.map +1 -1
- package/dist/services/products-references.mjs.map +1 -1
- package/dist/services/products.d.mts +70 -52
- package/dist/services/products.d.ts +70 -52
- package/dist/services/products.js.map +1 -1
- package/dist/services/products.mjs.map +1 -1
- package/dist/services/search.d.mts +40 -22
- package/dist/services/search.d.ts +40 -22
- package/dist/services/search.js +1 -1
- package/dist/services/search.js.map +1 -1
- package/dist/services/search.mjs +1 -1
- package/dist/services/search.mjs.map +1 -1
- package/dist/services/settings.d.mts +18 -0
- package/dist/services/settings.d.ts +18 -0
- package/dist/services/shipping-carriers.d.mts +42 -24
- package/dist/services/shipping-carriers.d.ts +42 -24
- package/dist/services/shipping-carriers.js.map +1 -1
- package/dist/services/shipping-carriers.mjs.map +1 -1
- package/dist/services/shipping-methods.d.mts +70 -52
- package/dist/services/shipping-methods.d.ts +70 -52
- package/dist/services/shipping-methods.js.map +1 -1
- package/dist/services/shipping-methods.mjs.map +1 -1
- package/dist/services/shipping-value-lists.d.mts +62 -44
- package/dist/services/shipping-value-lists.d.ts +62 -44
- package/dist/services/shipping-value-lists.js.map +1 -1
- package/dist/services/shipping-value-lists.mjs.map +1 -1
- package/dist/services/sites.d.mts +18 -0
- package/dist/services/sites.d.ts +18 -0
- package/dist/services/storage.d.mts +18 -0
- package/dist/services/storage.d.ts +18 -0
- package/package.json +6 -3
|
@@ -9,6 +9,15 @@ import '../query.js';
|
|
|
9
9
|
import '../enums/address-type-row-tone.js';
|
|
10
10
|
import '../enums/address-type-row-create-request-tone.js';
|
|
11
11
|
import '../enums/address-type-row-update-request-tone.js';
|
|
12
|
+
import '../enums/approval-rule-approver-type.js';
|
|
13
|
+
import '../enums/approval-rule-condition.js';
|
|
14
|
+
import '../enums/approval-rule-effect.js';
|
|
15
|
+
import '../enums/approval-rule-create-request-approver-type.js';
|
|
16
|
+
import '../enums/approval-rule-create-request-condition.js';
|
|
17
|
+
import '../enums/approval-rule-create-request-effect.js';
|
|
18
|
+
import '../enums/approval-rule-update-request-approver-type.js';
|
|
19
|
+
import '../enums/approval-rule-update-request-condition.js';
|
|
20
|
+
import '../enums/approval-rule-update-request-effect.js';
|
|
12
21
|
import '../enums/assets-source.js';
|
|
13
22
|
import '../enums/attribute-value-bucket.js';
|
|
14
23
|
import '../enums/auth-mail-source.js';
|
|
@@ -117,6 +126,8 @@ import '../enums/payment-term-tone.js';
|
|
|
117
126
|
import '../enums/payment-term-create-request-tone.js';
|
|
118
127
|
import '../enums/payment-term-update-request-tone.js';
|
|
119
128
|
import '../enums/payment-vocabulary-tone.js';
|
|
129
|
+
import '../enums/pending-approval-approver-type.js';
|
|
130
|
+
import '../enums/pending-approval-status.js';
|
|
120
131
|
import '../enums/price-ending-rule.js';
|
|
121
132
|
import '../enums/price-entries-adjust-response-rounding.js';
|
|
122
133
|
import '../enums/price-entries-adjust-response-rounding-mode.js';
|
|
@@ -139,6 +150,11 @@ import '../enums/product-grid-column-source.js';
|
|
|
139
150
|
import '../enums/product-label-source.js';
|
|
140
151
|
import '../enums/product-label-attribute-source.js';
|
|
141
152
|
import '../enums/products-kind.js';
|
|
153
|
+
import '../enums/purchase-request-status.js';
|
|
154
|
+
import '../enums/purchase-request-event-name.js';
|
|
155
|
+
import '../enums/purchase-request-item-type.js';
|
|
156
|
+
import '../enums/purchase-request-item-create-request-type.js';
|
|
157
|
+
import '../enums/purchase-request-item-update-request-type.js';
|
|
142
158
|
import '../enums/reorder-point-source.js';
|
|
143
159
|
import '../enums/reservation-status.js';
|
|
144
160
|
import '../enums/price-on-request-reason.js';
|
|
@@ -176,6 +192,8 @@ import '../enums/shipping-weight-unit-row-tone.js';
|
|
|
176
192
|
import '../enums/shipping-weight-unit-update-request-tone.js';
|
|
177
193
|
import '../enums/stock-movement-type.js';
|
|
178
194
|
import '../enums/store-asset-request-visibility.js';
|
|
195
|
+
import '../enums/submit-item-type.js';
|
|
196
|
+
import '../enums/submit-result-outcome.js';
|
|
179
197
|
import '../enums/validation-failed-response-status.js';
|
|
180
198
|
import '../enums/vocabulary-default-tone.js';
|
|
181
199
|
import '../enums/vocabulary-source.js';
|
|
@@ -237,7 +255,7 @@ declare class CartsIo {
|
|
|
237
255
|
* @param {string} params.sessionKey - Guest owner of the cart this import creates — the storefront's own session key. Ignored when target_cart_id is sent.
|
|
238
256
|
* @param {string} params.targetCartId - An existing ACTIVE cart to import into. The lines are added to it (merging identical product lines), unless the profile says `apply_mode: replace`, which clears it first. Without this a new cart is created and an owner is required.
|
|
239
257
|
* @throws {RevenexxException}
|
|
240
|
-
* @returns {Promise<Models.
|
|
258
|
+
* @returns {Promise<Models.CartImport>}
|
|
241
259
|
*/
|
|
242
260
|
cartsImport(params?: {
|
|
243
261
|
contactId?: string;
|
|
@@ -247,7 +265,7 @@ declare class CartsIo {
|
|
|
247
265
|
profileId?: string;
|
|
248
266
|
sessionKey?: string;
|
|
249
267
|
targetCartId?: string;
|
|
250
|
-
}): Promise<Models.
|
|
268
|
+
}): Promise<Models.CartImport>;
|
|
251
269
|
/**
|
|
252
270
|
* Reads a payload of lines into a cart — the bulk-order path a buyer pastes a spreadsheet into. With `target_cart_id` the lines land in that cart, which must be active, and the profile's `apply_mode` decides what happens to the lines already there: 'replace' clears them first, 'insert' and 'append' both add. Without a target a new cart is created, and an OWNER is then required — `contact_id` or `session_key` — because a cart with neither cannot exist. `profile_id` names an IMPORT profile; without one the payload is read ad hoc, as CSV when `csv` is present and as JSON otherwise. The lines fold into identical product lines exactly as carts.items.create does, so `imported_lines` counts the lines READ and the cart may have gained fewer rows than that. A payload that parses to no line at all is a 400 rather than a quiet no-op.
|
|
253
271
|
*
|
|
@@ -259,10 +277,10 @@ declare class CartsIo {
|
|
|
259
277
|
* @param {string} sessionKey - Guest owner of the cart this import creates — the storefront's own session key. Ignored when target_cart_id is sent.
|
|
260
278
|
* @param {string} targetCartId - An existing ACTIVE cart to import into. The lines are added to it (merging identical product lines), unless the profile says `apply_mode: replace`, which clears it first. Without this a new cart is created and an owner is required.
|
|
261
279
|
* @throws {RevenexxException}
|
|
262
|
-
* @returns {Promise<Models.
|
|
280
|
+
* @returns {Promise<Models.CartImport>}
|
|
263
281
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
264
282
|
*/
|
|
265
|
-
cartsImport(contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string): Promise<Models.
|
|
283
|
+
cartsImport(contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string): Promise<Models.CartImport>;
|
|
266
284
|
/**
|
|
267
285
|
* The filters are what make this list usable: `?direction=export` is how a client offers the profiles that carts.export will accept, and `?is_template=true` separates the four bundled templates from what a merchant wrote. An unknown column is dropped rather than refused — `filter` echoes what was understood.
|
|
268
286
|
*
|
|
@@ -279,7 +297,7 @@ declare class CartsIo {
|
|
|
279
297
|
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
280
298
|
* @param {string} params.order - Sort by one column: 'column' | 'column.asc' | 'column.desc'. A bare column sorts ascending. Anything else is refused with 400.
|
|
281
299
|
* @throws {RevenexxException}
|
|
282
|
-
* @returns {Promise<
|
|
300
|
+
* @returns {Promise<{}>}
|
|
283
301
|
*/
|
|
284
302
|
cartsIoProfilesList(params?: {
|
|
285
303
|
id?: string;
|
|
@@ -294,7 +312,7 @@ declare class CartsIo {
|
|
|
294
312
|
limit?: number;
|
|
295
313
|
offset?: number;
|
|
296
314
|
order?: string;
|
|
297
|
-
}): Promise<
|
|
315
|
+
}): Promise<{}>;
|
|
298
316
|
/**
|
|
299
317
|
* The filters are what make this list usable: `?direction=export` is how a client offers the profiles that carts.export will accept, and `?is_template=true` separates the four bundled templates from what a merchant wrote. An unknown column is dropped rather than refused — `filter` echoes what was understood.
|
|
300
318
|
*
|
|
@@ -311,10 +329,10 @@ declare class CartsIo {
|
|
|
311
329
|
* @param {number} offset - Row offset for pagination (default 0).
|
|
312
330
|
* @param {string} order - Sort by one column: 'column' | 'column.asc' | 'column.desc'. A bare column sorts ascending. Anything else is refused with 400.
|
|
313
331
|
* @throws {RevenexxException}
|
|
314
|
-
* @returns {Promise<
|
|
332
|
+
* @returns {Promise<{}>}
|
|
315
333
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
316
334
|
*/
|
|
317
|
-
cartsIoProfilesList(id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string): Promise<
|
|
335
|
+
cartsIoProfilesList(id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
318
336
|
/**
|
|
319
337
|
* Defines a new import/export profile. Two fields are required and have no default — `name`, which must be unique within the tenant, and `direction`, which fixes the one way this profile will ever run. Everything else defaults to the common case: whole carts, JSON, `apply_mode` 'insert', not a template. The uniqueness of the name is a unique index rather than a check in this app, so a reused name is a 409 no matter which route wrote the other one, including the four bundled templates. The shape is Baseline-IO-compatible, so a mapping written for another app's import reads the same way here. Creating a profile does not move any data: carts.export and carts.import are what execute one, and each refuses a profile pointed the wrong way.
|
|
320
338
|
*
|
|
@@ -327,7 +345,7 @@ declare class CartsIo {
|
|
|
327
345
|
* @param {object} params.mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.
|
|
328
346
|
* @param {object} params.options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.
|
|
329
347
|
* @throws {RevenexxException}
|
|
330
|
-
* @returns {Promise<Models.
|
|
348
|
+
* @returns {Promise<Models.IoProfile>}
|
|
331
349
|
*/
|
|
332
350
|
cartsIoProfilesCreate(params: {
|
|
333
351
|
direction: CartIoDirection;
|
|
@@ -338,7 +356,7 @@ declare class CartsIo {
|
|
|
338
356
|
isTemplate?: boolean;
|
|
339
357
|
mapping?: object;
|
|
340
358
|
options?: object;
|
|
341
|
-
}): Promise<Models.
|
|
359
|
+
}): Promise<Models.IoProfile>;
|
|
342
360
|
/**
|
|
343
361
|
* Defines a new import/export profile. Two fields are required and have no default — `name`, which must be unique within the tenant, and `direction`, which fixes the one way this profile will ever run. Everything else defaults to the common case: whole carts, JSON, `apply_mode` 'insert', not a template. The uniqueness of the name is a unique index rather than a check in this app, so a reused name is a 409 no matter which route wrote the other one, including the four bundled templates. The shape is Baseline-IO-compatible, so a mapping written for another app's import reads the same way here. Creating a profile does not move any data: carts.export and carts.import are what execute one, and each refuses a profile pointed the wrong way.
|
|
344
362
|
*
|
|
@@ -351,10 +369,10 @@ declare class CartsIo {
|
|
|
351
369
|
* @param {object} mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.
|
|
352
370
|
* @param {object} options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.
|
|
353
371
|
* @throws {RevenexxException}
|
|
354
|
-
* @returns {Promise<Models.
|
|
372
|
+
* @returns {Promise<Models.IoProfile>}
|
|
355
373
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
356
374
|
*/
|
|
357
|
-
cartsIoProfilesCreate(direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object): Promise<Models.
|
|
375
|
+
cartsIoProfilesCreate(direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object): Promise<Models.IoProfile>;
|
|
358
376
|
/**
|
|
359
377
|
* Seeds the 4 bundled templates and reports which of them it had to create — the call that gives a fresh tenant something to export through before anybody has written a profile. Idempotent and matched by NAME, so a second call answers with everything under 'existing' and writes nothing, and a template a merchant has edited is left exactly as they left it rather than reset. It also runs by itself on app.installed; call it by hand where that event cannot be relied on, and after deleting a template to get it back.
|
|
360
378
|
*
|
|
@@ -367,39 +385,39 @@ declare class CartsIo {
|
|
|
367
385
|
*
|
|
368
386
|
* @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.
|
|
369
387
|
* @throws {RevenexxException}
|
|
370
|
-
* @returns {Promise<
|
|
388
|
+
* @returns {Promise<{}>}
|
|
371
389
|
*/
|
|
372
390
|
cartsIoProfilesDelete(params: {
|
|
373
391
|
id: string;
|
|
374
|
-
}): Promise<
|
|
392
|
+
}): Promise<{}>;
|
|
375
393
|
/**
|
|
376
394
|
* Removes a profile. Nothing in this app points at one — no cart and no line stores the profile it was imported through — so no foreign key holds the delete up and nothing is orphaned by it; what breaks is the caller still holding that `profile_id`, which answers 404 on its next run. Deleting one of the four bundled templates is not permanent either: the next carts.io.profiles.defaults, and the next install of this app, seeds it again by name, in the shape it ships with rather than the shape a merchant had edited it into.
|
|
377
395
|
*
|
|
378
396
|
* @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.
|
|
379
397
|
* @throws {RevenexxException}
|
|
380
|
-
* @returns {Promise<
|
|
398
|
+
* @returns {Promise<{}>}
|
|
381
399
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
382
400
|
*/
|
|
383
|
-
cartsIoProfilesDelete(id: string): Promise<
|
|
401
|
+
cartsIoProfilesDelete(id: string): Promise<{}>;
|
|
384
402
|
/**
|
|
385
403
|
* One profile by id — the id carts.export and carts.import name in `profile_id`. Read it to see what a run will do before starting one: `direction`, because a profile only ever runs the way it declares; `entity`, whole carts or bare lines; `format`, where json round-trips and csv carries line fields only; `mapping`, what the external columns are called; and `apply_mode`, which decides what an import does with the lines a target cart already has. `is_template` says whether this is one of the four the app ships with or something a merchant wrote. Reading a profile runs nothing and changes nothing.
|
|
386
404
|
*
|
|
387
405
|
* @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.
|
|
388
406
|
* @throws {RevenexxException}
|
|
389
|
-
* @returns {Promise<Models.
|
|
407
|
+
* @returns {Promise<Models.IoProfile>}
|
|
390
408
|
*/
|
|
391
409
|
cartsIoProfilesGet(params: {
|
|
392
410
|
id: string;
|
|
393
|
-
}): Promise<Models.
|
|
411
|
+
}): Promise<Models.IoProfile>;
|
|
394
412
|
/**
|
|
395
413
|
* One profile by id — the id carts.export and carts.import name in `profile_id`. Read it to see what a run will do before starting one: `direction`, because a profile only ever runs the way it declares; `entity`, whole carts or bare lines; `format`, where json round-trips and csv carries line fields only; `mapping`, what the external columns are called; and `apply_mode`, which decides what an import does with the lines a target cart already has. `is_template` says whether this is one of the four the app ships with or something a merchant wrote. Reading a profile runs nothing and changes nothing.
|
|
396
414
|
*
|
|
397
415
|
* @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.
|
|
398
416
|
* @throws {RevenexxException}
|
|
399
|
-
* @returns {Promise<Models.
|
|
417
|
+
* @returns {Promise<Models.IoProfile>}
|
|
400
418
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
401
419
|
*/
|
|
402
|
-
cartsIoProfilesGet(id: string): Promise<Models.
|
|
420
|
+
cartsIoProfilesGet(id: string): Promise<Models.IoProfile>;
|
|
403
421
|
/**
|
|
404
422
|
* Edits a profile in place, the four bundled templates included — seeding matches on name and never rewrites what it finds, so an edit made here survives every later call to carts.io.profiles.defaults and every reinstall of the app. The name stays unique in the tenant, so renaming onto another profile's name is a 409, and a payload carrying no updatable field answers 400 rather than storing nothing quietly. Runs that already happened are unaffected: a profile is read at the moment carts.export or carts.import executes and nothing is kept pointing back at it, so changing a mapping changes the next run and no earlier one.
|
|
405
423
|
*
|
|
@@ -413,7 +431,7 @@ declare class CartsIo {
|
|
|
413
431
|
* @param {string} params.name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.
|
|
414
432
|
* @param {object} params.options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.
|
|
415
433
|
* @throws {RevenexxException}
|
|
416
|
-
* @returns {Promise<Models.
|
|
434
|
+
* @returns {Promise<Models.IoProfile>}
|
|
417
435
|
*/
|
|
418
436
|
cartsIoProfilesUpdate(params: {
|
|
419
437
|
id: string;
|
|
@@ -425,7 +443,7 @@ declare class CartsIo {
|
|
|
425
443
|
mapping?: object;
|
|
426
444
|
name?: string;
|
|
427
445
|
options?: object;
|
|
428
|
-
}): Promise<Models.
|
|
446
|
+
}): Promise<Models.IoProfile>;
|
|
429
447
|
/**
|
|
430
448
|
* Edits a profile in place, the four bundled templates included — seeding matches on name and never rewrites what it finds, so an edit made here survives every later call to carts.io.profiles.defaults and every reinstall of the app. The name stays unique in the tenant, so renaming onto another profile's name is a 409, and a payload carrying no updatable field answers 400 rather than storing nothing quietly. Runs that already happened are unaffected: a profile is read at the moment carts.export or carts.import executes and nothing is kept pointing back at it, so changing a mapping changes the next run and no earlier one.
|
|
431
449
|
*
|
|
@@ -439,10 +457,10 @@ declare class CartsIo {
|
|
|
439
457
|
* @param {string} name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.
|
|
440
458
|
* @param {object} options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.
|
|
441
459
|
* @throws {RevenexxException}
|
|
442
|
-
* @returns {Promise<Models.
|
|
460
|
+
* @returns {Promise<Models.IoProfile>}
|
|
443
461
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
444
462
|
*/
|
|
445
|
-
cartsIoProfilesUpdate(id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object): Promise<Models.
|
|
463
|
+
cartsIoProfilesUpdate(id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object): Promise<Models.IoProfile>;
|
|
446
464
|
/**
|
|
447
465
|
* Renders one cart as a document somebody can take away. With `profile_id` the named EXPORT profile decides the format, the entity and the column names; handing it an import profile is a 400, because a profile only runs the way it declares. Without one the call runs ad hoc — JSON, unless `format: 'csv'` says otherwise. The JSON form is `{cart: {…}, items: […]}` and is exactly what carts.import takes back, so an export round-trips; the CSV form is the lines only, header first, and drops everything that lives on the cart rather than on a line. Nothing is stored and nothing about the cart changes — `filename` is a suggestion for a browser download, not a file this app keeps — and a cart of any status can be exported, including one already ordered.
|
|
448
466
|
*
|
|
@@ -450,13 +468,13 @@ declare class CartsIo {
|
|
|
450
468
|
* @param {CartExportFormat} params.format - Format of an ad-hoc export, read only when no profile_id is sent. 'json' returns the whole `{cart, items}` document, 'csv' the lines alone. Default 'json'.
|
|
451
469
|
* @param {string} params.profileId - The export profile to run — one of the ids `GET /carts/io/profiles?direction=export` lists. Omit it for an ad-hoc export in the canonical shape, which is what `format` is for.
|
|
452
470
|
* @throws {RevenexxException}
|
|
453
|
-
* @returns {Promise<Models.
|
|
471
|
+
* @returns {Promise<Models.CartExport>}
|
|
454
472
|
*/
|
|
455
473
|
cartsExport(params: {
|
|
456
474
|
id: string;
|
|
457
475
|
format?: CartExportFormat;
|
|
458
476
|
profileId?: string;
|
|
459
|
-
}): Promise<Models.
|
|
477
|
+
}): Promise<Models.CartExport>;
|
|
460
478
|
/**
|
|
461
479
|
* Renders one cart as a document somebody can take away. With `profile_id` the named EXPORT profile decides the format, the entity and the column names; handing it an import profile is a 400, because a profile only runs the way it declares. Without one the call runs ad hoc — JSON, unless `format: 'csv'` says otherwise. The JSON form is `{cart: {…}, items: […]}` and is exactly what carts.import takes back, so an export round-trips; the CSV form is the lines only, header first, and drops everything that lives on the cart rather than on a line. Nothing is stored and nothing about the cart changes — `filename` is a suggestion for a browser download, not a file this app keeps — and a cart of any status can be exported, including one already ordered.
|
|
462
480
|
*
|
|
@@ -464,10 +482,10 @@ declare class CartsIo {
|
|
|
464
482
|
* @param {CartExportFormat} format - Format of an ad-hoc export, read only when no profile_id is sent. 'json' returns the whole `{cart, items}` document, 'csv' the lines alone. Default 'json'.
|
|
465
483
|
* @param {string} profileId - The export profile to run — one of the ids `GET /carts/io/profiles?direction=export` lists. Omit it for an ad-hoc export in the canonical shape, which is what `format` is for.
|
|
466
484
|
* @throws {RevenexxException}
|
|
467
|
-
* @returns {Promise<Models.
|
|
485
|
+
* @returns {Promise<Models.CartExport>}
|
|
468
486
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
469
487
|
*/
|
|
470
|
-
cartsExport(id: string, format?: CartExportFormat, profileId?: string): Promise<Models.
|
|
488
|
+
cartsExport(id: string, format?: CartExportFormat, profileId?: string): Promise<Models.CartExport>;
|
|
471
489
|
}
|
|
472
490
|
|
|
473
491
|
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AAa;AAClC,iBAAW,YAAY,IAAI;AAAA,IAC/B;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { RevenexxException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { CartIoDirection } from '../enums/cart-io-direction';\nimport { CartIoEntity } from '../enums/cart-io-entity';\nimport { CartIoFormat } from '../enums/cart-io-format';\nimport { CartIoApplyMode } from '../enums/cart-io-apply-mode';\nimport { CartExportFormat } from '../enums/cart-export-format';\n\nexport class CartsIo {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Reads a payload of lines into a cart — the bulk-order path a buyer pastes a spreadsheet into. With `target_cart_id` the lines land in that cart, which must be active, and the profile's `apply_mode` decides what happens to the lines already there: 'replace' clears them first, 'insert' and 'append' both add. Without a target a new cart is created, and an OWNER is then required — `contact_id` or `session_key` — because a cart with neither cannot exist. `profile_id` names an IMPORT profile; without one the payload is read ad hoc, as CSV when `csv` is present and as JSON otherwise. The lines fold into identical product lines exactly as carts.items.create does, so `imported_lines` counts the lines READ and the cart may have gained fewer rows than that. A payload that parses to no line at all is a 400 rather than a quiet no-op.\n *\n * @param {string} params.contactId - Owner of the cart this import creates. Ignored when target_cart_id is sent.\n * @param {string} params.csv - The CSV rows, when that is easier than putting them in `payload`. First line is the header, and its names are the ones the profile's mapping expects (the bundled quick-order template reads sku, name, quantity, unit_price). Numbers are coerced; a JSON column survives as a JSON string.\n * @param {string} params.name - Name for the cart this import creates. A name in the payload's own `cart` block wins over it; without either the cart is called 'Imported cart'.\n * @param {object} params.payload - The import itself. As an object: `{ \"cart\": { name, status, currency, channel_id, metadata }, \"items\": [ … ] }` — the same document carts.export produces, so an export round-trips. As a string: that document as raw JSON, or CSV rows when the profile is a csv one. A line with neither `name` nor `sku` is dropped, and a payload that leaves no line at all is a 400.\n * @param {string} params.profileId - The import profile to run — one of the ids `GET /carts/io/profiles?direction=import` lists. Omit it for an ad-hoc import: the payload is then read in the canonical shape, and as CSV if `csv` is what carried it.\n * @param {string} params.sessionKey - Guest owner of the cart this import creates — the storefront's own session key. Ignored when target_cart_id is sent.\n * @param {string} params.targetCartId - An existing ACTIVE cart to import into. The lines are added to it (merging identical product lines), unless the profile says `apply_mode: replace`, which clears it first. Without this a new cart is created and an owner is required.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsImport(params?: { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string }): Promise<Models.Error>;\n /**\n * Reads a payload of lines into a cart — the bulk-order path a buyer pastes a spreadsheet into. With `target_cart_id` the lines land in that cart, which must be active, and the profile's `apply_mode` decides what happens to the lines already there: 'replace' clears them first, 'insert' and 'append' both add. Without a target a new cart is created, and an OWNER is then required — `contact_id` or `session_key` — because a cart with neither cannot exist. `profile_id` names an IMPORT profile; without one the payload is read ad hoc, as CSV when `csv` is present and as JSON otherwise. The lines fold into identical product lines exactly as carts.items.create does, so `imported_lines` counts the lines READ and the cart may have gained fewer rows than that. A payload that parses to no line at all is a 400 rather than a quiet no-op.\n *\n * @param {string} contactId - Owner of the cart this import creates. Ignored when target_cart_id is sent.\n * @param {string} csv - The CSV rows, when that is easier than putting them in `payload`. First line is the header, and its names are the ones the profile's mapping expects (the bundled quick-order template reads sku, name, quantity, unit_price). Numbers are coerced; a JSON column survives as a JSON string.\n * @param {string} name - Name for the cart this import creates. A name in the payload's own `cart` block wins over it; without either the cart is called 'Imported cart'.\n * @param {object} payload - The import itself. As an object: `{ \"cart\": { name, status, currency, channel_id, metadata }, \"items\": [ … ] }` — the same document carts.export produces, so an export round-trips. As a string: that document as raw JSON, or CSV rows when the profile is a csv one. A line with neither `name` nor `sku` is dropped, and a payload that leaves no line at all is a 400.\n * @param {string} profileId - The import profile to run — one of the ids `GET /carts/io/profiles?direction=import` lists. Omit it for an ad-hoc import: the payload is then read in the canonical shape, and as CSV if `csv` is what carried it.\n * @param {string} sessionKey - Guest owner of the cart this import creates — the storefront's own session key. Ignored when target_cart_id is sent.\n * @param {string} targetCartId - An existing ACTIVE cart to import into. The lines are added to it (merging identical product lines), unless the profile says `apply_mode: replace`, which clears it first. Without this a new cart is created and an owner is required.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsImport(contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string): Promise<Models.Error>;\n cartsImport(\n paramsOrFirst?: { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string } | string,\n ...rest: [(string)?, (string)?, (object)?, (string)?, (string)?, (string)?] \n ): Promise<Models.Error> {\n let params: { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string };\n } else {\n params = {\n contactId: paramsOrFirst as string,\n csv: rest[0] as string,\n name: rest[1] as string,\n payload: rest[2] as object,\n profileId: rest[3] as string,\n sessionKey: rest[4] as string,\n targetCartId: rest[5] as string \n };\n }\n \n const contactId = params.contactId;\n const csv = params.csv;\n const name = params.name;\n const payload = params.payload;\n const profileId = params.profileId;\n const sessionKey = params.sessionKey;\n const targetCartId = params.targetCartId;\n\n\n const apiPath = '/v1/carts/import';\n const apiPayload: Payload = {};\n if (typeof contactId !== 'undefined') {\n apiPayload['contact_id'] = contactId;\n }\n if (typeof csv !== 'undefined') {\n apiPayload['csv'] = csv;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof payload !== 'undefined') {\n apiPayload['payload'] = payload;\n }\n if (typeof profileId !== 'undefined') {\n apiPayload['profile_id'] = profileId;\n }\n if (typeof sessionKey !== 'undefined') {\n apiPayload['session_key'] = sessionKey;\n }\n if (typeof targetCartId !== 'undefined') {\n apiPayload['target_cart_id'] = targetCartId;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * The filters are what make this list usable: `?direction=export` is how a client offers the profiles that carts.export will accept, and `?is_template=true` separates the four bundled templates from what a merchant wrote. An unknown column is dropped rather than refused — `filter` echoes what was understood.\n *\n * @param {string} params.id - One profile, in list form.\n * @param {string} params.name - Exact profile name — how the bundled templates are addressed, since they are identified by name.\n * @param {CartIoDirection} params.direction - Import or export profiles. `?direction=export` is how a client offers exactly the profiles carts.export will accept — the other half is a 400.\n * @param {CartIoEntity} params.entity - Profiles that carry whole carts, or profiles that carry lines.\n * @param {CartIoFormat} params.format - JSON profiles or CSV profiles.\n * @param {CartIoApplyMode} params.applyMode - Profiles that replace a target cart's lines, as against those that add to them.\n * @param {boolean} params.isTemplate - The four bundled templates, or everything a merchant wrote.\n * @param {string} params.createdAt - Exact instant, not a range.\n * @param {string} params.updatedAt - Exact instant, not a range.\n * @param {number} params.limit - Page size (default 50, max 200).\n * @param {number} params.offset - Row offset for pagination (default 0).\n * @param {string} params.order - Sort by one column: 'column' | 'column.asc' | 'column.desc'. A bare column sorts ascending. Anything else is refused with 400.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsIoProfilesList(params?: { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string }): Promise<Models.Error>;\n /**\n * The filters are what make this list usable: `?direction=export` is how a client offers the profiles that carts.export will accept, and `?is_template=true` separates the four bundled templates from what a merchant wrote. An unknown column is dropped rather than refused — `filter` echoes what was understood.\n *\n * @param {string} id - One profile, in list form.\n * @param {string} name - Exact profile name — how the bundled templates are addressed, since they are identified by name.\n * @param {CartIoDirection} direction - Import or export profiles. `?direction=export` is how a client offers exactly the profiles carts.export will accept — the other half is a 400.\n * @param {CartIoEntity} entity - Profiles that carry whole carts, or profiles that carry lines.\n * @param {CartIoFormat} format - JSON profiles or CSV profiles.\n * @param {CartIoApplyMode} applyMode - Profiles that replace a target cart's lines, as against those that add to them.\n * @param {boolean} isTemplate - The four bundled templates, or everything a merchant wrote.\n * @param {string} createdAt - Exact instant, not a range.\n * @param {string} updatedAt - Exact instant, not a range.\n * @param {number} limit - Page size (default 50, max 200).\n * @param {number} offset - Row offset for pagination (default 0).\n * @param {string} order - Sort by one column: 'column' | 'column.asc' | 'column.desc'. A bare column sorts ascending. Anything else is refused with 400.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesList(id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string): Promise<Models.Error>;\n cartsIoProfilesList(\n paramsOrFirst?: { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string } | string,\n ...rest: [(string)?, (CartIoDirection)?, (CartIoEntity)?, (CartIoFormat)?, (CartIoApplyMode)?, (boolean)?, (string)?, (string)?, (number)?, (number)?, (string)?] \n ): Promise<Models.Error> {\n let params: { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string };\n } else {\n params = {\n id: paramsOrFirst as string,\n name: rest[0] as string,\n direction: rest[1] as CartIoDirection,\n entity: rest[2] as CartIoEntity,\n format: rest[3] as CartIoFormat,\n applyMode: rest[4] as CartIoApplyMode,\n isTemplate: rest[5] as boolean,\n createdAt: rest[6] as string,\n updatedAt: rest[7] as string,\n limit: rest[8] as number,\n offset: rest[9] as number,\n order: rest[10] as string \n };\n }\n \n const id = params.id;\n const name = params.name;\n const direction = params.direction;\n const entity = params.entity;\n const format = params.format;\n const applyMode = params.applyMode;\n const isTemplate = params.isTemplate;\n const createdAt = params.createdAt;\n const updatedAt = params.updatedAt;\n const limit = params.limit;\n const offset = params.offset;\n const order = params.order;\n\n\n const apiPath = '/v1/carts/io/profiles';\n const apiPayload: Payload = {};\n if (typeof id !== 'undefined') {\n apiPayload['id'] = id;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof direction !== 'undefined') {\n apiPayload['direction'] = direction;\n }\n if (typeof entity !== 'undefined') {\n apiPayload['entity'] = entity;\n }\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof applyMode !== 'undefined') {\n apiPayload['apply_mode'] = applyMode;\n }\n if (typeof isTemplate !== 'undefined') {\n apiPayload['is_template'] = isTemplate;\n }\n if (typeof createdAt !== 'undefined') {\n apiPayload['created_at'] = createdAt;\n }\n if (typeof updatedAt !== 'undefined') {\n apiPayload['updated_at'] = updatedAt;\n }\n if (typeof limit !== 'undefined') {\n apiPayload['limit'] = limit;\n }\n if (typeof offset !== 'undefined') {\n apiPayload['offset'] = offset;\n }\n if (typeof order !== 'undefined') {\n apiPayload['order'] = order;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Defines a new import/export profile. Two fields are required and have no default — `name`, which must be unique within the tenant, and `direction`, which fixes the one way this profile will ever run. Everything else defaults to the common case: whole carts, JSON, `apply_mode` 'insert', not a template. The uniqueness of the name is a unique index rather than a check in this app, so a reused name is a 409 no matter which route wrote the other one, including the four bundled templates. The shape is Baseline-IO-compatible, so a mapping written for another app's import reads the same way here. Creating a profile does not move any data: carts.export and carts.import are what execute one, and each refuses a profile pointed the wrong way.\n *\n * @param {CartIoDirection} params.direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {string} params.name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {CartIoApplyMode} params.applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoEntity} params.entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} params.format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} params.isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} params.mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {object} params.options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsIoProfilesCreate(params: { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object }): Promise<Models.Error>;\n /**\n * Defines a new import/export profile. Two fields are required and have no default — `name`, which must be unique within the tenant, and `direction`, which fixes the one way this profile will ever run. Everything else defaults to the common case: whole carts, JSON, `apply_mode` 'insert', not a template. The uniqueness of the name is a unique index rather than a check in this app, so a reused name is a 409 no matter which route wrote the other one, including the four bundled templates. The shape is Baseline-IO-compatible, so a mapping written for another app's import reads the same way here. Creating a profile does not move any data: carts.export and carts.import are what execute one, and each refuses a profile pointed the wrong way.\n *\n * @param {CartIoDirection} direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {string} name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {CartIoApplyMode} applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoEntity} entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {object} options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesCreate(direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object): Promise<Models.Error>;\n cartsIoProfilesCreate(\n paramsOrFirst: { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object } | CartIoDirection,\n ...rest: [(string)?, (CartIoApplyMode)?, (CartIoEntity)?, (CartIoFormat)?, (boolean)?, (object)?, (object)?] \n ): Promise<Models.Error> {\n let params: { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('direction' in paramsOrFirst || 'name' in paramsOrFirst || 'applyMode' in paramsOrFirst || 'entity' in paramsOrFirst || 'format' in paramsOrFirst || 'isTemplate' in paramsOrFirst || 'mapping' in paramsOrFirst || 'options' in paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object };\n } else {\n params = {\n direction: paramsOrFirst as CartIoDirection,\n name: rest[0] as string,\n applyMode: rest[1] as CartIoApplyMode,\n entity: rest[2] as CartIoEntity,\n format: rest[3] as CartIoFormat,\n isTemplate: rest[4] as boolean,\n mapping: rest[5] as object,\n options: rest[6] as object \n };\n }\n \n const direction = params.direction;\n const name = params.name;\n const applyMode = params.applyMode;\n const entity = params.entity;\n const format = params.format;\n const isTemplate = params.isTemplate;\n const mapping = params.mapping;\n const options = params.options;\n\n if (typeof direction === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"direction\"');\n }\n if (typeof name === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"name\"');\n }\n\n const apiPath = '/v1/carts/io/profiles';\n const apiPayload: Payload = {};\n if (typeof applyMode !== 'undefined') {\n apiPayload['apply_mode'] = applyMode;\n }\n if (typeof direction !== 'undefined') {\n apiPayload['direction'] = direction;\n }\n if (typeof entity !== 'undefined') {\n apiPayload['entity'] = entity;\n }\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof isTemplate !== 'undefined') {\n apiPayload['is_template'] = isTemplate;\n }\n if (typeof mapping !== 'undefined') {\n apiPayload['mapping'] = mapping;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof options !== 'undefined') {\n apiPayload['options'] = options;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Seeds the 4 bundled templates and reports which of them it had to create — the call that gives a fresh tenant something to export through before anybody has written a profile. Idempotent and matched by NAME, so a second call answers with everything under 'existing' and writes nothing, and a template a merchant has edited is left exactly as they left it rather than reset. It also runs by itself on app.installed; call it by hand where that event cannot be relied on, and after deleting a template to get it back.\n *\n * @throws {RevenexxException}\n * @returns {Promise<{}>}\n */\n cartsIoProfilesDefaults(): Promise<{}> {\n\n const apiPath = '/v1/carts/io/profiles/defaults';\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Removes a profile. Nothing in this app points at one — no cart and no line stores the profile it was imported through — so no foreign key holds the delete up and nothing is orphaned by it; what breaks is the caller still holding that `profile_id`, which answers 404 on its next run. Deleting one of the four bundled templates is not permanent either: the next carts.io.profiles.defaults, and the next install of this app, seeds it again by name, in the shape it ships with rather than the shape a merchant had edited it into.\n *\n * @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsIoProfilesDelete(params: { id: string }): Promise<Models.Error>;\n /**\n * Removes a profile. Nothing in this app points at one — no cart and no line stores the profile it was imported through — so no foreign key holds the delete up and nothing is orphaned by it; what breaks is the caller still holding that `profile_id`, which answers 404 on its next run. Deleting one of the four bundled templates is not permanent either: the next carts.io.profiles.defaults, and the next install of this app, seeds it again by name, in the shape it ships with rather than the shape a merchant had edited it into.\n *\n * @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesDelete(id: string): Promise<Models.Error>;\n cartsIoProfilesDelete(\n paramsOrFirst: { id: string } | string \n ): Promise<Models.Error> {\n let params: { id: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string };\n } else {\n params = {\n id: paramsOrFirst as string \n };\n }\n \n const id = params.id;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/io/profiles/{id}'.replace('{id}', id);\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * One profile by id — the id carts.export and carts.import name in `profile_id`. Read it to see what a run will do before starting one: `direction`, because a profile only ever runs the way it declares; `entity`, whole carts or bare lines; `format`, where json round-trips and csv carries line fields only; `mapping`, what the external columns are called; and `apply_mode`, which decides what an import does with the lines a target cart already has. `is_template` says whether this is one of the four the app ships with or something a merchant wrote. Reading a profile runs nothing and changes nothing.\n *\n * @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsIoProfilesGet(params: { id: string }): Promise<Models.Error>;\n /**\n * One profile by id — the id carts.export and carts.import name in `profile_id`. Read it to see what a run will do before starting one: `direction`, because a profile only ever runs the way it declares; `entity`, whole carts or bare lines; `format`, where json round-trips and csv carries line fields only; `mapping`, what the external columns are called; and `apply_mode`, which decides what an import does with the lines a target cart already has. `is_template` says whether this is one of the four the app ships with or something a merchant wrote. Reading a profile runs nothing and changes nothing.\n *\n * @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesGet(id: string): Promise<Models.Error>;\n cartsIoProfilesGet(\n paramsOrFirst: { id: string } | string \n ): Promise<Models.Error> {\n let params: { id: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string };\n } else {\n params = {\n id: paramsOrFirst as string \n };\n }\n \n const id = params.id;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/io/profiles/{id}'.replace('{id}', id);\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Edits a profile in place, the four bundled templates included — seeding matches on name and never rewrites what it finds, so an edit made here survives every later call to carts.io.profiles.defaults and every reinstall of the app. The name stays unique in the tenant, so renaming onto another profile's name is a 409, and a payload carrying no updatable field answers 400 rather than storing nothing quietly. Runs that already happened are unaffected: a profile is read at the moment carts.export or carts.import executes and nothing is kept pointing back at it, so changing a mapping changes the next run and no earlier one.\n *\n * @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @param {CartIoApplyMode} params.applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoDirection} params.direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {CartIoEntity} params.entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} params.format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} params.isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} params.mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {string} params.name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {object} params.options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsIoProfilesUpdate(params: { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object }): Promise<Models.Error>;\n /**\n * Edits a profile in place, the four bundled templates included — seeding matches on name and never rewrites what it finds, so an edit made here survives every later call to carts.io.profiles.defaults and every reinstall of the app. The name stays unique in the tenant, so renaming onto another profile's name is a 409, and a payload carrying no updatable field answers 400 rather than storing nothing quietly. Runs that already happened are unaffected: a profile is read at the moment carts.export or carts.import executes and nothing is kept pointing back at it, so changing a mapping changes the next run and no earlier one.\n *\n * @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @param {CartIoApplyMode} applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoDirection} direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {CartIoEntity} entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {string} name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {object} options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesUpdate(id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object): Promise<Models.Error>;\n cartsIoProfilesUpdate(\n paramsOrFirst: { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object } | string,\n ...rest: [(CartIoApplyMode)?, (CartIoDirection)?, (CartIoEntity)?, (CartIoFormat)?, (boolean)?, (object)?, (string)?, (object)?] \n ): Promise<Models.Error> {\n let params: { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object };\n } else {\n params = {\n id: paramsOrFirst as string,\n applyMode: rest[0] as CartIoApplyMode,\n direction: rest[1] as CartIoDirection,\n entity: rest[2] as CartIoEntity,\n format: rest[3] as CartIoFormat,\n isTemplate: rest[4] as boolean,\n mapping: rest[5] as object,\n name: rest[6] as string,\n options: rest[7] as object \n };\n }\n \n const id = params.id;\n const applyMode = params.applyMode;\n const direction = params.direction;\n const entity = params.entity;\n const format = params.format;\n const isTemplate = params.isTemplate;\n const mapping = params.mapping;\n const name = params.name;\n const options = params.options;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/io/profiles/{id}'.replace('{id}', id);\n const apiPayload: Payload = {};\n if (typeof applyMode !== 'undefined') {\n apiPayload['apply_mode'] = applyMode;\n }\n if (typeof direction !== 'undefined') {\n apiPayload['direction'] = direction;\n }\n if (typeof entity !== 'undefined') {\n apiPayload['entity'] = entity;\n }\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof isTemplate !== 'undefined') {\n apiPayload['is_template'] = isTemplate;\n }\n if (typeof mapping !== 'undefined') {\n apiPayload['mapping'] = mapping;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof options !== 'undefined') {\n apiPayload['options'] = options;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Renders one cart as a document somebody can take away. With `profile_id` the named EXPORT profile decides the format, the entity and the column names; handing it an import profile is a 400, because a profile only runs the way it declares. Without one the call runs ad hoc — JSON, unless `format: 'csv'` says otherwise. The JSON form is `{cart: {…}, items: […]}` and is exactly what carts.import takes back, so an export round-trips; the CSV form is the lines only, header first, and drops everything that lives on the cart rather than on a line. Nothing is stored and nothing about the cart changes — `filename` is a suggestion for a browser download, not a file this app keeps — and a cart of any status can be exported, including one already ordered.\n *\n * @param {string} params.id - The cart, by its id — the `id` every cart answer carries. A uuid: the data plane casts the segment, so a code or a slug is refused before the cart is looked up.\n * @param {CartExportFormat} params.format - Format of an ad-hoc export, read only when no profile_id is sent. 'json' returns the whole `{cart, items}` document, 'csv' the lines alone. Default 'json'.\n * @param {string} params.profileId - The export profile to run — one of the ids `GET /carts/io/profiles?direction=export` lists. Omit it for an ad-hoc export in the canonical shape, which is what `format` is for.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n */\n cartsExport(params: { id: string, format?: CartExportFormat, profileId?: string }): Promise<Models.Error>;\n /**\n * Renders one cart as a document somebody can take away. With `profile_id` the named EXPORT profile decides the format, the entity and the column names; handing it an import profile is a 400, because a profile only runs the way it declares. Without one the call runs ad hoc — JSON, unless `format: 'csv'` says otherwise. The JSON form is `{cart: {…}, items: […]}` and is exactly what carts.import takes back, so an export round-trips; the CSV form is the lines only, header first, and drops everything that lives on the cart rather than on a line. Nothing is stored and nothing about the cart changes — `filename` is a suggestion for a browser download, not a file this app keeps — and a cart of any status can be exported, including one already ordered.\n *\n * @param {string} id - The cart, by its id — the `id` every cart answer carries. A uuid: the data plane casts the segment, so a code or a slug is refused before the cart is looked up.\n * @param {CartExportFormat} format - Format of an ad-hoc export, read only when no profile_id is sent. 'json' returns the whole `{cart, items}` document, 'csv' the lines alone. Default 'json'.\n * @param {string} profileId - The export profile to run — one of the ids `GET /carts/io/profiles?direction=export` lists. Omit it for an ad-hoc export in the canonical shape, which is what `format` is for.\n * @throws {RevenexxException}\n * @returns {Promise<Models.Error>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsExport(id: string, format?: CartExportFormat, profileId?: string): Promise<Models.Error>;\n cartsExport(\n paramsOrFirst: { id: string, format?: CartExportFormat, profileId?: string } | string,\n ...rest: [(CartExportFormat)?, (string)?] \n ): Promise<Models.Error> {\n let params: { id: string, format?: CartExportFormat, profileId?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string, format?: CartExportFormat, profileId?: string };\n } else {\n params = {\n id: paramsOrFirst as string,\n format: rest[0] as CartExportFormat,\n profileId: rest[1] as string \n };\n }\n \n const id = params.id;\n const format = params.format;\n const profileId = params.profileId;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/{id}/export'.replace('{id}', id);\n const apiPayload: Payload = {};\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof profileId !== 'undefined') {\n apiPayload['profile_id'] = profileId;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/services/carts-io.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AASjE,MAAM,QAAQ;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EA+BA,YACI,kBACG,MACuB;AAC1B,QAAI;AAEJ,QAAI,CAAC,iBAAkB,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACzG,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,WAAW;AAAA,QACX,KAAK,KAAK,CAAC;AAAA,QACX,MAAM,KAAK,CAAC;AAAA,QACZ,SAAS,KAAK,CAAC;AAAA,QACf,WAAW,KAAK,CAAC;AAAA,QACjB,YAAY,KAAK,CAAC;AAAA,QAClB,cAAc,KAAK,CAAC;AAAA,MACxB;AAAA,IACJ;AAEA,UAAM,YAAY,OAAO;AACzB,UAAM,MAAM,OAAO;AACnB,UAAM,OAAO,OAAO;AACpB,UAAM,UAAU,OAAO;AACvB,UAAM,YAAY,OAAO;AACzB,UAAM,aAAa,OAAO;AAC1B,UAAM,eAAe,OAAO;AAG5B,UAAM,UAAU;AAChB,UAAM,aAAsB,CAAC;AAC7B,QAAI,OAAO,cAAc,aAAa;AAClC,iBAAW,YAAY,IAAI;AAAA,IAC/B;AACA,QAAI,OAAO,QAAQ,aAAa;AAC5B,iBAAW,KAAK,IAAI;AAAA,IACxB;AACA,QAAI,OAAO,SAAS,aAAa;AAC7B,iBAAW,MAAM,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,YAAY,aAAa;AAChC,iBAAW,SAAS,IAAI;AAAA,IAC5B;AACA,QAA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B,QAAQ,QAAQ,EAAE;AAC1D,UAAM,aAAsB,CAAC;AAC7B,QAAI,OAAO,WAAW,aAAa;AAC/B,iBAAW,QAAQ,IAAI;AAAA,IAC3B;AACA,QAAI,OAAO,cAAc,aAAa;AAClC,iBAAW,YAAY,IAAI;AAAA,IAC/B;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { RevenexxException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\nimport { CartIoDirection } from '../enums/cart-io-direction';\nimport { CartIoEntity } from '../enums/cart-io-entity';\nimport { CartIoFormat } from '../enums/cart-io-format';\nimport { CartIoApplyMode } from '../enums/cart-io-apply-mode';\nimport { CartExportFormat } from '../enums/cart-export-format';\n\nexport class CartsIo {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Reads a payload of lines into a cart — the bulk-order path a buyer pastes a spreadsheet into. With `target_cart_id` the lines land in that cart, which must be active, and the profile's `apply_mode` decides what happens to the lines already there: 'replace' clears them first, 'insert' and 'append' both add. Without a target a new cart is created, and an OWNER is then required — `contact_id` or `session_key` — because a cart with neither cannot exist. `profile_id` names an IMPORT profile; without one the payload is read ad hoc, as CSV when `csv` is present and as JSON otherwise. The lines fold into identical product lines exactly as carts.items.create does, so `imported_lines` counts the lines READ and the cart may have gained fewer rows than that. A payload that parses to no line at all is a 400 rather than a quiet no-op.\n *\n * @param {string} params.contactId - Owner of the cart this import creates. Ignored when target_cart_id is sent.\n * @param {string} params.csv - The CSV rows, when that is easier than putting them in `payload`. First line is the header, and its names are the ones the profile's mapping expects (the bundled quick-order template reads sku, name, quantity, unit_price). Numbers are coerced; a JSON column survives as a JSON string.\n * @param {string} params.name - Name for the cart this import creates. A name in the payload's own `cart` block wins over it; without either the cart is called 'Imported cart'.\n * @param {object} params.payload - The import itself. As an object: `{ \"cart\": { name, status, currency, channel_id, metadata }, \"items\": [ … ] }` — the same document carts.export produces, so an export round-trips. As a string: that document as raw JSON, or CSV rows when the profile is a csv one. A line with neither `name` nor `sku` is dropped, and a payload that leaves no line at all is a 400.\n * @param {string} params.profileId - The import profile to run — one of the ids `GET /carts/io/profiles?direction=import` lists. Omit it for an ad-hoc import: the payload is then read in the canonical shape, and as CSV if `csv` is what carried it.\n * @param {string} params.sessionKey - Guest owner of the cart this import creates — the storefront's own session key. Ignored when target_cart_id is sent.\n * @param {string} params.targetCartId - An existing ACTIVE cart to import into. The lines are added to it (merging identical product lines), unless the profile says `apply_mode: replace`, which clears it first. Without this a new cart is created and an owner is required.\n * @throws {RevenexxException}\n * @returns {Promise<Models.CartImport>}\n */\n cartsImport(params?: { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string }): Promise<Models.CartImport>;\n /**\n * Reads a payload of lines into a cart — the bulk-order path a buyer pastes a spreadsheet into. With `target_cart_id` the lines land in that cart, which must be active, and the profile's `apply_mode` decides what happens to the lines already there: 'replace' clears them first, 'insert' and 'append' both add. Without a target a new cart is created, and an OWNER is then required — `contact_id` or `session_key` — because a cart with neither cannot exist. `profile_id` names an IMPORT profile; without one the payload is read ad hoc, as CSV when `csv` is present and as JSON otherwise. The lines fold into identical product lines exactly as carts.items.create does, so `imported_lines` counts the lines READ and the cart may have gained fewer rows than that. A payload that parses to no line at all is a 400 rather than a quiet no-op.\n *\n * @param {string} contactId - Owner of the cart this import creates. Ignored when target_cart_id is sent.\n * @param {string} csv - The CSV rows, when that is easier than putting them in `payload`. First line is the header, and its names are the ones the profile's mapping expects (the bundled quick-order template reads sku, name, quantity, unit_price). Numbers are coerced; a JSON column survives as a JSON string.\n * @param {string} name - Name for the cart this import creates. A name in the payload's own `cart` block wins over it; without either the cart is called 'Imported cart'.\n * @param {object} payload - The import itself. As an object: `{ \"cart\": { name, status, currency, channel_id, metadata }, \"items\": [ … ] }` — the same document carts.export produces, so an export round-trips. As a string: that document as raw JSON, or CSV rows when the profile is a csv one. A line with neither `name` nor `sku` is dropped, and a payload that leaves no line at all is a 400.\n * @param {string} profileId - The import profile to run — one of the ids `GET /carts/io/profiles?direction=import` lists. Omit it for an ad-hoc import: the payload is then read in the canonical shape, and as CSV if `csv` is what carried it.\n * @param {string} sessionKey - Guest owner of the cart this import creates — the storefront's own session key. Ignored when target_cart_id is sent.\n * @param {string} targetCartId - An existing ACTIVE cart to import into. The lines are added to it (merging identical product lines), unless the profile says `apply_mode: replace`, which clears it first. Without this a new cart is created and an owner is required.\n * @throws {RevenexxException}\n * @returns {Promise<Models.CartImport>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsImport(contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string): Promise<Models.CartImport>;\n cartsImport(\n paramsOrFirst?: { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string } | string,\n ...rest: [(string)?, (string)?, (object)?, (string)?, (string)?, (string)?] \n ): Promise<Models.CartImport> {\n let params: { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { contactId?: string, csv?: string, name?: string, payload?: object, profileId?: string, sessionKey?: string, targetCartId?: string };\n } else {\n params = {\n contactId: paramsOrFirst as string,\n csv: rest[0] as string,\n name: rest[1] as string,\n payload: rest[2] as object,\n profileId: rest[3] as string,\n sessionKey: rest[4] as string,\n targetCartId: rest[5] as string \n };\n }\n \n const contactId = params.contactId;\n const csv = params.csv;\n const name = params.name;\n const payload = params.payload;\n const profileId = params.profileId;\n const sessionKey = params.sessionKey;\n const targetCartId = params.targetCartId;\n\n\n const apiPath = '/v1/carts/import';\n const apiPayload: Payload = {};\n if (typeof contactId !== 'undefined') {\n apiPayload['contact_id'] = contactId;\n }\n if (typeof csv !== 'undefined') {\n apiPayload['csv'] = csv;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof payload !== 'undefined') {\n apiPayload['payload'] = payload;\n }\n if (typeof profileId !== 'undefined') {\n apiPayload['profile_id'] = profileId;\n }\n if (typeof sessionKey !== 'undefined') {\n apiPayload['session_key'] = sessionKey;\n }\n if (typeof targetCartId !== 'undefined') {\n apiPayload['target_cart_id'] = targetCartId;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * The filters are what make this list usable: `?direction=export` is how a client offers the profiles that carts.export will accept, and `?is_template=true` separates the four bundled templates from what a merchant wrote. An unknown column is dropped rather than refused — `filter` echoes what was understood.\n *\n * @param {string} params.id - One profile, in list form.\n * @param {string} params.name - Exact profile name — how the bundled templates are addressed, since they are identified by name.\n * @param {CartIoDirection} params.direction - Import or export profiles. `?direction=export` is how a client offers exactly the profiles carts.export will accept — the other half is a 400.\n * @param {CartIoEntity} params.entity - Profiles that carry whole carts, or profiles that carry lines.\n * @param {CartIoFormat} params.format - JSON profiles or CSV profiles.\n * @param {CartIoApplyMode} params.applyMode - Profiles that replace a target cart's lines, as against those that add to them.\n * @param {boolean} params.isTemplate - The four bundled templates, or everything a merchant wrote.\n * @param {string} params.createdAt - Exact instant, not a range.\n * @param {string} params.updatedAt - Exact instant, not a range.\n * @param {number} params.limit - Page size (default 50, max 200).\n * @param {number} params.offset - Row offset for pagination (default 0).\n * @param {string} params.order - Sort by one column: 'column' | 'column.asc' | 'column.desc'. A bare column sorts ascending. Anything else is refused with 400.\n * @throws {RevenexxException}\n * @returns {Promise<{}>}\n */\n cartsIoProfilesList(params?: { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;\n /**\n * The filters are what make this list usable: `?direction=export` is how a client offers the profiles that carts.export will accept, and `?is_template=true` separates the four bundled templates from what a merchant wrote. An unknown column is dropped rather than refused — `filter` echoes what was understood.\n *\n * @param {string} id - One profile, in list form.\n * @param {string} name - Exact profile name — how the bundled templates are addressed, since they are identified by name.\n * @param {CartIoDirection} direction - Import or export profiles. `?direction=export` is how a client offers exactly the profiles carts.export will accept — the other half is a 400.\n * @param {CartIoEntity} entity - Profiles that carry whole carts, or profiles that carry lines.\n * @param {CartIoFormat} format - JSON profiles or CSV profiles.\n * @param {CartIoApplyMode} applyMode - Profiles that replace a target cart's lines, as against those that add to them.\n * @param {boolean} isTemplate - The four bundled templates, or everything a merchant wrote.\n * @param {string} createdAt - Exact instant, not a range.\n * @param {string} updatedAt - Exact instant, not a range.\n * @param {number} limit - Page size (default 50, max 200).\n * @param {number} offset - Row offset for pagination (default 0).\n * @param {string} order - Sort by one column: 'column' | 'column.asc' | 'column.desc'. A bare column sorts ascending. Anything else is refused with 400.\n * @throws {RevenexxException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesList(id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string): Promise<{}>;\n cartsIoProfilesList(\n paramsOrFirst?: { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string } | string,\n ...rest: [(string)?, (CartIoDirection)?, (CartIoEntity)?, (CartIoFormat)?, (CartIoApplyMode)?, (boolean)?, (string)?, (string)?, (number)?, (number)?, (string)?] \n ): Promise<{}> {\n let params: { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id?: string, name?: string, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, applyMode?: CartIoApplyMode, isTemplate?: boolean, createdAt?: string, updatedAt?: string, limit?: number, offset?: number, order?: string };\n } else {\n params = {\n id: paramsOrFirst as string,\n name: rest[0] as string,\n direction: rest[1] as CartIoDirection,\n entity: rest[2] as CartIoEntity,\n format: rest[3] as CartIoFormat,\n applyMode: rest[4] as CartIoApplyMode,\n isTemplate: rest[5] as boolean,\n createdAt: rest[6] as string,\n updatedAt: rest[7] as string,\n limit: rest[8] as number,\n offset: rest[9] as number,\n order: rest[10] as string \n };\n }\n \n const id = params.id;\n const name = params.name;\n const direction = params.direction;\n const entity = params.entity;\n const format = params.format;\n const applyMode = params.applyMode;\n const isTemplate = params.isTemplate;\n const createdAt = params.createdAt;\n const updatedAt = params.updatedAt;\n const limit = params.limit;\n const offset = params.offset;\n const order = params.order;\n\n\n const apiPath = '/v1/carts/io/profiles';\n const apiPayload: Payload = {};\n if (typeof id !== 'undefined') {\n apiPayload['id'] = id;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof direction !== 'undefined') {\n apiPayload['direction'] = direction;\n }\n if (typeof entity !== 'undefined') {\n apiPayload['entity'] = entity;\n }\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof applyMode !== 'undefined') {\n apiPayload['apply_mode'] = applyMode;\n }\n if (typeof isTemplate !== 'undefined') {\n apiPayload['is_template'] = isTemplate;\n }\n if (typeof createdAt !== 'undefined') {\n apiPayload['created_at'] = createdAt;\n }\n if (typeof updatedAt !== 'undefined') {\n apiPayload['updated_at'] = updatedAt;\n }\n if (typeof limit !== 'undefined') {\n apiPayload['limit'] = limit;\n }\n if (typeof offset !== 'undefined') {\n apiPayload['offset'] = offset;\n }\n if (typeof order !== 'undefined') {\n apiPayload['order'] = order;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Defines a new import/export profile. Two fields are required and have no default — `name`, which must be unique within the tenant, and `direction`, which fixes the one way this profile will ever run. Everything else defaults to the common case: whole carts, JSON, `apply_mode` 'insert', not a template. The uniqueness of the name is a unique index rather than a check in this app, so a reused name is a 409 no matter which route wrote the other one, including the four bundled templates. The shape is Baseline-IO-compatible, so a mapping written for another app's import reads the same way here. Creating a profile does not move any data: carts.export and carts.import are what execute one, and each refuses a profile pointed the wrong way.\n *\n * @param {CartIoDirection} params.direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {string} params.name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {CartIoApplyMode} params.applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoEntity} params.entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} params.format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} params.isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} params.mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {object} params.options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.IoProfile>}\n */\n cartsIoProfilesCreate(params: { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object }): Promise<Models.IoProfile>;\n /**\n * Defines a new import/export profile. Two fields are required and have no default — `name`, which must be unique within the tenant, and `direction`, which fixes the one way this profile will ever run. Everything else defaults to the common case: whole carts, JSON, `apply_mode` 'insert', not a template. The uniqueness of the name is a unique index rather than a check in this app, so a reused name is a 409 no matter which route wrote the other one, including the four bundled templates. The shape is Baseline-IO-compatible, so a mapping written for another app's import reads the same way here. Creating a profile does not move any data: carts.export and carts.import are what execute one, and each refuses a profile pointed the wrong way.\n *\n * @param {CartIoDirection} direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {string} name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {CartIoApplyMode} applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoEntity} entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {object} options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.IoProfile>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesCreate(direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object): Promise<Models.IoProfile>;\n cartsIoProfilesCreate(\n paramsOrFirst: { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object } | CartIoDirection,\n ...rest: [(string)?, (CartIoApplyMode)?, (CartIoEntity)?, (CartIoFormat)?, (boolean)?, (object)?, (object)?] \n ): Promise<Models.IoProfile> {\n let params: { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('direction' in paramsOrFirst || 'name' in paramsOrFirst || 'applyMode' in paramsOrFirst || 'entity' in paramsOrFirst || 'format' in paramsOrFirst || 'isTemplate' in paramsOrFirst || 'mapping' in paramsOrFirst || 'options' in paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { direction: CartIoDirection, name: string, applyMode?: CartIoApplyMode, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, options?: object };\n } else {\n params = {\n direction: paramsOrFirst as CartIoDirection,\n name: rest[0] as string,\n applyMode: rest[1] as CartIoApplyMode,\n entity: rest[2] as CartIoEntity,\n format: rest[3] as CartIoFormat,\n isTemplate: rest[4] as boolean,\n mapping: rest[5] as object,\n options: rest[6] as object \n };\n }\n \n const direction = params.direction;\n const name = params.name;\n const applyMode = params.applyMode;\n const entity = params.entity;\n const format = params.format;\n const isTemplate = params.isTemplate;\n const mapping = params.mapping;\n const options = params.options;\n\n if (typeof direction === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"direction\"');\n }\n if (typeof name === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"name\"');\n }\n\n const apiPath = '/v1/carts/io/profiles';\n const apiPayload: Payload = {};\n if (typeof applyMode !== 'undefined') {\n apiPayload['apply_mode'] = applyMode;\n }\n if (typeof direction !== 'undefined') {\n apiPayload['direction'] = direction;\n }\n if (typeof entity !== 'undefined') {\n apiPayload['entity'] = entity;\n }\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof isTemplate !== 'undefined') {\n apiPayload['is_template'] = isTemplate;\n }\n if (typeof mapping !== 'undefined') {\n apiPayload['mapping'] = mapping;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof options !== 'undefined') {\n apiPayload['options'] = options;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Seeds the 4 bundled templates and reports which of them it had to create — the call that gives a fresh tenant something to export through before anybody has written a profile. Idempotent and matched by NAME, so a second call answers with everything under 'existing' and writes nothing, and a template a merchant has edited is left exactly as they left it rather than reset. It also runs by itself on app.installed; call it by hand where that event cannot be relied on, and after deleting a template to get it back.\n *\n * @throws {RevenexxException}\n * @returns {Promise<{}>}\n */\n cartsIoProfilesDefaults(): Promise<{}> {\n\n const apiPath = '/v1/carts/io/profiles/defaults';\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Removes a profile. Nothing in this app points at one — no cart and no line stores the profile it was imported through — so no foreign key holds the delete up and nothing is orphaned by it; what breaks is the caller still holding that `profile_id`, which answers 404 on its next run. Deleting one of the four bundled templates is not permanent either: the next carts.io.profiles.defaults, and the next install of this app, seeds it again by name, in the shape it ships with rather than the shape a merchant had edited it into.\n *\n * @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<{}>}\n */\n cartsIoProfilesDelete(params: { id: string }): Promise<{}>;\n /**\n * Removes a profile. Nothing in this app points at one — no cart and no line stores the profile it was imported through — so no foreign key holds the delete up and nothing is orphaned by it; what breaks is the caller still holding that `profile_id`, which answers 404 on its next run. Deleting one of the four bundled templates is not permanent either: the next carts.io.profiles.defaults, and the next install of this app, seeds it again by name, in the shape it ships with rather than the shape a merchant had edited it into.\n *\n * @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesDelete(id: string): Promise<{}>;\n cartsIoProfilesDelete(\n paramsOrFirst: { id: string } | string \n ): Promise<{}> {\n let params: { id: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string };\n } else {\n params = {\n id: paramsOrFirst as string \n };\n }\n \n const id = params.id;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/io/profiles/{id}'.replace('{id}', id);\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * One profile by id — the id carts.export and carts.import name in `profile_id`. Read it to see what a run will do before starting one: `direction`, because a profile only ever runs the way it declares; `entity`, whole carts or bare lines; `format`, where json round-trips and csv carries line fields only; `mapping`, what the external columns are called; and `apply_mode`, which decides what an import does with the lines a target cart already has. `is_template` says whether this is one of the four the app ships with or something a merchant wrote. Reading a profile runs nothing and changes nothing.\n *\n * @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<Models.IoProfile>}\n */\n cartsIoProfilesGet(params: { id: string }): Promise<Models.IoProfile>;\n /**\n * One profile by id — the id carts.export and carts.import name in `profile_id`. Read it to see what a run will do before starting one: `direction`, because a profile only ever runs the way it declares; `entity`, whole carts or bare lines; `format`, where json round-trips and csv carries line fields only; `mapping`, what the external columns are called; and `apply_mode`, which decides what an import does with the lines a target cart already has. `is_template` says whether this is one of the four the app ships with or something a merchant wrote. Reading a profile runs nothing and changes nothing.\n *\n * @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @throws {RevenexxException}\n * @returns {Promise<Models.IoProfile>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesGet(id: string): Promise<Models.IoProfile>;\n cartsIoProfilesGet(\n paramsOrFirst: { id: string } | string \n ): Promise<Models.IoProfile> {\n let params: { id: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string };\n } else {\n params = {\n id: paramsOrFirst as string \n };\n }\n \n const id = params.id;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/io/profiles/{id}'.replace('{id}', id);\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Edits a profile in place, the four bundled templates included — seeding matches on name and never rewrites what it finds, so an edit made here survives every later call to carts.io.profiles.defaults and every reinstall of the app. The name stays unique in the tenant, so renaming onto another profile's name is a 409, and a payload carrying no updatable field answers 400 rather than storing nothing quietly. Runs that already happened are unaffected: a profile is read at the moment carts.export or carts.import executes and nothing is kept pointing back at it, so changing a mapping changes the next run and no earlier one.\n *\n * @param {string} params.id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @param {CartIoApplyMode} params.applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoDirection} params.direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {CartIoEntity} params.entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} params.format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} params.isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} params.mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {string} params.name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {object} params.options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.IoProfile>}\n */\n cartsIoProfilesUpdate(params: { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object }): Promise<Models.IoProfile>;\n /**\n * Edits a profile in place, the four bundled templates included — seeding matches on name and never rewrites what it finds, so an edit made here survives every later call to carts.io.profiles.defaults and every reinstall of the app. The name stays unique in the tenant, so renaming onto another profile's name is a 409, and a payload carrying no updatable field answers 400 rather than storing nothing quietly. Runs that already happened are unaffected: a profile is read at the moment carts.export or carts.import executes and nothing is kept pointing back at it, so changing a mapping changes the next run and no earlier one.\n *\n * @param {string} id - The import/export profile, by its id — one of the ids `GET /carts/io/profiles` lists.\n * @param {CartIoApplyMode} applyMode - What an import does with the lines the target cart already has: 'replace' clears them first, 'insert' and 'append' both add and behave identically today. Read only when the import names a target_cart_id. Default 'insert'.\n * @param {CartIoDirection} direction - Which way this profile runs. A profile only ever runs in the direction it declares: handing an import profile to carts.export is a 400, and the other way round.\n * @param {CartIoEntity} entity - What the profile carries: whole carts (the `{cart, items}` document) or bare cart lines. Default 'carts'.\n * @param {CartIoFormat} format - The wire format. 'json' is the canonical, re-importable document; 'csv' is the spreadsheet form, and only line fields survive it. Default 'json'.\n * @param {boolean} isTemplate - One of the bundled templates. Set by carts.io.profiles.defaults; a profile a merchant writes is not one.\n * @param {object} mapping - Baseline-IO-compatible column mapping. An empty object (or null) is identity: the full canonical shape, every field under its own name.\n * @param {string} name - What a merchant picks this profile by. Unique within the tenant — reusing a name is a 409.\n * @param {object} options - Free-form options carried with the profile. The four bundled templates put one human sentence under `description` and nothing else; no other key is read by this app, so anything a merchant needs alongside a profile can live here.\n * @throws {RevenexxException}\n * @returns {Promise<Models.IoProfile>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsIoProfilesUpdate(id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object): Promise<Models.IoProfile>;\n cartsIoProfilesUpdate(\n paramsOrFirst: { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object } | string,\n ...rest: [(CartIoApplyMode)?, (CartIoDirection)?, (CartIoEntity)?, (CartIoFormat)?, (boolean)?, (object)?, (string)?, (object)?] \n ): Promise<Models.IoProfile> {\n let params: { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string, applyMode?: CartIoApplyMode, direction?: CartIoDirection, entity?: CartIoEntity, format?: CartIoFormat, isTemplate?: boolean, mapping?: object, name?: string, options?: object };\n } else {\n params = {\n id: paramsOrFirst as string,\n applyMode: rest[0] as CartIoApplyMode,\n direction: rest[1] as CartIoDirection,\n entity: rest[2] as CartIoEntity,\n format: rest[3] as CartIoFormat,\n isTemplate: rest[4] as boolean,\n mapping: rest[5] as object,\n name: rest[6] as string,\n options: rest[7] as object \n };\n }\n \n const id = params.id;\n const applyMode = params.applyMode;\n const direction = params.direction;\n const entity = params.entity;\n const format = params.format;\n const isTemplate = params.isTemplate;\n const mapping = params.mapping;\n const name = params.name;\n const options = params.options;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/io/profiles/{id}'.replace('{id}', id);\n const apiPayload: Payload = {};\n if (typeof applyMode !== 'undefined') {\n apiPayload['apply_mode'] = applyMode;\n }\n if (typeof direction !== 'undefined') {\n apiPayload['direction'] = direction;\n }\n if (typeof entity !== 'undefined') {\n apiPayload['entity'] = entity;\n }\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof isTemplate !== 'undefined') {\n apiPayload['is_template'] = isTemplate;\n }\n if (typeof mapping !== 'undefined') {\n apiPayload['mapping'] = mapping;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof options !== 'undefined') {\n apiPayload['options'] = options;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n\n /**\n * Renders one cart as a document somebody can take away. With `profile_id` the named EXPORT profile decides the format, the entity and the column names; handing it an import profile is a 400, because a profile only runs the way it declares. Without one the call runs ad hoc — JSON, unless `format: 'csv'` says otherwise. The JSON form is `{cart: {…}, items: […]}` and is exactly what carts.import takes back, so an export round-trips; the CSV form is the lines only, header first, and drops everything that lives on the cart rather than on a line. Nothing is stored and nothing about the cart changes — `filename` is a suggestion for a browser download, not a file this app keeps — and a cart of any status can be exported, including one already ordered.\n *\n * @param {string} params.id - The cart, by its id — the `id` every cart answer carries. A uuid: the data plane casts the segment, so a code or a slug is refused before the cart is looked up.\n * @param {CartExportFormat} params.format - Format of an ad-hoc export, read only when no profile_id is sent. 'json' returns the whole `{cart, items}` document, 'csv' the lines alone. Default 'json'.\n * @param {string} params.profileId - The export profile to run — one of the ids `GET /carts/io/profiles?direction=export` lists. Omit it for an ad-hoc export in the canonical shape, which is what `format` is for.\n * @throws {RevenexxException}\n * @returns {Promise<Models.CartExport>}\n */\n cartsExport(params: { id: string, format?: CartExportFormat, profileId?: string }): Promise<Models.CartExport>;\n /**\n * Renders one cart as a document somebody can take away. With `profile_id` the named EXPORT profile decides the format, the entity and the column names; handing it an import profile is a 400, because a profile only runs the way it declares. Without one the call runs ad hoc — JSON, unless `format: 'csv'` says otherwise. The JSON form is `{cart: {…}, items: […]}` and is exactly what carts.import takes back, so an export round-trips; the CSV form is the lines only, header first, and drops everything that lives on the cart rather than on a line. Nothing is stored and nothing about the cart changes — `filename` is a suggestion for a browser download, not a file this app keeps — and a cart of any status can be exported, including one already ordered.\n *\n * @param {string} id - The cart, by its id — the `id` every cart answer carries. A uuid: the data plane casts the segment, so a code or a slug is refused before the cart is looked up.\n * @param {CartExportFormat} format - Format of an ad-hoc export, read only when no profile_id is sent. 'json' returns the whole `{cart, items}` document, 'csv' the lines alone. Default 'json'.\n * @param {string} profileId - The export profile to run — one of the ids `GET /carts/io/profiles?direction=export` lists. Omit it for an ad-hoc export in the canonical shape, which is what `format` is for.\n * @throws {RevenexxException}\n * @returns {Promise<Models.CartExport>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n cartsExport(id: string, format?: CartExportFormat, profileId?: string): Promise<Models.CartExport>;\n cartsExport(\n paramsOrFirst: { id: string, format?: CartExportFormat, profileId?: string } | string,\n ...rest: [(CartExportFormat)?, (string)?] \n ): Promise<Models.CartExport> {\n let params: { id: string, format?: CartExportFormat, profileId?: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { id: string, format?: CartExportFormat, profileId?: string };\n } else {\n params = {\n id: paramsOrFirst as string,\n format: rest[0] as CartExportFormat,\n profileId: rest[1] as string \n };\n }\n \n const id = params.id;\n const format = params.format;\n const profileId = params.profileId;\n\n if (typeof id === 'undefined') {\n throw new RevenexxException('Missing required parameter: \"id\"');\n }\n\n const apiPath = '/v1/carts/{id}/export'.replace('{id}', id);\n const apiPayload: Payload = {};\n if (typeof format !== 'undefined') {\n apiPayload['format'] = format;\n }\n if (typeof profileId !== 'undefined') {\n apiPayload['profile_id'] = profileId;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n apiPayload,\n );\n }\n}\n"]}
|