@spscommerce/asst-api 1.0.0 → 1.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/{CompanyBriefByOrg-HsKxilwl.d.ts → CompanyBriefByOrg-QIqfCtA_.d.ts} +273 -8
- package/dist/{chunk-6FFDMMN5.js → chunk-3EK6JHC5.js} +137 -2
- package/dist/{chunk-C2N5RQWG.js → chunk-SFRJ3IYY.js} +43 -13
- package/dist/{index-wuCGfJSu.d.ts → index-6k1X-ckx.d.ts} +1 -1
- package/dist/index.cjs +171 -76
- package/dist/index.d.cts +32 -15
- package/dist/index.d.ts +32 -15
- package/dist/index.js +5 -65
- package/dist/msw.cjs +250 -98
- package/dist/msw.d.cts +49 -8
- package/dist/msw.d.ts +49 -8
- package/dist/msw.js +95 -73
- package/dist/{zod-9pZn6tpQ.d.ts → zod-FlYA7lT3.d.ts} +157 -2
- package/dist/zod.cjs +141 -2
- package/dist/zod.d.cts +2 -3
- package/dist/zod.d.ts +2 -3
- package/dist/zod.js +11 -1
- package/package.json +3 -3
package/dist/msw.d.cts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
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, I as ImportErrors, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, c as ItemCategoriesSearch, E as Export, d as attrProdTypeSchema, T as TradingPartnerAccessByCompanyId, e as CompanyRelationshipUpsertBody, U as UserAccount, f as ItemErrorDetailsResult, L as Locale,
|
|
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, e as CompanyRelationshipUpsertBody, U as UserAccount, f as ItemErrorDetailsResult, g as ItemErrorSummaryResultV2, h as ItemErrorDetailsResultV2, L as Locale, i as ItemSearchView, j as ItemDetailView, k as AttributeMetaData, l as AttributesByCompany, m as AttributeDefinition, n as AttributeValidValues, S as SpreadsheetTemplate } from './CompanyBriefByOrg-QIqfCtA_.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { R as RetailerTradingPartnerStages, I as ItemStatusResponse } from './index-
|
|
7
|
-
export { c as createCompaniesApi } from './index-
|
|
8
|
-
import 'ky-universal';
|
|
6
|
+
import { R as RetailerTradingPartnerStages, I as ItemStatusResponse } from './index-6k1X-ckx.js';
|
|
7
|
+
export { c as createCompaniesApi } from './index-6k1X-ckx.js';
|
|
9
8
|
import 'ky';
|
|
10
9
|
|
|
11
10
|
declare function pagedResultsSchema<T extends z.ZodTypeAny>(resultsType: T): z.ZodObject<{
|
|
@@ -318,10 +317,10 @@ declare function createErrorsApiHandlers(client: AsstClient): {
|
|
|
318
317
|
isValid: boolean;
|
|
319
318
|
}[];
|
|
320
319
|
attributeName: string | null;
|
|
321
|
-
errorMessage: string;
|
|
322
|
-
tradingPartnerNames: string[];
|
|
323
320
|
phases: ("CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS")[];
|
|
321
|
+
errorMessage: string;
|
|
324
322
|
attributeDbNames: string[];
|
|
323
|
+
tradingPartnerNames: string[];
|
|
325
324
|
repeatableGroupId?: string | null | undefined;
|
|
326
325
|
}[];
|
|
327
326
|
gtin?: string | null | undefined;
|
|
@@ -333,6 +332,49 @@ declare function createErrorsApiHandlers(client: AsstClient): {
|
|
|
333
332
|
};
|
|
334
333
|
};
|
|
335
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Generate collection of MSW request handlers for `ErrorsApi`
|
|
337
|
+
* @param client Assortment Client instance
|
|
338
|
+
* @returns An object containing functions to generate MSW request handlers
|
|
339
|
+
*/
|
|
340
|
+
declare function createErrorsApiV2Handlers(client: AsstClient): {
|
|
341
|
+
getItemErrorSummary: (resolver?: ResponseResolver<RestRequest, RestContext, ItemErrorSummaryResultV2>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
342
|
+
getItemErrorDetails: {
|
|
343
|
+
(resolver?: ResponseResolver<RestRequest<never, {
|
|
344
|
+
itemInfoId: string;
|
|
345
|
+
}>, RestContext, ItemErrorDetailsResultV2>): msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
346
|
+
generateData(): {
|
|
347
|
+
itemInfoId: number;
|
|
348
|
+
itemErrorDetails: {
|
|
349
|
+
tradingPartnerStages: {
|
|
350
|
+
companyId: number;
|
|
351
|
+
companyName: string;
|
|
352
|
+
isValid: boolean;
|
|
353
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
354
|
+
}[];
|
|
355
|
+
attributeName: string;
|
|
356
|
+
phases: Set<"CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED">;
|
|
357
|
+
errorMessage: string;
|
|
358
|
+
attributeDbNames: string[];
|
|
359
|
+
tradingPartnerNames: string[];
|
|
360
|
+
repeatableGroupId: string;
|
|
361
|
+
}[];
|
|
362
|
+
gtin?: string | null | undefined;
|
|
363
|
+
upc?: string | null | undefined;
|
|
364
|
+
ean?: string | null | undefined;
|
|
365
|
+
isbn?: string | null | undefined;
|
|
366
|
+
partnumber?: string | null | undefined;
|
|
367
|
+
productcolordescription?: string | null | undefined;
|
|
368
|
+
colorfamily?: string | null | undefined;
|
|
369
|
+
fit?: string | null | undefined;
|
|
370
|
+
distributioncentercode?: string | null | undefined;
|
|
371
|
+
accountnumber?: string | null | undefined;
|
|
372
|
+
erpid?: string | null | undefined;
|
|
373
|
+
itemName?: string | null | undefined;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
|
|
336
378
|
/**
|
|
337
379
|
* Generate collection of MSW request handlers for `Locale Api`
|
|
338
380
|
* @param client Assortment Client instance
|
|
@@ -812,7 +854,6 @@ declare function createCompanyFeaturesApiHandlers(client: AsstClient): {
|
|
|
812
854
|
* @returns An object containing functions to generate MSW request handlers
|
|
813
855
|
*/
|
|
814
856
|
declare function createFeatureFlagsApiHandlers(client: AsstClient): {
|
|
815
|
-
checkEnableItemsApiEndpointsForImports: (resolver?: ResponseResolver<RestRequest<never>, RestContext, boolean>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
|
|
816
857
|
checkEnableItemsLevelMSIS: (resolver?: ResponseResolver<RestRequest<never>, RestContext, boolean>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
|
|
817
858
|
};
|
|
818
859
|
|
|
@@ -830,4 +871,4 @@ declare function createUniqueCriteriaApiHandlers(client: AsstClient): {
|
|
|
830
871
|
};
|
|
831
872
|
};
|
|
832
873
|
|
|
833
|
-
export { createAttributesApiHandlers, createCategoriesApiHandlers, createCompanyFeaturesApiHandlers, createErrorsApiHandlers, createExportsApiHandlers, createFeatureFlagsApiHandlers, createImportsApiHandlers, createItemsApiHandlers, createLocaleApiHandlers, createProductTypesApiHandlers, createSpreadsheetTemplateApiHandlers, createTradingPartnerAccessApiHandlers, createTradingPartnerSettingsApiHandlers, createUniqueCriteriaApiHandlers, createWhoAmIApiHandlers };
|
|
874
|
+
export { createAttributesApiHandlers, createCategoriesApiHandlers, createCompanyFeaturesApiHandlers, createErrorsApiHandlers, createErrorsApiV2Handlers, createExportsApiHandlers, createFeatureFlagsApiHandlers, createImportsApiHandlers, createItemsApiHandlers, createLocaleApiHandlers, createProductTypesApiHandlers, createSpreadsheetTemplateApiHandlers, createTradingPartnerAccessApiHandlers, createTradingPartnerSettingsApiHandlers, createUniqueCriteriaApiHandlers, createWhoAmIApiHandlers };
|
package/dist/msw.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
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, I as ImportErrors, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, c as ItemCategoriesSearch, E as Export, d as attrProdTypeSchema, T as TradingPartnerAccessByCompanyId, e as CompanyRelationshipUpsertBody, U as UserAccount, f as ItemErrorDetailsResult, L as Locale,
|
|
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, e as CompanyRelationshipUpsertBody, U as UserAccount, f as ItemErrorDetailsResult, g as ItemErrorSummaryResultV2, h as ItemErrorDetailsResultV2, L as Locale, i as ItemSearchView, j as ItemDetailView, k as AttributeMetaData, l as AttributesByCompany, m as AttributeDefinition, n as AttributeValidValues, S as SpreadsheetTemplate } from './CompanyBriefByOrg-QIqfCtA_.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { R as RetailerTradingPartnerStages, I as ItemStatusResponse } from './index-
|
|
7
|
-
export { c as createCompaniesApi } from './index-
|
|
8
|
-
import 'ky-universal';
|
|
6
|
+
import { R as RetailerTradingPartnerStages, I as ItemStatusResponse } from './index-6k1X-ckx.js';
|
|
7
|
+
export { c as createCompaniesApi } from './index-6k1X-ckx.js';
|
|
9
8
|
import 'ky';
|
|
10
9
|
|
|
11
10
|
declare function pagedResultsSchema<T extends z.ZodTypeAny>(resultsType: T): z.ZodObject<{
|
|
@@ -318,10 +317,10 @@ declare function createErrorsApiHandlers(client: AsstClient): {
|
|
|
318
317
|
isValid: boolean;
|
|
319
318
|
}[];
|
|
320
319
|
attributeName: string | null;
|
|
321
|
-
errorMessage: string;
|
|
322
|
-
tradingPartnerNames: string[];
|
|
323
320
|
phases: ("CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | "STANDARD_REQUIREMENTS")[];
|
|
321
|
+
errorMessage: string;
|
|
324
322
|
attributeDbNames: string[];
|
|
323
|
+
tradingPartnerNames: string[];
|
|
325
324
|
repeatableGroupId?: string | null | undefined;
|
|
326
325
|
}[];
|
|
327
326
|
gtin?: string | null | undefined;
|
|
@@ -333,6 +332,49 @@ declare function createErrorsApiHandlers(client: AsstClient): {
|
|
|
333
332
|
};
|
|
334
333
|
};
|
|
335
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Generate collection of MSW request handlers for `ErrorsApi`
|
|
337
|
+
* @param client Assortment Client instance
|
|
338
|
+
* @returns An object containing functions to generate MSW request handlers
|
|
339
|
+
*/
|
|
340
|
+
declare function createErrorsApiV2Handlers(client: AsstClient): {
|
|
341
|
+
getItemErrorSummary: (resolver?: ResponseResolver<RestRequest, RestContext, ItemErrorSummaryResultV2>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
342
|
+
getItemErrorDetails: {
|
|
343
|
+
(resolver?: ResponseResolver<RestRequest<never, {
|
|
344
|
+
itemInfoId: string;
|
|
345
|
+
}>, RestContext, ItemErrorDetailsResultV2>): msw.RestHandler<msw_lib_glossary_de6278a9.M<DefaultBodyType>>;
|
|
346
|
+
generateData(): {
|
|
347
|
+
itemInfoId: number;
|
|
348
|
+
itemErrorDetails: {
|
|
349
|
+
tradingPartnerStages: {
|
|
350
|
+
companyId: number;
|
|
351
|
+
companyName: string;
|
|
352
|
+
isValid: boolean;
|
|
353
|
+
stage?: "CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED" | null | undefined;
|
|
354
|
+
}[];
|
|
355
|
+
attributeName: string;
|
|
356
|
+
phases: Set<"CORE" | "CORE_PLUS" | "CORE_ADVANCED" | "ENRICHED">;
|
|
357
|
+
errorMessage: string;
|
|
358
|
+
attributeDbNames: string[];
|
|
359
|
+
tradingPartnerNames: string[];
|
|
360
|
+
repeatableGroupId: string;
|
|
361
|
+
}[];
|
|
362
|
+
gtin?: string | null | undefined;
|
|
363
|
+
upc?: string | null | undefined;
|
|
364
|
+
ean?: string | null | undefined;
|
|
365
|
+
isbn?: string | null | undefined;
|
|
366
|
+
partnumber?: string | null | undefined;
|
|
367
|
+
productcolordescription?: string | null | undefined;
|
|
368
|
+
colorfamily?: string | null | undefined;
|
|
369
|
+
fit?: string | null | undefined;
|
|
370
|
+
distributioncentercode?: string | null | undefined;
|
|
371
|
+
accountnumber?: string | null | undefined;
|
|
372
|
+
erpid?: string | null | undefined;
|
|
373
|
+
itemName?: string | null | undefined;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
|
|
336
378
|
/**
|
|
337
379
|
* Generate collection of MSW request handlers for `Locale Api`
|
|
338
380
|
* @param client Assortment Client instance
|
|
@@ -812,7 +854,6 @@ declare function createCompanyFeaturesApiHandlers(client: AsstClient): {
|
|
|
812
854
|
* @returns An object containing functions to generate MSW request handlers
|
|
813
855
|
*/
|
|
814
856
|
declare function createFeatureFlagsApiHandlers(client: AsstClient): {
|
|
815
|
-
checkEnableItemsApiEndpointsForImports: (resolver?: ResponseResolver<RestRequest<never>, RestContext, boolean>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
|
|
816
857
|
checkEnableItemsLevelMSIS: (resolver?: ResponseResolver<RestRequest<never>, RestContext, boolean>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
|
|
817
858
|
};
|
|
818
859
|
|
|
@@ -830,4 +871,4 @@ declare function createUniqueCriteriaApiHandlers(client: AsstClient): {
|
|
|
830
871
|
};
|
|
831
872
|
};
|
|
832
873
|
|
|
833
|
-
export { createAttributesApiHandlers, createCategoriesApiHandlers, createCompanyFeaturesApiHandlers, createErrorsApiHandlers, createExportsApiHandlers, createFeatureFlagsApiHandlers, createImportsApiHandlers, createItemsApiHandlers, createLocaleApiHandlers, createProductTypesApiHandlers, createSpreadsheetTemplateApiHandlers, createTradingPartnerAccessApiHandlers, createTradingPartnerSettingsApiHandlers, createUniqueCriteriaApiHandlers, createWhoAmIApiHandlers };
|
|
874
|
+
export { createAttributesApiHandlers, createCategoriesApiHandlers, createCompanyFeaturesApiHandlers, createErrorsApiHandlers, createErrorsApiV2Handlers, createExportsApiHandlers, createFeatureFlagsApiHandlers, createImportsApiHandlers, createItemsApiHandlers, createLocaleApiHandlers, createProductTypesApiHandlers, createSpreadsheetTemplateApiHandlers, createTradingPartnerAccessApiHandlers, createTradingPartnerSettingsApiHandlers, createUniqueCriteriaApiHandlers, createWhoAmIApiHandlers };
|
package/dist/msw.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
BASE_URL13,
|
|
7
7
|
BASE_URL14,
|
|
8
8
|
BASE_URL15,
|
|
9
|
+
BASE_URL16,
|
|
9
10
|
BASE_URL2,
|
|
10
11
|
BASE_URL3,
|
|
11
12
|
BASE_URL4,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
BASE_URL_V2,
|
|
18
19
|
createCompaniesApi,
|
|
19
20
|
retailerTradingPartnerStages
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SFRJ3IYY.js";
|
|
21
22
|
import {
|
|
22
23
|
attrProdTypeSchema,
|
|
23
24
|
attributeDefinitionSchema,
|
|
@@ -30,6 +31,8 @@ import {
|
|
|
30
31
|
itemCategoriesSearchSchema,
|
|
31
32
|
itemDetailViewSchema,
|
|
32
33
|
itemErrorDetailsResultSchema,
|
|
34
|
+
itemErrorDetailsResultV2Schema,
|
|
35
|
+
itemErrorSummaryResultV2Schema,
|
|
33
36
|
itemPartnerSchema,
|
|
34
37
|
itemSearchViewSchema,
|
|
35
38
|
itemStatusResponseSchema,
|
|
@@ -40,7 +43,7 @@ import {
|
|
|
40
43
|
userAccountSchema,
|
|
41
44
|
vendorPartnerAttGroupsSchema,
|
|
42
45
|
z
|
|
43
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-3EK6JHC5.js";
|
|
44
47
|
|
|
45
48
|
// lib/imports/mockHandlers.ts
|
|
46
49
|
import { generateMock } from "@anatine/zod-mock";
|
|
@@ -246,7 +249,7 @@ function createWhoAmIApiHandlers(client) {
|
|
|
246
249
|
};
|
|
247
250
|
}
|
|
248
251
|
|
|
249
|
-
// lib/errors/mockHandlers.ts
|
|
252
|
+
// lib/errors/v1/mockHandlers.ts
|
|
250
253
|
import { generateMock as generateMock7 } from "@anatine/zod-mock";
|
|
251
254
|
import {
|
|
252
255
|
rest as rest8
|
|
@@ -264,49 +267,77 @@ function createErrorsApiHandlers(client) {
|
|
|
264
267
|
};
|
|
265
268
|
}
|
|
266
269
|
|
|
267
|
-
// lib/
|
|
268
|
-
import { rest as rest9 } from "msw";
|
|
270
|
+
// lib/errors/v2/mockHandlers.ts
|
|
269
271
|
import { generateMock as generateMock8 } from "@anatine/zod-mock";
|
|
272
|
+
import {
|
|
273
|
+
rest as rest9
|
|
274
|
+
} from "msw";
|
|
275
|
+
function createErrorsApiV2Handlers(client) {
|
|
276
|
+
function getItemErrorSummary(resolver = (_req, res, ctx) => {
|
|
277
|
+
const data = generateMock8(itemErrorSummaryResultV2Schema);
|
|
278
|
+
return res(ctx.status(200), ctx.json(data));
|
|
279
|
+
}) {
|
|
280
|
+
return rest9.get(
|
|
281
|
+
`${client.getBaseUrl()}${BASE_URL15}/summary`,
|
|
282
|
+
resolver
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
function getItemErrorDetails(resolver = (_req, res, ctx) => {
|
|
286
|
+
const data = generateMock8(itemErrorDetailsResultV2Schema);
|
|
287
|
+
return res(ctx.status(200), ctx.json(data));
|
|
288
|
+
}) {
|
|
289
|
+
return rest9.get(`${client.getBaseUrl()}${BASE_URL15}/items/:itemInfoId`, resolver);
|
|
290
|
+
}
|
|
291
|
+
getItemErrorDetails.generateData = () => generateMock8(itemErrorDetailsResultV2Schema);
|
|
292
|
+
return {
|
|
293
|
+
getItemErrorSummary,
|
|
294
|
+
getItemErrorDetails
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// lib/locale/mockHandlers.ts
|
|
299
|
+
import { rest as rest10 } from "msw";
|
|
300
|
+
import { generateMock as generateMock9 } from "@anatine/zod-mock";
|
|
270
301
|
function createLocaleApiHandlers(client) {
|
|
271
302
|
function getLocale(resolver = (_req, res, ctx) => {
|
|
272
|
-
const data =
|
|
303
|
+
const data = generateMock9(z.array(localeSchema));
|
|
273
304
|
return res(ctx.status(200), ctx.json(data));
|
|
274
305
|
}) {
|
|
275
|
-
return
|
|
306
|
+
return rest10.get(`${client.getBaseUrl()}${BASE_URL8}`, resolver);
|
|
276
307
|
}
|
|
277
|
-
getLocale.generateData = () =>
|
|
308
|
+
getLocale.generateData = () => generateMock9(z.array(localeSchema));
|
|
278
309
|
return {
|
|
279
310
|
getLocale
|
|
280
311
|
};
|
|
281
312
|
}
|
|
282
313
|
|
|
283
314
|
// lib/items/v1/mockHandlers.ts
|
|
284
|
-
import { generateMock as
|
|
315
|
+
import { generateMock as generateMock10 } from "@anatine/zod-mock";
|
|
285
316
|
import {
|
|
286
|
-
rest as
|
|
317
|
+
rest as rest11
|
|
287
318
|
} from "msw";
|
|
288
319
|
function createItemsApiHandlers(client) {
|
|
289
320
|
function searchItems(resolver = (_req, res, ctx) => {
|
|
290
|
-
const data =
|
|
321
|
+
const data = generateMock10(itemSearchViewSchema);
|
|
291
322
|
return res(ctx.status(200), ctx.json(data));
|
|
292
323
|
}) {
|
|
293
|
-
return
|
|
324
|
+
return rest11.get(`${client.getBaseUrl()}${BASE_URL13}`, resolver);
|
|
294
325
|
}
|
|
295
|
-
searchItems.generateData = () =>
|
|
326
|
+
searchItems.generateData = () => generateMock10(itemSearchViewSchema);
|
|
296
327
|
function getItem(resolver = (_req, res, ctx) => {
|
|
297
|
-
const data =
|
|
328
|
+
const data = generateMock10(itemDetailViewSchema);
|
|
298
329
|
return res(ctx.status(200), ctx.json(data));
|
|
299
330
|
}) {
|
|
300
|
-
return
|
|
331
|
+
return rest11.get(
|
|
301
332
|
`${client.getBaseUrl()}${BASE_URL13}/:itemId`,
|
|
302
333
|
resolver
|
|
303
334
|
);
|
|
304
335
|
}
|
|
305
|
-
getItem.generateData = () =>
|
|
336
|
+
getItem.generateData = () => generateMock10(itemDetailViewSchema);
|
|
306
337
|
function updateItem(resolver = (_req, res, ctx) => {
|
|
307
338
|
return res(ctx.status(200));
|
|
308
339
|
}) {
|
|
309
|
-
return
|
|
340
|
+
return rest11.put(
|
|
310
341
|
`${client.getBaseUrl()}${BASE_URL13}/details/:itemId`,
|
|
311
342
|
resolver
|
|
312
343
|
);
|
|
@@ -314,43 +345,43 @@ function createItemsApiHandlers(client) {
|
|
|
314
345
|
function deleteItem(resolver = (_req, res, ctx) => {
|
|
315
346
|
return res(ctx.status(200));
|
|
316
347
|
}) {
|
|
317
|
-
return
|
|
348
|
+
return rest11.post(`${client.getBaseUrl()}${BASE_URL13}/:itemId`, resolver);
|
|
318
349
|
}
|
|
319
350
|
function deleteItems(resolver = (_req, res, ctx) => {
|
|
320
351
|
return res(ctx.status(200));
|
|
321
352
|
}) {
|
|
322
|
-
return
|
|
353
|
+
return rest11.post(`${client.getBaseUrl()}${BASE_URL13}/items`, resolver);
|
|
323
354
|
}
|
|
324
355
|
function getItemInfoId(resolver = (_req, res, ctx) => {
|
|
325
|
-
const data =
|
|
356
|
+
const data = generateMock10(z.number());
|
|
326
357
|
return res(ctx.status(200), ctx.json(data));
|
|
327
358
|
}) {
|
|
328
|
-
return
|
|
359
|
+
return rest11.get(
|
|
329
360
|
`${client.getBaseUrl()}${BASE_URL13}/:spsItemId/itemInfoId`,
|
|
330
361
|
resolver
|
|
331
362
|
);
|
|
332
363
|
}
|
|
333
|
-
getItemInfoId.generateData = () =>
|
|
364
|
+
getItemInfoId.generateData = () => generateMock10(z.number());
|
|
334
365
|
function getSpsItemId(resolver = (_req, res, ctx) => {
|
|
335
|
-
const data =
|
|
366
|
+
const data = generateMock10(z.string());
|
|
336
367
|
return res(ctx.status(200), ctx.json(data));
|
|
337
368
|
}) {
|
|
338
|
-
return
|
|
369
|
+
return rest11.get(
|
|
339
370
|
`${client.getBaseUrl()}${BASE_URL13}/:itemInfoId/spsItemId`,
|
|
340
371
|
resolver
|
|
341
372
|
);
|
|
342
373
|
}
|
|
343
|
-
getSpsItemId.generateData = () =>
|
|
374
|
+
getSpsItemId.generateData = () => generateMock10(z.string());
|
|
344
375
|
function getItemStatus(resolver = (_req, res, ctx) => {
|
|
345
|
-
const data =
|
|
376
|
+
const data = generateMock10(itemStatusResponseSchema);
|
|
346
377
|
return res(ctx.status(200), ctx.json(data));
|
|
347
378
|
}) {
|
|
348
|
-
return
|
|
379
|
+
return rest11.get(
|
|
349
380
|
`${client.getBaseUrl()}${BASE_URL13}/status`,
|
|
350
381
|
resolver
|
|
351
382
|
);
|
|
352
383
|
}
|
|
353
|
-
getItemStatus.generateData = () =>
|
|
384
|
+
getItemStatus.generateData = () => generateMock10(itemStatusResponseSchema);
|
|
354
385
|
return {
|
|
355
386
|
searchItems,
|
|
356
387
|
getItem,
|
|
@@ -365,54 +396,54 @@ function createItemsApiHandlers(client) {
|
|
|
365
396
|
|
|
366
397
|
// lib/attributes/mockHandlers.ts
|
|
367
398
|
import {
|
|
368
|
-
rest as
|
|
399
|
+
rest as rest12
|
|
369
400
|
} from "msw";
|
|
370
|
-
import { generateMock as
|
|
401
|
+
import { generateMock as generateMock11 } from "@anatine/zod-mock";
|
|
371
402
|
function createAttributesApiHandlers(client) {
|
|
372
403
|
function getAllAttributes(resolver = (_req, res, ctx) => {
|
|
373
|
-
const data =
|
|
404
|
+
const data = generateMock11(z.array(attributeMetaDataSchema));
|
|
374
405
|
return res(ctx.status(200), ctx.json(data));
|
|
375
406
|
}) {
|
|
376
|
-
return
|
|
407
|
+
return rest12.get(`${client.getBaseUrl()}${BASE_URL7}`, resolver);
|
|
377
408
|
}
|
|
378
|
-
getAllAttributes.generateData = () =>
|
|
409
|
+
getAllAttributes.generateData = () => generateMock11(attributeMetaDataSchema);
|
|
379
410
|
function getAllAttributesByCompany(resolver = (_req, res, ctx) => {
|
|
380
|
-
const data =
|
|
411
|
+
const data = generateMock11(attributesByCompanySchema);
|
|
381
412
|
return res(ctx.status(200), ctx.json(data));
|
|
382
413
|
}) {
|
|
383
|
-
return
|
|
414
|
+
return rest12.get(`${client.getBaseUrl()}${BASE_URL7}/company`, resolver);
|
|
384
415
|
}
|
|
385
|
-
getAllAttributesByCompany.generateData = () =>
|
|
416
|
+
getAllAttributesByCompany.generateData = () => generateMock11(attributesByCompanySchema);
|
|
386
417
|
function getAttributesExtensiveInfo(resolver = (_req, res, ctx) => {
|
|
387
|
-
const data =
|
|
418
|
+
const data = generateMock11(z.array(attributeDefinitionSchema));
|
|
388
419
|
return res(ctx.status(200), ctx.json(data));
|
|
389
420
|
}) {
|
|
390
|
-
return
|
|
421
|
+
return rest12.get(
|
|
391
422
|
`${client.getBaseUrl()}${BASE_URL7}/registry/editui`,
|
|
392
423
|
resolver
|
|
393
424
|
);
|
|
394
425
|
}
|
|
395
|
-
getAttributesExtensiveInfo.generateData = () =>
|
|
426
|
+
getAttributesExtensiveInfo.generateData = () => generateMock11(z.array(attributeDefinitionSchema));
|
|
396
427
|
function getAttributeValidValues(resolver = (_req, res, ctx) => {
|
|
397
|
-
const data =
|
|
428
|
+
const data = generateMock11(z.array(attributeValidValuesSchema));
|
|
398
429
|
return res(ctx.status(200), ctx.json(data));
|
|
399
430
|
}) {
|
|
400
|
-
return
|
|
431
|
+
return rest12.get(
|
|
401
432
|
`${client.getBaseUrl()}${BASE_URL7}/registry/attribute/:attributeDbName/values`,
|
|
402
433
|
resolver
|
|
403
434
|
);
|
|
404
435
|
}
|
|
405
|
-
getAttributeValidValues.generateData = () =>
|
|
436
|
+
getAttributeValidValues.generateData = () => generateMock11(attributeValidValuesSchema);
|
|
406
437
|
function getCompanyInterestedAttributes(resolver = (_req, res, ctx) => {
|
|
407
|
-
const data =
|
|
438
|
+
const data = generateMock11(z.array(z.string()));
|
|
408
439
|
return res(ctx.status(200), ctx.json(data));
|
|
409
440
|
}) {
|
|
410
|
-
return
|
|
441
|
+
return rest12.get(
|
|
411
442
|
`${client.getBaseUrl()}${BASE_URL7}/company/interested-attributes`,
|
|
412
443
|
resolver
|
|
413
444
|
);
|
|
414
445
|
}
|
|
415
|
-
getCompanyInterestedAttributes.generateData = () =>
|
|
446
|
+
getCompanyInterestedAttributes.generateData = () => generateMock11(z.array(z.string()));
|
|
416
447
|
return {
|
|
417
448
|
getAllAttributes,
|
|
418
449
|
getAllAttributesByCompany,
|
|
@@ -423,30 +454,30 @@ function createAttributesApiHandlers(client) {
|
|
|
423
454
|
}
|
|
424
455
|
|
|
425
456
|
// lib/spreadsheetTemplate/mockHandlers.ts
|
|
426
|
-
import { rest as
|
|
427
|
-
import { generateMock as
|
|
457
|
+
import { rest as rest13 } from "msw";
|
|
458
|
+
import { generateMock as generateMock12 } from "@anatine/zod-mock";
|
|
428
459
|
function createSpreadsheetTemplateApiHandlers(client) {
|
|
429
460
|
function getTemplates(resolver = (_req, res, ctx) => {
|
|
430
|
-
const data =
|
|
461
|
+
const data = generateMock12(z.array(spreadsheetTemplateSchema));
|
|
431
462
|
return res(ctx.status(200), ctx.json(data));
|
|
432
463
|
}) {
|
|
433
|
-
return
|
|
464
|
+
return rest13.get(`${client.getBaseUrl()}${BASE_URL9}`, resolver);
|
|
434
465
|
}
|
|
435
|
-
getTemplates.generateData = () =>
|
|
466
|
+
getTemplates.generateData = () => generateMock12(z.array(spreadsheetTemplateSchema));
|
|
436
467
|
return {
|
|
437
468
|
getTemplates
|
|
438
469
|
};
|
|
439
470
|
}
|
|
440
471
|
|
|
441
472
|
// lib/companyFeatures/mockHandlers.ts
|
|
442
|
-
import { generateMock as
|
|
443
|
-
import { rest as
|
|
473
|
+
import { generateMock as generateMock13 } from "@anatine/zod-mock";
|
|
474
|
+
import { rest as rest14 } from "msw";
|
|
444
475
|
function createCompanyFeaturesApiHandlers(client) {
|
|
445
476
|
function checkIfStageItemSetupIsEnabled(resolver = (_req, res, ctx) => {
|
|
446
|
-
const data =
|
|
477
|
+
const data = generateMock13(z.boolean());
|
|
447
478
|
return res(ctx.status(200), ctx.json(data));
|
|
448
479
|
}) {
|
|
449
|
-
return
|
|
480
|
+
return rest14.get(
|
|
450
481
|
`${client.getBaseUrl()}${BASE_URL11}/isphaseditemsetupenabled`,
|
|
451
482
|
resolver
|
|
452
483
|
);
|
|
@@ -457,44 +488,34 @@ function createCompanyFeaturesApiHandlers(client) {
|
|
|
457
488
|
}
|
|
458
489
|
|
|
459
490
|
// lib/featureFlags/mockHandlers.ts
|
|
460
|
-
import { generateMock as
|
|
461
|
-
import { rest as
|
|
491
|
+
import { generateMock as generateMock14 } from "@anatine/zod-mock";
|
|
492
|
+
import { rest as rest15 } from "msw";
|
|
462
493
|
function createFeatureFlagsApiHandlers(client) {
|
|
463
|
-
function checkEnableItemsApiEndpointsForImports(resolver = (_req, res, ctx) => {
|
|
464
|
-
const data = generateMock13(z.boolean());
|
|
465
|
-
return res(ctx.status(200), ctx.json(data));
|
|
466
|
-
}) {
|
|
467
|
-
return rest14.get(
|
|
468
|
-
`${client.getBaseUrl()}${BASE_URL12}/enable-items-api-endpoints-for-imports/`,
|
|
469
|
-
resolver
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
494
|
function checkEnableItemsLevelMSIS(resolver = (_req, res, ctx) => {
|
|
473
|
-
const data =
|
|
495
|
+
const data = generateMock14(z.boolean());
|
|
474
496
|
return res(ctx.status(200), ctx.json(data));
|
|
475
497
|
}) {
|
|
476
|
-
return
|
|
498
|
+
return rest15.get(
|
|
477
499
|
`${client.getBaseUrl()}/${BASE_URL12}/enable-item-level-msis/`,
|
|
478
500
|
resolver
|
|
479
501
|
);
|
|
480
502
|
}
|
|
481
503
|
return {
|
|
482
|
-
checkEnableItemsApiEndpointsForImports,
|
|
483
504
|
checkEnableItemsLevelMSIS
|
|
484
505
|
};
|
|
485
506
|
}
|
|
486
507
|
|
|
487
508
|
// lib/uniqueCriteria/mockHandlers.ts
|
|
488
|
-
import { generateMock as
|
|
489
|
-
import { rest as
|
|
509
|
+
import { generateMock as generateMock15 } from "@anatine/zod-mock";
|
|
510
|
+
import { rest as rest16 } from "msw";
|
|
490
511
|
function createUniqueCriteriaApiHandlers(client) {
|
|
491
512
|
function getUniqueCriteriaByOrg(resolver = (_req, res, ctx) => {
|
|
492
|
-
const data =
|
|
513
|
+
const data = generateMock15(z.array(z.string()));
|
|
493
514
|
return res(ctx.status(200), ctx.json(data));
|
|
494
515
|
}) {
|
|
495
|
-
return
|
|
516
|
+
return rest16.get(`${client.getBaseUrl()}/${BASE_URL16}/org`, resolver);
|
|
496
517
|
}
|
|
497
|
-
getUniqueCriteriaByOrg.generateData = () =>
|
|
518
|
+
getUniqueCriteriaByOrg.generateData = () => generateMock15(z.array(z.string()));
|
|
498
519
|
return {
|
|
499
520
|
getUniqueCriteriaByOrg
|
|
500
521
|
};
|
|
@@ -505,6 +526,7 @@ export {
|
|
|
505
526
|
createCompaniesApi,
|
|
506
527
|
createCompanyFeaturesApiHandlers,
|
|
507
528
|
createErrorsApiHandlers,
|
|
529
|
+
createErrorsApiV2Handlers,
|
|
508
530
|
createExportsApiHandlers,
|
|
509
531
|
createFeatureFlagsApiHandlers,
|
|
510
532
|
createImportsApiHandlers,
|