@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/index.js CHANGED
@@ -1192,12 +1192,12 @@ async function getDistricts(api, params) {
1192
1192
  var DEFAULT_SETTINGS_CACHE_TTL_MS = 3e4;
1193
1193
  function createClient(options) {
1194
1194
  const {
1195
- slug,
1195
+ domain,
1196
1196
  settingsCacheTtlMs = DEFAULT_SETTINGS_CACHE_TTL_MS,
1197
1197
  ...apiOptions
1198
1198
  } = options;
1199
- if (!slug?.trim()) {
1200
- throw new Error("createClient requiere `slug` (config.slug de ecomiq.config.js)");
1199
+ if (!domain?.trim()) {
1200
+ throw new Error("createClient requiere `domain` (config.domain de ecomiq.config.js)");
1201
1201
  }
1202
1202
  if (!Number.isFinite(settingsCacheTtlMs) || settingsCacheTtlMs < 0) {
1203
1203
  throw new Error("settingsCacheTtlMs debe ser un n\xFAmero mayor o igual a 0");
@@ -1225,7 +1225,7 @@ function createClient(options) {
1225
1225
  if (inflight) return inflight;
1226
1226
  const previous = cache?.data;
1227
1227
  inflight = api.get("settings", StorefrontSettingsSchema, {
1228
- headers: { "x-Store-Domain": slug }
1228
+ headers: { "x-Store-Domain": domain }
1229
1229
  }).then((data) => {
1230
1230
  cache = { data, expiresAt: Date.now() + settingsCacheTtlMs };
1231
1231
  return data;