@spscommerce/asst-api 0.0.1-beta.1 → 0.0.1-beta.11

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 (65) hide show
  1. package/dist/ItemCategoriesSearch-44b87663.d.ts +318 -0
  2. package/dist/ItemCategoriesSearch-e0870a34.d.ts +318 -0
  3. package/dist/ItemCategoriesSearch-e3298650.d.ts +319 -0
  4. package/dist/ItemCategoriesSearch-ec43591f.d.ts +319 -0
  5. package/dist/ItemCategory-14816deb.d.ts +99 -0
  6. package/dist/ItemErrorDetails-0eed9761.d.ts +3200 -0
  7. package/dist/ItemErrorDetails-1614b511.d.ts +3137 -0
  8. package/dist/ItemErrorDetails-1bd2821e.d.ts +3137 -0
  9. package/dist/ItemErrorDetails-b2c79d10.d.ts +3197 -0
  10. package/dist/ItemErrorDetails-ba155b70.d.ts +3269 -0
  11. package/dist/ItemErrorDetails-bc465036.d.ts +3200 -0
  12. package/dist/ItemErrorDetails-e6e400aa.d.ts +3197 -0
  13. package/dist/ItemErrorDetailsResult-0b4a628c.d.ts +3032 -0
  14. package/dist/ItemErrorDetailsResult-8317ab6e.d.ts +3092 -0
  15. package/dist/ItemErrorDetailsResult-859368da.d.ts +3032 -0
  16. package/dist/ItemErrorDetailsResult-9ac97c24.d.ts +3032 -0
  17. package/dist/ItemErrorDetailsResult-ae90f329.d.ts +3097 -0
  18. package/dist/ItemErrorDetailsResult-c12c4eac.d.ts +3032 -0
  19. package/dist/ItemErrorDetailsResult-c62caeae.d.ts +3092 -0
  20. package/dist/ItemErrorDetailsResult-fbc33a43.d.ts +3097 -0
  21. package/dist/ItemStatusResponse-7f871d5a.d.ts +91 -0
  22. package/dist/TradingPartnerAccessByCompanyId-29866586.d.ts +97 -0
  23. package/dist/TradingPartnerAccessByCompanyId-43f83fb6.d.ts +130 -0
  24. package/dist/TradingPartnerAccessByCompanyId-53b868a8.d.ts +125 -0
  25. package/dist/TradingPartnerAccessByCompanyId-b227f0c5.d.ts +125 -0
  26. package/dist/TradingPartnerAccessByCompanyId-e7a1d443.d.ts +129 -0
  27. package/dist/chunk-3CJG5LDN.js +360 -0
  28. package/dist/chunk-3FMMM7IS.js +80 -0
  29. package/dist/chunk-3JRE7YYE.js +4576 -0
  30. package/dist/chunk-4HWZ3JEH.js +328 -0
  31. package/dist/chunk-4WER3ZLX.js +4576 -0
  32. package/dist/chunk-5YWAQNT6.js +4634 -0
  33. package/dist/chunk-6ZNFOWTV.js +78 -0
  34. package/dist/chunk-CB3PVPHS.js +344 -0
  35. package/dist/chunk-ETURPA7W.js +326 -0
  36. package/dist/chunk-F3KCLICG.js +77 -0
  37. package/dist/chunk-FS6LHGAR.js +87 -0
  38. package/dist/chunk-G36FM5OA.js +327 -0
  39. package/dist/chunk-GDFX3WTX.js +78 -0
  40. package/dist/chunk-GSUSBCHT.js +4576 -0
  41. package/dist/chunk-IHIEBLQV.js +4576 -0
  42. package/dist/chunk-ITWMRXLD.js +328 -0
  43. package/dist/chunk-J3A66IGS.js +389 -0
  44. package/dist/chunk-LYMGZWSR.js +80 -0
  45. package/dist/chunk-N2OYWNHF.js +80 -0
  46. package/dist/chunk-OA6PO3QG.js +78 -0
  47. package/dist/chunk-OBXZRDPY.js +77 -0
  48. package/dist/chunk-OI47EFQH.js +82 -0
  49. package/dist/chunk-OVOZIZA2.js +326 -0
  50. package/dist/chunk-RRGAJ4ZS.js +4576 -0
  51. package/dist/chunk-T3UCSW2B.js +81 -0
  52. package/dist/chunk-VNFU2PUV.js +4577 -0
  53. package/dist/chunk-WN2FPUF3.js +4577 -0
  54. package/dist/chunk-XMNYZGXF.js +84 -0
  55. package/dist/chunk-YCQUK6KV.js +85 -0
  56. package/dist/index.cjs +1001 -84
  57. package/dist/index.d.ts +197 -46
  58. package/dist/index.js +23 -56
  59. package/dist/msw.cjs +1056 -65
  60. package/dist/msw.d.ts +638 -76
  61. package/dist/msw.js +317 -54
  62. package/dist/zod.cjs +812 -17
  63. package/dist/zod.d.ts +4 -2
  64. package/dist/zod.js +112 -52
  65. package/package.json +2 -3
