@spscommerce/asst-api 0.0.1-beta.9 → 0.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/{ItemErrorDetailsResult-c62caeae.d.ts → CompanyBriefByOrg-f1bfabb3.d.ts} +211 -165
- package/dist/{chunk-ITWMRXLD.js → chunk-FDGLFR7X.js} +133 -22
- package/dist/{chunk-IHIEBLQV.js → chunk-PUQDOFRT.js} +103 -29
- package/dist/index-d94fdfef.d.ts +103 -0
- package/dist/index.cjs +223 -47
- package/dist/index.d.ts +146 -9
- package/dist/index.js +8 -2
- package/dist/msw.cjs +251 -60
- package/dist/msw.d.ts +126 -69
- package/dist/msw.js +132 -31
- package/dist/{ItemErrorDetails-e6e400aa.d.ts → zod-ec1cdb27.d.ts} +179 -103
- package/dist/zod.cjs +106 -28
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +11 -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
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import * as ky_universal from 'ky-universal';
|
|
2
|
-
import { Options } from 'ky';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
declare const BASE_URLS: {
|
|
6
|
-
readonly local: "https://localhost:8443";
|
|
7
|
-
readonly test: "https://integration.api.spscommerce.com/assortment/gateway";
|
|
8
|
-
readonly prod: "https://api.spscommerce.com/assortment/gateway";
|
|
9
|
-
};
|
|
10
|
-
type Env = keyof typeof BASE_URLS;
|
|
11
|
-
type AsstUrl = typeof BASE_URLS[Env];
|
|
12
|
-
interface AsstClientOptions extends Options {
|
|
13
|
-
prefixUrl?: AsstUrl;
|
|
14
|
-
}
|
|
15
|
-
type Input = string | URL | Request;
|
|
16
|
-
declare class AsstClient {
|
|
17
|
-
#private;
|
|
18
|
-
constructor(options: AsstClientOptions);
|
|
19
|
-
updateConfig(options: AsstClientOptions): void;
|
|
20
|
-
getBaseUrl(): AsstUrl;
|
|
21
|
-
/**
|
|
22
|
-
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
23
|
-
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
24
|
-
*/
|
|
25
|
-
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): void;
|
|
26
|
-
unsubscribeToConfigChange(): void;
|
|
27
|
-
get(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
28
|
-
post(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
29
|
-
put(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
30
|
-
patch(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
31
|
-
head(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
32
|
-
delete(url: Input, options?: AsstClientOptions): ky_universal.ResponsePromise;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
declare const vendorPartnerAttGroupsSchema: z.ZodObject<{
|
|
36
|
-
partnerCompanyId: z.ZodNumber;
|
|
37
|
-
partnerCompanyName: z.ZodString;
|
|
38
|
-
partnerAttributeGroups: z.ZodArray<z.ZodNumber, "many">;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
partnerCompanyId: number;
|
|
41
|
-
partnerCompanyName: string;
|
|
42
|
-
partnerAttributeGroups: number[];
|
|
43
|
-
}, {
|
|
44
|
-
partnerCompanyId: number;
|
|
45
|
-
partnerCompanyName: string;
|
|
46
|
-
partnerAttributeGroups: number[];
|
|
47
|
-
}>;
|
|
48
|
-
type VendorPartnerAttGroups = z.infer<typeof vendorPartnerAttGroupsSchema>;
|
|
49
|
-
|
|
50
|
-
declare const attrProdTypeSchema: z.ZodObject<{
|
|
51
|
-
attrProdTypeId: z.ZodNumber;
|
|
52
|
-
productType: z.ZodString;
|
|
53
|
-
description: z.ZodString;
|
|
54
|
-
createdDate: z.ZodNumber;
|
|
55
|
-
createdBy: z.ZodString;
|
|
56
|
-
modifiedDate: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
modifiedBy: z.ZodOptional<z.ZodString>;
|
|
58
|
-
retailerId: z.ZodOptional<z.ZodNumber>;
|
|
59
|
-
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
description: string;
|
|
61
|
-
attrProdTypeId: number;
|
|
62
|
-
productType: string;
|
|
63
|
-
createdDate: number;
|
|
64
|
-
createdBy: string;
|
|
65
|
-
modifiedDate?: number | undefined;
|
|
66
|
-
modifiedBy?: string | undefined;
|
|
67
|
-
retailerId?: number | undefined;
|
|
68
|
-
}, {
|
|
69
|
-
description: string;
|
|
70
|
-
attrProdTypeId: number;
|
|
71
|
-
productType: string;
|
|
72
|
-
createdDate: number;
|
|
73
|
-
createdBy: string;
|
|
74
|
-
modifiedDate?: number | undefined;
|
|
75
|
-
modifiedBy?: string | undefined;
|
|
76
|
-
retailerId?: number | undefined;
|
|
77
|
-
}>;
|
|
78
|
-
type AttrProdType = z.infer<typeof attrProdTypeSchema>;
|
|
79
|
-
|
|
80
|
-
declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
|
|
81
|
-
companyId: z.ZodNumber;
|
|
82
|
-
companyType: z.ZodString;
|
|
83
|
-
identityOrgId: z.ZodString;
|
|
84
|
-
companyName: z.ZodString;
|
|
85
|
-
count: z.ZodNumber;
|
|
86
|
-
connections: z.ZodArray<z.ZodObject<{
|
|
87
|
-
catalog_id: z.ZodNumber;
|
|
88
|
-
catalog_name: z.ZodString;
|
|
89
|
-
partner_company_name: z.ZodString;
|
|
90
|
-
partner_company_id: z.ZodNumber;
|
|
91
|
-
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
catalog_id: number;
|
|
93
|
-
catalog_name: string;
|
|
94
|
-
partner_company_name: string;
|
|
95
|
-
partner_company_id: number;
|
|
96
|
-
}, {
|
|
97
|
-
catalog_id: number;
|
|
98
|
-
catalog_name: string;
|
|
99
|
-
partner_company_name: string;
|
|
100
|
-
partner_company_id: number;
|
|
101
|
-
}>, "many">;
|
|
102
|
-
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
count: number;
|
|
104
|
-
companyId: number;
|
|
105
|
-
companyType: string;
|
|
106
|
-
identityOrgId: string;
|
|
107
|
-
companyName: string;
|
|
108
|
-
connections: {
|
|
109
|
-
catalog_id: number;
|
|
110
|
-
catalog_name: string;
|
|
111
|
-
partner_company_name: string;
|
|
112
|
-
partner_company_id: number;
|
|
113
|
-
}[];
|
|
114
|
-
}, {
|
|
115
|
-
count: number;
|
|
116
|
-
companyId: number;
|
|
117
|
-
companyType: string;
|
|
118
|
-
identityOrgId: string;
|
|
119
|
-
companyName: string;
|
|
120
|
-
connections: {
|
|
121
|
-
catalog_id: number;
|
|
122
|
-
catalog_name: string;
|
|
123
|
-
partner_company_name: string;
|
|
124
|
-
partner_company_id: number;
|
|
125
|
-
}[];
|
|
126
|
-
}>;
|
|
127
|
-
type TradingPartnerAccessByCompanyId = z.infer<typeof tradingPartnerAccessByCompanyIdSchema>;
|
|
128
|
-
|
|
129
|
-
export { AsstClient as A, BASE_URLS as B, Env as E, TradingPartnerAccessByCompanyId as T, VendorPartnerAttGroups as V, AttrProdType as a, AsstClientOptions as b, AsstUrl as c, attrProdTypeSchema as d };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as ky from 'ky';
|
|
2
|
-
import { Options } from 'ky';
|
|
3
|
-
|
|
4
|
-
declare const BASE_URLS: {
|
|
5
|
-
readonly local: "https://localhost:8443";
|
|
6
|
-
readonly test: "https://integration.api.spscommerce.com/assortment/gateway";
|
|
7
|
-
readonly prod: "https://api.spscommerce.com/assortment/gateway";
|
|
8
|
-
};
|
|
9
|
-
type Env = keyof typeof BASE_URLS;
|
|
10
|
-
type AsstUrl = typeof BASE_URLS[Env];
|
|
11
|
-
interface AsstClientOptions extends Options {
|
|
12
|
-
prefixUrl?: AsstUrl;
|
|
13
|
-
}
|
|
14
|
-
type Input = string | URL | Request;
|
|
15
|
-
declare class AsstClient {
|
|
16
|
-
#private;
|
|
17
|
-
constructor(options: AsstClientOptions);
|
|
18
|
-
updateConfig(options: AsstClientOptions): void;
|
|
19
|
-
getBaseUrl(): AsstUrl;
|
|
20
|
-
subscribeToConfigChange(subscriptionCallback: (newConfig: AsstClientOptions) => void): void;
|
|
21
|
-
get(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
22
|
-
post(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
23
|
-
put(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
24
|
-
patch(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
25
|
-
head(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
26
|
-
delete(url: Input, options?: AsstClientOptions): ky.ResponsePromise;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { AsstClient as A, BASE_URLS as B, Env as E, AsstClientOptions as a, AsstUrl as b };
|
package/dist/chunk-3FMMM7IS.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
z
|
|
3
|
-
} from "./chunk-D3ML6E4G.js";
|
|
4
|
-
|
|
5
|
-
// lib/asstClient.ts
|
|
6
|
-
import ky from "ky-universal";
|
|
7
|
-
var baseUrlsSchema = z.object({
|
|
8
|
-
local: z.literal("https://localhost:8443"),
|
|
9
|
-
test: z.literal("https://integration.api.spscommerce.com/assortment/gateway"),
|
|
10
|
-
prod: z.literal("https://api.spscommerce.com/assortment/gateway")
|
|
11
|
-
});
|
|
12
|
-
var BASE_URLS = {
|
|
13
|
-
local: "https://localhost:8443",
|
|
14
|
-
test: "https://integration.api.spscommerce.com/assortment/gateway",
|
|
15
|
-
prod: "https://api.spscommerce.com/assortment/gateway"
|
|
16
|
-
};
|
|
17
|
-
var envSchema = baseUrlsSchema.keyof();
|
|
18
|
-
var AsstClient = class {
|
|
19
|
-
#client = ky.create({
|
|
20
|
-
prefixUrl: BASE_URLS["test"],
|
|
21
|
-
retry: 0
|
|
22
|
-
});
|
|
23
|
-
#baseUrl = BASE_URLS["test"];
|
|
24
|
-
#subscriptionCallback;
|
|
25
|
-
#currentConfig = {};
|
|
26
|
-
constructor(options) {
|
|
27
|
-
console.log(`AsstClient created! Config: ${JSON.stringify(options)}`);
|
|
28
|
-
if (options) {
|
|
29
|
-
this.updateConfig(options);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
updateConfig(options) {
|
|
33
|
-
this.#client = this.#client.extend(options);
|
|
34
|
-
this.#currentConfig = options;
|
|
35
|
-
if (options.prefixUrl) {
|
|
36
|
-
this.#baseUrl = options.prefixUrl;
|
|
37
|
-
}
|
|
38
|
-
if (this.#subscriptionCallback) {
|
|
39
|
-
this.#subscriptionCallback(options);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
getBaseUrl() {
|
|
43
|
-
return this.#baseUrl;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Subscribe to config changes. The callback will be immediately invoked with the current config.
|
|
47
|
-
* @param subscriptionCallback Function that will be called with the new config every time it is changed
|
|
48
|
-
*/
|
|
49
|
-
subscribeToConfigChange(subscriptionCallback) {
|
|
50
|
-
this.#subscriptionCallback = subscriptionCallback;
|
|
51
|
-
subscriptionCallback(this.#currentConfig);
|
|
52
|
-
}
|
|
53
|
-
unsubscribeToConfigChange() {
|
|
54
|
-
this.#subscriptionCallback = void 0;
|
|
55
|
-
}
|
|
56
|
-
get(url, options) {
|
|
57
|
-
return this.#client.get(url, options);
|
|
58
|
-
}
|
|
59
|
-
post(url, options) {
|
|
60
|
-
return this.#client.post(url, options);
|
|
61
|
-
}
|
|
62
|
-
put(url, options) {
|
|
63
|
-
return this.#client.put(url, options);
|
|
64
|
-
}
|
|
65
|
-
patch(url, options) {
|
|
66
|
-
return this.#client.patch(url, options);
|
|
67
|
-
}
|
|
68
|
-
head(url, options) {
|
|
69
|
-
return this.#client.head(url, options);
|
|
70
|
-
}
|
|
71
|
-
delete(url, options) {
|
|
72
|
-
return this.#client.delete(url, options);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export {
|
|
77
|
-
BASE_URLS,
|
|
78
|
-
envSchema,
|
|
79
|
-
AsstClient
|
|
80
|
-
};
|