@viu/emporix-sdk 2.31.1 → 2.33.1
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 +68 -0
- package/README.md +12 -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/companies.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-DK8jg6y5.cjs';
|
|
2
2
|
import { L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
3
3
|
export { A as AccountLimit, d as CustomerGroup, g as LegalInfo } from './types.gen-C_wOXYZB.cjs';
|
|
4
4
|
|
package/dist/companies.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-DK8jg6y5.js';
|
|
2
2
|
import { L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate } from './types.gen-C_wOXYZB.js';
|
|
3
3
|
export { A as AccountLimit, d as CustomerGroup, g as LegalInfo } from './types.gen-C_wOXYZB.js';
|
|
4
4
|
|
package/dist/contacts.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-DK8jg6y5.cjs';
|
|
2
2
|
import { C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/contacts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext } from './context-DK8jg6y5.js';
|
|
2
2
|
import { C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate } from './types.gen-C_wOXYZB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -352,7 +352,11 @@ interface RequestOptions {
|
|
|
352
352
|
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
353
353
|
path: string;
|
|
354
354
|
auth: AuthContext;
|
|
355
|
-
|
|
355
|
+
/**
|
|
356
|
+
* Query parameters. Booleans are serialized with `String(v)`, so a facade can
|
|
357
|
+
* pass one straight through instead of stringifying it at the call site.
|
|
358
|
+
*/
|
|
359
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
356
360
|
body?: unknown;
|
|
357
361
|
/** Extra request headers (merged before auth; cannot override Authorization). */
|
|
358
362
|
headers?: Record<string, string>;
|
|
@@ -366,6 +370,17 @@ interface RequestOptions {
|
|
|
366
370
|
*/
|
|
367
371
|
idempotent?: boolean;
|
|
368
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* A successful response: the parsed body plus its headers.
|
|
375
|
+
*
|
|
376
|
+
* `Headers` rather than the whole `Response` on purpose — by the time this
|
|
377
|
+
* returns, the body has been consumed, and a `Response` whose body cannot be
|
|
378
|
+
* read again is a trap in a caller's hands.
|
|
379
|
+
*/
|
|
380
|
+
interface HttpResult<T> {
|
|
381
|
+
data: T;
|
|
382
|
+
headers: Headers;
|
|
383
|
+
}
|
|
369
384
|
/** Construction options for {@link HttpClient}. */
|
|
370
385
|
interface HttpClientOptions {
|
|
371
386
|
host: string;
|
|
@@ -404,7 +419,21 @@ declare class HttpClient {
|
|
|
404
419
|
private readonly doFetch;
|
|
405
420
|
constructor(opts: HttpClientOptions);
|
|
406
421
|
private buildHeaders;
|
|
422
|
+
/**
|
|
423
|
+
* Issues a request and returns the parsed body. Retries 5xx/429 on idempotent
|
|
424
|
+
* methods and re-auths once on a 401 — see {@link send}.
|
|
425
|
+
*/
|
|
407
426
|
request<T = unknown>(o: RequestOptions): Promise<T>;
|
|
427
|
+
/**
|
|
428
|
+
* Like {@link request}, but also hands back the response headers.
|
|
429
|
+
*
|
|
430
|
+
* Emporix puts pagination metadata there — `X-Total-Count` and, on the schema
|
|
431
|
+
* service's custom instances, `X-Next-Cursor` / `X-Prev-Cursor`. Facades
|
|
432
|
+
* should reach for `core/paged.ts`'s `requestPage` rather than calling this
|
|
433
|
+
* directly; it exists for metadata that does not fit the paginated shape.
|
|
434
|
+
*/
|
|
435
|
+
requestWithMeta<T = unknown>(o: RequestOptions): Promise<HttpResult<T>>;
|
|
436
|
+
private send;
|
|
408
437
|
/**
|
|
409
438
|
* Single-shot fetch that returns the raw {@link Response} unparsed. Used by
|
|
410
439
|
* endpoints whose responses are not JSON (binary downloads, redirect-only
|
|
@@ -448,6 +477,23 @@ interface PaginatedItems<T> {
|
|
|
448
477
|
pageNumber: number;
|
|
449
478
|
pageSize: number;
|
|
450
479
|
hasNextPage: boolean;
|
|
480
|
+
/**
|
|
481
|
+
* Absolute number of matches, when the caller asked for it and the endpoint
|
|
482
|
+
* answered. Opt-in per call (`totalCount: true`), because Emporix computes it
|
|
483
|
+
* with a second query — see `core/paged.ts`.
|
|
484
|
+
*
|
|
485
|
+
* Always `undefined` in cursor mode: the server ignores the request header
|
|
486
|
+
* and omits the response header there.
|
|
487
|
+
*/
|
|
488
|
+
totalCount?: number;
|
|
489
|
+
/**
|
|
490
|
+
* Opaque cursor for the next page, on the endpoints that offer one (today:
|
|
491
|
+
* the schema service's custom instances). Pass it back as the `next` query
|
|
492
|
+
* parameter. Absence means "this endpoint said nothing", NOT "last page".
|
|
493
|
+
*/
|
|
494
|
+
nextCursor?: string;
|
|
495
|
+
/** Opaque cursor for the previous page. Same caveat as {@link nextCursor}. */
|
|
496
|
+
prevCursor?: string;
|
|
451
497
|
}
|
|
452
498
|
/**
|
|
453
499
|
* Async-iterates every item across pages of a `PaginatedItems<T>` source.
|
|
@@ -458,4 +504,4 @@ interface PaginatedItems<T> {
|
|
|
458
504
|
*/
|
|
459
505
|
declare function iterateAll<T>(fetchPage: (pageNumber: number) => Promise<PaginatedItems<T>>, start?: number): AsyncIterable<T>;
|
|
460
506
|
|
|
461
|
-
export { type AnonymousSession as A, type ClientContext as C, DEFAULT_HOST as D, type EmporixConfig as E, HttpClient as H, LEVEL as L, type PaginatedItems as P, type RequestOptions as R, type ServiceCredentials as S, type TokenProvider as T, type AnonymousSessionStore as a, type AuthContext as b, type AuthKind as c, CustomerRefreshRegistry as d, type CustomerTokenRefresher as e, DefaultTokenProvider as f, type HttpClientOptions as g,
|
|
507
|
+
export { type AnonymousSession as A, type ClientContext as C, DEFAULT_HOST as D, type EmporixConfig as E, HttpClient as H, LEVEL as L, type PaginatedItems as P, type RequestOptions as R, type ServiceCredentials as S, type TokenProvider as T, type AnonymousSessionStore as a, type AuthContext as b, type AuthKind as c, CustomerRefreshRegistry as d, type CustomerTokenRefresher as e, DefaultTokenProvider as f, type HttpClientOptions as g, type HttpResult as h, LevelResolver as i, type LogFields as j, type LogLevel as k, type Logger as l, type LoggerConfig as m, type LoggerObjectConfig as n, type ResolvedConfig as o, type ServiceName as p, type StoredAnonymousSession as q, type StorefrontCredentials as r, auth as s, createConsoleLogger as t, createNoopLogger as u, iterateAll as v, redact as w, resolveToken as x, validateConfig as y };
|
|
@@ -352,7 +352,11 @@ interface RequestOptions {
|
|
|
352
352
|
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
353
353
|
path: string;
|
|
354
354
|
auth: AuthContext;
|
|
355
|
-
|
|
355
|
+
/**
|
|
356
|
+
* Query parameters. Booleans are serialized with `String(v)`, so a facade can
|
|
357
|
+
* pass one straight through instead of stringifying it at the call site.
|
|
358
|
+
*/
|
|
359
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
356
360
|
body?: unknown;
|
|
357
361
|
/** Extra request headers (merged before auth; cannot override Authorization). */
|
|
358
362
|
headers?: Record<string, string>;
|
|
@@ -366,6 +370,17 @@ interface RequestOptions {
|
|
|
366
370
|
*/
|
|
367
371
|
idempotent?: boolean;
|
|
368
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* A successful response: the parsed body plus its headers.
|
|
375
|
+
*
|
|
376
|
+
* `Headers` rather than the whole `Response` on purpose — by the time this
|
|
377
|
+
* returns, the body has been consumed, and a `Response` whose body cannot be
|
|
378
|
+
* read again is a trap in a caller's hands.
|
|
379
|
+
*/
|
|
380
|
+
interface HttpResult<T> {
|
|
381
|
+
data: T;
|
|
382
|
+
headers: Headers;
|
|
383
|
+
}
|
|
369
384
|
/** Construction options for {@link HttpClient}. */
|
|
370
385
|
interface HttpClientOptions {
|
|
371
386
|
host: string;
|
|
@@ -404,7 +419,21 @@ declare class HttpClient {
|
|
|
404
419
|
private readonly doFetch;
|
|
405
420
|
constructor(opts: HttpClientOptions);
|
|
406
421
|
private buildHeaders;
|
|
422
|
+
/**
|
|
423
|
+
* Issues a request and returns the parsed body. Retries 5xx/429 on idempotent
|
|
424
|
+
* methods and re-auths once on a 401 — see {@link send}.
|
|
425
|
+
*/
|
|
407
426
|
request<T = unknown>(o: RequestOptions): Promise<T>;
|
|
427
|
+
/**
|
|
428
|
+
* Like {@link request}, but also hands back the response headers.
|
|
429
|
+
*
|
|
430
|
+
* Emporix puts pagination metadata there — `X-Total-Count` and, on the schema
|
|
431
|
+
* service's custom instances, `X-Next-Cursor` / `X-Prev-Cursor`. Facades
|
|
432
|
+
* should reach for `core/paged.ts`'s `requestPage` rather than calling this
|
|
433
|
+
* directly; it exists for metadata that does not fit the paginated shape.
|
|
434
|
+
*/
|
|
435
|
+
requestWithMeta<T = unknown>(o: RequestOptions): Promise<HttpResult<T>>;
|
|
436
|
+
private send;
|
|
408
437
|
/**
|
|
409
438
|
* Single-shot fetch that returns the raw {@link Response} unparsed. Used by
|
|
410
439
|
* endpoints whose responses are not JSON (binary downloads, redirect-only
|
|
@@ -448,6 +477,23 @@ interface PaginatedItems<T> {
|
|
|
448
477
|
pageNumber: number;
|
|
449
478
|
pageSize: number;
|
|
450
479
|
hasNextPage: boolean;
|
|
480
|
+
/**
|
|
481
|
+
* Absolute number of matches, when the caller asked for it and the endpoint
|
|
482
|
+
* answered. Opt-in per call (`totalCount: true`), because Emporix computes it
|
|
483
|
+
* with a second query — see `core/paged.ts`.
|
|
484
|
+
*
|
|
485
|
+
* Always `undefined` in cursor mode: the server ignores the request header
|
|
486
|
+
* and omits the response header there.
|
|
487
|
+
*/
|
|
488
|
+
totalCount?: number;
|
|
489
|
+
/**
|
|
490
|
+
* Opaque cursor for the next page, on the endpoints that offer one (today:
|
|
491
|
+
* the schema service's custom instances). Pass it back as the `next` query
|
|
492
|
+
* parameter. Absence means "this endpoint said nothing", NOT "last page".
|
|
493
|
+
*/
|
|
494
|
+
nextCursor?: string;
|
|
495
|
+
/** Opaque cursor for the previous page. Same caveat as {@link nextCursor}. */
|
|
496
|
+
prevCursor?: string;
|
|
451
497
|
}
|
|
452
498
|
/**
|
|
453
499
|
* Async-iterates every item across pages of a `PaginatedItems<T>` source.
|
|
@@ -458,4 +504,4 @@ interface PaginatedItems<T> {
|
|
|
458
504
|
*/
|
|
459
505
|
declare function iterateAll<T>(fetchPage: (pageNumber: number) => Promise<PaginatedItems<T>>, start?: number): AsyncIterable<T>;
|
|
460
506
|
|
|
461
|
-
export { type AnonymousSession as A, type ClientContext as C, DEFAULT_HOST as D, type EmporixConfig as E, HttpClient as H, LEVEL as L, type PaginatedItems as P, type RequestOptions as R, type ServiceCredentials as S, type TokenProvider as T, type AnonymousSessionStore as a, type AuthContext as b, type AuthKind as c, CustomerRefreshRegistry as d, type CustomerTokenRefresher as e, DefaultTokenProvider as f, type HttpClientOptions as g,
|
|
507
|
+
export { type AnonymousSession as A, type ClientContext as C, DEFAULT_HOST as D, type EmporixConfig as E, HttpClient as H, LEVEL as L, type PaginatedItems as P, type RequestOptions as R, type ServiceCredentials as S, type TokenProvider as T, type AnonymousSessionStore as a, type AuthContext as b, type AuthKind as c, CustomerRefreshRegistry as d, type CustomerTokenRefresher as e, DefaultTokenProvider as f, type HttpClientOptions as g, type HttpResult as h, LevelResolver as i, type LogFields as j, type LogLevel as k, type Logger as l, type LoggerConfig as m, type LoggerObjectConfig as n, type ResolvedConfig as o, type ServiceName as p, type StoredAnonymousSession as q, type StorefrontCredentials as r, auth as s, createConsoleLogger as t, createNoopLogger as u, iterateAll as v, redact as w, resolveToken as x, validateConfig as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { g as CustomerGroupsService, j as IamGroup, c as IamGroupMemberAssignment } from './customer-groups-
|
|
2
|
-
import './context-
|
|
1
|
+
export { g as CustomerGroupsService, j as IamGroup, c as IamGroupMemberAssignment } from './customer-groups-D0OCm8kJ.cjs';
|
|
2
|
+
import './context-DK8jg6y5.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { g as CustomerGroupsService, j as IamGroup, c as IamGroupMemberAssignment } from './customer-groups-
|
|
2
|
-
import './context-
|
|
1
|
+
export { g as CustomerGroupsService, j as IamGroup, c as IamGroupMemberAssignment } from './customer-groups-WSt4aT62.js';
|
|
2
|
+
import './context-DK8jg6y5.js';
|
package/dist/customer.d.cts
CHANGED
package/dist/customer.d.ts
CHANGED