@spscommerce/asst-api 4.2.2 → 4.2.3

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 (98) hide show
  1. package/dist/CompanyBriefByOrg-57oGCtjK.d.ts +3427 -0
  2. package/dist/CompanyBriefByOrg-LTdsUKm4.d.ts +3427 -0
  3. package/dist/CompanyBriefByOrg-itus4RMD.d.cts +131 -0
  4. package/dist/CompanyBriefByOrg-itus4RMD.d.ts +131 -0
  5. package/dist/SpsItemIdResponse-CkHdH_QJ.d.cts +59 -0
  6. package/dist/SpsItemIdResponse-CkHdH_QJ.d.ts +59 -0
  7. package/dist/SpsItemIdResponse-s0vCXepG.d.cts +74 -0
  8. package/dist/SpsItemIdResponse-s0vCXepG.d.ts +74 -0
  9. package/dist/chunk-27XV7TS2.js +522 -0
  10. package/dist/chunk-2ETQHIXC.js +528 -0
  11. package/dist/chunk-2VJS5KPH.js +5182 -0
  12. package/dist/chunk-2W3LZ4AO.js +513 -0
  13. package/dist/chunk-3XNXQYIB.js +521 -0
  14. package/dist/chunk-4C475UZX.js +5164 -0
  15. package/dist/chunk-5AROSGQB.js +5034 -0
  16. package/dist/chunk-7CGKH3QQ.js +528 -0
  17. package/dist/chunk-7F5CQRS2.js +567 -0
  18. package/dist/chunk-7OEXJIWW.js +565 -0
  19. package/dist/chunk-A22SEYVL.js +530 -0
  20. package/dist/chunk-AH5MG2WF.js +5040 -0
  21. package/dist/chunk-BDSSH6MN.js +574 -0
  22. package/dist/chunk-BFIQVABZ.js +528 -0
  23. package/dist/chunk-BJTO4CRW.js +558 -0
  24. package/dist/chunk-BLMS4KUD.js +5164 -0
  25. package/dist/chunk-BTNVA4NZ.js +568 -0
  26. package/dist/chunk-C73WZRUL.js +544 -0
  27. package/dist/chunk-CNQTNX3M.js +567 -0
  28. package/dist/chunk-CUVSWUIQ.js +5040 -0
  29. package/dist/chunk-DP2ZMQG5.js +4881 -0
  30. package/dist/chunk-EMBJNPTB.js +5040 -0
  31. package/dist/chunk-EO2UMCWY.js +574 -0
  32. package/dist/chunk-FCUIJXCD.js +544 -0
  33. package/dist/chunk-FTB465WY.js +575 -0
  34. package/dist/chunk-G6A4EVAL.js +528 -0
  35. package/dist/chunk-GDARBI5R.js +5185 -0
  36. package/dist/chunk-HHJDDPFR.js +4886 -0
  37. package/dist/chunk-HY2SRD5L.js +5003 -0
  38. package/dist/chunk-ISQ3LQRI.js +565 -0
  39. package/dist/chunk-KKX3CXHP.js +558 -0
  40. package/dist/chunk-L4AWOEED.js +4892 -0
  41. package/dist/chunk-LCK4AEWB.js +79 -0
  42. package/dist/chunk-LJVJ4SYE.js +568 -0
  43. package/dist/chunk-LYMA4XGG.js +5181 -0
  44. package/dist/chunk-MLAU3LFL.js +527 -0
  45. package/dist/chunk-MQREZR54.js +5164 -0
  46. package/dist/chunk-N4A4BVKV.js +5163 -0
  47. package/dist/chunk-QVEV57JA.js +5185 -0
  48. package/dist/chunk-RPGGEEFE.js +79 -0
  49. package/dist/chunk-SI7CWAHC.js +574 -0
  50. package/dist/chunk-SK6U2JDX.js +566 -0
  51. package/dist/chunk-SPR77CVW.js +529 -0
  52. package/dist/chunk-SQBB5K5J.js +574 -0
  53. package/dist/chunk-TQ2IQDSM.js +568 -0
  54. package/dist/chunk-TTT6PM27.js +558 -0
  55. package/dist/chunk-VFMKDLXO.js +570 -0
  56. package/dist/chunk-VKPQOGVS.js +565 -0
  57. package/dist/chunk-VLLI4AYA.js +520 -0
  58. package/dist/chunk-VNFLJ5FV.js +530 -0
  59. package/dist/chunk-WNCDQJEM.js +5034 -0
  60. package/dist/chunk-XYZVRJF3.js +5162 -0
  61. package/dist/chunk-YJCJB4OT.js +79 -0
  62. package/dist/chunk-YJMQ4PGM.js +559 -0
  63. package/dist/chunk-Z6PXGHNC.js +570 -0
  64. package/dist/chunk-ZQ32XEVW.js +79 -0
  65. package/dist/chunk-ZXXDLGW7.js +513 -0
  66. package/dist/index-B8ovDTs5.d.cts +14 -0
  67. package/dist/index-BFKgtuVI.d.ts +14 -0
  68. package/dist/index-Zz-6wNSh.d.ts +106 -0
  69. package/dist/index-fgr_c5Wj.d.ts +106 -0
  70. package/dist/index.cjs +6 -6
  71. package/dist/index.js +3 -3
  72. package/dist/msw.cjs +6 -6
  73. package/dist/msw.js +2 -2
  74. package/dist/zod-6gU8y6oS.d.cts +6712 -0
  75. package/dist/zod-B4sIVoVX.d.ts +6712 -0
  76. package/dist/zod-BI81QHVK.d.ts +6715 -0
  77. package/dist/zod-BUCQsGOm.d.ts +6712 -0
  78. package/dist/zod-BdDmL7rg.d.ts +6718 -0
  79. package/dist/zod-Bl_5j5Nx.d.ts +6712 -0
  80. package/dist/zod-Bxu34bbp.d.ts +6718 -0
  81. package/dist/zod-C3fOiO-H.d.cts +5900 -0
  82. package/dist/zod-C4kEHhO8.d.cts +6718 -0
  83. package/dist/zod-C5pRCHei.d.ts +6712 -0
  84. package/dist/zod-CIacR1Kf.d.cts +6712 -0
  85. package/dist/zod-CJ6AFTQr.d.ts +5900 -0
  86. package/dist/zod-DBbdP-KT.d.cts +6718 -0
  87. package/dist/zod-DyBGOUbG.d.ts +5876 -0
  88. package/dist/zod-DzhoVlw_.d.cts +6712 -0
  89. package/dist/zod-FdtLO2-F.d.cts +6715 -0
  90. package/dist/zod-NE2xXWlK.d.ts +3416 -0
  91. package/dist/zod-VuA-QJOT.d.ts +5915 -0
  92. package/dist/zod-jDi_gO0s.d.cts +5915 -0
  93. package/dist/zod-lSiFMzqK.d.cts +6712 -0
  94. package/dist/zod-rs54beS2.d.cts +5876 -0
  95. package/dist/zod-zxqlYYMG.d.ts +3416 -0
  96. package/dist/zod.cjs +6 -6
  97. package/dist/zod.js +2 -2
  98. package/package.json +1 -1
