@spscommerce/asst-api 4.3.0 → 4.5.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.
Files changed (38) hide show
  1. package/dist/{SpsItemIdResponse-CI_Ao86P.d.cts → SpsItemIdResponse-gAHfCzwP.d.cts} +22 -14
  2. package/dist/{SpsItemIdResponse-CI_Ao86P.d.ts → SpsItemIdResponse-gAHfCzwP.d.ts} +22 -14
  3. package/dist/{chunk-LKUGPDIT.js → chunk-BMTYM2N6.js} +33 -4
  4. package/dist/{chunk-CI3ZSIT4.js → chunk-VS3QNXZF.js} +146 -37
  5. package/dist/{chunk-55ECRTUX.js → chunk-WX4LGXJV.js} +1 -1
  6. package/dist/index.cjs +174 -40
  7. package/dist/index.d.cts +141 -14
  8. package/dist/index.d.ts +141 -14
  9. package/dist/index.js +3 -3
  10. package/dist/msw.cjs +85 -7
  11. package/dist/msw.d.cts +43 -12
  12. package/dist/msw.d.ts +43 -12
  13. package/dist/msw.js +50 -4
  14. package/dist/{zod-C41Rts8D.d.cts → zod-C-emh7a3.d.cts} +10 -46
  15. package/dist/{zod-COyz02Lh.d.ts → zod-D3Xe9bw3.d.ts} +10 -46
  16. package/dist/zod.cjs +31 -4
  17. package/dist/zod.d.cts +2 -2
  18. package/dist/zod.d.ts +2 -2
  19. package/dist/zod.js +2 -2
  20. package/package.json +2 -3
  21. package/dist/SpsItemIdResponse-0VgfCmG_.d.cts +0 -84
  22. package/dist/SpsItemIdResponse-0VgfCmG_.d.ts +0 -84
  23. package/dist/SpsItemIdResponse-s0vCXepG.d.cts +0 -74
  24. package/dist/SpsItemIdResponse-s0vCXepG.d.ts +0 -74
  25. package/dist/chunk-355LPVI6.js +0 -126
  26. package/dist/chunk-63KIELUR.js +0 -128
  27. package/dist/chunk-DK2OMRWR.js +0 -134
  28. package/dist/chunk-FCUIJXCD.js +0 -544
  29. package/dist/chunk-L4AWOEED.js +0 -4892
  30. package/dist/chunk-NFZI7D22.js +0 -544
  31. package/dist/chunk-NUUQDRHD.js +0 -4899
  32. package/dist/chunk-RPGGEEFE.js +0 -79
  33. package/dist/zod-C3fOiO-H.d.cts +0 -5900
  34. package/dist/zod-CJ6AFTQr.d.ts +0 -5900
  35. package/dist/zod-CJmsC_DX.d.cts +0 -5900
  36. package/dist/zod-CzPw-bfk.d.cts +0 -5900
  37. package/dist/zod-vDuspd-x.d.ts +0 -5900
  38. package/dist/zod-xWM6u1LJ.d.ts +0 -5900
