@spscommerce/asst-api 4.1.0 → 4.1.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/CompanyBriefByOrg-57oGCtjK.d.ts +3427 -0
- package/dist/CompanyBriefByOrg-Dy2omcT0.d.cts +95 -0
- package/dist/CompanyBriefByOrg-Dy2omcT0.d.ts +95 -0
- package/dist/CompanyBriefByOrg-LTdsUKm4.d.ts +3427 -0
- package/dist/chunk-27XV7TS2.js +522 -0
- package/dist/chunk-2ETQHIXC.js +528 -0
- package/dist/chunk-2VJS5KPH.js +5182 -0
- package/dist/chunk-2W3LZ4AO.js +513 -0
- package/dist/chunk-3XNXQYIB.js +521 -0
- package/dist/chunk-4C475UZX.js +5164 -0
- package/dist/chunk-5AROSGQB.js +5034 -0
- package/dist/chunk-7F5CQRS2.js +567 -0
- package/dist/chunk-7OEXJIWW.js +565 -0
- package/dist/chunk-A22SEYVL.js +530 -0
- package/dist/chunk-AH5MG2WF.js +5040 -0
- package/dist/chunk-BDSSH6MN.js +574 -0
- package/dist/chunk-BFIQVABZ.js +528 -0
- package/dist/chunk-BJTO4CRW.js +558 -0
- package/dist/chunk-BTNVA4NZ.js +568 -0
- package/dist/chunk-CNQTNX3M.js +567 -0
- package/dist/chunk-CUVSWUIQ.js +5040 -0
- package/dist/chunk-DP2ZMQG5.js +4881 -0
- package/dist/chunk-EMBJNPTB.js +5040 -0
- package/dist/chunk-EO2UMCWY.js +574 -0
- package/dist/chunk-FTB465WY.js +575 -0
- package/dist/chunk-G6A4EVAL.js +528 -0
- package/dist/chunk-GDARBI5R.js +5185 -0
- package/dist/chunk-HHJDDPFR.js +4886 -0
- package/dist/chunk-HY2SRD5L.js +5003 -0
- package/dist/chunk-ISQ3LQRI.js +565 -0
- package/dist/chunk-KKX3CXHP.js +558 -0
- package/dist/chunk-LCK4AEWB.js +79 -0
- package/dist/chunk-LJVJ4SYE.js +568 -0
- package/dist/chunk-LYMA4XGG.js +5181 -0
- package/dist/chunk-MLAU3LFL.js +527 -0
- package/dist/chunk-MQREZR54.js +5164 -0
- package/dist/chunk-N4A4BVKV.js +5163 -0
- package/dist/chunk-QVEV57JA.js +5185 -0
- package/dist/chunk-SK6U2JDX.js +566 -0
- package/dist/chunk-SQBB5K5J.js +574 -0
- package/dist/chunk-TQ2IQDSM.js +568 -0
- package/dist/chunk-TTT6PM27.js +558 -0
- package/dist/chunk-VFMKDLXO.js +570 -0
- package/dist/chunk-VKPQOGVS.js +565 -0
- package/dist/chunk-VLLI4AYA.js +520 -0
- package/dist/chunk-VNFLJ5FV.js +530 -0
- package/dist/chunk-WNCDQJEM.js +5034 -0
- package/dist/chunk-XYZVRJF3.js +5162 -0
- package/dist/chunk-YJCJB4OT.js +79 -0
- package/dist/chunk-YJMQ4PGM.js +559 -0
- package/dist/chunk-Z6PXGHNC.js +570 -0
- package/dist/chunk-ZQ32XEVW.js +79 -0
- package/dist/chunk-ZXXDLGW7.js +513 -0
- package/dist/index-9KKchLwe.d.cts +14 -0
- package/dist/index-DeivEdv0.d.ts +14 -0
- package/dist/index-Zz-6wNSh.d.ts +106 -0
- package/dist/index-fgr_c5Wj.d.ts +106 -0
- package/dist/index.cjs +225 -458
- package/dist/index.d.cts +6 -24
- package/dist/index.d.ts +6 -24
- package/dist/index.js +5 -5
- package/dist/msw.cjs +225 -510
- package/dist/msw.d.cts +10 -197
- package/dist/msw.d.ts +10 -197
- package/dist/msw.js +51 -117
- package/dist/zod-6gU8y6oS.d.cts +6712 -0
- package/dist/zod-B4sIVoVX.d.ts +6712 -0
- package/dist/zod-BI81QHVK.d.ts +6715 -0
- package/dist/zod-BUCQsGOm.d.ts +6712 -0
- package/dist/zod-Bl_5j5Nx.d.ts +6712 -0
- package/dist/zod-Bxu34bbp.d.ts +6718 -0
- package/dist/zod-C4kEHhO8.d.cts +6718 -0
- package/dist/zod-C5pRCHei.d.ts +6712 -0
- package/dist/zod-CIacR1Kf.d.cts +6712 -0
- package/dist/zod-DyBGOUbG.d.ts +5876 -0
- package/dist/zod-DzhoVlw_.d.cts +6712 -0
- package/dist/zod-FdtLO2-F.d.cts +6715 -0
- package/dist/zod-NE2xXWlK.d.ts +3416 -0
- package/dist/zod-lSiFMzqK.d.cts +6712 -0
- package/dist/zod-rs54beS2.d.cts +5876 -0
- package/dist/zod-zxqlYYMG.d.ts +3416 -0
- package/dist/zod.cjs +30 -178
- package/dist/zod.d.cts +2 -2
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +62 -21
- package/package.json +4 -4
|
@@ -0,0 +1,95 @@
|
|
|
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 spsItemIdResponseSchema: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
ref: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
id: string;
|
|
52
|
+
ref: string;
|
|
53
|
+
}, {
|
|
54
|
+
id: string;
|
|
55
|
+
ref: string;
|
|
56
|
+
}>;
|
|
57
|
+
type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
|
|
58
|
+
|
|
59
|
+
declare const companyBriefByOrgSchema: z.ZodObject<{
|
|
60
|
+
companyId: z.ZodNumber;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
orgId: z.ZodString;
|
|
63
|
+
companyType: z.ZodObject<{
|
|
64
|
+
type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
65
|
+
display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
type: "SUPPLIER" | "RETAILER";
|
|
68
|
+
display: "SUPPLIER" | "RETAILER";
|
|
69
|
+
}, {
|
|
70
|
+
type: "SUPPLIER" | "RETAILER";
|
|
71
|
+
display: "SUPPLIER" | "RETAILER";
|
|
72
|
+
}>;
|
|
73
|
+
dc4Id: z.ZodNumber;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
name: string;
|
|
76
|
+
orgId: string;
|
|
77
|
+
companyId: number;
|
|
78
|
+
companyType: {
|
|
79
|
+
type: "SUPPLIER" | "RETAILER";
|
|
80
|
+
display: "SUPPLIER" | "RETAILER";
|
|
81
|
+
};
|
|
82
|
+
dc4Id: number;
|
|
83
|
+
}, {
|
|
84
|
+
name: string;
|
|
85
|
+
orgId: string;
|
|
86
|
+
companyId: number;
|
|
87
|
+
companyType: {
|
|
88
|
+
type: "SUPPLIER" | "RETAILER";
|
|
89
|
+
display: "SUPPLIER" | "RETAILER";
|
|
90
|
+
};
|
|
91
|
+
dc4Id: number;
|
|
92
|
+
}>;
|
|
93
|
+
type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
|
|
94
|
+
|
|
95
|
+
export { AsstClient as A, BASE_URLS as B, type CompanyBriefByOrg as C, type Env as E, type SpsItemIdResponse as S, type AsstClientOptions as a, type AsstUrl as b, companyBriefByOrgSchema as c, envSchema as e, spsItemIdResponseSchema as s };
|
|
@@ -0,0 +1,95 @@
|
|
|
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 spsItemIdResponseSchema: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
ref: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
id: string;
|
|
52
|
+
ref: string;
|
|
53
|
+
}, {
|
|
54
|
+
id: string;
|
|
55
|
+
ref: string;
|
|
56
|
+
}>;
|
|
57
|
+
type SpsItemIdResponse = z.infer<typeof spsItemIdResponseSchema>;
|
|
58
|
+
|
|
59
|
+
declare const companyBriefByOrgSchema: z.ZodObject<{
|
|
60
|
+
companyId: z.ZodNumber;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
orgId: z.ZodString;
|
|
63
|
+
companyType: z.ZodObject<{
|
|
64
|
+
type: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
65
|
+
display: z.ZodEnum<["SUPPLIER", "RETAILER"]>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
type: "SUPPLIER" | "RETAILER";
|
|
68
|
+
display: "SUPPLIER" | "RETAILER";
|
|
69
|
+
}, {
|
|
70
|
+
type: "SUPPLIER" | "RETAILER";
|
|
71
|
+
display: "SUPPLIER" | "RETAILER";
|
|
72
|
+
}>;
|
|
73
|
+
dc4Id: z.ZodNumber;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
name: string;
|
|
76
|
+
orgId: string;
|
|
77
|
+
companyId: number;
|
|
78
|
+
companyType: {
|
|
79
|
+
type: "SUPPLIER" | "RETAILER";
|
|
80
|
+
display: "SUPPLIER" | "RETAILER";
|
|
81
|
+
};
|
|
82
|
+
dc4Id: number;
|
|
83
|
+
}, {
|
|
84
|
+
name: string;
|
|
85
|
+
orgId: string;
|
|
86
|
+
companyId: number;
|
|
87
|
+
companyType: {
|
|
88
|
+
type: "SUPPLIER" | "RETAILER";
|
|
89
|
+
display: "SUPPLIER" | "RETAILER";
|
|
90
|
+
};
|
|
91
|
+
dc4Id: number;
|
|
92
|
+
}>;
|
|
93
|
+
type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
|
|
94
|
+
|
|
95
|
+
export { AsstClient as A, BASE_URLS as B, type CompanyBriefByOrg as C, type Env as E, type SpsItemIdResponse as S, type AsstClientOptions as a, type AsstUrl as b, companyBriefByOrgSchema as c, envSchema as e, spsItemIdResponseSchema as s };
|