@epcc-sdk/sdks-shopper 0.0.36 → 0.0.38
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/README.md +79 -0
- package/dist/auth/configure-client.cjs +94 -0
- package/dist/auth/configure-client.cjs.map +1 -0
- package/dist/auth/configure-client.d.cts +59 -0
- package/dist/auth/configure-client.d.ts +59 -0
- package/dist/auth/configure-client.mjs +74 -0
- package/dist/auth/configure-client.mjs.map +1 -0
- package/dist/auth/kit.cjs +97 -0
- package/dist/auth/kit.cjs.map +1 -0
- package/dist/auth/kit.d.cts +15 -0
- package/dist/auth/kit.d.ts +15 -0
- package/dist/auth/kit.mjs +73 -0
- package/dist/auth/kit.mjs.map +1 -0
- package/dist/auth/make-auth-fetch.cjs +53 -0
- package/dist/auth/make-auth-fetch.cjs.map +1 -0
- package/dist/auth/make-auth-fetch.d.cts +16 -0
- package/dist/auth/make-auth-fetch.d.ts +16 -0
- package/dist/auth/make-auth-fetch.mjs +29 -0
- package/dist/auth/make-auth-fetch.mjs.map +1 -0
- package/dist/auth/storage.cjs +118 -0
- package/dist/auth/storage.cjs.map +1 -0
- package/dist/auth/storage.d.cts +23 -0
- package/dist/auth/storage.d.ts +23 -0
- package/dist/auth/storage.mjs +92 -0
- package/dist/auth/storage.mjs.map +1 -0
- package/dist/auth/token-providers.cjs +82 -0
- package/dist/auth/token-providers.cjs.map +1 -0
- package/dist/auth/token-providers.d.cts +28 -0
- package/dist/auth/token-providers.d.ts +28 -0
- package/dist/auth/token-providers.mjs +57 -0
- package/dist/auth/token-providers.mjs.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/test/utils.cjs +38 -0
- package/dist/test/utils.cjs.map +1 -0
- package/dist/test/utils.d.cts +10 -0
- package/dist/test/utils.d.ts +10 -0
- package/dist/test/utils.mjs +13 -0
- package/dist/test/utils.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,7 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
__export(index_exports, {
|
|
22
22
|
client: () => import_sdk.client,
|
|
23
|
+
configureClient: () => import_configure_client.configureClient,
|
|
23
24
|
createClient: () => import_client_fetch.createClient,
|
|
25
|
+
createShopperClient: () => import_configure_client.createShopperClient,
|
|
24
26
|
extractProductImage: () => import_utils.extractProductImage,
|
|
25
27
|
getCartId: () => import_utils.getCartId,
|
|
26
28
|
initializeCart: () => import_utils.initializeCart
|
|
@@ -31,10 +33,13 @@ var import_client_fetch = require("@hey-api/client-fetch");
|
|
|
31
33
|
var import_sdk = require('./client/sdk.gen.cjs');
|
|
32
34
|
var import_utils = require('./utils/index.cjs');
|
|
33
35
|
__reExport(index_exports, require('./interceptors/index.cjs'), module.exports);
|
|
36
|
+
var import_configure_client = require('./auth/configure-client.cjs');
|
|
34
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
38
|
0 && (module.exports = {
|
|
36
39
|
client,
|
|
40
|
+
configureClient,
|
|
37
41
|
createClient,
|
|
42
|
+
createShopperClient,
|
|
38
43
|
extractProductImage,
|
|
39
44
|
getCartId,
|
|
40
45
|
initializeCart,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./client\"\nimport { type Client, createClient } from \"@hey-api/client-fetch\"\nexport { createClient, type Client }\nexport { client } from \"./client/sdk.gen\"\nexport { extractProductImage, initializeCart, getCartId } from \"./utils\"\nexport * from \"./interceptors\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,qBAAd;AACA,0BAA0C;AAE1C,iBAAuB;AACvB,mBAA+D;AAC/D,0BAAc,2BALd;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./client\"\nimport { type Client, createClient } from \"@hey-api/client-fetch\"\nexport { createClient, type Client }\nexport { client } from \"./client/sdk.gen\"\nexport { extractProductImage, initializeCart, getCartId } from \"./utils\"\nexport * from \"./interceptors\"\n\nexport { createShopperClient, configureClient } from \"./auth/configure-client\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,qBAAd;AACA,0BAA0C;AAE1C,iBAAuB;AACvB,mBAA+D;AAC/D,0BAAc,2BALd;AAOA,8BAAqD;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -5,3 +5,6 @@ export { extractProductImage } from './utils/extract-product-image.cjs';
|
|
|
5
5
|
export { initializeCart } from './utils/initialize-cart.cjs';
|
|
6
6
|
export { getCartId } from './utils/get-cart-id.cjs';
|
|
7
7
|
export { createAuthLocalStorageInterceptor } from './interceptors/auth-local-storage-interceptor.cjs';
|
|
8
|
+
export { configureClient, createShopperClient } from './auth/configure-client.cjs';
|
|
9
|
+
import './auth/kit.cjs';
|
|
10
|
+
import './auth/storage.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,6 @@ export { extractProductImage } from './utils/extract-product-image.js';
|
|
|
5
5
|
export { initializeCart } from './utils/initialize-cart.js';
|
|
6
6
|
export { getCartId } from './utils/get-cart-id.js';
|
|
7
7
|
export { createAuthLocalStorageInterceptor } from './interceptors/auth-local-storage-interceptor.js';
|
|
8
|
+
export { configureClient, createShopperClient } from './auth/configure-client.js';
|
|
9
|
+
import './auth/kit.js';
|
|
10
|
+
import './auth/storage.js';
|
package/dist/index.mjs
CHANGED
|
@@ -3,9 +3,12 @@ import { createClient } from "@hey-api/client-fetch";
|
|
|
3
3
|
import { client } from "./client/sdk.gen.mjs";
|
|
4
4
|
import { extractProductImage, initializeCart, getCartId } from "./utils/index.mjs";
|
|
5
5
|
export * from "./interceptors/index.mjs";
|
|
6
|
+
import { createShopperClient, configureClient } from "./auth/configure-client.mjs";
|
|
6
7
|
export {
|
|
7
8
|
client,
|
|
9
|
+
configureClient,
|
|
8
10
|
createClient,
|
|
11
|
+
createShopperClient,
|
|
9
12
|
extractProductImage,
|
|
10
13
|
getCartId,
|
|
11
14
|
initializeCart
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./client\"\nimport { type Client, createClient } from \"@hey-api/client-fetch\"\nexport { createClient, type Client }\nexport { client } from \"./client/sdk.gen\"\nexport { extractProductImage, initializeCart, getCartId } from \"./utils\"\nexport * from \"./interceptors\"\n"],"mappings":"AAAA,cAAc;AACd,SAAsB,oBAAoB;AAE1C,SAAS,cAAc;AACvB,SAAS,qBAAqB,gBAAgB,iBAAiB;AAC/D,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./client\"\nimport { type Client, createClient } from \"@hey-api/client-fetch\"\nexport { createClient, type Client }\nexport { client } from \"./client/sdk.gen\"\nexport { extractProductImage, initializeCart, getCartId } from \"./utils\"\nexport * from \"./interceptors\"\n\nexport { createShopperClient, configureClient } from \"./auth/configure-client\"\n"],"mappings":"AAAA,cAAc;AACd,SAAsB,oBAAoB;AAE1C,SAAS,cAAc;AACvB,SAAS,qBAAqB,gBAAgB,iBAAiB;AAC/D,cAAc;AAEd,SAAS,qBAAqB,uBAAuB;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
asAny: () => asAny,
|
|
22
|
+
makeJwtExpIn: () => makeJwtExpIn
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
const makeJwtExpIn = (sec) => {
|
|
26
|
+
const header = { alg: "none", typ: "JWT" };
|
|
27
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
28
|
+
const payload = { exp: now + sec };
|
|
29
|
+
const b64 = (o) => btoa(JSON.stringify(o)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
30
|
+
return `${b64(header)}.${b64(payload)}.`;
|
|
31
|
+
};
|
|
32
|
+
const asAny = (fn) => fn;
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
asAny,
|
|
36
|
+
makeJwtExpIn
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/utils.ts"],"sourcesContent":["/**\n * Helper to craft a JWT with exp in seconds from now\n */\nexport const makeJwtExpIn = (sec: number) => {\n const header = { alg: \"none\", typ: \"JWT\" }\n const now = Math.floor(Date.now() / 1000)\n const payload = { exp: now + sec }\n const b64 = (o: any) =>\n btoa(JSON.stringify(o))\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\")\n .replace(/=+$/, \"\")\n return `${b64(header)}.${b64(payload)}.`\n}\n\n/**\n * Type assertion helper for mocks\n */\nexport const asAny = (fn: any): any => fn\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,eAAe,CAAC,QAAgB;AAC3C,QAAM,SAAS,EAAE,KAAK,QAAQ,KAAK,MAAM;AACzC,QAAM,MAAM,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;AACxC,QAAM,UAAU,EAAE,KAAK,MAAM,IAAI;AACjC,QAAM,MAAM,CAAC,MACX,KAAK,KAAK,UAAU,CAAC,CAAC,EACnB,QAAQ,OAAO,GAAG,EAClB,QAAQ,OAAO,GAAG,EAClB,QAAQ,OAAO,EAAE;AACtB,SAAO,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC;AACvC;AAKO,MAAM,QAAQ,CAAC,OAAiB;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const makeJwtExpIn = (sec) => {
|
|
2
|
+
const header = { alg: "none", typ: "JWT" };
|
|
3
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
4
|
+
const payload = { exp: now + sec };
|
|
5
|
+
const b64 = (o) => btoa(JSON.stringify(o)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
6
|
+
return `${b64(header)}.${b64(payload)}.`;
|
|
7
|
+
};
|
|
8
|
+
const asAny = (fn) => fn;
|
|
9
|
+
export {
|
|
10
|
+
asAny,
|
|
11
|
+
makeJwtExpIn
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/utils.ts"],"sourcesContent":["/**\n * Helper to craft a JWT with exp in seconds from now\n */\nexport const makeJwtExpIn = (sec: number) => {\n const header = { alg: \"none\", typ: \"JWT\" }\n const now = Math.floor(Date.now() / 1000)\n const payload = { exp: now + sec }\n const b64 = (o: any) =>\n btoa(JSON.stringify(o))\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\")\n .replace(/=+$/, \"\")\n return `${b64(header)}.${b64(payload)}.`\n}\n\n/**\n * Type assertion helper for mocks\n */\nexport const asAny = (fn: any): any => fn\n"],"mappings":"AAGO,MAAM,eAAe,CAAC,QAAgB;AAC3C,QAAM,SAAS,EAAE,KAAK,QAAQ,KAAK,MAAM;AACzC,QAAM,MAAM,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;AACxC,QAAM,UAAU,EAAE,KAAK,MAAM,IAAI;AACjC,QAAM,MAAM,CAAC,MACX,KAAK,KAAK,UAAU,CAAC,CAAC,EACnB,QAAQ,OAAO,GAAG,EAClB,QAAQ,OAAO,GAAG,EAClB,QAAQ,OAAO,EAAE;AACtB,SAAO,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC;AACvC;AAKO,MAAM,QAAQ,CAAC,OAAiB;","names":[]}
|