@viu/emporix-sdk 2.13.1 → 2.15.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 (136) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/dist/availability.cjs +4 -1
  4. package/dist/availability.cjs.map +1 -1
  5. package/dist/availability.d.cts +2 -1
  6. package/dist/availability.d.ts +2 -1
  7. package/dist/availability.js +2 -2
  8. package/dist/cart.cjs +1 -0
  9. package/dist/cart.cjs.map +1 -1
  10. package/dist/cart.d.cts +2 -1
  11. package/dist/cart.d.ts +2 -1
  12. package/dist/cart.js +2 -2
  13. package/dist/category.cjs +4 -1
  14. package/dist/category.cjs.map +1 -1
  15. package/dist/category.d.cts +2 -1
  16. package/dist/category.d.ts +2 -1
  17. package/dist/category.js +1 -1
  18. package/dist/checkout.cjs +1 -0
  19. package/dist/checkout.cjs.map +1 -1
  20. package/dist/checkout.d.cts +2 -1
  21. package/dist/checkout.d.ts +2 -1
  22. package/dist/checkout.js +2 -2
  23. package/dist/{chunk-BFQ732VZ.js → chunk-3BDDYX3V.js} +3 -3
  24. package/dist/{chunk-BFQ732VZ.js.map → chunk-3BDDYX3V.js.map} +1 -1
  25. package/dist/{chunk-LGOC5XOI.js → chunk-3BTPX7IJ.js} +3 -2
  26. package/dist/chunk-3BTPX7IJ.js.map +1 -0
  27. package/dist/{chunk-B4UOYJKW.js → chunk-5VTBLBXJ.js} +9 -4
  28. package/dist/chunk-5VTBLBXJ.js.map +1 -0
  29. package/dist/{chunk-WW3H7VJ5.js → chunk-62PCCHZ2.js} +4 -2
  30. package/dist/chunk-62PCCHZ2.js.map +1 -0
  31. package/dist/{chunk-BK25FDTH.js → chunk-A3LYJUD4.js} +10 -5
  32. package/dist/chunk-A3LYJUD4.js.map +1 -0
  33. package/dist/{chunk-MM6JF3Z7.js → chunk-BNX3JULF.js} +3 -2
  34. package/dist/chunk-BNX3JULF.js.map +1 -0
  35. package/dist/{chunk-LGLFJL3S.js → chunk-DUVIIWFG.js} +3 -2
  36. package/dist/chunk-DUVIIWFG.js.map +1 -0
  37. package/dist/{chunk-HAEVK6IS.js → chunk-EAWGUZHS.js} +3 -2
  38. package/dist/chunk-EAWGUZHS.js.map +1 -0
  39. package/dist/{chunk-AUVJ5V47.js → chunk-GIZS4BY3.js} +6 -3
  40. package/dist/chunk-GIZS4BY3.js.map +1 -0
  41. package/dist/{chunk-XMEP74BU.js → chunk-K3VQLW3P.js} +7 -4
  42. package/dist/chunk-K3VQLW3P.js.map +1 -0
  43. package/dist/{chunk-Z6PNI5VT.js → chunk-NE7MIZPR.js} +5 -3
  44. package/dist/chunk-NE7MIZPR.js.map +1 -0
  45. package/dist/{chunk-TLH6SLAF.js → chunk-NEXUWPHW.js} +28 -34
  46. package/dist/chunk-NEXUWPHW.js.map +1 -0
  47. package/dist/{chunk-WSXRUYBE.js → chunk-OTG2S2L4.js} +4 -3
  48. package/dist/chunk-OTG2S2L4.js.map +1 -0
  49. package/dist/{chunk-I3YYGSN2.js → chunk-PAT4CS36.js} +4 -3
  50. package/dist/chunk-PAT4CS36.js.map +1 -0
  51. package/dist/{chunk-OMYVOOSX.js → chunk-RYQVMR26.js} +4 -3
  52. package/dist/chunk-RYQVMR26.js.map +1 -0
  53. package/dist/{chunk-KTODT6DV.js → chunk-UWGGF4MC.js} +7 -3
  54. package/dist/chunk-UWGGF4MC.js.map +1 -0
  55. package/dist/{chunk-HKPZI7Y5.js → chunk-XEJPH6UN.js} +4 -3
  56. package/dist/chunk-XEJPH6UN.js.map +1 -0
  57. package/dist/companies.cjs +1 -0
  58. package/dist/companies.cjs.map +1 -1
  59. package/dist/companies.d.cts +2 -1
  60. package/dist/companies.d.ts +2 -1
  61. package/dist/companies.js +1 -1
  62. package/dist/contacts.cjs +1 -0
  63. package/dist/contacts.cjs.map +1 -1
  64. package/dist/contacts.d.cts +2 -1
  65. package/dist/contacts.d.ts +2 -1
  66. package/dist/contacts.js +1 -1
  67. package/dist/{context-CD7F_LHT.d.cts → context-DhoFgoKf.d.cts} +13 -0
  68. package/dist/{context-CD7F_LHT.d.ts → context-DhoFgoKf.d.ts} +13 -0
  69. package/dist/customer-groups.cjs +1 -0
  70. package/dist/customer-groups.cjs.map +1 -1
  71. package/dist/customer-groups.d.cts +2 -1
  72. package/dist/customer-groups.d.ts +2 -1
  73. package/dist/customer-groups.js +1 -1
  74. package/dist/customer.cjs +24 -31
  75. package/dist/customer.cjs.map +1 -1
  76. package/dist/customer.d.cts +2 -1
  77. package/dist/customer.d.ts +2 -1
  78. package/dist/customer.js +3 -3
  79. package/dist/index.cjs +310 -151
  80. package/dist/index.cjs.map +1 -1
  81. package/dist/index.d.cts +84 -6
  82. package/dist/index.d.ts +84 -6
  83. package/dist/index.js +278 -148
  84. package/dist/index.js.map +1 -1
  85. package/dist/locations.cjs +1 -0
  86. package/dist/locations.cjs.map +1 -1
  87. package/dist/locations.d.cts +2 -1
  88. package/dist/locations.d.ts +2 -1
  89. package/dist/locations.js +1 -1
  90. package/dist/media.cjs +1 -0
  91. package/dist/media.cjs.map +1 -1
  92. package/dist/media.d.cts +2 -1
  93. package/dist/media.d.ts +2 -1
  94. package/dist/media.js +2 -2
  95. package/dist/orders.cjs +2 -0
  96. package/dist/orders.cjs.map +1 -1
  97. package/dist/orders.d.cts +3 -1
  98. package/dist/orders.d.ts +3 -1
  99. package/dist/orders.js +1 -1
  100. package/dist/payment.cjs +1 -0
  101. package/dist/payment.cjs.map +1 -1
  102. package/dist/payment.d.cts +2 -1
  103. package/dist/payment.d.ts +2 -1
  104. package/dist/payment.js +3 -3
  105. package/dist/price.cjs +7 -2
  106. package/dist/price.cjs.map +1 -1
  107. package/dist/price.d.cts +2 -1
  108. package/dist/price.d.ts +2 -1
  109. package/dist/price.js +2 -2
  110. package/dist/product.cjs +7 -2
  111. package/dist/product.cjs.map +1 -1
  112. package/dist/product.d.cts +2 -1
  113. package/dist/product.d.ts +2 -1
  114. package/dist/product.js +1 -1
  115. package/dist/segment.cjs +2 -0
  116. package/dist/segment.cjs.map +1 -1
  117. package/dist/segment.d.cts +3 -1
  118. package/dist/segment.d.ts +3 -1
  119. package/dist/segment.js +3 -3
  120. package/package.json +2 -1
  121. package/dist/chunk-AUVJ5V47.js.map +0 -1
  122. package/dist/chunk-B4UOYJKW.js.map +0 -1
  123. package/dist/chunk-BK25FDTH.js.map +0 -1
  124. package/dist/chunk-HAEVK6IS.js.map +0 -1
  125. package/dist/chunk-HKPZI7Y5.js.map +0 -1
  126. package/dist/chunk-I3YYGSN2.js.map +0 -1
  127. package/dist/chunk-KTODT6DV.js.map +0 -1
  128. package/dist/chunk-LGLFJL3S.js.map +0 -1
  129. package/dist/chunk-LGOC5XOI.js.map +0 -1
  130. package/dist/chunk-MM6JF3Z7.js.map +0 -1
  131. package/dist/chunk-OMYVOOSX.js.map +0 -1
  132. package/dist/chunk-TLH6SLAF.js.map +0 -1
  133. package/dist/chunk-WSXRUYBE.js.map +0 -1
  134. package/dist/chunk-WW3H7VJ5.js.map +0 -1
  135. package/dist/chunk-XMEP74BU.js.map +0 -1
  136. package/dist/chunk-Z6PNI5VT.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-CD7F_LHT.cjs';