package/dist/index.d.cts CHANGED
@@ -1,16 +1,19 @@
1
- import { A as AsstClient, I as ItemHierarchyResponse, S as SpsItemIdResponse } from './SpsItemIdResponse-s0vCXepG.cjs';
2
- export { a as AsstClientOptions, b as AsstUrl, B as BASE_URLS, E as Env, e as envSchema } from './SpsItemIdResponse-s0vCXepG.cjs';
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-C41Rts8D.cjs';
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-C41Rts8D.cjs';
1
+ import { A as AsstClient, I as ItemHierarchyResponse, S as SpsItemIdResponse, C as CompanyBriefByOrg } from './SpsItemIdResponse-gAHfCzwP.cjs';
2
+ export { a as AsstClientOptions, b as AsstUrl, B as BASE_URLS, E as Env, e as envSchema } from './SpsItemIdResponse-gAHfCzwP.cjs';
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 } from './zod-C-emh7a3.cjs';
4
+ export { K as AttributeDetail, a0 as Bulb, M as CategoryEnum, N as ComponentDetails, q as Connection, n as ExportDayOfWeek, o as ExportFrequency, p as ExportType, O as GroupedAttributeList, Q as GroupedAttributes, W as GroupedItem, X as HierarchyCategory, Y as HierarchyDetails, v as IdentityServiceDatetimePreferences, w as IdentityServiceOrganization, u as IdentityServiceOrganizationMetadata, x as IdentityServicePreferences, y as IdentityServiceUser, j as ImportDetails, k as ImportError, l as ImportErrors, m as ImportStatusEnum, s as ItemCategory, a4 as ItemErrorDetails, a6 as ItemErrorDetailsV2, a5 as ItemErrorSummaryV2, z as ItemHeader, B as ItemMap, Z as ItemPrice, F as ItemTable, $ as MediaItem, P as PRODUCT_CODE_DEFAULT_VALUE, a1 as PackComponent, _ as PackComponentDetails, a3 as PackComponentItemInfo, H as PhaseEnum, R as RegisteredService, a2 as RepeatableGroup, r as SELECTION_CODE_DEFAULT_VALUE, t as SpreadsheetTemplateCompany, J as TradingPartnerStage, a7 as TradingPartnerStageV2 } from './zod-C-emh7a3.cjs';
5
5
  import { z } from 'zod';
6
6
  import 'ky';
7
7
 
8
+ declare const companyTypeSchema: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
9
+ type CompanyType = z.infer<typeof companyTypeSchema>;
10
+
8
11
  /**
9
12
  * Initialize Imports Api functions
10
13
  * @param client Assortment Client instance
11
14
  * @returns An object containing Imports API functions
12
15
  */
