arky-sdk 0.9.18 → 0.9.20

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.
@@ -1,8 +1,8 @@
1
- import { C as CreateStorefrontConfig, S as StorefrontClient, a as ContactSession, b as StorefrontIdentifyResult, V as VerifyResponse, A as AuthStateListener, I as IdentifyResponse, T as TrackActionParams, c as StorefrontAction, U as UseExperimentParams, E as ExperimentUseResponse, d as StartSupportConversationParams, e as SupportConversationStartResponse, f as StorefrontSendSupportMessageParams, g as SupportConversationResponse, h as StorefrontGetSupportConversationParams, i as getBlockValue, j as getBlockTextValue, k as getBlockContentValue, l as getBlockValues, m as getBlockLabel, n as getBlockObjectValues, o as getBlockFromArray, p as formatBlockValue, q as prepareBlocksForSubmission, r as extractBlockValues, v as validatePhoneNumber, s as findTimeZone, t as slugify, u as humanize, w as categorify, x as formatDate, y as getSvgContentForAstro, z as fetchSvgContent, B as injectSvgIntoElement } from './admin-CBgRGUCX.cjs';
2
- export { D as COMMON_ACTION_KEYS, J as CartApi, K as CartController, L as CartControllerAddItemParams, M as CartControllerCheckoutParams, N as CartControllerClearParams, O as CartControllerInitParams, P as CartControllerListener, Q as CartControllerQuoteParams, R as CartControllerRefreshParams, W as CartControllerRemoveItemParams, X as CartControllerState, Y as CartControllerUpdateParams, H as CommonActionKey, Z as StorefrontSessionStorage, G as createCartController, F as createStorefront } from './admin-CBgRGUCX.cjs';
3
- import { m as formatPayment, f as formatMinor, g as getCurrencySymbol, a as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, e as getAvailableStock, h as getReservedStock, j as hasStock, k as getInventoryAt, l as getFirstAvailableFCId } from './inventory-DrVRUkE2.cjs';
4
- import { C as CollectionEntry, F as Form, a as FormValues, P as Product, S as Service, b as Provider, A as AvailabilityResponse, c as ServiceProvider, B as Block, d as OrderQuote, e as Currency, f as PaymentMethod, g as SlotRange, h as FormEntry, i as Price, j as OrderCheckoutResult, E as EshopCartItem, k as Address, l as Cart, m as FormSchema, n as FormField, Z as ZoneLocation, o as ProductCheckoutItemInput, p as ServiceCheckoutItemInput, M as Market, q as PaymentStoreConfig, r as Contact, G as GetCollectionParams, R as RequestOptions, s as Collection, t as GetEntriesParams, u as PaginatedResponse, v as GetFormParams, w as SubmitFormParams, x as FormSubmission, y as GetTaxonomyParams, T as Taxonomy, z as GetTaxonomyChildrenParams, D as GetProductParams, H as GetProductsParams, J as GetServiceParams, K as GetServicesParams, L as FindServiceProvidersParams, N as GetAvailabilityParams, Q as GetProviderParams, U as GetProvidersParams, V as GetOrderParams, W as Order, X as GetOrdersParams, Y as DownloadDigitalAccessParams, _ as DigitalAccessDownloadResponse, $ as FindDigitalAccessGrantsParams, a0 as DigitalAccessGrant, a1 as GetDigitalAccessGrantParams, a2 as ProductVariant, a3 as OrderCheckoutItemInput, a4 as GetContactListParams, a5 as StorefrontContactList, a6 as FindStorefrontContactListsParams, a7 as FindStorefrontContactListPlansParams, a8 as StorefrontContactListPlan, a9 as FindStorefrontContactListMembershipsParams, aa as StorefrontContactListMembership, ab as SubscribeContactListParams, ac as ContactListSubscribeResponse, ad as ContactListAccessParams, ae as ContactListAccessResponse, af as ContactListContentAccessParams, ag as ContactListContentAccessResponse, ah as ContactListManagementResponse, ai as Store, aj as Location } from './api-CuqZQQGv.cjs';
5
- export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-CuqZQQGv.cjs';
1
+ import { C as CreateStorefrontConfig, S as StorefrontClient, a as ContactSession, b as StorefrontIdentifyResult, V as VerifyResponse, A as AuthStateListener, I as IdentifyResponse, T as TrackActionParams, c as StorefrontAction, U as UseExperimentParams, E as ExperimentUseResponse, d as StartSupportConversationParams, e as SupportConversationStartResponse, f as StorefrontSendSupportMessageParams, g as SupportConversationResponse, h as StorefrontGetSupportConversationParams, i as getBlockValue, j as getBlockTextValue, k as getBlockContentValue, l as getBlockValues, m as getBlockLabel, n as getBlockObjectValues, o as getBlockFromArray, p as formatBlockValue, q as prepareBlocksForSubmission, r as extractBlockValues, v as validatePhoneNumber, s as findTimeZone, t as slugify, u as humanize, w as categorify, x as formatDate, y as getSvgContentForAstro, z as fetchSvgContent, B as injectSvgIntoElement } from './admin-DB_GYW2b.cjs';
2
+ export { D as COMMON_ACTION_KEYS, J as CartApi, K as CartController, L as CartControllerAddItemParams, M as CartControllerCheckoutParams, N as CartControllerClearParams, O as CartControllerInitParams, P as CartControllerListener, Q as CartControllerQuoteParams, R as CartControllerRefreshParams, W as CartControllerRemoveItemParams, X as CartControllerState, Y as CartControllerUpdateParams, H as CommonActionKey, Z as StorefrontSessionStorage, G as createCartController, F as createStorefront } from './admin-DB_GYW2b.cjs';
3
+ import { m as formatPayment, f as formatMinor, g as getCurrencySymbol, a as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, e as getAvailableStock, h as getReservedStock, j as hasStock, k as getInventoryAt, l as getFirstAvailableFCId } from './inventory-DgPpeRWU.cjs';
4
+ import { C as CollectionEntry, F as Form, a as FormValues, P as Product, S as Service, b as Provider, A as AvailabilityResponse, c as ServiceProvider, B as Block, d as OrderQuote, e as Currency, f as PaymentMethod, g as SlotRange, h as FormEntry, i as Price, j as OrderCheckoutResult, E as EshopCartItem, k as Address, l as Cart, m as FormSchema, n as FormField, Z as ZoneLocation, o as ProductCheckoutItemInput, p as ServiceCheckoutItemInput, M as Market, q as PaymentStoreConfig, r as Contact, G as GetCollectionParams, R as RequestOptions, s as Collection, t as GetEntriesParams, u as PaginatedResponse, v as GetFormParams, w as SubmitFormParams, x as FormSubmission, y as GetTaxonomyParams, T as Taxonomy, z as GetTaxonomyChildrenParams, D as GetProductParams, H as GetProductsParams, J as GetServiceParams, K as GetServicesParams, L as FindServiceProvidersParams, N as GetAvailabilityParams, Q as GetProviderParams, U as GetProvidersParams, V as GetOrderParams, W as Order, X as GetOrdersParams, Y as DownloadDigitalAccessParams, _ as DigitalAccessDownloadResponse, $ as FindDigitalAccessGrantsParams, a0 as DigitalAccessGrant, a1 as GetDigitalAccessGrantParams, a2 as ProductVariant, a3 as OrderCheckoutItemInput, a4 as GetContactListParams, a5 as StorefrontContactList, a6 as FindStorefrontContactListsParams, a7 as FindStorefrontContactListPlansParams, a8 as StorefrontContactListPlan, a9 as FindStorefrontContactListMembershipsParams, aa as StorefrontContactListMembership, ab as SubscribeContactListParams, ac as ContactListSubscribeResponse, ad as ContactListAccessParams, ae as ContactListAccessResponse, af as ContactListContentAccessParams, ag as ContactListContentAccessResponse, ah as ContactListManagementResponse, ai as Store, aj as Location } from './api-C_2AMzmc.cjs';
5
+ export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-C_2AMzmc.cjs';
6
6
  import * as nanostores from 'nanostores';
