@spscommerce/asst-api 0.0.1 → 0.2.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.
@@ -3,17 +3,17 @@ import { Options } from 'ky';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const baseUrlsSchema: z.ZodObject<{
6
- local: z.ZodLiteral<"https://localhost:8443">;
7
- test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway">;
8
- prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway">;
6
+ local: z.ZodLiteral<"https://localhost:8443/">;
7
+ test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
8
+ prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
9
9
  }, "strip", z.ZodTypeAny, {
10
- local: "https://localhost:8443";
11
- test: "https://integration.api.spscommerce.com/assortment/gateway";
12
- prod: "https://api.spscommerce.com/assortment/gateway";
10
+ local: "https://localhost:8443/";
11
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
12
+ prod: "https://api.spscommerce.com/assortment/gateway/";
13
13
  }, {
14
- local: "https://localhost:8443";
15
- test: "https://integration.api.spscommerce.com/assortment/gateway";
16
- prod: "https://api.spscommerce.com/assortment/gateway";
14
+ local: "https://localhost:8443/";
15
+ test: "https://integration.api.spscommerce.com/assortment/gateway/";
16
+ prod: "https://api.spscommerce.com/assortment/gateway/";
17
17
  }>;
18
18
  type BaseUrls = z.infer<typeof baseUrlsSchema>;
19
19
  declare const BASE_URLS: BaseUrls;
@@ -289,6 +289,27 @@ declare const attrProdTypeSchema: z.ZodObject<{
289
289
  }>;
290
290
  type AttrProdType = z.infer<typeof attrProdTypeSchema>;
291
291
 
292
+ declare const companyRelationshipUpsertBodySchema: z.ZodObject<{
293
+ supplierId: z.ZodNumber;
294
+ retailerId: z.ZodNumber;
295
+ catalogId: z.ZodNumber;
296
+ isActive: z.ZodBoolean;
297
+ applicationType: z.ZodDefault<z.ZodArray<z.ZodEnum<["ASSORTMENT", "ITEM-XREF"]>, "many">>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ isActive: boolean;
300
+ retailerId: number;
301
+ supplierId: number;
302
+ catalogId: number;
303
+ applicationType: ("ASSORTMENT" | "ITEM-XREF")[];
304
+ }, {
305
+ isActive: boolean;
306
+ retailerId: number;
307
+ supplierId: number;
308
+ catalogId: number;
309
+ applicationType?: ("ASSORTMENT" | "ITEM-XREF")[] | undefined;
310
+ }>;
311
+ type CompanyRelationshipUpsertBody = z.infer<typeof companyRelationshipUpsertBodySchema>;
312
+
292
313
  declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
293
314
  companyId: z.ZodNumber;
294
315
  companyType: z.ZodString;
@@ -3099,4 +3120,40 @@ declare const itemErrorDetailsResultSchema: z.ZodObject<{
3099
3120
  }>;
3100
3121
  type ItemErrorDetailsResult = z.infer<typeof itemErrorDetailsResultSchema>;
3101
3122
 
