@spscommerce/asst-api 4.6.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CompanySearch-T6HJx4a6.d.cts +313 -0
- package/dist/CompanySearch-T6HJx4a6.d.ts +313 -0
- package/dist/{SpsItemIdResponse-gAHfCzwP.d.cts → SpsItemIdResponse-BEq6yqtR.d.cts} +28 -23
- package/dist/{SpsItemIdResponse-gAHfCzwP.d.ts → SpsItemIdResponse-BEq6yqtR.d.ts} +28 -23
- package/dist/{chunk-BMTYM2N6.js → chunk-52RZCPMT.js} +85 -1
- package/dist/{chunk-WX4LGXJV.js → chunk-VQDRXCML.js} +8 -1
- package/dist/{chunk-U7UJOT4D.js → chunk-ZAW3TKZQ.js} +112 -34
- package/dist/index.cjs +197 -32
- package/dist/index.d.cts +133 -25
- package/dist/index.d.ts +133 -25
- package/dist/index.js +5 -3
- package/dist/msw.cjs +125 -1
- package/dist/msw.d.cts +110 -29
- package/dist/msw.d.ts +110 -29
- package/dist/msw.js +42 -3
- package/dist/{zod-C-emh7a3.d.cts → zod-CEvcMeWn.d.ts} +159 -159
- package/dist/{zod-D3Xe9bw3.d.ts → zod-DscWtu4d.d.cts} +159 -159
- package/dist/zod.cjs +82 -0
- package/dist/zod.d.cts +3 -3
- package/dist/zod.d.ts +3 -3
- package/dist/zod.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ __export(lib_exports, {
|
|
|
46
46
|
createItemsApiV2: () => createItemsApiV2,
|
|
47
47
|
createLocaleApi: () => createLocaleApi,
|
|
48
48
|
createProductTypesApi: () => createProductTypesApi,
|
|
49
|
+
createRulesManagementApi: () => createRulesManagementApi,
|
|
49
50
|
createSpreadsheetTemplateApi: () => createSpreadsheetTemplateApi,
|
|
50
51
|
createTradingPartnerAccessApi: () => createTradingPartnerAccessApi,
|
|
51
52
|
createTradingPartnerSettingsApi: () => createTradingPartnerSettingsApi,
|
|
@@ -4122,6 +4123,7 @@ var AsstClient = class {
|
|
|
4122
4123
|
#baseUrl = BASE_URLS["test"];
|
|
4123
4124
|
#listeners = /* @__PURE__ */ new Set();
|
|
4124
4125
|
#currentConfig = initialConfig;
|
|
4126
|
+
#companyType = "SUPPLIER";
|
|
4125
4127
|
constructor(options) {
|
|
4126
4128
|
if (options) {
|
|
4127
4129
|
this.updateConfig(options);
|
|
@@ -4135,9 +4137,15 @@ var AsstClient = class {
|
|
|
4135
4137
|
}
|
|
4136
4138
|
this.#listeners.forEach((listener) => listener(options));
|
|
4137
4139
|
}
|
|
4140
|
+
updateCompanyType(companyType) {
|
|
4141
|
+
this.#companyType = companyType;
|
|
4142
|
+
}
|
|
4138
4143
|
getBaseUrl() {
|
|
4139
4144
|
return this.#baseUrl;
|
|
4140
4145
|
}
|
|
4146
|
+
getCompanyType() {
|
|
4147
|
+
return this.#companyType;
|
|
4148
|
+
}
|
|
4141
4149
|
/**
|
|
4142
4150
|
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
4143
4151
|
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
@@ -4258,7 +4266,7 @@ function getCompanyTypeSearchParams({
|
|
|
4258
4266
|
|
|
4259
4267
|
// lib/imports/index.ts
|
|
4260
4268
|
var BASE_URL = "imports";
|
|
4261
|
-
function createImportsApi(client
|
|
4269
|
+
function createImportsApi(client) {
|
|
4262
4270
|
async function getImportErrors(importId, params, signal) {
|
|
4263
4271
|
const data = await client.get(`${BASE_URL}/${importId}/errors`, { searchParams: params, signal }).json();
|
|
4264
4272
|
return importErrorsSchema.parse(data);
|
|
@@ -4273,7 +4281,7 @@ function createImportsApi(client, companyType) {
|
|
|
4273
4281
|
async function getImportsStatus(signal) {
|
|
4274
4282
|
const data = await client.get(`${BASE_URL}/status`, {
|
|
4275
4283
|
signal,
|
|
4276
|
-
searchParams: getCompanyTypeSearchParams({ companyType })
|
|
4284
|
+
searchParams: getCompanyTypeSearchParams({ companyType: client.getCompanyType() })
|
|
4277
4285
|
}).json();
|
|
4278
4286
|
return external_exports.array(importsStatusSchema).parse(data);
|
|
4279
4287
|
}
|
|
@@ -4283,7 +4291,7 @@ function createImportsApi(client, companyType) {
|
|
|
4283
4291
|
async function getVendorPartnerGroups(signal) {
|
|
4284
4292
|
const data = await client.get(`${BASE_URL}/template/vendor-partner-groups`, {
|
|
4285
4293
|
signal,
|
|
4286
|
-
searchParams: getCompanyTypeSearchParams({ companyType })
|
|
4294
|
+
searchParams: getCompanyTypeSearchParams({ companyType: client.getCompanyType() })
|
|
4287
4295
|
}).json();
|
|
4288
4296
|
return external_exports.array(vendorPartnerAttGroupsSchema).parse(data);
|
|
4289
4297
|
}
|
|
@@ -4292,7 +4300,7 @@ function createImportsApi(client, companyType) {
|
|
|
4292
4300
|
headers: {
|
|
4293
4301
|
Accept: "application/octet-stream"
|
|
4294
4302
|
},
|
|
4295
|
-
searchParams: getCompanyTypeSearchParams({ params, companyType }),
|
|
4303
|
+
searchParams: getCompanyTypeSearchParams({ params, companyType: client.getCompanyType() }),
|
|
4296
4304
|
timeout: false
|
|
4297
4305
|
});
|
|
4298
4306
|
const disposition = response.headers.get("content-disposition") || "";
|
|
@@ -4322,7 +4330,7 @@ function createImportsApi(client, companyType) {
|
|
|
4322
4330
|
// lib/exports/index.ts
|
|
4323
4331
|
var BASE_URL2 = "exports";
|
|
4324
4332
|
var BASE_URL_V2 = "v2/exports";
|
|
4325
|
-
function createExportsApi(client
|
|
4333
|
+
function createExportsApi(client) {
|
|
4326
4334
|
async function createExport(data, params) {
|
|
4327
4335
|
await client.post(`${BASE_URL_V2}/add`, {
|
|
4328
4336
|
json: data,
|
|
@@ -4336,7 +4344,10 @@ function createExportsApi(client, companyType) {
|
|
|
4336
4344
|
availableAttributes: params.availableAttributes?.join(",") ?? ""
|
|
4337
4345
|
};
|
|
4338
4346
|
const response = await client.get(`${BASE_URL2}/spreadsheet/by-item`, {
|
|
4339
|
-
searchParams: getCompanyTypeSearchParams({
|
|
4347
|
+
searchParams: getCompanyTypeSearchParams({
|
|
4348
|
+
params: searchParams,
|
|
4349
|
+
companyType: client.getCompanyType()
|
|
4350
|
+
}),
|
|
4340
4351
|
headers: {
|
|
4341
4352
|
Accept: "application/octet-stream"
|
|
4342
4353
|
},
|
|
@@ -4432,10 +4443,13 @@ var tradingPartnerAccessByCompanyIdSchema = external_exports.object({
|
|
|
4432
4443
|
|
|
4433
4444
|
// lib/tradingPartners/index.ts
|
|
4434
4445
|
var BASE_URL4 = "trading-partner-access";
|
|
4435
|
-
function createTradingPartnerAccessApi(client
|
|
4446
|
+
function createTradingPartnerAccessApi(client) {
|
|
4436
4447
|
async function getAllTradingPartners(params, signal) {
|
|
4437
4448
|
const data = await client.get(`${BASE_URL4}/connections`, {
|
|
4438
|
-
searchParams: getCompanyTypeSearchParams({
|
|
4449
|
+
searchParams: getCompanyTypeSearchParams({
|
|
4450
|
+
params,
|
|
4451
|
+
companyType: client.getCompanyType()
|
|
4452
|
+
}),
|
|
4439
4453
|
signal
|
|
4440
4454
|
}).json();
|
|
4441
4455
|
return tradingPartnerAccessByCompanyIdSchema.parse(data);
|
|
@@ -4466,10 +4480,10 @@ var retailerTradingPartnerStages = external_exports.array(
|
|
|
4466
4480
|
|
|
4467
4481
|
// lib/tradingPartnerSettings/index.ts
|
|
4468
4482
|
var BASE_URL5 = "trading-partner-settings";
|
|
4469
|
-
function createTradingPartnerSettingsApi(client
|
|
4483
|
+
function createTradingPartnerSettingsApi(client) {
|
|
4470
4484
|
async function getRetailerStages(signal) {
|
|
4471
4485
|
const data = await client.get(`${BASE_URL5}/stages/retailer-configured`, {
|
|
4472
|
-
searchParams: getCompanyTypeSearchParams({ companyType }),
|
|
4486
|
+
searchParams: getCompanyTypeSearchParams({ companyType: client.getCompanyType() }),
|
|
4473
4487
|
signal
|
|
4474
4488
|
}).json();
|
|
4475
4489
|
return retailerTradingPartnerStages.parse(data);
|
|
@@ -4555,13 +4569,20 @@ var BASE_URL6 = "categories";
|
|
|
4555
4569
|
function createCategoriesApi(client) {
|
|
4556
4570
|
async function getCatalogs(params, signal) {
|
|
4557
4571
|
const data = await client.get(`${BASE_URL6}/search-category`, {
|
|
4558
|
-
searchParams: {
|
|
4572
|
+
searchParams: {
|
|
4573
|
+
...params,
|
|
4574
|
+
type: "CATALOG",
|
|
4575
|
+
companyType: client.getCompanyType()
|
|
4576
|
+
},
|
|
4559
4577
|
signal
|
|
4560
4578
|
}).json();
|
|
4561
4579
|
return itemCategoriesSearchSchema.parse(data);
|
|
4562
4580
|
}
|
|
4563
4581
|
async function getProductCodes(params, signal) {
|
|
4564
|
-
const searchParams = {
|
|
4582
|
+
const searchParams = {
|
|
4583
|
+
type: "PRODUCT_CODE",
|
|
4584
|
+
companyType: client.getCompanyType()
|
|
4585
|
+
};
|
|
4565
4586
|
if (params?.categoryName) {
|
|
4566
4587
|
searchParams.categoryName = params.categoryName;
|
|
4567
4588
|
}
|
|
@@ -4582,7 +4603,10 @@ function createCategoriesApi(client) {
|
|
|
4582
4603
|
return itemCategoriesSearchSchema.parse(data);
|
|
4583
4604
|
}
|
|
4584
4605
|
async function getSelectionCodes(params, signal) {
|
|
4585
|
-
const searchParams = {
|
|
4606
|
+
const searchParams = {
|
|
4607
|
+
type: "SELECTION_CODE",
|
|
4608
|
+
companyType: client.getCompanyType()
|
|
4609
|
+
};
|
|
4586
4610
|
if (params?.categoryName) {
|
|
4587
4611
|
searchParams.categoryName = params.categoryName;
|
|
4588
4612
|
}
|
|
@@ -4627,7 +4651,12 @@ function createCategoriesApi(client) {
|
|
|
4627
4651
|
return external_exports.array(catalogBriefResponseSchema).parse(data);
|
|
4628
4652
|
}
|
|
4629
4653
|
async function createCategoryHierarchy(searchParams) {
|
|
4630
|
-
return await client.post(`${BASE_URL6}/hierarchy`, {
|
|
4654
|
+
return await client.post(`${BASE_URL6}/hierarchy`, {
|
|
4655
|
+
searchParams: getCompanyTypeSearchParams({
|
|
4656
|
+
params: searchParams,
|
|
4657
|
+
companyType: client.getCompanyType()
|
|
4658
|
+
})
|
|
4659
|
+
}).json();
|
|
4631
4660
|
}
|
|
4632
4661
|
return {
|
|
4633
4662
|
getCatalogs,
|
|
@@ -5175,28 +5204,41 @@ var itemStatusResponseSchema = external_exports.object({
|
|
|
5175
5204
|
|
|
5176
5205
|
// lib/items/v1/index.ts
|
|
5177
5206
|
var BASE_URL12 = "items";
|
|
5178
|
-
function createItemsApi(client
|
|
5207
|
+
function createItemsApi(client) {
|
|
5179
5208
|
function getCoalescedParams(params = {}) {
|
|
5180
5209
|
const queryParams = {};
|
|
5181
5210
|
if (params.limit !== void 0) queryParams.limit = params.limit.toString();
|
|
5182
|
-
if (params.offset !== void 0)
|
|
5183
|
-
|
|
5211
|
+
if (params.offset !== void 0)
|
|
5212
|
+
queryParams.offset = params.offset.toString();
|
|
5213
|
+
if (params.applicationType)
|
|
5214
|
+
queryParams.application = params.applicationType;
|
|
5184
5215
|
if (params.url) queryParams.url = params.url;
|
|
5185
5216
|
return Object.keys(queryParams).length > 0 ? queryParams : void 0;
|
|
5186
5217
|
}
|
|
5187
5218
|
async function searchItems(params, signal) {
|
|
5188
|
-
const searchParams = getCompanyTypeSearchParams({
|
|
5219
|
+
const searchParams = getCompanyTypeSearchParams({
|
|
5220
|
+
params: getCoalescedParams(params),
|
|
5221
|
+
companyType: client.getCompanyType()
|
|
5222
|
+
});
|
|
5189
5223
|
const data = await client.get(`${BASE_URL12}`, { searchParams, signal }).json();
|
|
5190
5224
|
return itemSearchViewSchema.parse(data);
|
|
5191
5225
|
}
|
|
5192
5226
|
async function getItem(itemId, locale = "en-US", signal) {
|
|
5193
|
-
const data = await client.get(`${BASE_URL12}/${itemId}`, {
|
|
5227
|
+
const data = await client.get(`${BASE_URL12}/${itemId}`, {
|
|
5228
|
+
searchParams: getCompanyTypeSearchParams({
|
|
5229
|
+
params: { locale },
|
|
5230
|
+
companyType: client.getCompanyType()
|
|
5231
|
+
}),
|
|
5232
|
+
signal
|
|
5233
|
+
}).json();
|
|
5194
5234
|
return itemDetailViewSchema.parse(data);
|
|
5195
5235
|
}
|
|
5196
5236
|
async function updateItem(itemId, item) {
|
|
5197
5237
|
await client.put(`${BASE_URL12}/details/${itemId}`, {
|
|
5198
5238
|
json: { ...item },
|
|
5199
|
-
searchParams: getCompanyTypeSearchParams({
|
|
5239
|
+
searchParams: getCompanyTypeSearchParams({
|
|
5240
|
+
companyType: client.getCompanyType()
|
|
5241
|
+
}),
|
|
5200
5242
|
timeout: 45e3
|
|
5201
5243
|
}).json();
|
|
5202
5244
|
}
|
|
@@ -5211,9 +5253,12 @@ function createItemsApi(client, companyType) {
|
|
|
5211
5253
|
await client.delete(`${BASE_URL12}`, { searchParams: params });
|
|
5212
5254
|
}
|
|
5213
5255
|
async function getItemInfoId(spsItemId, signal) {
|
|
5214
|
-
const data = await client.get(`${BASE_URL12}/${spsItemId}/itemInfoId`, {
|
|
5215
|
-
|
|
5216
|
-
|
|
5256
|
+
const data = await client.get(`${BASE_URL12}/${spsItemId}/itemInfoId`, {
|
|
5257
|
+
searchParams: getCompanyTypeSearchParams({
|
|
5258
|
+
companyType: client.getCompanyType()
|
|
5259
|
+
}),
|
|
5260
|
+
signal
|
|
5261
|
+
}).json();
|
|
5217
5262
|
return external_exports.number().parse(data);
|
|
5218
5263
|
}
|
|
5219
5264
|
async function getSpsItemId(itemInfoId, signal) {
|
|
@@ -5296,10 +5341,12 @@ var itemStatusV2ResponseSchema = external_exports.object({
|
|
|
5296
5341
|
// lib/items/v2/index.ts
|
|
5297
5342
|
var BASE_URL13 = "v2/items";
|
|
5298
5343
|
function createItemsApiV2(client) {
|
|
5299
|
-
async function getItemStatus(
|
|
5344
|
+
async function getItemStatus(itemIds) {
|
|
5300
5345
|
const data = await client.post(`${BASE_URL13}/status`, {
|
|
5301
5346
|
json: { itemIds },
|
|
5302
|
-
searchParams: getCompanyTypeSearchParams({
|
|
5347
|
+
searchParams: getCompanyTypeSearchParams({
|
|
5348
|
+
companyType: client.getCompanyType()
|
|
5349
|
+
})
|
|
5303
5350
|
}).json();
|
|
5304
5351
|
return itemStatusV2ResponseSchema.parse(data);
|
|
5305
5352
|
}
|
|
@@ -5333,10 +5380,12 @@ var itemErrorDetailsResultSchema = external_exports.object({
|
|
|
5333
5380
|
|
|
5334
5381
|
// lib/errors/v1/index.ts
|
|
5335
5382
|
var BASE_URL14 = "errors";
|
|
5336
|
-
function createErrorsApi(client
|
|
5383
|
+
function createErrorsApi(client) {
|
|
5337
5384
|
async function getInvalidItemErrorDetails(itemInfoId, signal) {
|
|
5338
5385
|
const data = await client.get(`${BASE_URL14}/items/${itemInfoId}`, {
|
|
5339
|
-
searchParams: getCompanyTypeSearchParams({
|
|
5386
|
+
searchParams: getCompanyTypeSearchParams({
|
|
5387
|
+
companyType: client.getCompanyType()
|
|
5388
|
+
}),
|
|
5340
5389
|
signal
|
|
5341
5390
|
}).json();
|
|
5342
5391
|
return itemErrorDetailsResultSchema.parse(data);
|
|
@@ -5415,7 +5464,7 @@ var itemErrorDetailsResultV2Schema = external_exports.object({
|
|
|
5415
5464
|
|
|
5416
5465
|
// lib/errors/v2/index.ts
|
|
5417
5466
|
var BASE_URL15 = "errors/v2";
|
|
5418
|
-
function createErrorsApiV2(client
|
|
5467
|
+
function createErrorsApiV2(client) {
|
|
5419
5468
|
async function getItemErrorSummary(params, signal) {
|
|
5420
5469
|
const searchParams = new URLSearchParams();
|
|
5421
5470
|
if (params.searchField)
|
|
@@ -5431,13 +5480,19 @@ function createErrorsApiV2(client, companyType) {
|
|
|
5431
5480
|
if (params.docInEventId)
|
|
5432
5481
|
searchParams.append("docInEventId", params.docInEventId);
|
|
5433
5482
|
if (params.importId) searchParams.append("importId", params.importId);
|
|
5434
|
-
if (
|
|
5435
|
-
|
|
5483
|
+
if (client.getCompanyType())
|
|
5484
|
+
searchParams.append("companyType", client.getCompanyType());
|
|
5485
|
+
const data = await client.get(`${BASE_URL15}/summary`, {
|
|
5486
|
+
signal,
|
|
5487
|
+
searchParams
|
|
5488
|
+
}).json();
|
|
5436
5489
|
return itemErrorSummaryResultV2Schema.parse(data);
|
|
5437
5490
|
}
|
|
5438
5491
|
async function getItemErrorDetails(itemInfoId, signal) {
|
|
5439
5492
|
const data = await client.get(`${BASE_URL15}/items/${itemInfoId}`, {
|
|
5440
|
-
searchParams: getCompanyTypeSearchParams({
|
|
5493
|
+
searchParams: getCompanyTypeSearchParams({
|
|
5494
|
+
companyType: client.getCompanyType()
|
|
5495
|
+
}),
|
|
5441
5496
|
signal
|
|
5442
5497
|
}).json();
|
|
5443
5498
|
return itemErrorDetailsResultV2Schema.parse(data);
|
|
@@ -5534,6 +5589,88 @@ var companyBriefByOrgSchema = external_exports.object({
|
|
|
5534
5589
|
dc4Id: external_exports.number()
|
|
5535
5590
|
});
|
|
5536
5591
|
|
|
5592
|
+
// lib/companies/models/CompanyRelationship.ts
|
|
5593
|
+
var applicationSchema = external_exports.object({
|
|
5594
|
+
application: applicationTypeSchema,
|
|
5595
|
+
relationshipApplicationId: external_exports.number()
|
|
5596
|
+
});
|
|
5597
|
+
var catalogSchema = external_exports.object({
|
|
5598
|
+
active: external_exports.boolean(),
|
|
5599
|
+
catalogId: external_exports.number(),
|
|
5600
|
+
itemPartnerId: external_exports.number()
|
|
5601
|
+
});
|
|
5602
|
+
var relationshipCompanySchema = external_exports.object({
|
|
5603
|
+
companyId: external_exports.number(),
|
|
5604
|
+
companyTypes: external_exports.array(companyTypeSchema),
|
|
5605
|
+
dc4Id: external_exports.number().nullable(),
|
|
5606
|
+
name: external_exports.string(),
|
|
5607
|
+
orgId: external_exports.string()
|
|
5608
|
+
});
|
|
5609
|
+
var relationshipSchema = external_exports.object({
|
|
5610
|
+
active: external_exports.boolean(),
|
|
5611
|
+
application: external_exports.array(applicationSchema),
|
|
5612
|
+
catalog: external_exports.array(catalogSchema),
|
|
5613
|
+
company: relationshipCompanySchema,
|
|
5614
|
+
createdAt: external_exports.number(),
|
|
5615
|
+
modifiedAt: external_exports.number().nullable(),
|
|
5616
|
+
relationshipId: external_exports.number()
|
|
5617
|
+
});
|
|
5618
|
+
|
|
5619
|
+
// lib/companies/models/Company.ts
|
|
5620
|
+
var featureResponseSchema = external_exports.object({
|
|
5621
|
+
active: external_exports.boolean(),
|
|
5622
|
+
createdBy: external_exports.string().nullable(),
|
|
5623
|
+
createdDate: external_exports.number().nullable(),
|
|
5624
|
+
display: external_exports.string(),
|
|
5625
|
+
modifiedBy: external_exports.string().nullable(),
|
|
5626
|
+
modifiedDate: external_exports.number().nullable(),
|
|
5627
|
+
type: external_exports.string()
|
|
5628
|
+
});
|
|
5629
|
+
var identitySchema = external_exports.object({
|
|
5630
|
+
orgId: external_exports.string().nullable(),
|
|
5631
|
+
service: external_exports.object({
|
|
5632
|
+
name: external_exports.string()
|
|
5633
|
+
}).nullable()
|
|
5634
|
+
});
|
|
5635
|
+
var companySchema = external_exports.object({
|
|
5636
|
+
active: external_exports.boolean(),
|
|
5637
|
+
companyId: external_exports.number(),
|
|
5638
|
+
companyTypes: external_exports.array(companyTypeSchema),
|
|
5639
|
+
createdAt: external_exports.number().nullable(),
|
|
5640
|
+
features: external_exports.array(featureResponseSchema),
|
|
5641
|
+
identity: identitySchema,
|
|
5642
|
+
modifiedAt: external_exports.number().nullable(),
|
|
5643
|
+
name: external_exports.string(),
|
|
5644
|
+
relationships: external_exports.array(relationshipSchema),
|
|
5645
|
+
uniqueAttributes: external_exports.array(external_exports.string())
|
|
5646
|
+
});
|
|
5647
|
+
|
|
5648
|
+
// lib/companies/models/CompanySearch.ts
|
|
5649
|
+
var companySearchParamsSchema = external_exports.object({
|
|
5650
|
+
name: external_exports.string().min(2).max(100).optional(),
|
|
5651
|
+
companyIds: external_exports.string().min(2).optional(),
|
|
5652
|
+
orgId: external_exports.string().min(2).optional(),
|
|
5653
|
+
catalogName: external_exports.string().min(2).max(100).optional(),
|
|
5654
|
+
catalogIds: external_exports.string().min(2).optional(),
|
|
5655
|
+
type: companyTypeSchema.optional()
|
|
5656
|
+
});
|
|
5657
|
+
var companyCatalogSchema = external_exports.object({
|
|
5658
|
+
categoryId: external_exports.number(),
|
|
5659
|
+
categoryName: external_exports.string()
|
|
5660
|
+
});
|
|
5661
|
+
var companySearchSchema = external_exports.object({
|
|
5662
|
+
id: external_exports.string(),
|
|
5663
|
+
organizationName: external_exports.string(),
|
|
5664
|
+
description: external_exports.string(),
|
|
5665
|
+
orgId: external_exports.string().optional(),
|
|
5666
|
+
roles: external_exports.array(companyTypeSchema),
|
|
5667
|
+
connections: external_exports.number(),
|
|
5668
|
+
uniqueCriteria: external_exports.array(external_exports.string()).optional(),
|
|
5669
|
+
serviceName: external_exports.string(),
|
|
5670
|
+
catalogs: external_exports.array(companyCatalogSchema),
|
|
5671
|
+
application: external_exports.array(applicationTypeSchema).optional()
|
|
5672
|
+
});
|
|
5673
|
+
|
|
5537
5674
|
// lib/companies/index.ts
|
|
5538
5675
|
var BASE_URL17 = "v3/companys";
|
|
5539
5676
|
function createCompaniesApi(client) {
|
|
@@ -5544,7 +5681,34 @@ function createCompaniesApi(client) {
|
|
|
5544
5681
|
}).json();
|
|
5545
5682
|
return companyBriefByOrgSchema.parse(data);
|
|
5546
5683
|
}
|
|
5547
|
-
|
|
5684
|
+
async function companySearch(params, signal) {
|
|
5685
|
+
const data = await client.get(`${BASE_URL17}/search`, {
|
|
5686
|
+
searchParams: params,
|
|
5687
|
+
signal
|
|
5688
|
+
}).json();
|
|
5689
|
+
return external_exports.array(companySearchSchema).parse(data);
|
|
5690
|
+
}
|
|
5691
|
+
async function getCompanyById(companyId, signal) {
|
|
5692
|
+
const data = await client.get(`${BASE_URL17}/${companyId}`, {
|
|
5693
|
+
signal
|
|
5694
|
+
}).json();
|
|
5695
|
+
return companySchema.parse(data);
|
|
5696
|
+
}
|
|
5697
|
+
return { getCompanyBriefInfoByOrg, companySearch, getCompanyById };
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
// lib/rulesManagement/index.ts
|
|
5701
|
+
var BASE_URL18 = "rules";
|
|
5702
|
+
function createRulesManagementApi(client) {
|
|
5703
|
+
async function activateRule(ruleId, request, signal) {
|
|
5704
|
+
await client.post(`${BASE_URL18}/${ruleId}/activate`, {
|
|
5705
|
+
json: request,
|
|
5706
|
+
signal
|
|
5707
|
+
});
|
|
5708
|
+
}
|
|
5709
|
+
return {
|
|
5710
|
+
activateRule
|
|
5711
|
+
};
|
|
5548
5712
|
}
|
|
5549
5713
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5550
5714
|
0 && (module.exports = {
|
|
@@ -5564,6 +5728,7 @@ function createCompaniesApi(client) {
|
|
|
5564
5728
|
createItemsApiV2,
|
|
5565
5729
|
createLocaleApi,
|
|
5566
5730
|
createProductTypesApi,
|
|
5731
|
+
createRulesManagementApi,
|
|
5567
5732
|
createSpreadsheetTemplateApi,
|
|
5568
5733
|
createTradingPartnerAccessApi,
|
|
5569
5734
|
createTradingPartnerSettingsApi,
|