@spscommerce/asst-api 0.0.1-beta.9 → 0.0.1

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 (61) hide show
  1. package/dist/{ItemErrorDetailsResult-c62caeae.d.ts → ItemErrorDetailsResult-317fbe3e.d.ts} +166 -156
  2. package/dist/ItemStatusResponse-7f871d5a.d.ts +91 -0
  3. package/dist/{chunk-IHIEBLQV.js → chunk-HEFVXX2V.js} +82 -23
  4. package/dist/{chunk-ITWMRXLD.js → chunk-HG7MCO42.js} +77 -16
  5. package/dist/index.cjs +148 -36
  6. package/dist/index.d.ts +119 -6
  7. package/dist/index.js +4 -2
  8. package/dist/msw.cjs +158 -29
  9. package/dist/msw.d.ts +110 -69
  10. package/dist/msw.js +82 -11
  11. package/dist/{ItemErrorDetails-e6e400aa.d.ts → zod-1c4396f8.d.ts} +179 -103
  12. package/dist/zod.cjs +84 -22
  13. package/dist/zod.d.ts +2 -2
  14. package/dist/zod.js +9 -1
  15. package/package.json +1 -1
  16. package/dist/ImportsStatus-52d26b01.d.ts +0 -134
  17. package/dist/ImportsStatusEnum-22c03a0b.d.ts +0 -51
  18. package/dist/ItemCategoriesSearch-1bb945de.d.ts +0 -275
  19. package/dist/ItemCategoriesSearch-44b87663.d.ts +0 -318
  20. package/dist/ItemCategoriesSearch-e0870a34.d.ts +0 -318
  21. package/dist/ItemCategoriesSearch-e3298650.d.ts +0 -319
  22. package/dist/ItemCategoriesSearch-ec43591f.d.ts +0 -319
  23. package/dist/ItemCategory-14816deb.d.ts +0 -99
  24. package/dist/ItemCategory-768179bd.d.ts +0 -99
  25. package/dist/ItemErrorDetails-1614b511.d.ts +0 -3137
  26. package/dist/ItemErrorDetails-1bd2821e.d.ts +0 -3137
  27. package/dist/ItemErrorDetailsResult-0b4a628c.d.ts +0 -3032
  28. package/dist/ItemErrorDetailsResult-859368da.d.ts +0 -3032
  29. package/dist/ItemErrorDetailsResult-9ac97c24.d.ts +0 -3032
  30. package/dist/ItemErrorDetailsResult-c12c4eac.d.ts +0 -3032
  31. package/dist/TradingPartnerAccessByCompanyId-29866586.d.ts +0 -97
  32. package/dist/TradingPartnerAccessByCompanyId-43f83fb6.d.ts +0 -130
  33. package/dist/TradingPartnerAccessByCompanyId-479e3e57.d.ts +0 -124
  34. package/dist/TradingPartnerAccessByCompanyId-53b868a8.d.ts +0 -125
  35. package/dist/TradingPartnerAccessByCompanyId-b227f0c5.d.ts +0 -125
  36. package/dist/TradingPartnerAccessByCompanyId-e7a1d443.d.ts +0 -129
  37. package/dist/asstClient-f6a1693a.d.ts +0 -29
  38. package/dist/chunk-3FMMM7IS.js +0 -80
  39. package/dist/chunk-3JRE7YYE.js +0 -4576
  40. package/dist/chunk-4WER3ZLX.js +0 -4576
  41. package/dist/chunk-6ZNFOWTV.js +0 -78
  42. package/dist/chunk-7HCJJATJ.js +0 -40
  43. package/dist/chunk-B7B2ACF4.js +0 -3794
  44. package/dist/chunk-D3ML6E4G.js +0 -3787
  45. package/dist/chunk-ETURPA7W.js +0 -326
  46. package/dist/chunk-F3KCLICG.js +0 -77
  47. package/dist/chunk-FS6LHGAR.js +0 -87
  48. package/dist/chunk-G36FM5OA.js +0 -327
  49. package/dist/chunk-GDFX3WTX.js +0 -78
  50. package/dist/chunk-LGP22FRF.js +0 -0
  51. package/dist/chunk-LYMGZWSR.js +0 -80
  52. package/dist/chunk-N2OYWNHF.js +0 -80
  53. package/dist/chunk-OA6PO3QG.js +0 -78
  54. package/dist/chunk-OBXZRDPY.js +0 -77
  55. package/dist/chunk-OI47EFQH.js +0 -82
  56. package/dist/chunk-OVOZIZA2.js +0 -326
  57. package/dist/chunk-RNUSCCKB.js +0 -183
  58. package/dist/chunk-RRGAJ4ZS.js +0 -4576
  59. package/dist/chunk-T3UCSW2B.js +0 -81
  60. package/dist/chunk-XMNYZGXF.js +0 -84
  61. package/dist/chunk-YCQUK6KV.js +0 -85