3102
- export { AsstClient as A, BASE_URLS as B, itemSearchViewSchema as C, itemDetailViewSchema as D, Export as E, localeSchema as F, spreadsheetTemplateSchema as G, tradingPartnerAccessByCompanyIdSchema as H, ImportErrors as I, userAccountSchema as J, itemErrorDetailsResultSchema as K, Locale as L, SpreadsheetTemplate as S, TradingPartnerAccessByCompanyId as T, UserAccount as U, VendorPartnerAttGroups as V, Import as a, ImportsStatus as b, ItemCategoriesSearch as c, attrProdTypeSchema as d, ItemErrorDetailsResult as e, ItemSearchView as f, ItemDetailView as g, AttributeMetaData as h, AttributesByCompany as i, AttributeDefinition as j, AttributeValidValues as k, AttrProdType as l, AsstClientOptions as m, AsstUrl as n, Env as o, envSchema as p, importErrorsSchema as q, importSchema as r, importsStatusSchema as s, exportSchema as t, itemCategoriesSearchSchema as u, vendorPartnerAttGroupsSchema as v, attributeDefinitionSchema as w, attributeMetaDataSchema as x, attributesByCompanySchema as y, attributeValidValuesSchema as z };
3123
+ declare const companyBriefByOrgSchema: z.ZodObject<{
3124
+ companyId: z.ZodNumber;
3125
+ name: z.ZodString;
3126
+ orgId: z.ZodString;
3127
+ companyType: z.ZodObject<{
3128
+ type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
3129
+ display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
3130
+ }, "strip", z.ZodTypeAny, {
3131
+ type: "SUPPLIER" | "RETAILER";
3132
+ display: "SUPPLIER" | "RETAILER";
3133
+ }, {
3134
+ type: "SUPPLIER" | "RETAILER";
3135
+ display: "SUPPLIER" | "RETAILER";
3136
+ }>;
3137
+ dc4Id: z.ZodNumber;
3138
+ }, "strip", z.ZodTypeAny, {
3139
+ name: string;
3140
+ orgId: string;
3141
+ companyId: number;
3142
+ companyType: {
3143
+ type: "SUPPLIER" | "RETAILER";
3144
+ display: "SUPPLIER" | "RETAILER";
3145
+ };
3146
+ dc4Id: number;
3147
+ }, {
3148
+ name: string;
3149
+ orgId: string;
3150
+ companyId: number;
3151
+ companyType: {
3152
+ type: "SUPPLIER" | "RETAILER";
3153
+ display: "SUPPLIER" | "RETAILER";
3154
+ };
3155
+ dc4Id: number;
3156
+ }>;
3157
+ type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
3158
+
3159
+ export { AsstClient as A, BASE_URLS as B, CompanyBriefByOrg as C, attributeValidValuesSchema as D, Export as E, itemSearchViewSchema as F, itemDetailViewSchema as G, localeSchema as H, ImportErrors as I, spreadsheetTemplateSchema as J, tradingPartnerAccessByCompanyIdSchema as K, Locale as L, companyRelationshipUpsertBodySchema as M, userAccountSchema as N, itemErrorDetailsResultSchema as O, companyBriefByOrgSchema as P, SpreadsheetTemplate as S, TradingPartnerAccessByCompanyId as T, UserAccount as U, VendorPartnerAttGroups as V, Import as a, ImportsStatus as b, ItemCategoriesSearch as c, attrProdTypeSchema as d, CompanyRelationshipUpsertBody as e, ItemErrorDetailsResult as f, ItemSearchView as g, ItemDetailView as h, AttributeMetaData as i, AttributesByCompany as j, AttributeDefinition as k, AttributeValidValues as l, AttrProdType as m, envSchema as n, AsstClientOptions as o, AsstUrl as p, Env as q, importErrorsSchema as r, importSchema as s, importsStatusSchema as t, exportSchema as u, vendorPartnerAttGroupsSchema as v, itemCategoriesSearchSchema as w, attributeDefinitionSchema as x, attributeMetaDataSchema as y, attributesByCompanySchema as z };
@@ -4,6 +4,7 @@ import {
4
4
  attributeMetaDataSchema,
5
5
  attributeValidValuesSchema,
6
6
  attributesByCompanySchema,
7
+ companyBriefByOrgSchema,
7
8
  importErrorsSchema,
8
9
  importSchema,
9
10
  importsStatusSchema,
@@ -20,7 +21,7 @@ import {
20
21
  userAccountSchema,
21
22
  vendorPartnerAttGroupsSchema,
22
23
  z
23
- } from "./chunk-HEFVXX2V.js";
24
+ } from "./chunk-VICSFYTR.js";
24
25
 
25
26
  // lib/imports/index.ts
26
27
  var BASE_URL = "imports";