@@ -0,0 +1,80 @@
1
+ import {
2
+ z
3
+ } from "./chunk-D3ML6E4G.js";
4
+
5
+ // lib/asstClient.ts
6
+ import ky from "ky-universal";
7
+ var baseUrlsSchema = z.object({
8
+ local: z.literal("https://localhost:8443"),
9
+ test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
10
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway")
11
+ });
12
+ var BASE_URLS = {
13
+ local: "https://localhost:8443",
14
+ test: "https://integration.api.spscommerce.com/assortment/gateway",
15
+ prod: "https://api.spscommerce.com/assortment/gateway"
16
+ };
17
+ var envSchema = baseUrlsSchema.keyof();
18
+ var initialConfig = {
19
+ prefixUrl: BASE_URLS["test"],
20
+ retry: 0
21
+ };
22
+ var AsstClient = class {
23
+ #client = ky.create(initialConfig);
24
+ #baseUrl = BASE_URLS["test"];
25
+ #subscriptionCallback;
26
+ #currentConfig = initialConfig;
27
+ constructor(options) {
28
+ if (options) {
29
+ this.updateConfig(options);
30
+ }
31
+ }
32
+ updateConfig(options) {
33
+ this.#client = this.#client.extend(options);
34
+ this.#currentConfig = options;
35
+ if (options.prefixUrl) {
36
+ this.#baseUrl = options.prefixUrl;
37
+ }
38
+ if (this.#subscriptionCallback) {
39
+ this.#subscriptionCallback(options);
40
+ }
41
+ }
42
+ getBaseUrl() {
43
+ return this.#baseUrl;
44
+ }
45
+ /**
46
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
47
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
48
+ */
49
+ subscribeToConfigChange(subscriptionCallback) {
50
+ this.#subscriptionCallback = subscriptionCallback;
51
+ subscriptionCallback(this.#currentConfig);
52
+ }
53
+ unsubscribeToConfigChange() {
54
+ this.#subscriptionCallback = void 0;
55
+ }
56
+ get(url, options) {
57
+ return this.#client.get(url, options);
58
+ }
59
+ post(url, options) {
60
+ return this.#client.post(url, options);
61
+ }
62
+ put(url, options) {
63
+ return this.#client.put(url, options);
64
+ }
65
+ patch(url, options) {
66
+ return this.#client.patch(url, options);
67
+ }
68
+ head(url, options) {
69
+ return this.#client.head(url, options);
70
+ }
71
+ delete(url, options) {
72
+ return this.#client.delete(url, options);
73
+ }
74
+ };
75
+
76
+ export {
77
+ BASE_URLS,
78
+ envSchema,
79
+ AsstClient
80
+ };
@@ -0,0 +1,80 @@
1
+ import {
2
+ z
3
+ } from "./chunk-D3ML6E4G.js";
4
+
5
+ // lib/asstClient.ts
6
+ import ky from "ky-universal";
7
+ var baseUrlsSchema = z.object({
8
+ local: z.literal("https://localhost:8443"),
9
+ test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
10
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway")
11
+ });
12
+ var BASE_URLS = {
13
+ local: "https://localhost:8443",
14
+ test: "https://integration.api.spscommerce.com/assortment/gateway",
15
+ prod: "https://api.spscommerce.com/assortment/gateway"
16
+ };
17
+ var envSchema = baseUrlsSchema.keyof();
18
+ var AsstClient = class {
19
+ #client = ky.create({
20
+ prefixUrl: BASE_URLS["test"],
21
+ retry: 0
22
+ });
23
+ #baseUrl = BASE_URLS["test"];
24
+ #subscriptionCallback;
25
+ #currentConfig = {};
26
+ constructor(options) {
27
+ console.log(`AsstClient created! Config: ${options ? JSON.stringify(options) : "default"}`);
28
+ if (options) {
29
+ this.updateConfig(options);
30
+ }
31
+ }
32
+ updateConfig(options) {
33
+ this.#client = this.#client.extend(options);
34
+ this.#currentConfig = options;
35
+ if (options.prefixUrl) {
36
+ this.#baseUrl = options.prefixUrl;
37
+ }
38
+ if (this.#subscriptionCallback) {
39
+ this.#subscriptionCallback(options);
40
+ }
41
+ }
42
+ getBaseUrl() {
43
+ return this.#baseUrl;
44
+ }
45
+ /**
46
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
47
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
48
+ */
49
+ subscribeToConfigChange(subscriptionCallback) {
50
+ this.#subscriptionCallback = subscriptionCallback;
51
+ subscriptionCallback(this.#currentConfig);
52
+ }
53
+ unsubscribeToConfigChange() {
54
+ this.#subscriptionCallback = void 0;
55
+ }
56
+ get(url, options) {
57
+ return this.#client.get(url, options);
58
+ }
59
+ post(url, options) {
60
+ return this.#client.post(url, options);
61
+ }
62
+ put(url, options) {
63
+ return this.#client.put(url, options);
64
+ }
65
+ patch(url, options) {
66
+ return this.#client.patch(url, options);
67
+ }
68
+ head(url, options) {
69
+ return this.#client.head(url, options);
70
+ }
71
+ delete(url, options) {
72
+ return this.#client.delete(url, options);
73
+ }
74
+ };
75
+
76
+ export {
77
+ BASE_URLS,
78
+ envSchema,
79
+ AsstClient
80
+ };
@@ -0,0 +1,78 @@
1
+ import {
2
+ z
3
+ } from "./chunk-D3ML6E4G.js";
4
+
5
+ // lib/asstClient.ts
6
+ import ky from "ky-universal";
7
+ var baseUrlsSchema = z.object({
8
+ local: z.literal("https://localhost:8443"),
9
+ test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
10
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway")
11
+ });
12
+ var BASE_URLS = {
13
+ local: "https://localhost:8443",
14
+ test: "https://integration.api.spscommerce.com/assortment/gateway",
15
+ prod: "https://api.spscommerce.com/assortment/gateway"
16
+ };
17
+ var envSchema = baseUrlsSchema.keyof();
18
+ var AsstClient = class {
19
+ #client = ky.create({
20
+ prefixUrl: BASE_URLS["test"],
21
+ retry: 0
22
+ });
23
+ #baseUrl = BASE_URLS["test"];
24
+ #subscriptionCallback;
25
+ #currentConfig = {};
26
+ constructor(options) {
27
+ console.log(`AsstClient created`);
28
+ this.updateConfig(options);
29
+ }
30
+ updateConfig(options) {
31
+ this.#client = this.#client.extend(options);
32
+ this.#currentConfig = options;
33
+ if (options.prefixUrl) {
34
+ this.#baseUrl = options.prefixUrl;
35
+ }
36
+ if (this.#subscriptionCallback) {
37
+ this.#subscriptionCallback(options);
38
+ }
39
+ }
40
+ getBaseUrl() {
41
+ return this.#baseUrl;
42
+ }
43
+ /**
44
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
45
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
46
+ */
47
+ subscribeToConfigChange(subscriptionCallback) {
48
+ this.#subscriptionCallback = subscriptionCallback;
49
+ subscriptionCallback(this.#currentConfig);
50
+ }
51
+ unsubscribeToConfigChange() {
52
+ this.#subscriptionCallback = void 0;
53
+ }
54
+ get(url, options) {
55
+ return this.#client.get(url, options);
56
+ }
57
+ post(url, options) {
58
+ return this.#client.post(url, options);
59
+ }
60
+ put(url, options) {
61
+ return this.#client.put(url, options);
62
+ }
63
+ patch(url, options) {
64
+ return this.#client.patch(url, options);
65
+ }
66
+ head(url, options) {
67
+ return this.#client.head(url, options);
68
+ }
69
+ delete(url, options) {
70
+ return this.#client.delete(url, options);
71
+ }
72
+ };
73
+
74
+ export {
75
+ BASE_URLS,
76
+ envSchema,
77
+ AsstClient
78
+ };
@@ -0,0 +1,77 @@
1
+ import {
2
+ z
3
+ } from "./chunk-D3ML6E4G.js";
4
+
5
+ // lib/asstClient.ts
6
+ import ky from "ky-universal";
7
+ var baseUrlsSchema = z.object({
8
+ local: z.literal("https://localhost:8443"),
9
+ test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
10
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway")
11
+ });
12
+ var BASE_URLS = {
13
+ local: "https://localhost:8443",
14
+ test: "https://integration.api.spscommerce.com/assortment/gateway",
15
+ prod: "https://api.spscommerce.com/assortment/gateway"
16
+ };
17
+ var envSchema = baseUrlsSchema.keyof();
18
+ var initialConfig = {
19
+ prefixUrl: BASE_URLS["test"],
20
+ retry: 0
21
+ };
22
+ var AsstClient = class {
23
+ #client = ky.create(initialConfig);
24
+ #baseUrl = BASE_URLS["test"];
25
+ #listeners = /* @__PURE__ */ new Set();
26
+ #currentConfig = initialConfig;
27
+ constructor(options) {
28
+ if (options) {
29
+ this.updateConfig(options);
30
+ }
31
+ }
32
+ updateConfig(options) {
33
+ this.#client = this.#client.extend(options);
34
+ this.#currentConfig = options;
35
+ if (options.prefixUrl) {
36
+ this.#baseUrl = options.prefixUrl;
37
+ }
38
+ this.#listeners.forEach((listener) => listener(options));
39
+ }
40
+ getBaseUrl() {
41
+ return this.#baseUrl;
42
+ }
43
+ /**
44
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
45
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
46
+ * @returns Function to unsubscribe to config changes
47
+ */
48
+ subscribeToConfigChange(listener) {
49
+ this.#listeners.add(listener);
50
+ listener(this.#currentConfig);
51
+ return () => this.#listeners.delete(listener);
52
+ }
53
+ get(url, options) {
54
+ return this.#client.get(url, options);
55
+ }
56
+ post(url, options) {
57
+ return this.#client.post(url, options);
58
+ }
59
+ put(url, options) {
60
+ return this.#client.put(url, options);
61
+ }
62
+ patch(url, options) {
63
+ return this.#client.patch(url, options);
64
+ }
65
+ head(url, options) {
66
+ return this.#client.head(url, options);
67
+ }
68
+ delete(url, options) {
69
+ return this.#client.delete(url, options);
70
+ }
71
+ };
72
+
73
+ export {
74
+ BASE_URLS,
75
+ envSchema,
76
+ AsstClient
77
+ };
@@ -0,0 +1,82 @@
1
+ import {
2
+ z
3
+ } from "./chunk-D3ML6E4G.js";
4
+
5
+ // lib/asstClient.ts
6
+ import ky from "ky-universal";
7
+ var baseUrlsSchema = z.object({
8
+ local: z.literal("https://localhost:8443"),
9
+ test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
10
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway")
11
+ });
12
+ var BASE_URLS = {
13
+ local: "https://localhost:8443",
14
+ test: "https://integration.api.spscommerce.com/assortment/gateway",
15
+ prod: "https://api.spscommerce.com/assortment/gateway"
16
+ };
17
+ var envSchema = baseUrlsSchema.keyof();
18
+ var initialConfig = {
19
+ prefixUrl: BASE_URLS["test"],
20
+ retry: 0
21
+ };
22
+ var AsstClient = class {
23
+ #client = ky.create(initialConfig);
24
+ #baseUrl = BASE_URLS["test"];
25
+ #subscriptionCallback;
26
+ #currentConfig = initialConfig;
27
+ constructor(options) {
28
+ console.log(`AsstClient created! Config: ${options ? JSON.stringify(options) : "default"}`);
29
+ if (options) {
30
+ this.updateConfig(options);
31
+ }
32
+ }
33
+ updateConfig(options) {
34
+ this.#client = this.#client.extend(options);
35
+ this.#currentConfig = options;
36
+ if (options.prefixUrl) {
37
+ this.#baseUrl = options.prefixUrl;
38
+ }
39
+ if (this.#subscriptionCallback) {
40
+ this.#subscriptionCallback(options);
41
+ }
42
+ }
43
+ getBaseUrl() {
44
+ return this.#baseUrl;
45
+ }
46
+ /**
47
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
48
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
49
+ */
50
+ subscribeToConfigChange(subscriptionCallback) {
51
+ console.log(`Subscription added`);
52
+ this.#subscriptionCallback = subscriptionCallback;
53
+ subscriptionCallback(this.#currentConfig);
54
+ }
55
+ unsubscribeToConfigChange() {
56
+ this.#subscriptionCallback = void 0;
57
+ }
58
+ get(url, options) {
59
+ return this.#client.get(url, options);
60
+ }
61
+ post(url, options) {
62
+ return this.#client.post(url, options);
63
+ }
64
+ put(url, options) {
65
+ return this.#client.put(url, options);
66
+ }
67
+ patch(url, options) {
68
+ return this.#client.patch(url, options);
69
+ }
70
+ head(url, options) {
71
+ return this.#client.head(url, options);
72
+ }
73
+ delete(url, options) {
74
+ return this.#client.delete(url, options);
75
+ }
76
+ };
77
+
78
+ export {
79
+ BASE_URLS,
80
+ envSchema,
81
+ AsstClient
82
+ };