@spscommerce/asst-api 4.3.0 → 4.5.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/{SpsItemIdResponse-CI_Ao86P.d.cts → SpsItemIdResponse-gAHfCzwP.d.cts} +22 -14
- package/dist/{SpsItemIdResponse-CI_Ao86P.d.ts → SpsItemIdResponse-gAHfCzwP.d.ts} +22 -14
- package/dist/{chunk-LKUGPDIT.js → chunk-BMTYM2N6.js} +33 -4
- package/dist/{chunk-CI3ZSIT4.js → chunk-VS3QNXZF.js} +146 -37
- package/dist/{chunk-55ECRTUX.js → chunk-WX4LGXJV.js} +1 -1
- package/dist/index.cjs +174 -40
- package/dist/index.d.cts +141 -14
- package/dist/index.d.ts +141 -14
- package/dist/index.js +3 -3
- package/dist/msw.cjs +85 -7
- package/dist/msw.d.cts +43 -12
- package/dist/msw.d.ts +43 -12
- package/dist/msw.js +50 -4
- package/dist/{zod-C41Rts8D.d.cts → zod-C-emh7a3.d.cts} +10 -46
- package/dist/{zod-COyz02Lh.d.ts → zod-D3Xe9bw3.d.ts} +10 -46
- package/dist/zod.cjs +31 -4
- package/dist/zod.d.cts +2 -2
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +2 -2
- package/package.json +2 -3
- package/dist/SpsItemIdResponse-0VgfCmG_.d.cts +0 -84
- package/dist/SpsItemIdResponse-0VgfCmG_.d.ts +0 -84
- package/dist/SpsItemIdResponse-s0vCXepG.d.cts +0 -74
- package/dist/SpsItemIdResponse-s0vCXepG.d.ts +0 -74
- package/dist/chunk-355LPVI6.js +0 -126
- package/dist/chunk-63KIELUR.js +0 -128
- package/dist/chunk-DK2OMRWR.js +0 -134
- package/dist/chunk-FCUIJXCD.js +0 -544
- package/dist/chunk-L4AWOEED.js +0 -4892
- package/dist/chunk-NFZI7D22.js +0 -544
- package/dist/chunk-NUUQDRHD.js +0 -4899
- package/dist/chunk-RPGGEEFE.js +0 -79
- package/dist/zod-C3fOiO-H.d.cts +0 -5900
- package/dist/zod-CJ6AFTQr.d.ts +0 -5900
- package/dist/zod-CJmsC_DX.d.cts +0 -5900
- package/dist/zod-CzPw-bfk.d.cts +0 -5900
- package/dist/zod-vDuspd-x.d.ts +0 -5900
- package/dist/zod-xWM6u1LJ.d.ts +0 -5900
package/dist/chunk-RPGGEEFE.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
external_exports
|
|
3
|
-
} from "./chunk-L4AWOEED.js";
|
|
4
|
-
|
|
5
|
-
// lib/asstClient.ts
|
|
6
|
-
import ky from "ky";
|
|
7
|
-
var baseUrlsSchema = external_exports.object({
|
|
8
|
-
local: external_exports.literal("https://localhost:8443/"),
|
|
9
|
-
test: external_exports.literal(
|
|
10
|
-
"https://integration.api.spscommerce.com/assortment/gateway/"
|
|
11
|
-
),
|
|
12
|
-
prod: external_exports.literal("https://api.spscommerce.com/assortment/gateway/")
|
|
13
|
-
});
|
|
14
|
-
var BASE_URLS = {
|
|
15
|
-
local: "https://localhost:8443/",
|
|
16
|
-
test: "https://integration.api.spscommerce.com/assortment/gateway/",
|
|
17
|
-
prod: "https://api.spscommerce.com/assortment/gateway/"
|
|
18
|
-
};
|
|
19
|
-
var envSchema = baseUrlsSchema.keyof();
|
|
20
|
-
var initialConfig = {
|
|
21
|
-
prefixUrl: BASE_URLS["test"],
|
|
22
|
-
retry: 0
|
|
23
|
-
};
|
|
24
|
-
var AsstClient = class {
|
|
25
|
-
#client = ky.create(initialConfig);
|
|
26
|
-
#baseUrl = BASE_URLS["test"];
|
|
27
|
-
#listeners = /* @__PURE__ */ new Set();
|
|
28
|
-
#currentConfig = initialConfig;
|
|
29
|
-
constructor(options) {
|
|
30
|
-
if (options) {
|
|
31
|
-
this.updateConfig(options);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
updateConfig(options) {
|
|
35
|
-
this.#client = this.#client.extend(options);
|
|
36
|
-
this.#currentConfig = options;
|
|
37
|
-
if (options.prefixUrl) {
|
|
38
|
-
this.#baseUrl = options.prefixUrl;
|
|
39
|
-
}
|
|
40
|
-
this.#listeners.forEach((listener) => listener(options));
|
|
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
|
-
* @returns Function to unsubscribe to config changes
|
|
49
|
-
*/
|
|
50
|
-
subscribeToConfigChange(listener) {
|
|
51
|
-
this.#listeners.add(listener);
|
|
52
|
-
listener(this.#currentConfig);
|
|
53
|
-
return () => this.#listeners.delete(listener);
|
|
54
|
-
}
|
|
55
|
-
get(url, options) {
|
|
56
|
-
return this.#client.get(url, options);
|
|
57
|
-
}
|
|
58
|
-
post(url, options) {
|
|
59
|
-
return this.#client.post(url, options);
|
|
60
|
-
}
|
|
61
|
-
put(url, options) {
|
|
62
|
-
return this.#client.put(url, options);
|
|
63
|
-
}
|
|
64
|
-
patch(url, options) {
|
|
65
|
-
return this.#client.patch(url, options);
|
|
66
|
-
}
|
|
67
|
-
head(url, options) {
|
|
68
|
-
return this.#client.head(url, options);
|
|
69
|
-
}
|
|
70
|
-
delete(url, options) {
|
|
71
|
-
return this.#client.delete(url, options);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export {
|
|
76
|
-
BASE_URLS,
|
|
77
|
-
envSchema,
|
|
78
|
-
AsstClient
|
|
79
|
-
};
|