@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.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LocationsService } from './chunk-
|
|
2
|
-
export { LocationsService } from './chunk-
|
|
1
|
+
import { LocationsService } from './chunk-IAOWDMTA.js';
|
|
2
|
+
export { LocationsService } from './chunk-IAOWDMTA.js';
|
|
3
3
|
import { MediaService } from './chunk-OTG2S2L4.js';
|
|
4
4
|
export { MediaService } from './chunk-OTG2S2L4.js';
|
|
5
5
|
import { OrdersService, SalesOrdersService } from './chunk-36T4YPQJ.js';
|
|
6
6
|
export { OrdersService, SalesOrdersService } from './chunk-36T4YPQJ.js';
|
|
7
|
-
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-
|
|
8
|
-
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-
|
|
7
|
+
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-MMX5FGMI.js';
|
|
8
|
+
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-MMX5FGMI.js';
|
|
9
9
|
import { PriceService } from './chunk-A3LYJUD4.js';
|
|
10
10
|
export { PriceService } from './chunk-A3LYJUD4.js';
|
|
11
11
|
import { ProductService } from './chunk-FZMP5NQZ.js';
|
|
@@ -14,23 +14,23 @@ import { SegmentService } from './chunk-NE7MIZPR.js';
|
|
|
14
14
|
export { SegmentService } from './chunk-NE7MIZPR.js';
|
|
15
15
|
import { AvailabilityService } from './chunk-IVCCGJN5.js';
|
|
16
16
|
export { AvailabilityService } from './chunk-IVCCGJN5.js';
|
|
17
|
-
import { CartService } from './chunk-
|
|
18
|
-
export { CartService } from './chunk-
|
|
19
|
-
import { CategoryService } from './chunk-
|
|
20
|
-
export { CategoryService } from './chunk-
|
|
17
|
+
import { CartService } from './chunk-5DWCYDQD.js';
|
|
18
|
+
export { CartService } from './chunk-5DWCYDQD.js';
|
|
19
|
+
import { CategoryService } from './chunk-DXOLWAOY.js';
|
|
20
|
+
export { CategoryService } from './chunk-DXOLWAOY.js';
|
|
21
21
|
export { iterateAll } from './chunk-GWJ2U2CP.js';
|
|
22
22
|
import { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
23
23
|
export { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
24
24
|
import { CheckoutService } from './chunk-RYQVMR26.js';
|
|
25
25
|
export { CheckoutService } from './chunk-RYQVMR26.js';
|
|
26
|
-
import { CompaniesService } from './chunk-
|
|
27
|
-
export { CompaniesService } from './chunk-
|
|
28
|
-
import { ContactsService } from './chunk-
|
|
29
|
-
export { ContactsService } from './chunk-
|
|
26
|
+
import { CompaniesService } from './chunk-44F52KRE.js';
|
|
27
|
+
export { CompaniesService } from './chunk-44F52KRE.js';
|
|
28
|
+
import { ContactsService } from './chunk-HD5RBCM6.js';
|
|
29
|
+
export { ContactsService } from './chunk-HD5RBCM6.js';
|
|
30
30
|
import { CustomerGroupsService } from './chunk-3BTPX7IJ.js';
|
|
31
31
|
export { CustomerGroupsService } from './chunk-3BTPX7IJ.js';
|
|
32
|
-
import { CustomerService } from './chunk-
|
|
33
|
-
export { CustomerService } from './chunk-
|
|
32
|
+
import { CustomerService } from './chunk-PRN3T6TY.js';
|
|
33
|
+
export { CustomerService } from './chunk-PRN3T6TY.js';
|
|
34
34
|
import './chunk-3BDDYX3V.js';
|
|
35
35
|
import { EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError, EmporixError } from './chunk-UWGGF4MC.js';
|
|
36
36
|
export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, errorFromResponse } from './chunk-UWGGF4MC.js';
|
|
@@ -591,7 +591,7 @@ var HttpClient = class {
|
|
|
591
591
|
};
|
|
592
592
|
|
|
593
593
|
// package.json
|
|
594
|
-
var version = "2.
|
|
594
|
+
var version = "2.22.0";
|
|
595
595
|
|
|
596
596
|
// src/version.ts
|
|
597
597
|
var SDK_VERSION = version;
|
|
@@ -754,6 +754,23 @@ var SessionContextService = class {
|
|
|
754
754
|
});
|
|
755
755
|
return true;
|
|
756
756
|
}
|
|
757
|
+
/** Adds an attribute to the current session context. Default auth: anonymous. */
|
|
758
|
+
async addAttribute(attribute, authCtx = ANON2) {
|
|
759
|
+
await this.ctx.http.request({
|
|
760
|
+
method: "POST",
|
|
761
|
+
path: `/session-context/${this.ctx.tenant}/me/context/attributes`,
|
|
762
|
+
body: attribute,
|
|
763
|
+
auth: authCtx
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
/** Removes a named attribute from the current session context. Default auth: anonymous. */
|
|
767
|
+
async removeAttribute(name, authCtx = ANON2) {
|
|
768
|
+
await this.ctx.http.request({
|
|
769
|
+
method: "DELETE",
|
|
770
|
+
path: `/session-context/${this.ctx.tenant}/me/context/attributes/${encodeURIComponent(name)}`,
|
|
771
|
+
auth: authCtx
|
|
772
|
+
});
|
|
773
|
+
}
|
|
757
774
|
};
|
|
758
775
|
function isNotFound(err) {
|
|
759
776
|
if (err && typeof err === "object") {
|
|
@@ -1647,8 +1664,165 @@ var SchemaService = class {
|
|
|
1647
1664
|
}
|
|
1648
1665
|
};
|
|
1649
1666
|
|
|
1650
|
-
// src/services/ai.ts
|
|
1667
|
+
// src/services/ai-resources.ts
|
|
1651
1668
|
var SERVICE8 = { kind: "service" };
|
|
1669
|
+
var AgenticCrudResource = class {
|
|
1670
|
+
constructor(ctx, path) {
|
|
1671
|
+
this.ctx = ctx;
|
|
1672
|
+
this.path = path;
|
|
1673
|
+
}
|
|
1674
|
+
ctx;
|
|
1675
|
+
path;
|
|
1676
|
+
item(id) {
|
|
1677
|
+
return `${this.path}/${encodeURIComponent(id)}`;
|
|
1678
|
+
}
|
|
1679
|
+
/** List the collection (`GET {path}`). Optional `q`/paging/sort/fields/expand. */
|
|
1680
|
+
list(query = {}, auth2 = SERVICE8) {
|
|
1681
|
+
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
1682
|
+
}
|
|
1683
|
+
/** Structured search (`POST {path}/search`). Body is `{ q? }`. */
|
|
1684
|
+
search(query, auth2 = SERVICE8) {
|
|
1685
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, body: query });
|
|
1686
|
+
}
|
|
1687
|
+
/** Retrieve one entry by id (`GET {path}/{id}`). */
|
|
1688
|
+
get(id, opts = {}, auth2 = SERVICE8) {
|
|
1689
|
+
return this.ctx.http.request({ method: "GET", path: this.item(id), auth: auth2, query: { ...opts } });
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Create-or-replace by id (`PUT {path}/{id}`). Resolves to `{ id }` on create
|
|
1693
|
+
* (HTTP 201) and `undefined` on update (HTTP 204). `{ force: true }`
|
|
1694
|
+
* cascade-disables dependents.
|
|
1695
|
+
*/
|
|
1696
|
+
upsert(id, body, opts = {}, auth2 = SERVICE8) {
|
|
1697
|
+
return this.ctx.http.request({
|
|
1698
|
+
method: "PUT",
|
|
1699
|
+
path: this.item(id),
|
|
1700
|
+
auth: auth2,
|
|
1701
|
+
body,
|
|
1702
|
+
...opts.force ? { query: { force: "true" } } : {}
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Partial update with an op array (`PATCH {path}/{id}`, 204). `ops` use the
|
|
1707
|
+
* upstream UPPERCASE enum (`ADD | REMOVE | REPLACE`), sent verbatim.
|
|
1708
|
+
*/
|
|
1709
|
+
async patch(id, ops, auth2 = SERVICE8) {
|
|
1710
|
+
await this.ctx.http.request({ method: "PATCH", path: this.item(id), auth: auth2, body: ops });
|
|
1711
|
+
}
|
|
1712
|
+
/** Delete by id (`DELETE {path}/{id}`). `{ force: true }` removes even if referenced. */
|
|
1713
|
+
async delete(id, opts = {}, auth2 = SERVICE8) {
|
|
1714
|
+
await this.ctx.http.request({
|
|
1715
|
+
method: "DELETE",
|
|
1716
|
+
path: this.item(id),
|
|
1717
|
+
auth: auth2,
|
|
1718
|
+
...opts.force ? { query: { force: "true" } } : {}
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
};
|
|
1722
|
+
var JobsResource = class {
|
|
1723
|
+
constructor(ctx, base) {
|
|
1724
|
+
this.ctx = ctx;
|
|
1725
|
+
this.base = base;
|
|
1726
|
+
}
|
|
1727
|
+
ctx;
|
|
1728
|
+
base;
|
|
1729
|
+
/** List jobs (`GET /jobs`). */
|
|
1730
|
+
list(query = {}, auth2 = SERVICE8) {
|
|
1731
|
+
return this.ctx.http.request({ method: "GET", path: `${this.base}/jobs`, auth: auth2, query: { ...query } });
|
|
1732
|
+
}
|
|
1733
|
+
/** Structured job search (`POST /jobs/search`). */
|
|
1734
|
+
search(query, auth2 = SERVICE8) {
|
|
1735
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base}/jobs/search`, auth: auth2, body: query });
|
|
1736
|
+
}
|
|
1737
|
+
/** Retrieve one job (`GET /jobs/{jobId}`). */
|
|
1738
|
+
get(jobId, auth2 = SERVICE8) {
|
|
1739
|
+
return this.ctx.http.request({ method: "GET", path: `${this.base}/jobs/${encodeURIComponent(jobId)}`, auth: auth2 });
|
|
1740
|
+
}
|
|
1741
|
+
/** Delete one job (`DELETE /jobs/{jobId}`). */
|
|
1742
|
+
async delete(jobId, auth2 = SERVICE8) {
|
|
1743
|
+
await this.ctx.http.request({ method: "DELETE", path: `${this.base}/jobs/${encodeURIComponent(jobId)}`, auth: auth2 });
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
var TemplatesResource = class {
|
|
1747
|
+
constructor(ctx, path) {
|
|
1748
|
+
this.ctx = ctx;
|
|
1749
|
+
this.path = path;
|
|
1750
|
+
}
|
|
1751
|
+
ctx;
|
|
1752
|
+
path;
|
|
1753
|
+
/** List available templates (`GET /agentic/templates`). */
|
|
1754
|
+
list(query = {}, auth2 = SERVICE8) {
|
|
1755
|
+
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
1756
|
+
}
|
|
1757
|
+
/** Structured template search (`POST /agentic/templates/search`). */
|
|
1758
|
+
search(query, auth2 = SERVICE8) {
|
|
1759
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, body: query });
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Instantiate a new agent from a template
|
|
1763
|
+
* (`POST /agentic/templates/{templateId}/agents`, HTTP 201). Returns the
|
|
1764
|
+
* created agent's id.
|
|
1765
|
+
*/
|
|
1766
|
+
clone(templateId, body, auth2 = SERVICE8) {
|
|
1767
|
+
return this.ctx.http.request({
|
|
1768
|
+
method: "POST",
|
|
1769
|
+
path: `${this.path}/${encodeURIComponent(templateId)}/agents`,
|
|
1770
|
+
auth: auth2,
|
|
1771
|
+
body
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
var LogsResource = class {
|
|
1776
|
+
constructor(ctx, path) {
|
|
1777
|
+
this.ctx = ctx;
|
|
1778
|
+
this.path = path;
|
|
1779
|
+
}
|
|
1780
|
+
ctx;
|
|
1781
|
+
path;
|
|
1782
|
+
/** List request logs (`GET /agentic/logs/requests`). */
|
|
1783
|
+
listRequests(query = {}, auth2 = SERVICE8) {
|
|
1784
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/requests`, auth: auth2, query: { ...query } });
|
|
1785
|
+
}
|
|
1786
|
+
/** Retrieve one request log (`GET /agentic/logs/requests/{requestId}`). */
|
|
1787
|
+
getRequest(requestId, auth2 = SERVICE8) {
|
|
1788
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/requests/${encodeURIComponent(requestId)}`, auth: auth2 });
|
|
1789
|
+
}
|
|
1790
|
+
/** Structured request-log search (`POST /agentic/logs/requests/search`). */
|
|
1791
|
+
searchRequests(query, auth2 = SERVICE8) {
|
|
1792
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/requests/search`, auth: auth2, body: query });
|
|
1793
|
+
}
|
|
1794
|
+
/** List session logs (`GET /agentic/logs/sessions`). */
|
|
1795
|
+
listSessions(query = {}, auth2 = SERVICE8) {
|
|
1796
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/sessions`, auth: auth2, query: { ...query } });
|
|
1797
|
+
}
|
|
1798
|
+
/** Retrieve one session log (`GET /agentic/logs/sessions/{sessionId}`). */
|
|
1799
|
+
getSession(sessionId, auth2 = SERVICE8) {
|
|
1800
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/sessions/${encodeURIComponent(sessionId)}`, auth: auth2 });
|
|
1801
|
+
}
|
|
1802
|
+
/** Structured session-log search (`POST /agentic/logs/sessions/search`). */
|
|
1803
|
+
searchSessions(query, auth2 = SERVICE8) {
|
|
1804
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/sessions/search`, auth: auth2, body: query });
|
|
1805
|
+
}
|
|
1806
|
+
};
|
|
1807
|
+
var AnalyticsResource = class {
|
|
1808
|
+
constructor(ctx, path) {
|
|
1809
|
+
this.ctx = ctx;
|
|
1810
|
+
this.path = path;
|
|
1811
|
+
}
|
|
1812
|
+
ctx;
|
|
1813
|
+
path;
|
|
1814
|
+
/** Aggregated metrics (`GET /agentic/analytics`); scope with `agentId`. */
|
|
1815
|
+
get(opts = {}, auth2 = SERVICE8) {
|
|
1816
|
+
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...opts } });
|
|
1817
|
+
}
|
|
1818
|
+
/** Per-agent execution counts (`GET /agentic/analytics/executions`). `agentIds` required. */
|
|
1819
|
+
executions(query, auth2 = SERVICE8) {
|
|
1820
|
+
return this.ctx.http.request({ method: "GET", path: `${this.path}/executions`, auth: auth2, query: { ...query } });
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1823
|
+
|
|
1824
|
+
// src/services/ai.ts
|
|
1825
|
+
var SERVICE9 = { kind: "service" };
|
|
1652
1826
|
var AiService = class {
|
|
1653
1827
|
constructor(ctx) {
|
|
1654
1828
|
this.ctx = ctx;
|
|
@@ -1658,8 +1832,49 @@ var AiService = class {
|
|
|
1658
1832
|
base() {
|
|
1659
1833
|
return `/ai-service/${this.ctx.tenant}`;
|
|
1660
1834
|
}
|
|
1835
|
+
// --- Agentic building blocks (CRUD sub-resources) ----------------------
|
|
1836
|
+
_oauths;
|
|
1837
|
+
/** OAuth 2.0 client-credentials configs (`/agentic/oauths`). CRUD sub-resource. */
|
|
1838
|
+
get oauths() {
|
|
1839
|
+
return this._oauths ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/oauths`);
|
|
1840
|
+
}
|
|
1841
|
+
_tools;
|
|
1842
|
+
/** Agentic tools (`/agentic/tools`). CRUD sub-resource. */
|
|
1843
|
+
get tools() {
|
|
1844
|
+
return this._tools ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/tools`);
|
|
1845
|
+
}
|
|
1846
|
+
_tokens;
|
|
1847
|
+
/** Stored tokens (`/agentic/tokens`) — an OAuth config's client secret. CRUD sub-resource. */
|
|
1848
|
+
get tokens() {
|
|
1849
|
+
return this._tokens ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/tokens`);
|
|
1850
|
+
}
|
|
1851
|
+
_mcpServers;
|
|
1852
|
+
/** MCP-server configs (`/agentic/mcp-servers`). CRUD sub-resource. */
|
|
1853
|
+
get mcpServers() {
|
|
1854
|
+
return this._mcpServers ??= new AgenticCrudResource(this.ctx, `${this.base()}/agentic/mcp-servers`);
|
|
1855
|
+
}
|
|
1856
|
+
_jobs;
|
|
1857
|
+
/** AI async jobs (`/jobs`). `list · search · get · delete`. */
|
|
1858
|
+
get jobs() {
|
|
1859
|
+
return this._jobs ??= new JobsResource(this.ctx, this.base());
|
|
1860
|
+
}
|
|
1861
|
+
_templates;
|
|
1862
|
+
/** Agent templates (`/agentic/templates`). `list · search · clone`. */
|
|
1863
|
+
get templates() {
|
|
1864
|
+
return this._templates ??= new TemplatesResource(this.ctx, `${this.base()}/agentic/templates`);
|
|
1865
|
+
}
|
|
1866
|
+
_logs;
|
|
1867
|
+
/** Agent logs (`/agentic/logs`): request + session logs. */
|
|
1868
|
+
get logs() {
|
|
1869
|
+
return this._logs ??= new LogsResource(this.ctx, `${this.base()}/agentic/logs`);
|
|
1870
|
+
}
|
|
1871
|
+
_analytics;
|
|
1872
|
+
/** Agent analytics (`/agentic/analytics`). `get · executions`. */
|
|
1873
|
+
get analytics() {
|
|
1874
|
+
return this._analytics ??= new AnalyticsResource(this.ctx, `${this.base()}/agentic/analytics`);
|
|
1875
|
+
}
|
|
1661
1876
|
/** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
|
|
1662
|
-
async generateText(input, auth2 =
|
|
1877
|
+
async generateText(input, auth2 = SERVICE9) {
|
|
1663
1878
|
return this.ctx.http.request({
|
|
1664
1879
|
method: "POST",
|
|
1665
1880
|
path: `${this.base()}/texts`,
|
|
@@ -1668,7 +1883,7 @@ var AiService = class {
|
|
|
1668
1883
|
});
|
|
1669
1884
|
}
|
|
1670
1885
|
/** Run a chat completion over a message list (`POST /completions`). No `maxTokens`. */
|
|
1671
|
-
async complete(input, auth2 =
|
|
1886
|
+
async complete(input, auth2 = SERVICE9) {
|
|
1672
1887
|
return this.ctx.http.request({
|
|
1673
1888
|
method: "POST",
|
|
1674
1889
|
path: `${this.base()}/completions`,
|
|
@@ -1677,7 +1892,7 @@ var AiService = class {
|
|
|
1677
1892
|
});
|
|
1678
1893
|
}
|
|
1679
1894
|
/** List all agentic agents. */
|
|
1680
|
-
async listAgents(auth2 =
|
|
1895
|
+
async listAgents(auth2 = SERVICE9) {
|
|
1681
1896
|
return this.ctx.http.request({
|
|
1682
1897
|
method: "GET",
|
|
1683
1898
|
path: `${this.base()}/agentic/agents`,
|
|
@@ -1685,7 +1900,7 @@ var AiService = class {
|
|
|
1685
1900
|
});
|
|
1686
1901
|
}
|
|
1687
1902
|
/** Retrieve one agent by id. */
|
|
1688
|
-
async getAgent(id, auth2 =
|
|
1903
|
+
async getAgent(id, auth2 = SERVICE9) {
|
|
1689
1904
|
return this.ctx.http.request({
|
|
1690
1905
|
method: "GET",
|
|
1691
1906
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1693,7 +1908,7 @@ var AiService = class {
|
|
|
1693
1908
|
});
|
|
1694
1909
|
}
|
|
1695
1910
|
/** Create-or-replace an agent by id (`PUT`). Takes the agent write shape. */
|
|
1696
|
-
async upsertAgent(id, agent, auth2 =
|
|
1911
|
+
async upsertAgent(id, agent, auth2 = SERVICE9) {
|
|
1697
1912
|
return this.ctx.http.request({
|
|
1698
1913
|
method: "PUT",
|
|
1699
1914
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1706,7 +1921,7 @@ var AiService = class {
|
|
|
1706
1921
|
* UPPERCASE enum (`ADD | REMOVE | REPLACE`) and are sent verbatim — this is
|
|
1707
1922
|
* NOT RFC-6902 JSON-Patch.
|
|
1708
1923
|
*/
|
|
1709
|
-
async patchAgent(id, ops, auth2 =
|
|
1924
|
+
async patchAgent(id, ops, auth2 = SERVICE9) {
|
|
1710
1925
|
return this.ctx.http.request({
|
|
1711
1926
|
method: "PATCH",
|
|
1712
1927
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1718,7 +1933,7 @@ var AiService = class {
|
|
|
1718
1933
|
* Delete an agent by id. Pass `{ force: true }` to delete an agent that is
|
|
1719
1934
|
* still referenced elsewhere (`?force=true`).
|
|
1720
1935
|
*/
|
|
1721
|
-
async deleteAgent(id, auth2 =
|
|
1936
|
+
async deleteAgent(id, auth2 = SERVICE9, opts = {}) {
|
|
1722
1937
|
await this.ctx.http.request({
|
|
1723
1938
|
method: "DELETE",
|
|
1724
1939
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1727,7 +1942,7 @@ var AiService = class {
|
|
|
1727
1942
|
});
|
|
1728
1943
|
}
|
|
1729
1944
|
/** Server-side agent search (`POST /agentic/agents/search`). */
|
|
1730
|
-
async searchAgents(query, auth2 =
|
|
1945
|
+
async searchAgents(query, auth2 = SERVICE9) {
|
|
1731
1946
|
return this.ctx.http.request({
|
|
1732
1947
|
method: "POST",
|
|
1733
1948
|
path: `${this.base()}/agentic/agents/search`,
|
|
@@ -1739,7 +1954,7 @@ var AiService = class {
|
|
|
1739
1954
|
* Synchronous agent chat (`POST /agentic/chat`). Returns the response
|
|
1740
1955
|
* ARRAY verbatim (the upstream contract is an array, not a single object).
|
|
1741
1956
|
*/
|
|
1742
|
-
async chat(input, auth2 =
|
|
1957
|
+
async chat(input, auth2 = SERVICE9) {
|
|
1743
1958
|
return this.ctx.http.request({
|
|
1744
1959
|
method: "POST",
|
|
1745
1960
|
path: `${this.base()}/agentic/chat`,
|
|
@@ -1751,7 +1966,7 @@ var AiService = class {
|
|
|
1751
1966
|
* Fire-and-forget agent chat (`POST /agentic/chat-async`, HTTP 201).
|
|
1752
1967
|
* Returns the job-id ARRAY verbatim.
|
|
1753
1968
|
*/
|
|
1754
|
-
async chatAsync(input, auth2 =
|
|
1969
|
+
async chatAsync(input, auth2 = SERVICE9) {
|
|
1755
1970
|
return this.ctx.http.request({
|
|
1756
1971
|
method: "POST",
|
|
1757
1972
|
path: `${this.base()}/agentic/chat-async`,
|
|
@@ -1765,7 +1980,7 @@ var AiService = class {
|
|
|
1765
1980
|
* stream body as an opaque string, so chunks are raw strings, not parsed
|
|
1766
1981
|
* objects. Consume with `for await`.
|
|
1767
1982
|
*/
|
|
1768
|
-
async *chatStream(input, opts = {}, auth2 =
|
|
1983
|
+
async *chatStream(input, opts = {}, auth2 = SERVICE9) {
|
|
1769
1984
|
const events = this.ctx.http.requestStream({
|
|
1770
1985
|
method: "POST",
|
|
1771
1986
|
path: `${this.base()}/agentic/chat-stream`,
|
|
@@ -1776,7 +1991,7 @@ var AiService = class {
|
|
|
1776
1991
|
for await (const ev of events) yield ev.data;
|
|
1777
1992
|
}
|
|
1778
1993
|
/** List stored agentic conversations (`GET /agentic/conversations`). */
|
|
1779
|
-
async listConversations(auth2 =
|
|
1994
|
+
async listConversations(auth2 = SERVICE9) {
|
|
1780
1995
|
return this.ctx.http.request({
|
|
1781
1996
|
method: "GET",
|
|
1782
1997
|
path: `${this.base()}/agentic/conversations`,
|
|
@@ -1784,7 +1999,7 @@ var AiService = class {
|
|
|
1784
1999
|
});
|
|
1785
2000
|
}
|
|
1786
2001
|
/** Server-side conversation search (`POST /agentic/conversations/search`). */
|
|
1787
|
-
async searchConversations(query, auth2 =
|
|
2002
|
+
async searchConversations(query, auth2 = SERVICE9) {
|
|
1788
2003
|
return this.ctx.http.request({
|
|
1789
2004
|
method: "POST",
|
|
1790
2005
|
path: `${this.base()}/agentic/conversations/search`,
|
|
@@ -1792,10 +2007,62 @@ var AiService = class {
|
|
|
1792
2007
|
body: query
|
|
1793
2008
|
});
|
|
1794
2009
|
}
|
|
2010
|
+
// --- Standalone agentic reads / bulk operations ------------------------
|
|
2011
|
+
/** List models available to the tenant, grouped by provider (`GET /agentic/models`). */
|
|
2012
|
+
async listModels(auth2 = SERVICE9) {
|
|
2013
|
+
return this.ctx.http.request({
|
|
2014
|
+
method: "GET",
|
|
2015
|
+
path: `${this.base()}/agentic/models`,
|
|
2016
|
+
auth: auth2
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
/** List commerce events available to agent triggers (`GET /agentic/commerce-events`). */
|
|
2020
|
+
async listCommerceEvents(auth2 = SERVICE9) {
|
|
2021
|
+
return this.ctx.http.request({
|
|
2022
|
+
method: "GET",
|
|
2023
|
+
path: `${this.base()}/agentic/commerce-events`,
|
|
2024
|
+
auth: auth2
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* Upload a chat attachment for an agent
|
|
2029
|
+
* (`POST /agentic/{agentId}/attachments`, multipart, HTTP 201). The response
|
|
2030
|
+
* `sessionId` must be threaded into subsequent chat calls to bind the file.
|
|
2031
|
+
* Pass `opts.sessionId` to attach to an existing session.
|
|
2032
|
+
*/
|
|
2033
|
+
async uploadAttachment(agentId, attachment, opts = {}, auth2 = SERVICE9) {
|
|
2034
|
+
const form = new FormData();
|
|
2035
|
+
form.append("attachment", attachment);
|
|
2036
|
+
return this.ctx.http.request({
|
|
2037
|
+
method: "POST",
|
|
2038
|
+
path: `${this.base()}/agentic/${encodeURIComponent(agentId)}/attachments`,
|
|
2039
|
+
auth: auth2,
|
|
2040
|
+
body: form,
|
|
2041
|
+
...opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {}
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
/** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
|
|
2045
|
+
async exportAgents(body, auth2 = SERVICE9) {
|
|
2046
|
+
return this.ctx.http.request({
|
|
2047
|
+
method: "POST",
|
|
2048
|
+
path: `${this.base()}/agentic/agents/export`,
|
|
2049
|
+
auth: auth2,
|
|
2050
|
+
body
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
/** Import previously-exported agents (`POST /agentic/agents/import`). */
|
|
2054
|
+
async importAgents(body, auth2 = SERVICE9) {
|
|
2055
|
+
return this.ctx.http.request({
|
|
2056
|
+
method: "POST",
|
|
2057
|
+
path: `${this.base()}/agentic/agents/import`,
|
|
2058
|
+
auth: auth2,
|
|
2059
|
+
body
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
1795
2062
|
};
|
|
1796
2063
|
|
|
1797
2064
|
// src/services/tax.ts
|
|
1798
|
-
var
|
|
2065
|
+
var SERVICE10 = { kind: "service" };
|
|
1799
2066
|
var TaxService = class {
|
|
1800
2067
|
constructor(ctx) {
|
|
1801
2068
|
this.ctx = ctx;
|
|
@@ -1806,7 +2073,7 @@ var TaxService = class {
|
|
|
1806
2073
|
return `/tax/${this.ctx.tenant}`;
|
|
1807
2074
|
}
|
|
1808
2075
|
/** List all per-location tax configurations. */
|
|
1809
|
-
async listTaxConfigs(auth2 =
|
|
2076
|
+
async listTaxConfigs(auth2 = SERVICE10) {
|
|
1810
2077
|
return this.ctx.http.request({
|
|
1811
2078
|
method: "GET",
|
|
1812
2079
|
path: `${this.base()}/taxes`,
|
|
@@ -1814,7 +2081,7 @@ var TaxService = class {
|
|
|
1814
2081
|
});
|
|
1815
2082
|
}
|
|
1816
2083
|
/** Retrieve one tax configuration by its location (country) code. */
|
|
1817
|
-
async getTaxConfig(locationCode, auth2 =
|
|
2084
|
+
async getTaxConfig(locationCode, auth2 = SERVICE10) {
|
|
1818
2085
|
return this.ctx.http.request({
|
|
1819
2086
|
method: "GET",
|
|
1820
2087
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -1822,7 +2089,7 @@ var TaxService = class {
|
|
|
1822
2089
|
});
|
|
1823
2090
|
}
|
|
1824
2091
|
/** Create a tax configuration (`POST`). Returns the created `{ locationCode }`. */
|
|
1825
|
-
async createTaxConfig(input, auth2 =
|
|
2092
|
+
async createTaxConfig(input, auth2 = SERVICE10) {
|
|
1826
2093
|
return this.ctx.http.request({
|
|
1827
2094
|
method: "POST",
|
|
1828
2095
|
path: `${this.base()}/taxes`,
|
|
@@ -1834,7 +2101,7 @@ var TaxService = class {
|
|
|
1834
2101
|
* Update a tax configuration by location code (`PUT`). `metadata.version` is
|
|
1835
2102
|
* required (optimistic locking — a stale version yields 409).
|
|
1836
2103
|
*/
|
|
1837
|
-
async updateTaxConfig(locationCode, input, auth2 =
|
|
2104
|
+
async updateTaxConfig(locationCode, input, auth2 = SERVICE10) {
|
|
1838
2105
|
return this.ctx.http.request({
|
|
1839
2106
|
method: "PUT",
|
|
1840
2107
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -1843,7 +2110,7 @@ var TaxService = class {
|
|
|
1843
2110
|
});
|
|
1844
2111
|
}
|
|
1845
2112
|
/** Delete a tax configuration by location code. */
|
|
1846
|
-
async deleteTaxConfig(locationCode, auth2 =
|
|
2113
|
+
async deleteTaxConfig(locationCode, auth2 = SERVICE10) {
|
|
1847
2114
|
await this.ctx.http.request({
|
|
1848
2115
|
method: "DELETE",
|
|
1849
2116
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -1854,7 +2121,7 @@ var TaxService = class {
|
|
|
1854
2121
|
* Calculate net/gross values for a price (`PUT /taxes/calculation-commands`).
|
|
1855
2122
|
* Single command in, single result out.
|
|
1856
2123
|
*/
|
|
1857
|
-
async calculateTax(request, auth2 =
|
|
2124
|
+
async calculateTax(request, auth2 = SERVICE10) {
|
|
1858
2125
|
return this.ctx.http.request({
|
|
1859
2126
|
method: "PUT",
|
|
1860
2127
|
path: `${this.base()}/taxes/calculation-commands`,
|
|
@@ -1865,7 +2132,7 @@ var TaxService = class {
|
|
|
1865
2132
|
};
|
|
1866
2133
|
|
|
1867
2134
|
// src/services/coupon.ts
|
|
1868
|
-
var
|
|
2135
|
+
var SERVICE11 = { kind: "service" };
|
|
1869
2136
|
var CouponService = class {
|
|
1870
2137
|
constructor(ctx) {
|
|
1871
2138
|
this.ctx = ctx;
|
|
@@ -1876,7 +2143,7 @@ var CouponService = class {
|
|
|
1876
2143
|
return `/coupon/${this.ctx.tenant}`;
|
|
1877
2144
|
}
|
|
1878
2145
|
/** List coupons by criteria. Returns a plain array. */
|
|
1879
|
-
async listCoupons(query = {}, auth2 =
|
|
2146
|
+
async listCoupons(query = {}, auth2 = SERVICE11) {
|
|
1880
2147
|
return this.ctx.http.request({
|
|
1881
2148
|
method: "GET",
|
|
1882
2149
|
path: `${this.base()}/coupons`,
|
|
@@ -1885,7 +2152,7 @@ var CouponService = class {
|
|
|
1885
2152
|
});
|
|
1886
2153
|
}
|
|
1887
2154
|
/** Retrieve one coupon by code. */
|
|
1888
|
-
async getCoupon(code, auth2 =
|
|
2155
|
+
async getCoupon(code, auth2 = SERVICE11) {
|
|
1889
2156
|
return this.ctx.http.request({
|
|
1890
2157
|
method: "GET",
|
|
1891
2158
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -1893,7 +2160,7 @@ var CouponService = class {
|
|
|
1893
2160
|
});
|
|
1894
2161
|
}
|
|
1895
2162
|
/** Create a coupon (`POST`, HTTP 201). Returns the created resource's `{ id?, yrn? }`. */
|
|
1896
|
-
async createCoupon(input, auth2 =
|
|
2163
|
+
async createCoupon(input, auth2 = SERVICE11) {
|
|
1897
2164
|
return this.ctx.http.request({
|
|
1898
2165
|
method: "POST",
|
|
1899
2166
|
path: `${this.base()}/coupons`,
|
|
@@ -1902,7 +2169,7 @@ var CouponService = class {
|
|
|
1902
2169
|
});
|
|
1903
2170
|
}
|
|
1904
2171
|
/** Replace a coupon by code (`PUT`). Resolves once the update is accepted. */
|
|
1905
|
-
async updateCoupon(code, input, auth2 =
|
|
2172
|
+
async updateCoupon(code, input, auth2 = SERVICE11) {
|
|
1906
2173
|
await this.ctx.http.request({
|
|
1907
2174
|
method: "PUT",
|
|
1908
2175
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -1911,7 +2178,7 @@ var CouponService = class {
|
|
|
1911
2178
|
});
|
|
1912
2179
|
}
|
|
1913
2180
|
/** Partially update a coupon by code (`PATCH` merge body). */
|
|
1914
|
-
async patchCoupon(code, patch, auth2 =
|
|
2181
|
+
async patchCoupon(code, patch, auth2 = SERVICE11) {
|
|
1915
2182
|
await this.ctx.http.request({
|
|
1916
2183
|
method: "PATCH",
|
|
1917
2184
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -1920,7 +2187,7 @@ var CouponService = class {
|
|
|
1920
2187
|
});
|
|
1921
2188
|
}
|
|
1922
2189
|
/** Delete a coupon by code. */
|
|
1923
|
-
async deleteCoupon(code, auth2 =
|
|
2190
|
+
async deleteCoupon(code, auth2 = SERVICE11) {
|
|
1924
2191
|
await this.ctx.http.request({
|
|
1925
2192
|
method: "DELETE",
|
|
1926
2193
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -1931,7 +2198,7 @@ var CouponService = class {
|
|
|
1931
2198
|
* Check whether a coupon can be redeemed (`POST /validation`). Resolves when
|
|
1932
2199
|
* redeemable; throws an `EmporixError` otherwise (no response body).
|
|
1933
2200
|
*/
|
|
1934
|
-
async validateCoupon(code, redemption, auth2 =
|
|
2201
|
+
async validateCoupon(code, redemption, auth2 = SERVICE11) {
|
|
1935
2202
|
await this.ctx.http.request({
|
|
1936
2203
|
method: "POST",
|
|
1937
2204
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/validation`,
|
|
@@ -1940,7 +2207,7 @@ var CouponService = class {
|
|
|
1940
2207
|
});
|
|
1941
2208
|
}
|
|
1942
2209
|
/** List a coupon's redemptions by criteria. */
|
|
1943
|
-
async listRedemptions(code, query = {}, auth2 =
|
|
2210
|
+
async listRedemptions(code, query = {}, auth2 = SERVICE11) {
|
|
1944
2211
|
return this.ctx.http.request({
|
|
1945
2212
|
method: "GET",
|
|
1946
2213
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -1949,7 +2216,7 @@ var CouponService = class {
|
|
|
1949
2216
|
});
|
|
1950
2217
|
}
|
|
1951
2218
|
/** Redeem a coupon by creating a redemption (`POST`, HTTP 201). Returns the resource location. */
|
|
1952
|
-
async redeemCoupon(code, redemption, auth2 =
|
|
2219
|
+
async redeemCoupon(code, redemption, auth2 = SERVICE11) {
|
|
1953
2220
|
return this.ctx.http.request({
|
|
1954
2221
|
method: "POST",
|
|
1955
2222
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -1958,7 +2225,7 @@ var CouponService = class {
|
|
|
1958
2225
|
});
|
|
1959
2226
|
}
|
|
1960
2227
|
/** Retrieve one redemption by id. */
|
|
1961
|
-
async getRedemption(code, id, auth2 =
|
|
2228
|
+
async getRedemption(code, id, auth2 = SERVICE11) {
|
|
1962
2229
|
return this.ctx.http.request({
|
|
1963
2230
|
method: "GET",
|
|
1964
2231
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -1966,7 +2233,7 @@ var CouponService = class {
|
|
|
1966
2233
|
});
|
|
1967
2234
|
}
|
|
1968
2235
|
/** Delete a redemption by id. */
|
|
1969
|
-
async deleteRedemption(code, id, auth2 =
|
|
2236
|
+
async deleteRedemption(code, id, auth2 = SERVICE11) {
|
|
1970
2237
|
await this.ctx.http.request({
|
|
1971
2238
|
method: "DELETE",
|
|
1972
2239
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -1974,7 +2241,7 @@ var CouponService = class {
|
|
|
1974
2241
|
});
|
|
1975
2242
|
}
|
|
1976
2243
|
/** Retrieve a customer's referral coupon (resolves to an empty body when none exists). */
|
|
1977
|
-
async getReferralCoupon(customerNumber, auth2 =
|
|
2244
|
+
async getReferralCoupon(customerNumber, auth2 = SERVICE11) {
|
|
1978
2245
|
return this.ctx.http.request({
|
|
1979
2246
|
method: "GET",
|
|
1980
2247
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -1982,7 +2249,7 @@ var CouponService = class {
|
|
|
1982
2249
|
});
|
|
1983
2250
|
}
|
|
1984
2251
|
/** Create a referral coupon code for a customer (no request body). */
|
|
1985
|
-
async createReferralCoupon(customerNumber, auth2 =
|
|
2252
|
+
async createReferralCoupon(customerNumber, auth2 = SERVICE11) {
|
|
1986
2253
|
return this.ctx.http.request({
|
|
1987
2254
|
method: "POST",
|
|
1988
2255
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -1992,7 +2259,7 @@ var CouponService = class {
|
|
|
1992
2259
|
};
|
|
1993
2260
|
|
|
1994
2261
|
// src/services/reward-points.ts
|
|
1995
|
-
var
|
|
2262
|
+
var SERVICE12 = { kind: "service" };
|
|
1996
2263
|
var RewardPointsService = class {
|
|
1997
2264
|
constructor(ctx) {
|
|
1998
2265
|
this.ctx = ctx;
|
|
@@ -2009,7 +2276,7 @@ var RewardPointsService = class {
|
|
|
2009
2276
|
}
|
|
2010
2277
|
// --- Admin: customer points management (service token) ---
|
|
2011
2278
|
/** Batch summary across all customers. */
|
|
2012
|
-
async listAllSummaries(query = {}, auth2 =
|
|
2279
|
+
async listAllSummaries(query = {}, auth2 = SERVICE12) {
|
|
2013
2280
|
return this.ctx.http.request({
|
|
2014
2281
|
method: "GET",
|
|
2015
2282
|
path: `${this.base()}/summaryBatch`,
|
|
@@ -2018,7 +2285,7 @@ var RewardPointsService = class {
|
|
|
2018
2285
|
});
|
|
2019
2286
|
}
|
|
2020
2287
|
/** Retrieve one customer's reward-points balance. */
|
|
2021
|
-
async getCustomerPoints(customerId, auth2 =
|
|
2288
|
+
async getCustomerPoints(customerId, auth2 = SERVICE12) {
|
|
2022
2289
|
return this.ctx.http.request({
|
|
2023
2290
|
method: "GET",
|
|
2024
2291
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -2026,7 +2293,7 @@ var RewardPointsService = class {
|
|
|
2026
2293
|
});
|
|
2027
2294
|
}
|
|
2028
2295
|
/** Create a reward-points entry for a customer. */
|
|
2029
|
-
async createCustomerPoints(customerId, input, auth2 =
|
|
2296
|
+
async createCustomerPoints(customerId, input, auth2 = SERVICE12) {
|
|
2030
2297
|
await this.ctx.http.request({
|
|
2031
2298
|
method: "POST",
|
|
2032
2299
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -2035,7 +2302,7 @@ var RewardPointsService = class {
|
|
|
2035
2302
|
});
|
|
2036
2303
|
}
|
|
2037
2304
|
/** Delete a customer's reward points. */
|
|
2038
|
-
async deleteCustomerPoints(customerId, auth2 =
|
|
2305
|
+
async deleteCustomerPoints(customerId, auth2 = SERVICE12) {
|
|
2039
2306
|
await this.ctx.http.request({
|
|
2040
2307
|
method: "DELETE",
|
|
2041
2308
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -2043,7 +2310,7 @@ var RewardPointsService = class {
|
|
|
2043
2310
|
});
|
|
2044
2311
|
}
|
|
2045
2312
|
/** Retrieve a reward-points summary for one customer. */
|
|
2046
|
-
async getCustomerSummary(customerId, auth2 =
|
|
2313
|
+
async getCustomerSummary(customerId, auth2 = SERVICE12) {
|
|
2047
2314
|
return this.ctx.http.request({
|
|
2048
2315
|
method: "GET",
|
|
2049
2316
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/summary`,
|
|
@@ -2051,7 +2318,7 @@ var RewardPointsService = class {
|
|
|
2051
2318
|
});
|
|
2052
2319
|
}
|
|
2053
2320
|
/** Add reward points for a customer. */
|
|
2054
|
-
async addPoints(customerId, input, auth2 =
|
|
2321
|
+
async addPoints(customerId, input, auth2 = SERVICE12) {
|
|
2055
2322
|
await this.ctx.http.request({
|
|
2056
2323
|
method: "POST",
|
|
2057
2324
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/addPoints`,
|
|
@@ -2060,7 +2327,7 @@ var RewardPointsService = class {
|
|
|
2060
2327
|
});
|
|
2061
2328
|
}
|
|
2062
2329
|
/** Redeem a customer's reward points (on behalf). */
|
|
2063
|
-
async redeemPoints(customerId, input, auth2 =
|
|
2330
|
+
async redeemPoints(customerId, input, auth2 = SERVICE12) {
|
|
2064
2331
|
await this.ctx.http.request({
|
|
2065
2332
|
method: "POST",
|
|
2066
2333
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/redeemPoints`,
|
|
@@ -2111,7 +2378,7 @@ var RewardPointsService = class {
|
|
|
2111
2378
|
}
|
|
2112
2379
|
// --- Redeem options (tenant-scoped; read open to customer, management service-only) ---
|
|
2113
2380
|
/** List redeem options. Defaults to the service token; pass a customer `auth` for storefront reads. */
|
|
2114
|
-
async listRedeemOptions(auth2 =
|
|
2381
|
+
async listRedeemOptions(auth2 = SERVICE12) {
|
|
2115
2382
|
return this.ctx.http.request({
|
|
2116
2383
|
method: "GET",
|
|
2117
2384
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -2119,7 +2386,7 @@ var RewardPointsService = class {
|
|
|
2119
2386
|
});
|
|
2120
2387
|
}
|
|
2121
2388
|
/** Create a redeem option. Returns the updated options list. */
|
|
2122
|
-
async createRedeemOption(input, auth2 =
|
|
2389
|
+
async createRedeemOption(input, auth2 = SERVICE12) {
|
|
2123
2390
|
return this.ctx.http.request({
|
|
2124
2391
|
method: "POST",
|
|
2125
2392
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -2128,7 +2395,7 @@ var RewardPointsService = class {
|
|
|
2128
2395
|
});
|
|
2129
2396
|
}
|
|
2130
2397
|
/** Update a redeem option by id. Resolves once accepted (no response body). */
|
|
2131
|
-
async updateRedeemOption(redeemOptionId, input, auth2 =
|
|
2398
|
+
async updateRedeemOption(redeemOptionId, input, auth2 = SERVICE12) {
|
|
2132
2399
|
await this.ctx.http.request({
|
|
2133
2400
|
method: "PUT",
|
|
2134
2401
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -2137,7 +2404,7 @@ var RewardPointsService = class {
|
|
|
2137
2404
|
});
|
|
2138
2405
|
}
|
|
2139
2406
|
/** Delete a redeem option by id. */
|
|
2140
|
-
async deleteRedeemOption(redeemOptionId, auth2 =
|
|
2407
|
+
async deleteRedeemOption(redeemOptionId, auth2 = SERVICE12) {
|
|
2141
2408
|
await this.ctx.http.request({
|
|
2142
2409
|
method: "DELETE",
|
|
2143
2410
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -2147,7 +2414,7 @@ var RewardPointsService = class {
|
|
|
2147
2414
|
};
|
|
2148
2415
|
|
|
2149
2416
|
// src/services/brand.ts
|
|
2150
|
-
var
|
|
2417
|
+
var SERVICE13 = { kind: "service" };
|
|
2151
2418
|
var BrandService = class {
|
|
2152
2419
|
constructor(ctx) {
|
|
2153
2420
|
this.ctx = ctx;
|
|
@@ -2158,7 +2425,7 @@ var BrandService = class {
|
|
|
2158
2425
|
return `/brand/brands`;
|
|
2159
2426
|
}
|
|
2160
2427
|
/** List all brands. */
|
|
2161
|
-
async listBrands(query = {}, auth2 =
|
|
2428
|
+
async listBrands(query = {}, auth2 = SERVICE13) {
|
|
2162
2429
|
return this.ctx.http.request({
|
|
2163
2430
|
method: "GET",
|
|
2164
2431
|
path: this.base(),
|
|
@@ -2167,7 +2434,7 @@ var BrandService = class {
|
|
|
2167
2434
|
});
|
|
2168
2435
|
}
|
|
2169
2436
|
/** Retrieve one brand by id. */
|
|
2170
|
-
async getBrand(brandId, auth2 =
|
|
2437
|
+
async getBrand(brandId, auth2 = SERVICE13) {
|
|
2171
2438
|
return this.ctx.http.request({
|
|
2172
2439
|
method: "GET",
|
|
2173
2440
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2175,7 +2442,7 @@ var BrandService = class {
|
|
|
2175
2442
|
});
|
|
2176
2443
|
}
|
|
2177
2444
|
/** Create a brand. */
|
|
2178
|
-
async createBrand(input, auth2 =
|
|
2445
|
+
async createBrand(input, auth2 = SERVICE13) {
|
|
2179
2446
|
return this.ctx.http.request({
|
|
2180
2447
|
method: "POST",
|
|
2181
2448
|
path: this.base(),
|
|
@@ -2184,7 +2451,7 @@ var BrandService = class {
|
|
|
2184
2451
|
});
|
|
2185
2452
|
}
|
|
2186
2453
|
/** Replace a brand by id. */
|
|
2187
|
-
async updateBrand(brandId, input, auth2 =
|
|
2454
|
+
async updateBrand(brandId, input, auth2 = SERVICE13) {
|
|
2188
2455
|
return this.ctx.http.request({
|
|
2189
2456
|
method: "PUT",
|
|
2190
2457
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2193,7 +2460,7 @@ var BrandService = class {
|
|
|
2193
2460
|
});
|
|
2194
2461
|
}
|
|
2195
2462
|
/** Partially update a brand by id. */
|
|
2196
|
-
async patchBrand(brandId, patch, auth2 =
|
|
2463
|
+
async patchBrand(brandId, patch, auth2 = SERVICE13) {
|
|
2197
2464
|
return this.ctx.http.request({
|
|
2198
2465
|
method: "PATCH",
|
|
2199
2466
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2202,7 +2469,7 @@ var BrandService = class {
|
|
|
2202
2469
|
});
|
|
2203
2470
|
}
|
|
2204
2471
|
/** Delete a brand by id. */
|
|
2205
|
-
async deleteBrand(brandId, auth2 =
|
|
2472
|
+
async deleteBrand(brandId, auth2 = SERVICE13) {
|
|
2206
2473
|
await this.ctx.http.request({
|
|
2207
2474
|
method: "DELETE",
|
|
2208
2475
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2212,7 +2479,7 @@ var BrandService = class {
|
|
|
2212
2479
|
};
|
|
2213
2480
|
|
|
2214
2481
|
// src/services/label.ts
|
|
2215
|
-
var
|
|
2482
|
+
var SERVICE14 = { kind: "service" };
|
|
2216
2483
|
var LabelService = class {
|
|
2217
2484
|
constructor(ctx) {
|
|
2218
2485
|
this.ctx = ctx;
|
|
@@ -2223,7 +2490,7 @@ var LabelService = class {
|
|
|
2223
2490
|
return `/label/labels`;
|
|
2224
2491
|
}
|
|
2225
2492
|
/** List all labels. */
|
|
2226
|
-
async listLabels(query = {}, auth2 =
|
|
2493
|
+
async listLabels(query = {}, auth2 = SERVICE14) {
|
|
2227
2494
|
return this.ctx.http.request({
|
|
2228
2495
|
method: "GET",
|
|
2229
2496
|
path: this.base(),
|
|
@@ -2232,7 +2499,7 @@ var LabelService = class {
|
|
|
2232
2499
|
});
|
|
2233
2500
|
}
|
|
2234
2501
|
/** Retrieve one label by id. */
|
|
2235
|
-
async getLabel(labelId, auth2 =
|
|
2502
|
+
async getLabel(labelId, auth2 = SERVICE14) {
|
|
2236
2503
|
return this.ctx.http.request({
|
|
2237
2504
|
method: "GET",
|
|
2238
2505
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2240,7 +2507,7 @@ var LabelService = class {
|
|
|
2240
2507
|
});
|
|
2241
2508
|
}
|
|
2242
2509
|
/** Create a label. */
|
|
2243
|
-
async createLabel(input, auth2 =
|
|
2510
|
+
async createLabel(input, auth2 = SERVICE14) {
|
|
2244
2511
|
return this.ctx.http.request({
|
|
2245
2512
|
method: "POST",
|
|
2246
2513
|
path: this.base(),
|
|
@@ -2249,7 +2516,7 @@ var LabelService = class {
|
|
|
2249
2516
|
});
|
|
2250
2517
|
}
|
|
2251
2518
|
/** Replace a label by id. */
|
|
2252
|
-
async updateLabel(labelId, input, auth2 =
|
|
2519
|
+
async updateLabel(labelId, input, auth2 = SERVICE14) {
|
|
2253
2520
|
return this.ctx.http.request({
|
|
2254
2521
|
method: "PUT",
|
|
2255
2522
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2258,7 +2525,7 @@ var LabelService = class {
|
|
|
2258
2525
|
});
|
|
2259
2526
|
}
|
|
2260
2527
|
/** Partially update a label by id. */
|
|
2261
|
-
async patchLabel(labelId, patch, auth2 =
|
|
2528
|
+
async patchLabel(labelId, patch, auth2 = SERVICE14) {
|
|
2262
2529
|
return this.ctx.http.request({
|
|
2263
2530
|
method: "PATCH",
|
|
2264
2531
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2267,7 +2534,7 @@ var LabelService = class {
|
|
|
2267
2534
|
});
|
|
2268
2535
|
}
|
|
2269
2536
|
/** Delete a label by id. */
|
|
2270
|
-
async deleteLabel(labelId, auth2 =
|
|
2537
|
+
async deleteLabel(labelId, auth2 = SERVICE14) {
|
|
2271
2538
|
await this.ctx.http.request({
|
|
2272
2539
|
method: "DELETE",
|
|
2273
2540
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2277,7 +2544,7 @@ var LabelService = class {
|
|
|
2277
2544
|
};
|
|
2278
2545
|
|
|
2279
2546
|
// src/services/country.ts
|
|
2280
|
-
var
|
|
2547
|
+
var SERVICE15 = { kind: "service" };
|
|
2281
2548
|
var CountryService = class {
|
|
2282
2549
|
constructor(ctx) {
|
|
2283
2550
|
this.ctx = ctx;
|
|
@@ -2288,7 +2555,7 @@ var CountryService = class {
|
|
|
2288
2555
|
return `/country/${this.ctx.tenant}`;
|
|
2289
2556
|
}
|
|
2290
2557
|
/** List all countries. */
|
|
2291
|
-
async listCountries(query = {}, auth2 =
|
|
2558
|
+
async listCountries(query = {}, auth2 = SERVICE15) {
|
|
2292
2559
|
return this.ctx.http.request({
|
|
2293
2560
|
method: "GET",
|
|
2294
2561
|
path: `${this.base()}/countries`,
|
|
@@ -2297,7 +2564,7 @@ var CountryService = class {
|
|
|
2297
2564
|
});
|
|
2298
2565
|
}
|
|
2299
2566
|
/** Retrieve one country by code. */
|
|
2300
|
-
async getCountry(countryCode, auth2 =
|
|
2567
|
+
async getCountry(countryCode, auth2 = SERVICE15) {
|
|
2301
2568
|
return this.ctx.http.request({
|
|
2302
2569
|
method: "GET",
|
|
2303
2570
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -2305,7 +2572,7 @@ var CountryService = class {
|
|
|
2305
2572
|
});
|
|
2306
2573
|
}
|
|
2307
2574
|
/** Partially update a country by code. Resolves once accepted (no response body). */
|
|
2308
|
-
async patchCountry(countryCode, patch, auth2 =
|
|
2575
|
+
async patchCountry(countryCode, patch, auth2 = SERVICE15) {
|
|
2309
2576
|
await this.ctx.http.request({
|
|
2310
2577
|
method: "PATCH",
|
|
2311
2578
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -2314,7 +2581,7 @@ var CountryService = class {
|
|
|
2314
2581
|
});
|
|
2315
2582
|
}
|
|
2316
2583
|
/** List all regions. */
|
|
2317
|
-
async listRegions(query = {}, auth2 =
|
|
2584
|
+
async listRegions(query = {}, auth2 = SERVICE15) {
|
|
2318
2585
|
return this.ctx.http.request({
|
|
2319
2586
|
method: "GET",
|
|
2320
2587
|
path: `${this.base()}/regions`,
|
|
@@ -2323,7 +2590,7 @@ var CountryService = class {
|
|
|
2323
2590
|
});
|
|
2324
2591
|
}
|
|
2325
2592
|
/** Retrieve one region by code. */
|
|
2326
|
-
async getRegion(regionCode, auth2 =
|
|
2593
|
+
async getRegion(regionCode, auth2 = SERVICE15) {
|
|
2327
2594
|
return this.ctx.http.request({
|
|
2328
2595
|
method: "GET",
|
|
2329
2596
|
path: `${this.base()}/regions/${encodeURIComponent(regionCode)}`,
|
|
@@ -2333,7 +2600,7 @@ var CountryService = class {
|
|
|
2333
2600
|
};
|
|
2334
2601
|
|
|
2335
2602
|
// src/services/currency.ts
|
|
2336
|
-
var
|
|
2603
|
+
var SERVICE16 = { kind: "service" };
|
|
2337
2604
|
var CurrencyService = class {
|
|
2338
2605
|
constructor(ctx) {
|
|
2339
2606
|
this.ctx = ctx;
|
|
@@ -2345,7 +2612,7 @@ var CurrencyService = class {
|
|
|
2345
2612
|
}
|
|
2346
2613
|
// --- Currencies ---
|
|
2347
2614
|
/** List all currencies. */
|
|
2348
|
-
async listCurrencies(query = {}, auth2 =
|
|
2615
|
+
async listCurrencies(query = {}, auth2 = SERVICE16) {
|
|
2349
2616
|
return this.ctx.http.request({
|
|
2350
2617
|
method: "GET",
|
|
2351
2618
|
path: `${this.base()}/currencies`,
|
|
@@ -2354,7 +2621,7 @@ var CurrencyService = class {
|
|
|
2354
2621
|
});
|
|
2355
2622
|
}
|
|
2356
2623
|
/** Retrieve one currency by code. */
|
|
2357
|
-
async getCurrency(code, auth2 =
|
|
2624
|
+
async getCurrency(code, auth2 = SERVICE16) {
|
|
2358
2625
|
return this.ctx.http.request({
|
|
2359
2626
|
method: "GET",
|
|
2360
2627
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -2362,7 +2629,7 @@ var CurrencyService = class {
|
|
|
2362
2629
|
});
|
|
2363
2630
|
}
|
|
2364
2631
|
/** Create a currency. */
|
|
2365
|
-
async createCurrency(input, auth2 =
|
|
2632
|
+
async createCurrency(input, auth2 = SERVICE16) {
|
|
2366
2633
|
return this.ctx.http.request({
|
|
2367
2634
|
method: "POST",
|
|
2368
2635
|
path: `${this.base()}/currencies`,
|
|
@@ -2371,7 +2638,7 @@ var CurrencyService = class {
|
|
|
2371
2638
|
});
|
|
2372
2639
|
}
|
|
2373
2640
|
/** Update a currency by code. */
|
|
2374
|
-
async updateCurrency(code, input, auth2 =
|
|
2641
|
+
async updateCurrency(code, input, auth2 = SERVICE16) {
|
|
2375
2642
|
return this.ctx.http.request({
|
|
2376
2643
|
method: "PUT",
|
|
2377
2644
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -2380,7 +2647,7 @@ var CurrencyService = class {
|
|
|
2380
2647
|
});
|
|
2381
2648
|
}
|
|
2382
2649
|
/** Delete a currency by code. */
|
|
2383
|
-
async deleteCurrency(code, auth2 =
|
|
2650
|
+
async deleteCurrency(code, auth2 = SERVICE16) {
|
|
2384
2651
|
await this.ctx.http.request({
|
|
2385
2652
|
method: "DELETE",
|
|
2386
2653
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -2389,7 +2656,7 @@ var CurrencyService = class {
|
|
|
2389
2656
|
}
|
|
2390
2657
|
// --- Exchange rates ---
|
|
2391
2658
|
/** List all exchange rates. */
|
|
2392
|
-
async listExchangeRates(query = {}, auth2 =
|
|
2659
|
+
async listExchangeRates(query = {}, auth2 = SERVICE16) {
|
|
2393
2660
|
return this.ctx.http.request({
|
|
2394
2661
|
method: "GET",
|
|
2395
2662
|
path: `${this.base()}/exchanges`,
|
|
@@ -2398,7 +2665,7 @@ var CurrencyService = class {
|
|
|
2398
2665
|
});
|
|
2399
2666
|
}
|
|
2400
2667
|
/** Retrieve one exchange rate by code. */
|
|
2401
|
-
async getExchangeRate(code, auth2 =
|
|
2668
|
+
async getExchangeRate(code, auth2 = SERVICE16) {
|
|
2402
2669
|
return this.ctx.http.request({
|
|
2403
2670
|
method: "GET",
|
|
2404
2671
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -2406,7 +2673,7 @@ var CurrencyService = class {
|
|
|
2406
2673
|
});
|
|
2407
2674
|
}
|
|
2408
2675
|
/** Create an exchange rate. */
|
|
2409
|
-
async createExchangeRate(input, auth2 =
|
|
2676
|
+
async createExchangeRate(input, auth2 = SERVICE16) {
|
|
2410
2677
|
return this.ctx.http.request({
|
|
2411
2678
|
method: "POST",
|
|
2412
2679
|
path: `${this.base()}/exchanges`,
|
|
@@ -2415,7 +2682,7 @@ var CurrencyService = class {
|
|
|
2415
2682
|
});
|
|
2416
2683
|
}
|
|
2417
2684
|
/** Update an exchange rate by code. */
|
|
2418
|
-
async updateExchangeRate(code, input, auth2 =
|
|
2685
|
+
async updateExchangeRate(code, input, auth2 = SERVICE16) {
|
|
2419
2686
|
return this.ctx.http.request({
|
|
2420
2687
|
method: "PUT",
|
|
2421
2688
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -2424,7 +2691,7 @@ var CurrencyService = class {
|
|
|
2424
2691
|
});
|
|
2425
2692
|
}
|
|
2426
2693
|
/** Delete an exchange rate by code. */
|
|
2427
|
-
async deleteExchangeRate(code, auth2 =
|
|
2694
|
+
async deleteExchangeRate(code, auth2 = SERVICE16) {
|
|
2428
2695
|
await this.ctx.http.request({
|
|
2429
2696
|
method: "DELETE",
|
|
2430
2697
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -2434,7 +2701,7 @@ var CurrencyService = class {
|
|
|
2434
2701
|
};
|
|
2435
2702
|
|
|
2436
2703
|
// src/services/shipping.ts
|
|
2437
|
-
var
|
|
2704
|
+
var SERVICE17 = { kind: "service" };
|
|
2438
2705
|
var ShippingService = class {
|
|
2439
2706
|
constructor(ctx) {
|
|
2440
2707
|
this.ctx = ctx;
|
|
@@ -2449,7 +2716,7 @@ var ShippingService = class {
|
|
|
2449
2716
|
}
|
|
2450
2717
|
// --- Sites ---
|
|
2451
2718
|
/** Find shipping-related sites by postal code (`POST /findSite`). */
|
|
2452
|
-
async findSites(input, auth2 =
|
|
2719
|
+
async findSites(input, auth2 = SERVICE17) {
|
|
2453
2720
|
return this.ctx.http.request({
|
|
2454
2721
|
method: "POST",
|
|
2455
2722
|
path: `${this.base()}/findSite`,
|
|
@@ -2459,7 +2726,7 @@ var ShippingService = class {
|
|
|
2459
2726
|
}
|
|
2460
2727
|
// --- Zones ---
|
|
2461
2728
|
/** List shipping zones for a site. */
|
|
2462
|
-
async listZones(site, query = {}, auth2 =
|
|
2729
|
+
async listZones(site, query = {}, auth2 = SERVICE17) {
|
|
2463
2730
|
return this.ctx.http.request({
|
|
2464
2731
|
method: "GET",
|
|
2465
2732
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -2468,7 +2735,7 @@ var ShippingService = class {
|
|
|
2468
2735
|
});
|
|
2469
2736
|
}
|
|
2470
2737
|
/** Retrieve one shipping zone. */
|
|
2471
|
-
async getZone(site, zoneId, auth2 =
|
|
2738
|
+
async getZone(site, zoneId, auth2 = SERVICE17) {
|
|
2472
2739
|
return this.ctx.http.request({
|
|
2473
2740
|
method: "GET",
|
|
2474
2741
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2476,7 +2743,7 @@ var ShippingService = class {
|
|
|
2476
2743
|
});
|
|
2477
2744
|
}
|
|
2478
2745
|
/** Create a shipping zone. */
|
|
2479
|
-
async createZone(site, zone, auth2 =
|
|
2746
|
+
async createZone(site, zone, auth2 = SERVICE17) {
|
|
2480
2747
|
return this.ctx.http.request({
|
|
2481
2748
|
method: "POST",
|
|
2482
2749
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -2485,7 +2752,7 @@ var ShippingService = class {
|
|
|
2485
2752
|
});
|
|
2486
2753
|
}
|
|
2487
2754
|
/** Replace a shipping zone. */
|
|
2488
|
-
async updateZone(site, zoneId, zone, auth2 =
|
|
2755
|
+
async updateZone(site, zoneId, zone, auth2 = SERVICE17) {
|
|
2489
2756
|
await this.ctx.http.request({
|
|
2490
2757
|
method: "PUT",
|
|
2491
2758
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2494,7 +2761,7 @@ var ShippingService = class {
|
|
|
2494
2761
|
});
|
|
2495
2762
|
}
|
|
2496
2763
|
/** Partially update a shipping zone. */
|
|
2497
|
-
async patchZone(site, zoneId, patch, auth2 =
|
|
2764
|
+
async patchZone(site, zoneId, patch, auth2 = SERVICE17) {
|
|
2498
2765
|
await this.ctx.http.request({
|
|
2499
2766
|
method: "PATCH",
|
|
2500
2767
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2503,7 +2770,7 @@ var ShippingService = class {
|
|
|
2503
2770
|
});
|
|
2504
2771
|
}
|
|
2505
2772
|
/** Delete a shipping zone. */
|
|
2506
|
-
async deleteZone(site, zoneId, auth2 =
|
|
2773
|
+
async deleteZone(site, zoneId, auth2 = SERVICE17) {
|
|
2507
2774
|
await this.ctx.http.request({
|
|
2508
2775
|
method: "DELETE",
|
|
2509
2776
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2512,7 +2779,7 @@ var ShippingService = class {
|
|
|
2512
2779
|
}
|
|
2513
2780
|
// --- Methods (per zone) ---
|
|
2514
2781
|
/** List shipping methods of a zone. */
|
|
2515
|
-
async listMethods(site, zoneId, query = {}, auth2 =
|
|
2782
|
+
async listMethods(site, zoneId, query = {}, auth2 = SERVICE17) {
|
|
2516
2783
|
return this.ctx.http.request({
|
|
2517
2784
|
method: "GET",
|
|
2518
2785
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -2521,7 +2788,7 @@ var ShippingService = class {
|
|
|
2521
2788
|
});
|
|
2522
2789
|
}
|
|
2523
2790
|
/** Retrieve one shipping method. */
|
|
2524
|
-
async getMethod(site, zoneId, methodId, auth2 =
|
|
2791
|
+
async getMethod(site, zoneId, methodId, auth2 = SERVICE17) {
|
|
2525
2792
|
return this.ctx.http.request({
|
|
2526
2793
|
method: "GET",
|
|
2527
2794
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2529,7 +2796,7 @@ var ShippingService = class {
|
|
|
2529
2796
|
});
|
|
2530
2797
|
}
|
|
2531
2798
|
/** Create a shipping method in a zone. */
|
|
2532
|
-
async createMethod(site, zoneId, method, auth2 =
|
|
2799
|
+
async createMethod(site, zoneId, method, auth2 = SERVICE17) {
|
|
2533
2800
|
return this.ctx.http.request({
|
|
2534
2801
|
method: "POST",
|
|
2535
2802
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -2538,7 +2805,7 @@ var ShippingService = class {
|
|
|
2538
2805
|
});
|
|
2539
2806
|
}
|
|
2540
2807
|
/** Replace a shipping method. */
|
|
2541
|
-
async updateMethod(site, zoneId, methodId, method, auth2 =
|
|
2808
|
+
async updateMethod(site, zoneId, methodId, method, auth2 = SERVICE17) {
|
|
2542
2809
|
await this.ctx.http.request({
|
|
2543
2810
|
method: "PUT",
|
|
2544
2811
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2547,7 +2814,7 @@ var ShippingService = class {
|
|
|
2547
2814
|
});
|
|
2548
2815
|
}
|
|
2549
2816
|
/** Partially update a shipping method. */
|
|
2550
|
-
async patchMethod(site, zoneId, methodId, patch, auth2 =
|
|
2817
|
+
async patchMethod(site, zoneId, methodId, patch, auth2 = SERVICE17) {
|
|
2551
2818
|
await this.ctx.http.request({
|
|
2552
2819
|
method: "PATCH",
|
|
2553
2820
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2556,7 +2823,7 @@ var ShippingService = class {
|
|
|
2556
2823
|
});
|
|
2557
2824
|
}
|
|
2558
2825
|
/** Delete a shipping method. */
|
|
2559
|
-
async deleteMethod(site, zoneId, methodId, auth2 =
|
|
2826
|
+
async deleteMethod(site, zoneId, methodId, auth2 = SERVICE17) {
|
|
2560
2827
|
await this.ctx.http.request({
|
|
2561
2828
|
method: "DELETE",
|
|
2562
2829
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2565,7 +2832,7 @@ var ShippingService = class {
|
|
|
2565
2832
|
}
|
|
2566
2833
|
// --- Cost / quote ---
|
|
2567
2834
|
/** Calculate the final shipping cost (`POST /quote`). */
|
|
2568
|
-
async quote(site, input, auth2 =
|
|
2835
|
+
async quote(site, input, auth2 = SERVICE17) {
|
|
2569
2836
|
return this.ctx.http.request({
|
|
2570
2837
|
method: "POST",
|
|
2571
2838
|
path: `${this.siteBase(site)}/quote`,
|
|
@@ -2574,7 +2841,7 @@ var ShippingService = class {
|
|
|
2574
2841
|
});
|
|
2575
2842
|
}
|
|
2576
2843
|
/** Calculate the minimum shipping cost (`POST /quote/minimum`). */
|
|
2577
|
-
async quoteMinimum(site, input, auth2 =
|
|
2844
|
+
async quoteMinimum(site, input, auth2 = SERVICE17) {
|
|
2578
2845
|
return this.ctx.http.request({
|
|
2579
2846
|
method: "POST",
|
|
2580
2847
|
path: `${this.siteBase(site)}/quote/minimum`,
|
|
@@ -2583,7 +2850,7 @@ var ShippingService = class {
|
|
|
2583
2850
|
});
|
|
2584
2851
|
}
|
|
2585
2852
|
/** Calculate the shipping cost for a given slot (`POST /quote/slot`). */
|
|
2586
|
-
async quoteSlot(site, input, auth2 =
|
|
2853
|
+
async quoteSlot(site, input, auth2 = SERVICE17) {
|
|
2587
2854
|
return this.ctx.http.request({
|
|
2588
2855
|
method: "POST",
|
|
2589
2856
|
path: `${this.siteBase(site)}/quote/slot`,
|
|
@@ -2593,7 +2860,7 @@ var ShippingService = class {
|
|
|
2593
2860
|
}
|
|
2594
2861
|
// --- Groups ---
|
|
2595
2862
|
/** List shipping groups for a site. */
|
|
2596
|
-
async listGroups(site, query = {}, auth2 =
|
|
2863
|
+
async listGroups(site, query = {}, auth2 = SERVICE17) {
|
|
2597
2864
|
return this.ctx.http.request({
|
|
2598
2865
|
method: "GET",
|
|
2599
2866
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -2602,7 +2869,7 @@ var ShippingService = class {
|
|
|
2602
2869
|
});
|
|
2603
2870
|
}
|
|
2604
2871
|
/** Retrieve one shipping group. */
|
|
2605
|
-
async getGroup(site, groupId, auth2 =
|
|
2872
|
+
async getGroup(site, groupId, auth2 = SERVICE17) {
|
|
2606
2873
|
return this.ctx.http.request({
|
|
2607
2874
|
method: "GET",
|
|
2608
2875
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -2610,7 +2877,7 @@ var ShippingService = class {
|
|
|
2610
2877
|
});
|
|
2611
2878
|
}
|
|
2612
2879
|
/** Create a shipping group. */
|
|
2613
|
-
async createGroup(site, group, auth2 =
|
|
2880
|
+
async createGroup(site, group, auth2 = SERVICE17) {
|
|
2614
2881
|
return this.ctx.http.request({
|
|
2615
2882
|
method: "POST",
|
|
2616
2883
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -2619,7 +2886,7 @@ var ShippingService = class {
|
|
|
2619
2886
|
});
|
|
2620
2887
|
}
|
|
2621
2888
|
/** Replace a shipping group. */
|
|
2622
|
-
async updateGroup(site, groupId, group, auth2 =
|
|
2889
|
+
async updateGroup(site, groupId, group, auth2 = SERVICE17) {
|
|
2623
2890
|
await this.ctx.http.request({
|
|
2624
2891
|
method: "PUT",
|
|
2625
2892
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -2628,7 +2895,7 @@ var ShippingService = class {
|
|
|
2628
2895
|
});
|
|
2629
2896
|
}
|
|
2630
2897
|
/** Delete a shipping group. */
|
|
2631
|
-
async deleteGroup(site, groupId, auth2 =
|
|
2898
|
+
async deleteGroup(site, groupId, auth2 = SERVICE17) {
|
|
2632
2899
|
await this.ctx.http.request({
|
|
2633
2900
|
method: "DELETE",
|
|
2634
2901
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -2637,7 +2904,7 @@ var ShippingService = class {
|
|
|
2637
2904
|
}
|
|
2638
2905
|
// --- Customer-group relations ---
|
|
2639
2906
|
/** List customer-group relations for a site. */
|
|
2640
|
-
async listCgRelations(site, query = {}, auth2 =
|
|
2907
|
+
async listCgRelations(site, query = {}, auth2 = SERVICE17) {
|
|
2641
2908
|
return this.ctx.http.request({
|
|
2642
2909
|
method: "GET",
|
|
2643
2910
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -2646,7 +2913,7 @@ var ShippingService = class {
|
|
|
2646
2913
|
});
|
|
2647
2914
|
}
|
|
2648
2915
|
/** Retrieve a customer's customer-group relations. */
|
|
2649
|
-
async getCgRelations(site, customerId, auth2 =
|
|
2916
|
+
async getCgRelations(site, customerId, auth2 = SERVICE17) {
|
|
2650
2917
|
return this.ctx.http.request({
|
|
2651
2918
|
method: "GET",
|
|
2652
2919
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -2654,7 +2921,7 @@ var ShippingService = class {
|
|
|
2654
2921
|
});
|
|
2655
2922
|
}
|
|
2656
2923
|
/** Create a customer-group relation. */
|
|
2657
|
-
async createCgRelation(site, relation, auth2 =
|
|
2924
|
+
async createCgRelation(site, relation, auth2 = SERVICE17) {
|
|
2658
2925
|
return this.ctx.http.request({
|
|
2659
2926
|
method: "POST",
|
|
2660
2927
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -2663,7 +2930,7 @@ var ShippingService = class {
|
|
|
2663
2930
|
});
|
|
2664
2931
|
}
|
|
2665
2932
|
/** Update a customer's customer-group relations. */
|
|
2666
|
-
async updateCgRelations(site, customerId, relation, auth2 =
|
|
2933
|
+
async updateCgRelations(site, customerId, relation, auth2 = SERVICE17) {
|
|
2667
2934
|
await this.ctx.http.request({
|
|
2668
2935
|
method: "PUT",
|
|
2669
2936
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -2672,7 +2939,7 @@ var ShippingService = class {
|
|
|
2672
2939
|
});
|
|
2673
2940
|
}
|
|
2674
2941
|
/** Delete a customer's customer-group relation. */
|
|
2675
|
-
async deleteCgRelation(site, customerId, auth2 =
|
|
2942
|
+
async deleteCgRelation(site, customerId, auth2 = SERVICE17) {
|
|
2676
2943
|
await this.ctx.http.request({
|
|
2677
2944
|
method: "DELETE",
|
|
2678
2945
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -2681,7 +2948,7 @@ var ShippingService = class {
|
|
|
2681
2948
|
}
|
|
2682
2949
|
// --- Phase 2: delivery windows ---
|
|
2683
2950
|
/** Retrieve delivery windows for a delivery area + cart. */
|
|
2684
|
-
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 =
|
|
2951
|
+
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 = SERVICE17) {
|
|
2685
2952
|
return this.ctx.http.request({
|
|
2686
2953
|
method: "GET",
|
|
2687
2954
|
path: `${this.base()}/areaDeliveryTimes/${encodeURIComponent(deliveryAreaId)}/${encodeURIComponent(cartId)}`,
|
|
@@ -2689,7 +2956,7 @@ var ShippingService = class {
|
|
|
2689
2956
|
});
|
|
2690
2957
|
}
|
|
2691
2958
|
/** Retrieve delivery windows for a cart. */
|
|
2692
|
-
async getCartDeliveryWindows(cartId, auth2 =
|
|
2959
|
+
async getCartDeliveryWindows(cartId, auth2 = SERVICE17) {
|
|
2693
2960
|
return this.ctx.http.request({
|
|
2694
2961
|
method: "GET",
|
|
2695
2962
|
path: `${this.base()}/actualDeliveryWindows/${encodeURIComponent(cartId)}`,
|
|
@@ -2697,7 +2964,7 @@ var ShippingService = class {
|
|
|
2697
2964
|
});
|
|
2698
2965
|
}
|
|
2699
2966
|
/** Increment the delivery-window counter. */
|
|
2700
|
-
async incrementDeliveryWindowCounter(input, auth2 =
|
|
2967
|
+
async incrementDeliveryWindowCounter(input, auth2 = SERVICE17) {
|
|
2701
2968
|
await this.ctx.http.request({
|
|
2702
2969
|
method: "POST",
|
|
2703
2970
|
path: `${this.base()}/actualDeliveryWindows/incrementCounter`,
|
|
@@ -2706,7 +2973,7 @@ var ShippingService = class {
|
|
|
2706
2973
|
});
|
|
2707
2974
|
}
|
|
2708
2975
|
/** Validate a delivery window. Resolves when valid; throws otherwise. */
|
|
2709
|
-
async validateDeliveryWindow(input, auth2 =
|
|
2976
|
+
async validateDeliveryWindow(input, auth2 = SERVICE17) {
|
|
2710
2977
|
await this.ctx.http.request({
|
|
2711
2978
|
method: "POST",
|
|
2712
2979
|
path: `${this.base()}/deliveryWindowValidation`,
|
|
@@ -2716,7 +2983,7 @@ var ShippingService = class {
|
|
|
2716
2983
|
}
|
|
2717
2984
|
// --- Phase 2: delivery times ---
|
|
2718
2985
|
/** List all delivery times. */
|
|
2719
|
-
async listDeliveryTimes(query = {}, auth2 =
|
|
2986
|
+
async listDeliveryTimes(query = {}, auth2 = SERVICE17) {
|
|
2720
2987
|
return this.ctx.http.request({
|
|
2721
2988
|
method: "GET",
|
|
2722
2989
|
path: `${this.base()}/delivery-times`,
|
|
@@ -2725,7 +2992,7 @@ var ShippingService = class {
|
|
|
2725
2992
|
});
|
|
2726
2993
|
}
|
|
2727
2994
|
/** Retrieve one delivery time. */
|
|
2728
|
-
async getDeliveryTime(deliveryTimeId, auth2 =
|
|
2995
|
+
async getDeliveryTime(deliveryTimeId, auth2 = SERVICE17) {
|
|
2729
2996
|
return this.ctx.http.request({
|
|
2730
2997
|
method: "GET",
|
|
2731
2998
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -2733,7 +3000,7 @@ var ShippingService = class {
|
|
|
2733
3000
|
});
|
|
2734
3001
|
}
|
|
2735
3002
|
/** Create a delivery time. */
|
|
2736
|
-
async createDeliveryTime(input, auth2 =
|
|
3003
|
+
async createDeliveryTime(input, auth2 = SERVICE17) {
|
|
2737
3004
|
return this.ctx.http.request({
|
|
2738
3005
|
method: "POST",
|
|
2739
3006
|
path: `${this.base()}/delivery-times`,
|
|
@@ -2742,7 +3009,7 @@ var ShippingService = class {
|
|
|
2742
3009
|
});
|
|
2743
3010
|
}
|
|
2744
3011
|
/** Create multiple delivery times (`POST /delivery-times/bulk`). */
|
|
2745
|
-
async createDeliveryTimesBulk(inputs, auth2 =
|
|
3012
|
+
async createDeliveryTimesBulk(inputs, auth2 = SERVICE17) {
|
|
2746
3013
|
return this.ctx.http.request({
|
|
2747
3014
|
method: "POST",
|
|
2748
3015
|
path: `${this.base()}/delivery-times/bulk`,
|
|
@@ -2751,7 +3018,7 @@ var ShippingService = class {
|
|
|
2751
3018
|
});
|
|
2752
3019
|
}
|
|
2753
3020
|
/** Replace a delivery time. */
|
|
2754
|
-
async updateDeliveryTime(deliveryTimeId, input, auth2 =
|
|
3021
|
+
async updateDeliveryTime(deliveryTimeId, input, auth2 = SERVICE17) {
|
|
2755
3022
|
await this.ctx.http.request({
|
|
2756
3023
|
method: "PUT",
|
|
2757
3024
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -2760,7 +3027,7 @@ var ShippingService = class {
|
|
|
2760
3027
|
});
|
|
2761
3028
|
}
|
|
2762
3029
|
/** Partially update a delivery time (JSON-Patch op array). */
|
|
2763
|
-
async patchDeliveryTime(deliveryTimeId, ops, auth2 =
|
|
3030
|
+
async patchDeliveryTime(deliveryTimeId, ops, auth2 = SERVICE17) {
|
|
2764
3031
|
await this.ctx.http.request({
|
|
2765
3032
|
method: "PATCH",
|
|
2766
3033
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -2769,7 +3036,7 @@ var ShippingService = class {
|
|
|
2769
3036
|
});
|
|
2770
3037
|
}
|
|
2771
3038
|
/** Delete a delivery time. */
|
|
2772
|
-
async deleteDeliveryTime(deliveryTimeId, auth2 =
|
|
3039
|
+
async deleteDeliveryTime(deliveryTimeId, auth2 = SERVICE17) {
|
|
2773
3040
|
await this.ctx.http.request({
|
|
2774
3041
|
method: "DELETE",
|
|
2775
3042
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -2778,7 +3045,7 @@ var ShippingService = class {
|
|
|
2778
3045
|
}
|
|
2779
3046
|
// --- Phase 2: delivery time slots ---
|
|
2780
3047
|
/** List slots of a delivery time. */
|
|
2781
|
-
async listSlots(deliveryTimeId, auth2 =
|
|
3048
|
+
async listSlots(deliveryTimeId, auth2 = SERVICE17) {
|
|
2782
3049
|
return this.ctx.http.request({
|
|
2783
3050
|
method: "GET",
|
|
2784
3051
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -2786,7 +3053,7 @@ var ShippingService = class {
|
|
|
2786
3053
|
});
|
|
2787
3054
|
}
|
|
2788
3055
|
/** Retrieve one slot. */
|
|
2789
|
-
async getSlot(deliveryTimeId, slotId, auth2 =
|
|
3056
|
+
async getSlot(deliveryTimeId, slotId, auth2 = SERVICE17) {
|
|
2790
3057
|
return this.ctx.http.request({
|
|
2791
3058
|
method: "GET",
|
|
2792
3059
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -2794,7 +3061,7 @@ var ShippingService = class {
|
|
|
2794
3061
|
});
|
|
2795
3062
|
}
|
|
2796
3063
|
/** Create a slot in a delivery time. */
|
|
2797
|
-
async createSlot(deliveryTimeId, input, auth2 =
|
|
3064
|
+
async createSlot(deliveryTimeId, input, auth2 = SERVICE17) {
|
|
2798
3065
|
return this.ctx.http.request({
|
|
2799
3066
|
method: "POST",
|
|
2800
3067
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -2803,7 +3070,7 @@ var ShippingService = class {
|
|
|
2803
3070
|
});
|
|
2804
3071
|
}
|
|
2805
3072
|
/** Replace a slot. */
|
|
2806
|
-
async updateSlot(deliveryTimeId, slotId, input, auth2 =
|
|
3073
|
+
async updateSlot(deliveryTimeId, slotId, input, auth2 = SERVICE17) {
|
|
2807
3074
|
await this.ctx.http.request({
|
|
2808
3075
|
method: "PUT",
|
|
2809
3076
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -2812,7 +3079,7 @@ var ShippingService = class {
|
|
|
2812
3079
|
});
|
|
2813
3080
|
}
|
|
2814
3081
|
/** Partially update a slot (JSON-Patch op array). */
|
|
2815
|
-
async patchSlot(deliveryTimeId, slotId, ops, auth2 =
|
|
3082
|
+
async patchSlot(deliveryTimeId, slotId, ops, auth2 = SERVICE17) {
|
|
2816
3083
|
await this.ctx.http.request({
|
|
2817
3084
|
method: "PATCH",
|
|
2818
3085
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -2821,7 +3088,7 @@ var ShippingService = class {
|
|
|
2821
3088
|
});
|
|
2822
3089
|
}
|
|
2823
3090
|
/** Delete a slot. */
|
|
2824
|
-
async deleteSlot(deliveryTimeId, slotId, auth2 =
|
|
3091
|
+
async deleteSlot(deliveryTimeId, slotId, auth2 = SERVICE17) {
|
|
2825
3092
|
await this.ctx.http.request({
|
|
2826
3093
|
method: "DELETE",
|
|
2827
3094
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -2829,7 +3096,7 @@ var ShippingService = class {
|
|
|
2829
3096
|
});
|
|
2830
3097
|
}
|
|
2831
3098
|
/** Delete all slots of a delivery time. */
|
|
2832
|
-
async deleteAllSlots(deliveryTimeId, auth2 =
|
|
3099
|
+
async deleteAllSlots(deliveryTimeId, auth2 = SERVICE17) {
|
|
2833
3100
|
await this.ctx.http.request({
|
|
2834
3101
|
method: "DELETE",
|
|
2835
3102
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -2838,7 +3105,7 @@ var ShippingService = class {
|
|
|
2838
3105
|
}
|
|
2839
3106
|
// --- Phase 2: delivery cycles ---
|
|
2840
3107
|
/** Generate a delivery cycle (`POST /delivery-cycles/generate`). Returns the cycle id. */
|
|
2841
|
-
async generateDeliveryCycle(input, auth2 =
|
|
3108
|
+
async generateDeliveryCycle(input, auth2 = SERVICE17) {
|
|
2842
3109
|
return this.ctx.http.request({
|
|
2843
3110
|
method: "POST",
|
|
2844
3111
|
path: `${this.base()}/delivery-cycles/generate`,
|
|
@@ -2848,8 +3115,183 @@ var ShippingService = class {
|
|
|
2848
3115
|
}
|
|
2849
3116
|
};
|
|
2850
3117
|
|
|
3118
|
+
// src/services/invoice.ts
|
|
3119
|
+
var SERVICE18 = { kind: "service" };
|
|
3120
|
+
var InvoiceService = class {
|
|
3121
|
+
constructor(ctx) {
|
|
3122
|
+
this.ctx = ctx;
|
|
3123
|
+
}
|
|
3124
|
+
ctx;
|
|
3125
|
+
static channel = "invoice";
|
|
3126
|
+
base() {
|
|
3127
|
+
return `/invoice/${this.ctx.tenant}/jobs/invoices`;
|
|
3128
|
+
}
|
|
3129
|
+
/** Create an invoice-generation job (`POST …/jobs/invoices`, 201). */
|
|
3130
|
+
async createJob(draft, auth2 = SERVICE18) {
|
|
3131
|
+
return this.ctx.http.request({
|
|
3132
|
+
method: "POST",
|
|
3133
|
+
path: this.base(),
|
|
3134
|
+
auth: auth2,
|
|
3135
|
+
body: draft
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
3138
|
+
/** Retrieve a job and its per-order results (`GET …/jobs/invoices/{jobId}`). */
|
|
3139
|
+
async getJob(jobId, auth2 = SERVICE18) {
|
|
3140
|
+
return this.ctx.http.request({
|
|
3141
|
+
method: "GET",
|
|
3142
|
+
path: `${this.base()}/${encodeURIComponent(jobId)}`,
|
|
3143
|
+
auth: auth2
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3148
|
+
// src/services/quote.ts
|
|
3149
|
+
var QuoteService = class {
|
|
3150
|
+
constructor(ctx) {
|
|
3151
|
+
this.ctx = ctx;
|
|
3152
|
+
}
|
|
3153
|
+
ctx;
|
|
3154
|
+
static channel = "quote";
|
|
3155
|
+
quotesBase() {
|
|
3156
|
+
return `/quote/${this.ctx.tenant}/quotes`;
|
|
3157
|
+
}
|
|
3158
|
+
_reasons;
|
|
3159
|
+
/** Quote reasons config (`/quote-reasons`). CRUD sub-resource. */
|
|
3160
|
+
get reasons() {
|
|
3161
|
+
return this._reasons ??= new QuoteReasonsResource(this.ctx);
|
|
3162
|
+
}
|
|
3163
|
+
/** List quotes, wrapped in {@link PaginatedItems}. Pass `{}` for no filter. */
|
|
3164
|
+
async list(query, auth2) {
|
|
3165
|
+
const pageNumber = query.pageNumber ?? 1;
|
|
3166
|
+
const pageSize = query.pageSize ?? 60;
|
|
3167
|
+
const q = { pageNumber, pageSize };
|
|
3168
|
+
if (query.q) q.q = query.q;
|
|
3169
|
+
if (query.sort) q.sort = query.sort;
|
|
3170
|
+
const items = await this.ctx.http.request({
|
|
3171
|
+
method: "GET",
|
|
3172
|
+
path: this.quotesBase(),
|
|
3173
|
+
auth: auth2,
|
|
3174
|
+
query: q
|
|
3175
|
+
});
|
|
3176
|
+
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3177
|
+
}
|
|
3178
|
+
/** Create a quote (`POST /quotes`, 201). */
|
|
3179
|
+
async create(draft, auth2) {
|
|
3180
|
+
return this.ctx.http.request({
|
|
3181
|
+
method: "POST",
|
|
3182
|
+
path: this.quotesBase(),
|
|
3183
|
+
auth: auth2,
|
|
3184
|
+
body: draft
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
/** Retrieve one quote by id. */
|
|
3188
|
+
async get(quoteId, auth2) {
|
|
3189
|
+
return this.ctx.http.request({
|
|
3190
|
+
method: "GET",
|
|
3191
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}`,
|
|
3192
|
+
auth: auth2
|
|
3193
|
+
});
|
|
3194
|
+
}
|
|
3195
|
+
/** Apply an update-op array to a quote (`PATCH /quotes/{id}`, 204). */
|
|
3196
|
+
async update(quoteId, update, auth2) {
|
|
3197
|
+
await this.ctx.http.request({
|
|
3198
|
+
method: "PATCH",
|
|
3199
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}`,
|
|
3200
|
+
auth: auth2,
|
|
3201
|
+
body: update
|
|
3202
|
+
});
|
|
3203
|
+
}
|
|
3204
|
+
/** Delete a quote (`DELETE /quotes/{id}`). Requires the admin `quote_manage` scope. */
|
|
3205
|
+
async delete(quoteId, auth2) {
|
|
3206
|
+
await this.ctx.http.request({
|
|
3207
|
+
method: "DELETE",
|
|
3208
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}`,
|
|
3209
|
+
auth: auth2
|
|
3210
|
+
});
|
|
3211
|
+
}
|
|
3212
|
+
/** Retrieve a quote's change history (`GET /quotes/{id}/history`). */
|
|
3213
|
+
async history(quoteId, auth2) {
|
|
3214
|
+
return this.ctx.http.request({
|
|
3215
|
+
method: "GET",
|
|
3216
|
+
path: `${this.quotesBase()}/${encodeURIComponent(quoteId)}/history`,
|
|
3217
|
+
auth: auth2
|
|
3218
|
+
});
|
|
3219
|
+
}
|
|
3220
|
+
/**
|
|
3221
|
+
* Generate a quote PDF (`POST /quotes/{id}/pdf`). Returns the raw PDF bytes.
|
|
3222
|
+
* Uses `requestRaw` (no typed-error mapping) — a non-2xx is thrown explicitly.
|
|
3223
|
+
*/
|
|
3224
|
+
async generatePdf(quoteId, auth2) {
|
|
3225
|
+
const path = `${this.quotesBase()}/${encodeURIComponent(quoteId)}/pdf`;
|
|
3226
|
+
const res = await this.ctx.http.requestRaw({ method: "POST", path, auth: auth2 });
|
|
3227
|
+
if (!res.ok) {
|
|
3228
|
+
const body = await res.text();
|
|
3229
|
+
throw errorFromResponse(res.status, `POST ${path} failed: ${res.status}`, body);
|
|
3230
|
+
}
|
|
3231
|
+
return await res.blob();
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
var QuoteReasonsResource = class {
|
|
3235
|
+
constructor(ctx) {
|
|
3236
|
+
this.ctx = ctx;
|
|
3237
|
+
}
|
|
3238
|
+
ctx;
|
|
3239
|
+
base() {
|
|
3240
|
+
return `/quote/${this.ctx.tenant}/quote-reasons`;
|
|
3241
|
+
}
|
|
3242
|
+
/** List reasons, wrapped in {@link PaginatedItems}. Pass `{}` for no paging override. */
|
|
3243
|
+
async list(query, auth2) {
|
|
3244
|
+
const pageNumber = query.pageNumber ?? 1;
|
|
3245
|
+
const pageSize = query.pageSize ?? 60;
|
|
3246
|
+
const items = await this.ctx.http.request({
|
|
3247
|
+
method: "GET",
|
|
3248
|
+
path: this.base(),
|
|
3249
|
+
auth: auth2,
|
|
3250
|
+
query: { pageNumber, pageSize }
|
|
3251
|
+
});
|
|
3252
|
+
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3253
|
+
}
|
|
3254
|
+
/** Retrieve one reason by id. */
|
|
3255
|
+
async get(reasonId, auth2) {
|
|
3256
|
+
return this.ctx.http.request({
|
|
3257
|
+
method: "GET",
|
|
3258
|
+
path: `${this.base()}/${encodeURIComponent(reasonId)}`,
|
|
3259
|
+
auth: auth2
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3262
|
+
/** Create a reason (`POST /quote-reasons`). Requires the admin `quote_manage` scope. */
|
|
3263
|
+
async create(draft, auth2) {
|
|
3264
|
+
return this.ctx.http.request({
|
|
3265
|
+
method: "POST",
|
|
3266
|
+
path: this.base(),
|
|
3267
|
+
auth: auth2,
|
|
3268
|
+
body: draft
|
|
3269
|
+
});
|
|
3270
|
+
}
|
|
3271
|
+
/**
|
|
3272
|
+
* Replace a reason (`PUT /quote-reasons/{id}`, 204). `draft.metadata.version`
|
|
3273
|
+
* is required for optimistic locking. Requires the admin `quote_manage` scope.
|
|
3274
|
+
*/
|
|
3275
|
+
async update(reasonId, draft, auth2) {
|
|
3276
|
+
await this.ctx.http.request({
|
|
3277
|
+
method: "PUT",
|
|
3278
|
+
path: `${this.base()}/${encodeURIComponent(reasonId)}`,
|
|
3279
|
+
auth: auth2,
|
|
3280
|
+
body: draft
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3283
|
+
/** Delete a reason (`DELETE /quote-reasons/{id}`). Requires the admin `quote_manage` scope. */
|
|
3284
|
+
async delete(reasonId, auth2) {
|
|
3285
|
+
await this.ctx.http.request({
|
|
3286
|
+
method: "DELETE",
|
|
3287
|
+
path: `${this.base()}/${encodeURIComponent(reasonId)}`,
|
|
3288
|
+
auth: auth2
|
|
3289
|
+
});
|
|
3290
|
+
}
|
|
3291
|
+
};
|
|
3292
|
+
|
|
2851
3293
|
// src/services/returns.ts
|
|
2852
|
-
var
|
|
3294
|
+
var SERVICE19 = { kind: "service" };
|
|
2853
3295
|
var ReturnsService = class {
|
|
2854
3296
|
constructor(ctx) {
|
|
2855
3297
|
this.ctx = ctx;
|
|
@@ -2860,7 +3302,7 @@ var ReturnsService = class {
|
|
|
2860
3302
|
return `/return/${this.ctx.tenant}/returns`;
|
|
2861
3303
|
}
|
|
2862
3304
|
/** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
|
|
2863
|
-
async listReturns(query = {}, auth2 =
|
|
3305
|
+
async listReturns(query = {}, auth2 = SERVICE19) {
|
|
2864
3306
|
return this.ctx.http.request({
|
|
2865
3307
|
method: "GET",
|
|
2866
3308
|
path: this.base(),
|
|
@@ -2869,7 +3311,7 @@ var ReturnsService = class {
|
|
|
2869
3311
|
});
|
|
2870
3312
|
}
|
|
2871
3313
|
/** Retrieve one return by id. */
|
|
2872
|
-
async getReturn(returnId, auth2 =
|
|
3314
|
+
async getReturn(returnId, auth2 = SERVICE19) {
|
|
2873
3315
|
return this.ctx.http.request({
|
|
2874
3316
|
method: "GET",
|
|
2875
3317
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -2877,7 +3319,7 @@ var ReturnsService = class {
|
|
|
2877
3319
|
});
|
|
2878
3320
|
}
|
|
2879
3321
|
/** Create a return. Returns the created `{ id }`. */
|
|
2880
|
-
async createReturn(input, auth2 =
|
|
3322
|
+
async createReturn(input, auth2 = SERVICE19) {
|
|
2881
3323
|
return this.ctx.http.request({
|
|
2882
3324
|
method: "POST",
|
|
2883
3325
|
path: this.base(),
|
|
@@ -2886,7 +3328,7 @@ var ReturnsService = class {
|
|
|
2886
3328
|
});
|
|
2887
3329
|
}
|
|
2888
3330
|
/** Replace a return by id (`PUT`). */
|
|
2889
|
-
async updateReturn(returnId, input, auth2 =
|
|
3331
|
+
async updateReturn(returnId, input, auth2 = SERVICE19) {
|
|
2890
3332
|
await this.ctx.http.request({
|
|
2891
3333
|
method: "PUT",
|
|
2892
3334
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -2895,7 +3337,7 @@ var ReturnsService = class {
|
|
|
2895
3337
|
});
|
|
2896
3338
|
}
|
|
2897
3339
|
/** Partially update a return by id (`PATCH`, JSON-Patch op-array). */
|
|
2898
|
-
async patchReturn(returnId, ops, auth2 =
|
|
3340
|
+
async patchReturn(returnId, ops, auth2 = SERVICE19) {
|
|
2899
3341
|
await this.ctx.http.request({
|
|
2900
3342
|
method: "PATCH",
|
|
2901
3343
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -2904,7 +3346,7 @@ var ReturnsService = class {
|
|
|
2904
3346
|
});
|
|
2905
3347
|
}
|
|
2906
3348
|
/** Delete a return by id. */
|
|
2907
|
-
async deleteReturn(returnId, auth2 =
|
|
3349
|
+
async deleteReturn(returnId, auth2 = SERVICE19) {
|
|
2908
3350
|
await this.ctx.http.request({
|
|
2909
3351
|
method: "DELETE",
|
|
2910
3352
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -2914,7 +3356,7 @@ var ReturnsService = class {
|
|
|
2914
3356
|
};
|
|
2915
3357
|
|
|
2916
3358
|
// src/services/sepa-export.ts
|
|
2917
|
-
var
|
|
3359
|
+
var SERVICE20 = { kind: "service" };
|
|
2918
3360
|
var SepaExportService = class {
|
|
2919
3361
|
constructor(ctx) {
|
|
2920
3362
|
this.ctx = ctx;
|
|
@@ -2925,7 +3367,7 @@ var SepaExportService = class {
|
|
|
2925
3367
|
return `/sepa-export/${this.ctx.tenant}`;
|
|
2926
3368
|
}
|
|
2927
3369
|
/** Retrieve a SEPA export file by id. Returns the raw file content (text). */
|
|
2928
|
-
async getFile(fileId, auth2 =
|
|
3370
|
+
async getFile(fileId, auth2 = SERVICE20) {
|
|
2929
3371
|
const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
|
|
2930
3372
|
const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
|
|
2931
3373
|
if (!res.ok) {
|
|
@@ -2935,7 +3377,7 @@ var SepaExportService = class {
|
|
|
2935
3377
|
return res.text();
|
|
2936
3378
|
}
|
|
2937
3379
|
/** List export jobs. */
|
|
2938
|
-
async listJobs(query = {}, auth2 =
|
|
3380
|
+
async listJobs(query = {}, auth2 = SERVICE20) {
|
|
2939
3381
|
return this.ctx.http.request({
|
|
2940
3382
|
method: "GET",
|
|
2941
3383
|
path: `${this.base()}/jobs`,
|
|
@@ -2944,7 +3386,7 @@ var SepaExportService = class {
|
|
|
2944
3386
|
});
|
|
2945
3387
|
}
|
|
2946
3388
|
/** Create an export job. */
|
|
2947
|
-
async createJob(input, auth2 =
|
|
3389
|
+
async createJob(input, auth2 = SERVICE20) {
|
|
2948
3390
|
return this.ctx.http.request({
|
|
2949
3391
|
method: "POST",
|
|
2950
3392
|
path: `${this.base()}/jobs`,
|
|
@@ -2955,7 +3397,7 @@ var SepaExportService = class {
|
|
|
2955
3397
|
};
|
|
2956
3398
|
|
|
2957
3399
|
// src/services/indexing.ts
|
|
2958
|
-
var
|
|
3400
|
+
var SERVICE21 = { kind: "service" };
|
|
2959
3401
|
var IndexingService = class {
|
|
2960
3402
|
constructor(ctx) {
|
|
2961
3403
|
this.ctx = ctx;
|
|
@@ -2966,11 +3408,11 @@ var IndexingService = class {
|
|
|
2966
3408
|
return `/indexing/${this.ctx.tenant}`;
|
|
2967
3409
|
}
|
|
2968
3410
|
/** List indexing configurations. */
|
|
2969
|
-
async listConfigurations(auth2 =
|
|
3411
|
+
async listConfigurations(auth2 = SERVICE21) {
|
|
2970
3412
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
|
|
2971
3413
|
}
|
|
2972
3414
|
/** Get a configuration by provider name. */
|
|
2973
|
-
async getConfiguration(provider, auth2 =
|
|
3415
|
+
async getConfiguration(provider, auth2 = SERVICE21) {
|
|
2974
3416
|
return this.ctx.http.request({
|
|
2975
3417
|
method: "GET",
|
|
2976
3418
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -2978,7 +3420,7 @@ var IndexingService = class {
|
|
|
2978
3420
|
});
|
|
2979
3421
|
}
|
|
2980
3422
|
/** Create a configuration. */
|
|
2981
|
-
async createConfiguration(input, auth2 =
|
|
3423
|
+
async createConfiguration(input, auth2 = SERVICE21) {
|
|
2982
3424
|
return this.ctx.http.request({
|
|
2983
3425
|
method: "POST",
|
|
2984
3426
|
path: `${this.base()}/configurations`,
|
|
@@ -2987,7 +3429,7 @@ var IndexingService = class {
|
|
|
2987
3429
|
});
|
|
2988
3430
|
}
|
|
2989
3431
|
/** Update a configuration by provider name. */
|
|
2990
|
-
async updateConfiguration(provider, input, auth2 =
|
|
3432
|
+
async updateConfiguration(provider, input, auth2 = SERVICE21) {
|
|
2991
3433
|
await this.ctx.http.request({
|
|
2992
3434
|
method: "PUT",
|
|
2993
3435
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -2996,7 +3438,7 @@ var IndexingService = class {
|
|
|
2996
3438
|
});
|
|
2997
3439
|
}
|
|
2998
3440
|
/** Delete a configuration by provider name. */
|
|
2999
|
-
async deleteConfiguration(provider, auth2 =
|
|
3441
|
+
async deleteConfiguration(provider, auth2 = SERVICE21) {
|
|
3000
3442
|
await this.ctx.http.request({
|
|
3001
3443
|
method: "DELETE",
|
|
3002
3444
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -3004,11 +3446,11 @@ var IndexingService = class {
|
|
|
3004
3446
|
});
|
|
3005
3447
|
}
|
|
3006
3448
|
/** List public indexing configurations. */
|
|
3007
|
-
async listPublicConfigurations(auth2 =
|
|
3449
|
+
async listPublicConfigurations(auth2 = SERVICE21) {
|
|
3008
3450
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
|
|
3009
3451
|
}
|
|
3010
3452
|
/** Get a public configuration by provider name. */
|
|
3011
|
-
async getPublicConfiguration(provider, auth2 =
|
|
3453
|
+
async getPublicConfiguration(provider, auth2 = SERVICE21) {
|
|
3012
3454
|
return this.ctx.http.request({
|
|
3013
3455
|
method: "GET",
|
|
3014
3456
|
path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -3021,7 +3463,7 @@ var IndexingService = class {
|
|
|
3021
3463
|
* (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
|
|
3022
3464
|
* `entityType` is already `IN_PROGRESS`, that running job (`200`).
|
|
3023
3465
|
*/
|
|
3024
|
-
async createReindexJob(input, auth2 =
|
|
3466
|
+
async createReindexJob(input, auth2 = SERVICE21) {
|
|
3025
3467
|
return this.ctx.http.request({
|
|
3026
3468
|
method: "POST",
|
|
3027
3469
|
path: `${this.base()}/reindex-jobs`,
|
|
@@ -3030,7 +3472,7 @@ var IndexingService = class {
|
|
|
3030
3472
|
});
|
|
3031
3473
|
}
|
|
3032
3474
|
/** List reindex jobs (paginated). */
|
|
3033
|
-
async listReindexJobs(opts = {}, auth2 =
|
|
3475
|
+
async listReindexJobs(opts = {}, auth2 = SERVICE21) {
|
|
3034
3476
|
const pageNumber = opts.pageNumber ?? 1;
|
|
3035
3477
|
const pageSize = opts.pageSize ?? 50;
|
|
3036
3478
|
const query = { pageNumber, pageSize };
|
|
@@ -3044,7 +3486,7 @@ var IndexingService = class {
|
|
|
3044
3486
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3045
3487
|
}
|
|
3046
3488
|
/** Fetch one reindex job by id. */
|
|
3047
|
-
async getReindexJob(reindexJobId, auth2 =
|
|
3489
|
+
async getReindexJob(reindexJobId, auth2 = SERVICE21) {
|
|
3048
3490
|
return this.ctx.http.request({
|
|
3049
3491
|
method: "GET",
|
|
3050
3492
|
path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
|
|
@@ -3056,13 +3498,13 @@ var IndexingService = class {
|
|
|
3056
3498
|
* @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
|
|
3057
3499
|
* (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
|
|
3058
3500
|
*/
|
|
3059
|
-
async reindex(input, auth2 =
|
|
3501
|
+
async reindex(input, auth2 = SERVICE21) {
|
|
3060
3502
|
await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
|
|
3061
3503
|
}
|
|
3062
3504
|
};
|
|
3063
3505
|
|
|
3064
3506
|
// src/services/unit-handling.ts
|
|
3065
|
-
var
|
|
3507
|
+
var SERVICE22 = { kind: "service" };
|
|
3066
3508
|
var UnitHandlingService = class {
|
|
3067
3509
|
constructor(ctx) {
|
|
3068
3510
|
this.ctx = ctx;
|
|
@@ -3073,7 +3515,7 @@ var UnitHandlingService = class {
|
|
|
3073
3515
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
3074
3516
|
}
|
|
3075
3517
|
/** Find units (filter/sort/page). */
|
|
3076
|
-
async listUnits(query = {}, auth2 =
|
|
3518
|
+
async listUnits(query = {}, auth2 = SERVICE22) {
|
|
3077
3519
|
return this.ctx.http.request({
|
|
3078
3520
|
method: "GET",
|
|
3079
3521
|
path: `${this.base()}/units`,
|
|
@@ -3082,7 +3524,7 @@ var UnitHandlingService = class {
|
|
|
3082
3524
|
});
|
|
3083
3525
|
}
|
|
3084
3526
|
/** Retrieve a unit by code. */
|
|
3085
|
-
async getUnit(unitCode, auth2 =
|
|
3527
|
+
async getUnit(unitCode, auth2 = SERVICE22) {
|
|
3086
3528
|
return this.ctx.http.request({
|
|
3087
3529
|
method: "GET",
|
|
3088
3530
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -3090,11 +3532,11 @@ var UnitHandlingService = class {
|
|
|
3090
3532
|
});
|
|
3091
3533
|
}
|
|
3092
3534
|
/** Add a new unit. */
|
|
3093
|
-
async createUnit(input, auth2 =
|
|
3535
|
+
async createUnit(input, auth2 = SERVICE22) {
|
|
3094
3536
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
3095
3537
|
}
|
|
3096
3538
|
/** Update a unit by code. */
|
|
3097
|
-
async updateUnit(unitCode, input, auth2 =
|
|
3539
|
+
async updateUnit(unitCode, input, auth2 = SERVICE22) {
|
|
3098
3540
|
await this.ctx.http.request({
|
|
3099
3541
|
method: "PUT",
|
|
3100
3542
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -3103,7 +3545,7 @@ var UnitHandlingService = class {
|
|
|
3103
3545
|
});
|
|
3104
3546
|
}
|
|
3105
3547
|
/** Delete a unit by code. */
|
|
3106
|
-
async deleteUnit(unitCode, auth2 =
|
|
3548
|
+
async deleteUnit(unitCode, auth2 = SERVICE22) {
|
|
3107
3549
|
await this.ctx.http.request({
|
|
3108
3550
|
method: "DELETE",
|
|
3109
3551
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -3111,7 +3553,7 @@ var UnitHandlingService = class {
|
|
|
3111
3553
|
});
|
|
3112
3554
|
}
|
|
3113
3555
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
3114
|
-
async deleteUnits(codes, auth2 =
|
|
3556
|
+
async deleteUnits(codes, auth2 = SERVICE22) {
|
|
3115
3557
|
await this.ctx.http.request({
|
|
3116
3558
|
method: "DELETE",
|
|
3117
3559
|
path: `${this.base()}/units`,
|
|
@@ -3120,7 +3562,7 @@ var UnitHandlingService = class {
|
|
|
3120
3562
|
});
|
|
3121
3563
|
}
|
|
3122
3564
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
3123
|
-
async getConversionFactor(input, auth2 =
|
|
3565
|
+
async getConversionFactor(input, auth2 = SERVICE22) {
|
|
3124
3566
|
return this.ctx.http.request({
|
|
3125
3567
|
method: "PUT",
|
|
3126
3568
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -3129,7 +3571,7 @@ var UnitHandlingService = class {
|
|
|
3129
3571
|
});
|
|
3130
3572
|
}
|
|
3131
3573
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
3132
|
-
async convertUnit(input, auth2 =
|
|
3574
|
+
async convertUnit(input, auth2 = SERVICE22) {
|
|
3133
3575
|
return this.ctx.http.request({
|
|
3134
3576
|
method: "PUT",
|
|
3135
3577
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -3138,13 +3580,13 @@ var UnitHandlingService = class {
|
|
|
3138
3580
|
});
|
|
3139
3581
|
}
|
|
3140
3582
|
/** List all unit types. */
|
|
3141
|
-
async listUnitTypes(auth2 =
|
|
3583
|
+
async listUnitTypes(auth2 = SERVICE22) {
|
|
3142
3584
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
3143
3585
|
}
|
|
3144
3586
|
};
|
|
3145
3587
|
|
|
3146
3588
|
// src/services/catalog.ts
|
|
3147
|
-
var
|
|
3589
|
+
var SERVICE23 = { kind: "service" };
|
|
3148
3590
|
var CatalogService = class {
|
|
3149
3591
|
constructor(ctx) {
|
|
3150
3592
|
this.ctx = ctx;
|
|
@@ -3155,7 +3597,7 @@ var CatalogService = class {
|
|
|
3155
3597
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
3156
3598
|
}
|
|
3157
3599
|
/** List catalogs (filtered/sorted). */
|
|
3158
|
-
async listCatalogs(query = {}, auth2 =
|
|
3600
|
+
async listCatalogs(query = {}, auth2 = SERVICE23) {
|
|
3159
3601
|
return this.ctx.http.request({
|
|
3160
3602
|
method: "GET",
|
|
3161
3603
|
path: this.base(),
|
|
@@ -3164,7 +3606,7 @@ var CatalogService = class {
|
|
|
3164
3606
|
});
|
|
3165
3607
|
}
|
|
3166
3608
|
/** Retrieve a catalog by id. */
|
|
3167
|
-
async getCatalog(catalogId, auth2 =
|
|
3609
|
+
async getCatalog(catalogId, auth2 = SERVICE23) {
|
|
3168
3610
|
return this.ctx.http.request({
|
|
3169
3611
|
method: "GET",
|
|
3170
3612
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3172,7 +3614,7 @@ var CatalogService = class {
|
|
|
3172
3614
|
});
|
|
3173
3615
|
}
|
|
3174
3616
|
/** Retrieve all catalogs that contain a category. */
|
|
3175
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
3617
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE23) {
|
|
3176
3618
|
return this.ctx.http.request({
|
|
3177
3619
|
method: "GET",
|
|
3178
3620
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -3180,11 +3622,11 @@ var CatalogService = class {
|
|
|
3180
3622
|
});
|
|
3181
3623
|
}
|
|
3182
3624
|
/** Create a catalog. */
|
|
3183
|
-
async createCatalog(input, auth2 =
|
|
3625
|
+
async createCatalog(input, auth2 = SERVICE23) {
|
|
3184
3626
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
3185
3627
|
}
|
|
3186
3628
|
/** Upsert a catalog by id (`PUT`). */
|
|
3187
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
3629
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE23) {
|
|
3188
3630
|
return this.ctx.http.request({
|
|
3189
3631
|
method: "PUT",
|
|
3190
3632
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3193,7 +3635,7 @@ var CatalogService = class {
|
|
|
3193
3635
|
});
|
|
3194
3636
|
}
|
|
3195
3637
|
/** Partially update a catalog by id (`PATCH`). */
|
|
3196
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
3638
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE23) {
|
|
3197
3639
|
await this.ctx.http.request({
|
|
3198
3640
|
method: "PATCH",
|
|
3199
3641
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3202,7 +3644,7 @@ var CatalogService = class {
|
|
|
3202
3644
|
});
|
|
3203
3645
|
}
|
|
3204
3646
|
/** Remove a catalog by id. */
|
|
3205
|
-
async deleteCatalog(catalogId, auth2 =
|
|
3647
|
+
async deleteCatalog(catalogId, auth2 = SERVICE23) {
|
|
3206
3648
|
await this.ctx.http.request({
|
|
3207
3649
|
method: "DELETE",
|
|
3208
3650
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3212,7 +3654,7 @@ var CatalogService = class {
|
|
|
3212
3654
|
};
|
|
3213
3655
|
|
|
3214
3656
|
// src/services/vendor.ts
|
|
3215
|
-
var
|
|
3657
|
+
var SERVICE24 = { kind: "service" };
|
|
3216
3658
|
var VendorService = class {
|
|
3217
3659
|
constructor(ctx) {
|
|
3218
3660
|
this.ctx = ctx;
|
|
@@ -3224,7 +3666,7 @@ var VendorService = class {
|
|
|
3224
3666
|
}
|
|
3225
3667
|
// --- Vendors ---
|
|
3226
3668
|
/** List all vendors. */
|
|
3227
|
-
async listVendors(query = {}, auth2 =
|
|
3669
|
+
async listVendors(query = {}, auth2 = SERVICE24) {
|
|
3228
3670
|
return this.ctx.http.request({
|
|
3229
3671
|
method: "GET",
|
|
3230
3672
|
path: `${this.base()}/vendors`,
|
|
@@ -3233,7 +3675,7 @@ var VendorService = class {
|
|
|
3233
3675
|
});
|
|
3234
3676
|
}
|
|
3235
3677
|
/** Retrieve a vendor by id. */
|
|
3236
|
-
async getVendor(vendorId, auth2 =
|
|
3678
|
+
async getVendor(vendorId, auth2 = SERVICE24) {
|
|
3237
3679
|
return this.ctx.http.request({
|
|
3238
3680
|
method: "GET",
|
|
3239
3681
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -3241,7 +3683,7 @@ var VendorService = class {
|
|
|
3241
3683
|
});
|
|
3242
3684
|
}
|
|
3243
3685
|
/** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
|
|
3244
|
-
async searchVendors(query, auth2 =
|
|
3686
|
+
async searchVendors(query, auth2 = SERVICE24) {
|
|
3245
3687
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
3246
3688
|
return this.ctx.http.request({
|
|
3247
3689
|
method: "POST",
|
|
@@ -3251,11 +3693,11 @@ var VendorService = class {
|
|
|
3251
3693
|
});
|
|
3252
3694
|
}
|
|
3253
3695
|
/** Create a vendor. */
|
|
3254
|
-
async createVendor(input, auth2 =
|
|
3696
|
+
async createVendor(input, auth2 = SERVICE24) {
|
|
3255
3697
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
3256
3698
|
}
|
|
3257
3699
|
/** Upsert a vendor by id (`PUT`). */
|
|
3258
|
-
async updateVendor(vendorId, input, auth2 =
|
|
3700
|
+
async updateVendor(vendorId, input, auth2 = SERVICE24) {
|
|
3259
3701
|
await this.ctx.http.request({
|
|
3260
3702
|
method: "PUT",
|
|
3261
3703
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -3264,7 +3706,7 @@ var VendorService = class {
|
|
|
3264
3706
|
});
|
|
3265
3707
|
}
|
|
3266
3708
|
/** Delete a vendor by id. */
|
|
3267
|
-
async deleteVendor(vendorId, auth2 =
|
|
3709
|
+
async deleteVendor(vendorId, auth2 = SERVICE24) {
|
|
3268
3710
|
await this.ctx.http.request({
|
|
3269
3711
|
method: "DELETE",
|
|
3270
3712
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -3273,7 +3715,7 @@ var VendorService = class {
|
|
|
3273
3715
|
}
|
|
3274
3716
|
// --- Vendor locations ---
|
|
3275
3717
|
/** List all vendor locations. */
|
|
3276
|
-
async listVendorLocations(query = {}, auth2 =
|
|
3718
|
+
async listVendorLocations(query = {}, auth2 = SERVICE24) {
|
|
3277
3719
|
return this.ctx.http.request({
|
|
3278
3720
|
method: "GET",
|
|
3279
3721
|
path: `${this.base()}/locations`,
|
|
@@ -3282,7 +3724,7 @@ var VendorService = class {
|
|
|
3282
3724
|
});
|
|
3283
3725
|
}
|
|
3284
3726
|
/** Retrieve a vendor location by id. */
|
|
3285
|
-
async getVendorLocation(locationId, auth2 =
|
|
3727
|
+
async getVendorLocation(locationId, auth2 = SERVICE24) {
|
|
3286
3728
|
return this.ctx.http.request({
|
|
3287
3729
|
method: "GET",
|
|
3288
3730
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -3290,11 +3732,11 @@ var VendorService = class {
|
|
|
3290
3732
|
});
|
|
3291
3733
|
}
|
|
3292
3734
|
/** Create a vendor location. */
|
|
3293
|
-
async createVendorLocation(input, auth2 =
|
|
3735
|
+
async createVendorLocation(input, auth2 = SERVICE24) {
|
|
3294
3736
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
3295
3737
|
}
|
|
3296
3738
|
/** Upsert a vendor location by id (`PUT`). */
|
|
3297
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
3739
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE24) {
|
|
3298
3740
|
await this.ctx.http.request({
|
|
3299
3741
|
method: "PUT",
|
|
3300
3742
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -3303,7 +3745,7 @@ var VendorService = class {
|
|
|
3303
3745
|
});
|
|
3304
3746
|
}
|
|
3305
3747
|
/** Delete a vendor location by id. */
|
|
3306
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
3748
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE24) {
|
|
3307
3749
|
await this.ctx.http.request({
|
|
3308
3750
|
method: "DELETE",
|
|
3309
3751
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -3313,7 +3755,7 @@ var VendorService = class {
|
|
|
3313
3755
|
};
|
|
3314
3756
|
|
|
3315
3757
|
// src/services/pick-pack.ts
|
|
3316
|
-
var
|
|
3758
|
+
var SERVICE25 = { kind: "service" };
|
|
3317
3759
|
var PickPackService = class {
|
|
3318
3760
|
constructor(ctx) {
|
|
3319
3761
|
this.ctx = ctx;
|
|
@@ -3327,7 +3769,7 @@ var PickPackService = class {
|
|
|
3327
3769
|
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
3328
3770
|
}
|
|
3329
3771
|
/** List packlist orders. */
|
|
3330
|
-
async listOrders(query = {}, auth2 =
|
|
3772
|
+
async listOrders(query = {}, auth2 = SERVICE25) {
|
|
3331
3773
|
return this.ctx.http.request({
|
|
3332
3774
|
method: "GET",
|
|
3333
3775
|
path: `${this.base()}/orders`,
|
|
@@ -3336,19 +3778,19 @@ var PickPackService = class {
|
|
|
3336
3778
|
});
|
|
3337
3779
|
}
|
|
3338
3780
|
/** Retrieve a packlist order by id. */
|
|
3339
|
-
async getOrder(orderId, auth2 =
|
|
3781
|
+
async getOrder(orderId, auth2 = SERVICE25) {
|
|
3340
3782
|
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
3341
3783
|
}
|
|
3342
3784
|
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
3343
|
-
async updateOrder(orderId, change, auth2 =
|
|
3785
|
+
async updateOrder(orderId, change, auth2 = SERVICE25) {
|
|
3344
3786
|
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
3345
3787
|
}
|
|
3346
3788
|
/** Finish an order. Returns an acknowledgement. */
|
|
3347
|
-
async finishOrder(orderId, auth2 =
|
|
3789
|
+
async finishOrder(orderId, auth2 = SERVICE25) {
|
|
3348
3790
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
3349
3791
|
}
|
|
3350
3792
|
/** List order cycles (ids). */
|
|
3351
|
-
async listOrderCycles(query = {}, auth2 =
|
|
3793
|
+
async listOrderCycles(query = {}, auth2 = SERVICE25) {
|
|
3352
3794
|
return this.ctx.http.request({
|
|
3353
3795
|
method: "GET",
|
|
3354
3796
|
path: `${this.base()}/orderCycles`,
|
|
@@ -3357,11 +3799,11 @@ var PickPackService = class {
|
|
|
3357
3799
|
});
|
|
3358
3800
|
}
|
|
3359
3801
|
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
3360
|
-
async addAssignee(orderId, assignee, auth2 =
|
|
3802
|
+
async addAssignee(orderId, assignee, auth2 = SERVICE25) {
|
|
3361
3803
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
3362
3804
|
}
|
|
3363
3805
|
/** Remove an assignee from an order. */
|
|
3364
|
-
async removeAssignee(orderId, assigneeId, auth2 =
|
|
3806
|
+
async removeAssignee(orderId, assigneeId, auth2 = SERVICE25) {
|
|
3365
3807
|
await this.ctx.http.request({
|
|
3366
3808
|
method: "DELETE",
|
|
3367
3809
|
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
@@ -3369,15 +3811,15 @@ var PickPackService = class {
|
|
|
3369
3811
|
});
|
|
3370
3812
|
}
|
|
3371
3813
|
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
3372
|
-
async updatePackaging(orderId, change, auth2 =
|
|
3814
|
+
async updatePackaging(orderId, change, auth2 = SERVICE25) {
|
|
3373
3815
|
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
3374
3816
|
}
|
|
3375
3817
|
/** Create a packing event. Returns an acknowledgement. */
|
|
3376
|
-
async createEvent(event, auth2 =
|
|
3818
|
+
async createEvent(event, auth2 = SERVICE25) {
|
|
3377
3819
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
3378
3820
|
}
|
|
3379
3821
|
/** List packing events. */
|
|
3380
|
-
async listEvents(query = {}, auth2 =
|
|
3822
|
+
async listEvents(query = {}, auth2 = SERVICE25) {
|
|
3381
3823
|
return this.ctx.http.request({
|
|
3382
3824
|
method: "GET",
|
|
3383
3825
|
path: `${this.base()}/events`,
|
|
@@ -3386,7 +3828,7 @@ var PickPackService = class {
|
|
|
3386
3828
|
});
|
|
3387
3829
|
}
|
|
3388
3830
|
/** Trigger an order recalculation. Returns the created job's id. */
|
|
3389
|
-
async triggerRecalculation(input, auth2 =
|
|
3831
|
+
async triggerRecalculation(input, auth2 = SERVICE25) {
|
|
3390
3832
|
return this.ctx.http.request({
|
|
3391
3833
|
method: "POST",
|
|
3392
3834
|
path: `${this.base()}/jobs/recalculations`,
|
|
@@ -3395,7 +3837,7 @@ var PickPackService = class {
|
|
|
3395
3837
|
});
|
|
3396
3838
|
}
|
|
3397
3839
|
/** Retrieve a recalculation job by id. */
|
|
3398
|
-
async getRecalculationJob(jobId, auth2 =
|
|
3840
|
+
async getRecalculationJob(jobId, auth2 = SERVICE25) {
|
|
3399
3841
|
return this.ctx.http.request({
|
|
3400
3842
|
method: "GET",
|
|
3401
3843
|
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
@@ -3405,7 +3847,7 @@ var PickPackService = class {
|
|
|
3405
3847
|
};
|
|
3406
3848
|
|
|
3407
3849
|
// src/services/customer-admin.ts
|
|
3408
|
-
var
|
|
3850
|
+
var SERVICE26 = { kind: "service" };
|
|
3409
3851
|
var CustomerAdminService = class {
|
|
3410
3852
|
constructor(ctx) {
|
|
3411
3853
|
this.ctx = ctx;
|
|
@@ -3423,7 +3865,7 @@ var CustomerAdminService = class {
|
|
|
3423
3865
|
}
|
|
3424
3866
|
// --- Customers ---
|
|
3425
3867
|
/** List customers. */
|
|
3426
|
-
async listCustomers(query = {}, auth2 =
|
|
3868
|
+
async listCustomers(query = {}, auth2 = SERVICE26) {
|
|
3427
3869
|
return this.ctx.http.request({
|
|
3428
3870
|
method: "GET",
|
|
3429
3871
|
path: this.base(),
|
|
@@ -3432,33 +3874,33 @@ var CustomerAdminService = class {
|
|
|
3432
3874
|
});
|
|
3433
3875
|
}
|
|
3434
3876
|
/** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
|
|
3435
|
-
async searchCustomers(query, auth2 =
|
|
3877
|
+
async searchCustomers(query, auth2 = SERVICE26) {
|
|
3436
3878
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
3437
3879
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
|
|
3438
3880
|
}
|
|
3439
3881
|
/** Retrieve a customer profile by number. */
|
|
3440
|
-
async getCustomer(customerNumber, auth2 =
|
|
3882
|
+
async getCustomer(customerNumber, auth2 = SERVICE26) {
|
|
3441
3883
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
3442
3884
|
}
|
|
3443
3885
|
/** Create a customer. */
|
|
3444
|
-
async createCustomer(input, auth2 =
|
|
3886
|
+
async createCustomer(input, auth2 = SERVICE26) {
|
|
3445
3887
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
3446
3888
|
}
|
|
3447
3889
|
/** Upsert a customer profile by number (`PUT`). */
|
|
3448
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
3890
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE26) {
|
|
3449
3891
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
3450
3892
|
}
|
|
3451
3893
|
/** Partially update a customer profile (`PATCH`). */
|
|
3452
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
3894
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE26) {
|
|
3453
3895
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
3454
3896
|
}
|
|
3455
3897
|
/** Delete a customer profile. */
|
|
3456
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
3898
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE26) {
|
|
3457
3899
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
3458
3900
|
}
|
|
3459
3901
|
// --- Addresses ---
|
|
3460
3902
|
/** List a customer's addresses. */
|
|
3461
|
-
async listAddresses(customerNumber, auth2 =
|
|
3903
|
+
async listAddresses(customerNumber, auth2 = SERVICE26) {
|
|
3462
3904
|
return this.ctx.http.request({
|
|
3463
3905
|
method: "GET",
|
|
3464
3906
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -3466,11 +3908,11 @@ var CustomerAdminService = class {
|
|
|
3466
3908
|
});
|
|
3467
3909
|
}
|
|
3468
3910
|
/** Retrieve one address. */
|
|
3469
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
3911
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE26) {
|
|
3470
3912
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
3471
3913
|
}
|
|
3472
3914
|
/** Add an address. */
|
|
3473
|
-
async addAddress(customerNumber, input, auth2 =
|
|
3915
|
+
async addAddress(customerNumber, input, auth2 = SERVICE26) {
|
|
3474
3916
|
return this.ctx.http.request({
|
|
3475
3917
|
method: "POST",
|
|
3476
3918
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -3479,19 +3921,19 @@ var CustomerAdminService = class {
|
|
|
3479
3921
|
});
|
|
3480
3922
|
}
|
|
3481
3923
|
/** Upsert an address by id (`PUT`). */
|
|
3482
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
3924
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE26) {
|
|
3483
3925
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
3484
3926
|
}
|
|
3485
3927
|
/** Partially update an address by id (`PATCH`). */
|
|
3486
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
3928
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE26) {
|
|
3487
3929
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
3488
3930
|
}
|
|
3489
3931
|
/** Delete an address by id. */
|
|
3490
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
3932
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE26) {
|
|
3491
3933
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
3492
3934
|
}
|
|
3493
3935
|
/** Add tags to an address (`?tags=` query). */
|
|
3494
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
3936
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE26) {
|
|
3495
3937
|
await this.ctx.http.request({
|
|
3496
3938
|
method: "POST",
|
|
3497
3939
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -3500,7 +3942,7 @@ var CustomerAdminService = class {
|
|
|
3500
3942
|
});
|
|
3501
3943
|
}
|
|
3502
3944
|
/** Remove tags from an address (`?tags=` query). */
|
|
3503
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
3945
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE26) {
|
|
3504
3946
|
await this.ctx.http.request({
|
|
3505
3947
|
method: "DELETE",
|
|
3506
3948
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -3511,7 +3953,7 @@ var CustomerAdminService = class {
|
|
|
3511
3953
|
};
|
|
3512
3954
|
|
|
3513
3955
|
// src/services/approval.ts
|
|
3514
|
-
var
|
|
3956
|
+
var SERVICE27 = { kind: "service" };
|
|
3515
3957
|
var ApprovalService = class {
|
|
3516
3958
|
constructor(ctx) {
|
|
3517
3959
|
this.ctx = ctx;
|
|
@@ -3522,7 +3964,7 @@ var ApprovalService = class {
|
|
|
3522
3964
|
return `/approval/${this.ctx.tenant}`;
|
|
3523
3965
|
}
|
|
3524
3966
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
3525
|
-
async listApprovals(query = {}, auth2 =
|
|
3967
|
+
async listApprovals(query = {}, auth2 = SERVICE27) {
|
|
3526
3968
|
return this.ctx.http.request({
|
|
3527
3969
|
method: "GET",
|
|
3528
3970
|
path: `${this.base()}/approvals`,
|
|
@@ -3531,7 +3973,7 @@ var ApprovalService = class {
|
|
|
3531
3973
|
});
|
|
3532
3974
|
}
|
|
3533
3975
|
/** Retrieve a single approval by id. */
|
|
3534
|
-
async getApproval(approvalId, auth2 =
|
|
3976
|
+
async getApproval(approvalId, auth2 = SERVICE27) {
|
|
3535
3977
|
return this.ctx.http.request({
|
|
3536
3978
|
method: "GET",
|
|
3537
3979
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -3539,7 +3981,7 @@ var ApprovalService = class {
|
|
|
3539
3981
|
});
|
|
3540
3982
|
}
|
|
3541
3983
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
3542
|
-
async createApproval(input, auth2 =
|
|
3984
|
+
async createApproval(input, auth2 = SERVICE27) {
|
|
3543
3985
|
return this.ctx.http.request({
|
|
3544
3986
|
method: "POST",
|
|
3545
3987
|
path: `${this.base()}/approvals`,
|
|
@@ -3548,7 +3990,7 @@ var ApprovalService = class {
|
|
|
3548
3990
|
});
|
|
3549
3991
|
}
|
|
3550
3992
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
3551
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
3993
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE27) {
|
|
3552
3994
|
await this.ctx.http.request({
|
|
3553
3995
|
method: "PATCH",
|
|
3554
3996
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -3557,7 +3999,7 @@ var ApprovalService = class {
|
|
|
3557
3999
|
});
|
|
3558
4000
|
}
|
|
3559
4001
|
/** Delete an approval by id. */
|
|
3560
|
-
async deleteApproval(approvalId, auth2 =
|
|
4002
|
+
async deleteApproval(approvalId, auth2 = SERVICE27) {
|
|
3561
4003
|
await this.ctx.http.request({
|
|
3562
4004
|
method: "DELETE",
|
|
3563
4005
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -3565,7 +4007,7 @@ var ApprovalService = class {
|
|
|
3565
4007
|
});
|
|
3566
4008
|
}
|
|
3567
4009
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
3568
|
-
async checkPermitted(input, auth2 =
|
|
4010
|
+
async checkPermitted(input, auth2 = SERVICE27) {
|
|
3569
4011
|
return this.ctx.http.request({
|
|
3570
4012
|
method: "POST",
|
|
3571
4013
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -3574,7 +4016,7 @@ var ApprovalService = class {
|
|
|
3574
4016
|
});
|
|
3575
4017
|
}
|
|
3576
4018
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
3577
|
-
async searchApprovers(input, auth2 =
|
|
4019
|
+
async searchApprovers(input, auth2 = SERVICE27) {
|
|
3578
4020
|
return this.ctx.http.request({
|
|
3579
4021
|
method: "POST",
|
|
3580
4022
|
path: `${this.base()}/search/users`,
|
|
@@ -3622,6 +4064,8 @@ var EmporixClient = class {
|
|
|
3622
4064
|
countries;
|
|
3623
4065
|
currencies;
|
|
3624
4066
|
shipping;
|
|
4067
|
+
invoices;
|
|
4068
|
+
quotes;
|
|
3625
4069
|
returns;
|
|
3626
4070
|
sepaExport;
|
|
3627
4071
|
indexing;
|
|
@@ -3693,6 +4137,8 @@ var EmporixClient = class {
|
|
|
3693
4137
|
this.countries = new CountryService(mk(CountryService.channel));
|
|
3694
4138
|
this.currencies = new CurrencyService(mk(CurrencyService.channel));
|
|
3695
4139
|
this.shipping = new ShippingService(mk(ShippingService.channel));
|
|
4140
|
+
this.invoices = new InvoiceService(mk(InvoiceService.channel));
|
|
4141
|
+
this.quotes = new QuoteService(mk(QuoteService.channel));
|
|
3696
4142
|
this.returns = new ReturnsService(mk(ReturnsService.channel));
|
|
3697
4143
|
this.sepaExport = new SepaExportService(mk(SepaExportService.channel));
|
|
3698
4144
|
this.indexing = new IndexingService(mk(IndexingService.channel));
|
|
@@ -3766,6 +4212,6 @@ function productIdFromYrn(yrn) {
|
|
|
3766
4212
|
return semi >= 0 ? yrn.slice(semi + 1) : "";
|
|
3767
4213
|
}
|
|
3768
4214
|
|
|
3769
|
-
export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, IndexingService, LEVEL, LabelService, LevelResolver, PickPackService, RagIndexerService, ReturnsService, RewardPointsService, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, createConsoleLogger, createCore, createEmporixClient, createNoopLogger, productIdFromYrn, redact, validateConfig };
|
|
4215
|
+
export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver, PickPackService, QuoteService, RagIndexerService, ReturnsService, RewardPointsService, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, createConsoleLogger, createCore, createEmporixClient, createNoopLogger, productIdFromYrn, redact, validateConfig };
|
|
3770
4216
|
//# sourceMappingURL=index.js.map
|
|
3771
4217
|
//# sourceMappingURL=index.js.map
|