@viu/emporix-sdk 2.38.1 → 3.1.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 (43) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +1 -1
  3. package/dist/availability.d.cts +1 -1
  4. package/dist/availability.d.ts +1 -1
  5. package/dist/cart.d.cts +1 -1
  6. package/dist/cart.d.ts +1 -1
  7. package/dist/category.d.cts +1 -1
  8. package/dist/category.d.ts +1 -1
  9. package/dist/checkout.d.cts +1 -1
  10. package/dist/checkout.d.ts +1 -1
  11. package/dist/companies.d.cts +1 -1
  12. package/dist/companies.d.ts +1 -1
  13. package/dist/contacts.d.cts +1 -1
  14. package/dist/contacts.d.ts +1 -1
  15. package/dist/{context-D64-B1Rz.d.cts → context-CcU93eAL.d.cts} +1 -1
  16. package/dist/{context-D64-B1Rz.d.ts → context-CcU93eAL.d.ts} +1 -1
  17. package/dist/{customer-groups-B6xrwf59.d.cts → customer-groups-Tt9VIA-m.d.cts} +1 -1
  18. package/dist/{customer-groups-YZg22bFc.d.ts → customer-groups-wmO0f-vj.d.ts} +1 -1
  19. package/dist/customer-groups.d.cts +2 -2
  20. package/dist/customer-groups.d.ts +2 -2
  21. package/dist/customer.d.cts +1 -1
  22. package/dist/customer.d.ts +1 -1
  23. package/dist/index.cjs +353 -144
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +158 -54
  26. package/dist/index.d.ts +158 -54
  27. package/dist/index.js +344 -144
  28. package/dist/index.js.map +1 -1
  29. package/dist/locations.d.cts +1 -1
  30. package/dist/locations.d.ts +1 -1
  31. package/dist/media.d.cts +1 -1
  32. package/dist/media.d.ts +1 -1
  33. package/dist/orders.d.cts +1 -1
  34. package/dist/orders.d.ts +1 -1
  35. package/dist/payment.d.cts +1 -1
  36. package/dist/payment.d.ts +1 -1
  37. package/dist/price.d.cts +1 -1
  38. package/dist/price.d.ts +1 -1
  39. package/dist/product.d.cts +1 -1
  40. package/dist/product.d.ts +1 -1
  41. package/dist/segment.d.cts +1 -1
  42. package/dist/segment.d.ts +1 -1
  43. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -382,6 +382,249 @@ function serverAuth(storage) {
382
382
  return token !== null ? auth.customer(token) : auth.anonymous();
383
383
  }
384
384
 
