@spscommerce/asst-api 1.2.1 → 1.3.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-itus4RMD.d.cts +131 -0
- package/dist/CompanyBriefByOrg-itus4RMD.d.ts +131 -0
- package/dist/{chunk-AH5MG2WF.js → chunk-5AROSGQB.js} +7 -13
- package/dist/{chunk-IO62OUOU.js → chunk-TTT6PM27.js} +57 -21
- package/dist/index-B8ovDTs5.d.cts +14 -0
- package/dist/index-BFKgtuVI.d.ts +14 -0
- package/dist/index.cjs +63 -34
- package/dist/index.d.cts +112 -14
- package/dist/index.d.ts +112 -14
- package/dist/index.js +2 -2
- package/dist/msw.cjs +196 -150
- package/dist/msw.d.cts +50 -97
- package/dist/msw.d.ts +50 -97
- package/dist/msw.js +175 -159
- package/dist/{zod-NE2xXWlK.d.ts → zod-C5pRCHei.d.ts} +3329 -33
- package/dist/zod-DzhoVlw_.d.cts +6712 -0
- package/dist/zod.cjs +7 -13
- package/dist/zod.d.cts +2 -2
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +1 -1
- package/package.json +24 -23
- package/dist/CompanyBriefByOrg-LTdsUKm4.d.ts +0 -3427
- package/dist/index-Zz-6wNSh.d.ts +0 -106
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as ky from 'ky';
|
|
2
|
+
import { Options } from 'ky';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const baseUrlsSchema: z.ZodObject<{
|
|
6
|
+
local: z.ZodLiteral<"https://localhost:8443/">;
|
|
7
|
+
test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
|
|
8
|
+
prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
local: "https://localhost:8443/";
|
|
11
|
+
test: "https://integration.api.spscommerce.com/assortment/gateway/";
|
|
12
|
+
prod: "https://api.spscommerce.com/assortment/gateway/";
|
|
13
|
+
}, {
|
|
14
|
+
local: "https://localhost:8443/";
|
|
15
|
+
test: "https://integration.api.spscommerce.com/assortment/gateway/";
|
|
16
|
+
prod: "https://api.spscommerce.com/assortment/gateway/";
|
|
17
|
+
}>;
|
|
18
|
+
type BaseUrls = z.infer<typeof baseUrlsSchema>;
|
|
19
|
+
declare const BASE_URLS: BaseUrls;
|
|
20
|
+
declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
|
|
21
|
+
type Env = z.infer<typeof envSchema>;
|
|
22
|
+
type AsstUrl = BaseUrls[Env];
|
|
23
|
+
interface AsstClientOptions extends Options {
|
|
24
|
+
prefixUrl?: AsstUrl;
|
|
25
|
+
}
|
|
26
|
+
type Input = string | URL | Request;
|
|
27
|
+
type Listener = (config: AsstClientOptions) => void;
|
|
28
|
+
declare class AsstClient {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(options?: AsstClientOptions);
|
|
31
|
+
updateConfig(options: AsstClientOptions): void;
|
|
32
|
+
getBaseUrl(): AsstUrl;
|
|
33
|
+
/**
|
|
34
|
+
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
35
|
+
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
36
|
+
* @returns Function to unsubscribe to config changes
|
|
37
|
+
*/
|
|
38
|
+
subscribeToConfigChange(listener: Listener): () => boolean;
|
|
39
|
+
get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
40
|
+
post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
41
|
+
put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
42
|
+
patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
43
|
+
head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
44
|
+
delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare const attributeValidValuesSchema: z.ZodObject<{
|
|
48
|
+
value: z.ZodString;
|
|
49
|
+
isDefault: z.ZodBoolean;
|
|
50
|
+
locale: z.ZodString;
|
|
51
|
+
createdBy: z.ZodString;
|
|
52
|
+
createdDate: z.ZodNumber;
|
|
53
|
+
modifiedDate: z.ZodNumber;
|
|
54
|
+
modifiedBy: z.ZodString;
|
|
55
|
+
attributeId: z.ZodNumber;
|
|
56
|
+
attrValueId: z.ZodNumber;
|
|
57
|
+
attrKeyPair: z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
value: string;
|
|
60
|
+
createdDate: number;
|
|
61
|
+
createdBy: string;
|
|
62
|
+
modifiedDate: number;
|
|
63
|
+
modifiedBy: string;
|
|
64
|
+
attributeId: number;
|
|
65
|
+
isDefault: boolean;
|
|
66
|
+
locale: string;
|
|
67
|
+
attrKeyPair: string;
|
|
68
|
+
attrValueId: number;
|
|
69
|
+
}, {
|
|
70
|
+
value: string;
|
|
71
|
+
createdDate: number;
|
|
72
|
+
createdBy: string;
|
|
73
|
+
modifiedDate: number;
|
|
74
|
+
modifiedBy: string;
|
|
75
|
+
attributeId: number;
|
|
76
|
+
isDefault: boolean;
|
|
77
|
+
locale: string;
|
|
78
|
+
attrKeyPair: string;
|
|
79
|
+
attrValueId: number;
|
|
80
|
+
}>;
|
|
81
|
+
type AttributeValidValues = z.infer<typeof attributeValidValuesSchema>;
|
|
82
|
+
|
|
83
|
+
declare const spsItemIdResponseSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
ref: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
id: string;
|
|
88
|
+
ref: string;
|
|
89
|
+
}, {
|
|
90
|
+
id: string;
|
|
91
|
+
ref: string;
|
|
92
|
+
}>;
|
|
93
|
+
type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
|
|
94
|
+
|
|
95
|
+
declare const companyBriefByOrgSchema: z.ZodObject<{
|
|
96
|
+
companyId: z.ZodNumber;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
orgId: z.ZodString;
|
|
99
|
+
companyType: z.ZodObject<{
|
|
100
|
+
type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
101
|
+
display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
type: "SUPPLIER" | "RETAILER";
|
|
104
|
+
display: "SUPPLIER" | "RETAILER";
|
|
105
|
+
}, {
|
|
106
|
+
type: "SUPPLIER" | "RETAILER";
|
|
107
|
+
display: "SUPPLIER" | "RETAILER";
|
|
108
|
+
}>;
|
|
109
|
+
dc4Id: z.ZodNumber;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
name: string;
|
|
112
|
+
orgId: string;
|
|
113
|
+
companyId: number;
|
|
114
|
+
companyType: {
|
|
115
|
+
type: "SUPPLIER" | "RETAILER";
|
|
116
|
+
display: "SUPPLIER" | "RETAILER";
|
|
117
|
+
};
|
|
118
|
+
dc4Id: number;
|
|
119
|
+
}, {
|
|
120
|
+
name: string;
|
|
121
|
+
orgId: string;
|
|
122
|
+
companyId: number;
|
|
123
|
+
companyType: {
|
|
124
|
+
type: "SUPPLIER" | "RETAILER";
|
|
125
|
+
display: "SUPPLIER" | "RETAILER";
|
|
126
|
+
};
|
|
127
|
+
dc4Id: number;
|
|
128
|
+
}>;
|
|
129
|
+
type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
|
|
130
|
+
|
|
131
|
+
export { AsstClient as A, BASE_URLS as B, type CompanyBriefByOrg as C, type Env as E, type SpsItemIdResponse as S, type AttributeValidValues as a, type AsstClientOptions as b, type AsstUrl as c, attributeValidValuesSchema as d, envSchema as e, companyBriefByOrgSchema as f, spsItemIdResponseSchema as s };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as ky from 'ky';
|
|
2
|
+
import { Options } from 'ky';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
declare const baseUrlsSchema: z.ZodObject<{
|
|
6
|
+
local: z.ZodLiteral<"https://localhost:8443/">;
|
|
7
|
+
test: z.ZodLiteral<"https://integration.api.spscommerce.com/assortment/gateway/">;
|
|
8
|
+
prod: z.ZodLiteral<"https://api.spscommerce.com/assortment/gateway/">;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
local: "https://localhost:8443/";
|
|
11
|
+
test: "https://integration.api.spscommerce.com/assortment/gateway/";
|
|
12
|
+
prod: "https://api.spscommerce.com/assortment/gateway/";
|
|
13
|
+
}, {
|
|
14
|
+
local: "https://localhost:8443/";
|
|
15
|
+
test: "https://integration.api.spscommerce.com/assortment/gateway/";
|
|
16
|
+
prod: "https://api.spscommerce.com/assortment/gateway/";
|
|
17
|
+
}>;
|
|
18
|
+
type BaseUrls = z.infer<typeof baseUrlsSchema>;
|
|
19
|
+
declare const BASE_URLS: BaseUrls;
|
|
20
|
+
declare const envSchema: z.ZodEnum<["local", "test", "prod"]>;
|
|
21
|
+
type Env = z.infer<typeof envSchema>;
|
|
22
|
+
type AsstUrl = BaseUrls[Env];
|
|
23
|
+
interface AsstClientOptions extends Options {
|
|
24
|
+
prefixUrl?: AsstUrl;
|
|
25
|
+
}
|
|
26
|
+
type Input = string | URL | Request;
|
|
27
|
+
type Listener = (config: AsstClientOptions) => void;
|
|
28
|
+
declare class AsstClient {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(options?: AsstClientOptions);
|
|
31
|
+
updateConfig(options: AsstClientOptions): void;
|
|
32
|
+
getBaseUrl(): AsstUrl;
|
|
33
|
+
/**
|
|
34
|
+
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
35
|
+
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
36
|
+
* @returns Function to unsubscribe to config changes
|
|
37
|
+
*/
|
|
38
|
+
subscribeToConfigChange(listener: Listener): () => boolean;
|
|
39
|
+
get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
40
|
+
post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
41
|
+
put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
42
|
+
patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
43
|
+
head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
44
|
+
delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare const attributeValidValuesSchema: z.ZodObject<{
|
|
48
|
+
value: z.ZodString;
|
|
49
|
+
isDefault: z.ZodBoolean;
|
|
50
|
+
locale: z.ZodString;
|
|
51
|
+
createdBy: z.ZodString;
|
|
52
|
+
createdDate: z.ZodNumber;
|
|
53
|
+
modifiedDate: z.ZodNumber;
|
|
54
|
+
modifiedBy: z.ZodString;
|
|
55
|
+
attributeId: z.ZodNumber;
|
|
56
|
+
attrValueId: z.ZodNumber;
|
|
57
|
+
attrKeyPair: z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
value: string;
|
|
60
|
+
createdDate: number;
|
|
61
|
+
createdBy: string;
|
|
62
|
+
modifiedDate: number;
|
|
63
|
+
modifiedBy: string;
|
|
64
|
+
attributeId: number;
|
|
65
|
+
isDefault: boolean;
|
|
66
|
+
locale: string;
|
|
67
|
+
attrKeyPair: string;
|
|
68
|
+
attrValueId: number;
|
|
69
|
+
}, {
|
|
70
|
+
value: string;
|
|
71
|
+
createdDate: number;
|
|
72
|
+
createdBy: string;
|
|
73
|
+
modifiedDate: number;
|
|
74
|
+
modifiedBy: string;
|
|
75
|
+
attributeId: number;
|
|
76
|
+
isDefault: boolean;
|
|
77
|
+
locale: string;
|
|
78
|
+
attrKeyPair: string;
|
|
79
|
+
attrValueId: number;
|
|
80
|
+
}>;
|
|
81
|
+
type AttributeValidValues = z.infer<typeof attributeValidValuesSchema>;
|
|
82
|
+
|
|
83
|
+
declare const spsItemIdResponseSchema: z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
ref: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
id: string;
|
|
88
|
+
ref: string;
|
|
89
|
+
}, {
|
|
90
|
+
id: string;
|
|
91
|
+
ref: string;
|
|
92
|
+
}>;
|
|
93
|
+
type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
|
|
94
|
+
|
|
95
|
+
declare const companyBriefByOrgSchema: z.ZodObject<{
|
|
96
|
+
companyId: z.ZodNumber;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
orgId: z.ZodString;
|
|
99
|
+
companyType: z.ZodObject<{
|
|
100
|
+
type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
101
|
+
display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
type: "SUPPLIER" | "RETAILER";
|
|
104
|
+
display: "SUPPLIER" | "RETAILER";
|
|
105
|
+
}, {
|
|
106
|
+
type: "SUPPLIER" | "RETAILER";
|
|
107
|
+
display: "SUPPLIER" | "RETAILER";
|
|
108
|
+
}>;
|
|
109
|
+
dc4Id: z.ZodNumber;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
name: string;
|
|
112
|
+
orgId: string;
|
|
113
|
+
companyId: number;
|
|
114
|
+
companyType: {
|
|
115
|
+
type: "SUPPLIER" | "RETAILER";
|
|
116
|
+
display: "SUPPLIER" | "RETAILER";
|
|
117
|
+
};
|
|
118
|
+
dc4Id: number;
|
|
119
|
+
}, {
|
|
120
|
+
name: string;
|
|
121
|
+
orgId: string;
|
|
122
|
+
companyId: number;
|
|
123
|
+
companyType: {
|
|
124
|
+
type: "SUPPLIER" | "RETAILER";
|
|
125
|
+
display: "SUPPLIER" | "RETAILER";
|
|
126
|
+
};
|
|
127
|
+
dc4Id: number;
|
|
128
|
+
}>;
|
|
129
|
+
type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
|
|
130
|
+
|
|
131
|
+
export { AsstClient as A, BASE_URLS as B, type CompanyBriefByOrg as C, type Env as E, type SpsItemIdResponse as S, type AttributeValidValues as a, type AsstClientOptions as b, type AsstUrl as c, attributeValidValuesSchema as d, envSchema as e, companyBriefByOrgSchema as f, spsItemIdResponseSchema as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// lib/asstClient.ts
|
|
2
|
-
import ky from "ky
|
|
2
|
+
import ky from "ky";
|
|
3
3
|
|
|
4
4
|
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
5
5
|
var util;
|
|
@@ -459,19 +459,14 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
459
459
|
var isValid = (x) => x.status === "valid";
|
|
460
460
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
461
461
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
462
|
-
if (kind === "a" && !f)
|
|
463
|
-
|
|
464
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
465
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
462
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
463
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
466
464
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
467
465
|
}
|
|
468
466
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
469
|
-
if (kind === "m")
|
|
470
|
-
|
|
471
|
-
if (
|
|
472
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
473
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
474
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
467
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
468
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
469
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
475
470
|
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
476
471
|
}
|
|
477
472
|
var errorUtil;
|
|
@@ -2190,8 +2185,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2190
2185
|
});
|
|
2191
2186
|
status.dirty();
|
|
2192
2187
|
}
|
|
2193
|
-
} else if (unknownKeys === "strip")
|
|
2194
|
-
;
|
|
2188
|
+
} else if (unknownKeys === "strip") ;
|
|
2195
2189
|
else {
|
|
2196
2190
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
2197
2191
|
}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
userAccountSchema,
|
|
24
24
|
vendorPartnerAttGroupsSchema,
|
|
25
25
|
z
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5AROSGQB.js";
|
|
27
27
|
|
|
28
28
|
// lib/imports/index.ts
|
|
29
29
|
var BASE_URL = "imports";
|
|
@@ -344,8 +344,15 @@ function createFeatureFlagsApi(client) {
|
|
|
344
344
|
}).json();
|
|
345
345
|
return z.boolean().parse(data);
|
|
346
346
|
}
|
|
347
|
+
async function checkIfEnabledForPackagingHierarchies(signal) {
|
|
348
|
+
const data = await client.get(`${BASE_URL12}/server-allow-import-and-export-of-packsizes-170720/`, {
|
|
349
|
+
signal
|
|
350
|
+
}).json();
|
|
351
|
+
return z.boolean().parse(data);
|
|
352
|
+
}
|
|
347
353
|
return {
|
|
348
|
-
checkEnableItemsLevelMSIS
|
|
354
|
+
checkEnableItemsLevelMSIS,
|
|
355
|
+
checkIfEnabledForPackagingHierarchies
|
|
349
356
|
};
|
|
350
357
|
}
|
|
351
358
|
|
|
@@ -355,12 +362,9 @@ function createItemsApi(client) {
|
|
|
355
362
|
function createQueryParameterString(params = {}) {
|
|
356
363
|
const searchParams = new URLSearchParams();
|
|
357
364
|
const { limit, offset, applicationType, url } = params ?? {};
|
|
358
|
-
if (limit)
|
|
359
|
-
|
|
360
|
-
if (
|
|
361
|
-
searchParams.append("offset", offset.toString());
|
|
362
|
-
if (applicationType)
|
|
363
|
-
searchParams.append("application", applicationType);
|
|
365
|
+
if (limit) searchParams.append("limit", limit.toString());
|
|
366
|
+
if (offset) searchParams.append("offset", offset.toString());
|
|
367
|
+
if (applicationType) searchParams.append("application", applicationType);
|
|
364
368
|
const queryParameterString = searchParams.toString();
|
|
365
369
|
return url ? `${queryParameterString}&${url}` : queryParameterString;
|
|
366
370
|
}
|
|
@@ -429,21 +433,15 @@ var BASE_URL15 = "errors/v2";
|
|
|
429
433
|
function createErrorsApiV2(client) {
|
|
430
434
|
async function getItemErrorSummary(params, signal) {
|
|
431
435
|
const searchParams = new URLSearchParams();
|
|
432
|
-
if (params.searchField)
|
|
433
|
-
|
|
434
|
-
if (params.searchText)
|
|
435
|
-
searchParams.append("searchText", params.searchText);
|
|
436
|
+
if (params.searchField) searchParams.append("searchField", params.searchField);
|
|
437
|
+
if (params.searchText) searchParams.append("searchText", params.searchText);
|
|
436
438
|
if (params.tradingPartnerIds) {
|
|
437
439
|
params.tradingPartnerIds.forEach((id) => searchParams.append("tradingPartnerIds", id.toString()));
|
|
438
440
|
}
|
|
439
|
-
if (params.offset)
|
|
440
|
-
|
|
441
|
-
if (params.
|
|
442
|
-
|
|
443
|
-
if (params.docInEventId)
|
|
444
|
-
searchParams.append("docInEventId", params.docInEventId);
|
|
445
|
-
if (params.importId)
|
|
446
|
-
searchParams.append("importId", params.importId);
|
|
441
|
+
if (params.offset) searchParams.append("offset", params.offset.toString());
|
|
442
|
+
if (params.limit) searchParams.append("limit", params.limit.toString());
|
|
443
|
+
if (params.docInEventId) searchParams.append("docInEventId", params.docInEventId);
|
|
444
|
+
if (params.importId) searchParams.append("importId", params.importId);
|
|
447
445
|
const data = await client.get(`${BASE_URL15}/summary`, { signal, searchParams }).json();
|
|
448
446
|
return itemErrorSummaryResultV2Schema.parse(data);
|
|
449
447
|
}
|
|
@@ -457,6 +455,36 @@ function createErrorsApiV2(client) {
|
|
|
457
455
|
};
|
|
458
456
|
}
|
|
459
457
|
|
|
458
|
+
// lib/uniqueCriteria/models/FlattenedItemIdentifierKeysSchema.ts
|
|
459
|
+
var FlattenedItemIdentifierKeys = [
|
|
460
|
+
//Nested gtin keys
|
|
461
|
+
"eaneight",
|
|
462
|
+
// Different naming convention from items-api's ean8
|
|
463
|
+
"upc",
|
|
464
|
+
"ean",
|
|
465
|
+
// Different naming convention from items-api's ean13
|
|
466
|
+
"gtin",
|
|
467
|
+
// Different naming convention from items-api's gtin14
|
|
468
|
+
"upcCaseCode",
|
|
469
|
+
//Top level keys
|
|
470
|
+
"buyerPartNumber",
|
|
471
|
+
"partnumber",
|
|
472
|
+
// Different naming convention from items-api's vendorPartNumber
|
|
473
|
+
"isbn",
|
|
474
|
+
"sku",
|
|
475
|
+
"nationalDrugCode",
|
|
476
|
+
"drugIdentificationNumber",
|
|
477
|
+
"nationalHealthRelatedItemCode",
|
|
478
|
+
"manufacturersPartNumber",
|
|
479
|
+
"internationalStandardSerialNumber",
|
|
480
|
+
"nabcaNumber",
|
|
481
|
+
"erpId",
|
|
482
|
+
"componentId"
|
|
483
|
+
];
|
|
484
|
+
var FlattenedItemIdentifierKeysSchema = z.enum(
|
|
485
|
+
FlattenedItemIdentifierKeys
|
|
486
|
+
);
|
|
487
|
+
|
|
460
488
|
// lib/uniqueCriteria/index.ts
|
|
461
489
|
var BASE_URL16 = "uniquecriteria";
|
|
462
490
|
function createUniqueCriteriaApi(client) {
|
|
@@ -467,7 +495,14 @@ function createUniqueCriteriaApi(client) {
|
|
|
467
495
|
}).json();
|
|
468
496
|
return z.array(z.string()).parse(data);
|
|
469
497
|
}
|
|
470
|
-
|
|
498
|
+
async function getProductUniqueCriteriaByOrg(params, signal) {
|
|
499
|
+
const data = await client.get(`${BASE_URL16}/product/org`, {
|
|
500
|
+
searchParams: params,
|
|
501
|
+
signal
|
|
502
|
+
}).json();
|
|
503
|
+
return z.array(FlattenedItemIdentifierKeysSchema).parse(data);
|
|
504
|
+
}
|
|
505
|
+
return { getUniqueCriteriaByOrg, getProductUniqueCriteriaByOrg };
|
|
471
506
|
}
|
|
472
507
|
|
|
473
508
|
// lib/companies/index.ts
|
|
@@ -516,6 +551,7 @@ export {
|
|
|
516
551
|
createErrorsApi,
|
|
517
552
|
BASE_URL15,
|
|
518
553
|
createErrorsApiV2,
|
|
554
|
+
FlattenedItemIdentifierKeysSchema,
|
|
519
555
|
BASE_URL16,
|
|
520
556
|
createUniqueCriteriaApi,
|
|
521
557
|
createCompaniesApi
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A as AsstClient, C as CompanyBriefByOrg } from './CompanyBriefByOrg-itus4RMD.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Initialize Companies Api functions
|
|
5
|
+
* @param client Assortment Client instance
|
|
6
|
+
* @returns A CompanyBriefByOrg object containing Companies API functions
|
|
7
|
+
*/
|
|
8
|
+
declare function createCompaniesApi(client: AsstClient): {
|
|
9
|
+
getCompanyBriefInfoByOrg: (params?: {
|
|
10
|
+
orgId?: string;
|
|
11
|
+
}, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { createCompaniesApi as c };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A as AsstClient, C as CompanyBriefByOrg } from './CompanyBriefByOrg-itus4RMD.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Initialize Companies Api functions
|
|
5
|
+
* @param client Assortment Client instance
|
|
6
|
+
* @returns A CompanyBriefByOrg object containing Companies API functions
|
|
7
|
+
*/
|
|
8
|
+
declare function createCompaniesApi(client: AsstClient): {
|
|
9
|
+
getCompanyBriefInfoByOrg: (params?: {
|
|
10
|
+
orgId?: string;
|
|
11
|
+
}, signal?: AbortSignal) => Promise<CompanyBriefByOrg>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { createCompaniesApi as c };
|
package/dist/index.cjs
CHANGED
|
@@ -55,7 +55,7 @@ __export(lib_exports, {
|
|
|
55
55
|
module.exports = __toCommonJS(lib_exports);
|
|
56
56
|
|
|
57
57
|
// lib/asstClient.ts
|
|
58
|
-
var
|
|
58
|
+
var import_ky = __toESM(require("ky"), 1);
|
|
59
59
|
|
|
60
60
|
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
61
61
|
var util;
|
|
@@ -515,19 +515,14 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
515
515
|
var isValid = (x) => x.status === "valid";
|
|
516
516
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
517
517
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
518
|
-
if (kind === "a" && !f)
|
|
519
|
-
|
|
520
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
521
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
518
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
519
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
522
520
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
523
521
|
}
|
|
524
522
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
525
|
-
if (kind === "m")
|
|
526
|
-
|
|
527
|
-
if (
|
|
528
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
529
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
530
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
523
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
524
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
525
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
531
526
|
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
532
527
|
}
|
|
533
528
|
var errorUtil;
|
|
@@ -2246,8 +2241,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2246
2241
|
});
|
|
2247
2242
|
status.dirty();
|
|
2248
2243
|
}
|
|
2249
|
-
} else if (unknownKeys === "strip")
|
|
2250
|
-
;
|
|
2244
|
+
} else if (unknownKeys === "strip") ;
|
|
2251
2245
|
else {
|
|
2252
2246
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
2253
2247
|
}
|
|
@@ -3996,7 +3990,7 @@ var initialConfig = {
|
|
|
3996
3990
|
retry: 0
|
|
3997
3991
|
};
|
|
3998
3992
|
var AsstClient = class {
|
|
3999
|
-
#client =
|
|
3993
|
+
#client = import_ky.default.create(initialConfig);
|
|
4000
3994
|
#baseUrl = BASE_URLS["test"];
|
|
4001
3995
|
#listeners = /* @__PURE__ */ new Set();
|
|
4002
3996
|
#currentConfig = initialConfig;
|
|
@@ -4804,8 +4798,15 @@ function createFeatureFlagsApi(client) {
|
|
|
4804
4798
|
}).json();
|
|
4805
4799
|
return z.boolean().parse(data);
|
|
4806
4800
|
}
|
|
4801
|
+
async function checkIfEnabledForPackagingHierarchies(signal) {
|
|
4802
|
+
const data = await client.get(`${BASE_URL12}/server-allow-import-and-export-of-packsizes-170720/`, {
|
|
4803
|
+
signal
|
|
4804
|
+
}).json();
|
|
4805
|
+
return z.boolean().parse(data);
|
|
4806
|
+
}
|
|
4807
4807
|
return {
|
|
4808
|
-
checkEnableItemsLevelMSIS
|
|
4808
|
+
checkEnableItemsLevelMSIS,
|
|
4809
|
+
checkIfEnabledForPackagingHierarchies
|
|
4809
4810
|
};
|
|
4810
4811
|
}
|
|
4811
4812
|
|
|
@@ -5335,12 +5336,9 @@ function createItemsApi(client) {
|
|
|
5335
5336
|
function createQueryParameterString(params = {}) {
|
|
5336
5337
|
const searchParams = new URLSearchParams();
|
|
5337
5338
|
const { limit, offset, applicationType, url } = params ?? {};
|
|
5338
|
-
if (limit)
|
|
5339
|
-
|
|
5340
|
-
if (
|
|
5341
|
-
searchParams.append("offset", offset.toString());
|
|
5342
|
-
if (applicationType)
|
|
5343
|
-
searchParams.append("application", applicationType);
|
|
5339
|
+
if (limit) searchParams.append("limit", limit.toString());
|
|
5340
|
+
if (offset) searchParams.append("offset", offset.toString());
|
|
5341
|
+
if (applicationType) searchParams.append("application", applicationType);
|
|
5344
5342
|
const queryParameterString = searchParams.toString();
|
|
5345
5343
|
return url ? `${queryParameterString}&${url}` : queryParameterString;
|
|
5346
5344
|
}
|
|
@@ -5421,21 +5419,15 @@ var BASE_URL16 = "errors/v2";
|
|
|
5421
5419
|
function createErrorsApiV2(client) {
|
|
5422
5420
|
async function getItemErrorSummary(params, signal) {
|
|
5423
5421
|
const searchParams = new URLSearchParams();
|
|
5424
|
-
if (params.searchField)
|
|
5425
|
-
|
|
5426
|
-
if (params.searchText)
|
|
5427
|
-
searchParams.append("searchText", params.searchText);
|
|
5422
|
+
if (params.searchField) searchParams.append("searchField", params.searchField);
|
|
5423
|
+
if (params.searchText) searchParams.append("searchText", params.searchText);
|
|
5428
5424
|
if (params.tradingPartnerIds) {
|
|
5429
5425
|
params.tradingPartnerIds.forEach((id) => searchParams.append("tradingPartnerIds", id.toString()));
|
|
5430
5426
|
}
|
|
5431
|
-
if (params.offset)
|
|
5432
|
-
|
|
5433
|
-
if (params.
|
|
5434
|
-
|
|
5435
|
-
if (params.docInEventId)
|
|
5436
|
-
searchParams.append("docInEventId", params.docInEventId);
|
|
5437
|
-
if (params.importId)
|
|
5438
|
-
searchParams.append("importId", params.importId);
|
|
5427
|
+
if (params.offset) searchParams.append("offset", params.offset.toString());
|
|
5428
|
+
if (params.limit) searchParams.append("limit", params.limit.toString());
|
|
5429
|
+
if (params.docInEventId) searchParams.append("docInEventId", params.docInEventId);
|
|
5430
|
+
if (params.importId) searchParams.append("importId", params.importId);
|
|
5439
5431
|
const data = await client.get(`${BASE_URL16}/summary`, { signal, searchParams }).json();
|
|
5440
5432
|
return itemErrorSummaryResultV2Schema.parse(data);
|
|
5441
5433
|
}
|
|
@@ -5449,6 +5441,36 @@ function createErrorsApiV2(client) {
|
|
|
5449
5441
|
};
|
|
5450
5442
|
}
|
|
5451
5443
|
|
|
5444
|
+
// lib/uniqueCriteria/models/FlattenedItemIdentifierKeysSchema.ts
|
|
5445
|
+
var FlattenedItemIdentifierKeys = [
|
|
5446
|
+
//Nested gtin keys
|
|
5447
|
+
"eaneight",
|
|
5448
|
+
// Different naming convention from items-api's ean8
|
|
5449
|
+
"upc",
|
|
5450
|
+
"ean",
|
|
5451
|
+
// Different naming convention from items-api's ean13
|
|
5452
|
+
"gtin",
|
|
5453
|
+
// Different naming convention from items-api's gtin14
|
|
5454
|
+
"upcCaseCode",
|
|
5455
|
+
//Top level keys
|
|
5456
|
+
"buyerPartNumber",
|
|
5457
|
+
"partnumber",
|
|
5458
|
+
// Different naming convention from items-api's vendorPartNumber
|
|
5459
|
+
"isbn",
|
|
5460
|
+
"sku",
|
|
5461
|
+
"nationalDrugCode",
|
|
5462
|
+
"drugIdentificationNumber",
|
|
5463
|
+
"nationalHealthRelatedItemCode",
|
|
5464
|
+
"manufacturersPartNumber",
|
|
5465
|
+
"internationalStandardSerialNumber",
|
|
5466
|
+
"nabcaNumber",
|
|
5467
|
+
"erpId",
|
|
5468
|
+
"componentId"
|
|
5469
|
+
];
|
|
5470
|
+
var FlattenedItemIdentifierKeysSchema = z.enum(
|
|
5471
|
+
FlattenedItemIdentifierKeys
|
|
5472
|
+
);
|
|
5473
|
+
|
|
5452
5474
|
// lib/uniqueCriteria/index.ts
|
|
5453
5475
|
var BASE_URL17 = "uniquecriteria";
|
|
5454
5476
|
function createUniqueCriteriaApi(client) {
|
|
@@ -5459,7 +5481,14 @@ function createUniqueCriteriaApi(client) {
|
|
|
5459
5481
|
}).json();
|
|
5460
5482
|
return z.array(z.string()).parse(data);
|
|
5461
5483
|
}
|
|
5462
|
-
|
|
5484
|
+
async function getProductUniqueCriteriaByOrg(params, signal) {
|
|
5485
|
+
const data = await client.get(`${BASE_URL17}/product/org`, {
|
|
5486
|
+
searchParams: params,
|
|
5487
|
+
signal
|
|
5488
|
+
}).json();
|
|
5489
|
+
return z.array(FlattenedItemIdentifierKeysSchema).parse(data);
|
|
5490
|
+
}
|
|
5491
|
+
return { getUniqueCriteriaByOrg, getProductUniqueCriteriaByOrg };
|
|
5463
5492
|
}
|
|
5464
5493
|
|
|
5465
5494
|
// lib/companies/index.ts
|