7
7
  import { StripeElementsOptions, Stripe } from '@stripe/stripe-js';
8
8
 
@@ -1,8 +1,8 @@
1
- import { C as CreateStorefrontConfig, S as StorefrontClient, a as ContactSession, b as StorefrontIdentifyResult, V as VerifyResponse, A as AuthStateListener, I as IdentifyResponse, T as TrackActionParams, c as StorefrontAction, U as UseExperimentParams, E as ExperimentUseResponse, d as StartSupportConversationParams, e as SupportConversationStartResponse, f as StorefrontSendSupportMessageParams, g as SupportConversationResponse, h as StorefrontGetSupportConversationParams, i as getBlockValue, j as getBlockTextValue, k as getBlockContentValue, l as getBlockValues, m as getBlockLabel, n as getBlockObjectValues, o as getBlockFromArray, p as formatBlockValue, q as prepareBlocksForSubmission, r as extractBlockValues, v as validatePhoneNumber, s as findTimeZone, t as slugify, u as humanize, w as categorify, x as formatDate, y as getSvgContentForAstro, z as fetchSvgContent, B as injectSvgIntoElement } from './admin-yoFJKZB8.js';
2
- export { D as COMMON_ACTION_KEYS, J as CartApi, K as CartController, L as CartControllerAddItemParams, M as CartControllerCheckoutParams, N as CartControllerClearParams, O as CartControllerInitParams, P as CartControllerListener, Q as CartControllerQuoteParams, R as CartControllerRefreshParams, W as CartControllerRemoveItemParams, X as CartControllerState, Y as CartControllerUpdateParams, H as CommonActionKey, Z as StorefrontSessionStorage, G as createCartController, F as createStorefront } from './admin-yoFJKZB8.js';
3
- import { m as formatPayment, f as formatMinor, g as getCurrencySymbol, a as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, e as getAvailableStock, h as getReservedStock, j as hasStock, k as getInventoryAt, l as getFirstAvailableFCId } from './inventory-DNX8Vg-N.js';
4
- import { C as CollectionEntry, F as Form, a as FormValues, P as Product, S as Service, b as Provider, A as AvailabilityResponse, c as ServiceProvider, B as Block, d as OrderQuote, e as Currency, f as PaymentMethod, g as SlotRange, h as FormEntry, i as Price, j as OrderCheckoutResult, E as EshopCartItem, k as Address, l as Cart, m as FormSchema, n as FormField, Z as ZoneLocation, o as ProductCheckoutItemInput, p as ServiceCheckoutItemInput, M as Market, q as PaymentStoreConfig, r as Contact, G as GetCollectionParams, R as RequestOptions, s as Collection, t as GetEntriesParams, u as PaginatedResponse, v as GetFormParams, w as SubmitFormParams, x as FormSubmission, y as GetTaxonomyParams, T as Taxonomy, z as GetTaxonomyChildrenParams, D as GetProductParams, H as GetProductsParams, J as GetServiceParams, K as GetServicesParams, L as FindServiceProvidersParams, N as GetAvailabilityParams, Q as GetProviderParams, U as GetProvidersParams, V as GetOrderParams, W as Order, X as GetOrdersParams, Y as DownloadDigitalAccessParams, _ as DigitalAccessDownloadResponse, $ as FindDigitalAccessGrantsParams, a0 as DigitalAccessGrant, a1 as GetDigitalAccessGrantParams, a2 as ProductVariant, a3 as OrderCheckoutItemInput, a4 as GetContactListParams, a5 as StorefrontContactList, a6 as FindStorefrontContactListsParams, a7 as FindStorefrontContactListPlansParams, a8 as StorefrontContactListPlan, a9 as FindStorefrontContactListMembershipsParams, aa as StorefrontContactListMembership, ab as SubscribeContactListParams, ac as ContactListSubscribeResponse, ad as ContactListAccessParams, ae as ContactListAccessResponse, af as ContactListContentAccessParams, ag as ContactListContentAccessResponse, ah as ContactListManagementResponse, ai as Store, aj as Location } from './api-CuqZQQGv.js';
5
- export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-CuqZQQGv.js';
1
+ import { C as CreateStorefrontConfig, S as StorefrontClient, a as ContactSession, b as StorefrontIdentifyResult, V as VerifyResponse, A as AuthStateListener, I as IdentifyResponse, T as TrackActionParams, c as StorefrontAction, U as UseExperimentParams, E as ExperimentUseResponse, d as StartSupportConversationParams, e as SupportConversationStartResponse, f as StorefrontSendSupportMessageParams, g as SupportConversationResponse, h as StorefrontGetSupportConversationParams, i as getBlockValue, j as getBlockTextValue, k as getBlockContentValue, l as getBlockValues, m as getBlockLabel, n as getBlockObjectValues, o as getBlockFromArray, p as formatBlockValue, q as prepareBlocksForSubmission, r as extractBlockValues, v as validatePhoneNumber, s as findTimeZone, t as slugify, u as humanize, w as categorify, x as formatDate, y as getSvgContentForAstro, z as fetchSvgContent, B as injectSvgIntoElement } from './admin-CTtJoarO.js';
2
+ export { D as COMMON_ACTION_KEYS, J as CartApi, K as CartController, L as CartControllerAddItemParams, M as CartControllerCheckoutParams, N as CartControllerClearParams, O as CartControllerInitParams, P as CartControllerListener, Q as CartControllerQuoteParams, R as CartControllerRefreshParams, W as CartControllerRemoveItemParams, X as CartControllerState, Y as CartControllerUpdateParams, H as CommonActionKey, Z as StorefrontSessionStorage, G as createCartController, F as createStorefront } from './admin-CTtJoarO.js';
3
+ import { m as formatPayment, f as formatMinor, g as getCurrencySymbol, a as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, e as getAvailableStock, h as getReservedStock, j as hasStock, k as getInventoryAt, l as getFirstAvailableFCId } from './inventory-DdgZ5MI_.js';
4
+ import { C as CollectionEntry, F as Form, a as FormValues, P as Product, S as Service, b as Provider, A as AvailabilityResponse, c as ServiceProvider, B as Block, d as OrderQuote, e as Currency, f as PaymentMethod, g as SlotRange, h as FormEntry, i as Price, j as OrderCheckoutResult, E as EshopCartItem, k as Address, l as Cart, m as FormSchema, n as FormField, Z as ZoneLocation, o as ProductCheckoutItemInput, p as ServiceCheckoutItemInput, M as Market, q as PaymentStoreConfig, r as Contact, G as GetCollectionParams, R as RequestOptions, s as Collection, t as GetEntriesParams, u as PaginatedResponse, v as GetFormParams, w as SubmitFormParams, x as FormSubmission, y as GetTaxonomyParams, T as Taxonomy, z as GetTaxonomyChildrenParams, D as GetProductParams, H as GetProductsParams, J as GetServiceParams, K as GetServicesParams, L as FindServiceProvidersParams, N as GetAvailabilityParams, Q as GetProviderParams, U as GetProvidersParams, V as GetOrderParams, W as Order, X as GetOrdersParams, Y as DownloadDigitalAccessParams, _ as DigitalAccessDownloadResponse, $ as FindDigitalAccessGrantsParams, a0 as DigitalAccessGrant, a1 as GetDigitalAccessGrantParams, a2 as ProductVariant, a3 as OrderCheckoutItemInput, a4 as GetContactListParams, a5 as StorefrontContactList, a6 as FindStorefrontContactListsParams, a7 as FindStorefrontContactListPlansParams, a8 as StorefrontContactListPlan, a9 as FindStorefrontContactListMembershipsParams, aa as StorefrontContactListMembership, ab as SubscribeContactListParams, ac as ContactListSubscribeResponse, ad as ContactListAccessParams, ae as ContactListAccessResponse, af as ContactListContentAccessParams, ag as ContactListContentAccessResponse, ah as ContactListManagementResponse, ai as Store, aj as Location } from './api-C_2AMzmc.js';
5
+ export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-C_2AMzmc.js';
6
6
  import * as nanostores from 'nanostores';
