@viu/emporix-sdk 2.31.1 → 2.32.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 +48 -0
- package/dist/availability.cjs +44 -10
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +2 -1
- package/dist/availability.d.ts +2 -1
- package/dist/availability.js +2 -1
- package/dist/cart.d.cts +1 -1
- package/dist/cart.d.ts +1 -1
- package/dist/category.cjs +82 -28
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +10 -1
- package/dist/category.d.ts +10 -1
- package/dist/category.js +3 -2
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-W2KBVWJ2.js → chunk-3G5KROEC.js} +8 -2
- package/dist/chunk-3G5KROEC.js.map +1 -0
- package/dist/{chunk-7W22KLUL.js → chunk-JQWUGGRV.js} +32 -17
- package/dist/chunk-JQWUGGRV.js.map +1 -0
- package/dist/chunk-LKHKFF7B.js +30 -0
- package/dist/chunk-LKHKFF7B.js.map +1 -0
- package/dist/{chunk-D7HBM2DQ.js → chunk-MSQ3GEIW.js} +59 -31
- package/dist/chunk-MSQ3GEIW.js.map +1 -0
- package/dist/{chunk-P7G4LOOV.js → chunk-P3RANRGB.js} +47 -25
- package/dist/chunk-P3RANRGB.js.map +1 -0
- package/dist/{chunk-OTG2S2L4.js → chunk-TI56QENX.js} +14 -14
- package/dist/chunk-TI56QENX.js.map +1 -0
- package/dist/{chunk-GWJ2U2CP.js → chunk-W6SLZNRX.js} +2 -2
- package/dist/chunk-W6SLZNRX.js.map +1 -0
- package/dist/{chunk-V3275BA7.js → chunk-XQAOHHXL.js} +20 -12
- package/dist/chunk-XQAOHHXL.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-CpLIDl0P.d.cts → context-DK8jg6y5.d.cts} +48 -2
- package/dist/{context-CpLIDl0P.d.ts → context-DK8jg6y5.d.ts} +48 -2
- package/dist/{customer-groups-DJVbdrEP.d.cts → customer-groups-D0OCm8kJ.d.cts} +1 -1
- package/dist/{customer-groups-DhpCTCTg.d.ts → customer-groups-WSt4aT62.d.ts} +1 -1
- package/dist/customer-groups.d.cts +2 -2
- package/dist/customer-groups.d.ts +2 -2
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +343 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -7
- package/dist/index.d.ts +62 -7
- package/dist/index.js +169 -72
- package/dist/index.js.map +1 -1
- package/dist/locations.d.cts +1 -1
- package/dist/locations.d.ts +1 -1
- package/dist/media.cjs +38 -12
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +7 -2
- package/dist/media.d.ts +7 -2
- package/dist/media.js +2 -1
- package/dist/orders.cjs +71 -23
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +7 -1
- package/dist/orders.d.ts +7 -1
- package/dist/orders.js +2 -1
- package/dist/payment.d.cts +1 -1
- package/dist/payment.d.ts +1 -1
- package/dist/price.d.cts +1 -1
- package/dist/price.d.ts +1 -1
- package/dist/product.cjs +55 -14
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +4 -1
- package/dist/product.d.ts +4 -1
- package/dist/product.js +3 -2
- package/dist/segment.cjs +6 -0
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/dist/segment.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7W22KLUL.js.map +0 -1
- package/dist/chunk-D7HBM2DQ.js.map +0 -1
- package/dist/chunk-GWJ2U2CP.js.map +0 -1
- package/dist/chunk-OTG2S2L4.js.map +0 -1
- package/dist/chunk-P7G4LOOV.js.map +0 -1
- package/dist/chunk-V3275BA7.js.map +0 -1
- package/dist/chunk-W2KBVWJ2.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { LocationsService } from './chunk-IAOWDMTA.js';
|
|
2
2
|
export { LocationsService } from './chunk-IAOWDMTA.js';
|
|
3
|
-
import { MediaService } from './chunk-
|
|
4
|
-
export { MediaService } from './chunk-
|
|
5
|
-
import { OrdersService, SalesOrdersService } from './chunk-
|
|
6
|
-
export { OrdersService, SalesOrdersService } from './chunk-
|
|
3
|
+
import { MediaService } from './chunk-TI56QENX.js';
|
|
4
|
+
export { MediaService } from './chunk-TI56QENX.js';
|
|
5
|
+
import { OrdersService, SalesOrdersService } from './chunk-P3RANRGB.js';
|
|
6
|
+
export { OrdersService, SalesOrdersService } from './chunk-P3RANRGB.js';
|
|
7
7
|
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-4VRUMCS2.js';
|
|
8
8
|
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-4VRUMCS2.js';
|
|
9
9
|
import { PriceService } from './chunk-ZOFGDNSX.js';
|
|
10
10
|
export { PriceService } from './chunk-ZOFGDNSX.js';
|
|
11
|
-
import { ProductService } from './chunk-
|
|
12
|
-
export { ProductService } from './chunk-
|
|
13
|
-
import { SegmentService } from './chunk-
|
|
14
|
-
export { SegmentService } from './chunk-
|
|
15
|
-
import { AvailabilityService } from './chunk-
|
|
16
|
-
export { AvailabilityService } from './chunk-
|
|
11
|
+
import { ProductService } from './chunk-JQWUGGRV.js';
|
|
12
|
+
export { ProductService } from './chunk-JQWUGGRV.js';
|
|
13
|
+
import { SegmentService } from './chunk-3G5KROEC.js';
|
|
14
|
+
export { SegmentService } from './chunk-3G5KROEC.js';
|
|
15
|
+
import { AvailabilityService } from './chunk-XQAOHHXL.js';
|
|
16
|
+
export { AvailabilityService } from './chunk-XQAOHHXL.js';
|
|
17
17
|
import { CartService } from './chunk-YVZ6GOLE.js';
|
|
18
18
|
export { CartService } from './chunk-YVZ6GOLE.js';
|
|
19
|
-
import { CategoryService } from './chunk-
|
|
20
|
-
export { CategoryService } from './chunk-
|
|
21
|
-
export { iterateAll } from './chunk-
|
|
19
|
+
import { CategoryService } from './chunk-MSQ3GEIW.js';
|
|
20
|
+
export { CategoryService } from './chunk-MSQ3GEIW.js';
|
|
21
|
+
export { iterateAll } from './chunk-W6SLZNRX.js';
|
|
22
22
|
import { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
23
23
|
export { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
24
|
+
import { requestPage } from './chunk-LKHKFF7B.js';
|
|
24
25
|
import { CheckoutService } from './chunk-RYQVMR26.js';
|
|
25
26
|
export { CheckoutService } from './chunk-RYQVMR26.js';
|
|
26
27
|
import { CompaniesService } from './chunk-QQMLN76U.js';
|
|
@@ -439,7 +440,25 @@ var HttpClient = class {
|
|
|
439
440
|
...o.body !== void 0 && !isFormData ? { "Content-Type": "application/json" } : {}
|
|
440
441
|
};
|
|
441
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* Issues a request and returns the parsed body. Retries 5xx/429 on idempotent
|
|
445
|
+
* methods and re-auths once on a 401 — see {@link send}.
|
|
446
|
+
*/
|
|
442
447
|
async request(o) {
|
|
448
|
+
return (await this.send(o)).data;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Like {@link request}, but also hands back the response headers.
|
|
452
|
+
*
|
|
453
|
+
* Emporix puts pagination metadata there — `X-Total-Count` and, on the schema
|
|
454
|
+
* service's custom instances, `X-Next-Cursor` / `X-Prev-Cursor`. Facades
|
|
455
|
+
* should reach for `core/paged.ts`'s `requestPage` rather than calling this
|
|
456
|
+
* directly; it exists for metadata that does not fit the paginated shape.
|
|
457
|
+
*/
|
|
458
|
+
async requestWithMeta(o) {
|
|
459
|
+
return this.send(o);
|
|
460
|
+
}
|
|
461
|
+
async send(o) {
|
|
443
462
|
const requestId = `req-${++requestSeq}`;
|
|
444
463
|
const log = this.opts.logger.child({ requestId });
|
|
445
464
|
const url = new URL(this.opts.host + o.path);
|
|
@@ -506,7 +525,7 @@ var HttpClient = class {
|
|
|
506
525
|
const parsed = text ? safeJson(text) : void 0;
|
|
507
526
|
if (res.ok) {
|
|
508
527
|
log.debug("http ok", { status: res.status });
|
|
509
|
-
return parsed;
|
|
528
|
+
return { data: parsed, headers: res.headers };
|
|
510
529
|
}
|
|
511
530
|
if (res.status === 401) {
|
|
512
531
|
if (sdkManaged && !reauthed) {
|
|
@@ -667,7 +686,7 @@ var HttpClient = class {
|
|
|
667
686
|
};
|
|
668
687
|
|
|
669
688
|
// package.json
|
|
670
|
-
var version = "2.
|
|
689
|
+
var version = "2.32.0";
|
|
671
690
|
|
|
672
691
|
// src/version.ts
|
|
673
692
|
var SDK_VERSION = version;
|
|
@@ -1364,13 +1383,17 @@ var FeeService = class {
|
|
|
1364
1383
|
async list(query = {}, auth2 = SERVICE6) {
|
|
1365
1384
|
const pageNumber = query.pageNumber ?? 1;
|
|
1366
1385
|
const pageSize = query.pageSize ?? 60;
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1386
|
+
const { totalCount, ...rest } = query;
|
|
1387
|
+
return requestPage(
|
|
1388
|
+
this.ctx.http,
|
|
1389
|
+
{
|
|
1390
|
+
method: "GET",
|
|
1391
|
+
path: this.feesBase(),
|
|
1392
|
+
auth: auth2,
|
|
1393
|
+
query: { ...rest, pageNumber, pageSize }
|
|
1394
|
+
},
|
|
1395
|
+
{ pageNumber, pageSize, ...totalCount === void 0 ? {} : { totalCount } }
|
|
1396
|
+
);
|
|
1374
1397
|
}
|
|
1375
1398
|
/** Retrieve one fee definition by id. */
|
|
1376
1399
|
async get(id, auth2 = SERVICE6) {
|
|
@@ -1711,13 +1734,20 @@ var SchemaService = class {
|
|
|
1711
1734
|
const q = { pageNumber, pageSize };
|
|
1712
1735
|
if (query.q) q.q = query.q;
|
|
1713
1736
|
if (query.type) q.type = query.type;
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1737
|
+
return requestPage(
|
|
1738
|
+
this.ctx.http,
|
|
1739
|
+
{
|
|
1740
|
+
method: "GET",
|
|
1741
|
+
path: this.schemasBase(),
|
|
1742
|
+
auth: auth2,
|
|
1743
|
+
query: q
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
pageNumber,
|
|
1747
|
+
pageSize,
|
|
1748
|
+
...query.totalCount === void 0 ? {} : { totalCount: query.totalCount }
|
|
1749
|
+
}
|
|
1750
|
+
);
|
|
1721
1751
|
}
|
|
1722
1752
|
/** Retrieve one schema by id. */
|
|
1723
1753
|
async getSchema(id, auth2 = SERVICE8) {
|
|
@@ -1843,13 +1873,41 @@ var SchemaService = class {
|
|
|
1843
1873
|
async listInstances(type, query = {}, auth2 = SERVICE8) {
|
|
1844
1874
|
const pageNumber = query.pageNumber ?? 1;
|
|
1845
1875
|
const pageSize = query.pageSize ?? 60;
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1876
|
+
const { totalCount, ...rest } = query;
|
|
1877
|
+
return requestPage(
|
|
1878
|
+
this.ctx.http,
|
|
1879
|
+
{
|
|
1880
|
+
method: "GET",
|
|
1881
|
+
path: this.instancesBase(type),
|
|
1882
|
+
auth: auth2,
|
|
1883
|
+
query: { ...rest, pageNumber, pageSize }
|
|
1884
|
+
},
|
|
1885
|
+
{ pageNumber, pageSize, ...totalCount === void 0 ? {} : { totalCount } }
|
|
1886
|
+
);
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Async-iterates every instance of a type.
|
|
1890
|
+
*
|
|
1891
|
+
* Not built on `iterateAll`: that helper drives pagination by page number, and
|
|
1892
|
+
* the server ignores `pageNumber` the moment a cursor is in play. This follows
|
|
1893
|
+
* `nextCursor` while the server offers one and falls back to `pageNumber + 1`
|
|
1894
|
+
* when it does not — so it is correct whether or not the tenant's deployment
|
|
1895
|
+
* emits cursor headers on a request that carries no cursor.
|
|
1896
|
+
*/
|
|
1897
|
+
async *listAllInstances(type, query = {}, auth2 = SERVICE8) {
|
|
1898
|
+
let cursor;
|
|
1899
|
+
let pageNumber = 1;
|
|
1900
|
+
for (; ; ) {
|
|
1901
|
+
const page = await this.listInstances(
|
|
1902
|
+
type,
|
|
1903
|
+
{ ...query, pageNumber, ...cursor === void 0 ? {} : { next: cursor } },
|
|
1904
|
+
auth2
|
|
1905
|
+
);
|
|
1906
|
+
for (const item of page.items) yield item;
|
|
1907
|
+
if (!page.hasNextPage) return;
|
|
1908
|
+
cursor = page.nextCursor;
|
|
1909
|
+
if (cursor === void 0) pageNumber += 1;
|
|
1910
|
+
}
|
|
1853
1911
|
}
|
|
1854
1912
|
/** Retrieve one instance by id. */
|
|
1855
1913
|
async getInstance(type, id, auth2 = SERVICE8) {
|
|
@@ -1983,15 +2041,26 @@ var SchemaService = class {
|
|
|
1983
2041
|
/**
|
|
1984
2042
|
* Structured search over a custom entity's instances
|
|
1985
2043
|
* (`POST /instances/search`), wrapped in {@link PaginatedItems}.
|
|
2044
|
+
*
|
|
2045
|
+
* The `query` parameter is third and `auth` fourth. This used to forward no
|
|
2046
|
+
* query parameters at all and report a hard-coded `hasNextPage: false`, so a
|
|
2047
|
+
* search could only ever return the server's default first page.
|
|
1986
2048
|
*/
|
|
1987
|
-
async searchInstances(type, body, auth2 = SERVICE8) {
|
|
1988
|
-
const
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2049
|
+
async searchInstances(type, body, query = {}, auth2 = SERVICE8) {
|
|
2050
|
+
const pageNumber = query.pageNumber ?? 1;
|
|
2051
|
+
const pageSize = query.pageSize ?? 60;
|
|
2052
|
+
const { totalCount, ...rest } = query;
|
|
2053
|
+
return requestPage(
|
|
2054
|
+
this.ctx.http,
|
|
2055
|
+
{
|
|
2056
|
+
method: "POST",
|
|
2057
|
+
path: `${this.instancesBase(type)}/search`,
|
|
2058
|
+
auth: auth2,
|
|
2059
|
+
body,
|
|
2060
|
+
query: { ...rest, pageNumber, pageSize }
|
|
2061
|
+
},
|
|
2062
|
+
{ pageNumber, pageSize, ...totalCount === void 0 ? {} : { totalCount } }
|
|
2063
|
+
);
|
|
1995
2064
|
}
|
|
1996
2065
|
// --- (E) References ------------------------------------------------------
|
|
1997
2066
|
/**
|
|
@@ -2012,13 +2081,20 @@ var SchemaService = class {
|
|
|
2012
2081
|
if (query.q) q.q = query.q;
|
|
2013
2082
|
if (query.fields) q.fields = query.fields;
|
|
2014
2083
|
if (query.type) q.type = query.type;
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2084
|
+
return requestPage(
|
|
2085
|
+
this.ctx.http,
|
|
2086
|
+
{
|
|
2087
|
+
method: "GET",
|
|
2088
|
+
path: this.referencesBase(),
|
|
2089
|
+
auth: auth2,
|
|
2090
|
+
query: q
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
pageNumber,
|
|
2094
|
+
pageSize,
|
|
2095
|
+
...query.totalCount === void 0 ? {} : { totalCount: query.totalCount }
|
|
2096
|
+
}
|
|
2097
|
+
);
|
|
2022
2098
|
},
|
|
2023
2099
|
/** Retrieve one reference by id. */
|
|
2024
2100
|
get: async (id, auth2 = SERVICE8) => this.ctx.http.request({
|
|
@@ -3583,13 +3659,20 @@ var QuoteService = class {
|
|
|
3583
3659
|
const q = { pageNumber, pageSize };
|
|
3584
3660
|
if (query.q) q.q = query.q;
|
|
3585
3661
|
if (query.sort) q.sort = query.sort;
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3662
|
+
return requestPage(
|
|
3663
|
+
this.ctx.http,
|
|
3664
|
+
{
|
|
3665
|
+
method: "GET",
|
|
3666
|
+
path: this.quotesBase(),
|
|
3667
|
+
auth: auth2,
|
|
3668
|
+
query: q
|
|
3669
|
+
},
|
|
3670
|
+
{
|
|
3671
|
+
pageNumber,
|
|
3672
|
+
pageSize,
|
|
3673
|
+
...query.totalCount === void 0 ? {} : { totalCount: query.totalCount }
|
|
3674
|
+
}
|
|
3675
|
+
);
|
|
3593
3676
|
}
|
|
3594
3677
|
/** Create a quote (`POST /quotes`, 201). */
|
|
3595
3678
|
async create(draft, auth2) {
|
|
@@ -3659,13 +3742,20 @@ var QuoteReasonsResource = class {
|
|
|
3659
3742
|
async list(query, auth2) {
|
|
3660
3743
|
const pageNumber = query.pageNumber ?? 1;
|
|
3661
3744
|
const pageSize = query.pageSize ?? 60;
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3745
|
+
return requestPage(
|
|
3746
|
+
this.ctx.http,
|
|
3747
|
+
{
|
|
3748
|
+
method: "GET",
|
|
3749
|
+
path: this.base(),
|
|
3750
|
+
auth: auth2,
|
|
3751
|
+
query: { pageNumber, pageSize }
|
|
3752
|
+
},
|
|
3753
|
+
{
|
|
3754
|
+
pageNumber,
|
|
3755
|
+
pageSize,
|
|
3756
|
+
...query.totalCount === void 0 ? {} : { totalCount: query.totalCount }
|
|
3757
|
+
}
|
|
3758
|
+
);
|
|
3669
3759
|
}
|
|
3670
3760
|
/** Retrieve one reason by id. */
|
|
3671
3761
|
async get(reasonId, auth2) {
|
|
@@ -3893,13 +3983,20 @@ var IndexingService = class {
|
|
|
3893
3983
|
const pageSize = opts.pageSize ?? 50;
|
|
3894
3984
|
const query = { pageNumber, pageSize };
|
|
3895
3985
|
if (opts.q !== void 0) query.q = opts.q;
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3986
|
+
return requestPage(
|
|
3987
|
+
this.ctx.http,
|
|
3988
|
+
{
|
|
3989
|
+
method: "GET",
|
|
3990
|
+
path: `${this.base()}/reindex-jobs`,
|
|
3991
|
+
query,
|
|
3992
|
+
auth: auth2
|
|
3993
|
+
},
|
|
3994
|
+
{
|
|
3995
|
+
pageNumber,
|
|
3996
|
+
pageSize,
|
|
3997
|
+
...opts.totalCount === void 0 ? {} : { totalCount: opts.totalCount }
|
|
3998
|
+
}
|
|
3999
|
+
);
|
|
3903
4000
|
}
|
|
3904
4001
|
/** Fetch one reindex job by id. */
|
|
3905
4002
|
async getReindexJob(reindexJobId, auth2 = SERVICE22) {
|