@viu/emporix-sdk 2.19.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 +22 -0
- package/dist/availability.d.cts +1 -1
- package/dist/availability.d.ts +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-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 +461 -299
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +238 -17
- package/dist/index.d.ts +238 -17
- package/dist/index.js +153 -3
- 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/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`,
|
|
@@ -2845,7 +2960,7 @@ var RagIndexerService = class {
|
|
|
2845
2960
|
* @deprecated since 2026-06-18, removal 2026-12-01 — use the indexing service:
|
|
2846
2961
|
* `client.indexing.createReindexJob({ entityType: "PRODUCT", rag: true })`.
|
|
2847
2962
|
*/
|
|
2848
|
-
async reindex(type = "PRODUCT", auth2 =
|
|
2963
|
+
async reindex(type = "PRODUCT", auth2 = SERVICE6) {
|
|
2849
2964
|
await this.ctx.http.request({
|
|
2850
2965
|
method: "POST",
|
|
2851
2966
|
path: `${this.base(type)}/reindex`,
|
|
@@ -2855,7 +2970,7 @@ var RagIndexerService = class {
|
|
|
2855
2970
|
};
|
|
2856
2971
|
|
|
2857
2972
|
// src/services/sequential-id.ts
|
|
2858
|
-
var
|
|
2973
|
+
var SERVICE7 = { kind: "service" };
|
|
2859
2974
|
var SequentialIdService = class {
|
|
2860
2975
|
constructor(ctx) {
|
|
2861
2976
|
this.ctx = ctx;
|
|
@@ -2866,7 +2981,7 @@ var SequentialIdService = class {
|
|
|
2866
2981
|
return `/sequential-id/${this.ctx.tenant}/schemas`;
|
|
2867
2982
|
}
|
|
2868
2983
|
/** List all sequence schemas for the tenant. */
|
|
2869
|
-
async listSchemas(auth2 =
|
|
2984
|
+
async listSchemas(auth2 = SERVICE7) {
|
|
2870
2985
|
return this.ctx.http.request({
|
|
2871
2986
|
method: "GET",
|
|
2872
2987
|
path: this.base(),
|
|
@@ -2874,7 +2989,7 @@ var SequentialIdService = class {
|
|
|
2874
2989
|
});
|
|
2875
2990
|
}
|
|
2876
2991
|
/** Retrieve one sequence schema by id. */
|
|
2877
|
-
async getSchema(schemaId, auth2 =
|
|
2992
|
+
async getSchema(schemaId, auth2 = SERVICE7) {
|
|
2878
2993
|
return this.ctx.http.request({
|
|
2879
2994
|
method: "GET",
|
|
2880
2995
|
path: `${this.base()}/${encodeURIComponent(schemaId)}`,
|
|
@@ -2882,7 +2997,7 @@ var SequentialIdService = class {
|
|
|
2882
2997
|
});
|
|
2883
2998
|
}
|
|
2884
2999
|
/** Create a sequence schema. Schemas are immutable — there is no update. */
|
|
2885
|
-
async createSchema(schema, auth2 =
|
|
3000
|
+
async createSchema(schema, auth2 = SERVICE7) {
|
|
2886
3001
|
return this.ctx.http.request({
|
|
2887
3002
|
method: "POST",
|
|
2888
3003
|
path: this.base(),
|
|
@@ -2891,7 +3006,7 @@ var SequentialIdService = class {
|
|
|
2891
3006
|
});
|
|
2892
3007
|
}
|
|
2893
3008
|
/** Delete a sequence schema by id. */
|
|
2894
|
-
async deleteSchema(schemaId, auth2 =
|
|
3009
|
+
async deleteSchema(schemaId, auth2 = SERVICE7) {
|
|
2895
3010
|
await this.ctx.http.request({
|
|
2896
3011
|
method: "DELETE",
|
|
2897
3012
|
path: `${this.base()}/${encodeURIComponent(schemaId)}`,
|
|
@@ -2899,7 +3014,7 @@ var SequentialIdService = class {
|
|
|
2899
3014
|
});
|
|
2900
3015
|
}
|
|
2901
3016
|
/** Mark a schema active for its type (only one schema may be active per type). */
|
|
2902
|
-
async setActiveSchema(schemaId, auth2 =
|
|
3017
|
+
async setActiveSchema(schemaId, auth2 = SERVICE7) {
|
|
2903
3018
|
await this.ctx.http.request({
|
|
2904
3019
|
method: "POST",
|
|
2905
3020
|
path: `${this.base()}/${encodeURIComponent(schemaId)}/setActive`,
|
|
@@ -2907,7 +3022,7 @@ var SequentialIdService = class {
|
|
|
2907
3022
|
});
|
|
2908
3023
|
}
|
|
2909
3024
|
/** Get the active schema for a given schema type. */
|
|
2910
|
-
async listSchemasByType(schemaType, auth2 =
|
|
3025
|
+
async listSchemasByType(schemaType, auth2 = SERVICE7) {
|
|
2911
3026
|
return this.ctx.http.request({
|
|
2912
3027
|
method: "GET",
|
|
2913
3028
|
path: `${this.base()}/types/${encodeURIComponent(schemaType)}`,
|
|
@@ -2919,7 +3034,7 @@ var SequentialIdService = class {
|
|
|
2919
3034
|
* `sequenceKey` (independent sub-pool counter) and `placeholders`.
|
|
2920
3035
|
* `opts.siteCode` derives time/country placeholders from the site's settings.
|
|
2921
3036
|
*/
|
|
2922
|
-
async nextId(schemaType, body = {}, opts = {}, auth2 =
|
|
3037
|
+
async nextId(schemaType, body = {}, opts = {}, auth2 = SERVICE7) {
|
|
2923
3038
|
const query = opts.siteCode ? { siteCode: opts.siteCode } : void 0;
|
|
2924
3039
|
return this.ctx.http.request({
|
|
2925
3040
|
method: "POST",
|
|
@@ -2934,7 +3049,7 @@ var SequentialIdService = class {
|
|
|
2934
3049
|
* endpoint path omits the `{tenant}` segment — the service derives the
|
|
2935
3050
|
* tenant from the token.
|
|
2936
3051
|
*/
|
|
2937
|
-
async nextIdsBatch(req, auth2 =
|
|
3052
|
+
async nextIdsBatch(req, auth2 = SERVICE7) {
|
|
2938
3053
|
return this.ctx.http.request({
|
|
2939
3054
|
method: "POST",
|
|
2940
3055
|
path: `/sequential-id/sequenceSchemaBatch/nextIds`,
|
|
@@ -2945,7 +3060,7 @@ var SequentialIdService = class {
|
|
|
2945
3060
|
};
|
|
2946
3061
|
|
|
2947
3062
|
// src/services/fee.ts
|
|
2948
|
-
var
|
|
3063
|
+
var SERVICE8 = { kind: "service" };
|
|
2949
3064
|
var FeeService = class {
|
|
2950
3065
|
constructor(ctx) {
|
|
2951
3066
|
this.ctx = ctx;
|
|
@@ -2968,7 +3083,7 @@ var FeeService = class {
|
|
|
2968
3083
|
* returned page is full). Defaults match Emporix server defaults
|
|
2969
3084
|
* (`pageNumber: 1`, `pageSize: 60`).
|
|
2970
3085
|
*/
|
|
2971
|
-
async list(query = {}, auth2 =
|
|
3086
|
+
async list(query = {}, auth2 = SERVICE8) {
|
|
2972
3087
|
const pageNumber = query.pageNumber ?? 1;
|
|
2973
3088
|
const pageSize = query.pageSize ?? 60;
|
|
2974
3089
|
const items = await this.ctx.http.request({
|
|
@@ -2980,7 +3095,7 @@ var FeeService = class {
|
|
|
2980
3095
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
2981
3096
|
}
|
|
2982
3097
|
/** Retrieve one fee definition by id. */
|
|
2983
|
-
async get(id, auth2 =
|
|
3098
|
+
async get(id, auth2 = SERVICE8) {
|
|
2984
3099
|
return this.ctx.http.request({
|
|
2985
3100
|
method: "GET",
|
|
2986
3101
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -2988,7 +3103,7 @@ var FeeService = class {
|
|
|
2988
3103
|
});
|
|
2989
3104
|
}
|
|
2990
3105
|
/** Create a fee definition. */
|
|
2991
|
-
async create(draft, auth2 =
|
|
3106
|
+
async create(draft, auth2 = SERVICE8) {
|
|
2992
3107
|
return this.ctx.http.request({
|
|
2993
3108
|
method: "POST",
|
|
2994
3109
|
path: this.feesBase(),
|
|
@@ -2997,7 +3112,7 @@ var FeeService = class {
|
|
|
2997
3112
|
});
|
|
2998
3113
|
}
|
|
2999
3114
|
/** Update a fee definition by id. */
|
|
3000
|
-
async update(id, draft, auth2 =
|
|
3115
|
+
async update(id, draft, auth2 = SERVICE8) {
|
|
3001
3116
|
return this.ctx.http.request({
|
|
3002
3117
|
method: "PUT",
|
|
3003
3118
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3006,7 +3121,7 @@ var FeeService = class {
|
|
|
3006
3121
|
});
|
|
3007
3122
|
}
|
|
3008
3123
|
/** Delete a fee definition by id. */
|
|
3009
|
-
async delete(id, auth2 =
|
|
3124
|
+
async delete(id, auth2 = SERVICE8) {
|
|
3010
3125
|
await this.ctx.http.request({
|
|
3011
3126
|
method: "DELETE",
|
|
3012
3127
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3015,7 +3130,7 @@ var FeeService = class {
|
|
|
3015
3130
|
}
|
|
3016
3131
|
// --- Item-fee mappings ---
|
|
3017
3132
|
/** List all item-fee mappings. */
|
|
3018
|
-
async listItemFees(auth2 =
|
|
3133
|
+
async listItemFees(auth2 = SERVICE8) {
|
|
3019
3134
|
return this.ctx.http.request({
|
|
3020
3135
|
method: "GET",
|
|
3021
3136
|
path: this.itemFeesBase(),
|
|
@@ -3023,7 +3138,7 @@ var FeeService = class {
|
|
|
3023
3138
|
});
|
|
3024
3139
|
}
|
|
3025
3140
|
/** Fee mappings for one item YRN. */
|
|
3026
|
-
async getItemFees(itemYrn, auth2 =
|
|
3141
|
+
async getItemFees(itemYrn, auth2 = SERVICE8) {
|
|
3027
3142
|
return this.ctx.http.request({
|
|
3028
3143
|
method: "GET",
|
|
3029
3144
|
path: `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`,
|
|
@@ -3031,7 +3146,7 @@ var FeeService = class {
|
|
|
3031
3146
|
});
|
|
3032
3147
|
}
|
|
3033
3148
|
/** Create an item-fee mapping. */
|
|
3034
|
-
async createItemFee(draft, auth2 =
|
|
3149
|
+
async createItemFee(draft, auth2 = SERVICE8) {
|
|
3035
3150
|
return this.ctx.http.request({
|
|
3036
3151
|
method: "POST",
|
|
3037
3152
|
path: this.itemFeesBase(),
|
|
@@ -3043,7 +3158,7 @@ var FeeService = class {
|
|
|
3043
3158
|
* Set the fee list for an item YRN. Destructive replace by default; pass
|
|
3044
3159
|
* `{ partial: true }` to merge (`?partial=true`).
|
|
3045
3160
|
*/
|
|
3046
|
-
async setItemFees(itemYrn, feeIds, opts = {}, auth2 =
|
|
3161
|
+
async setItemFees(itemYrn, feeIds, opts = {}, auth2 = SERVICE8) {
|
|
3047
3162
|
return this.ctx.http.request({
|
|
3048
3163
|
method: "PUT",
|
|
3049
3164
|
path: `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`,
|
|
@@ -3056,7 +3171,7 @@ var FeeService = class {
|
|
|
3056
3171
|
* Delete item-fee mappings for a YRN. Without `feeId`, removes all mappings
|
|
3057
3172
|
* for the YRN; with `feeId`, removes that single fee from the mapping.
|
|
3058
3173
|
*/
|
|
3059
|
-
async deleteItemFees(itemYrn, feeId, auth2 =
|
|
3174
|
+
async deleteItemFees(itemYrn, feeId, auth2 = SERVICE8) {
|
|
3060
3175
|
const base = `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`;
|
|
3061
3176
|
await this.ctx.http.request({
|
|
3062
3177
|
method: "DELETE",
|
|
@@ -3065,7 +3180,7 @@ var FeeService = class {
|
|
|
3065
3180
|
});
|
|
3066
3181
|
}
|
|
3067
3182
|
/** Search item-fee mappings by item YRNs + site. */
|
|
3068
|
-
async searchItemFees(search, auth2 =
|
|
3183
|
+
async searchItemFees(search, auth2 = SERVICE8) {
|
|
3069
3184
|
return this.ctx.http.request({
|
|
3070
3185
|
method: "POST",
|
|
3071
3186
|
path: `${this.itemFeesBase()}/search`,
|
|
@@ -3075,7 +3190,7 @@ var FeeService = class {
|
|
|
3075
3190
|
}
|
|
3076
3191
|
// --- Product-fee mappings ---
|
|
3077
3192
|
/** Fee mappings for a product id. */
|
|
3078
|
-
async getProductFees(productId, auth2 =
|
|
3193
|
+
async getProductFees(productId, auth2 = SERVICE8) {
|
|
3079
3194
|
return this.ctx.http.request({
|
|
3080
3195
|
method: "GET",
|
|
3081
3196
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -3086,7 +3201,7 @@ var FeeService = class {
|
|
|
3086
3201
|
* Set the fee list for a product id. Destructive replace by default; pass
|
|
3087
3202
|
* `{ partial: true }` to merge (`?partial=true`).
|
|
3088
3203
|
*/
|
|
3089
|
-
async setProductFees(productId, feeIds, opts = {}, auth2 =
|
|
3204
|
+
async setProductFees(productId, feeIds, opts = {}, auth2 = SERVICE8) {
|
|
3090
3205
|
return this.ctx.http.request({
|
|
3091
3206
|
method: "PUT",
|
|
3092
3207
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -3096,7 +3211,7 @@ var FeeService = class {
|
|
|
3096
3211
|
});
|
|
3097
3212
|
}
|
|
3098
3213
|
/** Delete all fee mappings for a product id. */
|
|
3099
|
-
async deleteProductFees(productId, auth2 =
|
|
3214
|
+
async deleteProductFees(productId, auth2 = SERVICE8) {
|
|
3100
3215
|
await this.ctx.http.request({
|
|
3101
3216
|
method: "DELETE",
|
|
3102
3217
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -3129,7 +3244,7 @@ var CloudFunctionsService = class {
|
|
|
3129
3244
|
};
|
|
3130
3245
|
|
|
3131
3246
|
// src/services/webhook.ts
|
|
3132
|
-
var
|
|
3247
|
+
var SERVICE9 = { kind: "service" };
|
|
3133
3248
|
var WebhookService = class {
|
|
3134
3249
|
constructor(ctx) {
|
|
3135
3250
|
this.ctx = ctx;
|
|
@@ -3140,7 +3255,7 @@ var WebhookService = class {
|
|
|
3140
3255
|
return `/webhook/${this.ctx.tenant}`;
|
|
3141
3256
|
}
|
|
3142
3257
|
/** List the event-subscription catalog with each event's on/off state. */
|
|
3143
|
-
async listEventSubscriptions(auth2 =
|
|
3258
|
+
async listEventSubscriptions(auth2 = SERVICE9) {
|
|
3144
3259
|
return this.ctx.http.request({
|
|
3145
3260
|
method: "GET",
|
|
3146
3261
|
path: `${this.base()}/event-subscriptions`,
|
|
@@ -3153,7 +3268,7 @@ var WebhookService = class {
|
|
|
3153
3268
|
* `code`/`status` (e.g. `results.filter(r => (r.code ?? 0) >= 400)`). Does
|
|
3154
3269
|
* NOT throw on a 207 with failed items; only a non-2xx HTTP status throws.
|
|
3155
3270
|
*/
|
|
3156
|
-
async updateEventSubscriptions(items, auth2 =
|
|
3271
|
+
async updateEventSubscriptions(items, auth2 = SERVICE9) {
|
|
3157
3272
|
return this.ctx.http.request({
|
|
3158
3273
|
method: "PATCH",
|
|
3159
3274
|
path: `${this.base()}/event-subscriptions`,
|
|
@@ -3162,7 +3277,7 @@ var WebhookService = class {
|
|
|
3162
3277
|
});
|
|
3163
3278
|
}
|
|
3164
3279
|
/** List delivery configurations. */
|
|
3165
|
-
async listConfigs(auth2 =
|
|
3280
|
+
async listConfigs(auth2 = SERVICE9) {
|
|
3166
3281
|
return this.ctx.http.request({
|
|
3167
3282
|
method: "GET",
|
|
3168
3283
|
path: `${this.base()}/config`,
|
|
@@ -3170,7 +3285,7 @@ var WebhookService = class {
|
|
|
3170
3285
|
});
|
|
3171
3286
|
}
|
|
3172
3287
|
/** Retrieve one delivery configuration by code. */
|
|
3173
|
-
async getConfig(code, auth2 =
|
|
3288
|
+
async getConfig(code, auth2 = SERVICE9) {
|
|
3174
3289
|
return this.ctx.http.request({
|
|
3175
3290
|
method: "GET",
|
|
3176
3291
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3178,7 +3293,7 @@ var WebhookService = class {
|
|
|
3178
3293
|
});
|
|
3179
3294
|
}
|
|
3180
3295
|
/** Create a delivery configuration. Returns the server-assigned `{ code }`. */
|
|
3181
|
-
async createConfig(draft, auth2 =
|
|
3296
|
+
async createConfig(draft, auth2 = SERVICE9) {
|
|
3182
3297
|
return this.ctx.http.request({
|
|
3183
3298
|
method: "POST",
|
|
3184
3299
|
path: `${this.base()}/config`,
|
|
@@ -3187,7 +3302,7 @@ var WebhookService = class {
|
|
|
3187
3302
|
});
|
|
3188
3303
|
}
|
|
3189
3304
|
/** Replace a delivery configuration by code (204). */
|
|
3190
|
-
async replaceConfig(code, draft, auth2 =
|
|
3305
|
+
async replaceConfig(code, draft, auth2 = SERVICE9) {
|
|
3191
3306
|
await this.ctx.http.request({
|
|
3192
3307
|
method: "PUT",
|
|
3193
3308
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3199,7 +3314,7 @@ var WebhookService = class {
|
|
|
3199
3314
|
* Partially update a delivery configuration by code (204). The body is an
|
|
3200
3315
|
* **array** of `{ op, path, value }` operations (UPSERT / REMOVE).
|
|
3201
3316
|
*/
|
|
3202
|
-
async patchConfig(code, patches, auth2 =
|
|
3317
|
+
async patchConfig(code, patches, auth2 = SERVICE9) {
|
|
3203
3318
|
await this.ctx.http.request({
|
|
3204
3319
|
method: "PATCH",
|
|
3205
3320
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3211,7 +3326,7 @@ var WebhookService = class {
|
|
|
3211
3326
|
* Delete a delivery configuration by code. Pass `{ force: true }` to delete
|
|
3212
3327
|
* the currently-active config (the server otherwise rejects it).
|
|
3213
3328
|
*/
|
|
3214
|
-
async deleteConfig(code, opts = {}, auth2 =
|
|
3329
|
+
async deleteConfig(code, opts = {}, auth2 = SERVICE9) {
|
|
3215
3330
|
await this.ctx.http.request({
|
|
3216
3331
|
method: "DELETE",
|
|
3217
3332
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -3220,7 +3335,7 @@ var WebhookService = class {
|
|
|
3220
3335
|
});
|
|
3221
3336
|
}
|
|
3222
3337
|
/** Read delivery statistics over an optional `YYYY-MM` range. */
|
|
3223
|
-
async getStatistics(query = {}, auth2 =
|
|
3338
|
+
async getStatistics(query = {}, auth2 = SERVICE9) {
|
|
3224
3339
|
const q = {};
|
|
3225
3340
|
if (query.fromYearMonth) q.fromYearMonth = query.fromYearMonth;
|
|
3226
3341
|
if (query.toYearMonth) q.toYearMonth = query.toYearMonth;
|
|
@@ -3232,7 +3347,7 @@ var WebhookService = class {
|
|
|
3232
3347
|
});
|
|
3233
3348
|
}
|
|
3234
3349
|
/** Obtain Svix dashboard access (URL / token). */
|
|
3235
|
-
async getDashboardAccess(auth2 =
|
|
3350
|
+
async getDashboardAccess(auth2 = SERVICE9) {
|
|
3236
3351
|
return this.ctx.http.request({
|
|
3237
3352
|
method: "GET",
|
|
3238
3353
|
path: `${this.base()}/dashboard-access`,
|
|
@@ -3242,7 +3357,7 @@ var WebhookService = class {
|
|
|
3242
3357
|
};
|
|
3243
3358
|
|
|
3244
3359
|
// src/services/schema.ts
|
|
3245
|
-
var
|
|
3360
|
+
var SERVICE10 = { kind: "service" };
|
|
3246
3361
|
var SchemaService = class {
|
|
3247
3362
|
constructor(ctx) {
|
|
3248
3363
|
this.ctx = ctx;
|
|
@@ -3265,7 +3380,7 @@ var SchemaService = class {
|
|
|
3265
3380
|
* Pagination defaults match the rest of the SDK (`pageNumber: 1`,
|
|
3266
3381
|
* `pageSize: 60`).
|
|
3267
3382
|
*/
|
|
3268
|
-
async listSchemas(query = {}, auth2 =
|
|
3383
|
+
async listSchemas(query = {}, auth2 = SERVICE10) {
|
|
3269
3384
|
const pageNumber = query.pageNumber ?? 1;
|
|
3270
3385
|
const pageSize = query.pageSize ?? 60;
|
|
3271
3386
|
const q = { pageNumber, pageSize };
|
|
@@ -3280,7 +3395,7 @@ var SchemaService = class {
|
|
|
3280
3395
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3281
3396
|
}
|
|
3282
3397
|
/** Retrieve one schema by id. */
|
|
3283
|
-
async getSchema(id, auth2 =
|
|
3398
|
+
async getSchema(id, auth2 = SERVICE10) {
|
|
3284
3399
|
return this.ctx.http.request({
|
|
3285
3400
|
method: "GET",
|
|
3286
3401
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3288,7 +3403,7 @@ var SchemaService = class {
|
|
|
3288
3403
|
});
|
|
3289
3404
|
}
|
|
3290
3405
|
/** Create a schema. */
|
|
3291
|
-
async createSchema(draft, auth2 =
|
|
3406
|
+
async createSchema(draft, auth2 = SERVICE10) {
|
|
3292
3407
|
return this.ctx.http.request({
|
|
3293
3408
|
method: "POST",
|
|
3294
3409
|
path: this.schemasBase(),
|
|
@@ -3301,7 +3416,7 @@ var SchemaService = class {
|
|
|
3301
3416
|
* stale version yields 409 Conflict (propagated as the standard conflict
|
|
3302
3417
|
* error).
|
|
3303
3418
|
*/
|
|
3304
|
-
async updateSchema(id, draft, auth2 =
|
|
3419
|
+
async updateSchema(id, draft, auth2 = SERVICE10) {
|
|
3305
3420
|
return this.ctx.http.request({
|
|
3306
3421
|
method: "PUT",
|
|
3307
3422
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3310,7 +3425,7 @@ var SchemaService = class {
|
|
|
3310
3425
|
});
|
|
3311
3426
|
}
|
|
3312
3427
|
/** Delete a schema by id. */
|
|
3313
|
-
async deleteSchema(id, auth2 =
|
|
3428
|
+
async deleteSchema(id, auth2 = SERVICE10) {
|
|
3314
3429
|
await this.ctx.http.request({
|
|
3315
3430
|
method: "DELETE",
|
|
3316
3431
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3321,7 +3436,7 @@ var SchemaService = class {
|
|
|
3321
3436
|
* Validate a schema document without persisting it (`POST /schemas/file`).
|
|
3322
3437
|
* Returns the server's validation result verbatim.
|
|
3323
3438
|
*/
|
|
3324
|
-
async validateSchemaFile(body, auth2 =
|
|
3439
|
+
async validateSchemaFile(body, auth2 = SERVICE10) {
|
|
3325
3440
|
return this.ctx.http.request({
|
|
3326
3441
|
method: "POST",
|
|
3327
3442
|
path: `${this.schemasBase()}/file`,
|
|
@@ -3331,7 +3446,7 @@ var SchemaService = class {
|
|
|
3331
3446
|
}
|
|
3332
3447
|
// --- (B) Types -----------------------------------------------------------
|
|
3333
3448
|
/** List entity types that currently have at least one schema. */
|
|
3334
|
-
async listTypes(auth2 =
|
|
3449
|
+
async listTypes(auth2 = SERVICE10) {
|
|
3335
3450
|
return this.ctx.http.request({
|
|
3336
3451
|
method: "GET",
|
|
3337
3452
|
path: `/schema/${this.ctx.tenant}/types`,
|
|
@@ -3339,7 +3454,7 @@ var SchemaService = class {
|
|
|
3339
3454
|
});
|
|
3340
3455
|
}
|
|
3341
3456
|
/** Set the entity types a schema applies to (`PUT /schemas/{id}/types`). */
|
|
3342
|
-
async setSchemaTypes(id, types, auth2 =
|
|
3457
|
+
async setSchemaTypes(id, types, auth2 = SERVICE10) {
|
|
3343
3458
|
return this.ctx.http.request({
|
|
3344
3459
|
method: "PUT",
|
|
3345
3460
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}/types`,
|
|
@@ -3349,7 +3464,7 @@ var SchemaService = class {
|
|
|
3349
3464
|
}
|
|
3350
3465
|
// --- (C) Custom entities -------------------------------------------------
|
|
3351
3466
|
/** List custom-entity definitions. `expandSchemas` inlines each schema body. */
|
|
3352
|
-
async listCustomEntities(opts = {}, auth2 =
|
|
3467
|
+
async listCustomEntities(opts = {}, auth2 = SERVICE10) {
|
|
3353
3468
|
return this.ctx.http.request({
|
|
3354
3469
|
method: "GET",
|
|
3355
3470
|
path: this.entitiesBase(),
|
|
@@ -3358,7 +3473,7 @@ var SchemaService = class {
|
|
|
3358
3473
|
});
|
|
3359
3474
|
}
|
|
3360
3475
|
/** Retrieve one custom-entity definition by id. */
|
|
3361
|
-
async getCustomEntity(id, auth2 =
|
|
3476
|
+
async getCustomEntity(id, auth2 = SERVICE10) {
|
|
3362
3477
|
return this.ctx.http.request({
|
|
3363
3478
|
method: "GET",
|
|
3364
3479
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3366,7 +3481,7 @@ var SchemaService = class {
|
|
|
3366
3481
|
});
|
|
3367
3482
|
}
|
|
3368
3483
|
/** Create a custom-entity definition. */
|
|
3369
|
-
async createCustomEntity(draft, auth2 =
|
|
3484
|
+
async createCustomEntity(draft, auth2 = SERVICE10) {
|
|
3370
3485
|
return this.ctx.http.request({
|
|
3371
3486
|
method: "POST",
|
|
3372
3487
|
path: this.entitiesBase(),
|
|
@@ -3375,7 +3490,7 @@ var SchemaService = class {
|
|
|
3375
3490
|
});
|
|
3376
3491
|
}
|
|
3377
3492
|
/** Update a custom-entity definition. */
|
|
3378
|
-
async updateCustomEntity(id, draft, auth2 =
|
|
3493
|
+
async updateCustomEntity(id, draft, auth2 = SERVICE10) {
|
|
3379
3494
|
return this.ctx.http.request({
|
|
3380
3495
|
method: "PUT",
|
|
3381
3496
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3388,7 +3503,7 @@ var SchemaService = class {
|
|
|
3388
3503
|
* instances or schemas still reference it (propagated as the standard
|
|
3389
3504
|
* conflict error).
|
|
3390
3505
|
*/
|
|
3391
|
-
async deleteCustomEntity(id, auth2 =
|
|
3506
|
+
async deleteCustomEntity(id, auth2 = SERVICE10) {
|
|
3392
3507
|
await this.ctx.http.request({
|
|
3393
3508
|
method: "DELETE",
|
|
3394
3509
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -3400,7 +3515,7 @@ var SchemaService = class {
|
|
|
3400
3515
|
* List a custom entity's instances, wrapped in {@link PaginatedItems}.
|
|
3401
3516
|
* `type` is the custom-entity type and is always the first argument.
|
|
3402
3517
|
*/
|
|
3403
|
-
async listInstances(type, query = {}, auth2 =
|
|
3518
|
+
async listInstances(type, query = {}, auth2 = SERVICE10) {
|
|
3404
3519
|
const pageNumber = query.pageNumber ?? 1;
|
|
3405
3520
|
const pageSize = query.pageSize ?? 60;
|
|
3406
3521
|
const items = await this.ctx.http.request({
|
|
@@ -3412,7 +3527,7 @@ var SchemaService = class {
|
|
|
3412
3527
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3413
3528
|
}
|
|
3414
3529
|
/** Retrieve one instance by id. */
|
|
3415
|
-
async getInstance(type, id, auth2 =
|
|
3530
|
+
async getInstance(type, id, auth2 = SERVICE10) {
|
|
3416
3531
|
return this.ctx.http.request({
|
|
3417
3532
|
method: "GET",
|
|
3418
3533
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3420,7 +3535,7 @@ var SchemaService = class {
|
|
|
3420
3535
|
});
|
|
3421
3536
|
}
|
|
3422
3537
|
/** Create an instance of a custom entity. */
|
|
3423
|
-
async createInstance(type, draft, auth2 =
|
|
3538
|
+
async createInstance(type, draft, auth2 = SERVICE10) {
|
|
3424
3539
|
return this.ctx.http.request({
|
|
3425
3540
|
method: "POST",
|
|
3426
3541
|
path: this.instancesBase(type),
|
|
@@ -3429,7 +3544,7 @@ var SchemaService = class {
|
|
|
3429
3544
|
});
|
|
3430
3545
|
}
|
|
3431
3546
|
/** Replace an instance (full `PUT`). */
|
|
3432
|
-
async replaceInstance(type, id, draft, auth2 =
|
|
3547
|
+
async replaceInstance(type, id, draft, auth2 = SERVICE10) {
|
|
3433
3548
|
return this.ctx.http.request({
|
|
3434
3549
|
method: "PUT",
|
|
3435
3550
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3438,7 +3553,7 @@ var SchemaService = class {
|
|
|
3438
3553
|
});
|
|
3439
3554
|
}
|
|
3440
3555
|
/** Partially update an instance (`PATCH`). */
|
|
3441
|
-
async patchInstance(type, id, patch, auth2 =
|
|
3556
|
+
async patchInstance(type, id, patch, auth2 = SERVICE10) {
|
|
3442
3557
|
return this.ctx.http.request({
|
|
3443
3558
|
method: "PATCH",
|
|
3444
3559
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3446,8 +3561,22 @@ var SchemaService = class {
|
|
|
3446
3561
|
body: patch
|
|
3447
3562
|
});
|
|
3448
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
|
+
}
|
|
3449
3578
|
/** Delete an instance by id. */
|
|
3450
|
-
async deleteInstance(type, id, auth2 =
|
|
3579
|
+
async deleteInstance(type, id, auth2 = SERVICE10) {
|
|
3451
3580
|
await this.ctx.http.request({
|
|
3452
3581
|
method: "DELETE",
|
|
3453
3582
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -3458,7 +3587,7 @@ var SchemaService = class {
|
|
|
3458
3587
|
* Structured search over a custom entity's instances
|
|
3459
3588
|
* (`POST /instances/search`), wrapped in {@link PaginatedItems}.
|
|
3460
3589
|
*/
|
|
3461
|
-
async searchInstances(type, body, auth2 =
|
|
3590
|
+
async searchInstances(type, body, auth2 = SERVICE10) {
|
|
3462
3591
|
const items = await this.ctx.http.request({
|
|
3463
3592
|
method: "POST",
|
|
3464
3593
|
path: `${this.instancesBase(type)}/search`,
|
|
@@ -3470,7 +3599,7 @@ var SchemaService = class {
|
|
|
3470
3599
|
};
|
|
3471
3600
|
|
|
3472
3601
|
// src/services/ai.ts
|
|
3473
|
-
var
|
|
3602
|
+
var SERVICE11 = { kind: "service" };
|
|
3474
3603
|
var AiService = class {
|
|
3475
3604
|
constructor(ctx) {
|
|
3476
3605
|
this.ctx = ctx;
|
|
@@ -3481,7 +3610,7 @@ var AiService = class {
|
|
|
3481
3610
|
return `/ai-service/${this.ctx.tenant}`;
|
|
3482
3611
|
}
|
|
3483
3612
|
/** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
|
|
3484
|
-
async generateText(input, auth2 =
|
|
3613
|
+
async generateText(input, auth2 = SERVICE11) {
|
|
3485
3614
|
return this.ctx.http.request({
|
|
3486
3615
|
method: "POST",
|
|
3487
3616
|
path: `${this.base()}/texts`,
|
|
@@ -3490,7 +3619,7 @@ var AiService = class {
|
|
|
3490
3619
|
});
|
|
3491
3620
|
}
|
|
3492
3621
|
/** Run a chat completion over a message list (`POST /completions`). No `maxTokens`. */
|
|
3493
|
-
async complete(input, auth2 =
|
|
3622
|
+
async complete(input, auth2 = SERVICE11) {
|
|
3494
3623
|
return this.ctx.http.request({
|
|
3495
3624
|
method: "POST",
|
|
3496
3625
|
path: `${this.base()}/completions`,
|
|
@@ -3499,7 +3628,7 @@ var AiService = class {
|
|
|
3499
3628
|
});
|
|
3500
3629
|
}
|
|
3501
3630
|
/** List all agentic agents. */
|
|
3502
|
-
async listAgents(auth2 =
|
|
3631
|
+
async listAgents(auth2 = SERVICE11) {
|
|
3503
3632
|
return this.ctx.http.request({
|
|
3504
3633
|
method: "GET",
|
|
3505
3634
|
path: `${this.base()}/agentic/agents`,
|
|
@@ -3507,7 +3636,7 @@ var AiService = class {
|
|
|
3507
3636
|
});
|
|
3508
3637
|
}
|
|
3509
3638
|
/** Retrieve one agent by id. */
|
|
3510
|
-
async getAgent(id, auth2 =
|
|
3639
|
+
async getAgent(id, auth2 = SERVICE11) {
|
|
3511
3640
|
return this.ctx.http.request({
|
|
3512
3641
|
method: "GET",
|
|
3513
3642
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3515,7 +3644,7 @@ var AiService = class {
|
|
|
3515
3644
|
});
|
|
3516
3645
|
}
|
|
3517
3646
|
/** Create-or-replace an agent by id (`PUT`). Takes the agent write shape. */
|
|
3518
|
-
async upsertAgent(id, agent, auth2 =
|
|
3647
|
+
async upsertAgent(id, agent, auth2 = SERVICE11) {
|
|
3519
3648
|
return this.ctx.http.request({
|
|
3520
3649
|
method: "PUT",
|
|
3521
3650
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3528,7 +3657,7 @@ var AiService = class {
|
|
|
3528
3657
|
* UPPERCASE enum (`ADD | REMOVE | REPLACE`) and are sent verbatim — this is
|
|
3529
3658
|
* NOT RFC-6902 JSON-Patch.
|
|
3530
3659
|
*/
|
|
3531
|
-
async patchAgent(id, ops, auth2 =
|
|
3660
|
+
async patchAgent(id, ops, auth2 = SERVICE11) {
|
|
3532
3661
|
return this.ctx.http.request({
|
|
3533
3662
|
method: "PATCH",
|
|
3534
3663
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3540,7 +3669,7 @@ var AiService = class {
|
|
|
3540
3669
|
* Delete an agent by id. Pass `{ force: true }` to delete an agent that is
|
|
3541
3670
|
* still referenced elsewhere (`?force=true`).
|
|
3542
3671
|
*/
|
|
3543
|
-
async deleteAgent(id, auth2 =
|
|
3672
|
+
async deleteAgent(id, auth2 = SERVICE11, opts = {}) {
|
|
3544
3673
|
await this.ctx.http.request({
|
|
3545
3674
|
method: "DELETE",
|
|
3546
3675
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -3549,7 +3678,7 @@ var AiService = class {
|
|
|
3549
3678
|
});
|
|
3550
3679
|
}
|
|
3551
3680
|
/** Server-side agent search (`POST /agentic/agents/search`). */
|
|
3552
|
-
async searchAgents(query, auth2 =
|
|
3681
|
+
async searchAgents(query, auth2 = SERVICE11) {
|
|
3553
3682
|
return this.ctx.http.request({
|
|
3554
3683
|
method: "POST",
|
|
3555
3684
|
path: `${this.base()}/agentic/agents/search`,
|
|
@@ -3561,7 +3690,7 @@ var AiService = class {
|
|
|
3561
3690
|
* Synchronous agent chat (`POST /agentic/chat`). Returns the response
|
|
3562
3691
|
* ARRAY verbatim (the upstream contract is an array, not a single object).
|
|
3563
3692
|
*/
|
|
3564
|
-
async chat(input, auth2 =
|
|
3693
|
+
async chat(input, auth2 = SERVICE11) {
|
|
3565
3694
|
return this.ctx.http.request({
|
|
3566
3695
|
method: "POST",
|
|
3567
3696
|
path: `${this.base()}/agentic/chat`,
|
|
@@ -3573,7 +3702,7 @@ var AiService = class {
|
|
|
3573
3702
|
* Fire-and-forget agent chat (`POST /agentic/chat-async`, HTTP 201).
|
|
3574
3703
|
* Returns the job-id ARRAY verbatim.
|
|
3575
3704
|
*/
|
|
3576
|
-
async chatAsync(input, auth2 =
|
|
3705
|
+
async chatAsync(input, auth2 = SERVICE11) {
|
|
3577
3706
|
return this.ctx.http.request({
|
|
3578
3707
|
method: "POST",
|
|
3579
3708
|
path: `${this.base()}/agentic/chat-async`,
|
|
@@ -3581,10 +3710,43 @@ var AiService = class {
|
|
|
3581
3710
|
body: input
|
|
3582
3711
|
});
|
|
3583
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
|
+
}
|
|
3584
3746
|
};
|
|
3585
3747
|
|
|
3586
3748
|
// src/services/tax.ts
|
|
3587
|
-
var
|
|
3749
|
+
var SERVICE12 = { kind: "service" };
|
|
3588
3750
|
var TaxService = class {
|
|
3589
3751
|
constructor(ctx) {
|
|
3590
3752
|
this.ctx = ctx;
|
|
@@ -3595,7 +3757,7 @@ var TaxService = class {
|
|
|
3595
3757
|
return `/tax/${this.ctx.tenant}`;
|
|
3596
3758
|
}
|
|
3597
3759
|
/** List all per-location tax configurations. */
|
|
3598
|
-
async listTaxConfigs(auth2 =
|
|
3760
|
+
async listTaxConfigs(auth2 = SERVICE12) {
|
|
3599
3761
|
return this.ctx.http.request({
|
|
3600
3762
|
method: "GET",
|
|
3601
3763
|
path: `${this.base()}/taxes`,
|
|
@@ -3603,7 +3765,7 @@ var TaxService = class {
|
|
|
3603
3765
|
});
|
|
3604
3766
|
}
|
|
3605
3767
|
/** Retrieve one tax configuration by its location (country) code. */
|
|
3606
|
-
async getTaxConfig(locationCode, auth2 =
|
|
3768
|
+
async getTaxConfig(locationCode, auth2 = SERVICE12) {
|
|
3607
3769
|
return this.ctx.http.request({
|
|
3608
3770
|
method: "GET",
|
|
3609
3771
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3611,7 +3773,7 @@ var TaxService = class {
|
|
|
3611
3773
|
});
|
|
3612
3774
|
}
|
|
3613
3775
|
/** Create a tax configuration (`POST`). Returns the created `{ locationCode }`. */
|
|
3614
|
-
async createTaxConfig(input, auth2 =
|
|
3776
|
+
async createTaxConfig(input, auth2 = SERVICE12) {
|
|
3615
3777
|
return this.ctx.http.request({
|
|
3616
3778
|
method: "POST",
|
|
3617
3779
|
path: `${this.base()}/taxes`,
|
|
@@ -3623,7 +3785,7 @@ var TaxService = class {
|
|
|
3623
3785
|
* Update a tax configuration by location code (`PUT`). `metadata.version` is
|
|
3624
3786
|
* required (optimistic locking — a stale version yields 409).
|
|
3625
3787
|
*/
|
|
3626
|
-
async updateTaxConfig(locationCode, input, auth2 =
|
|
3788
|
+
async updateTaxConfig(locationCode, input, auth2 = SERVICE12) {
|
|
3627
3789
|
return this.ctx.http.request({
|
|
3628
3790
|
method: "PUT",
|
|
3629
3791
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3632,7 +3794,7 @@ var TaxService = class {
|
|
|
3632
3794
|
});
|
|
3633
3795
|
}
|
|
3634
3796
|
/** Delete a tax configuration by location code. */
|
|
3635
|
-
async deleteTaxConfig(locationCode, auth2 =
|
|
3797
|
+
async deleteTaxConfig(locationCode, auth2 = SERVICE12) {
|
|
3636
3798
|
await this.ctx.http.request({
|
|
3637
3799
|
method: "DELETE",
|
|
3638
3800
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -3643,7 +3805,7 @@ var TaxService = class {
|
|
|
3643
3805
|
* Calculate net/gross values for a price (`PUT /taxes/calculation-commands`).
|
|
3644
3806
|
* Single command in, single result out.
|
|
3645
3807
|
*/
|
|
3646
|
-
async calculateTax(request, auth2 =
|
|
3808
|
+
async calculateTax(request, auth2 = SERVICE12) {
|
|
3647
3809
|
return this.ctx.http.request({
|
|
3648
3810
|
method: "PUT",
|
|
3649
3811
|
path: `${this.base()}/taxes/calculation-commands`,
|
|
@@ -3654,7 +3816,7 @@ var TaxService = class {
|
|
|
3654
3816
|
};
|
|
3655
3817
|
|
|
3656
3818
|
// src/services/coupon.ts
|
|
3657
|
-
var
|
|
3819
|
+
var SERVICE13 = { kind: "service" };
|
|
3658
3820
|
var CouponService = class {
|
|
3659
3821
|
constructor(ctx) {
|
|
3660
3822
|
this.ctx = ctx;
|
|
@@ -3665,7 +3827,7 @@ var CouponService = class {
|
|
|
3665
3827
|
return `/coupon/${this.ctx.tenant}`;
|
|
3666
3828
|
}
|
|
3667
3829
|
/** List coupons by criteria. Returns a plain array. */
|
|
3668
|
-
async listCoupons(query = {}, auth2 =
|
|
3830
|
+
async listCoupons(query = {}, auth2 = SERVICE13) {
|
|
3669
3831
|
return this.ctx.http.request({
|
|
3670
3832
|
method: "GET",
|
|
3671
3833
|
path: `${this.base()}/coupons`,
|
|
@@ -3674,7 +3836,7 @@ var CouponService = class {
|
|
|
3674
3836
|
});
|
|
3675
3837
|
}
|
|
3676
3838
|
/** Retrieve one coupon by code. */
|
|
3677
|
-
async getCoupon(code, auth2 =
|
|
3839
|
+
async getCoupon(code, auth2 = SERVICE13) {
|
|
3678
3840
|
return this.ctx.http.request({
|
|
3679
3841
|
method: "GET",
|
|
3680
3842
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3682,7 +3844,7 @@ var CouponService = class {
|
|
|
3682
3844
|
});
|
|
3683
3845
|
}
|
|
3684
3846
|
/** Create a coupon (`POST`, HTTP 201). Returns the created resource's `{ id?, yrn? }`. */
|
|
3685
|
-
async createCoupon(input, auth2 =
|
|
3847
|
+
async createCoupon(input, auth2 = SERVICE13) {
|
|
3686
3848
|
return this.ctx.http.request({
|
|
3687
3849
|
method: "POST",
|
|
3688
3850
|
path: `${this.base()}/coupons`,
|
|
@@ -3691,7 +3853,7 @@ var CouponService = class {
|
|
|
3691
3853
|
});
|
|
3692
3854
|
}
|
|
3693
3855
|
/** Replace a coupon by code (`PUT`). Resolves once the update is accepted. */
|
|
3694
|
-
async updateCoupon(code, input, auth2 =
|
|
3856
|
+
async updateCoupon(code, input, auth2 = SERVICE13) {
|
|
3695
3857
|
await this.ctx.http.request({
|
|
3696
3858
|
method: "PUT",
|
|
3697
3859
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3700,7 +3862,7 @@ var CouponService = class {
|
|
|
3700
3862
|
});
|
|
3701
3863
|
}
|
|
3702
3864
|
/** Partially update a coupon by code (`PATCH` merge body). */
|
|
3703
|
-
async patchCoupon(code, patch, auth2 =
|
|
3865
|
+
async patchCoupon(code, patch, auth2 = SERVICE13) {
|
|
3704
3866
|
await this.ctx.http.request({
|
|
3705
3867
|
method: "PATCH",
|
|
3706
3868
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3709,7 +3871,7 @@ var CouponService = class {
|
|
|
3709
3871
|
});
|
|
3710
3872
|
}
|
|
3711
3873
|
/** Delete a coupon by code. */
|
|
3712
|
-
async deleteCoupon(code, auth2 =
|
|
3874
|
+
async deleteCoupon(code, auth2 = SERVICE13) {
|
|
3713
3875
|
await this.ctx.http.request({
|
|
3714
3876
|
method: "DELETE",
|
|
3715
3877
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -3720,7 +3882,7 @@ var CouponService = class {
|
|
|
3720
3882
|
* Check whether a coupon can be redeemed (`POST /validation`). Resolves when
|
|
3721
3883
|
* redeemable; throws an `EmporixError` otherwise (no response body).
|
|
3722
3884
|
*/
|
|
3723
|
-
async validateCoupon(code, redemption, auth2 =
|
|
3885
|
+
async validateCoupon(code, redemption, auth2 = SERVICE13) {
|
|
3724
3886
|
await this.ctx.http.request({
|
|
3725
3887
|
method: "POST",
|
|
3726
3888
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/validation`,
|
|
@@ -3729,7 +3891,7 @@ var CouponService = class {
|
|
|
3729
3891
|
});
|
|
3730
3892
|
}
|
|
3731
3893
|
/** List a coupon's redemptions by criteria. */
|
|
3732
|
-
async listRedemptions(code, query = {}, auth2 =
|
|
3894
|
+
async listRedemptions(code, query = {}, auth2 = SERVICE13) {
|
|
3733
3895
|
return this.ctx.http.request({
|
|
3734
3896
|
method: "GET",
|
|
3735
3897
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -3738,7 +3900,7 @@ var CouponService = class {
|
|
|
3738
3900
|
});
|
|
3739
3901
|
}
|
|
3740
3902
|
/** Redeem a coupon by creating a redemption (`POST`, HTTP 201). Returns the resource location. */
|
|
3741
|
-
async redeemCoupon(code, redemption, auth2 =
|
|
3903
|
+
async redeemCoupon(code, redemption, auth2 = SERVICE13) {
|
|
3742
3904
|
return this.ctx.http.request({
|
|
3743
3905
|
method: "POST",
|
|
3744
3906
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -3747,7 +3909,7 @@ var CouponService = class {
|
|
|
3747
3909
|
});
|
|
3748
3910
|
}
|
|
3749
3911
|
/** Retrieve one redemption by id. */
|
|
3750
|
-
async getRedemption(code, id, auth2 =
|
|
3912
|
+
async getRedemption(code, id, auth2 = SERVICE13) {
|
|
3751
3913
|
return this.ctx.http.request({
|
|
3752
3914
|
method: "GET",
|
|
3753
3915
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -3755,7 +3917,7 @@ var CouponService = class {
|
|
|
3755
3917
|
});
|
|
3756
3918
|
}
|
|
3757
3919
|
/** Delete a redemption by id. */
|
|
3758
|
-
async deleteRedemption(code, id, auth2 =
|
|
3920
|
+
async deleteRedemption(code, id, auth2 = SERVICE13) {
|
|
3759
3921
|
await this.ctx.http.request({
|
|
3760
3922
|
method: "DELETE",
|
|
3761
3923
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -3763,7 +3925,7 @@ var CouponService = class {
|
|
|
3763
3925
|
});
|
|
3764
3926
|
}
|
|
3765
3927
|
/** Retrieve a customer's referral coupon (resolves to an empty body when none exists). */
|
|
3766
|
-
async getReferralCoupon(customerNumber, auth2 =
|
|
3928
|
+
async getReferralCoupon(customerNumber, auth2 = SERVICE13) {
|
|
3767
3929
|
return this.ctx.http.request({
|
|
3768
3930
|
method: "GET",
|
|
3769
3931
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -3771,7 +3933,7 @@ var CouponService = class {
|
|
|
3771
3933
|
});
|
|
3772
3934
|
}
|
|
3773
3935
|
/** Create a referral coupon code for a customer (no request body). */
|
|
3774
|
-
async createReferralCoupon(customerNumber, auth2 =
|
|
3936
|
+
async createReferralCoupon(customerNumber, auth2 = SERVICE13) {
|
|
3775
3937
|
return this.ctx.http.request({
|
|
3776
3938
|
method: "POST",
|
|
3777
3939
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -3781,7 +3943,7 @@ var CouponService = class {
|
|
|
3781
3943
|
};
|
|
3782
3944
|
|
|
3783
3945
|
// src/services/reward-points.ts
|
|
3784
|
-
var
|
|
3946
|
+
var SERVICE14 = { kind: "service" };
|
|
3785
3947
|
var RewardPointsService = class {
|
|
3786
3948
|
constructor(ctx) {
|
|
3787
3949
|
this.ctx = ctx;
|
|
@@ -3798,7 +3960,7 @@ var RewardPointsService = class {
|
|
|
3798
3960
|
}
|
|
3799
3961
|
// --- Admin: customer points management (service token) ---
|
|
3800
3962
|
/** Batch summary across all customers. */
|
|
3801
|
-
async listAllSummaries(query = {}, auth2 =
|
|
3963
|
+
async listAllSummaries(query = {}, auth2 = SERVICE14) {
|
|
3802
3964
|
return this.ctx.http.request({
|
|
3803
3965
|
method: "GET",
|
|
3804
3966
|
path: `${this.base()}/summaryBatch`,
|
|
@@ -3807,7 +3969,7 @@ var RewardPointsService = class {
|
|
|
3807
3969
|
});
|
|
3808
3970
|
}
|
|
3809
3971
|
/** Retrieve one customer's reward-points balance. */
|
|
3810
|
-
async getCustomerPoints(customerId, auth2 =
|
|
3972
|
+
async getCustomerPoints(customerId, auth2 = SERVICE14) {
|
|
3811
3973
|
return this.ctx.http.request({
|
|
3812
3974
|
method: "GET",
|
|
3813
3975
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3815,7 +3977,7 @@ var RewardPointsService = class {
|
|
|
3815
3977
|
});
|
|
3816
3978
|
}
|
|
3817
3979
|
/** Create a reward-points entry for a customer. */
|
|
3818
|
-
async createCustomerPoints(customerId, input, auth2 =
|
|
3980
|
+
async createCustomerPoints(customerId, input, auth2 = SERVICE14) {
|
|
3819
3981
|
await this.ctx.http.request({
|
|
3820
3982
|
method: "POST",
|
|
3821
3983
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3824,7 +3986,7 @@ var RewardPointsService = class {
|
|
|
3824
3986
|
});
|
|
3825
3987
|
}
|
|
3826
3988
|
/** Delete a customer's reward points. */
|
|
3827
|
-
async deleteCustomerPoints(customerId, auth2 =
|
|
3989
|
+
async deleteCustomerPoints(customerId, auth2 = SERVICE14) {
|
|
3828
3990
|
await this.ctx.http.request({
|
|
3829
3991
|
method: "DELETE",
|
|
3830
3992
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -3832,7 +3994,7 @@ var RewardPointsService = class {
|
|
|
3832
3994
|
});
|
|
3833
3995
|
}
|
|
3834
3996
|
/** Retrieve a reward-points summary for one customer. */
|
|
3835
|
-
async getCustomerSummary(customerId, auth2 =
|
|
3997
|
+
async getCustomerSummary(customerId, auth2 = SERVICE14) {
|
|
3836
3998
|
return this.ctx.http.request({
|
|
3837
3999
|
method: "GET",
|
|
3838
4000
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/summary`,
|
|
@@ -3840,7 +4002,7 @@ var RewardPointsService = class {
|
|
|
3840
4002
|
});
|
|
3841
4003
|
}
|
|
3842
4004
|
/** Add reward points for a customer. */
|
|
3843
|
-
async addPoints(customerId, input, auth2 =
|
|
4005
|
+
async addPoints(customerId, input, auth2 = SERVICE14) {
|
|
3844
4006
|
await this.ctx.http.request({
|
|
3845
4007
|
method: "POST",
|
|
3846
4008
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/addPoints`,
|
|
@@ -3849,7 +4011,7 @@ var RewardPointsService = class {
|
|
|
3849
4011
|
});
|
|
3850
4012
|
}
|
|
3851
4013
|
/** Redeem a customer's reward points (on behalf). */
|
|
3852
|
-
async redeemPoints(customerId, input, auth2 =
|
|
4014
|
+
async redeemPoints(customerId, input, auth2 = SERVICE14) {
|
|
3853
4015
|
await this.ctx.http.request({
|
|
3854
4016
|
method: "POST",
|
|
3855
4017
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/redeemPoints`,
|
|
@@ -3900,7 +4062,7 @@ var RewardPointsService = class {
|
|
|
3900
4062
|
}
|
|
3901
4063
|
// --- Redeem options (tenant-scoped; read open to customer, management service-only) ---
|
|
3902
4064
|
/** List redeem options. Defaults to the service token; pass a customer `auth` for storefront reads. */
|
|
3903
|
-
async listRedeemOptions(auth2 =
|
|
4065
|
+
async listRedeemOptions(auth2 = SERVICE14) {
|
|
3904
4066
|
return this.ctx.http.request({
|
|
3905
4067
|
method: "GET",
|
|
3906
4068
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -3908,7 +4070,7 @@ var RewardPointsService = class {
|
|
|
3908
4070
|
});
|
|
3909
4071
|
}
|
|
3910
4072
|
/** Create a redeem option. Returns the updated options list. */
|
|
3911
|
-
async createRedeemOption(input, auth2 =
|
|
4073
|
+
async createRedeemOption(input, auth2 = SERVICE14) {
|
|
3912
4074
|
return this.ctx.http.request({
|
|
3913
4075
|
method: "POST",
|
|
3914
4076
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -3917,7 +4079,7 @@ var RewardPointsService = class {
|
|
|
3917
4079
|
});
|
|
3918
4080
|
}
|
|
3919
4081
|
/** Update a redeem option by id. Resolves once accepted (no response body). */
|
|
3920
|
-
async updateRedeemOption(redeemOptionId, input, auth2 =
|
|
4082
|
+
async updateRedeemOption(redeemOptionId, input, auth2 = SERVICE14) {
|
|
3921
4083
|
await this.ctx.http.request({
|
|
3922
4084
|
method: "PUT",
|
|
3923
4085
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -3926,7 +4088,7 @@ var RewardPointsService = class {
|
|
|
3926
4088
|
});
|
|
3927
4089
|
}
|
|
3928
4090
|
/** Delete a redeem option by id. */
|
|
3929
|
-
async deleteRedeemOption(redeemOptionId, auth2 =
|
|
4091
|
+
async deleteRedeemOption(redeemOptionId, auth2 = SERVICE14) {
|
|
3930
4092
|
await this.ctx.http.request({
|
|
3931
4093
|
method: "DELETE",
|
|
3932
4094
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -3936,7 +4098,7 @@ var RewardPointsService = class {
|
|
|
3936
4098
|
};
|
|
3937
4099
|
|
|
3938
4100
|
// src/services/brand.ts
|
|
3939
|
-
var
|
|
4101
|
+
var SERVICE15 = { kind: "service" };
|
|
3940
4102
|
var BrandService = class {
|
|
3941
4103
|
constructor(ctx) {
|
|
3942
4104
|
this.ctx = ctx;
|
|
@@ -3947,7 +4109,7 @@ var BrandService = class {
|
|
|
3947
4109
|
return `/brand/brands`;
|
|
3948
4110
|
}
|
|
3949
4111
|
/** List all brands. */
|
|
3950
|
-
async listBrands(query = {}, auth2 =
|
|
4112
|
+
async listBrands(query = {}, auth2 = SERVICE15) {
|
|
3951
4113
|
return this.ctx.http.request({
|
|
3952
4114
|
method: "GET",
|
|
3953
4115
|
path: this.base(),
|
|
@@ -3956,7 +4118,7 @@ var BrandService = class {
|
|
|
3956
4118
|
});
|
|
3957
4119
|
}
|
|
3958
4120
|
/** Retrieve one brand by id. */
|
|
3959
|
-
async getBrand(brandId, auth2 =
|
|
4121
|
+
async getBrand(brandId, auth2 = SERVICE15) {
|
|
3960
4122
|
return this.ctx.http.request({
|
|
3961
4123
|
method: "GET",
|
|
3962
4124
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3964,7 +4126,7 @@ var BrandService = class {
|
|
|
3964
4126
|
});
|
|
3965
4127
|
}
|
|
3966
4128
|
/** Create a brand. */
|
|
3967
|
-
async createBrand(input, auth2 =
|
|
4129
|
+
async createBrand(input, auth2 = SERVICE15) {
|
|
3968
4130
|
return this.ctx.http.request({
|
|
3969
4131
|
method: "POST",
|
|
3970
4132
|
path: this.base(),
|
|
@@ -3973,7 +4135,7 @@ var BrandService = class {
|
|
|
3973
4135
|
});
|
|
3974
4136
|
}
|
|
3975
4137
|
/** Replace a brand by id. */
|
|
3976
|
-
async updateBrand(brandId, input, auth2 =
|
|
4138
|
+
async updateBrand(brandId, input, auth2 = SERVICE15) {
|
|
3977
4139
|
return this.ctx.http.request({
|
|
3978
4140
|
method: "PUT",
|
|
3979
4141
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3982,7 +4144,7 @@ var BrandService = class {
|
|
|
3982
4144
|
});
|
|
3983
4145
|
}
|
|
3984
4146
|
/** Partially update a brand by id. */
|
|
3985
|
-
async patchBrand(brandId, patch, auth2 =
|
|
4147
|
+
async patchBrand(brandId, patch, auth2 = SERVICE15) {
|
|
3986
4148
|
return this.ctx.http.request({
|
|
3987
4149
|
method: "PATCH",
|
|
3988
4150
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -3991,7 +4153,7 @@ var BrandService = class {
|
|
|
3991
4153
|
});
|
|
3992
4154
|
}
|
|
3993
4155
|
/** Delete a brand by id. */
|
|
3994
|
-
async deleteBrand(brandId, auth2 =
|
|
4156
|
+
async deleteBrand(brandId, auth2 = SERVICE15) {
|
|
3995
4157
|
await this.ctx.http.request({
|
|
3996
4158
|
method: "DELETE",
|
|
3997
4159
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -4001,7 +4163,7 @@ var BrandService = class {
|
|
|
4001
4163
|
};
|
|
4002
4164
|
|
|
4003
4165
|
// src/services/label.ts
|
|
4004
|
-
var
|
|
4166
|
+
var SERVICE16 = { kind: "service" };
|
|
4005
4167
|
var LabelService = class {
|
|
4006
4168
|
constructor(ctx) {
|
|
4007
4169
|
this.ctx = ctx;
|
|
@@ -4012,7 +4174,7 @@ var LabelService = class {
|
|
|
4012
4174
|
return `/label/labels`;
|
|
4013
4175
|
}
|
|
4014
4176
|
/** List all labels. */
|
|
4015
|
-
async listLabels(query = {}, auth2 =
|
|
4177
|
+
async listLabels(query = {}, auth2 = SERVICE16) {
|
|
4016
4178
|
return this.ctx.http.request({
|
|
4017
4179
|
method: "GET",
|
|
4018
4180
|
path: this.base(),
|
|
@@ -4021,7 +4183,7 @@ var LabelService = class {
|
|
|
4021
4183
|
});
|
|
4022
4184
|
}
|
|
4023
4185
|
/** Retrieve one label by id. */
|
|
4024
|
-
async getLabel(labelId, auth2 =
|
|
4186
|
+
async getLabel(labelId, auth2 = SERVICE16) {
|
|
4025
4187
|
return this.ctx.http.request({
|
|
4026
4188
|
method: "GET",
|
|
4027
4189
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4029,7 +4191,7 @@ var LabelService = class {
|
|
|
4029
4191
|
});
|
|
4030
4192
|
}
|
|
4031
4193
|
/** Create a label. */
|
|
4032
|
-
async createLabel(input, auth2 =
|
|
4194
|
+
async createLabel(input, auth2 = SERVICE16) {
|
|
4033
4195
|
return this.ctx.http.request({
|
|
4034
4196
|
method: "POST",
|
|
4035
4197
|
path: this.base(),
|
|
@@ -4038,7 +4200,7 @@ var LabelService = class {
|
|
|
4038
4200
|
});
|
|
4039
4201
|
}
|
|
4040
4202
|
/** Replace a label by id. */
|
|
4041
|
-
async updateLabel(labelId, input, auth2 =
|
|
4203
|
+
async updateLabel(labelId, input, auth2 = SERVICE16) {
|
|
4042
4204
|
return this.ctx.http.request({
|
|
4043
4205
|
method: "PUT",
|
|
4044
4206
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4047,7 +4209,7 @@ var LabelService = class {
|
|
|
4047
4209
|
});
|
|
4048
4210
|
}
|
|
4049
4211
|
/** Partially update a label by id. */
|
|
4050
|
-
async patchLabel(labelId, patch, auth2 =
|
|
4212
|
+
async patchLabel(labelId, patch, auth2 = SERVICE16) {
|
|
4051
4213
|
return this.ctx.http.request({
|
|
4052
4214
|
method: "PATCH",
|
|
4053
4215
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4056,7 +4218,7 @@ var LabelService = class {
|
|
|
4056
4218
|
});
|
|
4057
4219
|
}
|
|
4058
4220
|
/** Delete a label by id. */
|
|
4059
|
-
async deleteLabel(labelId, auth2 =
|
|
4221
|
+
async deleteLabel(labelId, auth2 = SERVICE16) {
|
|
4060
4222
|
await this.ctx.http.request({
|
|
4061
4223
|
method: "DELETE",
|
|
4062
4224
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -4066,7 +4228,7 @@ var LabelService = class {
|
|
|
4066
4228
|
};
|
|
4067
4229
|
|
|
4068
4230
|
// src/services/country.ts
|
|
4069
|
-
var
|
|
4231
|
+
var SERVICE17 = { kind: "service" };
|
|
4070
4232
|
var CountryService = class {
|
|
4071
4233
|
constructor(ctx) {
|
|
4072
4234
|
this.ctx = ctx;
|
|
@@ -4077,7 +4239,7 @@ var CountryService = class {
|
|
|
4077
4239
|
return `/country/${this.ctx.tenant}`;
|
|
4078
4240
|
}
|
|
4079
4241
|
/** List all countries. */
|
|
4080
|
-
async listCountries(query = {}, auth2 =
|
|
4242
|
+
async listCountries(query = {}, auth2 = SERVICE17) {
|
|
4081
4243
|
return this.ctx.http.request({
|
|
4082
4244
|
method: "GET",
|
|
4083
4245
|
path: `${this.base()}/countries`,
|
|
@@ -4086,7 +4248,7 @@ var CountryService = class {
|
|
|
4086
4248
|
});
|
|
4087
4249
|
}
|
|
4088
4250
|
/** Retrieve one country by code. */
|
|
4089
|
-
async getCountry(countryCode, auth2 =
|
|
4251
|
+
async getCountry(countryCode, auth2 = SERVICE17) {
|
|
4090
4252
|
return this.ctx.http.request({
|
|
4091
4253
|
method: "GET",
|
|
4092
4254
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -4094,7 +4256,7 @@ var CountryService = class {
|
|
|
4094
4256
|
});
|
|
4095
4257
|
}
|
|
4096
4258
|
/** Partially update a country by code. Resolves once accepted (no response body). */
|
|
4097
|
-
async patchCountry(countryCode, patch, auth2 =
|
|
4259
|
+
async patchCountry(countryCode, patch, auth2 = SERVICE17) {
|
|
4098
4260
|
await this.ctx.http.request({
|
|
4099
4261
|
method: "PATCH",
|
|
4100
4262
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -4103,7 +4265,7 @@ var CountryService = class {
|
|
|
4103
4265
|
});
|
|
4104
4266
|
}
|
|
4105
4267
|
/** List all regions. */
|
|
4106
|
-
async listRegions(query = {}, auth2 =
|
|
4268
|
+
async listRegions(query = {}, auth2 = SERVICE17) {
|
|
4107
4269
|
return this.ctx.http.request({
|
|
4108
4270
|
method: "GET",
|
|
4109
4271
|
path: `${this.base()}/regions`,
|
|
@@ -4112,7 +4274,7 @@ var CountryService = class {
|
|
|
4112
4274
|
});
|
|
4113
4275
|
}
|
|
4114
4276
|
/** Retrieve one region by code. */
|
|
4115
|
-
async getRegion(regionCode, auth2 =
|
|
4277
|
+
async getRegion(regionCode, auth2 = SERVICE17) {
|
|
4116
4278
|
return this.ctx.http.request({
|
|
4117
4279
|
method: "GET",
|
|
4118
4280
|
path: `${this.base()}/regions/${encodeURIComponent(regionCode)}`,
|
|
@@ -4122,7 +4284,7 @@ var CountryService = class {
|
|
|
4122
4284
|
};
|
|
4123
4285
|
|
|
4124
4286
|
// src/services/currency.ts
|
|
4125
|
-
var
|
|
4287
|
+
var SERVICE18 = { kind: "service" };
|
|
4126
4288
|
var CurrencyService = class {
|
|
4127
4289
|
constructor(ctx) {
|
|
4128
4290
|
this.ctx = ctx;
|
|
@@ -4134,7 +4296,7 @@ var CurrencyService = class {
|
|
|
4134
4296
|
}
|
|
4135
4297
|
// --- Currencies ---
|
|
4136
4298
|
/** List all currencies. */
|
|
4137
|
-
async listCurrencies(query = {}, auth2 =
|
|
4299
|
+
async listCurrencies(query = {}, auth2 = SERVICE18) {
|
|
4138
4300
|
return this.ctx.http.request({
|
|
4139
4301
|
method: "GET",
|
|
4140
4302
|
path: `${this.base()}/currencies`,
|
|
@@ -4143,7 +4305,7 @@ var CurrencyService = class {
|
|
|
4143
4305
|
});
|
|
4144
4306
|
}
|
|
4145
4307
|
/** Retrieve one currency by code. */
|
|
4146
|
-
async getCurrency(code, auth2 =
|
|
4308
|
+
async getCurrency(code, auth2 = SERVICE18) {
|
|
4147
4309
|
return this.ctx.http.request({
|
|
4148
4310
|
method: "GET",
|
|
4149
4311
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4151,7 +4313,7 @@ var CurrencyService = class {
|
|
|
4151
4313
|
});
|
|
4152
4314
|
}
|
|
4153
4315
|
/** Create a currency. */
|
|
4154
|
-
async createCurrency(input, auth2 =
|
|
4316
|
+
async createCurrency(input, auth2 = SERVICE18) {
|
|
4155
4317
|
return this.ctx.http.request({
|
|
4156
4318
|
method: "POST",
|
|
4157
4319
|
path: `${this.base()}/currencies`,
|
|
@@ -4160,7 +4322,7 @@ var CurrencyService = class {
|
|
|
4160
4322
|
});
|
|
4161
4323
|
}
|
|
4162
4324
|
/** Update a currency by code. */
|
|
4163
|
-
async updateCurrency(code, input, auth2 =
|
|
4325
|
+
async updateCurrency(code, input, auth2 = SERVICE18) {
|
|
4164
4326
|
return this.ctx.http.request({
|
|
4165
4327
|
method: "PUT",
|
|
4166
4328
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4169,7 +4331,7 @@ var CurrencyService = class {
|
|
|
4169
4331
|
});
|
|
4170
4332
|
}
|
|
4171
4333
|
/** Delete a currency by code. */
|
|
4172
|
-
async deleteCurrency(code, auth2 =
|
|
4334
|
+
async deleteCurrency(code, auth2 = SERVICE18) {
|
|
4173
4335
|
await this.ctx.http.request({
|
|
4174
4336
|
method: "DELETE",
|
|
4175
4337
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -4178,7 +4340,7 @@ var CurrencyService = class {
|
|
|
4178
4340
|
}
|
|
4179
4341
|
// --- Exchange rates ---
|
|
4180
4342
|
/** List all exchange rates. */
|
|
4181
|
-
async listExchangeRates(query = {}, auth2 =
|
|
4343
|
+
async listExchangeRates(query = {}, auth2 = SERVICE18) {
|
|
4182
4344
|
return this.ctx.http.request({
|
|
4183
4345
|
method: "GET",
|
|
4184
4346
|
path: `${this.base()}/exchanges`,
|
|
@@ -4187,7 +4349,7 @@ var CurrencyService = class {
|
|
|
4187
4349
|
});
|
|
4188
4350
|
}
|
|
4189
4351
|
/** Retrieve one exchange rate by code. */
|
|
4190
|
-
async getExchangeRate(code, auth2 =
|
|
4352
|
+
async getExchangeRate(code, auth2 = SERVICE18) {
|
|
4191
4353
|
return this.ctx.http.request({
|
|
4192
4354
|
method: "GET",
|
|
4193
4355
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4195,7 +4357,7 @@ var CurrencyService = class {
|
|
|
4195
4357
|
});
|
|
4196
4358
|
}
|
|
4197
4359
|
/** Create an exchange rate. */
|
|
4198
|
-
async createExchangeRate(input, auth2 =
|
|
4360
|
+
async createExchangeRate(input, auth2 = SERVICE18) {
|
|
4199
4361
|
return this.ctx.http.request({
|
|
4200
4362
|
method: "POST",
|
|
4201
4363
|
path: `${this.base()}/exchanges`,
|
|
@@ -4204,7 +4366,7 @@ var CurrencyService = class {
|
|
|
4204
4366
|
});
|
|
4205
4367
|
}
|
|
4206
4368
|
/** Update an exchange rate by code. */
|
|
4207
|
-
async updateExchangeRate(code, input, auth2 =
|
|
4369
|
+
async updateExchangeRate(code, input, auth2 = SERVICE18) {
|
|
4208
4370
|
return this.ctx.http.request({
|
|
4209
4371
|
method: "PUT",
|
|
4210
4372
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4213,7 +4375,7 @@ var CurrencyService = class {
|
|
|
4213
4375
|
});
|
|
4214
4376
|
}
|
|
4215
4377
|
/** Delete an exchange rate by code. */
|
|
4216
|
-
async deleteExchangeRate(code, auth2 =
|
|
4378
|
+
async deleteExchangeRate(code, auth2 = SERVICE18) {
|
|
4217
4379
|
await this.ctx.http.request({
|
|
4218
4380
|
method: "DELETE",
|
|
4219
4381
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -4223,7 +4385,7 @@ var CurrencyService = class {
|
|
|
4223
4385
|
};
|
|
4224
4386
|
|
|
4225
4387
|
// src/services/shipping.ts
|
|
4226
|
-
var
|
|
4388
|
+
var SERVICE19 = { kind: "service" };
|
|
4227
4389
|
var ShippingService = class {
|
|
4228
4390
|
constructor(ctx) {
|
|
4229
4391
|
this.ctx = ctx;
|
|
@@ -4238,7 +4400,7 @@ var ShippingService = class {
|
|
|
4238
4400
|
}
|
|
4239
4401
|
// --- Sites ---
|
|
4240
4402
|
/** Find shipping-related sites by postal code (`POST /findSite`). */
|
|
4241
|
-
async findSites(input, auth2 =
|
|
4403
|
+
async findSites(input, auth2 = SERVICE19) {
|
|
4242
4404
|
return this.ctx.http.request({
|
|
4243
4405
|
method: "POST",
|
|
4244
4406
|
path: `${this.base()}/findSite`,
|
|
@@ -4248,7 +4410,7 @@ var ShippingService = class {
|
|
|
4248
4410
|
}
|
|
4249
4411
|
// --- Zones ---
|
|
4250
4412
|
/** List shipping zones for a site. */
|
|
4251
|
-
async listZones(site, query = {}, auth2 =
|
|
4413
|
+
async listZones(site, query = {}, auth2 = SERVICE19) {
|
|
4252
4414
|
return this.ctx.http.request({
|
|
4253
4415
|
method: "GET",
|
|
4254
4416
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -4257,7 +4419,7 @@ var ShippingService = class {
|
|
|
4257
4419
|
});
|
|
4258
4420
|
}
|
|
4259
4421
|
/** Retrieve one shipping zone. */
|
|
4260
|
-
async getZone(site, zoneId, auth2 =
|
|
4422
|
+
async getZone(site, zoneId, auth2 = SERVICE19) {
|
|
4261
4423
|
return this.ctx.http.request({
|
|
4262
4424
|
method: "GET",
|
|
4263
4425
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4265,7 +4427,7 @@ var ShippingService = class {
|
|
|
4265
4427
|
});
|
|
4266
4428
|
}
|
|
4267
4429
|
/** Create a shipping zone. */
|
|
4268
|
-
async createZone(site, zone, auth2 =
|
|
4430
|
+
async createZone(site, zone, auth2 = SERVICE19) {
|
|
4269
4431
|
return this.ctx.http.request({
|
|
4270
4432
|
method: "POST",
|
|
4271
4433
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -4274,7 +4436,7 @@ var ShippingService = class {
|
|
|
4274
4436
|
});
|
|
4275
4437
|
}
|
|
4276
4438
|
/** Replace a shipping zone. */
|
|
4277
|
-
async updateZone(site, zoneId, zone, auth2 =
|
|
4439
|
+
async updateZone(site, zoneId, zone, auth2 = SERVICE19) {
|
|
4278
4440
|
await this.ctx.http.request({
|
|
4279
4441
|
method: "PUT",
|
|
4280
4442
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4283,7 +4445,7 @@ var ShippingService = class {
|
|
|
4283
4445
|
});
|
|
4284
4446
|
}
|
|
4285
4447
|
/** Partially update a shipping zone. */
|
|
4286
|
-
async patchZone(site, zoneId, patch, auth2 =
|
|
4448
|
+
async patchZone(site, zoneId, patch, auth2 = SERVICE19) {
|
|
4287
4449
|
await this.ctx.http.request({
|
|
4288
4450
|
method: "PATCH",
|
|
4289
4451
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4292,7 +4454,7 @@ var ShippingService = class {
|
|
|
4292
4454
|
});
|
|
4293
4455
|
}
|
|
4294
4456
|
/** Delete a shipping zone. */
|
|
4295
|
-
async deleteZone(site, zoneId, auth2 =
|
|
4457
|
+
async deleteZone(site, zoneId, auth2 = SERVICE19) {
|
|
4296
4458
|
await this.ctx.http.request({
|
|
4297
4459
|
method: "DELETE",
|
|
4298
4460
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -4301,7 +4463,7 @@ var ShippingService = class {
|
|
|
4301
4463
|
}
|
|
4302
4464
|
// --- Methods (per zone) ---
|
|
4303
4465
|
/** List shipping methods of a zone. */
|
|
4304
|
-
async listMethods(site, zoneId, query = {}, auth2 =
|
|
4466
|
+
async listMethods(site, zoneId, query = {}, auth2 = SERVICE19) {
|
|
4305
4467
|
return this.ctx.http.request({
|
|
4306
4468
|
method: "GET",
|
|
4307
4469
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -4310,7 +4472,7 @@ var ShippingService = class {
|
|
|
4310
4472
|
});
|
|
4311
4473
|
}
|
|
4312
4474
|
/** Retrieve one shipping method. */
|
|
4313
|
-
async getMethod(site, zoneId, methodId, auth2 =
|
|
4475
|
+
async getMethod(site, zoneId, methodId, auth2 = SERVICE19) {
|
|
4314
4476
|
return this.ctx.http.request({
|
|
4315
4477
|
method: "GET",
|
|
4316
4478
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4318,7 +4480,7 @@ var ShippingService = class {
|
|
|
4318
4480
|
});
|
|
4319
4481
|
}
|
|
4320
4482
|
/** Create a shipping method in a zone. */
|
|
4321
|
-
async createMethod(site, zoneId, method, auth2 =
|
|
4483
|
+
async createMethod(site, zoneId, method, auth2 = SERVICE19) {
|
|
4322
4484
|
return this.ctx.http.request({
|
|
4323
4485
|
method: "POST",
|
|
4324
4486
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -4327,7 +4489,7 @@ var ShippingService = class {
|
|
|
4327
4489
|
});
|
|
4328
4490
|
}
|
|
4329
4491
|
/** Replace a shipping method. */
|
|
4330
|
-
async updateMethod(site, zoneId, methodId, method, auth2 =
|
|
4492
|
+
async updateMethod(site, zoneId, methodId, method, auth2 = SERVICE19) {
|
|
4331
4493
|
await this.ctx.http.request({
|
|
4332
4494
|
method: "PUT",
|
|
4333
4495
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4336,7 +4498,7 @@ var ShippingService = class {
|
|
|
4336
4498
|
});
|
|
4337
4499
|
}
|
|
4338
4500
|
/** Partially update a shipping method. */
|
|
4339
|
-
async patchMethod(site, zoneId, methodId, patch, auth2 =
|
|
4501
|
+
async patchMethod(site, zoneId, methodId, patch, auth2 = SERVICE19) {
|
|
4340
4502
|
await this.ctx.http.request({
|
|
4341
4503
|
method: "PATCH",
|
|
4342
4504
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4345,7 +4507,7 @@ var ShippingService = class {
|
|
|
4345
4507
|
});
|
|
4346
4508
|
}
|
|
4347
4509
|
/** Delete a shipping method. */
|
|
4348
|
-
async deleteMethod(site, zoneId, methodId, auth2 =
|
|
4510
|
+
async deleteMethod(site, zoneId, methodId, auth2 = SERVICE19) {
|
|
4349
4511
|
await this.ctx.http.request({
|
|
4350
4512
|
method: "DELETE",
|
|
4351
4513
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -4354,7 +4516,7 @@ var ShippingService = class {
|
|
|
4354
4516
|
}
|
|
4355
4517
|
// --- Cost / quote ---
|
|
4356
4518
|
/** Calculate the final shipping cost (`POST /quote`). */
|
|
4357
|
-
async quote(site, input, auth2 =
|
|
4519
|
+
async quote(site, input, auth2 = SERVICE19) {
|
|
4358
4520
|
return this.ctx.http.request({
|
|
4359
4521
|
method: "POST",
|
|
4360
4522
|
path: `${this.siteBase(site)}/quote`,
|
|
@@ -4363,7 +4525,7 @@ var ShippingService = class {
|
|
|
4363
4525
|
});
|
|
4364
4526
|
}
|
|
4365
4527
|
/** Calculate the minimum shipping cost (`POST /quote/minimum`). */
|
|
4366
|
-
async quoteMinimum(site, input, auth2 =
|
|
4528
|
+
async quoteMinimum(site, input, auth2 = SERVICE19) {
|
|
4367
4529
|
return this.ctx.http.request({
|
|
4368
4530
|
method: "POST",
|
|
4369
4531
|
path: `${this.siteBase(site)}/quote/minimum`,
|
|
@@ -4372,7 +4534,7 @@ var ShippingService = class {
|
|
|
4372
4534
|
});
|
|
4373
4535
|
}
|
|
4374
4536
|
/** Calculate the shipping cost for a given slot (`POST /quote/slot`). */
|
|
4375
|
-
async quoteSlot(site, input, auth2 =
|
|
4537
|
+
async quoteSlot(site, input, auth2 = SERVICE19) {
|
|
4376
4538
|
return this.ctx.http.request({
|
|
4377
4539
|
method: "POST",
|
|
4378
4540
|
path: `${this.siteBase(site)}/quote/slot`,
|
|
@@ -4382,7 +4544,7 @@ var ShippingService = class {
|
|
|
4382
4544
|
}
|
|
4383
4545
|
// --- Groups ---
|
|
4384
4546
|
/** List shipping groups for a site. */
|
|
4385
|
-
async listGroups(site, query = {}, auth2 =
|
|
4547
|
+
async listGroups(site, query = {}, auth2 = SERVICE19) {
|
|
4386
4548
|
return this.ctx.http.request({
|
|
4387
4549
|
method: "GET",
|
|
4388
4550
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -4391,7 +4553,7 @@ var ShippingService = class {
|
|
|
4391
4553
|
});
|
|
4392
4554
|
}
|
|
4393
4555
|
/** Retrieve one shipping group. */
|
|
4394
|
-
async getGroup(site, groupId, auth2 =
|
|
4556
|
+
async getGroup(site, groupId, auth2 = SERVICE19) {
|
|
4395
4557
|
return this.ctx.http.request({
|
|
4396
4558
|
method: "GET",
|
|
4397
4559
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4399,7 +4561,7 @@ var ShippingService = class {
|
|
|
4399
4561
|
});
|
|
4400
4562
|
}
|
|
4401
4563
|
/** Create a shipping group. */
|
|
4402
|
-
async createGroup(site, group, auth2 =
|
|
4564
|
+
async createGroup(site, group, auth2 = SERVICE19) {
|
|
4403
4565
|
return this.ctx.http.request({
|
|
4404
4566
|
method: "POST",
|
|
4405
4567
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -4408,7 +4570,7 @@ var ShippingService = class {
|
|
|
4408
4570
|
});
|
|
4409
4571
|
}
|
|
4410
4572
|
/** Replace a shipping group. */
|
|
4411
|
-
async updateGroup(site, groupId, group, auth2 =
|
|
4573
|
+
async updateGroup(site, groupId, group, auth2 = SERVICE19) {
|
|
4412
4574
|
await this.ctx.http.request({
|
|
4413
4575
|
method: "PUT",
|
|
4414
4576
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4417,7 +4579,7 @@ var ShippingService = class {
|
|
|
4417
4579
|
});
|
|
4418
4580
|
}
|
|
4419
4581
|
/** Delete a shipping group. */
|
|
4420
|
-
async deleteGroup(site, groupId, auth2 =
|
|
4582
|
+
async deleteGroup(site, groupId, auth2 = SERVICE19) {
|
|
4421
4583
|
await this.ctx.http.request({
|
|
4422
4584
|
method: "DELETE",
|
|
4423
4585
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -4426,7 +4588,7 @@ var ShippingService = class {
|
|
|
4426
4588
|
}
|
|
4427
4589
|
// --- Customer-group relations ---
|
|
4428
4590
|
/** List customer-group relations for a site. */
|
|
4429
|
-
async listCgRelations(site, query = {}, auth2 =
|
|
4591
|
+
async listCgRelations(site, query = {}, auth2 = SERVICE19) {
|
|
4430
4592
|
return this.ctx.http.request({
|
|
4431
4593
|
method: "GET",
|
|
4432
4594
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -4435,7 +4597,7 @@ var ShippingService = class {
|
|
|
4435
4597
|
});
|
|
4436
4598
|
}
|
|
4437
4599
|
/** Retrieve a customer's customer-group relations. */
|
|
4438
|
-
async getCgRelations(site, customerId, auth2 =
|
|
4600
|
+
async getCgRelations(site, customerId, auth2 = SERVICE19) {
|
|
4439
4601
|
return this.ctx.http.request({
|
|
4440
4602
|
method: "GET",
|
|
4441
4603
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4443,7 +4605,7 @@ var ShippingService = class {
|
|
|
4443
4605
|
});
|
|
4444
4606
|
}
|
|
4445
4607
|
/** Create a customer-group relation. */
|
|
4446
|
-
async createCgRelation(site, relation, auth2 =
|
|
4608
|
+
async createCgRelation(site, relation, auth2 = SERVICE19) {
|
|
4447
4609
|
return this.ctx.http.request({
|
|
4448
4610
|
method: "POST",
|
|
4449
4611
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -4452,7 +4614,7 @@ var ShippingService = class {
|
|
|
4452
4614
|
});
|
|
4453
4615
|
}
|
|
4454
4616
|
/** Update a customer's customer-group relations. */
|
|
4455
|
-
async updateCgRelations(site, customerId, relation, auth2 =
|
|
4617
|
+
async updateCgRelations(site, customerId, relation, auth2 = SERVICE19) {
|
|
4456
4618
|
await this.ctx.http.request({
|
|
4457
4619
|
method: "PUT",
|
|
4458
4620
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4461,7 +4623,7 @@ var ShippingService = class {
|
|
|
4461
4623
|
});
|
|
4462
4624
|
}
|
|
4463
4625
|
/** Delete a customer's customer-group relation. */
|
|
4464
|
-
async deleteCgRelation(site, customerId, auth2 =
|
|
4626
|
+
async deleteCgRelation(site, customerId, auth2 = SERVICE19) {
|
|
4465
4627
|
await this.ctx.http.request({
|
|
4466
4628
|
method: "DELETE",
|
|
4467
4629
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -4470,7 +4632,7 @@ var ShippingService = class {
|
|
|
4470
4632
|
}
|
|
4471
4633
|
// --- Phase 2: delivery windows ---
|
|
4472
4634
|
/** Retrieve delivery windows for a delivery area + cart. */
|
|
4473
|
-
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 =
|
|
4635
|
+
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 = SERVICE19) {
|
|
4474
4636
|
return this.ctx.http.request({
|
|
4475
4637
|
method: "GET",
|
|
4476
4638
|
path: `${this.base()}/areaDeliveryTimes/${encodeURIComponent(deliveryAreaId)}/${encodeURIComponent(cartId)}`,
|
|
@@ -4478,7 +4640,7 @@ var ShippingService = class {
|
|
|
4478
4640
|
});
|
|
4479
4641
|
}
|
|
4480
4642
|
/** Retrieve delivery windows for a cart. */
|
|
4481
|
-
async getCartDeliveryWindows(cartId, auth2 =
|
|
4643
|
+
async getCartDeliveryWindows(cartId, auth2 = SERVICE19) {
|
|
4482
4644
|
return this.ctx.http.request({
|
|
4483
4645
|
method: "GET",
|
|
4484
4646
|
path: `${this.base()}/actualDeliveryWindows/${encodeURIComponent(cartId)}`,
|
|
@@ -4486,7 +4648,7 @@ var ShippingService = class {
|
|
|
4486
4648
|
});
|
|
4487
4649
|
}
|
|
4488
4650
|
/** Increment the delivery-window counter. */
|
|
4489
|
-
async incrementDeliveryWindowCounter(input, auth2 =
|
|
4651
|
+
async incrementDeliveryWindowCounter(input, auth2 = SERVICE19) {
|
|
4490
4652
|
await this.ctx.http.request({
|
|
4491
4653
|
method: "POST",
|
|
4492
4654
|
path: `${this.base()}/actualDeliveryWindows/incrementCounter`,
|
|
@@ -4495,7 +4657,7 @@ var ShippingService = class {
|
|
|
4495
4657
|
});
|
|
4496
4658
|
}
|
|
4497
4659
|
/** Validate a delivery window. Resolves when valid; throws otherwise. */
|
|
4498
|
-
async validateDeliveryWindow(input, auth2 =
|
|
4660
|
+
async validateDeliveryWindow(input, auth2 = SERVICE19) {
|
|
4499
4661
|
await this.ctx.http.request({
|
|
4500
4662
|
method: "POST",
|
|
4501
4663
|
path: `${this.base()}/deliveryWindowValidation`,
|
|
@@ -4505,7 +4667,7 @@ var ShippingService = class {
|
|
|
4505
4667
|
}
|
|
4506
4668
|
// --- Phase 2: delivery times ---
|
|
4507
4669
|
/** List all delivery times. */
|
|
4508
|
-
async listDeliveryTimes(query = {}, auth2 =
|
|
4670
|
+
async listDeliveryTimes(query = {}, auth2 = SERVICE19) {
|
|
4509
4671
|
return this.ctx.http.request({
|
|
4510
4672
|
method: "GET",
|
|
4511
4673
|
path: `${this.base()}/delivery-times`,
|
|
@@ -4514,7 +4676,7 @@ var ShippingService = class {
|
|
|
4514
4676
|
});
|
|
4515
4677
|
}
|
|
4516
4678
|
/** Retrieve one delivery time. */
|
|
4517
|
-
async getDeliveryTime(deliveryTimeId, auth2 =
|
|
4679
|
+
async getDeliveryTime(deliveryTimeId, auth2 = SERVICE19) {
|
|
4518
4680
|
return this.ctx.http.request({
|
|
4519
4681
|
method: "GET",
|
|
4520
4682
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4522,7 +4684,7 @@ var ShippingService = class {
|
|
|
4522
4684
|
});
|
|
4523
4685
|
}
|
|
4524
4686
|
/** Create a delivery time. */
|
|
4525
|
-
async createDeliveryTime(input, auth2 =
|
|
4687
|
+
async createDeliveryTime(input, auth2 = SERVICE19) {
|
|
4526
4688
|
return this.ctx.http.request({
|
|
4527
4689
|
method: "POST",
|
|
4528
4690
|
path: `${this.base()}/delivery-times`,
|
|
@@ -4531,7 +4693,7 @@ var ShippingService = class {
|
|
|
4531
4693
|
});
|
|
4532
4694
|
}
|
|
4533
4695
|
/** Create multiple delivery times (`POST /delivery-times/bulk`). */
|
|
4534
|
-
async createDeliveryTimesBulk(inputs, auth2 =
|
|
4696
|
+
async createDeliveryTimesBulk(inputs, auth2 = SERVICE19) {
|
|
4535
4697
|
return this.ctx.http.request({
|
|
4536
4698
|
method: "POST",
|
|
4537
4699
|
path: `${this.base()}/delivery-times/bulk`,
|
|
@@ -4540,7 +4702,7 @@ var ShippingService = class {
|
|
|
4540
4702
|
});
|
|
4541
4703
|
}
|
|
4542
4704
|
/** Replace a delivery time. */
|
|
4543
|
-
async updateDeliveryTime(deliveryTimeId, input, auth2 =
|
|
4705
|
+
async updateDeliveryTime(deliveryTimeId, input, auth2 = SERVICE19) {
|
|
4544
4706
|
await this.ctx.http.request({
|
|
4545
4707
|
method: "PUT",
|
|
4546
4708
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4549,7 +4711,7 @@ var ShippingService = class {
|
|
|
4549
4711
|
});
|
|
4550
4712
|
}
|
|
4551
4713
|
/** Partially update a delivery time (JSON-Patch op array). */
|
|
4552
|
-
async patchDeliveryTime(deliveryTimeId, ops, auth2 =
|
|
4714
|
+
async patchDeliveryTime(deliveryTimeId, ops, auth2 = SERVICE19) {
|
|
4553
4715
|
await this.ctx.http.request({
|
|
4554
4716
|
method: "PATCH",
|
|
4555
4717
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4558,7 +4720,7 @@ var ShippingService = class {
|
|
|
4558
4720
|
});
|
|
4559
4721
|
}
|
|
4560
4722
|
/** Delete a delivery time. */
|
|
4561
|
-
async deleteDeliveryTime(deliveryTimeId, auth2 =
|
|
4723
|
+
async deleteDeliveryTime(deliveryTimeId, auth2 = SERVICE19) {
|
|
4562
4724
|
await this.ctx.http.request({
|
|
4563
4725
|
method: "DELETE",
|
|
4564
4726
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -4567,7 +4729,7 @@ var ShippingService = class {
|
|
|
4567
4729
|
}
|
|
4568
4730
|
// --- Phase 2: delivery time slots ---
|
|
4569
4731
|
/** List slots of a delivery time. */
|
|
4570
|
-
async listSlots(deliveryTimeId, auth2 =
|
|
4732
|
+
async listSlots(deliveryTimeId, auth2 = SERVICE19) {
|
|
4571
4733
|
return this.ctx.http.request({
|
|
4572
4734
|
method: "GET",
|
|
4573
4735
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4575,7 +4737,7 @@ var ShippingService = class {
|
|
|
4575
4737
|
});
|
|
4576
4738
|
}
|
|
4577
4739
|
/** Retrieve one slot. */
|
|
4578
|
-
async getSlot(deliveryTimeId, slotId, auth2 =
|
|
4740
|
+
async getSlot(deliveryTimeId, slotId, auth2 = SERVICE19) {
|
|
4579
4741
|
return this.ctx.http.request({
|
|
4580
4742
|
method: "GET",
|
|
4581
4743
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4583,7 +4745,7 @@ var ShippingService = class {
|
|
|
4583
4745
|
});
|
|
4584
4746
|
}
|
|
4585
4747
|
/** Create a slot in a delivery time. */
|
|
4586
|
-
async createSlot(deliveryTimeId, input, auth2 =
|
|
4748
|
+
async createSlot(deliveryTimeId, input, auth2 = SERVICE19) {
|
|
4587
4749
|
return this.ctx.http.request({
|
|
4588
4750
|
method: "POST",
|
|
4589
4751
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4592,7 +4754,7 @@ var ShippingService = class {
|
|
|
4592
4754
|
});
|
|
4593
4755
|
}
|
|
4594
4756
|
/** Replace a slot. */
|
|
4595
|
-
async updateSlot(deliveryTimeId, slotId, input, auth2 =
|
|
4757
|
+
async updateSlot(deliveryTimeId, slotId, input, auth2 = SERVICE19) {
|
|
4596
4758
|
await this.ctx.http.request({
|
|
4597
4759
|
method: "PUT",
|
|
4598
4760
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4601,7 +4763,7 @@ var ShippingService = class {
|
|
|
4601
4763
|
});
|
|
4602
4764
|
}
|
|
4603
4765
|
/** Partially update a slot (JSON-Patch op array). */
|
|
4604
|
-
async patchSlot(deliveryTimeId, slotId, ops, auth2 =
|
|
4766
|
+
async patchSlot(deliveryTimeId, slotId, ops, auth2 = SERVICE19) {
|
|
4605
4767
|
await this.ctx.http.request({
|
|
4606
4768
|
method: "PATCH",
|
|
4607
4769
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4610,7 +4772,7 @@ var ShippingService = class {
|
|
|
4610
4772
|
});
|
|
4611
4773
|
}
|
|
4612
4774
|
/** Delete a slot. */
|
|
4613
|
-
async deleteSlot(deliveryTimeId, slotId, auth2 =
|
|
4775
|
+
async deleteSlot(deliveryTimeId, slotId, auth2 = SERVICE19) {
|
|
4614
4776
|
await this.ctx.http.request({
|
|
4615
4777
|
method: "DELETE",
|
|
4616
4778
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -4618,7 +4780,7 @@ var ShippingService = class {
|
|
|
4618
4780
|
});
|
|
4619
4781
|
}
|
|
4620
4782
|
/** Delete all slots of a delivery time. */
|
|
4621
|
-
async deleteAllSlots(deliveryTimeId, auth2 =
|
|
4783
|
+
async deleteAllSlots(deliveryTimeId, auth2 = SERVICE19) {
|
|
4622
4784
|
await this.ctx.http.request({
|
|
4623
4785
|
method: "DELETE",
|
|
4624
4786
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -4627,7 +4789,7 @@ var ShippingService = class {
|
|
|
4627
4789
|
}
|
|
4628
4790
|
// --- Phase 2: delivery cycles ---
|
|
4629
4791
|
/** Generate a delivery cycle (`POST /delivery-cycles/generate`). Returns the cycle id. */
|
|
4630
|
-
async generateDeliveryCycle(input, auth2 =
|
|
4792
|
+
async generateDeliveryCycle(input, auth2 = SERVICE19) {
|
|
4631
4793
|
return this.ctx.http.request({
|
|
4632
4794
|
method: "POST",
|
|
4633
4795
|
path: `${this.base()}/delivery-cycles/generate`,
|
|
@@ -4638,7 +4800,7 @@ var ShippingService = class {
|
|
|
4638
4800
|
};
|
|
4639
4801
|
|
|
4640
4802
|
// src/services/returns.ts
|
|
4641
|
-
var
|
|
4803
|
+
var SERVICE20 = { kind: "service" };
|
|
4642
4804
|
var ReturnsService = class {
|
|
4643
4805
|
constructor(ctx) {
|
|
4644
4806
|
this.ctx = ctx;
|
|
@@ -4649,7 +4811,7 @@ var ReturnsService = class {
|
|
|
4649
4811
|
return `/return/${this.ctx.tenant}/returns`;
|
|
4650
4812
|
}
|
|
4651
4813
|
/** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
|
|
4652
|
-
async listReturns(query = {}, auth2 =
|
|
4814
|
+
async listReturns(query = {}, auth2 = SERVICE20) {
|
|
4653
4815
|
return this.ctx.http.request({
|
|
4654
4816
|
method: "GET",
|
|
4655
4817
|
path: this.base(),
|
|
@@ -4658,7 +4820,7 @@ var ReturnsService = class {
|
|
|
4658
4820
|
});
|
|
4659
4821
|
}
|
|
4660
4822
|
/** Retrieve one return by id. */
|
|
4661
|
-
async getReturn(returnId, auth2 =
|
|
4823
|
+
async getReturn(returnId, auth2 = SERVICE20) {
|
|
4662
4824
|
return this.ctx.http.request({
|
|
4663
4825
|
method: "GET",
|
|
4664
4826
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4666,7 +4828,7 @@ var ReturnsService = class {
|
|
|
4666
4828
|
});
|
|
4667
4829
|
}
|
|
4668
4830
|
/** Create a return. Returns the created `{ id }`. */
|
|
4669
|
-
async createReturn(input, auth2 =
|
|
4831
|
+
async createReturn(input, auth2 = SERVICE20) {
|
|
4670
4832
|
return this.ctx.http.request({
|
|
4671
4833
|
method: "POST",
|
|
4672
4834
|
path: this.base(),
|
|
@@ -4675,7 +4837,7 @@ var ReturnsService = class {
|
|
|
4675
4837
|
});
|
|
4676
4838
|
}
|
|
4677
4839
|
/** Replace a return by id (`PUT`). */
|
|
4678
|
-
async updateReturn(returnId, input, auth2 =
|
|
4840
|
+
async updateReturn(returnId, input, auth2 = SERVICE20) {
|
|
4679
4841
|
await this.ctx.http.request({
|
|
4680
4842
|
method: "PUT",
|
|
4681
4843
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4684,7 +4846,7 @@ var ReturnsService = class {
|
|
|
4684
4846
|
});
|
|
4685
4847
|
}
|
|
4686
4848
|
/** Partially update a return by id (`PATCH`, JSON-Patch op-array). */
|
|
4687
|
-
async patchReturn(returnId, ops, auth2 =
|
|
4849
|
+
async patchReturn(returnId, ops, auth2 = SERVICE20) {
|
|
4688
4850
|
await this.ctx.http.request({
|
|
4689
4851
|
method: "PATCH",
|
|
4690
4852
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4693,7 +4855,7 @@ var ReturnsService = class {
|
|
|
4693
4855
|
});
|
|
4694
4856
|
}
|
|
4695
4857
|
/** Delete a return by id. */
|
|
4696
|
-
async deleteReturn(returnId, auth2 =
|
|
4858
|
+
async deleteReturn(returnId, auth2 = SERVICE20) {
|
|
4697
4859
|
await this.ctx.http.request({
|
|
4698
4860
|
method: "DELETE",
|
|
4699
4861
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -4703,7 +4865,7 @@ var ReturnsService = class {
|
|
|
4703
4865
|
};
|
|
4704
4866
|
|
|
4705
4867
|
// src/services/sepa-export.ts
|
|
4706
|
-
var
|
|
4868
|
+
var SERVICE21 = { kind: "service" };
|
|
4707
4869
|
var SepaExportService = class {
|
|
4708
4870
|
constructor(ctx) {
|
|
4709
4871
|
this.ctx = ctx;
|
|
@@ -4714,7 +4876,7 @@ var SepaExportService = class {
|
|
|
4714
4876
|
return `/sepa-export/${this.ctx.tenant}`;
|
|
4715
4877
|
}
|
|
4716
4878
|
/** Retrieve a SEPA export file by id. Returns the raw file content (text). */
|
|
4717
|
-
async getFile(fileId, auth2 =
|
|
4879
|
+
async getFile(fileId, auth2 = SERVICE21) {
|
|
4718
4880
|
const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
|
|
4719
4881
|
const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
|
|
4720
4882
|
if (!res.ok) {
|
|
@@ -4724,7 +4886,7 @@ var SepaExportService = class {
|
|
|
4724
4886
|
return res.text();
|
|
4725
4887
|
}
|
|
4726
4888
|
/** List export jobs. */
|
|
4727
|
-
async listJobs(query = {}, auth2 =
|
|
4889
|
+
async listJobs(query = {}, auth2 = SERVICE21) {
|
|
4728
4890
|
return this.ctx.http.request({
|
|
4729
4891
|
method: "GET",
|
|
4730
4892
|
path: `${this.base()}/jobs`,
|
|
@@ -4733,7 +4895,7 @@ var SepaExportService = class {
|
|
|
4733
4895
|
});
|
|
4734
4896
|
}
|
|
4735
4897
|
/** Create an export job. */
|
|
4736
|
-
async createJob(input, auth2 =
|
|
4898
|
+
async createJob(input, auth2 = SERVICE21) {
|
|
4737
4899
|
return this.ctx.http.request({
|
|
4738
4900
|
method: "POST",
|
|
4739
4901
|
path: `${this.base()}/jobs`,
|
|
@@ -4744,7 +4906,7 @@ var SepaExportService = class {
|
|
|
4744
4906
|
};
|
|
4745
4907
|
|
|
4746
4908
|
// src/services/indexing.ts
|
|
4747
|
-
var
|
|
4909
|
+
var SERVICE22 = { kind: "service" };
|
|
4748
4910
|
var IndexingService = class {
|
|
4749
4911
|
constructor(ctx) {
|
|
4750
4912
|
this.ctx = ctx;
|
|
@@ -4755,11 +4917,11 @@ var IndexingService = class {
|
|
|
4755
4917
|
return `/indexing/${this.ctx.tenant}`;
|
|
4756
4918
|
}
|
|
4757
4919
|
/** List indexing configurations. */
|
|
4758
|
-
async listConfigurations(auth2 =
|
|
4920
|
+
async listConfigurations(auth2 = SERVICE22) {
|
|
4759
4921
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
|
|
4760
4922
|
}
|
|
4761
4923
|
/** Get a configuration by provider name. */
|
|
4762
|
-
async getConfiguration(provider, auth2 =
|
|
4924
|
+
async getConfiguration(provider, auth2 = SERVICE22) {
|
|
4763
4925
|
return this.ctx.http.request({
|
|
4764
4926
|
method: "GET",
|
|
4765
4927
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4767,7 +4929,7 @@ var IndexingService = class {
|
|
|
4767
4929
|
});
|
|
4768
4930
|
}
|
|
4769
4931
|
/** Create a configuration. */
|
|
4770
|
-
async createConfiguration(input, auth2 =
|
|
4932
|
+
async createConfiguration(input, auth2 = SERVICE22) {
|
|
4771
4933
|
return this.ctx.http.request({
|
|
4772
4934
|
method: "POST",
|
|
4773
4935
|
path: `${this.base()}/configurations`,
|
|
@@ -4776,7 +4938,7 @@ var IndexingService = class {
|
|
|
4776
4938
|
});
|
|
4777
4939
|
}
|
|
4778
4940
|
/** Update a configuration by provider name. */
|
|
4779
|
-
async updateConfiguration(provider, input, auth2 =
|
|
4941
|
+
async updateConfiguration(provider, input, auth2 = SERVICE22) {
|
|
4780
4942
|
await this.ctx.http.request({
|
|
4781
4943
|
method: "PUT",
|
|
4782
4944
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4785,7 +4947,7 @@ var IndexingService = class {
|
|
|
4785
4947
|
});
|
|
4786
4948
|
}
|
|
4787
4949
|
/** Delete a configuration by provider name. */
|
|
4788
|
-
async deleteConfiguration(provider, auth2 =
|
|
4950
|
+
async deleteConfiguration(provider, auth2 = SERVICE22) {
|
|
4789
4951
|
await this.ctx.http.request({
|
|
4790
4952
|
method: "DELETE",
|
|
4791
4953
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4793,11 +4955,11 @@ var IndexingService = class {
|
|
|
4793
4955
|
});
|
|
4794
4956
|
}
|
|
4795
4957
|
/** List public indexing configurations. */
|
|
4796
|
-
async listPublicConfigurations(auth2 =
|
|
4958
|
+
async listPublicConfigurations(auth2 = SERVICE22) {
|
|
4797
4959
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
|
|
4798
4960
|
}
|
|
4799
4961
|
/** Get a public configuration by provider name. */
|
|
4800
|
-
async getPublicConfiguration(provider, auth2 =
|
|
4962
|
+
async getPublicConfiguration(provider, auth2 = SERVICE22) {
|
|
4801
4963
|
return this.ctx.http.request({
|
|
4802
4964
|
method: "GET",
|
|
4803
4965
|
path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -4810,7 +4972,7 @@ var IndexingService = class {
|
|
|
4810
4972
|
* (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
|
|
4811
4973
|
* `entityType` is already `IN_PROGRESS`, that running job (`200`).
|
|
4812
4974
|
*/
|
|
4813
|
-
async createReindexJob(input, auth2 =
|
|
4975
|
+
async createReindexJob(input, auth2 = SERVICE22) {
|
|
4814
4976
|
return this.ctx.http.request({
|
|
4815
4977
|
method: "POST",
|
|
4816
4978
|
path: `${this.base()}/reindex-jobs`,
|
|
@@ -4819,7 +4981,7 @@ var IndexingService = class {
|
|
|
4819
4981
|
});
|
|
4820
4982
|
}
|
|
4821
4983
|
/** List reindex jobs (paginated). */
|
|
4822
|
-
async listReindexJobs(opts = {}, auth2 =
|
|
4984
|
+
async listReindexJobs(opts = {}, auth2 = SERVICE22) {
|
|
4823
4985
|
const pageNumber = opts.pageNumber ?? 1;
|
|
4824
4986
|
const pageSize = opts.pageSize ?? 50;
|
|
4825
4987
|
const query = { pageNumber, pageSize };
|
|
@@ -4833,7 +4995,7 @@ var IndexingService = class {
|
|
|
4833
4995
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
4834
4996
|
}
|
|
4835
4997
|
/** Fetch one reindex job by id. */
|
|
4836
|
-
async getReindexJob(reindexJobId, auth2 =
|
|
4998
|
+
async getReindexJob(reindexJobId, auth2 = SERVICE22) {
|
|
4837
4999
|
return this.ctx.http.request({
|
|
4838
5000
|
method: "GET",
|
|
4839
5001
|
path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
|
|
@@ -4845,13 +5007,13 @@ var IndexingService = class {
|
|
|
4845
5007
|
* @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
|
|
4846
5008
|
* (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
|
|
4847
5009
|
*/
|
|
4848
|
-
async reindex(input, auth2 =
|
|
5010
|
+
async reindex(input, auth2 = SERVICE22) {
|
|
4849
5011
|
await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
|
|
4850
5012
|
}
|
|
4851
5013
|
};
|
|
4852
5014
|
|
|
4853
5015
|
// src/services/unit-handling.ts
|
|
4854
|
-
var
|
|
5016
|
+
var SERVICE23 = { kind: "service" };
|
|
4855
5017
|
var UnitHandlingService = class {
|
|
4856
5018
|
constructor(ctx) {
|
|
4857
5019
|
this.ctx = ctx;
|
|
@@ -4862,7 +5024,7 @@ var UnitHandlingService = class {
|
|
|
4862
5024
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
4863
5025
|
}
|
|
4864
5026
|
/** Find units (filter/sort/page). */
|
|
4865
|
-
async listUnits(query = {}, auth2 =
|
|
5027
|
+
async listUnits(query = {}, auth2 = SERVICE23) {
|
|
4866
5028
|
return this.ctx.http.request({
|
|
4867
5029
|
method: "GET",
|
|
4868
5030
|
path: `${this.base()}/units`,
|
|
@@ -4871,7 +5033,7 @@ var UnitHandlingService = class {
|
|
|
4871
5033
|
});
|
|
4872
5034
|
}
|
|
4873
5035
|
/** Retrieve a unit by code. */
|
|
4874
|
-
async getUnit(unitCode, auth2 =
|
|
5036
|
+
async getUnit(unitCode, auth2 = SERVICE23) {
|
|
4875
5037
|
return this.ctx.http.request({
|
|
4876
5038
|
method: "GET",
|
|
4877
5039
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -4879,11 +5041,11 @@ var UnitHandlingService = class {
|
|
|
4879
5041
|
});
|
|
4880
5042
|
}
|
|
4881
5043
|
/** Add a new unit. */
|
|
4882
|
-
async createUnit(input, auth2 =
|
|
5044
|
+
async createUnit(input, auth2 = SERVICE23) {
|
|
4883
5045
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
4884
5046
|
}
|
|
4885
5047
|
/** Update a unit by code. */
|
|
4886
|
-
async updateUnit(unitCode, input, auth2 =
|
|
5048
|
+
async updateUnit(unitCode, input, auth2 = SERVICE23) {
|
|
4887
5049
|
await this.ctx.http.request({
|
|
4888
5050
|
method: "PUT",
|
|
4889
5051
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -4892,7 +5054,7 @@ var UnitHandlingService = class {
|
|
|
4892
5054
|
});
|
|
4893
5055
|
}
|
|
4894
5056
|
/** Delete a unit by code. */
|
|
4895
|
-
async deleteUnit(unitCode, auth2 =
|
|
5057
|
+
async deleteUnit(unitCode, auth2 = SERVICE23) {
|
|
4896
5058
|
await this.ctx.http.request({
|
|
4897
5059
|
method: "DELETE",
|
|
4898
5060
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -4900,7 +5062,7 @@ var UnitHandlingService = class {
|
|
|
4900
5062
|
});
|
|
4901
5063
|
}
|
|
4902
5064
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
4903
|
-
async deleteUnits(codes, auth2 =
|
|
5065
|
+
async deleteUnits(codes, auth2 = SERVICE23) {
|
|
4904
5066
|
await this.ctx.http.request({
|
|
4905
5067
|
method: "DELETE",
|
|
4906
5068
|
path: `${this.base()}/units`,
|
|
@@ -4909,7 +5071,7 @@ var UnitHandlingService = class {
|
|
|
4909
5071
|
});
|
|
4910
5072
|
}
|
|
4911
5073
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
4912
|
-
async getConversionFactor(input, auth2 =
|
|
5074
|
+
async getConversionFactor(input, auth2 = SERVICE23) {
|
|
4913
5075
|
return this.ctx.http.request({
|
|
4914
5076
|
method: "PUT",
|
|
4915
5077
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -4918,7 +5080,7 @@ var UnitHandlingService = class {
|
|
|
4918
5080
|
});
|
|
4919
5081
|
}
|
|
4920
5082
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
4921
|
-
async convertUnit(input, auth2 =
|
|
5083
|
+
async convertUnit(input, auth2 = SERVICE23) {
|
|
4922
5084
|
return this.ctx.http.request({
|
|
4923
5085
|
method: "PUT",
|
|
4924
5086
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -4927,13 +5089,13 @@ var UnitHandlingService = class {
|
|
|
4927
5089
|
});
|
|
4928
5090
|
}
|
|
4929
5091
|
/** List all unit types. */
|
|
4930
|
-
async listUnitTypes(auth2 =
|
|
5092
|
+
async listUnitTypes(auth2 = SERVICE23) {
|
|
4931
5093
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
4932
5094
|
}
|
|
4933
5095
|
};
|
|
4934
5096
|
|
|
4935
5097
|
// src/services/catalog.ts
|
|
4936
|
-
var
|
|
5098
|
+
var SERVICE24 = { kind: "service" };
|
|
4937
5099
|
var CatalogService = class {
|
|
4938
5100
|
constructor(ctx) {
|
|
4939
5101
|
this.ctx = ctx;
|
|
@@ -4944,7 +5106,7 @@ var CatalogService = class {
|
|
|
4944
5106
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
4945
5107
|
}
|
|
4946
5108
|
/** List catalogs (filtered/sorted). */
|
|
4947
|
-
async listCatalogs(query = {}, auth2 =
|
|
5109
|
+
async listCatalogs(query = {}, auth2 = SERVICE24) {
|
|
4948
5110
|
return this.ctx.http.request({
|
|
4949
5111
|
method: "GET",
|
|
4950
5112
|
path: this.base(),
|
|
@@ -4953,7 +5115,7 @@ var CatalogService = class {
|
|
|
4953
5115
|
});
|
|
4954
5116
|
}
|
|
4955
5117
|
/** Retrieve a catalog by id. */
|
|
4956
|
-
async getCatalog(catalogId, auth2 =
|
|
5118
|
+
async getCatalog(catalogId, auth2 = SERVICE24) {
|
|
4957
5119
|
return this.ctx.http.request({
|
|
4958
5120
|
method: "GET",
|
|
4959
5121
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4961,7 +5123,7 @@ var CatalogService = class {
|
|
|
4961
5123
|
});
|
|
4962
5124
|
}
|
|
4963
5125
|
/** Retrieve all catalogs that contain a category. */
|
|
4964
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
5126
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE24) {
|
|
4965
5127
|
return this.ctx.http.request({
|
|
4966
5128
|
method: "GET",
|
|
4967
5129
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -4969,11 +5131,11 @@ var CatalogService = class {
|
|
|
4969
5131
|
});
|
|
4970
5132
|
}
|
|
4971
5133
|
/** Create a catalog. */
|
|
4972
|
-
async createCatalog(input, auth2 =
|
|
5134
|
+
async createCatalog(input, auth2 = SERVICE24) {
|
|
4973
5135
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
4974
5136
|
}
|
|
4975
5137
|
/** Upsert a catalog by id (`PUT`). */
|
|
4976
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
5138
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE24) {
|
|
4977
5139
|
return this.ctx.http.request({
|
|
4978
5140
|
method: "PUT",
|
|
4979
5141
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4982,7 +5144,7 @@ var CatalogService = class {
|
|
|
4982
5144
|
});
|
|
4983
5145
|
}
|
|
4984
5146
|
/** Partially update a catalog by id (`PATCH`). */
|
|
4985
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
5147
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE24) {
|
|
4986
5148
|
await this.ctx.http.request({
|
|
4987
5149
|
method: "PATCH",
|
|
4988
5150
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -4991,7 +5153,7 @@ var CatalogService = class {
|
|
|
4991
5153
|
});
|
|
4992
5154
|
}
|
|
4993
5155
|
/** Remove a catalog by id. */
|
|
4994
|
-
async deleteCatalog(catalogId, auth2 =
|
|
5156
|
+
async deleteCatalog(catalogId, auth2 = SERVICE24) {
|
|
4995
5157
|
await this.ctx.http.request({
|
|
4996
5158
|
method: "DELETE",
|
|
4997
5159
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -5001,7 +5163,7 @@ var CatalogService = class {
|
|
|
5001
5163
|
};
|
|
5002
5164
|
|
|
5003
5165
|
// src/services/vendor.ts
|
|
5004
|
-
var
|
|
5166
|
+
var SERVICE25 = { kind: "service" };
|
|
5005
5167
|
var VendorService = class {
|
|
5006
5168
|
constructor(ctx) {
|
|
5007
5169
|
this.ctx = ctx;
|
|
@@ -5013,7 +5175,7 @@ var VendorService = class {
|
|
|
5013
5175
|
}
|
|
5014
5176
|
// --- Vendors ---
|
|
5015
5177
|
/** List all vendors. */
|
|
5016
|
-
async listVendors(query = {}, auth2 =
|
|
5178
|
+
async listVendors(query = {}, auth2 = SERVICE25) {
|
|
5017
5179
|
return this.ctx.http.request({
|
|
5018
5180
|
method: "GET",
|
|
5019
5181
|
path: `${this.base()}/vendors`,
|
|
@@ -5022,7 +5184,7 @@ var VendorService = class {
|
|
|
5022
5184
|
});
|
|
5023
5185
|
}
|
|
5024
5186
|
/** Retrieve a vendor by id. */
|
|
5025
|
-
async getVendor(vendorId, auth2 =
|
|
5187
|
+
async getVendor(vendorId, auth2 = SERVICE25) {
|
|
5026
5188
|
return this.ctx.http.request({
|
|
5027
5189
|
method: "GET",
|
|
5028
5190
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5030,7 +5192,7 @@ var VendorService = class {
|
|
|
5030
5192
|
});
|
|
5031
5193
|
}
|
|
5032
5194
|
/** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
|
|
5033
|
-
async searchVendors(query, auth2 =
|
|
5195
|
+
async searchVendors(query, auth2 = SERVICE25) {
|
|
5034
5196
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5035
5197
|
return this.ctx.http.request({
|
|
5036
5198
|
method: "POST",
|
|
@@ -5040,11 +5202,11 @@ var VendorService = class {
|
|
|
5040
5202
|
});
|
|
5041
5203
|
}
|
|
5042
5204
|
/** Create a vendor. */
|
|
5043
|
-
async createVendor(input, auth2 =
|
|
5205
|
+
async createVendor(input, auth2 = SERVICE25) {
|
|
5044
5206
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
5045
5207
|
}
|
|
5046
5208
|
/** Upsert a vendor by id (`PUT`). */
|
|
5047
|
-
async updateVendor(vendorId, input, auth2 =
|
|
5209
|
+
async updateVendor(vendorId, input, auth2 = SERVICE25) {
|
|
5048
5210
|
await this.ctx.http.request({
|
|
5049
5211
|
method: "PUT",
|
|
5050
5212
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5053,7 +5215,7 @@ var VendorService = class {
|
|
|
5053
5215
|
});
|
|
5054
5216
|
}
|
|
5055
5217
|
/** Delete a vendor by id. */
|
|
5056
|
-
async deleteVendor(vendorId, auth2 =
|
|
5218
|
+
async deleteVendor(vendorId, auth2 = SERVICE25) {
|
|
5057
5219
|
await this.ctx.http.request({
|
|
5058
5220
|
method: "DELETE",
|
|
5059
5221
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -5062,7 +5224,7 @@ var VendorService = class {
|
|
|
5062
5224
|
}
|
|
5063
5225
|
// --- Vendor locations ---
|
|
5064
5226
|
/** List all vendor locations. */
|
|
5065
|
-
async listVendorLocations(query = {}, auth2 =
|
|
5227
|
+
async listVendorLocations(query = {}, auth2 = SERVICE25) {
|
|
5066
5228
|
return this.ctx.http.request({
|
|
5067
5229
|
method: "GET",
|
|
5068
5230
|
path: `${this.base()}/locations`,
|
|
@@ -5071,7 +5233,7 @@ var VendorService = class {
|
|
|
5071
5233
|
});
|
|
5072
5234
|
}
|
|
5073
5235
|
/** Retrieve a vendor location by id. */
|
|
5074
|
-
async getVendorLocation(locationId, auth2 =
|
|
5236
|
+
async getVendorLocation(locationId, auth2 = SERVICE25) {
|
|
5075
5237
|
return this.ctx.http.request({
|
|
5076
5238
|
method: "GET",
|
|
5077
5239
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5079,11 +5241,11 @@ var VendorService = class {
|
|
|
5079
5241
|
});
|
|
5080
5242
|
}
|
|
5081
5243
|
/** Create a vendor location. */
|
|
5082
|
-
async createVendorLocation(input, auth2 =
|
|
5244
|
+
async createVendorLocation(input, auth2 = SERVICE25) {
|
|
5083
5245
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
5084
5246
|
}
|
|
5085
5247
|
/** Upsert a vendor location by id (`PUT`). */
|
|
5086
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
5248
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE25) {
|
|
5087
5249
|
await this.ctx.http.request({
|
|
5088
5250
|
method: "PUT",
|
|
5089
5251
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5092,7 +5254,7 @@ var VendorService = class {
|
|
|
5092
5254
|
});
|
|
5093
5255
|
}
|
|
5094
5256
|
/** Delete a vendor location by id. */
|
|
5095
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
5257
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE25) {
|
|
5096
5258
|
await this.ctx.http.request({
|
|
5097
5259
|
method: "DELETE",
|
|
5098
5260
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -5102,7 +5264,7 @@ var VendorService = class {
|
|
|
5102
5264
|
};
|
|
5103
5265
|
|
|
5104
5266
|
// src/services/pick-pack.ts
|
|
5105
|
-
var
|
|
5267
|
+
var SERVICE26 = { kind: "service" };
|
|
5106
5268
|
var PickPackService = class {
|
|
5107
5269
|
constructor(ctx) {
|
|
5108
5270
|
this.ctx = ctx;
|
|
@@ -5116,7 +5278,7 @@ var PickPackService = class {
|
|
|
5116
5278
|
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
5117
5279
|
}
|
|
5118
5280
|
/** List packlist orders. */
|
|
5119
|
-
async listOrders(query = {}, auth2 =
|
|
5281
|
+
async listOrders(query = {}, auth2 = SERVICE26) {
|
|
5120
5282
|
return this.ctx.http.request({
|
|
5121
5283
|
method: "GET",
|
|
5122
5284
|
path: `${this.base()}/orders`,
|
|
@@ -5125,19 +5287,19 @@ var PickPackService = class {
|
|
|
5125
5287
|
});
|
|
5126
5288
|
}
|
|
5127
5289
|
/** Retrieve a packlist order by id. */
|
|
5128
|
-
async getOrder(orderId, auth2 =
|
|
5290
|
+
async getOrder(orderId, auth2 = SERVICE26) {
|
|
5129
5291
|
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
5130
5292
|
}
|
|
5131
5293
|
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
5132
|
-
async updateOrder(orderId, change, auth2 =
|
|
5294
|
+
async updateOrder(orderId, change, auth2 = SERVICE26) {
|
|
5133
5295
|
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
5134
5296
|
}
|
|
5135
5297
|
/** Finish an order. Returns an acknowledgement. */
|
|
5136
|
-
async finishOrder(orderId, auth2 =
|
|
5298
|
+
async finishOrder(orderId, auth2 = SERVICE26) {
|
|
5137
5299
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
5138
5300
|
}
|
|
5139
5301
|
/** List order cycles (ids). */
|
|
5140
|
-
async listOrderCycles(query = {}, auth2 =
|
|
5302
|
+
async listOrderCycles(query = {}, auth2 = SERVICE26) {
|
|
5141
5303
|
return this.ctx.http.request({
|
|
5142
5304
|
method: "GET",
|
|
5143
5305
|
path: `${this.base()}/orderCycles`,
|
|
@@ -5146,11 +5308,11 @@ var PickPackService = class {
|
|
|
5146
5308
|
});
|
|
5147
5309
|
}
|
|
5148
5310
|
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
5149
|
-
async addAssignee(orderId, assignee, auth2 =
|
|
5311
|
+
async addAssignee(orderId, assignee, auth2 = SERVICE26) {
|
|
5150
5312
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
5151
5313
|
}
|
|
5152
5314
|
/** Remove an assignee from an order. */
|
|
5153
|
-
async removeAssignee(orderId, assigneeId, auth2 =
|
|
5315
|
+
async removeAssignee(orderId, assigneeId, auth2 = SERVICE26) {
|
|
5154
5316
|
await this.ctx.http.request({
|
|
5155
5317
|
method: "DELETE",
|
|
5156
5318
|
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
@@ -5158,15 +5320,15 @@ var PickPackService = class {
|
|
|
5158
5320
|
});
|
|
5159
5321
|
}
|
|
5160
5322
|
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
5161
|
-
async updatePackaging(orderId, change, auth2 =
|
|
5323
|
+
async updatePackaging(orderId, change, auth2 = SERVICE26) {
|
|
5162
5324
|
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
5163
5325
|
}
|
|
5164
5326
|
/** Create a packing event. Returns an acknowledgement. */
|
|
5165
|
-
async createEvent(event, auth2 =
|
|
5327
|
+
async createEvent(event, auth2 = SERVICE26) {
|
|
5166
5328
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
5167
5329
|
}
|
|
5168
5330
|
/** List packing events. */
|
|
5169
|
-
async listEvents(query = {}, auth2 =
|
|
5331
|
+
async listEvents(query = {}, auth2 = SERVICE26) {
|
|
5170
5332
|
return this.ctx.http.request({
|
|
5171
5333
|
method: "GET",
|
|
5172
5334
|
path: `${this.base()}/events`,
|
|
@@ -5175,7 +5337,7 @@ var PickPackService = class {
|
|
|
5175
5337
|
});
|
|
5176
5338
|
}
|
|
5177
5339
|
/** Trigger an order recalculation. Returns the created job's id. */
|
|
5178
|
-
async triggerRecalculation(input, auth2 =
|
|
5340
|
+
async triggerRecalculation(input, auth2 = SERVICE26) {
|
|
5179
5341
|
return this.ctx.http.request({
|
|
5180
5342
|
method: "POST",
|
|
5181
5343
|
path: `${this.base()}/jobs/recalculations`,
|
|
@@ -5184,7 +5346,7 @@ var PickPackService = class {
|
|
|
5184
5346
|
});
|
|
5185
5347
|
}
|
|
5186
5348
|
/** Retrieve a recalculation job by id. */
|
|
5187
|
-
async getRecalculationJob(jobId, auth2 =
|
|
5349
|
+
async getRecalculationJob(jobId, auth2 = SERVICE26) {
|
|
5188
5350
|
return this.ctx.http.request({
|
|
5189
5351
|
method: "GET",
|
|
5190
5352
|
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
@@ -5194,7 +5356,7 @@ var PickPackService = class {
|
|
|
5194
5356
|
};
|
|
5195
5357
|
|
|
5196
5358
|
// src/services/customer-admin.ts
|
|
5197
|
-
var
|
|
5359
|
+
var SERVICE27 = { kind: "service" };
|
|
5198
5360
|
var CustomerAdminService = class {
|
|
5199
5361
|
constructor(ctx) {
|
|
5200
5362
|
this.ctx = ctx;
|
|
@@ -5212,7 +5374,7 @@ var CustomerAdminService = class {
|
|
|
5212
5374
|
}
|
|
5213
5375
|
// --- Customers ---
|
|
5214
5376
|
/** List customers. */
|
|
5215
|
-
async listCustomers(query = {}, auth2 =
|
|
5377
|
+
async listCustomers(query = {}, auth2 = SERVICE27) {
|
|
5216
5378
|
return this.ctx.http.request({
|
|
5217
5379
|
method: "GET",
|
|
5218
5380
|
path: this.base(),
|
|
@@ -5221,33 +5383,33 @@ var CustomerAdminService = class {
|
|
|
5221
5383
|
});
|
|
5222
5384
|
}
|
|
5223
5385
|
/** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
|
|
5224
|
-
async searchCustomers(query, auth2 =
|
|
5386
|
+
async searchCustomers(query, auth2 = SERVICE27) {
|
|
5225
5387
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5226
5388
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
|
|
5227
5389
|
}
|
|
5228
5390
|
/** Retrieve a customer profile by number. */
|
|
5229
|
-
async getCustomer(customerNumber, auth2 =
|
|
5391
|
+
async getCustomer(customerNumber, auth2 = SERVICE27) {
|
|
5230
5392
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5231
5393
|
}
|
|
5232
5394
|
/** Create a customer. */
|
|
5233
|
-
async createCustomer(input, auth2 =
|
|
5395
|
+
async createCustomer(input, auth2 = SERVICE27) {
|
|
5234
5396
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
5235
5397
|
}
|
|
5236
5398
|
/** Upsert a customer profile by number (`PUT`). */
|
|
5237
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
5399
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE27) {
|
|
5238
5400
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
5239
5401
|
}
|
|
5240
5402
|
/** Partially update a customer profile (`PATCH`). */
|
|
5241
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
5403
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE27) {
|
|
5242
5404
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
5243
5405
|
}
|
|
5244
5406
|
/** Delete a customer profile. */
|
|
5245
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
5407
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE27) {
|
|
5246
5408
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5247
5409
|
}
|
|
5248
5410
|
// --- Addresses ---
|
|
5249
5411
|
/** List a customer's addresses. */
|
|
5250
|
-
async listAddresses(customerNumber, auth2 =
|
|
5412
|
+
async listAddresses(customerNumber, auth2 = SERVICE27) {
|
|
5251
5413
|
return this.ctx.http.request({
|
|
5252
5414
|
method: "GET",
|
|
5253
5415
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5255,11 +5417,11 @@ var CustomerAdminService = class {
|
|
|
5255
5417
|
});
|
|
5256
5418
|
}
|
|
5257
5419
|
/** Retrieve one address. */
|
|
5258
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
5420
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
5259
5421
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5260
5422
|
}
|
|
5261
5423
|
/** Add an address. */
|
|
5262
|
-
async addAddress(customerNumber, input, auth2 =
|
|
5424
|
+
async addAddress(customerNumber, input, auth2 = SERVICE27) {
|
|
5263
5425
|
return this.ctx.http.request({
|
|
5264
5426
|
method: "POST",
|
|
5265
5427
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5268,19 +5430,19 @@ var CustomerAdminService = class {
|
|
|
5268
5430
|
});
|
|
5269
5431
|
}
|
|
5270
5432
|
/** Upsert an address by id (`PUT`). */
|
|
5271
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
5433
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE27) {
|
|
5272
5434
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
5273
5435
|
}
|
|
5274
5436
|
/** Partially update an address by id (`PATCH`). */
|
|
5275
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
5437
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE27) {
|
|
5276
5438
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
5277
5439
|
}
|
|
5278
5440
|
/** Delete an address by id. */
|
|
5279
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
5441
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
5280
5442
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5281
5443
|
}
|
|
5282
5444
|
/** Add tags to an address (`?tags=` query). */
|
|
5283
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
5445
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
5284
5446
|
await this.ctx.http.request({
|
|
5285
5447
|
method: "POST",
|
|
5286
5448
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5289,7 +5451,7 @@ var CustomerAdminService = class {
|
|
|
5289
5451
|
});
|
|
5290
5452
|
}
|
|
5291
5453
|
/** Remove tags from an address (`?tags=` query). */
|
|
5292
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
5454
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
5293
5455
|
await this.ctx.http.request({
|
|
5294
5456
|
method: "DELETE",
|
|
5295
5457
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5300,7 +5462,7 @@ var CustomerAdminService = class {
|
|
|
5300
5462
|
};
|
|
5301
5463
|
|
|
5302
5464
|
// src/services/approval.ts
|
|
5303
|
-
var
|
|
5465
|
+
var SERVICE28 = { kind: "service" };
|
|
5304
5466
|
var ApprovalService = class {
|
|
5305
5467
|
constructor(ctx) {
|
|
5306
5468
|
this.ctx = ctx;
|
|
@@ -5311,7 +5473,7 @@ var ApprovalService = class {
|
|
|
5311
5473
|
return `/approval/${this.ctx.tenant}`;
|
|
5312
5474
|
}
|
|
5313
5475
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
5314
|
-
async listApprovals(query = {}, auth2 =
|
|
5476
|
+
async listApprovals(query = {}, auth2 = SERVICE28) {
|
|
5315
5477
|
return this.ctx.http.request({
|
|
5316
5478
|
method: "GET",
|
|
5317
5479
|
path: `${this.base()}/approvals`,
|
|
@@ -5320,7 +5482,7 @@ var ApprovalService = class {
|
|
|
5320
5482
|
});
|
|
5321
5483
|
}
|
|
5322
5484
|
/** Retrieve a single approval by id. */
|
|
5323
|
-
async getApproval(approvalId, auth2 =
|
|
5485
|
+
async getApproval(approvalId, auth2 = SERVICE28) {
|
|
5324
5486
|
return this.ctx.http.request({
|
|
5325
5487
|
method: "GET",
|
|
5326
5488
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5328,7 +5490,7 @@ var ApprovalService = class {
|
|
|
5328
5490
|
});
|
|
5329
5491
|
}
|
|
5330
5492
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
5331
|
-
async createApproval(input, auth2 =
|
|
5493
|
+
async createApproval(input, auth2 = SERVICE28) {
|
|
5332
5494
|
return this.ctx.http.request({
|
|
5333
5495
|
method: "POST",
|
|
5334
5496
|
path: `${this.base()}/approvals`,
|
|
@@ -5337,7 +5499,7 @@ var ApprovalService = class {
|
|
|
5337
5499
|
});
|
|
5338
5500
|
}
|
|
5339
5501
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
5340
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
5502
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE28) {
|
|
5341
5503
|
await this.ctx.http.request({
|
|
5342
5504
|
method: "PATCH",
|
|
5343
5505
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5346,7 +5508,7 @@ var ApprovalService = class {
|
|
|
5346
5508
|
});
|
|
5347
5509
|
}
|
|
5348
5510
|
/** Delete an approval by id. */
|
|
5349
|
-
async deleteApproval(approvalId, auth2 =
|
|
5511
|
+
async deleteApproval(approvalId, auth2 = SERVICE28) {
|
|
5350
5512
|
await this.ctx.http.request({
|
|
5351
5513
|
method: "DELETE",
|
|
5352
5514
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5354,7 +5516,7 @@ var ApprovalService = class {
|
|
|
5354
5516
|
});
|
|
5355
5517
|
}
|
|
5356
5518
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
5357
|
-
async checkPermitted(input, auth2 =
|
|
5519
|
+
async checkPermitted(input, auth2 = SERVICE28) {
|
|
5358
5520
|
return this.ctx.http.request({
|
|
5359
5521
|
method: "POST",
|
|
5360
5522
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -5363,7 +5525,7 @@ var ApprovalService = class {
|
|
|
5363
5525
|
});
|
|
5364
5526
|
}
|
|
5365
5527
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
5366
|
-
async searchApprovers(input, auth2 =
|
|
5528
|
+
async searchApprovers(input, auth2 = SERVICE28) {
|
|
5367
5529
|
return this.ctx.http.request({
|
|
5368
5530
|
method: "POST",
|
|
5369
5531
|
path: `${this.base()}/search/users`,
|