@spscommerce/asst-api 4.6.0 → 4.8.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/index.d.cts CHANGED
@@ -1,19 +1,109 @@
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';
1
+ import { A as AsstClient, I as ItemHierarchyResponse, a as CompanyType, S as SpsItemIdResponse, C as CompanyBriefByOrg } from './SpsItemIdResponse-BEq6yqtR.cjs';
2
+ export { b as AsstClientOptions, c as AsstUrl, B as BASE_URLS, E as Env, e as envSchema } from './SpsItemIdResponse-BEq6yqtR.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-DscWtu4d.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-DscWtu4d.cjs';
5
5
  import { z } from 'zod';
6
+ import { b as CompanySearchParams, C as CompanySearch, a as Company } from './CompanySearch-T6HJx4a6.cjs';
6
7
  import 'ky';
7
8
 
8
- declare const companyTypeSchema: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
9
- type CompanyType = z.infer<typeof companyTypeSchema>;
9
+ declare const relationshipSchema: z.ZodObject<{
10
+ active: z.ZodBoolean;
11
+ application: z.ZodArray<z.ZodObject<{
12
+ application: z.ZodEnum<["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"]>;
13
+ relationshipApplicationId: z.ZodNumber;
14
+ }, "strip", z.ZodTypeAny, {
15
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
16
+ relationshipApplicationId: number;
17
+ }, {
18
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
19
+ relationshipApplicationId: number;
20
+ }>, "many">;
21
+ catalog: z.ZodArray<z.ZodObject<{
22
+ active: z.ZodBoolean;
23
+ catalogId: z.ZodNumber;
24
+ itemPartnerId: z.ZodNumber;
25
+ }, "strip", z.ZodTypeAny, {
26
+ active: boolean;
27
+ catalogId: number;
28
+ itemPartnerId: number;
29
+ }, {
30
+ active: boolean;
31
+ catalogId: number;
32
+ itemPartnerId: number;
33
+ }>, "many">;
34
+ company: z.ZodObject<{
35
+ companyId: z.ZodNumber;
36
+ companyTypes: z.ZodArray<z.ZodEnum<["SUPPLIER", "RETAILER"]>, "many">;
37
+ dc4Id: z.ZodNullable<z.ZodNumber>;
38
+ name: z.ZodString;
39
+ orgId: z.ZodString;
40
+ }, "strip", z.ZodTypeAny, {
41
+ companyId: number;
42
+ name: string;
43
+ orgId: string;
44
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
45
+ dc4Id: number | null;
46
+ }, {
47
+ companyId: number;
48
+ name: string;
49
+ orgId: string;
50
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
51
+ dc4Id: number | null;
52
+ }>;
53
+ createdAt: z.ZodNumber;
54
+ modifiedAt: z.ZodNullable<z.ZodNumber>;
55
+ relationshipId: z.ZodNumber;
56
+ }, "strip", z.ZodTypeAny, {
57
+ application: {
58
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
59
+ relationshipApplicationId: number;
60
+ }[];
61
+ active: boolean;
62
+ catalog: {
63
+ active: boolean;
64
+ catalogId: number;
65
+ itemPartnerId: number;
66
+ }[];
67
+ company: {
68
+ companyId: number;
69
+ name: string;
70
+ orgId: string;
71
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
72
+ dc4Id: number | null;
73
+ };
74
+ createdAt: number;
75
+ modifiedAt: number | null;
76
+ relationshipId: number;
77
+ }, {
78
+ application: {
79
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
80
+ relationshipApplicationId: number;
81
+ }[];
82
+ active: boolean;
83
+ catalog: {
84
+ active: boolean;
85
+ catalogId: number;
86
+ itemPartnerId: number;
87
+ }[];
88
+ company: {
89
+ companyId: number;
90
+ name: string;
91
+ orgId: string;
92
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
93
+ dc4Id: number | null;
94
+ };
95
+ createdAt: number;
96
+ modifiedAt: number | null;
97
+ relationshipId: number;
98
+ }>;
99
+ type CompanyRelationship = z.infer<typeof relationshipSchema>;
10
100
 
11
101
  /**
12
102
  * Initialize Imports Api functions
13
103
  * @param client Assortment Client instance
14
104
  * @returns An object containing Imports API functions
15
105
  */