7
7
  import { StripeElementsOptions, Stripe } from '@stripe/stripe-js';
8
8
 
@@ -744,21 +744,6 @@ function createCartController(cartApi) {
744
744
  };
745
745
  }
746
746
 
747
- // src/utils/errors.ts
748
- var convertServerErrorToRequestError = (serverError, renameRules) => {
749
- const validationErrors = serverError?.validationErrors ?? [];
750
- return {
751
- ...serverError,
752
- validationErrors: validationErrors.map((validationError) => {
753
- const field = validationError.field;
754
- return {
755
- field,
756
- error: validationError.error || "GENERAL.VALIDATION_ERROR"
757
- };
758
- })
759
- };
760
- };
761
-
762
747
  // src/utils/queryParams.ts
763
748
  function buildQueryString(params) {
764
749
  const queryParts = Object.entries(params).flatMap(
@@ -802,6 +787,12 @@ function toServerError(value, statusCode) {
802
787
  validationErrors
803
788
  };
804
789
  }
790
+ function normalizeValidationErrors(validationErrors) {
791
+ return validationErrors.map((validationError) => ({
792
+ field: validationError.field,
793
+ error: validationError.error || "GENERAL.VALIDATION_ERROR"
794
+ }));
795
+ }
805
796
  function createHttpClient(cfg) {
806
797
  const { authStorage } = cfg;
807
798
  let refreshPromise = null;
@@ -932,11 +923,10 @@ function createHttpClient(cfg) {
932
923
  }
933
924
  if (!res.ok) {
934
925
  const serverErr = toServerError(data, res.status);
935
- const reqErr = convertServerErrorToRequestError(serverErr);
936
926
  const requestId = res.headers.get("x-request-id") || res.headers.get("request-id");
937
927
  const err = requestError("ApiError", serverErr.message, {
938
928
  statusCode: serverErr.statusCode,
939
- validationErrors: reqErr.validationErrors,
929
+ validationErrors: normalizeValidationErrors(serverErr.validationErrors),
940
930
  method,
941
931
  url: fullUrl,
942
932
  requestId: requestId || void 0
@@ -1125,11 +1115,8 @@ function getBlockLabel(block) {
1125
1115
  function formatBlockValue(block) {
1126
1116
  if (block?.value === null || block?.value === void 0) return "";
1127
1117
  if (block.type === "boolean") return block.value ? "Yes" : "No";
1128
- if (block.type === "number") {
1129
- const properties = isRecord2(block.properties) ? block.properties : {};
1130
- if (properties.variant === "DATE" || properties.variant === "DATE_TIME") {
1131
- return new Date(Number(block.value)).toLocaleDateString();
1132
- }
1118
+ if (block.type === "date") {
1119
+ return new Date(Number(block.value) * 1e3).toLocaleDateString();
1133
1120
  }
1134
1121
  if (block.type === "media" && isRecord2(block.value)) {
1135
1122
  const label = block.value.name ?? block.value.title ?? block.value.id;