@@ -1,81 +0,0 @@
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
- console.log(`Subscription added`);
51
- this.#subscriptionCallback = subscriptionCallback;
52
- subscriptionCallback(this.#currentConfig);
53
- }
54
- unsubscribeToConfigChange() {
55
- this.#subscriptionCallback = void 0;
56
- }
57
- get(url, options) {
58
- return this.#client.get(url, options);
59
- }
60
- post(url, options) {
61
- return this.#client.post(url, options);
62
- }
63
- put(url, options) {
64
- return this.#client.put(url, options);
65
- }
66
- patch(url, options) {
67
- return this.#client.patch(url, options);
68
- }
69
- head(url, options) {
70
- return this.#client.head(url, options);
71
- }
72
- delete(url, options) {
73
- return this.#client.delete(url, options);
74
- }
75
- };
76
-
77
- export {
78
- BASE_URLS,
79
- envSchema,
80
- AsstClient
81
- };
@@ -1,84 +0,0 @@
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(
29
- `AsstClient created! Config: ${options ? JSON.stringify(options) : "default"}`
30
- );
31
- if (options) {
32
- this.updateConfig(options);
33
- }
34
- }
35
- updateConfig(options) {
36
- this.#client = this.#client.extend(options);
37
- this.#currentConfig = options;
38
- if (options.prefixUrl) {
39
- this.#baseUrl = options.prefixUrl;
40
- }
41
- if (this.#subscriptionCallback) {
42
- this.#subscriptionCallback(options);
43
- }
44
- }
45
- getBaseUrl() {
46
- return this.#baseUrl;
47
- }
48
- /**
49
- * Subscribe to config changes. The callback will be immediately invoked with the current config.
50
- * @param subscriptionCallback Function that will be called with the new config every time it is changed
51
- */
52
- subscribeToConfigChange(subscriptionCallback) {
53
- console.log(`Subscription added`);
54
- this.#subscriptionCallback = subscriptionCallback;
55
- subscriptionCallback(this.#currentConfig);
56
- }
57
- unsubscribeToConfigChange() {
58
- this.#subscriptionCallback = void 0;
59
- }
60
- get(url, options) {
61
- return this.#client.get(url, options);
62
- }
63
- post(url, options) {
64
- return this.#client.post(url, options);
65
- }
66
- put(url, options) {
67
- return this.#client.put(url, options);
68
- }
69
- patch(url, options) {
70
- return this.#client.patch(url, options);
71
- }
72
- head(url, options) {
73
- return this.#client.head(url, options);
74
- }
75
- delete(url, options) {
76
- return this.#client.delete(url, options);
77
- }
78
- };
79
-
80
- export {
81
- BASE_URLS,
82
- envSchema,
83
- AsstClient
84
- };
@@ -1,85 +0,0 @@
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(
29
- `AsstClient created! Config: ${options ? JSON.stringify(options) : "default"}`
30
- );
31
- if (options) {
32
- this.updateConfig(options);
33
- }
34
- }
35
- updateConfig(options) {
36
- console.log(`Config updated! ${JSON.stringify(options)}`);
37
- this.#client = this.#client.extend(options);
38
- this.#currentConfig = options;
39
- if (options.prefixUrl) {
40
- this.#baseUrl = options.prefixUrl;
41
- }
42
- if (this.#subscriptionCallback) {
43
- this.#subscriptionCallback(options);
44
- }
45
- }
46
- getBaseUrl() {
47
- return this.#baseUrl;
48
- }
49
- /**
50
- * Subscribe to config changes. The callback will be immediately invoked with the current config.
51
- * @param subscriptionCallback Function that will be called with the new config every time it is changed
52
- */
53
- subscribeToConfigChange(subscriptionCallback) {
54
- console.log(`Subscription added`);
55
- this.#subscriptionCallback = subscriptionCallback;
56
- subscriptionCallback(this.#currentConfig);
57
- }
58
- unsubscribeToConfigChange() {
59
- this.#subscriptionCallback = void 0;
60
- }
61
- get(url, options) {
62
- return this.#client.get(url, options);
63
- }
64
- post(url, options) {
65
- return this.#client.post(url, options);
66
- }
67
- put(url, options) {
68
- return this.#client.put(url, options);
69
- }
70
- patch(url, options) {
71
- return this.#client.patch(url, options);
72
- }
73
- head(url, options) {
74
- return this.#client.head(url, options);
75
- }
76
- delete(url, options) {
77
- return this.#client.delete(url, options);
78
- }
79
- };
80
-
81
- export {
82
- BASE_URLS,
83
- envSchema,
84
- AsstClient
85
- };