@spscommerce/asst-api 0.0.1-beta.2 → 0.0.1-beta.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.
- package/dist/ItemCategoriesSearch-44b87663.d.ts +318 -0
- package/dist/ItemCategory-14816deb.d.ts +99 -0
- package/dist/TradingPartnerAccessByCompanyId-29866586.d.ts +97 -0
- package/dist/TradingPartnerAccessByCompanyId-43f83fb6.d.ts +130 -0
- package/dist/TradingPartnerAccessByCompanyId-53b868a8.d.ts +125 -0
- package/dist/TradingPartnerAccessByCompanyId-b227f0c5.d.ts +125 -0
- package/dist/TradingPartnerAccessByCompanyId-e7a1d443.d.ts +129 -0
- package/dist/chunk-F3KCLICG.js +77 -0
- package/package.json +1 -1
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import * as ky_universal from 'ky-universal';
|
|
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
|
+
declare class AsstClient {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(options: AsstClientOptions);
|
|
30
|
+
updateConfig(options: AsstClientOptions): void;
|
|
31
|
+
getBaseUrl(): AsstUrl;
|
|
32
|
+
/**
|
|
33
|
+
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
34
|
+
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
35
|
+
*/
|
|
36
|
+
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): void;
|
|
37
|
+
unsubscribeToConfigChange(): void;
|
|
38
|
+
get(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
39
|
+
post(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
40
|
+
put(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
41
|
+
patch(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
42
|
+
head(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
43
|
+
delete(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare const importSchema: z.ZodObject<{
|
|
47
|
+
count: z.ZodNumber;
|
|
48
|
+
imports: z.ZodArray<z.ZodObject<{
|
|
49
|
+
completedAt: z.ZodNullable<z.ZodNumber>;
|
|
50
|
+
errorCount: z.ZodNumber;
|
|
51
|
+
importId: z.ZodNumber;
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
54
|
+
status: z.ZodString;
|
|
55
|
+
uploadedAt: z.ZodString;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
status: string;
|
|
58
|
+
completedAt: number | null;
|
|
59
|
+
errorCount: number;
|
|
60
|
+
importId: number;
|
|
61
|
+
name: string;
|
|
62
|
+
startedAt: string | null;
|
|
63
|
+
uploadedAt: string;
|
|
64
|
+
}, {
|
|
65
|
+
status: string;
|
|
66
|
+
completedAt: number | null;
|
|
67
|
+
errorCount: number;
|
|
68
|
+
importId: number;
|
|
69
|
+
name: string;
|
|
70
|
+
startedAt: string | null;
|
|
71
|
+
uploadedAt: string;
|
|
72
|
+
}>, "many">;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
count: number;
|
|
75
|
+
imports: {
|
|
76
|
+
status: string;
|
|
77
|
+
completedAt: number | null;
|
|
78
|
+
errorCount: number;
|
|
79
|
+
importId: number;
|
|
80
|
+
name: string;
|
|
81
|
+
startedAt: string | null;
|
|
82
|
+
uploadedAt: string;
|
|
83
|
+
}[];
|
|
84
|
+
}, {
|
|
85
|
+
count: number;
|
|
86
|
+
imports: {
|
|
87
|
+
status: string;
|
|
88
|
+
completedAt: number | null;
|
|
89
|
+
errorCount: number;
|
|
90
|
+
importId: number;
|
|
91
|
+
name: string;
|
|
92
|
+
startedAt: string | null;
|
|
93
|
+
uploadedAt: string;
|
|
94
|
+
}[];
|
|
95
|
+
}>;
|
|
96
|
+
type Import = z.infer<typeof importSchema>;
|
|
97
|
+
|
|
98
|
+
declare const importErrorsSchema: z.ZodObject<{
|
|
99
|
+
count: z.ZodNumber;
|
|
100
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
101
|
+
attribute: z.ZodString;
|
|
102
|
+
description: z.ZodString;
|
|
103
|
+
importErrorId: z.ZodNumber;
|
|
104
|
+
row: z.ZodNumber;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
attribute: string;
|
|
107
|
+
description: string;
|
|
108
|
+
importErrorId: number;
|
|
109
|
+
row: number;
|
|
110
|
+
}, {
|
|
111
|
+
attribute: string;
|
|
112
|
+
description: string;
|
|
113
|
+
importErrorId: number;
|
|
114
|
+
row: number;
|
|
115
|
+
}>, "many">;
|
|
116
|
+
hasNext: z.ZodBoolean;
|
|
117
|
+
importId: z.ZodNumber;
|
|
118
|
+
totalCount: z.ZodNumber;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
importId: number;
|
|
121
|
+
count: number;
|
|
122
|
+
errors: {
|
|
123
|
+
attribute: string;
|
|
124
|
+
description: string;
|
|
125
|
+
importErrorId: number;
|
|
126
|
+
row: number;
|
|
127
|
+
}[];
|
|
128
|
+
hasNext: boolean;
|
|
129
|
+
totalCount: number;
|
|
130
|
+
}, {
|
|
131
|
+
importId: number;
|
|
132
|
+
count: number;
|
|
133
|
+
errors: {
|
|
134
|
+
attribute: string;
|
|
135
|
+
description: string;
|
|
136
|
+
importErrorId: number;
|
|
137
|
+
row: number;
|
|
138
|
+
}[];
|
|
139
|
+
hasNext: boolean;
|
|
140
|
+
totalCount: number;
|
|
141
|
+
}>;
|
|
142
|
+
type ImportErrors = z.infer<typeof importErrorsSchema>;
|
|
143
|
+
|
|
144
|
+
declare const importsStatusSchema: z.ZodObject<{
|
|
145
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
docInEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
errorCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
148
|
+
importId: z.ZodNumber;
|
|
149
|
+
invalidItemCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
status: z.ZodEnum<["QUEUED_FOR_IMPORT", "IN_PROGRESS", "DOC_FAILED", "VALIDATION_FAILED", "COMPLETED"]>;
|
|
152
|
+
totalItemCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
153
|
+
validItemCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
status: "QUEUED_FOR_IMPORT" | "IN_PROGRESS" | "DOC_FAILED" | "VALIDATION_FAILED" | "COMPLETED";
|
|
156
|
+
importId: number;
|
|
157
|
+
name: string;
|
|
158
|
+
completedAt?: string | null | undefined;
|
|
159
|
+
docInEventId?: string | null | undefined;
|
|
160
|
+
errorCount?: number | null | undefined;
|
|
161
|
+
invalidItemCount?: number | null | undefined;
|
|
162
|
+
totalItemCount?: number | null | undefined;
|
|
163
|
+
validItemCount?: number | null | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
status: "QUEUED_FOR_IMPORT" | "IN_PROGRESS" | "DOC_FAILED" | "VALIDATION_FAILED" | "COMPLETED";
|
|
166
|
+
importId: number;
|
|
167
|
+
name: string;
|
|
168
|
+
completedAt?: string | null | undefined;
|
|
169
|
+
docInEventId?: string | null | undefined;
|
|
170
|
+
errorCount?: number | null | undefined;
|
|
171
|
+
invalidItemCount?: number | null | undefined;
|
|
172
|
+
totalItemCount?: number | null | undefined;
|
|
173
|
+
validItemCount?: number | null | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
type ImportsStatus = z.infer<typeof importsStatusSchema>;
|
|
176
|
+
|
|
177
|
+
declare const exportSchema: z.ZodObject<{
|
|
178
|
+
exportName: z.ZodString;
|
|
179
|
+
exportDescription: z.ZodString;
|
|
180
|
+
isActive: z.ZodBoolean;
|
|
181
|
+
exportType: z.ZodEnum<["ALL", "UPDATES", "DELTAS_UPDATE", "NO_BUYER_PART_NUMBER"]>;
|
|
182
|
+
exportFrequency: z.ZodEnum<["IMMEDIATE", "ONETIME", "DAILY", "WEEKLY", "MONTHLY"]>;
|
|
183
|
+
includeValidAttributes: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
dayOfMonth: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
dayOfWeek: z.ZodOptional<z.ZodEnum<["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]>>;
|
|
186
|
+
hourOfDay: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
date: z.ZodOptional<z.ZodString>;
|
|
188
|
+
catalogIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
189
|
+
itemInfoIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
190
|
+
excludeItemInfoIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
191
|
+
selectionCodeIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
192
|
+
productCodeIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
193
|
+
productTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
194
|
+
deliveryType: z.ZodOptional<z.ZodString>;
|
|
195
|
+
spreadsheetTemplateId: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
emailAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
197
|
+
subjectLine: z.ZodOptional<z.ZodString>;
|
|
198
|
+
additionalLocales: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
exportName: string;
|
|
201
|
+
exportDescription: string;
|
|
202
|
+
isActive: boolean;
|
|
203
|
+
exportType: "ALL" | "UPDATES" | "DELTAS_UPDATE" | "NO_BUYER_PART_NUMBER";
|
|
204
|
+
exportFrequency: "IMMEDIATE" | "ONETIME" | "DAILY" | "WEEKLY" | "MONTHLY";
|
|
205
|
+
includeValidAttributes?: boolean | undefined;
|
|
206
|
+
dayOfMonth?: number | undefined;
|
|
207
|
+
dayOfWeek?: "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN" | undefined;
|
|
208
|
+
hourOfDay?: number | undefined;
|
|
209
|
+
date?: string | undefined;
|
|
210
|
+
catalogIds?: number[] | undefined;
|
|
211
|
+
itemInfoIds?: number[] | undefined;
|
|
212
|
+
excludeItemInfoIds?: number[] | undefined;
|
|
213
|
+
selectionCodeIds?: number[] | undefined;
|
|
214
|
+
productCodeIds?: number[] | undefined;
|
|
215
|
+
productTypes?: string[] | undefined;
|
|
216
|
+
deliveryType?: string | undefined;
|
|
217
|
+
spreadsheetTemplateId?: number | undefined;
|
|
218
|
+
emailAddresses?: string[] | undefined;
|
|
219
|
+
subjectLine?: string | undefined;
|
|
220
|
+
additionalLocales?: string[] | undefined;
|
|
221
|
+
}, {
|
|
222
|
+
exportName: string;
|
|
223
|
+
exportDescription: string;
|
|
224
|
+
isActive: boolean;
|
|
225
|
+
exportType: "ALL" | "UPDATES" | "DELTAS_UPDATE" | "NO_BUYER_PART_NUMBER";
|
|
226
|
+
exportFrequency: "IMMEDIATE" | "ONETIME" | "DAILY" | "WEEKLY" | "MONTHLY";
|
|
227
|
+
includeValidAttributes?: boolean | undefined;
|
|
228
|
+
dayOfMonth?: number | undefined;
|
|
229
|
+
dayOfWeek?: "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN" | undefined;
|
|
230
|
+
hourOfDay?: number | undefined;
|
|
231
|
+
date?: string | undefined;
|
|
232
|
+
catalogIds?: number[] | undefined;
|
|
233
|
+
itemInfoIds?: number[] | undefined;
|
|
234
|
+
excludeItemInfoIds?: number[] | undefined;
|
|
235
|
+
selectionCodeIds?: number[] | undefined;
|
|
236
|
+
productCodeIds?: number[] | undefined;
|
|
237
|
+
productTypes?: string[] | undefined;
|
|
238
|
+
deliveryType?: string | undefined;
|
|
239
|
+
spreadsheetTemplateId?: number | undefined;
|
|
240
|
+
emailAddresses?: string[] | undefined;
|
|
241
|
+
subjectLine?: string | undefined;
|
|
242
|
+
additionalLocales?: string[] | undefined;
|
|
243
|
+
}>;
|
|
244
|
+
type Export = z.infer<typeof exportSchema>;
|
|
245
|
+
|
|
246
|
+
declare const itemCategoriesSearchSchema: z.ZodObject<{
|
|
247
|
+
count: z.ZodNumber;
|
|
248
|
+
data: z.ZodArray<z.ZodObject<{
|
|
249
|
+
categoryid: z.ZodNumber;
|
|
250
|
+
companyId: z.ZodNumber;
|
|
251
|
+
name: z.ZodString;
|
|
252
|
+
isActive: z.ZodNumber;
|
|
253
|
+
createdDate: z.ZodNullable<z.ZodNumber>;
|
|
254
|
+
categorytimestamp: z.ZodNullable<z.ZodNumber>;
|
|
255
|
+
typeId: z.ZodNumber;
|
|
256
|
+
type: z.ZodString;
|
|
257
|
+
categorykey: z.ZodOptional<z.ZodString>;
|
|
258
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
259
|
+
categoryCatalogName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
type: string;
|
|
262
|
+
name: string;
|
|
263
|
+
isActive: number;
|
|
264
|
+
createdDate: number | null;
|
|
265
|
+
companyId: number;
|
|
266
|
+
categoryid: number;
|
|
267
|
+
categorytimestamp: number | null;
|
|
268
|
+
typeId: number;
|
|
269
|
+
categorykey?: string | undefined;
|
|
270
|
+
description?: string | null | undefined;
|
|
271
|
+
categoryCatalogName?: string | null | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
type: string;
|
|
274
|
+
name: string;
|
|
275
|
+
isActive: number;
|
|
276
|
+
createdDate: number | null;
|
|
277
|
+
companyId: number;
|
|
278
|
+
categoryid: number;
|
|
279
|
+
categorytimestamp: number | null;
|
|
280
|
+
typeId: number;
|
|
281
|
+
categorykey?: string | undefined;
|
|
282
|
+
description?: string | null | undefined;
|
|
283
|
+
categoryCatalogName?: string | null | undefined;
|
|
284
|
+
}>, "many">;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
data: {
|
|
287
|
+
type: string;
|
|
288
|
+
name: string;
|
|
289
|
+
isActive: number;
|
|
290
|
+
createdDate: number | null;
|
|
291
|
+
companyId: number;
|
|
292
|
+
categoryid: number;
|
|
293
|
+
categorytimestamp: number | null;
|
|
294
|
+
typeId: number;
|
|
295
|
+
categorykey?: string | undefined;
|
|
296
|
+
description?: string | null | undefined;
|
|
297
|
+
categoryCatalogName?: string | null | undefined;
|
|
298
|
+
}[];
|
|
299
|
+
count: number;
|
|
300
|
+
}, {
|
|
301
|
+
data: {
|
|
302
|
+
type: string;
|
|
303
|
+
name: string;
|
|
304
|
+
isActive: number;
|
|
305
|
+
createdDate: number | null;
|
|
306
|
+
companyId: number;
|
|
307
|
+
categoryid: number;
|
|
308
|
+
categorytimestamp: number | null;
|
|
309
|
+
typeId: number;
|
|
310
|
+
categorykey?: string | undefined;
|
|
311
|
+
description?: string | null | undefined;
|
|
312
|
+
categoryCatalogName?: string | null | undefined;
|
|
313
|
+
}[];
|
|
314
|
+
count: number;
|
|
315
|
+
}>;
|
|
316
|
+
type ItemCategoriesSearch = z.infer<typeof itemCategoriesSearchSchema>;
|
|
317
|
+
|
|
318
|
+
export { AsstClient as A, BASE_URLS as B, Export as E, Import as I, ImportsStatus as a, ItemCategoriesSearch as b, AsstClientOptions as c, AsstUrl as d, Env as e, ImportErrors as f, envSchema as g, importSchema as h, importErrorsSchema as i, importsStatusSchema as j, exportSchema as k, itemCategoriesSearchSchema as l };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const importDetailSchema: z.ZodObject<{
|
|
4
|
+
completedAt: z.ZodNullable<z.ZodNumber>;
|
|
5
|
+
errorCount: z.ZodNumber;
|
|
6
|
+
importId: z.ZodNumber;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
9
|
+
status: z.ZodString;
|
|
10
|
+
uploadedAt: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
status: string;
|
|
13
|
+
completedAt: number | null;
|
|
14
|
+
errorCount: number;
|
|
15
|
+
importId: number;
|
|
16
|
+
name: string;
|
|
17
|
+
startedAt: string | null;
|
|
18
|
+
uploadedAt: string;
|
|
19
|
+
}, {
|
|
20
|
+
status: string;
|
|
21
|
+
completedAt: number | null;
|
|
22
|
+
errorCount: number;
|
|
23
|
+
importId: number;
|
|
24
|
+
name: string;
|
|
25
|
+
startedAt: string | null;
|
|
26
|
+
uploadedAt: string;
|
|
27
|
+
}>;
|
|
28
|
+
type ImportDetails = z.infer<typeof importDetailSchema>;
|
|
29
|
+
|
|
30
|
+
declare const importErrorSchema: z.ZodObject<{
|
|
31
|
+
attribute: z.ZodString;
|
|
32
|
+
description: z.ZodString;
|
|
33
|
+
importErrorId: z.ZodNumber;
|
|
34
|
+
row: z.ZodNumber;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
attribute: string;
|
|
37
|
+
description: string;
|
|
38
|
+
importErrorId: number;
|
|
39
|
+
row: number;
|
|
40
|
+
}, {
|
|
41
|
+
attribute: string;
|
|
42
|
+
description: string;
|
|
43
|
+
importErrorId: number;
|
|
44
|
+
row: number;
|
|
45
|
+
}>;
|
|
46
|
+
type ImportError = z.infer<typeof importErrorSchema>;
|
|
47
|
+
|
|
48
|
+
declare const importStatusEnumSchema: z.ZodEnum<["QUEUED_FOR_IMPORT", "IN_PROGRESS", "DOC_FAILED", "VALIDATION_FAILED", "COMPLETED"]>;
|
|
49
|
+
type ImportStatusEnum = z.infer<typeof importStatusEnumSchema>;
|
|
50
|
+
|
|
51
|
+
declare const exportDayOfWeekEnum: z.ZodEnum<["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]>;
|
|
52
|
+
type ExportDayOfWeek = z.infer<typeof exportDayOfWeekEnum>;
|
|
53
|
+
|
|
54
|
+
declare const exportFrequencyEnum: z.ZodEnum<["IMMEDIATE", "ONETIME", "DAILY", "WEEKLY", "MONTHLY"]>;
|
|
55
|
+
type ExportFrequency = z.infer<typeof exportFrequencyEnum>;
|
|
56
|
+
|
|
57
|
+
declare const exportTypeEnum: z.ZodEnum<["ALL", "UPDATES", "DELTAS_UPDATE", "NO_BUYER_PART_NUMBER"]>;
|
|
58
|
+
type ExportType = z.infer<typeof exportTypeEnum>;
|
|
59
|
+
|
|
60
|
+
declare const itemCategorySchema: z.ZodObject<{
|
|
61
|
+
categoryid: z.ZodNumber;
|
|
62
|
+
companyId: z.ZodNumber;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
isActive: z.ZodNumber;
|
|
65
|
+
createdDate: z.ZodNullable<z.ZodNumber>;
|
|
66
|
+
categorytimestamp: z.ZodNullable<z.ZodNumber>;
|
|
67
|
+
typeId: z.ZodNumber;
|
|
68
|
+
type: z.ZodString;
|
|
69
|
+
categorykey: z.ZodOptional<z.ZodString>;
|
|
70
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
categoryCatalogName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
type: string;
|
|
74
|
+
name: string;
|
|
75
|
+
isActive: number;
|
|
76
|
+
createdDate: number | null;
|
|
77
|
+
companyId: number;
|
|
78
|
+
categoryid: number;
|
|
79
|
+
categorytimestamp: number | null;
|
|
80
|
+
typeId: number;
|
|
81
|
+
categorykey?: string | undefined;
|
|
82
|
+
description?: string | null | undefined;
|
|
83
|
+
categoryCatalogName?: string | null | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
type: string;
|
|
86
|
+
name: string;
|
|
87
|
+
isActive: number;
|
|
88
|
+
createdDate: number | null;
|
|
89
|
+
companyId: number;
|
|
90
|
+
categoryid: number;
|
|
91
|
+
categorytimestamp: number | null;
|
|
92
|
+
typeId: number;
|
|
93
|
+
categorykey?: string | undefined;
|
|
94
|
+
description?: string | null | undefined;
|
|
95
|
+
categoryCatalogName?: string | null | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
type ItemCategory = z.infer<typeof itemCategorySchema>;
|
|
98
|
+
|
|
99
|
+
export { ExportDayOfWeek as E, ImportDetails as I, ImportError as a, ImportStatusEnum as b, ExportFrequency as c, ExportType as d, ItemCategory as e, importErrorSchema as f, importStatusEnumSchema as g, exportDayOfWeekEnum as h, importDetailSchema as i, exportFrequencyEnum as j, exportTypeEnum as k, itemCategorySchema as l };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const vendorPartnerAttGroupsSchema: z.ZodObject<{
|
|
4
|
+
partnerCompanyId: z.ZodNumber;
|
|
5
|
+
partnerCompanyName: z.ZodString;
|
|
6
|
+
partnerAttributeGroups: z.ZodArray<z.ZodNumber, "many">;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
partnerCompanyId: number;
|
|
9
|
+
partnerCompanyName: string;
|
|
10
|
+
partnerAttributeGroups: number[];
|
|
11
|
+
}, {
|
|
12
|
+
partnerCompanyId: number;
|
|
13
|
+
partnerCompanyName: string;
|
|
14
|
+
partnerAttributeGroups: number[];
|
|
15
|
+
}>;
|
|
16
|
+
type VendorPartnerAttGroups = z.infer<typeof vendorPartnerAttGroupsSchema>;
|
|
17
|
+
|
|
18
|
+
declare const attrProdTypeSchema: z.ZodObject<{
|
|
19
|
+
attrProdTypeId: z.ZodNumber;
|
|
20
|
+
productType: z.ZodString;
|
|
21
|
+
description: z.ZodString;
|
|
22
|
+
createdDate: z.ZodNumber;
|
|
23
|
+
createdBy: z.ZodString;
|
|
24
|
+
modifiedDate: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
modifiedBy: z.ZodOptional<z.ZodString>;
|
|
26
|
+
retailerId: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
description: string;
|
|
29
|
+
attrProdTypeId: number;
|
|
30
|
+
productType: string;
|
|
31
|
+
createdDate: number;
|
|
32
|
+
createdBy: string;
|
|
33
|
+
modifiedDate?: number | undefined;
|
|
34
|
+
modifiedBy?: string | undefined;
|
|
35
|
+
retailerId?: number | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
description: string;
|
|
38
|
+
attrProdTypeId: number;
|
|
39
|
+
productType: string;
|
|
40
|
+
createdDate: number;
|
|
41
|
+
createdBy: string;
|
|
42
|
+
modifiedDate?: number | undefined;
|
|
43
|
+
modifiedBy?: string | undefined;
|
|
44
|
+
retailerId?: number | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
type AttrProdType = z.infer<typeof attrProdTypeSchema>;
|
|
47
|
+
|
|
48
|
+
declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
|
|
49
|
+
companyId: z.ZodNumber;
|
|
50
|
+
companyType: z.ZodString;
|
|
51
|
+
identityOrgId: z.ZodString;
|
|
52
|
+
companyName: z.ZodString;
|
|
53
|
+
count: z.ZodNumber;
|
|
54
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
55
|
+
catalog_id: z.ZodNumber;
|
|
56
|
+
catalog_name: z.ZodString;
|
|
57
|
+
partner_company_name: z.ZodString;
|
|
58
|
+
partner_company_id: z.ZodNumber;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
catalog_id: number;
|
|
61
|
+
catalog_name: string;
|
|
62
|
+
partner_company_name: string;
|
|
63
|
+
partner_company_id: number;
|
|
64
|
+
}, {
|
|
65
|
+
catalog_id: number;
|
|
66
|
+
catalog_name: string;
|
|
67
|
+
partner_company_name: string;
|
|
68
|
+
partner_company_id: number;
|
|
69
|
+
}>, "many">;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
count: number;
|
|
72
|
+
companyId: number;
|
|
73
|
+
companyType: string;
|
|
74
|
+
identityOrgId: string;
|
|
75
|
+
companyName: string;
|
|
76
|
+
connections: {
|
|
77
|
+
catalog_id: number;
|
|
78
|
+
catalog_name: string;
|
|
79
|
+
partner_company_name: string;
|
|
80
|
+
partner_company_id: number;
|
|
81
|
+
}[];
|
|
82
|
+
}, {
|
|
83
|
+
count: number;
|
|
84
|
+
companyId: number;
|
|
85
|
+
companyType: string;
|
|
86
|
+
identityOrgId: string;
|
|
87
|
+
companyName: string;
|
|
88
|
+
connections: {
|
|
89
|
+
catalog_id: number;
|
|
90
|
+
catalog_name: string;
|
|
91
|
+
partner_company_name: string;
|
|
92
|
+
partner_company_id: number;
|
|
93
|
+
}[];
|
|
94
|
+
}>;
|
|
95
|
+
type TradingPartnerAccessByCompanyId = z.infer<typeof tradingPartnerAccessByCompanyIdSchema>;
|
|
96
|
+
|
|
97
|
+
export { AttrProdType as A, TradingPartnerAccessByCompanyId as T, VendorPartnerAttGroups as V, attrProdTypeSchema as a };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as ky_universal from 'ky-universal';
|
|
2
|
+
import { Options } from 'ky';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const BASE_URLS: {
|
|
6
|
+
readonly local: "https://localhost:8443";
|
|
7
|
+
readonly test: "https://integration.api.spscommerce.com/assortment/gateway";
|
|
8
|
+
readonly prod: "https://api.spscommerce.com/assortment/gateway";
|
|
9
|
+
};
|
|
10
|
+
type Env = keyof typeof BASE_URLS;
|
|
11
|
+
type AsstUrl = typeof BASE_URLS[Env];
|
|
12
|
+
interface AsstClientOptions extends Options {
|
|
13
|
+
prefixUrl?: AsstUrl;
|
|
14
|
+
}
|
|
15
|
+
type Input = string | URL | Request;
|
|
16
|
+
declare class AsstClient {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(options: AsstClientOptions);
|
|
19
|
+
updateConfig(options: AsstClientOptions): void;
|
|
20
|
+
getBaseUrl(): AsstUrl;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to config changes. This function also returns the current config.
|
|
23
|
+
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
24
|
+
* @returns The current config
|
|
25
|
+
*/
|
|
26
|
+
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): AsstClientOptions;
|
|
27
|
+
unsubscribeToConfigChange(): void;
|
|
28
|
+
get(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
29
|
+
post(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
30
|
+
put(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
31
|
+
patch(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
32
|
+
head(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
33
|
+
delete(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare const vendorPartnerAttGroupsSchema: z.ZodObject<{
|
|
37
|
+
partnerCompanyId: z.ZodNumber;
|
|
38
|
+
partnerCompanyName: z.ZodString;
|
|
39
|
+
partnerAttributeGroups: z.ZodArray<z.ZodNumber, "many">;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
partnerCompanyId: number;
|
|
42
|
+
partnerCompanyName: string;
|
|
43
|
+
partnerAttributeGroups: number[];
|
|
44
|
+
}, {
|
|
45
|
+
partnerCompanyId: number;
|
|
46
|
+
partnerCompanyName: string;
|
|
47
|
+
partnerAttributeGroups: number[];
|
|
48
|
+
}>;
|
|
49
|
+
type VendorPartnerAttGroups = z.infer<typeof vendorPartnerAttGroupsSchema>;
|
|
50
|
+
|
|
51
|
+
declare const attrProdTypeSchema: z.ZodObject<{
|
|
52
|
+
attrProdTypeId: z.ZodNumber;
|
|
53
|
+
productType: z.ZodString;
|
|
54
|
+
description: z.ZodString;
|
|
55
|
+
createdDate: z.ZodNumber;
|
|
56
|
+
createdBy: z.ZodString;
|
|
57
|
+
modifiedDate: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
modifiedBy: z.ZodOptional<z.ZodString>;
|
|
59
|
+
retailerId: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
description: string;
|
|
62
|
+
attrProdTypeId: number;
|
|
63
|
+
productType: string;
|
|
64
|
+
createdDate: number;
|
|
65
|
+
createdBy: string;
|
|
66
|
+
modifiedDate?: number | undefined;
|
|
67
|
+
modifiedBy?: string | undefined;
|
|
68
|
+
retailerId?: number | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
description: string;
|
|
71
|
+
attrProdTypeId: number;
|
|
72
|
+
productType: string;
|
|
73
|
+
createdDate: number;
|
|
74
|
+
createdBy: string;
|
|
75
|
+
modifiedDate?: number | undefined;
|
|
76
|
+
modifiedBy?: string | undefined;
|
|
77
|
+
retailerId?: number | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
type AttrProdType = z.infer<typeof attrProdTypeSchema>;
|
|
80
|
+
|
|
81
|
+
declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
|
|
82
|
+
companyId: z.ZodNumber;
|
|
83
|
+
companyType: z.ZodString;
|
|
84
|
+
identityOrgId: z.ZodString;
|
|
85
|
+
companyName: z.ZodString;
|
|
86
|
+
count: z.ZodNumber;
|
|
87
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
88
|
+
catalog_id: z.ZodNumber;
|
|
89
|
+
catalog_name: z.ZodString;
|
|
90
|
+
partner_company_name: z.ZodString;
|
|
91
|
+
partner_company_id: z.ZodNumber;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
catalog_id: number;
|
|
94
|
+
catalog_name: string;
|
|
95
|
+
partner_company_name: string;
|
|
96
|
+
partner_company_id: number;
|
|
97
|
+
}, {
|
|
98
|
+
catalog_id: number;
|
|
99
|
+
catalog_name: string;
|
|
100
|
+
partner_company_name: string;
|
|
101
|
+
partner_company_id: number;
|
|
102
|
+
}>, "many">;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
count: number;
|
|
105
|
+
companyId: number;
|
|
106
|
+
companyType: string;
|
|
107
|
+
identityOrgId: string;
|
|
108
|
+
companyName: string;
|
|
109
|
+
connections: {
|
|
110
|
+
catalog_id: number;
|
|
111
|
+
catalog_name: string;
|
|
112
|
+
partner_company_name: string;
|
|
113
|
+
partner_company_id: number;
|
|
114
|
+
}[];
|
|
115
|
+
}, {
|
|
116
|
+
count: number;
|
|
117
|
+
companyId: number;
|
|
118
|
+
companyType: string;
|
|
119
|
+
identityOrgId: string;
|
|
120
|
+
companyName: string;
|
|
121
|
+
connections: {
|
|
122
|
+
catalog_id: number;
|
|
123
|
+
catalog_name: string;
|
|
124
|
+
partner_company_name: string;
|
|
125
|
+
partner_company_id: number;
|
|
126
|
+
}[];
|
|
127
|
+
}>;
|
|
128
|
+
type TradingPartnerAccessByCompanyId = z.infer<typeof tradingPartnerAccessByCompanyIdSchema>;
|
|
129
|
+
|
|
130
|
+
export { AsstClient as A, BASE_URLS as B, Env as E, TradingPartnerAccessByCompanyId as T, VendorPartnerAttGroups as V, AttrProdType as a, AsstClientOptions as b, AsstUrl as c, attrProdTypeSchema as d };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as ky_universal from 'ky-universal';
|
|
2
|
+
import { Options } from 'ky';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const BASE_URLS: {
|
|
6
|
+
readonly local: "https://localhost:8443";
|
|
7
|
+
readonly test: "https://integration.api.spscommerce.com/assortment/gateway";
|
|
8
|
+
readonly prod: "https://api.spscommerce.com/assortment/gateway";
|
|
9
|
+
};
|
|
10
|
+
type Env = keyof typeof BASE_URLS;
|
|
11
|
+
type AsstUrl = typeof BASE_URLS[Env];
|
|
12
|
+
interface AsstClientOptions extends Options {
|
|
13
|
+
prefixUrl?: AsstUrl;
|
|
14
|
+
}
|
|
15
|
+
type Input = string | URL | Request;
|
|
16
|
+
declare class AsstClient {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(options: AsstClientOptions);
|
|
19
|
+
updateConfig(options: AsstClientOptions): void;
|
|
20
|
+
getBaseUrl(): AsstUrl;
|
|
21
|
+
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): void;
|
|
22
|
+
unsubscribeToConfigChange(): void;
|
|
23
|
+
get(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
24
|
+
post(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
25
|
+
put(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
26
|
+
patch(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
27
|
+
head(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
28
|
+
delete(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const vendorPartnerAttGroupsSchema: z.ZodObject<{
|
|
32
|
+
partnerCompanyId: z.ZodNumber;
|
|
33
|
+
partnerCompanyName: z.ZodString;
|
|
34
|
+
partnerAttributeGroups: z.ZodArray<z.ZodNumber, "many">;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
partnerCompanyId: number;
|
|
37
|
+
partnerCompanyName: string;
|
|
38
|
+
partnerAttributeGroups: number[];
|
|
39
|
+
}, {
|
|
40
|
+
partnerCompanyId: number;
|
|
41
|
+
partnerCompanyName: string;
|
|
42
|
+
partnerAttributeGroups: number[];
|
|
43
|
+
}>;
|
|
44
|
+
type VendorPartnerAttGroups = z.infer<typeof vendorPartnerAttGroupsSchema>;
|
|
45
|
+
|
|
46
|
+
declare const attrProdTypeSchema: z.ZodObject<{
|
|
47
|
+
attrProdTypeId: z.ZodNumber;
|
|
48
|
+
productType: z.ZodString;
|
|
49
|
+
description: z.ZodString;
|
|
50
|
+
createdDate: z.ZodNumber;
|
|
51
|
+
createdBy: z.ZodString;
|
|
52
|
+
modifiedDate: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
modifiedBy: z.ZodOptional<z.ZodString>;
|
|
54
|
+
retailerId: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
description: string;
|
|
57
|
+
attrProdTypeId: number;
|
|
58
|
+
productType: string;
|
|
59
|
+
createdDate: number;
|
|
60
|
+
createdBy: string;
|
|
61
|
+
modifiedDate?: number | undefined;
|
|
62
|
+
modifiedBy?: string | undefined;
|
|
63
|
+
retailerId?: number | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
description: string;
|
|
66
|
+
attrProdTypeId: number;
|
|
67
|
+
productType: string;
|
|
68
|
+
createdDate: number;
|
|
69
|
+
createdBy: string;
|
|
70
|
+
modifiedDate?: number | undefined;
|
|
71
|
+
modifiedBy?: string | undefined;
|
|
72
|
+
retailerId?: number | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
type AttrProdType = z.infer<typeof attrProdTypeSchema>;
|
|
75
|
+
|
|
76
|
+
declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
|
|
77
|
+
companyId: z.ZodNumber;
|
|
78
|
+
companyType: z.ZodString;
|
|
79
|
+
identityOrgId: z.ZodString;
|
|
80
|
+
companyName: z.ZodString;
|
|
81
|
+
count: z.ZodNumber;
|
|
82
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
83
|
+
catalog_id: z.ZodNumber;
|
|
84
|
+
catalog_name: z.ZodString;
|
|
85
|
+
partner_company_name: z.ZodString;
|
|
86
|
+
partner_company_id: z.ZodNumber;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
catalog_id: number;
|
|
89
|
+
catalog_name: string;
|
|
90
|
+
partner_company_name: string;
|
|
91
|
+
partner_company_id: number;
|
|
92
|
+
}, {
|
|
93
|
+
catalog_id: number;
|
|
94
|
+
catalog_name: string;
|
|
95
|
+
partner_company_name: string;
|
|
96
|
+
partner_company_id: number;
|
|
97
|
+
}>, "many">;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
count: number;
|
|
100
|
+
companyId: number;
|
|
101
|
+
companyType: string;
|
|
102
|
+
identityOrgId: string;
|
|
103
|
+
companyName: string;
|
|
104
|
+
connections: {
|
|
105
|
+
catalog_id: number;
|
|
106
|
+
catalog_name: string;
|
|
107
|
+
partner_company_name: string;
|
|
108
|
+
partner_company_id: number;
|
|
109
|
+
}[];
|
|
110
|
+
}, {
|
|
111
|
+
count: number;
|
|
112
|
+
companyId: number;
|
|
113
|
+
companyType: string;
|
|
114
|
+
identityOrgId: string;
|
|
115
|
+
companyName: string;
|
|
116
|
+
connections: {
|
|
117
|
+
catalog_id: number;
|
|
118
|
+
catalog_name: string;
|
|
119
|
+
partner_company_name: string;
|
|
120
|
+
partner_company_id: number;
|
|
121
|
+
}[];
|
|
122
|
+
}>;
|
|
123
|
+
type TradingPartnerAccessByCompanyId = z.infer<typeof tradingPartnerAccessByCompanyIdSchema>;
|
|
124
|
+
|
|
125
|
+
export { AsstClient as A, BASE_URLS as B, Env as E, TradingPartnerAccessByCompanyId as T, VendorPartnerAttGroups as V, AttrProdType as a, AsstClientOptions as b, AsstUrl as c, attrProdTypeSchema as d };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as ky_universal from 'ky-universal';
|
|
2
|
+
import { Options } from 'ky';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const BASE_URLS: {
|
|
6
|
+
readonly local: "https://localhost:8443";
|
|
7
|
+
readonly test: "https://integration.api.spscommerce.com/assortment/gateway";
|
|
8
|
+
readonly prod: "https://api.spscommerce.com/assortment/gateway";
|
|
9
|
+
};
|
|
10
|
+
type Env = keyof typeof BASE_URLS;
|
|
11
|
+
type AsstUrl = typeof BASE_URLS[Env];
|
|
12
|
+
interface AsstClientOptions extends Options {
|
|
13
|
+
prefixUrl?: AsstUrl;
|
|
14
|
+
}
|
|
15
|
+
type Input = string | URL | Request;
|
|
16
|
+
declare class AsstClient {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(options: AsstClientOptions);
|
|
19
|
+
updateConfig(options: AsstClientOptions): void;
|
|
20
|
+
getBaseUrl(): AsstUrl;
|
|
21
|
+
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): AsstClientOptions;
|
|
22
|
+
unsubscribeToConfigChange(): void;
|
|
23
|
+
get(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
24
|
+
post(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
25
|
+
put(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
26
|
+
patch(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
27
|
+
head(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
28
|
+
delete(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const vendorPartnerAttGroupsSchema: z.ZodObject<{
|
|
32
|
+
partnerCompanyId: z.ZodNumber;
|
|
33
|
+
partnerCompanyName: z.ZodString;
|
|
34
|
+
partnerAttributeGroups: z.ZodArray<z.ZodNumber, "many">;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
partnerCompanyId: number;
|
|
37
|
+
partnerCompanyName: string;
|
|
38
|
+
partnerAttributeGroups: number[];
|
|
39
|
+
}, {
|
|
40
|
+
partnerCompanyId: number;
|
|
41
|
+
partnerCompanyName: string;
|
|
42
|
+
partnerAttributeGroups: number[];
|
|
43
|
+
}>;
|
|
44
|
+
type VendorPartnerAttGroups = z.infer<typeof vendorPartnerAttGroupsSchema>;
|
|
45
|
+
|
|
46
|
+
declare const attrProdTypeSchema: z.ZodObject<{
|
|
47
|
+
attrProdTypeId: z.ZodNumber;
|
|
48
|
+
productType: z.ZodString;
|
|
49
|
+
description: z.ZodString;
|
|
50
|
+
createdDate: z.ZodNumber;
|
|
51
|
+
createdBy: z.ZodString;
|
|
52
|
+
modifiedDate: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
modifiedBy: z.ZodOptional<z.ZodString>;
|
|
54
|
+
retailerId: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
description: string;
|
|
57
|
+
attrProdTypeId: number;
|
|
58
|
+
productType: string;
|
|
59
|
+
createdDate: number;
|
|
60
|
+
createdBy: string;
|
|
61
|
+
modifiedDate?: number | undefined;
|
|
62
|
+
modifiedBy?: string | undefined;
|
|
63
|
+
retailerId?: number | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
description: string;
|
|
66
|
+
attrProdTypeId: number;
|
|
67
|
+
productType: string;
|
|
68
|
+
createdDate: number;
|
|
69
|
+
createdBy: string;
|
|
70
|
+
modifiedDate?: number | undefined;
|
|
71
|
+
modifiedBy?: string | undefined;
|
|
72
|
+
retailerId?: number | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
type AttrProdType = z.infer<typeof attrProdTypeSchema>;
|
|
75
|
+
|
|
76
|
+
declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
|
|
77
|
+
companyId: z.ZodNumber;
|
|
78
|
+
companyType: z.ZodString;
|
|
79
|
+
identityOrgId: z.ZodString;
|
|
80
|
+
companyName: z.ZodString;
|
|
81
|
+
count: z.ZodNumber;
|
|
82
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
83
|
+
catalog_id: z.ZodNumber;
|
|
84
|
+
catalog_name: z.ZodString;
|
|
85
|
+
partner_company_name: z.ZodString;
|
|
86
|
+
partner_company_id: z.ZodNumber;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
catalog_id: number;
|
|
89
|
+
catalog_name: string;
|
|
90
|
+
partner_company_name: string;
|
|
91
|
+
partner_company_id: number;
|
|
92
|
+
}, {
|
|
93
|
+
catalog_id: number;
|
|
94
|
+
catalog_name: string;
|
|
95
|
+
partner_company_name: string;
|
|
96
|
+
partner_company_id: number;
|
|
97
|
+
}>, "many">;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
count: number;
|
|
100
|
+
companyId: number;
|
|
101
|
+
companyType: string;
|
|
102
|
+
identityOrgId: string;
|
|
103
|
+
companyName: string;
|
|
104
|
+
connections: {
|
|
105
|
+
catalog_id: number;
|
|
106
|
+
catalog_name: string;
|
|
107
|
+
partner_company_name: string;
|
|
108
|
+
partner_company_id: number;
|
|
109
|
+
}[];
|
|
110
|
+
}, {
|
|
111
|
+
count: number;
|
|
112
|
+
companyId: number;
|
|
113
|
+
companyType: string;
|
|
114
|
+
identityOrgId: string;
|
|
115
|
+
companyName: string;
|
|
116
|
+
connections: {
|
|
117
|
+
catalog_id: number;
|
|
118
|
+
catalog_name: string;
|
|
119
|
+
partner_company_name: string;
|
|
120
|
+
partner_company_id: number;
|
|
121
|
+
}[];
|
|
122
|
+
}>;
|
|
123
|
+
type TradingPartnerAccessByCompanyId = z.infer<typeof tradingPartnerAccessByCompanyIdSchema>;
|
|
124
|
+
|
|
125
|
+
export { AsstClient as A, BASE_URLS as B, Env as E, TradingPartnerAccessByCompanyId as T, VendorPartnerAttGroups as V, AttrProdType as a, AsstClientOptions as b, AsstUrl as c, attrProdTypeSchema as d };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as ky_universal from 'ky-universal';
|
|
2
|
+
import { Options } from 'ky';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const BASE_URLS: {
|
|
6
|
+
readonly local: "https://localhost:8443";
|
|
7
|
+
readonly test: "https://integration.api.spscommerce.com/assortment/gateway";
|
|
8
|
+
readonly prod: "https://api.spscommerce.com/assortment/gateway";
|
|
9
|
+
};
|
|
10
|
+
type Env = keyof typeof BASE_URLS;
|
|
11
|
+
type AsstUrl = typeof BASE_URLS[Env];
|
|
12
|
+
interface AsstClientOptions extends Options {
|
|
13
|
+
prefixUrl?: AsstUrl;
|
|
14
|
+
}
|
|
15
|
+
type Input = string | URL | Request;
|
|
16
|
+
declare class AsstClient {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(options: AsstClientOptions);
|
|
19
|
+
updateConfig(options: AsstClientOptions): void;
|
|
20
|
+
getBaseUrl(): AsstUrl;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
23
|
+
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
24
|
+
*/
|
|
25
|
+
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): void;
|
|
26
|
+
unsubscribeToConfigChange(): void;
|
|
27
|
+
get(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
28
|
+
post(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
29
|
+
put(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
30
|
+
patch(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
31
|
+
head(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
32
|
+
delete(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare const vendorPartnerAttGroupsSchema: z.ZodObject<{
|
|
36
|
+
partnerCompanyId: z.ZodNumber;
|
|
37
|
+
partnerCompanyName: z.ZodString;
|
|
38
|
+
partnerAttributeGroups: z.ZodArray<z.ZodNumber, "many">;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
partnerCompanyId: number;
|
|
41
|
+
partnerCompanyName: string;
|
|
42
|
+
partnerAttributeGroups: number[];
|
|
43
|
+
}, {
|
|
44
|
+
partnerCompanyId: number;
|
|
45
|
+
partnerCompanyName: string;
|
|
46
|
+
partnerAttributeGroups: number[];
|
|
47
|
+
}>;
|
|
48
|
+
type VendorPartnerAttGroups = z.infer<typeof vendorPartnerAttGroupsSchema>;
|
|
49
|
+
|
|
50
|
+
declare const attrProdTypeSchema: z.ZodObject<{
|
|
51
|
+
attrProdTypeId: z.ZodNumber;
|
|
52
|
+
productType: z.ZodString;
|
|
53
|
+
description: z.ZodString;
|
|
54
|
+
createdDate: z.ZodNumber;
|
|
55
|
+
createdBy: z.ZodString;
|
|
56
|
+
modifiedDate: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
modifiedBy: z.ZodOptional<z.ZodString>;
|
|
58
|
+
retailerId: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
description: string;
|
|
61
|
+
attrProdTypeId: number;
|
|
62
|
+
productType: string;
|
|
63
|
+
createdDate: number;
|
|
64
|
+
createdBy: string;
|
|
65
|
+
modifiedDate?: number | undefined;
|
|
66
|
+
modifiedBy?: string | undefined;
|
|
67
|
+
retailerId?: number | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
description: string;
|
|
70
|
+
attrProdTypeId: number;
|
|
71
|
+
productType: string;
|
|
72
|
+
createdDate: number;
|
|
73
|
+
createdBy: string;
|
|
74
|
+
modifiedDate?: number | undefined;
|
|
75
|
+
modifiedBy?: string | undefined;
|
|
76
|
+
retailerId?: number | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
type AttrProdType = z.infer<typeof attrProdTypeSchema>;
|
|
79
|
+
|
|
80
|
+
declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
|
|
81
|
+
companyId: z.ZodNumber;
|
|
82
|
+
companyType: z.ZodString;
|
|
83
|
+
identityOrgId: z.ZodString;
|
|
84
|
+
companyName: z.ZodString;
|
|
85
|
+
count: z.ZodNumber;
|
|
86
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
87
|
+
catalog_id: z.ZodNumber;
|
|
88
|
+
catalog_name: z.ZodString;
|
|
89
|
+
partner_company_name: z.ZodString;
|
|
90
|
+
partner_company_id: z.ZodNumber;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
catalog_id: number;
|
|
93
|
+
catalog_name: string;
|
|
94
|
+
partner_company_name: string;
|
|
95
|
+
partner_company_id: number;
|
|
96
|
+
}, {
|
|
97
|
+
catalog_id: number;
|
|
98
|
+
catalog_name: string;
|
|
99
|
+
partner_company_name: string;
|
|
100
|
+
partner_company_id: number;
|
|
101
|
+
}>, "many">;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
count: number;
|
|
104
|
+
companyId: number;
|
|
105
|
+
companyType: string;
|
|
106
|
+
identityOrgId: string;
|
|
107
|
+
companyName: string;
|
|
108
|
+
connections: {
|
|
109
|
+
catalog_id: number;
|
|
110
|
+
catalog_name: string;
|
|
111
|
+
partner_company_name: string;
|
|
112
|
+
partner_company_id: number;
|
|
113
|
+
}[];
|
|
114
|
+
}, {
|
|
115
|
+
count: number;
|
|
116
|
+
companyId: number;
|
|
117
|
+
companyType: string;
|
|
118
|
+
identityOrgId: string;
|
|
119
|
+
companyName: string;
|
|
120
|
+
connections: {
|
|
121
|
+
catalog_id: number;
|
|
122
|
+
catalog_name: string;
|
|
123
|
+
partner_company_name: string;
|
|
124
|
+
partner_company_id: number;
|
|
125
|
+
}[];
|
|
126
|
+
}>;
|
|
127
|
+
type TradingPartnerAccessByCompanyId = z.infer<typeof tradingPartnerAccessByCompanyIdSchema>;
|
|
128
|
+
|
|
129
|
+
export { AsstClient as A, BASE_URLS as B, Env as E, TradingPartnerAccessByCompanyId as T, VendorPartnerAttGroups as V, AttrProdType as a, AsstClientOptions as b, AsstUrl as c, attrProdTypeSchema as d };
|
|
@@ -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 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
|
+
this.updateConfig(options);
|
|
28
|
+
}
|
|
29
|
+
updateConfig(options) {
|
|
30
|
+
this.#client = this.#client.extend(options);
|
|
31
|
+
this.#currentConfig = options;
|
|
32
|
+
if (options.prefixUrl) {
|
|
33
|
+
this.#baseUrl = options.prefixUrl;
|
|
34
|
+
}
|
|
35
|
+
if (this.#subscriptionCallback) {
|
|
36
|
+
this.#subscriptionCallback(options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
getBaseUrl() {
|
|
40
|
+
return this.#baseUrl;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
44
|
+
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
45
|
+
*/
|
|
46
|
+
subscribeToConfigChange(subscriptionCallback) {
|
|
47
|
+
this.#subscriptionCallback = subscriptionCallback;
|
|
48
|
+
subscriptionCallback(this.#currentConfig);
|
|
49
|
+
}
|
|
50
|
+
unsubscribeToConfigChange() {
|
|
51
|
+
this.#subscriptionCallback = void 0;
|
|
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
|
+
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Assortment Api is a collection of HTTP functions to use Assortment endpoints",
|
|
4
4
|
"author": "Assortment",
|
|
5
5
|
"repository": "https://github.com/SPSCommerce/assortment-main/tree/main/ui/packages/asst-api",
|
|
6
|
-
"version": "0.0.1-beta.
|
|
6
|
+
"version": "0.0.1-beta.3",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|