385
+ // src/core/browser-storage.ts
386
+ var browser = globalThis;
387
+ function createListenerSet() {
388
+ const listeners = /* @__PURE__ */ new Set();
389
+ return {
390
+ add(l) {
391
+ listeners.add(l);
392
+ return () => listeners.delete(l);
393
+ },
394
+ notify(value) {
395
+ for (const l of listeners) {
396
+ try {
397
+ l(value);
398
+ } catch {
399
+ }
400
+ }
401
+ }
402
+ };
403
+ }
404
+ function createMemoryStorage(opts = {}) {
405
+ let token = opts.initial ?? null;
406
+ let cartId = null;
407
+ let anon = null;
408
+ let siteCode = null;
409
+ let language = null;
410
+ let activeLegalEntityId = null;
411
+ let refreshToken = null;
412
+ let saasToken = null;
413
+ const tokenListeners = /* @__PURE__ */ new Set();
414
+ const all = createListenerSet();
415
+ return {
416
+ getCustomerToken: () => token,
417
+ setCustomerToken: (t) => {
418
+ token = t;
419
+ for (const l of tokenListeners) l(token);
420
+ all.notify("customerToken");
421
+ },
422
+ subscribe: (l) => {
423
+ tokenListeners.add(l);
424
+ return () => tokenListeners.delete(l);
425
+ },
426
+ getCartId: () => cartId,
427
+ setCartId: (id) => {
428
+ cartId = id;
429
+ all.notify("cartId");
430
+ },
431
+ getAnonymousSession: () => anon,
432
+ setAnonymousSession: (s) => {
433
+ anon = s;
434
+ all.notify("anonymousSession");
435
+ },
436
+ getSiteCode: () => siteCode,
437
+ setSiteCode: (code) => {
438
+ siteCode = code;
439
+ all.notify("siteCode");
440
+ },
441
+ getLanguage: () => language,
442
+ setLanguage: (l) => {
443
+ language = l;
444
+ all.notify("language");
445
+ },
446
+ getActiveLegalEntityId: () => activeLegalEntityId,
447
+ setActiveLegalEntityId: (id) => {
448
+ activeLegalEntityId = id;
449
+ all.notify("activeLegalEntityId");
450
+ },
451
+ getRefreshToken: () => refreshToken,
452
+ setRefreshToken: (t) => {
453
+ refreshToken = t;
454
+ all.notify("refreshToken");
455
+ },
456
+ getSaasToken: () => saasToken,
457
+ setSaasToken: (t) => {
458
+ saasToken = t;
459
+ all.notify("saasToken");
460
+ },
461
+ subscribeAll: (l) => all.add(l)
462
+ };
463
+ }
464
+ function fromWebStorage(storage, opts = {}) {
465
+ const tokenKey = opts.key ?? STORAGE_KEYS.customerToken;
466
+ const tokenListeners = /* @__PURE__ */ new Set();
467
+ const all = createListenerSet();
468
+ return {
469
+ getCustomerToken: () => storage.getItem(tokenKey),
470
+ setCustomerToken: (t) => {
471
+ if (t === null) storage.removeItem(tokenKey);
472
+ else storage.setItem(tokenKey, t);
473
+ for (const l of tokenListeners) l(t);
474
+ all.notify("customerToken");
475
+ },
476
+ subscribe: (l) => {
477
+ tokenListeners.add(l);
478
+ return () => tokenListeners.delete(l);
479
+ },
480
+ getCartId: () => storage.getItem(STORAGE_KEYS.cartId),
481
+ setCartId: (id) => {
482
+ if (id === null) storage.removeItem(STORAGE_KEYS.cartId);
483
+ else storage.setItem(STORAGE_KEYS.cartId, id);
484
+ all.notify("cartId");
485
+ },
486
+ getAnonymousSession: () => parseAnonymousSession(storage.getItem(STORAGE_KEYS.anonymousSession)),
487
+ setAnonymousSession: (s) => {
488
+ if (s === null) storage.removeItem(STORAGE_KEYS.anonymousSession);
489
+ else
490
+ storage.setItem(
491
+ STORAGE_KEYS.anonymousSession,
492
+ JSON.stringify({ refreshToken: s.refreshToken, sessionId: s.sessionId })
493
+ );
494
+ all.notify("anonymousSession");
495
+ },
496
+ getSiteCode: () => storage.getItem(STORAGE_KEYS.siteCode),
497
+ setSiteCode: (code) => {
498
+ if (code === null) storage.removeItem(STORAGE_KEYS.siteCode);
499
+ else storage.setItem(STORAGE_KEYS.siteCode, code);
500
+ all.notify("siteCode");
501
+ },
502
+ getLanguage: () => storage.getItem(STORAGE_KEYS.language),
503
+ setLanguage: (l) => {
504
+ if (l === null) storage.removeItem(STORAGE_KEYS.language);
505
+ else storage.setItem(STORAGE_KEYS.language, l);
506
+ all.notify("language");
507
+ },
508
+ getActiveLegalEntityId: () => storage.getItem(STORAGE_KEYS.activeLegalEntityId),
509
+ setActiveLegalEntityId: (id) => {
510
+ if (id === null) storage.removeItem(STORAGE_KEYS.activeLegalEntityId);
511
+ else storage.setItem(STORAGE_KEYS.activeLegalEntityId, id);
512
+ all.notify("activeLegalEntityId");
513
+ },
514
+ getRefreshToken: () => storage.getItem(STORAGE_KEYS.refreshToken),
515
+ setRefreshToken: (t) => {
516
+ if (t === null) storage.removeItem(STORAGE_KEYS.refreshToken);
517
+ else storage.setItem(STORAGE_KEYS.refreshToken, t);
518
+ all.notify("refreshToken");
519
+ },
520
+ getSaasToken: () => storage.getItem(STORAGE_KEYS.saasToken),
521
+ setSaasToken: (t) => {
522
+ if (t === null) storage.removeItem(STORAGE_KEYS.saasToken);
523
+ else storage.setItem(STORAGE_KEYS.saasToken, t);
524
+ all.notify("saasToken");
525
+ },
526
+ subscribeAll: (l) => all.add(l)
527
+ };
528
+ }
529
+ function createLocalStorage(opts = {}) {
530
+ const store = browser.localStorage;
531
+ if (store === void 0) {
532
+ console.warn("[emporix] localStorage unavailable; falling back to in-memory storage");
533
+ return createMemoryStorage();
534
+ }
535
+ return fromWebStorage(store, opts);
536
+ }
537
+ var createLocalStorageStorage = createLocalStorage;
538
+ function createSessionStorage(opts = {}) {
539
+ const store = browser.sessionStorage;
540
+ if (store === void 0) {
541
+ console.warn("[emporix] sessionStorage unavailable; falling back to in-memory storage");
542
+ return createMemoryStorage();
543
+ }
544
+ return fromWebStorage(store, opts);
545
+ }
546
+ function createCookieStorage(opts = {}) {
547
+ const sameSite = opts.sameSite ?? "lax";
548
+ const secure = opts.secure ?? browser.location?.protocol === "https:";
549
+ const doc = browser.document;
550
+ if (doc === void 0) {
551
+ console.warn("[emporix] document unavailable; cookie storage falling back to in-memory");
552
+ return createMemoryStorage();
553
+ }
554
+ const attrs = `path=/; SameSite=${sameSite}${secure ? "; Secure" : ""}`;
555
+ const all = createListenerSet();
556
+ const storage = createCookieBackedStorage(
557
+ {
558
+ get: (name) => {
559
+ for (const part of doc.cookie.split("; ")) {
560
+ const [k, ...v] = part.split("=");
561
+ if (k === name) return decodeURIComponent(v.join("=")) || null;
562
+ }
563
+ return null;
564
+ },
565
+ set: (name, value) => {
566
+ doc.cookie = value === null ? `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; ${attrs}` : `${name}=${encodeURIComponent(value)}; ${attrs}`;
567
+ }
568
+ },
569
+ {
570
+ ...opts.name !== void 0 ? { tokenName: opts.name } : {},
571
+ notify: (key) => all.notify(key)
572
+ }
573
+ );
574
+ return { ...storage, subscribeAll: (l) => all.add(l) };
575
+ }
576
+
577
+ // src/core/query-keys.ts
578
+ function emporixKey(resource, args, context) {
579
+ const meta = {
580
+ tenant: context.tenant,
581
+ authKind: context.authKind
582
+ };
583
+ if (context.siteCode !== void 0) {
584
+ meta.siteCode = context.siteCode;
585
+ }
586
+ if (context.language !== void 0) {
587
+ meta.language = context.language;
588
+ }
589
+ return ["emporix", resource, ...args, meta];
590
+ }
591
+ function siteMeta(site, siteCode, language) {
592
+ return site === "full" ? { siteCode, language } : site === "language" ? { language } : {};
593
+ }
594
+
595
+ // src/core/customer-session-store.ts
596
+ var stores = /* @__PURE__ */ new WeakMap();
597
+ function getCustomerSessionStore(storage) {
598
+ const existing = stores.get(storage);
599
+ if (existing) return existing;
600
+ let state = {
601
+ token: storage.getCustomerToken(),
602
+ refreshToken: storage.getRefreshToken(),
603
+ saasToken: storage.getSaasToken?.() ?? null
604
+ };
605
+ const listeners = /* @__PURE__ */ new Set();
606
+ const store = {
607
+ getSnapshot: () => state,
608
+ setState: (next) => {
609
+ const resolved = typeof next === "function" ? next(state) : next;
610
+ if (resolved === state) return;
611
+ state = resolved;
612
+ for (const listener of listeners) listener();
613
+ },
614
+ subscribe: (listener) => {
615
+ listeners.add(listener);
616
+ return () => {
617
+ listeners.delete(listener);
618
+ };
619
+ }
620
+ };
621
+ storage.subscribe?.((t) => {
622
+ store.setState((s) => s.token === t ? s : { ...s, token: t });
623
+ });
624
+ stores.set(storage, store);
625
+ return store;
626
+ }
627
+
385
628
  // src/core/sse.ts
386
629
  function parseFrame(frame) {
387
630
  const ev = { data: "" };
@@ -702,7 +945,7 @@ var HttpClient = class {
702
945
  };
703
946
 
704
947
  // package.json
705
- var version = "2.38.1";
948
+ var version = "3.1.0";
706
949
 
707
950
  // src/version.ts
708
951
  var SDK_VERSION = version;
@@ -3878,49 +4121,8 @@ var ReturnsService = class {
3878
4121
  }
3879
4122
  };
3880
4123
 
3881
- // src/services/sepa-export.ts
3882
- var SERVICE21 = { kind: "service" };
3883
- var SepaExportService = class {
3884
- constructor(ctx) {
3885
- this.ctx = ctx;
3886
- }
3887
- ctx;
3888
- static channel = "sepa-export";
3889
- base() {
3890
- return `/sepa-export/${this.ctx.tenant}`;
3891
- }
3892
- /** Retrieve a SEPA export file by id. Returns the raw file content (text). */
3893
- async getFile(fileId, auth2 = SERVICE21) {
3894
- const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
3895
- const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
3896
- if (!res.ok) {
3897
- const errBody = await res.text().catch(() => void 0);
3898
- throw errorFromResponse(res.status, `GET ${path} \u2192 ${res.status}`, errBody);
3899
- }
3900
- return res.text();
3901
- }
3902
- /** List export jobs. */
3903
- async listJobs(query = {}, auth2 = SERVICE21) {
3904
- return this.ctx.http.request({
3905
- method: "GET",
3906
- path: `${this.base()}/jobs`,
3907
- auth: auth2,
3908
- ...Object.keys(query).length ? { query } : {}
3909
- });
3910
- }
3911
- /** Create an export job. */
3912
- async createJob(input, auth2 = SERVICE21) {
3913
- return this.ctx.http.request({
3914
- method: "POST",
3915
- path: `${this.base()}/jobs`,
3916
- auth: auth2,
3917
- body: input
3918
- });
3919
- }
3920
- };
3921
-
3922
4124
  // src/services/indexing.ts