@@ -83,8 +84,11 @@ function createImportsApi(client) {
83
84
  var BASE_URL2 = "exports";
84
85
  var BASE_URL_V2 = "v2/exports";
85
86
  function createExportsApi(client) {
86
- async function createExport(data) {
87
- await client.post(`${BASE_URL_V2}/add`, { json: data });
87
+ async function createExport(data, params) {
88
+ await client.post(`${BASE_URL_V2}/add`, {
89
+ json: data,
90
+ searchParams: params
91
+ });
88
92
  }
89
93
  async function downloadItems(params) {
90
94
  const searchParams = { ...params, ids: params.ids.join(",") };
@@ -134,14 +138,23 @@ function createProductTypesApi(client) {
134
138
  // lib/tradingPartners/index.ts
135
139
  var BASE_URL4 = "trading-partner-access";
136
140
  function createTradingPartnerAccessApi(client) {
137
- async function getAllTradingPartners(signal) {
141
+ async function getAllTradingPartners(params, signal) {
138
142
  const data = await client.get(`${BASE_URL4}/connections`, {
143
+ searchParams: params,
139
144
  signal
140
145
  }).json();
141
146
  return tradingPartnerAccessByCompanyIdSchema.parse(data);
142
147
  }
148
+ async function upsertRelationship(data) {
149
+ return await client.post(`${BASE_URL4}/upsert-relationship`, { json: data }).json();
150
+ }
151
+ async function upsertHierarchy(data) {
152
+ await client.post(`${BASE_URL4}/upsert-hierarchy`, { json: data }).json();
153
+ }
143
154
  return {
144
- getAllTradingPartners
155
+ getAllTradingPartners,
156
+ upsertRelationship,
157
+ upsertHierarchy
145
158
  };
146
159
  }
147
160
 
@@ -166,6 +179,9 @@ function createCategoriesApi(client) {
166
179
  if (params?.selectionCodeId) {
167
180
  searchParams.selectionCodeId = params.selectionCodeId;
168
181
  }
182
+ if (params?.orgId) {
183
+ searchParams.orgId = params.orgId;
184
+ }
169
185
  const data = await client.get(`${BASE_URL5}/search-category`, {
170
186
  searchParams,
171
187
  signal,
@@ -181,6 +197,9 @@ function createCategoriesApi(client) {
181
197
  if (params?.catalogId) {
182
198
  searchParams.catalogId = params.catalogId;
183
199
  }
200
+ if (params?.orgId) {
201
+ searchParams.orgId = params.orgId;
202
+ }
184
203
  const data = await client.get(`${BASE_URL5}/search-category`, {
185
204
  searchParams,
186
205
  signal
@@ -218,8 +237,11 @@ function createAttributesApi(client) {
218
237
  }).json();
219
238
  return z.array(attributeValidValuesSchema).parse(data);
220
239
  }
221
- async function getCompanyInterestedAttributes(signal) {
222
- const data = await client.get(`${BASE_URL6}/company/interested-attributes`, { signal }).json();
240
+ async function getCompanyInterestedAttributes(params, signal) {
241
+ const data = await client.get(`${BASE_URL6}/company/interested-attributes`, {
242
+ searchParams: params,
243
+ signal
244
+ }).json();
223
245
  return z.array(z.string()).parse(data);
224
246
  }
225
247
  return {
@@ -246,8 +268,8 @@ function createLocaleApi(client) {
246
268
  // lib/spreadsheetTemplate/index.ts
247
269
  var BASE_URL8 = "templates";
248
270
  function createSpreadsheetTemplateApi(client) {
249
- async function getTemplates(signal) {
250
- const data = await client.get(`${BASE_URL8}`, { signal }).json();
271
+ async function getTemplates(params, signal) {
272
+ const data = await client.get(`${BASE_URL8}`, { searchParams: params, signal }).json();
251
273
  return z.array(spreadsheetTemplateSchema).parse(data);
252
274
  }
253
275
  return {
@@ -290,8 +312,15 @@ function createFeatureFlagsApi(client) {
290
312
  }).json();
291
313
  return z.boolean().parse(data);
292
314
  }
315
+ async function checkEnableItemsLevelMSIS(signal) {
316
+ const data = await client.get(`${BASE_URL11}/enable-item-level-msis/`, {
317
+ signal
318
+ }).json();
319
+ return z.boolean().parse(data);
320
+ }
293
321
  return {
294
- checkEnableItemsApiEndpointsForImports
322
+ checkEnableItemsApiEndpointsForImports,
323
+ checkEnableItemsLevelMSIS
295
324
  };
296
325
  }
297
326
 
@@ -358,6 +387,32 @@ function createErrorsApi(client) {
358
387
  };
359
388
  }
360
389
 
390
+ // lib/uniqueCriteria/index.ts
391
+ var BASE_URL14 = "uniquecriteria";
392
+ function createUniqueCriteriaApi(client) {
393
+ async function getUniqueCriteriaByOrg(params, signal) {
394
+ const data = await client.get(`${BASE_URL14}/org`, {
395
+ searchParams: params,
396
+ signal
397
+ }).json();
398
+ return z.array(z.string()).parse(data);
399
+ }
400
+ return { getUniqueCriteriaByOrg };
401
+ }
402
+
403
+ // lib/companies/index.ts
404
+ var BASE_URL15 = "companys";
405
+ function createCompaniesApi(client) {
406
+ async function getCompanyBriefInfoByOrg(params, signal) {
407
+ const data = await client.get(`${BASE_URL15}/brief`, {
408
+ searchParams: params,
409
+ signal
410
+ }).json();
411
+ return companyBriefByOrgSchema.parse(data);
412
+ }
413
+ return { getCompanyBriefInfoByOrg };
414
+ }
415
+
361
416
  export {
362
417
  BASE_URL,
363
418
  createImportsApi,
@@ -385,5 +440,8 @@ export {
385
440
  BASE_URL12,
386
441
  createItemsApi,
387
442
  BASE_URL13,
388
- createErrorsApi
443
+ createErrorsApi,
444
+ BASE_URL14,
445
+ createUniqueCriteriaApi,
446
+ createCompaniesApi
389
447
  };
@@ -3685,14 +3685,16 @@ var z = /* @__PURE__ */ Object.freeze({
3685
3685
 
3686
3686
  // lib/asstClient.ts
3687
3687
  var baseUrlsSchema = z.object({
3688
- local: z.literal("https://localhost:8443"),
3689
- test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
3690
- prod: z.literal("https://api.spscommerce.com/assortment/gateway")
3688
+ local: z.literal("https://localhost:8443/"),
3689
+ test: z.literal(
3690
+ "https://integration.api.spscommerce.com/assortment/gateway/"
3691
+ ),
3692
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway/")
3691
3693
  });
3692
3694
  var BASE_URLS = {
3693
- local: "https://localhost:8443",
3694
- test: "https://integration.api.spscommerce.com/assortment/gateway",
3695
- prod: "https://api.spscommerce.com/assortment/gateway"
3695
+ local: "https://localhost:8443/",
3696
+ test: "https://integration.api.spscommerce.com/assortment/gateway/",
3697
+ prod: "https://api.spscommerce.com/assortment/gateway/"
3696
3698
  };
3697
3699
  var envSchema = baseUrlsSchema.keyof();
3698
3700
  var initialConfig = {
@@ -4435,6 +4437,27 @@ var connectionSchema = z.object({
4435
4437
  partner_org_id: z.string()
4436
4438
  });
4437
4439
 
4440
+ // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4441
+ var companyRelationshipUpsertBodySchema = z.object({
4442
+ supplierId: z.number(),
4443
+ retailerId: z.number(),
4444
+ catalogId: z.number(),
4445
+ isActive: z.boolean(),
4446
+ applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4447
+ });
4448
+
4449
+ // lib/tradingPartners/models/ItemPartner.ts
4450
+ var itemPartnerSchema = z.object({
4451
+ itemPartnerId: z.number(),
4452
+ retailerId: z.number(),
4453
+ supplierId: z.number(),
4454
+ catalogId: z.number(),
4455
+ isActive: z.number(),
4456
+ createdDate: z.string(),
4457
+ modifiedDate: z.string(),
4458
+ applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4459
+ });
4460
+
4438
4461
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4439
4462
  var tradingPartnerAccessByCompanyIdSchema = z.object({
4440
4463
  companyId: z.number(),
@@ -4561,6 +4584,18 @@ var itemErrorDetailsResultSchema = z.object({
4561
4584
  itemErrorDetails: z.array(itemErrorDetailsSchema)
4562
4585
  });
4563
4586
 
4587
+ // lib/companies/models/CompanyBriefByOrg.ts
4588
+ var companyBriefByOrgSchema = z.object({
4589
+ companyId: z.number(),
4590
+ name: z.string(),
4591
+ orgId: z.string(),
4592
+ companyType: z.object({
4593
+ type: z.enum(["SUPPLIER", "RETAILER"]),
4594
+ display: z.enum(["SUPPLIER", "RETAILER"])
4595
+ }),
4596
+ dc4Id: z.number()
4597
+ });
4598
+
4564
4599
  export {
4565
4600
  z,
4566
4601
  BASE_URLS,
@@ -4577,6 +4612,8 @@ export {
4577
4612
  attrProdTypeSchema,
4578
4613
  pagedResultsSchema,
4579
4614
  connectionSchema,
4615
+ companyRelationshipUpsertBodySchema,
4616
+ itemPartnerSchema,
4580
4617
  tradingPartnerAccessByCompanyIdSchema,
4581
4618
  itemCategorySchema,
4582
4619
  itemCategoriesSearchSchema,
@@ -4613,6 +4650,7 @@ export {
4613
4650
  downLoadItemsParamsSchema,
4614
4651
  itemErrorDetailsSchema,
4615
4652
  itemErrorDetailsResultSchema,
4653
+ companyBriefByOrgSchema,
4616
4654
  attributeDetailSchema,
4617
4655
  categoryEnumSchema,
4618
4656
  componentDetailsSchema,
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { A as AsstClient, C as CompanyBriefByOrg } from './CompanyBriefByOrg-eea5479d.js';
2
3
 
3
4
  declare const itemStatusResponseSchema: z.ZodObject<{
4
5
  itemStatuses: z.ZodArray<z.ZodObject<{
@@ -88,4 +89,15 @@ declare const itemStatusResponseSchema: z.ZodObject<{
88
89
  }>;
89
90
  type ItemStatusResponse = z.infer<typeof itemStatusResponseSchema>;
90
91
 
91
- export { ItemStatusResponse as I };
92
+ /**
93
+ * Initialize Companies Api functions
94
+ * @param client Assortment Client instance
95
+ * @returns A CompanyBriefByOrg object containing Companies API functions
96
+ */
97
+ declare function createCompaniesApi(client: AsstClient): {
98
+ getCompanyBriefInfoByOrg: (params?: {
99
+ orgId?: string;
100
+ }, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
101
+ };
102
+
103
+ export { ItemStatusResponse as I, createCompaniesApi as c };
package/dist/index.cjs CHANGED
@@ -34,6 +34,7 @@ __export(lib_exports, {
34
34
  BASE_URLS: () => BASE_URLS,
35
35
  createAttributesApi: () => createAttributesApi,
36
36
  createCategoriesApi: () => createCategoriesApi,
37
+ createCompaniesApi: () => createCompaniesApi,
37
38
  createCompanyFeaturesApi: () => createCompanyFeaturesApi,
38
39
  createErrorsApi: () => createErrorsApi,
39
40
  createExportsApi: () => createExportsApi,
@@ -44,7 +45,9 @@ __export(lib_exports, {
44
45
  createProductTypesApi: () => createProductTypesApi,
45
46
  createSpreadsheetTemplateApi: () => createSpreadsheetTemplateApi,
46
47
  createTradingPartnerAccessApi: () => createTradingPartnerAccessApi,
47
- createWhoAmIApi: () => createWhoAmIApi
48
+ createUniqueCriteriaApi: () => createUniqueCriteriaApi,
49
+ createWhoAmIApi: () => createWhoAmIApi,
50
+ envSchema: () => envSchema
48
51
  });
49
52
  module.exports = __toCommonJS(lib_exports);
50
53
 
@@ -3735,14 +3738,16 @@ var z = /* @__PURE__ */ Object.freeze({
3735
3738
 
3736
3739
  // lib/asstClient.ts
3737
3740
  var baseUrlsSchema = z.object({
3738
- local: z.literal("https://localhost:8443"),
3739
- test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
3740
- prod: z.literal("https://api.spscommerce.com/assortment/gateway")
3741
+ local: z.literal("https://localhost:8443/"),
3742
+ test: z.literal(
3743
+ "https://integration.api.spscommerce.com/assortment/gateway/"
3744
+ ),
3745
+ prod: z.literal("https://api.spscommerce.com/assortment/gateway/")
3741
3746
  });
3742
3747
  var BASE_URLS = {
3743
- local: "https://localhost:8443",
3744
- test: "https://integration.api.spscommerce.com/assortment/gateway",
3745
- prod: "https://api.spscommerce.com/assortment/gateway"
3748
+ local: "https://localhost:8443/",
3749
+ test: "https://integration.api.spscommerce.com/assortment/gateway/",
3750
+ prod: "https://api.spscommerce.com/assortment/gateway/"
3746
3751
  };
3747
3752
  var envSchema = baseUrlsSchema.keyof();
3748
3753
  var initialConfig = {
@@ -3933,8 +3938,11 @@ function createImportsApi(client) {
3933
3938
  var BASE_URL2 = "exports";
3934
3939
  var BASE_URL_V2 = "v2/exports";
3935
3940
  function createExportsApi(client) {
3936
- async function createExport(data) {
3937
- await client.post(`${BASE_URL_V2}/add`, { json: data });
3941
+ async function createExport(data, params) {
3942
+ await client.post(`${BASE_URL_V2}/add`, {
3943
+ json: data,
3944
+ searchParams: params
3945
+ });
3938
3946
  }
3939
3947
  async function downloadItems(params) {
3940
3948
  const searchParams = { ...params, ids: params.ids.join(",") };
@@ -4002,6 +4010,27 @@ var connectionSchema = z.object({
4002
4010
  partner_org_id: z.string()
4003
4011
  });
4004
4012
 
4013
+ // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4014
+ var companyRelationshipUpsertBodySchema = z.object({
4015
+ supplierId: z.number(),
4016
+ retailerId: z.number(),
4017
+ catalogId: z.number(),
4018
+ isActive: z.boolean(),
4019
+ applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4020
+ });
4021
+
4022
+ // lib/tradingPartners/models/ItemPartner.ts
4023
+ var itemPartnerSchema = z.object({
4024
+ itemPartnerId: z.number(),
4025
+ retailerId: z.number(),
4026
+ supplierId: z.number(),
4027
+ catalogId: z.number(),
4028
+ isActive: z.number(),
4029
+ createdDate: z.string(),
4030
+ modifiedDate: z.string(),
4031
+ applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4032
+ });
4033
+
4005
4034
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4006
4035
  var tradingPartnerAccessByCompanyIdSchema = z.object({
4007
4036
  companyId: z.number(),
@@ -4015,14 +4044,23 @@ var tradingPartnerAccessByCompanyIdSchema = z.object({
4015
4044
  // lib/tradingPartners/index.ts
4016
4045
  var BASE_URL4 = "trading-partner-access";
4017
4046
  function createTradingPartnerAccessApi(client) {
4018
- async function getAllTradingPartners(signal) {
4047
+ async function getAllTradingPartners(params, signal) {
4019
4048
  const data = await client.get(`${BASE_URL4}/connections`, {
4049
+ searchParams: params,
4020
4050
  signal
4021
4051
  }).json();
4022
4052
  return tradingPartnerAccessByCompanyIdSchema.parse(data);
4023
4053
  }
4054
+ async function upsertRelationship(data) {
4055
+ return await client.post(`${BASE_URL4}/upsert-relationship`, { json: data }).json();
4056
+ }
4057
+ async function upsertHierarchy(data) {
4058
+ await client.post(`${BASE_URL4}/upsert-hierarchy`, { json: data }).json();
4059
+ }
4024
4060
  return {
4025
- getAllTradingPartners
4061
+ getAllTradingPartners,
4062
+ upsertRelationship,
4063
+ upsertHierarchy
4026
4064
  };
4027
4065
  }
4028
4066
 
@@ -4093,6 +4131,9 @@ function createCategoriesApi(client) {
4093
4131
  if (params?.selectionCodeId) {
4094
4132
  searchParams.selectionCodeId = params.selectionCodeId;
4095
4133
  }
4134
+ if (params?.orgId) {
4135
+ searchParams.orgId = params.orgId;
4136
+ }
4096
4137
  const data = await client.get(`${BASE_URL5}/search-category`, {
4097
4138
  searchParams,
4098
4139
  signal,
@@ -4108,6 +4149,9 @@ function createCategoriesApi(client) {
4108
4149
  if (params?.catalogId) {
4109
4150
  searchParams.catalogId = params.catalogId;
4110
4151
  }
4152
+ if (params?.orgId) {
4153
+ searchParams.orgId = params.orgId;
4154
+ }
4111
4155
  const data = await client.get(`${BASE_URL5}/search-category`, {
4112
4156
  searchParams,
4113
4157
  signal
@@ -4299,8 +4343,11 @@ function createAttributesApi(client) {
4299
4343
  }).json();
4300
4344
  return z.array(attributeValidValuesSchema).parse(data);
4301
4345
  }
4302
- async function getCompanyInterestedAttributes(signal) {
4303
- const data = await client.get(`${BASE_URL6}/company/interested-attributes`, { signal }).json();
4346
+ async function getCompanyInterestedAttributes(params, signal) {
4347
+ const data = await client.get(`${BASE_URL6}/company/interested-attributes`, {
4348
+ searchParams: params,
4349
+ signal
4350
+ }).json();
4304
4351
  return z.array(z.string()).parse(data);
4305
4352
  }
4306
4353
  return {
@@ -4354,8 +4401,8 @@ var spreadsheetTemplateSchema = z.object({
4354
4401
  // lib/spreadsheetTemplate/index.ts
4355
4402
  var BASE_URL8 = "templates";
4356
4403
  function createSpreadsheetTemplateApi(client) {
4357
- async function getTemplates(signal) {
4358
- const data = await client.get(`${BASE_URL8}`, { signal }).json();
4404
+ async function getTemplates(params, signal) {
4405
+ const data = await client.get(`${BASE_URL8}`, { searchParams: params, signal }).json();
4359
4406
  return z.array(spreadsheetTemplateSchema).parse(data);
4360
4407
  }
4361
4408
  return {
@@ -4491,8 +4538,15 @@ function createFeatureFlagsApi(client) {
4491
4538
  }).json();
4492
4539
  return z.boolean().parse(data);
4493
4540
  }
4541
+ async function checkEnableItemsLevelMSIS(signal) {
4542
+ const data = await client.get(`${BASE_URL11}/enable-item-level-msis/`, {
4543
+ signal
4544
+ }).json();
4545
+ return z.boolean().parse(data);
4546
+ }
4494
4547
  return {
4495
- checkEnableItemsApiEndpointsForImports
4548
+ checkEnableItemsApiEndpointsForImports,
4549
+ checkEnableItemsLevelMSIS
4496
4550
  };
4497
4551
  }
4498
4552
 
@@ -4642,6 +4696,18 @@ var itemErrorDetailsResultSchema = z.object({
4642
4696
  itemErrorDetails: z.array(itemErrorDetailsSchema)
4643
4697
  });
4644
4698
 
4699
+ // lib/companies/models/CompanyBriefByOrg.ts
4700
+ var companyBriefByOrgSchema = z.object({
4701
+ companyId: z.number(),
4702
+ name: z.string(),
4703
+ orgId: z.string(),
4704
+ companyType: z.object({
4705
+ type: z.enum(["SUPPLIER", "RETAILER"]),
4706
+ display: z.enum(["SUPPLIER", "RETAILER"])
4707
+ }),
4708
+ dc4Id: z.number()
4709
+ });
4710
+
4645
4711
  // lib/items/models/AttributeDetail.ts
4646
4712
  var attributeDetailSchema = z.object({
4647
4713
  type: attrDatatypeNameEnumSchema,
@@ -4936,12 +5002,39 @@ function createErrorsApi(client) {
4936
5002
  getInvalidItemErrorDetails
4937
5003
  };
4938
5004
  }
5005
+
5006
+ // lib/uniqueCriteria/index.ts
5007
+ var BASE_URL14 = "uniquecriteria";
5008
+ function createUniqueCriteriaApi(client) {
5009
+ async function getUniqueCriteriaByOrg(params, signal) {
5010
+ const data = await client.get(`${BASE_URL14}/org`, {
5011
+ searchParams: params,
5012
+ signal
5013
+ }).json();
5014
+ return z.array(z.string()).parse(data);
5015
+ }
5016
+ return { getUniqueCriteriaByOrg };
5017
+ }
5018
+
5019
+ // lib/companies/index.ts
5020
+ var BASE_URL15 = "companys";
5021
+ function createCompaniesApi(client) {
5022
+ async function getCompanyBriefInfoByOrg(params, signal) {
5023
+ const data = await client.get(`${BASE_URL15}/brief`, {
5024
+ searchParams: params,
5025
+ signal
5026
+ }).json();
5027
+ return companyBriefByOrgSchema.parse(data);
5028
+ }
5029
+ return { getCompanyBriefInfoByOrg };
5030
+ }
4939
5031
  // Annotate the CommonJS export names for ESM import in node:
4940
5032
  0 && (module.exports = {
4941
5033
  AsstClient,
4942
5034
  BASE_URLS,
4943
5035
  createAttributesApi,
4944
5036
  createCategoriesApi,
5037
+ createCompaniesApi,
4945
5038
  createCompanyFeaturesApi,
4946
5039
  createErrorsApi,
4947
5040
  createExportsApi,
@@ -4952,5 +5045,7 @@ function createErrorsApi(client) {
4952
5045
  createProductTypesApi,
4953
5046
  createSpreadsheetTemplateApi,
4954
5047
  createTradingPartnerAccessApi,
4955
- createWhoAmIApi
5048
+ createUniqueCriteriaApi,
5049
+ createWhoAmIApi,
5050
+ envSchema
4956
5051
  });