13
- declare function createImportsApi(client: AsstClient): {
16
+ declare function createImportsApi(client: AsstClient, companyType?: CompanyType): {
14
17
  getImportErrors: (importId: string, params?: {
15
18
  offset?: number;
16
19
  limit?: number;
@@ -38,9 +41,10 @@ declare function createImportsApi(client: AsstClient): {
38
41
  /**
39
42
  * Initialize Exports Api functions
40
43
  * @param client Assortment Client instance
44
+ * @param companyType Company type for perspective
41
45
  * @returns An object containing Exports API functions
42
46
  */
43
- declare function createExportsApi(client: AsstClient): {
47
+ declare function createExportsApi(client: AsstClient, companyType?: CompanyType): {
44
48
  createExport: (data: Export, params?: {
45
49
  orgId?: string;
46
50
  }) => Promise<void>;
@@ -61,9 +65,10 @@ declare function createProductTypesApi(client: AsstClient): {
61
65
  /**
62
66
  * Initialize Trading Partner Access Api functions
63
67
  * @param client Assortment Client instance
68
+ * @param companyType Company type for perspective
64
69
  * @returns An object containing Trading Partner Access API functions
65
70
  */
66
- declare function createTradingPartnerAccessApi(client: AsstClient): {
71
+ declare function createTradingPartnerAccessApi(client: AsstClient, companyType?: CompanyType): {
67
72
  getAllTradingPartners: (params?: {
68
73
  orgId?: string;
69
74
  }, signal?: AbortSignal) => Promise<TradingPartnerAccessByCompanyId>;
@@ -77,12 +82,99 @@ type RetailerTradingPartnerStages = z.infer<typeof retailerTradingPartnerStages>
77
82
  /**
78
83
  * Initialize Trading Partner Settings Api functions
79
84
  * @param client Assortment Client instance
85
+ * @param companyType Company type for perspective
80
86
  * @returns An object containing Trading Partner Settings API functions
81
87
  */
82
- declare function createTradingPartnerSettingsApi(client: AsstClient): {
88
+ declare function createTradingPartnerSettingsApi(client: AsstClient, companyType?: CompanyType): {
83
89
  getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
84
90
  };
85
91
 
92
+ /**
93
+ * Request payload for creating a new catalog
94
+ * Matches the backend POST /categories endpoint
95
+ */
96
+ declare const catalogCreateRequestSchema: z.ZodObject<{
97
+ type: z.ZodString;
98
+ name: z.ZodString;
99
+ companyId: z.ZodNumber;
100
+ }, "strip", z.ZodTypeAny, {
101
+ type: string;
102
+ name: string;
103
+ companyId: number;
104
+ }, {
105
+ type: string;
106
+ name: string;
107
+ companyId: number;
108
+ }>;
109
+ type CatalogCreateRequest = z.infer<typeof catalogCreateRequestSchema>;
110
+ /**
111
+ * Response from creating a new catalog
112
+ * Returns the created category ID (lowercase 'categoryid')
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
+ categoryId: number;
157
+ categoryName: string;
158
+ categoryDescription: string;
159
+ categoryDescriptionExt: string;
160
+ ownerCompanyId: string;
161
+ categoryTypeId: number;
162
+ createdAt: string;
163
+ modifiedAt: string;
164
+ }, {
165
+ createdBy: string;
166
+ modifiedBy: string;
167
+ categoryId: number;
168
+ categoryName: string;
169
+ categoryDescription: string;
170
+ categoryDescriptionExt: string;
171
+ ownerCompanyId: string;
172
+ categoryTypeId: number;
173
+ createdAt: string;
174
+ modifiedAt: string;
175
+ }>;
176
+ type CatalogBriefResponse = z.infer<typeof catalogBriefResponseSchema>;
177
+
86
178
  type CategoriesApi = {
87
179
  getCatalogs: (params?: {
88
180
  categoryName?: string;
@@ -100,6 +192,11 @@ type CategoriesApi = {
100
192
  orgId?: string;
101
193
  }, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
102
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[]>;
103
200
  };
104
201
  /**
105
202
  * Initialize Categories Api functions
@@ -140,13 +237,22 @@ declare function createWhoAmIApi(client: AsstClient): {
140
237
  declare const applicationTypeSchema: z.ZodEnum<["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"]>;
141
238
  type ApplicationType = z.infer<typeof applicationTypeSchema>;
142
239
 
240
+ /**
241
+ * Note: These represent the small set of flags that are enabled via the UI. These
242
+ * match the backend enum values in the CompanyFeatures service. If this list
243
+ * grows significantly, we should consider moving these to their own constants file or
244
+ * generating them from the backend.
245
+ */
246
+ type FeatureType = "RETAILERAPI" | "DELTASUPDATEEXPORT" | "ASSORTMENTUIDASHBOARD" | "PHASEDITEMSETUP" | "PUBLICIMAGEACCESS" | "SINGLEHIERARCHYBYITEM" | "DELTAPRICEEXPORT";
143
247
  /**
144
248
  * Initialize Company Features Api functions
145
249
  * @param client Assortment Client instance
250
+ * @param companyType Company type for perspective on hybrid organisations
146
251
  * @returns An object containing Company Features API functions
147
252
  */
148
- declare function createCompanyFeaturesApi(client: AsstClient): {
253
+ declare function createCompanyFeaturesApi(client: AsstClient, companyType?: CompanyType): {
149
254
  checkIfStageItemSetupIsEnabled: (signal?: AbortSignal) => Promise<boolean>;
255
+ enableFeatureForCompany: (featureKey: FeatureType, companyId: number) => Promise<void>;
150
256
  };
151
257
 
152
258
  interface FlagOptions {
@@ -162,6 +268,7 @@ declare function createFeatureFlagsApi(client: AsstClient): {
162
268
  checkEnableItemsLevelMSIS: (signal?: AbortSignal) => Promise<boolean>;
163
269
  checkIfEnabledForPackagingHierarchies: (signal?: AbortSignal) => Promise<boolean>;
164
270
  checkIfEnabledForItemUomConversionRules: (flagOptions?: FlagOptions) => Promise<boolean>;
271
+ checkIfItemMatchEnabled: (flagOptions?: FlagOptions) => Promise<boolean>;
165
272
  };
166
273
 
167
274
  declare const itemStatusResponseSchema: z.ZodObject<{
@@ -365,9 +472,10 @@ type ItemsApi = {
365
472
  /**
366
473
  * Initialize Items Api functions
367
474
  * @param client Assortment Client instance
475
+ * @param companyType Optional company type eg "RETAILER" | "SUPPLIER"
368
476
  * @returns An object containing Items API functions
369
477
  */
370
- declare function createItemsApi(client: AsstClient): ItemsApi;
478
+ declare function createItemsApi(client: AsstClient, companyType?: CompanyType): ItemsApi;
371
479
 
372
480
  declare const itemOrgStageDetailsSchema: z.ZodObject<{
373
481
  /**
@@ -665,18 +773,20 @@ type Stage = z.infer<typeof stageSchema>;
665
773
  /**
666
774
  * Initialize Items Api functions
667
775
  * @param client Assortment Client instance
776
+ * @param companyType Company type for perspective
668
777
  * @returns An object containing Items API functions
669
778
  */
670
- declare function createItemsApiV2(client: AsstClient): {
779
+ declare function createItemsApiV2(client: AsstClient, companyType?: CompanyType): {
671
780
  getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
672
781
  };
673
782
 
674
783
  /**
675
784
  * Initialize Errors Api functions
676
785
  * @param client Assortment Client instance
786
+ * @param companyType Company type for perspective
677
787
  * @returns An object containing Errors API functions
678
788
  */
679
- declare function createErrorsApi(client: AsstClient): {
789
+ declare function createErrorsApi(client: AsstClient, companyType?: CompanyType): {
680
790
  getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
681
791
  };
682
792
 
@@ -692,9 +802,10 @@ type GetItemErrorSummaryParams = {
692
802
  /**
693
803
  * Initialize Errors Api functions
694
804
  * @param client Assortment Client instance
805
+ * @param companyType Company type for perspective
695
806
  * @returns An object containing Errors API functions
696
807
  */
697
- declare function createErrorsApiV2(client: AsstClient): {
808
+ declare function createErrorsApiV2(client: AsstClient, companyType?: CompanyType): {
698
809
  getItemErrorSummary: (params: GetItemErrorSummaryParams, signal?: AbortSignal) => Promise<ItemErrorSummaryResultV2>;
699
810
  getItemErrorDetails: (itemInfoId: number, signal?: AbortSignal) => Promise<ItemErrorDetailsResultV2>;
700
811
  };
@@ -702,18 +813,34 @@ declare function createErrorsApiV2(client: AsstClient): {
702
813
  declare const FlattenedItemIdentifierKeys: readonly ["eaneight", "upc", "ean", "gtin", "upcCaseCode", "buyerPartNumber", "partnumber", "isbn", "sku", "nationalDrugCode", "drugIdentificationNumber", "nationalHealthRelatedItemCode", "manufacturersPartNumber", "internationalStandardSerialNumber", "nabcaNumber", "erpId", "componentId"];
703
814
  type FlattenedItemIdentifiers = (typeof FlattenedItemIdentifierKeys)[number];
704
815
 
816
+ declare const uniqueCriteriaOptionsSchema: z.ZodArray<z.ZodObject<{
817
+ name: z.ZodString;
818
+ value: z.ZodString;
819
+ }, "strip", z.ZodTypeAny, {
820
+ value: string;
821
+ name: string;
822
+ }, {
823
+ value: string;
824
+ name: string;
825
+ }>, "many">;
826
+ type UniqueCriteriaOptions = z.infer<typeof uniqueCriteriaOptionsSchema>;
827
+
705
828
  /**
706
829
  * Initialize UniqueCriteria Api functions
707
830
  * @param client Assortment Client instance
708
831
  * @returns An object containing UniqueCriteria API functions
709
832
  */
710
833
  declare function createUniqueCriteriaApi(client: AsstClient): {
834
+ getUniqueCriteriaOptions: () => Promise<UniqueCriteriaOptions>;
711
835
  getUniqueCriteriaByOrg: (params?: {
712
836
  orgId?: string;
713
837
  }, signal?: AbortSignal) => Promise<string[]>;
714
838
  getProductUniqueCriteriaByOrg: (params?: {
715
839
  orgId?: string;
716
840
  }, signal?: AbortSignal) => Promise<FlattenedItemIdentifiers[]>;
841
+ updateMultipleUniqueCriteriaAttributes: (uniqueAttributes: {
842
+ uniqueAttribute: string;
843
+ }[], companyId: number) => Promise<void>;
717
844
  };
718
845
 
719
846
  /**
@@ -727,4 +854,4 @@ declare function createCompaniesApi(client: AsstClient): {
727
854
  }, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
728
855
  };
729
856
 
730
- 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, UserAccount, VendorPartnerAttGroups, createCategoriesApi, createCompaniesApi, createCompanyFeaturesApi, createErrorsApi, createErrorsApiV2, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createItemsApiV2, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
857
+ export { type ApplicationType, AsstClient, AttrProdType, type CatalogBriefResponse, type CatalogCreateRequest, type CatalogCreateResponse, type CatalogSearchParams, type CategoriesApi, CompanyBriefByOrg, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, type FeatureType, 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.d.ts CHANGED
@@ -1,16 +1,19 @@
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-COyz02Lh.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-COyz02Lh.js';
1
+ import { A as AsstClient, I as ItemHierarchyResponse, S as SpsItemIdResponse, C as CompanyBriefByOrg } from './SpsItemIdResponse-gAHfCzwP.js';
2
+ export { a as AsstClientOptions, b as AsstUrl, B as BASE_URLS, E as Env, e as envSchema } from './SpsItemIdResponse-gAHfCzwP.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 } from './zod-D3Xe9bw3.js';
4
+ export { K as AttributeDetail, a0 as Bulb, M as CategoryEnum, N as ComponentDetails, q as Connection, n as ExportDayOfWeek, o as ExportFrequency, p as ExportType, O as GroupedAttributeList, Q as GroupedAttributes, W as GroupedItem, X as HierarchyCategory, Y as HierarchyDetails, v as IdentityServiceDatetimePreferences, w as IdentityServiceOrganization, u as IdentityServiceOrganizationMetadata, x as IdentityServicePreferences, y as IdentityServiceUser, j as ImportDetails, k as ImportError, l as ImportErrors, m as ImportStatusEnum, s as ItemCategory, a4 as ItemErrorDetails, a6 as ItemErrorDetailsV2, a5 as ItemErrorSummaryV2, z as ItemHeader, B as ItemMap, Z as ItemPrice, F as ItemTable, $ as MediaItem, P as PRODUCT_CODE_DEFAULT_VALUE, a1 as PackComponent, _ as PackComponentDetails, a3 as PackComponentItemInfo, H as PhaseEnum, R as RegisteredService, a2 as RepeatableGroup, r as SELECTION_CODE_DEFAULT_VALUE, t as SpreadsheetTemplateCompany, J as TradingPartnerStage, a7 as TradingPartnerStageV2 } from './zod-D3Xe9bw3.js';
5
5
  import { z } from 'zod';
6
6
  import 'ky';
7
7
 
8
+ declare const companyTypeSchema: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
9
+ type CompanyType = z.infer<typeof companyTypeSchema>;
10
+
8
11
  /**
9
12
  * Initialize Imports Api functions
10
13
  * @param client Assortment Client instance
11
14
  * @returns An object containing Imports API functions
12
15
  */
13
- declare function createImportsApi(client: AsstClient): {
16
+ declare function createImportsApi(client: AsstClient, companyType?: CompanyType): {
14
17
  getImportErrors: (importId: string, params?: {
15
18
  offset?: number;
16
19
  limit?: number;
@@ -38,9 +41,10 @@ declare function createImportsApi(client: AsstClient): {
38
41
  /**
39
42
  * Initialize Exports Api functions
40
43
  * @param client Assortment Client instance
44
+ * @param companyType Company type for perspective
41
45
  * @returns An object containing Exports API functions
42
46
  */
43
- declare function createExportsApi(client: AsstClient): {
47
+ declare function createExportsApi(client: AsstClient, companyType?: CompanyType): {
44
48
  createExport: (data: Export, params?: {
45
49
  orgId?: string;
46
50
  }) => Promise<void>;
@@ -61,9 +65,10 @@ declare function createProductTypesApi(client: AsstClient): {
61
65
  /**
62
66
  * Initialize Trading Partner Access Api functions
63
67
  * @param client Assortment Client instance
68
+ * @param companyType Company type for perspective
64
69
  * @returns An object containing Trading Partner Access API functions
65
70
  */
66
- declare function createTradingPartnerAccessApi(client: AsstClient): {
71
+ declare function createTradingPartnerAccessApi(client: AsstClient, companyType?: CompanyType): {
67
72
  getAllTradingPartners: (params?: {
68
73
  orgId?: string;
69
74
  }, signal?: AbortSignal) => Promise<TradingPartnerAccessByCompanyId>;
@@ -77,12 +82,99 @@ type RetailerTradingPartnerStages = z.infer<typeof retailerTradingPartnerStages>
77
82
  /**
78
83
  * Initialize Trading Partner Settings Api functions
79
84
  * @param client Assortment Client instance
85
+ * @param companyType Company type for perspective
80
86
  * @returns An object containing Trading Partner Settings API functions
81
87
  */
82
- declare function createTradingPartnerSettingsApi(client: AsstClient): {
88
+ declare function createTradingPartnerSettingsApi(client: AsstClient, companyType?: CompanyType): {
83
89
  getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
84
90
  };
85
91
 
92
+ /**
93
+ * Request payload for creating a new catalog
94
+ * Matches the backend POST /categories endpoint
95
+ */
96
+ declare const catalogCreateRequestSchema: z.ZodObject<{
97
+ type: z.ZodString;
98
+ name: z.ZodString;
99
+ companyId: z.ZodNumber;
100
+ }, "strip", z.ZodTypeAny, {
101
+ type: string;
102
+ name: string;
103
+ companyId: number;
104
+ }, {
105
+ type: string;
106
+ name: string;
107
+ companyId: number;
108
+ }>;
109
+ type CatalogCreateRequest = z.infer<typeof catalogCreateRequestSchema>;
110
+ /**
111
+ * Response from creating a new catalog
112
+ * Returns the created category ID (lowercase 'categoryid')
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
+ categoryId: number;
157
+ categoryName: string;
158
+ categoryDescription: string;
159
+ categoryDescriptionExt: string;
160
+ ownerCompanyId: string;
161
+ categoryTypeId: number;
162
+ createdAt: string;
163
+ modifiedAt: string;
164
+ }, {
165
+ createdBy: string;
166
+ modifiedBy: string;
167
+ categoryId: number;
168
+ categoryName: string;
169
+ categoryDescription: string;
170
+ categoryDescriptionExt: string;
171
+ ownerCompanyId: string;
172
+ categoryTypeId: number;
173
+ createdAt: string;
174
+ modifiedAt: string;
175
+ }>;
176
+ type CatalogBriefResponse = z.infer<typeof catalogBriefResponseSchema>;
177
+
86
178
  type CategoriesApi = {
87
179
  getCatalogs: (params?: {
88
180
  categoryName?: string;
@@ -100,6 +192,11 @@ type CategoriesApi = {
100
192
  orgId?: string;
101
193
  }, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
102
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[]>;
103
200
  };
104
201
  /**
105
202
  * Initialize Categories Api functions
@@ -140,13 +237,22 @@ declare function createWhoAmIApi(client: AsstClient): {
140
237
  declare const applicationTypeSchema: z.ZodEnum<["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"]>;
141
238
  type ApplicationType = z.infer<typeof applicationTypeSchema>;
142
239
 
240
+ /**
241
+ * Note: These represent the small set of flags that are enabled via the UI. These
242
+ * match the backend enum values in the CompanyFeatures service. If this list
243
+ * grows significantly, we should consider moving these to their own constants file or
244
+ * generating them from the backend.
245
+ */
246
+ type FeatureType = "RETAILERAPI" | "DELTASUPDATEEXPORT" | "ASSORTMENTUIDASHBOARD" | "PHASEDITEMSETUP" | "PUBLICIMAGEACCESS" | "SINGLEHIERARCHYBYITEM" | "DELTAPRICEEXPORT";
143
247
  /**
144
248
  * Initialize Company Features Api functions
145
249
  * @param client Assortment Client instance
250
+ * @param companyType Company type for perspective on hybrid organisations
146
251
  * @returns An object containing Company Features API functions
147
252
  */
148
- declare function createCompanyFeaturesApi(client: AsstClient): {
253
+ declare function createCompanyFeaturesApi(client: AsstClient, companyType?: CompanyType): {
149
254
  checkIfStageItemSetupIsEnabled: (signal?: AbortSignal) => Promise<boolean>;
255
+ enableFeatureForCompany: (featureKey: FeatureType, companyId: number) => Promise<void>;
150
256
  };
151
257
 
152
258
  interface FlagOptions {
@@ -162,6 +268,7 @@ declare function createFeatureFlagsApi(client: AsstClient): {
162
268
  checkEnableItemsLevelMSIS: (signal?: AbortSignal) => Promise<boolean>;
163
269
  checkIfEnabledForPackagingHierarchies: (signal?: AbortSignal) => Promise<boolean>;
164
270
  checkIfEnabledForItemUomConversionRules: (flagOptions?: FlagOptions) => Promise<boolean>;
271
+ checkIfItemMatchEnabled: (flagOptions?: FlagOptions) => Promise<boolean>;
165
272
  };
166
273
 
167
274
  declare const itemStatusResponseSchema: z.ZodObject<{
@@ -365,9 +472,10 @@ type ItemsApi = {
365
472
  /**
366
473
  * Initialize Items Api functions
367
474
  * @param client Assortment Client instance
475
+ * @param companyType Optional company type eg "RETAILER" | "SUPPLIER"
368
476
  * @returns An object containing Items API functions
369
477
  */
370
- declare function createItemsApi(client: AsstClient): ItemsApi;
478
+ declare function createItemsApi(client: AsstClient, companyType?: CompanyType): ItemsApi;
371
479
 
372
480
  declare const itemOrgStageDetailsSchema: z.ZodObject<{
373
481
  /**
@@ -665,18 +773,20 @@ type Stage = z.infer<typeof stageSchema>;
665
773
  /**
666
774
  * Initialize Items Api functions
667
775
  * @param client Assortment Client instance
776
+ * @param companyType Company type for perspective
668
777
  * @returns An object containing Items API functions
669
778
  */
670
- declare function createItemsApiV2(client: AsstClient): {
779
+ declare function createItemsApiV2(client: AsstClient, companyType?: CompanyType): {
671
780
  getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
672
781
  };
673
782
 
674
783
  /**
675
784
  * Initialize Errors Api functions
676
785
  * @param client Assortment Client instance
786
+ * @param companyType Company type for perspective
677
787
  * @returns An object containing Errors API functions
678
788
  */
679
- declare function createErrorsApi(client: AsstClient): {
789
+ declare function createErrorsApi(client: AsstClient, companyType?: CompanyType): {
680
790
  getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
681
791
  };
682
792
 
@@ -692,9 +802,10 @@ type GetItemErrorSummaryParams = {
692
802
  /**
693
803
  * Initialize Errors Api functions
694
804
  * @param client Assortment Client instance
805
+ * @param companyType Company type for perspective
695
806
  * @returns An object containing Errors API functions
696
807
  */
697
- declare function createErrorsApiV2(client: AsstClient): {
808
+ declare function createErrorsApiV2(client: AsstClient, companyType?: CompanyType): {
698
809
  getItemErrorSummary: (params: GetItemErrorSummaryParams, signal?: AbortSignal) => Promise<ItemErrorSummaryResultV2>;
699
810
  getItemErrorDetails: (itemInfoId: number, signal?: AbortSignal) => Promise<ItemErrorDetailsResultV2>;
700
811
  };
@@ -702,18 +813,34 @@ declare function createErrorsApiV2(client: AsstClient): {
702
813
  declare const FlattenedItemIdentifierKeys: readonly ["eaneight", "upc", "ean", "gtin", "upcCaseCode", "buyerPartNumber", "partnumber", "isbn", "sku", "nationalDrugCode", "drugIdentificationNumber", "nationalHealthRelatedItemCode", "manufacturersPartNumber", "internationalStandardSerialNumber", "nabcaNumber", "erpId", "componentId"];
703
814
  type FlattenedItemIdentifiers = (typeof FlattenedItemIdentifierKeys)[number];
704
815
 
816
+ declare const uniqueCriteriaOptionsSchema: z.ZodArray<z.ZodObject<{
817
+ name: z.ZodString;
818
+ value: z.ZodString;
819
+ }, "strip", z.ZodTypeAny, {
820
+ value: string;
821
+ name: string;
822
+ }, {
823
+ value: string;
824
+ name: string;
825
+ }>, "many">;
826
+ type UniqueCriteriaOptions = z.infer<typeof uniqueCriteriaOptionsSchema>;
827
+
705
828
  /**
706
829
  * Initialize UniqueCriteria Api functions
707
830
  * @param client Assortment Client instance
708
831
  * @returns An object containing UniqueCriteria API functions
709
832
  */
710
833
  declare function createUniqueCriteriaApi(client: AsstClient): {
834
+ getUniqueCriteriaOptions: () => Promise<UniqueCriteriaOptions>;
711
835
  getUniqueCriteriaByOrg: (params?: {
712
836
  orgId?: string;
713
837
  }, signal?: AbortSignal) => Promise<string[]>;
714
838
  getProductUniqueCriteriaByOrg: (params?: {
715
839
  orgId?: string;
716
840
  }, signal?: AbortSignal) => Promise<FlattenedItemIdentifiers[]>;
841
+ updateMultipleUniqueCriteriaAttributes: (uniqueAttributes: {
842
+ uniqueAttribute: string;
843
+ }[], companyId: number) => Promise<void>;
717
844
  };
718
845
 
719
846
  /**
@@ -727,4 +854,4 @@ declare function createCompaniesApi(client: AsstClient): {
727
854
  }, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
728
855
  };
729
856
 
730
- 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, UserAccount, VendorPartnerAttGroups, createCategoriesApi, createCompaniesApi, createCompanyFeaturesApi, createErrorsApi, createErrorsApiV2, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createItemsApiV2, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
857
+ export { type ApplicationType, AsstClient, AttrProdType, type CatalogBriefResponse, type CatalogCreateRequest, type CatalogCreateResponse, type CatalogSearchParams, type CategoriesApi, CompanyBriefByOrg, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, type FeatureType, 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
@@ -16,16 +16,16 @@ import {
16
16
  createTradingPartnerSettingsApi,
17
17
  createUniqueCriteriaApi,
18
18
  createWhoAmIApi
19
- } from "./chunk-NFZI7D22.js";
19
+ } from "./chunk-VS3QNXZF.js";
20
20
  import {
21
21
  AsstClient,
22
22
  BASE_URLS,
23
23
  envSchema
24
- } from "./chunk-55ECRTUX.js";
24
+ } from "./chunk-WX4LGXJV.js";
25
25
  import {
26
26
  PRODUCT_CODE_DEFAULT_VALUE,
27
27
  SELECTION_CODE_DEFAULT_VALUE
28
- } from "./chunk-LKUGPDIT.js";
28
+ } from "./chunk-BMTYM2N6.js";
29
29
  export {
30
30
  AsstClient,
31
31
  BASE_URLS,