@commercengine/storefront-sdk 0.1.0 → 0.1.2
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/index.d.ts +8 -1
- package/dist/index.js +9 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StorefrontAPIClient, Environment } from "./lib/client";
|
|
2
2
|
import { CatalogClient } from "./lib/catalog";
|
|
3
3
|
import { CartClient } from "./lib/cart";
|
|
4
|
-
import { AuthClient } from "./lib/auth";
|
|
4
|
+
import { AuthClient, TokenStorage } from "./lib/auth";
|
|
5
5
|
/**
|
|
6
6
|
* SDK initialization options
|
|
7
7
|
*/
|
|
@@ -31,6 +31,11 @@ export interface StorefrontSDKOptions {
|
|
|
31
31
|
* Optional timeout in milliseconds
|
|
32
32
|
*/
|
|
33
33
|
timeout?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Optional token storage strategy
|
|
36
|
+
* Defaults to MemoryTokenStorage if not provided
|
|
37
|
+
*/
|
|
38
|
+
tokenStorage?: TokenStorage;
|
|
34
39
|
}
|
|
35
40
|
/**
|
|
36
41
|
* Main SDK class for the Storefront API
|
|
@@ -78,3 +83,5 @@ export declare class StorefrontSDK {
|
|
|
78
83
|
export default StorefrontSDK;
|
|
79
84
|
export { StorefrontAPIClient, CatalogClient, CartClient, AuthClient };
|
|
80
85
|
export { Environment };
|
|
86
|
+
export { TokenStorage, MemoryTokenStorage, BrowserTokenStorage, CookieTokenStorage, NextCookieTokenStorage, createTokenStorage, } from "./lib/auth";
|
|
87
|
+
export type { components, operations, paths } from "./types/storefront";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Environment = exports.AuthClient = exports.CartClient = exports.CatalogClient = exports.StorefrontAPIClient = exports.StorefrontSDK = void 0;
|
|
3
|
+
exports.createTokenStorage = exports.NextCookieTokenStorage = exports.CookieTokenStorage = exports.BrowserTokenStorage = exports.MemoryTokenStorage = exports.Environment = exports.AuthClient = exports.CartClient = exports.CatalogClient = exports.StorefrontAPIClient = exports.StorefrontSDK = void 0;
|
|
4
4
|
const client_1 = require("./lib/client");
|
|
5
5
|
Object.defineProperty(exports, "StorefrontAPIClient", { enumerable: true, get: function () { return client_1.StorefrontAPIClient; } });
|
|
6
6
|
Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return client_1.Environment; } });
|
|
@@ -31,7 +31,7 @@ class StorefrontSDK {
|
|
|
31
31
|
};
|
|
32
32
|
this.catalog = new catalog_1.CatalogClient(config);
|
|
33
33
|
this.cart = new cart_1.CartClient(config);
|
|
34
|
-
this.auth = new auth_1.AuthClient(config);
|
|
34
|
+
this.auth = new auth_1.AuthClient(config, options.tokenStorage);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Set the authentication token for all clients
|
|
@@ -73,3 +73,10 @@ class StorefrontSDK {
|
|
|
73
73
|
exports.StorefrontSDK = StorefrontSDK;
|
|
74
74
|
// Export the main SDK class
|
|
75
75
|
exports.default = StorefrontSDK;
|
|
76
|
+
// Export token storage types
|
|
77
|
+
var auth_2 = require("./lib/auth");
|
|
78
|
+
Object.defineProperty(exports, "MemoryTokenStorage", { enumerable: true, get: function () { return auth_2.MemoryTokenStorage; } });
|
|
79
|
+
Object.defineProperty(exports, "BrowserTokenStorage", { enumerable: true, get: function () { return auth_2.BrowserTokenStorage; } });
|
|
80
|
+
Object.defineProperty(exports, "CookieTokenStorage", { enumerable: true, get: function () { return auth_2.CookieTokenStorage; } });
|
|
81
|
+
Object.defineProperty(exports, "NextCookieTokenStorage", { enumerable: true, get: function () { return auth_2.NextCookieTokenStorage; } });
|
|
82
|
+
Object.defineProperty(exports, "createTokenStorage", { enumerable: true, get: function () { return auth_2.createTokenStorage; } });
|