@spscommerce/asst-api 4.3.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CI3ZSIT4.js → chunk-V2XRXJIJ.js} +129 -33
- package/dist/{chunk-RPGGEEFE.js → chunk-WODMKML4.js} +1 -1
- package/dist/{chunk-LKUGPDIT.js → chunk-YT2B4UAK.js} +33 -0
- package/dist/index.cjs +157 -32
- package/dist/index.d.cts +127 -11
- package/dist/index.d.ts +127 -11
- package/dist/index.js +3 -3
- package/dist/msw.cjs +70 -1
- package/dist/msw.d.cts +27 -6
- package/dist/msw.d.ts +27 -6
- package/dist/msw.js +36 -3
- package/dist/zod.cjs +31 -0
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.ts +1 -1
- package/dist/zod.js +2 -2
- package/package.json +1 -1
- package/dist/SpsItemIdResponse-0VgfCmG_.d.cts +0 -84
- package/dist/SpsItemIdResponse-0VgfCmG_.d.ts +0 -84
- package/dist/SpsItemIdResponse-CI_Ao86P.d.cts +0 -87
- package/dist/SpsItemIdResponse-CI_Ao86P.d.ts +0 -87
- package/dist/chunk-355LPVI6.js +0 -126
- package/dist/chunk-55ECRTUX.js +0 -79
- package/dist/chunk-63KIELUR.js +0 -128
- package/dist/chunk-DK2OMRWR.js +0 -134
- package/dist/chunk-FCUIJXCD.js +0 -544
- package/dist/chunk-L4AWOEED.js +0 -4892
- package/dist/chunk-NFZI7D22.js +0 -544
- package/dist/chunk-NUUQDRHD.js +0 -4899
- package/dist/zod-C3fOiO-H.d.cts +0 -5900
- package/dist/zod-CJ6AFTQr.d.ts +0 -5900
- package/dist/zod-CJmsC_DX.d.cts +0 -5900
- package/dist/zod-CzPw-bfk.d.cts +0 -5900
- package/dist/zod-vDuspd-x.d.ts +0 -5900
- package/dist/zod-xWM6u1LJ.d.ts +0 -5900
- package/dist/{zod-C41Rts8D.d.cts → zod-CJ7lvFQH.d.cts} +44 -44
- package/dist/{zod-COyz02Lh.d.ts → zod-j6CrX5vY.d.ts} +44 -44
package/dist/index.cjs
CHANGED
|
@@ -4244,9 +4244,21 @@ var generateImportTemplateParamsSchema = external_exports.object({
|
|
|
4244
4244
|
productTypeIds: external_exports.string().optional()
|
|
4245
4245
|
});
|
|
4246
4246
|
|
|
4247
|
+
// lib/util.ts
|
|
4248
|
+
function getCompanyTypeSearchParams({
|
|
4249
|
+
params,
|
|
4250
|
+
companyType
|
|
4251
|
+
}) {
|
|
4252
|
+
const merged = {
|
|
4253
|
+
...params ?? {},
|
|
4254
|
+
...companyType ? { companyType } : {}
|
|
4255
|
+
};
|
|
4256
|
+
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4247
4259
|
// lib/imports/index.ts
|
|
4248
4260
|
var BASE_URL = "imports";
|
|
4249
|
-
function createImportsApi(client) {
|
|
4261
|
+
function createImportsApi(client, companyType) {
|
|
4250
4262
|
async function getImportErrors(importId, params, signal) {
|
|
4251
4263
|
const data = await client.get(`${BASE_URL}/${importId}/errors`, { searchParams: params, signal }).json();
|
|
4252
4264
|
return importErrorsSchema.parse(data);
|
|
@@ -4259,22 +4271,28 @@ function createImportsApi(client) {
|
|
|
4259
4271
|
return importSchema.parse(data);
|
|
4260
4272
|
}
|
|
4261
4273
|
async function getImportsStatus(signal) {
|
|
4262
|
-
const data = await client.get(`${BASE_URL}/status`, {
|
|
4274
|
+
const data = await client.get(`${BASE_URL}/status`, {
|
|
4275
|
+
signal,
|
|
4276
|
+
searchParams: getCompanyTypeSearchParams({ companyType })
|
|
4277
|
+
}).json();
|
|
4263
4278
|
return external_exports.array(importsStatusSchema).parse(data);
|
|
4264
4279
|
}
|
|
4265
4280
|
async function uploadImport(file) {
|
|
4266
4281
|
await client.post(`${BASE_URL}`, { body: file });
|
|
4267
4282
|
}
|
|
4268
4283
|
async function getVendorPartnerGroups(signal) {
|
|
4269
|
-
const data = await client.get(`${BASE_URL}/template/vendor-partner-groups`, {
|
|
4284
|
+
const data = await client.get(`${BASE_URL}/template/vendor-partner-groups`, {
|
|
4285
|
+
signal,
|
|
4286
|
+
searchParams: getCompanyTypeSearchParams({ companyType })
|
|
4287
|
+
}).json();
|
|
4270
4288
|
return external_exports.array(vendorPartnerAttGroupsSchema).parse(data);
|
|
4271
4289
|
}
|
|
4272
4290
|
async function generateImportTemplate(params) {
|
|
4273
4291
|
const response = await client.get(`${BASE_URL}/template/generate`, {
|
|
4274
|
-
searchParams: params,
|
|
4275
4292
|
headers: {
|
|
4276
4293
|
Accept: "application/octet-stream"
|
|
4277
4294
|
},
|
|
4295
|
+
searchParams: getCompanyTypeSearchParams({ params, companyType }),
|
|
4278
4296
|
timeout: false
|
|
4279
4297
|
});
|
|
4280
4298
|
const disposition = response.headers.get("content-disposition") || "";
|
|
@@ -4304,7 +4322,7 @@ function createImportsApi(client) {
|
|
|
4304
4322
|
// lib/exports/index.ts
|
|
4305
4323
|
var BASE_URL2 = "exports";
|
|
4306
4324
|
var BASE_URL_V2 = "v2/exports";
|
|
4307
|
-
function createExportsApi(client) {
|
|
4325
|
+
function createExportsApi(client, companyType) {
|
|
4308
4326
|
async function createExport(data, params) {
|
|
4309
4327
|
await client.post(`${BASE_URL_V2}/add`, {
|
|
4310
4328
|
json: data,
|
|
@@ -4318,7 +4336,7 @@ function createExportsApi(client) {
|
|
|
4318
4336
|
availableAttributes: params.availableAttributes?.join(",") ?? ""
|
|
4319
4337
|
};
|
|
4320
4338
|
const response = await client.get(`${BASE_URL2}/spreadsheet/by-item`, {
|
|
4321
|
-
searchParams,
|
|
4339
|
+
searchParams: getCompanyTypeSearchParams({ params: searchParams, companyType }),
|
|
4322
4340
|
headers: {
|
|
4323
4341
|
Accept: "application/octet-stream"
|
|
4324
4342
|
},
|
|
@@ -4448,9 +4466,10 @@ var retailerTradingPartnerStages = external_exports.array(
|
|
|
4448
4466
|
|
|
4449
4467
|
// lib/tradingPartnerSettings/index.ts
|
|
4450
4468
|
var BASE_URL5 = "trading-partner-settings";
|
|
4451
|
-
function createTradingPartnerSettingsApi(client) {
|
|
4469
|
+
function createTradingPartnerSettingsApi(client, companyType) {
|
|
4452
4470
|
async function getRetailerStages(signal) {
|
|
4453
4471
|
const data = await client.get(`${BASE_URL5}/stages/retailer-configured`, {
|
|
4472
|
+
searchParams: getCompanyTypeSearchParams({ companyType }),
|
|
4454
4473
|
signal
|
|
4455
4474
|
}).json();
|
|
4456
4475
|
return retailerTradingPartnerStages.parse(data);
|
|
@@ -4504,6 +4523,34 @@ var itemHierarchyResponseSchema = external_exports.object({
|
|
|
4504
4523
|
)
|
|
4505
4524
|
});
|
|
4506
4525
|
|
|
4526
|
+
// lib/categories/models/CatalogManagement.ts
|
|
4527
|
+
var catalogCreateRequestSchema = external_exports.object({
|
|
4528
|
+
categoryName: external_exports.string(),
|
|
4529
|
+
categoryCompanyId: external_exports.number(),
|
|
4530
|
+
categoryTypeId: external_exports.number(),
|
|
4531
|
+
categoryDescription: external_exports.string().optional()
|
|
4532
|
+
});
|
|
4533
|
+
var catalogCreateResponseSchema = external_exports.object({
|
|
4534
|
+
categoryId: external_exports.number()
|
|
4535
|
+
});
|
|
4536
|
+
var catalogSearchParamsSchema = external_exports.object({
|
|
4537
|
+
ownerCompanyIds: external_exports.array(external_exports.number()).optional(),
|
|
4538
|
+
searchTerms: external_exports.string().optional(),
|
|
4539
|
+
categoryType: external_exports.literal("CATALOG")
|
|
4540
|
+
});
|
|
4541
|
+
var catalogBriefResponseSchema = external_exports.object({
|
|
4542
|
+
categoryId: external_exports.number(),
|
|
4543
|
+
categoryName: external_exports.string(),
|
|
4544
|
+
categoryDescription: external_exports.string(),
|
|
4545
|
+
categoryDescriptionExt: external_exports.string(),
|
|
4546
|
+
ownerCompanyId: external_exports.string(),
|
|
4547
|
+
categoryTypeId: external_exports.number(),
|
|
4548
|
+
createdAt: external_exports.string(),
|
|
4549
|
+
modifiedAt: external_exports.string(),
|
|
4550
|
+
createdBy: external_exports.string(),
|
|
4551
|
+
modifiedBy: external_exports.string()
|
|
4552
|
+
});
|
|
4553
|
+
|
|
4507
4554
|
// lib/categories/index.ts
|
|
4508
4555
|
var BASE_URL6 = "categories";
|
|
4509
4556
|
function createCategoriesApi(client) {
|
|
@@ -4556,11 +4603,41 @@ function createCategoriesApi(client) {
|
|
|
4556
4603
|
const data = await client.post(`${BASE_URL6}/item-hierarchy`, { json: { itemIds } }).json();
|
|
4557
4604
|
return itemHierarchyResponseSchema.parse(data);
|
|
4558
4605
|
}
|
|
4606
|
+
async function createCatalog(params, signal) {
|
|
4607
|
+
const data = await client.post("category", {
|
|
4608
|
+
json: params,
|
|
4609
|
+
signal
|
|
4610
|
+
}).json();
|
|
4611
|
+
return catalogCreateResponseSchema.parse(data);
|
|
4612
|
+
}
|
|
4613
|
+
async function searchCatalogsByCompany(params, signal) {
|
|
4614
|
+
const url = "category/brief/CATALOG/search";
|
|
4615
|
+
const searchParams = new URLSearchParams();
|
|
4616
|
+
if (params.ownerCompanyIds?.length) {
|
|
4617
|
+
for (const id of params.ownerCompanyIds) {
|
|
4618
|
+
searchParams.append("ownerCompanyIds", id.toString());
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4621
|
+
if (params.searchTerms) {
|
|
4622
|
+
searchParams.set("searchTerms", params.searchTerms);
|
|
4623
|
+
}
|
|
4624
|
+
const data = await client.get(url, {
|
|
4625
|
+
searchParams,
|
|
4626
|
+
signal
|
|
4627
|
+
}).json();
|
|
4628
|
+
return external_exports.array(catalogBriefResponseSchema).parse(data);
|
|
4629
|
+
}
|
|
4630
|
+
async function createCategoryHierarchy(searchParams) {
|
|
4631
|
+
return await client.post(`${BASE_URL6}/hierarchy`, { searchParams }).json();
|
|
4632
|
+
}
|
|
4559
4633
|
return {
|
|
4560
4634
|
getCatalogs,
|
|
4561
4635
|
getProductCodes,
|
|
4562
4636
|
getSelectionCodes,
|
|
4563
|
-
getItemHierarchy
|
|
4637
|
+
getItemHierarchy,
|
|
4638
|
+
createCatalog,
|
|
4639
|
+
searchCatalogsByCompany,
|
|
4640
|
+
createCategoryHierarchy
|
|
4564
4641
|
};
|
|
4565
4642
|
}
|
|
4566
4643
|
|
|
@@ -4722,10 +4799,14 @@ function createWhoAmIApi(client) {
|
|
|
4722
4799
|
|
|
4723
4800
|
// lib/companyFeatures/index.ts
|
|
4724
4801
|
var BASE_URL10 = "feature";
|
|
4725
|
-
function createCompanyFeaturesApi(client) {
|
|
4802
|
+
function createCompanyFeaturesApi(client, companyType) {
|
|
4803
|
+
function getSearchParams() {
|
|
4804
|
+
return companyType && { companyType };
|
|
4805
|
+
}
|
|
4726
4806
|
async function checkIfStageItemSetupIsEnabled(signal) {
|
|
4727
4807
|
const data = await client.get(`${BASE_URL10}/isphaseditemsetupenabled`, {
|
|
4728
|
-
signal
|
|
4808
|
+
signal,
|
|
4809
|
+
searchParams: getSearchParams()
|
|
4729
4810
|
}).json();
|
|
4730
4811
|
return external_exports.boolean().parse(data);
|
|
4731
4812
|
}
|
|
@@ -4757,10 +4838,19 @@ function createFeatureFlagsApi(client) {
|
|
|
4757
4838
|
}).json();
|
|
4758
4839
|
return external_exports.boolean().parse(data);
|
|
4759
4840
|
}
|
|
4841
|
+
async function checkIfItemMatchEnabled(flagOptions = {}) {
|
|
4842
|
+
const { companyId, signal } = flagOptions;
|
|
4843
|
+
const path = companyId ? `${BASE_URL11}/enable-item-match-section/${companyId}/` : `${BASE_URL11}/enable-item-match-section/`;
|
|
4844
|
+
const data = await client.get(path, {
|
|
4845
|
+
signal
|
|
4846
|
+
}).json();
|
|
4847
|
+
return external_exports.boolean().parse(data);
|
|
4848
|
+
}
|
|
4760
4849
|
return {
|
|
4761
4850
|
checkEnableItemsLevelMSIS,
|
|
4762
4851
|
checkIfEnabledForPackagingHierarchies,
|
|
4763
|
-
checkIfEnabledForItemUomConversionRules
|
|
4852
|
+
checkIfEnabledForItemUomConversionRules,
|
|
4853
|
+
checkIfItemMatchEnabled
|
|
4764
4854
|
};
|
|
4765
4855
|
}
|
|
4766
4856
|
|
|
@@ -5082,18 +5172,17 @@ var itemStatusResponseSchema = external_exports.object({
|
|
|
5082
5172
|
|
|
5083
5173
|
// lib/items/v1/index.ts
|
|
5084
5174
|
var BASE_URL12 = "items";
|
|
5085
|
-
function createItemsApi(client) {
|
|
5086
|
-
function
|
|
5087
|
-
const
|
|
5088
|
-
|
|
5089
|
-
if (
|
|
5090
|
-
if (
|
|
5091
|
-
if (
|
|
5092
|
-
|
|
5093
|
-
return url ? `${queryParameterString}&${url}` : queryParameterString;
|
|
5175
|
+
function createItemsApi(client, companyType) {
|
|
5176
|
+
function getCoalescedParams(params = {}) {
|
|
5177
|
+
const queryParams = {};
|
|
5178
|
+
if (params.limit !== void 0) queryParams.limit = params.limit.toString();
|
|
5179
|
+
if (params.offset !== void 0) queryParams.offset = params.offset.toString();
|
|
5180
|
+
if (params.applicationType) queryParams.application = params.applicationType;
|
|
5181
|
+
if (params.url) queryParams.url = params.url;
|
|
5182
|
+
return Object.keys(queryParams).length > 0 ? queryParams : void 0;
|
|
5094
5183
|
}
|
|
5095
5184
|
async function searchItems(params, signal) {
|
|
5096
|
-
const searchParams =
|
|
5185
|
+
const searchParams = getCompanyTypeSearchParams({ params: getCoalescedParams(params), companyType });
|
|
5097
5186
|
const data = await client.get(`${BASE_URL12}`, { searchParams, signal }).json();
|
|
5098
5187
|
return itemSearchViewSchema.parse(data);
|
|
5099
5188
|
}
|
|
@@ -5104,6 +5193,7 @@ function createItemsApi(client) {
|
|
|
5104
5193
|
async function updateItem(itemId, item) {
|
|
5105
5194
|
await client.put(`${BASE_URL12}/details/${itemId}`, {
|
|
5106
5195
|
json: { ...item },
|
|
5196
|
+
searchParams: getCompanyTypeSearchParams({ companyType }),
|
|
5107
5197
|
timeout: 45e3
|
|
5108
5198
|
}).json();
|
|
5109
5199
|
}
|
|
@@ -5118,7 +5208,9 @@ function createItemsApi(client) {
|
|
|
5118
5208
|
await client.delete(`${BASE_URL12}`, { searchParams: params });
|
|
5119
5209
|
}
|
|
5120
5210
|
async function getItemInfoId(spsItemId, signal) {
|
|
5121
|
-
const data = await client.get(`${BASE_URL12}/${spsItemId}/itemInfoId`, {
|
|
5211
|
+
const data = await client.get(`${BASE_URL12}/${spsItemId}/itemInfoId`, { searchParams: getCompanyTypeSearchParams({
|
|
5212
|
+
companyType
|
|
5213
|
+
}), signal }).json();
|
|
5122
5214
|
return external_exports.number().parse(data);
|
|
5123
5215
|
}
|
|
5124
5216
|
async function getSpsItemId(itemInfoId, signal) {
|
|
@@ -5126,7 +5218,10 @@ function createItemsApi(client) {
|
|
|
5126
5218
|
return spsItemIdResponseSchema.parse(data);
|
|
5127
5219
|
}
|
|
5128
5220
|
async function getItemStatus(itemIds) {
|
|
5129
|
-
const data = await client.post(`${BASE_URL12}/status`, {
|
|
5221
|
+
const data = await client.post(`${BASE_URL12}/status`, {
|
|
5222
|
+
json: { itemIds },
|
|
5223
|
+
searchParams: getCompanyTypeSearchParams({ companyType })
|
|
5224
|
+
}).json();
|
|
5130
5225
|
return itemStatusResponseSchema.parse(data);
|
|
5131
5226
|
}
|
|
5132
5227
|
return {
|
|
@@ -5205,9 +5300,12 @@ var itemStatusV2ResponseSchema = external_exports.object({
|
|
|
5205
5300
|
|
|
5206
5301
|
// lib/items/v2/index.ts
|
|
5207
5302
|
var BASE_URL13 = "v2/items";
|
|
5208
|
-
function createItemsApiV2(client) {
|
|
5303
|
+
function createItemsApiV2(client, companyType) {
|
|
5209
5304
|
async function getItemStatus(itemIds) {
|
|
5210
|
-
const data = await client.post(`${BASE_URL13}/status`, {
|
|
5305
|
+
const data = await client.post(`${BASE_URL13}/status`, {
|
|
5306
|
+
json: { itemIds },
|
|
5307
|
+
searchParams: getCompanyTypeSearchParams({ companyType })
|
|
5308
|
+
}).json();
|
|
5211
5309
|
return itemStatusV2ResponseSchema.parse(data);
|
|
5212
5310
|
}
|
|
5213
5311
|
return {
|
|
@@ -5240,9 +5338,10 @@ var itemErrorDetailsResultSchema = external_exports.object({
|
|
|
5240
5338
|
|
|
5241
5339
|
// lib/errors/v1/index.ts
|
|
5242
5340
|
var BASE_URL14 = "errors";
|
|
5243
|
-
function createErrorsApi(client) {
|
|
5341
|
+
function createErrorsApi(client, companyType) {
|
|
5244
5342
|
async function getInvalidItemErrorDetails(itemInfoId, signal) {
|
|
5245
5343
|
const data = await client.get(`${BASE_URL14}/items/${itemInfoId}`, {
|
|
5344
|
+
searchParams: getCompanyTypeSearchParams({ companyType }),
|
|
5246
5345
|
signal
|
|
5247
5346
|
}).json();
|
|
5248
5347
|
return itemErrorDetailsResultSchema.parse(data);
|
|
@@ -5321,23 +5420,31 @@ var itemErrorDetailsResultV2Schema = external_exports.object({
|
|
|
5321
5420
|
|
|
5322
5421
|
// lib/errors/v2/index.ts
|
|
5323
5422
|
var BASE_URL15 = "errors/v2";
|
|
5324
|
-
function createErrorsApiV2(client) {
|
|
5423
|
+
function createErrorsApiV2(client, companyType) {
|
|
5325
5424
|
async function getItemErrorSummary(params, signal) {
|
|
5326
5425
|
const searchParams = new URLSearchParams();
|
|
5327
|
-
if (params.searchField)
|
|
5426
|
+
if (params.searchField)
|
|
5427
|
+
searchParams.append("searchField", params.searchField);
|
|
5328
5428
|
if (params.searchText) searchParams.append("searchText", params.searchText);
|
|
5329
5429
|
if (params.tradingPartnerIds) {
|
|
5330
|
-
params.tradingPartnerIds.forEach(
|
|
5430
|
+
params.tradingPartnerIds.forEach(
|
|
5431
|
+
(id) => searchParams.append("tradingPartnerIds", id.toString())
|
|
5432
|
+
);
|
|
5331
5433
|
}
|
|
5332
5434
|
if (params.offset) searchParams.append("offset", params.offset.toString());
|
|
5333
5435
|
if (params.limit) searchParams.append("limit", params.limit.toString());
|
|
5334
|
-
if (params.docInEventId)
|
|
5436
|
+
if (params.docInEventId)
|
|
5437
|
+
searchParams.append("docInEventId", params.docInEventId);
|
|
5335
5438
|
if (params.importId) searchParams.append("importId", params.importId);
|
|
5439
|
+
if (companyType) searchParams.append("companyType", companyType);
|
|
5336
5440
|
const data = await client.get(`${BASE_URL15}/summary`, { signal, searchParams }).json();
|
|
5337
5441
|
return itemErrorSummaryResultV2Schema.parse(data);
|
|
5338
5442
|
}
|
|
5339
5443
|
async function getItemErrorDetails(itemInfoId, signal) {
|
|
5340
|
-
const data = await client.get(`${BASE_URL15}/items/${itemInfoId}`, {
|
|
5444
|
+
const data = await client.get(`${BASE_URL15}/items/${itemInfoId}`, {
|
|
5445
|
+
searchParams: getCompanyTypeSearchParams({ companyType }),
|
|
5446
|
+
signal
|
|
5447
|
+
}).json();
|
|
5341
5448
|
return itemErrorDetailsResultV2Schema.parse(data);
|
|
5342
5449
|
}
|
|
5343
5450
|
return {
|
|
@@ -5376,9 +5483,20 @@ var FlattenedItemIdentifierKeysSchema = external_exports.enum(
|
|
|
5376
5483
|
FlattenedItemIdentifierKeys
|
|
5377
5484
|
);
|
|
5378
5485
|
|
|
5486
|
+
// lib/uniqueCriteria/models/UniqueCriteriaOptionsSchema.ts
|
|
5487
|
+
var uniqueCriteriaOptions = external_exports.object({
|
|
5488
|
+
name: external_exports.string(),
|
|
5489
|
+
value: external_exports.string()
|
|
5490
|
+
});
|
|
5491
|
+
var uniqueCriteriaOptionsSchema = external_exports.array(uniqueCriteriaOptions);
|
|
5492
|
+
|
|
5379
5493
|
// lib/uniqueCriteria/index.ts
|
|
5380
5494
|
var BASE_URL16 = "uniquecriteria";
|
|
5381
5495
|
function createUniqueCriteriaApi(client) {
|
|
5496
|
+
async function getUniqueCriteriaOptions() {
|
|
5497
|
+
const data = await client.get(`${BASE_URL16}`).json();
|
|
5498
|
+
return uniqueCriteriaOptionsSchema.parse(data);
|
|
5499
|
+
}
|
|
5382
5500
|
async function getUniqueCriteriaByOrg(params, signal) {
|
|
5383
5501
|
const data = await client.get(`${BASE_URL16}/org`, {
|
|
5384
5502
|
searchParams: params,
|
|
@@ -5393,7 +5511,11 @@ function createUniqueCriteriaApi(client) {
|
|
|
5393
5511
|
}).json();
|
|
5394
5512
|
return external_exports.array(FlattenedItemIdentifierKeysSchema).parse(data);
|
|
5395
5513
|
}
|
|
5396
|
-
return {
|
|
5514
|
+
return {
|
|
5515
|
+
getUniqueCriteriaOptions,
|
|
5516
|
+
getUniqueCriteriaByOrg,
|
|
5517
|
+
getProductUniqueCriteriaByOrg
|
|
5518
|
+
};
|
|
5397
5519
|
}
|
|
5398
5520
|
|
|
5399
5521
|
// lib/companies/models/CompanyBriefByOrg.ts
|
|
@@ -5408,6 +5530,9 @@ var companyBriefByOrgSchema = external_exports.object({
|
|
|
5408
5530
|
dc4Id: external_exports.number()
|
|
5409
5531
|
});
|
|
5410
5532
|
|
|
5533
|
+
// lib/companies/models/CompanyType.ts
|
|
5534
|
+
var companyTypeSchema = external_exports.enum(["SUPPLIER", "RETAILER"]);
|
|
5535
|
+
|
|
5411
5536
|
// lib/companies/index.ts
|
|
5412
5537
|
var BASE_URL17 = "companys";
|
|
5413
5538
|
function createCompaniesApi(client) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { A as AsstClient, I as ItemHierarchyResponse, S as SpsItemIdResponse } from './SpsItemIdResponse-s0vCXepG.cjs';
|
|
2
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-
|
|
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-
|
|
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-CJ7lvFQH.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-CJ7lvFQH.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>;
|
|
@@ -77,12 +81,100 @@ type RetailerTradingPartnerStages = z.infer<typeof retailerTradingPartnerStages>
|
|
|
77
81
|
/**
|
|
78
82
|
* Initialize Trading Partner Settings Api functions
|
|
79
83
|
* @param client Assortment Client instance
|
|
84
|
+
* @param companyType Company type for perspective
|
|
80
85
|
* @returns An object containing Trading Partner Settings API functions
|
|
81
86
|
*/
|
|
82
|
-
declare function createTradingPartnerSettingsApi(client: AsstClient): {
|
|
87
|
+
declare function createTradingPartnerSettingsApi(client: AsstClient, companyType?: CompanyType): {
|
|
83
88
|
getRetailerStages: (signal?: AbortSignal) => Promise<RetailerTradingPartnerStages>;
|
|
84
89
|
};
|
|
85
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Request payload for creating a new catalog
|
|
93
|
+
*/
|
|
94
|
+
declare const catalogCreateRequestSchema: z.ZodObject<{
|
|
95
|
+
categoryName: z.ZodString;
|
|
96
|
+
categoryCompanyId: z.ZodNumber;
|
|
97
|
+
categoryTypeId: z.ZodNumber;
|
|
98
|
+
categoryDescription: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
categoryName: string;
|
|
101
|
+
categoryCompanyId: number;
|
|
102
|
+
categoryTypeId: number;
|
|
103
|
+
categoryDescription?: string | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
categoryName: string;
|
|
106
|
+
categoryCompanyId: number;
|
|
107
|
+
categoryTypeId: number;
|
|
108
|
+
categoryDescription?: string | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
type CatalogCreateRequest = z.infer<typeof catalogCreateRequestSchema>;
|
|
111
|
+
/**
|
|
112
|
+
* Response from creating a new catalog
|
|
113
|
+
*/
|
|
114
|
+
declare const catalogCreateResponseSchema: z.ZodObject<{
|
|
115
|
+
categoryId: z.ZodNumber;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
categoryId: number;
|
|
118
|
+
}, {
|
|
119
|
+
categoryId: number;
|
|
120
|
+
}>;
|
|
121
|
+
type CatalogCreateResponse = z.infer<typeof catalogCreateResponseSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* Parameters for searching catalogs by company
|
|
124
|
+
*/
|
|
125
|
+
declare const catalogSearchParamsSchema: z.ZodObject<{
|
|
126
|
+
ownerCompanyIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
127
|
+
searchTerms: z.ZodOptional<z.ZodString>;
|
|
128
|
+
categoryType: z.ZodLiteral<"CATALOG">;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
categoryType: "CATALOG";
|
|
131
|
+
ownerCompanyIds?: number[] | undefined;
|
|
132
|
+
searchTerms?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
categoryType: "CATALOG";
|
|
135
|
+
ownerCompanyIds?: number[] | undefined;
|
|
136
|
+
searchTerms?: string | undefined;
|
|
137
|
+
}>;
|
|
138
|
+
type CatalogSearchParams = z.infer<typeof catalogSearchParamsSchema>;
|
|
139
|
+
/**
|
|
140
|
+
* Brief catalog information returned from search
|
|
141
|
+
*/
|
|
142
|
+
declare const catalogBriefResponseSchema: z.ZodObject<{
|
|
143
|
+
categoryId: z.ZodNumber;
|
|
144
|
+
categoryName: z.ZodString;
|
|
145
|
+
categoryDescription: z.ZodString;
|
|
146
|
+
categoryDescriptionExt: z.ZodString;
|
|
147
|
+
ownerCompanyId: z.ZodString;
|
|
148
|
+
categoryTypeId: z.ZodNumber;
|
|
149
|
+
createdAt: z.ZodString;
|
|
150
|
+
modifiedAt: z.ZodString;
|
|
151
|
+
createdBy: z.ZodString;
|
|
152
|
+
modifiedBy: z.ZodString;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
createdBy: string;
|
|
155
|
+
modifiedBy: string;
|
|
156
|
+
categoryName: string;
|
|
157
|
+
categoryTypeId: number;
|
|
158
|
+
categoryDescription: string;
|
|
159
|
+
categoryId: number;
|
|
160
|
+
categoryDescriptionExt: string;
|
|
161
|
+
ownerCompanyId: string;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
modifiedAt: string;
|
|
164
|
+
}, {
|
|
165
|
+
createdBy: string;
|
|
166
|
+
modifiedBy: string;
|
|
167
|
+
categoryName: string;
|
|
168
|
+
categoryTypeId: number;
|
|
169
|
+
categoryDescription: string;
|
|
170
|
+
categoryId: number;
|
|
171
|
+
categoryDescriptionExt: string;
|
|
172
|
+
ownerCompanyId: string;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
modifiedAt: string;
|
|
175
|
+
}>;
|
|
176
|
+
type CatalogBriefResponse = z.infer<typeof catalogBriefResponseSchema>;
|
|
177
|
+
|
|
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
|
|
@@ -143,9 +240,10 @@ type ApplicationType = z.infer<typeof applicationTypeSchema>;
|
|
|
143
240
|
/**
|
|
144
241
|
* Initialize Company Features Api functions
|
|
145
242
|
* @param client Assortment Client instance
|
|
243
|
+
* @param companyType Company type for perspective on hybrid organisations
|
|
146
244
|
* @returns An object containing Company Features API functions
|
|
147
245
|
*/
|
|
148
|
-
declare function createCompanyFeaturesApi(client: AsstClient): {
|
|
246
|
+
declare function createCompanyFeaturesApi(client: AsstClient, companyType?: CompanyType): {
|
|
149
247
|
checkIfStageItemSetupIsEnabled: (signal?: AbortSignal) => Promise<boolean>;
|
|
150
248
|
};
|
|
151
249
|
|
|
@@ -162,6 +260,7 @@ declare function createFeatureFlagsApi(client: AsstClient): {
|
|
|
162
260
|
checkEnableItemsLevelMSIS: (signal?: AbortSignal) => Promise<boolean>;
|
|
163
261
|
checkIfEnabledForPackagingHierarchies: (signal?: AbortSignal) => Promise<boolean>;
|
|
164
262
|
checkIfEnabledForItemUomConversionRules: (flagOptions?: FlagOptions) => Promise<boolean>;
|
|
263
|
+
checkIfItemMatchEnabled: (flagOptions?: FlagOptions) => Promise<boolean>;
|
|
165
264
|
};
|
|
166
265
|
|
|
167
266
|
declare const itemStatusResponseSchema: z.ZodObject<{
|
|
@@ -365,9 +464,10 @@ type ItemsApi = {
|
|
|
365
464
|
/**
|
|
366
465
|
* Initialize Items Api functions
|
|
367
466
|
* @param client Assortment Client instance
|
|
467
|
+
* @param companyType Optional company type eg "RETAILER" | "SUPPLIER"
|
|
368
468
|
* @returns An object containing Items API functions
|
|
369
469
|
*/
|
|
370
|
-
declare function createItemsApi(client: AsstClient): ItemsApi;
|
|
470
|
+
declare function createItemsApi(client: AsstClient, companyType?: CompanyType): ItemsApi;
|
|
371
471
|
|
|
372
472
|
declare const itemOrgStageDetailsSchema: z.ZodObject<{
|
|
373
473
|
/**
|
|
@@ -665,18 +765,20 @@ type Stage = z.infer<typeof stageSchema>;
|
|
|
665
765
|
/**
|
|
666
766
|
* Initialize Items Api functions
|
|
667
767
|
* @param client Assortment Client instance
|
|
768
|
+
* @param companyType Company type for perspective
|
|
668
769
|
* @returns An object containing Items API functions
|
|
669
770
|
*/
|
|
670
|
-
declare function createItemsApiV2(client: AsstClient): {
|
|
771
|
+
declare function createItemsApiV2(client: AsstClient, companyType?: CompanyType): {
|
|
671
772
|
getItemStatus: (itemIds: string[]) => Promise<ItemStatusV2Response>;
|
|
672
773
|
};
|
|
673
774
|
|
|
674
775
|
/**
|
|
675
776
|
* Initialize Errors Api functions
|
|
676
777
|
* @param client Assortment Client instance
|
|
778
|
+
* @param companyType Company type for perspective
|
|
677
779
|
* @returns An object containing Errors API functions
|
|
678
780
|
*/
|
|
679
|
-
declare function createErrorsApi(client: AsstClient): {
|
|
781
|
+
declare function createErrorsApi(client: AsstClient, companyType?: CompanyType): {
|
|
680
782
|
getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
|
|
681
783
|
};
|
|
682
784
|
|
|
@@ -692,9 +794,10 @@ type GetItemErrorSummaryParams = {
|
|
|
692
794
|
/**
|
|
693
795
|
* Initialize Errors Api functions
|
|
694
796
|
* @param client Assortment Client instance
|
|
797
|
+
* @param companyType Company type for perspective
|
|
695
798
|
* @returns An object containing Errors API functions
|
|
696
799
|
*/
|
|
697
|
-
declare function createErrorsApiV2(client: AsstClient): {
|
|
800
|
+
declare function createErrorsApiV2(client: AsstClient, companyType?: CompanyType): {
|
|
698
801
|
getItemErrorSummary: (params: GetItemErrorSummaryParams, signal?: AbortSignal) => Promise<ItemErrorSummaryResultV2>;
|
|
699
802
|
getItemErrorDetails: (itemInfoId: number, signal?: AbortSignal) => Promise<ItemErrorDetailsResultV2>;
|
|
700
803
|
};
|
|
@@ -702,12 +805,25 @@ declare function createErrorsApiV2(client: AsstClient): {
|
|
|
702
805
|
declare const FlattenedItemIdentifierKeys: readonly ["eaneight", "upc", "ean", "gtin", "upcCaseCode", "buyerPartNumber", "partnumber", "isbn", "sku", "nationalDrugCode", "drugIdentificationNumber", "nationalHealthRelatedItemCode", "manufacturersPartNumber", "internationalStandardSerialNumber", "nabcaNumber", "erpId", "componentId"];
|
|
703
806
|
type FlattenedItemIdentifiers = (typeof FlattenedItemIdentifierKeys)[number];
|
|
704
807
|
|
|
808
|
+
declare const uniqueCriteriaOptionsSchema: z.ZodArray<z.ZodObject<{
|
|
809
|
+
name: z.ZodString;
|
|
810
|
+
value: z.ZodString;
|
|
811
|
+
}, "strip", z.ZodTypeAny, {
|
|
812
|
+
value: string;
|
|
813
|
+
name: string;
|
|
814
|
+
}, {
|
|
815
|
+
value: string;
|
|
816
|
+
name: string;
|
|
817
|
+
}>, "many">;
|
|
818
|
+
type UniqueCriteriaOptions = z.infer<typeof uniqueCriteriaOptionsSchema>;
|
|
819
|
+
|
|
705
820
|
/**
|
|
706
821
|
* Initialize UniqueCriteria Api functions
|
|
707
822
|
* @param client Assortment Client instance
|
|
708
823
|
* @returns An object containing UniqueCriteria API functions
|
|
709
824
|
*/
|
|
710
825
|
declare function createUniqueCriteriaApi(client: AsstClient): {
|
|
826
|
+
getUniqueCriteriaOptions: () => Promise<UniqueCriteriaOptions>;
|
|
711
827
|
getUniqueCriteriaByOrg: (params?: {
|
|
712
828
|
orgId?: string;
|
|
713
829
|
}, signal?: AbortSignal) => Promise<string[]>;
|
|
@@ -727,4 +843,4 @@ declare function createCompaniesApi(client: AsstClient): {
|
|
|
727
843
|
}, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
|
|
728
844
|
};
|
|
729
845
|
|
|
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 };
|
|
846
|
+
export { type ApplicationType, AsstClient, AttrProdType, type CategoriesApi, CompanyBriefByOrg, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, type FlagOptions, type FlattenedItemIdentifiers, GenerateImportTemplateParams, type GetItemErrorSummaryParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemErrorDetailsResultV2, ItemErrorSummaryResultV2, ItemHierarchyResponse, type ItemOrgStageDetails, type ItemOrgStatus, ItemPartner, ItemSearchView, type ItemStatus, type ItemStatusResponse, type ItemStatusV2, type ItemStatusV2Response, type ItemsApi, Locale, type OrgSummary, type RetailerTradingPartnerStages, SpreadsheetTemplate, SpsItemIdResponse, type Stage, TradingPartnerAccessByCompanyId, type UniqueCriteriaOptions, UserAccount, VendorPartnerAttGroups, createCategoriesApi, createCompaniesApi, createCompanyFeaturesApi, createErrorsApi, createErrorsApiV2, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createItemsApiV2, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createTradingPartnerSettingsApi, createUniqueCriteriaApi, createWhoAmIApi };
|