@commercengine/storefront-sdk 0.4.1 → 0.4.3
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.cjs +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -13
- package/dist/index.d.ts +345 -13
- package/dist/{index.global.js → index.iife.js} +22 -1
- package/dist/index.iife.js.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/index.global.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(index_exports, {
|
|
|
42
42
|
OrderClient: () => OrderClient,
|
|
43
43
|
ResponseUtils: () => ResponseUtils,
|
|
44
44
|
ShippingClient: () => ShippingClient,
|
|
45
|
+
StoreConfigClient: () => StoreConfigClient,
|
|
45
46
|
StorefrontAPIClient: () => StorefrontAPIClient,
|
|
46
47
|
StorefrontSDK: () => StorefrontSDK,
|
|
47
48
|
default: () => index_default
|
|
@@ -2228,6 +2229,16 @@ var CustomerClient = class extends StorefrontAPIClient {
|
|
|
2228
2229
|
}
|
|
2229
2230
|
};
|
|
2230
2231
|
|
|
2232
|
+
// src/lib/store-config.ts
|
|
2233
|
+
var StoreConfigClient = class extends StorefrontAPIClient {
|
|
2234
|
+
/**
|
|
2235
|
+
* Get store config
|
|
2236
|
+
*/
|
|
2237
|
+
async getStoreConfig() {
|
|
2238
|
+
return this.executeRequest(() => this.client.GET("/store/config"));
|
|
2239
|
+
}
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2231
2242
|
// src/index.ts
|
|
2232
2243
|
var StorefrontSDK = class {
|
|
2233
2244
|
/**
|
|
@@ -2258,6 +2269,10 @@ var StorefrontSDK = class {
|
|
|
2258
2269
|
* Client for order-related endpoints
|
|
2259
2270
|
*/
|
|
2260
2271
|
order;
|
|
2272
|
+
/**
|
|
2273
|
+
* Client for store config-related endpoints
|
|
2274
|
+
*/
|
|
2275
|
+
storeConfig;
|
|
2261
2276
|
/**
|
|
2262
2277
|
* Create a new StorefrontSDK instance
|
|
2263
2278
|
*
|
|
@@ -2286,6 +2301,7 @@ var StorefrontSDK = class {
|
|
|
2286
2301
|
this.helpers = new HelpersClient(config);
|
|
2287
2302
|
this.shipping = new ShippingClient(config);
|
|
2288
2303
|
this.order = new OrderClient(config);
|
|
2304
|
+
this.storeConfig = new StoreConfigClient(config);
|
|
2289
2305
|
}
|
|
2290
2306
|
/**
|
|
2291
2307
|
* Set authentication tokens for all clients
|
|
@@ -2305,6 +2321,7 @@ var StorefrontSDK = class {
|
|
|
2305
2321
|
await this.helpers.setTokens(accessToken, refreshToken);
|
|
2306
2322
|
await this.shipping.setTokens(accessToken, refreshToken);
|
|
2307
2323
|
await this.order.setTokens(accessToken, refreshToken);
|
|
2324
|
+
await this.storeConfig.setTokens(accessToken, refreshToken);
|
|
2308
2325
|
}
|
|
2309
2326
|
/**
|
|
2310
2327
|
* Clear all authentication tokens from all clients
|
|
@@ -2321,6 +2338,7 @@ var StorefrontSDK = class {
|
|
|
2321
2338
|
await this.helpers.clearTokens();
|
|
2322
2339
|
await this.shipping.clearTokens();
|
|
2323
2340
|
await this.order.clearTokens();
|
|
2341
|
+
await this.storeConfig.clearTokens();
|
|
2324
2342
|
}
|
|
2325
2343
|
/**
|
|
2326
2344
|
* Set the API key for all clients
|
|
@@ -2335,6 +2353,7 @@ var StorefrontSDK = class {
|
|
|
2335
2353
|
this.helpers.setApiKey(apiKey);
|
|
2336
2354
|
this.shipping.setApiKey(apiKey);
|
|
2337
2355
|
this.order.setApiKey(apiKey);
|
|
2356
|
+
this.storeConfig.setApiKey(apiKey);
|
|
2338
2357
|
}
|
|
2339
2358
|
/**
|
|
2340
2359
|
* Clear the API key from all clients
|
|
@@ -2347,6 +2366,7 @@ var StorefrontSDK = class {
|
|
|
2347
2366
|
this.helpers.clearApiKey();
|
|
2348
2367
|
this.shipping.clearApiKey();
|
|
2349
2368
|
this.order.clearApiKey();
|
|
2369
|
+
this.storeConfig.clearApiKey();
|
|
2350
2370
|
}
|
|
2351
2371
|
/**
|
|
2352
2372
|
* Get the current access token if using token storage
|
|
@@ -2428,6 +2448,7 @@ var StorefrontSDK = class {
|
|
|
2428
2448
|
this.helpers["config"] = newConfig;
|
|
2429
2449
|
this.shipping["config"] = newConfig;
|
|
2430
2450
|
this.order["config"] = newConfig;
|
|
2451
|
+
this.storeConfig["config"] = newConfig;
|
|
2431
2452
|
}
|
|
2432
2453
|
/**
|
|
2433
2454
|
* Get current default headers
|
|
@@ -2453,6 +2474,7 @@ var index_default = StorefrontSDK;
|
|
|
2453
2474
|
OrderClient,
|
|
2454
2475
|
ResponseUtils,
|
|
2455
2476
|
ShippingClient,
|
|
2477
|
+
StoreConfigClient,
|
|
2456
2478
|
StorefrontAPIClient,
|
|
2457
2479
|
StorefrontSDK
|
|
2458
2480
|
});
|