3923
- var SERVICE22 = { kind: "service" };
4125
+ var SERVICE21 = { kind: "service" };
3924
4126
  var IndexingService = class {
3925
4127
  constructor(ctx) {
3926
4128
  this.ctx = ctx;
@@ -3931,11 +4133,11 @@ var IndexingService = class {
3931
4133
  return `/indexing/${this.ctx.tenant}`;
3932
4134
  }
3933
4135
  /** List indexing configurations. */
3934
- async listConfigurations(auth2 = SERVICE22) {
4136
+ async listConfigurations(auth2 = SERVICE21) {
3935
4137
  return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
3936
4138
  }
3937
4139
  /** Get a configuration by provider name. */
3938
- async getConfiguration(provider, auth2 = SERVICE22) {
4140
+ async getConfiguration(provider, auth2 = SERVICE21) {
3939
4141
  return this.ctx.http.request({
3940
4142
  method: "GET",
3941
4143
  path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
@@ -3943,7 +4145,7 @@ var IndexingService = class {
3943
4145
  });
3944
4146
  }
3945
4147
  /** Create a configuration. */
3946
- async createConfiguration(input, auth2 = SERVICE22) {
4148
+ async createConfiguration(input, auth2 = SERVICE21) {
3947
4149
  return this.ctx.http.request({
3948
4150
  method: "POST",
3949
4151
  path: `${this.base()}/configurations`,
@@ -3952,7 +4154,7 @@ var IndexingService = class {
3952
4154
  });
3953
4155
  }
3954
4156
  /** Update a configuration by provider name. */
3955
- async updateConfiguration(provider, input, auth2 = SERVICE22) {
4157
+ async updateConfiguration(provider, input, auth2 = SERVICE21) {
3956
4158
  await this.ctx.http.request({
3957
4159
  method: "PUT",
3958
4160
  path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
@@ -3961,7 +4163,7 @@ var IndexingService = class {
3961
4163
  });
3962
4164
  }
3963
4165
  /** Delete a configuration by provider name. */
3964
- async deleteConfiguration(provider, auth2 = SERVICE22) {
4166
+ async deleteConfiguration(provider, auth2 = SERVICE21) {
3965
4167
  await this.ctx.http.request({
3966
4168
  method: "DELETE",
3967
4169
  path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
@@ -3969,11 +4171,11 @@ var IndexingService = class {
3969
4171
  });
3970
4172
  }
3971
4173
  /** List public indexing configurations. */
3972
- async listPublicConfigurations(auth2 = SERVICE22) {
4174
+ async listPublicConfigurations(auth2 = SERVICE21) {
3973
4175
  return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
3974
4176
  }
3975
4177
  /** Get a public configuration by provider name. */
3976
- async getPublicConfiguration(provider, auth2 = SERVICE22) {
4178
+ async getPublicConfiguration(provider, auth2 = SERVICE21) {
3977
4179
  return this.ctx.http.request({
3978
4180
  method: "GET",
3979
4181
  path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
@@ -3986,7 +4188,7 @@ var IndexingService = class {
3986
4188
  * (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
3987
4189
  * `entityType` is already `IN_PROGRESS`, that running job (`200`).
3988
4190
  */
3989
- async createReindexJob(input, auth2 = SERVICE22) {
4191
+ async createReindexJob(input, auth2 = SERVICE21) {
3990
4192
  return this.ctx.http.request({
3991
4193
  method: "POST",
3992
4194
  path: `${this.base()}/reindex-jobs`,
@@ -3995,7 +4197,7 @@ var IndexingService = class {
3995
4197
  });
3996
4198
  }
3997
4199
  /** List reindex jobs (paginated). */
3998
- async listReindexJobs(opts = {}, auth2 = SERVICE22) {
4200
+ async listReindexJobs(opts = {}, auth2 = SERVICE21) {
3999
4201
  const pageNumber = opts.pageNumber ?? 1;
4000
4202
  const pageSize = opts.pageSize ?? 50;
4001
4203
  const query = { pageNumber, pageSize };
@@ -4016,7 +4218,7 @@ var IndexingService = class {
4016
4218
  );
4017
4219
  }
4018
4220
  /** Fetch one reindex job by id. */
4019
- async getReindexJob(reindexJobId, auth2 = SERVICE22) {
4221
+ async getReindexJob(reindexJobId, auth2 = SERVICE21) {
4020
4222
  return this.ctx.http.request({
4021
4223
  method: "GET",
4022
4224
  path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
@@ -4028,13 +4230,13 @@ var IndexingService = class {
4028
4230
  * @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
4029
4231
  * (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
4030
4232
  */
4031
- async reindex(input, auth2 = SERVICE22) {
4233
+ async reindex(input, auth2 = SERVICE21) {
4032
4234
  await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
4033
4235
  }
4034
4236
  };
4035
4237
 
4036
4238
  // src/services/imports.ts
4037
- var SERVICE23 = { kind: "service" };
4239
+ var SERVICE22 = { kind: "service" };
4038
4240
  var DEFAULT_PAGE_SIZE = 50;
4039
4241
  function pageArgs(opts) {
4040
4242
  return { pageNumber: opts.pageNumber ?? 1, pageSize: opts.pageSize ?? DEFAULT_PAGE_SIZE };
@@ -4084,7 +4286,7 @@ var ImportService = class {
4084
4286
  return `/importtool/${this.ctx.tenant}`;
4085
4287
  }
4086
4288
  /** List every import configuration of the tenant. */
4087
- async listConfigs(auth2 = SERVICE23) {
4289
+ async listConfigs(auth2 = SERVICE22) {
4088
4290
  return this.ctx.http.request({
4089
4291
  method: "GET",
4090
4292
  path: `${this.base()}/configs`,
@@ -4092,7 +4294,7 @@ var ImportService = class {
4092
4294
  });
4093
4295
  }
4094
4296
  /** Fetch one configuration by id. */
4095
- async getConfig(id, auth2 = SERVICE23) {
4297
+ async getConfig(id, auth2 = SERVICE22) {
4096
4298
  return this.ctx.http.request({
4097
4299
  method: "GET",
4098
4300
  path: `${this.base()}/configs/${encodeURIComponent(id)}`,
@@ -4100,7 +4302,7 @@ var ImportService = class {
4100
4302
  });
4101
4303
  }
4102
4304
  /** List the streams of one configuration. */
4103
- async listStreams(configId, auth2 = SERVICE23) {
4305
+ async listStreams(configId, auth2 = SERVICE22) {
4104
4306
  return this.ctx.http.request({
4105
4307
  method: "GET",
4106
4308
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/streams`,
@@ -4108,7 +4310,7 @@ var ImportService = class {
4108
4310
  });
4109
4311
  }
4110
4312
  /** Fetch one stream by id. */
4111
- async getStream(id, auth2 = SERVICE23) {
4313
+ async getStream(id, auth2 = SERVICE22) {
4112
4314
  return this.ctx.http.request({
4113
4315
  method: "GET",
4114
4316
  path: `${this.base()}/streams/${encodeURIComponent(id)}`,
@@ -4120,7 +4322,7 @@ var ImportService = class {
4120
4322
  * configured — the service answers `204`, not `404`, so an absent schedule is
4121
4323
  * a normal result rather than an error.
4122
4324
  */
4123
- async getSchedule(configId, auth2 = SERVICE23) {
4325
+ async getSchedule(configId, auth2 = SERVICE22) {
4124
4326
  const res = await this.ctx.http.request({
4125
4327
  method: "GET",
4126
4328
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
@@ -4129,7 +4331,7 @@ var ImportService = class {
4129
4331
  return res ?? null;
4130
4332
  }
4131
4333
  /** Create or replace a configuration's schedule. */
4132
- async setSchedule(configId, input, auth2 = SERVICE23) {
4334
+ async setSchedule(configId, input, auth2 = SERVICE22) {
4133
4335
  return this.ctx.http.request({
4134
4336
  method: "PUT",
4135
4337
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
@@ -4143,7 +4345,7 @@ var ImportService = class {
4143
4345
  *
4144
4346
  * Not retried on a 5xx: a POST that timed out may already have queued a run.
4145
4347
  */
4146
- async triggerRun(configId, input = {}, auth2 = SERVICE23) {
4348
+ async triggerRun(configId, input = {}, auth2 = SERVICE22) {
4147
4349
  return this.ctx.http.request({
4148
4350
  method: "POST",
4149
4351
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/runs`,
@@ -4152,7 +4354,7 @@ var ImportService = class {
4152
4354
  });
4153
4355
  }
4154
4356
  /** List a configuration's runs, newest first. */
4155
- async listRuns(configId, opts = {}, auth2 = SERVICE23) {
4357
+ async listRuns(configId, opts = {}, auth2 = SERVICE22) {
4156
4358
  const args = pageArgs(opts);
4157
4359
  const wire = await this.ctx.http.request({
4158
4360
  method: "GET",
@@ -4163,7 +4365,7 @@ var ImportService = class {
4163
4365
  return toPage(wire, args);
4164
4366
  }
4165
4367
  /** Fetch one run with its per-stream progress. */
4166
- async getRun(runId, auth2 = SERVICE23) {
4368
+ async getRun(runId, auth2 = SERVICE22) {
4167
4369
  return this.ctx.http.request({
4168
4370
  method: "GET",
4169
4371
  path: `${this.base()}/runs/${encodeURIComponent(runId)}`,
@@ -4183,7 +4385,7 @@ var ImportService = class {
4183
4385
  * arrive as `{ type: "unknown" }` rather than throwing — see
4184
4386
  * {@link ImportRunEvent}.
4185
4387
  */
4186
- async *streamRun(runId, auth2 = SERVICE23) {
4388
+ async *streamRun(runId, auth2 = SERVICE22) {
4187
4389
  const frames = this.ctx.http.requestStream({
4188
4390
  method: "GET",
4189
4391
  path: `${this.base()}/runs/${encodeURIComponent(runId)}/events`,
@@ -4198,7 +4400,7 @@ var ImportService = class {
4198
4400
  * a result, not an error. A state conflict may instead come back as a `409`,
4199
4401
  * which does throw.
4200
4402
  */
4201
- async cancelRun(runId, opts = {}, auth2 = SERVICE23) {
4403
+ async cancelRun(runId, opts = {}, auth2 = SERVICE22) {
4202
4404
  const query = {};
4203
4405
  if (opts.force) query.force = "true";
4204
4406
  return this.ctx.http.request({
@@ -4209,7 +4411,7 @@ var ImportService = class {
4209
4411
  });
4210
4412
  }
4211
4413
  /** List the errors recorded during a run. */
4212
- async listRunErrors(runId, opts = {}, auth2 = SERVICE23) {
4414
+ async listRunErrors(runId, opts = {}, auth2 = SERVICE22) {
4213
4415
  const args = pageArgs(opts);
4214
4416
  const wire = await this.ctx.http.request({
4215
4417
  method: "GET",
@@ -4220,7 +4422,7 @@ var ImportService = class {
4220
4422
  return toPage(wire, args);
4221
4423
  }
4222
4424
  /** List the target types that hold imported records — the valid `type` values for {@link searchRecords}. */
4223
- async listDataTypes(auth2 = SERVICE23) {
4425
+ async listDataTypes(auth2 = SERVICE22) {
4224
4426
  return this.ctx.http.request({
4225
4427
  method: "GET",
4226
4428
  path: `${this.base()}/data/types`,
@@ -4228,7 +4430,7 @@ var ImportService = class {
4228
4430
  });
4229
4431
  }
4230
4432
  /** Search imported records of one target type. */
4231
- async searchRecords(opts, auth2 = SERVICE23) {
4433
+ async searchRecords(opts, auth2 = SERVICE22) {
4232
4434
  const args = pageArgs(opts);
4233
4435
  const query = {
4234
4436
  type: opts.type,
@@ -4246,7 +4448,7 @@ var ImportService = class {
4246
4448
  return toPage(wire, args);
4247
4449
  }
4248
4450
  /** Search the imported records produced by one stream. */
4249
- async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE23) {
4451
+ async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE22) {
4250
4452
  const args = pageArgs(opts);
4251
4453
  const query = {
4252
4454
  page: args.pageNumber - 1,
@@ -4265,7 +4467,7 @@ var ImportService = class {
4265
4467
  };
4266
4468
 
4267
4469
  // src/services/unit-handling.ts
4268
- var SERVICE24 = { kind: "service" };
4470
+ var SERVICE23 = { kind: "service" };
4269
4471
  var UnitHandlingService = class {
4270
4472
  constructor(ctx) {
4271
4473
  this.ctx = ctx;
@@ -4276,7 +4478,7 @@ var UnitHandlingService = class {
4276
4478
  return `/unit-handling/${this.ctx.tenant}`;
4277
4479
  }
4278
4480
  /** Find units (filter/sort/page). */
4279
- async listUnits(query = {}, auth2 = SERVICE24) {
4481
+ async listUnits(query = {}, auth2 = SERVICE23) {
4280
4482
  return this.ctx.http.request({
4281
4483
  method: "GET",
4282
4484
  path: `${this.base()}/units`,
@@ -4285,7 +4487,7 @@ var UnitHandlingService = class {
4285
4487
  });
4286
4488
  }
4287
4489
  /** Retrieve a unit by code. */
4288
- async getUnit(unitCode, auth2 = SERVICE24) {
4490
+ async getUnit(unitCode, auth2 = SERVICE23) {
4289
4491
  return this.ctx.http.request({
4290
4492
  method: "GET",
4291
4493
  path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
@@ -4293,11 +4495,11 @@ var UnitHandlingService = class {
4293
4495
  });
4294
4496
  }
4295
4497
  /** Add a new unit. */
4296
- async createUnit(input, auth2 = SERVICE24) {
4498
+ async createUnit(input, auth2 = SERVICE23) {
4297
4499
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
4298
4500
  }
4299
4501
  /** Update a unit by code. */
4300
- async updateUnit(unitCode, input, auth2 = SERVICE24) {
4502
+ async updateUnit(unitCode, input, auth2 = SERVICE23) {
4301
4503
  await this.ctx.http.request({
4302
4504
  method: "PUT",
4303
4505
  path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
@@ -4306,7 +4508,7 @@ var UnitHandlingService = class {
4306
4508
  });
4307
4509
  }
4308
4510
  /** Delete a unit by code. */
4309
- async deleteUnit(unitCode, auth2 = SERVICE24) {
4511
+ async deleteUnit(unitCode, auth2 = SERVICE23) {
4310
4512
  await this.ctx.http.request({
4311
4513
  method: "DELETE",
4312
4514
  path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
@@ -4314,7 +4516,7 @@ var UnitHandlingService = class {
4314
4516
  });
4315
4517
  }
4316
4518
  /** Delete multiple units by code (bulk). The codes are sent as the request body. */
4317
- async deleteUnits(codes, auth2 = SERVICE24) {
4519
+ async deleteUnits(codes, auth2 = SERVICE23) {
4318
4520
  await this.ctx.http.request({
4319
4521
  method: "DELETE",
4320
4522
  path: `${this.base()}/units`,
@@ -4323,7 +4525,7 @@ var UnitHandlingService = class {
4323
4525
  });
4324
4526
  }
4325
4527
  /** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
4326
- async getConversionFactor(input, auth2 = SERVICE24) {
4528
+ async getConversionFactor(input, auth2 = SERVICE23) {
4327
4529
  return this.ctx.http.request({
4328
4530
  method: "PUT",
4329
4531
  path: `${this.base()}/units/conversion-factor-commands`,
@@ -4332,7 +4534,7 @@ var UnitHandlingService = class {
4332
4534
  });
4333
4535
  }
4334
4536
  /** Convert a value between units (`PUT /units/convert-unit-commands`). */
4335
- async convertUnit(input, auth2 = SERVICE24) {
4537
+ async convertUnit(input, auth2 = SERVICE23) {
4336
4538
  return this.ctx.http.request({
4337
4539
  method: "PUT",
4338
4540
  path: `${this.base()}/units/convert-unit-commands`,
@@ -4341,13 +4543,13 @@ var UnitHandlingService = class {
4341
4543
  });
4342
4544
  }
4343
4545
  /** List all unit types. */
4344
- async listUnitTypes(auth2 = SERVICE24) {
4546
+ async listUnitTypes(auth2 = SERVICE23) {
4345
4547
  return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
4346
4548
  }
4347
4549
  };
4348
4550
 
4349
4551
  // src/services/catalog.ts
4350
- var SERVICE25 = { kind: "service" };
4552
+ var SERVICE24 = { kind: "service" };
4351
4553
  var CatalogService = class {
4352
4554
  constructor(ctx) {
4353
4555
  this.ctx = ctx;
@@ -4358,7 +4560,7 @@ var CatalogService = class {
4358
4560
  return `/catalog/${this.ctx.tenant}/catalogs`;
4359
4561
  }
4360
4562
  /** List catalogs (filtered/sorted). */
4361
- async listCatalogs(query = {}, auth2 = SERVICE25) {
4563
+ async listCatalogs(query = {}, auth2 = SERVICE24) {
4362
4564
  return this.ctx.http.request({
4363
4565
  method: "GET",
4364
4566
  path: this.base(),
@@ -4367,7 +4569,7 @@ var CatalogService = class {
4367
4569
  });
4368
4570
  }
4369
4571
  /** Retrieve a catalog by id. */
4370
- async getCatalog(catalogId, auth2 = SERVICE25) {
4572
+ async getCatalog(catalogId, auth2 = SERVICE24) {
4371
4573
  return this.ctx.http.request({
4372
4574
  method: "GET",
4373
4575
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -4375,7 +4577,7 @@ var CatalogService = class {
4375
4577
  });
4376
4578
  }
4377
4579
  /** Retrieve all catalogs that contain a category. */
4378
- async getCatalogsForCategory(categoryId, auth2 = SERVICE25) {
4580
+ async getCatalogsForCategory(categoryId, auth2 = SERVICE24) {
4379
4581
  return this.ctx.http.request({
4380
4582
  method: "GET",
4381
4583
  path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
@@ -4383,11 +4585,11 @@ var CatalogService = class {
4383
4585
  });
4384
4586
  }
4385
4587
  /** Create a catalog. */
4386
- async createCatalog(input, auth2 = SERVICE25) {
4588
+ async createCatalog(input, auth2 = SERVICE24) {
4387
4589
  return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
4388
4590
  }
4389
4591
  /** Upsert a catalog by id (`PUT`). */
4390
- async updateCatalog(catalogId, input, auth2 = SERVICE25) {
4592
+ async updateCatalog(catalogId, input, auth2 = SERVICE24) {
4391
4593
  return this.ctx.http.request({
4392
4594
  method: "PUT",
4393
4595
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -4396,7 +4598,7 @@ var CatalogService = class {
4396
4598
  });
4397
4599
  }
4398
4600
  /** Partially update a catalog by id (`PATCH`). */
4399
- async patchCatalog(catalogId, patch, auth2 = SERVICE25) {
4601
+ async patchCatalog(catalogId, patch, auth2 = SERVICE24) {
4400
4602
  await this.ctx.http.request({
4401
4603
  method: "PATCH",
4402
4604
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -4405,7 +4607,7 @@ var CatalogService = class {
4405
4607
  });
4406
4608
  }
4407
4609
  /** Remove a catalog by id. */
4408
- async deleteCatalog(catalogId, auth2 = SERVICE25) {
4610
+ async deleteCatalog(catalogId, auth2 = SERVICE24) {
4409
4611
  await this.ctx.http.request({
4410
4612
  method: "DELETE",
4411
4613
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -4415,7 +4617,7 @@ var CatalogService = class {
4415
4617
  };
4416
4618
 
4417
4619
  // src/services/vendor.ts
4418
- var SERVICE26 = { kind: "service" };
4620
+ var SERVICE25 = { kind: "service" };
4419
4621
  var VendorService = class {
4420
4622
  constructor(ctx) {
4421
4623
  this.ctx = ctx;
@@ -4427,7 +4629,7 @@ var VendorService = class {
4427
4629
  }
4428
4630
  // --- Vendors ---
4429
4631
  /** List all vendors. */
4430
- async listVendors(query = {}, auth2 = SERVICE26) {
4632
+ async listVendors(query = {}, auth2 = SERVICE25) {
4431
4633
  return this.ctx.http.request({
4432
4634
  method: "GET",
4433
4635
  path: `${this.base()}/vendors`,
@@ -4436,7 +4638,7 @@ var VendorService = class {
4436
4638
  });
4437
4639
  }
4438
4640
  /** Retrieve a vendor by id. */
4439
- async getVendor(vendorId, auth2 = SERVICE26) {
4641
+ async getVendor(vendorId, auth2 = SERVICE25) {
4440
4642
  return this.ctx.http.request({
4441
4643
  method: "GET",
4442
4644
  path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
@@ -4444,7 +4646,7 @@ var VendorService = class {
4444
4646
  });
4445
4647
  }
4446
4648
  /** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
4447
- async searchVendors(query, auth2 = SERVICE26) {
4649
+ async searchVendors(query, auth2 = SERVICE25) {
4448
4650
  const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
4449
4651
  return this.ctx.http.request({
4450
4652
  method: "POST",
@@ -4454,11 +4656,11 @@ var VendorService = class {
4454
4656
  });
4455
4657
  }
4456
4658
  /** Create a vendor. */
4457
- async createVendor(input, auth2 = SERVICE26) {
4659
+ async createVendor(input, auth2 = SERVICE25) {
4458
4660
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
4459
4661
  }
4460
4662
  /** Upsert a vendor by id (`PUT`). */
4461
- async updateVendor(vendorId, input, auth2 = SERVICE26) {
4663
+ async updateVendor(vendorId, input, auth2 = SERVICE25) {
4462
4664
  await this.ctx.http.request({
4463
4665
  method: "PUT",
4464
4666
  path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
@@ -4467,7 +4669,7 @@ var VendorService = class {
4467
4669
  });
4468
4670
  }
4469
4671
  /** Delete a vendor by id. */
4470
- async deleteVendor(vendorId, auth2 = SERVICE26) {
4672
+ async deleteVendor(vendorId, auth2 = SERVICE25) {
4471
4673
  await this.ctx.http.request({
4472
4674
  method: "DELETE",
4473
4675
  path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
@@ -4476,7 +4678,7 @@ var VendorService = class {
4476
4678
  }
4477
4679
  // --- Vendor locations ---
4478
4680
  /** List all vendor locations. */
4479
- async listVendorLocations(query = {}, auth2 = SERVICE26) {
4681
+ async listVendorLocations(query = {}, auth2 = SERVICE25) {
4480
4682
  return this.ctx.http.request({
4481
4683
  method: "GET",
4482
4684
  path: `${this.base()}/locations`,
@@ -4485,7 +4687,7 @@ var VendorService = class {
4485
4687
  });
4486
4688
  }
4487
4689
  /** Retrieve a vendor location by id. */
4488
- async getVendorLocation(locationId, auth2 = SERVICE26) {
4690
+ async getVendorLocation(locationId, auth2 = SERVICE25) {
4489
4691
  return this.ctx.http.request({
4490
4692
  method: "GET",
4491
4693
  path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
@@ -4493,11 +4695,11 @@ var VendorService = class {
4493
4695
  });
4494
4696
  }
4495
4697
  /** Create a vendor location. */
4496
- async createVendorLocation(input, auth2 = SERVICE26) {
4698
+ async createVendorLocation(input, auth2 = SERVICE25) {
4497
4699
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
4498
4700
  }
4499
4701
  /** Upsert a vendor location by id (`PUT`). */
4500
- async updateVendorLocation(locationId, input, auth2 = SERVICE26) {
4702
+ async updateVendorLocation(locationId, input, auth2 = SERVICE25) {
4501
4703
  await this.ctx.http.request({
4502
4704
  method: "PUT",
4503
4705
  path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
@@ -4506,7 +4708,7 @@ var VendorService = class {
4506
4708
  });
4507
4709
  }
4508
4710
  /** Delete a vendor location by id. */
4509
- async deleteVendorLocation(locationId, auth2 = SERVICE26) {
4711
+ async deleteVendorLocation(locationId, auth2 = SERVICE25) {
4510
4712
  await this.ctx.http.request({
4511
4713
  method: "DELETE",
4512
4714
  path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
@@ -4516,7 +4718,7 @@ var VendorService = class {
4516
4718
  };
4517
4719
 
4518
4720
  // src/services/pick-pack.ts
4519
- var SERVICE27 = { kind: "service" };
4721
+ var SERVICE26 = { kind: "service" };
4520
4722
  var PickPackService = class {
4521
4723
  constructor(ctx) {
4522
4724
  this.ctx = ctx;
@@ -4530,7 +4732,7 @@ var PickPackService = class {
4530
4732
  return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
4531
4733
  }
4532
4734
  /** List packlist orders. */
4533
- async listOrders(query = {}, auth2 = SERVICE27) {
4735
+ async listOrders(query = {}, auth2 = SERVICE26) {
4534
4736
  return this.ctx.http.request({
4535
4737
  method: "GET",
4536
4738
  path: `${this.base()}/orders`,
@@ -4539,19 +4741,19 @@ var PickPackService = class {
4539
4741
  });
4540
4742
  }
4541
4743
  /** Retrieve a packlist order by id. */
4542
- async getOrder(orderId, auth2 = SERVICE27) {
4744
+ async getOrder(orderId, auth2 = SERVICE26) {
4543
4745
  return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
4544
4746
  }
4545
4747
  /** Update an order's status (`PATCH`). Returns an acknowledgement. */
4546
- async updateOrder(orderId, change, auth2 = SERVICE27) {
4748
+ async updateOrder(orderId, change, auth2 = SERVICE26) {
4547
4749
  return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
4548
4750
  }
4549
4751
  /** Finish an order. Returns an acknowledgement. */
4550
- async finishOrder(orderId, auth2 = SERVICE27) {
4752
+ async finishOrder(orderId, auth2 = SERVICE26) {
4551
4753
  return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
4552
4754
  }
4553
4755
  /** List order cycles (ids). */
4554
- async listOrderCycles(query = {}, auth2 = SERVICE27) {
4756
+ async listOrderCycles(query = {}, auth2 = SERVICE26) {
4555
4757
  return this.ctx.http.request({
4556
4758
  method: "GET",
4557
4759
  path: `${this.base()}/orderCycles`,
@@ -4560,11 +4762,11 @@ var PickPackService = class {
4560
4762
  });
4561
4763
  }
4562
4764
  /** Add an assignee to an order. Returns an acknowledgement. */
4563
- async addAssignee(orderId, assignee, auth2 = SERVICE27) {
4765
+ async addAssignee(orderId, assignee, auth2 = SERVICE26) {
4564
4766
  return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
4565
4767
  }
4566
4768
  /** Remove an assignee from an order. */
4567
- async removeAssignee(orderId, assigneeId, auth2 = SERVICE27) {
4769
+ async removeAssignee(orderId, assigneeId, auth2 = SERVICE26) {
4568
4770
  await this.ctx.http.request({
4569
4771
  method: "DELETE",
4570
4772
  path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
@@ -4572,15 +4774,15 @@ var PickPackService = class {
4572
4774
  });
4573
4775
  }
4574
4776
  /** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
4575
- async updatePackaging(orderId, change, auth2 = SERVICE27) {
4777
+ async updatePackaging(orderId, change, auth2 = SERVICE26) {
4576
4778
  return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
4577
4779
  }
4578
4780
  /** Create a packing event. Returns an acknowledgement. */
4579
- async createEvent(event, auth2 = SERVICE27) {
4781
+ async createEvent(event, auth2 = SERVICE26) {
4580
4782
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
4581
4783
  }
4582
4784
  /** List packing events. */
4583
- async listEvents(query = {}, auth2 = SERVICE27) {
4785
+ async listEvents(query = {}, auth2 = SERVICE26) {
4584
4786
  return this.ctx.http.request({
4585
4787
  method: "GET",
4586
4788
  path: `${this.base()}/events`,
@@ -4589,7 +4791,7 @@ var PickPackService = class {
4589
4791
  });
4590
4792
  }
4591
4793
  /** Trigger an order recalculation. Returns the created job's id. */
4592
- async triggerRecalculation(input, auth2 = SERVICE27) {
4794
+ async triggerRecalculation(input, auth2 = SERVICE26) {
4593
4795
  return this.ctx.http.request({
4594
4796
  method: "POST",
4595
4797
  path: `${this.base()}/jobs/recalculations`,
@@ -4598,7 +4800,7 @@ var PickPackService = class {
4598
4800
  });
4599
4801
  }
4600
4802
  /** Retrieve a recalculation job by id. */
4601
- async getRecalculationJob(jobId, auth2 = SERVICE27) {
4803
+ async getRecalculationJob(jobId, auth2 = SERVICE26) {
4602
4804
  return this.ctx.http.request({
4603
4805
  method: "GET",
4604
4806
  path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
@@ -4608,7 +4810,7 @@ var PickPackService = class {
4608
4810
  };
4609
4811
 
4610
4812
  // src/services/customer-admin.ts
4611
- var SERVICE28 = { kind: "service" };
4813
+ var SERVICE27 = { kind: "service" };
4612
4814
  var CustomerAdminService = class {
4613
4815
  constructor(ctx) {
4614
4816
  this.ctx = ctx;
@@ -4629,7 +4831,7 @@ var CustomerAdminService = class {
4629
4831
  }
4630
4832
  // --- Customers ---
4631
4833
  /** List customers. */
4632
- async listCustomers(query = {}, auth2 = SERVICE28) {
4834
+ async listCustomers(query = {}, auth2 = SERVICE27) {
4633
4835
  return this.ctx.http.request({
4634
4836
  method: "GET",
4635
4837
  path: this.base(),
@@ -4638,33 +4840,33 @@ var CustomerAdminService = class {
4638
4840
  });
4639
4841
  }
4640
4842
  /** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
4641
- async searchCustomers(query, auth2 = SERVICE28) {
4843
+ async searchCustomers(query, auth2 = SERVICE27) {
4642
4844
  const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
4643
4845
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
4644
4846
  }
4645
4847
  /** Retrieve a customer profile by number. */
4646
- async getCustomer(customerNumber, auth2 = SERVICE28) {
4848
+ async getCustomer(customerNumber, auth2 = SERVICE27) {
4647
4849
  return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
4648
4850
  }
4649
4851
  /** Create a customer. */
4650
- async createCustomer(input, auth2 = SERVICE28) {
4852
+ async createCustomer(input, auth2 = SERVICE27) {
4651
4853
  return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
4652
4854
  }
4653
4855
  /** Upsert a customer profile by number (`PUT`). */
4654
- async upsertCustomer(customerNumber, input, auth2 = SERVICE28) {
4856
+ async upsertCustomer(customerNumber, input, auth2 = SERVICE27) {
4655
4857
  return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
4656
4858
  }
4657
4859
  /** Partially update a customer profile (`PATCH`). */
4658
- async patchCustomer(customerNumber, patch, auth2 = SERVICE28) {
4860
+ async patchCustomer(customerNumber, patch, auth2 = SERVICE27) {
4659
4861
  await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
4660
4862
  }
4661
4863
  /** Delete a customer profile. */
4662
- async deleteCustomer(customerNumber, auth2 = SERVICE28) {
4864
+ async deleteCustomer(customerNumber, auth2 = SERVICE27) {
4663
4865
  await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
4664
4866
  }
4665
4867
  // --- Addresses ---
4666
4868
  /** List a customer's addresses. */
4667
- async listAddresses(customerNumber, auth2 = SERVICE28) {
4869
+ async listAddresses(customerNumber, auth2 = SERVICE27) {
4668
4870
  return this.ctx.http.request({
4669
4871
  method: "GET",
4670
4872
  path: `${this.customerPath(customerNumber)}/addresses`,
@@ -4672,11 +4874,11 @@ var CustomerAdminService = class {
4672
4874
  });
4673
4875
  }
4674
4876
  /** Retrieve one address. */
4675
- async getAddress(customerNumber, addressId, auth2 = SERVICE28) {
4877
+ async getAddress(customerNumber, addressId, auth2 = SERVICE27) {
4676
4878
  return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
4677
4879
  }
4678
4880
  /** Add an address. */
4679
- async addAddress(customerNumber, input, auth2 = SERVICE28) {
4881
+ async addAddress(customerNumber, input, auth2 = SERVICE27) {
4680
4882
  return this.ctx.http.request({
4681
4883
  method: "POST",
4682
4884
  path: `${this.customerPath(customerNumber)}/addresses`,
@@ -4685,19 +4887,19 @@ var CustomerAdminService = class {
4685
4887
  });
4686
4888
  }
4687
4889
  /** Upsert an address by id (`PUT`). */
4688
- async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE28) {
4890
+ async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE27) {
4689
4891
  return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
4690
4892
  }
4691
4893
  /** Partially update an address by id (`PATCH`). */
4692
- async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE28) {
4894
+ async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE27) {
4693
4895
  await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
4694
4896
  }
4695
4897
  /** Delete an address by id. */
4696
- async deleteAddress(customerNumber, addressId, auth2 = SERVICE28) {
4898
+ async deleteAddress(customerNumber, addressId, auth2 = SERVICE27) {
4697
4899
  await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
4698
4900
  }
4699
4901
  /** Add tags to an address (`?tags=` query). */
4700
- async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE28) {
4902
+ async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
4701
4903
  await this.ctx.http.request({
4702
4904
  method: "POST",
4703
4905
  path: `${this.addressPath(customerNumber, addressId)}/tags`,
@@ -4706,7 +4908,7 @@ var CustomerAdminService = class {
4706
4908
  });
4707
4909
  }
4708
4910
  /** Remove tags from an address (`?tags=` query). */
4709
- async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE28) {
4911
+ async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
4710
4912
  await this.ctx.http.request({
4711
4913
  method: "DELETE",
4712
4914
  path: `${this.addressPath(customerNumber, addressId)}/tags`,
@@ -4720,7 +4922,7 @@ var CustomerAdminService = class {
4720
4922
  * `customer.import_read` scope. An unconfigured tenant answers with an empty
4721
4923
  * object rather than a 404.
4722
4924
  */
4723
- async getPasswordMigrationRetention(auth2 = SERVICE28) {
4925
+ async getPasswordMigrationRetention(auth2 = SERVICE27) {
4724
4926
  return this.ctx.http.request({
4725
4927
  method: "GET",
4726
4928
  path: this.configPath(),
@@ -4733,7 +4935,7 @@ var CustomerAdminService = class {
4733
4935
  * `legacyAuth`** — that import is rejected without an active config. Re-POST with
4734
4936
  * an earlier `retentionEndDate` to shorten a running window.
4735
4937
  */
4736
- async configurePasswordMigrationRetention(input, auth2 = SERVICE28) {
4938
+ async configurePasswordMigrationRetention(input, auth2 = SERVICE27) {
4737
4939
  return this.ctx.http.request({
4738
4940
  method: "POST",
4739
4941
  path: this.configPath(),
@@ -4746,7 +4948,7 @@ var CustomerAdminService = class {
4746
4948
  * Intended for after the migration window: when the window ends, unmigrated
4747
4949
  * accounts need a password reset and their legacy credentials are cleared.
4748
4950
  */
4749
- async deletePasswordMigrationRetention(auth2 = SERVICE28) {
4951
+ async deletePasswordMigrationRetention(auth2 = SERVICE27) {
4750
4952
  await this.ctx.http.request({ method: "DELETE", path: this.configPath(), auth: auth2 });
4751
4953
  }
4752
4954
  // --- Bulk import ---
@@ -4759,7 +4961,7 @@ var CustomerAdminService = class {
4759
4961
  * `account.legacyAuth`, and importing `legacyAuth` requires an active retention
4760
4962
  * config (see `configurePasswordMigrationRetention`).
4761
4963
  */
4762
- async importCustomers(input, auth2 = SERVICE28) {
4964
+ async importCustomers(input, auth2 = SERVICE27) {
4763
4965
  return this.ctx.http.request({
4764
4966
  method: "POST",
4765
4967
  path: `${this.base()}/import`,
@@ -4770,7 +4972,7 @@ var CustomerAdminService = class {
4770
4972
  };
4771
4973
 
4772
4974
  // src/services/approval.ts
4773
- var SERVICE29 = { kind: "service" };
4975
+ var SERVICE28 = { kind: "service" };
4774
4976
  var ApprovalService = class {
4775
4977
  constructor(ctx) {
4776
4978
  this.ctx = ctx;
@@ -4781,7 +4983,7 @@ var ApprovalService = class {
4781
4983
  return `/approval/${this.ctx.tenant}`;
4782
4984
  }
4783
4985
  /** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
4784
- async listApprovals(query = {}, auth2 = SERVICE29) {
4986
+ async listApprovals(query = {}, auth2 = SERVICE28) {
4785
4987
  return this.ctx.http.request({
4786
4988
  method: "GET",
4787
4989
  path: `${this.base()}/approvals`,
@@ -4790,7 +4992,7 @@ var ApprovalService = class {
4790
4992
  });
4791
4993
  }
4792
4994
  /** Retrieve a single approval by id. */
4793
- async getApproval(approvalId, auth2 = SERVICE29) {
4995
+ async getApproval(approvalId, auth2 = SERVICE28) {
4794
4996
  return this.ctx.http.request({
4795
4997
  method: "GET",
4796
4998
  path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
@@ -4798,7 +5000,7 @@ var ApprovalService = class {
4798
5000
  });
4799
5001
  }
4800
5002
  /** Create an approval request (cart or quote). Returns the created `{ id }`. */
4801
- async createApproval(input, auth2 = SERVICE29) {
5003
+ async createApproval(input, auth2 = SERVICE28) {
4802
5004
  return this.ctx.http.request({
4803
5005
  method: "POST",
4804
5006
  path: `${this.base()}/approvals`,
@@ -4807,7 +5009,7 @@ var ApprovalService = class {
4807
5009
  });
4808
5010
  }
4809
5011
  /** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
4810
- async updateApproval(approvalId, ops, auth2 = SERVICE29) {
5012
+ async updateApproval(approvalId, ops, auth2 = SERVICE28) {
4811
5013
  await this.ctx.http.request({
4812
5014
  method: "PATCH",
4813
5015
  path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
@@ -4816,7 +5018,7 @@ var ApprovalService = class {
4816
5018
  });
4817
5019
  }
4818
5020
  /** Delete an approval by id. */
4819
- async deleteApproval(approvalId, auth2 = SERVICE29) {
5021
+ async deleteApproval(approvalId, auth2 = SERVICE28) {
4820
5022
  await this.ctx.http.request({
4821
5023
  method: "DELETE",
4822
5024
  path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
@@ -4824,7 +5026,7 @@ var ApprovalService = class {
4824
5026
  });
4825
5027
  }
4826
5028
  /** Check whether an operation on a resource is permitted / needs approval. */
4827
- async checkPermitted(input, auth2 = SERVICE29) {
5029
+ async checkPermitted(input, auth2 = SERVICE28) {
4828
5030
  return this.ctx.http.request({
4829
5031
  method: "POST",
4830
5032
  path: `${this.base()}/approval/permitted`,
@@ -4833,7 +5035,7 @@ var ApprovalService = class {
4833
5035
  });
4834
5036
  }
4835
5037
  /** Search for users eligible to approve a resource. Returns an array. */
4836
- async searchApprovers(input, auth2 = SERVICE29) {
5038
+ async searchApprovers(input, auth2 = SERVICE28) {
4837
5039
  return this.ctx.http.request({
4838
5040
  method: "POST",
4839
5041
  path: `${this.base()}/search/users`,
@@ -4894,7 +5096,6 @@ var EmporixClient = class {
4894
5096
  invoices;
4895
5097
  quotes;
4896
5098
  returns;
4897
- sepaExport;
4898
5099
  indexing;
4899
5100
  imports;
4900
5101
  units;
@@ -4969,7 +5170,6 @@ var EmporixClient = class {
4969
5170
  this.invoices = new InvoiceService(mk(InvoiceService.channel));
4970
5171
  this.quotes = new QuoteService(mk(QuoteService.channel));
4971
5172
  this.returns = new ReturnsService(mk(ReturnsService.channel));
4972
- this.sepaExport = new SepaExportService(mk(SepaExportService.channel));
4973
5173
  this.indexing = new IndexingService(mk(IndexingService.channel));
4974
5174
  this.imports = new ImportService(mk(ImportService.channel));
4975
5175
  this.units = new UnitHandlingService(mk(UnitHandlingService.channel));
@@ -5045,6 +5245,6 @@ function productYrn(tenant, productId) {
5045
5245
  return `urn:yaas:hybris:product:product:${tenant};${productId}`;
5046
5246
  }
5047
5247
 
5048
- export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, ImportService, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver, PickPackService, QuoteService, RagIndexerService, ReturnsService, RewardPointsService, STORAGE_KEYS, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, approvalStatusPatch, createConsoleLogger, createCookieBackedStorage, createCore, createEmporixClient, createNoopLogger, createServerStorage, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, redact, resolveZone, serverAuth, validateConfig };
5248
+ export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, ImportService, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver, PickPackService, QuoteService, RagIndexerService, ReturnsService, RewardPointsService, STORAGE_KEYS, SchemaService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, approvalStatusPatch, createConsoleLogger, createCookieBackedStorage, createCookieStorage, createCore, createEmporixClient, createListenerSet, createLocalStorage, createLocalStorageStorage, createMemoryStorage, createNoopLogger, createServerStorage, createSessionStorage, emporixKey, fromWebStorage, getCustomerSessionStore, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, redact, resolveZone, serverAuth, siteMeta, validateConfig };
5049
5249
  //# sourceMappingURL=index.js.map
5050
5250
  //# sourceMappingURL=index.js.map