@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.cjs CHANGED
@@ -679,6 +679,249 @@ function serverAuth(storage) {
679
679
  return token !== null ? auth.customer(token) : auth.anonymous();
680
680
  }
681
681
 
682
+ // src/core/browser-storage.ts
683
+ var browser = globalThis;
684
+ function createListenerSet() {
685
+ const listeners = /* @__PURE__ */ new Set();
686
+ return {
687
+ add(l) {
688
+ listeners.add(l);
689
+ return () => listeners.delete(l);
690
+ },
691
+ notify(value) {
692
+ for (const l of listeners) {
693
+ try {
694
+ l(value);
695
+ } catch {
696
+ }
697
+ }
698
+ }
699
+ };
700
+ }
701
+ function createMemoryStorage(opts = {}) {
702
+ let token = opts.initial ?? null;
703
+ let cartId = null;
704
+ let anon = null;
705
+ let siteCode = null;
706
+ let language = null;
707
+ let activeLegalEntityId = null;
708
+ let refreshToken = null;
709
+ let saasToken = null;
710
+ const tokenListeners = /* @__PURE__ */ new Set();
711
+ const all = createListenerSet();
712
+ return {
713
+ getCustomerToken: () => token,
714
+ setCustomerToken: (t) => {
715
+ token = t;
716
+ for (const l of tokenListeners) l(token);
717
+ all.notify("customerToken");
718
+ },
719
+ subscribe: (l) => {
720
+ tokenListeners.add(l);
721
+ return () => tokenListeners.delete(l);
722
+ },
723
+ getCartId: () => cartId,
724
+ setCartId: (id) => {
725
+ cartId = id;
726
+ all.notify("cartId");
727
+ },
728
+ getAnonymousSession: () => anon,
729
+ setAnonymousSession: (s) => {
730
+ anon = s;
731
+ all.notify("anonymousSession");
732
+ },
733
+ getSiteCode: () => siteCode,
734
+ setSiteCode: (code) => {
735
+ siteCode = code;
736
+ all.notify("siteCode");
737
+ },
738
+ getLanguage: () => language,
739
+ setLanguage: (l) => {
740
+ language = l;
741
+ all.notify("language");
742
+ },
743
+ getActiveLegalEntityId: () => activeLegalEntityId,
744
+ setActiveLegalEntityId: (id) => {
745
+ activeLegalEntityId = id;
746
+ all.notify("activeLegalEntityId");
747
+ },
748
+ getRefreshToken: () => refreshToken,
749
+ setRefreshToken: (t) => {
750
+ refreshToken = t;
751
+ all.notify("refreshToken");
752
+ },
753
+ getSaasToken: () => saasToken,
754
+ setSaasToken: (t) => {
755
+ saasToken = t;
756
+ all.notify("saasToken");
757
+ },
758
+ subscribeAll: (l) => all.add(l)
759
+ };
760
+ }
761
+ function fromWebStorage(storage, opts = {}) {
762
+ const tokenKey = opts.key ?? STORAGE_KEYS.customerToken;
763
+ const tokenListeners = /* @__PURE__ */ new Set();
764
+ const all = createListenerSet();
765
+ return {
766
+ getCustomerToken: () => storage.getItem(tokenKey),
767
+ setCustomerToken: (t) => {
768
+ if (t === null) storage.removeItem(tokenKey);
769
+ else storage.setItem(tokenKey, t);
770
+ for (const l of tokenListeners) l(t);
771
+ all.notify("customerToken");
772
+ },
773
+ subscribe: (l) => {
774
+ tokenListeners.add(l);
775
+ return () => tokenListeners.delete(l);
776
+ },
777
+ getCartId: () => storage.getItem(STORAGE_KEYS.cartId),
778
+ setCartId: (id) => {
779
+ if (id === null) storage.removeItem(STORAGE_KEYS.cartId);
780
+ else storage.setItem(STORAGE_KEYS.cartId, id);
781
+ all.notify("cartId");
782
+ },
783
+ getAnonymousSession: () => parseAnonymousSession(storage.getItem(STORAGE_KEYS.anonymousSession)),
784
+ setAnonymousSession: (s) => {
785
+ if (s === null) storage.removeItem(STORAGE_KEYS.anonymousSession);
786
+ else
787
+ storage.setItem(
788
+ STORAGE_KEYS.anonymousSession,
789
+ JSON.stringify({ refreshToken: s.refreshToken, sessionId: s.sessionId })
790
+ );
791
+ all.notify("anonymousSession");
792
+ },
793
+ getSiteCode: () => storage.getItem(STORAGE_KEYS.siteCode),
794
+ setSiteCode: (code) => {
795
+ if (code === null) storage.removeItem(STORAGE_KEYS.siteCode);
796
+ else storage.setItem(STORAGE_KEYS.siteCode, code);
797
+ all.notify("siteCode");
798
+ },
799
+ getLanguage: () => storage.getItem(STORAGE_KEYS.language),
800
+ setLanguage: (l) => {
801
+ if (l === null) storage.removeItem(STORAGE_KEYS.language);
802
+ else storage.setItem(STORAGE_KEYS.language, l);
803
+ all.notify("language");
804
+ },
805
+ getActiveLegalEntityId: () => storage.getItem(STORAGE_KEYS.activeLegalEntityId),
806
+ setActiveLegalEntityId: (id) => {
807
+ if (id === null) storage.removeItem(STORAGE_KEYS.activeLegalEntityId);
808
+ else storage.setItem(STORAGE_KEYS.activeLegalEntityId, id);
809
+ all.notify("activeLegalEntityId");
810
+ },
811
+ getRefreshToken: () => storage.getItem(STORAGE_KEYS.refreshToken),
812
+ setRefreshToken: (t) => {
813
+ if (t === null) storage.removeItem(STORAGE_KEYS.refreshToken);
814
+ else storage.setItem(STORAGE_KEYS.refreshToken, t);
815
+ all.notify("refreshToken");
816
+ },
817
+ getSaasToken: () => storage.getItem(STORAGE_KEYS.saasToken),
818
+ setSaasToken: (t) => {
819
+ if (t === null) storage.removeItem(STORAGE_KEYS.saasToken);
820
+ else storage.setItem(STORAGE_KEYS.saasToken, t);
821
+ all.notify("saasToken");
822
+ },
823
+ subscribeAll: (l) => all.add(l)
824
+ };
825
+ }
826
+ function createLocalStorage(opts = {}) {
827
+ const store = browser.localStorage;
828
+ if (store === void 0) {
829
+ console.warn("[emporix] localStorage unavailable; falling back to in-memory storage");
830
+ return createMemoryStorage();
831
+ }
832
+ return fromWebStorage(store, opts);
833
+ }
834
+ var createLocalStorageStorage = createLocalStorage;
835
+ function createSessionStorage(opts = {}) {
836
+ const store = browser.sessionStorage;
837
+ if (store === void 0) {
838
+ console.warn("[emporix] sessionStorage unavailable; falling back to in-memory storage");
839
+ return createMemoryStorage();
840
+ }
841
+ return fromWebStorage(store, opts);
842
+ }
843
+ function createCookieStorage(opts = {}) {
844
+ const sameSite = opts.sameSite ?? "lax";
845
+ const secure = opts.secure ?? browser.location?.protocol === "https:";
846
+ const doc = browser.document;
847
+ if (doc === void 0) {
848
+ console.warn("[emporix] document unavailable; cookie storage falling back to in-memory");
849
+ return createMemoryStorage();
850
+ }
851
+ const attrs = `path=/; SameSite=${sameSite}${secure ? "; Secure" : ""}`;
852
+ const all = createListenerSet();
853
+ const storage = createCookieBackedStorage(
854
+ {
855
+ get: (name) => {
856
+ for (const part of doc.cookie.split("; ")) {
857
+ const [k, ...v] = part.split("=");
858
+ if (k === name) return decodeURIComponent(v.join("=")) || null;
859
+ }
860
+ return null;
861
+ },
862
+ set: (name, value) => {
863
+ doc.cookie = value === null ? `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; ${attrs}` : `${name}=${encodeURIComponent(value)}; ${attrs}`;
864
+ }
865
+ },
866
+ {
867
+ ...opts.name !== void 0 ? { tokenName: opts.name } : {},
868
+ notify: (key) => all.notify(key)
869
+ }
870
+ );
871
+ return { ...storage, subscribeAll: (l) => all.add(l) };
872
+ }
873
+
874
+ // src/core/query-keys.ts
875
+ function emporixKey(resource, args, context) {
876
+ const meta = {
877
+ tenant: context.tenant,
878
+ authKind: context.authKind
879
+ };
880
+ if (context.siteCode !== void 0) {
881
+ meta.siteCode = context.siteCode;
882
+ }
883
+ if (context.language !== void 0) {
884
+ meta.language = context.language;
885
+ }
886
+ return ["emporix", resource, ...args, meta];
887
+ }
888
+ function siteMeta(site, siteCode, language) {
889
+ return site === "full" ? { siteCode, language } : site === "language" ? { language } : {};
890
+ }
891
+
892
+ // src/core/customer-session-store.ts
893
+ var stores = /* @__PURE__ */ new WeakMap();
894
+ function getCustomerSessionStore(storage) {
895
+ const existing = stores.get(storage);
896
+ if (existing) return existing;
897
+ let state = {
898
+ token: storage.getCustomerToken(),
899
+ refreshToken: storage.getRefreshToken(),
900
+ saasToken: storage.getSaasToken?.() ?? null
901
+ };
902
+ const listeners = /* @__PURE__ */ new Set();
903
+ const store = {
904
+ getSnapshot: () => state,
905
+ setState: (next) => {
906
+ const resolved = typeof next === "function" ? next(state) : next;
907
+ if (resolved === state) return;
908
+ state = resolved;
909
+ for (const listener of listeners) listener();
910
+ },
911
+ subscribe: (listener) => {
912
+ listeners.add(listener);
913
+ return () => {
914
+ listeners.delete(listener);
915
+ };
916
+ }
917
+ };
918
+ storage.subscribe?.((t) => {
919
+ store.setState((s) => s.token === t ? s : { ...s, token: t });
920
+ });
921
+ stores.set(storage, store);
922
+ return store;
923
+ }
924
+
682
925
  // src/core/sse.ts
