@spscommerce/asst-api 0.0.1-beta.9 → 0.1.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/{ItemErrorDetailsResult-c62caeae.d.ts → CompanyBriefByOrg-f1bfabb3.d.ts} +211 -165
- package/dist/{chunk-ITWMRXLD.js → chunk-FDGLFR7X.js} +133 -22
- package/dist/{chunk-IHIEBLQV.js → chunk-PUQDOFRT.js} +103 -29
- package/dist/index-d94fdfef.d.ts +103 -0
- package/dist/index.cjs +223 -47
- package/dist/index.d.ts +146 -9
- package/dist/index.js +8 -2
- package/dist/msw.cjs +251 -60
- package/dist/msw.d.ts +126 -69
- package/dist/msw.js +132 -31
- package/dist/{ItemErrorDetails-e6e400aa.d.ts → zod-ec1cdb27.d.ts} +179 -103
- package/dist/zod.cjs +106 -28
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +11 -1
- package/package.json +1 -1
- package/dist/ImportsStatus-52d26b01.d.ts +0 -134
- package/dist/ImportsStatusEnum-22c03a0b.d.ts +0 -51
- package/dist/ItemCategoriesSearch-1bb945de.d.ts +0 -275
- package/dist/ItemCategoriesSearch-44b87663.d.ts +0 -318
- package/dist/ItemCategoriesSearch-e0870a34.d.ts +0 -318
- package/dist/ItemCategoriesSearch-e3298650.d.ts +0 -319
- package/dist/ItemCategoriesSearch-ec43591f.d.ts +0 -319
- package/dist/ItemCategory-14816deb.d.ts +0 -99
- package/dist/ItemCategory-768179bd.d.ts +0 -99
- package/dist/ItemErrorDetails-1614b511.d.ts +0 -3137
- package/dist/ItemErrorDetails-1bd2821e.d.ts +0 -3137
- package/dist/ItemErrorDetailsResult-0b4a628c.d.ts +0 -3032
- package/dist/ItemErrorDetailsResult-859368da.d.ts +0 -3032
- package/dist/ItemErrorDetailsResult-9ac97c24.d.ts +0 -3032
- package/dist/ItemErrorDetailsResult-c12c4eac.d.ts +0 -3032
- package/dist/TradingPartnerAccessByCompanyId-29866586.d.ts +0 -97
- package/dist/TradingPartnerAccessByCompanyId-43f83fb6.d.ts +0 -130
- package/dist/TradingPartnerAccessByCompanyId-479e3e57.d.ts +0 -124
- package/dist/TradingPartnerAccessByCompanyId-53b868a8.d.ts +0 -125
- package/dist/TradingPartnerAccessByCompanyId-b227f0c5.d.ts +0 -125
- package/dist/TradingPartnerAccessByCompanyId-e7a1d443.d.ts +0 -129
- package/dist/asstClient-f6a1693a.d.ts +0 -29
- package/dist/chunk-3FMMM7IS.js +0 -80
- package/dist/chunk-3JRE7YYE.js +0 -4576
- package/dist/chunk-4WER3ZLX.js +0 -4576
- package/dist/chunk-6ZNFOWTV.js +0 -78
- package/dist/chunk-7HCJJATJ.js +0 -40
- package/dist/chunk-B7B2ACF4.js +0 -3794
- package/dist/chunk-D3ML6E4G.js +0 -3787
- package/dist/chunk-ETURPA7W.js +0 -326
- package/dist/chunk-F3KCLICG.js +0 -77
- package/dist/chunk-FS6LHGAR.js +0 -87
- package/dist/chunk-G36FM5OA.js +0 -327
- package/dist/chunk-GDFX3WTX.js +0 -78
- package/dist/chunk-LGP22FRF.js +0 -0
- package/dist/chunk-LYMGZWSR.js +0 -80
- package/dist/chunk-N2OYWNHF.js +0 -80
- package/dist/chunk-OA6PO3QG.js +0 -78
- package/dist/chunk-OBXZRDPY.js +0 -77
- package/dist/chunk-OI47EFQH.js +0 -82
- package/dist/chunk-OVOZIZA2.js +0 -326
- package/dist/chunk-RNUSCCKB.js +0 -183
- package/dist/chunk-RRGAJ4ZS.js +0 -4576
- package/dist/chunk-T3UCSW2B.js +0 -81
- package/dist/chunk-XMNYZGXF.js +0 -84
- package/dist/chunk-YCQUK6KV.js +0 -85
package/dist/index.cjs
CHANGED
|
@@ -34,15 +34,18 @@ __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,
|
|
41
|
+
createFeatureFlagsApi: () => createFeatureFlagsApi,
|
|
40
42
|
createImportsApi: () => createImportsApi,
|
|
41
43
|
createItemsApi: () => createItemsApi,
|
|
42
44
|
createLocaleApi: () => createLocaleApi,
|
|
43
45
|
createProductTypesApi: () => createProductTypesApi,
|
|
44
46
|
createSpreadsheetTemplateApi: () => createSpreadsheetTemplateApi,
|
|
45
47
|
createTradingPartnerAccessApi: () => createTradingPartnerAccessApi,
|
|
48
|
+
createUniqueCriteriaApi: () => createUniqueCriteriaApi,
|
|
46
49
|
createWhoAmIApi: () => createWhoAmIApi
|
|
47
50
|
});
|
|
48
51
|
module.exports = __toCommonJS(lib_exports);
|
|
@@ -3734,14 +3737,16 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
3734
3737
|
|
|
3735
3738
|
// lib/asstClient.ts
|
|
3736
3739
|
var baseUrlsSchema = z.object({
|
|
3737
|
-
local: z.literal("https://localhost:8443"),
|
|
3738
|
-
test: z.literal(
|
|
3739
|
-
|
|
3740
|
+
local: z.literal("https://localhost:8443/"),
|
|
3741
|
+
test: z.literal(
|
|
3742
|
+
"https://integration.api.spscommerce.com/assortment/gateway/"
|
|
3743
|
+
),
|
|
3744
|
+
prod: z.literal("https://api.spscommerce.com/assortment/gateway/")
|
|
3740
3745
|
});
|
|
3741
3746
|
var BASE_URLS = {
|
|
3742
|
-
local: "https://localhost:8443",
|
|
3743
|
-
test: "https://integration.api.spscommerce.com/assortment/gateway",
|
|
3744
|
-
prod: "https://api.spscommerce.com/assortment/gateway"
|
|
3747
|
+
local: "https://localhost:8443/",
|
|
3748
|
+
test: "https://integration.api.spscommerce.com/assortment/gateway/",
|
|
3749
|
+
prod: "https://api.spscommerce.com/assortment/gateway/"
|
|
3745
3750
|
};
|
|
3746
3751
|
var envSchema = baseUrlsSchema.keyof();
|
|
3747
3752
|
var initialConfig = {
|
|
@@ -3932,8 +3937,11 @@ function createImportsApi(client) {
|
|
|
3932
3937
|
var BASE_URL2 = "exports";
|
|
3933
3938
|
var BASE_URL_V2 = "v2/exports";
|
|
3934
3939
|
function createExportsApi(client) {
|
|
3935
|
-
async function createExport(data) {
|
|
3936
|
-
await client.post(`${BASE_URL_V2}/add`, {
|
|
3940
|
+
async function createExport(data, params) {
|
|
3941
|
+
await client.post(`${BASE_URL_V2}/add`, {
|
|
3942
|
+
json: data,
|
|
3943
|
+
searchParams: params
|
|
3944
|
+
});
|
|
3937
3945
|
}
|
|
3938
3946
|
async function downloadItems(params) {
|
|
3939
3947
|
const searchParams = { ...params, ids: params.ids.join(",") };
|
|
@@ -3997,7 +4005,8 @@ var connectionSchema = z.object({
|
|
|
3997
4005
|
catalog_id: z.number(),
|
|
3998
4006
|
catalog_name: z.string().nullable(),
|
|
3999
4007
|
partner_company_name: z.string(),
|
|
4000
|
-
partner_company_id: z.number()
|
|
4008
|
+
partner_company_id: z.number(),
|
|
4009
|
+
partner_org_id: z.string()
|
|
4001
4010
|
});
|
|
4002
4011
|
|
|
4003
4012
|
// lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
|
|
@@ -4013,8 +4022,9 @@ var tradingPartnerAccessByCompanyIdSchema = z.object({
|
|
|
4013
4022
|
// lib/tradingPartners/index.ts
|
|
4014
4023
|
var BASE_URL4 = "trading-partner-access";
|
|
4015
4024
|
function createTradingPartnerAccessApi(client) {
|
|
4016
|
-
async function getAllTradingPartners(signal) {
|
|
4025
|
+
async function getAllTradingPartners(params, signal) {
|
|
4017
4026
|
const data = await client.get(`${BASE_URL4}/connections`, {
|
|
4027
|
+
searchParams: params,
|
|
4018
4028
|
signal
|
|
4019
4029
|
}).json();
|
|
4020
4030
|
return tradingPartnerAccessByCompanyIdSchema.parse(data);
|
|
@@ -4027,6 +4037,7 @@ function createTradingPartnerAccessApi(client) {
|
|
|
4027
4037
|
// lib/categories/models/ItemCategory.ts
|
|
4028
4038
|
var itemCategorySchema = z.object({
|
|
4029
4039
|
categoryid: z.number(),
|
|
4040
|
+
encodedCategoryId: z.string(),
|
|
4030
4041
|
companyId: z.number(),
|
|
4031
4042
|
name: z.string(),
|
|
4032
4043
|
isActive: z.number(),
|
|
@@ -4045,6 +4056,30 @@ var itemCategoriesSearchSchema = z.object({
|
|
|
4045
4056
|
data: z.array(itemCategorySchema)
|
|
4046
4057
|
});
|
|
4047
4058
|
|
|
4059
|
+
// lib/categories/models/Hierarchy.ts
|
|
4060
|
+
var baseHierarchySchema = z.object({
|
|
4061
|
+
id: z.string(),
|
|
4062
|
+
name: z.string().nullish(),
|
|
4063
|
+
description: z.string().nullish(),
|
|
4064
|
+
type: z.string().nullish()
|
|
4065
|
+
});
|
|
4066
|
+
var hierarchySchema = baseHierarchySchema.extend(
|
|
4067
|
+
{
|
|
4068
|
+
child: z.lazy(() => hierarchySchema).nullable()
|
|
4069
|
+
}
|
|
4070
|
+
);
|
|
4071
|
+
|
|
4072
|
+
// lib/categories/models/ItemHierarchy.ts
|
|
4073
|
+
var itemHierarchySchema = z.object({
|
|
4074
|
+
itemId: z.string(),
|
|
4075
|
+
hierarchies: z.array(hierarchySchema)
|
|
4076
|
+
});
|
|
4077
|
+
|
|
4078
|
+
// lib/categories/models/ItemHierarchyResponse.ts
|
|
4079
|
+
var itemHierarchyResponseSchema = z.object({
|
|
4080
|
+
itemHierarchies: z.array(itemHierarchySchema)
|
|
4081
|
+
});
|
|
4082
|
+
|
|
4048
4083
|
// lib/categories/index.ts
|
|
4049
4084
|
var BASE_URL5 = "categories";
|
|
4050
4085
|
function createCategoriesApi(client) {
|
|
@@ -4056,20 +4091,48 @@ function createCategoriesApi(client) {
|
|
|
4056
4091
|
return itemCategoriesSearchSchema.parse(data);
|
|
4057
4092
|
}
|
|
4058
4093
|
async function getProductCodes(params, signal) {
|
|
4094
|
+
const searchParams = { type: "PRODUCT_CODE" };
|
|
4095
|
+
if (params?.categoryName) {
|
|
4096
|
+
searchParams.categoryName = params.categoryName;
|
|
4097
|
+
}
|
|
4098
|
+
if (params?.catalogId) {
|
|
4099
|
+
searchParams.catalogId = params.catalogId;
|
|
4100
|
+
}
|
|
4101
|
+
if (params?.selectionCodeId) {
|
|
4102
|
+
searchParams.selectionCodeId = params.selectionCodeId;
|
|
4103
|
+
}
|
|
4104
|
+
if (params?.orgId) {
|
|
4105
|
+
searchParams.orgId = params.orgId;
|
|
4106
|
+
}
|
|
4059
4107
|
const data = await client.get(`${BASE_URL5}/search-category`, {
|
|
4060
|
-
searchParams
|
|
4061
|
-
signal
|
|
4108
|
+
searchParams,
|
|
4109
|
+
signal,
|
|
4110
|
+
timeout: false
|
|
4062
4111
|
}).json();
|
|
4063
4112
|
return itemCategoriesSearchSchema.parse(data);
|
|
4064
4113
|
}
|
|
4065
4114
|
async function getSelectionCodes(params, signal) {
|
|
4115
|
+
const searchParams = { type: "SELECTION_CODE" };
|
|
4116
|
+
if (params?.categoryName) {
|
|
4117
|
+
searchParams.categoryName = params.categoryName;
|
|
4118
|
+
}
|
|
4119
|
+
if (params?.catalogId) {
|
|
4120
|
+
searchParams.catalogId = params.catalogId;
|
|
4121
|
+
}
|
|
4122
|
+
if (params?.orgId) {
|
|
4123
|
+
searchParams.orgId = params.orgId;
|
|
4124
|
+
}
|
|
4066
4125
|
const data = await client.get(`${BASE_URL5}/search-category`, {
|
|
4067
|
-
searchParams
|
|
4126
|
+
searchParams,
|
|
4068
4127
|
signal
|
|
4069
4128
|
}).json();
|
|
4070
4129
|
return itemCategoriesSearchSchema.parse(data);
|
|
4071
4130
|
}
|
|
4072
|
-
|
|
4131
|
+
async function getItemHierarchy(itemIds) {
|
|
4132
|
+
const data = await client.post(`${BASE_URL5}/item-hierarchy`, { json: { itemIds } }).json();
|
|
4133
|
+
return itemHierarchyResponseSchema.parse(data);
|
|
4134
|
+
}
|
|
4135
|
+
return { getCatalogs, getProductCodes, getSelectionCodes, getItemHierarchy };
|
|
4073
4136
|
}
|
|
4074
4137
|
|
|
4075
4138
|
// lib/attributes/models/AttributeMetaData.ts
|
|
@@ -4250,11 +4313,19 @@ function createAttributesApi(client) {
|
|
|
4250
4313
|
}).json();
|
|
4251
4314
|
return z.array(attributeValidValuesSchema).parse(data);
|
|
4252
4315
|
}
|
|
4316
|
+
async function getCompanyInterestedAttributes(params, signal) {
|
|
4317
|
+
const data = await client.get(`${BASE_URL6}/company/interested-attributes`, {
|
|
4318
|
+
searchParams: params,
|
|
4319
|
+
signal
|
|
4320
|
+
}).json();
|
|
4321
|
+
return z.array(z.string()).parse(data);
|
|
4322
|
+
}
|
|
4253
4323
|
return {
|
|
4254
4324
|
getAllAttributes,
|
|
4255
4325
|
getAllAttributesByCompany,
|
|
4256
4326
|
getAttributesExtensiveInfo,
|
|
4257
|
-
getAttributeValidValues
|
|
4327
|
+
getAttributeValidValues,
|
|
4328
|
+
getCompanyInterestedAttributes
|
|
4258
4329
|
};
|
|
4259
4330
|
}
|
|
4260
4331
|
|
|
@@ -4300,8 +4371,8 @@ var spreadsheetTemplateSchema = z.object({
|
|
|
4300
4371
|
// lib/spreadsheetTemplate/index.ts
|
|
4301
4372
|
var BASE_URL8 = "templates";
|
|
4302
4373
|
function createSpreadsheetTemplateApi(client) {
|
|
4303
|
-
async function getTemplates(signal) {
|
|
4304
|
-
const data = await client.get(`${BASE_URL8}`, { signal }).json();
|
|
4374
|
+
async function getTemplates(params, signal) {
|
|
4375
|
+
const data = await client.get(`${BASE_URL8}`, { searchParams: params, signal }).json();
|
|
4305
4376
|
return z.array(spreadsheetTemplateSchema).parse(data);
|
|
4306
4377
|
}
|
|
4307
4378
|
return {
|
|
@@ -4328,9 +4399,9 @@ var identityServiceOrganizationMetadataSchema = z.object({
|
|
|
4328
4399
|
|
|
4329
4400
|
// lib/whoami/models/IdentityServiceOrganization.ts
|
|
4330
4401
|
var identityServiceOrganizationSchema = z.object({
|
|
4331
|
-
organization_name: z.string(),
|
|
4332
|
-
organization_site: z.string(),
|
|
4333
|
-
namespace: z.string(),
|
|
4402
|
+
organization_name: z.string().optional(),
|
|
4403
|
+
organization_site: z.string().optional(),
|
|
4404
|
+
namespace: z.string().optional(),
|
|
4334
4405
|
id: z.string(),
|
|
4335
4406
|
permissions: z.array(z.string()).optional(),
|
|
4336
4407
|
metadata: identityServiceOrganizationMetadataSchema.optional()
|
|
@@ -4348,26 +4419,26 @@ var identityServicePreferencesSchema = z.object({
|
|
|
4348
4419
|
// lib/whoami/models/IdentityServiceUser.ts
|
|
4349
4420
|
var identityServiceUserSchema = z.object({
|
|
4350
4421
|
id: z.string(),
|
|
4351
|
-
email: z.string(),
|
|
4352
|
-
first_name: z.string(),
|
|
4353
|
-
last_name: z.string(),
|
|
4354
|
-
job_title: z.string(),
|
|
4355
|
-
externally_managed: z.boolean(),
|
|
4356
|
-
city: z.string(),
|
|
4422
|
+
email: z.string().optional(),
|
|
4423
|
+
first_name: z.string().optional(),
|
|
4424
|
+
last_name: z.string().optional(),
|
|
4425
|
+
job_title: z.string().optional(),
|
|
4426
|
+
externally_managed: z.boolean().optional(),
|
|
4427
|
+
city: z.string().optional(),
|
|
4357
4428
|
name: z.string(),
|
|
4358
|
-
state: z.string(),
|
|
4359
|
-
country: z.string(),
|
|
4360
|
-
user_type: z.string(),
|
|
4361
|
-
token_type: z.string(),
|
|
4362
|
-
avatar_image_id: z.string(),
|
|
4363
|
-
avatar_image_url: z.string(),
|
|
4364
|
-
origin_avatar_image_id: z.string(),
|
|
4365
|
-
bio: z.string(),
|
|
4366
|
-
phone_number: z.string(),
|
|
4367
|
-
twitter_handle: z.string(),
|
|
4368
|
-
linkedin_url: z.string(),
|
|
4429
|
+
state: z.string().optional(),
|
|
4430
|
+
country: z.string().optional(),
|
|
4431
|
+
user_type: z.string().optional(),
|
|
4432
|
+
token_type: z.string().optional(),
|
|
4433
|
+
avatar_image_id: z.string().optional(),
|
|
4434
|
+
avatar_image_url: z.string().optional(),
|
|
4435
|
+
origin_avatar_image_id: z.string().optional(),
|
|
4436
|
+
bio: z.string().optional(),
|
|
4437
|
+
phone_number: z.string().optional(),
|
|
4438
|
+
twitter_handle: z.string().optional(),
|
|
4439
|
+
linkedin_url: z.string().optional(),
|
|
4369
4440
|
description: z.string().optional(),
|
|
4370
|
-
preferences: identityServicePreferencesSchema,
|
|
4441
|
+
preferences: identityServicePreferencesSchema.optional(),
|
|
4371
4442
|
roles: z.array(z.string()),
|
|
4372
4443
|
organization: identityServiceOrganizationSchema,
|
|
4373
4444
|
password: z.string(),
|
|
@@ -4428,6 +4499,27 @@ function createCompanyFeaturesApi(client) {
|
|
|
4428
4499
|
};
|
|
4429
4500
|
}
|
|
4430
4501
|
|
|
4502
|
+
// lib/featureFlags/index.ts
|
|
4503
|
+
var BASE_URL11 = "feature-flag";
|
|
4504
|
+
function createFeatureFlagsApi(client) {
|
|
4505
|
+
async function checkEnableItemsApiEndpointsForImports(signal) {
|
|
4506
|
+
const data = await client.get(`${BASE_URL11}/enable-items-api-endpoints-for-imports/`, {
|
|
4507
|
+
signal
|
|
4508
|
+
}).json();
|
|
4509
|
+
return z.boolean().parse(data);
|
|
4510
|
+
}
|
|
4511
|
+
async function checkEnableItemsLevelMSIS(signal) {
|
|
4512
|
+
const data = await client.get(`${BASE_URL11}/enable-item-level-msis/`, {
|
|
4513
|
+
signal
|
|
4514
|
+
}).json();
|
|
4515
|
+
return z.boolean().parse(data);
|
|
4516
|
+
}
|
|
4517
|
+
return {
|
|
4518
|
+
checkEnableItemsApiEndpointsForImports,
|
|
4519
|
+
checkEnableItemsLevelMSIS
|
|
4520
|
+
};
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4431
4523
|
// lib/items/models/ItemHeader.ts
|
|
4432
4524
|
var itemHeaderSchema = z.object({
|
|
4433
4525
|
status: z.string().optional(),
|
|
@@ -4574,6 +4666,18 @@ var itemErrorDetailsResultSchema = z.object({
|
|
|
4574
4666
|
itemErrorDetails: z.array(itemErrorDetailsSchema)
|
|
4575
4667
|
});
|
|
4576
4668
|
|
|
4669
|
+
// lib/companies/models/CompanyBriefByOrg.ts
|
|
4670
|
+
var companyBriefByOrgSchema = z.object({
|
|
4671
|
+
companyId: z.number(),
|
|
4672
|
+
name: z.string(),
|
|
4673
|
+
orgId: z.string(),
|
|
4674
|
+
companyType: z.object({
|
|
4675
|
+
type: z.enum(["SUPPLIER", "RETAILER"]),
|
|
4676
|
+
display: z.enum(["SUPPLIER", "RETAILER"])
|
|
4677
|
+
}),
|
|
4678
|
+
dc4Id: z.number()
|
|
4679
|
+
});
|
|
4680
|
+
|
|
4577
4681
|
// lib/items/models/AttributeDetail.ts
|
|
4578
4682
|
var attributeDetailSchema = z.object({
|
|
4579
4683
|
type: attrDatatypeNameEnumSchema,
|
|
@@ -4778,45 +4882,88 @@ var itemDetailSchema = z.object({
|
|
|
4778
4882
|
packs: z.array(packComponentSchema)
|
|
4779
4883
|
});
|
|
4780
4884
|
|
|
4885
|
+
// lib/items/models/SpsItemIdResponse.ts
|
|
4886
|
+
var spsItemIdResponseSchema = z.object({
|
|
4887
|
+
id: z.string(),
|
|
4888
|
+
ref: z.string()
|
|
4889
|
+
});
|
|
4890
|
+
|
|
4891
|
+
// lib/items/models/ItemOrgStatus.ts
|
|
4892
|
+
var itemOrgStatusSchema = z.object({
|
|
4893
|
+
org: z.object({
|
|
4894
|
+
ref: z.string(),
|
|
4895
|
+
id: z.string(),
|
|
4896
|
+
name: z.string()
|
|
4897
|
+
}),
|
|
4898
|
+
lowestInvalidStage: phaseEnumSchema.nullable(),
|
|
4899
|
+
validForRelationship: z.boolean()
|
|
4900
|
+
});
|
|
4901
|
+
|
|
4902
|
+
// lib/items/models/ItemStatus.ts
|
|
4903
|
+
var itemStatusSchema = z.object({
|
|
4904
|
+
itemId: z.string(),
|
|
4905
|
+
itemOrgStatuses: z.array(itemOrgStatusSchema)
|
|
4906
|
+
});
|
|
4907
|
+
|
|
4908
|
+
// lib/items/models/ItemStatusResponse.ts
|
|
4909
|
+
var itemStatusResponseSchema = z.object({
|
|
4910
|
+
itemStatuses: z.array(itemStatusSchema)
|
|
4911
|
+
});
|
|
4912
|
+
|
|
4781
4913
|
// lib/items/index.ts
|
|
4782
|
-
var
|
|
4914
|
+
var BASE_URL12 = "items";
|
|
4783
4915
|
function createItemsApi(client) {
|
|
4784
4916
|
async function searchItems(params, signal) {
|
|
4785
4917
|
const searchParams = params ? `limit=${params.limit}&offset=${params.offset}` + (params.url ? `&${params.url}` : "") : void 0;
|
|
4786
|
-
const data = await client.get(`${
|
|
4918
|
+
const data = await client.get(`${BASE_URL12}`, { searchParams, signal }).json();
|
|
4787
4919
|
return itemSearchViewSchema.parse(data);
|
|
4788
4920
|
}
|
|
4789
4921
|
async function getItem(itemId, locale = "en-US", signal) {
|
|
4790
|
-
const data = await client.get(`${
|
|
4922
|
+
const data = await client.get(`${BASE_URL12}/${itemId}`, { searchParams: { locale }, signal }).json();
|
|
4791
4923
|
return itemDetailViewSchema.parse(data);
|
|
4792
4924
|
}
|
|
4793
4925
|
async function updateItem(itemId, item) {
|
|
4794
|
-
await client.put(`${
|
|
4926
|
+
await client.put(`${BASE_URL12}/details/${itemId}`, { json: { ...item } }).json();
|
|
4795
4927
|
}
|
|
4796
4928
|
async function deleteItem(itemId) {
|
|
4797
|
-
await client.delete(`${
|
|
4929
|
+
await client.delete(`${BASE_URL12}/${itemId}`);
|
|
4798
4930
|
}
|
|
4799
4931
|
async function deleteItems(itemIds) {
|
|
4800
4932
|
const params = new URLSearchParams();
|
|
4801
4933
|
itemIds.forEach((id) => {
|
|
4802
4934
|
params.append("items", id);
|
|
4803
4935
|
});
|
|
4804
|
-
await client.delete(`${
|
|
4936
|
+
await client.delete(`${BASE_URL12}`, { searchParams: params });
|
|
4937
|
+
}
|
|
4938
|
+
async function getItemInfoId(spsItemId, signal) {
|
|
4939
|
+
const data = await client.get(`${BASE_URL12}/${spsItemId}/itemInfoId`, { signal }).json();
|
|
4940
|
+
return z.number().parse(data);
|
|
4941
|
+
}
|
|
4942
|
+
async function getSpsItemId(itemInfoId, signal) {
|
|
4943
|
+
const data = await client.get(`${BASE_URL12}/${itemInfoId}/spsItemId`, { signal }).json();
|
|
4944
|
+
return spsItemIdResponseSchema.parse(data);
|
|
4945
|
+
}
|
|
4946
|
+
async function getItemStatus(itemIds) {
|
|
4947
|
+
const data = await client.post(`${BASE_URL12}/status`, { json: { itemIds } }).json();
|
|
4948
|
+
return itemStatusResponseSchema.parse(data);
|
|
4805
4949
|
}
|
|
4806
4950
|
return {
|
|
4807
4951
|
searchItems,
|
|
4808
4952
|
getItem,
|
|
4809
4953
|
updateItem,
|
|
4810
4954
|
deleteItem,
|
|
4811
|
-
deleteItems
|
|
4955
|
+
deleteItems,
|
|
4956
|
+
getItemInfoId,
|
|
4957
|
+
getSpsItemId,
|
|
4958
|
+
getItemStatus
|
|
4812
4959
|
};
|
|
4813
4960
|
}
|
|
4814
4961
|
|
|
4815
4962
|
// lib/errors/index.ts
|
|
4816
|
-
var
|
|
4963
|
+
var BASE_URL13 = "errors";
|
|
4817
4964
|
function createErrorsApi(client) {
|
|
4818
4965
|
async function getInvalidItemErrorDetails(itemInfoId, signal) {
|
|
4819
|
-
const data = await client.get(`${
|
|
4966
|
+
const data = await client.get(`${BASE_URL13}/items/${itemInfoId}`, {
|
|
4820
4967
|
signal
|
|
4821
4968
|
}).json();
|
|
4822
4969
|
return itemErrorDetailsResultSchema.parse(data);
|
|
@@ -4825,20 +4972,49 @@ function createErrorsApi(client) {
|
|
|
4825
4972
|
getInvalidItemErrorDetails
|
|
4826
4973
|
};
|
|
4827
4974
|
}
|
|
4975
|
+
|
|
4976
|
+
// lib/uniqueCriteria/index.ts
|
|
4977
|
+
var BASE_URL14 = "uniquecriteria";
|
|
4978
|
+
function createUniqueCriteriaApi(client) {
|
|
4979
|
+
async function getUniqueCriteriaByOrg(params, signal) {
|
|
4980
|
+
const data = await client.get(`${BASE_URL14}/org`, {
|
|
4981
|
+
searchParams: params,
|
|
4982
|
+
signal
|
|
4983
|
+
}).json();
|
|
4984
|
+
return z.array(z.string()).parse(data);
|
|
4985
|
+
}
|
|
4986
|
+
return { getUniqueCriteriaByOrg };
|
|
4987
|
+
}
|
|
4988
|
+
|
|
4989
|
+
// lib/companies/index.ts
|
|
4990
|
+
var BASE_URL15 = "companys";
|
|
4991
|
+
function createCompaniesApi(client) {
|
|
4992
|
+
async function getCompanyBriefInfoByOrg(params, signal) {
|
|
4993
|
+
const data = await client.get(`${BASE_URL15}/brief`, {
|
|
4994
|
+
searchParams: params,
|
|
4995
|
+
signal
|
|
4996
|
+
}).json();
|
|
4997
|
+
return companyBriefByOrgSchema.parse(data);
|
|
4998
|
+
}
|
|
4999
|
+
return { getCompanyBriefInfoByOrg };
|
|
5000
|
+
}
|
|
4828
5001
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4829
5002
|
0 && (module.exports = {
|
|
4830
5003
|
AsstClient,
|
|
4831
5004
|
BASE_URLS,
|
|
4832
5005
|
createAttributesApi,
|
|
4833
5006
|
createCategoriesApi,
|
|
5007
|
+
createCompaniesApi,
|
|
4834
5008
|
createCompanyFeaturesApi,
|
|
4835
5009
|
createErrorsApi,
|
|
4836
5010
|
createExportsApi,
|
|
5011
|
+
createFeatureFlagsApi,
|
|
4837
5012
|
createImportsApi,
|
|
4838
5013
|
createItemsApi,
|
|
4839
5014
|
createLocaleApi,
|
|
4840
5015
|
createProductTypesApi,
|
|
4841
5016
|
createSpreadsheetTemplateApi,
|
|
4842
5017
|
createTradingPartnerAccessApi,
|
|
5018
|
+
createUniqueCriteriaApi,
|
|
4843
5019
|
createWhoAmIApi
|
|
4844
5020
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { A as AsstClient,
|
|
2
|
-
export {
|
|
3
|
-
import { G as GenerateImportTemplateParams, D as DownLoadItemsParams, I as ItemDetail } from './
|
|
4
|
-
export {
|
|
1
|
+
import { A as AsstClient, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, E as Export, l as AttrProdType, T as TradingPartnerAccessByCompanyId, c as ItemCategoriesSearch, h as AttributeMetaData, i as AttributesByCompany, j as AttributeDefinition, k as AttributeValidValues, L as Locale, S as SpreadsheetTemplate, U as UserAccount, f as ItemSearchView, g as ItemDetailView, e as ItemErrorDetailsResult } from './CompanyBriefByOrg-f1bfabb3.js';
|
|
2
|
+
export { m as AsstClientOptions, n as AsstUrl, B as BASE_URLS, C as CompanyBriefByOrg, o as Env, I as ImportErrors } from './CompanyBriefByOrg-f1bfabb3.js';
|
|
3
|
+
import { G as GenerateImportTemplateParams, D as DownLoadItemsParams, I as ItemHierarchyResponse, a as ItemDetail, S as SpsItemIdResponse } from './zod-ec1cdb27.js';
|
|
4
|
+
export { i as AttrDatatypeNameEnum, t as AttributeDetail, j as AttributeGroup, A as AttributeSummary, K as Bulb, u as CategoryEnum, v as ComponentDetails, C as Connection, E as ExportDayOfWeek, e as ExportFrequency, f as ExportType, w as GroupedAttributeList, x as GroupedAttributes, y as GroupedItem, H as Hierarchy, z as HierarchyCategory, B as HierarchyDetails, m as IdentityServiceDatetimePreferences, n as IdentityServiceOrganization, l as IdentityServiceOrganizationMetadata, o as IdentityServicePreferences, p as IdentityServiceUser, b as ImportDetails, c as ImportError, d as ImportStatusEnum, g as ItemCategory, Q as ItemErrorDetails, q as ItemHeader, h as ItemHierarchy, r as ItemMap, F as ItemPrice, s as ItemTable, M as MediaItem, L as PackComponent, J as PackComponentDetails, O as PackComponentItemInfo, P as PhaseEnum, R as RegisteredService, N as RepeatableGroup, k as SpreadsheetTemplateCompany, T as TradingPartnerStage } from './zod-ec1cdb27.js';
|
|
5
|
+
import { I as ItemStatusResponse } from './index-d94fdfef.js';
|
|
6
|
+
export { c as createCompaniesApi } from './index-d94fdfef.js';
|
|
7
|
+
import { z } from 'zod';
|
|
5
8
|
import 'ky-universal';
|
|
6
9
|
import 'ky';
|
|
7
|
-
import 'zod';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Initialize Imports Api functions
|
|
@@ -42,7 +44,9 @@ declare function createImportsApi(client: AsstClient): {
|
|
|
42
44
|
* @returns An object containing Exports API functions
|
|
43
45
|
*/
|
|
44
46
|
declare function createExportsApi(client: AsstClient): {
|
|
45
|
-
createExport: (data: Export
|
|
47
|
+
createExport: (data: Export, params?: {
|
|
48
|
+
orgId?: string;
|
|
49
|
+
}) => Promise<void>;
|
|
46
50
|
downloadItems: (params: DownLoadItemsParams) => Promise<void>;
|
|
47
51
|
};
|
|
48
52
|
|
|
@@ -63,7 +67,9 @@ declare function createProductTypesApi(client: AsstClient): {
|
|
|
63
67
|
* @returns An object containing Trading Partner Access API functions
|
|
64
68
|
*/
|
|
65
69
|
declare function createTradingPartnerAccessApi(client: AsstClient): {
|
|
66
|
-
getAllTradingPartners: (
|
|
70
|
+
getAllTradingPartners: (params?: {
|
|
71
|
+
orgId?: string;
|
|
72
|
+
}, signal?: AbortSignal) => Promise<TradingPartnerAccessByCompanyId>;
|
|
67
73
|
};
|
|
68
74
|
|
|
69
75
|
/**
|
|
@@ -74,13 +80,20 @@ declare function createTradingPartnerAccessApi(client: AsstClient): {
|
|
|
74
80
|
declare function createCategoriesApi(client: AsstClient): {
|
|
75
81
|
getCatalogs: (params?: {
|
|
76
82
|
categoryName?: string;
|
|
83
|
+
orgId?: string;
|
|
77
84
|
}, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
|
|
78
85
|
getProductCodes: (params?: {
|
|
79
86
|
categoryName?: string;
|
|
87
|
+
catalogId?: string;
|
|
88
|
+
selectionCodeId?: string;
|
|
89
|
+
orgId?: string;
|
|
80
90
|
}, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
|
|
81
91
|
getSelectionCodes: (params?: {
|
|
82
92
|
categoryName?: string;
|
|
93
|
+
catalogId?: string;
|
|
94
|
+
orgId?: string;
|
|
83
95
|
}, signal?: AbortSignal) => Promise<ItemCategoriesSearch>;
|
|
96
|
+
getItemHierarchy: (itemIds: string[]) => Promise<ItemHierarchyResponse>;
|
|
84
97
|
};
|
|
85
98
|
|
|
86
99
|
/**
|
|
@@ -96,6 +109,9 @@ declare function createAttributesApi(client: AsstClient): {
|
|
|
96
109
|
}, signal?: AbortSignal) => Promise<AttributesByCompany>;
|
|
97
110
|
getAttributesExtensiveInfo: (signal?: AbortSignal) => Promise<AttributeDefinition[]>;
|
|
98
111
|
getAttributeValidValues: (attributeDbName: string, signal?: AbortSignal) => Promise<AttributeValidValues[]>;
|
|
112
|
+
getCompanyInterestedAttributes: (params?: {
|
|
113
|
+
orgId?: string;
|
|
114
|
+
}, signal?: AbortSignal) => Promise<string[]>;
|
|
99
115
|
};
|
|
100
116
|
|
|
101
117
|
/**
|
|
@@ -113,7 +129,9 @@ declare function createLocaleApi(client: AsstClient): {
|
|
|
113
129
|
* @returns An object containing Spreadsheet Template API functions
|
|
114
130
|
*/
|
|
115
131
|
declare function createSpreadsheetTemplateApi(client: AsstClient): {
|
|
116
|
-
getTemplates: (
|
|
132
|
+
getTemplates: (params?: {
|
|
133
|
+
orgId?: string;
|
|
134
|
+
}, signal?: AbortSignal) => Promise<SpreadsheetTemplate[]>;
|
|
117
135
|
};
|
|
118
136
|
|
|
119
137
|
/**
|
|
@@ -134,6 +152,111 @@ declare function createCompanyFeaturesApi(client: AsstClient): {
|
|
|
134
152
|
checkIfStageItemSetupIsEnabled: (signal?: AbortSignal) => Promise<boolean>;
|
|
135
153
|
};
|
|
136
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Initialize Feature Flags Api functions
|
|
157
|
+
* @param client Assortment Client instance
|
|
158
|
+
* @returns An object containing feature flags utility functions
|
|
159
|
+
*/
|
|
160
|
+
declare function createFeatureFlagsApi(client: AsstClient): {
|
|
161
|
+
checkEnableItemsApiEndpointsForImports: (signal?: AbortSignal) => Promise<boolean>;
|
|
162
|
+
checkEnableItemsLevelMSIS: (signal?: AbortSignal) => Promise<boolean>;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
declare const itemStatusSchema: z.ZodObject<{
|
|
166
|
+
itemId: z.ZodString;
|
|
167
|
+
itemOrgStatuses: z.ZodArray<z.ZodObject<{
|
|
168
|
+
org: z.ZodObject<{
|
|
169
|
+
ref: z.ZodString;
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
name: z.ZodString;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
name: string;
|
|
174
|
+
id: string;
|
|
175
|
+
ref: string;
|
|
176
|
+
}, {
|
|
177
|
+
name: string;
|
|
178
|
+
id: string;
|
|
179
|
+
ref: string;
|
|
180
|
+
}>;
|
|
181
|
+
lowestInvalidStage: z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED", "STANDARD_REQUIREMENTS"]>>;
|
|
182
|
+
validForRelationship: z.ZodBoolean;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
org: {
|
|
185
|
+
name: string;
|
|
186
|
+
id: string;
|
|
187
|
+
ref: string;
|
|
188
|
+
};
|
|
189
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
190
|
+
validForRelationship: boolean;
|
|
191
|
+
}, {
|
|
192
|
+
org: {
|
|
193
|
+
name: string;
|
|
194
|
+
id: string;
|
|
195
|
+
ref: string;
|
|
196
|
+
};
|
|
197
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
198
|
+
validForRelationship: boolean;
|
|
199
|
+
}>, "many">;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
itemId: string;
|
|
202
|
+
itemOrgStatuses: {
|
|
203
|
+
org: {
|
|
204
|
+
name: string;
|
|
205
|
+
id: string;
|
|
206
|
+
ref: string;
|
|
207
|
+
};
|
|
208
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
209
|
+
validForRelationship: boolean;
|
|
210
|
+
}[];
|
|
211
|
+
}, {
|
|
212
|
+
itemId: string;
|
|
213
|
+
itemOrgStatuses: {
|
|
214
|
+
org: {
|
|
215
|
+
name: string;
|
|
216
|
+
id: string;
|
|
217
|
+
ref: string;
|
|
218
|
+
};
|
|
219
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
220
|
+
validForRelationship: boolean;
|
|
221
|
+
}[];
|
|
222
|
+
}>;
|
|
223
|
+
type ItemStatus = z.infer<typeof itemStatusSchema>;
|
|
224
|
+
|
|
225
|
+
declare const itemOrgStatusSchema: z.ZodObject<{
|
|
226
|
+
org: z.ZodObject<{
|
|
227
|
+
ref: z.ZodString;
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
name: z.ZodString;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
name: string;
|
|
232
|
+
id: string;
|
|
233
|
+
ref: string;
|
|
234
|
+
}, {
|
|
235
|
+
name: string;
|
|
236
|
+
id: string;
|
|
237
|
+
ref: string;
|
|
238
|
+
}>;
|
|
239
|
+
lowestInvalidStage: z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED", "STANDARD_REQUIREMENTS"]>>;
|
|
240
|
+
validForRelationship: z.ZodBoolean;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
org: {
|
|
243
|
+
name: string;
|
|
244
|
+
id: string;
|
|
245
|
+
ref: string;
|
|
246
|
+
};
|
|
247
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
248
|
+
validForRelationship: boolean;
|
|
249
|
+
}, {
|
|
250
|
+
org: {
|
|
251
|
+
name: string;
|
|
252
|
+
id: string;
|
|
253
|
+
ref: string;
|
|
254
|
+
};
|
|
255
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
256
|
+
validForRelationship: boolean;
|
|
257
|
+
}>;
|
|
258
|
+
type ItemOrgStatus = z.infer<typeof itemOrgStatusSchema>;
|
|
259
|
+
|
|
137
260
|
/**
|
|
138
261
|
* Initialize Items Api functions
|
|
139
262
|
* @param client Assortment Client instance
|
|
@@ -149,6 +272,9 @@ declare function createItemsApi(client: AsstClient): {
|
|
|
149
272
|
updateItem: (itemId: string, item: ItemDetail) => Promise<void>;
|
|
150
273
|
deleteItem: (itemId: number) => Promise<void>;
|
|
151
274
|
deleteItems: (itemIds: string[]) => Promise<void>;
|
|
275
|
+
getItemInfoId: (spsItemId: string, signal?: AbortSignal) => Promise<number>;
|
|
276
|
+
getSpsItemId: (itemInfoId: string, signal?: AbortSignal) => Promise<SpsItemIdResponse>;
|
|
277
|
+
getItemStatus: (itemIds: string[]) => Promise<ItemStatusResponse>;
|
|
152
278
|
};
|
|
153
279
|
|
|
154
280
|
/**
|
|
@@ -160,4 +286,15 @@ declare function createErrorsApi(client: AsstClient): {
|
|
|
160
286
|
getInvalidItemErrorDetails: (itemInfoId: string, signal?: AbortSignal) => Promise<ItemErrorDetailsResult>;
|
|
161
287
|
};
|
|
162
288
|
|
|
163
|
-
|
|
289
|
+
/**
|
|
290
|
+
* Initialize UniqueCriteria Api functions
|
|
291
|
+
* @param client Assortment Client instance
|
|
292
|
+
* @returns An object containing UniqueCriteria API functions
|
|
293
|
+
*/
|
|
294
|
+
declare function createUniqueCriteriaApi(client: AsstClient): {
|
|
295
|
+
getUniqueCriteriaByOrg: (params?: {
|
|
296
|
+
orgId?: string;
|
|
297
|
+
}, signal?: AbortSignal) => Promise<string[]>;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export { AsstClient, AttrProdType, AttributeDefinition, AttributeMetaData, AttributeValidValues, AttributesByCompany, DownLoadItemsParams, Export, GenerateImportTemplateParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemHierarchyResponse, ItemOrgStatus, ItemSearchView, ItemStatus, ItemStatusResponse, Locale, SpreadsheetTemplate, SpsItemIdResponse, TradingPartnerAccessByCompanyId, UserAccount, VendorPartnerAttGroups, createAttributesApi, createCategoriesApi, createCompanyFeaturesApi, createErrorsApi, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createUniqueCriteriaApi, createWhoAmIApi };
|