16
- declare function createImportsApi(client: AsstClient, companyType?: CompanyType): {
106
+ declare function createImportsApi(client: AsstClient): {
17
107
  getImportErrors: (importId: string, params?: {
18
108
  offset?: number;
19
109
  limit?: number;
@@ -44,7 +134,7 @@ declare function createImportsApi(client: AsstClient, companyType?: CompanyType)
44
134
  * @param companyType Company type for perspective
45
135
  * @returns An object containing Exports API functions
46
136
  */
47
- declare function createExportsApi(client: AsstClient, companyType?: CompanyType): {
137
+ declare function createExportsApi(client: AsstClient): {
48
138
  createExport: (data: Export, params?: {
49
139
  orgId?: string;
50
140
  }) => Promise<void>;
@@ -65,10 +155,9 @@ declare function createProductTypesApi(client: AsstClient): {
65
155
  /**
66
156
  * Initialize Trading Partner Access Api functions
67
157
  * @param client Assortment Client instance
68
- * @param companyType Company type for perspective
69
158
  * @returns An object containing Trading Partner Access API functions
70
159
  */
71
- declare function createTradingPartnerAccessApi(client: AsstClient, companyType?: CompanyType): {
160
+ declare function createTradingPartnerAccessApi(client: AsstClient): {
72
161
  getAllTradingPartners: (params?: {
73
162
  orgId?: string;
74
163
  }, signal?: AbortSignal) => Promise<TradingPartnerAccessByCompanyId>;
@@ -82,10 +171,9 @@ type RetailerTradingPartnerStages = z.infer<typeof retailerTradingPartnerStages>
82
171
  /**
83
172
  * Initialize Trading Partner Settings Api functions
84
173
  * @param client Assortment Client instance
85
- * @param companyType Company type for perspective
86
174
  * @returns An object containing Trading Partner Settings API functions
87
175
  */
88
- declare function createTradingPartnerSettingsApi(client: AsstClient, companyType?: CompanyType): {
176
+ declare function createTradingPartnerSettingsApi(client: AsstClient): {
89
177
  getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
90
178
  };
91
179
 
@@ -99,12 +187,12 @@ declare const catalogCreateRequestSchema: z.ZodObject<{
99
187
  companyId: z.ZodNumber;
100
188
  }, "strip", z.ZodTypeAny, {
101
189
  type: string;
102
- name: string;
103
190
  companyId: number;
191
+ name: string;
104
192
  }, {
105
193
  type: string;
106
- name: string;
107
194
  companyId: number;
195
+ name: string;
108
196
  }>;
109
197
  type CatalogCreateRequest = z.infer<typeof catalogCreateRequestSchema>;
110
198
  /**
@@ -151,6 +239,8 @@ declare const catalogBriefResponseSchema: z.ZodObject<{
151
239
  createdBy: z.ZodString;
152
240
  modifiedBy: z.ZodString;
153
241
  }, "strip", z.ZodTypeAny, {
242
+ createdAt: string;
243
+ modifiedAt: string;
154
244
  createdBy: string;
155
245
  modifiedBy: string;
156
246
  categoryId: number;
@@ -159,9 +249,9 @@ declare const catalogBriefResponseSchema: z.ZodObject<{
159
249
  categoryDescriptionExt: string;
160
250
  ownerCompanyId: string;
161
251
  categoryTypeId: number;
252
+ }, {
162
253
  createdAt: string;
163
254
  modifiedAt: string;
164
- }, {
165
255
  createdBy: string;
166
256
  modifiedBy: string;
167
257
  categoryId: number;
@@ -170,8 +260,6 @@ declare const catalogBriefResponseSchema: z.ZodObject<{
170
260
  categoryDescriptionExt: string;
171
261
  ownerCompanyId: string;
172
262
  categoryTypeId: number;
173
- createdAt: string;
174
- modifiedAt: string;
175
263
  }>;
176
264
  type CatalogBriefResponse = z.infer<typeof catalogBriefResponseSchema>;
177
265
 
@@ -471,10 +559,9 @@ type ItemsApi = {
471
559
  /**
472
560
  * Initialize Items Api functions
473
561
  * @param client Assortment Client instance
474
- * @param companyType Optional company type eg "RETAILER" | "SUPPLIER"
475
562
  * @returns An object containing Items API functions
476
563
  */
477
- declare function createItemsApi(client: AsstClient, companyType?: CompanyType): ItemsApi;
564
+ declare function createItemsApi(client: AsstClient): ItemsApi;
478
565
 
479
566
  declare const itemOrgStageDetailsSchema: z.ZodObject<{
480
567
  /**
@@ -772,20 +859,18 @@ type Stage = z.infer<typeof stageSchema>;
772
859
  /**
773
860
  * Initialize Items Api functions
774
861
  * @param client Assortment Client instance
775
- * @param companyType Company type for perspective
776
862
  * @returns An object containing Items API functions
777
863
  */
778
864
  declare function createItemsApiV2(client: AsstClient): {
779
- getItemStatus: (companyType: CompanyType, itemIds: string[]) => Promise<ItemStatusV2Response>;
865
+ getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
780
866
  };
781
867
 
782
868
  /**
783
869
  * Initialize Errors Api functions
784
870
  * @param client Assortment Client instance
785
- * @param companyType Company type for perspective
786
871
  * @returns An object containing Errors API functions
787
872
  */
788
- declare function createErrorsApi(client: AsstClient, companyType?: CompanyType): {
873
+ declare function createErrorsApi(client: AsstClient): {
789
874
  getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
790
875
  };
791
876
 
@@ -804,7 +889,7 @@ type GetItemErrorSummaryParams = {
804
889
  * @param companyType Company type for perspective
805
890
  * @returns An object containing Errors API functions
806
891
  */
807
- declare function createErrorsApiV2(client: AsstClient, companyType?: CompanyType): {
892
+ declare function createErrorsApiV2(client: AsstClient): {
808
893
  getItemErrorSummary: (params: GetItemErrorSummaryParams, signal?: AbortSignal) => Promise<ItemErrorSummaryResultV2>;
809
894
  getItemErrorDetails: (itemInfoId: number, signal?: AbortSignal) => Promise<ItemErrorDetailsResultV2>;
810
895
  };
@@ -851,6 +936,29 @@ declare function createCompaniesApi(client: AsstClient): {
851
936
  getCompanyBriefInfoByOrg: (params?: {
852
937
  orgId?: string;
853
938
  }, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
939
+ companySearch: (params?: CompanySearchParams, signal?: AbortSignal) => Promise<CompanySearch[]>;
940
+ getCompanyById: (companyId: number, signal?: AbortSignal) => Promise<Company>;
941
+ };
942
+
943
+ declare const activateRuleRequestDtoSchema: z.ZodObject<{
944
+ instanceId: z.ZodNullable<z.ZodString>;
945
+ description: z.ZodString;
946
+ }, "strip", z.ZodTypeAny, {
947
+ description: string;
948
+ instanceId: string | null;
949
+ }, {
950
+ description: string;
951
+ instanceId: string | null;
952
+ }>;
953
+ type ActivateRuleRequestDto = z.infer<typeof activateRuleRequestDtoSchema>;
954
+
955
+ /**
956
+ * Initialize Rules Management Api functions
957
+ * @param client Assortment Client instance
958
+ * @returns An object containing Rules Management API functions
959
+ */
960
+ declare function createRulesManagementApi(client: AsstClient): {
961
+ activateRule: (ruleId: string, request: ActivateRuleRequestDto, signal?: AbortSignal) => Promise<void>;
854
962
  };
855
963
 
856
- 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 };
964
+ export { type ActivateRuleRequestDto, type ApplicationType, AsstClient, AttrProdType, type CatalogBriefResponse, type CatalogCreateRequest, type CatalogCreateResponse, type CatalogSearchParams, type CategoriesApi, Company, CompanyBriefByOrg, type CompanyRelationship, CompanyRelationshipUpsertBody, CompanySearch, CompanySearchParams, CompanyType, 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, createRulesManagementApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,109 @@
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';
1
+ import { A as AsstClient, I as ItemHierarchyResponse, a as CompanyType, S as SpsItemIdResponse, C as CompanyBriefByOrg } from './SpsItemIdResponse-BEq6yqtR.js';
2
+ export { b as AsstClientOptions, c as AsstUrl, B as BASE_URLS, E as Env, e as envSchema } from './SpsItemIdResponse-BEq6yqtR.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-CEvcMeWn.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-CEvcMeWn.js';
5
5
  import { z } from 'zod';
6
+ import { b as CompanySearchParams, C as CompanySearch, a as Company } from './CompanySearch-T6HJx4a6.js';
6
7
  import 'ky';
7
8
 
8
- declare const companyTypeSchema: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
9
- type CompanyType = z.infer<typeof companyTypeSchema>;
9
+ declare const relationshipSchema: z.ZodObject<{
10
+ active: z.ZodBoolean;
11
+ application: z.ZodArray<z.ZodObject<{
12
+ application: z.ZodEnum<["ASSORTMENT", "ITEM-XREF", "TEST-ORDER-GENERATOR"]>;
13
+ relationshipApplicationId: z.ZodNumber;
14
+ }, "strip", z.ZodTypeAny, {
15
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
16
+ relationshipApplicationId: number;
17
+ }, {
18
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
19
+ relationshipApplicationId: number;
20
+ }>, "many">;
21
+ catalog: z.ZodArray<z.ZodObject<{
22
+ active: z.ZodBoolean;
23
+ catalogId: z.ZodNumber;
24
+ itemPartnerId: z.ZodNumber;
25
+ }, "strip", z.ZodTypeAny, {
26
+ active: boolean;
27
+ catalogId: number;
28
+ itemPartnerId: number;
29
+ }, {
30
+ active: boolean;
31
+ catalogId: number;
32
+ itemPartnerId: number;
33
+ }>, "many">;
34
+ company: z.ZodObject<{
35
+ companyId: z.ZodNumber;
36
+ companyTypes: z.ZodArray<z.ZodEnum<["SUPPLIER", "RETAILER"]>, "many">;
37
+ dc4Id: z.ZodNullable<z.ZodNumber>;
38
+ name: z.ZodString;
39
+ orgId: z.ZodString;
40
+ }, "strip", z.ZodTypeAny, {
41
+ companyId: number;
42
+ name: string;
43
+ orgId: string;
44
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
45
+ dc4Id: number | null;
46
+ }, {
47
+ companyId: number;
48
+ name: string;
49
+ orgId: string;
50
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
51
+ dc4Id: number | null;
52
+ }>;
53
+ createdAt: z.ZodNumber;
54
+ modifiedAt: z.ZodNullable<z.ZodNumber>;
55
+ relationshipId: z.ZodNumber;
56
+ }, "strip", z.ZodTypeAny, {
57
+ application: {
58
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
59
+ relationshipApplicationId: number;
60
+ }[];
61
+ active: boolean;
62
+ catalog: {
63
+ active: boolean;
64
+ catalogId: number;
65
+ itemPartnerId: number;
66
+ }[];
67
+ company: {
68
+ companyId: number;
69
+ name: string;
70
+ orgId: string;
71
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
72
+ dc4Id: number | null;
73
+ };
74
+ createdAt: number;
75
+ modifiedAt: number | null;
76
+ relationshipId: number;
77
+ }, {
78
+ application: {
79
+ application: "ASSORTMENT" | "ITEM-XREF" | "TEST-ORDER-GENERATOR";
80
+ relationshipApplicationId: number;
81
+ }[];
82
+ active: boolean;
83
+ catalog: {
84
+ active: boolean;
85
+ catalogId: number;
86
+ itemPartnerId: number;
87
+ }[];
88
+ company: {
89
+ companyId: number;
90
+ name: string;
91
+ orgId: string;
92
+ companyTypes: ("SUPPLIER" | "RETAILER")[];
93
+ dc4Id: number | null;
94
+ };
95
+ createdAt: number;
96
+ modifiedAt: number | null;
97
+ relationshipId: number;
98
+ }>;
99
+ type CompanyRelationship = z.infer<typeof relationshipSchema>;
10
100
 
11
101
  /**
12
102
  * Initialize Imports Api functions
13
103
  * @param client Assortment Client instance
14
104
  * @returns An object containing Imports API functions
15
105
  */
16
- declare function createImportsApi(client: AsstClient, companyType?: CompanyType): {
106
+ declare function createImportsApi(client: AsstClient): {
17
107
  getImportErrors: (importId: string, params?: {
18
108
  offset?: number;
19
109
  limit?: number;
@@ -44,7 +134,7 @@ declare function createImportsApi(client: AsstClient, companyType?: CompanyType)
44
134
  * @param companyType Company type for perspective
45
135
  * @returns An object containing Exports API functions
46
136
  */
47
- declare function createExportsApi(client: AsstClient, companyType?: CompanyType): {
137
+ declare function createExportsApi(client: AsstClient): {
48
138
  createExport: (data: Export, params?: {
49
139
  orgId?: string;
50
140
  }) => Promise<void>;
@@ -65,10 +155,9 @@ declare function createProductTypesApi(client: AsstClient): {
65
155
  /**
66
156
  * Initialize Trading Partner Access Api functions
67
157
  * @param client Assortment Client instance
68
- * @param companyType Company type for perspective
69
158
  * @returns An object containing Trading Partner Access API functions
70
159
  */
71
- declare function createTradingPartnerAccessApi(client: AsstClient, companyType?: CompanyType): {
160
+ declare function createTradingPartnerAccessApi(client: AsstClient): {
72
161
  getAllTradingPartners: (params?: {
73
162
  orgId?: string;
74
163
  }, signal?: AbortSignal) => Promise<TradingPartnerAccessByCompanyId>;
@@ -82,10 +171,9 @@ type RetailerTradingPartnerStages = z.infer<typeof retailerTradingPartnerStages>
82
171
  /**
83
172
  * Initialize Trading Partner Settings Api functions
84
173
  * @param client Assortment Client instance
85
- * @param companyType Company type for perspective
86
174
  * @returns An object containing Trading Partner Settings API functions
87
175
  */
88
- declare function createTradingPartnerSettingsApi(client: AsstClient, companyType?: CompanyType): {
176
+ declare function createTradingPartnerSettingsApi(client: AsstClient): {
89
177
  getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
90
178
  };
91
179
 
@@ -99,12 +187,12 @@ declare const catalogCreateRequestSchema: z.ZodObject<{
99
187
  companyId: z.ZodNumber;
100
188
  }, "strip", z.ZodTypeAny, {
101
189
  type: string;
102
- name: string;
103
190
  companyId: number;
191
+ name: string;
104
192
  }, {
105
193
  type: string;
106
- name: string;
107
194
  companyId: number;
195
+ name: string;
108
196
  }>;
109
197
  type CatalogCreateRequest = z.infer<typeof catalogCreateRequestSchema>;
110
198
  /**
@@ -151,6 +239,8 @@ declare const catalogBriefResponseSchema: z.ZodObject<{
151
239
  createdBy: z.ZodString;
152
240
  modifiedBy: z.ZodString;
153
241
  }, "strip", z.ZodTypeAny, {
242
+ createdAt: string;
243
+ modifiedAt: string;
154
244
  createdBy: string;
155
245
  modifiedBy: string;
156
246
  categoryId: number;
@@ -159,9 +249,9 @@ declare const catalogBriefResponseSchema: z.ZodObject<{
159
249
  categoryDescriptionExt: string;
160
250
  ownerCompanyId: string;
161
251
  categoryTypeId: number;
252
+ }, {
162
253
  createdAt: string;
163
254
  modifiedAt: string;
164
- }, {
165
255
  createdBy: string;
166
256
  modifiedBy: string;
167
257
  categoryId: number;
@@ -170,8 +260,6 @@ declare const catalogBriefResponseSchema: z.ZodObject<{
170
260
  categoryDescriptionExt: string;
171
261
  ownerCompanyId: string;
172
262
  categoryTypeId: number;
173
- createdAt: string;
174
- modifiedAt: string;
175
263
  }>;
176
264
  type CatalogBriefResponse = z.infer<typeof catalogBriefResponseSchema>;
177
265
 
@@ -471,10 +559,9 @@ type ItemsApi = {
471
559
  /**
472
560
  * Initialize Items Api functions
473
561
  * @param client Assortment Client instance
474
- * @param companyType Optional company type eg "RETAILER" | "SUPPLIER"
475
562
  * @returns An object containing Items API functions
476
563
  */
477
- declare function createItemsApi(client: AsstClient, companyType?: CompanyType): ItemsApi;
564
+ declare function createItemsApi(client: AsstClient): ItemsApi;
478
565
 
479
566
  declare const itemOrgStageDetailsSchema: z.ZodObject<{
480
567
  /**
@@ -772,20 +859,18 @@ type Stage = z.infer<typeof stageSchema>;
772
859
  /**
773
860
  * Initialize Items Api functions
774
861
  * @param client Assortment Client instance
775
- * @param companyType Company type for perspective
776
862
  * @returns An object containing Items API functions
777
863
  */
778
864
  declare function createItemsApiV2(client: AsstClient): {
779
- getItemStatus: (companyType: CompanyType, itemIds: string[]) => Promise<ItemStatusV2Response>;
865
+ getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
780
866
  };
781
867
 
782
868
  /**
783
869
  * Initialize Errors Api functions
784
870
  * @param client Assortment Client instance
785
- * @param companyType Company type for perspective
786
871
  * @returns An object containing Errors API functions
787
872
  */
788
- declare function createErrorsApi(client: AsstClient, companyType?: CompanyType): {
873
+ declare function createErrorsApi(client: AsstClient): {
789
874
  getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
790
875
  };
791
876
 
@@ -804,7 +889,7 @@ type GetItemErrorSummaryParams = {
804
889
  * @param companyType Company type for perspective
805
890
  * @returns An object containing Errors API functions
806
891
  */
807
- declare function createErrorsApiV2(client: AsstClient, companyType?: CompanyType): {
892
+ declare function createErrorsApiV2(client: AsstClient): {
808
893
  getItemErrorSummary: (params: GetItemErrorSummaryParams, signal?: AbortSignal) => Promise<ItemErrorSummaryResultV2>;
809
894
  getItemErrorDetails: (itemInfoId: number, signal?: AbortSignal) => Promise<ItemErrorDetailsResultV2>;
810
895
  };
@@ -851,6 +936,29 @@ declare function createCompaniesApi(client: AsstClient): {
851
936
  getCompanyBriefInfoByOrg: (params?: {
852
937
  orgId?: string;
853
938
  }, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
939
+ companySearch: (params?: CompanySearchParams, signal?: AbortSignal) => Promise<CompanySearch[]>;
940
+ getCompanyById: (companyId: number, signal?: AbortSignal) => Promise<Company>;
941
+ };
942
+
943
+ declare const activateRuleRequestDtoSchema: z.ZodObject<{
944
+ instanceId: z.ZodNullable<z.ZodString>;
945
+ description: z.ZodString;
946
+ }, "strip", z.ZodTypeAny, {
947
+ description: string;
948
+ instanceId: string | null;
949
+ }, {
950
+ description: string;
951
+ instanceId: string | null;
952
+ }>;
953
+ type ActivateRuleRequestDto = z.infer<typeof activateRuleRequestDtoSchema>;
954
+
955
+ /**
956
+ * Initialize Rules Management Api functions
957
+ * @param client Assortment Client instance
958
+ * @returns An object containing Rules Management API functions
959
+ */
960
+ declare function createRulesManagementApi(client: AsstClient): {
961
+ activateRule: (ruleId: string, request: ActivateRuleRequestDto, signal?: AbortSignal) => Promise<void>;
854
962
  };
855
963
 
856
- 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 };
964
+ export { type ActivateRuleRequestDto, type ApplicationType, AsstClient, AttrProdType, type CatalogBriefResponse, type CatalogCreateRequest, type CatalogCreateResponse, type CatalogSearchParams, type CategoriesApi, Company, CompanyBriefByOrg, type CompanyRelationship, CompanyRelationshipUpsertBody, CompanySearch, CompanySearchParams, CompanyType, 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, createRulesManagementApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
package/dist/index.js CHANGED
@@ -11,21 +11,22 @@ import {
11
11
  createItemsApiV2,
12
12
  createLocaleApi,
13
13
  createProductTypesApi,
14
+ createRulesManagementApi,
14
15
  createSpreadsheetTemplateApi,
15
16
  createTradingPartnerAccessApi,
16
17
  createTradingPartnerSettingsApi,
17
18
  createUniqueCriteriaApi,
18
19
  createWhoAmIApi
19
- } from "./chunk-U7UJOT4D.js";
20
+ } from "./chunk-ZAW3TKZQ.js";
20
21
  import {
21
22
  AsstClient,
22
23
  BASE_URLS,
23
24
  envSchema
24
- } from "./chunk-WX4LGXJV.js";
25
+ } from "./chunk-VQDRXCML.js";
25
26
  import {
26
27
  PRODUCT_CODE_DEFAULT_VALUE,
27
28
  SELECTION_CODE_DEFAULT_VALUE
28
- } from "./chunk-BMTYM2N6.js";
29
+ } from "./chunk-52RZCPMT.js";
29
30
  export {
30
31
  AsstClient,
31
32
  BASE_URLS,
@@ -43,6 +44,7 @@ export {
43
44
  createItemsApiV2,
44
45
  createLocaleApi,
45
46
  createProductTypesApi,
47
+ createRulesManagementApi,
46
48
  createSpreadsheetTemplateApi,
47
49
  createTradingPartnerAccessApi,
48
50
  createTradingPartnerSettingsApi,