@@ -0,0 +1,131 @@
1
+ import * as ky from 'ky';
2
+ import { Options } from 'ky';
3
+ import { z } from 'zod';
4
+
5
+ declare const baseUrlsSchema: z.ZodObject<{
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
+ }, {
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
+ }>;
18
+ type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
+ declare const BASE_URLS: BaseUrls;
20
+ declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
21
+ type Env = z.infer<typeof envSchema>;
22
+ type AsstUrl = BaseUrls[Env];
23
+ interface AsstClientOptions extends Options {
24
+ prefixUrl?: AsstUrl;
25
+ }
26
+ type Input = string | URL | Request;
27
+ type Listener = (config: AsstClientOptions) => void;
28
+ declare class AsstClient {
29
+ #private;
30
+ constructor(options?: AsstClientOptions);
31
+ updateConfig(options: AsstClientOptions): void;
32
+ getBaseUrl(): AsstUrl;
33
+ /**
34
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
35
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
36
+ * @returns Function to unsubscribe to config changes
37
+ */
38
+ subscribeToConfigChange(listener: Listener): () => boolean;
39
+ get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
40
+ post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
41
+ put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
42
+ patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
43
+ head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
44
+ delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
45
+ }
46
+
47
+ declare const attributeValidValuesSchema: z.ZodObject<{
48
+ value: z.ZodString;
49
+ isDefault: z.ZodBoolean;
50
+ locale: z.ZodString;
51
+ createdBy: z.ZodString;
52
+ createdDate: z.ZodNumber;
53
+ modifiedDate: z.ZodNumber;
54
+ modifiedBy: z.ZodString;
55
+ attributeId: z.ZodNumber;
56
+ attrValueId: z.ZodNumber;
57
+ attrKeyPair: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ value: string;
60
+ createdDate: number;
61
+ createdBy: string;
62
+ modifiedDate: number;
63
+ modifiedBy: string;
64
+ attributeId: number;
65
+ isDefault: boolean;
66
+ locale: string;
67
+ attrKeyPair: string;
68
+ attrValueId: number;
69
+ }, {
70
+ value: string;
71
+ createdDate: number;
72
+ createdBy: string;
73
+ modifiedDate: number;
74
+ modifiedBy: string;
75
+ attributeId: number;
76
+ isDefault: boolean;
77
+ locale: string;
78
+ attrKeyPair: string;
79
+ attrValueId: number;
80
+ }>;
81
+ type AttributeValidValues = z.infer<typeof attributeValidValuesSchema>;
82
+
83
+ declare const spsItemIdResponseSchema: z.ZodObject<{
84
+ id: z.ZodString;
85
+ ref: z.ZodString;
86
+ }, "strip", z.ZodTypeAny, {
87
+ id: string;
88
+ ref: string;
89
+ }, {
90
+ id: string;
91
+ ref: string;
92
+ }>;
93
+ type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
94
+
95
+ declare const companyBriefByOrgSchema: z.ZodObject<{
96
+ companyId: z.ZodNumber;
97
+ name: z.ZodString;
98
+ orgId: z.ZodString;
99
+ companyType: z.ZodObject<{
100
+ type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
101
+ display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ type: "SUPPLIER" | "RETAILER";
104
+ display: "SUPPLIER" | "RETAILER";
105
+ }, {
106
+ type: "SUPPLIER" | "RETAILER";
107
+ display: "SUPPLIER" | "RETAILER";
108
+ }>;
109
+ dc4Id: z.ZodNumber;
110
+ }, "strip", z.ZodTypeAny, {
111
+ name: string;
112
+ orgId: string;
113
+ companyId: number;
114
+ companyType: {
115
+ type: "SUPPLIER" | "RETAILER";
116
+ display: "SUPPLIER" | "RETAILER";
117
+ };
118
+ dc4Id: number;
119
+ }, {
120
+ name: string;
121
+ orgId: string;
122
+ companyId: number;
123
+ companyType: {
124
+ type: "SUPPLIER" | "RETAILER";
125
+ display: "SUPPLIER" | "RETAILER";
126
+ };
127
+ dc4Id: number;
128
+ }>;
129
+ type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
130
+
131
+ export { AsstClient as A, BASE_URLS as B, type CompanyBriefByOrg as C, type Env as E, type SpsItemIdResponse as S, type AttributeValidValues as a, type AsstClientOptions as b, type AsstUrl as c, attributeValidValuesSchema as d, envSchema as e, companyBriefByOrgSchema as f, spsItemIdResponseSchema as s };
@@ -0,0 +1,131 @@
1
+ import * as ky from 'ky';
2
+ import { Options } from 'ky';
3
+ import { z } from 'zod';
4
+
5
+ declare const baseUrlsSchema: z.ZodObject<{
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
+ }, {
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
+ }>;
18
+ type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
+ declare const BASE_URLS: BaseUrls;
20
+ declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
21
+ type Env = z.infer<typeof envSchema>;
22
+ type AsstUrl = BaseUrls[Env];
23
+ interface AsstClientOptions extends Options {
24
+ prefixUrl?: AsstUrl;
25
+ }
26
+ type Input = string | URL | Request;
27
+ type Listener = (config: AsstClientOptions) => void;
28
+ declare class AsstClient {
29
+ #private;
30
+ constructor(options?: AsstClientOptions);
31
+ updateConfig(options: AsstClientOptions): void;
32
+ getBaseUrl(): AsstUrl;
33
+ /**
34
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
35
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
36
+ * @returns Function to unsubscribe to config changes
37
+ */
38
+ subscribeToConfigChange(listener: Listener): () => boolean;
39
+ get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
40
+ post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
41
+ put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
42
+ patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
43
+ head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
44
+ delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
45
+ }
46
+
47
+ declare const attributeValidValuesSchema: z.ZodObject<{
48
+ value: z.ZodString;
49
+ isDefault: z.ZodBoolean;
50
+ locale: z.ZodString;
51
+ createdBy: z.ZodString;
52
+ createdDate: z.ZodNumber;
53
+ modifiedDate: z.ZodNumber;
54
+ modifiedBy: z.ZodString;
55
+ attributeId: z.ZodNumber;
56
+ attrValueId: z.ZodNumber;
57
+ attrKeyPair: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ value: string;
60
+ createdDate: number;
61
+ createdBy: string;
62
+ modifiedDate: number;
63
+ modifiedBy: string;
64
+ attributeId: number;
65
+ isDefault: boolean;
66
+ locale: string;
67
+ attrKeyPair: string;
68
+ attrValueId: number;
69
+ }, {
70
+ value: string;
71
+ createdDate: number;
72
+ createdBy: string;
73
+ modifiedDate: number;
74
+ modifiedBy: string;
75
+ attributeId: number;
76
+ isDefault: boolean;
77
+ locale: string;
78
+ attrKeyPair: string;
79
+ attrValueId: number;
80
+ }>;
81
+ type AttributeValidValues = z.infer<typeof attributeValidValuesSchema>;
82
+
83
+ declare const spsItemIdResponseSchema: z.ZodObject<{
84
+ id: z.ZodString;
85
+ ref: z.ZodString;
86
+ }, "strip", z.ZodTypeAny, {
87
+ id: string;
88
+ ref: string;
89
+ }, {
90
+ id: string;
91
+ ref: string;
92
+ }>;
93
+ type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
94
+
95
+ declare const companyBriefByOrgSchema: z.ZodObject<{
96
+ companyId: z.ZodNumber;
97
+ name: z.ZodString;
98
+ orgId: z.ZodString;
99
+ companyType: z.ZodObject<{
100
+ type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
101
+ display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ type: "SUPPLIER" | "RETAILER";
104
+ display: "SUPPLIER" | "RETAILER";
105
+ }, {
106
+ type: "SUPPLIER" | "RETAILER";
107
+ display: "SUPPLIER" | "RETAILER";
108
+ }>;
109
+ dc4Id: z.ZodNumber;
110
+ }, "strip", z.ZodTypeAny, {
111
+ name: string;
112
+ orgId: string;
113
+ companyId: number;
114
+ companyType: {
115
+ type: "SUPPLIER" | "RETAILER";
116
+ display: "SUPPLIER" | "RETAILER";
117
+ };
118
+ dc4Id: number;
119
+ }, {
120
+ name: string;
121
+ orgId: string;
122
+ companyId: number;
123
+ companyType: {
124
+ type: "SUPPLIER" | "RETAILER";
125
+ display: "SUPPLIER" | "RETAILER";
126
+ };
127
+ dc4Id: number;
128
+ }>;
129
+ type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
130
+
131
+ export { AsstClient as A, BASE_URLS as B, type CompanyBriefByOrg as C, type Env as E, type SpsItemIdResponse as S, type AttributeValidValues as a, type AsstClientOptions as b, type AsstUrl as c, attributeValidValuesSchema as d, envSchema as e, companyBriefByOrgSchema as f, spsItemIdResponseSchema as s };
@@ -0,0 +1,59 @@
1
+ import * as ky from 'ky';
2
+ import { Options } from 'ky';
3
+ import { z } from 'zod';
4
+
5
+ declare const baseUrlsSchema: z.ZodObject<{
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
+ }, {
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
+ }>;
18
+ type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
+ declare const BASE_URLS: BaseUrls;
20
+ declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
21
+ type Env = z.infer<typeof envSchema>;
22
+ type AsstUrl = BaseUrls[Env];
23
+ interface AsstClientOptions extends Options {
24
+ prefixUrl?: AsstUrl;
25
+ }
26
+ type Input = string | URL | Request;
27
+ type Listener = (config: AsstClientOptions) => void;
28
+ declare class AsstClient {
29
+ #private;
30
+ constructor(options?: AsstClientOptions);
31
+ updateConfig(options: AsstClientOptions): void;
32
+ getBaseUrl(): AsstUrl;
33
+ /**
34
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
35
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
36
+ * @returns Function to unsubscribe to config changes
37
+ */
38
+ subscribeToConfigChange(listener: Listener): () => boolean;
39
+ get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
40
+ post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
41
+ put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
42
+ patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
43
+ head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
44
+ delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
45
+ }
46
+
47
+ declare const spsItemIdResponseSchema: z.ZodObject<{
48
+ id: z.ZodString;
49
+ ref: z.ZodString;
50
+ }, "strip", z.ZodTypeAny, {
51
+ id: string;
52
+ ref: string;
53
+ }, {
54
+ id: string;
55
+ ref: string;
56
+ }>;
57
+ type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
58
+
59
+ export { AsstClient as A, BASE_URLS as B, type Env as E, type SpsItemIdResponse as S, type AsstClientOptions as a, type AsstUrl as b, envSchema as e, spsItemIdResponseSchema as s };
@@ -0,0 +1,59 @@
1
+ import * as ky from 'ky';
2
+ import { Options } from 'ky';
3
+ import { z } from 'zod';
4
+
5
+ declare const baseUrlsSchema: z.ZodObject<{
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
+ }, {
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
+ }>;
18
+ type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
+ declare const BASE_URLS: BaseUrls;
20
+ declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
21
+ type Env = z.infer<typeof envSchema>;
22
+ type AsstUrl = BaseUrls[Env];
23
+ interface AsstClientOptions extends Options {
24
+ prefixUrl?: AsstUrl;
25
+ }
26
+ type Input = string | URL | Request;
27
+ type Listener = (config: AsstClientOptions) => void;
28
+ declare class AsstClient {
29
+ #private;
30
+ constructor(options?: AsstClientOptions);
31
+ updateConfig(options: AsstClientOptions): void;
32
+ getBaseUrl(): AsstUrl;
33
+ /**
34
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
35
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
36
+ * @returns Function to unsubscribe to config changes
37
+ */
38
+ subscribeToConfigChange(listener: Listener): () => boolean;
39
+ get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
40
+ post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
41
+ put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
42
+ patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
43
+ head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
44
+ delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
45
+ }
46
+
47
+ declare const spsItemIdResponseSchema: z.ZodObject<{
48
+ id: z.ZodString;
49
+ ref: z.ZodString;
50
+ }, "strip", z.ZodTypeAny, {
51
+ id: string;
52
+ ref: string;
53
+ }, {
54
+ id: string;
55
+ ref: string;
56
+ }>;
57
+ type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
58
+
59
+ export { AsstClient as A, BASE_URLS as B, type Env as E, type SpsItemIdResponse as S, type AsstClientOptions as a, type AsstUrl as b, envSchema as e, spsItemIdResponseSchema as s };
@@ -0,0 +1,74 @@
1
+ import * as ky from 'ky';
2
+ import { Options } from 'ky';
3
+ import { z } from 'zod';
4
+
5
+ declare const baseUrlsSchema: z.ZodObject<{
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
+ }, {
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
+ }>;
18
+ type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
+ declare const BASE_URLS: BaseUrls;
20
+ declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
21
+ type Env = z.infer<typeof envSchema>;
22
+ type AsstUrl = BaseUrls[Env];
23
+ interface AsstClientOptions extends Options {
24
+ prefixUrl?: AsstUrl;
25
+ }
26
+ type Input = string | URL | Request;
27
+ type Listener = (config: AsstClientOptions) => void;
28
+ declare class AsstClient {
29
+ #private;
30
+ constructor(options?: AsstClientOptions);
31
+ updateConfig(options: AsstClientOptions): void;
32
+ getBaseUrl(): AsstUrl;
33
+ /**
34
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
35
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
36
+ * @returns Function to unsubscribe to config changes
37
+ */
38
+ subscribeToConfigChange(listener: Listener): () => boolean;
39
+ get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
40
+ post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
41
+ put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
42
+ patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
43
+ head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
44
+ delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
45
+ }
46
+
47
+ type Hierarchy = {
48
+ id: string;
49
+ name?: string | null;
50
+ description?: string | null;
51
+ type?: string | null;
52
+ child?: Hierarchy | null;
53
+ };
54
+ type ItemHierarchyResponse = {
55
+ itemHierarchies: Array<{
56
+ itemId: string;
57
+ hierarchies: Array<Hierarchy>;
58
+ }>;
59
+ };
60
+ declare const itemHierarchyResponseSchema: z.ZodType<ItemHierarchyResponse>;
61
+
62
+ declare const spsItemIdResponseSchema: z.ZodObject<{
63
+ id: z.ZodString;
64
+ ref: z.ZodString;
65
+ }, "strip", z.ZodTypeAny, {
66
+ id: string;
67
+ ref: string;
68
+ }, {
69
+ id: string;
70
+ ref: string;
71
+ }>;
72
+ type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
73
+
74
+ export { AsstClient as A, BASE_URLS as B, type Env as E, type ItemHierarchyResponse as I, type SpsItemIdResponse as S, type AsstClientOptions as a, type AsstUrl as b, envSchema as e, itemHierarchyResponseSchema as i, spsItemIdResponseSchema as s };
@@ -0,0 +1,74 @@
1
+ import * as ky from 'ky';
2
+ import { Options } from 'ky';
3
+ import { z } from 'zod';
4
+
5
+ declare const baseUrlsSchema: z.ZodObject<{
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
+ }, "strip", z.ZodTypeAny, {
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
+ }, {
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
+ }>;
18
+ type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
+ declare const BASE_URLS: BaseUrls;
20
+ declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
21
+ type Env = z.infer<typeof envSchema>;
22
+ type AsstUrl = BaseUrls[Env];
23
+ interface AsstClientOptions extends Options {
24
+ prefixUrl?: AsstUrl;
25
+ }
26
+ type Input = string | URL | Request;
27
+ type Listener = (config: AsstClientOptions) => void;
28
+ declare class AsstClient {
29
+ #private;
30
+ constructor(options?: AsstClientOptions);
31
+ updateConfig(options: AsstClientOptions): void;
32
+ getBaseUrl(): AsstUrl;
33
+ /**
34
+ * Subscribe to config changes. The callback will be immediately invoked with the current config.
35
+ * @param subscriptionCallback Function that will be called with the new config every time it is changed
36
+ * @returns Function to unsubscribe to config changes
37
+ */
38
+ subscribeToConfigChange(listener: Listener): () => boolean;
39
+ get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
40
+ post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
41
+ put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
42
+ patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
43
+ head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
44
+ delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
45
+ }
46
+
47
+ type Hierarchy = {
48
+ id: string;
49
+ name?: string | null;
50
+ description?: string | null;
51
+ type?: string | null;
52
+ child?: Hierarchy | null;
53
+ };
54
+ type ItemHierarchyResponse = {
55
+ itemHierarchies: Array<{
56
+ itemId: string;
57
+ hierarchies: Array<Hierarchy>;
58
+ }>;
59
+ };
60
+ declare const itemHierarchyResponseSchema: z.ZodType<ItemHierarchyResponse>;
61
+
62
+ declare const spsItemIdResponseSchema: z.ZodObject<{
63
+ id: z.ZodString;
64
+ ref: z.ZodString;
65
+ }, "strip", z.ZodTypeAny, {
66
+ id: string;
67
+ ref: string;
68
+ }, {
69
+ id: string;
70
+ ref: string;
71
+ }>;
72
+ type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
73
+
74
+ export { AsstClient as A, BASE_URLS as B, type Env as E, type ItemHierarchyResponse as I, type SpsItemIdResponse as S, type AsstClientOptions as a, type AsstUrl as b, envSchema as e, itemHierarchyResponseSchema as i, spsItemIdResponseSchema as s };