683
926
  function parseFrame(frame) {
684
927
  const ev = { data: "" };
@@ -999,7 +1242,7 @@ var HttpClient = class {
999
1242
  };
1000
1243
 
1001
1244
  // package.json
1002
- var version = "2.38.1";
1245
+ var version = "3.1.0";
1003
1246
 
1004
1247
  // src/version.ts
1005
1248
  var SDK_VERSION = version;
@@ -7681,49 +7924,8 @@ var ReturnsService = class {
7681
7924
  }
7682
7925
  };
7683
7926
 
7684
- // src/services/sepa-export.ts
7685
- var SERVICE28 = { kind: "service" };
7686
- var SepaExportService = class {
7687
- constructor(ctx) {
7688
- this.ctx = ctx;
7689
- }
7690
- ctx;
7691
- static channel = "sepa-export";
7692
- base() {
7693
- return `/sepa-export/${this.ctx.tenant}`;
7694
- }
7695
- /** Retrieve a SEPA export file by id. Returns the raw file content (text). */
7696
- async getFile(fileId, auth2 = SERVICE28) {
7697
- const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
7698
- const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
7699
- if (!res.ok) {
7700
- const errBody = await res.text().catch(() => void 0);
7701
- throw errorFromResponse(res.status, `GET ${path} \u2192 ${res.status}`, errBody);
7702
- }
7703
- return res.text();
7704
- }
7705
- /** List export jobs. */
7706
- async listJobs(query = {}, auth2 = SERVICE28) {
7707
- return this.ctx.http.request({
7708
- method: "GET",
7709
- path: `${this.base()}/jobs`,
7710
- auth: auth2,
7711
- ...Object.keys(query).length ? { query } : {}
7712
- });
7713
- }
7714
- /** Create an export job. */
7715
- async createJob(input, auth2 = SERVICE28) {
7716
- return this.ctx.http.request({
7717
- method: "POST",
7718
- path: `${this.base()}/jobs`,
7719
- auth: auth2,
7720
- body: input
7721
- });
7722
- }
7723
- };
7724
-
7725
7927
  // src/services/indexing.ts
