@commercengine/storefront-sdk 0.14.2 → 0.14.4
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 +40 -26
- package/dist/index.iife.js +98 -125
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +1 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import createClient from "openapi-fetch";
|
|
2
|
-
|
|
3
2
|
//#region ../sdk-core/dist/index.mjs
|
|
4
3
|
/**
|
|
5
4
|
* Response utilities for debugging and working with Response objects
|
|
@@ -427,7 +426,6 @@ function getPathnameFromUrl(url) {
|
|
|
427
426
|
return url.split("?")[0] || url;
|
|
428
427
|
}
|
|
429
428
|
}
|
|
430
|
-
|
|
431
429
|
//#endregion
|
|
432
430
|
//#region src/lib/shared/url-utils.ts
|
|
433
431
|
/**
|
|
@@ -458,7 +456,6 @@ function buildStorefrontURL(config) {
|
|
|
458
456
|
default: return `https://prod.api.commercengine.io/api/v1/${config.storeId}/storefront`;
|
|
459
457
|
}
|
|
460
458
|
}
|
|
461
|
-
|
|
462
459
|
//#endregion
|
|
463
460
|
//#region src/lib/shared/client.ts
|
|
464
461
|
/**
|
|
@@ -498,7 +495,6 @@ var StorefrontAPIClientBase = class extends BaseAPIClient {
|
|
|
498
495
|
this.client.use(middleware);
|
|
499
496
|
}
|
|
500
497
|
};
|
|
501
|
-
|
|
502
498
|
//#endregion
|
|
503
499
|
//#region src/lib/session/client.ts
|
|
504
500
|
function attachSessionAuth(client, sessionManager) {
|
|
@@ -629,7 +625,6 @@ var SessionStorefrontAPIClient = class extends StorefrontAPIClientBase {
|
|
|
629
625
|
};
|
|
630
626
|
}
|
|
631
627
|
};
|
|
632
|
-
|
|
633
628
|
//#endregion
|
|
634
629
|
//#region src/lib/shared/catalog.ts
|
|
635
630
|
/**
|
|
@@ -1205,7 +1200,6 @@ var BaseCatalogClient = class extends StorefrontAPIClientBase {
|
|
|
1205
1200
|
} }));
|
|
1206
1201
|
}
|
|
1207
1202
|
};
|
|
1208
|
-
|
|
1209
1203
|
//#endregion
|
|
1210
1204
|
//#region src/lib/public/client.ts
|
|
1211
1205
|
/**
|
|
@@ -1227,7 +1221,6 @@ function attachPublicAuth(client) {
|
|
|
1227
1221
|
return request;
|
|
1228
1222
|
} });
|
|
1229
1223
|
}
|
|
1230
|
-
|
|
1231
1224
|
//#endregion
|
|
1232
1225
|
//#region src/lib/public/catalog.ts
|
|
1233
1226
|
/**
|
|
@@ -1239,7 +1232,6 @@ var PublicCatalogClient = class extends BaseCatalogClient {
|
|
|
1239
1232
|
attachPublicAuth(this);
|
|
1240
1233
|
}
|
|
1241
1234
|
};
|
|
1242
|
-
|
|
1243
1235
|
//#endregion
|
|
1244
1236
|
//#region src/lib/catalog.ts
|
|
1245
1237
|
/**
|
|
@@ -1294,7 +1286,6 @@ var CatalogClient = class extends BaseCatalogClient {
|
|
|
1294
1286
|
}));
|
|
1295
1287
|
}
|
|
1296
1288
|
};
|
|
1297
|
-
|
|
1298
1289
|
//#endregion
|
|
1299
1290
|
//#region src/lib/cart.ts
|
|
1300
1291
|
/**
|
|
@@ -1951,7 +1942,6 @@ var CartClient = class extends SessionStorefrontAPIClient {
|
|
|
1951
1942
|
}));
|
|
1952
1943
|
}
|
|
1953
1944
|
};
|
|
1954
|
-
|
|
1955
1945
|
//#endregion
|
|
1956
1946
|
//#region src/lib/auth.ts
|
|
1957
1947
|
/**
|
|
@@ -2637,7 +2627,6 @@ var AuthClient = class extends SessionStorefrontAPIClient {
|
|
|
2637
2627
|
return this.executeRequest(() => this.client.POST("/auth/verified-email-phone", { body }));
|
|
2638
2628
|
}
|
|
2639
2629
|
};
|
|
2640
|
-
|
|
2641
2630
|
//#endregion
|
|
2642
2631
|
//#region src/lib/order.ts
|
|
2643
2632
|
/**
|
|
@@ -3001,7 +2990,6 @@ var OrderClient = class extends SessionStorefrontAPIClient {
|
|
|
3001
2990
|
}));
|
|
3002
2991
|
}
|
|
3003
2992
|
};
|
|
3004
|
-
|
|
3005
2993
|
//#endregion
|
|
3006
2994
|
//#region src/lib/payments.ts
|
|
3007
2995
|
/**
|
|
@@ -3148,7 +3136,6 @@ var PaymentsClient = class extends SessionStorefrontAPIClient {
|
|
|
3148
3136
|
return this.executeRequest(() => this.client.POST("/payments/resend-direct-otp", { body }));
|
|
3149
3137
|
}
|
|
3150
3138
|
};
|
|
3151
|
-
|
|
3152
3139
|
//#endregion
|
|
3153
3140
|
//#region src/lib/shared/helper.ts
|
|
3154
3141
|
/**
|
|
@@ -3262,7 +3249,6 @@ var BaseHelpersClient = class extends StorefrontAPIClientBase {
|
|
|
3262
3249
|
} }));
|
|
3263
3250
|
}
|
|
3264
3251
|
};
|
|
3265
|
-
|
|
3266
3252
|
//#endregion
|
|
3267
3253
|
//#region src/lib/public/helper.ts
|
|
3268
3254
|
/**
|
|
@@ -3274,7 +3260,6 @@ var PublicHelpersClient = class extends BaseHelpersClient {
|
|
|
3274
3260
|
attachPublicAuth(this);
|
|
3275
3261
|
}
|
|
3276
3262
|
};
|
|
3277
|
-
|
|
3278
3263
|
//#endregion
|
|
3279
3264
|
//#region src/lib/helper.ts
|
|
3280
3265
|
/**
|
|
@@ -3286,7 +3271,6 @@ var HelpersClient = class extends BaseHelpersClient {
|
|
|
3286
3271
|
attachSessionAuth(this, config.sessionManager);
|
|
3287
3272
|
}
|
|
3288
3273
|
};
|
|
3289
|
-
|
|
3290
3274
|
//#endregion
|
|
3291
3275
|
//#region src/lib/customer.ts
|
|
3292
3276
|
/**
|
|
@@ -3357,7 +3341,6 @@ var CustomerClient = class extends SessionStorefrontAPIClient {
|
|
|
3357
3341
|
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/cards", { params: { path: resolvedPathParams } }));
|
|
3358
3342
|
}
|
|
3359
3343
|
};
|
|
3360
|
-
|
|
3361
3344
|
//#endregion
|
|
3362
3345
|
//#region src/lib/shared/store-config.ts
|
|
3363
3346
|
/**
|
|
@@ -3411,7 +3394,6 @@ var BaseStoreConfigClient = class extends StorefrontAPIClientBase {
|
|
|
3411
3394
|
return this.executeRequest(() => this.client.GET("/store/config"));
|
|
3412
3395
|
}
|
|
3413
3396
|
};
|
|
3414
|
-
|
|
3415
3397
|
//#endregion
|
|
3416
3398
|
//#region src/lib/public/store-config.ts
|
|
3417
3399
|
/**
|
|
@@ -3423,7 +3405,6 @@ var PublicStoreConfigClient = class extends BaseStoreConfigClient {
|
|
|
3423
3405
|
attachPublicAuth(this);
|
|
3424
3406
|
}
|
|
3425
3407
|
};
|
|
3426
|
-
|
|
3427
3408
|
//#endregion
|
|
3428
3409
|
//#region src/lib/store-config.ts
|
|
3429
3410
|
/**
|
|
@@ -3435,7 +3416,6 @@ var StoreConfigClient = class extends BaseStoreConfigClient {
|
|
|
3435
3416
|
attachSessionAuth(this, config.sessionManager);
|
|
3436
3417
|
}
|
|
3437
3418
|
};
|
|
3438
|
-
|
|
3439
3419
|
//#endregion
|
|
3440
3420
|
//#region src/lib/storage/token-storage.ts
|
|
3441
3421
|
/**
|
|
@@ -3555,7 +3535,6 @@ var CookieTokenStorage = class {
|
|
|
3555
3535
|
document.cookie = cookieString;
|
|
3556
3536
|
}
|
|
3557
3537
|
};
|
|
3558
|
-
|
|
3559
3538
|
//#endregion
|
|
3560
3539
|
//#region src/lib/session/jwt-utils.ts
|
|
3561
3540
|
/**
|
|
@@ -3657,7 +3636,6 @@ function isUserLoggedIn(token) {
|
|
|
3657
3636
|
function isUserAnonymous(token) {
|
|
3658
3637
|
return extractUserInfoFromToken(token)?.isAnonymous ?? true;
|
|
3659
3638
|
}
|
|
3660
|
-
|
|
3661
3639
|
//#endregion
|
|
3662
3640
|
//#region src/types/auth-operation-metadata.ts
|
|
3663
3641
|
const API_KEY_ONLY_OPERATIONS = [
|
|
@@ -3698,7 +3676,6 @@ const API_KEY_ONLY_OPERATIONS = [
|
|
|
3698
3676
|
path: "/store/sellers/{id}/reviews"
|
|
3699
3677
|
}
|
|
3700
3678
|
];
|
|
3701
|
-
|
|
3702
3679
|
//#endregion
|
|
3703
3680
|
//#region src/lib/session/auth-utils.ts
|
|
3704
3681
|
const TOKEN_RETURNING_OPERATIONS = [
|
|
@@ -3776,7 +3753,6 @@ function isApiKeyOnlyOperation(method, pathname) {
|
|
|
3776
3753
|
function isTokenReturningOperation(method, pathname) {
|
|
3777
3754
|
return matchesOperationList(method, pathname, TOKEN_RETURNING_OPERATIONS);
|
|
3778
3755
|
}
|
|
3779
|
-
|
|
3780
3756
|
//#endregion
|
|
3781
3757
|
//#region src/lib/session/manager.ts
|
|
3782
3758
|
/**
|
|
@@ -4153,7 +4129,6 @@ var StorefrontSessionManager = class {
|
|
|
4153
4129
|
if (refreshToken) await this.tokenStorage.setRefreshToken(refreshToken);
|
|
4154
4130
|
}
|
|
4155
4131
|
};
|
|
4156
|
-
|
|
4157
4132
|
//#endregion
|
|
4158
4133
|
//#region src/index.ts
|
|
4159
4134
|
/**
|
|
@@ -4535,7 +4510,7 @@ function createStorefront(options) {
|
|
|
4535
4510
|
session
|
|
4536
4511
|
};
|
|
4537
4512
|
}
|
|
4538
|
-
|
|
4539
4513
|
//#endregion
|
|
4540
4514
|
export { AuthClient, BrowserTokenStorage, CartClient, CatalogClient, CookieTokenStorage, CustomerClient, Environment, HelpersClient, MemoryTokenStorage, OrderClient, PaymentsClient, PublicCatalogClient, PublicHelpersClient, PublicStoreConfigClient, PublicStorefrontAPIClient, PublicStorefrontSDK, ResponseUtils, SessionStorefrontAPIClient, SessionStorefrontSDK, StoreConfigClient, createStorefront };
|
|
4515
|
+
|
|
4541
4516
|
//# sourceMappingURL=index.mjs.map
|