@spscommerce/asst-api 0.0.1-beta.9 → 0.0.1
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 → ItemErrorDetailsResult-317fbe3e.d.ts} +166 -156
- package/dist/ItemStatusResponse-7f871d5a.d.ts +91 -0
- package/dist/{chunk-IHIEBLQV.js → chunk-HEFVXX2V.js} +82 -23
- package/dist/{chunk-ITWMRXLD.js → chunk-HG7MCO42.js} +77 -16
- package/dist/index.cjs +148 -36
- package/dist/index.d.ts +119 -6
- package/dist/index.js +4 -2
- package/dist/msw.cjs +158 -29
- package/dist/msw.d.ts +110 -69
- package/dist/msw.js +82 -11
- package/dist/{ItemErrorDetails-e6e400aa.d.ts → zod-1c4396f8.d.ts} +179 -103
- package/dist/zod.cjs +84 -22
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +9 -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/msw.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as msw from 'msw';
|
|
2
2
|
import { ResponseResolver, RestRequest, RestContext, DefaultBodyType } from 'msw';
|
|
3
3
|
import * as msw_lib_glossary_de6278a9 from 'msw/lib/glossary-de6278a9';
|
|
4
|
-
import { A as AsstClient,
|
|
5
|
-
import * as zod from 'zod';
|
|
4
|
+
import { A as AsstClient, I as ImportErrors, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, c as ItemCategoriesSearch, E as Export, d as attrProdTypeSchema, T as TradingPartnerAccessByCompanyId, U as UserAccount, e as ItemErrorDetailsResult, L as Locale, f as ItemSearchView, g as ItemDetailView, h as AttributeMetaData, i as AttributesByCompany, j as AttributeDefinition, k as AttributeValidValues, S as SpreadsheetTemplate } from './ItemErrorDetailsResult-317fbe3e.js';
|
|
6
5
|
import { z } from 'zod';
|
|
6
|
+
import { I as ItemStatusResponse } from './ItemStatusResponse-7f871d5a.js';
|
|
7
7
|
import 'ky-universal';
|
|
8
8
|
import 'ky';
|
|
9
9
|
|
|
@@ -108,6 +108,7 @@ declare function createCategoriesApiHandlers(client: AsstClient): {
|
|
|
108
108
|
type: string;
|
|
109
109
|
name: string;
|
|
110
110
|
categoryid: number;
|
|
111
|
+
encodedCategoryId: string;
|
|
111
112
|
companyId: number;
|
|
112
113
|
isActive: number;
|
|
113
114
|
typeId: number;
|
|
@@ -179,6 +180,7 @@ declare function createTradingPartnerAccessApiHandlers(client: AsstClient): {
|
|
|
179
180
|
catalog_name: string | null;
|
|
180
181
|
partner_company_name: string;
|
|
181
182
|
partner_company_id: number;
|
|
183
|
+
partner_org_id: string;
|
|
182
184
|
}[];
|
|
183
185
|
};
|
|
184
186
|
};
|
|
@@ -199,43 +201,12 @@ declare function createWhoAmIApiHandlers(client: AsstClient): {
|
|
|
199
201
|
identityUser: {
|
|
200
202
|
name: string;
|
|
201
203
|
id: string;
|
|
202
|
-
email: string;
|
|
203
|
-
first_name: string;
|
|
204
|
-
last_name: string;
|
|
205
|
-
job_title: string;
|
|
206
|
-
externally_managed: boolean;
|
|
207
|
-
city: string;
|
|
208
|
-
state: string;
|
|
209
|
-
country: string;
|
|
210
|
-
user_type: string;
|
|
211
|
-
token_type: string;
|
|
212
|
-
avatar_image_id: string;
|
|
213
|
-
avatar_image_url: string;
|
|
214
|
-
origin_avatar_image_id: string;
|
|
215
|
-
bio: string;
|
|
216
|
-
phone_number: string;
|
|
217
|
-
twitter_handle: string;
|
|
218
|
-
linkedin_url: string;
|
|
219
|
-
preferences: {
|
|
220
|
-
locale: string;
|
|
221
|
-
timezone: string;
|
|
222
|
-
language: string[];
|
|
223
|
-
datetime: {
|
|
224
|
-
DATE_TIME: string;
|
|
225
|
-
TIME: string;
|
|
226
|
-
SHORT_DATE: string;
|
|
227
|
-
LONG_DATETIME: string;
|
|
228
|
-
LONG_TIME: string;
|
|
229
|
-
DATE: string;
|
|
230
|
-
};
|
|
231
|
-
cpUpgrade?: string | undefined;
|
|
232
|
-
};
|
|
233
204
|
roles: string[];
|
|
234
205
|
organization: {
|
|
235
|
-
namespace: string;
|
|
236
|
-
organization_name: string;
|
|
237
|
-
organization_site: string;
|
|
238
206
|
id: string;
|
|
207
|
+
organization_name?: string | undefined;
|
|
208
|
+
organization_site?: string | undefined;
|
|
209
|
+
namespace?: string | undefined;
|
|
239
210
|
permissions?: string[] | undefined;
|
|
240
211
|
metadata?: {
|
|
241
212
|
value: string;
|
|
@@ -245,7 +216,38 @@ declare function createWhoAmIApiHandlers(client: AsstClient): {
|
|
|
245
216
|
};
|
|
246
217
|
password: string;
|
|
247
218
|
verified: boolean;
|
|
219
|
+
email?: string | undefined;
|
|
220
|
+
first_name?: string | undefined;
|
|
221
|
+
last_name?: string | undefined;
|
|
222
|
+
job_title?: string | undefined;
|
|
223
|
+
externally_managed?: boolean | undefined;
|
|
224
|
+
city?: string | undefined;
|
|
225
|
+
state?: string | undefined;
|
|
226
|
+
country?: string | undefined;
|
|
227
|
+
user_type?: string | undefined;
|
|
228
|
+
token_type?: string | undefined;
|
|
229
|
+
avatar_image_id?: string | undefined;
|
|
230
|
+
avatar_image_url?: string | undefined;
|
|
231
|
+
origin_avatar_image_id?: string | undefined;
|
|
232
|
+
bio?: string | undefined;
|
|
233
|
+
phone_number?: string | undefined;
|
|
234
|
+
twitter_handle?: string | undefined;
|
|
235
|
+
linkedin_url?: string | undefined;
|
|
248
236
|
description?: string | undefined;
|
|
237
|
+
preferences?: {
|
|
238
|
+
locale: string;
|
|
239
|
+
timezone: string;
|
|
240
|
+
language: string[];
|
|
241
|
+
datetime: {
|
|
242
|
+
DATE_TIME: string;
|
|
243
|
+
TIME: string;
|
|
244
|
+
SHORT_DATE: string;
|
|
245
|
+
LONG_DATETIME: string;
|
|
246
|
+
LONG_TIME: string;
|
|
247
|
+
DATE: string;
|
|
248
|
+
};
|
|
249
|
+
cpUpgrade?: string | undefined;
|
|
250
|
+
} | undefined;
|
|
249
251
|
};
|
|
250
252
|
retailer: boolean;
|
|
251
253
|
supplier: boolean;
|
|
@@ -349,15 +351,15 @@ declare function createItemsApiHandlers(client: AsstClient): {
|
|
|
349
351
|
itemInfoId: string;
|
|
350
352
|
status?: string | undefined;
|
|
351
353
|
};
|
|
352
|
-
itemMaps:
|
|
353
|
-
rn:
|
|
354
|
-
iteminfoid:
|
|
355
|
-
tradingPartnerStages:
|
|
356
|
-
companyId:
|
|
357
|
-
companyName:
|
|
358
|
-
stage:
|
|
359
|
-
isValid:
|
|
360
|
-
}, "strip",
|
|
354
|
+
itemMaps: z.objectOutputType<{
|
|
355
|
+
rn: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
iteminfoid: z.ZodString;
|
|
357
|
+
tradingPartnerStages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
358
|
+
companyId: z.ZodNumber;
|
|
359
|
+
companyName: z.ZodString;
|
|
360
|
+
stage: z.ZodNullable<z.ZodEnum<["CORE", "CORE_PLUS", "CORE_ADVANCED", "ENRICHED", "STANDARD_REQUIREMENTS"]>>;
|
|
361
|
+
isValid: z.ZodBoolean;
|
|
362
|
+
}, "strip", z.ZodTypeAny, {
|
|
361
363
|
companyId: number;
|
|
362
364
|
companyName: string;
|
|
363
365
|
stage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
@@ -368,28 +370,23 @@ declare function createItemsApiHandlers(client: AsstClient): {
|
|
|
368
370
|
stage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
369
371
|
isValid: boolean;
|
|
370
372
|
}>, "many">>;
|
|
371
|
-
gtin:
|
|
372
|
-
catalogname:
|
|
373
|
-
isbn:
|
|
374
|
-
lastupdateddatestring:
|
|
375
|
-
upc:
|
|
376
|
-
productcodename:
|
|
377
|
-
ean:
|
|
378
|
-
selectioncodename:
|
|
379
|
-
createddatestring:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
nrfcolorcode: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString, "many">>>;
|
|
389
|
-
nrfsizecode: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString, "many">>>;
|
|
390
|
-
productcolordescription: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString, "many">>>;
|
|
391
|
-
productsizedescription: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString, "many">>>;
|
|
392
|
-
}, zod.ZodTypeAny, "passthrough">[];
|
|
373
|
+
gtin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
374
|
+
catalogname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
375
|
+
isbn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
376
|
+
lastupdateddatestring: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
377
|
+
upc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
378
|
+
productcodename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
379
|
+
ean: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
|
+
selectioncodename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
|
+
createddatestring: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
382
|
+
partnumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
383
|
+
consumeravailabledatestring: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
384
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
385
|
+
nrfcolorcode: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
386
|
+
nrfsizecode: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
387
|
+
productcolordescription: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
388
|
+
productsizedescription: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
389
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
393
390
|
};
|
|
394
391
|
};
|
|
395
392
|
};
|
|
@@ -523,6 +520,37 @@ declare function createItemsApiHandlers(client: AsstClient): {
|
|
|
523
520
|
deleteItems: (resolver?: ResponseResolver<RestRequest<never, {
|
|
524
521
|
itemIds: string[];
|
|
525
522
|
}>>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
523
|
+
getItemInfoId: {
|
|
524
|
+
(resolver?: ResponseResolver<RestRequest<never, {
|
|
525
|
+
spsItemId: string;
|
|
526
|
+
}>, RestContext, number>): msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
527
|
+
generateData(): number;
|
|
528
|
+
};
|
|
529
|
+
getSpsItemId: {
|
|
530
|
+
(resolver?: ResponseResolver<RestRequest<never, {
|
|
531
|
+
itemInfoId: string;
|
|
532
|
+
}>, RestContext, string>): msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
533
|
+
generateData(): string;
|
|
534
|
+
};
|
|
535
|
+
getItemStatus: {
|
|
536
|
+
(resolver?: ResponseResolver<RestRequest<never, {
|
|
537
|
+
itemIds: string[];
|
|
538
|
+
}>, RestContext, ItemStatusResponse>): msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
539
|
+
generateData(): {
|
|
540
|
+
itemStatuses: {
|
|
541
|
+
itemId: string;
|
|
542
|
+
itemOrgStatuses: {
|
|
543
|
+
org: {
|
|
544
|
+
name: string;
|
|
545
|
+
id: string;
|
|
546
|
+
ref: string;
|
|
547
|
+
};
|
|
548
|
+
lowestInvalidStage: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS" | null;
|
|
549
|
+
validForRelationship: boolean;
|
|
550
|
+
}[];
|
|
551
|
+
}[];
|
|
552
|
+
};
|
|
553
|
+
};
|
|
526
554
|
};
|
|
527
555
|
|
|
528
556
|
/**
|
|
@@ -707,7 +735,11 @@ declare function createAttributesApiHandlers(client: AsstClient): {
|
|
|
707
735
|
isDefault: boolean;
|
|
708
736
|
attrKeyPair: string;
|
|
709
737
|
attrValueId: number;
|
|
710
|
-
}
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
getCompanyInterestedAttributes: {
|
|
741
|
+
(resolver?: ResponseResolver<RestRequest<never, never>, RestContext, string[]>): msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
742
|
+
generateData(): string[];
|
|
711
743
|
};
|
|
712
744
|
};
|
|
713
745
|
|
|
@@ -747,4 +779,13 @@ declare function createCompanyFeaturesApiHandlers(client: AsstClient): {
|
|
|
747
779
|
checkIfStageItemSetupIsEnabled: (resolver?: ResponseResolver<RestRequest<never>, RestContext, boolean>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
|
|
748
780
|
};
|
|
749
781
|
|
|
750
|
-
|
|
782
|
+
/**
|
|
783
|
+
* Generate collection of MSW request handlers for `Feature Flags Api`
|
|
784
|
+
* @param client Assortment Client instance
|
|
785
|
+
* @returns An object containing functions to generate MSW request handlers
|
|
786
|
+
*/
|
|
787
|
+
declare function createFeatureFlagsApiHandlers(client: AsstClient): {
|
|
788
|
+
checkEnableItemsApiEndpointsForImports: (resolver?: ResponseResolver<RestRequest<never>, RestContext, boolean>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
export { createAttributesApiHandlers, createCategoriesApiHandlers, createCompanyFeaturesApiHandlers, createErrorsApiHandlers, createExportsApiHandlers, createFeatureFlagsApiHandlers, createImportsApiHandlers, createItemsApiHandlers, createLocaleApiHandlers, createProductTypesApiHandlers, createSpreadsheetTemplateApiHandlers, createTradingPartnerAccessApiHandlers, createWhoAmIApiHandlers };
|
package/dist/msw.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BASE_URL10,
|
|
4
4
|
BASE_URL11,
|
|
5
5
|
BASE_URL12,
|
|
6
|
+
BASE_URL13,
|
|
6
7
|
BASE_URL2,
|
|
7
8
|
BASE_URL3,
|
|
8
9
|
BASE_URL4,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
BASE_URL8,
|
|
13
14
|
BASE_URL9,
|
|
14
15
|
BASE_URL_V2
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HG7MCO42.js";
|
|
16
17
|
import {
|
|
17
18
|
attrProdTypeSchema,
|
|
18
19
|
attributeDefinitionSchema,
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
26
27
|
itemDetailViewSchema,
|
|
27
28
|
itemErrorDetailsResultSchema,
|
|
28
29
|
itemSearchViewSchema,
|
|
30
|
+
itemStatusResponseSchema,
|
|
29
31
|
localeSchema,
|
|
30
32
|
pagedResultsSchema,
|
|
31
33
|
spreadsheetTemplateSchema,
|
|
@@ -33,7 +35,7 @@ import {
|
|
|
33
35
|
userAccountSchema,
|
|
34
36
|
vendorPartnerAttGroupsSchema,
|
|
35
37
|
z
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-HEFVXX2V.js";
|
|
37
39
|
|
|
38
40
|
// lib/imports/mockHandlers.ts
|
|
39
41
|
import { generateMock } from "@anatine/zod-mock";
|
|
@@ -217,7 +219,7 @@ function createErrorsApiHandlers(client) {
|
|
|
217
219
|
const data = generateMock6(itemErrorDetailsResultSchema);
|
|
218
220
|
return res(ctx.status(200), ctx.json(data));
|
|
219
221
|
}) {
|
|
220
|
-
return rest7.get(`${client.getBaseUrl()}/${
|
|
222
|
+
return rest7.get(`${client.getBaseUrl()}/${BASE_URL13}/items/:itemInfoId`, resolver);
|
|
221
223
|
}
|
|
222
224
|
getInvalidItemErrorDetails.generateData = () => generateMock6(itemErrorDetailsResultSchema);
|
|
223
225
|
return {
|
|
@@ -251,7 +253,7 @@ function createItemsApiHandlers(client) {
|
|
|
251
253
|
const data = generateMock8(itemSearchViewSchema);
|
|
252
254
|
return res(ctx.status(200), ctx.json(data));
|
|
253
255
|
}) {
|
|
254
|
-
return rest9.get(`${client.getBaseUrl()}/${
|
|
256
|
+
return rest9.get(`${client.getBaseUrl()}/${BASE_URL12}`, resolver);
|
|
255
257
|
}
|
|
256
258
|
searchItems.generateData = () => generateMock8(itemSearchViewSchema);
|
|
257
259
|
function getItem(resolver = (_req, res, ctx) => {
|
|
@@ -259,7 +261,7 @@ function createItemsApiHandlers(client) {
|
|
|
259
261
|
return res(ctx.status(200), ctx.json(data));
|
|
260
262
|
}) {
|
|
261
263
|
return rest9.get(
|
|
262
|
-
`${client.getBaseUrl()}/${
|
|
264
|
+
`${client.getBaseUrl()}/${BASE_URL12}/:itemId`,
|
|
263
265
|
resolver
|
|
264
266
|
);
|
|
265
267
|
}
|
|
@@ -268,21 +270,60 @@ function createItemsApiHandlers(client) {
|
|
|
268
270
|
return res(ctx.status(200));
|
|
269
271
|
}) {
|
|
270
272
|
return rest9.put(
|
|
271
|
-
`${client.getBaseUrl()}/${
|
|
273
|
+
`${client.getBaseUrl()}/${BASE_URL12}/details/:itemId`,
|
|
272
274
|
resolver
|
|
273
275
|
);
|
|
274
276
|
}
|
|
275
277
|
function deleteItem(resolver = (_req, res, ctx) => {
|
|
276
278
|
return res(ctx.status(200));
|
|
277
279
|
}) {
|
|
278
|
-
return rest9.post(`${client.getBaseUrl()}/${
|
|
280
|
+
return rest9.post(`${client.getBaseUrl()}/${BASE_URL12}/:itemId`, resolver);
|
|
279
281
|
}
|
|
280
282
|
function deleteItems(resolver = (_req, res, ctx) => {
|
|
281
283
|
return res(ctx.status(200));
|
|
282
284
|
}) {
|
|
283
|
-
return rest9.post(`${client.getBaseUrl()}/${
|
|
285
|
+
return rest9.post(`${client.getBaseUrl()}/${BASE_URL12}/items`, resolver);
|
|
284
286
|
}
|
|
285
|
-
|
|
287
|
+
function getItemInfoId(resolver = (_req, res, ctx) => {
|
|
288
|
+
const data = generateMock8(z.number());
|
|
289
|
+
return res(ctx.status(200), ctx.json(data));
|
|
290
|
+
}) {
|
|
291
|
+
return rest9.get(
|
|
292
|
+
`${client.getBaseUrl()}/${BASE_URL12}/:spsItemId/itemInfoId`,
|
|
293
|
+
resolver
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
getItemInfoId.generateData = () => generateMock8(z.number());
|
|
297
|
+
function getSpsItemId(resolver = (_req, res, ctx) => {
|
|
298
|
+
const data = generateMock8(z.string());
|
|
299
|
+
return res(ctx.status(200), ctx.json(data));
|
|
300
|
+
}) {
|
|
301
|
+
return rest9.get(
|
|
302
|
+
`${client.getBaseUrl()}/${BASE_URL12}/:itemInfoId/spsItemId`,
|
|
303
|
+
resolver
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
getSpsItemId.generateData = () => generateMock8(z.string());
|
|
307
|
+
function getItemStatus(resolver = (_req, res, ctx) => {
|
|
308
|
+
const data = generateMock8(itemStatusResponseSchema);
|
|
309
|
+
return res(ctx.status(200), ctx.json(data));
|
|
310
|
+
}) {
|
|
311
|
+
return rest9.get(
|
|
312
|
+
`${client.getBaseUrl()}/${BASE_URL12}/status`,
|
|
313
|
+
resolver
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
getItemStatus.generateData = () => generateMock8(itemStatusResponseSchema);
|
|
317
|
+
return {
|
|
318
|
+
searchItems,
|
|
319
|
+
getItem,
|
|
320
|
+
updateItem,
|
|
321
|
+
deleteItem,
|
|
322
|
+
deleteItems,
|
|
323
|
+
getItemInfoId,
|
|
324
|
+
getSpsItemId,
|
|
325
|
+
getItemStatus
|
|
326
|
+
};
|
|
286
327
|
}
|
|
287
328
|
|
|
288
329
|
// lib/attributes/mockHandlers.ts
|
|
@@ -324,12 +365,23 @@ function createAttributesApiHandlers(client) {
|
|
|
324
365
|
resolver
|
|
325
366
|
);
|
|
326
367
|
}
|
|
327
|
-
getAttributeValidValues.generateData = () => generateMock9(
|
|
368
|
+
getAttributeValidValues.generateData = () => generateMock9(attributeValidValuesSchema);
|
|
369
|
+
function getCompanyInterestedAttributes(resolver = (_req, res, ctx) => {
|
|
370
|
+
const data = generateMock9(z.array(z.string()));
|
|
371
|
+
return res(ctx.status(200), ctx.json(data));
|
|
372
|
+
}) {
|
|
373
|
+
return rest10.get(
|
|
374
|
+
`${client.getBaseUrl()}/${BASE_URL6}/company/interested-attributes`,
|
|
375
|
+
resolver
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
getCompanyInterestedAttributes.generateData = () => generateMock9(z.array(z.string()));
|
|
328
379
|
return {
|
|
329
380
|
getAllAttributes,
|
|
330
381
|
getAllAttributesByCompany,
|
|
331
382
|
getAttributesExtensiveInfo,
|
|
332
|
-
getAttributeValidValues
|
|
383
|
+
getAttributeValidValues,
|
|
384
|
+
getCompanyInterestedAttributes
|
|
333
385
|
};
|
|
334
386
|
}
|
|
335
387
|
|
|
@@ -366,12 +418,31 @@ function createCompanyFeaturesApiHandlers(client) {
|
|
|
366
418
|
checkIfStageItemSetupIsEnabled
|
|
367
419
|
};
|
|
368
420
|
}
|
|
421
|
+
|
|
422
|
+
// lib/featureFlags/mockHandlers.ts
|
|
423
|
+
import { generateMock as generateMock12 } from "@anatine/zod-mock";
|
|
424
|
+
import { rest as rest13 } from "msw";
|
|
425
|
+
function createFeatureFlagsApiHandlers(client) {
|
|
426
|
+
function checkEnableItemsApiEndpointsForImports(resolver = (_req, res, ctx) => {
|
|
427
|
+
const data = generateMock12(z.boolean());
|
|
428
|
+
return res(ctx.status(200), ctx.json(data));
|
|
429
|
+
}) {
|
|
430
|
+
return rest13.get(
|
|
431
|
+
`${client.getBaseUrl()}/${BASE_URL11}/enable-items-api-endpoints-for-imports/`,
|
|
432
|
+
resolver
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
checkEnableItemsApiEndpointsForImports
|
|
437
|
+
};
|
|
438
|
+
}
|
|
369
439
|
export {
|
|
370
440
|
createAttributesApiHandlers,
|
|
371
441
|
createCategoriesApiHandlers,
|
|
372
442
|
createCompanyFeaturesApiHandlers,
|
|
373
443
|
createErrorsApiHandlers,
|
|
374
444
|
createExportsApiHandlers,
|
|
445
|
+
createFeatureFlagsApiHandlers,
|
|
375
446
|
createImportsApiHandlers,
|
|
376
447
|
createItemsApiHandlers,
|
|
377
448
|
createLocaleApiHandlers,
|