@spscommerce/asst-api 4.2.3 → 4.4.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/{chunk-FCUIJXCD.js → chunk-V2XRXJIJ.js} +129 -33
- package/dist/{chunk-RPGGEEFE.js → chunk-WODMKML4.js} +1 -1
- package/dist/{chunk-L4AWOEED.js → chunk-YT2B4UAK.js} +41 -4
- package/dist/index.cjs +165 -36
- package/dist/index.d.cts +142 -15
- package/dist/index.d.ts +142 -15
- package/dist/index.js +5 -17
- package/dist/msw.cjs +134 -19
- package/dist/msw.d.cts +85 -10
- package/dist/msw.d.ts +85 -10
- package/dist/msw.js +94 -13
- package/dist/{zod-C3fOiO-H.d.cts → zod-CJ7lvFQH.d.cts} +53 -50
- package/dist/{zod-CJ6AFTQr.d.ts → zod-j6CrX5vY.d.ts} +53 -50
- package/dist/zod.cjs +39 -4
- package/dist/zod.d.cts +2 -2
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +2 -2
- package/package.json +3 -3
- package/dist/CompanyBriefByOrg-57oGCtjK.d.ts +0 -3427
- package/dist/CompanyBriefByOrg-Dy2omcT0.d.cts +0 -95
- package/dist/CompanyBriefByOrg-Dy2omcT0.d.ts +0 -95
- package/dist/CompanyBriefByOrg-LTdsUKm4.d.ts +0 -3427
- package/dist/CompanyBriefByOrg-itus4RMD.d.cts +0 -131
- package/dist/CompanyBriefByOrg-itus4RMD.d.ts +0 -131
- package/dist/SpsItemIdResponse-CkHdH_QJ.d.cts +0 -59
- package/dist/SpsItemIdResponse-CkHdH_QJ.d.ts +0 -59
- package/dist/chunk-27XV7TS2.js +0 -522
- package/dist/chunk-2ETQHIXC.js +0 -528
- package/dist/chunk-2VJS5KPH.js +0 -5182
- package/dist/chunk-2W3LZ4AO.js +0 -513
- package/dist/chunk-3XNXQYIB.js +0 -521
- package/dist/chunk-4C475UZX.js +0 -5164
- package/dist/chunk-4RARACQK.js +0 -528
- package/dist/chunk-5AROSGQB.js +0 -5034
- package/dist/chunk-7CGKH3QQ.js +0 -528
- package/dist/chunk-7F5CQRS2.js +0 -567
- package/dist/chunk-7OEXJIWW.js +0 -565
- package/dist/chunk-A22SEYVL.js +0 -530
- package/dist/chunk-AH5MG2WF.js +0 -5040
- package/dist/chunk-BDSSH6MN.js +0 -574
- package/dist/chunk-BFIQVABZ.js +0 -528
- package/dist/chunk-BJTO4CRW.js +0 -558
- package/dist/chunk-BLMS4KUD.js +0 -5164
- package/dist/chunk-BTNVA4NZ.js +0 -568
- package/dist/chunk-BVCWT7AV.js +0 -79
- package/dist/chunk-C73WZRUL.js +0 -544
- package/dist/chunk-CNQTNX3M.js +0 -567
- package/dist/chunk-CUVSWUIQ.js +0 -5040
- package/dist/chunk-DP2ZMQG5.js +0 -4881
- package/dist/chunk-EMBJNPTB.js +0 -5040
- package/dist/chunk-EO2UMCWY.js +0 -574
- package/dist/chunk-FTB465WY.js +0 -575
- package/dist/chunk-G6A4EVAL.js +0 -528
- package/dist/chunk-GDARBI5R.js +0 -5185
- package/dist/chunk-HHJDDPFR.js +0 -4886
- package/dist/chunk-HY2SRD5L.js +0 -5003
- package/dist/chunk-ISQ3LQRI.js +0 -565
- package/dist/chunk-KKX3CXHP.js +0 -558
- package/dist/chunk-LCK4AEWB.js +0 -79
- package/dist/chunk-LJVJ4SYE.js +0 -568
- package/dist/chunk-LYMA4XGG.js +0 -5181
- package/dist/chunk-MH76527N.js +0 -4892
- package/dist/chunk-MLAU3LFL.js +0 -527
- package/dist/chunk-MQREZR54.js +0 -5164
- package/dist/chunk-N4A4BVKV.js +0 -5163
- package/dist/chunk-QVEV57JA.js +0 -5185
- package/dist/chunk-SI7CWAHC.js +0 -574
- package/dist/chunk-SK6U2JDX.js +0 -566
- package/dist/chunk-SPR77CVW.js +0 -529
- package/dist/chunk-SQBB5K5J.js +0 -574
- package/dist/chunk-TQ2IQDSM.js +0 -568
- package/dist/chunk-TTT6PM27.js +0 -558
- package/dist/chunk-VFMKDLXO.js +0 -570
- package/dist/chunk-VKPQOGVS.js +0 -565
- package/dist/chunk-VLLI4AYA.js +0 -520
- package/dist/chunk-VNFLJ5FV.js +0 -530
- package/dist/chunk-WNCDQJEM.js +0 -5034
- package/dist/chunk-XYZVRJF3.js +0 -5162
- package/dist/chunk-YJCJB4OT.js +0 -79
- package/dist/chunk-YJMQ4PGM.js +0 -559
- package/dist/chunk-Z6PXGHNC.js +0 -570
- package/dist/chunk-ZQ32XEVW.js +0 -79
- package/dist/chunk-ZXXDLGW7.js +0 -513
- package/dist/index-9KKchLwe.d.cts +0 -14
- package/dist/index-B8ovDTs5.d.cts +0 -14
- package/dist/index-BFKgtuVI.d.ts +0 -14
- package/dist/index-DeivEdv0.d.ts +0 -14
- package/dist/index-Zz-6wNSh.d.ts +0 -106
- package/dist/index-fgr_c5Wj.d.ts +0 -106
- package/dist/zod-6gU8y6oS.d.cts +0 -6712
- package/dist/zod-B4sIVoVX.d.ts +0 -6712
- package/dist/zod-BI81QHVK.d.ts +0 -6715
- package/dist/zod-BRmUARvM.d.cts +0 -5879
- package/dist/zod-BUCQsGOm.d.ts +0 -6712
- package/dist/zod-BdDmL7rg.d.ts +0 -6718
- package/dist/zod-Bl_5j5Nx.d.ts +0 -6712
- package/dist/zod-Bxu34bbp.d.ts +0 -6718
- package/dist/zod-C4kEHhO8.d.cts +0 -6718
- package/dist/zod-C5pRCHei.d.ts +0 -6712
- package/dist/zod-CFNzalN6.d.ts +0 -5879
- package/dist/zod-CIacR1Kf.d.cts +0 -6712
- package/dist/zod-DBbdP-KT.d.cts +0 -6718
- package/dist/zod-DyBGOUbG.d.ts +0 -5876
- package/dist/zod-DzhoVlw_.d.cts +0 -6712
- package/dist/zod-FdtLO2-F.d.cts +0 -6715
- package/dist/zod-NE2xXWlK.d.ts +0 -3416
- package/dist/zod-VuA-QJOT.d.ts +0 -5915
- package/dist/zod-jDi_gO0s.d.cts +0 -5915
- package/dist/zod-lSiFMzqK.d.cts +0 -6712
- package/dist/zod-rs54beS2.d.cts +0 -5876
- package/dist/zod-zxqlYYMG.d.ts +0 -3416
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { A as AsstClient, S as SpsItemIdResponse } from './
|
|
2
|
-
export { a as AsstClientOptions, b as AsstUrl, B as BASE_URLS,
|
|
3
|
-
import { I as Import, a as ImportsStatus, V as VendorPartnerAttGroups, G as GenerateImportTemplateParams, E as Export, D as DownLoadItemsParams, A as AttrProdType, T as TradingPartnerAccessByCompanyId, C as CompanyRelationshipUpsertBody, b as ItemPartner, c as ItemCategoriesSearch,
|
|
4
|
-
export { M as AttributeDetail, a1 as Bulb, N as CategoryEnum, O as ComponentDetails, r as Connection, o as ExportDayOfWeek, p as ExportFrequency, q as ExportType, Q as GroupedAttributeList, W as GroupedAttributes, X as GroupedItem, Y as HierarchyCategory, Z as HierarchyDetails, w as IdentityServiceDatetimePreferences, x as IdentityServiceOrganization, v as IdentityServiceOrganizationMetadata, y as IdentityServicePreferences, z as IdentityServiceUser, k as ImportDetails, l as ImportError, m as ImportErrors, n as ImportStatusEnum, t as ItemCategory, a5 as ItemErrorDetails, a7 as ItemErrorDetailsV2, a6 as ItemErrorSummaryV2, B as ItemHeader, F as ItemMap, _ as ItemPrice, H as ItemTable, a0 as MediaItem, P as PRODUCT_CODE_DEFAULT_VALUE, a2 as PackComponent, $ as PackComponentDetails, a4 as PackComponentItemInfo, J as PhaseEnum, R as RegisteredService, a3 as RepeatableGroup, s as SELECTION_CODE_DEFAULT_VALUE, u as SpreadsheetTemplateCompany, K as TradingPartnerStage, a8 as TradingPartnerStageV2 } from './zod-
|
|
1
|
+
import { A as AsstClient, I as ItemHierarchyResponse, S as SpsItemIdResponse } from './SpsItemIdResponse-s0vCXepG.js';
|
|
2
|
+
export { a as AsstClientOptions, b as AsstUrl, B as BASE_URLS, E as Env, e as envSchema } from './SpsItemIdResponse-s0vCXepG.js';
|
|
3
|
+
import { I as Import, a as ImportsStatus, V as VendorPartnerAttGroups, G as GenerateImportTemplateParams, E as Export, D as DownLoadItemsParams, A as AttrProdType, T as TradingPartnerAccessByCompanyId, C as CompanyRelationshipUpsertBody, b as ItemPartner, c as ItemCategoriesSearch, L as Locale, S as SpreadsheetTemplate, U as UserAccount, d as ItemSearchView, e as ItemDetailView, f as ItemDetail, g as ItemErrorDetailsResult, h as ItemErrorSummaryResultV2, i as ItemErrorDetailsResultV2, j as CompanyBriefByOrg } from './zod-j6CrX5vY.js';
|
|
4
|
+
export { M as AttributeDetail, a1 as Bulb, N as CategoryEnum, O as ComponentDetails, r as Connection, o as ExportDayOfWeek, p as ExportFrequency, q as ExportType, Q as GroupedAttributeList, W as GroupedAttributes, X as GroupedItem, Y as HierarchyCategory, Z as HierarchyDetails, w as IdentityServiceDatetimePreferences, x as IdentityServiceOrganization, v as IdentityServiceOrganizationMetadata, y as IdentityServicePreferences, z as IdentityServiceUser, k as ImportDetails, l as ImportError, m as ImportErrors, n as ImportStatusEnum, t as ItemCategory, a5 as ItemErrorDetails, a7 as ItemErrorDetailsV2, a6 as ItemErrorSummaryV2, B as ItemHeader, F as ItemMap, _ as ItemPrice, H as ItemTable, a0 as MediaItem, P as PRODUCT_CODE_DEFAULT_VALUE, a2 as PackComponent, $ as PackComponentDetails, a4 as PackComponentItemInfo, J as PhaseEnum, R as RegisteredService, a3 as RepeatableGroup, s as SELECTION_CODE_DEFAULT_VALUE, u as SpreadsheetTemplateCompany, K as TradingPartnerStage, a8 as TradingPartnerStageV2 } from './zod-j6CrX5vY.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
export { c as createCompaniesApi } from './index-DeivEdv0.js';
|
|
7
6
|
import 'ky';
|
|
8
7
|
|
|
8
|
+
declare const companyTypeSchema: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
9
|
+
type CompanyType = z.infer<typeof companyTypeSchema>;
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* Initialize Imports Api functions
|
|
11
13
|
* @param client Assortment Client instance
|
|
12
14
|
* @returns An object containing Imports API functions
|
|
13
15
|
*/
|
|
14
|
-
declare function createImportsApi(client: AsstClient): {
|
|
16
|
+
declare function createImportsApi(client: AsstClient, companyType?: CompanyType): {
|
|
15
17
|
getImportErrors: (importId: string, params?: {
|
|
16
18
|
offset?: number;
|
|
17
19
|
limit?: number;
|
|
@@ -39,9 +41,10 @@ declare function createImportsApi(client: AsstClient): {
|
|
|
39
41
|
/**
|
|
40
42
|
* Initialize Exports Api functions
|
|
41
43
|
* @param client Assortment Client instance
|
|
44
|
+
* @param companyType Company type for perspective
|
|
42
45
|
* @returns An object containing Exports API functions
|
|
43
46
|
*/
|
|
44
|
-
declare function createExportsApi(client: AsstClient): {
|
|
47
|
+
declare function createExportsApi(client: AsstClient, companyType?: CompanyType): {
|
|
45
48
|
createExport: (data: Export, params?: {
|
|
46
49
|
orgId?: string;
|
|
47
50
|
}) => Promise<void>;
|
|
@@ -78,12 +81,100 @@ type RetailerTradingPartnerStages = z.infer<typeof retailerTradingPartnerStages>
|
|
|
78
81
|
/**
|
|
79
82
|
* Initialize Trading Partner Settings Api functions
|
|
80
83
|
* @param client Assortment Client instance
|
|
84
|
+
* @param companyType Company type for perspective
|
|
81
85
|
* @returns An object containing Trading Partner Settings API functions
|
|
82
86
|
*/
|
|
83
|
-
declare function createTradingPartnerSettingsApi(client: AsstClient): {
|
|
87
|
+
declare function createTradingPartnerSettingsApi(client: AsstClient, companyType?: CompanyType): {
|
|
84
88
|
getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
|
|
85
89
|
};
|
|
86
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Request payload for creating a new catalog
|
|
93
|
+
*/
|
|
94
|
+
declare const catalogCreateRequestSchema: z.ZodObject<{
|
|
95
|
+
categoryName: z.ZodString;
|
|
96
|
+
categoryCompanyId: z.ZodNumber;
|
|
97
|
+
categoryTypeId: z.ZodNumber;
|
|
98
|
+
categoryDescription: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
categoryName: string;
|
|
101
|
+
categoryCompanyId: number;
|
|
102
|
+
categoryTypeId: number;
|
|
103
|
+
categoryDescription?: string | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
categoryName: string;
|
|
106
|
+
categoryCompanyId: number;
|
|
107
|
+
categoryTypeId: number;
|
|
108
|
+
categoryDescription?: string | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
type CatalogCreateRequest = z.infer<typeof catalogCreateRequestSchema>;
|
|
111
|
+
/**
|
|
112
|
+
* Response from creating a new catalog
|
|
113
|
+
*/
|
|
114
|
+
declare const catalogCreateResponseSchema: z.ZodObject<{
|
|
115
|
+
categoryId: z.ZodNumber;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
categoryId: number;
|
|
118
|
+
}, {
|
|
119
|
+
categoryId: number;
|
|
120
|
+
}>;
|
|
121
|
+
type CatalogCreateResponse = z.infer<typeof catalogCreateResponseSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* Parameters for searching catalogs by company
|
|
124
|
+
*/
|
|
125
|
+
declare const catalogSearchParamsSchema: z.ZodObject<{
|
|
126
|
+
ownerCompanyIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
127
|
+
searchTerms: z.ZodOptional<z.ZodString>;
|
|
128
|
+
categoryType: z.ZodLiteral<"CATALOG">;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
categoryType: "CATALOG";
|
|
131
|
+
ownerCompanyIds?: number[] | undefined;
|
|
132
|
+
searchTerms?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
categoryType: "CATALOG";
|
|
135
|
+
ownerCompanyIds?: number[] | undefined;
|
|
136
|
+
searchTerms?: string | undefined;
|
|
137
|
+
}>;
|
|
138
|
+
type CatalogSearchParams = z.infer<typeof catalogSearchParamsSchema>;
|
|
139
|
+
/**
|
|
140
|
+
* Brief catalog information returned from search
|
|
141
|
+
*/
|
|
142
|
+
declare const catalogBriefResponseSchema: z.ZodObject<{
|
|
143
|
+
categoryId: z.ZodNumber;
|
|
144
|
+
categoryName: z.ZodString;
|
|
145
|
+
categoryDescription: z.ZodString;
|
|
146
|
+
categoryDescriptionExt: z.ZodString;
|
|
147
|
+
ownerCompanyId: z.ZodString;
|
|
148
|
+
categoryTypeId: z.ZodNumber;
|
|
149
|
+
createdAt: z.ZodString;
|
|
150
|
+
modifiedAt: z.ZodString;
|
|
151
|
+
createdBy: z.ZodString;
|
|
152
|
+
modifiedBy: z.ZodString;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
createdBy: string;
|
|
155
|
+
modifiedBy: string;
|
|
156
|
+
categoryName: string;
|
|
157
|
+
categoryTypeId: number;
|
|
158
|
+
categoryDescription: string;
|
|
159
|
+
categoryId: number;
|
|
160
|
+
categoryDescriptionExt: string;
|
|
161
|
+
ownerCompanyId: string;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
modifiedAt: string;
|
|
164
|
+
}, {
|
|
165
|
+
createdBy: string;
|
|
166
|
+
modifiedBy: string;
|
|
167
|
+
categoryName: string;
|
|
168
|
+
categoryTypeId: number;
|
|
169
|
+
categoryDescription: string;
|
|
170
|
+
categoryId: number;
|
|
171
|
+
categoryDescriptionExt: string;
|
|
172
|
+
ownerCompanyId: string;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
modifiedAt: string;
|
|
175
|
+
}>;
|
|
176
|
+
type CatalogBriefResponse = z.infer<typeof catalogBriefResponseSchema>;
|
|
177
|
+
|
|
87
178
|
type CategoriesApi = {
|
|
88
179
|
getCatalogs: (params?: {
|
|
89
180
|
categoryName?: string;
|
|
@@ -101,6 +192,11 @@ type CategoriesApi = {
|
|
|
101
192
|
orgId?: string;
|
|
102
193
|
}, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
|
|
103
194
|
getItemHierarchy: (itemIds: string[]) => Promise<ItemHierarchyResponse>;
|
|
195
|
+
createCatalog: (params: CatalogCreateRequest, signal?: AbortSignal) => Promise<CatalogCreateResponse>;
|
|
196
|
+
searchCatalogsByCompany: (params: CatalogSearchParams, signal?: AbortSignal) => Promise<CatalogBriefResponse[]>;
|
|
197
|
+
createCategoryHierarchy: (params?: {
|
|
198
|
+
orgId?: string;
|
|
199
|
+
}) => Promise<string[]>;
|
|
104
200
|
};
|
|
105
201
|
/**
|
|
106
202
|
* Initialize Categories Api functions
|
|
@@ -138,14 +234,16 @@ declare function createWhoAmIApi(client: AsstClient): {
|
|
|
138
234
|
whoAmI: (signal?: AbortSignal) => Promise<UserAccount>;
|
|
139
235
|
};
|
|
140
236
|
|
|
141
|
-
|
|
237
|
+
declare const applicationTypeSchema: z.ZodEnum<["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"]>;
|
|
238
|
+
type ApplicationType = z.infer<typeof applicationTypeSchema>;
|
|
142
239
|
|
|
143
240
|
/**
|
|
144
241
|
* Initialize Company Features Api functions
|
|
145
242
|
* @param client Assortment Client instance
|
|
243
|
+
* @param companyType Company type for perspective on hybrid organisations
|
|
146
244
|
* @returns An object containing Company Features API functions
|
|
147
245
|
*/
|
|
148
|
-
declare function createCompanyFeaturesApi(client: AsstClient): {
|
|
246
|
+
declare function createCompanyFeaturesApi(client: AsstClient, companyType?: CompanyType): {
|
|
149
247
|
checkIfStageItemSetupIsEnabled: (signal?: AbortSignal) => Promise<boolean>;
|
|
150
248
|
};
|
|
151
249
|
|
|
@@ -162,6 +260,7 @@ declare function createFeatureFlagsApi(client: AsstClient): {
|
|
|
162
260
|
checkEnableItemsLevelMSIS: (signal?: AbortSignal) => Promise<boolean>;
|
|
163
261
|
checkIfEnabledForPackagingHierarchies: (signal?: AbortSignal) => Promise<boolean>;
|
|
164
262
|
checkIfEnabledForItemUomConversionRules: (flagOptions?: FlagOptions) => Promise<boolean>;
|
|
263
|
+
checkIfItemMatchEnabled: (flagOptions?: FlagOptions) => Promise<boolean>;
|
|
165
264
|
};
|
|
166
265
|
|
|
167
266
|
declare const itemStatusResponseSchema: z.ZodObject<{
|
|
@@ -365,9 +464,10 @@ type ItemsApi = {
|
|
|
365
464
|
/**
|
|
366
465
|
* Initialize Items Api functions
|
|
367
466
|
* @param client Assortment Client instance
|
|
467
|
+
* @param companyType Optional company type eg "RETAILER" | "SUPPLIER"
|
|
368
468
|
* @returns An object containing Items API functions
|
|
369
469
|
*/
|
|
370
|
-
declare function createItemsApi(client: AsstClient): ItemsApi;
|
|
470
|
+
declare function createItemsApi(client: AsstClient, companyType?: CompanyType): ItemsApi;
|
|
371
471
|
|
|
372
472
|
declare const itemOrgStageDetailsSchema: z.ZodObject<{
|
|
373
473
|
/**
|
|
@@ -665,18 +765,20 @@ type Stage = z.infer<typeof stageSchema>;
|
|
|
665
765
|
/**
|
|
666
766
|
* Initialize Items Api functions
|
|
667
767
|
* @param client Assortment Client instance
|
|
768
|
+
* @param companyType Company type for perspective
|
|
668
769
|
* @returns An object containing Items API functions
|
|
669
770
|
*/
|
|
670
|
-
declare function createItemsApiV2(client: AsstClient): {
|
|
771
|
+
declare function createItemsApiV2(client: AsstClient, companyType?: CompanyType): {
|
|
671
772
|
getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
|
|
672
773
|
};
|
|
673
774
|
|
|
674
775
|
/**
|
|
675
776
|
* Initialize Errors Api functions
|
|
676
777
|
* @param client Assortment Client instance
|
|
778
|
+
* @param companyType Company type for perspective
|
|
677
779
|
* @returns An object containing Errors API functions
|
|
678
780
|
*/
|
|
679
|
-
declare function createErrorsApi(client: AsstClient): {
|
|
781
|
+
declare function createErrorsApi(client: AsstClient, companyType?: CompanyType): {
|
|
680
782
|
getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
|
|
681
783
|
};
|
|
682
784
|
|
|
@@ -692,9 +794,10 @@ type GetItemErrorSummaryParams = {
|
|
|
692
794
|
/**
|
|
693
795
|
* Initialize Errors Api functions
|
|
694
796
|
* @param client Assortment Client instance
|
|
797
|
+
* @param companyType Company type for perspective
|
|
695
798
|
* @returns An object containing Errors API functions
|
|
696
799
|
*/
|
|
697
|
-
declare function createErrorsApiV2(client: AsstClient): {
|
|
800
|
+
declare function createErrorsApiV2(client: AsstClient, companyType?: CompanyType): {
|
|
698
801
|
getItemErrorSummary: (params: GetItemErrorSummaryParams, signal?: AbortSignal) => Promise<ItemErrorSummaryResultV2>;
|
|
699
802
|
getItemErrorDetails: (itemInfoId: number, signal?: AbortSignal) => Promise<ItemErrorDetailsResultV2>;
|
|
700
803
|
};
|
|
@@ -702,12 +805,25 @@ declare function createErrorsApiV2(client: AsstClient): {
|
|
|
702
805
|
declare const FlattenedItemIdentifierKeys: readonly ["eaneight", "upc", "ean", "gtin", "upcCaseCode", "buyerPartNumber", "partnumber", "isbn", "sku", "nationalDrugCode", "drugIdentificationNumber", "nationalHealthRelatedItemCode", "manufacturersPartNumber", "internationalStandardSerialNumber", "nabcaNumber", "erpId", "componentId"];
|
|
703
806
|
type FlattenedItemIdentifiers = (typeof FlattenedItemIdentifierKeys)[number];
|
|
704
807
|
|
|
808
|
+
declare const uniqueCriteriaOptionsSchema: z.ZodArray<z.ZodObject<{
|
|
809
|
+
name: z.ZodString;
|
|
810
|
+
value: z.ZodString;
|
|
811
|
+
}, "strip", z.ZodTypeAny, {
|
|
812
|
+
value: string;
|
|
813
|
+
name: string;
|
|
814
|
+
}, {
|
|
815
|
+
value: string;
|
|
816
|
+
name: string;
|
|
817
|
+
}>, "many">;
|
|
818
|
+
type UniqueCriteriaOptions = z.infer<typeof uniqueCriteriaOptionsSchema>;
|
|
819
|
+
|
|
705
820
|
/**
|
|
706
821
|
* Initialize UniqueCriteria Api functions
|
|
707
822
|
* @param client Assortment Client instance
|
|
708
823
|
* @returns An object containing UniqueCriteria API functions
|
|
709
824
|
*/
|
|
710
825
|
declare function createUniqueCriteriaApi(client: AsstClient): {
|
|
826
|
+
getUniqueCriteriaOptions: () => Promise<UniqueCriteriaOptions>;
|
|
711
827
|
getUniqueCriteriaByOrg: (params?: {
|
|
712
828
|
orgId?: string;
|
|
713
829
|
}, signal?: AbortSignal) => Promise<string[]>;
|
|
@@ -716,4 +832,15 @@ declare function createUniqueCriteriaApi(client: AsstClient): {
|
|
|
716
832
|
}, signal?: AbortSignal) => Promise<FlattenedItemIdentifiers[]>;
|
|
717
833
|
};
|
|
718
834
|
|
|
719
|
-
|
|
835
|
+
/**
|
|
836
|
+
* Initialize Companies Api functions
|
|
837
|
+
* @param client Assortment Client instance
|
|
838
|
+
* @returns A CompanyBriefByOrg object containing Companies API functions
|
|
839
|
+
*/
|
|
840
|
+
declare function createCompaniesApi(client: AsstClient): {
|
|
841
|
+
getCompanyBriefInfoByOrg: (params?: {
|
|
842
|
+
orgId?: string;
|
|
843
|
+
}, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
export { type ApplicationType, AsstClient, AttrProdType, type CategoriesApi, CompanyBriefByOrg, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, type FlagOptions, type FlattenedItemIdentifiers, GenerateImportTemplateParams, type GetItemErrorSummaryParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemErrorDetailsResultV2, ItemErrorSummaryResultV2, ItemHierarchyResponse, type ItemOrgStageDetails, type ItemOrgStatus, ItemPartner, ItemSearchView, type ItemStatus, type ItemStatusResponse, type ItemStatusV2, type ItemStatusV2Response, type ItemsApi, Locale, type OrgSummary, type RetailerTradingPartnerStages, SpreadsheetTemplate, SpsItemIdResponse, type Stage, TradingPartnerAccessByCompanyId, type UniqueCriteriaOptions, UserAccount, VendorPartnerAttGroups, createCategoriesApi, createCompaniesApi, createCompanyFeaturesApi, createErrorsApi, createErrorsApiV2, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createItemsApiV2, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createFeatureFlagsApi,
|
|
9
9
|
createImportsApi,
|
|
10
10
|
createItemsApi,
|
|
11
|
+
createItemsApiV2,
|
|
11
12
|
createLocaleApi,
|
|
12
13
|
createProductTypesApi,
|
|
13
14
|
createSpreadsheetTemplateApi,
|
|
@@ -15,29 +16,16 @@ import {
|
|
|
15
16
|
createTradingPartnerSettingsApi,
|
|
16
17
|
createUniqueCriteriaApi,
|
|
17
18
|
createWhoAmIApi
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-V2XRXJIJ.js";
|
|
19
20
|
import {
|
|
20
21
|
AsstClient,
|
|
21
22
|
BASE_URLS,
|
|
22
23
|
envSchema
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WODMKML4.js";
|
|
24
25
|
import {
|
|
25
26
|
PRODUCT_CODE_DEFAULT_VALUE,
|
|
26
|
-
SELECTION_CODE_DEFAULT_VALUE
|
|
27
|
-
|
|
28
|
-
} from "./chunk-L4AWOEED.js";
|
|
29
|
-
|
|
30
|
-
// lib/items/v2/index.ts
|
|
31
|
-
var BASE_URL = "v2/items";
|
|
32
|
-
function createItemsApiV2(client) {
|
|
33
|
-
async function getItemStatus(itemIds) {
|
|
34
|
-
const data = await client.post(`${BASE_URL}/status`, { json: { itemIds } }).json();
|
|
35
|
-
return itemStatusV2ResponseSchema.parse(data);
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
getItemStatus
|
|
39
|
-
};
|
|
40
|
-
}
|
|
27
|
+
SELECTION_CODE_DEFAULT_VALUE
|
|
28
|
+
} from "./chunk-YT2B4UAK.js";
|
|
41
29
|
export {
|
|
42
30
|
AsstClient,
|
|
43
31
|
BASE_URLS,
|
package/dist/msw.cjs
CHANGED
|
@@ -21,7 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var msw_exports = {};
|
|
22
22
|
__export(msw_exports, {
|
|
23
23
|
createCategoriesApiHandlers: () => createCategoriesApiHandlers,
|
|
24
|
-
|
|
24
|
+
createCompaniesApiHandlers: () => createCompaniesApiHandlers,
|
|
25
25
|
createCompanyFeaturesApiHandlers: () => createCompanyFeaturesApiHandlers,
|
|
26
26
|
createErrorsApiHandlers: () => createErrorsApiHandlers,
|
|
27
27
|
createErrorsApiV2Handlers: () => createErrorsApiV2Handlers,
|
|
@@ -29,6 +29,7 @@ __export(msw_exports, {
|
|
|
29
29
|
createFeatureFlagsApiHandlers: () => createFeatureFlagsApiHandlers,
|
|
30
30
|
createImportsApiHandlers: () => createImportsApiHandlers,
|
|
31
31
|
createItemsApiHandlers: () => createItemsApiHandlers,
|
|
32
|
+
createItemsApiV2Handlers: () => createItemsApiV2Handlers,
|
|
32
33
|
createLocaleApiHandlers: () => createLocaleApiHandlers,
|
|
33
34
|
createProductTypesApiHandlers: () => createProductTypesApiHandlers,
|
|
34
35
|
createSpreadsheetTemplateApiHandlers: () => createSpreadsheetTemplateApiHandlers,
|
|
@@ -4147,13 +4148,17 @@ var vendorPartnerAttGroupsSchema = external_exports.object({
|
|
|
4147
4148
|
partnerAttributeGroups: external_exports.array(external_exports.number())
|
|
4148
4149
|
});
|
|
4149
4150
|
|
|
4151
|
+
// lib/_common/ApplicationType.ts
|
|
4152
|
+
var applicationTypeSchema = external_exports.enum(["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"]);
|
|
4153
|
+
|
|
4150
4154
|
// lib/imports/models/GenerateImportTemplateParams.ts
|
|
4151
4155
|
var generateImportTemplateParamsSchema = external_exports.object({
|
|
4152
4156
|
"multi-sheet": external_exports.boolean(),
|
|
4157
|
+
callingApplicationType: applicationTypeSchema.optional(),
|
|
4153
4158
|
gids: external_exports.string().optional(),
|
|
4154
|
-
productTypeIds: external_exports.string().optional(),
|
|
4155
4159
|
groupTypeId: external_exports.number().optional(),
|
|
4156
|
-
includeGuides: external_exports.boolean().optional()
|
|
4160
|
+
includeGuides: external_exports.boolean().optional(),
|
|
4161
|
+
productTypeIds: external_exports.string().optional()
|
|
4157
4162
|
});
|
|
4158
4163
|
|
|
4159
4164
|
// lib/imports/index.ts
|
|
@@ -4264,6 +4269,34 @@ var itemHierarchyResponseSchema = external_exports.object({
|
|
|
4264
4269
|
)
|
|
4265
4270
|
});
|
|
4266
4271
|
|
|
4272
|
+
// lib/categories/models/CatalogManagement.ts
|
|
4273
|
+
var catalogCreateRequestSchema = external_exports.object({
|
|
4274
|
+
categoryName: external_exports.string(),
|
|
4275
|
+
categoryCompanyId: external_exports.number(),
|
|
4276
|
+
categoryTypeId: external_exports.number(),
|
|
4277
|
+
categoryDescription: external_exports.string().optional()
|
|
4278
|
+
});
|
|
4279
|
+
var catalogCreateResponseSchema = external_exports.object({
|
|
4280
|
+
categoryId: external_exports.number()
|
|
4281
|
+
});
|
|
4282
|
+
var catalogSearchParamsSchema = external_exports.object({
|
|
4283
|
+
ownerCompanyIds: external_exports.array(external_exports.number()).optional(),
|
|
4284
|
+
searchTerms: external_exports.string().optional(),
|
|
4285
|
+
categoryType: external_exports.literal("CATALOG")
|
|
4286
|
+
});
|
|
4287
|
+
var catalogBriefResponseSchema = external_exports.object({
|
|
4288
|
+
categoryId: external_exports.number(),
|
|
4289
|
+
categoryName: external_exports.string(),
|
|
4290
|
+
categoryDescription: external_exports.string(),
|
|
4291
|
+
categoryDescriptionExt: external_exports.string(),
|
|
4292
|
+
ownerCompanyId: external_exports.string(),
|
|
4293
|
+
categoryTypeId: external_exports.number(),
|
|
4294
|
+
createdAt: external_exports.string(),
|
|
4295
|
+
modifiedAt: external_exports.string(),
|
|
4296
|
+
createdBy: external_exports.string(),
|
|
4297
|
+
modifiedBy: external_exports.string()
|
|
4298
|
+
});
|
|
4299
|
+
|
|
4267
4300
|
// lib/categories/index.ts
|
|
4268
4301
|
var BASE_URL2 = "categories";
|
|
4269
4302
|
|
|
@@ -4299,8 +4332,41 @@ function createCategoriesApiHandlers(client) {
|
|
|
4299
4332
|
);
|
|
4300
4333
|
}
|
|
4301
4334
|
getCategory.generateData = () => (0, import_zod_mock2.generateMock)(itemCategoriesSearchSchema);
|
|
4335
|
+
function getItemHierarchy(resolver = (_info) => {
|
|
4336
|
+
const data = (0, import_zod_mock2.generateMock)(itemHierarchyResponseSchema);
|
|
4337
|
+
return import_msw2.HttpResponse.json(data);
|
|
4338
|
+
}) {
|
|
4339
|
+
return import_msw2.http.post(
|
|
4340
|
+
`${client.getBaseUrl()}${BASE_URL2}/item-hierarchy`,
|
|
4341
|
+
resolver
|
|
4342
|
+
);
|
|
4343
|
+
}
|
|
4344
|
+
getItemHierarchy.generateData = () => (0, import_zod_mock2.generateMock)(itemHierarchyResponseSchema);
|
|
4345
|
+
function createCatalog(resolver = (_info) => {
|
|
4346
|
+
const data = (0, import_zod_mock2.generateMock)(catalogCreateResponseSchema);
|
|
4347
|
+
return import_msw2.HttpResponse.json(data);
|
|
4348
|
+
}) {
|
|
4349
|
+
return import_msw2.http.post(`${client.getBaseUrl()}category`, resolver);
|
|
4350
|
+
}
|
|
4351
|
+
createCatalog.generateData = () => (0, import_zod_mock2.generateMock)(catalogCreateResponseSchema);
|
|
4352
|
+
function searchCatalogsByCompany(resolver = (_info) => {
|
|
4353
|
+
const data = Array.from(
|
|
4354
|
+
{ length: 3 },
|
|
4355
|
+
() => (0, import_zod_mock2.generateMock)(catalogBriefResponseSchema)
|
|
4356
|
+
);
|
|
4357
|
+
return import_msw2.HttpResponse.json(data);
|
|
4358
|
+
}) {
|
|
4359
|
+
return import_msw2.http.get(
|
|
4360
|
+
`${client.getBaseUrl()}category/brief/CATALOG/search`,
|
|
4361
|
+
resolver
|
|
4362
|
+
);
|
|
4363
|
+
}
|
|
4364
|
+
searchCatalogsByCompany.generateData = () => Array.from({ length: 3 }, () => (0, import_zod_mock2.generateMock)(catalogBriefResponseSchema));
|
|
4302
4365
|
return {
|
|
4303
|
-
getCategory
|
|
4366
|
+
getCategory,
|
|
4367
|
+
getItemHierarchy,
|
|
4368
|
+
createCatalog,
|
|
4369
|
+
searchCatalogsByCompany
|
|
4304
4370
|
};
|
|
4305
4371
|
}
|
|
4306
4372
|
|
|
@@ -4394,7 +4460,7 @@ var companyRelationshipUpsertBodySchema = external_exports.object({
|
|
|
4394
4460
|
retailerId: external_exports.number(),
|
|
4395
4461
|
catalogId: external_exports.number(),
|
|
4396
4462
|
active: external_exports.boolean(),
|
|
4397
|
-
applicationType: external_exports.array(
|
|
4463
|
+
applicationType: external_exports.array(applicationTypeSchema).default([])
|
|
4398
4464
|
});
|
|
4399
4465
|
|
|
4400
4466
|
// lib/tradingPartners/models/ItemPartner.ts
|
|
@@ -4406,7 +4472,7 @@ var itemPartnerSchema = external_exports.object({
|
|
|
4406
4472
|
isActive: external_exports.number(),
|
|
4407
4473
|
createdDate: external_exports.string(),
|
|
4408
4474
|
modifiedDate: external_exports.string(),
|
|
4409
|
-
applications: external_exports.array(
|
|
4475
|
+
applications: external_exports.array(applicationTypeSchema)
|
|
4410
4476
|
});
|
|
4411
4477
|
|
|
4412
4478
|
// lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
|
|
@@ -5328,10 +5394,10 @@ function createFeatureFlagsApiHandlers(client) {
|
|
|
5328
5394
|
const data = (0, import_zod_mock13.generateMock)(external_exports.boolean());
|
|
5329
5395
|
return import_msw14.HttpResponse.json(data);
|
|
5330
5396
|
}) {
|
|
5331
|
-
const baseUrl = `${client.getBaseUrl()}${BASE_URL14}/enable-items-api-uom-conversion-rules
|
|
5397
|
+
const baseUrl = `${client.getBaseUrl()}${BASE_URL14}/enable-items-api-uom-conversion-rules`;
|
|
5332
5398
|
return [
|
|
5333
|
-
import_msw14.http.get(`${baseUrl}
|
|
5334
|
-
import_msw14.http.get(`${baseUrl}/:companyId
|
|
5399
|
+
import_msw14.http.get(`${baseUrl}/`, resolver),
|
|
5400
|
+
import_msw14.http.get(`${baseUrl}/:companyId/`, resolver)
|
|
5335
5401
|
// Handles requests with companyId
|
|
5336
5402
|
];
|
|
5337
5403
|
}
|
|
@@ -5376,11 +5442,27 @@ var FlattenedItemIdentifierKeysSchema = external_exports.enum(
|
|
|
5376
5442
|
FlattenedItemIdentifierKeys
|
|
5377
5443
|
);
|
|
5378
5444
|
|
|
5445
|
+
// lib/uniqueCriteria/models/UniqueCriteriaOptionsSchema.ts
|
|
5446
|
+
var uniqueCriteriaOptions = external_exports.object({
|
|
5447
|
+
name: external_exports.string(),
|
|
5448
|
+
value: external_exports.string()
|
|
5449
|
+
});
|
|
5450
|
+
var uniqueCriteriaOptionsSchema = external_exports.array(uniqueCriteriaOptions);
|
|
5451
|
+
|
|
5379
5452
|
// lib/uniqueCriteria/index.ts
|
|
5380
5453
|
var BASE_URL15 = "uniquecriteria";
|
|
5381
5454
|
|
|
5382
5455
|
// lib/uniqueCriteria/mockHandlers.ts
|
|
5383
5456
|
function createUniqueCriteriaApiHandlers(client) {
|
|
5457
|
+
function getUniqueCriteriaOptions(resolver = (_info) => {
|
|
5458
|
+
const data = (0, import_zod_mock14.generateMock)(
|
|
5459
|
+
external_exports.array(external_exports.object({ name: external_exports.string(), value: external_exports.string() }))
|
|
5460
|
+
);
|
|
5461
|
+
return import_msw15.HttpResponse.json(data);
|
|
5462
|
+
}) {
|
|
5463
|
+
return import_msw15.http.get(`${client.getBaseUrl()}${BASE_URL15}`, resolver);
|
|
5464
|
+
}
|
|
5465
|
+
getUniqueCriteriaOptions.generateData = () => (0, import_zod_mock14.generateMock)(external_exports.array(external_exports.object({ name: external_exports.string(), value: external_exports.string() })));
|
|
5384
5466
|
function getUniqueCriteriaByOrg(resolver = (_info) => {
|
|
5385
5467
|
const data = (0, import_zod_mock14.generateMock)(external_exports.array(external_exports.string()));
|
|
5386
5468
|
return import_msw15.HttpResponse.json(data);
|
|
@@ -5401,6 +5483,10 @@ function createUniqueCriteriaApiHandlers(client) {
|
|
|
5401
5483
|
};
|
|
5402
5484
|
}
|
|
5403
5485
|
|
|
5486
|
+
// lib/companies/mockHandlers.ts
|
|
5487
|
+
var import_zod_mock15 = require("@anatine/zod-mock");
|
|
5488
|
+
var import_msw16 = require("msw");
|
|
5489
|
+
|
|
5404
5490
|
// lib/companies/models/CompanyBriefByOrg.ts
|
|
5405
5491
|
var companyBriefByOrgSchema = external_exports.object({
|
|
5406
5492
|
companyId: external_exports.number(),
|
|
@@ -5413,22 +5499,50 @@ var companyBriefByOrgSchema = external_exports.object({
|
|
|
5413
5499
|
dc4Id: external_exports.number()
|
|
5414
5500
|
});
|
|
5415
5501
|
|
|
5502
|
+
// lib/companies/models/CompanyType.ts
|
|
5503
|
+
var companyTypeSchema = external_exports.enum(["SUPPLIER", "RETAILER"]);
|
|
5504
|
+
|
|
5416
5505
|
// lib/companies/index.ts
|
|
5417
5506
|
var BASE_URL16 = "companys";
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5507
|
+
|
|
5508
|
+
// lib/companies/mockHandlers.ts
|
|
5509
|
+
function createCompaniesApiHandlers(client) {
|
|
5510
|
+
function getCompanyBriefInfoByOrg(resolver = (_info) => {
|
|
5511
|
+
const data = (0, import_zod_mock15.generateMock)(companyBriefByOrgSchema);
|
|
5512
|
+
return import_msw16.HttpResponse.json(data);
|
|
5513
|
+
}) {
|
|
5514
|
+
return import_msw16.http.get(`${client.getBaseUrl()}${BASE_URL16}/brief`, resolver);
|
|
5515
|
+
}
|
|
5516
|
+
getCompanyBriefInfoByOrg.generateData = () => (0, import_zod_mock15.generateMock)(companyBriefByOrgSchema);
|
|
5517
|
+
return {
|
|
5518
|
+
getCompanyBriefInfoByOrg
|
|
5519
|
+
};
|
|
5520
|
+
}
|
|
5521
|
+
|
|
5522
|
+
// lib/items/v2/mockHandlers.ts
|
|
5523
|
+
var import_zod_mock16 = require("@anatine/zod-mock");
|
|
5524
|
+
var import_msw17 = require("msw");
|
|
5525
|
+
|
|
5526
|
+
// lib/items/v2/index.ts
|
|
5527
|
+
var BASE_URL17 = "v2/items";
|
|
5528
|
+
|
|
5529
|
+
// lib/items/v2/mockHandlers.ts
|
|
5530
|
+
function createItemsApiV2Handlers(client) {
|
|
5531
|
+
function getItemStatus(resolver = (_info) => {
|
|
5532
|
+
const data = (0, import_zod_mock16.generateMock)(itemStatusV2ResponseSchema);
|
|
5533
|
+
return import_msw17.HttpResponse.json(data);
|
|
5534
|
+
}) {
|
|
5535
|
+
return import_msw17.http.post(`${client.getBaseUrl()}${BASE_URL17}/status`, resolver);
|
|
5536
|
+
}
|
|
5537
|
+
getItemStatus.generateData = () => (0, import_zod_mock16.generateMock)(itemStatusV2ResponseSchema);
|
|
5538
|
+
return {
|
|
5539
|
+
getItemStatus
|
|
5540
|
+
};
|
|
5427
5541
|
}
|
|
5428
5542
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5429
5543
|
0 && (module.exports = {
|
|
5430
5544
|
createCategoriesApiHandlers,
|
|
5431
|
-
|
|
5545
|
+
createCompaniesApiHandlers,
|
|
5432
5546
|
createCompanyFeaturesApiHandlers,
|
|
5433
5547
|
createErrorsApiHandlers,
|
|
5434
5548
|
createErrorsApiV2Handlers,
|
|
@@ -5436,6 +5550,7 @@ function createCompaniesApi(client) {
|
|
|
5436
5550
|
createFeatureFlagsApiHandlers,
|
|
5437
5551
|
createImportsApiHandlers,
|
|
5438
5552
|
createItemsApiHandlers,
|
|
5553
|
+
createItemsApiV2Handlers,
|
|
5439
5554
|
createLocaleApiHandlers,
|
|
5440
5555
|
createProductTypesApiHandlers,
|
|
5441
5556
|
createSpreadsheetTemplateApiHandlers,
|