@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.
Files changed (83) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/availability.cjs +44 -10
  3. package/dist/availability.cjs.map +1 -1
  4. package/dist/availability.d.cts +2 -1
  5. package/dist/availability.d.ts +2 -1
  6. package/dist/availability.js +2 -1
  7. package/dist/cart.d.cts +1 -1
  8. package/dist/cart.d.ts +1 -1
  9. package/dist/category.cjs +82 -28
  10. package/dist/category.cjs.map +1 -1
  11. package/dist/category.d.cts +10 -1
  12. package/dist/category.d.ts +10 -1
  13. package/dist/category.js +3 -2
  14. package/dist/checkout.d.cts +1 -1
  15. package/dist/checkout.d.ts +1 -1
  16. package/dist/{chunk-W2KBVWJ2.js → chunk-3G5KROEC.js} +8 -2
  17. package/dist/chunk-3G5KROEC.js.map +1 -0
  18. package/dist/{chunk-7W22KLUL.js → chunk-JQWUGGRV.js} +32 -17
  19. package/dist/chunk-JQWUGGRV.js.map +1 -0
  20. package/dist/chunk-LKHKFF7B.js +30 -0
  21. package/dist/chunk-LKHKFF7B.js.map +1 -0
  22. package/dist/{chunk-D7HBM2DQ.js → chunk-MSQ3GEIW.js} +59 -31
  23. package/dist/chunk-MSQ3GEIW.js.map +1 -0
  24. package/dist/{chunk-P7G4LOOV.js → chunk-P3RANRGB.js} +47 -25
  25. package/dist/chunk-P3RANRGB.js.map +1 -0
  26. package/dist/{chunk-OTG2S2L4.js → chunk-TI56QENX.js} +14 -14
  27. package/dist/chunk-TI56QENX.js.map +1 -0
  28. package/dist/{chunk-GWJ2U2CP.js → chunk-W6SLZNRX.js} +2 -2
  29. package/dist/chunk-W6SLZNRX.js.map +1 -0
  30. package/dist/{chunk-V3275BA7.js → chunk-XQAOHHXL.js} +20 -12
  31. package/dist/chunk-XQAOHHXL.js.map +1 -0
  32. package/dist/companies.d.cts +1 -1
  33. package/dist/companies.d.ts +1 -1
  34. package/dist/contacts.d.cts +1 -1
  35. package/dist/contacts.d.ts +1 -1
  36. package/dist/{context-CpLIDl0P.d.cts → context-DK8jg6y5.d.cts} +48 -2
  37. package/dist/{context-CpLIDl0P.d.ts → context-DK8jg6y5.d.ts} +48 -2
  38. package/dist/{customer-groups-DJVbdrEP.d.cts → customer-groups-D0OCm8kJ.d.cts} +1 -1
  39. package/dist/{customer-groups-DhpCTCTg.d.ts → customer-groups-WSt4aT62.d.ts} +1 -1
  40. package/dist/customer-groups.d.cts +2 -2
  41. package/dist/customer-groups.d.ts +2 -2
  42. package/dist/customer.d.cts +1 -1
  43. package/dist/customer.d.ts +1 -1
  44. package/dist/index.cjs +343 -146
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +62 -7
  47. package/dist/index.d.ts +62 -7
  48. package/dist/index.js +169 -72
  49. package/dist/index.js.map +1 -1
  50. package/dist/locations.d.cts +1 -1
  51. package/dist/locations.d.ts +1 -1
  52. package/dist/media.cjs +38 -12
  53. package/dist/media.cjs.map +1 -1
  54. package/dist/media.d.cts +7 -2
  55. package/dist/media.d.ts +7 -2
  56. package/dist/media.js +2 -1
  57. package/dist/orders.cjs +71 -23
  58. package/dist/orders.cjs.map +1 -1
  59. package/dist/orders.d.cts +7 -1
  60. package/dist/orders.d.ts +7 -1
  61. package/dist/orders.js +2 -1
  62. package/dist/payment.d.cts +1 -1
  63. package/dist/payment.d.ts +1 -1
  64. package/dist/price.d.cts +1 -1
  65. package/dist/price.d.ts +1 -1
  66. package/dist/product.cjs +55 -14
  67. package/dist/product.cjs.map +1 -1
  68. package/dist/product.d.cts +4 -1
  69. package/dist/product.d.ts +4 -1
  70. package/dist/product.js +3 -2
  71. package/dist/segment.cjs +6 -0
  72. package/dist/segment.cjs.map +1 -1
  73. package/dist/segment.d.cts +1 -1
  74. package/dist/segment.d.ts +1 -1
  75. package/dist/segment.js +1 -1
  76. package/package.json +1 -1
  77. package/dist/chunk-7W22KLUL.js.map +0 -1
  78. package/dist/chunk-D7HBM2DQ.js.map +0 -1
  79. package/dist/chunk-GWJ2U2CP.js.map +0 -1
  80. package/dist/chunk-OTG2S2L4.js.map +0 -1
  81. package/dist/chunk-P7G4LOOV.js.map +0 -1
  82. package/dist/chunk-V3275BA7.js.map +0 -1
  83. package/dist/chunk-W2KBVWJ2.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, b as AuthContext } from './context-CpLIDl0P.cjs';
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
 
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, b as AuthContext } from './context-CpLIDl0P.js';
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
 
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, b as AuthContext } from './context-CpLIDl0P.cjs';
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
  /**
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, b as AuthContext } from './context-CpLIDl0P.js';
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
- query?: Record<string, string | number | undefined>;
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, LevelResolver as h, type LogFields as i, type LogLevel as j, type Logger as k, type LoggerConfig as l, type LoggerObjectConfig as m, type ResolvedConfig as n, type ServiceName as o, type StoredAnonymousSession as p, type StorefrontCredentials as q, auth as r, createConsoleLogger as s, createNoopLogger as t, iterateAll as u, redact as v, resolveToken as w, validateConfig as x };
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
- query?: Record<string, string | number | undefined>;
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, LevelResolver as h, type LogFields as i, type LogLevel as j, type Logger as k, type LoggerConfig as l, type LoggerObjectConfig as m, type ResolvedConfig as n, type ServiceName as o, type StoredAnonymousSession as p, type StorefrontCredentials as q, auth as r, createConsoleLogger as s, createNoopLogger as t, iterateAll as u, redact as v, resolveToken as w, validateConfig as x };
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,4 +1,4 @@
1
- import { C as ClientContext, b as AuthContext } from './context-CpLIDl0P.cjs';
1
+ import { C as ClientContext, b as AuthContext } from './context-DK8jg6y5.cjs';
2
2
 
3
3
  /**
4
4
  * Access control metadata.
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, b as AuthContext } from './context-CpLIDl0P.js';
1
+ import { C as ClientContext, b as AuthContext } from './context-DK8jg6y5.js';
2
2
 
3
3
  /**
4
4
  * Access control metadata.
@@ -1,2 +1,2 @@
1
- export { g as CustomerGroupsService, j as IamGroup, c as IamGroupMemberAssignment } from './customer-groups-DJVbdrEP.cjs';
2
- import './context-CpLIDl0P.cjs';
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-DhpCTCTg.js';
2
- import './context-CpLIDl0P.js';
1
+ export { g as CustomerGroupsService, j as IamGroup, c as IamGroupMemberAssignment } from './customer-groups-WSt4aT62.js';
2
+ import './context-DK8jg6y5.js';
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, A as AnonymousSession, b as AuthContext } from './context-CpLIDl0P.cjs';
1
+ import { C as ClientContext, A as AnonymousSession, b as AuthContext } from './context-DK8jg6y5.cjs';
2
2
 
3
3
  type AccountId = {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { C as ClientContext, A as AnonymousSession, b as AuthContext } from './context-CpLIDl0P.js';
1
+ import { C as ClientContext, A as AnonymousSession, b as AuthContext } from './context-DK8jg6y5.js';
2
2
 
3
3
  type AccountId = {
4
4
  /**