2
- export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-CD7F_LHT.cjs';
1
+ import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-DhoFgoKf.cjs';
2
+ export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-DhoFgoKf.cjs';
3
3
  import { CustomerService } from './customer.cjs';
4
4
  export { Address, AddressCreateInput, AddressUpdateInput, Customer, CustomerSession, CustomerSignupInput, CustomerUpdateInput, PasswordChangeInput, PasswordResetConfirmInput, PasswordResetRequestInput } from './customer.cjs';
5
5
  import { ProductService } from './product.cjs';
@@ -52,6 +52,12 @@ declare class EmporixValidationError extends EmporixError {
52
52
  /** 5xx — server-side failure. */
53
53
  declare class EmporixServerError extends EmporixError {
54
54
  }
55
+ /** Request aborted by the configured connect/read timeout. No HTTP status. */
56
+ declare class EmporixTimeoutError extends EmporixError {
57
+ }
58
+ /** DNS/TLS/connection-level failure before or during the exchange. No HTTP status. */
59
+ declare class EmporixNetworkError extends EmporixError {
60
+ }
55
61
  /**
56
62
  * 403 with a `missing scope: <name>` hint in the body's `details` array.
57
63
  * Subclasses {@link EmporixForbiddenError} so existing 403 catches still work.
@@ -100,6 +106,7 @@ interface Site$1 {
100
106
  */
101
107
  declare class SiteService {
102
108
  private readonly ctx;
109
+ static readonly channel: "site";
103
110
  constructor(ctx: ClientContext);
104
111
  /** Lists active sites. */
105
112
  list(authCtx?: AuthContext): Promise<Site$1[]>;
@@ -156,6 +163,7 @@ interface SessionContextPatch {
156
163
  */
157
164
  declare class SessionContextService {
158
165
  private readonly ctx;
166
+ static readonly channel: "session-context";
159
167
  constructor(ctx: ClientContext);
160
168
  /**
161
169
  * Retrieves the current session context, or `null` when the server returns
@@ -251,6 +259,7 @@ interface ListConfigOptions {
251
259
  */
252
260
  declare class TenantConfigService {
253
261
  private readonly ctx;
262
+ static readonly channel: "configuration";
254
263
  constructor(ctx: ClientContext);
255
264
  private base;
256
265
  /** List tenant configurations, optionally filtered by `keys`. */
@@ -274,6 +283,7 @@ declare class TenantConfigService {
274
283
  */
275
284
  declare class ClientConfigService {
276
285
  private readonly ctx;
286
+ static readonly channel: "configuration";
277
287
  constructor(ctx: ClientContext);
278
288
  private base;
279
289
  /** List a client's configurations, optionally filtered by `keys`. */
@@ -321,6 +331,7 @@ interface ShoppingListDraft {
321
331
  */
322
332
  declare class ShoppingListService {
323
333
  private readonly ctx;
334
+ static readonly channel: "shopping-list";
324
335
  constructor(ctx: ClientContext);
325
336
  private base;
326
337
  /** The caller's lists (or, with employee scope, all), normalized to an array. */
@@ -397,6 +408,7 @@ type RagType = "PRODUCT";
397
408
  */
398
409
  declare class RagIndexerService {
399
410
  private readonly ctx;
411
+ static readonly channel: "ai-rag-indexer";
400
412
  constructor(ctx: ClientContext);
401
413
  private base;
402
414
  /** The indexable embedding field names for `type` (default `"PRODUCT"`). */
@@ -567,6 +579,7 @@ type NextIdsBatchResponse = Record<string, {
567
579
  */
568
580
  declare class SequentialIdService {
569
581
  private readonly ctx;
582
+ static readonly channel: "sequential-id";
570
583
  constructor(ctx: ClientContext);
571
584
  private base;
572
585
  /** List all sequence schemas for the tenant. */
@@ -740,6 +753,7 @@ interface SetItemFeesOptions {
740
753
  */
741
754
  declare class FeeService {
742
755
  private readonly ctx;
756
+ static readonly channel: "fee";
743
757
  constructor(ctx: ClientContext);
744
758
  private feesBase;
745
759
  private itemFeesBase;
@@ -808,6 +822,7 @@ interface InvokeCloudFunctionOptions<TReq = unknown> {
808
822
  */
809
823
  declare class CloudFunctionsService {
810
824
  private readonly ctx;
825
+ static readonly channel: "cloud-functions";
811
826
  constructor(ctx: ClientContext);
812
827
  private base;
813
828
  invoke<TRes = unknown, TReq = unknown>(functionId: string, options?: InvokeCloudFunctionOptions<TReq>, authCtx?: AuthContext): Promise<TRes>;
@@ -1119,6 +1134,7 @@ interface DeleteConfigOptions {
1119
1134
  */
1120
1135
  declare class WebhookService {
1121
1136
  private readonly ctx;
1137
+ static readonly channel: "webhook";
1122
1138
  constructor(ctx: ClientContext);
1123
1139
  private base;
1124
1140
  /** List the event-subscription catalog with each event's on/off state. */
@@ -1461,6 +1477,7 @@ type InstanceSearchBody = Record<string, unknown>;
1461
1477
  */
1462
1478
  declare class SchemaService {
1463
1479
  private readonly ctx;
1480
+ static readonly channel: "schema";
1464
1481
  constructor(ctx: ClientContext);
1465
1482
  private schemasBase;
1466
1483
  private entitiesBase;
@@ -2162,6 +2179,7 @@ interface DeleteAgentOptions {
2162
2179
  */
2163
2180
  declare class AiService {
2164
2181
  private readonly ctx;
2182
+ static readonly channel: "ai";
2165
2183
  constructor(ctx: ClientContext);
2166
2184
  private base;
2167
2185
  /** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
@@ -2446,6 +2464,7 @@ type TaxCalculationResult = TaxCalculationResponse;
2446
2464
  */
2447
2465
  declare class TaxService {
2448
2466
  private readonly ctx;
2467
+ static readonly channel: "tax";
2449
2468
  constructor(ctx: ClientContext);
2450
2469
  private base;
2451
2470
  /** List all per-location tax configurations. */
@@ -2871,6 +2890,7 @@ type CouponCreated = ResourceLocation$1;
2871
2890
  */
2872
2891
  declare class CouponService {
2873
2892
  private readonly ctx;
2893
+ static readonly channel: "coupon";
2874
2894
  constructor(ctx: ClientContext);
2875
2895
  private base;
2876
2896
  /** List coupons by criteria. Returns a plain array. */
@@ -3172,6 +3192,7 @@ interface RedeemMyPointsInput {
3172
3192
  */
3173
3193
  declare class RewardPointsService {
3174
3194
  private readonly ctx;
3195
+ static readonly channel: "reward-points";
3175
3196
  constructor(ctx: ClientContext);
3176
3197
  /** Base without tenant (customer / public / batch endpoints). */
3177
3198
  private base;
@@ -3341,6 +3362,7 @@ type BrandUpdate = UpdateBrand;
3341
3362
  */
3342
3363
  declare class BrandService {
3343
3364
  private readonly ctx;
3365
+ static readonly channel: "brand";
3344
3366
  constructor(ctx: ClientContext);
3345
3367
  private base;
3346
3368
  /** List all brands. */
@@ -3453,6 +3475,7 @@ type LabelUpdate = LabelUpdate$1;
3453
3475
  */
3454
3476
  declare class LabelService {
3455
3477
  private readonly ctx;
3478
+ static readonly channel: "label";
3456
3479
  constructor(ctx: ClientContext);
3457
3480
  private base;
3458
3481
  /** List all labels. */
@@ -3554,6 +3577,7 @@ type RegionList = Region[];
3554
3577
  */
3555
3578
  declare class CountryService {
3556
3579
  private readonly ctx;
3580
+ static readonly channel: "country";
3557
3581
  constructor(ctx: ClientContext);
3558
3582
  private base;
3559
3583
  /** List all countries. */
@@ -3739,6 +3763,7 @@ type ExchangeRateCreated = ExchangeRateResponse;
3739
3763
  */
3740
3764
  declare class CurrencyService {
3741
3765
  private readonly ctx;
3766
+ static readonly channel: "currency";
3742
3767
  constructor(ctx: ClientContext);
3743
3768
  private base;
3744
3769
  /** List all currencies. */
@@ -4326,6 +4351,7 @@ interface DeliveryCreated {
4326
4351
  */
4327
4352
  declare class ShippingService {
4328
4353
  private readonly ctx;
4354
+ static readonly channel: "shipping";
4329
4355
  constructor(ctx: ClientContext);
4330
4356
  private base;
4331
4357
  private siteBase;
@@ -4933,6 +4959,7 @@ type ReturnCreated = ReturnId;
4933
4959
  */
4934
4960
  declare class ReturnsService {
4935
4961
  private readonly ctx;
4962
+ static readonly channel: "returns";
4936
4963
  constructor(ctx: ClientContext);
4937
4964
  private base;
4938
4965
  /** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
@@ -4984,6 +5011,7 @@ type SepaJobCreated = JobId;
4984
5011
  */
4985
5012
  declare class SepaExportService {
4986
5013
  private readonly ctx;
5014
+ static readonly channel: "sepa-export";
4987
5015
  constructor(ctx: ClientContext);
4988
5016
  private base;
4989
5017
  /** Retrieve a SEPA export file by id. Returns the raw file content (text). */
@@ -5059,6 +5087,7 @@ type ReindexInput = Reindex;
5059
5087
  */
5060
5088
  declare class IndexingService {
5061
5089
  private readonly ctx;
5090
+ static readonly channel: "indexing";
5062
5091
  constructor(ctx: ClientContext);
5063
5092
  private base;
5064
5093
  /** List indexing configurations. */
@@ -5245,6 +5274,7 @@ type ConvertUnitResult = ConversionResponse;
5245
5274
  */
5246
5275
  declare class UnitHandlingService {
5247
5276
  private readonly ctx;
5277
+ static readonly channel: "unit-handling";
5248
5278
  constructor(ctx: ClientContext);
5249
5279
  private base;
5250
5280
  /** Find units (filter/sort/page). */
@@ -5421,6 +5451,7 @@ type CatalogCreated = CreateCatalogResponse;
5421
5451
  */
5422
5452
  declare class CatalogService {
5423
5453
  private readonly ctx;
5454
+ static readonly channel: "catalog";
5424
5455
  constructor(ctx: ClientContext);
5425
5456
  private base;
5426
5457
  /** List catalogs (filtered/sorted). */
@@ -5743,6 +5774,7 @@ type VendorLocationUpdate = LocationUpdate;
5743
5774
  */
5744
5775
  declare class VendorService {
5745
5776
  private readonly ctx;
5777
+ static readonly channel: "vendor";
5746
5778
  constructor(ctx: ClientContext);
5747
5779
  private base;
5748
5780
  /** List all vendors. */
@@ -6217,6 +6249,7 @@ interface RecalculationJobCreated {
6217
6249
  */
6218
6250
  declare class PickPackService {
6219
6251
  private readonly ctx;
6252
+ static readonly channel: "pick-pack";
6220
6253
  constructor(ctx: ClientContext);
6221
6254
  private base;
6222
6255
  private orderPath;
@@ -6569,6 +6602,7 @@ type AdminCustomerAddressUpdate = AddressUpdateDto;
6569
6602
  */
6570
6603
  declare class CustomerAdminService {
6571
6604
  private readonly ctx;
6605
+ static readonly channel: "customer-admin";
6572
6606
  constructor(ctx: ClientContext);
6573
6607
  private base;
6574
6608
  private customerPath;
@@ -7053,6 +7087,7 @@ type ApprovalUsersResult = User[];
7053
7087
  */
7054
7088
  declare class ApprovalService {
7055
7089
  private readonly ctx;
7090
+ static readonly channel: "approval";
7056
7091
  constructor(ctx: ClientContext);
7057
7092
  private base;
7058
7093
  /** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
@@ -7133,9 +7168,7 @@ declare class EmporixClient {
7133
7168
  * Provider tree. Treat as read-only.
7134
7169
  */
7135
7170
  readonly config: ResolvedConfig;
7136
- private readonly resolver;
7137
- private readonly customerRefresh;
7138
- private readonly requestContext;
7171
+ private readonly core;
7139
7172
  constructor(config: EmporixConfig);
7140
7173
  /**
7141
7174
  * Re-binds the storefront price context (currency / siteCode / targetLocation)
@@ -7169,6 +7202,51 @@ declare class EmporixClient {
7169
7202
  setCustomerTokenRefresher(refresher: CustomerTokenRefresher | null): void;
7170
7203
  }
7171
7204
 
7205
+ /** The service-agnostic core shared by `EmporixClient` and `createEmporixClient`. */
7206
+ interface EmporixCore {
7207
+ readonly tenant: string;
7208
+ readonly config: ResolvedConfig;
7209
+ readonly tokenProvider: TokenProvider;
7210
+ setStorefrontContext(ctx: {
7211
+ currency?: string;
7212
+ siteCode?: string;
7213
+ targetLocation?: string;
7214
+ language?: string;
7215
+ }): void;
7216
+ setLogLevel(level: LogLevel, opts?: {
7217
+ service?: ServiceName;
7218
+ force?: boolean;
7219
+ }): void;
7220
+ getLogLevel(service: ServiceName): LogLevel;
7221
+ setCustomerTokenRefresher(refresher: CustomerTokenRefresher | null): void;
7222
+ /** Internal: builds a per-service ClientContext (logger child + HttpClient). */
7223
+ mk(service: ServiceName): ClientContext;
7224
+ }
7225
+ /** Validates config and assembles the shared infrastructure (no services). */
7226
+ declare function createCore(config: EmporixConfig): EmporixCore;
7227
+
7228
+ /**
7229
+ * A service class the factory can instantiate: carries its channel + optional
7230
+ * deps. The constructor signature is intentionally loose (`...args: any[]`) so
7231
+ * both dep-free services (`new Svc(ctx)`) and dependent ones
7232
+ * (`new Svc(ctx, deps)` — e.g. `SegmentService`) satisfy it.
7233
+ */
7234
+ interface ServiceClass<I> {
7235
+ readonly channel: ServiceName;
7236
+ readonly deps?: readonly string[];
7237
+ new (...args: any[]): I;
7238
+ }
7239
+ /**
7240
+ * Tree-shakeable client factory. Builds ONLY the service classes you pass —
7241
+ * imports no services itself, so a bundler drops every service you don't use.
7242
+ * `EmporixClient` remains the batteries-included default; reach for this when
7243
+ * bundle size matters. Dependent services (e.g. `segments`) require their deps
7244
+ * to be present in the map under their public names (`products`, `categories`).
7245
+ */
7246
+ declare function createEmporixClient<S extends Record<string, ServiceClass<unknown>>>(config: EmporixConfig, services: S): Omit<EmporixCore, "mk"> & {
7247
+ [K in keyof S]: InstanceType<S[K]>;
7248
+ };
7249
+
7172
7250
  /**
7173
7251
  * Extracts the product id from a product `itemYrn`
7174
7252
  * (`urn:yaas:hybris:product:product:<tenant>;<productId>`). Cart and order line
@@ -7177,4 +7255,4 @@ declare class EmporixClient {
7177
7255
  */
7178
7256
  declare function productIdFromYrn(yrn: string | undefined): string;
7179
7257
 
7180
- export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type Agent, type AgentInput, type AgentPatchOp, type AgentSearchQuery, AiService, type Approval, type ApprovalCreated, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNotFoundError, EmporixServerError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListSchemasQuery, LocationsService, LogLevel, MediaService, type MetadataFilter, type MinimumFee, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type QuoteInput, type QuoteResult, type QuoteSlotInput, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexInput, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, SchemaService, type SchemaTypeName, type SchemaUpdate, SegmentService, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, ServiceName, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteList, SiteService, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, TokenProvider, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, errorFromResponse, productIdFromYrn };
7258
+ export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type Agent, type AgentInput, type AgentPatchOp, type AgentSearchQuery, AiService, type Approval, type ApprovalCreated, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListSchemasQuery, LocationsService, LogLevel, MediaService, type MetadataFilter, type MinimumFee, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type QuoteInput, type QuoteResult, type QuoteSlotInput, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexInput, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, SchemaService, type SchemaTypeName, type SchemaUpdate, SegmentService, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, type ServiceClass, ServiceName, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteList, SiteService, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, TokenProvider, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, createCore, createEmporixClient, errorFromResponse, productIdFromYrn };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-CD7F_LHT.js';
2
- export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-CD7F_LHT.js';
1
+ import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-DhoFgoKf.js';
2
+ export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-DhoFgoKf.js';
3
3
  import { CustomerService } from './customer.js';
4
4
  export { Address, AddressCreateInput, AddressUpdateInput, Customer, CustomerSession, CustomerSignupInput, CustomerUpdateInput, PasswordChangeInput, PasswordResetConfirmInput, PasswordResetRequestInput } from './customer.js';
5
5
  import { ProductService } from './product.js';
@@ -52,6 +52,12 @@ declare class EmporixValidationError extends EmporixError {
52
52
  /** 5xx — server-side failure. */
53
53
  declare class EmporixServerError extends EmporixError {
54
54
  }
55
+ /** Request aborted by the configured connect/read timeout. No HTTP status. */
56
+ declare class EmporixTimeoutError extends EmporixError {
57
+ }
58
+ /** DNS/TLS/connection-level failure before or during the exchange. No HTTP status. */
59
+ declare class EmporixNetworkError extends EmporixError {
60
+ }
55
61
  /**
56
62
  * 403 with a `missing scope: <name>` hint in the body's `details` array.
57
63
  * Subclasses {@link EmporixForbiddenError} so existing 403 catches still work.
@@ -100,6 +106,7 @@ interface Site$1 {
100
106
  */
101
107
  declare class SiteService {
102
108
  private readonly ctx;
109
+ static readonly channel: "site";
103
110
  constructor(ctx: ClientContext);
104
111
  /** Lists active sites. */
105
112
  list(authCtx?: AuthContext): Promise<Site$1[]>;
@@ -156,6 +163,7 @@ interface SessionContextPatch {
156
163
  */
157
164
  declare class SessionContextService {
158
165
  private readonly ctx;
166
+ static readonly channel: "session-context";
159
167
  constructor(ctx: ClientContext);
160
168
  /**
161
169
  * Retrieves the current session context, or `null` when the server returns
@@ -251,6 +259,7 @@ interface ListConfigOptions {
251
259
  */
252
260
  declare class TenantConfigService {
253
261
  private readonly ctx;
262
+ static readonly channel: "configuration";
254
263
  constructor(ctx: ClientContext);
255
264
  private base;
256
265
  /** List tenant configurations, optionally filtered by `keys`. */
@@ -274,6 +283,7 @@ declare class TenantConfigService {
274
283
  */
275
284
  declare class ClientConfigService {
276
285
  private readonly ctx;
286
+ static readonly channel: "configuration";
277
287
  constructor(ctx: ClientContext);
278
288
  private base;
279
289
  /** List a client's configurations, optionally filtered by `keys`. */
@@ -321,6 +331,7 @@ interface ShoppingListDraft {
321
331
  */
322
332
  declare class ShoppingListService {
323
333
  private readonly ctx;
334
+ static readonly channel: "shopping-list";
324
335
  constructor(ctx: ClientContext);
325
336
  private base;
326
337
  /** The caller's lists (or, with employee scope, all), normalized to an array. */
@@ -397,6 +408,7 @@ type RagType = "PRODUCT";
397
408
  */
398
409
  declare class RagIndexerService {
399
410
  private readonly ctx;
411
+ static readonly channel: "ai-rag-indexer";
400
412
  constructor(ctx: ClientContext);
401
413
  private base;
402
414
  /** The indexable embedding field names for `type` (default `"PRODUCT"`). */
@@ -567,6 +579,7 @@ type NextIdsBatchResponse = Record<string, {
567
579
  */
568
580
  declare class SequentialIdService {
569
581
  private readonly ctx;
582
+ static readonly channel: "sequential-id";
570
583
  constructor(ctx: ClientContext);
571
584
  private base;
572
585
  /** List all sequence schemas for the tenant. */
@@ -740,6 +753,7 @@ interface SetItemFeesOptions {
740
753
  */
741
754
  declare class FeeService {
742
755
  private readonly ctx;
756
+ static readonly channel: "fee";
743
757
  constructor(ctx: ClientContext);
744
758
  private feesBase;
745
759
  private itemFeesBase;
@@ -808,6 +822,7 @@ interface InvokeCloudFunctionOptions<TReq = unknown> {
808
822
  */
809
823
  declare class CloudFunctionsService {
810
824
  private readonly ctx;
825
+ static readonly channel: "cloud-functions";
811
826
  constructor(ctx: ClientContext);
812
827
  private base;
813
828
  invoke<TRes = unknown, TReq = unknown>(functionId: string, options?: InvokeCloudFunctionOptions<TReq>, authCtx?: AuthContext): Promise<TRes>;
@@ -1119,6 +1134,7 @@ interface DeleteConfigOptions {
1119
1134
  */
1120
1135
  declare class WebhookService {
1121
1136
  private readonly ctx;
1137
+ static readonly channel: "webhook";
1122
1138
  constructor(ctx: ClientContext);
1123
1139
  private base;
1124
1140
  /** List the event-subscription catalog with each event's on/off state. */
@@ -1461,6 +1477,7 @@ type InstanceSearchBody = Record<string, unknown>;
1461
1477
  */
1462
1478
  declare class SchemaService {
1463
1479
  private readonly ctx;
1480
+ static readonly channel: "schema";
1464
1481
  constructor(ctx: ClientContext);
1465
1482
  private schemasBase;
1466
1483
  private entitiesBase;
@@ -2162,6 +2179,7 @@ interface DeleteAgentOptions {
2162
2179
  */
2163
2180
  declare class AiService {
2164
2181
  private readonly ctx;
2182
+ static readonly channel: "ai";
2165
2183
  constructor(ctx: ClientContext);
2166
2184
  private base;
2167
2185
  /** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
@@ -2446,6 +2464,7 @@ type TaxCalculationResult = TaxCalculationResponse;
2446
2464
  */
2447
2465
  declare class TaxService {
2448
2466
  private readonly ctx;
2467
+ static readonly channel: "tax";
2449
2468
  constructor(ctx: ClientContext);
2450
2469
  private base;
2451
2470
  /** List all per-location tax configurations. */
@@ -2871,6 +2890,7 @@ type CouponCreated = ResourceLocation$1;
2871
2890
  */
2872
2891
  declare class CouponService {
2873
2892
  private readonly ctx;
2893
+ static readonly channel: "coupon";
2874
2894
  constructor(ctx: ClientContext);
2875
2895
  private base;
2876
2896
  /** List coupons by criteria. Returns a plain array. */
@@ -3172,6 +3192,7 @@ interface RedeemMyPointsInput {
3172
3192
  */
3173
3193
  declare class RewardPointsService {
3174
3194
  private readonly ctx;
3195
+ static readonly channel: "reward-points";
3175
3196
  constructor(ctx: ClientContext);
3176
3197
  /** Base without tenant (customer / public / batch endpoints). */
3177
3198
  private base;
@@ -3341,6 +3362,7 @@ type BrandUpdate = UpdateBrand;
3341
3362
  */
3342
3363
  declare class BrandService {
3343
3364
  private readonly ctx;
3365
+ static readonly channel: "brand";
3344
3366
  constructor(ctx: ClientContext);
3345
3367
  private base;
3346
3368
  /** List all brands. */
@@ -3453,6 +3475,7 @@ type LabelUpdate = LabelUpdate$1;
3453
3475
  */
3454
3476
  declare class LabelService {
3455
3477
  private readonly ctx;
3478
+ static readonly channel: "label";
3456
3479
  constructor(ctx: ClientContext);
3457
3480
  private base;
3458
3481
  /** List all labels. */
@@ -3554,6 +3577,7 @@ type RegionList = Region[];
3554
3577
  */
3555
3578
  declare class CountryService {
3556
3579
  private readonly ctx;
3580
+ static readonly channel: "country";
3557
3581
  constructor(ctx: ClientContext);
3558
3582
  private base;
3559
3583
  /** List all countries. */
@@ -3739,6 +3763,7 @@ type ExchangeRateCreated = ExchangeRateResponse;
3739
3763
  */
3740
3764
  declare class CurrencyService {
3741
3765
  private readonly ctx;
3766
+ static readonly channel: "currency";
3742
3767
  constructor(ctx: ClientContext);
3743
3768
  private base;
3744
3769
  /** List all currencies. */
@@ -4326,6 +4351,7 @@ interface DeliveryCreated {
4326
4351
  */
4327
4352
  declare class ShippingService {
4328
4353
  private readonly ctx;
4354
+ static readonly channel: "shipping";
4329
4355
  constructor(ctx: ClientContext);
4330
4356
  private base;
4331
4357
  private siteBase;
@@ -4933,6 +4959,7 @@ type ReturnCreated = ReturnId;
4933
4959
  */
4934
4960
  declare class ReturnsService {
4935
4961
  private readonly ctx;
4962
+ static readonly channel: "returns";
4936
4963
  constructor(ctx: ClientContext);
4937
4964
  private base;
4938
4965
  /** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
@@ -4984,6 +5011,7 @@ type SepaJobCreated = JobId;
4984
5011
  */
4985
5012
  declare class SepaExportService {
4986
5013
  private readonly ctx;
5014
+ static readonly channel: "sepa-export";
4987
5015
  constructor(ctx: ClientContext);
4988
5016
  private base;
4989
5017
  /** Retrieve a SEPA export file by id. Returns the raw file content (text). */
@@ -5059,6 +5087,7 @@ type ReindexInput = Reindex;
5059
5087
  */
5060
5088
  declare class IndexingService {
5061
5089
  private readonly ctx;
5090
+ static readonly channel: "indexing";
5062
5091
  constructor(ctx: ClientContext);
5063
5092
  private base;
5064
5093
  /** List indexing configurations. */
@@ -5245,6 +5274,7 @@ type ConvertUnitResult = ConversionResponse;
5245
5274
  */
5246
5275
  declare class UnitHandlingService {
5247
5276
  private readonly ctx;
5277
+ static readonly channel: "unit-handling";
5248
5278
  constructor(ctx: ClientContext);
5249
5279
  private base;
5250
5280
  /** Find units (filter/sort/page). */
@@ -5421,6 +5451,7 @@ type CatalogCreated = CreateCatalogResponse;
5421
5451
  */
5422
5452
  declare class CatalogService {
5423
5453
  private readonly ctx;
5454
+ static readonly channel: "catalog";
5424
5455
  constructor(ctx: ClientContext);
5425
5456
  private base;
5426
5457
  /** List catalogs (filtered/sorted). */
@@ -5743,6 +5774,7 @@ type VendorLocationUpdate = LocationUpdate;
5743
5774
  */
5744
5775
  declare class VendorService {
5745
5776
  private readonly ctx;
5777
+ static readonly channel: "vendor";
5746
5778
  constructor(ctx: ClientContext);
5747
5779
  private base;
5748
5780
  /** List all vendors. */
@@ -6217,6 +6249,7 @@ interface RecalculationJobCreated {
6217
6249
  */
6218
6250
  declare class PickPackService {
6219
6251
  private readonly ctx;
6252
+ static readonly channel: "pick-pack";
6220
6253
  constructor(ctx: ClientContext);
6221
6254
  private base;
6222
6255
  private orderPath;
@@ -6569,6 +6602,7 @@ type AdminCustomerAddressUpdate = AddressUpdateDto;
6569
6602
  */
6570
6603
  declare class CustomerAdminService {
6571
6604
  private readonly ctx;
6605
+ static readonly channel: "customer-admin";
6572
6606
  constructor(ctx: ClientContext);
6573
6607
  private base;
6574
6608
  private customerPath;
@@ -7053,6 +7087,7 @@ type ApprovalUsersResult = User[];
7053
7087
  */
7054
7088
  declare class ApprovalService {
7055
7089
  private readonly ctx;
7090
+ static readonly channel: "approval";
7056
7091
  constructor(ctx: ClientContext);
7057
7092
  private base;
7058
7093
  /** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
@@ -7133,9 +7168,7 @@ declare class EmporixClient {
7133
7168
  * Provider tree. Treat as read-only.
7134
7169
  */
7135
7170
  readonly config: ResolvedConfig;
7136
- private readonly resolver;
7137
- private readonly customerRefresh;
7138
- private readonly requestContext;
7171
+ private readonly core;
7139
7172
  constructor(config: EmporixConfig);
7140
7173
  /**
7141
7174
  * Re-binds the storefront price context (currency / siteCode / targetLocation)
@@ -7169,6 +7202,51 @@ declare class EmporixClient {
7169
7202
  setCustomerTokenRefresher(refresher: CustomerTokenRefresher | null): void;
7170
7203
  }
7171
7204
 
7205
+ /** The service-agnostic core shared by `EmporixClient` and `createEmporixClient`. */
7206
+ interface EmporixCore {
7207
+ readonly tenant: string;
7208
+ readonly config: ResolvedConfig;
7209
+ readonly tokenProvider: TokenProvider;
7210
+ setStorefrontContext(ctx: {
7211
+ currency?: string;
7212
+ siteCode?: string;
7213
+ targetLocation?: string;
7214
+ language?: string;
7215
+ }): void;
7216
+ setLogLevel(level: LogLevel, opts?: {
7217
+ service?: ServiceName;
7218
+ force?: boolean;
7219
+ }): void;
7220
+ getLogLevel(service: ServiceName): LogLevel;
7221
+ setCustomerTokenRefresher(refresher: CustomerTokenRefresher | null): void;
7222
+ /** Internal: builds a per-service ClientContext (logger child + HttpClient). */
7223
+ mk(service: ServiceName): ClientContext;
7224
+ }
7225
+ /** Validates config and assembles the shared infrastructure (no services). */
7226
+ declare function createCore(config: EmporixConfig): EmporixCore;
7227
+
7228
+ /**
7229
+ * A service class the factory can instantiate: carries its channel + optional
7230
+ * deps. The constructor signature is intentionally loose (`...args: any[]`) so
7231
+ * both dep-free services (`new Svc(ctx)`) and dependent ones
7232
+ * (`new Svc(ctx, deps)` — e.g. `SegmentService`) satisfy it.
7233
+ */
7234
+ interface ServiceClass<I> {
7235
+ readonly channel: ServiceName;
7236
+ readonly deps?: readonly string[];
7237
+ new (...args: any[]): I;
7238
+ }
7239
+ /**
7240
+ * Tree-shakeable client factory. Builds ONLY the service classes you pass —
7241
+ * imports no services itself, so a bundler drops every service you don't use.
7242
+ * `EmporixClient` remains the batteries-included default; reach for this when
7243
+ * bundle size matters. Dependent services (e.g. `segments`) require their deps
7244
+ * to be present in the map under their public names (`products`, `categories`).
7245
+ */
7246
+ declare function createEmporixClient<S extends Record<string, ServiceClass<unknown>>>(config: EmporixConfig, services: S): Omit<EmporixCore, "mk"> & {
7247
+ [K in keyof S]: InstanceType<S[K]>;
7248
+ };
7249
+
7172
7250
  /**
7173
7251
  * Extracts the product id from a product `itemYrn`
7174
7252
  * (`urn:yaas:hybris:product:product:<tenant>;<productId>`). Cart and order line
@@ -7177,4 +7255,4 @@ declare class EmporixClient {
7177
7255
  */
7178
7256
  declare function productIdFromYrn(yrn: string | undefined): string;
7179
7257
 
7180
- export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type Agent, type AgentInput, type AgentPatchOp, type AgentSearchQuery, AiService, type Approval, type ApprovalCreated, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNotFoundError, EmporixServerError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListSchemasQuery, LocationsService, LogLevel, MediaService, type MetadataFilter, type MinimumFee, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type QuoteInput, type QuoteResult, type QuoteSlotInput, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexInput, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, SchemaService, type SchemaTypeName, type SchemaUpdate, SegmentService, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, ServiceName, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteList, SiteService, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, TokenProvider, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, errorFromResponse, productIdFromYrn };
7258
+ export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type Agent, type AgentInput, type AgentPatchOp, type AgentSearchQuery, AiService, type Approval, type ApprovalCreated, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListSchemasQuery, LocationsService, LogLevel, MediaService, type MetadataFilter, type MinimumFee, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type QuoteInput, type QuoteResult, type QuoteSlotInput, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexInput, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, SchemaService, type SchemaTypeName, type SchemaUpdate, SegmentService, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, type ServiceClass, ServiceName, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteList, SiteService, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, TokenProvider, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, createCore, createEmporixClient, errorFromResponse, productIdFromYrn };