@commercengine/storefront-sdk 0.14.3 → 0.14.5
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.mts +1680 -175
- package/dist/index.iife.js +231 -128
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +124 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
package/dist/index.iife.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
var CE_SDK = (function(exports) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region ../../node_modules/.pnpm/openapi-fetch@0.17.0/node_modules/openapi-fetch/dist/index.mjs
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region ../../node_modules/.pnpm/openapi-fetch@0.17.0/node_modules/openapi-fetch/dist/index.mjs
|
|
6
4
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
7
5
|
const supportsRequestInitExt = () => {
|
|
8
6
|
return typeof process === "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
|
|
@@ -158,54 +156,63 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
158
156
|
method: method.toUpperCase()
|
|
159
157
|
});
|
|
160
158
|
},
|
|
159
|
+
/** Call a GET endpoint */
|
|
161
160
|
GET(url, init) {
|
|
162
161
|
return coreFetch(url, {
|
|
163
162
|
...init,
|
|
164
163
|
method: "GET"
|
|
165
164
|
});
|
|
166
165
|
},
|
|
166
|
+
/** Call a PUT endpoint */
|
|
167
167
|
PUT(url, init) {
|
|
168
168
|
return coreFetch(url, {
|
|
169
169
|
...init,
|
|
170
170
|
method: "PUT"
|
|
171
171
|
});
|
|
172
172
|
},
|
|
173
|
+
/** Call a POST endpoint */
|
|
173
174
|
POST(url, init) {
|
|
174
175
|
return coreFetch(url, {
|
|
175
176
|
...init,
|
|
176
177
|
method: "POST"
|
|
177
178
|
});
|
|
178
179
|
},
|
|
180
|
+
/** Call a DELETE endpoint */
|
|
179
181
|
DELETE(url, init) {
|
|
180
182
|
return coreFetch(url, {
|
|
181
183
|
...init,
|
|
182
184
|
method: "DELETE"
|
|
183
185
|
});
|
|
184
186
|
},
|
|
187
|
+
/** Call a OPTIONS endpoint */
|
|
185
188
|
OPTIONS(url, init) {
|
|
186
189
|
return coreFetch(url, {
|
|
187
190
|
...init,
|
|
188
191
|
method: "OPTIONS"
|
|
189
192
|
});
|
|
190
193
|
},
|
|
194
|
+
/** Call a HEAD endpoint */
|
|
191
195
|
HEAD(url, init) {
|
|
192
196
|
return coreFetch(url, {
|
|
193
197
|
...init,
|
|
194
198
|
method: "HEAD"
|
|
195
199
|
});
|
|
196
200
|
},
|
|
201
|
+
/** Call a PATCH endpoint */
|
|
197
202
|
PATCH(url, init) {
|
|
198
203
|
return coreFetch(url, {
|
|
199
204
|
...init,
|
|
200
205
|
method: "PATCH"
|
|
201
206
|
});
|
|
202
207
|
},
|
|
208
|
+
/** Call a TRACE endpoint */
|
|
203
209
|
TRACE(url, init) {
|
|
204
210
|
return coreFetch(url, {
|
|
205
211
|
...init,
|
|
206
212
|
method: "TRACE"
|
|
207
213
|
});
|
|
208
214
|
},
|
|
215
|
+
/** Register middleware */
|
|
209
216
|
use(...middleware) {
|
|
210
217
|
for (const m of middleware) {
|
|
211
218
|
if (!m) continue;
|
|
@@ -213,6 +220,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
213
220
|
globalMiddlewares.push(m);
|
|
214
221
|
}
|
|
215
222
|
},
|
|
223
|
+
/** Unregister middleware */
|
|
216
224
|
eject(...middleware) {
|
|
217
225
|
for (const m of middleware) {
|
|
218
226
|
const i = globalMiddlewares.indexOf(m);
|
|
@@ -378,10 +386,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
378
386
|
if (url.endsWith("/")) return url.substring(0, url.length - 1);
|
|
379
387
|
return url;
|
|
380
388
|
}
|
|
381
|
-
|
|
382
|
-
//#
|
|
383
|
-
|
|
384
|
-
/**
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region ../sdk-core/dist/index.mjs
|
|
391
|
+
/**
|
|
385
392
|
* Response utilities for debugging and working with Response objects
|
|
386
393
|
*/
|
|
387
394
|
var ResponseUtils = class {
|
|
@@ -807,10 +814,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
807
814
|
return url.split("?")[0] || url;
|
|
808
815
|
}
|
|
809
816
|
}
|
|
810
|
-
|
|
811
|
-
//#
|
|
812
|
-
|
|
813
|
-
/**
|
|
817
|
+
//#endregion
|
|
818
|
+
//#region src/lib/shared/url-utils.ts
|
|
819
|
+
/**
|
|
814
820
|
* URL utility functions for the Storefront SDK
|
|
815
821
|
*/
|
|
816
822
|
/**
|
|
@@ -832,16 +838,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
832
838
|
*/
|
|
833
839
|
function buildStorefrontURL(config) {
|
|
834
840
|
if (config.baseUrl) return config.baseUrl;
|
|
835
|
-
switch (config.environment ||
|
|
836
|
-
case
|
|
837
|
-
case Environment.Production:
|
|
841
|
+
switch (config.environment || "production") {
|
|
842
|
+
case "staging": return `https://staging.api.commercengine.io/api/v1/${config.storeId}/storefront`;
|
|
838
843
|
default: return `https://prod.api.commercengine.io/api/v1/${config.storeId}/storefront`;
|
|
839
844
|
}
|
|
840
845
|
}
|
|
841
|
-
|
|
842
|
-
//#
|
|
843
|
-
|
|
844
|
-
/**
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region src/lib/shared/client.ts
|
|
848
|
+
/**
|
|
845
849
|
* Shared base class for Storefront API clients.
|
|
846
850
|
*
|
|
847
851
|
* This centralizes Storefront-specific URL construction, default header
|
|
@@ -878,9 +882,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
878
882
|
this.client.use(middleware);
|
|
879
883
|
}
|
|
880
884
|
};
|
|
881
|
-
|
|
882
|
-
//#
|
|
883
|
-
//#region src/lib/session/client.ts
|
|
885
|
+
//#endregion
|
|
886
|
+
//#region src/lib/session/client.ts
|
|
884
887
|
function attachSessionAuth(client, sessionManager) {
|
|
885
888
|
client.useMiddleware(sessionManager.createAuthMiddleware());
|
|
886
889
|
}
|
|
@@ -1009,10 +1012,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1009
1012
|
};
|
|
1010
1013
|
}
|
|
1011
1014
|
};
|
|
1012
|
-
|
|
1013
|
-
//#
|
|
1014
|
-
|
|
1015
|
-
/**
|
|
1015
|
+
//#endregion
|
|
1016
|
+
//#region src/lib/shared/catalog.ts
|
|
1017
|
+
/**
|
|
1016
1018
|
* Client for interacting with catalog endpoints
|
|
1017
1019
|
*/
|
|
1018
1020
|
var BaseCatalogClient = class extends StorefrontAPIClientBase {
|
|
@@ -1585,10 +1587,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1585
1587
|
} }));
|
|
1586
1588
|
}
|
|
1587
1589
|
};
|
|
1588
|
-
|
|
1589
|
-
//#
|
|
1590
|
-
|
|
1591
|
-
/**
|
|
1590
|
+
//#endregion
|
|
1591
|
+
//#region src/lib/public/client.ts
|
|
1592
|
+
/**
|
|
1592
1593
|
* Storefront API client that always authenticates with `X-Api-Key`.
|
|
1593
1594
|
*
|
|
1594
1595
|
* This class is kept as the advanced public transport client. Concrete public
|
|
@@ -1607,10 +1608,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1607
1608
|
return request;
|
|
1608
1609
|
} });
|
|
1609
1610
|
}
|
|
1610
|
-
|
|
1611
|
-
//#
|
|
1612
|
-
|
|
1613
|
-
/**
|
|
1611
|
+
//#endregion
|
|
1612
|
+
//#region src/lib/public/catalog.ts
|
|
1613
|
+
/**
|
|
1614
1614
|
* Client for interacting with catalog endpoints
|
|
1615
1615
|
*/
|
|
1616
1616
|
var PublicCatalogClient = class extends BaseCatalogClient {
|
|
@@ -1619,10 +1619,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1619
1619
|
attachPublicAuth(this);
|
|
1620
1620
|
}
|
|
1621
1621
|
};
|
|
1622
|
-
|
|
1623
|
-
//#
|
|
1624
|
-
|
|
1625
|
-
/**
|
|
1622
|
+
//#endregion
|
|
1623
|
+
//#region src/lib/catalog.ts
|
|
1624
|
+
/**
|
|
1626
1625
|
* Client for interacting with catalog endpoints
|
|
1627
1626
|
*/
|
|
1628
1627
|
var CatalogClient = class extends BaseCatalogClient {
|
|
@@ -1674,10 +1673,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1674
1673
|
}));
|
|
1675
1674
|
}
|
|
1676
1675
|
};
|
|
1677
|
-
|
|
1678
|
-
//#
|
|
1679
|
-
|
|
1680
|
-
/**
|
|
1676
|
+
//#endregion
|
|
1677
|
+
//#region src/lib/cart.ts
|
|
1678
|
+
/**
|
|
1681
1679
|
* Client for interacting with cart endpoints
|
|
1682
1680
|
*/
|
|
1683
1681
|
var CartClient = class extends SessionStorefrontAPIClient {
|
|
@@ -2331,10 +2329,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2331
2329
|
}));
|
|
2332
2330
|
}
|
|
2333
2331
|
};
|
|
2334
|
-
|
|
2335
|
-
//#
|
|
2336
|
-
|
|
2337
|
-
/**
|
|
2332
|
+
//#endregion
|
|
2333
|
+
//#region src/lib/auth.ts
|
|
2334
|
+
/**
|
|
2338
2335
|
* Client for interacting with authentication endpoints
|
|
2339
2336
|
*/
|
|
2340
2337
|
var AuthClient = class extends SessionStorefrontAPIClient {
|
|
@@ -3017,10 +3014,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3017
3014
|
return this.executeRequest(() => this.client.POST("/auth/verified-email-phone", { body }));
|
|
3018
3015
|
}
|
|
3019
3016
|
};
|
|
3020
|
-
|
|
3021
|
-
//#
|
|
3022
|
-
|
|
3023
|
-
/**
|
|
3017
|
+
//#endregion
|
|
3018
|
+
//#region src/lib/order.ts
|
|
3019
|
+
/**
|
|
3024
3020
|
* Client for interacting with order endpoints
|
|
3025
3021
|
*/
|
|
3026
3022
|
var OrderClient = class extends SessionStorefrontAPIClient {
|
|
@@ -3381,10 +3377,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3381
3377
|
}));
|
|
3382
3378
|
}
|
|
3383
3379
|
};
|
|
3384
|
-
|
|
3385
|
-
//#
|
|
3386
|
-
|
|
3387
|
-
/**
|
|
3380
|
+
//#endregion
|
|
3381
|
+
//#region src/lib/payments.ts
|
|
3382
|
+
/**
|
|
3388
3383
|
* Client for interacting with payment endpoints
|
|
3389
3384
|
*/
|
|
3390
3385
|
var PaymentsClient = class extends SessionStorefrontAPIClient {
|
|
@@ -3527,11 +3522,37 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3527
3522
|
async resendDirectOtp(body) {
|
|
3528
3523
|
return this.executeRequest(() => this.client.POST("/payments/resend-direct-otp", { body }));
|
|
3529
3524
|
}
|
|
3525
|
+
/**
|
|
3526
|
+
* Verify an IFSC code and resolve its bank branch details
|
|
3527
|
+
*
|
|
3528
|
+
* @description Resolves an 11-character Indian Financial System Code (IFSC) to bank,
|
|
3529
|
+
* branch, and supported payment rail details. Useful for validating user-entered IFSC
|
|
3530
|
+
* codes before creating bank accounts or mandates.
|
|
3531
|
+
*
|
|
3532
|
+
* @param pathParams - Path parameters containing the IFSC code
|
|
3533
|
+
* @returns Promise with IFSC details
|
|
3534
|
+
* @example
|
|
3535
|
+
* ```typescript
|
|
3536
|
+
* const { data, error } = await sdk.payments.verifyIfscCode({
|
|
3537
|
+
* ifsc_code: "HDFC0001234"
|
|
3538
|
+
* });
|
|
3539
|
+
*
|
|
3540
|
+
* if (error) {
|
|
3541
|
+
* console.error("Failed to verify IFSC:", error.message);
|
|
3542
|
+
* } else {
|
|
3543
|
+
* console.log("Bank:", data.ifsc.bank);
|
|
3544
|
+
* console.log("Branch:", data.ifsc.branch);
|
|
3545
|
+
* console.log("Supports UPI:", data.ifsc.upi);
|
|
3546
|
+
* }
|
|
3547
|
+
* ```
|
|
3548
|
+
*/
|
|
3549
|
+
async verifyIfscCode(pathParams) {
|
|
3550
|
+
return this.executeRequest(() => this.client.GET("/payments/ifsc-lookup/{ifsc_code}", { params: { path: pathParams } }));
|
|
3551
|
+
}
|
|
3530
3552
|
};
|
|
3531
|
-
|
|
3532
|
-
//#
|
|
3533
|
-
|
|
3534
|
-
/**
|
|
3553
|
+
//#endregion
|
|
3554
|
+
//#region src/lib/shared/helper.ts
|
|
3555
|
+
/**
|
|
3535
3556
|
* Client for interacting with helper endpoints
|
|
3536
3557
|
*/
|
|
3537
3558
|
var BaseHelpersClient = class extends StorefrontAPIClientBase {
|
|
@@ -3642,10 +3663,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3642
3663
|
} }));
|
|
3643
3664
|
}
|
|
3644
3665
|
};
|
|
3645
|
-
|
|
3646
|
-
//#
|
|
3647
|
-
|
|
3648
|
-
/**
|
|
3666
|
+
//#endregion
|
|
3667
|
+
//#region src/lib/public/helper.ts
|
|
3668
|
+
/**
|
|
3649
3669
|
* Client for interacting with helper endpoints
|
|
3650
3670
|
*/
|
|
3651
3671
|
var PublicHelpersClient = class extends BaseHelpersClient {
|
|
@@ -3654,10 +3674,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3654
3674
|
attachPublicAuth(this);
|
|
3655
3675
|
}
|
|
3656
3676
|
};
|
|
3657
|
-
|
|
3658
|
-
//#
|
|
3659
|
-
|
|
3660
|
-
/**
|
|
3677
|
+
//#endregion
|
|
3678
|
+
//#region src/lib/helper.ts
|
|
3679
|
+
/**
|
|
3661
3680
|
* Client for interacting with helper endpoints
|
|
3662
3681
|
*/
|
|
3663
3682
|
var HelpersClient = class extends BaseHelpersClient {
|
|
@@ -3666,10 +3685,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3666
3685
|
attachSessionAuth(this, config.sessionManager);
|
|
3667
3686
|
}
|
|
3668
3687
|
};
|
|
3669
|
-
|
|
3670
|
-
//#
|
|
3671
|
-
|
|
3672
|
-
/**
|
|
3688
|
+
//#endregion
|
|
3689
|
+
//#region src/lib/customer.ts
|
|
3690
|
+
/**
|
|
3673
3691
|
* Client for interacting with customer endpoints
|
|
3674
3692
|
*/
|
|
3675
3693
|
var CustomerClient = class extends SessionStorefrontAPIClient {
|
|
@@ -3736,11 +3754,104 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3736
3754
|
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3737
3755
|
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/cards", { params: { path: resolvedPathParams } }));
|
|
3738
3756
|
}
|
|
3757
|
+
async listBankAccounts(pathParamsOrQuery, queryParams) {
|
|
3758
|
+
const hasPathParams = queryParams !== void 0 || !!pathParamsOrQuery && typeof pathParamsOrQuery === "object" && "customer_id" in pathParamsOrQuery;
|
|
3759
|
+
const pathParams = hasPathParams ? pathParamsOrQuery : {};
|
|
3760
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3761
|
+
const resolvedQueryParams = hasPathParams ? queryParams : pathParamsOrQuery;
|
|
3762
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/bank-accounts", { params: {
|
|
3763
|
+
path: resolvedPathParams,
|
|
3764
|
+
query: resolvedQueryParams
|
|
3765
|
+
} }));
|
|
3766
|
+
}
|
|
3767
|
+
async createBankAccount(pathParamsOrBody, maybeBody) {
|
|
3768
|
+
const pathParams = maybeBody ? pathParamsOrBody : {};
|
|
3769
|
+
const body = maybeBody ?? pathParamsOrBody;
|
|
3770
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3771
|
+
return this.executeRequest(() => this.client.POST("/customers/{customer_id}/bank-accounts", {
|
|
3772
|
+
params: { path: resolvedPathParams },
|
|
3773
|
+
body
|
|
3774
|
+
}));
|
|
3775
|
+
}
|
|
3776
|
+
async getBankAccount(pathParams) {
|
|
3777
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3778
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/bank-accounts/{account_id}", { params: { path: resolvedPathParams } }));
|
|
3779
|
+
}
|
|
3780
|
+
async updateBankAccount(pathParams, body) {
|
|
3781
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3782
|
+
return this.executeRequest(() => this.client.PUT("/customers/{customer_id}/bank-accounts/{account_id}", {
|
|
3783
|
+
params: { path: resolvedPathParams },
|
|
3784
|
+
body
|
|
3785
|
+
}));
|
|
3786
|
+
}
|
|
3787
|
+
async deleteBankAccount(pathParams) {
|
|
3788
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3789
|
+
return this.executeRequest(() => this.client.DELETE("/customers/{customer_id}/bank-accounts/{account_id}", { params: { path: resolvedPathParams } }));
|
|
3790
|
+
}
|
|
3791
|
+
async verifyBankAccount(pathParams, body) {
|
|
3792
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3793
|
+
return this.executeRequest(() => this.client.POST("/customers/{customer_id}/bank-accounts/{account_id}/verify", {
|
|
3794
|
+
params: { path: resolvedPathParams },
|
|
3795
|
+
body
|
|
3796
|
+
}));
|
|
3797
|
+
}
|
|
3798
|
+
async getCreditLineBalance(pathParams = {}) {
|
|
3799
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3800
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/credit-line-balance", { params: { path: resolvedPathParams } }));
|
|
3801
|
+
}
|
|
3802
|
+
async listMandates(pathParams = {}) {
|
|
3803
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3804
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/mandates", { params: { path: resolvedPathParams } }));
|
|
3805
|
+
}
|
|
3806
|
+
async createMandate(pathParamsOrBody, maybeBody) {
|
|
3807
|
+
const pathParams = maybeBody ? pathParamsOrBody : {};
|
|
3808
|
+
const body = maybeBody ?? pathParamsOrBody;
|
|
3809
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3810
|
+
return this.executeRequest(() => this.client.POST("/customers/{customer_id}/mandates", {
|
|
3811
|
+
params: { path: resolvedPathParams },
|
|
3812
|
+
body
|
|
3813
|
+
}));
|
|
3814
|
+
}
|
|
3815
|
+
async getMandate(pathParams, queryParams) {
|
|
3816
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3817
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/mandates/{mandate_id}", { params: {
|
|
3818
|
+
path: resolvedPathParams,
|
|
3819
|
+
query: queryParams
|
|
3820
|
+
} }));
|
|
3821
|
+
}
|
|
3822
|
+
async updateMandate(pathParams, body) {
|
|
3823
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3824
|
+
return this.executeRequest(() => this.client.PUT("/customers/{customer_id}/mandates/{mandate_id}", {
|
|
3825
|
+
params: { path: resolvedPathParams },
|
|
3826
|
+
body
|
|
3827
|
+
}));
|
|
3828
|
+
}
|
|
3829
|
+
async pauseMandate(pathParams) {
|
|
3830
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3831
|
+
return this.executeRequest(() => this.client.POST("/customers/{customer_id}/mandates/{mandate_id}/pause", { params: { path: resolvedPathParams } }));
|
|
3832
|
+
}
|
|
3833
|
+
async resumeMandate(pathParams) {
|
|
3834
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3835
|
+
return this.executeRequest(() => this.client.POST("/customers/{customer_id}/mandates/{mandate_id}/resume", { params: { path: resolvedPathParams } }));
|
|
3836
|
+
}
|
|
3837
|
+
async revokeMandate(pathParams) {
|
|
3838
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3839
|
+
return this.executeRequest(() => this.client.POST("/customers/{customer_id}/mandates/{mandate_id}/revoke", { params: { path: resolvedPathParams } }));
|
|
3840
|
+
}
|
|
3841
|
+
async listMandateDebitSchedules(pathParamsOrQuery, queryParams) {
|
|
3842
|
+
const hasPathParams = queryParams !== void 0 || !!pathParamsOrQuery && typeof pathParamsOrQuery === "object" && "customer_id" in pathParamsOrQuery;
|
|
3843
|
+
const pathParams = hasPathParams ? pathParamsOrQuery : {};
|
|
3844
|
+
const resolvedPathParams = await this.resolveCustomerPathParams(pathParams);
|
|
3845
|
+
const resolvedQueryParams = hasPathParams ? queryParams : pathParamsOrQuery;
|
|
3846
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/mandate-debit-schedules", { params: {
|
|
3847
|
+
path: resolvedPathParams,
|
|
3848
|
+
query: resolvedQueryParams
|
|
3849
|
+
} }));
|
|
3850
|
+
}
|
|
3739
3851
|
};
|
|
3740
|
-
|
|
3741
|
-
//#
|
|
3742
|
-
|
|
3743
|
-
/**
|
|
3852
|
+
//#endregion
|
|
3853
|
+
//#region src/lib/shared/store-config.ts
|
|
3854
|
+
/**
|
|
3744
3855
|
* Client for interacting with store config endpoints
|
|
3745
3856
|
*/
|
|
3746
3857
|
var BaseStoreConfigClient = class extends StorefrontAPIClientBase {
|
|
@@ -3791,10 +3902,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3791
3902
|
return this.executeRequest(() => this.client.GET("/store/config"));
|
|
3792
3903
|
}
|
|
3793
3904
|
};
|
|
3794
|
-
|
|
3795
|
-
//#
|
|
3796
|
-
|
|
3797
|
-
/**
|
|
3905
|
+
//#endregion
|
|
3906
|
+
//#region src/lib/public/store-config.ts
|
|
3907
|
+
/**
|
|
3798
3908
|
* Client for interacting with store config endpoints
|
|
3799
3909
|
*/
|
|
3800
3910
|
var PublicStoreConfigClient = class extends BaseStoreConfigClient {
|
|
@@ -3803,10 +3913,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3803
3913
|
attachPublicAuth(this);
|
|
3804
3914
|
}
|
|
3805
3915
|
};
|
|
3806
|
-
|
|
3807
|
-
//#
|
|
3808
|
-
|
|
3809
|
-
/**
|
|
3916
|
+
//#endregion
|
|
3917
|
+
//#region src/lib/store-config.ts
|
|
3918
|
+
/**
|
|
3810
3919
|
* Client for interacting with store config endpoints
|
|
3811
3920
|
*/
|
|
3812
3921
|
var StoreConfigClient = class extends BaseStoreConfigClient {
|
|
@@ -3815,10 +3924,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3815
3924
|
attachSessionAuth(this, config.sessionManager);
|
|
3816
3925
|
}
|
|
3817
3926
|
};
|
|
3818
|
-
|
|
3819
|
-
//#
|
|
3820
|
-
|
|
3821
|
-
/**
|
|
3927
|
+
//#endregion
|
|
3928
|
+
//#region src/lib/storage/token-storage.ts
|
|
3929
|
+
/**
|
|
3822
3930
|
* Simple in-memory token storage implementation
|
|
3823
3931
|
*/
|
|
3824
3932
|
var MemoryTokenStorage = class {
|
|
@@ -3935,10 +4043,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3935
4043
|
document.cookie = cookieString;
|
|
3936
4044
|
}
|
|
3937
4045
|
};
|
|
3938
|
-
|
|
3939
|
-
//#
|
|
3940
|
-
|
|
3941
|
-
/**
|
|
4046
|
+
//#endregion
|
|
4047
|
+
//#region src/lib/session/jwt-utils.ts
|
|
4048
|
+
/**
|
|
3942
4049
|
* Decode a JWT token payload without signature verification.
|
|
3943
4050
|
* This is a lightweight replacement for jose's decodeJwt.
|
|
3944
4051
|
*
|
|
@@ -4037,9 +4144,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4037
4144
|
function isUserAnonymous(token) {
|
|
4038
4145
|
return extractUserInfoFromToken(token)?.isAnonymous ?? true;
|
|
4039
4146
|
}
|
|
4040
|
-
|
|
4041
|
-
//#
|
|
4042
|
-
//#region src/types/auth-operation-metadata.ts
|
|
4147
|
+
//#endregion
|
|
4148
|
+
//#region src/types/auth-operation-metadata.ts
|
|
4043
4149
|
const API_KEY_ONLY_OPERATIONS = [
|
|
4044
4150
|
{
|
|
4045
4151
|
method: "POST",
|
|
@@ -4078,9 +4184,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4078
4184
|
path: "/store/sellers/{id}/reviews"
|
|
4079
4185
|
}
|
|
4080
4186
|
];
|
|
4081
|
-
|
|
4082
|
-
//#
|
|
4083
|
-
//#region src/lib/session/auth-utils.ts
|
|
4187
|
+
//#endregion
|
|
4188
|
+
//#region src/lib/session/auth-utils.ts
|
|
4084
4189
|
const TOKEN_RETURNING_OPERATIONS = [
|
|
4085
4190
|
{
|
|
4086
4191
|
method: "POST",
|
|
@@ -4156,10 +4261,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4156
4261
|
function isTokenReturningOperation(method, pathname) {
|
|
4157
4262
|
return matchesOperationList(method, pathname, TOKEN_RETURNING_OPERATIONS);
|
|
4158
4263
|
}
|
|
4159
|
-
|
|
4160
|
-
//#
|
|
4161
|
-
|
|
4162
|
-
/**
|
|
4264
|
+
//#endregion
|
|
4265
|
+
//#region src/lib/session/manager.ts
|
|
4266
|
+
/**
|
|
4163
4267
|
* Internal per-SDK session controller.
|
|
4164
4268
|
*
|
|
4165
4269
|
* A single instance is shared by all API clients created from the same
|
|
@@ -4533,10 +4637,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4533
4637
|
if (refreshToken) await this.tokenStorage.setRefreshToken(refreshToken);
|
|
4534
4638
|
}
|
|
4535
4639
|
};
|
|
4536
|
-
|
|
4537
|
-
//#
|
|
4538
|
-
|
|
4539
|
-
/**
|
|
4640
|
+
//#endregion
|
|
4641
|
+
//#region src/index.ts
|
|
4642
|
+
/**
|
|
4540
4643
|
* Public SDK class for the Storefront API.
|
|
4541
4644
|
*
|
|
4542
4645
|
* This surface is intentionally limited to API-key-backed, public read
|
|
@@ -4915,29 +5018,29 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4915
5018
|
session
|
|
4916
5019
|
};
|
|
4917
5020
|
}
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
exports.
|
|
4921
|
-
exports.
|
|
4922
|
-
exports.
|
|
4923
|
-
exports.
|
|
4924
|
-
exports.
|
|
4925
|
-
exports.
|
|
4926
|
-
exports.
|
|
4927
|
-
exports.
|
|
4928
|
-
exports.
|
|
4929
|
-
exports.
|
|
4930
|
-
exports.
|
|
4931
|
-
exports.
|
|
4932
|
-
exports.
|
|
4933
|
-
exports.
|
|
4934
|
-
exports.
|
|
4935
|
-
exports.
|
|
4936
|
-
exports.
|
|
4937
|
-
exports.
|
|
4938
|
-
exports.
|
|
4939
|
-
exports.
|
|
4940
|
-
exports
|
|
4941
|
-
return exports;
|
|
5021
|
+
//#endregion
|
|
5022
|
+
exports.AuthClient = AuthClient;
|
|
5023
|
+
exports.BrowserTokenStorage = BrowserTokenStorage;
|
|
5024
|
+
exports.CartClient = CartClient;
|
|
5025
|
+
exports.CatalogClient = CatalogClient;
|
|
5026
|
+
exports.CookieTokenStorage = CookieTokenStorage;
|
|
5027
|
+
exports.CustomerClient = CustomerClient;
|
|
5028
|
+
exports.Environment = Environment;
|
|
5029
|
+
exports.HelpersClient = HelpersClient;
|
|
5030
|
+
exports.MemoryTokenStorage = MemoryTokenStorage;
|
|
5031
|
+
exports.OrderClient = OrderClient;
|
|
5032
|
+
exports.PaymentsClient = PaymentsClient;
|
|
5033
|
+
exports.PublicCatalogClient = PublicCatalogClient;
|
|
5034
|
+
exports.PublicHelpersClient = PublicHelpersClient;
|
|
5035
|
+
exports.PublicStoreConfigClient = PublicStoreConfigClient;
|
|
5036
|
+
exports.PublicStorefrontAPIClient = PublicStorefrontAPIClient;
|
|
5037
|
+
exports.PublicStorefrontSDK = PublicStorefrontSDK;
|
|
5038
|
+
exports.ResponseUtils = ResponseUtils;
|
|
5039
|
+
exports.SessionStorefrontAPIClient = SessionStorefrontAPIClient;
|
|
5040
|
+
exports.SessionStorefrontSDK = SessionStorefrontSDK;
|
|
5041
|
+
exports.StoreConfigClient = StoreConfigClient;
|
|
5042
|
+
exports.createStorefront = createStorefront;
|
|
5043
|
+
return exports;
|
|
4942
5044
|
})({});
|
|
5045
|
+
|
|
4943
5046
|
//# sourceMappingURL=index.iife.js.map
|