7726
- var SERVICE29 = { kind: "service" };
7928
+ var SERVICE28 = { kind: "service" };
7727
7929
  var IndexingService = class {
7728
7930
  constructor(ctx) {
7729
7931
  this.ctx = ctx;
@@ -7734,11 +7936,11 @@ var IndexingService = class {
7734
7936
  return `/indexing/${this.ctx.tenant}`;
7735
7937
  }
7736
7938
  /** List indexing configurations. */
7737
- async listConfigurations(auth2 = SERVICE29) {
7939
+ async listConfigurations(auth2 = SERVICE28) {
7738
7940
  return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
7739
7941
  }
7740
7942
  /** Get a configuration by provider name. */
7741
- async getConfiguration(provider, auth2 = SERVICE29) {
7943
+ async getConfiguration(provider, auth2 = SERVICE28) {
7742
7944
  return this.ctx.http.request({
7743
7945
  method: "GET",
7744
7946
  path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
@@ -7746,7 +7948,7 @@ var IndexingService = class {
7746
7948
  });
7747
7949
  }
7748
7950
  /** Create a configuration. */
7749
- async createConfiguration(input, auth2 = SERVICE29) {
7951
+ async createConfiguration(input, auth2 = SERVICE28) {
7750
7952
  return this.ctx.http.request({
7751
7953
  method: "POST",
7752
7954
  path: `${this.base()}/configurations`,
@@ -7755,7 +7957,7 @@ var IndexingService = class {
7755
7957
  });
7756
7958
  }
7757
7959
  /** Update a configuration by provider name. */
7758
- async updateConfiguration(provider, input, auth2 = SERVICE29) {
7960
+ async updateConfiguration(provider, input, auth2 = SERVICE28) {
7759
7961
  await this.ctx.http.request({
7760
7962
  method: "PUT",
7761
7963
  path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
@@ -7764,7 +7966,7 @@ var IndexingService = class {
7764
7966
  });
7765
7967
  }
7766
7968
  /** Delete a configuration by provider name. */
7767
- async deleteConfiguration(provider, auth2 = SERVICE29) {
7969
+ async deleteConfiguration(provider, auth2 = SERVICE28) {
7768
7970
  await this.ctx.http.request({
7769
7971
  method: "DELETE",
7770
7972
  path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
@@ -7772,11 +7974,11 @@ var IndexingService = class {
7772
7974
  });
7773
7975
  }
7774
7976
  /** List public indexing configurations. */
7775
- async listPublicConfigurations(auth2 = SERVICE29) {
7977
+ async listPublicConfigurations(auth2 = SERVICE28) {
7776
7978
  return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
7777
7979
  }
7778
7980
  /** Get a public configuration by provider name. */
7779
- async getPublicConfiguration(provider, auth2 = SERVICE29) {
7981
+ async getPublicConfiguration(provider, auth2 = SERVICE28) {
7780
7982
  return this.ctx.http.request({
7781
7983
  method: "GET",
7782
7984
  path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
@@ -7789,7 +7991,7 @@ var IndexingService = class {
7789
7991
  * (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
7790
7992
  * `entityType` is already `IN_PROGRESS`, that running job (`200`).
7791
7993
  */
7792
- async createReindexJob(input, auth2 = SERVICE29) {
7994
+ async createReindexJob(input, auth2 = SERVICE28) {
7793
7995
  return this.ctx.http.request({
7794
7996
  method: "POST",
7795
7997
  path: `${this.base()}/reindex-jobs`,
@@ -7798,7 +8000,7 @@ var IndexingService = class {
7798
8000
  });
7799
8001
  }
7800
8002
  /** List reindex jobs (paginated). */
7801
- async listReindexJobs(opts = {}, auth2 = SERVICE29) {
8003
+ async listReindexJobs(opts = {}, auth2 = SERVICE28) {
7802
8004
  const pageNumber = opts.pageNumber ?? 1;
7803
8005
  const pageSize = opts.pageSize ?? 50;
7804
8006
  const query = { pageNumber, pageSize };
@@ -7819,7 +8021,7 @@ var IndexingService = class {
7819
8021
  );
7820
8022
  }
7821
8023
  /** Fetch one reindex job by id. */
7822
- async getReindexJob(reindexJobId, auth2 = SERVICE29) {
8024
+ async getReindexJob(reindexJobId, auth2 = SERVICE28) {
7823
8025
  return this.ctx.http.request({
7824
8026
  method: "GET",
7825
8027
  path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
@@ -7831,13 +8033,13 @@ var IndexingService = class {
7831
8033
  * @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
7832
8034
  * (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
7833
8035
  */
7834
- async reindex(input, auth2 = SERVICE29) {
8036
+ async reindex(input, auth2 = SERVICE28) {
7835
8037
  await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
7836
8038
  }
7837
8039
  };
7838
8040
 
7839
8041
  // src/services/imports.ts
7840
- var SERVICE30 = { kind: "service" };
8042
+ var SERVICE29 = { kind: "service" };
7841
8043
  var DEFAULT_PAGE_SIZE = 50;
7842
8044
  function pageArgs(opts) {
7843
8045
  return { pageNumber: opts.pageNumber ?? 1, pageSize: opts.pageSize ?? DEFAULT_PAGE_SIZE };
@@ -7887,7 +8089,7 @@ var ImportService = class {
7887
8089
  return `/importtool/${this.ctx.tenant}`;
7888
8090
  }
7889
8091
  /** List every import configuration of the tenant. */
7890
- async listConfigs(auth2 = SERVICE30) {
8092
+ async listConfigs(auth2 = SERVICE29) {
7891
8093
  return this.ctx.http.request({
7892
8094
  method: "GET",
7893
8095
  path: `${this.base()}/configs`,
@@ -7895,7 +8097,7 @@ var ImportService = class {
7895
8097
  });
7896
8098
  }
7897
8099
  /** Fetch one configuration by id. */
7898
- async getConfig(id, auth2 = SERVICE30) {
8100
+ async getConfig(id, auth2 = SERVICE29) {
7899
8101
  return this.ctx.http.request({
7900
8102
  method: "GET",
7901
8103
  path: `${this.base()}/configs/${encodeURIComponent(id)}`,
@@ -7903,7 +8105,7 @@ var ImportService = class {
7903
8105
  });
7904
8106
  }
7905
8107
  /** List the streams of one configuration. */
7906
- async listStreams(configId, auth2 = SERVICE30) {
8108
+ async listStreams(configId, auth2 = SERVICE29) {
7907
8109
  return this.ctx.http.request({
7908
8110
  method: "GET",
7909
8111
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/streams`,
@@ -7911,7 +8113,7 @@ var ImportService = class {
7911
8113
  });
7912
8114
  }
7913
8115
  /** Fetch one stream by id. */
7914
- async getStream(id, auth2 = SERVICE30) {
8116
+ async getStream(id, auth2 = SERVICE29) {
7915
8117
  return this.ctx.http.request({
7916
8118
  method: "GET",
7917
8119
  path: `${this.base()}/streams/${encodeURIComponent(id)}`,
@@ -7923,7 +8125,7 @@ var ImportService = class {
7923
8125
  * configured — the service answers `204`, not `404`, so an absent schedule is
7924
8126
  * a normal result rather than an error.
7925
8127
  */
7926
- async getSchedule(configId, auth2 = SERVICE30) {
8128
+ async getSchedule(configId, auth2 = SERVICE29) {
7927
8129
  const res = await this.ctx.http.request({
7928
8130
  method: "GET",
7929
8131
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
@@ -7932,7 +8134,7 @@ var ImportService = class {
7932
8134
  return res ?? null;
7933
8135
  }
7934
8136
  /** Create or replace a configuration's schedule. */
7935
- async setSchedule(configId, input, auth2 = SERVICE30) {
8137
+ async setSchedule(configId, input, auth2 = SERVICE29) {
7936
8138
  return this.ctx.http.request({
7937
8139
  method: "PUT",
7938
8140
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
@@ -7946,7 +8148,7 @@ var ImportService = class {
7946
8148
  *
7947
8149
  * Not retried on a 5xx: a POST that timed out may already have queued a run.
7948
8150
  */
7949
- async triggerRun(configId, input = {}, auth2 = SERVICE30) {
8151
+ async triggerRun(configId, input = {}, auth2 = SERVICE29) {
7950
8152
  return this.ctx.http.request({
7951
8153
  method: "POST",
7952
8154
  path: `${this.base()}/configs/${encodeURIComponent(configId)}/runs`,
@@ -7955,7 +8157,7 @@ var ImportService = class {
7955
8157
  });
7956
8158
  }
7957
8159
  /** List a configuration's runs, newest first. */
7958
- async listRuns(configId, opts = {}, auth2 = SERVICE30) {
8160
+ async listRuns(configId, opts = {}, auth2 = SERVICE29) {
7959
8161
  const args = pageArgs(opts);
7960
8162
  const wire = await this.ctx.http.request({
7961
8163
  method: "GET",
@@ -7966,7 +8168,7 @@ var ImportService = class {
7966
8168
  return toPage(wire, args);
7967
8169
  }
7968
8170
  /** Fetch one run with its per-stream progress. */
7969
- async getRun(runId, auth2 = SERVICE30) {
8171
+ async getRun(runId, auth2 = SERVICE29) {
7970
8172
  return this.ctx.http.request({
7971
8173
  method: "GET",
7972
8174
  path: `${this.base()}/runs/${encodeURIComponent(runId)}`,
@@ -7986,7 +8188,7 @@ var ImportService = class {
7986
8188
  * arrive as `{ type: "unknown" }` rather than throwing — see
7987
8189
  * {@link ImportRunEvent}.
7988
8190
  */
7989
- async *streamRun(runId, auth2 = SERVICE30) {
8191
+ async *streamRun(runId, auth2 = SERVICE29) {
7990
8192
  const frames = this.ctx.http.requestStream({
7991
8193
  method: "GET",
7992
8194
  path: `${this.base()}/runs/${encodeURIComponent(runId)}/events`,
@@ -8001,7 +8203,7 @@ var ImportService = class {
8001
8203
  * a result, not an error. A state conflict may instead come back as a `409`,
8002
8204
  * which does throw.
8003
8205
  */
8004
- async cancelRun(runId, opts = {}, auth2 = SERVICE30) {
8206
+ async cancelRun(runId, opts = {}, auth2 = SERVICE29) {
8005
8207
  const query = {};
8006
8208
  if (opts.force) query.force = "true";
8007
8209
  return this.ctx.http.request({
@@ -8012,7 +8214,7 @@ var ImportService = class {
8012
8214
  });
8013
8215
  }
8014
8216
  /** List the errors recorded during a run. */
8015
- async listRunErrors(runId, opts = {}, auth2 = SERVICE30) {
8217
+ async listRunErrors(runId, opts = {}, auth2 = SERVICE29) {
8016
8218
  const args = pageArgs(opts);
8017
8219
  const wire = await this.ctx.http.request({
8018
8220
  method: "GET",
@@ -8023,7 +8225,7 @@ var ImportService = class {
8023
8225
  return toPage(wire, args);
8024
8226
  }
8025
8227
  /** List the target types that hold imported records — the valid `type` values for {@link searchRecords}. */
8026
- async listDataTypes(auth2 = SERVICE30) {
8228
+ async listDataTypes(auth2 = SERVICE29) {
8027
8229
  return this.ctx.http.request({
8028
8230
  method: "GET",
8029
8231
  path: `${this.base()}/data/types`,
@@ -8031,7 +8233,7 @@ var ImportService = class {
8031
8233
  });
8032
8234
  }
8033
8235
  /** Search imported records of one target type. */
8034
- async searchRecords(opts, auth2 = SERVICE30) {
8236
+ async searchRecords(opts, auth2 = SERVICE29) {
8035
8237
  const args = pageArgs(opts);
8036
8238
  const query = {
8037
8239
  type: opts.type,
@@ -8049,7 +8251,7 @@ var ImportService = class {
8049
8251
  return toPage(wire, args);
8050
8252
  }
8051
8253
  /** Search the imported records produced by one stream. */
8052
- async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE30) {
8254
+ async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE29) {
8053
8255
  const args = pageArgs(opts);
8054
8256
  const query = {
8055
8257
  page: args.pageNumber - 1,
@@ -8068,7 +8270,7 @@ var ImportService = class {
8068
8270
  };
8069
8271
 
8070
8272
  // src/services/unit-handling.ts
8071
- var SERVICE31 = { kind: "service" };
8273
+ var SERVICE30 = { kind: "service" };
8072
8274
  var UnitHandlingService = class {
8073
8275
  constructor(ctx) {
8074
8276
  this.ctx = ctx;
@@ -8079,7 +8281,7 @@ var UnitHandlingService = class {
8079
8281
  return `/unit-handling/${this.ctx.tenant}`;
8080
8282
  }
8081
8283
  /** Find units (filter/sort/page). */
8082
- async listUnits(query = {}, auth2 = SERVICE31) {
8284
+ async listUnits(query = {}, auth2 = SERVICE30) {
8083
8285
  return this.ctx.http.request({
8084
8286
  method: "GET",
8085
8287
  path: `${this.base()}/units`,
@@ -8088,7 +8290,7 @@ var UnitHandlingService = class {
8088
8290
  });
8089
8291
  }
8090
8292
  /** Retrieve a unit by code. */
8091
- async getUnit(unitCode, auth2 = SERVICE31) {
8293
+ async getUnit(unitCode, auth2 = SERVICE30) {
8092
8294
  return this.ctx.http.request({
8093
8295
  method: "GET",
8094
8296
  path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
@@ -8096,11 +8298,11 @@ var UnitHandlingService = class {
8096
8298
  });
8097
8299
  }
8098
8300
  /** Add a new unit. */
8099
- async createUnit(input, auth2 = SERVICE31) {
8301
+ async createUnit(input, auth2 = SERVICE30) {
8100
8302
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
8101
8303
  }
8102
8304
  /** Update a unit by code. */
8103
- async updateUnit(unitCode, input, auth2 = SERVICE31) {
8305
+ async updateUnit(unitCode, input, auth2 = SERVICE30) {
8104
8306
  await this.ctx.http.request({
8105
8307
  method: "PUT",
8106
8308
  path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
@@ -8109,7 +8311,7 @@ var UnitHandlingService = class {
8109
8311
  });
8110
8312
  }
8111
8313
  /** Delete a unit by code. */
8112
- async deleteUnit(unitCode, auth2 = SERVICE31) {
8314
+ async deleteUnit(unitCode, auth2 = SERVICE30) {
8113
8315
  await this.ctx.http.request({
8114
8316
  method: "DELETE",
8115
8317
  path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
@@ -8117,7 +8319,7 @@ var UnitHandlingService = class {
8117
8319
  });
8118
8320
  }
8119
8321
  /** Delete multiple units by code (bulk). The codes are sent as the request body. */
8120
- async deleteUnits(codes, auth2 = SERVICE31) {
8322
+ async deleteUnits(codes, auth2 = SERVICE30) {
8121
8323
  await this.ctx.http.request({
8122
8324
  method: "DELETE",
8123
8325
  path: `${this.base()}/units`,
@@ -8126,7 +8328,7 @@ var UnitHandlingService = class {
8126
8328
  });
8127
8329
  }
8128
8330
  /** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
8129
- async getConversionFactor(input, auth2 = SERVICE31) {
8331
+ async getConversionFactor(input, auth2 = SERVICE30) {
8130
8332
  return this.ctx.http.request({
8131
8333
  method: "PUT",
8132
8334
  path: `${this.base()}/units/conversion-factor-commands`,
@@ -8135,7 +8337,7 @@ var UnitHandlingService = class {
8135
8337
  });
8136
8338
  }
8137
8339
  /** Convert a value between units (`PUT /units/convert-unit-commands`). */
8138
- async convertUnit(input, auth2 = SERVICE31) {
8340
+ async convertUnit(input, auth2 = SERVICE30) {
8139
8341
  return this.ctx.http.request({
8140
8342
  method: "PUT",
8141
8343
  path: `${this.base()}/units/convert-unit-commands`,
@@ -8144,13 +8346,13 @@ var UnitHandlingService = class {
8144
8346
  });
8145
8347
  }
8146
8348
  /** List all unit types. */
8147
- async listUnitTypes(auth2 = SERVICE31) {
8349
+ async listUnitTypes(auth2 = SERVICE30) {
8148
8350
  return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
8149
8351
  }
8150
8352
  };
8151
8353
 
8152
8354
  // src/services/catalog.ts
8153
- var SERVICE32 = { kind: "service" };
8355
+ var SERVICE31 = { kind: "service" };
8154
8356
  var CatalogService = class {
8155
8357
  constructor(ctx) {
8156
8358
  this.ctx = ctx;
@@ -8161,7 +8363,7 @@ var CatalogService = class {
8161
8363
  return `/catalog/${this.ctx.tenant}/catalogs`;
8162
8364
  }
8163
8365
  /** List catalogs (filtered/sorted). */
8164
- async listCatalogs(query = {}, auth2 = SERVICE32) {
8366
+ async listCatalogs(query = {}, auth2 = SERVICE31) {
8165
8367
  return this.ctx.http.request({
8166
8368
  method: "GET",
8167
8369
  path: this.base(),
@@ -8170,7 +8372,7 @@ var CatalogService = class {
8170
8372
  });
8171
8373
  }
8172
8374
  /** Retrieve a catalog by id. */
8173
- async getCatalog(catalogId, auth2 = SERVICE32) {
8375
+ async getCatalog(catalogId, auth2 = SERVICE31) {
8174
8376
  return this.ctx.http.request({
8175
8377
  method: "GET",
8176
8378
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -8178,7 +8380,7 @@ var CatalogService = class {
8178
8380
  });
8179
8381
  }
8180
8382
  /** Retrieve all catalogs that contain a category. */
8181
- async getCatalogsForCategory(categoryId, auth2 = SERVICE32) {
8383
+ async getCatalogsForCategory(categoryId, auth2 = SERVICE31) {
8182
8384
  return this.ctx.http.request({
8183
8385
  method: "GET",
8184
8386
  path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
@@ -8186,11 +8388,11 @@ var CatalogService = class {
8186
8388
  });
8187
8389
  }
8188
8390
  /** Create a catalog. */
8189
- async createCatalog(input, auth2 = SERVICE32) {
8391
+ async createCatalog(input, auth2 = SERVICE31) {
8190
8392
  return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
8191
8393
  }
8192
8394
  /** Upsert a catalog by id (`PUT`). */
8193
- async updateCatalog(catalogId, input, auth2 = SERVICE32) {
8395
+ async updateCatalog(catalogId, input, auth2 = SERVICE31) {
8194
8396
  return this.ctx.http.request({
8195
8397
  method: "PUT",
8196
8398
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -8199,7 +8401,7 @@ var CatalogService = class {
8199
8401
  });
8200
8402
  }
8201
8403
  /** Partially update a catalog by id (`PATCH`). */
8202
- async patchCatalog(catalogId, patch, auth2 = SERVICE32) {
8404
+ async patchCatalog(catalogId, patch, auth2 = SERVICE31) {
8203
8405
  await this.ctx.http.request({
8204
8406
  method: "PATCH",
8205
8407
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -8208,7 +8410,7 @@ var CatalogService = class {
8208
8410
  });
8209
8411
  }
8210
8412
  /** Remove a catalog by id. */
8211
- async deleteCatalog(catalogId, auth2 = SERVICE32) {
8413
+ async deleteCatalog(catalogId, auth2 = SERVICE31) {
8212
8414
  await this.ctx.http.request({
8213
8415
  method: "DELETE",
8214
8416
  path: `${this.base()}/${encodeURIComponent(catalogId)}`,
@@ -8218,7 +8420,7 @@ var CatalogService = class {
8218
8420
  };
8219
8421
 
8220
8422
  // src/services/vendor.ts
8221
- var SERVICE33 = { kind: "service" };
8423
+ var SERVICE32 = { kind: "service" };
8222
8424
  var VendorService = class {
8223
8425
  constructor(ctx) {
8224
8426
  this.ctx = ctx;
@@ -8230,7 +8432,7 @@ var VendorService = class {
8230
8432
  }
8231
8433
  // --- Vendors ---
8232
8434
  /** List all vendors. */
8233
- async listVendors(query = {}, auth2 = SERVICE33) {
8435
+ async listVendors(query = {}, auth2 = SERVICE32) {
8234
8436
  return this.ctx.http.request({
8235
8437
  method: "GET",
8236
8438
  path: `${this.base()}/vendors`,
@@ -8239,7 +8441,7 @@ var VendorService = class {
8239
8441
  });
8240
8442
  }
8241
8443
  /** Retrieve a vendor by id. */
8242
- async getVendor(vendorId, auth2 = SERVICE33) {
8444
+ async getVendor(vendorId, auth2 = SERVICE32) {
8243
8445
  return this.ctx.http.request({
8244
8446
  method: "GET",
8245
8447
  path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
@@ -8247,7 +8449,7 @@ var VendorService = class {
8247
8449
  });
8248
8450
  }
8249
8451
  /** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
8250
- async searchVendors(query, auth2 = SERVICE33) {
8452
+ async searchVendors(query, auth2 = SERVICE32) {
8251
8453
  const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
8252
8454
  return this.ctx.http.request({
8253
8455
  method: "POST",
@@ -8257,11 +8459,11 @@ var VendorService = class {
8257
8459
  });
8258
8460
  }
8259
8461
  /** Create a vendor. */
8260
- async createVendor(input, auth2 = SERVICE33) {
8462
+ async createVendor(input, auth2 = SERVICE32) {
8261
8463
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
8262
8464
  }
8263
8465
  /** Upsert a vendor by id (`PUT`). */
8264
- async updateVendor(vendorId, input, auth2 = SERVICE33) {
8466
+ async updateVendor(vendorId, input, auth2 = SERVICE32) {
8265
8467
  await this.ctx.http.request({
8266
8468
  method: "PUT",
8267
8469
  path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
@@ -8270,7 +8472,7 @@ var VendorService = class {
8270
8472
  });
8271
8473
  }
8272
8474
  /** Delete a vendor by id. */
8273
- async deleteVendor(vendorId, auth2 = SERVICE33) {
8475
+ async deleteVendor(vendorId, auth2 = SERVICE32) {
8274
8476
  await this.ctx.http.request({
8275
8477
  method: "DELETE",
8276
8478
  path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
@@ -8279,7 +8481,7 @@ var VendorService = class {
8279
8481
  }
8280
8482
  // --- Vendor locations ---
8281
8483
  /** List all vendor locations. */
8282
- async listVendorLocations(query = {}, auth2 = SERVICE33) {
8484
+ async listVendorLocations(query = {}, auth2 = SERVICE32) {
8283
8485
  return this.ctx.http.request({
8284
8486
  method: "GET",
8285
8487
  path: `${this.base()}/locations`,
@@ -8288,7 +8490,7 @@ var VendorService = class {
8288
8490
  });
8289
8491
  }
8290
8492
  /** Retrieve a vendor location by id. */
8291
- async getVendorLocation(locationId, auth2 = SERVICE33) {
8493
+ async getVendorLocation(locationId, auth2 = SERVICE32) {
8292
8494
  return this.ctx.http.request({
8293
8495
  method: "GET",
8294
8496
  path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
@@ -8296,11 +8498,11 @@ var VendorService = class {
8296
8498
  });
8297
8499
  }
8298
8500
  /** Create a vendor location. */
8299
- async createVendorLocation(input, auth2 = SERVICE33) {
8501
+ async createVendorLocation(input, auth2 = SERVICE32) {
8300
8502
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
8301
8503
  }
8302
8504
  /** Upsert a vendor location by id (`PUT`). */
8303
- async updateVendorLocation(locationId, input, auth2 = SERVICE33) {
8505
+ async updateVendorLocation(locationId, input, auth2 = SERVICE32) {
8304
8506
  await this.ctx.http.request({
8305
8507
  method: "PUT",
8306
8508
  path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
@@ -8309,7 +8511,7 @@ var VendorService = class {
8309
8511
  });
8310
8512
  }
8311
8513
  /** Delete a vendor location by id. */
8312
- async deleteVendorLocation(locationId, auth2 = SERVICE33) {
8514
+ async deleteVendorLocation(locationId, auth2 = SERVICE32) {
8313
8515
  await this.ctx.http.request({
8314
8516
  method: "DELETE",
8315
8517
  path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
@@ -8319,7 +8521,7 @@ var VendorService = class {
8319
8521
  };
8320
8522
 
8321
8523
  // src/services/pick-pack.ts
8322
- var SERVICE34 = { kind: "service" };
8524
+ var SERVICE33 = { kind: "service" };
8323
8525
  var PickPackService = class {
8324
8526
  constructor(ctx) {
8325
8527
  this.ctx = ctx;
@@ -8333,7 +8535,7 @@ var PickPackService = class {
8333
8535
  return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
8334
8536
  }
8335
8537
  /** List packlist orders. */
8336
- async listOrders(query = {}, auth2 = SERVICE34) {
8538
+ async listOrders(query = {}, auth2 = SERVICE33) {
8337
8539
  return this.ctx.http.request({
8338
8540
  method: "GET",
8339
8541
  path: `${this.base()}/orders`,
@@ -8342,19 +8544,19 @@ var PickPackService = class {
8342
8544
  });
8343
8545
  }
8344
8546
  /** Retrieve a packlist order by id. */
8345
- async getOrder(orderId, auth2 = SERVICE34) {
8547
+ async getOrder(orderId, auth2 = SERVICE33) {
8346
8548
  return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
8347
8549
  }
8348
8550
  /** Update an order's status (`PATCH`). Returns an acknowledgement. */
8349
- async updateOrder(orderId, change, auth2 = SERVICE34) {
8551
+ async updateOrder(orderId, change, auth2 = SERVICE33) {
8350
8552
  return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
8351
8553
  }
8352
8554
  /** Finish an order. Returns an acknowledgement. */
8353
- async finishOrder(orderId, auth2 = SERVICE34) {
8555
+ async finishOrder(orderId, auth2 = SERVICE33) {
8354
8556
  return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
8355
8557
  }
8356
8558
  /** List order cycles (ids). */
8357
- async listOrderCycles(query = {}, auth2 = SERVICE34) {
8559
+ async listOrderCycles(query = {}, auth2 = SERVICE33) {
8358
8560
  return this.ctx.http.request({
8359
8561
  method: "GET",
8360
8562
  path: `${this.base()}/orderCycles`,
@@ -8363,11 +8565,11 @@ var PickPackService = class {
8363
8565
  });
8364
8566
  }
8365
8567
  /** Add an assignee to an order. Returns an acknowledgement. */
8366
- async addAssignee(orderId, assignee, auth2 = SERVICE34) {
8568
+ async addAssignee(orderId, assignee, auth2 = SERVICE33) {
8367
8569
  return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
8368
8570
  }
8369
8571
  /** Remove an assignee from an order. */
8370
- async removeAssignee(orderId, assigneeId, auth2 = SERVICE34) {
8572
+ async removeAssignee(orderId, assigneeId, auth2 = SERVICE33) {
8371
8573
  await this.ctx.http.request({
8372
8574
  method: "DELETE",
8373
8575
  path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
@@ -8375,15 +8577,15 @@ var PickPackService = class {
8375
8577
  });
8376
8578
  }
8377
8579
  /** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
8378
- async updatePackaging(orderId, change, auth2 = SERVICE34) {
8580
+ async updatePackaging(orderId, change, auth2 = SERVICE33) {
8379
8581
  return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
8380
8582
  }
8381
8583
  /** Create a packing event. Returns an acknowledgement. */
8382
- async createEvent(event, auth2 = SERVICE34) {
8584
+ async createEvent(event, auth2 = SERVICE33) {
8383
8585
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
8384
8586
  }
8385
8587
  /** List packing events. */
8386
- async listEvents(query = {}, auth2 = SERVICE34) {
8588
+ async listEvents(query = {}, auth2 = SERVICE33) {
8387
8589
  return this.ctx.http.request({
8388
8590
  method: "GET",
8389
8591
  path: `${this.base()}/events`,
@@ -8392,7 +8594,7 @@ var PickPackService = class {
8392
8594
  });
8393
8595
  }
8394
8596
  /** Trigger an order recalculation. Returns the created job's id. */
8395
- async triggerRecalculation(input, auth2 = SERVICE34) {
8597
+ async triggerRecalculation(input, auth2 = SERVICE33) {
8396
8598
  return this.ctx.http.request({
8397
8599
  method: "POST",
8398
8600
  path: `${this.base()}/jobs/recalculations`,
@@ -8401,7 +8603,7 @@ var PickPackService = class {
8401
8603
  });
8402
8604
  }
8403
8605
  /** Retrieve a recalculation job by id. */
8404
- async getRecalculationJob(jobId, auth2 = SERVICE34) {
8606
+ async getRecalculationJob(jobId, auth2 = SERVICE33) {
8405
8607
  return this.ctx.http.request({
8406
8608
  method: "GET",
8407
8609
  path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
@@ -8411,7 +8613,7 @@ var PickPackService = class {
8411
8613
  };
8412
8614
 
8413
8615
  // src/services/customer-admin.ts
8414
- var SERVICE35 = { kind: "service" };
8616
+ var SERVICE34 = { kind: "service" };
8415
8617
  var CustomerAdminService = class {
8416
8618
  constructor(ctx) {
8417
8619
  this.ctx = ctx;
@@ -8432,7 +8634,7 @@ var CustomerAdminService = class {
8432
8634
  }
8433
8635
  // --- Customers ---
8434
8636
  /** List customers. */
8435
- async listCustomers(query = {}, auth2 = SERVICE35) {
8637
+ async listCustomers(query = {}, auth2 = SERVICE34) {
8436
8638
  return this.ctx.http.request({
8437
8639
  method: "GET",
8438
8640
  path: this.base(),
@@ -8441,33 +8643,33 @@ var CustomerAdminService = class {
8441
8643
  });
8442
8644
  }
8443
8645
  /** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
8444
- async searchCustomers(query, auth2 = SERVICE35) {
8646
+ async searchCustomers(query, auth2 = SERVICE34) {
8445
8647
  const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
8446
8648
  return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
8447
8649
  }
8448
8650
  /** Retrieve a customer profile by number. */
8449
- async getCustomer(customerNumber, auth2 = SERVICE35) {
8651
+ async getCustomer(customerNumber, auth2 = SERVICE34) {
8450
8652
  return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
8451
8653
  }
8452
8654
  /** Create a customer. */
8453
- async createCustomer(input, auth2 = SERVICE35) {
8655
+ async createCustomer(input, auth2 = SERVICE34) {
8454
8656
  return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
8455
8657
  }
8456
8658
  /** Upsert a customer profile by number (`PUT`). */
8457
- async upsertCustomer(customerNumber, input, auth2 = SERVICE35) {
8659
+ async upsertCustomer(customerNumber, input, auth2 = SERVICE34) {
8458
8660
  return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
8459
8661
  }
8460
8662
  /** Partially update a customer profile (`PATCH`). */
8461
- async patchCustomer(customerNumber, patch, auth2 = SERVICE35) {
8663
+ async patchCustomer(customerNumber, patch, auth2 = SERVICE34) {
8462
8664
  await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
8463
8665
  }
8464
8666
  /** Delete a customer profile. */
8465
- async deleteCustomer(customerNumber, auth2 = SERVICE35) {
8667
+ async deleteCustomer(customerNumber, auth2 = SERVICE34) {
8466
8668
  await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
8467
8669
  }
8468
8670
  // --- Addresses ---
8469
8671
  /** List a customer's addresses. */
8470
- async listAddresses(customerNumber, auth2 = SERVICE35) {
8672
+ async listAddresses(customerNumber, auth2 = SERVICE34) {
8471
8673
  return this.ctx.http.request({
8472
8674
  method: "GET",
8473
8675
  path: `${this.customerPath(customerNumber)}/addresses`,
@@ -8475,11 +8677,11 @@ var CustomerAdminService = class {
8475
8677
  });
8476
8678
  }
8477
8679
  /** Retrieve one address. */
8478
- async getAddress(customerNumber, addressId, auth2 = SERVICE35) {
8680
+ async getAddress(customerNumber, addressId, auth2 = SERVICE34) {
8479
8681
  return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
8480
8682
  }
8481
8683
  /** Add an address. */
8482
- async addAddress(customerNumber, input, auth2 = SERVICE35) {
8684
+ async addAddress(customerNumber, input, auth2 = SERVICE34) {
8483
8685
  return this.ctx.http.request({
8484
8686
  method: "POST",
8485
8687
  path: `${this.customerPath(customerNumber)}/addresses`,
@@ -8488,19 +8690,19 @@ var CustomerAdminService = class {
8488
8690
  });
8489
8691
  }
8490
8692
  /** Upsert an address by id (`PUT`). */
8491
- async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE35) {
8693
+ async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE34) {
8492
8694
  return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
8493
8695
  }
8494
8696
  /** Partially update an address by id (`PATCH`). */
8495
- async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE35) {
8697
+ async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE34) {
8496
8698
  await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
8497
8699
  }
8498
8700
  /** Delete an address by id. */
8499
- async deleteAddress(customerNumber, addressId, auth2 = SERVICE35) {
8701
+ async deleteAddress(customerNumber, addressId, auth2 = SERVICE34) {
8500
8702
  await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
8501
8703
  }
8502
8704
  /** Add tags to an address (`?tags=` query). */
8503
- async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
8705
+ async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE34) {
8504
8706
  await this.ctx.http.request({
8505
8707
  method: "POST",
8506
8708
  path: `${this.addressPath(customerNumber, addressId)}/tags`,
@@ -8509,7 +8711,7 @@ var CustomerAdminService = class {
8509
8711
  });
8510
8712
  }
8511
8713
  /** Remove tags from an address (`?tags=` query). */
8512
- async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
8714
+ async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE34) {
8513
8715
  await this.ctx.http.request({
8514
8716
  method: "DELETE",
8515
8717
  path: `${this.addressPath(customerNumber, addressId)}/tags`,
@@ -8523,7 +8725,7 @@ var CustomerAdminService = class {
8523
8725
  * `customer.import_read` scope. An unconfigured tenant answers with an empty
8524
8726
  * object rather than a 404.
8525
8727
  */
8526
- async getPasswordMigrationRetention(auth2 = SERVICE35) {
8728
+ async getPasswordMigrationRetention(auth2 = SERVICE34) {
8527
8729
  return this.ctx.http.request({
8528
8730
  method: "GET",
8529
8731
  path: this.configPath(),
@@ -8536,7 +8738,7 @@ var CustomerAdminService = class {
8536
8738
  * `legacyAuth`** — that import is rejected without an active config. Re-POST with
8537
8739
  * an earlier `retentionEndDate` to shorten a running window.
8538
8740
  */
8539
- async configurePasswordMigrationRetention(input, auth2 = SERVICE35) {
8741
+ async configurePasswordMigrationRetention(input, auth2 = SERVICE34) {
8540
8742
  return this.ctx.http.request({
8541
8743
  method: "POST",
8542
8744
  path: this.configPath(),
@@ -8549,7 +8751,7 @@ var CustomerAdminService = class {
8549
8751
  * Intended for after the migration window: when the window ends, unmigrated
8550
8752
  * accounts need a password reset and their legacy credentials are cleared.
8551
8753
  */
8552
- async deletePasswordMigrationRetention(auth2 = SERVICE35) {
8754
+ async deletePasswordMigrationRetention(auth2 = SERVICE34) {
8553
8755
  await this.ctx.http.request({ method: "DELETE", path: this.configPath(), auth: auth2 });
8554
8756
  }
8555
8757
  // --- Bulk import ---
@@ -8562,7 +8764,7 @@ var CustomerAdminService = class {
8562
8764
  * `account.legacyAuth`, and importing `legacyAuth` requires an active retention
8563
8765
  * config (see `configurePasswordMigrationRetention`).
8564
8766
  */
8565
- async importCustomers(input, auth2 = SERVICE35) {
8767
+ async importCustomers(input, auth2 = SERVICE34) {
8566
8768
  return this.ctx.http.request({
8567
8769
  method: "POST",
8568
8770
  path: `${this.base()}/import`,
@@ -8573,7 +8775,7 @@ var CustomerAdminService = class {
8573
8775
  };
8574
8776
 
8575
8777
  // src/services/approval.ts
8576
- var SERVICE36 = { kind: "service" };
8778
+ var SERVICE35 = { kind: "service" };
8577
8779
  var ApprovalService = class {
8578
8780
  constructor(ctx) {
8579
8781
  this.ctx = ctx;
@@ -8584,7 +8786,7 @@ var ApprovalService = class {
8584
8786
  return `/approval/${this.ctx.tenant}`;
8585
8787
  }
8586
8788
  /** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
8587
- async listApprovals(query = {}, auth2 = SERVICE36) {
8789
+ async listApprovals(query = {}, auth2 = SERVICE35) {
8588
8790
  return this.ctx.http.request({
8589
8791
  method: "GET",
8590
8792
  path: `${this.base()}/approvals`,
@@ -8593,7 +8795,7 @@ var ApprovalService = class {
8593
8795
  });
8594
8796
  }
8595
8797
  /** Retrieve a single approval by id. */
8596
- async getApproval(approvalId, auth2 = SERVICE36) {
8798
+ async getApproval(approvalId, auth2 = SERVICE35) {
8597
8799
  return this.ctx.http.request({
8598
8800
  method: "GET",
8599
8801
  path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
@@ -8601,7 +8803,7 @@ var ApprovalService = class {
8601
8803
  });
8602
8804
  }
8603
8805
  /** Create an approval request (cart or quote). Returns the created `{ id }`. */
8604
- async createApproval(input, auth2 = SERVICE36) {
8806
+ async createApproval(input, auth2 = SERVICE35) {
8605
8807
  return this.ctx.http.request({
8606
8808
  method: "POST",
8607
8809
  path: `${this.base()}/approvals`,
@@ -8610,7 +8812,7 @@ var ApprovalService = class {
8610
8812
  });
8611
8813
  }
8612
8814
  /** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
8613
- async updateApproval(approvalId, ops, auth2 = SERVICE36) {
8815
+ async updateApproval(approvalId, ops, auth2 = SERVICE35) {
8614
8816
  await this.ctx.http.request({
8615
8817
  method: "PATCH",
8616
8818
  path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
@@ -8619,7 +8821,7 @@ var ApprovalService = class {
8619
8821
  });
8620
8822
  }
8621
8823
  /** Delete an approval by id. */
8622
- async deleteApproval(approvalId, auth2 = SERVICE36) {
8824
+ async deleteApproval(approvalId, auth2 = SERVICE35) {
8623
8825
  await this.ctx.http.request({
8624
8826
  method: "DELETE",
8625
8827
  path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
@@ -8627,7 +8829,7 @@ var ApprovalService = class {
8627
8829
  });
8628
8830
  }
8629
8831
  /** Check whether an operation on a resource is permitted / needs approval. */
8630
- async checkPermitted(input, auth2 = SERVICE36) {
8832
+ async checkPermitted(input, auth2 = SERVICE35) {
8631
8833
  return this.ctx.http.request({
8632
8834
  method: "POST",
8633
8835
  path: `${this.base()}/approval/permitted`,
@@ -8636,7 +8838,7 @@ var ApprovalService = class {
8636
8838
  });
8637
8839
  }
8638
8840
  /** Search for users eligible to approve a resource. Returns an array. */
8639
- async searchApprovers(input, auth2 = SERVICE36) {
8841
+ async searchApprovers(input, auth2 = SERVICE35) {
8640
8842
  return this.ctx.http.request({
8641
8843
  method: "POST",
8642
8844
  path: `${this.base()}/search/users`,
@@ -8697,7 +8899,6 @@ var EmporixClient = class {
8697
8899
  invoices;
8698
8900
  quotes;
8699
8901
  returns;
8700
- sepaExport;
8701
8902
  indexing;
8702
8903
  imports;
8703
8904
  units;
@@ -8772,7 +8973,6 @@ var EmporixClient = class {
8772
8973
  this.invoices = new InvoiceService(mk(InvoiceService.channel));
8773
8974
  this.quotes = new QuoteService(mk(QuoteService.channel));
8774
8975
  this.returns = new ReturnsService(mk(ReturnsService.channel));
8775
- this.sepaExport = new SepaExportService(mk(SepaExportService.channel));
8776
8976
  this.indexing = new IndexingService(mk(IndexingService.channel));
8777
8977
  this.imports = new ImportService(mk(ImportService.channel));
8778
8978
  this.units = new UnitHandlingService(mk(UnitHandlingService.channel));
@@ -8903,7 +9103,6 @@ exports.STORAGE_KEYS = STORAGE_KEYS;
8903
9103
  exports.SalesOrdersService = SalesOrdersService;
8904
9104
  exports.SchemaService = SchemaService;
8905
9105
  exports.SegmentService = SegmentService;
8906
- exports.SepaExportService = SepaExportService;
8907
9106
  exports.SequentialIdService = SequentialIdService;
8908
9107
  exports.SessionContextService = SessionContextService;
8909
9108
  exports.ShippingService = ShippingService;
@@ -8918,11 +9117,20 @@ exports.approvalStatusPatch = approvalStatusPatch;
8918
9117
  exports.auth = auth;
8919
9118
  exports.createConsoleLogger = createConsoleLogger;
8920
9119
  exports.createCookieBackedStorage = createCookieBackedStorage;
9120
+ exports.createCookieStorage = createCookieStorage;
8921
9121
  exports.createCore = createCore;
8922
9122
  exports.createEmporixClient = createEmporixClient;
9123
+ exports.createListenerSet = createListenerSet;
9124
+ exports.createLocalStorage = createLocalStorage;
9125
+ exports.createLocalStorageStorage = createLocalStorageStorage;
9126
+ exports.createMemoryStorage = createMemoryStorage;
8923
9127
  exports.createNoopLogger = createNoopLogger;
8924
9128
  exports.createServerStorage = createServerStorage;
9129
+ exports.createSessionStorage = createSessionStorage;
9130
+ exports.emporixKey = emporixKey;
8925
9131
  exports.errorFromResponse = errorFromResponse;
9132
+ exports.fromWebStorage = fromWebStorage;
9133
+ exports.getCustomerSessionStore = getCustomerSessionStore;
8926
9134
  exports.iterateAll = iterateAll;
8927
9135
  exports.parseAnonymousSession = parseAnonymousSession;
8928
9136
  exports.pickFee = pickFee;
@@ -8933,6 +9141,7 @@ exports.resolveQuery = resolveQuery;
8933
9141
  exports.resolveToken = resolveToken;
8934
9142
  exports.resolveZone = resolveZone;
8935
9143
  exports.serverAuth = serverAuth;
9144
+ exports.siteMeta = siteMeta;
8936
9145
  exports.validateConfig = validateConfig;
8937
9146
  //# sourceMappingURL=index.cjs.map
8938
9147
  //# sourceMappingURL=index.cjs.map