@spscommerce/asst-api 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CompanyBriefByOrg-eea5479d.d.ts → CompanyBriefByOrg-HsKxilwl.d.ts} +140 -140
- package/dist/{chunk-VICSFYTR.js → chunk-6FFDMMN5.js} +430 -199
- package/dist/{chunk-HBDHFANT.js → chunk-C2N5RQWG.js} +95 -50
- package/dist/{index-ba0dd228.d.ts → index-wuCGfJSu.d.ts} +5 -2
- package/dist/index.cjs +590 -237
- package/dist/index.d.cts +617 -0
- package/dist/index.d.ts +325 -10
- package/dist/index.js +81 -3
- package/dist/msw.cjs +569 -299
- package/dist/msw.d.cts +833 -0
- package/dist/msw.d.ts +40 -28
- package/dist/msw.js +111 -89
- package/dist/{zod-5a9153f1.d.ts → zod-9pZn6tpQ.d.ts} +206 -248
- package/dist/zod.cjs +430 -201
- package/dist/zod.d.cts +5 -0
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +1 -5
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AsstClient, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, E as Export, m as AttrProdType, T as TradingPartnerAccessByCompanyId, e as CompanyRelationshipUpsertBody, c as ItemCategoriesSearch, i as AttributeMetaData, j as AttributesByCompany, k as AttributeDefinition, l as AttributeValidValues, L as Locale, S as SpreadsheetTemplate, U as UserAccount, g as ItemSearchView, h as ItemDetailView, f as ItemErrorDetailsResult } from './CompanyBriefByOrg-
|
|
2
|
-
export { o as AsstClientOptions, p as AsstUrl, B as BASE_URLS, C as CompanyBriefByOrg, q as Env, I as ImportErrors, n as envSchema } from './CompanyBriefByOrg-
|
|
3
|
-
import { G as GenerateImportTemplateParams, D as DownLoadItemsParams, I as ItemPartner, a as ItemHierarchyResponse, b as ItemDetail, S as SpsItemIdResponse } from './zod-
|
|
4
|
-
export {
|
|
5
|
-
import { I as ItemStatusResponse } from './index-
|
|
6
|
-
export { c as createCompaniesApi } from './index-
|
|
1
|
+
import { A as AsstClient, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, E as Export, m as AttrProdType, T as TradingPartnerAccessByCompanyId, e as CompanyRelationshipUpsertBody, c as ItemCategoriesSearch, i as AttributeMetaData, j as AttributesByCompany, k as AttributeDefinition, l as AttributeValidValues, L as Locale, S as SpreadsheetTemplate, U as UserAccount, g as ItemSearchView, h as ItemDetailView, f as ItemErrorDetailsResult } from './CompanyBriefByOrg-HsKxilwl.js';
|
|
2
|
+
export { o as AsstClientOptions, p as AsstUrl, B as BASE_URLS, C as CompanyBriefByOrg, q as Env, I as ImportErrors, n as envSchema } from './CompanyBriefByOrg-HsKxilwl.js';
|
|
3
|
+
import { G as GenerateImportTemplateParams, D as DownLoadItemsParams, I as ItemPartner, a as ItemHierarchyResponse, b as ItemDetail, S as SpsItemIdResponse } from './zod-9pZn6tpQ.js';
|
|
4
|
+
export { i as AttrDatatypeNameEnum, t as AttributeDetail, j as AttributeGroup, A as AttributeSummary, J as Bulb, u as CategoryEnum, v as ComponentDetails, C as Connection, E as ExportDayOfWeek, f as ExportFrequency, g as ExportType, w as GroupedAttributeList, x as GroupedAttributes, y as GroupedItem, H as HierarchyCategory, z as HierarchyDetails, m as IdentityServiceDatetimePreferences, n as IdentityServiceOrganization, l as IdentityServiceOrganizationMetadata, o as IdentityServicePreferences, p as IdentityServiceUser, c as ImportDetails, d as ImportError, e as ImportStatusEnum, h as ItemCategory, O as ItemErrorDetails, q as ItemHeader, r as ItemMap, B as ItemPrice, s as ItemTable, M as MediaItem, K as PackComponent, F as PackComponentDetails, N as PackComponentItemInfo, P as PhaseEnum, R as RegisteredService, L as RepeatableGroup, k as SpreadsheetTemplateCompany, T as TradingPartnerStage } from './zod-9pZn6tpQ.js';
|
|
5
|
+
import { R as RetailerTradingPartnerStages, I as ItemStatusResponse } from './index-wuCGfJSu.js';
|
|
6
|
+
export { c as createCompaniesApi } from './index-wuCGfJSu.js';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import 'ky-universal';
|
|
9
9
|
import 'ky';
|
|
@@ -75,11 +75,15 @@ declare function createTradingPartnerAccessApi(client: AsstClient): {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Initialize
|
|
78
|
+
* Initialize Trading Partner Settings Api functions
|
|
79
79
|
* @param client Assortment Client instance
|
|
80
|
-
* @returns An object containing
|
|
80
|
+
* @returns An object containing Trading Partner Settings API functions
|
|
81
81
|
*/
|
|
82
|
-
declare function
|
|
82
|
+
declare function createTradingPartnerSettingsApi(client: AsstClient): {
|
|
83
|
+
getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type CategoriesApi = {
|
|
83
87
|
getCatalogs: (params?: {
|
|
84
88
|
categoryName?: string;
|
|
85
89
|
orgId?: string;
|
|
@@ -97,6 +101,12 @@ declare function createCategoriesApi(client: AsstClient): {
|
|
|
97
101
|
}, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
|
|
98
102
|
getItemHierarchy: (itemIds: string[]) => Promise<ItemHierarchyResponse>;
|
|
99
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Initialize Categories Api functions
|
|
106
|
+
* @param client Assortment Client instance
|
|
107
|
+
* @returns An object containing Categories API functions
|
|
108
|
+
*/
|
|
109
|
+
declare function createCategoriesApi(client: AsstClient): CategoriesApi;
|
|
100
110
|
|
|
101
111
|
/**
|
|
102
112
|
* Initialize Attributes Api functions
|
|
@@ -145,6 +155,8 @@ declare function createWhoAmIApi(client: AsstClient): {
|
|
|
145
155
|
whoAmI: (signal?: AbortSignal) => Promise<UserAccount>;
|
|
146
156
|
};
|
|
147
157
|
|
|
158
|
+
type ApplicationType = "ASSORTMENT" | "ITEM-XREF";
|
|
159
|
+
|
|
148
160
|
/**
|
|
149
161
|
* Initialize Company Features Api functions
|
|
150
162
|
* @param client Assortment Client instance
|
|
@@ -269,6 +281,7 @@ declare function createItemsApi(client: AsstClient): {
|
|
|
269
281
|
url: string;
|
|
270
282
|
limit?: number;
|
|
271
283
|
offset?: number;
|
|
284
|
+
applicationType?: ApplicationType;
|
|
272
285
|
}, signal?: AbortSignal) => Promise<ItemSearchView>;
|
|
273
286
|
getItem: (itemId: string, locale?: string, signal?: AbortSignal) => Promise<ItemDetailView>;
|
|
274
287
|
updateItem: (itemId: string, item: ItemDetail) => Promise<void>;
|
|
@@ -279,6 +292,308 @@ declare function createItemsApi(client: AsstClient): {
|
|
|
279
292
|
getItemStatus: (itemIds: string[]) => Promise<ItemStatusResponse>;
|
|
280
293
|
};
|
|
281
294
|
|
|
295
|
+
declare const itemOrgStageDetailsSchema: z.ZodObject<{
|
|
296
|
+
/**
|
|
297
|
+
* When called as retailer, the vendor, else when vendor, the retailer.
|
|
298
|
+
* */
|
|
299
|
+
orgSummary: z.ZodObject<{
|
|
300
|
+
ref: z.ZodString;
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
name: z.ZodString;
|
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
|
304
|
+
name: string;
|
|
305
|
+
id: string;
|
|
306
|
+
ref: string;
|
|
307
|
+
}, {
|
|
308
|
+
name: string;
|
|
309
|
+
id: string;
|
|
310
|
+
ref: string;
|
|
311
|
+
}>;
|
|
312
|
+
/**
|
|
313
|
+
* The company id of the retailer or vendor used for matching ItemOrgStageDetails to TradingPartnerStage for ErrorService
|
|
314
|
+
*/
|
|
315
|
+
companyId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
316
|
+
/**
|
|
317
|
+
* "Standard Requirements" (null) UNLESS the retailer of the item is MSIS Enabled
|
|
318
|
+
* OTHERWISE the retailer default Stage UNLESS there's a currently active vendor-specific Stage defined
|
|
319
|
+
* OTHERWISE the trading partnership Stage UNLESS there's a currently active Item Level override defined
|
|
320
|
+
* OTHERWISE the item level override */
|
|
321
|
+
stage: z.ZodOptional<z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED"]>>>;
|
|
322
|
+
/**
|
|
323
|
+
* If the item is valid for the active stage. Note that for "Standard Requirements" or
|
|
324
|
+
* "Enriched" this cam come directly from the item_doc table, but anything else requires validation
|
|
325
|
+
*/
|
|
326
|
+
isValid: z.ZodBoolean;
|
|
327
|
+
/**
|
|
328
|
+
* Not null if there's an item level policy override for this trading partnership
|
|
329
|
+
*/
|
|
330
|
+
itemPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
331
|
+
/**
|
|
332
|
+
* Start date for the Item level Stage if applicable
|
|
333
|
+
*/
|
|
334
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodPipeline<z.ZodNumber, z.ZodDate>>>;
|
|
335
|
+
/**
|
|
336
|
+
* End date for the Item level Stage if applicable
|
|
337
|
+
*/
|
|
338
|
+
endDate: z.ZodOptional<z.ZodNullable<z.ZodPipeline<z.ZodNumber, z.ZodDate>>>;
|
|
339
|
+
}, "strip", z.ZodTypeAny, {
|
|
340
|
+
isValid: boolean;
|
|
341
|
+
orgSummary: {
|
|
342
|
+
name: string;
|
|
343
|
+
id: string;
|
|
344
|
+
ref: string;
|
|
345
|
+
};
|
|
346
|
+
companyId?: number | null | undefined;
|
|
347
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
348
|
+
itemPolicyId?: string | null | undefined;
|
|
349
|
+
startDate?: Date | null | undefined;
|
|
350
|
+
endDate?: Date | null | undefined;
|
|
351
|
+
}, {
|
|
352
|
+
isValid: boolean;
|
|
353
|
+
orgSummary: {
|
|
354
|
+
name: string;
|
|
355
|
+
id: string;
|
|
356
|
+
ref: string;
|
|
357
|
+
};
|
|
358
|
+
companyId?: number | null | undefined;
|
|
359
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
360
|
+
itemPolicyId?: string | null | undefined;
|
|
361
|
+
startDate?: number | null | undefined;
|
|
362
|
+
endDate?: number | null | undefined;
|
|
363
|
+
}>;
|
|
364
|
+
type ItemOrgStageDetails = z.infer<typeof itemOrgStageDetailsSchema>;
|
|
365
|
+
|
|
366
|
+
declare const itemStatusV2Schema: z.ZodObject<{
|
|
367
|
+
itemId: z.ZodString;
|
|
368
|
+
mostRestrictiveRetailerStage: z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED"]>>;
|
|
369
|
+
itemOrgStageDetails: z.ZodArray<z.ZodObject<{
|
|
370
|
+
orgSummary: z.ZodObject<{
|
|
371
|
+
ref: z.ZodString;
|
|
372
|
+
id: z.ZodString;
|
|
373
|
+
name: z.ZodString;
|
|
374
|
+
}, "strip", z.ZodTypeAny, {
|
|
375
|
+
name: string;
|
|
376
|
+
id: string;
|
|
377
|
+
ref: string;
|
|
378
|
+
}, {
|
|
379
|
+
name: string;
|
|
380
|
+
id: string;
|
|
381
|
+
ref: string;
|
|
382
|
+
}>;
|
|
383
|
+
companyId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
384
|
+
stage: z.ZodOptional<z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED"]>>>;
|
|
385
|
+
isValid: z.ZodBoolean;
|
|
386
|
+
itemPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
387
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodPipeline<z.ZodNumber, z.ZodDate>>>;
|
|
388
|
+
endDate: z.ZodOptional<z.ZodNullable<z.ZodPipeline<z.ZodNumber, z.ZodDate>>>;
|
|
389
|
+
}, "strip", z.ZodTypeAny, {
|
|
390
|
+
isValid: boolean;
|
|
391
|
+
orgSummary: {
|
|
392
|
+
name: string;
|
|
393
|
+
id: string;
|
|
394
|
+
ref: string;
|
|
395
|
+
};
|
|
396
|
+
companyId?: number | null | undefined;
|
|
397
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
398
|
+
itemPolicyId?: string | null | undefined;
|
|
399
|
+
startDate?: Date | null | undefined;
|
|
400
|
+
endDate?: Date | null | undefined;
|
|
401
|
+
}, {
|
|
402
|
+
isValid: boolean;
|
|
403
|
+
orgSummary: {
|
|
404
|
+
name: string;
|
|
405
|
+
id: string;
|
|
406
|
+
ref: string;
|
|
407
|
+
};
|
|
408
|
+
companyId?: number | null | undefined;
|
|
409
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
410
|
+
itemPolicyId?: string | null | undefined;
|
|
411
|
+
startDate?: number | null | undefined;
|
|
412
|
+
endDate?: number | null | undefined;
|
|
413
|
+
}>, "many">;
|
|
414
|
+
}, "strip", z.ZodTypeAny, {
|
|
415
|
+
itemId: string;
|
|
416
|
+
mostRestrictiveRetailerStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null;
|
|
417
|
+
itemOrgStageDetails: {
|
|
418
|
+
isValid: boolean;
|
|
419
|
+
orgSummary: {
|
|
420
|
+
name: string;
|
|
421
|
+
id: string;
|
|
422
|
+
ref: string;
|
|
423
|
+
};
|
|
424
|
+
companyId?: number | null | undefined;
|
|
425
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
426
|
+
itemPolicyId?: string | null | undefined;
|
|
427
|
+
startDate?: Date | null | undefined;
|
|
428
|
+
endDate?: Date | null | undefined;
|
|
429
|
+
}[];
|
|
430
|
+
}, {
|
|
431
|
+
itemId: string;
|
|
432
|
+
mostRestrictiveRetailerStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null;
|
|
433
|
+
itemOrgStageDetails: {
|
|
434
|
+
isValid: boolean;
|
|
435
|
+
orgSummary: {
|
|
436
|
+
name: string;
|
|
437
|
+
id: string;
|
|
438
|
+
ref: string;
|
|
439
|
+
};
|
|
440
|
+
companyId?: number | null | undefined;
|
|
441
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
442
|
+
itemPolicyId?: string | null | undefined;
|
|
443
|
+
startDate?: number | null | undefined;
|
|
444
|
+
endDate?: number | null | undefined;
|
|
445
|
+
}[];
|
|
446
|
+
}>;
|
|
447
|
+
type ItemStatusV2 = z.infer<typeof itemStatusV2Schema>;
|
|
448
|
+
|
|
449
|
+
declare const itemStatusV2ResponseSchema: z.ZodObject<{
|
|
450
|
+
itemStatuses: z.ZodArray<z.ZodObject<{
|
|
451
|
+
itemId: z.ZodString;
|
|
452
|
+
mostRestrictiveRetailerStage: z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED"]>>;
|
|
453
|
+
itemOrgStageDetails: z.ZodArray<z.ZodObject<{
|
|
454
|
+
orgSummary: z.ZodObject<{
|
|
455
|
+
ref: z.ZodString;
|
|
456
|
+
id: z.ZodString;
|
|
457
|
+
name: z.ZodString;
|
|
458
|
+
}, "strip", z.ZodTypeAny, {
|
|
459
|
+
name: string;
|
|
460
|
+
id: string;
|
|
461
|
+
ref: string;
|
|
462
|
+
}, {
|
|
463
|
+
name: string;
|
|
464
|
+
id: string;
|
|
465
|
+
ref: string;
|
|
466
|
+
}>;
|
|
467
|
+
companyId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
468
|
+
stage: z.ZodOptional<z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED"]>>>;
|
|
469
|
+
isValid: z.ZodBoolean;
|
|
470
|
+
itemPolicyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
471
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodPipeline<z.ZodNumber, z.ZodDate>>>;
|
|
472
|
+
endDate: z.ZodOptional<z.ZodNullable<z.ZodPipeline<z.ZodNumber, z.ZodDate>>>;
|
|
473
|
+
}, "strip", z.ZodTypeAny, {
|
|
474
|
+
isValid: boolean;
|
|
475
|
+
orgSummary: {
|
|
476
|
+
name: string;
|
|
477
|
+
id: string;
|
|
478
|
+
ref: string;
|
|
479
|
+
};
|
|
480
|
+
companyId?: number | null | undefined;
|
|
481
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
482
|
+
itemPolicyId?: string | null | undefined;
|
|
483
|
+
startDate?: Date | null | undefined;
|
|
484
|
+
endDate?: Date | null | undefined;
|
|
485
|
+
}, {
|
|
486
|
+
isValid: boolean;
|
|
487
|
+
orgSummary: {
|
|
488
|
+
name: string;
|
|
489
|
+
id: string;
|
|
490
|
+
ref: string;
|
|
491
|
+
};
|
|
492
|
+
companyId?: number | null | undefined;
|
|
493
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
494
|
+
itemPolicyId?: string | null | undefined;
|
|
495
|
+
startDate?: number | null | undefined;
|
|
496
|
+
endDate?: number | null | undefined;
|
|
497
|
+
}>, "many">;
|
|
498
|
+
}, "strip", z.ZodTypeAny, {
|
|
499
|
+
itemId: string;
|
|
500
|
+
mostRestrictiveRetailerStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null;
|
|
501
|
+
itemOrgStageDetails: {
|
|
502
|
+
isValid: boolean;
|
|
503
|
+
orgSummary: {
|
|
504
|
+
name: string;
|
|
505
|
+
id: string;
|
|
506
|
+
ref: string;
|
|
507
|
+
};
|
|
508
|
+
companyId?: number | null | undefined;
|
|
509
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
510
|
+
itemPolicyId?: string | null | undefined;
|
|
511
|
+
startDate?: Date | null | undefined;
|
|
512
|
+
endDate?: Date | null | undefined;
|
|
513
|
+
}[];
|
|
514
|
+
}, {
|
|
515
|
+
itemId: string;
|
|
516
|
+
mostRestrictiveRetailerStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null;
|
|
517
|
+
itemOrgStageDetails: {
|
|
518
|
+
isValid: boolean;
|
|
519
|
+
orgSummary: {
|
|
520
|
+
name: string;
|
|
521
|
+
id: string;
|
|
522
|
+
ref: string;
|
|
523
|
+
};
|
|
524
|
+
companyId?: number | null | undefined;
|
|
525
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
526
|
+
itemPolicyId?: string | null | undefined;
|
|
527
|
+
startDate?: number | null | undefined;
|
|
528
|
+
endDate?: number | null | undefined;
|
|
529
|
+
}[];
|
|
530
|
+
}>, "many">;
|
|
531
|
+
}, "strip", z.ZodTypeAny, {
|
|
532
|
+
itemStatuses: {
|
|
533
|
+
itemId: string;
|
|
534
|
+
mostRestrictiveRetailerStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null;
|
|
535
|
+
itemOrgStageDetails: {
|
|
536
|
+
isValid: boolean;
|
|
537
|
+
orgSummary: {
|
|
538
|
+
name: string;
|
|
539
|
+
id: string;
|
|
540
|
+
ref: string;
|
|
541
|
+
};
|
|
542
|
+
companyId?: number | null | undefined;
|
|
543
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
544
|
+
itemPolicyId?: string | null | undefined;
|
|
545
|
+
startDate?: Date | null | undefined;
|
|
546
|
+
endDate?: Date | null | undefined;
|
|
547
|
+
}[];
|
|
548
|
+
}[];
|
|
549
|
+
}, {
|
|
550
|
+
itemStatuses: {
|
|
551
|
+
itemId: string;
|
|
552
|
+
mostRestrictiveRetailerStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null;
|
|
553
|
+
itemOrgStageDetails: {
|
|
554
|
+
isValid: boolean;
|
|
555
|
+
orgSummary: {
|
|
556
|
+
name: string;
|
|
557
|
+
id: string;
|
|
558
|
+
ref: string;
|
|
559
|
+
};
|
|
560
|
+
companyId?: number | null | undefined;
|
|
561
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
562
|
+
itemPolicyId?: string | null | undefined;
|
|
563
|
+
startDate?: number | null | undefined;
|
|
564
|
+
endDate?: number | null | undefined;
|
|
565
|
+
}[];
|
|
566
|
+
}[];
|
|
567
|
+
}>;
|
|
568
|
+
type ItemStatusV2Response = z.infer<typeof itemStatusV2ResponseSchema>;
|
|
569
|
+
|
|
570
|
+
declare const orgSummarySchema: z.ZodObject<{
|
|
571
|
+
ref: z.ZodString;
|
|
572
|
+
id: z.ZodString;
|
|
573
|
+
name: z.ZodString;
|
|
574
|
+
}, "strip", z.ZodTypeAny, {
|
|
575
|
+
name: string;
|
|
576
|
+
id: string;
|
|
577
|
+
ref: string;
|
|
578
|
+
}, {
|
|
579
|
+
name: string;
|
|
580
|
+
id: string;
|
|
581
|
+
ref: string;
|
|
582
|
+
}>;
|
|
583
|
+
type OrgSummary = z.infer<typeof orgSummarySchema>;
|
|
584
|
+
|
|
585
|
+
declare const stageSchema: z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED"]>;
|
|
586
|
+
type Stage = z.infer<typeof stageSchema>;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Initialize Items Api functions
|
|
590
|
+
* @param client Assortment Client instance
|
|
591
|
+
* @returns An object containing Items API functions
|
|
592
|
+
*/
|
|
593
|
+
declare function createItemsApiV2(client: AsstClient): {
|
|
594
|
+
getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
|
|
595
|
+
};
|
|
596
|
+
|
|
282
597
|
/**
|
|
283
598
|
* Initialize Errors Api functions
|
|
284
599
|
* @param client Assortment Client instance
|
|
@@ -299,4 +614,4 @@ declare function createUniqueCriteriaApi(client: AsstClient): {
|
|
|
299
614
|
}, signal?: AbortSignal) => Promise<string[]>;
|
|
300
615
|
};
|
|
301
616
|
|
|
302
|
-
export { AsstClient, AttrProdType, AttributeDefinition, AttributeMetaData, AttributeValidValues, AttributesByCompany, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, GenerateImportTemplateParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemHierarchyResponse, ItemOrgStatus, ItemPartner, ItemSearchView, ItemStatus, ItemStatusResponse, Locale, SpreadsheetTemplate, SpsItemIdResponse, TradingPartnerAccessByCompanyId, UserAccount, VendorPartnerAttGroups, createAttributesApi, createCategoriesApi, createCompanyFeaturesApi, createErrorsApi, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createUniqueCriteriaApi, createWhoAmIApi };
|
|
617
|
+
export { type ApplicationType, AsstClient, AttrProdType, AttributeDefinition, AttributeMetaData, AttributeValidValues, AttributesByCompany, type CategoriesApi, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, GenerateImportTemplateParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemHierarchyResponse, type ItemOrgStageDetails, type ItemOrgStatus, ItemPartner, ItemSearchView, type ItemStatus, ItemStatusResponse, type ItemStatusV2, type ItemStatusV2Response, Locale, type OrgSummary, RetailerTradingPartnerStages, SpreadsheetTemplate, SpsItemIdResponse, type Stage, TradingPartnerAccessByCompanyId, UserAccount, VendorPartnerAttGroups, createAttributesApi, createCategoriesApi, createCompanyFeaturesApi, createErrorsApi, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createItemsApiV2, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
|
package/dist/index.js
CHANGED
|
@@ -12,14 +12,90 @@ import {
|
|
|
12
12
|
createProductTypesApi,
|
|
13
13
|
createSpreadsheetTemplateApi,
|
|
14
14
|
createTradingPartnerAccessApi,
|
|
15
|
+
createTradingPartnerSettingsApi,
|
|
15
16
|
createUniqueCriteriaApi,
|
|
16
17
|
createWhoAmIApi
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-C2N5RQWG.js";
|
|
18
19
|
import {
|
|
19
20
|
AsstClient,
|
|
20
21
|
BASE_URLS,
|
|
21
|
-
envSchema
|
|
22
|
-
|
|
22
|
+
envSchema,
|
|
23
|
+
z
|
|
24
|
+
} from "./chunk-6FFDMMN5.js";
|
|
25
|
+
|
|
26
|
+
// lib/items/v2/models/Stage.ts
|
|
27
|
+
var stageSchema = z.enum([
|
|
28
|
+
"CORE",
|
|
29
|
+
"CORE_PLUS",
|
|
30
|
+
"CORE_ADVANCED",
|
|
31
|
+
"ENRICHED"
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
// lib/items/v2/models/OrgSummary.ts
|
|
35
|
+
var orgSummarySchema = z.object({
|
|
36
|
+
ref: z.string(),
|
|
37
|
+
id: z.string(),
|
|
38
|
+
name: z.string()
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// lib/items/v2/models/ItemOrgStageDetails.ts
|
|
42
|
+
var itemOrgStageDetailsSchema = z.object({
|
|
43
|
+
/**
|
|
44
|
+
* When called as retailer, the vendor, else when vendor, the retailer.
|
|
45
|
+
* */
|
|
46
|
+
orgSummary: orgSummarySchema,
|
|
47
|
+
/**
|
|
48
|
+
* The company id of the retailer or vendor used for matching ItemOrgStageDetails to TradingPartnerStage for ErrorService
|
|
49
|
+
*/
|
|
50
|
+
companyId: z.number().nullish(),
|
|
51
|
+
/**
|
|
52
|
+
* "Standard Requirements" (null) UNLESS the retailer of the item is MSIS Enabled
|
|
53
|
+
* OTHERWISE the retailer default Stage UNLESS there's a currently active vendor-specific Stage defined
|
|
54
|
+
* OTHERWISE the trading partnership Stage UNLESS there's a currently active Item Level override defined
|
|
55
|
+
* OTHERWISE the item level override */
|
|
56
|
+
stage: stageSchema.nullish(),
|
|
57
|
+
/**
|
|
58
|
+
* If the item is valid for the active stage. Note that for "Standard Requirements" or
|
|
59
|
+
* "Enriched" this cam come directly from the item_doc table, but anything else requires validation
|
|
60
|
+
*/
|
|
61
|
+
isValid: z.boolean(),
|
|
62
|
+
/**
|
|
63
|
+
* Not null if there's an item level policy override for this trading partnership
|
|
64
|
+
*/
|
|
65
|
+
itemPolicyId: z.string().nullish(),
|
|
66
|
+
/**
|
|
67
|
+
* Start date for the Item level Stage if applicable
|
|
68
|
+
*/
|
|
69
|
+
startDate: z.number().pipe(z.coerce.date()).nullish(),
|
|
70
|
+
/**
|
|
71
|
+
* End date for the Item level Stage if applicable
|
|
72
|
+
*/
|
|
73
|
+
endDate: z.number().pipe(z.coerce.date()).nullish()
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// lib/items/v2/models/ItemStatusV2.ts
|
|
77
|
+
var itemStatusV2Schema = z.object({
|
|
78
|
+
itemId: z.string(),
|
|
79
|
+
mostRestrictiveRetailerStage: stageSchema.nullable(),
|
|
80
|
+
itemOrgStageDetails: z.array(itemOrgStageDetailsSchema)
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// lib/items/v2/models/ItemStatusV2Response.ts
|
|
84
|
+
var itemStatusV2ResponseSchema = z.object({
|
|
85
|
+
itemStatuses: z.array(itemStatusV2Schema)
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// lib/items/v2/index.ts
|
|
89
|
+
var BASE_URL = "v2/items";
|
|
90
|
+
function createItemsApiV2(client) {
|
|
91
|
+
async function getItemStatus(itemIds) {
|
|
92
|
+
const data = await client.post(`${BASE_URL}/status`, { json: { itemIds } }).json();
|
|
93
|
+
return itemStatusV2ResponseSchema.parse(data);
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
getItemStatus
|
|
97
|
+
};
|
|
98
|
+
}
|
|
23
99
|
export {
|
|
24
100
|
AsstClient,
|
|
25
101
|
BASE_URLS,
|
|
@@ -32,10 +108,12 @@ export {
|
|
|
32
108
|
createFeatureFlagsApi,
|
|
33
109
|
createImportsApi,
|
|
34
110
|
createItemsApi,
|
|
111
|
+
createItemsApiV2,
|
|
35
112
|
createLocaleApi,
|
|
36
113
|
createProductTypesApi,
|
|
37
114
|
createSpreadsheetTemplateApi,
|
|
38
115
|
createTradingPartnerAccessApi,
|
|
116
|
+
createTradingPartnerSettingsApi,
|
|
39
117
|
createUniqueCriteriaApi,
|
|
40
118
|
createWhoAmIApi,
|
|
41
119
|
envSchema
|