@viu/emporix-sdk 2.18.0 → 2.20.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 +35 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +95 -9
- package/dist/availability.d.ts +95 -9
- package/dist/availability.js +1 -1
- package/dist/cart.d.cts +1 -1
- package/dist/cart.d.ts +1 -1
- package/dist/category.cjs +12 -0
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +12 -2
- package/dist/category.d.ts +12 -2
- package/dist/category.js +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-K3VQLW3P.js → chunk-IVCCGJN5.js} +2 -2
- package/dist/chunk-IVCCGJN5.js.map +1 -0
- package/dist/{chunk-6XND7SYV.js → chunk-ZNLHLFQM.js} +14 -2
- package/dist/chunk-ZNLHLFQM.js.map +1 -0
- package/dist/companies.d.cts +1 -1
- package/dist/companies.d.ts +1 -1
- package/dist/contacts.d.cts +1 -1
- package/dist/contacts.d.ts +1 -1
- package/dist/{context-DhoFgoKf.d.cts → context-Dawv2AtS.d.cts} +16 -0
- package/dist/{context-DhoFgoKf.d.ts → context-Dawv2AtS.d.ts} +16 -0
- package/dist/customer-groups.d.cts +1 -1
- package/dist/customer-groups.d.ts +1 -1
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +501 -297
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +439 -35
- package/dist/index.d.ts +439 -35
- package/dist/index.js +198 -6
- package/dist/index.js.map +1 -1
- package/dist/locations.d.cts +1 -1
- package/dist/locations.d.ts +1 -1
- package/dist/media.d.cts +17 -2
- package/dist/media.d.ts +17 -2
- package/dist/orders.d.cts +10 -27
- package/dist/orders.d.ts +10 -27
- package/dist/payment.d.cts +1 -1
- package/dist/payment.d.ts +1 -1
- package/dist/price.d.cts +5 -18
- package/dist/price.d.ts +5 -18
- package/dist/product.d.cts +7 -1
- package/dist/product.d.ts +7 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-6XND7SYV.js.map +0 -1
- package/dist/chunk-K3VQLW3P.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -591,6 +591,47 @@ var DefaultTokenProvider = class {
|
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
593
|
|
|
594
|
+
// src/core/sse.ts
|
|
595
|
+
function parseFrame(frame) {
|
|
596
|
+
const ev = { data: "" };
|
|
597
|
+
const dataLines = [];
|
|
598
|
+
let saw = false;
|
|
599
|
+
for (const line of frame.split("\n")) {
|
|
600
|
+
if (line === "" || line.startsWith(":")) continue;
|
|
601
|
+
const colon = line.indexOf(":");
|
|
602
|
+
const field = colon === -1 ? line : line.slice(0, colon);
|
|
603
|
+
let value = colon === -1 ? "" : line.slice(colon + 1);
|
|
604
|
+
if (value.startsWith(" ")) value = value.slice(1);
|
|
605
|
+
if (field === "data") {
|
|
606
|
+
dataLines.push(value);
|
|
607
|
+
saw = true;
|
|
608
|
+
} else if (field === "event") {
|
|
609
|
+
ev.event = value;
|
|
610
|
+
saw = true;
|
|
611
|
+
} else if (field === "id") {
|
|
612
|
+
ev.id = value;
|
|
613
|
+
saw = true;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (!saw) return void 0;
|
|
617
|
+
ev.data = dataLines.join("\n");
|
|
618
|
+
return ev;
|
|
619
|
+
}
|
|
620
|
+
async function* parseSseStream(chunks) {
|
|
621
|
+
let buf = "";
|
|
622
|
+
for await (const chunk of chunks) {
|
|
623
|
+
buf += chunk.replace(/\r\n/g, "\n");
|
|
624
|
+
let idx;
|
|
625
|
+
while ((idx = buf.indexOf("\n\n")) !== -1) {
|
|
626
|
+
const ev = parseFrame(buf.slice(0, idx));
|
|
627
|
+
buf = buf.slice(idx + 2);
|
|
628
|
+
if (ev) yield ev;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const tail = parseFrame(buf);
|
|
632
|
+
if (tail) yield tail;
|
|
633
|
+
}
|
|
634
|
+
|
|
594
635
|
// src/core/http.ts
|
|
595
636
|
var requestSeq = 0;
|
|
596
637
|
function safeJson(text) {
|
|
@@ -780,10 +821,72 @@ var HttpClient = class {
|
|
|
780
821
|
clearTimeout(timer);
|
|
781
822
|
}
|
|
782
823
|
}
|
|
824
|
+
/**
|
|
825
|
+
* Open a Server-Sent Events stream (`text/event-stream`) and yield parsed
|
|
826
|
+
* events. Unlike {@link request}, no overall read budget applies (streams are
|
|
827
|
+
* long-lived) — only `connectMs` bounds time-to-headers, and the consumer
|
|
828
|
+
* breaking the iterator aborts the fetch. Like {@link requestRaw}, it does
|
|
829
|
+
* NOT retry or re-auth on 401; a non-2xx maps to a typed error before the
|
|
830
|
+
* stream begins.
|
|
831
|
+
*/
|
|
832
|
+
async *requestStream(o) {
|
|
833
|
+
const log = this.opts.logger.child({ requestId: `req-${++requestSeq}` });
|
|
834
|
+
const url = new URL(this.opts.host + o.path);
|
|
835
|
+
for (const [k, v] of Object.entries(o.query ?? {})) {
|
|
836
|
+
if (v !== void 0) url.searchParams.set(k, String(v));
|
|
837
|
+
}
|
|
838
|
+
const token = await resolveToken(o.auth, this.opts.provider);
|
|
839
|
+
const controller = new AbortController();
|
|
840
|
+
const connectTimer = setTimeout(() => controller.abort(), this.opts.timeouts.connectMs);
|
|
841
|
+
const headers = this.buildHeaders(o, token, false);
|
|
842
|
+
headers["Accept"] = "text/event-stream";
|
|
843
|
+
let res;
|
|
844
|
+
try {
|
|
845
|
+
res = await fetch(url, {
|
|
846
|
+
method: o.method,
|
|
847
|
+
headers,
|
|
848
|
+
signal: controller.signal,
|
|
849
|
+
...o.body !== void 0 ? { body: JSON.stringify(o.body) } : {}
|
|
850
|
+
});
|
|
851
|
+
} catch (err) {
|
|
852
|
+
clearTimeout(connectTimer);
|
|
853
|
+
if (err.name === "AbortError") {
|
|
854
|
+
throw new EmporixTimeoutError(`${o.method} ${o.path} timed out opening stream`);
|
|
855
|
+
}
|
|
856
|
+
throw new EmporixNetworkError(
|
|
857
|
+
`${o.method} ${o.path} network failure: ${err.message}`
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
clearTimeout(connectTimer);
|
|
861
|
+
if (!res.ok) {
|
|
862
|
+
const text = await res.text().catch(() => "");
|
|
863
|
+
throw errorFromResponse(
|
|
864
|
+
res.status,
|
|
865
|
+
`${o.method} ${o.path} \u2192 ${res.status}`,
|
|
866
|
+
text ? safeJson(text) : void 0
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
log.debug("http stream open", { status: res.status });
|
|
870
|
+
if (!res.body) return;
|
|
871
|
+
const reader = res.body.getReader();
|
|
872
|
+
const decoder = new TextDecoder();
|
|
873
|
+
async function* readChunks() {
|
|
874
|
+
try {
|
|
875
|
+
for (; ; ) {
|
|
876
|
+
const { done, value } = await reader.read();
|
|
877
|
+
if (done) break;
|
|
878
|
+
yield decoder.decode(value, { stream: true });
|
|
879
|
+
}
|
|
880
|
+
} finally {
|
|
881
|
+
controller.abort();
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
yield* parseSseStream(readChunks());
|
|
885
|
+
}
|
|
783
886
|
};
|
|
784
887
|
|
|
785
888
|
// package.json
|
|
786
|
-
var version = "2.
|
|
889
|
+
var version = "2.20.0";
|
|
787
890
|
|
|
788
891
|
// src/version.ts
|
|
789
892
|
var SDK_VERSION = version;
|
|
@@ -1251,6 +1354,7 @@ var ProductService = class {
|
|
|
1251
1354
|
|
|
1252
1355
|
// src/services/category.ts
|
|
1253
1356
|
var ANON2 = { kind: "anonymous" };
|
|
1357
|
+
var SERVICE = { kind: "service" };
|
|
1254
1358
|
var CategoryService = class {
|
|
1255
1359
|
constructor(ctx) {
|
|
1256
1360
|
this.ctx = ctx;
|
|
@@ -1311,6 +1415,17 @@ var CategoryService = class {
|
|
|
1311
1415
|
auth: auth2
|
|
1312
1416
|
});
|
|
1313
1417
|
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Rebuild a category tree from its root (`POST /category-trees/{rootCategoryId}/rebuild`).
|
|
1420
|
+
* Admin write — defaults to the service token. Returns the rebuilt tree.
|
|
1421
|
+
*/
|
|
1422
|
+
async rebuildTree(rootCategoryId, auth2 = SERVICE) {
|
|
1423
|
+
return this.ctx.http.request({
|
|
1424
|
+
method: "POST",
|
|
1425
|
+
path: `/category/${this.ctx.tenant}/category-trees/${encodeURIComponent(rootCategoryId)}/rebuild`,
|
|
1426
|
+
auth: auth2
|
|
1427
|
+
});
|
|
1428
|
+
}
|
|
1314
1429
|
/**
|
|
1315
1430
|
* Direct child categories of a category (for hierarchy drill-down). Mirrors
|
|
1316
1431
|
* {@link productsIn}: reads the category's **assignments** and keeps the
|
|
@@ -1660,7 +1775,7 @@ function normalizeMatch(raw) {
|
|
|
1660
1775
|
return { ...base, itemId, itemRef };
|
|
1661
1776
|
}
|
|
1662
1777
|
var ANON4 = { kind: "anonymous" };
|
|
1663
|
-
var
|
|
1778
|
+
var SERVICE2 = { kind: "service" };
|
|
1664
1779
|
function requireContextAuth(auth2) {
|
|
1665
1780
|
const a = auth2 ?? ANON4;
|
|
1666
1781
|
if (a.kind === "anonymous" || a.kind === "customer" || a.kind === "raw") return a;
|
|
@@ -1694,7 +1809,7 @@ var PriceService = class {
|
|
|
1694
1809
|
* Resolves prices from an explicit context. Default auth: service
|
|
1695
1810
|
* (requires `price.price_read` / `price.price_manage`).
|
|
1696
1811
|
*/
|
|
1697
|
-
async match(input, auth2 =
|
|
1812
|
+
async match(input, auth2 = SERVICE2) {
|
|
1698
1813
|
const rows = await this.ctx.http.request({
|
|
1699
1814
|
method: "POST",
|
|
1700
1815
|
path: `/price/${this.ctx.tenant}/match-prices`,
|
|
@@ -1752,7 +1867,7 @@ var PriceService = class {
|
|
|
1752
1867
|
};
|
|
1753
1868
|
|
|
1754
1869
|
// src/services/media.ts
|
|
1755
|
-
var
|
|
1870
|
+
var SERVICE3 = { kind: "service" };
|
|
1756
1871
|
function isProductRef(r, productId) {
|
|
1757
1872
|
return r.type === "PRODUCT" && r.id === productId;
|
|
1758
1873
|
}
|
|
@@ -1766,7 +1881,7 @@ var MediaService = class {
|
|
|
1766
1881
|
return `/media/${this.ctx.tenant}/assets`;
|
|
1767
1882
|
}
|
|
1768
1883
|
/** Create an asset. BLOB uploads via multipart; LINK via JSON. */
|
|
1769
|
-
async create(input, auth2 =
|
|
1884
|
+
async create(input, auth2 = SERVICE3) {
|
|
1770
1885
|
if (input.kind === "blob") {
|
|
1771
1886
|
const fd = new FormData();
|
|
1772
1887
|
fd.set("file", input.file);
|
|
@@ -1793,7 +1908,7 @@ var MediaService = class {
|
|
|
1793
1908
|
* defaults match Emporix's server defaults (`pageNumber: 1`,
|
|
1794
1909
|
* `pageSize: 60`) so an empty `query` produces stable expectations.
|
|
1795
1910
|
*/
|
|
1796
|
-
async list(query = {}, auth2 =
|
|
1911
|
+
async list(query = {}, auth2 = SERVICE3) {
|
|
1797
1912
|
const pageNumber = query.pageNumber ?? 1;
|
|
1798
1913
|
const pageSize = query.pageSize ?? 60;
|
|
1799
1914
|
const items = await this.ctx.http.request({
|
|
@@ -1810,7 +1925,7 @@ var MediaService = class {
|
|
|
1810
1925
|
};
|
|
1811
1926
|
}
|
|
1812
1927
|
/** Fetch an asset by id. */
|
|
1813
|
-
async get(assetId, auth2 =
|
|
1928
|
+
async get(assetId, auth2 = SERVICE3) {
|
|
1814
1929
|
return this.ctx.http.request({
|
|
1815
1930
|
method: "GET",
|
|
1816
1931
|
path: `${this.base()}/${assetId}`,
|
|
@@ -1831,7 +1946,7 @@ var MediaService = class {
|
|
|
1831
1946
|
* existing asset's values. Optimistic-locking is via `body.metadata.version`;
|
|
1832
1947
|
* the server returns 409 Conflict on a stale version.
|
|
1833
1948
|
*/
|
|
1834
|
-
async update(assetId, input, auth2 =
|
|
1949
|
+
async update(assetId, input, auth2 = SERVICE3) {
|
|
1835
1950
|
if (input.kind === "blob") {
|
|
1836
1951
|
const fd = new FormData();
|
|
1837
1952
|
fd.set("file", input.file);
|
|
@@ -1851,7 +1966,7 @@ var MediaService = class {
|
|
|
1851
1966
|
});
|
|
1852
1967
|
}
|
|
1853
1968
|
/** Remove an asset. */
|
|
1854
|
-
async remove(assetId, auth2 =
|
|
1969
|
+
async remove(assetId, auth2 = SERVICE3) {
|
|
1855
1970
|
await this.ctx.http.request({
|
|
1856
1971
|
method: "DELETE",
|
|
1857
1972
|
path: `${this.base()}/${assetId}`,
|
|
@@ -1877,7 +1992,7 @@ var MediaService = class {
|
|
|
1877
1992
|
* direct storage URL for `PUBLIC` `BLOB` assets (typically delivered via
|
|
1878
1993
|
* an `<img>` tag rather than `download()`).
|
|
1879
1994
|
*/
|
|
1880
|
-
async download(assetId, auth2 =
|
|
1995
|
+
async download(assetId, auth2 = SERVICE3) {
|
|
1881
1996
|
const path = `${this.base()}/${assetId}/download`;
|
|
1882
1997
|
const res = await this.ctx.http.requestRaw(
|
|
1883
1998
|
{ method: "GET", path, auth: auth2 },
|
|
@@ -1925,7 +2040,7 @@ var MediaService = class {
|
|
|
1925
2040
|
throw errorFromResponse(res.status, `GET ${path} \u2192 ${res.status}`, parsed);
|
|
1926
2041
|
}
|
|
1927
2042
|
/** Multipart upload sugar: builds `AssetCreateBlob` from input. */
|
|
1928
|
-
async uploadFile(input, auth2 =
|
|
2043
|
+
async uploadFile(input, auth2 = SERVICE3) {
|
|
1929
2044
|
const body = {
|
|
1930
2045
|
type: "BLOB",
|
|
1931
2046
|
access: input.access ?? "PUBLIC",
|
|
@@ -1946,7 +2061,7 @@ var MediaService = class {
|
|
|
1946
2061
|
* Pass `version` from `asset.metadata.version` if you want optimistic
|
|
1947
2062
|
* locking (recommended when concurrent writers are possible).
|
|
1948
2063
|
*/
|
|
1949
|
-
async replaceFile(assetId, input, auth2 =
|
|
2064
|
+
async replaceFile(assetId, input, auth2 = SERVICE3) {
|
|
1950
2065
|
const body = {
|
|
1951
2066
|
type: "BLOB",
|
|
1952
2067
|
access: input.access,
|
|
@@ -1961,7 +2076,7 @@ var MediaService = class {
|
|
|
1961
2076
|
return this.update(assetId, { kind: "blob", file: input.file, body }, auth2);
|
|
1962
2077
|
}
|
|
1963
2078
|
/** External-URL sugar: builds `AssetCreateLink`. */
|
|
1964
|
-
async link(input, auth2 =
|
|
2079
|
+
async link(input, auth2 = SERVICE3) {
|
|
1965
2080
|
const body = {
|
|
1966
2081
|
type: "LINK",
|
|
1967
2082
|
access: input.access ?? "PUBLIC",
|
|
@@ -1971,7 +2086,7 @@ var MediaService = class {
|
|
|
1971
2086
|
return this.create({ kind: "link", body }, auth2);
|
|
1972
2087
|
}
|
|
1973
2088
|
/** Idempotently add a PRODUCT refId to an asset. */
|
|
1974
|
-
async attachToProduct(assetId, productId, auth2 =
|
|
2089
|
+
async attachToProduct(assetId, productId, auth2 = SERVICE3) {
|
|
1975
2090
|
const a = await this.get(assetId, auth2);
|
|
1976
2091
|
const refIds = a.refIds ?? [];
|
|
1977
2092
|
if (refIds.some((r) => isProductRef(r, productId))) return a;
|
|
@@ -1980,7 +2095,7 @@ var MediaService = class {
|
|
|
1980
2095
|
return this.update(assetId, { kind: "json", body: patch }, auth2);
|
|
1981
2096
|
}
|
|
1982
2097
|
/** Remove a PRODUCT refId from an asset (no-op if absent). */
|
|
1983
|
-
async detachFromProduct(assetId, productId, auth2 =
|
|
2098
|
+
async detachFromProduct(assetId, productId, auth2 = SERVICE3) {
|
|
1984
2099
|
const a = await this.get(assetId, auth2);
|
|
1985
2100
|
const refIds = a.refIds ?? [];
|
|
1986
2101
|
const next = refIds.filter((r) => !isProductRef(r, productId));
|
|
@@ -1989,7 +2104,7 @@ var MediaService = class {
|
|
|
1989
2104
|
return this.update(assetId, { kind: "json", body: patch }, auth2);
|
|
1990
2105
|
}
|
|
1991
2106
|
/** Convenience: list assets attached to a product (server-side filter). */
|
|
1992
|
-
async listForProduct(productId, auth2 =
|
|
2107
|
+
async listForProduct(productId, auth2 = SERVICE3) {
|
|
1993
2108
|
return this.list({ "refIds.id": productId }, auth2);
|
|
1994
2109
|
}
|
|
1995
2110
|
};
|
|
@@ -2600,7 +2715,7 @@ var AvailabilityService = class {
|
|
|
2600
2715
|
};
|
|
2601
2716
|
|
|
2602
2717
|
// src/services/tenant-config.ts
|
|
2603
|
-
var
|
|
2718
|
+
var SERVICE4 = { kind: "service" };
|
|
2604
2719
|
var TenantConfigService = class {
|
|
2605
2720
|
constructor(ctx) {
|
|
2606
2721
|
this.ctx = ctx;
|
|
@@ -2611,7 +2726,7 @@ var TenantConfigService = class {
|
|
|
2611
2726
|
return `/configuration/${this.ctx.tenant}/configurations`;
|
|
2612
2727
|
}
|
|
2613
2728
|
/** List tenant configurations, optionally filtered by `keys`. */
|
|
2614
|
-
async list(opts = {}, auth2 =
|
|
2729
|
+
async list(opts = {}, auth2 = SERVICE4) {
|
|
2615
2730
|
const query = opts.keys && opts.keys.length > 0 ? { keys: opts.keys.join(",") } : void 0;
|
|
2616
2731
|
return this.ctx.http.request({
|
|
2617
2732
|
method: "GET",
|
|
@@ -2621,7 +2736,7 @@ var TenantConfigService = class {
|
|
|
2621
2736
|
});
|
|
2622
2737
|
}
|
|
2623
2738
|
/** Retrieve one tenant configuration by key. */
|
|
2624
|
-
async get(key, auth2 =
|
|
2739
|
+
async get(key, auth2 = SERVICE4) {
|
|
2625
2740
|
return this.ctx.http.request({
|
|
2626
2741
|
method: "GET",
|
|
2627
2742
|
path: `${this.base()}/${encodeURIComponent(key)}`,
|
|
@@ -2629,7 +2744,7 @@ var TenantConfigService = class {
|
|
|
2629
2744
|
});
|
|
2630
2745
|
}
|
|
2631
2746
|
/** Create one or more tenant configurations (array in, array out). */
|
|
2632
|
-
async create(drafts, auth2 =
|
|
2747
|
+
async create(drafts, auth2 = SERVICE4) {
|
|
2633
2748
|
return this.ctx.http.request({
|
|
2634
2749
|
method: "POST",
|
|
2635
2750
|
path: this.base(),
|
|
@@ -2638,7 +2753,7 @@ var TenantConfigService = class {
|
|
|
2638
2753
|
});
|
|
2639
2754
|
}
|
|
2640
2755
|
/** Update one tenant configuration by key. */
|
|
2641
|
-
async update(key, draft, auth2 =
|
|
2756
|
+
async update(key, draft, auth2 = SERVICE4) {
|
|
2642
2757
|
return this.ctx.http.request({
|
|
2643
2758
|
method: "PUT",
|
|
2644
2759
|
path: `${this.base()}/${encodeURIComponent(key)}`,
|
|
@@ -2647,7 +2762,7 @@ var TenantConfigService = class {
|
|
|
2647
2762
|
});
|
|
2648
2763
|
}
|
|
2649
2764
|
/** Delete one tenant configuration by key. */
|
|
2650
|
-
async delete(key, auth2 =
|
|
2765
|
+
async delete(key, auth2 = SERVICE4) {
|
|
2651
2766
|
await this.ctx.http.request({
|
|
2652
2767
|
method: "DELETE",
|
|
2653
2768
|
path: `${this.base()}/${encodeURIComponent(key)}`,
|
|
@@ -2657,7 +2772,7 @@ var TenantConfigService = class {
|
|
|
2657
2772
|
};
|
|
2658
2773
|
|
|
2659
2774
|
// src/services/client-config.ts
|
|
2660
|
-
var
|
|
2775
|
+
var SERVICE5 = { kind: "service" };
|
|
2661
2776
|
var ClientConfigService = class {
|
|
2662
2777
|
constructor(ctx) {
|
|
2663
2778
|
this.ctx = ctx;
|
|
@@ -2668,7 +2783,7 @@ var ClientConfigService = class {
|
|
|
2668
2783
|
return `/configuration/${this.ctx.tenant}/clients/${encodeURIComponent(client)}/configurations`;
|
|
2669
2784
|
}
|
|
2670
2785
|
/** List a client's configurations, optionally filtered by `keys`. */
|
|
2671
|
-
async list(client, opts = {}, auth2 =
|
|
2786
|
+
async list(client, opts = {}, auth2 = SERVICE5) {
|
|
2672
2787
|
const query = opts.keys && opts.keys.length > 0 ? { keys: opts.keys.join(",") } : void 0;
|
|
2673
2788
|
return this.ctx.http.request({
|
|
2674
2789
|
method: "GET",
|
|
@@ -2678,7 +2793,7 @@ var ClientConfigService = class {
|
|
|
2678
2793
|
});
|
|
2679
2794
|
}
|
|
2680
2795
|
/** Retrieve one client configuration by key. */
|
|
2681
|
-
async get(client, key, auth2 =
|
|
2796
|
+
async get(client, key, auth2 = SERVICE5) {
|
|
2682
2797
|
return this.ctx.http.request({
|
|
2683
2798
|
method: "GET",
|
|
2684
2799
|
path: `${this.base(client)}/${encodeURIComponent(key)}`,
|
|
@@ -2686,7 +2801,7 @@ var ClientConfigService = class {
|
|
|
2686
2801
|
});
|
|
2687
2802
|
}
|
|
2688
2803
|
/** Create one or more client configurations. Injects `client` into each item. */
|
|
2689
|
-
async create(client, drafts, auth2 =
|
|
2804
|
+
async create(client, drafts, auth2 = SERVICE5) {
|
|
2690
2805
|
const body = drafts.map((d) => ({ ...d, client }));
|
|
2691
2806
|
return this.ctx.http.request({
|
|
2692
2807
|
method: "POST",
|
|
@@ -2696,7 +2811,7 @@ var ClientConfigService = class {
|
|
|
2696
2811
|
});
|
|
2697
2812
|
}
|
|
2698
2813
|
/** Update one client configuration by key. Injects `client` into the body. */
|
|
2699
|
-
async update(client, key, draft, auth2 =
|
|
2814
|
+
async update(client, key, draft, auth2 = SERVICE5) {
|
|
2700
2815
|
return this.ctx.http.request({
|
|
2701
2816
|
method: "PUT",
|
|
2702
2817
|
path: `${this.base(client)}/${encodeURIComponent(key)}`,
|
|
@@ -2705,7 +2820,7 @@ var ClientConfigService = class {
|
|
|
2705
2820
|
});
|
|
2706
2821
|
}
|
|
2707
2822
|
/** Delete one client configuration by key. */
|
|
2708
|
-
async delete(client, key, auth2 =
|
|
2823
|
+
async delete(client, key, auth2 = SERVICE5) {
|
|
2709
2824
|
await this.ctx.http.request({
|
|
2710
2825
|
method: "DELETE",
|
|
2711
2826
|
path: `${this.base(client)}/${encodeURIComponent(key)}`,
|
|
@@ -2812,7 +2927,7 @@ var ShoppingListService = class {
|
|
|
2812
2927
|
};
|
|
2813
2928
|
|
|
2814
2929
|
// src/services/ai-rag-indexer.ts
|
|
2815
|
-
var
|
|
2930
|
+
var SERVICE6 = { kind: "service" };
|
|
2816
2931
|
var RagIndexerService = class {
|
|
2817
2932
|
constructor(ctx) {
|
|
2818
2933
|
this.ctx = ctx;
|
|
@@ -2823,7 +2938,7 @@ var RagIndexerService = class {
|
|
|
2823
2938
|
return `/ai-rag-indexer/${this.ctx.tenant}/${encodeURIComponent(type)}`;
|
|
2824
2939
|
}
|
|
2825
2940
|
/** The indexable embedding field names for `type` (default `"PRODUCT"`). */
|
|
2826
|
-
async ragMetadata(type = "PRODUCT", auth2 =
|
|
2941
|
+
async ragMetadata(type = "PRODUCT", auth2 = SERVICE6) {
|
|
2827
2942
|
return this.ctx.http.request({
|
|
2828
2943
|
method: "GET",
|
|
2829
2944
|
path: `${this.base(type)}/rag-metadata`,
|
|
@@ -2831,7 +2946,7 @@ var RagIndexerService = class {
|
|
|
2831
2946
|
});
|
|
2832
2947
|
}
|
|
2833
2948
|
/** The filterable metadata fields for `type` (default `"PRODUCT"`). */
|
|
2834
|
-
async filterMetadata(type = "PRODUCT", auth2 =
|
|
2949
|
+
async filterMetadata(type = "PRODUCT", auth2 = SERVICE6) {
|
|
2835
2950
|
return this.ctx.http.request({
|
|
2836
2951
|
method: "GET",
|
|
2837
2952
|
path: `${this.base(type)}/filter-metadata`,
|
|
@@ -2842,8 +2957,10 @@ var RagIndexerService = class {
|
|
|
2842
2957
|
* Schedule a full asynchronous re-index for `type` (default `"PRODUCT"`).
|
|
2843
2958
|
* Resolves once the rebuild is *scheduled* (HTTP 204); there is no progress
|
|
2844
2959
|
* to await or poll. Costly — avoid calling on a hot path.
|
|
2960
|
+
* @deprecated since 2026-06-18, removal 2026-12-01 — use the indexing service:
|
|
2961
|
+
* `client.indexing.createReindexJob({ entityType: "PRODUCT", rag: true })`.
|
|
2845
2962
|
*/
|
|
2846
|
-
async reindex(type = "PRODUCT", auth2 =
|
|
2963
|
+
async reindex(type = "PRODUCT", auth2 = SERVICE6) {
|
|
2847
2964
|
await this.ctx.http.request({
|
|
2848
2965
|
method: "POST",
|
|
2849
2966
|
path: `${this.base(type)}/reindex`,
|
|
@@ -2853,7 +2970,7 @@ var RagIndexerService = class {
|
|
|
2853
2970
|
};
|
|
2854
2971
|
|
|
2855
2972
|
// src/services/sequential-id.ts
|
|
2856
|
-
var
|
|
2973
|
+
var SERVICE7 = { kind: "service" };
|
|
2857
2974
|
var SequentialIdService = class {
|
|
2858
2975
|
constructor(ctx) {
|
|
2859
2976
|
this.ctx = ctx;
|
|
@@ -2864,7 +2981,7 @@ var SequentialIdService = class {
|
|
|
2864
2981
|
return `/sequential-id/${this.ctx.tenant}/schemas`;
|
|
2865
2982
|
}
|
|
2866
2983
|
/** List all sequence schemas for the tenant. */
|
|
2867
|
-
async listSchemas(auth2 =
|
|
2984
|
+
async listSchemas(auth2 = SERVICE7) {
|
|
2868
2985
|
return this.ctx.http.request({
|
|
2869
2986
|
method: "GET",
|
|
2870
2987
|
path: this.base(),
|
|
@@ -2872,7 +2989,7 @@ var SequentialIdService = class {
|
|
|
2872
2989
|
});
|
|
2873
2990
|
}
|
|
2874
2991
|
/** Retrieve one sequence schema by id. */
|
|
2875
|
-
async getSchema(schemaId, auth2 =
|
|
2992
|
+
async getSchema(schemaId, auth2 = SERVICE7) {
|
|
2876
2993
|
return this.ctx.http.request({
|
|
2877
2994
|
method: "GET",
|
|
2878
2995
|
path: `${this.base()}/${encodeURIComponent(schemaId)}`,
|
|
@@ -2880,7 +2997,7 @@ var SequentialIdService = class {
|
|
|
2880
2997
|
});
|
|
2881
2998
|
}
|
|
2882
2999
|
/** Create a sequence schema. Schemas are immutable — there is no update. */
|
|
2883
|
-
async createSchema(schema, auth2 =
|
|
3000
|
+
async createSchema(schema, auth2 = SERVICE7) {
|
|
2884
3001
|
return this.ctx.http.request({
|
|
2885
3002
|
method: "POST",
|
|
2886
3003
|
path: this.base(),
|
|
@@ -2889,7 +3006,7 @@ var SequentialIdService = class {
|
|
|
2889
3006
|
});
|
|
2890
3007
|
}
|
|
2891
3008
|
/** Delete a sequence schema by id. */
|
|
2892
|
-
async deleteSchema(schemaId, auth2 =
|
|
3009
|
+
async deleteSchema(schemaId, auth2 = SERVICE7) {
|
|
2893
3010
|
await this.ctx.http.request({
|
|
2894
3011
|
method: "DELETE",
|
|
2895
3012
|
path: `${this.base()}/${encodeURIComponent(schemaId)}`,
|
|
@@ -2897,7 +3014,7 @@ var SequentialIdService = class {
|
|
|
2897
3014
|
});
|
|
2898
3015
|
}
|
|
2899
3016
|
/** Mark a schema active for its type (only one schema may be active per type). */
|
|
2900
|
-
async setActiveSchema(schemaId, auth2 =
|
|
3017
|
+
async setActiveSchema(schemaId, auth2 = SERVICE7) {
|
|
2901
3018
|
await this.ctx.http.request({
|
|
2902
3019
|
method: "POST",
|
|
2903
3020
|
path: `${this.base()}/${encodeURIComponent(schemaId)}/setActive`,
|
|
@@ -2905,7 +3022,7 @@ var SequentialIdService = class {
|
|
|
2905
3022
|
});
|
|
2906
3023
|
}
|
|
2907
3024
|
/** Get the active schema for a given schema type. */
|
|
2908
|
-
async listSchemasByType(schemaType, auth2 =
|
|
3025
|
+
async listSchemasByType(schemaType, auth2 = SERVICE7) {
|
|
2909
3026
|
return this.ctx.http.request({
|
|
2910
3027
|
method: "GET",
|
|
2911
3028
|
path: `${this.base()}/types/${encodeURIComponent(schemaType)}`,
|
|
@@ -2917,7 +3034,7 @@ var SequentialIdService = class {
|
|
|
2917
3034
|
* `sequenceKey` (independent sub-pool counter) and `placeholders`.
|
|
2918
3035
|
* `opts.siteCode` derives time/country placeholders from the site's settings.
|
|
2919
3036
|
*/
|
|
2920
|
-
async nextId(schemaType, body = {}, opts = {}, auth2 =
|
|
3037
|
+
async nextId(schemaType, body = {}, opts = {}, auth2 = SERVICE7) {
|
|
2921
3038
|
const query = opts.siteCode ? { siteCode: opts.siteCode } : void 0;
|
|
2922
3039
|
return this.ctx.http.request({
|
|
2923
3040
|
method: "POST",
|
|
@@ -2932,7 +3049,7 @@ var SequentialIdService = class {
|
|
|
2932
3049
|
* endpoint path omits the `{tenant}` segment — the service derives the
|
|
2933
3050
|
* tenant from the token.
|
|
2934
3051
|
*/
|
|
2935
|
-
async nextIdsBatch(req, auth2 =
|
|
3052
|
+
async nextIdsBatch(req, auth2 = SERVICE7) {
|
|
2936
3053
|
return this.ctx.http.request({
|
|
2937
3054
|
method: "POST",
|
|
2938
3055
|
path: `/sequential-id/sequenceSchemaBatch/nextIds`,
|
|
@@ -2943,7 +3060,7 @@ var SequentialIdService = class {
|
|
|
2943
3060
|
};
|
|
2944
3061
|
|
|
2945
3062
|
// src/services/fee.ts
|
|
2946
|
-
var
|
|
3063
|
+
var SERVICE8 = { kind: "service" };
|
|
2947
3064
|
var FeeService = class {
|
|
2948
3065
|
constructor(ctx) {
|
|
2949
3066
|
this.ctx = ctx;
|
|
@@ -2966,7 +3083,7 @@ var FeeService = class {
|
|
|
2966
3083
|
* returned page is full). Defaults match Emporix server defaults
|
|
2967
3084
|
* (`pageNumber: 1`, `pageSize: 60`).
|
|
2968
3085
|
*/
|
|
2969
|
-
async list(query = {}, auth2 =
|
|
3086
|
+
async list(query = {}, auth2 = SERVICE8) {
|
|
2970
3087
|
const pageNumber = query.pageNumber ?? 1;
|
|
2971
3088
|
const pageSize = query.pageSize ?? 60;
|
|
2972
3089
|
const items = await this.ctx.http.request({
|
|
@@ -2978,7 +3095,7 @@ var FeeService = class {
|
|
|
2978
3095
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
2979
3096
|
}
|
|
2980
3097
|
/** Retrieve one fee definition by id. */
|
|
2981
|
-
async get(id, auth2 =
|
|
3098
|
+
async get(id, auth2 = SERVICE8) {
|
|
2982
3099
|
return this.ctx.http.request({
|
|
2983
3100
|
method: "GET",
|
|
2984
3101
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -2986,7 +3103,7 @@ var FeeService = class {
|
|
|
2986
3103
|
});
|
|
2987
3104
|
}
|
|
2988
3105
|
/** Create a fee definition. */
|
|
2989
|
-
async create(draft, auth2 =
|
|
3106
|
+
async create(draft, auth2 = SERVICE8) {
|
|
2990
3107
|
return this.ctx.http.request({
|
|
2991
3108
|
method: "POST",
|
|
2992
3109
|
path: this.feesBase(),
|
|
@@ -2995,7 +3112,7 @@ var FeeService = class {
|
|
|
2995
3112
|
});
|
|
2996
3113
|
}
|
|
2997
3114
|
/** Update a fee definition by id. */
|
|
2998
|
-
async update(id, draft, auth2 =
|
|
3115
|
+
async update(id, draft, auth2 = SERVICE8) {
|
|
2999
3116
|
return this.ctx.http.request({
|
|
3000
3117
|
method: "PUT",
|
|
3001
3118
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3004,7 +3121,7 @@ var FeeService = class {
|
|
|
3004
3121
|
});
|
|
3005
3122
|
}
|
|
3006
3123
|
/** Delete a fee definition by id. */
|
|
3007
|
-
async delete(id, auth2 =
|
|
3124
|
+
async delete(id, auth2 = SERVICE8) {
|
|
3008
3125
|
await this.ctx.http.request({
|
|
3009
3126
|
method: "DELETE",
|
|
3010
3127
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3013,7 +3130,7 @@ var FeeService = class {
|
|
|
3013
3130
|
}
|
|
3014
3131
|
// --- Item-fee mappings ---
|
|
3015
3132
|
/** List all item-fee mappings. */
|
|
3016
|
-
async listItemFees(auth2 =
|
|
3133
|
+
async listItemFees(auth2 = SERVICE8) {
|
|
3017
3134
|
return this.ctx.http.request({
|
|
3018
3135
|
method: "GET",
|
|
3019
3136
|
path: this.itemFeesBase(),
|
|
@@ -3021,7 +3138,7 @@ var FeeService = class {
|
|
|
3021
3138
|
});
|
|
3022
3139
|
}
|
|
3023
3140
|
/** Fee mappings for one item YRN. */
|
|
3024
|
-
async getItemFees(itemYrn, auth2 =
|
|
3141
|
+
async getItemFees(itemYrn, auth2 = SERVICE8) {
|
|
3025
3142
|
return this.ctx.http.request({
|
|
3026
3143
|
method: "GET",
|
|
3027
3144
|
path: `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`,
|
|
@@ -3029,7 +3146,7 @@ var FeeService = class {
|
|
|
3029
3146
|
});
|
|
3030
3147
|
}
|
|
3031
3148
|
/** Create an item-fee mapping. */
|
|
3032
|
-
async createItemFee(draft, auth2 =
|
|
3149
|
+
async createItemFee(draft, auth2 = SERVICE8) {
|
|
3033
3150
|
return this.ctx.http.request({
|
|
3034
3151
|
method: "POST",
|
|
3035
3152
|
path: this.itemFeesBase(),
|
|
@@ -3041,7 +3158,7 @@ var FeeService = class {
|
|
|
3041
3158
|
* Set the fee list for an item YRN. Destructive replace by default; pass
|
|
3042
3159
|
* `{ partial: true }` to merge (`?partial=true`).
|
|
3043
3160
|
*/
|
|
3044
|
-
async setItemFees(itemYrn, feeIds, opts = {}, auth2 =
|
|
3161
|
+
async setItemFees(itemYrn, feeIds, opts = {}, auth2 = SERVICE8) {
|
|
3045
3162
|
return this.ctx.http.request({
|
|
3046
3163
|
method: "PUT",
|
|
3047
3164
|
path: `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`,
|
|
@@ -3054,7 +3171,7 @@ var FeeService = class {
|
|
|
3054
3171
|
* Delete item-fee mappings for a YRN. Without `feeId`, removes all mappings
|
|
3055
3172
|
* for the YRN; with `feeId`, removes that single fee from the mapping.
|
|
3056
3173
|
*/
|
|
3057
|
-
async deleteItemFees(itemYrn, feeId, auth2 =
|
|
3174
|
+
async deleteItemFees(itemYrn, feeId, auth2 = SERVICE8) {
|
|
3058
3175
|
const base = `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`;
|
|
3059
3176
|
await this.ctx.http.request({
|
|
3060
3177
|
method: "DELETE",
|
|
@@ -3063,7 +3180,7 @@ var FeeService = class {
|
|
|
3063
3180
|
});
|
|
3064
3181
|
}
|
|
3065
3182
|
/** Search item-fee mappings by item YRNs + site. */
|
|
3066
|
-
async searchItemFees(search, auth2 =
|
|
3183
|
+
async searchItemFees(search, auth2 = SERVICE8) {
|
|
3067
3184
|
return this.ctx.http.request({
|
|
3068
3185
|
method: "POST",
|
|
3069
3186
|
path: `${this.itemFeesBase()}/search`,
|
|
@@ -3073,7 +3190,7 @@ var FeeService = class {
|
|
|
3073
3190
|
}
|
|
3074
3191
|
// --- Product-fee mappings ---
|
|
3075
3192
|
/** Fee mappings for a product id. */
|
|
3076
|
-
async getProductFees(productId, auth2 =
|
|
3193
|
+
async getProductFees(productId, auth2 = SERVICE8) {
|
|
3077
3194
|
return this.ctx.http.request({
|
|
3078
3195
|
method: "GET",
|
|
3079
3196
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -3084,7 +3201,7 @@ var FeeService = class {
|
|
|
3084
3201
|
* Set the fee list for a product id. Destructive replace by default; pass
|
|
3085
3202
|
* `{ partial: true }` to merge (`?partial=true`).
|
|
3086
3203
|
*/
|
|
3087
|
-
async setProductFees(productId, feeIds, opts = {}, auth2 =
|
|
3204
|
+
async setProductFees(productId, feeIds, opts = {}, auth2 = SERVICE8) {
|
|
3088
3205
|
return this.ctx.http.request({
|
|
3089
3206
|
method: "PUT",
|
|
3090
3207
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -3094,7 +3211,7 @@ var FeeService = class {
|
|
|
3094
3211
|
});
|
|
3095
3212
|
}
|
|
3096
3213
|
/** Delete all fee mappings for a product id. */
|
|
3097
|
-
async deleteProductFees(productId, auth2 =
|
|
3214
|
+
async deleteProductFees(productId, auth2 = SERVICE8) {
|
|
3098
3215
|
await this.ctx.http.request({
|
|
3099
3216
|
method: "DELETE",
|
|
3100
3217
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -3127,7 +3244,7 @@ var CloudFunctionsService = class {
|
|
|
3127
3244
|
};
|
|
3128
3245
|
|
|
3129
3246
|
// src/services/webhook.ts
|
|
3130
|
-
var
|
|
3247
|
+
var SERVICE9 = { kind: "service" };
|
|
3131
3248
|
var WebhookService = class {
|
|
3132
3249
|
constructor(ctx) {
|
|
3133
3250
|
this.ctx = ctx;
|
|
@@ -3138,7 +3255,7 @@ var WebhookService = class {
|
|
|
3138
3255
|
return `/webhook/${this.ctx.tenant}`;
|
|
3139
3256
|
}
|
|
3140
3257
|
/** List the event-subscription catalog with each event's on/off state. */
|
|
3141
|
-
async listEventSubscriptions(auth2 =
|
|
3258
|
+
async listEventSubscriptions(auth2 = SERVICE9) {
|
|
3142
3259
|
return this.ctx.http.request({
|
|
3143
3260
|
method: "GET",
|
|
3144
3261
|
path: `${this.base()}/event-subscriptions`,
|
|
@@ -3151,7 +3268,7 @@ var WebhookService = class {
|
|
|
3151
3268
|
* `code`/`status` (e.g. `results.filter(r => (r.code ?? 0) >= 400)`). Does
|
|
3152
3269
|
* NOT throw on a 207 with failed items; only a non-2xx HTTP status throws.
|
|
3153
3270
|
*/
|
|
3154
|
-
async updateEventSubscriptions(items, auth2 =
|
|
3271
|
+
async updateEventSubscriptions(items, auth2 = SERVICE9) {
|
|
3155
3272
|
return this.ctx.http.request({
|
|
3156
3273
|
method: "PATCH",
|
|
3157
3274
|
path: `${this.base()}/event-subscriptions`,
|
|
@@ -3160,7 +3277,7 @@ var WebhookService = class {
|
|
|
3160
3277
|
});
|
|
3161
3278
|
}
|
|
3162
3279
|
/** List delivery configurations. */
|
|
3163
|
-
async listConfigs(auth2 =
|
|
3280
|
+
async listConfigs(auth2 = SERVICE9) {
|
|
3164
3281
|
return this.ctx.http.request({
|
|
3165
3282
|
method: "GET",
|
|
3166
3283
|
path: `${this.base()}/config`,
|
|
@@ -3168,7 +3285,7 @@ var WebhookService = class {
|
|
|
3168
3285
|
});
|
|
3169
3286
|
}
|
|
3170
3287
|
/** Retrieve one delivery configuration by code. */
|
|
3171
|
-
async getConfig(code, auth2 =
|
|
3288
|
+
async getConfig(code, auth2 = SERVICE9) {
|
|
3172
3289
|
return this.ctx.http.request({
|
|
3173
3290
|
method: "GET",
|
|
3174
3291
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3176,7 +3293,7 @@ var WebhookService = class {
|
|
|
3176
3293
|
});
|
|
3177
3294
|
}
|
|
3178
3295
|
/** Create a delivery configuration. Returns the server-assigned `{ code }`. */
|
|
3179
|
-
async createConfig(draft, auth2 =
|
|
3296
|
+
async createConfig(draft, auth2 = SERVICE9) {
|
|
3180
3297
|
return this.ctx.http.request({
|
|
3181
3298
|
method: "POST",
|
|
3182
3299
|
path: `${this.base()}/config`,
|
|
@@ -3185,7 +3302,7 @@ var WebhookService = class {
|
|
|
3185
3302
|
});
|
|
3186
3303
|
}
|
|
3187
3304
|
/** Replace a delivery configuration by code (204). */
|
|
3188
|
-
async replaceConfig(code, draft, auth2 =
|
|
3305
|
+
async replaceConfig(code, draft, auth2 = SERVICE9) {
|
|
3189
3306
|
await this.ctx.http.request({
|
|
3190
3307
|
method: "PUT",
|
|
3191
3308
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3197,7 +3314,7 @@ var WebhookService = class {
|
|
|
3197
3314
|
* Partially update a delivery configuration by code (204). The body is an
|
|
3198
3315
|
* **array** of `{ op, path, value }` operations (UPSERT / REMOVE).
|
|
3199
3316
|
*/
|
|
3200
|
-
async patchConfig(code, patches, auth2 =
|
|
3317
|
+
async patchConfig(code, patches, auth2 = SERVICE9) {
|
|
3201
3318
|
await this.ctx.http.request({
|
|
3202
3319
|
method: "PATCH",
|
|
3203
3320
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3209,7 +3326,7 @@ var WebhookService = class {
|
|
|
3209
3326
|
* Delete a delivery configuration by code. Pass `{ force: true }` to delete
|
|
3210
3327
|
* the currently-active config (the server otherwise rejects it).
|
|
3211
3328
|
*/
|
|
3212
|
-
async deleteConfig(code, opts = {}, auth2 =
|
|
3329
|
+
async deleteConfig(code, opts = {}, auth2 = SERVICE9) {
|
|
3213
3330
|
await this.ctx.http.request({
|
|
3214
3331
|
method: "DELETE",
|
|
3215
3332
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3218,7 +3335,7 @@ var WebhookService = class {
|
|
|
3218
3335
|
});
|
|
3219
3336
|
}
|
|
3220
3337
|
/** Read delivery statistics over an optional `YYYY-MM` range. */
|
|
3221
|
-
async getStatistics(query = {}, auth2 =
|
|
3338
|
+
async getStatistics(query = {}, auth2 = SERVICE9) {
|
|
3222
3339
|
const q = {};
|
|
3223
3340
|
if (query.fromYearMonth) q.fromYearMonth = query.fromYearMonth;
|
|
3224
3341
|
if (query.toYearMonth) q.toYearMonth = query.toYearMonth;
|
|
@@ -3230,7 +3347,7 @@ var WebhookService = class {
|
|
|
3230
3347
|
});
|
|
3231
3348
|
}
|
|
3232
3349
|
/** Obtain Svix dashboard access (URL / token). */
|
|
3233
|
-
async getDashboardAccess(auth2 =
|
|
3350
|
+
async getDashboardAccess(auth2 = SERVICE9) {
|
|
3234
3351
|
return this.ctx.http.request({
|
|
3235
3352
|
method: "GET",
|
|
3236
3353
|
path: `${this.base()}/dashboard-access`,
|
|
@@ -3240,7 +3357,7 @@ var WebhookService = class {
|
|
|
3240
3357
|
};
|
|
3241
3358
|
|
|
3242
3359
|
// src/services/schema.ts
|
|
3243
|
-
var
|
|
3360
|
+
var SERVICE10 = { kind: "service" };
|
|
3244
3361
|
var SchemaService = class {
|
|
3245
3362
|
constructor(ctx) {
|
|
3246
3363
|
this.ctx = ctx;
|
|
@@ -3263,7 +3380,7 @@ var SchemaService = class {
|
|
|
3263
3380
|
* Pagination defaults match the rest of the SDK (`pageNumber: 1`,
|
|
3264
3381
|
* `pageSize: 60`).
|
|
3265
3382
|
*/
|
|
3266
|
-
async listSchemas(query = {}, auth2 =
|
|
3383
|
+
async listSchemas(query = {}, auth2 = SERVICE10) {
|
|
3267
3384
|
const pageNumber = query.pageNumber ?? 1;
|
|
3268
3385
|
const pageSize = query.pageSize ?? 60;
|
|
3269
3386
|
const q = { pageNumber, pageSize };
|
|
@@ -3278,7 +3395,7 @@ var SchemaService = class {
|
|
|
3278
3395
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3279
3396
|
}
|
|
3280
3397
|
/** Retrieve one schema by id. */
|
|
3281
|
-
async getSchema(id, auth2 =
|
|
3398
|
+
async getSchema(id, auth2 = SERVICE10) {
|
|
3282
3399
|
return this.ctx.http.request({
|
|
3283
3400
|
method: "GET",
|
|
3284
3401
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3286,7 +3403,7 @@ var SchemaService = class {
|
|
|
3286
3403
|
});
|
|
3287
3404
|
}
|
|
3288
3405
|
/** Create a schema. */
|
|
3289
|
-
async createSchema(draft, auth2 =
|
|
3406
|
+
async createSchema(draft, auth2 = SERVICE10) {
|
|
3290
3407
|
return this.ctx.http.request({
|
|
3291
3408
|
method: "POST",
|
|
3292
3409
|
path: this.schemasBase(),
|
|
@@ -3299,7 +3416,7 @@ var SchemaService = class {
|
|
|
3299
3416
|
* stale version yields 409 Conflict (propagated as the standard conflict
|
|
3300
3417
|
* error).
|
|
3301
3418
|
*/
|
|
3302
|
-
async updateSchema(id, draft, auth2 =
|
|
3419
|
+
async updateSchema(id, draft, auth2 = SERVICE10) {
|
|
3303
3420
|
return this.ctx.http.request({
|
|
3304
3421
|
method: "PUT",
|
|
3305
3422
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3308,7 +3425,7 @@ var SchemaService = class {
|
|
|
3308
3425
|
});
|
|
3309
3426
|
}
|
|
3310
3427
|
/** Delete a schema by id. */
|
|
3311
|
-
async deleteSchema(id, auth2 =
|
|
3428
|
+
async deleteSchema(id, auth2 = SERVICE10) {
|
|
3312
3429
|
await this.ctx.http.request({
|
|
3313
3430
|
method: "DELETE",
|
|
3314
3431
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3319,7 +3436,7 @@ var SchemaService = class {
|
|
|
3319
3436
|
* Validate a schema document without persisting it (`POST /schemas/file`).
|
|
3320
3437
|
* Returns the server's validation result verbatim.
|
|
3321
3438
|
*/
|
|
3322
|
-
async validateSchemaFile(body, auth2 =
|
|
3439
|
+
async validateSchemaFile(body, auth2 = SERVICE10) {
|
|
3323
3440
|
return this.ctx.http.request({
|
|
3324
3441
|
method: "POST",
|
|
3325
3442
|
path: `${this.schemasBase()}/file`,
|
|
@@ -3329,7 +3446,7 @@ var SchemaService = class {
|
|
|
3329
3446
|
}
|
|
3330
3447
|
// --- (B) Types -----------------------------------------------------------
|
|
3331
3448
|
/** List entity types that currently have at least one schema. */
|
|
3332
|
-
async listTypes(auth2 =
|
|
3449
|
+
async listTypes(auth2 = SERVICE10) {
|
|
3333
3450
|
return this.ctx.http.request({
|
|
3334
3451
|
method: "GET",
|
|
3335
3452
|
path: `/schema/${this.ctx.tenant}/types`,
|
|
@@ -3337,7 +3454,7 @@ var SchemaService = class {
|
|
|
3337
3454
|
});
|
|
3338
3455
|
}
|
|
3339
3456
|
/** Set the entity types a schema applies to (`PUT /schemas/{id}/types`). */
|
|
3340
|
-
async setSchemaTypes(id, types, auth2 =
|
|
3457
|
+
async setSchemaTypes(id, types, auth2 = SERVICE10) {
|
|
3341
3458
|
return this.ctx.http.request({
|
|
3342
3459
|
method: "PUT",
|
|
3343
3460
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}/types`,
|
|
@@ -3347,7 +3464,7 @@ var SchemaService = class {
|
|
|
3347
3464
|
}
|
|
3348
3465
|
// --- (C) Custom entities -------------------------------------------------
|
|
3349
3466
|
/** List custom-entity definitions. `expandSchemas` inlines each schema body. */
|
|
3350
|
-
async listCustomEntities(opts = {}, auth2 =
|
|
3467
|
+
async listCustomEntities(opts = {}, auth2 = SERVICE10) {
|
|
3351
3468
|
return this.ctx.http.request({
|
|
3352
3469
|
method: "GET",
|
|
3353
3470
|
path: this.entitiesBase(),
|
|
@@ -3356,7 +3473,7 @@ var SchemaService = class {
|
|
|
3356
3473
|
});
|
|
3357
3474
|
}
|
|
3358
3475
|
/** Retrieve one custom-entity definition by id. */
|
|
3359
|
-
async getCustomEntity(id, auth2 =
|
|
3476
|
+
async getCustomEntity(id, auth2 = SERVICE10) {
|
|
3360
3477
|
return this.ctx.http.request({
|
|
3361
3478
|
method: "GET",
|
|
3362
3479
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3364,7 +3481,7 @@ var SchemaService = class {
|
|
|
3364
3481
|
});
|
|
3365
3482
|
}
|
|
3366
3483
|
/** Create a custom-entity definition. */
|
|
3367
|
-
async createCustomEntity(draft, auth2 =
|
|
3484
|
+
async createCustomEntity(draft, auth2 = SERVICE10) {
|
|
3368
3485
|
return this.ctx.http.request({
|
|
3369
3486
|
method: "POST",
|
|
3370
3487
|
path: this.entitiesBase(),
|
|
@@ -3373,7 +3490,7 @@ var SchemaService = class {
|
|
|
3373
3490
|
});
|
|
3374
3491
|
}
|
|
3375
3492
|
/** Update a custom-entity definition. */
|
|
3376
|
-
async updateCustomEntity(id, draft, auth2 =
|
|
3493
|
+
async updateCustomEntity(id, draft, auth2 = SERVICE10) {
|
|
3377
3494
|
return this.ctx.http.request({
|
|
3378
3495
|
method: "PUT",
|
|
3379
3496
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3386,7 +3503,7 @@ var SchemaService = class {
|
|
|
3386
3503
|
* instances or schemas still reference it (propagated as the standard
|
|
3387
3504
|
* conflict error).
|
|
3388
3505
|
*/
|
|
3389
|
-
async deleteCustomEntity(id, auth2 =
|
|
3506
|
+
async deleteCustomEntity(id, auth2 = SERVICE10) {
|
|
3390
3507
|
await this.ctx.http.request({
|
|
3391
3508
|
method: "DELETE",
|
|
3392
3509
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3398,7 +3515,7 @@ var SchemaService = class {
|
|
|
3398
3515
|
* List a custom entity's instances, wrapped in {@link PaginatedItems}.
|
|
3399
3516
|
* `type` is the custom-entity type and is always the first argument.
|
|
3400
3517
|
*/
|
|
3401
|
-
async listInstances(type, query = {}, auth2 =
|
|
3518
|
+
async listInstances(type, query = {}, auth2 = SERVICE10) {
|
|
3402
3519
|
const pageNumber = query.pageNumber ?? 1;
|
|
3403
3520
|
const pageSize = query.pageSize ?? 60;
|
|
3404
3521
|
const items = await this.ctx.http.request({
|
|
@@ -3410,7 +3527,7 @@ var SchemaService = class {
|
|
|
3410
3527
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3411
3528
|
}
|
|
3412
3529
|
/** Retrieve one instance by id. */
|
|
3413
|
-
async getInstance(type, id, auth2 =
|
|
3530
|
+
async getInstance(type, id, auth2 = SERVICE10) {
|
|
3414
3531
|
return this.ctx.http.request({
|
|
3415
3532
|
method: "GET",
|
|
3416
3533
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3418,7 +3535,7 @@ var SchemaService = class {
|
|
|
3418
3535
|
});
|
|
3419
3536
|
}
|
|
3420
3537
|
/** Create an instance of a custom entity. */
|
|
3421
|
-
async createInstance(type, draft, auth2 =
|
|
3538
|
+
async createInstance(type, draft, auth2 = SERVICE10) {
|
|
3422
3539
|
return this.ctx.http.request({
|
|
3423
3540
|
method: "POST",
|
|
3424
3541
|
path: this.instancesBase(type),
|
|
@@ -3427,7 +3544,7 @@ var SchemaService = class {
|
|
|
3427
3544
|
});
|
|
3428
3545
|
}
|
|
3429
3546
|
/** Replace an instance (full `PUT`). */
|
|
3430
|
-
async replaceInstance(type, id, draft, auth2 =
|
|
3547
|
+
async replaceInstance(type, id, draft, auth2 = SERVICE10) {
|
|
3431
3548
|
return this.ctx.http.request({
|
|
3432
3549
|
method: "PUT",
|
|
3433
3550
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3436,7 +3553,7 @@ var SchemaService = class {
|
|
|
3436
3553
|
});
|
|
3437
3554
|
}
|
|
3438
3555
|
/** Partially update an instance (`PATCH`). */
|
|
3439
|
-
async patchInstance(type, id, patch, auth2 =
|
|
3556
|
+
async patchInstance(type, id, patch, auth2 = SERVICE10) {
|
|
3440
3557
|
return this.ctx.http.request({
|
|
3441
3558
|
method: "PATCH",
|
|
3442
3559
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3444,8 +3561,22 @@ var SchemaService = class {
|
|
|
3444
3561
|
body: patch
|
|
3445
3562
|
});
|
|
3446
3563
|
}
|
|
3564
|
+
/**
|
|
3565
|
+
* Patch up to 200 custom instances of `type` in one call
|
|
3566
|
+
* (`PATCH /custom-entities/{type}/instances/bulk`). Returns a 207 envelope:
|
|
3567
|
+
* a per-item result array — a 207 is success, individual failures live in
|
|
3568
|
+
* each item's `code`/`status`.
|
|
3569
|
+
*/
|
|
3570
|
+
async bulkPatchInstances(type, items, auth2 = SERVICE10) {
|
|
3571
|
+
return this.ctx.http.request({
|
|
3572
|
+
method: "PATCH",
|
|
3573
|
+
path: `${this.instancesBase(type)}/bulk`,
|
|
3574
|
+
auth: auth2,
|
|
3575
|
+
body: items
|
|
3576
|
+
});
|
|
3577
|
+
}
|
|
3447
3578
|
/** Delete an instance by id. */
|
|
3448
|
-
async deleteInstance(type, id, auth2 =
|
|
3579
|
+
async deleteInstance(type, id, auth2 = SERVICE10) {
|
|
3449
3580
|
await this.ctx.http.request({
|
|
3450
3581
|
method: "DELETE",
|
|
3451
3582
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3456,7 +3587,7 @@ var SchemaService = class {
|
|
|
3456
3587
|
* Structured search over a custom entity's instances
|
|
3457
3588
|
* (`POST /instances/search`), wrapped in {@link PaginatedItems}.
|
|
3458
3589
|
*/
|
|
3459
|
-
async searchInstances(type, body, auth2 =
|
|
3590
|
+
async searchInstances(type, body, auth2 = SERVICE10) {
|
|
3460
3591
|
const items = await this.ctx.http.request({
|
|
3461
3592
|
method: "POST",
|
|
3462
3593
|
path: `${this.instancesBase(type)}/search`,
|
|
@@ -3468,7 +3599,7 @@ var SchemaService = class {
|
|
|
3468
3599
|
};
|
|
3469
3600
|
|
|
3470
3601
|
// src/services/ai.ts
|
|
3471
|
-
var
|
|
3602
|
+
var SERVICE11 = { kind: "service" };
|
|
3472
3603
|
var AiService = class {
|
|
3473
3604
|
constructor(ctx) {
|
|
3474
3605
|
this.ctx = ctx;
|
|
@@ -3479,7 +3610,7 @@ var AiService = class {
|
|
|
3479
3610
|
return `/ai-service/${this.ctx.tenant}`;
|
|
3480
3611
|
}
|
|
3481
3612
|
/** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
|
|
3482
|
-
async generateText(input, auth2 =
|
|
3613
|
+
async generateText(input, auth2 = SERVICE11) {
|
|
3483
3614
|
return this.ctx.http.request({
|
|
3484
3615
|
method: "POST",
|
|
3485
3616
|
path: `${this.base()}/texts`,
|
|
@@ -3488,7 +3619,7 @@ var AiService = class {
|
|
|
3488
3619
|
});
|
|
3489
3620
|
}
|
|
3490
3621
|
/** Run a chat completion over a message list (`POST /completions`). No `maxTokens`. */
|
|
3491
|
-
async complete(input, auth2 =
|
|
3622
|
+
async complete(input, auth2 = SERVICE11) {
|
|
3492
3623
|
return this.ctx.http.request({
|
|
3493
3624
|
method: "POST",
|
|
3494
3625
|
path: `${this.base()}/completions`,
|
|
@@ -3497,7 +3628,7 @@ var AiService = class {
|
|
|
3497
3628
|
});
|
|
3498
3629
|
}
|
|
3499
3630
|
/** List all agentic agents. */
|
|
3500
|
-
async listAgents(auth2 =
|
|
3631
|
+
async listAgents(auth2 = SERVICE11) {
|
|
3501
3632
|
return this.ctx.http.request({
|
|
3502
3633
|
method: "GET",
|
|
3503
3634
|
path: `${this.base()}/agentic/agents`,
|
|
@@ -3505,7 +3636,7 @@ var AiService = class {
|
|
|
3505
3636
|
});
|
|
3506
3637
|
}
|
|
3507
3638
|
/** Retrieve one agent by id. */
|
|
3508
|
-
async getAgent(id, auth2 =
|
|
3639
|
+
async getAgent(id, auth2 = SERVICE11) {
|
|
3509
3640
|
return this.ctx.http.request({
|
|
3510
3641
|
method: "GET",
|
|
3511
3642
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3513,7 +3644,7 @@ var AiService = class {
|
|
|
3513
3644
|
});
|
|
3514
3645
|
}
|
|
3515
3646
|
/** Create-or-replace an agent by id (`PUT`). Takes the agent write shape. */
|
|
3516
|
-
async upsertAgent(id, agent, auth2 =
|
|
3647
|
+
async upsertAgent(id, agent, auth2 = SERVICE11) {
|
|
3517
3648
|
return this.ctx.http.request({
|
|
3518
3649
|
method: "PUT",
|
|
3519
3650
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3526,7 +3657,7 @@ var AiService = class {
|
|
|
3526
3657
|
* UPPERCASE enum (`ADD | REMOVE | REPLACE`) and are sent verbatim — this is
|
|
3527
3658
|
* NOT RFC-6902 JSON-Patch.
|
|
3528
3659
|
*/
|
|
3529
|
-
async patchAgent(id, ops, auth2 =
|
|
3660
|
+
async patchAgent(id, ops, auth2 = SERVICE11) {
|
|
3530
3661
|
return this.ctx.http.request({
|
|
3531
3662
|
method: "PATCH",
|
|
3532
3663
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3538,7 +3669,7 @@ var AiService = class {
|
|
|
3538
3669
|
* Delete an agent by id. Pass `{ force: true }` to delete an agent that is
|
|
3539
3670
|
* still referenced elsewhere (`?force=true`).
|
|
3540
3671
|
*/
|
|
3541
|
-
async deleteAgent(id, auth2 =
|
|
3672
|
+
async deleteAgent(id, auth2 = SERVICE11, opts = {}) {
|
|
3542
3673
|
await this.ctx.http.request({
|
|
3543
3674
|
method: "DELETE",
|
|
3544
3675
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3547,7 +3678,7 @@ var AiService = class {
|
|
|
3547
3678
|
});
|
|
3548
3679
|
}
|
|
3549
3680
|
/** Server-side agent search (`POST /agentic/agents/search`). */
|
|
3550
|
-
async searchAgents(query, auth2 =
|
|
3681
|
+
async searchAgents(query, auth2 = SERVICE11) {
|
|
3551
3682
|
return this.ctx.http.request({
|
|
3552
3683
|
method: "POST",
|
|
3553
3684
|
path: `${this.base()}/agentic/agents/search`,
|
|
@@ -3559,7 +3690,7 @@ var AiService = class {
|
|
|
3559
3690
|
* Synchronous agent chat (`POST /agentic/chat`). Returns the response
|
|
3560
3691
|
* ARRAY verbatim (the upstream contract is an array, not a single object).
|
|
3561
3692
|
*/
|
|
3562
|
-
async chat(input, auth2 =
|
|
3693
|
+
async chat(input, auth2 = SERVICE11) {
|
|
3563
3694
|
return this.ctx.http.request({
|
|
3564
3695
|
method: "POST",
|
|
3565
3696
|
path: `${this.base()}/agentic/chat`,
|
|
@@ -3571,7 +3702,7 @@ var AiService = class {
|
|
|
3571
3702
|
* Fire-and-forget agent chat (`POST /agentic/chat-async`, HTTP 201).
|
|
3572
3703
|
* Returns the job-id ARRAY verbatim.
|
|
3573
3704
|
*/
|
|
3574
|
-
async chatAsync(input, auth2 =
|
|
3705
|
+
async chatAsync(input, auth2 = SERVICE11) {
|
|
3575
3706
|
return this.ctx.http.request({
|
|
3576
3707
|
method: "POST",
|
|
3577
3708
|
path: `${this.base()}/agentic/chat-async`,
|
|
@@ -3579,10 +3710,43 @@ var AiService = class {
|
|
|
3579
3710
|
body: input
|
|
3580
3711
|
});
|
|
3581
3712
|
}
|
|
3713
|
+
/**
|
|
3714
|
+
* Streaming agent chat (`POST /agentic/chat-stream`, `text/event-stream`).
|
|
3715
|
+
* Yields each SSE `data` payload verbatim — the upstream contract types the
|
|
3716
|
+
* stream body as an opaque string, so chunks are raw strings, not parsed
|
|
3717
|
+
* objects. Consume with `for await`.
|
|
3718
|
+
*/
|
|
3719
|
+
async *chatStream(input, opts = {}, auth2 = SERVICE11) {
|
|
3720
|
+
const events = this.ctx.http.requestStream({
|
|
3721
|
+
method: "POST",
|
|
3722
|
+
path: `${this.base()}/agentic/chat-stream`,
|
|
3723
|
+
auth: auth2,
|
|
3724
|
+
body: input,
|
|
3725
|
+
...opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {}
|
|
3726
|
+
});
|
|
3727
|
+
for await (const ev of events) yield ev.data;
|
|
3728
|
+
}
|
|
3729
|
+
/** List stored agentic conversations (`GET /agentic/conversations`). */
|
|
3730
|
+
async listConversations(auth2 = SERVICE11) {
|
|
3731
|
+
return this.ctx.http.request({
|
|
3732
|
+
method: "GET",
|
|
3733
|
+
path: `${this.base()}/agentic/conversations`,
|
|
3734
|
+
auth: auth2
|
|
3735
|
+
});
|
|
3736
|
+
}
|
|
3737
|
+
/** Server-side conversation search (`POST /agentic/conversations/search`). */
|
|
3738
|
+
async searchConversations(query, auth2 = SERVICE11) {
|
|
3739
|
+
return this.ctx.http.request({
|
|
3740
|
+
method: "POST",
|
|
3741
|
+
path: `${this.base()}/agentic/conversations/search`,
|
|
3742
|
+
auth: auth2,
|
|
3743
|
+
body: query
|
|
3744
|
+
});
|
|
3745
|
+
}
|
|
3582
3746
|
};
|
|
3583
3747
|
|
|
3584
3748
|
// src/services/tax.ts
|
|
3585
|
-
var
|
|
3749
|
+
var SERVICE12 = { kind: "service" };
|
|
3586
3750
|
var TaxService = class {
|
|
3587
3751
|
constructor(ctx) {
|
|
3588
3752
|
this.ctx = ctx;
|
|
@@ -3593,7 +3757,7 @@ var TaxService = class {
|
|
|
3593
3757
|
return `/tax/${this.ctx.tenant}`;
|
|
3594
3758
|
}
|
|
3595
3759
|
/** List all per-location tax configurations. */
|
|
3596
|
-
async listTaxConfigs(auth2 =
|
|
3760
|
+
async listTaxConfigs(auth2 = SERVICE12) {
|
|
3597
3761
|
return this.ctx.http.request({
|
|
3598
3762
|
method: "GET",
|
|
3599
3763
|
path: `${this.base()}/taxes`,
|
|
@@ -3601,7 +3765,7 @@ var TaxService = class {
|
|
|
3601
3765
|
});
|
|
3602
3766
|
}
|
|
3603
3767
|
/** Retrieve one tax configuration by its location (country) code. */
|
|
3604
|
-
async getTaxConfig(locationCode, auth2 =
|
|
3768
|
+
async getTaxConfig(locationCode, auth2 = SERVICE12) {
|
|
3605
3769
|
return this.ctx.http.request({
|
|
3606
3770
|
method: "GET",
|
|
3607
3771
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3609,7 +3773,7 @@ var TaxService = class {
|
|
|
3609
3773
|
});
|
|
3610
3774
|
}
|
|
3611
3775
|
/** Create a tax configuration (`POST`). Returns the created `{ locationCode }`. */
|
|
3612
|
-
async createTaxConfig(input, auth2 =
|
|
3776
|
+
async createTaxConfig(input, auth2 = SERVICE12) {
|
|
3613
3777
|
return this.ctx.http.request({
|
|
3614
3778
|
method: "POST",
|
|
3615
3779
|
path: `${this.base()}/taxes`,
|
|
@@ -3621,7 +3785,7 @@ var TaxService = class {
|
|
|
3621
3785
|
* Update a tax configuration by location code (`PUT`). `metadata.version` is
|
|
3622
3786
|
* required (optimistic locking — a stale version yields 409).
|
|
3623
3787
|
*/
|
|
3624
|
-
async updateTaxConfig(locationCode, input, auth2 =
|
|
3788
|
+
async updateTaxConfig(locationCode, input, auth2 = SERVICE12) {
|
|
3625
3789
|
return this.ctx.http.request({
|
|
3626
3790
|
method: "PUT",
|
|
3627
3791
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3630,7 +3794,7 @@ var TaxService = class {
|
|
|
3630
3794
|
});
|
|
3631
3795
|
}
|
|
3632
3796
|
/** Delete a tax configuration by location code. */
|
|
3633
|
-
async deleteTaxConfig(locationCode, auth2 =
|
|
3797
|
+
async deleteTaxConfig(locationCode, auth2 = SERVICE12) {
|
|
3634
3798
|
await this.ctx.http.request({
|
|
3635
3799
|
method: "DELETE",
|
|
3636
3800
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3641,7 +3805,7 @@ var TaxService = class {
|
|
|
3641
3805
|
* Calculate net/gross values for a price (`PUT /taxes/calculation-commands`).
|
|
3642
3806
|
* Single command in, single result out.
|
|
3643
3807
|
*/
|
|
3644
|
-
async calculateTax(request, auth2 =
|
|
3808
|
+
async calculateTax(request, auth2 = SERVICE12) {
|
|
3645
3809
|
return this.ctx.http.request({
|
|
3646
3810
|
method: "PUT",
|
|
3647
3811
|
path: `${this.base()}/taxes/calculation-commands`,
|
|
@@ -3652,7 +3816,7 @@ var TaxService = class {
|
|
|
3652
3816
|
};
|
|
3653
3817
|
|
|
3654
3818
|
// src/services/coupon.ts
|
|
3655
|
-
var
|
|
3819
|
+
var SERVICE13 = { kind: "service" };
|
|
3656
3820
|
var CouponService = class {
|
|
3657
3821
|
constructor(ctx) {
|
|
3658
3822
|
this.ctx = ctx;
|
|
@@ -3663,7 +3827,7 @@ var CouponService = class {
|
|
|
3663
3827
|
return `/coupon/${this.ctx.tenant}`;
|
|
3664
3828
|
}
|
|
3665
3829
|
/** List coupons by criteria. Returns a plain array. */
|
|
3666
|
-
async listCoupons(query = {}, auth2 =
|
|
3830
|
+
async listCoupons(query = {}, auth2 = SERVICE13) {
|
|
3667
3831
|
return this.ctx.http.request({
|
|
3668
3832
|
method: "GET",
|
|
3669
3833
|
path: `${this.base()}/coupons`,
|
|
@@ -3672,7 +3836,7 @@ var CouponService = class {
|
|
|
3672
3836
|
});
|
|
3673
3837
|
}
|
|
3674
3838
|
/** Retrieve one coupon by code. */
|
|
3675
|
-
async getCoupon(code, auth2 =
|
|
3839
|
+
async getCoupon(code, auth2 = SERVICE13) {
|
|
3676
3840
|
return this.ctx.http.request({
|
|
3677
3841
|
method: "GET",
|
|
3678
3842
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3680,7 +3844,7 @@ var CouponService = class {
|
|
|
3680
3844
|
});
|
|
3681
3845
|
}
|
|
3682
3846
|
/** Create a coupon (`POST`, HTTP 201). Returns the created resource's `{ id?, yrn? }`. */
|
|
3683
|
-
async createCoupon(input, auth2 =
|
|
3847
|
+
async createCoupon(input, auth2 = SERVICE13) {
|
|
3684
3848
|
return this.ctx.http.request({
|
|
3685
3849
|
method: "POST",
|
|
3686
3850
|
path: `${this.base()}/coupons`,
|
|
@@ -3689,7 +3853,7 @@ var CouponService = class {
|
|
|
3689
3853
|
});
|
|
3690
3854
|
}
|
|
3691
3855
|
/** Replace a coupon by code (`PUT`). Resolves once the update is accepted. */
|
|
3692
|
-
async updateCoupon(code, input, auth2 =
|
|
3856
|
+
async updateCoupon(code, input, auth2 = SERVICE13) {
|
|
3693
3857
|
await this.ctx.http.request({
|
|
3694
3858
|
method: "PUT",
|
|
3695
3859
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3698,7 +3862,7 @@ var CouponService = class {
|
|
|
3698
3862
|
});
|
|
3699
3863
|
}
|
|
3700
3864
|
/** Partially update a coupon by code (`PATCH` merge body). */
|
|
3701
|
-
async patchCoupon(code, patch, auth2 =
|
|
3865
|
+
async patchCoupon(code, patch, auth2 = SERVICE13) {
|
|
3702
3866
|
await this.ctx.http.request({
|
|
3703
3867
|
method: "PATCH",
|
|
3704
3868
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3707,7 +3871,7 @@ var CouponService = class {
|
|
|
3707
3871
|
});
|
|
3708
3872
|
}
|
|
3709
3873
|
/** Delete a coupon by code. */
|
|
3710
|
-
async deleteCoupon(code, auth2 =
|
|
3874
|
+
async deleteCoupon(code, auth2 = SERVICE13) {
|
|
3711
3875
|
await this.ctx.http.request({
|
|
3712
3876
|
method: "DELETE",
|
|
3713
3877
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3718,7 +3882,7 @@ var CouponService = class {
|
|
|
3718
3882
|
* Check whether a coupon can be redeemed (`POST /validation`). Resolves when
|
|
3719
3883
|
* redeemable; throws an `EmporixError` otherwise (no response body).
|
|
3720
3884
|
*/
|
|
3721
|
-
async validateCoupon(code, redemption, auth2 =
|
|
3885
|
+
async validateCoupon(code, redemption, auth2 = SERVICE13) {
|
|
3722
3886
|
await this.ctx.http.request({
|
|
3723
3887
|
method: "POST",
|
|
3724
3888
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/validation`,
|
|
@@ -3727,7 +3891,7 @@ var CouponService = class {
|
|
|
3727
3891
|
});
|
|
3728
3892
|
}
|
|
3729
3893
|
/** List a coupon's redemptions by criteria. */
|
|
3730
|
-
async listRedemptions(code, query = {}, auth2 =
|
|
3894
|
+
async listRedemptions(code, query = {}, auth2 = SERVICE13) {
|
|
3731
3895
|
return this.ctx.http.request({
|
|
3732
3896
|
method: "GET",
|
|
3733
3897
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -3736,7 +3900,7 @@ var CouponService = class {
|
|
|
3736
3900
|
});
|
|
3737
3901
|
}
|
|
3738
3902
|
/** Redeem a coupon by creating a redemption (`POST`, HTTP 201). Returns the resource location. */
|
|
3739
|
-
async redeemCoupon(code, redemption, auth2 =
|
|
3903
|
+
async redeemCoupon(code, redemption, auth2 = SERVICE13) {
|
|
3740
3904
|
return this.ctx.http.request({
|
|
3741
3905
|
method: "POST",
|
|
3742
3906
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -3745,7 +3909,7 @@ var CouponService = class {
|
|
|
3745
3909
|
});
|
|
3746
3910
|
}
|
|
3747
3911
|
/** Retrieve one redemption by id. */
|
|
3748
|
-
async getRedemption(code, id, auth2 =
|
|
3912
|
+
async getRedemption(code, id, auth2 = SERVICE13) {
|
|
3749
3913
|
return this.ctx.http.request({
|
|
3750
3914
|
method: "GET",
|
|
3751
3915
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -3753,7 +3917,7 @@ var CouponService = class {
|
|
|
3753
3917
|
});
|
|
3754
3918
|
}
|
|
3755
3919
|
/** Delete a redemption by id. */
|
|
3756
|
-
async deleteRedemption(code, id, auth2 =
|
|
3920
|
+
async deleteRedemption(code, id, auth2 = SERVICE13) {
|
|
3757
3921
|
await this.ctx.http.request({
|
|
3758
3922
|
method: "DELETE",
|
|
3759
3923
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -3761,7 +3925,7 @@ var CouponService = class {
|
|
|
3761
3925
|
});
|
|
3762
3926
|
}
|
|
3763
3927
|
/** Retrieve a customer's referral coupon (resolves to an empty body when none exists). */
|
|
3764
|
-
async getReferralCoupon(customerNumber, auth2 =
|
|
3928
|
+
async getReferralCoupon(customerNumber, auth2 = SERVICE13) {
|
|
3765
3929
|
return this.ctx.http.request({
|
|
3766
3930
|
method: "GET",
|
|
3767
3931
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -3769,7 +3933,7 @@ var CouponService = class {
|
|
|
3769
3933
|
});
|
|
3770
3934
|
}
|
|
3771
3935
|
/** Create a referral coupon code for a customer (no request body). */
|
|
3772
|
-
async createReferralCoupon(customerNumber, auth2 =
|
|
3936
|
+
async createReferralCoupon(customerNumber, auth2 = SERVICE13) {
|
|
3773
3937
|
return this.ctx.http.request({
|
|
3774
3938
|
method: "POST",
|
|
3775
3939
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -3779,7 +3943,7 @@ var CouponService = class {
|
|
|
3779
3943
|
};
|
|
3780
3944
|
|
|
3781
3945
|
// src/services/reward-points.ts
|
|
3782
|
-
var
|
|
3946
|
+
var SERVICE14 = { kind: "service" };
|
|
3783
3947
|
var RewardPointsService = class {
|
|
3784
3948
|
constructor(ctx) {
|
|
3785
3949
|
this.ctx = ctx;
|
|
@@ -3796,7 +3960,7 @@ var RewardPointsService = class {
|
|
|
3796
3960
|
}
|
|
3797
3961
|
// --- Admin: customer points management (service token) ---
|
|
3798
3962
|
/** Batch summary across all customers. */
|
|
3799
|
-
async listAllSummaries(query = {}, auth2 =
|
|
3963
|
+
async listAllSummaries(query = {}, auth2 = SERVICE14) {
|
|
3800
3964
|
return this.ctx.http.request({
|
|
3801
3965
|
method: "GET",
|
|
3802
3966
|
path: `${this.base()}/summaryBatch`,
|
|
@@ -3805,7 +3969,7 @@ var RewardPointsService = class {
|
|
|
3805
3969
|
});
|
|
3806
3970
|
}
|
|
3807
3971
|
/** Retrieve one customer's reward-points balance. */
|
|
3808
|
-
async getCustomerPoints(customerId, auth2 =
|
|
3972
|
+
async getCustomerPoints(customerId, auth2 = SERVICE14) {
|
|
3809
3973
|
return this.ctx.http.request({
|
|
3810
3974
|
method: "GET",
|
|
3811
3975
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3813,7 +3977,7 @@ var RewardPointsService = class {
|
|
|
3813
3977
|
});
|
|
3814
3978
|
}
|
|
3815
3979
|
/** Create a reward-points entry for a customer. */
|
|
3816
|
-
async createCustomerPoints(customerId, input, auth2 =
|
|
3980
|
+
async createCustomerPoints(customerId, input, auth2 = SERVICE14) {
|
|
3817
3981
|
await this.ctx.http.request({
|
|
3818
3982
|
method: "POST",
|
|
3819
3983
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3822,7 +3986,7 @@ var RewardPointsService = class {
|
|
|
3822
3986
|
});
|
|
3823
3987
|
}
|
|
3824
3988
|
/** Delete a customer's reward points. */
|
|
3825
|
-
async deleteCustomerPoints(customerId, auth2 =
|
|
3989
|
+
async deleteCustomerPoints(customerId, auth2 = SERVICE14) {
|
|
3826
3990
|
await this.ctx.http.request({
|
|
3827
3991
|
method: "DELETE",
|
|
3828
3992
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3830,7 +3994,7 @@ var RewardPointsService = class {
|
|
|
3830
3994
|
});
|
|
3831
3995
|
}
|
|
3832
3996
|
/** Retrieve a reward-points summary for one customer. */
|
|
3833
|
-
async getCustomerSummary(customerId, auth2 =
|
|
3997
|
+
async getCustomerSummary(customerId, auth2 = SERVICE14) {
|
|
3834
3998
|
return this.ctx.http.request({
|
|
3835
3999
|
method: "GET",
|
|
3836
4000
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/summary`,
|
|
@@ -3838,7 +4002,7 @@ var RewardPointsService = class {
|
|
|
3838
4002
|
});
|
|
3839
4003
|
}
|
|
3840
4004
|
/** Add reward points for a customer. */
|
|
3841
|
-
async addPoints(customerId, input, auth2 =
|
|
4005
|
+
async addPoints(customerId, input, auth2 = SERVICE14) {
|
|
3842
4006
|
await this.ctx.http.request({
|
|
3843
4007
|
method: "POST",
|
|
3844
4008
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/addPoints`,
|
|
@@ -3847,7 +4011,7 @@ var RewardPointsService = class {
|
|
|
3847
4011
|
});
|
|
3848
4012
|
}
|
|
3849
4013
|
/** Redeem a customer's reward points (on behalf). */
|
|
3850
|
-
async redeemPoints(customerId, input, auth2 =
|
|
4014
|
+
async redeemPoints(customerId, input, auth2 = SERVICE14) {
|
|
3851
4015
|
await this.ctx.http.request({
|
|
3852
4016
|
method: "POST",
|
|
3853
4017
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/redeemPoints`,
|
|
@@ -3898,7 +4062,7 @@ var RewardPointsService = class {
|
|
|
3898
4062
|
}
|
|
3899
4063
|
// --- Redeem options (tenant-scoped; read open to customer, management service-only) ---
|
|
3900
4064
|
/** List redeem options. Defaults to the service token; pass a customer `auth` for storefront reads. */
|
|
3901
|
-
async listRedeemOptions(auth2 =
|
|
4065
|
+
async listRedeemOptions(auth2 = SERVICE14) {
|
|
3902
4066
|
return this.ctx.http.request({
|
|
3903
4067
|
method: "GET",
|
|
3904
4068
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -3906,7 +4070,7 @@ var RewardPointsService = class {
|
|
|
3906
4070
|
});
|
|
3907
4071
|
}
|
|
3908
4072
|
/** Create a redeem option. Returns the updated options list. */
|
|
3909
|
-
async createRedeemOption(input, auth2 =
|
|
4073
|
+
async createRedeemOption(input, auth2 = SERVICE14) {
|
|
3910
4074
|
return this.ctx.http.request({
|
|
3911
4075
|
method: "POST",
|
|
3912
4076
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -3915,7 +4079,7 @@ var RewardPointsService = class {
|
|
|
3915
4079
|
});
|
|
3916
4080
|
}
|
|
3917
4081
|
/** Update a redeem option by id. Resolves once accepted (no response body). */
|
|
3918
|
-
async updateRedeemOption(redeemOptionId, input, auth2 =
|
|
4082
|
+
async updateRedeemOption(redeemOptionId, input, auth2 = SERVICE14) {
|
|
3919
4083
|
await this.ctx.http.request({
|
|
3920
4084
|
method: "PUT",
|
|
3921
4085
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -3924,7 +4088,7 @@ var RewardPointsService = class {
|
|
|
3924
4088
|
});
|
|
3925
4089
|
}
|
|
3926
4090
|
/** Delete a redeem option by id. */
|
|
3927
|
-
async deleteRedeemOption(redeemOptionId, auth2 =
|
|
4091
|
+
async deleteRedeemOption(redeemOptionId, auth2 = SERVICE14) {
|
|
3928
4092
|
await this.ctx.http.request({
|
|
3929
4093
|
method: "DELETE",
|
|
3930
4094
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -3934,7 +4098,7 @@ var RewardPointsService = class {
|
|
|
3934
4098
|
};
|
|
3935
4099
|
|
|
3936
4100
|
// src/services/brand.ts
|
|
3937
|
-
var
|
|
4101
|
+
var SERVICE15 = { kind: "service" };
|
|
3938
4102
|
var BrandService = class {
|
|
3939
4103
|
constructor(ctx) {
|
|
3940
4104
|
this.ctx = ctx;
|
|
@@ -3945,7 +4109,7 @@ var BrandService = class {
|
|
|
3945
4109
|
return `/brand/brands`;
|
|
3946
4110
|
}
|
|
3947
4111
|
/** List all brands. */
|
|
3948
|
-
async listBrands(query = {}, auth2 =
|
|
4112
|
+
async listBrands(query = {}, auth2 = SERVICE15) {
|
|
3949
4113
|
return this.ctx.http.request({
|
|
3950
4114
|
method: "GET",
|
|
3951
4115
|
path: this.base(),
|
|
@@ -3954,7 +4118,7 @@ var BrandService = class {
|
|
|
3954
4118
|
});
|
|
3955
4119
|
}
|
|
3956
4120
|
/** Retrieve one brand by id. */
|
|
3957
|
-
async getBrand(brandId, auth2 =
|
|
4121
|
+
async getBrand(brandId, auth2 = SERVICE15) {
|
|
3958
4122
|
return this.ctx.http.request({
|
|
3959
4123
|
method: "GET",
|
|
3960
4124
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3962,7 +4126,7 @@ var BrandService = class {
|
|
|
3962
4126
|
});
|
|
3963
4127
|
}
|
|
3964
4128
|
/** Create a brand. */
|
|
3965
|
-
async createBrand(input, auth2 =
|
|
4129
|
+
async createBrand(input, auth2 = SERVICE15) {
|
|
3966
4130
|
return this.ctx.http.request({
|
|
3967
4131
|
method: "POST",
|
|
3968
4132
|
path: this.base(),
|
|
@@ -3971,7 +4135,7 @@ var BrandService = class {
|
|
|
3971
4135
|
});
|
|
3972
4136
|
}
|
|
3973
4137
|
/** Replace a brand by id. */
|
|
3974
|
-
async updateBrand(brandId, input, auth2 =
|
|
4138
|
+
async updateBrand(brandId, input, auth2 = SERVICE15) {
|
|
3975
4139
|
return this.ctx.http.request({
|
|
3976
4140
|
method: "PUT",
|
|
3977
4141
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3980,7 +4144,7 @@ var BrandService = class {
|
|
|
3980
4144
|
});
|
|
3981
4145
|
}
|
|
3982
4146
|
/** Partially update a brand by id. */
|
|
3983
|
-
async patchBrand(brandId, patch, auth2 =
|
|
4147
|
+
async patchBrand(brandId, patch, auth2 = SERVICE15) {
|
|
3984
4148
|
return this.ctx.http.request({
|
|
3985
4149
|
method: "PATCH",
|
|
3986
4150
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3989,7 +4153,7 @@ var BrandService = class {
|
|
|
3989
4153
|
});
|
|
3990
4154
|
}
|
|
3991
4155
|
/** Delete a brand by id. */
|
|
3992
|
-
async deleteBrand(brandId, auth2 =
|
|
4156
|
+
async deleteBrand(brandId, auth2 = SERVICE15) {
|
|
3993
4157
|
await this.ctx.http.request({
|
|
3994
4158
|
method: "DELETE",
|
|
3995
4159
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3999,7 +4163,7 @@ var BrandService = class {
|
|
|
3999
4163
|
};
|
|
4000
4164
|
|
|
4001
4165
|
// src/services/label.ts
|
|
4002
|
-
var
|
|
4166
|
+
var SERVICE16 = { kind: "service" };
|
|
4003
4167
|
var LabelService = class {
|
|
4004
4168
|
constructor(ctx) {
|
|
4005
4169
|
this.ctx = ctx;
|
|
@@ -4010,7 +4174,7 @@ var LabelService = class {
|
|
|
4010
4174
|
return `/label/labels`;
|
|
4011
4175
|
}
|
|
4012
4176
|
/** List all labels. */
|
|
4013
|
-
async listLabels(query = {}, auth2 =
|
|
4177
|
+
async listLabels(query = {}, auth2 = SERVICE16) {
|
|
4014
4178
|
return this.ctx.http.request({
|
|
4015
4179
|
method: "GET",
|
|
4016
4180
|
path: this.base(),
|
|
@@ -4019,7 +4183,7 @@ var LabelService = class {
|
|
|
4019
4183
|
});
|
|
4020
4184
|
}
|
|
4021
4185
|
/** Retrieve one label by id. */
|
|
4022
|
-
async getLabel(labelId, auth2 =
|
|
4186
|
+
async getLabel(labelId, auth2 = SERVICE16) {
|
|
4023
4187
|
return this.ctx.http.request({
|
|
4024
4188
|
method: "GET",
|
|
4025
4189
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4027,7 +4191,7 @@ var LabelService = class {
|
|
|
4027
4191
|
});
|
|
4028
4192
|
}
|
|
4029
4193
|
/** Create a label. */
|
|
4030
|
-
async createLabel(input, auth2 =
|
|
4194
|
+
async createLabel(input, auth2 = SERVICE16) {
|
|
4031
4195
|
return this.ctx.http.request({
|
|
4032
4196
|
method: "POST",
|
|
4033
4197
|
path: this.base(),
|
|
@@ -4036,7 +4200,7 @@ var LabelService = class {
|
|
|
4036
4200
|
});
|
|
4037
4201
|
}
|
|
4038
4202
|
/** Replace a label by id. */
|
|
4039
|
-
async updateLabel(labelId, input, auth2 =
|
|
4203
|
+
async updateLabel(labelId, input, auth2 = SERVICE16) {
|
|
4040
4204
|
return this.ctx.http.request({
|
|
4041
4205
|
method: "PUT",
|
|
4042
4206
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4045,7 +4209,7 @@ var LabelService = class {
|
|
|
4045
4209
|
});
|
|
4046
4210
|
}
|
|
4047
4211
|
/** Partially update a label by id. */
|
|
4048
|
-
async patchLabel(labelId, patch, auth2 =
|
|
4212
|
+
async patchLabel(labelId, patch, auth2 = SERVICE16) {
|
|
4049
4213
|
return this.ctx.http.request({
|
|
4050
4214
|
method: "PATCH",
|
|
4051
4215
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4054,7 +4218,7 @@ var LabelService = class {
|
|
|
4054
4218
|
});
|
|
4055
4219
|
}
|
|
4056
4220
|
/** Delete a label by id. */
|
|
4057
|
-
async deleteLabel(labelId, auth2 =
|
|
4221
|
+
async deleteLabel(labelId, auth2 = SERVICE16) {
|
|
4058
4222
|
await this.ctx.http.request({
|
|
4059
4223
|
method: "DELETE",
|
|
4060
4224
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4064,7 +4228,7 @@ var LabelService = class {
|
|
|
4064
4228
|
};
|
|
4065
4229
|
|
|
4066
4230
|
// src/services/country.ts
|
|
4067
|
-
var
|
|
4231
|
+
var SERVICE17 = { kind: "service" };
|
|
4068
4232
|
var CountryService = class {
|
|
4069
4233
|
constructor(ctx) {
|
|
4070
4234
|
this.ctx = ctx;
|
|
@@ -4075,7 +4239,7 @@ var CountryService = class {
|
|
|
4075
4239
|
return `/country/${this.ctx.tenant}`;
|
|
4076
4240
|
}
|
|
4077
4241
|
/** List all countries. */
|
|
4078
|
-
async listCountries(query = {}, auth2 =
|
|
4242
|
+
async listCountries(query = {}, auth2 = SERVICE17) {
|
|
4079
4243
|
return this.ctx.http.request({
|
|
4080
4244
|
method: "GET",
|
|
4081
4245
|
path: `${this.base()}/countries`,
|
|
@@ -4084,7 +4248,7 @@ var CountryService = class {
|
|
|
4084
4248
|
});
|
|
4085
4249
|
}
|
|
4086
4250
|
/** Retrieve one country by code. */
|
|
4087
|
-
async getCountry(countryCode, auth2 =
|
|
4251
|
+
async getCountry(countryCode, auth2 = SERVICE17) {
|
|
4088
4252
|
return this.ctx.http.request({
|
|
4089
4253
|
method: "GET",
|
|
4090
4254
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -4092,7 +4256,7 @@ var CountryService = class {
|
|
|
4092
4256
|
});
|
|
4093
4257
|
}
|
|
4094
4258
|
/** Partially update a country by code. Resolves once accepted (no response body). */
|
|
4095
|
-
async patchCountry(countryCode, patch, auth2 =
|
|
4259
|
+
async patchCountry(countryCode, patch, auth2 = SERVICE17) {
|
|
4096
4260
|
await this.ctx.http.request({
|
|
4097
4261
|
method: "PATCH",
|
|
4098
4262
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -4101,7 +4265,7 @@ var CountryService = class {
|
|
|
4101
4265
|
});
|
|
4102
4266
|
}
|
|
4103
4267
|
/** List all regions. */
|
|
4104
|
-
async listRegions(query = {}, auth2 =
|
|
4268
|
+
async listRegions(query = {}, auth2 = SERVICE17) {
|
|
4105
4269
|
return this.ctx.http.request({
|
|
4106
4270
|
method: "GET",
|
|
4107
4271
|
path: `${this.base()}/regions`,
|
|
@@ -4110,7 +4274,7 @@ var CountryService = class {
|
|
|
4110
4274
|
});
|
|
4111
4275
|
}
|
|
4112
4276
|
/** Retrieve one region by code. */
|
|
4113
|
-
async getRegion(regionCode, auth2 =
|
|
4277
|
+
async getRegion(regionCode, auth2 = SERVICE17) {
|
|
4114
4278
|
return this.ctx.http.request({
|
|
4115
4279
|
method: "GET",
|
|
4116
4280
|
path: `${this.base()}/regions/${encodeURIComponent(regionCode)}`,
|
|
@@ -4120,7 +4284,7 @@ var CountryService = class {
|
|
|
4120
4284
|
};
|
|
4121
4285
|
|
|
4122
4286
|
// src/services/currency.ts
|
|
4123
|
-
var
|
|
4287
|
+
var SERVICE18 = { kind: "service" };
|
|
4124
4288
|
var CurrencyService = class {
|
|
4125
4289
|
constructor(ctx) {
|
|
4126
4290
|
this.ctx = ctx;
|
|
@@ -4132,7 +4296,7 @@ var CurrencyService = class {
|
|
|
4132
4296
|
}
|
|
4133
4297
|
// --- Currencies ---
|
|
4134
4298
|
/** List all currencies. */
|
|
4135
|
-
async listCurrencies(query = {}, auth2 =
|
|
4299
|
+
async listCurrencies(query = {}, auth2 = SERVICE18) {
|
|
4136
4300
|
return this.ctx.http.request({
|
|
4137
4301
|
method: "GET",
|
|
4138
4302
|
path: `${this.base()}/currencies`,
|
|
@@ -4141,7 +4305,7 @@ var CurrencyService = class {
|
|
|
4141
4305
|
});
|
|
4142
4306
|
}
|
|
4143
4307
|
/** Retrieve one currency by code. */
|
|
4144
|
-
async getCurrency(code, auth2 =
|
|
4308
|
+
async getCurrency(code, auth2 = SERVICE18) {
|
|
4145
4309
|
return this.ctx.http.request({
|
|
4146
4310
|
method: "GET",
|
|
4147
4311
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4149,7 +4313,7 @@ var CurrencyService = class {
|
|
|
4149
4313
|
});
|
|
4150
4314
|
}
|
|
4151
4315
|
/** Create a currency. */
|
|
4152
|
-
async createCurrency(input, auth2 =
|
|
4316
|
+
async createCurrency(input, auth2 = SERVICE18) {
|
|
4153
4317
|
return this.ctx.http.request({
|
|
4154
4318
|
method: "POST",
|
|
4155
4319
|
path: `${this.base()}/currencies`,
|
|
@@ -4158,7 +4322,7 @@ var CurrencyService = class {
|
|
|
4158
4322
|
});
|
|
4159
4323
|
}
|
|
4160
4324
|
/** Update a currency by code. */
|
|
4161
|
-
async updateCurrency(code, input, auth2 =
|
|
4325
|
+
async updateCurrency(code, input, auth2 = SERVICE18) {
|
|
4162
4326
|
return this.ctx.http.request({
|
|
4163
4327
|
method: "PUT",
|
|
4164
4328
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4167,7 +4331,7 @@ var CurrencyService = class {
|
|
|
4167
4331
|
});
|
|
4168
4332
|
}
|
|
4169
4333
|
/** Delete a currency by code. */
|
|
4170
|
-
async deleteCurrency(code, auth2 =
|
|
4334
|
+
async deleteCurrency(code, auth2 = SERVICE18) {
|
|
4171
4335
|
await this.ctx.http.request({
|
|
4172
4336
|
method: "DELETE",
|
|
4173
4337
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4176,7 +4340,7 @@ var CurrencyService = class {
|
|
|
4176
4340
|
}
|
|
4177
4341
|
// --- Exchange rates ---
|
|
4178
4342
|
/** List all exchange rates. */
|
|
4179
|
-
async listExchangeRates(query = {}, auth2 =
|
|
4343
|
+
async listExchangeRates(query = {}, auth2 = SERVICE18) {
|
|
4180
4344
|
return this.ctx.http.request({
|
|
4181
4345
|
method: "GET",
|
|
4182
4346
|
path: `${this.base()}/exchanges`,
|
|
@@ -4185,7 +4349,7 @@ var CurrencyService = class {
|
|
|
4185
4349
|
});
|
|
4186
4350
|
}
|
|
4187
4351
|
/** Retrieve one exchange rate by code. */
|
|
4188
|
-
async getExchangeRate(code, auth2 =
|
|
4352
|
+
async getExchangeRate(code, auth2 = SERVICE18) {
|
|
4189
4353
|
return this.ctx.http.request({
|
|
4190
4354
|
method: "GET",
|
|
4191
4355
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4193,7 +4357,7 @@ var CurrencyService = class {
|
|
|
4193
4357
|
});
|
|
4194
4358
|
}
|
|
4195
4359
|
/** Create an exchange rate. */
|
|
4196
|
-
async createExchangeRate(input, auth2 =
|
|
4360
|
+
async createExchangeRate(input, auth2 = SERVICE18) {
|
|
4197
4361
|
return this.ctx.http.request({
|
|
4198
4362
|
method: "POST",
|
|
4199
4363
|
path: `${this.base()}/exchanges`,
|
|
@@ -4202,7 +4366,7 @@ var CurrencyService = class {
|
|
|
4202
4366
|
});
|
|
4203
4367
|
}
|
|
4204
4368
|
/** Update an exchange rate by code. */
|
|
4205
|
-
async updateExchangeRate(code, input, auth2 =
|
|
4369
|
+
async updateExchangeRate(code, input, auth2 = SERVICE18) {
|
|
4206
4370
|
return this.ctx.http.request({
|
|
4207
4371
|
method: "PUT",
|
|
4208
4372
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4211,7 +4375,7 @@ var CurrencyService = class {
|
|
|
4211
4375
|
});
|
|
4212
4376
|
}
|
|
4213
4377
|
/** Delete an exchange rate by code. */
|
|
4214
|
-
async deleteExchangeRate(code, auth2 =
|
|
4378
|
+
async deleteExchangeRate(code, auth2 = SERVICE18) {
|
|
4215
4379
|
await this.ctx.http.request({
|
|
4216
4380
|
method: "DELETE",
|
|
4217
4381
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4221,7 +4385,7 @@ var CurrencyService = class {
|
|
|
4221
4385
|
};
|
|
4222
4386
|
|
|
4223
4387
|
// src/services/shipping.ts
|
|
4224
|
-
var
|
|
4388
|
+
var SERVICE19 = { kind: "service" };
|
|
4225
4389
|
var ShippingService = class {
|
|
4226
4390
|
constructor(ctx) {
|
|
4227
4391
|
this.ctx = ctx;
|
|
@@ -4236,7 +4400,7 @@ var ShippingService = class {
|
|
|
4236
4400
|
}
|
|
4237
4401
|
// --- Sites ---
|
|
4238
4402
|
/** Find shipping-related sites by postal code (`POST /findSite`). */
|
|
4239
|
-
async findSites(input, auth2 =
|
|
4403
|
+
async findSites(input, auth2 = SERVICE19) {
|
|
4240
4404
|
return this.ctx.http.request({
|
|
4241
4405
|
method: "POST",
|
|
4242
4406
|
path: `${this.base()}/findSite`,
|
|
@@ -4246,7 +4410,7 @@ var ShippingService = class {
|
|
|
4246
4410
|
}
|
|
4247
4411
|
// --- Zones ---
|
|
4248
4412
|
/** List shipping zones for a site. */
|
|
4249
|
-
async listZones(site, query = {}, auth2 =
|
|
4413
|
+
async listZones(site, query = {}, auth2 = SERVICE19) {
|
|
4250
4414
|
return this.ctx.http.request({
|
|
4251
4415
|
method: "GET",
|
|
4252
4416
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -4255,7 +4419,7 @@ var ShippingService = class {
|
|
|
4255
4419
|
});
|
|
4256
4420
|
}
|
|
4257
4421
|
/** Retrieve one shipping zone. */
|
|
4258
|
-
async getZone(site, zoneId, auth2 =
|
|
4422
|
+
async getZone(site, zoneId, auth2 = SERVICE19) {
|
|
4259
4423
|
return this.ctx.http.request({
|
|
4260
4424
|
method: "GET",
|
|
4261
4425
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4263,7 +4427,7 @@ var ShippingService = class {
|
|
|
4263
4427
|
});
|
|
4264
4428
|
}
|
|
4265
4429
|
/** Create a shipping zone. */
|
|
4266
|
-
async createZone(site, zone, auth2 =
|
|
4430
|
+
async createZone(site, zone, auth2 = SERVICE19) {
|
|
4267
4431
|
return this.ctx.http.request({
|
|
4268
4432
|
method: "POST",
|
|
4269
4433
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -4272,7 +4436,7 @@ var ShippingService = class {
|
|
|
4272
4436
|
});
|
|
4273
4437
|
}
|
|
4274
4438
|
/** Replace a shipping zone. */
|
|
4275
|
-
async updateZone(site, zoneId, zone, auth2 =
|
|
4439
|
+
async updateZone(site, zoneId, zone, auth2 = SERVICE19) {
|
|
4276
4440
|
await this.ctx.http.request({
|
|
4277
4441
|
method: "PUT",
|
|
4278
4442
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4281,7 +4445,7 @@ var ShippingService = class {
|
|
|
4281
4445
|
});
|
|
4282
4446
|
}
|
|
4283
4447
|
/** Partially update a shipping zone. */
|
|
4284
|
-
async patchZone(site, zoneId, patch, auth2 =
|
|
4448
|
+
async patchZone(site, zoneId, patch, auth2 = SERVICE19) {
|
|
4285
4449
|
await this.ctx.http.request({
|
|
4286
4450
|
method: "PATCH",
|
|
4287
4451
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4290,7 +4454,7 @@ var ShippingService = class {
|
|
|
4290
4454
|
});
|
|
4291
4455
|
}
|
|
4292
4456
|
/** Delete a shipping zone. */
|
|
4293
|
-
async deleteZone(site, zoneId, auth2 =
|
|
4457
|
+
async deleteZone(site, zoneId, auth2 = SERVICE19) {
|
|
4294
4458
|
await this.ctx.http.request({
|
|
4295
4459
|
method: "DELETE",
|
|
4296
4460
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4299,7 +4463,7 @@ var ShippingService = class {
|
|
|
4299
4463
|
}
|
|
4300
4464
|
// --- Methods (per zone) ---
|
|
4301
4465
|
/** List shipping methods of a zone. */
|
|
4302
|
-
async listMethods(site, zoneId, query = {}, auth2 =
|
|
4466
|
+
async listMethods(site, zoneId, query = {}, auth2 = SERVICE19) {
|
|
4303
4467
|
return this.ctx.http.request({
|
|
4304
4468
|
method: "GET",
|
|
4305
4469
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -4308,7 +4472,7 @@ var ShippingService = class {
|
|
|
4308
4472
|
});
|
|
4309
4473
|
}
|
|
4310
4474
|
/** Retrieve one shipping method. */
|
|
4311
|
-
async getMethod(site, zoneId, methodId, auth2 =
|
|
4475
|
+
async getMethod(site, zoneId, methodId, auth2 = SERVICE19) {
|
|
4312
4476
|
return this.ctx.http.request({
|
|
4313
4477
|
method: "GET",
|
|
4314
4478
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4316,7 +4480,7 @@ var ShippingService = class {
|
|
|
4316
4480
|
});
|
|
4317
4481
|
}
|
|
4318
4482
|
/** Create a shipping method in a zone. */
|
|
4319
|
-
async createMethod(site, zoneId, method, auth2 =
|
|
4483
|
+
async createMethod(site, zoneId, method, auth2 = SERVICE19) {
|
|
4320
4484
|
return this.ctx.http.request({
|
|
4321
4485
|
method: "POST",
|
|
4322
4486
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -4325,7 +4489,7 @@ var ShippingService = class {
|
|
|
4325
4489
|
});
|
|
4326
4490
|
}
|
|
4327
4491
|
/** Replace a shipping method. */
|
|
4328
|
-
async updateMethod(site, zoneId, methodId, method, auth2 =
|
|
4492
|
+
async updateMethod(site, zoneId, methodId, method, auth2 = SERVICE19) {
|
|
4329
4493
|
await this.ctx.http.request({
|
|
4330
4494
|
method: "PUT",
|
|
4331
4495
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4334,7 +4498,7 @@ var ShippingService = class {
|
|
|
4334
4498
|
});
|
|
4335
4499
|
}
|
|
4336
4500
|
/** Partially update a shipping method. */
|
|
4337
|
-
async patchMethod(site, zoneId, methodId, patch, auth2 =
|
|
4501
|
+
async patchMethod(site, zoneId, methodId, patch, auth2 = SERVICE19) {
|
|
4338
4502
|
await this.ctx.http.request({
|
|
4339
4503
|
method: "PATCH",
|
|
4340
4504
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4343,7 +4507,7 @@ var ShippingService = class {
|
|
|
4343
4507
|
});
|
|
4344
4508
|
}
|
|
4345
4509
|
/** Delete a shipping method. */
|
|
4346
|
-
async deleteMethod(site, zoneId, methodId, auth2 =
|
|
4510
|
+
async deleteMethod(site, zoneId, methodId, auth2 = SERVICE19) {
|
|
4347
4511
|
await this.ctx.http.request({
|
|
4348
4512
|
method: "DELETE",
|
|
4349
4513
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4352,7 +4516,7 @@ var ShippingService = class {
|
|
|
4352
4516
|
}
|
|
4353
4517
|
// --- Cost / quote ---
|
|
4354
4518
|
/** Calculate the final shipping cost (`POST /quote`). */
|
|
4355
|
-
async quote(site, input, auth2 =
|
|
4519
|
+
async quote(site, input, auth2 = SERVICE19) {
|
|
4356
4520
|
return this.ctx.http.request({
|
|
4357
4521
|
method: "POST",
|
|
4358
4522
|
path: `${this.siteBase(site)}/quote`,
|
|
@@ -4361,7 +4525,7 @@ var ShippingService = class {
|
|
|
4361
4525
|
});
|
|
4362
4526
|
}
|
|
4363
4527
|
/** Calculate the minimum shipping cost (`POST /quote/minimum`). */
|
|
4364
|
-
async quoteMinimum(site, input, auth2 =
|
|
4528
|
+
async quoteMinimum(site, input, auth2 = SERVICE19) {
|
|
4365
4529
|
return this.ctx.http.request({
|
|
4366
4530
|
method: "POST",
|
|
4367
4531
|
path: `${this.siteBase(site)}/quote/minimum`,
|
|
@@ -4370,7 +4534,7 @@ var ShippingService = class {
|
|
|
4370
4534
|
});
|
|
4371
4535
|
}
|
|
4372
4536
|
/** Calculate the shipping cost for a given slot (`POST /quote/slot`). */
|
|
4373
|
-
async quoteSlot(site, input, auth2 =
|
|
4537
|
+
async quoteSlot(site, input, auth2 = SERVICE19) {
|
|
4374
4538
|
return this.ctx.http.request({
|
|
4375
4539
|
method: "POST",
|
|
4376
4540
|
path: `${this.siteBase(site)}/quote/slot`,
|
|
@@ -4380,7 +4544,7 @@ var ShippingService = class {
|
|
|
4380
4544
|
}
|
|
4381
4545
|
// --- Groups ---
|
|
4382
4546
|
/** List shipping groups for a site. */
|
|
4383
|
-
async listGroups(site, query = {}, auth2 =
|
|
4547
|
+
async listGroups(site, query = {}, auth2 = SERVICE19) {
|
|
4384
4548
|
return this.ctx.http.request({
|
|
4385
4549
|
method: "GET",
|
|
4386
4550
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -4389,7 +4553,7 @@ var ShippingService = class {
|
|
|
4389
4553
|
});
|
|
4390
4554
|
}
|
|
4391
4555
|
/** Retrieve one shipping group. */
|
|
4392
|
-
async getGroup(site, groupId, auth2 =
|
|
4556
|
+
async getGroup(site, groupId, auth2 = SERVICE19) {
|
|
4393
4557
|
return this.ctx.http.request({
|
|
4394
4558
|
method: "GET",
|
|
4395
4559
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4397,7 +4561,7 @@ var ShippingService = class {
|
|
|
4397
4561
|
});
|
|
4398
4562
|
}
|
|
4399
4563
|
/** Create a shipping group. */
|
|
4400
|
-
async createGroup(site, group, auth2 =
|
|
4564
|
+
async createGroup(site, group, auth2 = SERVICE19) {
|
|
4401
4565
|
return this.ctx.http.request({
|
|
4402
4566
|
method: "POST",
|
|
4403
4567
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -4406,7 +4570,7 @@ var ShippingService = class {
|
|
|
4406
4570
|
});
|
|
4407
4571
|
}
|
|
4408
4572
|
/** Replace a shipping group. */
|
|
4409
|
-
async updateGroup(site, groupId, group, auth2 =
|
|
4573
|
+
async updateGroup(site, groupId, group, auth2 = SERVICE19) {
|
|
4410
4574
|
await this.ctx.http.request({
|
|
4411
4575
|
method: "PUT",
|
|
4412
4576
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4415,7 +4579,7 @@ var ShippingService = class {
|
|
|
4415
4579
|
});
|
|
4416
4580
|
}
|
|
4417
4581
|
/** Delete a shipping group. */
|
|
4418
|
-
async deleteGroup(site, groupId, auth2 =
|
|
4582
|
+
async deleteGroup(site, groupId, auth2 = SERVICE19) {
|
|
4419
4583
|
await this.ctx.http.request({
|
|
4420
4584
|
method: "DELETE",
|
|
4421
4585
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4424,7 +4588,7 @@ var ShippingService = class {
|
|
|
4424
4588
|
}
|
|
4425
4589
|
// --- Customer-group relations ---
|
|
4426
4590
|
/** List customer-group relations for a site. */
|
|
4427
|
-
async listCgRelations(site, query = {}, auth2 =
|
|
4591
|
+
async listCgRelations(site, query = {}, auth2 = SERVICE19) {
|
|
4428
4592
|
return this.ctx.http.request({
|
|
4429
4593
|
method: "GET",
|
|
4430
4594
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -4433,7 +4597,7 @@ var ShippingService = class {
|
|
|
4433
4597
|
});
|
|
4434
4598
|
}
|
|
4435
4599
|
/** Retrieve a customer's customer-group relations. */
|
|
4436
|
-
async getCgRelations(site, customerId, auth2 =
|
|
4600
|
+
async getCgRelations(site, customerId, auth2 = SERVICE19) {
|
|
4437
4601
|
return this.ctx.http.request({
|
|
4438
4602
|
method: "GET",
|
|
4439
4603
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4441,7 +4605,7 @@ var ShippingService = class {
|
|
|
4441
4605
|
});
|
|
4442
4606
|
}
|
|
4443
4607
|
/** Create a customer-group relation. */
|
|
4444
|
-
async createCgRelation(site, relation, auth2 =
|
|
4608
|
+
async createCgRelation(site, relation, auth2 = SERVICE19) {
|
|
4445
4609
|
return this.ctx.http.request({
|
|
4446
4610
|
method: "POST",
|
|
4447
4611
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -4450,7 +4614,7 @@ var ShippingService = class {
|
|
|
4450
4614
|
});
|
|
4451
4615
|
}
|
|
4452
4616
|
/** Update a customer's customer-group relations. */
|
|
4453
|
-
async updateCgRelations(site, customerId, relation, auth2 =
|
|
4617
|
+
async updateCgRelations(site, customerId, relation, auth2 = SERVICE19) {
|
|
4454
4618
|
await this.ctx.http.request({
|
|
4455
4619
|
method: "PUT",
|
|
4456
4620
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4459,7 +4623,7 @@ var ShippingService = class {
|
|
|
4459
4623
|
});
|
|
4460
4624
|
}
|
|
4461
4625
|
/** Delete a customer's customer-group relation. */
|
|
4462
|
-
async deleteCgRelation(site, customerId, auth2 =
|
|
4626
|
+
async deleteCgRelation(site, customerId, auth2 = SERVICE19) {
|
|
4463
4627
|
await this.ctx.http.request({
|
|
4464
4628
|
method: "DELETE",
|
|
4465
4629
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4468,7 +4632,7 @@ var ShippingService = class {
|
|
|
4468
4632
|
}
|
|
4469
4633
|
// --- Phase 2: delivery windows ---
|
|
4470
4634
|
/** Retrieve delivery windows for a delivery area + cart. */
|
|
4471
|
-
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 =
|
|
4635
|
+
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 = SERVICE19) {
|
|
4472
4636
|
return this.ctx.http.request({
|
|
4473
4637
|
method: "GET",
|
|
4474
4638
|
path: `${this.base()}/areaDeliveryTimes/${encodeURIComponent(deliveryAreaId)}/${encodeURIComponent(cartId)}`,
|
|
@@ -4476,7 +4640,7 @@ var ShippingService = class {
|
|
|
4476
4640
|
});
|
|
4477
4641
|
}
|
|
4478
4642
|
/** Retrieve delivery windows for a cart. */
|
|
4479
|
-
async getCartDeliveryWindows(cartId, auth2 =
|
|
4643
|
+
async getCartDeliveryWindows(cartId, auth2 = SERVICE19) {
|
|
4480
4644
|
return this.ctx.http.request({
|
|
4481
4645
|
method: "GET",
|
|
4482
4646
|
path: `${this.base()}/actualDeliveryWindows/${encodeURIComponent(cartId)}`,
|
|
@@ -4484,7 +4648,7 @@ var ShippingService = class {
|
|
|
4484
4648
|
});
|
|
4485
4649
|
}
|
|
4486
4650
|
/** Increment the delivery-window counter. */
|
|
4487
|
-
async incrementDeliveryWindowCounter(input, auth2 =
|
|
4651
|
+
async incrementDeliveryWindowCounter(input, auth2 = SERVICE19) {
|
|
4488
4652
|
await this.ctx.http.request({
|
|
4489
4653
|
method: "POST",
|
|
4490
4654
|
path: `${this.base()}/actualDeliveryWindows/incrementCounter`,
|
|
@@ -4493,7 +4657,7 @@ var ShippingService = class {
|
|
|
4493
4657
|
});
|
|
4494
4658
|
}
|
|
4495
4659
|
/** Validate a delivery window. Resolves when valid; throws otherwise. */
|
|
4496
|
-
async validateDeliveryWindow(input, auth2 =
|
|
4660
|
+
async validateDeliveryWindow(input, auth2 = SERVICE19) {
|
|
4497
4661
|
await this.ctx.http.request({
|
|
4498
4662
|
method: "POST",
|
|
4499
4663
|
path: `${this.base()}/deliveryWindowValidation`,
|
|
@@ -4503,7 +4667,7 @@ var ShippingService = class {
|
|
|
4503
4667
|
}
|
|
4504
4668
|
// --- Phase 2: delivery times ---
|
|
4505
4669
|
/** List all delivery times. */
|
|
4506
|
-
async listDeliveryTimes(query = {}, auth2 =
|
|
4670
|
+
async listDeliveryTimes(query = {}, auth2 = SERVICE19) {
|
|
4507
4671
|
return this.ctx.http.request({
|
|
4508
4672
|
method: "GET",
|
|
4509
4673
|
path: `${this.base()}/delivery-times`,
|
|
@@ -4512,7 +4676,7 @@ var ShippingService = class {
|
|
|
4512
4676
|
});
|
|
4513
4677
|
}
|
|
4514
4678
|
/** Retrieve one delivery time. */
|
|
4515
|
-
async getDeliveryTime(deliveryTimeId, auth2 =
|
|
4679
|
+
async getDeliveryTime(deliveryTimeId, auth2 = SERVICE19) {
|
|
4516
4680
|
return this.ctx.http.request({
|
|
4517
4681
|
method: "GET",
|
|
4518
4682
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4520,7 +4684,7 @@ var ShippingService = class {
|
|
|
4520
4684
|
});
|
|
4521
4685
|
}
|
|
4522
4686
|
/** Create a delivery time. */
|
|
4523
|
-
async createDeliveryTime(input, auth2 =
|
|
4687
|
+
async createDeliveryTime(input, auth2 = SERVICE19) {
|
|
4524
4688
|
return this.ctx.http.request({
|
|
4525
4689
|
method: "POST",
|
|
4526
4690
|
path: `${this.base()}/delivery-times`,
|
|
@@ -4529,7 +4693,7 @@ var ShippingService = class {
|
|
|
4529
4693
|
});
|
|
4530
4694
|
}
|
|
4531
4695
|
/** Create multiple delivery times (`POST /delivery-times/bulk`). */
|
|
4532
|
-
async createDeliveryTimesBulk(inputs, auth2 =
|
|
4696
|
+
async createDeliveryTimesBulk(inputs, auth2 = SERVICE19) {
|
|
4533
4697
|
return this.ctx.http.request({
|
|
4534
4698
|
method: "POST",
|
|
4535
4699
|
path: `${this.base()}/delivery-times/bulk`,
|
|
@@ -4538,7 +4702,7 @@ var ShippingService = class {
|
|
|
4538
4702
|
});
|
|
4539
4703
|
}
|
|
4540
4704
|
/** Replace a delivery time. */
|
|
4541
|
-
async updateDeliveryTime(deliveryTimeId, input, auth2 =
|
|
4705
|
+
async updateDeliveryTime(deliveryTimeId, input, auth2 = SERVICE19) {
|
|
4542
4706
|
await this.ctx.http.request({
|
|
4543
4707
|
method: "PUT",
|
|
4544
4708
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4547,7 +4711,7 @@ var ShippingService = class {
|
|
|
4547
4711
|
});
|
|
4548
4712
|
}
|
|
4549
4713
|
/** Partially update a delivery time (JSON-Patch op array). */
|
|
4550
|
-
async patchDeliveryTime(deliveryTimeId, ops, auth2 =
|
|
4714
|
+
async patchDeliveryTime(deliveryTimeId, ops, auth2 = SERVICE19) {
|
|
4551
4715
|
await this.ctx.http.request({
|
|
4552
4716
|
method: "PATCH",
|
|
4553
4717
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4556,7 +4720,7 @@ var ShippingService = class {
|
|
|
4556
4720
|
});
|
|
4557
4721
|
}
|
|
4558
4722
|
/** Delete a delivery time. */
|
|
4559
|
-
async deleteDeliveryTime(deliveryTimeId, auth2 =
|
|
4723
|
+
async deleteDeliveryTime(deliveryTimeId, auth2 = SERVICE19) {
|
|
4560
4724
|
await this.ctx.http.request({
|
|
4561
4725
|
method: "DELETE",
|
|
4562
4726
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4565,7 +4729,7 @@ var ShippingService = class {
|
|
|
4565
4729
|
}
|
|
4566
4730
|
// --- Phase 2: delivery time slots ---
|
|
4567
4731
|
/** List slots of a delivery time. */
|
|
4568
|
-
async listSlots(deliveryTimeId, auth2 =
|
|
4732
|
+
async listSlots(deliveryTimeId, auth2 = SERVICE19) {
|
|
4569
4733
|
return this.ctx.http.request({
|
|
4570
4734
|
method: "GET",
|
|
4571
4735
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4573,7 +4737,7 @@ var ShippingService = class {
|
|
|
4573
4737
|
});
|
|
4574
4738
|
}
|
|
4575
4739
|
/** Retrieve one slot. */
|
|
4576
|
-
async getSlot(deliveryTimeId, slotId, auth2 =
|
|
4740
|
+
async getSlot(deliveryTimeId, slotId, auth2 = SERVICE19) {
|
|
4577
4741
|
return this.ctx.http.request({
|
|
4578
4742
|
method: "GET",
|
|
4579
4743
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4581,7 +4745,7 @@ var ShippingService = class {
|
|
|
4581
4745
|
});
|
|
4582
4746
|
}
|
|
4583
4747
|
/** Create a slot in a delivery time. */
|
|
4584
|
-
async createSlot(deliveryTimeId, input, auth2 =
|
|
4748
|
+
async createSlot(deliveryTimeId, input, auth2 = SERVICE19) {
|
|
4585
4749
|
return this.ctx.http.request({
|
|
4586
4750
|
method: "POST",
|
|
4587
4751
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4590,7 +4754,7 @@ var ShippingService = class {
|
|
|
4590
4754
|
});
|
|
4591
4755
|
}
|
|
4592
4756
|
/** Replace a slot. */
|
|
4593
|
-
async updateSlot(deliveryTimeId, slotId, input, auth2 =
|
|
4757
|
+
async updateSlot(deliveryTimeId, slotId, input, auth2 = SERVICE19) {
|
|
4594
4758
|
await this.ctx.http.request({
|
|
4595
4759
|
method: "PUT",
|
|
4596
4760
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4599,7 +4763,7 @@ var ShippingService = class {
|
|
|
4599
4763
|
});
|
|
4600
4764
|
}
|
|
4601
4765
|
/** Partially update a slot (JSON-Patch op array). */
|
|
4602
|
-
async patchSlot(deliveryTimeId, slotId, ops, auth2 =
|
|
4766
|
+
async patchSlot(deliveryTimeId, slotId, ops, auth2 = SERVICE19) {
|
|
4603
4767
|
await this.ctx.http.request({
|
|
4604
4768
|
method: "PATCH",
|
|
4605
4769
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4608,7 +4772,7 @@ var ShippingService = class {
|
|
|
4608
4772
|
});
|
|
4609
4773
|
}
|
|
4610
4774
|
/** Delete a slot. */
|
|
4611
|
-
async deleteSlot(deliveryTimeId, slotId, auth2 =
|
|
4775
|
+
async deleteSlot(deliveryTimeId, slotId, auth2 = SERVICE19) {
|
|
4612
4776
|
await this.ctx.http.request({
|
|
4613
4777
|
method: "DELETE",
|
|
4614
4778
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4616,7 +4780,7 @@ var ShippingService = class {
|
|
|
4616
4780
|
});
|
|
4617
4781
|
}
|
|
4618
4782
|
/** Delete all slots of a delivery time. */
|
|
4619
|
-
async deleteAllSlots(deliveryTimeId, auth2 =
|
|
4783
|
+
async deleteAllSlots(deliveryTimeId, auth2 = SERVICE19) {
|
|
4620
4784
|
await this.ctx.http.request({
|
|
4621
4785
|
method: "DELETE",
|
|
4622
4786
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4625,7 +4789,7 @@ var ShippingService = class {
|
|
|
4625
4789
|
}
|
|
4626
4790
|
// --- Phase 2: delivery cycles ---
|
|
4627
4791
|
/** Generate a delivery cycle (`POST /delivery-cycles/generate`). Returns the cycle id. */
|
|
4628
|
-
async generateDeliveryCycle(input, auth2 =
|
|
4792
|
+
async generateDeliveryCycle(input, auth2 = SERVICE19) {
|
|
4629
4793
|
return this.ctx.http.request({
|
|
4630
4794
|
method: "POST",
|
|
4631
4795
|
path: `${this.base()}/delivery-cycles/generate`,
|
|
@@ -4636,7 +4800,7 @@ var ShippingService = class {
|
|
|
4636
4800
|
};
|
|
4637
4801
|
|
|
4638
4802
|
// src/services/returns.ts
|
|
4639
|
-
var
|
|
4803
|
+
var SERVICE20 = { kind: "service" };
|
|
4640
4804
|
var ReturnsService = class {
|
|
4641
4805
|
constructor(ctx) {
|
|
4642
4806
|
this.ctx = ctx;
|
|
@@ -4647,7 +4811,7 @@ var ReturnsService = class {
|
|
|
4647
4811
|
return `/return/${this.ctx.tenant}/returns`;
|
|
4648
4812
|
}
|
|
4649
4813
|
/** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
|
|
4650
|
-
async listReturns(query = {}, auth2 =
|
|
4814
|
+
async listReturns(query = {}, auth2 = SERVICE20) {
|
|
4651
4815
|
return this.ctx.http.request({
|
|
4652
4816
|
method: "GET",
|
|
4653
4817
|
path: this.base(),
|
|
@@ -4656,7 +4820,7 @@ var ReturnsService = class {
|
|
|
4656
4820
|
});
|
|
4657
4821
|
}
|
|
4658
4822
|
/** Retrieve one return by id. */
|
|
4659
|
-
async getReturn(returnId, auth2 =
|
|
4823
|
+
async getReturn(returnId, auth2 = SERVICE20) {
|
|
4660
4824
|
return this.ctx.http.request({
|
|
4661
4825
|
method: "GET",
|
|
4662
4826
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4664,7 +4828,7 @@ var ReturnsService = class {
|
|
|
4664
4828
|
});
|
|
4665
4829
|
}
|
|
4666
4830
|
/** Create a return. Returns the created `{ id }`. */
|
|
4667
|
-
async createReturn(input, auth2 =
|
|
4831
|
+
async createReturn(input, auth2 = SERVICE20) {
|
|
4668
4832
|
return this.ctx.http.request({
|
|
4669
4833
|
method: "POST",
|
|
4670
4834
|
path: this.base(),
|
|
@@ -4673,7 +4837,7 @@ var ReturnsService = class {
|
|
|
4673
4837
|
});
|
|
4674
4838
|
}
|
|
4675
4839
|
/** Replace a return by id (`PUT`). */
|
|
4676
|
-
async updateReturn(returnId, input, auth2 =
|
|
4840
|
+
async updateReturn(returnId, input, auth2 = SERVICE20) {
|
|
4677
4841
|
await this.ctx.http.request({
|
|
4678
4842
|
method: "PUT",
|
|
4679
4843
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4682,7 +4846,7 @@ var ReturnsService = class {
|
|
|
4682
4846
|
});
|
|
4683
4847
|
}
|
|
4684
4848
|
/** Partially update a return by id (`PATCH`, JSON-Patch op-array). */
|
|
4685
|
-
async patchReturn(returnId, ops, auth2 =
|
|
4849
|
+
async patchReturn(returnId, ops, auth2 = SERVICE20) {
|
|
4686
4850
|
await this.ctx.http.request({
|
|
4687
4851
|
method: "PATCH",
|
|
4688
4852
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4691,7 +4855,7 @@ var ReturnsService = class {
|
|
|
4691
4855
|
});
|
|
4692
4856
|
}
|
|
4693
4857
|
/** Delete a return by id. */
|
|
4694
|
-
async deleteReturn(returnId, auth2 =
|
|
4858
|
+
async deleteReturn(returnId, auth2 = SERVICE20) {
|
|
4695
4859
|
await this.ctx.http.request({
|
|
4696
4860
|
method: "DELETE",
|
|
4697
4861
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4701,7 +4865,7 @@ var ReturnsService = class {
|
|
|
4701
4865
|
};
|
|
4702
4866
|
|
|
4703
4867
|
// src/services/sepa-export.ts
|
|
4704
|
-
var
|
|
4868
|
+
var SERVICE21 = { kind: "service" };
|
|
4705
4869
|
var SepaExportService = class {
|
|
4706
4870
|
constructor(ctx) {
|
|
4707
4871
|
this.ctx = ctx;
|
|
@@ -4712,7 +4876,7 @@ var SepaExportService = class {
|
|
|
4712
4876
|
return `/sepa-export/${this.ctx.tenant}`;
|
|
4713
4877
|
}
|
|
4714
4878
|
/** Retrieve a SEPA export file by id. Returns the raw file content (text). */
|
|
4715
|
-
async getFile(fileId, auth2 =
|
|
4879
|
+
async getFile(fileId, auth2 = SERVICE21) {
|
|
4716
4880
|
const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
|
|
4717
4881
|
const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
|
|
4718
4882
|
if (!res.ok) {
|
|
@@ -4722,7 +4886,7 @@ var SepaExportService = class {
|
|
|
4722
4886
|
return res.text();
|
|
4723
4887
|
}
|
|
4724
4888
|
/** List export jobs. */
|
|
4725
|
-
async listJobs(query = {}, auth2 =
|
|
4889
|
+
async listJobs(query = {}, auth2 = SERVICE21) {
|
|
4726
4890
|
return this.ctx.http.request({
|
|
4727
4891
|
method: "GET",
|
|
4728
4892
|
path: `${this.base()}/jobs`,
|
|
@@ -4731,7 +4895,7 @@ var SepaExportService = class {
|
|
|
4731
4895
|
});
|
|
4732
4896
|
}
|
|
4733
4897
|
/** Create an export job. */
|
|
4734
|
-
async createJob(input, auth2 =
|
|
4898
|
+
async createJob(input, auth2 = SERVICE21) {
|
|
4735
4899
|
return this.ctx.http.request({
|
|
4736
4900
|
method: "POST",
|
|
4737
4901
|
path: `${this.base()}/jobs`,
|
|
@@ -4742,7 +4906,7 @@ var SepaExportService = class {
|
|
|
4742
4906
|
};
|
|
4743
4907
|
|
|
4744
4908
|
// src/services/indexing.ts
|
|
4745
|
-
var
|
|
4909
|
+
var SERVICE22 = { kind: "service" };
|
|
4746
4910
|
var IndexingService = class {
|
|
4747
4911
|
constructor(ctx) {
|
|
4748
4912
|
this.ctx = ctx;
|
|
@@ -4753,11 +4917,11 @@ var IndexingService = class {
|
|
|
4753
4917
|
return `/indexing/${this.ctx.tenant}`;
|
|
4754
4918
|
}
|
|
4755
4919
|
/** List indexing configurations. */
|
|
4756
|
-
async listConfigurations(auth2 =
|
|
4920
|
+
async listConfigurations(auth2 = SERVICE22) {
|
|
4757
4921
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
|
|
4758
4922
|
}
|
|
4759
4923
|
/** Get a configuration by provider name. */
|
|
4760
|
-
async getConfiguration(provider, auth2 =
|
|
4924
|
+
async getConfiguration(provider, auth2 = SERVICE22) {
|
|
4761
4925
|
return this.ctx.http.request({
|
|
4762
4926
|
method: "GET",
|
|
4763
4927
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4765,7 +4929,7 @@ var IndexingService = class {
|
|
|
4765
4929
|
});
|
|
4766
4930
|
}
|
|
4767
4931
|
/** Create a configuration. */
|
|
4768
|
-
async createConfiguration(input, auth2 =
|
|
4932
|
+
async createConfiguration(input, auth2 = SERVICE22) {
|
|
4769
4933
|
return this.ctx.http.request({
|
|
4770
4934
|
method: "POST",
|
|
4771
4935
|
path: `${this.base()}/configurations`,
|
|
@@ -4774,7 +4938,7 @@ var IndexingService = class {
|
|
|
4774
4938
|
});
|
|
4775
4939
|
}
|
|
4776
4940
|
/** Update a configuration by provider name. */
|
|
4777
|
-
async updateConfiguration(provider, input, auth2 =
|
|
4941
|
+
async updateConfiguration(provider, input, auth2 = SERVICE22) {
|
|
4778
4942
|
await this.ctx.http.request({
|
|
4779
4943
|
method: "PUT",
|
|
4780
4944
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4783,7 +4947,7 @@ var IndexingService = class {
|
|
|
4783
4947
|
});
|
|
4784
4948
|
}
|
|
4785
4949
|
/** Delete a configuration by provider name. */
|
|
4786
|
-
async deleteConfiguration(provider, auth2 =
|
|
4950
|
+
async deleteConfiguration(provider, auth2 = SERVICE22) {
|
|
4787
4951
|
await this.ctx.http.request({
|
|
4788
4952
|
method: "DELETE",
|
|
4789
4953
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4791,25 +4955,65 @@ var IndexingService = class {
|
|
|
4791
4955
|
});
|
|
4792
4956
|
}
|
|
4793
4957
|
/** List public indexing configurations. */
|
|
4794
|
-
async listPublicConfigurations(auth2 =
|
|
4958
|
+
async listPublicConfigurations(auth2 = SERVICE22) {
|
|
4795
4959
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
|
|
4796
4960
|
}
|
|
4797
4961
|
/** Get a public configuration by provider name. */
|
|
4798
|
-
async getPublicConfiguration(provider, auth2 =
|
|
4962
|
+
async getPublicConfiguration(provider, auth2 = SERVICE22) {
|
|
4799
4963
|
return this.ctx.http.request({
|
|
4800
4964
|
method: "GET",
|
|
4801
4965
|
path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
|
|
4802
4966
|
auth: auth2
|
|
4803
4967
|
});
|
|
4804
4968
|
}
|
|
4805
|
-
/**
|
|
4806
|
-
|
|
4969
|
+
/**
|
|
4970
|
+
* Create a reindex job (replaces {@link reindex}). A `FULL` reindex of the
|
|
4971
|
+
* given `entityType`; set `rag: true` to also rebuild the RAG vector index
|
|
4972
|
+
* (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
|
|
4973
|
+
* `entityType` is already `IN_PROGRESS`, that running job (`200`).
|
|
4974
|
+
*/
|
|
4975
|
+
async createReindexJob(input, auth2 = SERVICE22) {
|
|
4976
|
+
return this.ctx.http.request({
|
|
4977
|
+
method: "POST",
|
|
4978
|
+
path: `${this.base()}/reindex-jobs`,
|
|
4979
|
+
auth: auth2,
|
|
4980
|
+
body: input
|
|
4981
|
+
});
|
|
4982
|
+
}
|
|
4983
|
+
/** List reindex jobs (paginated). */
|
|
4984
|
+
async listReindexJobs(opts = {}, auth2 = SERVICE22) {
|
|
4985
|
+
const pageNumber = opts.pageNumber ?? 1;
|
|
4986
|
+
const pageSize = opts.pageSize ?? 50;
|
|
4987
|
+
const query = { pageNumber, pageSize };
|
|
4988
|
+
if (opts.q !== void 0) query.q = opts.q;
|
|
4989
|
+
const items = await this.ctx.http.request({
|
|
4990
|
+
method: "GET",
|
|
4991
|
+
path: `${this.base()}/reindex-jobs`,
|
|
4992
|
+
query,
|
|
4993
|
+
auth: auth2
|
|
4994
|
+
});
|
|
4995
|
+
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
4996
|
+
}
|
|
4997
|
+
/** Fetch one reindex job by id. */
|
|
4998
|
+
async getReindexJob(reindexJobId, auth2 = SERVICE22) {
|
|
4999
|
+
return this.ctx.http.request({
|
|
5000
|
+
method: "GET",
|
|
5001
|
+
path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
|
|
5002
|
+
auth: auth2
|
|
5003
|
+
});
|
|
5004
|
+
}
|
|
5005
|
+
/**
|
|
5006
|
+
* Trigger a reindex.
|
|
5007
|
+
* @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
|
|
5008
|
+
* (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
|
|
5009
|
+
*/
|
|
5010
|
+
async reindex(input, auth2 = SERVICE22) {
|
|
4807
5011
|
await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
|
|
4808
5012
|
}
|
|
4809
5013
|
};
|
|
4810
5014
|
|
|
4811
5015
|
// src/services/unit-handling.ts
|
|
4812
|
-
var
|
|
5016
|
+
var SERVICE23 = { kind: "service" };
|
|
4813
5017
|
var UnitHandlingService = class {
|
|
4814
5018
|
constructor(ctx) {
|
|
4815
5019
|
this.ctx = ctx;
|
|
@@ -4820,7 +5024,7 @@ var UnitHandlingService = class {
|
|
|
4820
5024
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
4821
5025
|
}
|
|
4822
5026
|
/** Find units (filter/sort/page). */
|
|
4823
|
-
async listUnits(query = {}, auth2 =
|
|
5027
|
+
async listUnits(query = {}, auth2 = SERVICE23) {
|
|
4824
5028
|
return this.ctx.http.request({
|
|
4825
5029
|
method: "GET",
|
|
4826
5030
|
path: `${this.base()}/units`,
|
|
@@ -4829,7 +5033,7 @@ var UnitHandlingService = class {
|
|
|
4829
5033
|
});
|
|
4830
5034
|
}
|
|
4831
5035
|
/** Retrieve a unit by code. */
|
|
4832
|
-
async getUnit(unitCode, auth2 =
|
|
5036
|
+
async getUnit(unitCode, auth2 = SERVICE23) {
|
|
4833
5037
|
return this.ctx.http.request({
|
|
4834
5038
|
method: "GET",
|
|
4835
5039
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -4837,11 +5041,11 @@ var UnitHandlingService = class {
|
|
|
4837
5041
|
});
|
|
4838
5042
|
}
|
|
4839
5043
|
/** Add a new unit. */
|
|
4840
|
-
async createUnit(input, auth2 =
|
|
5044
|
+
async createUnit(input, auth2 = SERVICE23) {
|
|
4841
5045
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
4842
5046
|
}
|
|
4843
5047
|
/** Update a unit by code. */
|
|
4844
|
-
async updateUnit(unitCode, input, auth2 =
|
|
5048
|
+
async updateUnit(unitCode, input, auth2 = SERVICE23) {
|
|
4845
5049
|
await this.ctx.http.request({
|
|
4846
5050
|
method: "PUT",
|
|
4847
5051
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -4850,7 +5054,7 @@ var UnitHandlingService = class {
|
|
|
4850
5054
|
});
|
|
4851
5055
|
}
|
|
4852
5056
|
/** Delete a unit by code. */
|
|
4853
|
-
async deleteUnit(unitCode, auth2 =
|
|
5057
|
+
async deleteUnit(unitCode, auth2 = SERVICE23) {
|
|
4854
5058
|
await this.ctx.http.request({
|
|
4855
5059
|
method: "DELETE",
|
|
4856
5060
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -4858,7 +5062,7 @@ var UnitHandlingService = class {
|
|
|
4858
5062
|
});
|
|
4859
5063
|
}
|
|
4860
5064
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
4861
|
-
async deleteUnits(codes, auth2 =
|
|
5065
|
+
async deleteUnits(codes, auth2 = SERVICE23) {
|
|
4862
5066
|
await this.ctx.http.request({
|
|
4863
5067
|
method: "DELETE",
|
|
4864
5068
|
path: `${this.base()}/units`,
|
|
@@ -4867,7 +5071,7 @@ var UnitHandlingService = class {
|
|
|
4867
5071
|
});
|
|
4868
5072
|
}
|
|
4869
5073
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
4870
|
-
async getConversionFactor(input, auth2 =
|
|
5074
|
+
async getConversionFactor(input, auth2 = SERVICE23) {
|
|
4871
5075
|
return this.ctx.http.request({
|
|
4872
5076
|
method: "PUT",
|
|
4873
5077
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -4876,7 +5080,7 @@ var UnitHandlingService = class {
|
|
|
4876
5080
|
});
|
|
4877
5081
|
}
|
|
4878
5082
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
4879
|
-
async convertUnit(input, auth2 =
|
|
5083
|
+
async convertUnit(input, auth2 = SERVICE23) {
|
|
4880
5084
|
return this.ctx.http.request({
|
|
4881
5085
|
method: "PUT",
|
|
4882
5086
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -4885,13 +5089,13 @@ var UnitHandlingService = class {
|
|
|
4885
5089
|
});
|
|
4886
5090
|
}
|
|
4887
5091
|
/** List all unit types. */
|
|
4888
|
-
async listUnitTypes(auth2 =
|
|
5092
|
+
async listUnitTypes(auth2 = SERVICE23) {
|
|
4889
5093
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
4890
5094
|
}
|
|
4891
5095
|
};
|
|
4892
5096
|
|
|
4893
5097
|
// src/services/catalog.ts
|
|
4894
|
-
var
|
|
5098
|
+
var SERVICE24 = { kind: "service" };
|
|
4895
5099
|
var CatalogService = class {
|
|
4896
5100
|
constructor(ctx) {
|
|
4897
5101
|
this.ctx = ctx;
|
|
@@ -4902,7 +5106,7 @@ var CatalogService = class {
|
|
|
4902
5106
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
4903
5107
|
}
|
|
4904
5108
|
/** List catalogs (filtered/sorted). */
|
|
4905
|
-
async listCatalogs(query = {}, auth2 =
|
|
5109
|
+
async listCatalogs(query = {}, auth2 = SERVICE24) {
|
|
4906
5110
|
return this.ctx.http.request({
|
|
4907
5111
|
method: "GET",
|
|
4908
5112
|
path: this.base(),
|
|
@@ -4911,7 +5115,7 @@ var CatalogService = class {
|
|
|
4911
5115
|
});
|
|
4912
5116
|
}
|
|
4913
5117
|
/** Retrieve a catalog by id. */
|
|
4914
|
-
async getCatalog(catalogId, auth2 =
|
|
5118
|
+
async getCatalog(catalogId, auth2 = SERVICE24) {
|
|
4915
5119
|
return this.ctx.http.request({
|
|
4916
5120
|
method: "GET",
|
|
4917
5121
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4919,7 +5123,7 @@ var CatalogService = class {
|
|
|
4919
5123
|
});
|
|
4920
5124
|
}
|
|
4921
5125
|
/** Retrieve all catalogs that contain a category. */
|
|
4922
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
5126
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE24) {
|
|
4923
5127
|
return this.ctx.http.request({
|
|
4924
5128
|
method: "GET",
|
|
4925
5129
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -4927,11 +5131,11 @@ var CatalogService = class {
|
|
|
4927
5131
|
});
|
|
4928
5132
|
}
|
|
4929
5133
|
/** Create a catalog. */
|
|
4930
|
-
async createCatalog(input, auth2 =
|
|
5134
|
+
async createCatalog(input, auth2 = SERVICE24) {
|
|
4931
5135
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
4932
5136
|
}
|
|
4933
5137
|
/** Upsert a catalog by id (`PUT`). */
|
|
4934
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
5138
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE24) {
|
|
4935
5139
|
return this.ctx.http.request({
|
|
4936
5140
|
method: "PUT",
|
|
4937
5141
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4940,7 +5144,7 @@ var CatalogService = class {
|
|
|
4940
5144
|
});
|
|
4941
5145
|
}
|
|
4942
5146
|
/** Partially update a catalog by id (`PATCH`). */
|
|
4943
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
5147
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE24) {
|
|
4944
5148
|
await this.ctx.http.request({
|
|
4945
5149
|
method: "PATCH",
|
|
4946
5150
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4949,7 +5153,7 @@ var CatalogService = class {
|
|
|
4949
5153
|
});
|
|
4950
5154
|
}
|
|
4951
5155
|
/** Remove a catalog by id. */
|
|
4952
|
-
async deleteCatalog(catalogId, auth2 =
|
|
5156
|
+
async deleteCatalog(catalogId, auth2 = SERVICE24) {
|
|
4953
5157
|
await this.ctx.http.request({
|
|
4954
5158
|
method: "DELETE",
|
|
4955
5159
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4959,7 +5163,7 @@ var CatalogService = class {
|
|
|
4959
5163
|
};
|
|
4960
5164
|
|
|
4961
5165
|
// src/services/vendor.ts
|
|
4962
|
-
var
|
|
5166
|
+
var SERVICE25 = { kind: "service" };
|
|
4963
5167
|
var VendorService = class {
|
|
4964
5168
|
constructor(ctx) {
|
|
4965
5169
|
this.ctx = ctx;
|
|
@@ -4971,7 +5175,7 @@ var VendorService = class {
|
|
|
4971
5175
|
}
|
|
4972
5176
|
// --- Vendors ---
|
|
4973
5177
|
/** List all vendors. */
|
|
4974
|
-
async listVendors(query = {}, auth2 =
|
|
5178
|
+
async listVendors(query = {}, auth2 = SERVICE25) {
|
|
4975
5179
|
return this.ctx.http.request({
|
|
4976
5180
|
method: "GET",
|
|
4977
5181
|
path: `${this.base()}/vendors`,
|
|
@@ -4980,7 +5184,7 @@ var VendorService = class {
|
|
|
4980
5184
|
});
|
|
4981
5185
|
}
|
|
4982
5186
|
/** Retrieve a vendor by id. */
|
|
4983
|
-
async getVendor(vendorId, auth2 =
|
|
5187
|
+
async getVendor(vendorId, auth2 = SERVICE25) {
|
|
4984
5188
|
return this.ctx.http.request({
|
|
4985
5189
|
method: "GET",
|
|
4986
5190
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -4988,7 +5192,7 @@ var VendorService = class {
|
|
|
4988
5192
|
});
|
|
4989
5193
|
}
|
|
4990
5194
|
/** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
|
|
4991
|
-
async searchVendors(query, auth2 =
|
|
5195
|
+
async searchVendors(query, auth2 = SERVICE25) {
|
|
4992
5196
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
4993
5197
|
return this.ctx.http.request({
|
|
4994
5198
|
method: "POST",
|
|
@@ -4998,11 +5202,11 @@ var VendorService = class {
|
|
|
4998
5202
|
});
|
|
4999
5203
|
}
|
|
5000
5204
|
/** Create a vendor. */
|
|
5001
|
-
async createVendor(input, auth2 =
|
|
5205
|
+
async createVendor(input, auth2 = SERVICE25) {
|
|
5002
5206
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
5003
5207
|
}
|
|
5004
5208
|
/** Upsert a vendor by id (`PUT`). */
|
|
5005
|
-
async updateVendor(vendorId, input, auth2 =
|
|
5209
|
+
async updateVendor(vendorId, input, auth2 = SERVICE25) {
|
|
5006
5210
|
await this.ctx.http.request({
|
|
5007
5211
|
method: "PUT",
|
|
5008
5212
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5011,7 +5215,7 @@ var VendorService = class {
|
|
|
5011
5215
|
});
|
|
5012
5216
|
}
|
|
5013
5217
|
/** Delete a vendor by id. */
|
|
5014
|
-
async deleteVendor(vendorId, auth2 =
|
|
5218
|
+
async deleteVendor(vendorId, auth2 = SERVICE25) {
|
|
5015
5219
|
await this.ctx.http.request({
|
|
5016
5220
|
method: "DELETE",
|
|
5017
5221
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5020,7 +5224,7 @@ var VendorService = class {
|
|
|
5020
5224
|
}
|
|
5021
5225
|
// --- Vendor locations ---
|
|
5022
5226
|
/** List all vendor locations. */
|
|
5023
|
-
async listVendorLocations(query = {}, auth2 =
|
|
5227
|
+
async listVendorLocations(query = {}, auth2 = SERVICE25) {
|
|
5024
5228
|
return this.ctx.http.request({
|
|
5025
5229
|
method: "GET",
|
|
5026
5230
|
path: `${this.base()}/locations`,
|
|
@@ -5029,7 +5233,7 @@ var VendorService = class {
|
|
|
5029
5233
|
});
|
|
5030
5234
|
}
|
|
5031
5235
|
/** Retrieve a vendor location by id. */
|
|
5032
|
-
async getVendorLocation(locationId, auth2 =
|
|
5236
|
+
async getVendorLocation(locationId, auth2 = SERVICE25) {
|
|
5033
5237
|
return this.ctx.http.request({
|
|
5034
5238
|
method: "GET",
|
|
5035
5239
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5037,11 +5241,11 @@ var VendorService = class {
|
|
|
5037
5241
|
});
|
|
5038
5242
|
}
|
|
5039
5243
|
/** Create a vendor location. */
|
|
5040
|
-
async createVendorLocation(input, auth2 =
|
|
5244
|
+
async createVendorLocation(input, auth2 = SERVICE25) {
|
|
5041
5245
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
5042
5246
|
}
|
|
5043
5247
|
/** Upsert a vendor location by id (`PUT`). */
|
|
5044
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
5248
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE25) {
|
|
5045
5249
|
await this.ctx.http.request({
|
|
5046
5250
|
method: "PUT",
|
|
5047
5251
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5050,7 +5254,7 @@ var VendorService = class {
|
|
|
5050
5254
|
});
|
|
5051
5255
|
}
|
|
5052
5256
|
/** Delete a vendor location by id. */
|
|
5053
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
5257
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE25) {
|
|
5054
5258
|
await this.ctx.http.request({
|
|
5055
5259
|
method: "DELETE",
|
|
5056
5260
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5060,7 +5264,7 @@ var VendorService = class {
|
|
|
5060
5264
|
};
|
|
5061
5265
|
|
|
5062
5266
|
// src/services/pick-pack.ts
|
|
5063
|
-
var
|
|
5267
|
+
var SERVICE26 = { kind: "service" };
|
|
5064
5268
|
var PickPackService = class {
|
|
5065
5269
|
constructor(ctx) {
|
|
5066
5270
|
this.ctx = ctx;
|
|
@@ -5074,7 +5278,7 @@ var PickPackService = class {
|
|
|
5074
5278
|
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
5075
5279
|
}
|
|
5076
5280
|
/** List packlist orders. */
|
|
5077
|
-
async listOrders(query = {}, auth2 =
|
|
5281
|
+
async listOrders(query = {}, auth2 = SERVICE26) {
|
|
5078
5282
|
return this.ctx.http.request({
|
|
5079
5283
|
method: "GET",
|
|
5080
5284
|
path: `${this.base()}/orders`,
|
|
@@ -5083,19 +5287,19 @@ var PickPackService = class {
|
|
|
5083
5287
|
});
|
|
5084
5288
|
}
|
|
5085
5289
|
/** Retrieve a packlist order by id. */
|
|
5086
|
-
async getOrder(orderId, auth2 =
|
|
5290
|
+
async getOrder(orderId, auth2 = SERVICE26) {
|
|
5087
5291
|
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
5088
5292
|
}
|
|
5089
5293
|
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
5090
|
-
async updateOrder(orderId, change, auth2 =
|
|
5294
|
+
async updateOrder(orderId, change, auth2 = SERVICE26) {
|
|
5091
5295
|
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
5092
5296
|
}
|
|
5093
5297
|
/** Finish an order. Returns an acknowledgement. */
|
|
5094
|
-
async finishOrder(orderId, auth2 =
|
|
5298
|
+
async finishOrder(orderId, auth2 = SERVICE26) {
|
|
5095
5299
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
5096
5300
|
}
|
|
5097
5301
|
/** List order cycles (ids). */
|
|
5098
|
-
async listOrderCycles(query = {}, auth2 =
|
|
5302
|
+
async listOrderCycles(query = {}, auth2 = SERVICE26) {
|
|
5099
5303
|
return this.ctx.http.request({
|
|
5100
5304
|
method: "GET",
|
|
5101
5305
|
path: `${this.base()}/orderCycles`,
|
|
@@ -5104,11 +5308,11 @@ var PickPackService = class {
|
|
|
5104
5308
|
});
|
|
5105
5309
|
}
|
|
5106
5310
|
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
5107
|
-
async addAssignee(orderId, assignee, auth2 =
|
|
5311
|
+
async addAssignee(orderId, assignee, auth2 = SERVICE26) {
|
|
5108
5312
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
5109
5313
|
}
|
|
5110
5314
|
/** Remove an assignee from an order. */
|
|
5111
|
-
async removeAssignee(orderId, assigneeId, auth2 =
|
|
5315
|
+
async removeAssignee(orderId, assigneeId, auth2 = SERVICE26) {
|
|
5112
5316
|
await this.ctx.http.request({
|
|
5113
5317
|
method: "DELETE",
|
|
5114
5318
|
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
@@ -5116,15 +5320,15 @@ var PickPackService = class {
|
|
|
5116
5320
|
});
|
|
5117
5321
|
}
|
|
5118
5322
|
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
5119
|
-
async updatePackaging(orderId, change, auth2 =
|
|
5323
|
+
async updatePackaging(orderId, change, auth2 = SERVICE26) {
|
|
5120
5324
|
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
5121
5325
|
}
|
|
5122
5326
|
/** Create a packing event. Returns an acknowledgement. */
|
|
5123
|
-
async createEvent(event, auth2 =
|
|
5327
|
+
async createEvent(event, auth2 = SERVICE26) {
|
|
5124
5328
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
5125
5329
|
}
|
|
5126
5330
|
/** List packing events. */
|
|
5127
|
-
async listEvents(query = {}, auth2 =
|
|
5331
|
+
async listEvents(query = {}, auth2 = SERVICE26) {
|
|
5128
5332
|
return this.ctx.http.request({
|
|
5129
5333
|
method: "GET",
|
|
5130
5334
|
path: `${this.base()}/events`,
|
|
@@ -5133,7 +5337,7 @@ var PickPackService = class {
|
|
|
5133
5337
|
});
|
|
5134
5338
|
}
|
|
5135
5339
|
/** Trigger an order recalculation. Returns the created job's id. */
|
|
5136
|
-
async triggerRecalculation(input, auth2 =
|
|
5340
|
+
async triggerRecalculation(input, auth2 = SERVICE26) {
|
|
5137
5341
|
return this.ctx.http.request({
|
|
5138
5342
|
method: "POST",
|
|
5139
5343
|
path: `${this.base()}/jobs/recalculations`,
|
|
@@ -5142,7 +5346,7 @@ var PickPackService = class {
|
|
|
5142
5346
|
});
|
|
5143
5347
|
}
|
|
5144
5348
|
/** Retrieve a recalculation job by id. */
|
|
5145
|
-
async getRecalculationJob(jobId, auth2 =
|
|
5349
|
+
async getRecalculationJob(jobId, auth2 = SERVICE26) {
|
|
5146
5350
|
return this.ctx.http.request({
|
|
5147
5351
|
method: "GET",
|
|
5148
5352
|
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
@@ -5152,7 +5356,7 @@ var PickPackService = class {
|
|
|
5152
5356
|
};
|
|
5153
5357
|
|
|
5154
5358
|
// src/services/customer-admin.ts
|
|
5155
|
-
var
|
|
5359
|
+
var SERVICE27 = { kind: "service" };
|
|
5156
5360
|
var CustomerAdminService = class {
|
|
5157
5361
|
constructor(ctx) {
|
|
5158
5362
|
this.ctx = ctx;
|
|
@@ -5170,7 +5374,7 @@ var CustomerAdminService = class {
|
|
|
5170
5374
|
}
|
|
5171
5375
|
// --- Customers ---
|
|
5172
5376
|
/** List customers. */
|
|
5173
|
-
async listCustomers(query = {}, auth2 =
|
|
5377
|
+
async listCustomers(query = {}, auth2 = SERVICE27) {
|
|
5174
5378
|
return this.ctx.http.request({
|
|
5175
5379
|
method: "GET",
|
|
5176
5380
|
path: this.base(),
|
|
@@ -5179,33 +5383,33 @@ var CustomerAdminService = class {
|
|
|
5179
5383
|
});
|
|
5180
5384
|
}
|
|
5181
5385
|
/** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
|
|
5182
|
-
async searchCustomers(query, auth2 =
|
|
5386
|
+
async searchCustomers(query, auth2 = SERVICE27) {
|
|
5183
5387
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5184
5388
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
|
|
5185
5389
|
}
|
|
5186
5390
|
/** Retrieve a customer profile by number. */
|
|
5187
|
-
async getCustomer(customerNumber, auth2 =
|
|
5391
|
+
async getCustomer(customerNumber, auth2 = SERVICE27) {
|
|
5188
5392
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5189
5393
|
}
|
|
5190
5394
|
/** Create a customer. */
|
|
5191
|
-
async createCustomer(input, auth2 =
|
|
5395
|
+
async createCustomer(input, auth2 = SERVICE27) {
|
|
5192
5396
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
5193
5397
|
}
|
|
5194
5398
|
/** Upsert a customer profile by number (`PUT`). */
|
|
5195
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
5399
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE27) {
|
|
5196
5400
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
5197
5401
|
}
|
|
5198
5402
|
/** Partially update a customer profile (`PATCH`). */
|
|
5199
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
5403
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE27) {
|
|
5200
5404
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
5201
5405
|
}
|
|
5202
5406
|
/** Delete a customer profile. */
|
|
5203
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
5407
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE27) {
|
|
5204
5408
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5205
5409
|
}
|
|
5206
5410
|
// --- Addresses ---
|
|
5207
5411
|
/** List a customer's addresses. */
|
|
5208
|
-
async listAddresses(customerNumber, auth2 =
|
|
5412
|
+
async listAddresses(customerNumber, auth2 = SERVICE27) {
|
|
5209
5413
|
return this.ctx.http.request({
|
|
5210
5414
|
method: "GET",
|
|
5211
5415
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5213,11 +5417,11 @@ var CustomerAdminService = class {
|
|
|
5213
5417
|
});
|
|
5214
5418
|
}
|
|
5215
5419
|
/** Retrieve one address. */
|
|
5216
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
5420
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
5217
5421
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5218
5422
|
}
|
|
5219
5423
|
/** Add an address. */
|
|
5220
|
-
async addAddress(customerNumber, input, auth2 =
|
|
5424
|
+
async addAddress(customerNumber, input, auth2 = SERVICE27) {
|
|
5221
5425
|
return this.ctx.http.request({
|
|
5222
5426
|
method: "POST",
|
|
5223
5427
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5226,19 +5430,19 @@ var CustomerAdminService = class {
|
|
|
5226
5430
|
});
|
|
5227
5431
|
}
|
|
5228
5432
|
/** Upsert an address by id (`PUT`). */
|
|
5229
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
5433
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE27) {
|
|
5230
5434
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
5231
5435
|
}
|
|
5232
5436
|
/** Partially update an address by id (`PATCH`). */
|
|
5233
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
5437
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE27) {
|
|
5234
5438
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
5235
5439
|
}
|
|
5236
5440
|
/** Delete an address by id. */
|
|
5237
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
5441
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
5238
5442
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5239
5443
|
}
|
|
5240
5444
|
/** Add tags to an address (`?tags=` query). */
|
|
5241
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
5445
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
5242
5446
|
await this.ctx.http.request({
|
|
5243
5447
|
method: "POST",
|
|
5244
5448
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5247,7 +5451,7 @@ var CustomerAdminService = class {
|
|
|
5247
5451
|
});
|
|
5248
5452
|
}
|
|
5249
5453
|
/** Remove tags from an address (`?tags=` query). */
|
|
5250
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
5454
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
5251
5455
|
await this.ctx.http.request({
|
|
5252
5456
|
method: "DELETE",
|
|
5253
5457
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5258,7 +5462,7 @@ var CustomerAdminService = class {
|
|
|
5258
5462
|
};
|
|
5259
5463
|
|
|
5260
5464
|
// src/services/approval.ts
|
|
5261
|
-
var
|
|
5465
|
+
var SERVICE28 = { kind: "service" };
|
|
5262
5466
|
var ApprovalService = class {
|
|
5263
5467
|
constructor(ctx) {
|
|
5264
5468
|
this.ctx = ctx;
|
|
@@ -5269,7 +5473,7 @@ var ApprovalService = class {
|
|
|
5269
5473
|
return `/approval/${this.ctx.tenant}`;
|
|
5270
5474
|
}
|
|
5271
5475
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
5272
|
-
async listApprovals(query = {}, auth2 =
|
|
5476
|
+
async listApprovals(query = {}, auth2 = SERVICE28) {
|
|
5273
5477
|
return this.ctx.http.request({
|
|
5274
5478
|
method: "GET",
|
|
5275
5479
|
path: `${this.base()}/approvals`,
|
|
@@ -5278,7 +5482,7 @@ var ApprovalService = class {
|
|
|
5278
5482
|
});
|
|
5279
5483
|
}
|
|
5280
5484
|
/** Retrieve a single approval by id. */
|
|
5281
|
-
async getApproval(approvalId, auth2 =
|
|
5485
|
+
async getApproval(approvalId, auth2 = SERVICE28) {
|
|
5282
5486
|
return this.ctx.http.request({
|
|
5283
5487
|
method: "GET",
|
|
5284
5488
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5286,7 +5490,7 @@ var ApprovalService = class {
|
|
|
5286
5490
|
});
|
|
5287
5491
|
}
|
|
5288
5492
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
5289
|
-
async createApproval(input, auth2 =
|
|
5493
|
+
async createApproval(input, auth2 = SERVICE28) {
|
|
5290
5494
|
return this.ctx.http.request({
|
|
5291
5495
|
method: "POST",
|
|
5292
5496
|
path: `${this.base()}/approvals`,
|
|
@@ -5295,7 +5499,7 @@ var ApprovalService = class {
|
|
|
5295
5499
|
});
|
|
5296
5500
|
}
|
|
5297
5501
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
5298
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
5502
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE28) {
|
|
5299
5503
|
await this.ctx.http.request({
|
|
5300
5504
|
method: "PATCH",
|
|
5301
5505
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5304,7 +5508,7 @@ var ApprovalService = class {
|
|
|
5304
5508
|
});
|
|
5305
5509
|
}
|
|
5306
5510
|
/** Delete an approval by id. */
|
|
5307
|
-
async deleteApproval(approvalId, auth2 =
|
|
5511
|
+
async deleteApproval(approvalId, auth2 = SERVICE28) {
|
|
5308
5512
|
await this.ctx.http.request({
|
|
5309
5513
|
method: "DELETE",
|
|
5310
5514
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5312,7 +5516,7 @@ var ApprovalService = class {
|
|
|
5312
5516
|
});
|
|
5313
5517
|
}
|
|
5314
5518
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
5315
|
-
async checkPermitted(input, auth2 =
|
|
5519
|
+
async checkPermitted(input, auth2 = SERVICE28) {
|
|
5316
5520
|
return this.ctx.http.request({
|
|
5317
5521
|
method: "POST",
|
|
5318
5522
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -5321,7 +5525,7 @@ var ApprovalService = class {
|
|
|
5321
5525
|
});
|
|
5322
5526
|
}
|
|
5323
5527
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
5324
|
-
async searchApprovers(input, auth2 =
|
|
5528
|
+
async searchApprovers(input, auth2 = SERVICE28) {
|
|
5325
5529
|
return this.ctx.http.request({
|
|
5326
5530
|
method: "POST",
|
|
5327
5531
|
path: `${this.base()}/search/users`,
|