@ecomiq/core 0.1.2 → 0.1.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/client.cjs +4 -4
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -6
- package/dist/client.d.ts +7 -6
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +319 -319
- package/dist/index.d.ts +319 -319
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/models/collections.d.cts +4 -4
- package/dist/models/collections.d.ts +4 -4
- package/dist/models/geo.d.cts +14 -14
- package/dist/models/geo.d.ts +14 -14
- package/dist/models/products.d.cts +130 -130
- package/dist/models/products.d.ts +130 -130
- package/dist/models/search.d.cts +4 -4
- package/dist/models/search.d.ts +4 -4
- package/dist/models/settings.d.cts +512 -512
- package/dist/models/settings.d.ts +512 -512
- package/dist/models/storefront-cart.d.cts +80 -80
- package/dist/models/storefront-cart.d.ts +80 -80
- package/dist/models/storefront-checkout.d.cts +384 -384
- package/dist/models/storefront-checkout.d.ts +384 -384
- package/dist/models/storefront-reviews.d.cts +8 -8
- package/dist/models/storefront-reviews.d.ts +8 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1198,12 +1198,12 @@ async function getDistricts(api, params) {
|
|
|
1198
1198
|
var DEFAULT_SETTINGS_CACHE_TTL_MS = 3e4;
|
|
1199
1199
|
function createClient(options) {
|
|
1200
1200
|
const {
|
|
1201
|
-
|
|
1201
|
+
domain,
|
|
1202
1202
|
settingsCacheTtlMs = DEFAULT_SETTINGS_CACHE_TTL_MS,
|
|
1203
1203
|
...apiOptions
|
|
1204
1204
|
} = options;
|
|
1205
|
-
if (!
|
|
1206
|
-
throw new Error("createClient requiere `
|
|
1205
|
+
if (!domain?.trim()) {
|
|
1206
|
+
throw new Error("createClient requiere `domain` (config.domain de ecomiq.config.js)");
|
|
1207
1207
|
}
|
|
1208
1208
|
if (!Number.isFinite(settingsCacheTtlMs) || settingsCacheTtlMs < 0) {
|
|
1209
1209
|
throw new Error("settingsCacheTtlMs debe ser un n\xFAmero mayor o igual a 0");
|
|
@@ -1231,7 +1231,7 @@ function createClient(options) {
|
|
|
1231
1231
|
if (inflight) return inflight;
|
|
1232
1232
|
const previous = cache?.data;
|
|
1233
1233
|
inflight = api.get("settings", StorefrontSettingsSchema, {
|
|
1234
|
-
headers: { "x-Store-Domain":
|
|
1234
|
+
headers: { "x-Store-Domain": domain }
|
|
1235
1235
|
}).then((data) => {
|
|
1236
1236
|
cache = { data, expiresAt: Date.now() + settingsCacheTtlMs };
|
|
1237
1237
|
return data;
|