@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 CHANGED
@@ -1159,12 +1159,12 @@ async function getDistricts(api, params) {
1159
1159
  var DEFAULT_SETTINGS_CACHE_TTL_MS = 3e4;
1160
1160
  function createClient(options) {
1161
1161
  const {
1162
- slug,
1162
+ domain,
1163
1163
  settingsCacheTtlMs = DEFAULT_SETTINGS_CACHE_TTL_MS,
1164
1164
  ...apiOptions
1165
1165
  } = options;
1166
- if (!slug?.trim()) {
1167
- throw new Error("createClient requiere `slug` (config.slug de ecomiq.config.js)");
1166
+ if (!domain?.trim()) {
1167
+ throw new Error("createClient requiere `domain` (config.domain de ecomiq.config.js)");
1168
1168
  }
1169
1169
  if (!Number.isFinite(settingsCacheTtlMs) || settingsCacheTtlMs < 0) {
1170
1170
  throw new Error("settingsCacheTtlMs debe ser un n\xFAmero mayor o igual a 0");
@@ -1192,7 +1192,7 @@ function createClient(options) {
1192
1192
  if (inflight) return inflight;
1193
1193
  const previous = cache?.data;
1194
1194
  inflight = api.get("settings", StorefrontSettingsSchema, {
1195
- headers: { "x-Store-Domain": slug }
1195
+ headers: { "x-Store-Domain": domain }
1196
1196
  }).then((data) => {
1197
1197
  cache = { data, expiresAt: Date.now() + settingsCacheTtlMs };
1198
1198
  return data;