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.
- package/dist/{admin-yoFJKZB8.d.ts → admin-CTtJoarO.d.ts} +3 -3
- package/dist/{admin-CBgRGUCX.d.cts → admin-DB_GYW2b.d.cts} +3 -3
- package/dist/admin.cjs +9 -36
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.d.cts +3 -3
- package/dist/admin.d.ts +3 -3
- package/dist/admin.js +9 -36
- package/dist/admin.js.map +1 -1
- package/dist/{api-CuqZQQGv.d.cts → api-C_2AMzmc.d.cts} +0 -4
- package/dist/{api-CuqZQQGv.d.ts → api-C_2AMzmc.d.ts} +0 -4
- package/dist/index.cjs +10 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -37
- package/dist/index.js.map +1 -1
- package/dist/{inventory-DNX8Vg-N.d.ts → inventory-DdgZ5MI_.d.ts} +1 -1
- package/dist/{inventory-DrVRUkE2.d.cts → inventory-DgPpeRWU.d.cts} +1 -1
- package/dist/storefront.cjs +9 -22
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +5 -5
- package/dist/storefront.d.ts +5 -5
- package/dist/storefront.js +9 -22
- package/dist/storefront.js.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +1 -1
package/dist/storefront.d.cts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
-
export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-
|
|
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
|
|
package/dist/storefront.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
-
export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-
|
|
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
|
|
package/dist/storefront.js
CHANGED
|
@@ -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:
|
|
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 === "
|
|
1129
|
-
|
|
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;
|