@viu/emporix-sdk 2.20.1 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/dist/availability.d.cts +1 -1
- package/dist/availability.d.ts +1 -1
- package/dist/cart.cjs +83 -7
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.d.cts +119 -4
- package/dist/cart.d.ts +119 -4
- package/dist/cart.js +1 -1
- package/dist/category.cjs +28 -0
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +11 -1
- package/dist/category.d.ts +11 -1
- package/dist/category.js +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-BNX3JULF.js → chunk-44F52KRE.js} +7 -5
- package/dist/chunk-44F52KRE.js.map +1 -0
- package/dist/{chunk-PAT4CS36.js → chunk-5DWCYDQD.js} +85 -9
- package/dist/chunk-5DWCYDQD.js.map +1 -0
- package/dist/{chunk-ZNLHLFQM.js → chunk-DXOLWAOY.js} +30 -2
- package/dist/chunk-DXOLWAOY.js.map +1 -0
- package/dist/{chunk-EAWGUZHS.js → chunk-HD5RBCM6.js} +7 -5
- package/dist/chunk-HD5RBCM6.js.map +1 -0
- package/dist/{chunk-DUVIIWFG.js → chunk-IAOWDMTA.js} +7 -5
- package/dist/chunk-IAOWDMTA.js.map +1 -0
- package/dist/{chunk-PYLWZZC4.js → chunk-MMX5FGMI.js} +19 -2
- package/dist/chunk-MMX5FGMI.js.map +1 -0
- package/dist/{chunk-NEXUWPHW.js → chunk-PRN3T6TY.js} +66 -6
- package/dist/chunk-PRN3T6TY.js.map +1 -0
- package/dist/companies.cjs +5 -3
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +5 -3
- package/dist/companies.d.ts +5 -3
- package/dist/companies.js +1 -1
- package/dist/contacts.cjs +5 -3
- package/dist/contacts.cjs.map +1 -1
- package/dist/contacts.d.cts +5 -3
- package/dist/contacts.d.ts +5 -3
- package/dist/contacts.js +1 -1
- package/dist/{context-Dawv2AtS.d.ts → context-CfXJcYKP.d.cts} +1 -1
- package/dist/{context-Dawv2AtS.d.cts → context-CfXJcYKP.d.ts} +1 -1
- package/dist/customer-groups.d.cts +1 -1
- package/dist/customer-groups.d.ts +1 -1
- package/dist/customer.cjs +64 -4
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +49 -2
- package/dist/customer.d.ts +49 -2
- package/dist/customer.js +1 -1
- package/dist/index.cjs +870 -235
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2138 -117
- package/dist/index.d.ts +2138 -117
- package/dist/index.js +676 -230
- package/dist/index.js.map +1 -1
- package/dist/locations.cjs +5 -3
- package/dist/locations.cjs.map +1 -1
- package/dist/locations.d.cts +5 -3
- package/dist/locations.d.ts +5 -3
- package/dist/locations.js +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/orders.d.cts +1 -1
- package/dist/orders.d.ts +1 -1
- package/dist/payment.cjs +17 -0
- package/dist/payment.cjs.map +1 -1
- package/dist/payment.d.cts +38 -2
- package/dist/payment.d.ts +38 -2
- package/dist/payment.js +1 -1
- package/dist/price.d.cts +6 -6
- package/dist/price.d.ts +6 -6
- package/dist/product.d.cts +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-BNX3JULF.js.map +0 -1
- package/dist/chunk-DUVIIWFG.js.map +0 -1
- package/dist/chunk-EAWGUZHS.js.map +0 -1
- package/dist/chunk-NEXUWPHW.js.map +0 -1
- package/dist/chunk-PAT4CS36.js.map +0 -1
- package/dist/chunk-PYLWZZC4.js.map +0 -1
- package/dist/chunk-ZNLHLFQM.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -886,7 +886,7 @@ var HttpClient = class {
|
|
|
886
886
|
};
|
|
887
887
|
|
|
888
888
|
// package.json
|
|
889
|
-
var version = "2.
|
|
889
|
+
var version = "2.22.0";
|
|
890
890
|
|
|
891
891
|
// src/version.ts
|
|
892
892
|
var SDK_VERSION = version;
|
|
@@ -1112,8 +1112,8 @@ var CustomerService = class {
|
|
|
1112
1112
|
/** Changes the password. Requires customer/raw auth. */
|
|
1113
1113
|
async changePassword(input, auth2) {
|
|
1114
1114
|
await this.ctx.http.request({
|
|
1115
|
-
method: "
|
|
1116
|
-
path: `/customer/${this.ctx.tenant}/password`,
|
|
1115
|
+
method: "POST",
|
|
1116
|
+
path: `/customer/${this.ctx.tenant}/password/change`,
|
|
1117
1117
|
auth: requireCustomer(auth2),
|
|
1118
1118
|
body: input
|
|
1119
1119
|
});
|
|
@@ -1131,7 +1131,46 @@ var CustomerService = class {
|
|
|
1131
1131
|
async confirmPasswordReset(input, auth2 = { kind: "anonymous" }) {
|
|
1132
1132
|
await this.ctx.http.request({
|
|
1133
1133
|
method: "POST",
|
|
1134
|
-
path: `/customer/${this.ctx.tenant}/password/reset/
|
|
1134
|
+
path: `/customer/${this.ctx.tenant}/password/reset/update`,
|
|
1135
|
+
auth: auth2,
|
|
1136
|
+
body: input
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Completes double opt-in signup with the emailed token, creating the account
|
|
1141
|
+
* and returning a logged-in {@link CustomerSession}. Default auth: anonymous.
|
|
1142
|
+
*/
|
|
1143
|
+
async confirmSignup(token, auth2 = { kind: "anonymous" }) {
|
|
1144
|
+
const wire = await this.ctx.http.request({
|
|
1145
|
+
method: "GET",
|
|
1146
|
+
path: `/customer/${this.ctx.tenant}/signup/optin/${encodeURIComponent(token)}`,
|
|
1147
|
+
auth: auth2
|
|
1148
|
+
});
|
|
1149
|
+
return toSession("confirmSignup", wire);
|
|
1150
|
+
}
|
|
1151
|
+
/** Resends the double opt-in activation link. Default auth: anonymous. */
|
|
1152
|
+
async resendActivation(input, auth2 = { kind: "anonymous" }) {
|
|
1153
|
+
await this.ctx.http.request({
|
|
1154
|
+
method: "POST",
|
|
1155
|
+
path: `/customer/${this.ctx.tenant}/signup/optin/refresh_token`,
|
|
1156
|
+
auth: auth2,
|
|
1157
|
+
body: input
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
/** Requests a login-email change (emails a confirmation token). Requires customer/raw auth. */
|
|
1161
|
+
async changeEmail(input, auth2) {
|
|
1162
|
+
await this.ctx.http.request({
|
|
1163
|
+
method: "POST",
|
|
1164
|
+
path: `/customer/${this.ctx.tenant}/me/accounts/internal/email/change`,
|
|
1165
|
+
auth: requireCustomer(auth2),
|
|
1166
|
+
body: input
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
/** Confirms a login-email change with the emailed token. Default auth: anonymous. */
|
|
1170
|
+
async confirmEmailChange(input, auth2 = { kind: "anonymous" }) {
|
|
1171
|
+
await this.ctx.http.request({
|
|
1172
|
+
method: "POST",
|
|
1173
|
+
path: `/customer/${this.ctx.tenant}/me/accounts/internal/email/change/confirm`,
|
|
1135
1174
|
auth: auth2,
|
|
1136
1175
|
body: input
|
|
1137
1176
|
});
|
|
@@ -1159,7 +1198,28 @@ var CustomerService = class {
|
|
|
1159
1198
|
method: "DELETE",
|
|
1160
1199
|
path: `/customer/${this.ctx.tenant}/me/addresses/${id}`,
|
|
1161
1200
|
auth: requireCustomer(auth2)
|
|
1162
|
-
})
|
|
1201
|
+
}),
|
|
1202
|
+
get: async (id, auth2) => this.ctx.http.request({
|
|
1203
|
+
method: "GET",
|
|
1204
|
+
path: `/customer/${this.ctx.tenant}/me/addresses/${id}`,
|
|
1205
|
+
auth: requireCustomer(auth2)
|
|
1206
|
+
}),
|
|
1207
|
+
addTags: async (id, tags, auth2) => {
|
|
1208
|
+
await this.ctx.http.request({
|
|
1209
|
+
method: "POST",
|
|
1210
|
+
path: `/customer/${this.ctx.tenant}/me/addresses/${id}/tags`,
|
|
1211
|
+
query: { tags: tags.join(",") },
|
|
1212
|
+
auth: requireCustomer(auth2)
|
|
1213
|
+
});
|
|
1214
|
+
},
|
|
1215
|
+
removeTags: async (id, tags, auth2) => {
|
|
1216
|
+
await this.ctx.http.request({
|
|
1217
|
+
method: "DELETE",
|
|
1218
|
+
path: `/customer/${this.ctx.tenant}/me/addresses/${id}/tags`,
|
|
1219
|
+
query: { tags: tags.join(",") },
|
|
1220
|
+
auth: requireCustomer(auth2)
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1163
1223
|
};
|
|
1164
1224
|
};
|
|
1165
1225
|
|
|
@@ -1504,6 +1564,34 @@ var CategoryService = class {
|
|
|
1504
1564
|
);
|
|
1505
1565
|
return pages.flat();
|
|
1506
1566
|
}
|
|
1567
|
+
/** Lists a category's ancestor categories (breadcrumb-up). Default auth: anonymous. */
|
|
1568
|
+
async parents(categoryId, auth2 = ANON2) {
|
|
1569
|
+
return this.ctx.http.request({
|
|
1570
|
+
method: "GET",
|
|
1571
|
+
path: `/category/${this.ctx.tenant}/categories/${categoryId}/parents`,
|
|
1572
|
+
auth: auth2
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Lists a category's direct child categories via the dedicated
|
|
1577
|
+
* `…/subcategories` endpoint. (The older `subcategories()` reads `/assignments`
|
|
1578
|
+
* and is kept for backward compatibility.) Default auth: anonymous.
|
|
1579
|
+
*/
|
|
1580
|
+
async childCategories(categoryId, auth2 = ANON2) {
|
|
1581
|
+
return this.ctx.http.request({
|
|
1582
|
+
method: "GET",
|
|
1583
|
+
path: `/category/${this.ctx.tenant}/categories/${categoryId}/subcategories`,
|
|
1584
|
+
auth: auth2
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
/** Retrieves one category tree by its root category id. Default auth: anonymous. */
|
|
1588
|
+
async getTree(categoryId, auth2 = ANON2) {
|
|
1589
|
+
return this.ctx.http.request({
|
|
1590
|
+
method: "GET",
|
|
1591
|
+
path: `/category/${this.ctx.tenant}/category-trees/${encodeURIComponent(categoryId)}`,
|
|
1592
|
+
auth: auth2
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1507
1595
|
};
|
|
1508
1596
|
|
|
1509
1597
|
// src/services/cart.ts
|
|
@@ -1626,23 +1714,99 @@ var CartService = class {
|
|
|
1626
1714
|
auth: requireCartAuth(auth2)
|
|
1627
1715
|
});
|
|
1628
1716
|
}
|
|
1629
|
-
/**
|
|
1717
|
+
/**
|
|
1718
|
+
* Applies a coupon by code. Coupon application goes through the cart's
|
|
1719
|
+
* `discounts` endpoint (`POST …/discounts` with a coupon-code-only payload) —
|
|
1720
|
+
* the live API has no `…/coupons` path. The apply response only carries the
|
|
1721
|
+
* applied-discount reference (`{ discountId, discountIndex }`), so the updated
|
|
1722
|
+
* cart is re-fetched and returned to preserve the `Cart` contract.
|
|
1723
|
+
*/
|
|
1630
1724
|
async applyCoupon(cartId, code, auth2) {
|
|
1631
|
-
|
|
1725
|
+
const cartAuth = requireCartAuth(auth2);
|
|
1726
|
+
await this.ctx.http.request({
|
|
1632
1727
|
method: "POST",
|
|
1633
|
-
path: `${this.base()}/${cartId}/
|
|
1634
|
-
auth:
|
|
1728
|
+
path: `${this.base()}/${cartId}/discounts`,
|
|
1729
|
+
auth: cartAuth,
|
|
1635
1730
|
body: { code }
|
|
1636
1731
|
});
|
|
1732
|
+
return this.get(cartId, cartAuth);
|
|
1637
1733
|
}
|
|
1638
|
-
/**
|
|
1734
|
+
/**
|
|
1735
|
+
* Removes a coupon by code via `DELETE …/discounts?codes=<code>` — the live
|
|
1736
|
+
* API has no `…/coupons/<code>` path. The delete responds 204 No Content, so
|
|
1737
|
+
* the updated cart is re-fetched and returned.
|
|
1738
|
+
*/
|
|
1639
1739
|
async removeCoupon(cartId, code, auth2) {
|
|
1640
|
-
|
|
1740
|
+
const cartAuth = requireCartAuth(auth2);
|
|
1741
|
+
await this.ctx.http.request({
|
|
1641
1742
|
method: "DELETE",
|
|
1642
|
-
path: `${this.base()}/${cartId}/
|
|
1743
|
+
path: `${this.base()}/${cartId}/discounts`,
|
|
1744
|
+
query: { codes: code },
|
|
1745
|
+
auth: cartAuth
|
|
1746
|
+
});
|
|
1747
|
+
return this.get(cartId, cartAuth);
|
|
1748
|
+
}
|
|
1749
|
+
/** Validates the cart's items (pricing/consistency checks). */
|
|
1750
|
+
async validate(cartId, auth2) {
|
|
1751
|
+
return this.ctx.http.request({
|
|
1752
|
+
method: "GET",
|
|
1753
|
+
path: `${this.base()}/${cartId}/validate`,
|
|
1754
|
+
auth: requireCartAuth(auth2)
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
/** Lists the items in a cart with calculated prices. */
|
|
1758
|
+
async listItems(cartId, auth2) {
|
|
1759
|
+
return this.ctx.http.request({
|
|
1760
|
+
method: "GET",
|
|
1761
|
+
path: `${this.base()}/${cartId}/items`,
|
|
1643
1762
|
auth: requireCartAuth(auth2)
|
|
1644
1763
|
});
|
|
1645
1764
|
}
|
|
1765
|
+
/** Refreshes a cart and its items (re-prices), then returns the updated cart. */
|
|
1766
|
+
async refresh(cartId, auth2) {
|
|
1767
|
+
const cartAuth = requireCartAuth(auth2);
|
|
1768
|
+
await this.ctx.http.request({
|
|
1769
|
+
method: "PUT",
|
|
1770
|
+
path: `${this.base()}/${cartId}/refresh`,
|
|
1771
|
+
auth: cartAuth
|
|
1772
|
+
});
|
|
1773
|
+
return this.get(cartId, cartAuth);
|
|
1774
|
+
}
|
|
1775
|
+
/** Changes the cart's site (re-prices to the new site's currency), then returns the updated cart. */
|
|
1776
|
+
async changeSite(cartId, siteCode, auth2) {
|
|
1777
|
+
const cartAuth = requireCartAuth(auth2);
|
|
1778
|
+
await this.ctx.http.request({
|
|
1779
|
+
method: "POST",
|
|
1780
|
+
path: `${this.base()}/${cartId}/changeSite`,
|
|
1781
|
+
auth: cartAuth,
|
|
1782
|
+
body: { siteCode }
|
|
1783
|
+
});
|
|
1784
|
+
return this.get(cartId, cartAuth);
|
|
1785
|
+
}
|
|
1786
|
+
/** Changes the cart's currency (re-prices), then returns the updated cart. */
|
|
1787
|
+
async changeCurrency(cartId, currency, auth2) {
|
|
1788
|
+
const cartAuth = requireCartAuth(auth2);
|
|
1789
|
+
await this.ctx.http.request({
|
|
1790
|
+
method: "POST",
|
|
1791
|
+
path: `${this.base()}/${cartId}/changeCurrency`,
|
|
1792
|
+
auth: cartAuth,
|
|
1793
|
+
body: { currency }
|
|
1794
|
+
});
|
|
1795
|
+
return this.get(cartId, cartAuth);
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Updates multiple cart items in one request (`PUT …/itemsBatch`). Like
|
|
1799
|
+
* `addItemsBatch`, the response carries a per-entry `status`; partial failures
|
|
1800
|
+
* do not throw — inspect each entry.
|
|
1801
|
+
*/
|
|
1802
|
+
async updateItemsBatch(cartId, items, auth2) {
|
|
1803
|
+
return this.ctx.http.request({
|
|
1804
|
+
method: "PUT",
|
|
1805
|
+
path: `${this.base()}/${cartId}/itemsBatch`,
|
|
1806
|
+
auth: requireCartAuth(auth2),
|
|
1807
|
+
body: items
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1646
1810
|
/** Sets the shipping address. */
|
|
1647
1811
|
async setShippingAddress(cartId, address, auth2) {
|
|
1648
1812
|
return this.ctx.http.request({
|
|
@@ -1761,6 +1925,23 @@ var PaymentGatewayService = class {
|
|
|
1761
1925
|
body: input
|
|
1762
1926
|
});
|
|
1763
1927
|
}
|
|
1928
|
+
/** Retrieves a single frontend payment mode by id. Defaults to anonymous (no scope required). */
|
|
1929
|
+
async getMode(id, authCtx = ANON3) {
|
|
1930
|
+
return this.ctx.http.request({
|
|
1931
|
+
method: "GET",
|
|
1932
|
+
path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/frontend/${id}`,
|
|
1933
|
+
auth: authCtx
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
/** Initializes a payment from the frontend. Defaults to anonymous (no scope required). */
|
|
1937
|
+
async initialize(input, authCtx = ANON3) {
|
|
1938
|
+
return this.ctx.http.request({
|
|
1939
|
+
method: "POST",
|
|
1940
|
+
path: `/payment-gateway/${this.ctx.tenant}/payment/frontend/initialize`,
|
|
1941
|
+
auth: authCtx,
|
|
1942
|
+
body: input
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1764
1945
|
};
|
|
1765
1946
|
|
|
1766
1947
|
// src/services/price.ts
|
|
@@ -2343,6 +2524,23 @@ var SessionContextService = class {
|
|
|
2343
2524
|
});
|
|
2344
2525
|
return true;
|
|
2345
2526
|
}
|
|
2527
|
+
/** Adds an attribute to the current session context. Default auth: anonymous. */
|
|
2528
|
+
async addAttribute(attribute, authCtx = ANON6) {
|
|
2529
|
+
await this.ctx.http.request({
|
|
2530
|
+
method: "POST",
|
|
2531
|
+
path: `/session-context/${this.ctx.tenant}/me/context/attributes`,
|
|
2532
|
+
body: attribute,
|
|
2533
|
+
auth: authCtx
|
|
2534
|
+
});
|
|
2535
|
+
}
|
|
2536
|
+
/** Removes a named attribute from the current session context. Default auth: anonymous. */
|
|
2537
|
+
async removeAttribute(name, authCtx = ANON6) {
|
|
2538
|
+
await this.ctx.http.request({
|
|
2539
|
+
method: "DELETE",
|
|
2540
|
+
path: `/session-context/${this.ctx.tenant}/me/context/attributes/${encodeURIComponent(name)}`,
|
|
2541
|
+
auth: authCtx
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2346
2544
|
};
|
|
2347
2545
|
function isNotFound(err) {
|
|
2348
2546
|
if (err && typeof err === "object") {
|
|
@@ -2388,12 +2586,14 @@ var CompaniesService = class {
|
|
|
2388
2586
|
});
|
|
2389
2587
|
}
|
|
2390
2588
|
/**
|
|
2391
|
-
*
|
|
2392
|
-
*
|
|
2589
|
+
* Updates a legal entity via `PUT …/legal-entities/{id}` (upsert / full
|
|
2590
|
+
* replace). The live API rejects `PATCH` on this path with 405; send the
|
|
2591
|
+
* complete entity, as the server replaces the resource. The body stays typed
|
|
2592
|
+
* as a partial of `LegalEntityUpdate` for backward compatibility.
|
|
2393
2593
|
*/
|
|
2394
2594
|
async update(legalEntityId, patch, auth2) {
|
|
2395
2595
|
return this.ctx.http.request({
|
|
2396
|
-
method: "
|
|
2596
|
+
method: "PUT",
|
|
2397
2597
|
path: `${this.base()}/${legalEntityId}`,
|
|
2398
2598
|
auth: auth2,
|
|
2399
2599
|
body: patch
|
|
@@ -2438,12 +2638,14 @@ var ContactsService = class {
|
|
|
2438
2638
|
});
|
|
2439
2639
|
}
|
|
2440
2640
|
/**
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2641
|
+
* Updates a contact assignment via `PUT …/contact-assignments/{id}` (upsert /
|
|
2642
|
+
* full replace). The live API rejects `PATCH` on this path with 405; send the
|
|
2643
|
+
* complete entity, as the server replaces the resource. The body stays typed
|
|
2644
|
+
* as a partial of `ContactAssignmentUpdate` for backward compatibility.
|
|
2443
2645
|
*/
|
|
2444
2646
|
async update(contactAssignmentId, patch, auth2) {
|
|
2445
2647
|
return this.ctx.http.request({
|
|
2446
|
-
method: "
|
|
2648
|
+
method: "PUT",
|
|
2447
2649
|
path: `${this.base()}/${contactAssignmentId}`,
|
|
2448
2650
|
auth: auth2,
|
|
2449
2651
|
body: patch
|
|
@@ -2496,12 +2698,14 @@ var LocationsService = class {
|
|
|
2496
2698
|
});
|
|
2497
2699
|
}
|
|
2498
2700
|
/**
|
|
2499
|
-
*
|
|
2500
|
-
*
|
|
2701
|
+
* Updates a location via `PUT …/locations/{id}` (upsert / full replace). The
|
|
2702
|
+
* live API rejects `PATCH` on this path with 405; send the complete entity,
|
|
2703
|
+
* as the server replaces the resource. The body stays typed as a partial of
|
|
2704
|
+
* `LocationUpdate` for backward compatibility.
|
|
2501
2705
|
*/
|
|
2502
2706
|
async update(locationId, patch, auth2) {
|
|
2503
2707
|
return this.ctx.http.request({
|
|
2504
|
-
method: "
|
|
2708
|
+
method: "PUT",
|
|
2505
2709
|
path: `${this.base()}/${locationId}`,
|
|
2506
2710
|
auth: auth2,
|
|
2507
2711
|
body: patch
|
|
@@ -3598,8 +3802,165 @@ var SchemaService = class {
|
|
|
3598
3802
|
}
|
|
3599
3803
|
};
|
|
3600
3804
|
|
|
3601
|
-
// src/services/ai.ts
|
|
3805
|
+
// src/services/ai-resources.ts
|
|
3602
3806
|
var SERVICE11 = { kind: "service" };
|
|
3807
|
+
var AgenticCrudResource = class {
|
|
3808
|
+
constructor(ctx, path) {
|
|
3809
|
+
this.ctx = ctx;
|
|
3810
|
+
this.path = path;
|
|
3811
|
+
}
|
|
3812
|
+
ctx;
|
|
3813
|
+
path;
|
|
3814
|
+
item(id) {
|
|
3815
|
+
return `${this.path}/${encodeURIComponent(id)}`;
|
|
3816
|
+
}
|
|
3817
|
+
/** List the collection (`GET {path}`). Optional `q`/paging/sort/fields/expand. */
|
|
3818
|
+
list(query = {}, auth2 = SERVICE11) {
|
|
3819
|
+
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
3820
|
+
}
|
|
3821
|
+
/** Structured search (`POST {path}/search`). Body is `{ q? }`. */
|
|
3822
|
+
search(query, auth2 = SERVICE11) {
|
|
3823
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, body: query });
|
|
3824
|
+
}
|
|
3825
|
+
/** Retrieve one entry by id (`GET {path}/{id}`). */
|
|
3826
|
+
get(id, opts = {}, auth2 = SERVICE11) {
|
|
3827
|
+
return this.ctx.http.request({ method: "GET", path: this.item(id), auth: auth2, query: { ...opts } });
|
|
3828
|
+
}
|
|
3829
|
+
/**
|
|
3830
|
+
* Create-or-replace by id (`PUT {path}/{id}`). Resolves to `{ id }` on create
|
|
3831
|
+
* (HTTP 201) and `undefined` on update (HTTP 204). `{ force: true }`
|
|
3832
|
+
* cascade-disables dependents.
|
|
3833
|
+
*/
|
|
3834
|
+
upsert(id, body, opts = {}, auth2 = SERVICE11) {
|
|
3835
|
+
return this.ctx.http.request({
|
|
3836
|
+
method: "PUT",
|
|
3837
|
+
path: this.item(id),
|
|
3838
|
+
auth: auth2,
|
|
3839
|
+
body,
|
|
3840
|
+
...opts.force ? { query: { force: "true" } } : {}
|
|
3841
|
+
});
|
|
3842
|
+
}
|
|
3843
|
+
/**
|
|
3844
|
+
* Partial update with an op array (`PATCH {path}/{id}`, 204). `ops` use the
|
|
3845
|
+
* upstream UPPERCASE enum (`ADD | REMOVE | REPLACE`), sent verbatim.
|
|
3846
|
+
*/
|
|
3847
|
+
async patch(id, ops, auth2 = SERVICE11) {
|
|
3848
|
+
await this.ctx.http.request({ method: "PATCH", path: this.item(id), auth: auth2, body: ops });
|
|
3849
|
+
}
|
|
3850
|
+
/** Delete by id (`DELETE {path}/{id}`). `{ force: true }` removes even if referenced. */
|
|
3851
|
+
async delete(id, opts = {}, auth2 = SERVICE11) {
|
|
3852
|
+
await this.ctx.http.request({
|
|
3853
|
+
method: "DELETE",
|
|
3854
|
+
path: this.item(id),
|
|
3855
|
+
auth: auth2,
|
|
3856
|
+
...opts.force ? { query: { force: "true" } } : {}
|
|
3857
|
+
});
|
|
3858
|
+
}
|
|
3859
|
+
};
|
|
3860
|
+
var JobsResource = class {
|
|
3861
|
+
constructor(ctx, base) {
|
|
3862
|
+
this.ctx = ctx;
|
|
3863
|
+
this.base = base;
|
|
3864
|
+
}
|
|
3865
|
+
ctx;
|
|
3866
|
+
base;
|
|
3867
|
+
/** List jobs (`GET /jobs`). */
|
|
3868
|
+
list(query = {}, auth2 = SERVICE11) {
|
|
3869
|
+
return this.ctx.http.request({ method: "GET", path: `${this.base}/jobs`, auth: auth2, query: { ...query } });
|
|
3870
|
+
}
|
|
3871
|
+
/** Structured job search (`POST /jobs/search`). */
|
|
3872
|
+
search(query, auth2 = SERVICE11) {
|
|
3873
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base}/jobs/search`, auth: auth2, body: query });
|
|
3874
|
+
}
|
|
3875
|
+
/** Retrieve one job (`GET /jobs/{jobId}`). */
|
|
3876
|
+
get(jobId, auth2 = SERVICE11) {
|
|
3877
|
+
return this.ctx.http.request({ method: "GET", path: `${this.base}/jobs/${encodeURIComponent(jobId)}`, auth: auth2 });
|
|
3878
|
+
}
|
|
3879
|
+
/** Delete one job (`DELETE /jobs/{jobId}`). */
|
|
3880
|
+
async delete(jobId, auth2 = SERVICE11) {
|
|
3881
|
+
await this.ctx.http.request({ method: "DELETE", path: `${this.base}/jobs/${encodeURIComponent(jobId)}`, auth: auth2 });
|
|
3882
|
+
}
|
|
3883
|
+
};
|
|
3884
|
+
var TemplatesResource = class {
|
|
3885
|
+
constructor(ctx, path) {
|
|
3886
|
+
this.ctx = ctx;
|
|
3887
|
+
this.path = path;
|
|
3888
|
+
}
|
|
3889
|
+
ctx;
|
|
3890
|
+
path;
|
|
3891
|
+
/** List available templates (`GET /agentic/templates`). */
|
|
3892
|
+
list(query = {}, auth2 = SERVICE11) {
|
|
3893
|
+
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
3894
|
+
}
|
|
3895
|
+
/** Structured template search (`POST /agentic/templates/search`). */
|
|
3896
|
+
search(query, auth2 = SERVICE11) {
|
|
3897
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, body: query });
|
|
3898
|
+
}
|
|
3899
|
+
/**
|
|
3900
|
+
* Instantiate a new agent from a template
|
|
3901
|
+
* (`POST /agentic/templates/{templateId}/agents`, HTTP 201). Returns the
|
|
3902
|
+
* created agent's id.
|
|
3903
|
+
*/
|
|
3904
|
+
clone(templateId, body, auth2 = SERVICE11) {
|
|
3905
|
+
return this.ctx.http.request({
|
|
3906
|
+
method: "POST",
|
|
3907
|
+
path: `${this.path}/${encodeURIComponent(templateId)}/agents`,
|
|
3908
|
+
auth: auth2,
|
|
3909
|
+
body
|
|
3910
|
+
});
|
|
3911
|
+
}
|
|
3912
|
+
};
|
|
3913
|
+
var LogsResource = class {
|
|
3914
|
+
constructor(ctx, path) {
|
|
3915
|
+
this.ctx = ctx;
|
|
3916
|
+
this.path = path;
|
|
3917
|
+
}
|
|
3918
|
+
ctx;
|
|
3919
|
+
path;
|
|
3920
|
+
/** List request logs (`GET /agentic/logs/requests`). */
|
|
3921
|
+
listRequests(query = {}, auth2 = SERVICE11) {
|
|
3922
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/requests`, auth: auth2, query: { ...query } });
|
|
3923
|
+
}
|
|
3924
|
+
/** Retrieve one request log (`GET /agentic/logs/requests/{requestId}`). */
|
|
3925
|
+
getRequest(requestId, auth2 = SERVICE11) {
|
|
3926
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/requests/${encodeURIComponent(requestId)}`, auth: auth2 });
|
|
3927
|
+
}
|
|
3928
|
+
/** Structured request-log search (`POST /agentic/logs/requests/search`). */
|
|
3929
|
+
searchRequests(query, auth2 = SERVICE11) {
|
|
3930
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/requests/search`, auth: auth2, body: query });
|
|
3931
|
+
}
|
|
3932
|
+
/** List session logs (`GET /agentic/logs/sessions`). */
|
|
3933
|
+
listSessions(query = {}, auth2 = SERVICE11) {
|
|
3934
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/sessions`, auth: auth2, query: { ...query } });
|
|
3935
|
+
}
|
|
3936
|
+
/** Retrieve one session log (`GET /agentic/logs/sessions/{sessionId}`). */
|
|
3937
|
+
getSession(sessionId, auth2 = SERVICE11) {
|
|
3938
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/sessions/${encodeURIComponent(sessionId)}`, auth: auth2 });
|
|
3939
|
+
}
|
|
3940
|
+
/** Structured session-log search (`POST /agentic/logs/sessions/search`). */
|
|
3941
|
+
searchSessions(query, auth2 = SERVICE11) {
|
|
3942
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/sessions/search`, auth: auth2, body: query });
|
|
3943
|
+
}
|
|
3944
|
+
};
|
|
3945
|
+
var AnalyticsResource = class {
|
|
3946
|
+
constructor(ctx, path) {
|
|
3947
|
+
this.ctx = ctx;
|
|
3948
|
+
this.path = path;
|
|
3949
|
+
}
|
|
3950
|
+
ctx;
|
|
3951
|
+
path;
|
|
3952
|
+
/** Aggregated metrics (`GET /agentic/analytics`); scope with `agentId`. */
|
|
3953
|
+
get(opts = {}, auth2 = SERVICE11) {
|
|
3954
|
+
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...opts } });
|
|
3955
|
+
}
|
|
3956
|
+
/** Per-agent execution counts (`GET /agentic/analytics/executions`). `agentIds` required. */
|
|
3957
|
+
executions(query, auth2 = SERVICE11) {
|
|
3958
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/executions`, auth: auth2, query: { ...query } });
|
|
3959
|
+
}
|
|
3960
|
+
};
|
|
3961
|
+
|
|
3962
|
+
// src/services/ai.ts
|
|
3963
|
+
var SERVICE12 = { kind: "service" };
|
|
3603
3964
|
var AiService = class {
|
|
3604
3965
|
constructor(ctx) {
|
|
3605
3966
|
this.ctx = ctx;
|
|
@@ -3609,8 +3970,49 @@ var AiService = class {
|
|
|
3609
3970
|
base() {
|
|
3610
3971
|
return `/ai-service/${this.ctx.tenant}`;
|
|
3611
3972
|
}
|
|
3973
|
+
// --- Agentic building blocks (CRUD sub-resources) ----------------------
|
|
3974
|
+
_oauths;
|
|
3975
|
+
/** OAuth 2.0 client-credentials configs (`/agentic/oauths`). CRUD sub-resource. */
|
|
3976
|
+
get oauths() {
|
|
3977
|
+
return this._oauths ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/oauths`);
|
|
3978
|
+
}
|
|
3979
|
+
_tools;
|
|
3980
|
+
/** Agentic tools (`/agentic/tools`). CRUD sub-resource. */
|
|
3981
|
+
get tools() {
|
|
3982
|
+
return this._tools ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/tools`);
|
|
3983
|
+
}
|
|
3984
|
+
_tokens;
|
|
3985
|
+
/** Stored tokens (`/agentic/tokens`) — an OAuth config's client secret. CRUD sub-resource. */
|
|
3986
|
+
get tokens() {
|
|
3987
|
+
return this._tokens ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/tokens`);
|
|
3988
|
+
}
|
|
3989
|
+
_mcpServers;
|
|
3990
|
+
/** MCP-server configs (`/agentic/mcp-servers`). CRUD sub-resource. */
|
|
3991
|
+
get mcpServers() {
|
|
3992
|
+
return this._mcpServers ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/mcp-servers`);
|
|
3993
|
+
}
|
|
3994
|
+
_jobs;
|
|
3995
|
+
/** AI async jobs (`/jobs`). `list · search · get · delete`. */
|
|
3996
|
+
get jobs() {
|
|
3997
|
+
return this._jobs ??= new JobsResource(this.ctx, this.base());
|
|
3998
|
+
}
|
|
3999
|
+
_templates;
|
|
4000
|
+
/** Agent templates (`/agentic/templates`). `list · search · clone`. */
|
|
4001
|
+
get templates() {
|
|
4002
|
+
return this._templates ??= new TemplatesResource(this.ctx, `${this.base()}/agentic/templates`);
|
|
4003
|
+
}
|
|
4004
|
+
_logs;
|
|
4005
|
+
/** Agent logs (`/agentic/logs`): request + session logs. */
|
|
4006
|
+
get logs() {
|
|
4007
|
+
return this._logs ??= new LogsResource(this.ctx, `${this.base()}/agentic/logs`);
|
|
4008
|
+
}
|
|
4009
|
+
_analytics;
|
|
4010
|
+
/** Agent analytics (`/agentic/analytics`). `get · executions`. */
|
|
4011
|
+
get analytics() {
|
|
4012
|
+
return this._analytics ??= new AnalyticsResource(this.ctx, `${this.base()}/agentic/analytics`);
|
|
4013
|
+
}
|
|
3612
4014
|
/** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
|
|
3613
|
-
async generateText(input, auth2 =
|
|
4015
|
+
async generateText(input, auth2 = SERVICE12) {
|
|
3614
4016
|
return this.ctx.http.request({
|
|
3615
4017
|
method: "POST",
|
|
3616
4018
|
path: `${this.base()}/texts`,
|
|
@@ -3619,7 +4021,7 @@ var AiService = class {
|
|
|
3619
4021
|
});
|
|
3620
4022
|
}
|
|
3621
4023
|
/** Run a chat completion over a message list (`POST /completions`). No `maxTokens`. */
|
|
3622
|
-
async complete(input, auth2 =
|
|
4024
|
+
async complete(input, auth2 = SERVICE12) {
|
|
3623
4025
|
return this.ctx.http.request({
|
|
3624
4026
|
method: "POST",
|
|
3625
4027
|
path: `${this.base()}/completions`,
|
|
@@ -3628,7 +4030,7 @@ var AiService = class {
|
|
|
3628
4030
|
});
|
|
3629
4031
|
}
|
|
3630
4032
|
/** List all agentic agents. */
|
|
3631
|
-
async listAgents(auth2 =
|
|
4033
|
+
async listAgents(auth2 = SERVICE12) {
|
|
3632
4034
|
return this.ctx.http.request({
|
|
3633
4035
|
method: "GET",
|
|
3634
4036
|
path: `${this.base()}/agentic/agents`,
|
|
@@ -3636,7 +4038,7 @@ var AiService = class {
|
|
|
3636
4038
|
});
|
|
3637
4039
|
}
|
|
3638
4040
|
/** Retrieve one agent by id. */
|
|
3639
|
-
async getAgent(id, auth2 =
|
|
4041
|
+
async getAgent(id, auth2 = SERVICE12) {
|
|
3640
4042
|
return this.ctx.http.request({
|
|
3641
4043
|
method: "GET",
|
|
3642
4044
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3644,7 +4046,7 @@ var AiService = class {
|
|
|
3644
4046
|
});
|
|
3645
4047
|
}
|
|
3646
4048
|
/** Create-or-replace an agent by id (`PUT`). Takes the agent write shape. */
|
|
3647
|
-
async upsertAgent(id, agent, auth2 =
|
|
4049
|
+
async upsertAgent(id, agent, auth2 = SERVICE12) {
|
|
3648
4050
|
return this.ctx.http.request({
|
|
3649
4051
|
method: "PUT",
|
|
3650
4052
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3657,7 +4059,7 @@ var AiService = class {
|
|
|
3657
4059
|
* UPPERCASE enum (`ADD | REMOVE | REPLACE`) and are sent verbatim — this is
|
|
3658
4060
|
* NOT RFC-6902 JSON-Patch.
|
|
3659
4061
|
*/
|
|
3660
|
-
async patchAgent(id, ops, auth2 =
|
|
4062
|
+
async patchAgent(id, ops, auth2 = SERVICE12) {
|
|
3661
4063
|
return this.ctx.http.request({
|
|
3662
4064
|
method: "PATCH",
|
|
3663
4065
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3669,7 +4071,7 @@ var AiService = class {
|
|
|
3669
4071
|
* Delete an agent by id. Pass `{ force: true }` to delete an agent that is
|
|
3670
4072
|
* still referenced elsewhere (`?force=true`).
|
|
3671
4073
|
*/
|
|
3672
|
-
async deleteAgent(id, auth2 =
|
|
4074
|
+
async deleteAgent(id, auth2 = SERVICE12, opts = {}) {
|
|
3673
4075
|
await this.ctx.http.request({
|
|
3674
4076
|
method: "DELETE",
|
|
3675
4077
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3678,7 +4080,7 @@ var AiService = class {
|
|
|
3678
4080
|
});
|
|
3679
4081
|
}
|
|
3680
4082
|
/** Server-side agent search (`POST /agentic/agents/search`). */
|
|
3681
|
-
async searchAgents(query, auth2 =
|
|
4083
|
+
async searchAgents(query, auth2 = SERVICE12) {
|
|
3682
4084
|
return this.ctx.http.request({
|
|
3683
4085
|
method: "POST",
|
|
3684
4086
|
path: `${this.base()}/agentic/agents/search`,
|
|
@@ -3690,7 +4092,7 @@ var AiService = class {
|
|
|
3690
4092
|
* Synchronous agent chat (`POST /agentic/chat`). Returns the response
|
|
3691
4093
|
* ARRAY verbatim (the upstream contract is an array, not a single object).
|
|
3692
4094
|
*/
|
|
3693
|
-
async chat(input, auth2 =
|
|
4095
|
+
async chat(input, auth2 = SERVICE12) {
|
|
3694
4096
|
return this.ctx.http.request({
|
|
3695
4097
|
method: "POST",
|
|
3696
4098
|
path: `${this.base()}/agentic/chat`,
|
|
@@ -3702,7 +4104,7 @@ var AiService = class {
|
|
|
3702
4104
|
* Fire-and-forget agent chat (`POST /agentic/chat-async`, HTTP 201).
|
|
3703
4105
|
* Returns the job-id ARRAY verbatim.
|
|
3704
4106
|
*/
|
|
3705
|
-
async chatAsync(input, auth2 =
|
|
4107
|
+
async chatAsync(input, auth2 = SERVICE12) {
|
|
3706
4108
|
return this.ctx.http.request({
|
|
3707
4109
|
method: "POST",
|
|
3708
4110
|
path: `${this.base()}/agentic/chat-async`,
|
|
@@ -3716,7 +4118,7 @@ var AiService = class {
|
|
|
3716
4118
|
* stream body as an opaque string, so chunks are raw strings, not parsed
|
|
3717
4119
|
* objects. Consume with `for await`.
|
|
3718
4120
|
*/
|
|
3719
|
-
async *chatStream(input, opts = {}, auth2 =
|
|
4121
|
+
async *chatStream(input, opts = {}, auth2 = SERVICE12) {
|
|
3720
4122
|
const events = this.ctx.http.requestStream({
|
|
3721
4123
|
method: "POST",
|
|
3722
4124
|
path: `${this.base()}/agentic/chat-stream`,
|
|
@@ -3727,7 +4129,7 @@ var AiService = class {
|
|
|
3727
4129
|
for await (const ev of events) yield ev.data;
|
|
3728
4130
|
}
|
|
3729
4131
|
/** List stored agentic conversations (`GET /agentic/conversations`). */
|
|
3730
|
-
async listConversations(auth2 =
|
|
4132
|
+
async listConversations(auth2 = SERVICE12) {
|
|
3731
4133
|
return this.ctx.http.request({
|
|
3732
4134
|
method: "GET",
|
|
3733
4135
|
path: `${this.base()}/agentic/conversations`,
|
|
@@ -3735,7 +4137,7 @@ var AiService = class {
|
|
|
3735
4137
|
});
|
|
3736
4138
|
}
|
|
3737
4139
|
/** Server-side conversation search (`POST /agentic/conversations/search`). */
|
|
3738
|
-
async searchConversations(query, auth2 =
|
|
4140
|
+
async searchConversations(query, auth2 = SERVICE12) {
|
|
3739
4141
|
return this.ctx.http.request({
|
|
3740
4142
|
method: "POST",
|
|
3741
4143
|
path: `${this.base()}/agentic/conversations/search`,
|
|
@@ -3743,10 +4145,62 @@ var AiService = class {
|
|
|
3743
4145
|
body: query
|
|
3744
4146
|
});
|
|
3745
4147
|
}
|
|
4148
|
+
// --- Standalone agentic reads / bulk operations ------------------------
|
|
4149
|
+
/** List models available to the tenant, grouped by provider (`GET /agentic/models`). */
|
|
4150
|
+
async listModels(auth2 = SERVICE12) {
|
|
4151
|
+
return this.ctx.http.request({
|
|
4152
|
+
method: "GET",
|
|
4153
|
+
path: `${this.base()}/agentic/models`,
|
|
4154
|
+
auth: auth2
|
|
4155
|
+
});
|
|
4156
|
+
}
|
|
4157
|
+
/** List commerce events available to agent triggers (`GET /agentic/commerce-events`). */
|
|
4158
|
+
async listCommerceEvents(auth2 = SERVICE12) {
|
|
4159
|
+
return this.ctx.http.request({
|
|
4160
|
+
method: "GET",
|
|
4161
|
+
path: `${this.base()}/agentic/commerce-events`,
|
|
4162
|
+
auth: auth2
|
|
4163
|
+
});
|
|
4164
|
+
}
|
|
4165
|
+
/**
|
|
4166
|
+
* Upload a chat attachment for an agent
|
|
4167
|
+
* (`POST /agentic/{agentId}/attachments`, multipart, HTTP 201). The response
|
|
4168
|
+
* `sessionId` must be threaded into subsequent chat calls to bind the file.
|
|
4169
|
+
* Pass `opts.sessionId` to attach to an existing session.
|
|
4170
|
+
*/
|
|
4171
|
+
async uploadAttachment(agentId, attachment, opts = {}, auth2 = SERVICE12) {
|
|
4172
|
+
const form = new FormData();
|
|
4173
|
+
form.append("attachment", attachment);
|
|
4174
|
+
return this.ctx.http.request({
|
|
4175
|
+
method: "POST",
|
|
4176
|
+
path: `${this.base()}/agentic/${encodeURIComponent(agentId)}/attachments`,
|
|
4177
|
+
auth: auth2,
|
|
4178
|
+
body: form,
|
|
4179
|
+
...opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {}
|
|
4180
|
+
});
|
|
4181
|
+
}
|
|
4182
|
+
/** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
|
|
4183
|
+
async exportAgents(body, auth2 = SERVICE12) {
|
|
4184
|
+
return this.ctx.http.request({
|
|
4185
|
+
method: "POST",
|
|
4186
|
+
path: `${this.base()}/agentic/agents/export`,
|
|
4187
|
+
auth: auth2,
|
|
4188
|
+
body
|
|
4189
|
+
});
|
|
4190
|
+
}
|
|
4191
|
+
/** Import previously-exported agents (`POST /agentic/agents/import`). */
|
|
4192
|
+
async importAgents(body, auth2 = SERVICE12) {
|
|
4193
|
+
return this.ctx.http.request({
|
|
4194
|
+
method: "POST",
|
|
4195
|
+
path: `${this.base()}/agentic/agents/import`,
|
|
4196
|
+
auth: auth2,
|
|
4197
|
+
body
|
|
4198
|
+
});
|
|
4199
|
+
}
|
|
3746
4200
|
};
|
|
3747
4201
|
|
|
3748
4202
|
// src/services/tax.ts
|
|
3749
|
-
var
|
|
4203
|
+
var SERVICE13 = { kind: "service" };
|
|
3750
4204
|
var TaxService = class {
|
|
3751
4205
|
constructor(ctx) {
|
|
3752
4206
|
this.ctx = ctx;
|
|
@@ -3757,7 +4211,7 @@ var TaxService = class {
|
|
|
3757
4211
|
return `/tax/${this.ctx.tenant}`;
|
|
3758
4212
|
}
|
|
3759
4213
|
/** List all per-location tax configurations. */
|
|
3760
|
-
async listTaxConfigs(auth2 =
|
|
4214
|
+
async listTaxConfigs(auth2 = SERVICE13) {
|
|
3761
4215
|
return this.ctx.http.request({
|
|
3762
4216
|
method: "GET",
|
|
3763
4217
|
path: `${this.base()}/taxes`,
|
|
@@ -3765,7 +4219,7 @@ var TaxService = class {
|
|
|
3765
4219
|
});
|
|
3766
4220
|
}
|
|
3767
4221
|
/** Retrieve one tax configuration by its location (country) code. */
|
|
3768
|
-
async getTaxConfig(locationCode, auth2 =
|
|
4222
|
+
async getTaxConfig(locationCode, auth2 = SERVICE13) {
|
|
3769
4223
|
return this.ctx.http.request({
|
|
3770
4224
|
method: "GET",
|
|
3771
4225
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3773,7 +4227,7 @@ var TaxService = class {
|
|
|
3773
4227
|
});
|
|
3774
4228
|
}
|
|
3775
4229
|
/** Create a tax configuration (`POST`). Returns the created `{ locationCode }`. */
|
|
3776
|
-
async createTaxConfig(input, auth2 =
|
|
4230
|
+
async createTaxConfig(input, auth2 = SERVICE13) {
|
|
3777
4231
|
return this.ctx.http.request({
|
|
3778
4232
|
method: "POST",
|
|
3779
4233
|
path: `${this.base()}/taxes`,
|
|
@@ -3785,7 +4239,7 @@ var TaxService = class {
|
|
|
3785
4239
|
* Update a tax configuration by location code (`PUT`). `metadata.version` is
|
|
3786
4240
|
* required (optimistic locking — a stale version yields 409).
|
|
3787
4241
|
*/
|
|
3788
|
-
async updateTaxConfig(locationCode, input, auth2 =
|
|
4242
|
+
async updateTaxConfig(locationCode, input, auth2 = SERVICE13) {
|
|
3789
4243
|
return this.ctx.http.request({
|
|
3790
4244
|
method: "PUT",
|
|
3791
4245
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3794,7 +4248,7 @@ var TaxService = class {
|
|
|
3794
4248
|
});
|
|
3795
4249
|
}
|
|
3796
4250
|
/** Delete a tax configuration by location code. */
|
|
3797
|
-
async deleteTaxConfig(locationCode, auth2 =
|
|
4251
|
+
async deleteTaxConfig(locationCode, auth2 = SERVICE13) {
|
|
3798
4252
|
await this.ctx.http.request({
|
|
3799
4253
|
method: "DELETE",
|
|
3800
4254
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3805,7 +4259,7 @@ var TaxService = class {
|
|
|
3805
4259
|
* Calculate net/gross values for a price (`PUT /taxes/calculation-commands`).
|
|
3806
4260
|
* Single command in, single result out.
|
|
3807
4261
|
*/
|
|
3808
|
-
async calculateTax(request, auth2 =
|
|
4262
|
+
async calculateTax(request, auth2 = SERVICE13) {
|
|
3809
4263
|
return this.ctx.http.request({
|
|
3810
4264
|
method: "PUT",
|
|
3811
4265
|
path: `${this.base()}/taxes/calculation-commands`,
|
|
@@ -3816,7 +4270,7 @@ var TaxService = class {
|
|
|
3816
4270
|
};
|
|
3817
4271
|
|
|
3818
4272
|
// src/services/coupon.ts
|
|
3819
|
-
var
|
|
4273
|
+
var SERVICE14 = { kind: "service" };
|
|
3820
4274
|
var CouponService = class {
|
|
3821
4275
|
constructor(ctx) {
|
|
3822
4276
|
this.ctx = ctx;
|
|
@@ -3827,7 +4281,7 @@ var CouponService = class {
|
|
|
3827
4281
|
return `/coupon/${this.ctx.tenant}`;
|
|
3828
4282
|
}
|
|
3829
4283
|
/** List coupons by criteria. Returns a plain array. */
|
|
3830
|
-
async listCoupons(query = {}, auth2 =
|
|
4284
|
+
async listCoupons(query = {}, auth2 = SERVICE14) {
|
|
3831
4285
|
return this.ctx.http.request({
|
|
3832
4286
|
method: "GET",
|
|
3833
4287
|
path: `${this.base()}/coupons`,
|
|
@@ -3836,7 +4290,7 @@ var CouponService = class {
|
|
|
3836
4290
|
});
|
|
3837
4291
|
}
|
|
3838
4292
|
/** Retrieve one coupon by code. */
|
|
3839
|
-
async getCoupon(code, auth2 =
|
|
4293
|
+
async getCoupon(code, auth2 = SERVICE14) {
|
|
3840
4294
|
return this.ctx.http.request({
|
|
3841
4295
|
method: "GET",
|
|
3842
4296
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3844,7 +4298,7 @@ var CouponService = class {
|
|
|
3844
4298
|
});
|
|
3845
4299
|
}
|
|
3846
4300
|
/** Create a coupon (`POST`, HTTP 201). Returns the created resource's `{ id?, yrn? }`. */
|
|
3847
|
-
async createCoupon(input, auth2 =
|
|
4301
|
+
async createCoupon(input, auth2 = SERVICE14) {
|
|
3848
4302
|
return this.ctx.http.request({
|
|
3849
4303
|
method: "POST",
|
|
3850
4304
|
path: `${this.base()}/coupons`,
|
|
@@ -3853,7 +4307,7 @@ var CouponService = class {
|
|
|
3853
4307
|
});
|
|
3854
4308
|
}
|
|
3855
4309
|
/** Replace a coupon by code (`PUT`). Resolves once the update is accepted. */
|
|
3856
|
-
async updateCoupon(code, input, auth2 =
|
|
4310
|
+
async updateCoupon(code, input, auth2 = SERVICE14) {
|
|
3857
4311
|
await this.ctx.http.request({
|
|
3858
4312
|
method: "PUT",
|
|
3859
4313
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3862,7 +4316,7 @@ var CouponService = class {
|
|
|
3862
4316
|
});
|
|
3863
4317
|
}
|
|
3864
4318
|
/** Partially update a coupon by code (`PATCH` merge body). */
|
|
3865
|
-
async patchCoupon(code, patch, auth2 =
|
|
4319
|
+
async patchCoupon(code, patch, auth2 = SERVICE14) {
|
|
3866
4320
|
await this.ctx.http.request({
|
|
3867
4321
|
method: "PATCH",
|
|
3868
4322
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3871,7 +4325,7 @@ var CouponService = class {
|
|
|
3871
4325
|
});
|
|
3872
4326
|
}
|
|
3873
4327
|
/** Delete a coupon by code. */
|
|
3874
|
-
async deleteCoupon(code, auth2 =
|
|
4328
|
+
async deleteCoupon(code, auth2 = SERVICE14) {
|
|
3875
4329
|
await this.ctx.http.request({
|
|
3876
4330
|
method: "DELETE",
|
|
3877
4331
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3882,7 +4336,7 @@ var CouponService = class {
|
|
|
3882
4336
|
* Check whether a coupon can be redeemed (`POST /validation`). Resolves when
|
|
3883
4337
|
* redeemable; throws an `EmporixError` otherwise (no response body).
|
|
3884
4338
|
*/
|
|
3885
|
-
async validateCoupon(code, redemption, auth2 =
|
|
4339
|
+
async validateCoupon(code, redemption, auth2 = SERVICE14) {
|
|
3886
4340
|
await this.ctx.http.request({
|
|
3887
4341
|
method: "POST",
|
|
3888
4342
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/validation`,
|
|
@@ -3891,7 +4345,7 @@ var CouponService = class {
|
|
|
3891
4345
|
});
|
|
3892
4346
|
}
|
|
3893
4347
|
/** List a coupon's redemptions by criteria. */
|
|
3894
|
-
async listRedemptions(code, query = {}, auth2 =
|
|
4348
|
+
async listRedemptions(code, query = {}, auth2 = SERVICE14) {
|
|
3895
4349
|
return this.ctx.http.request({
|
|
3896
4350
|
method: "GET",
|
|
3897
4351
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -3900,7 +4354,7 @@ var CouponService = class {
|
|
|
3900
4354
|
});
|
|
3901
4355
|
}
|
|
3902
4356
|
/** Redeem a coupon by creating a redemption (`POST`, HTTP 201). Returns the resource location. */
|
|
3903
|
-
async redeemCoupon(code, redemption, auth2 =
|
|
4357
|
+
async redeemCoupon(code, redemption, auth2 = SERVICE14) {
|
|
3904
4358
|
return this.ctx.http.request({
|
|
3905
4359
|
method: "POST",
|
|
3906
4360
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -3909,7 +4363,7 @@ var CouponService = class {
|
|
|
3909
4363
|
});
|
|
3910
4364
|
}
|
|
3911
4365
|
/** Retrieve one redemption by id. */
|
|
3912
|
-
async getRedemption(code, id, auth2 =
|
|
4366
|
+
async getRedemption(code, id, auth2 = SERVICE14) {
|
|
3913
4367
|
return this.ctx.http.request({
|
|
3914
4368
|
method: "GET",
|
|
3915
4369
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -3917,7 +4371,7 @@ var CouponService = class {
|
|
|
3917
4371
|
});
|
|
3918
4372
|
}
|
|
3919
4373
|
/** Delete a redemption by id. */
|
|
3920
|
-
async deleteRedemption(code, id, auth2 =
|
|
4374
|
+
async deleteRedemption(code, id, auth2 = SERVICE14) {
|
|
3921
4375
|
await this.ctx.http.request({
|
|
3922
4376
|
method: "DELETE",
|
|
3923
4377
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -3925,7 +4379,7 @@ var CouponService = class {
|
|
|
3925
4379
|
});
|
|
3926
4380
|
}
|
|
3927
4381
|
/** Retrieve a customer's referral coupon (resolves to an empty body when none exists). */
|
|
3928
|
-
async getReferralCoupon(customerNumber, auth2 =
|
|
4382
|
+
async getReferralCoupon(customerNumber, auth2 = SERVICE14) {
|
|
3929
4383
|
return this.ctx.http.request({
|
|
3930
4384
|
method: "GET",
|
|
3931
4385
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -3933,7 +4387,7 @@ var CouponService = class {
|
|
|
3933
4387
|
});
|
|
3934
4388
|
}
|
|
3935
4389
|
/** Create a referral coupon code for a customer (no request body). */
|
|
3936
|
-
async createReferralCoupon(customerNumber, auth2 =
|
|
4390
|
+
async createReferralCoupon(customerNumber, auth2 = SERVICE14) {
|
|
3937
4391
|
return this.ctx.http.request({
|
|
3938
4392
|
method: "POST",
|
|
3939
4393
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -3943,7 +4397,7 @@ var CouponService = class {
|
|
|
3943
4397
|
};
|
|
3944
4398
|
|
|
3945
4399
|
// src/services/reward-points.ts
|
|
3946
|
-
var
|
|
4400
|
+
var SERVICE15 = { kind: "service" };
|
|
3947
4401
|
var RewardPointsService = class {
|
|
3948
4402
|
constructor(ctx) {
|
|
3949
4403
|
this.ctx = ctx;
|
|
@@ -3960,7 +4414,7 @@ var RewardPointsService = class {
|
|
|
3960
4414
|
}
|
|
3961
4415
|
// --- Admin: customer points management (service token) ---
|
|
3962
4416
|
/** Batch summary across all customers. */
|
|
3963
|
-
async listAllSummaries(query = {}, auth2 =
|
|
4417
|
+
async listAllSummaries(query = {}, auth2 = SERVICE15) {
|
|
3964
4418
|
return this.ctx.http.request({
|
|
3965
4419
|
method: "GET",
|
|
3966
4420
|
path: `${this.base()}/summaryBatch`,
|
|
@@ -3969,7 +4423,7 @@ var RewardPointsService = class {
|
|
|
3969
4423
|
});
|
|
3970
4424
|
}
|
|
3971
4425
|
/** Retrieve one customer's reward-points balance. */
|
|
3972
|
-
async getCustomerPoints(customerId, auth2 =
|
|
4426
|
+
async getCustomerPoints(customerId, auth2 = SERVICE15) {
|
|
3973
4427
|
return this.ctx.http.request({
|
|
3974
4428
|
method: "GET",
|
|
3975
4429
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3977,7 +4431,7 @@ var RewardPointsService = class {
|
|
|
3977
4431
|
});
|
|
3978
4432
|
}
|
|
3979
4433
|
/** Create a reward-points entry for a customer. */
|
|
3980
|
-
async createCustomerPoints(customerId, input, auth2 =
|
|
4434
|
+
async createCustomerPoints(customerId, input, auth2 = SERVICE15) {
|
|
3981
4435
|
await this.ctx.http.request({
|
|
3982
4436
|
method: "POST",
|
|
3983
4437
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3986,7 +4440,7 @@ var RewardPointsService = class {
|
|
|
3986
4440
|
});
|
|
3987
4441
|
}
|
|
3988
4442
|
/** Delete a customer's reward points. */
|
|
3989
|
-
async deleteCustomerPoints(customerId, auth2 =
|
|
4443
|
+
async deleteCustomerPoints(customerId, auth2 = SERVICE15) {
|
|
3990
4444
|
await this.ctx.http.request({
|
|
3991
4445
|
method: "DELETE",
|
|
3992
4446
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3994,7 +4448,7 @@ var RewardPointsService = class {
|
|
|
3994
4448
|
});
|
|
3995
4449
|
}
|
|
3996
4450
|
/** Retrieve a reward-points summary for one customer. */
|
|
3997
|
-
async getCustomerSummary(customerId, auth2 =
|
|
4451
|
+
async getCustomerSummary(customerId, auth2 = SERVICE15) {
|
|
3998
4452
|
return this.ctx.http.request({
|
|
3999
4453
|
method: "GET",
|
|
4000
4454
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/summary`,
|
|
@@ -4002,7 +4456,7 @@ var RewardPointsService = class {
|
|
|
4002
4456
|
});
|
|
4003
4457
|
}
|
|
4004
4458
|
/** Add reward points for a customer. */
|
|
4005
|
-
async addPoints(customerId, input, auth2 =
|
|
4459
|
+
async addPoints(customerId, input, auth2 = SERVICE15) {
|
|
4006
4460
|
await this.ctx.http.request({
|
|
4007
4461
|
method: "POST",
|
|
4008
4462
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/addPoints`,
|
|
@@ -4011,7 +4465,7 @@ var RewardPointsService = class {
|
|
|
4011
4465
|
});
|
|
4012
4466
|
}
|
|
4013
4467
|
/** Redeem a customer's reward points (on behalf). */
|
|
4014
|
-
async redeemPoints(customerId, input, auth2 =
|
|
4468
|
+
async redeemPoints(customerId, input, auth2 = SERVICE15) {
|
|
4015
4469
|
await this.ctx.http.request({
|
|
4016
4470
|
method: "POST",
|
|
4017
4471
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/redeemPoints`,
|
|
@@ -4062,7 +4516,7 @@ var RewardPointsService = class {
|
|
|
4062
4516
|
}
|
|
4063
4517
|
// --- Redeem options (tenant-scoped; read open to customer, management service-only) ---
|
|
4064
4518
|
/** List redeem options. Defaults to the service token; pass a customer `auth` for storefront reads. */
|
|
4065
|
-
async listRedeemOptions(auth2 =
|
|
4519
|
+
async listRedeemOptions(auth2 = SERVICE15) {
|
|
4066
4520
|
return this.ctx.http.request({
|
|
4067
4521
|
method: "GET",
|
|
4068
4522
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -4070,7 +4524,7 @@ var RewardPointsService = class {
|
|
|
4070
4524
|
});
|
|
4071
4525
|
}
|
|
4072
4526
|
/** Create a redeem option. Returns the updated options list. */
|
|
4073
|
-
async createRedeemOption(input, auth2 =
|
|
4527
|
+
async createRedeemOption(input, auth2 = SERVICE15) {
|
|
4074
4528
|
return this.ctx.http.request({
|
|
4075
4529
|
method: "POST",
|
|
4076
4530
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -4079,7 +4533,7 @@ var RewardPointsService = class {
|
|
|
4079
4533
|
});
|
|
4080
4534
|
}
|
|
4081
4535
|
/** Update a redeem option by id. Resolves once accepted (no response body). */
|
|
4082
|
-
async updateRedeemOption(redeemOptionId, input, auth2 =
|
|
4536
|
+
async updateRedeemOption(redeemOptionId, input, auth2 = SERVICE15) {
|
|
4083
4537
|
await this.ctx.http.request({
|
|
4084
4538
|
method: "PUT",
|
|
4085
4539
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -4088,7 +4542,7 @@ var RewardPointsService = class {
|
|
|
4088
4542
|
});
|
|
4089
4543
|
}
|
|
4090
4544
|
/** Delete a redeem option by id. */
|
|
4091
|
-
async deleteRedeemOption(redeemOptionId, auth2 =
|
|
4545
|
+
async deleteRedeemOption(redeemOptionId, auth2 = SERVICE15) {
|
|
4092
4546
|
await this.ctx.http.request({
|
|
4093
4547
|
method: "DELETE",
|
|
4094
4548
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -4098,7 +4552,7 @@ var RewardPointsService = class {
|
|
|
4098
4552
|
};
|
|
4099
4553
|
|
|
4100
4554
|
// src/services/brand.ts
|
|
4101
|
-
var
|
|
4555
|
+
var SERVICE16 = { kind: "service" };
|
|
4102
4556
|
var BrandService = class {
|
|
4103
4557
|
constructor(ctx) {
|
|
4104
4558
|
this.ctx = ctx;
|
|
@@ -4109,7 +4563,7 @@ var BrandService = class {
|
|
|
4109
4563
|
return `/brand/brands`;
|
|
4110
4564
|
}
|
|
4111
4565
|
/** List all brands. */
|
|
4112
|
-
async listBrands(query = {}, auth2 =
|
|
4566
|
+
async listBrands(query = {}, auth2 = SERVICE16) {
|
|
4113
4567
|
return this.ctx.http.request({
|
|
4114
4568
|
method: "GET",
|
|
4115
4569
|
path: this.base(),
|
|
@@ -4118,7 +4572,7 @@ var BrandService = class {
|
|
|
4118
4572
|
});
|
|
4119
4573
|
}
|
|
4120
4574
|
/** Retrieve one brand by id. */
|
|
4121
|
-
async getBrand(brandId, auth2 =
|
|
4575
|
+
async getBrand(brandId, auth2 = SERVICE16) {
|
|
4122
4576
|
return this.ctx.http.request({
|
|
4123
4577
|
method: "GET",
|
|
4124
4578
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -4126,7 +4580,7 @@ var BrandService = class {
|
|
|
4126
4580
|
});
|
|
4127
4581
|
}
|
|
4128
4582
|
/** Create a brand. */
|
|
4129
|
-
async createBrand(input, auth2 =
|
|
4583
|
+
async createBrand(input, auth2 = SERVICE16) {
|
|
4130
4584
|
return this.ctx.http.request({
|
|
4131
4585
|
method: "POST",
|
|
4132
4586
|
path: this.base(),
|
|
@@ -4135,7 +4589,7 @@ var BrandService = class {
|
|
|
4135
4589
|
});
|
|
4136
4590
|
}
|
|
4137
4591
|
/** Replace a brand by id. */
|
|
4138
|
-
async updateBrand(brandId, input, auth2 =
|
|
4592
|
+
async updateBrand(brandId, input, auth2 = SERVICE16) {
|
|
4139
4593
|
return this.ctx.http.request({
|
|
4140
4594
|
method: "PUT",
|
|
4141
4595
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -4144,7 +4598,7 @@ var BrandService = class {
|
|
|
4144
4598
|
});
|
|
4145
4599
|
}
|
|
4146
4600
|
/** Partially update a brand by id. */
|
|
4147
|
-
async patchBrand(brandId, patch, auth2 =
|
|
4601
|
+
async patchBrand(brandId, patch, auth2 = SERVICE16) {
|
|
4148
4602
|
return this.ctx.http.request({
|
|
4149
4603
|
method: "PATCH",
|
|
4150
4604
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -4153,7 +4607,7 @@ var BrandService = class {
|
|
|
4153
4607
|
});
|
|
4154
4608
|
}
|
|
4155
4609
|
/** Delete a brand by id. */
|
|
4156
|
-
async deleteBrand(brandId, auth2 =
|
|
4610
|
+
async deleteBrand(brandId, auth2 = SERVICE16) {
|
|
4157
4611
|
await this.ctx.http.request({
|
|
4158
4612
|
method: "DELETE",
|
|
4159
4613
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -4163,7 +4617,7 @@ var BrandService = class {
|
|
|
4163
4617
|
};
|
|
4164
4618
|
|
|
4165
4619
|
// src/services/label.ts
|
|
4166
|
-
var
|
|
4620
|
+
var SERVICE17 = { kind: "service" };
|
|
4167
4621
|
var LabelService = class {
|
|
4168
4622
|
constructor(ctx) {
|
|
4169
4623
|
this.ctx = ctx;
|
|
@@ -4174,7 +4628,7 @@ var LabelService = class {
|
|
|
4174
4628
|
return `/label/labels`;
|
|
4175
4629
|
}
|
|
4176
4630
|
/** List all labels. */
|
|
4177
|
-
async listLabels(query = {}, auth2 =
|
|
4631
|
+
async listLabels(query = {}, auth2 = SERVICE17) {
|
|
4178
4632
|
return this.ctx.http.request({
|
|
4179
4633
|
method: "GET",
|
|
4180
4634
|
path: this.base(),
|
|
@@ -4183,7 +4637,7 @@ var LabelService = class {
|
|
|
4183
4637
|
});
|
|
4184
4638
|
}
|
|
4185
4639
|
/** Retrieve one label by id. */
|
|
4186
|
-
async getLabel(labelId, auth2 =
|
|
4640
|
+
async getLabel(labelId, auth2 = SERVICE17) {
|
|
4187
4641
|
return this.ctx.http.request({
|
|
4188
4642
|
method: "GET",
|
|
4189
4643
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4191,7 +4645,7 @@ var LabelService = class {
|
|
|
4191
4645
|
});
|
|
4192
4646
|
}
|
|
4193
4647
|
/** Create a label. */
|
|
4194
|
-
async createLabel(input, auth2 =
|
|
4648
|
+
async createLabel(input, auth2 = SERVICE17) {
|
|
4195
4649
|
return this.ctx.http.request({
|
|
4196
4650
|
method: "POST",
|
|
4197
4651
|
path: this.base(),
|
|
@@ -4200,7 +4654,7 @@ var LabelService = class {
|
|
|
4200
4654
|
});
|
|
4201
4655
|
}
|
|
4202
4656
|
/** Replace a label by id. */
|
|
4203
|
-
async updateLabel(labelId, input, auth2 =
|
|
4657
|
+
async updateLabel(labelId, input, auth2 = SERVICE17) {
|
|
4204
4658
|
return this.ctx.http.request({
|
|
4205
4659
|
method: "PUT",
|
|
4206
4660
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4209,7 +4663,7 @@ var LabelService = class {
|
|
|
4209
4663
|
});
|
|
4210
4664
|
}
|
|
4211
4665
|
/** Partially update a label by id. */
|
|
4212
|
-
async patchLabel(labelId, patch, auth2 =
|
|
4666
|
+
async patchLabel(labelId, patch, auth2 = SERVICE17) {
|
|
4213
4667
|
return this.ctx.http.request({
|
|
4214
4668
|
method: "PATCH",
|
|
4215
4669
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4218,7 +4672,7 @@ var LabelService = class {
|
|
|
4218
4672
|
});
|
|
4219
4673
|
}
|
|
4220
4674
|
/** Delete a label by id. */
|
|
4221
|
-
async deleteLabel(labelId, auth2 =
|
|
4675
|
+
async deleteLabel(labelId, auth2 = SERVICE17) {
|
|
4222
4676
|
await this.ctx.http.request({
|
|
4223
4677
|
method: "DELETE",
|
|
4224
4678
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4228,7 +4682,7 @@ var LabelService = class {
|
|
|
4228
4682
|
};
|
|
4229
4683
|
|
|
4230
4684
|
// src/services/country.ts
|
|
4231
|
-
var
|
|
4685
|
+
var SERVICE18 = { kind: "service" };
|
|
4232
4686
|
var CountryService = class {
|
|
4233
4687
|
constructor(ctx) {
|
|
4234
4688
|
this.ctx = ctx;
|
|
@@ -4239,7 +4693,7 @@ var CountryService = class {
|
|
|
4239
4693
|
return `/country/${this.ctx.tenant}`;
|
|
4240
4694
|
}
|
|
4241
4695
|
/** List all countries. */
|
|
4242
|
-
async listCountries(query = {}, auth2 =
|
|
4696
|
+
async listCountries(query = {}, auth2 = SERVICE18) {
|
|
4243
4697
|
return this.ctx.http.request({
|
|
4244
4698
|
method: "GET",
|
|
4245
4699
|
path: `${this.base()}/countries`,
|
|
@@ -4248,7 +4702,7 @@ var CountryService = class {
|
|
|
4248
4702
|
});
|
|
4249
4703
|
}
|
|
4250
4704
|
/** Retrieve one country by code. */
|
|
4251
|
-
async getCountry(countryCode, auth2 =
|
|
4705
|
+
async getCountry(countryCode, auth2 = SERVICE18) {
|
|
4252
4706
|
return this.ctx.http.request({
|
|
4253
4707
|
method: "GET",
|
|
4254
4708
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -4256,7 +4710,7 @@ var CountryService = class {
|
|
|
4256
4710
|
});
|
|
4257
4711
|
}
|
|
4258
4712
|
/** Partially update a country by code. Resolves once accepted (no response body). */
|
|
4259
|
-
async patchCountry(countryCode, patch, auth2 =
|
|
4713
|
+
async patchCountry(countryCode, patch, auth2 = SERVICE18) {
|
|
4260
4714
|
await this.ctx.http.request({
|
|
4261
4715
|
method: "PATCH",
|
|
4262
4716
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -4265,7 +4719,7 @@ var CountryService = class {
|
|
|
4265
4719
|
});
|
|
4266
4720
|
}
|
|
4267
4721
|
/** List all regions. */
|
|
4268
|
-
async listRegions(query = {}, auth2 =
|
|
4722
|
+
async listRegions(query = {}, auth2 = SERVICE18) {
|
|
4269
4723
|
return this.ctx.http.request({
|
|
4270
4724
|
method: "GET",
|
|
4271
4725
|
path: `${this.base()}/regions`,
|
|
@@ -4274,7 +4728,7 @@ var CountryService = class {
|
|
|
4274
4728
|
});
|
|
4275
4729
|
}
|
|
4276
4730
|
/** Retrieve one region by code. */
|
|
4277
|
-
async getRegion(regionCode, auth2 =
|
|
4731
|
+
async getRegion(regionCode, auth2 = SERVICE18) {
|
|
4278
4732
|
return this.ctx.http.request({
|
|
4279
4733
|
method: "GET",
|
|
4280
4734
|
path: `${this.base()}/regions/${encodeURIComponent(regionCode)}`,
|
|
@@ -4284,7 +4738,7 @@ var CountryService = class {
|
|
|
4284
4738
|
};
|
|
4285
4739
|
|
|
4286
4740
|
// src/services/currency.ts
|
|
4287
|
-
var
|
|
4741
|
+
var SERVICE19 = { kind: "service" };
|
|
4288
4742
|
var CurrencyService = class {
|
|
4289
4743
|
constructor(ctx) {
|
|
4290
4744
|
this.ctx = ctx;
|
|
@@ -4296,7 +4750,7 @@ var CurrencyService = class {
|
|
|
4296
4750
|
}
|
|
4297
4751
|
// --- Currencies ---
|
|
4298
4752
|
/** List all currencies. */
|
|
4299
|
-
async listCurrencies(query = {}, auth2 =
|
|
4753
|
+
async listCurrencies(query = {}, auth2 = SERVICE19) {
|
|
4300
4754
|
return this.ctx.http.request({
|
|
4301
4755
|
method: "GET",
|
|
4302
4756
|
path: `${this.base()}/currencies`,
|
|
@@ -4305,7 +4759,7 @@ var CurrencyService = class {
|
|
|
4305
4759
|
});
|
|
4306
4760
|
}
|
|
4307
4761
|
/** Retrieve one currency by code. */
|
|
4308
|
-
async getCurrency(code, auth2 =
|
|
4762
|
+
async getCurrency(code, auth2 = SERVICE19) {
|
|
4309
4763
|
return this.ctx.http.request({
|
|
4310
4764
|
method: "GET",
|
|
4311
4765
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4313,7 +4767,7 @@ var CurrencyService = class {
|
|
|
4313
4767
|
});
|
|
4314
4768
|
}
|
|
4315
4769
|
/** Create a currency. */
|
|
4316
|
-
async createCurrency(input, auth2 =
|
|
4770
|
+
async createCurrency(input, auth2 = SERVICE19) {
|
|
4317
4771
|
return this.ctx.http.request({
|
|
4318
4772
|
method: "POST",
|
|
4319
4773
|
path: `${this.base()}/currencies`,
|
|
@@ -4322,7 +4776,7 @@ var CurrencyService = class {
|
|
|
4322
4776
|
});
|
|
4323
4777
|
}
|
|
4324
4778
|
/** Update a currency by code. */
|
|
4325
|
-
async updateCurrency(code, input, auth2 =
|
|
4779
|
+
async updateCurrency(code, input, auth2 = SERVICE19) {
|
|
4326
4780
|
return this.ctx.http.request({
|
|
4327
4781
|
method: "PUT",
|
|
4328
4782
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4331,7 +4785,7 @@ var CurrencyService = class {
|
|
|
4331
4785
|
});
|
|
4332
4786
|
}
|
|
4333
4787
|
/** Delete a currency by code. */
|
|
4334
|
-
async deleteCurrency(code, auth2 =
|
|
4788
|
+
async deleteCurrency(code, auth2 = SERVICE19) {
|
|
4335
4789
|
await this.ctx.http.request({
|
|
4336
4790
|
method: "DELETE",
|
|
4337
4791
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4340,7 +4794,7 @@ var CurrencyService = class {
|
|
|
4340
4794
|
}
|
|
4341
4795
|
// --- Exchange rates ---
|
|
4342
4796
|
/** List all exchange rates. */
|
|
4343
|
-
async listExchangeRates(query = {}, auth2 =
|
|
4797
|
+
async listExchangeRates(query = {}, auth2 = SERVICE19) {
|
|
4344
4798
|
return this.ctx.http.request({
|
|
4345
4799
|
method: "GET",
|
|
4346
4800
|
path: `${this.base()}/exchanges`,
|
|
@@ -4349,7 +4803,7 @@ var CurrencyService = class {
|
|
|
4349
4803
|
});
|
|
4350
4804
|
}
|
|
4351
4805
|
/** Retrieve one exchange rate by code. */
|
|
4352
|
-
async getExchangeRate(code, auth2 =
|
|
4806
|
+
async getExchangeRate(code, auth2 = SERVICE19) {
|
|
4353
4807
|
return this.ctx.http.request({
|
|
4354
4808
|
method: "GET",
|
|
4355
4809
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4357,7 +4811,7 @@ var CurrencyService = class {
|
|
|
4357
4811
|
});
|
|
4358
4812
|
}
|
|
4359
4813
|
/** Create an exchange rate. */
|
|
4360
|
-
async createExchangeRate(input, auth2 =
|
|
4814
|
+
async createExchangeRate(input, auth2 = SERVICE19) {
|
|
4361
4815
|
return this.ctx.http.request({
|
|
4362
4816
|
method: "POST",
|
|
4363
4817
|
path: `${this.base()}/exchanges`,
|
|
@@ -4366,7 +4820,7 @@ var CurrencyService = class {
|
|
|
4366
4820
|
});
|
|
4367
4821
|
}
|
|
4368
4822
|
/** Update an exchange rate by code. */
|
|
4369
|
-
async updateExchangeRate(code, input, auth2 =
|
|
4823
|
+
async updateExchangeRate(code, input, auth2 = SERVICE19) {
|
|
4370
4824
|
return this.ctx.http.request({
|
|
4371
4825
|
method: "PUT",
|
|
4372
4826
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4375,7 +4829,7 @@ var CurrencyService = class {
|
|
|
4375
4829
|
});
|
|
4376
4830
|
}
|
|
4377
4831
|
/** Delete an exchange rate by code. */
|
|
4378
|
-
async deleteExchangeRate(code, auth2 =
|
|
4832
|
+
async deleteExchangeRate(code, auth2 = SERVICE19) {
|
|
4379
4833
|
await this.ctx.http.request({
|
|
4380
4834
|
method: "DELETE",
|
|
4381
4835
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4385,7 +4839,7 @@ var CurrencyService = class {
|
|
|
4385
4839
|
};
|
|
4386
4840
|
|
|
4387
4841
|
// src/services/shipping.ts
|
|
4388
|
-
var
|
|
4842
|
+
var SERVICE20 = { kind: "service" };
|
|
4389
4843
|
var ShippingService = class {
|
|
4390
4844
|
constructor(ctx) {
|
|
4391
4845
|
this.ctx = ctx;
|
|
@@ -4400,7 +4854,7 @@ var ShippingService = class {
|
|
|
4400
4854
|
}
|
|
4401
4855
|
// --- Sites ---
|
|
4402
4856
|
/** Find shipping-related sites by postal code (`POST /findSite`). */
|
|
4403
|
-
async findSites(input, auth2 =
|
|
4857
|
+
async findSites(input, auth2 = SERVICE20) {
|
|
4404
4858
|
return this.ctx.http.request({
|
|
4405
4859
|
method: "POST",
|
|
4406
4860
|
path: `${this.base()}/findSite`,
|
|
@@ -4410,7 +4864,7 @@ var ShippingService = class {
|
|
|
4410
4864
|
}
|
|
4411
4865
|
// --- Zones ---
|
|
4412
4866
|
/** List shipping zones for a site. */
|
|
4413
|
-
async listZones(site, query = {}, auth2 =
|
|
4867
|
+
async listZones(site, query = {}, auth2 = SERVICE20) {
|
|
4414
4868
|
return this.ctx.http.request({
|
|
4415
4869
|
method: "GET",
|
|
4416
4870
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -4419,7 +4873,7 @@ var ShippingService = class {
|
|
|
4419
4873
|
});
|
|
4420
4874
|
}
|
|
4421
4875
|
/** Retrieve one shipping zone. */
|
|
4422
|
-
async getZone(site, zoneId, auth2 =
|
|
4876
|
+
async getZone(site, zoneId, auth2 = SERVICE20) {
|
|
4423
4877
|
return this.ctx.http.request({
|
|
4424
4878
|
method: "GET",
|
|
4425
4879
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4427,7 +4881,7 @@ var ShippingService = class {
|
|
|
4427
4881
|
});
|
|
4428
4882
|
}
|
|
4429
4883
|
/** Create a shipping zone. */
|
|
4430
|
-
async createZone(site, zone, auth2 =
|
|
4884
|
+
async createZone(site, zone, auth2 = SERVICE20) {
|
|
4431
4885
|
return this.ctx.http.request({
|
|
4432
4886
|
method: "POST",
|
|
4433
4887
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -4436,7 +4890,7 @@ var ShippingService = class {
|
|
|
4436
4890
|
});
|
|
4437
4891
|
}
|
|
4438
4892
|
/** Replace a shipping zone. */
|
|
4439
|
-
async updateZone(site, zoneId, zone, auth2 =
|
|
4893
|
+
async updateZone(site, zoneId, zone, auth2 = SERVICE20) {
|
|
4440
4894
|
await this.ctx.http.request({
|
|
4441
4895
|
method: "PUT",
|
|
4442
4896
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4445,7 +4899,7 @@ var ShippingService = class {
|
|
|
4445
4899
|
});
|
|
4446
4900
|
}
|
|
4447
4901
|
/** Partially update a shipping zone. */
|
|
4448
|
-
async patchZone(site, zoneId, patch, auth2 =
|
|
4902
|
+
async patchZone(site, zoneId, patch, auth2 = SERVICE20) {
|
|
4449
4903
|
await this.ctx.http.request({
|
|
4450
4904
|
method: "PATCH",
|
|
4451
4905
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4454,7 +4908,7 @@ var ShippingService = class {
|
|
|
4454
4908
|
});
|
|
4455
4909
|
}
|
|
4456
4910
|
/** Delete a shipping zone. */
|
|
4457
|
-
async deleteZone(site, zoneId, auth2 =
|
|
4911
|
+
async deleteZone(site, zoneId, auth2 = SERVICE20) {
|
|
4458
4912
|
await this.ctx.http.request({
|
|
4459
4913
|
method: "DELETE",
|
|
4460
4914
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4463,7 +4917,7 @@ var ShippingService = class {
|
|
|
4463
4917
|
}
|
|
4464
4918
|
// --- Methods (per zone) ---
|
|
4465
4919
|
/** List shipping methods of a zone. */
|
|
4466
|
-
async listMethods(site, zoneId, query = {}, auth2 =
|
|
4920
|
+
async listMethods(site, zoneId, query = {}, auth2 = SERVICE20) {
|
|
4467
4921
|
return this.ctx.http.request({
|
|
4468
4922
|
method: "GET",
|
|
4469
4923
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -4472,7 +4926,7 @@ var ShippingService = class {
|
|
|
4472
4926
|
});
|
|
4473
4927
|
}
|
|
4474
4928
|
/** Retrieve one shipping method. */
|
|
4475
|
-
async getMethod(site, zoneId, methodId, auth2 =
|
|
4929
|
+
async getMethod(site, zoneId, methodId, auth2 = SERVICE20) {
|
|
4476
4930
|
return this.ctx.http.request({
|
|
4477
4931
|
method: "GET",
|
|
4478
4932
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4480,7 +4934,7 @@ var ShippingService = class {
|
|
|
4480
4934
|
});
|
|
4481
4935
|
}
|
|
4482
4936
|
/** Create a shipping method in a zone. */
|
|
4483
|
-
async createMethod(site, zoneId, method, auth2 =
|
|
4937
|
+
async createMethod(site, zoneId, method, auth2 = SERVICE20) {
|
|
4484
4938
|
return this.ctx.http.request({
|
|
4485
4939
|
method: "POST",
|
|
4486
4940
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -4489,7 +4943,7 @@ var ShippingService = class {
|
|
|
4489
4943
|
});
|
|
4490
4944
|
}
|
|
4491
4945
|
/** Replace a shipping method. */
|
|
4492
|
-
async updateMethod(site, zoneId, methodId, method, auth2 =
|
|
4946
|
+
async updateMethod(site, zoneId, methodId, method, auth2 = SERVICE20) {
|
|
4493
4947
|
await this.ctx.http.request({
|
|
4494
4948
|
method: "PUT",
|
|
4495
4949
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4498,7 +4952,7 @@ var ShippingService = class {
|
|
|
4498
4952
|
});
|
|
4499
4953
|
}
|
|
4500
4954
|
/** Partially update a shipping method. */
|
|
4501
|
-
async patchMethod(site, zoneId, methodId, patch, auth2 =
|
|
4955
|
+
async patchMethod(site, zoneId, methodId, patch, auth2 = SERVICE20) {
|
|
4502
4956
|
await this.ctx.http.request({
|
|
4503
4957
|
method: "PATCH",
|
|
4504
4958
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4507,7 +4961,7 @@ var ShippingService = class {
|
|
|
4507
4961
|
});
|
|
4508
4962
|
}
|
|
4509
4963
|
/** Delete a shipping method. */
|
|
4510
|
-
async deleteMethod(site, zoneId, methodId, auth2 =
|
|
4964
|
+
async deleteMethod(site, zoneId, methodId, auth2 = SERVICE20) {
|
|
4511
4965
|
await this.ctx.http.request({
|
|
4512
4966
|
method: "DELETE",
|
|
4513
4967
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4516,7 +4970,7 @@ var ShippingService = class {
|
|
|
4516
4970
|
}
|
|
4517
4971
|
// --- Cost / quote ---
|
|
4518
4972
|
/** Calculate the final shipping cost (`POST /quote`). */
|
|
4519
|
-
async quote(site, input, auth2 =
|
|
4973
|
+
async quote(site, input, auth2 = SERVICE20) {
|
|
4520
4974
|
return this.ctx.http.request({
|
|
4521
4975
|
method: "POST",
|
|
4522
4976
|
path: `${this.siteBase(site)}/quote`,
|
|
@@ -4525,7 +4979,7 @@ var ShippingService = class {
|
|
|
4525
4979
|
});
|
|
4526
4980
|
}
|
|
4527
4981
|
/** Calculate the minimum shipping cost (`POST /quote/minimum`). */
|
|
4528
|
-
async quoteMinimum(site, input, auth2 =
|
|
4982
|
+
async quoteMinimum(site, input, auth2 = SERVICE20) {
|
|
4529
4983
|
return this.ctx.http.request({
|
|
4530
4984
|
method: "POST",
|
|
4531
4985
|
path: `${this.siteBase(site)}/quote/minimum`,
|
|
@@ -4534,7 +4988,7 @@ var ShippingService = class {
|
|
|
4534
4988
|
});
|
|
4535
4989
|
}
|
|
4536
4990
|
/** Calculate the shipping cost for a given slot (`POST /quote/slot`). */
|
|
4537
|
-
async quoteSlot(site, input, auth2 =
|
|
4991
|
+
async quoteSlot(site, input, auth2 = SERVICE20) {
|
|
4538
4992
|
return this.ctx.http.request({
|
|
4539
4993
|
method: "POST",
|
|
4540
4994
|
path: `${this.siteBase(site)}/quote/slot`,
|
|
@@ -4544,7 +4998,7 @@ var ShippingService = class {
|
|
|
4544
4998
|
}
|
|
4545
4999
|
// --- Groups ---
|
|
4546
5000
|
/** List shipping groups for a site. */
|
|
4547
|
-
async listGroups(site, query = {}, auth2 =
|
|
5001
|
+
async listGroups(site, query = {}, auth2 = SERVICE20) {
|
|
4548
5002
|
return this.ctx.http.request({
|
|
4549
5003
|
method: "GET",
|
|
4550
5004
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -4553,7 +5007,7 @@ var ShippingService = class {
|
|
|
4553
5007
|
});
|
|
4554
5008
|
}
|
|
4555
5009
|
/** Retrieve one shipping group. */
|
|
4556
|
-
async getGroup(site, groupId, auth2 =
|
|
5010
|
+
async getGroup(site, groupId, auth2 = SERVICE20) {
|
|
4557
5011
|
return this.ctx.http.request({
|
|
4558
5012
|
method: "GET",
|
|
4559
5013
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4561,7 +5015,7 @@ var ShippingService = class {
|
|
|
4561
5015
|
});
|
|
4562
5016
|
}
|
|
4563
5017
|
/** Create a shipping group. */
|
|
4564
|
-
async createGroup(site, group, auth2 =
|
|
5018
|
+
async createGroup(site, group, auth2 = SERVICE20) {
|
|
4565
5019
|
return this.ctx.http.request({
|
|
4566
5020
|
method: "POST",
|
|
4567
5021
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -4570,7 +5024,7 @@ var ShippingService = class {
|
|
|
4570
5024
|
});
|
|
4571
5025
|
}
|
|
4572
5026
|
/** Replace a shipping group. */
|
|
4573
|
-
async updateGroup(site, groupId, group, auth2 =
|
|
5027
|
+
async updateGroup(site, groupId, group, auth2 = SERVICE20) {
|
|
4574
5028
|
await this.ctx.http.request({
|
|
4575
5029
|
method: "PUT",
|
|
4576
5030
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4579,7 +5033,7 @@ var ShippingService = class {
|
|
|
4579
5033
|
});
|
|
4580
5034
|
}
|
|
4581
5035
|
/** Delete a shipping group. */
|
|
4582
|
-
async deleteGroup(site, groupId, auth2 =
|
|
5036
|
+
async deleteGroup(site, groupId, auth2 = SERVICE20) {
|
|
4583
5037
|
await this.ctx.http.request({
|
|
4584
5038
|
method: "DELETE",
|
|
4585
5039
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4588,7 +5042,7 @@ var ShippingService = class {
|
|
|
4588
5042
|
}
|
|
4589
5043
|
// --- Customer-group relations ---
|
|
4590
5044
|
/** List customer-group relations for a site. */
|
|
4591
|
-
async listCgRelations(site, query = {}, auth2 =
|
|
5045
|
+
async listCgRelations(site, query = {}, auth2 = SERVICE20) {
|
|
4592
5046
|
return this.ctx.http.request({
|
|
4593
5047
|
method: "GET",
|
|
4594
5048
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -4597,7 +5051,7 @@ var ShippingService = class {
|
|
|
4597
5051
|
});
|
|
4598
5052
|
}
|
|
4599
5053
|
/** Retrieve a customer's customer-group relations. */
|
|
4600
|
-
async getCgRelations(site, customerId, auth2 =
|
|
5054
|
+
async getCgRelations(site, customerId, auth2 = SERVICE20) {
|
|
4601
5055
|
return this.ctx.http.request({
|
|
4602
5056
|
method: "GET",
|
|
4603
5057
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4605,7 +5059,7 @@ var ShippingService = class {
|
|
|
4605
5059
|
});
|
|
4606
5060
|
}
|
|
4607
5061
|
/** Create a customer-group relation. */
|
|
4608
|
-
async createCgRelation(site, relation, auth2 =
|
|
5062
|
+
async createCgRelation(site, relation, auth2 = SERVICE20) {
|
|
4609
5063
|
return this.ctx.http.request({
|
|
4610
5064
|
method: "POST",
|
|
4611
5065
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -4614,7 +5068,7 @@ var ShippingService = class {
|
|
|
4614
5068
|
});
|
|
4615
5069
|
}
|
|
4616
5070
|
/** Update a customer's customer-group relations. */
|
|
4617
|
-
async updateCgRelations(site, customerId, relation, auth2 =
|
|
5071
|
+
async updateCgRelations(site, customerId, relation, auth2 = SERVICE20) {
|
|
4618
5072
|
await this.ctx.http.request({
|
|
4619
5073
|
method: "PUT",
|
|
4620
5074
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4623,7 +5077,7 @@ var ShippingService = class {
|
|
|
4623
5077
|
});
|
|
4624
5078
|
}
|
|
4625
5079
|
/** Delete a customer's customer-group relation. */
|
|
4626
|
-
async deleteCgRelation(site, customerId, auth2 =
|
|
5080
|
+
async deleteCgRelation(site, customerId, auth2 = SERVICE20) {
|
|
4627
5081
|
await this.ctx.http.request({
|
|
4628
5082
|
method: "DELETE",
|
|
4629
5083
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4632,7 +5086,7 @@ var ShippingService = class {
|
|
|
4632
5086
|
}
|
|
4633
5087
|
// --- Phase 2: delivery windows ---
|
|
4634
5088
|
/** Retrieve delivery windows for a delivery area + cart. */
|
|
4635
|
-
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 =
|
|
5089
|
+
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 = SERVICE20) {
|
|
4636
5090
|
return this.ctx.http.request({
|
|
4637
5091
|
method: "GET",
|
|
4638
5092
|
path: `${this.base()}/areaDeliveryTimes/${encodeURIComponent(deliveryAreaId)}/${encodeURIComponent(cartId)}`,
|
|
@@ -4640,7 +5094,7 @@ var ShippingService = class {
|
|
|
4640
5094
|
});
|
|
4641
5095
|
}
|
|
4642
5096
|
/** Retrieve delivery windows for a cart. */
|
|
4643
|
-
async getCartDeliveryWindows(cartId, auth2 =
|
|
5097
|
+
async getCartDeliveryWindows(cartId, auth2 = SERVICE20) {
|
|
4644
5098
|
return this.ctx.http.request({
|
|
4645
5099
|
method: "GET",
|
|
4646
5100
|
path: `${this.base()}/actualDeliveryWindows/${encodeURIComponent(cartId)}`,
|
|
@@ -4648,7 +5102,7 @@ var ShippingService = class {
|
|
|
4648
5102
|
});
|
|
4649
5103
|
}
|
|
4650
5104
|
/** Increment the delivery-window counter. */
|
|
4651
|
-
async incrementDeliveryWindowCounter(input, auth2 =
|
|
5105
|
+
async incrementDeliveryWindowCounter(input, auth2 = SERVICE20) {
|
|
4652
5106
|
await this.ctx.http.request({
|
|
4653
5107
|
method: "POST",
|
|
4654
5108
|
path: `${this.base()}/actualDeliveryWindows/incrementCounter`,
|
|
@@ -4657,7 +5111,7 @@ var ShippingService = class {
|
|
|
4657
5111
|
});
|
|
4658
5112
|
}
|
|
4659
5113
|
/** Validate a delivery window. Resolves when valid; throws otherwise. */
|
|
4660
|
-
async validateDeliveryWindow(input, auth2 =
|
|
5114
|
+
async validateDeliveryWindow(input, auth2 = SERVICE20) {
|
|
4661
5115
|
await this.ctx.http.request({
|
|
4662
5116
|
method: "POST",
|
|
4663
5117
|
path: `${this.base()}/deliveryWindowValidation`,
|
|
@@ -4667,7 +5121,7 @@ var ShippingService = class {
|
|
|
4667
5121
|
}
|
|
4668
5122
|
// --- Phase 2: delivery times ---
|
|
4669
5123
|
/** List all delivery times. */
|
|
4670
|
-
async listDeliveryTimes(query = {}, auth2 =
|
|
5124
|
+
async listDeliveryTimes(query = {}, auth2 = SERVICE20) {
|
|
4671
5125
|
return this.ctx.http.request({
|
|
4672
5126
|
method: "GET",
|
|
4673
5127
|
path: `${this.base()}/delivery-times`,
|
|
@@ -4676,7 +5130,7 @@ var ShippingService = class {
|
|
|
4676
5130
|
});
|
|
4677
5131
|
}
|
|
4678
5132
|
/** Retrieve one delivery time. */
|
|
4679
|
-
async getDeliveryTime(deliveryTimeId, auth2 =
|
|
5133
|
+
async getDeliveryTime(deliveryTimeId, auth2 = SERVICE20) {
|
|
4680
5134
|
return this.ctx.http.request({
|
|
4681
5135
|
method: "GET",
|
|
4682
5136
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4684,7 +5138,7 @@ var ShippingService = class {
|
|
|
4684
5138
|
});
|
|
4685
5139
|
}
|
|
4686
5140
|
/** Create a delivery time. */
|
|
4687
|
-
async createDeliveryTime(input, auth2 =
|
|
5141
|
+
async createDeliveryTime(input, auth2 = SERVICE20) {
|
|
4688
5142
|
return this.ctx.http.request({
|
|
4689
5143
|
method: "POST",
|
|
4690
5144
|
path: `${this.base()}/delivery-times`,
|
|
@@ -4693,7 +5147,7 @@ var ShippingService = class {
|
|
|
4693
5147
|
});
|
|
4694
5148
|
}
|
|
4695
5149
|
/** Create multiple delivery times (`POST /delivery-times/bulk`). */
|
|
4696
|
-
async createDeliveryTimesBulk(inputs, auth2 =
|
|
5150
|
+
async createDeliveryTimesBulk(inputs, auth2 = SERVICE20) {
|
|
4697
5151
|
return this.ctx.http.request({
|
|
4698
5152
|
method: "POST",
|
|
4699
5153
|
path: `${this.base()}/delivery-times/bulk`,
|
|
@@ -4702,7 +5156,7 @@ var ShippingService = class {
|
|
|
4702
5156
|
});
|
|
4703
5157
|
}
|
|
4704
5158
|
/** Replace a delivery time. */
|
|
4705
|
-
async updateDeliveryTime(deliveryTimeId, input, auth2 =
|
|
5159
|
+
async updateDeliveryTime(deliveryTimeId, input, auth2 = SERVICE20) {
|
|
4706
5160
|
await this.ctx.http.request({
|
|
4707
5161
|
method: "PUT",
|
|
4708
5162
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4711,7 +5165,7 @@ var ShippingService = class {
|
|
|
4711
5165
|
});
|
|
4712
5166
|
}
|
|
4713
5167
|
/** Partially update a delivery time (JSON-Patch op array). */
|
|
4714
|
-
async patchDeliveryTime(deliveryTimeId, ops, auth2 =
|
|
5168
|
+
async patchDeliveryTime(deliveryTimeId, ops, auth2 = SERVICE20) {
|
|
4715
5169
|
await this.ctx.http.request({
|
|
4716
5170
|
method: "PATCH",
|
|
4717
5171
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4720,7 +5174,7 @@ var ShippingService = class {
|
|
|
4720
5174
|
});
|
|
4721
5175
|
}
|
|
4722
5176
|
/** Delete a delivery time. */
|
|
4723
|
-
async deleteDeliveryTime(deliveryTimeId, auth2 =
|
|
5177
|
+
async deleteDeliveryTime(deliveryTimeId, auth2 = SERVICE20) {
|
|
4724
5178
|
await this.ctx.http.request({
|
|
4725
5179
|
method: "DELETE",
|
|
4726
5180
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4729,7 +5183,7 @@ var ShippingService = class {
|
|
|
4729
5183
|
}
|
|
4730
5184
|
// --- Phase 2: delivery time slots ---
|
|
4731
5185
|
/** List slots of a delivery time. */
|
|
4732
|
-
async listSlots(deliveryTimeId, auth2 =
|
|
5186
|
+
async listSlots(deliveryTimeId, auth2 = SERVICE20) {
|
|
4733
5187
|
return this.ctx.http.request({
|
|
4734
5188
|
method: "GET",
|
|
4735
5189
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4737,7 +5191,7 @@ var ShippingService = class {
|
|
|
4737
5191
|
});
|
|
4738
5192
|
}
|
|
4739
5193
|
/** Retrieve one slot. */
|
|
4740
|
-
async getSlot(deliveryTimeId, slotId, auth2 =
|
|
5194
|
+
async getSlot(deliveryTimeId, slotId, auth2 = SERVICE20) {
|
|
4741
5195
|
return this.ctx.http.request({
|
|
4742
5196
|
method: "GET",
|
|
4743
5197
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4745,7 +5199,7 @@ var ShippingService = class {
|
|
|
4745
5199
|
});
|
|
4746
5200
|
}
|
|
4747
5201
|
/** Create a slot in a delivery time. */
|
|
4748
|
-
async createSlot(deliveryTimeId, input, auth2 =
|
|
5202
|
+
async createSlot(deliveryTimeId, input, auth2 = SERVICE20) {
|
|
4749
5203
|
return this.ctx.http.request({
|
|
4750
5204
|
method: "POST",
|
|
4751
5205
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4754,7 +5208,7 @@ var ShippingService = class {
|
|
|
4754
5208
|
});
|
|
4755
5209
|
}
|
|
4756
5210
|
/** Replace a slot. */
|
|
4757
|
-
async updateSlot(deliveryTimeId, slotId, input, auth2 =
|
|
5211
|
+
async updateSlot(deliveryTimeId, slotId, input, auth2 = SERVICE20) {
|
|
4758
5212
|
await this.ctx.http.request({
|
|
4759
5213
|
method: "PUT",
|
|
4760
5214
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4763,7 +5217,7 @@ var ShippingService = class {
|
|
|
4763
5217
|
});
|
|
4764
5218
|
}
|
|
4765
5219
|
/** Partially update a slot (JSON-Patch op array). */
|
|
4766
|
-
async patchSlot(deliveryTimeId, slotId, ops, auth2 =
|
|
5220
|
+
async patchSlot(deliveryTimeId, slotId, ops, auth2 = SERVICE20) {
|
|
4767
5221
|
await this.ctx.http.request({
|
|
4768
5222
|
method: "PATCH",
|
|
4769
5223
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4772,7 +5226,7 @@ var ShippingService = class {
|
|
|
4772
5226
|
});
|
|
4773
5227
|
}
|
|
4774
5228
|
/** Delete a slot. */
|
|
4775
|
-
async deleteSlot(deliveryTimeId, slotId, auth2 =
|
|
5229
|
+
async deleteSlot(deliveryTimeId, slotId, auth2 = SERVICE20) {
|
|
4776
5230
|
await this.ctx.http.request({
|
|
4777
5231
|
method: "DELETE",
|
|
4778
5232
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4780,7 +5234,7 @@ var ShippingService = class {
|
|
|
4780
5234
|
});
|
|
4781
5235
|
}
|
|
4782
5236
|
/** Delete all slots of a delivery time. */
|
|
4783
|
-
async deleteAllSlots(deliveryTimeId, auth2 =
|
|
5237
|
+
async deleteAllSlots(deliveryTimeId, auth2 = SERVICE20) {
|
|
4784
5238
|
await this.ctx.http.request({
|
|
4785
5239
|
method: "DELETE",
|
|
4786
5240
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4789,7 +5243,7 @@ var ShippingService = class {
|
|
|
4789
5243
|
}
|
|
4790
5244
|
// --- Phase 2: delivery cycles ---
|
|
4791
5245
|
/** Generate a delivery cycle (`POST /delivery-cycles/generate`). Returns the cycle id. */
|
|
4792
|
-
async generateDeliveryCycle(input, auth2 =
|
|
5246
|
+
async generateDeliveryCycle(input, auth2 = SERVICE20) {
|
|
4793
5247
|
return this.ctx.http.request({
|
|
4794
5248
|
method: "POST",
|
|
4795
5249
|
path: `${this.base()}/delivery-cycles/generate`,
|
|
@@ -4799,8 +5253,183 @@ var ShippingService = class {
|
|
|
4799
5253
|
}
|
|
4800
5254
|
};
|
|
4801
5255
|
|
|
5256
|
+
// src/services/invoice.ts
|
|
5257
|
+
var SERVICE21 = { kind: "service" };
|
|
5258
|
+
var InvoiceService = class {
|
|
5259
|
+
constructor(ctx) {
|
|
5260
|
+
this.ctx = ctx;
|
|
5261
|
+
}
|
|
5262
|
+
ctx;
|
|
5263
|
+
static channel = "invoice";
|
|
5264
|
+
base() {
|
|
5265
|
+
return `/invoice/${this.ctx.tenant}/jobs/invoices`;
|
|
5266
|
+
}
|
|
5267
|
+
/** Create an invoice-generation job (`POST …/jobs/invoices`, 201). */
|
|
5268
|
+
async createJob(draft, auth2 = SERVICE21) {
|
|
5269
|
+
return this.ctx.http.request({
|
|
5270
|
+
method: "POST",
|
|
5271
|
+
path: this.base(),
|
|
5272
|
+
auth: auth2,
|
|
5273
|
+
body: draft
|
|
5274
|
+
});
|
|
5275
|
+
}
|
|
5276
|
+
/** Retrieve a job and its per-order results (`GET …/jobs/invoices/{jobId}`). */
|
|
5277
|
+
async getJob(jobId, auth2 = SERVICE21) {
|
|
5278
|
+
return this.ctx.http.request({
|
|
5279
|
+
method: "GET",
|
|
5280
|
+
path: `${this.base()}/${encodeURIComponent(jobId)}`,
|
|
5281
|
+
auth: auth2
|
|
5282
|
+
});
|
|
5283
|
+
}
|
|
5284
|
+
};
|
|
5285
|
+
|
|
5286
|
+
// src/services/quote.ts
|
|
5287
|
+
var QuoteService = class {
|
|
5288
|
+
constructor(ctx) {
|
|
5289
|
+
this.ctx = ctx;
|
|
5290
|
+
}
|
|
5291
|
+
ctx;
|
|
5292
|
+
static channel = "quote";
|
|
5293
|
+
quotesBase() {
|
|
5294
|
+
return `/quote/${this.ctx.tenant}/quotes`;
|
|
5295
|
+
}
|
|
5296
|
+
_reasons;
|
|
5297
|
+
/** Quote reasons config (`/quote-reasons`). CRUD sub-resource. */
|
|
5298
|
+
get reasons() {
|
|
5299
|
+
return this._reasons ??= new QuoteReasonsResource(this.ctx);
|
|
5300
|
+
}
|
|
5301
|
+
/** List quotes, wrapped in {@link PaginatedItems}. Pass `{}` for no filter. */
|
|
5302
|
+
async list(query, auth2) {
|
|
5303
|
+
const pageNumber = query.pageNumber ?? 1;
|
|
5304
|
+
const pageSize = query.pageSize ?? 60;
|
|
5305
|
+
const q = { pageNumber, pageSize };
|
|
5306
|
+
if (query.q) q.q = query.q;
|
|
5307
|
+
if (query.sort) q.sort = query.sort;
|
|
5308
|
+
const items = await this.ctx.http.request({
|
|
5309
|
+
method: "GET",
|
|
5310
|
+
path: this.quotesBase(),
|
|
5311
|
+
auth: auth2,
|
|
5312
|
+
query: q
|
|
5313
|
+
});
|
|
5314
|
+
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
5315
|
+
}
|
|
5316
|
+
/** Create a quote (`POST /quotes`, 201). */
|
|
5317
|
+
async create(draft, auth2) {
|
|
5318
|
+
return this.ctx.http.request({
|
|
5319
|
+
method: "POST",
|
|
5320
|
+
path: this.quotesBase(),
|
|
5321
|
+
auth: auth2,
|
|
5322
|
+
body: draft
|
|
5323
|
+
});
|
|
5324
|
+
}
|
|
5325
|
+
/** Retrieve one quote by id. */
|
|
5326
|
+
async get(quoteId, auth2) {
|
|
5327
|
+
return this.ctx.http.request({
|
|
5328
|
+
method: "GET",
|
|
5329
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}`,
|
|
5330
|
+
auth: auth2
|
|
5331
|
+
});
|
|
5332
|
+
}
|
|
5333
|
+
/** Apply an update-op array to a quote (`PATCH /quotes/{id}`, 204). */
|
|
5334
|
+
async update(quoteId, update, auth2) {
|
|
5335
|
+
await this.ctx.http.request({
|
|
5336
|
+
method: "PATCH",
|
|
5337
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}`,
|
|
5338
|
+
auth: auth2,
|
|
5339
|
+
body: update
|
|
5340
|
+
});
|
|
5341
|
+
}
|
|
5342
|
+
/** Delete a quote (`DELETE /quotes/{id}`). Requires the admin `quote_manage` scope. */
|
|
5343
|
+
async delete(quoteId, auth2) {
|
|
5344
|
+
await this.ctx.http.request({
|
|
5345
|
+
method: "DELETE",
|
|
5346
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}`,
|
|
5347
|
+
auth: auth2
|
|
5348
|
+
});
|
|
5349
|
+
}
|
|
5350
|
+
/** Retrieve a quote's change history (`GET /quotes/{id}/history`). */
|
|
5351
|
+
async history(quoteId, auth2) {
|
|
5352
|
+
return this.ctx.http.request({
|
|
5353
|
+
method: "GET",
|
|
5354
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}/history`,
|
|
5355
|
+
auth: auth2
|
|
5356
|
+
});
|
|
5357
|
+
}
|
|
5358
|
+
/**
|
|
5359
|
+
* Generate a quote PDF (`POST /quotes/{id}/pdf`). Returns the raw PDF bytes.
|
|
5360
|
+
* Uses `requestRaw` (no typed-error mapping) — a non-2xx is thrown explicitly.
|
|
5361
|
+
*/
|
|
5362
|
+
async generatePdf(quoteId, auth2) {
|
|
5363
|
+
const path = `${this.quotesBase()}/${encodeURIComponent(quoteId)}/pdf`;
|
|
5364
|
+
const res = await this.ctx.http.requestRaw({ method: "POST", path, auth: auth2 });
|
|
5365
|
+
if (!res.ok) {
|
|
5366
|
+
const body = await res.text();
|
|
5367
|
+
throw errorFromResponse(res.status, `POST ${path} failed: ${res.status}`, body);
|
|
5368
|
+
}
|
|
5369
|
+
return await res.blob();
|
|
5370
|
+
}
|
|
5371
|
+
};
|
|
5372
|
+
var QuoteReasonsResource = class {
|
|
5373
|
+
constructor(ctx) {
|
|
5374
|
+
this.ctx = ctx;
|
|
5375
|
+
}
|
|
5376
|
+
ctx;
|
|
5377
|
+
base() {
|
|
5378
|
+
return `/quote/${this.ctx.tenant}/quote-reasons`;
|
|
5379
|
+
}
|
|
5380
|
+
/** List reasons, wrapped in {@link PaginatedItems}. Pass `{}` for no paging override. */
|
|
5381
|
+
async list(query, auth2) {
|
|
5382
|
+
const pageNumber = query.pageNumber ?? 1;
|
|
5383
|
+
const pageSize = query.pageSize ?? 60;
|
|
5384
|
+
const items = await this.ctx.http.request({
|
|
5385
|
+
method: "GET",
|
|
5386
|
+
path: this.base(),
|
|
5387
|
+
auth: auth2,
|
|
5388
|
+
query: { pageNumber, pageSize }
|
|
5389
|
+
});
|
|
5390
|
+
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
5391
|
+
}
|
|
5392
|
+
/** Retrieve one reason by id. */
|
|
5393
|
+
async get(reasonId, auth2) {
|
|
5394
|
+
return this.ctx.http.request({
|
|
5395
|
+
method: "GET",
|
|
5396
|
+
path: `${this.base()}/${encodeURIComponent(reasonId)}`,
|
|
5397
|
+
auth: auth2
|
|
5398
|
+
});
|
|
5399
|
+
}
|
|
5400
|
+
/** Create a reason (`POST /quote-reasons`). Requires the admin `quote_manage` scope. */
|
|
5401
|
+
async create(draft, auth2) {
|
|
5402
|
+
return this.ctx.http.request({
|
|
5403
|
+
method: "POST",
|
|
5404
|
+
path: this.base(),
|
|
5405
|
+
auth: auth2,
|
|
5406
|
+
body: draft
|
|
5407
|
+
});
|
|
5408
|
+
}
|
|
5409
|
+
/**
|
|
5410
|
+
* Replace a reason (`PUT /quote-reasons/{id}`, 204). `draft.metadata.version`
|
|
5411
|
+
* is required for optimistic locking. Requires the admin `quote_manage` scope.
|
|
5412
|
+
*/
|
|
5413
|
+
async update(reasonId, draft, auth2) {
|
|
5414
|
+
await this.ctx.http.request({
|
|
5415
|
+
method: "PUT",
|
|
5416
|
+
path: `${this.base()}/${encodeURIComponent(reasonId)}`,
|
|
5417
|
+
auth: auth2,
|
|
5418
|
+
body: draft
|
|
5419
|
+
});
|
|
5420
|
+
}
|
|
5421
|
+
/** Delete a reason (`DELETE /quote-reasons/{id}`). Requires the admin `quote_manage` scope. */
|
|
5422
|
+
async delete(reasonId, auth2) {
|
|
5423
|
+
await this.ctx.http.request({
|
|
5424
|
+
method: "DELETE",
|
|
5425
|
+
path: `${this.base()}/${encodeURIComponent(reasonId)}`,
|
|
5426
|
+
auth: auth2
|
|
5427
|
+
});
|
|
5428
|
+
}
|
|
5429
|
+
};
|
|
5430
|
+
|
|
4802
5431
|
// src/services/returns.ts
|
|
4803
|
-
var
|
|
5432
|
+
var SERVICE22 = { kind: "service" };
|
|
4804
5433
|
var ReturnsService = class {
|
|
4805
5434
|
constructor(ctx) {
|
|
4806
5435
|
this.ctx = ctx;
|
|
@@ -4811,7 +5440,7 @@ var ReturnsService = class {
|
|
|
4811
5440
|
return `/return/${this.ctx.tenant}/returns`;
|
|
4812
5441
|
}
|
|
4813
5442
|
/** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
|
|
4814
|
-
async listReturns(query = {}, auth2 =
|
|
5443
|
+
async listReturns(query = {}, auth2 = SERVICE22) {
|
|
4815
5444
|
return this.ctx.http.request({
|
|
4816
5445
|
method: "GET",
|
|
4817
5446
|
path: this.base(),
|
|
@@ -4820,7 +5449,7 @@ var ReturnsService = class {
|
|
|
4820
5449
|
});
|
|
4821
5450
|
}
|
|
4822
5451
|
/** Retrieve one return by id. */
|
|
4823
|
-
async getReturn(returnId, auth2 =
|
|
5452
|
+
async getReturn(returnId, auth2 = SERVICE22) {
|
|
4824
5453
|
return this.ctx.http.request({
|
|
4825
5454
|
method: "GET",
|
|
4826
5455
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4828,7 +5457,7 @@ var ReturnsService = class {
|
|
|
4828
5457
|
});
|
|
4829
5458
|
}
|
|
4830
5459
|
/** Create a return. Returns the created `{ id }`. */
|
|
4831
|
-
async createReturn(input, auth2 =
|
|
5460
|
+
async createReturn(input, auth2 = SERVICE22) {
|
|
4832
5461
|
return this.ctx.http.request({
|
|
4833
5462
|
method: "POST",
|
|
4834
5463
|
path: this.base(),
|
|
@@ -4837,7 +5466,7 @@ var ReturnsService = class {
|
|
|
4837
5466
|
});
|
|
4838
5467
|
}
|
|
4839
5468
|
/** Replace a return by id (`PUT`). */
|
|
4840
|
-
async updateReturn(returnId, input, auth2 =
|
|
5469
|
+
async updateReturn(returnId, input, auth2 = SERVICE22) {
|
|
4841
5470
|
await this.ctx.http.request({
|
|
4842
5471
|
method: "PUT",
|
|
4843
5472
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4846,7 +5475,7 @@ var ReturnsService = class {
|
|
|
4846
5475
|
});
|
|
4847
5476
|
}
|
|
4848
5477
|
/** Partially update a return by id (`PATCH`, JSON-Patch op-array). */
|
|
4849
|
-
async patchReturn(returnId, ops, auth2 =
|
|
5478
|
+
async patchReturn(returnId, ops, auth2 = SERVICE22) {
|
|
4850
5479
|
await this.ctx.http.request({
|
|
4851
5480
|
method: "PATCH",
|
|
4852
5481
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4855,7 +5484,7 @@ var ReturnsService = class {
|
|
|
4855
5484
|
});
|
|
4856
5485
|
}
|
|
4857
5486
|
/** Delete a return by id. */
|
|
4858
|
-
async deleteReturn(returnId, auth2 =
|
|
5487
|
+
async deleteReturn(returnId, auth2 = SERVICE22) {
|
|
4859
5488
|
await this.ctx.http.request({
|
|
4860
5489
|
method: "DELETE",
|
|
4861
5490
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4865,7 +5494,7 @@ var ReturnsService = class {
|
|
|
4865
5494
|
};
|
|
4866
5495
|
|
|
4867
5496
|
// src/services/sepa-export.ts
|
|
4868
|
-
var
|
|
5497
|
+
var SERVICE23 = { kind: "service" };
|
|
4869
5498
|
var SepaExportService = class {
|
|
4870
5499
|
constructor(ctx) {
|
|
4871
5500
|
this.ctx = ctx;
|
|
@@ -4876,7 +5505,7 @@ var SepaExportService = class {
|
|
|
4876
5505
|
return `/sepa-export/${this.ctx.tenant}`;
|
|
4877
5506
|
}
|
|
4878
5507
|
/** Retrieve a SEPA export file by id. Returns the raw file content (text). */
|
|
4879
|
-
async getFile(fileId, auth2 =
|
|
5508
|
+
async getFile(fileId, auth2 = SERVICE23) {
|
|
4880
5509
|
const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
|
|
4881
5510
|
const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
|
|
4882
5511
|
if (!res.ok) {
|
|
@@ -4886,7 +5515,7 @@ var SepaExportService = class {
|
|
|
4886
5515
|
return res.text();
|
|
4887
5516
|
}
|
|
4888
5517
|
/** List export jobs. */
|
|
4889
|
-
async listJobs(query = {}, auth2 =
|
|
5518
|
+
async listJobs(query = {}, auth2 = SERVICE23) {
|
|
4890
5519
|
return this.ctx.http.request({
|
|
4891
5520
|
method: "GET",
|
|
4892
5521
|
path: `${this.base()}/jobs`,
|
|
@@ -4895,7 +5524,7 @@ var SepaExportService = class {
|
|
|
4895
5524
|
});
|
|
4896
5525
|
}
|
|
4897
5526
|
/** Create an export job. */
|
|
4898
|
-
async createJob(input, auth2 =
|
|
5527
|
+
async createJob(input, auth2 = SERVICE23) {
|
|
4899
5528
|
return this.ctx.http.request({
|
|
4900
5529
|
method: "POST",
|
|
4901
5530
|
path: `${this.base()}/jobs`,
|
|
@@ -4906,7 +5535,7 @@ var SepaExportService = class {
|
|
|
4906
5535
|
};
|
|
4907
5536
|
|
|
4908
5537
|
// src/services/indexing.ts
|
|
4909
|
-
var
|
|
5538
|
+
var SERVICE24 = { kind: "service" };
|
|
4910
5539
|
var IndexingService = class {
|
|
4911
5540
|
constructor(ctx) {
|
|
4912
5541
|
this.ctx = ctx;
|
|
@@ -4917,11 +5546,11 @@ var IndexingService = class {
|
|
|
4917
5546
|
return `/indexing/${this.ctx.tenant}`;
|
|
4918
5547
|
}
|
|
4919
5548
|
/** List indexing configurations. */
|
|
4920
|
-
async listConfigurations(auth2 =
|
|
5549
|
+
async listConfigurations(auth2 = SERVICE24) {
|
|
4921
5550
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
|
|
4922
5551
|
}
|
|
4923
5552
|
/** Get a configuration by provider name. */
|
|
4924
|
-
async getConfiguration(provider, auth2 =
|
|
5553
|
+
async getConfiguration(provider, auth2 = SERVICE24) {
|
|
4925
5554
|
return this.ctx.http.request({
|
|
4926
5555
|
method: "GET",
|
|
4927
5556
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4929,7 +5558,7 @@ var IndexingService = class {
|
|
|
4929
5558
|
});
|
|
4930
5559
|
}
|
|
4931
5560
|
/** Create a configuration. */
|
|
4932
|
-
async createConfiguration(input, auth2 =
|
|
5561
|
+
async createConfiguration(input, auth2 = SERVICE24) {
|
|
4933
5562
|
return this.ctx.http.request({
|
|
4934
5563
|
method: "POST",
|
|
4935
5564
|
path: `${this.base()}/configurations`,
|
|
@@ -4938,7 +5567,7 @@ var IndexingService = class {
|
|
|
4938
5567
|
});
|
|
4939
5568
|
}
|
|
4940
5569
|
/** Update a configuration by provider name. */
|
|
4941
|
-
async updateConfiguration(provider, input, auth2 =
|
|
5570
|
+
async updateConfiguration(provider, input, auth2 = SERVICE24) {
|
|
4942
5571
|
await this.ctx.http.request({
|
|
4943
5572
|
method: "PUT",
|
|
4944
5573
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4947,7 +5576,7 @@ var IndexingService = class {
|
|
|
4947
5576
|
});
|
|
4948
5577
|
}
|
|
4949
5578
|
/** Delete a configuration by provider name. */
|
|
4950
|
-
async deleteConfiguration(provider, auth2 =
|
|
5579
|
+
async deleteConfiguration(provider, auth2 = SERVICE24) {
|
|
4951
5580
|
await this.ctx.http.request({
|
|
4952
5581
|
method: "DELETE",
|
|
4953
5582
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4955,11 +5584,11 @@ var IndexingService = class {
|
|
|
4955
5584
|
});
|
|
4956
5585
|
}
|
|
4957
5586
|
/** List public indexing configurations. */
|
|
4958
|
-
async listPublicConfigurations(auth2 =
|
|
5587
|
+
async listPublicConfigurations(auth2 = SERVICE24) {
|
|
4959
5588
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
|
|
4960
5589
|
}
|
|
4961
5590
|
/** Get a public configuration by provider name. */
|
|
4962
|
-
async getPublicConfiguration(provider, auth2 =
|
|
5591
|
+
async getPublicConfiguration(provider, auth2 = SERVICE24) {
|
|
4963
5592
|
return this.ctx.http.request({
|
|
4964
5593
|
method: "GET",
|
|
4965
5594
|
path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4972,7 +5601,7 @@ var IndexingService = class {
|
|
|
4972
5601
|
* (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
|
|
4973
5602
|
* `entityType` is already `IN_PROGRESS`, that running job (`200`).
|
|
4974
5603
|
*/
|
|
4975
|
-
async createReindexJob(input, auth2 =
|
|
5604
|
+
async createReindexJob(input, auth2 = SERVICE24) {
|
|
4976
5605
|
return this.ctx.http.request({
|
|
4977
5606
|
method: "POST",
|
|
4978
5607
|
path: `${this.base()}/reindex-jobs`,
|
|
@@ -4981,7 +5610,7 @@ var IndexingService = class {
|
|
|
4981
5610
|
});
|
|
4982
5611
|
}
|
|
4983
5612
|
/** List reindex jobs (paginated). */
|
|
4984
|
-
async listReindexJobs(opts = {}, auth2 =
|
|
5613
|
+
async listReindexJobs(opts = {}, auth2 = SERVICE24) {
|
|
4985
5614
|
const pageNumber = opts.pageNumber ?? 1;
|
|
4986
5615
|
const pageSize = opts.pageSize ?? 50;
|
|
4987
5616
|
const query = { pageNumber, pageSize };
|
|
@@ -4995,7 +5624,7 @@ var IndexingService = class {
|
|
|
4995
5624
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
4996
5625
|
}
|
|
4997
5626
|
/** Fetch one reindex job by id. */
|
|
4998
|
-
async getReindexJob(reindexJobId, auth2 =
|
|
5627
|
+
async getReindexJob(reindexJobId, auth2 = SERVICE24) {
|
|
4999
5628
|
return this.ctx.http.request({
|
|
5000
5629
|
method: "GET",
|
|
5001
5630
|
path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
|
|
@@ -5007,13 +5636,13 @@ var IndexingService = class {
|
|
|
5007
5636
|
* @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
|
|
5008
5637
|
* (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
|
|
5009
5638
|
*/
|
|
5010
|
-
async reindex(input, auth2 =
|
|
5639
|
+
async reindex(input, auth2 = SERVICE24) {
|
|
5011
5640
|
await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
|
|
5012
5641
|
}
|
|
5013
5642
|
};
|
|
5014
5643
|
|
|
5015
5644
|
// src/services/unit-handling.ts
|
|
5016
|
-
var
|
|
5645
|
+
var SERVICE25 = { kind: "service" };
|
|
5017
5646
|
var UnitHandlingService = class {
|
|
5018
5647
|
constructor(ctx) {
|
|
5019
5648
|
this.ctx = ctx;
|
|
@@ -5024,7 +5653,7 @@ var UnitHandlingService = class {
|
|
|
5024
5653
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
5025
5654
|
}
|
|
5026
5655
|
/** Find units (filter/sort/page). */
|
|
5027
|
-
async listUnits(query = {}, auth2 =
|
|
5656
|
+
async listUnits(query = {}, auth2 = SERVICE25) {
|
|
5028
5657
|
return this.ctx.http.request({
|
|
5029
5658
|
method: "GET",
|
|
5030
5659
|
path: `${this.base()}/units`,
|
|
@@ -5033,7 +5662,7 @@ var UnitHandlingService = class {
|
|
|
5033
5662
|
});
|
|
5034
5663
|
}
|
|
5035
5664
|
/** Retrieve a unit by code. */
|
|
5036
|
-
async getUnit(unitCode, auth2 =
|
|
5665
|
+
async getUnit(unitCode, auth2 = SERVICE25) {
|
|
5037
5666
|
return this.ctx.http.request({
|
|
5038
5667
|
method: "GET",
|
|
5039
5668
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -5041,11 +5670,11 @@ var UnitHandlingService = class {
|
|
|
5041
5670
|
});
|
|
5042
5671
|
}
|
|
5043
5672
|
/** Add a new unit. */
|
|
5044
|
-
async createUnit(input, auth2 =
|
|
5673
|
+
async createUnit(input, auth2 = SERVICE25) {
|
|
5045
5674
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
5046
5675
|
}
|
|
5047
5676
|
/** Update a unit by code. */
|
|
5048
|
-
async updateUnit(unitCode, input, auth2 =
|
|
5677
|
+
async updateUnit(unitCode, input, auth2 = SERVICE25) {
|
|
5049
5678
|
await this.ctx.http.request({
|
|
5050
5679
|
method: "PUT",
|
|
5051
5680
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -5054,7 +5683,7 @@ var UnitHandlingService = class {
|
|
|
5054
5683
|
});
|
|
5055
5684
|
}
|
|
5056
5685
|
/** Delete a unit by code. */
|
|
5057
|
-
async deleteUnit(unitCode, auth2 =
|
|
5686
|
+
async deleteUnit(unitCode, auth2 = SERVICE25) {
|
|
5058
5687
|
await this.ctx.http.request({
|
|
5059
5688
|
method: "DELETE",
|
|
5060
5689
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -5062,7 +5691,7 @@ var UnitHandlingService = class {
|
|
|
5062
5691
|
});
|
|
5063
5692
|
}
|
|
5064
5693
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
5065
|
-
async deleteUnits(codes, auth2 =
|
|
5694
|
+
async deleteUnits(codes, auth2 = SERVICE25) {
|
|
5066
5695
|
await this.ctx.http.request({
|
|
5067
5696
|
method: "DELETE",
|
|
5068
5697
|
path: `${this.base()}/units`,
|
|
@@ -5071,7 +5700,7 @@ var UnitHandlingService = class {
|
|
|
5071
5700
|
});
|
|
5072
5701
|
}
|
|
5073
5702
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
5074
|
-
async getConversionFactor(input, auth2 =
|
|
5703
|
+
async getConversionFactor(input, auth2 = SERVICE25) {
|
|
5075
5704
|
return this.ctx.http.request({
|
|
5076
5705
|
method: "PUT",
|
|
5077
5706
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -5080,7 +5709,7 @@ var UnitHandlingService = class {
|
|
|
5080
5709
|
});
|
|
5081
5710
|
}
|
|
5082
5711
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
5083
|
-
async convertUnit(input, auth2 =
|
|
5712
|
+
async convertUnit(input, auth2 = SERVICE25) {
|
|
5084
5713
|
return this.ctx.http.request({
|
|
5085
5714
|
method: "PUT",
|
|
5086
5715
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -5089,13 +5718,13 @@ var UnitHandlingService = class {
|
|
|
5089
5718
|
});
|
|
5090
5719
|
}
|
|
5091
5720
|
/** List all unit types. */
|
|
5092
|
-
async listUnitTypes(auth2 =
|
|
5721
|
+
async listUnitTypes(auth2 = SERVICE25) {
|
|
5093
5722
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
5094
5723
|
}
|
|
5095
5724
|
};
|
|
5096
5725
|
|
|
5097
5726
|
// src/services/catalog.ts
|
|
5098
|
-
var
|
|
5727
|
+
var SERVICE26 = { kind: "service" };
|
|
5099
5728
|
var CatalogService = class {
|
|
5100
5729
|
constructor(ctx) {
|
|
5101
5730
|
this.ctx = ctx;
|
|
@@ -5106,7 +5735,7 @@ var CatalogService = class {
|
|
|
5106
5735
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
5107
5736
|
}
|
|
5108
5737
|
/** List catalogs (filtered/sorted). */
|
|
5109
|
-
async listCatalogs(query = {}, auth2 =
|
|
5738
|
+
async listCatalogs(query = {}, auth2 = SERVICE26) {
|
|
5110
5739
|
return this.ctx.http.request({
|
|
5111
5740
|
method: "GET",
|
|
5112
5741
|
path: this.base(),
|
|
@@ -5115,7 +5744,7 @@ var CatalogService = class {
|
|
|
5115
5744
|
});
|
|
5116
5745
|
}
|
|
5117
5746
|
/** Retrieve a catalog by id. */
|
|
5118
|
-
async getCatalog(catalogId, auth2 =
|
|
5747
|
+
async getCatalog(catalogId, auth2 = SERVICE26) {
|
|
5119
5748
|
return this.ctx.http.request({
|
|
5120
5749
|
method: "GET",
|
|
5121
5750
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -5123,7 +5752,7 @@ var CatalogService = class {
|
|
|
5123
5752
|
});
|
|
5124
5753
|
}
|
|
5125
5754
|
/** Retrieve all catalogs that contain a category. */
|
|
5126
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
5755
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE26) {
|
|
5127
5756
|
return this.ctx.http.request({
|
|
5128
5757
|
method: "GET",
|
|
5129
5758
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -5131,11 +5760,11 @@ var CatalogService = class {
|
|
|
5131
5760
|
});
|
|
5132
5761
|
}
|
|
5133
5762
|
/** Create a catalog. */
|
|
5134
|
-
async createCatalog(input, auth2 =
|
|
5763
|
+
async createCatalog(input, auth2 = SERVICE26) {
|
|
5135
5764
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
5136
5765
|
}
|
|
5137
5766
|
/** Upsert a catalog by id (`PUT`). */
|
|
5138
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
5767
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE26) {
|
|
5139
5768
|
return this.ctx.http.request({
|
|
5140
5769
|
method: "PUT",
|
|
5141
5770
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -5144,7 +5773,7 @@ var CatalogService = class {
|
|
|
5144
5773
|
});
|
|
5145
5774
|
}
|
|
5146
5775
|
/** Partially update a catalog by id (`PATCH`). */
|
|
5147
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
5776
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE26) {
|
|
5148
5777
|
await this.ctx.http.request({
|
|
5149
5778
|
method: "PATCH",
|
|
5150
5779
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -5153,7 +5782,7 @@ var CatalogService = class {
|
|
|
5153
5782
|
});
|
|
5154
5783
|
}
|
|
5155
5784
|
/** Remove a catalog by id. */
|
|
5156
|
-
async deleteCatalog(catalogId, auth2 =
|
|
5785
|
+
async deleteCatalog(catalogId, auth2 = SERVICE26) {
|
|
5157
5786
|
await this.ctx.http.request({
|
|
5158
5787
|
method: "DELETE",
|
|
5159
5788
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -5163,7 +5792,7 @@ var CatalogService = class {
|
|
|
5163
5792
|
};
|
|
5164
5793
|
|
|
5165
5794
|
// src/services/vendor.ts
|
|
5166
|
-
var
|
|
5795
|
+
var SERVICE27 = { kind: "service" };
|
|
5167
5796
|
var VendorService = class {
|
|
5168
5797
|
constructor(ctx) {
|
|
5169
5798
|
this.ctx = ctx;
|
|
@@ -5175,7 +5804,7 @@ var VendorService = class {
|
|
|
5175
5804
|
}
|
|
5176
5805
|
// --- Vendors ---
|
|
5177
5806
|
/** List all vendors. */
|
|
5178
|
-
async listVendors(query = {}, auth2 =
|
|
5807
|
+
async listVendors(query = {}, auth2 = SERVICE27) {
|
|
5179
5808
|
return this.ctx.http.request({
|
|
5180
5809
|
method: "GET",
|
|
5181
5810
|
path: `${this.base()}/vendors`,
|
|
@@ -5184,7 +5813,7 @@ var VendorService = class {
|
|
|
5184
5813
|
});
|
|
5185
5814
|
}
|
|
5186
5815
|
/** Retrieve a vendor by id. */
|
|
5187
|
-
async getVendor(vendorId, auth2 =
|
|
5816
|
+
async getVendor(vendorId, auth2 = SERVICE27) {
|
|
5188
5817
|
return this.ctx.http.request({
|
|
5189
5818
|
method: "GET",
|
|
5190
5819
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5192,7 +5821,7 @@ var VendorService = class {
|
|
|
5192
5821
|
});
|
|
5193
5822
|
}
|
|
5194
5823
|
/** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
|
|
5195
|
-
async searchVendors(query, auth2 =
|
|
5824
|
+
async searchVendors(query, auth2 = SERVICE27) {
|
|
5196
5825
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5197
5826
|
return this.ctx.http.request({
|
|
5198
5827
|
method: "POST",
|
|
@@ -5202,11 +5831,11 @@ var VendorService = class {
|
|
|
5202
5831
|
});
|
|
5203
5832
|
}
|
|
5204
5833
|
/** Create a vendor. */
|
|
5205
|
-
async createVendor(input, auth2 =
|
|
5834
|
+
async createVendor(input, auth2 = SERVICE27) {
|
|
5206
5835
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
5207
5836
|
}
|
|
5208
5837
|
/** Upsert a vendor by id (`PUT`). */
|
|
5209
|
-
async updateVendor(vendorId, input, auth2 =
|
|
5838
|
+
async updateVendor(vendorId, input, auth2 = SERVICE27) {
|
|
5210
5839
|
await this.ctx.http.request({
|
|
5211
5840
|
method: "PUT",
|
|
5212
5841
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5215,7 +5844,7 @@ var VendorService = class {
|
|
|
5215
5844
|
});
|
|
5216
5845
|
}
|
|
5217
5846
|
/** Delete a vendor by id. */
|
|
5218
|
-
async deleteVendor(vendorId, auth2 =
|
|
5847
|
+
async deleteVendor(vendorId, auth2 = SERVICE27) {
|
|
5219
5848
|
await this.ctx.http.request({
|
|
5220
5849
|
method: "DELETE",
|
|
5221
5850
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5224,7 +5853,7 @@ var VendorService = class {
|
|
|
5224
5853
|
}
|
|
5225
5854
|
// --- Vendor locations ---
|
|
5226
5855
|
/** List all vendor locations. */
|
|
5227
|
-
async listVendorLocations(query = {}, auth2 =
|
|
5856
|
+
async listVendorLocations(query = {}, auth2 = SERVICE27) {
|
|
5228
5857
|
return this.ctx.http.request({
|
|
5229
5858
|
method: "GET",
|
|
5230
5859
|
path: `${this.base()}/locations`,
|
|
@@ -5233,7 +5862,7 @@ var VendorService = class {
|
|
|
5233
5862
|
});
|
|
5234
5863
|
}
|
|
5235
5864
|
/** Retrieve a vendor location by id. */
|
|
5236
|
-
async getVendorLocation(locationId, auth2 =
|
|
5865
|
+
async getVendorLocation(locationId, auth2 = SERVICE27) {
|
|
5237
5866
|
return this.ctx.http.request({
|
|
5238
5867
|
method: "GET",
|
|
5239
5868
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5241,11 +5870,11 @@ var VendorService = class {
|
|
|
5241
5870
|
});
|
|
5242
5871
|
}
|
|
5243
5872
|
/** Create a vendor location. */
|
|
5244
|
-
async createVendorLocation(input, auth2 =
|
|
5873
|
+
async createVendorLocation(input, auth2 = SERVICE27) {
|
|
5245
5874
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
5246
5875
|
}
|
|
5247
5876
|
/** Upsert a vendor location by id (`PUT`). */
|
|
5248
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
5877
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE27) {
|
|
5249
5878
|
await this.ctx.http.request({
|
|
5250
5879
|
method: "PUT",
|
|
5251
5880
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5254,7 +5883,7 @@ var VendorService = class {
|
|
|
5254
5883
|
});
|
|
5255
5884
|
}
|
|
5256
5885
|
/** Delete a vendor location by id. */
|
|
5257
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
5886
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE27) {
|
|
5258
5887
|
await this.ctx.http.request({
|
|
5259
5888
|
method: "DELETE",
|
|
5260
5889
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5264,7 +5893,7 @@ var VendorService = class {
|
|
|
5264
5893
|
};
|
|
5265
5894
|
|
|
5266
5895
|
// src/services/pick-pack.ts
|
|
5267
|
-
var
|
|
5896
|
+
var SERVICE28 = { kind: "service" };
|
|
5268
5897
|
var PickPackService = class {
|
|
5269
5898
|
constructor(ctx) {
|
|
5270
5899
|
this.ctx = ctx;
|
|
@@ -5278,7 +5907,7 @@ var PickPackService = class {
|
|
|
5278
5907
|
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
5279
5908
|
}
|
|
5280
5909
|
/** List packlist orders. */
|
|
5281
|
-
async listOrders(query = {}, auth2 =
|
|
5910
|
+
async listOrders(query = {}, auth2 = SERVICE28) {
|
|
5282
5911
|
return this.ctx.http.request({
|
|
5283
5912
|
method: "GET",
|
|
5284
5913
|
path: `${this.base()}/orders`,
|
|
@@ -5287,19 +5916,19 @@ var PickPackService = class {
|
|
|
5287
5916
|
});
|
|
5288
5917
|
}
|
|
5289
5918
|
/** Retrieve a packlist order by id. */
|
|
5290
|
-
async getOrder(orderId, auth2 =
|
|
5919
|
+
async getOrder(orderId, auth2 = SERVICE28) {
|
|
5291
5920
|
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
5292
5921
|
}
|
|
5293
5922
|
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
5294
|
-
async updateOrder(orderId, change, auth2 =
|
|
5923
|
+
async updateOrder(orderId, change, auth2 = SERVICE28) {
|
|
5295
5924
|
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
5296
5925
|
}
|
|
5297
5926
|
/** Finish an order. Returns an acknowledgement. */
|
|
5298
|
-
async finishOrder(orderId, auth2 =
|
|
5927
|
+
async finishOrder(orderId, auth2 = SERVICE28) {
|
|
5299
5928
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
5300
5929
|
}
|
|
5301
5930
|
/** List order cycles (ids). */
|
|
5302
|
-
async listOrderCycles(query = {}, auth2 =
|
|
5931
|
+
async listOrderCycles(query = {}, auth2 = SERVICE28) {
|
|
5303
5932
|
return this.ctx.http.request({
|
|
5304
5933
|
method: "GET",
|
|
5305
5934
|
path: `${this.base()}/orderCycles`,
|
|
@@ -5308,11 +5937,11 @@ var PickPackService = class {
|
|
|
5308
5937
|
});
|
|
5309
5938
|
}
|
|
5310
5939
|
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
5311
|
-
async addAssignee(orderId, assignee, auth2 =
|
|
5940
|
+
async addAssignee(orderId, assignee, auth2 = SERVICE28) {
|
|
5312
5941
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
5313
5942
|
}
|
|
5314
5943
|
/** Remove an assignee from an order. */
|
|
5315
|
-
async removeAssignee(orderId, assigneeId, auth2 =
|
|
5944
|
+
async removeAssignee(orderId, assigneeId, auth2 = SERVICE28) {
|
|
5316
5945
|
await this.ctx.http.request({
|
|
5317
5946
|
method: "DELETE",
|
|
5318
5947
|
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
@@ -5320,15 +5949,15 @@ var PickPackService = class {
|
|
|
5320
5949
|
});
|
|
5321
5950
|
}
|
|
5322
5951
|
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
5323
|
-
async updatePackaging(orderId, change, auth2 =
|
|
5952
|
+
async updatePackaging(orderId, change, auth2 = SERVICE28) {
|
|
5324
5953
|
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
5325
5954
|
}
|
|
5326
5955
|
/** Create a packing event. Returns an acknowledgement. */
|
|
5327
|
-
async createEvent(event, auth2 =
|
|
5956
|
+
async createEvent(event, auth2 = SERVICE28) {
|
|
5328
5957
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
5329
5958
|
}
|
|
5330
5959
|
/** List packing events. */
|
|
5331
|
-
async listEvents(query = {}, auth2 =
|
|
5960
|
+
async listEvents(query = {}, auth2 = SERVICE28) {
|
|
5332
5961
|
return this.ctx.http.request({
|
|
5333
5962
|
method: "GET",
|
|
5334
5963
|
path: `${this.base()}/events`,
|
|
@@ -5337,7 +5966,7 @@ var PickPackService = class {
|
|
|
5337
5966
|
});
|
|
5338
5967
|
}
|
|
5339
5968
|
/** Trigger an order recalculation. Returns the created job's id. */
|
|
5340
|
-
async triggerRecalculation(input, auth2 =
|
|
5969
|
+
async triggerRecalculation(input, auth2 = SERVICE28) {
|
|
5341
5970
|
return this.ctx.http.request({
|
|
5342
5971
|
method: "POST",
|
|
5343
5972
|
path: `${this.base()}/jobs/recalculations`,
|
|
@@ -5346,7 +5975,7 @@ var PickPackService = class {
|
|
|
5346
5975
|
});
|
|
5347
5976
|
}
|
|
5348
5977
|
/** Retrieve a recalculation job by id. */
|
|
5349
|
-
async getRecalculationJob(jobId, auth2 =
|
|
5978
|
+
async getRecalculationJob(jobId, auth2 = SERVICE28) {
|
|
5350
5979
|
return this.ctx.http.request({
|
|
5351
5980
|
method: "GET",
|
|
5352
5981
|
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
@@ -5356,7 +5985,7 @@ var PickPackService = class {
|
|
|
5356
5985
|
};
|
|
5357
5986
|
|
|
5358
5987
|
// src/services/customer-admin.ts
|
|
5359
|
-
var
|
|
5988
|
+
var SERVICE29 = { kind: "service" };
|
|
5360
5989
|
var CustomerAdminService = class {
|
|
5361
5990
|
constructor(ctx) {
|
|
5362
5991
|
this.ctx = ctx;
|
|
@@ -5374,7 +6003,7 @@ var CustomerAdminService = class {
|
|
|
5374
6003
|
}
|
|
5375
6004
|
// --- Customers ---
|
|
5376
6005
|
/** List customers. */
|
|
5377
|
-
async listCustomers(query = {}, auth2 =
|
|
6006
|
+
async listCustomers(query = {}, auth2 = SERVICE29) {
|
|
5378
6007
|
return this.ctx.http.request({
|
|
5379
6008
|
method: "GET",
|
|
5380
6009
|
path: this.base(),
|
|
@@ -5383,33 +6012,33 @@ var CustomerAdminService = class {
|
|
|
5383
6012
|
});
|
|
5384
6013
|
}
|
|
5385
6014
|
/** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
|
|
5386
|
-
async searchCustomers(query, auth2 =
|
|
6015
|
+
async searchCustomers(query, auth2 = SERVICE29) {
|
|
5387
6016
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5388
6017
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
|
|
5389
6018
|
}
|
|
5390
6019
|
/** Retrieve a customer profile by number. */
|
|
5391
|
-
async getCustomer(customerNumber, auth2 =
|
|
6020
|
+
async getCustomer(customerNumber, auth2 = SERVICE29) {
|
|
5392
6021
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5393
6022
|
}
|
|
5394
6023
|
/** Create a customer. */
|
|
5395
|
-
async createCustomer(input, auth2 =
|
|
6024
|
+
async createCustomer(input, auth2 = SERVICE29) {
|
|
5396
6025
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
5397
6026
|
}
|
|
5398
6027
|
/** Upsert a customer profile by number (`PUT`). */
|
|
5399
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
6028
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE29) {
|
|
5400
6029
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
5401
6030
|
}
|
|
5402
6031
|
/** Partially update a customer profile (`PATCH`). */
|
|
5403
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
6032
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE29) {
|
|
5404
6033
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
5405
6034
|
}
|
|
5406
6035
|
/** Delete a customer profile. */
|
|
5407
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
6036
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE29) {
|
|
5408
6037
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5409
6038
|
}
|
|
5410
6039
|
// --- Addresses ---
|
|
5411
6040
|
/** List a customer's addresses. */
|
|
5412
|
-
async listAddresses(customerNumber, auth2 =
|
|
6041
|
+
async listAddresses(customerNumber, auth2 = SERVICE29) {
|
|
5413
6042
|
return this.ctx.http.request({
|
|
5414
6043
|
method: "GET",
|
|
5415
6044
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5417,11 +6046,11 @@ var CustomerAdminService = class {
|
|
|
5417
6046
|
});
|
|
5418
6047
|
}
|
|
5419
6048
|
/** Retrieve one address. */
|
|
5420
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
6049
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE29) {
|
|
5421
6050
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5422
6051
|
}
|
|
5423
6052
|
/** Add an address. */
|
|
5424
|
-
async addAddress(customerNumber, input, auth2 =
|
|
6053
|
+
async addAddress(customerNumber, input, auth2 = SERVICE29) {
|
|
5425
6054
|
return this.ctx.http.request({
|
|
5426
6055
|
method: "POST",
|
|
5427
6056
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5430,19 +6059,19 @@ var CustomerAdminService = class {
|
|
|
5430
6059
|
});
|
|
5431
6060
|
}
|
|
5432
6061
|
/** Upsert an address by id (`PUT`). */
|
|
5433
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
6062
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE29) {
|
|
5434
6063
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
5435
6064
|
}
|
|
5436
6065
|
/** Partially update an address by id (`PATCH`). */
|
|
5437
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
6066
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE29) {
|
|
5438
6067
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
5439
6068
|
}
|
|
5440
6069
|
/** Delete an address by id. */
|
|
5441
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
6070
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE29) {
|
|
5442
6071
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5443
6072
|
}
|
|
5444
6073
|
/** Add tags to an address (`?tags=` query). */
|
|
5445
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
6074
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE29) {
|
|
5446
6075
|
await this.ctx.http.request({
|
|
5447
6076
|
method: "POST",
|
|
5448
6077
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5451,7 +6080,7 @@ var CustomerAdminService = class {
|
|
|
5451
6080
|
});
|
|
5452
6081
|
}
|
|
5453
6082
|
/** Remove tags from an address (`?tags=` query). */
|
|
5454
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
6083
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE29) {
|
|
5455
6084
|
await this.ctx.http.request({
|
|
5456
6085
|
method: "DELETE",
|
|
5457
6086
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5462,7 +6091,7 @@ var CustomerAdminService = class {
|
|
|
5462
6091
|
};
|
|
5463
6092
|
|
|
5464
6093
|
// src/services/approval.ts
|
|
5465
|
-
var
|
|
6094
|
+
var SERVICE30 = { kind: "service" };
|
|
5466
6095
|
var ApprovalService = class {
|
|
5467
6096
|
constructor(ctx) {
|
|
5468
6097
|
this.ctx = ctx;
|
|
@@ -5473,7 +6102,7 @@ var ApprovalService = class {
|
|
|
5473
6102
|
return `/approval/${this.ctx.tenant}`;
|
|
5474
6103
|
}
|
|
5475
6104
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
5476
|
-
async listApprovals(query = {}, auth2 =
|
|
6105
|
+
async listApprovals(query = {}, auth2 = SERVICE30) {
|
|
5477
6106
|
return this.ctx.http.request({
|
|
5478
6107
|
method: "GET",
|
|
5479
6108
|
path: `${this.base()}/approvals`,
|
|
@@ -5482,7 +6111,7 @@ var ApprovalService = class {
|
|
|
5482
6111
|
});
|
|
5483
6112
|
}
|
|
5484
6113
|
/** Retrieve a single approval by id. */
|
|
5485
|
-
async getApproval(approvalId, auth2 =
|
|
6114
|
+
async getApproval(approvalId, auth2 = SERVICE30) {
|
|
5486
6115
|
return this.ctx.http.request({
|
|
5487
6116
|
method: "GET",
|
|
5488
6117
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5490,7 +6119,7 @@ var ApprovalService = class {
|
|
|
5490
6119
|
});
|
|
5491
6120
|
}
|
|
5492
6121
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
5493
|
-
async createApproval(input, auth2 =
|
|
6122
|
+
async createApproval(input, auth2 = SERVICE30) {
|
|
5494
6123
|
return this.ctx.http.request({
|
|
5495
6124
|
method: "POST",
|
|
5496
6125
|
path: `${this.base()}/approvals`,
|
|
@@ -5499,7 +6128,7 @@ var ApprovalService = class {
|
|
|
5499
6128
|
});
|
|
5500
6129
|
}
|
|
5501
6130
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
5502
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
6131
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE30) {
|
|
5503
6132
|
await this.ctx.http.request({
|
|
5504
6133
|
method: "PATCH",
|
|
5505
6134
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5508,7 +6137,7 @@ var ApprovalService = class {
|
|
|
5508
6137
|
});
|
|
5509
6138
|
}
|
|
5510
6139
|
/** Delete an approval by id. */
|
|
5511
|
-
async deleteApproval(approvalId, auth2 =
|
|
6140
|
+
async deleteApproval(approvalId, auth2 = SERVICE30) {
|
|
5512
6141
|
await this.ctx.http.request({
|
|
5513
6142
|
method: "DELETE",
|
|
5514
6143
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5516,7 +6145,7 @@ var ApprovalService = class {
|
|
|
5516
6145
|
});
|
|
5517
6146
|
}
|
|
5518
6147
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
5519
|
-
async checkPermitted(input, auth2 =
|
|
6148
|
+
async checkPermitted(input, auth2 = SERVICE30) {
|
|
5520
6149
|
return this.ctx.http.request({
|
|
5521
6150
|
method: "POST",
|
|
5522
6151
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -5525,7 +6154,7 @@ var ApprovalService = class {
|
|
|
5525
6154
|
});
|
|
5526
6155
|
}
|
|
5527
6156
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
5528
|
-
async searchApprovers(input, auth2 =
|
|
6157
|
+
async searchApprovers(input, auth2 = SERVICE30) {
|
|
5529
6158
|
return this.ctx.http.request({
|
|
5530
6159
|
method: "POST",
|
|
5531
6160
|
path: `${this.base()}/search/users`,
|
|
@@ -5573,6 +6202,8 @@ var EmporixClient = class {
|
|
|
5573
6202
|
countries;
|
|
5574
6203
|
currencies;
|
|
5575
6204
|
shipping;
|
|
6205
|
+
invoices;
|
|
6206
|
+
quotes;
|
|
5576
6207
|
returns;
|
|
5577
6208
|
sepaExport;
|
|
5578
6209
|
indexing;
|
|
@@ -5644,6 +6275,8 @@ var EmporixClient = class {
|
|
|
5644
6275
|
this.countries = new CountryService(mk(CountryService.channel));
|
|
5645
6276
|
this.currencies = new CurrencyService(mk(CurrencyService.channel));
|
|
5646
6277
|
this.shipping = new ShippingService(mk(ShippingService.channel));
|
|
6278
|
+
this.invoices = new InvoiceService(mk(InvoiceService.channel));
|
|
6279
|
+
this.quotes = new QuoteService(mk(QuoteService.channel));
|
|
5647
6280
|
this.returns = new ReturnsService(mk(ReturnsService.channel));
|
|
5648
6281
|
this.sepaExport = new SepaExportService(mk(SepaExportService.channel));
|
|
5649
6282
|
this.indexing = new IndexingService(mk(IndexingService.channel));
|
|
@@ -5751,6 +6384,7 @@ exports.EmporixValidationError = EmporixValidationError;
|
|
|
5751
6384
|
exports.FeeService = FeeService;
|
|
5752
6385
|
exports.HttpClient = HttpClient;
|
|
5753
6386
|
exports.IndexingService = IndexingService;
|
|
6387
|
+
exports.InvoiceService = InvoiceService;
|
|
5754
6388
|
exports.LEVEL = LEVEL;
|
|
5755
6389
|
exports.LabelService = LabelService;
|
|
5756
6390
|
exports.LevelResolver = LevelResolver;
|
|
@@ -5761,6 +6395,7 @@ exports.PaymentGatewayService = PaymentGatewayService;
|
|
|
5761
6395
|
exports.PickPackService = PickPackService;
|
|
5762
6396
|
exports.PriceService = PriceService;
|
|
5763
6397
|
exports.ProductService = ProductService;
|
|
6398
|
+
exports.QuoteService = QuoteService;
|
|
5764
6399
|
exports.RagIndexerService = RagIndexerService;
|
|
5765
6400
|
exports.ReturnsService = ReturnsService;
|
|
5766
6401
|
exports.RewardPointsService = RewardPointsService;
|