@01.software/sdk 0.48.0 → 0.49.0
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/CHANGELOG.md +27 -0
- package/README.md +64 -7
- package/dist/client.cjs +189 -26
- 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 +189 -26
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-D3ExJU-7.d.ts → collection-client-DnDt6EQz.d.ts} +4 -4
- package/dist/{collection-client-CBup9yOx.d.cts → collection-client-XfGLPuTf.d.cts} +4 -4
- package/dist/{const-BXEi1Kix.d.cts → const-CBba4lDo.d.cts} +1 -1
- package/dist/{const-k9gHylYa.d.ts → const-DCNV5Kq7.d.ts} +1 -1
- package/dist/errors.cjs +63 -15
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +10 -1
- package/dist/errors.d.ts +10 -1
- package/dist/errors.js +63 -15
- package/dist/errors.js.map +1 -1
- package/dist/{index-BCM9CTL7.d.cts → index-CbKyoEzy.d.cts} +3 -3
- package/dist/{index-CHGGkcLj.d.ts → index-DUuIqUS8.d.ts} +3 -3
- package/dist/index.cjs +152 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +152 -48
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-B6AZQcB7.d.cts → payload-types-MKbx5MuJ.d.cts} +133 -3
- package/dist/{payload-types-B6AZQcB7.d.ts → payload-types-MKbx5MuJ.d.ts} +133 -3
- package/dist/query.cjs +21 -0
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +21 -0
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +189 -26
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +8 -7
- package/dist/server.d.ts +8 -7
- package/dist/server.js +189 -26
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +21 -0
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +21 -0
- package/dist/storefront-cache.js.map +1 -1
- package/dist/{types-DbA5V3mt.d.ts → types-1UeOk1Uy.d.cts} +31 -6
- package/dist/{types-8us-_C-Q.d.cts → types-BKr_2avj.d.cts} +2 -2
- package/dist/{types-CM2je9Kw.d.cts → types-Du4s5anw.d.ts} +31 -6
- package/dist/{types-ByD2zii1.d.ts → types-L_nh-ED7.d.ts} +2 -2
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.ts +4 -4
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { cd as BaseApi, aF as ServerApiOptions, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, ce as ProductDetail, cf as ProductDetailCatalog, cg as StockSnapshotResponse, ch as ProductSelectionMediaSource, ci as ProductDisplayMediaSource, cj as ResolveProductSelectionMediaInput, ck as ResolveProductSelectionMediaResult, cl as ProductSelectionMediaPointer, h as ClientConfig, cm as RootClientWithEvents } from './types-
|
|
2
|
-
export { A as AddItemParams, i as ApiQueryOptions, cn as BulkImportFulfillmentsParams, co as BulkImportFulfillmentsResponse, cp as CalculateShippingParams, cq as CalculateShippingResult, j as CancelBrowserPaymentSessionParams, cr as CancelOrderParams, cs as CancelOrderResponse, ct as CancelReasonCode, cu as CartDiscountCode, k as CartMergeParams, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, cv as CartWarning, cw as CartWarningCode, o as CheckoutAbandonedReason, p as CheckoutAmounts, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, s as CheckoutShippingAddress, t as ClearCartParams, al as Client, u as ClientMetadata, g as ClientState, al as ClientType, cx as Comment, C as CommerceClient, cy as CommerceClientOptions, a as CommunityClient, cz as CommunityClientOptions, cA as CommunityComment, cB as CommunityCommentListSort, cC as CommunityPost, cD as CommunityPostCategory, cE as CommunityPostListSort, cF as CommunityPostTag, cG as CommunityPublicAuthorSnapshot, cH as CommunityPublicMediaAsset, cI as CommunityPublicReference, cJ as CompatibilityProductSelectionParamEvent, b as ContentClient, v as ContentClientOptions, w as CreateCartParams, x as CreateCartResult, y as CreateCheckoutParams, z as CreateCheckoutResult, cK as CreateFulfillmentParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, cL as CreateReturnParams, bY as CustomerAuth, cM as CustomerAuthOptions, b_ as CustomerAuthResponse, cN as CustomerAuthorizationUrlInput, cO as CustomerAuthorizationUrlResult, b$ as CustomerLoginData, d as CustomerMembershipView, c as CustomerNamespace, cP as CustomerOAuth, cQ as CustomerOAuthCallbackResult, cR as CustomerOAuthConfig, cS as CustomerOAuthTokenSet, cT as CustomerOrderListOptions, bZ as CustomerProfile, c2 as CustomerRefreshResponse, c1 as CustomerRegisterData, c0 as CustomerRegisterResponse, F as CustomerSnapshot, G as DebugConfig, H as DeepPartial, cU as DiscountApi, cV as DiscountApiOptions, cW as DiscountErrorReasonCode, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, E as EventsClient, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, I as ExtractArrayType, cX as FeaturedImagePointerInput, cY as GetOrderByPaymentIdParams, cZ as LegacyProductSelectionParamEvent, c_ as ListingGroupsParams, c$ as MAX_CART_LINE_ADMISSIONS, d0 as ManagedPaymentNextAction, d1 as ManagedPublicPaymentSession, d2 as MarketDTO, d3 as MediaValue, J as MembershipStatus, K as Money, d4 as NormalizedOptionSwatch, d5 as NormalizedProductSelection, O as OpenCheckoutPaymentState, d6 as OrderApi, d7 as OrderApiOptions, d8 as OrderByPaymentResult, d9 as PRODUCT_PLP_FIND_OPTIONS, da as PRODUCT_UPSERT_READONLY_FIELD_REASON, db as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, L as PayloadMutationResponse, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, dc as PrepareFulfillmentOrderParams, dd as PrepareFulfillmentOrderResponse, de as ProductApi, df as ProductApiOptions, dg as ProductDetailBrand, c7 as ProductDetailCatalogResult, dh as ProductDetailCatalogVariant, di as ProductDetailCategory, dj as ProductDetailImage, dk as ProductDetailImageMedia, dl as ProductDetailMedia, dm as ProductDetailOption, dn as ProductDetailOptionValue, c6 as ProductDetailParams, dp as ProductDetailResult, dq as ProductDetailTag, dr as ProductDetailUnavailableReason, ds as ProductDetailVariant, dt as ProductDetailVariantOptionValue, du as ProductDetailVideo, dv as ProductFallbackLocaleOption, dw as ProductHrefGroup, dx as ProductHrefOptions, dy as ProductHrefProduct, dz as ProductListingCard, dA as ProductListingCardOptions, dB as ProductListingCardPriceRange, dC as ProductListingCardRepresentativeVariant, dD as ProductListingGroup, dE as ProductListingGroupCatalogSummary, dF as ProductListingGroupCatalogVariant, dG as ProductListingGroupProjection, dH as ProductListingGroupSummary, dI as ProductListingGroupVariant, ca as ProductListingGroupsCatalogItem, dJ as ProductListingGroupsCatalogProduct, dK as ProductListingGroupsCatalogResponse, cc as ProductListingGroupsItem, dL as ProductListingGroupsProduct, dM as ProductListingGroupsResponse, c5 as ProductListingPageBaseParams, c8 as ProductListingPageCatalogParams, dN as ProductListingPageFilters, cb as ProductListingPageFullParams, c4 as ProductListingPageParams, c9 as ProductListingPageResult, dO as ProductListingPageSort, dP as ProductListingProductShape, dQ as ProductListingSwatch, dR as ProductLocaleOption, dS as ProductLocaleReadParams, dT as ProductLocalizedText, dU as ProductLocalizedValue, dV as ProductMediaResolutionSource, dW as ProductMoneyRange, dX as ProductOptionMatrix, dY as ProductOptionMatrixOption, dZ as ProductOptionMatrixValue, d_ as ProductOptionMatrixVariant, d$ as ProductOptionShape, e0 as ProductOptionValueShape, e1 as ProductOptionValueSwatch, e2 as ProductOptionValueSwatchInput, e3 as ProductPriceRange, e4 as ProductSelectionAvailableSwatch, e5 as ProductSelectionAvailableValue, e6 as ProductSelectionByOptionValue, e7 as ProductSelectionCodecError, e8 as ProductSelectionCodecOptions, e9 as ProductSelectionInput, ea as ProductSelectionOptionValue, eb as ProductSelectionResolution, ec as ProductSelectionResolutionContext, ed as ProductSelectionUrlEmit, ee as ProductSelectionVariant, ef as ProductUpsertFieldValidationErrorBody, eg as ProductUpsertFieldValidationErrorReason, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, eh as ProductVariantShape, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, ei as PublicCheckoutBase, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, bX as PublicReadQueryOptions, af as ReconciliationRequired, ag as RemoveItemParams, ej as RequestOptions, ek as ResolveCancelRefundFailedResponse, el as ResolveCancelRefundOutcome, em as ResolveCancelRefundParams, en as ResolveCancelRefundResponse, eo as ResolveCancelRefundSucceededResponse, ep as ResolveProductDisplayMediaInput, eq as ResolveProductDisplayMediaResult, er as ResolvedCatalogPrice, ah as RetrieveBrowserPaymentSessionParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bA as RetrieveServerCheckoutParams, ak as RetryConfig, es as ReturnCancellationReasonCode, et as ReturnItem, eu as ReturnReason, ev as ReturnWithRefundItem, ew as ReturnWithRefundParams, al as RootClient, am as RootCollectionClient, an as RootReadOnlyQueryBuilder, ex as ShippingApi, ey as ShippingApiOptions, ao as ShippingLine, ap as Sort, aq as SpentCheckoutPaymentState, ez as StockCheckParams, eA as StockCheckResponse, eB as StockCheckResult, eC as StockSnapshotItem, eD as StockSnapshotParams, ar as StorefrontContentListOptions, as as StorefrontContentReference, at as StorefrontGalleryItem, au as StorefrontGalleryItemsListOptions, av as StorefrontGalleryItemsSort, aw as StorefrontLink, ax as StorefrontLinksListOptions, ay as StorefrontLinksSort, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, eE as UpdateFulfillmentParams, aB as UpdateItemParams, eF as UpdateOrderParams, c3 as UpdateProfileData, eG as UpdateReturnParams, eH as ValidateDiscountParams, eI as ValidateDiscountResult, aC as VariantInput, aD as Where, eJ as WithIdempotencyKey, eK as buildProductHref, eL as buildProductListingCard, eM as buildProductListingGroupProjection, eN as buildProductListingGroupsByOption, eO as buildProductOptionMatrix, eP as buildProductOptionMatrixFromDetail, eQ as createProductSelectionCodec, eR as getAvailableOptionValues, eS as getProductSelectionImages, eT as getSelectedValueByOptionId, eU as getVariantAvailableForSale, eV as getVariantAvailableStock, eW as isProductUpsertFieldValidationErrorBody, eX as normalizeProductSelection, eY as normalizeProductSelectionFromMatrix, eZ as normalizeSelectedValueIds, e_ as parseProductSelection, e$ as projectProductToListingShape, f0 as resolveFeaturedImagePointer, f1 as resolveProductDisplayMedia, f2 as resolveProductSelection, f3 as resolveProductSelectionFromMatrix, f4 as resolveProductSelectionMedia, f5 as resolveVariantForSelection, f6 as selectNext, f7 as selectedSwatchMediaItemId, f8 as stringifyProductSelection, f9 as toShopifyPriceRangeV2 } from './types-
|
|
3
|
-
import { P as Product } from './payload-types-
|
|
4
|
-
export { A as Article, f as ArticleAuthor, g as ArticleCategory, h as ArticleTag, D as Document, I as Image, i as Post, j as PostCategory, T as Tenant, V as Video } from './payload-types-
|
|
5
|
-
export { C as CollectionType, P as Market, a as Product, b as ProductCollection, c as ProductVariant } from './types-
|
|
6
|
-
export { C as COMMERCE_NOTIFICATION_EVENTS, a as COMMERCE_NOTIFICATION_EVENT_TYPE, b as COMMERCE_NOTIFICATION_OPERATION, c as CUSTOMER_PASSWORD_RESET_OPERATION, d as CollectionWebhookOperation, e as CommerceEmailChannel, f as CommerceEmailConfig, g as CommerceEmailEventConfig, h as CommerceEmailEventHandlers, i as CommerceEmailHandlerContext, j as CommerceNotification, k as CommerceNotificationData, l as CommerceNotificationEventHandlers, m as CommerceNotificationEventName, n as CommerceNotificationHandlerContext, o as CommerceNotificationSource, p as CommerceNotificationSourceCollection, q as CommerceNotificationWebhookEvent, r as CustomerAuthWebhookEvent, s as CustomerAuthWebhookHandlers, t as CustomerPasswordResetWebhookData, u as CustomerPasswordResetWebhookEvent, O as ORDER_CHANGED_EVENT_TYPE, v as OrderChangedWebhookEvent, W as WebhookChange, w as WebhookCommerceNotificationChange, x as WebhookEvent, y as WebhookHandler, z as WebhookKnownOperation, A as WebhookOperation, B as WebhookOptions, D as WebhookOrderChange, E as WebhookOrderMoved, F as WebhookOrderScope, G as createCommerceEmailWebhookHandler, H as createCommerceNotificationWebhookHandler, I as createCustomerAuthWebhookHandler, J as createTypedWebhookHandler, K as defineCommerceEmailConfig, L as getCommerceNotificationIdempotencyKey, M as handleWebhook, N as isCommerceNotificationWebhookEvent, P as isCustomerPasswordResetWebhookEvent, Q as isOrderChangedWebhookEvent, R as isValidWebhookEvent, S as isWebhookCollection, T as isWebhookOperation } from './index-
|
|
7
|
-
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS, P as PublicCollection, b as SERVER_COLLECTIONS, c as SERVER_ONLY_COLLECTIONS } from './const-
|
|
1
|
+
import { cd as BaseApi, aF as ServerApiOptions, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, ce as ProductDetail, cf as ProductDetailCatalog, cg as StockSnapshotResponse, ch as ProductSelectionMediaSource, ci as ProductDisplayMediaSource, cj as ResolveProductSelectionMediaInput, ck as ResolveProductSelectionMediaResult, cl as ProductSelectionMediaPointer, h as ClientConfig, cm as RootClientWithEvents } from './types-1UeOk1Uy.cjs';
|
|
2
|
+
export { A as AddItemParams, i as ApiQueryOptions, cn as BulkImportFulfillmentsParams, co as BulkImportFulfillmentsResponse, cp as CalculateShippingParams, cq as CalculateShippingResult, j as CancelBrowserPaymentSessionParams, cr as CancelOrderParams, cs as CancelOrderResponse, ct as CancelReasonCode, cu as CartDiscountCode, k as CartMergeParams, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, cv as CartWarning, cw as CartWarningCode, o as CheckoutAbandonedReason, p as CheckoutAmounts, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, s as CheckoutShippingAddress, t as ClearCartParams, al as Client, u as ClientMetadata, g as ClientState, al as ClientType, cx as Comment, C as CommerceClient, cy as CommerceClientOptions, a as CommunityClient, cz as CommunityClientOptions, cA as CommunityComment, cB as CommunityCommentListSort, cC as CommunityPost, cD as CommunityPostCategory, cE as CommunityPostListSort, cF as CommunityPostTag, cG as CommunityPublicAuthorSnapshot, cH as CommunityPublicMediaAsset, cI as CommunityPublicReference, cJ as CompatibilityProductSelectionParamEvent, b as ContentClient, v as ContentClientOptions, w as CreateCartParams, x as CreateCartResult, y as CreateCheckoutParams, z as CreateCheckoutResult, cK as CreateFulfillmentParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, cL as CreateReturnParams, bY as CustomerAuth, cM as CustomerAuthOptions, b_ as CustomerAuthResponse, cN as CustomerAuthorizationUrlInput, cO as CustomerAuthorizationUrlResult, b$ as CustomerLoginData, d as CustomerMembershipView, c as CustomerNamespace, cP as CustomerOAuth, cQ as CustomerOAuthCallbackResult, cR as CustomerOAuthConfig, cS as CustomerOAuthTokenSet, cT as CustomerOrderListOptions, bZ as CustomerProfile, c2 as CustomerRefreshResponse, c1 as CustomerRegisterData, c0 as CustomerRegisterResponse, F as CustomerSnapshot, G as DebugConfig, H as DeepPartial, cU as DiscountApi, cV as DiscountApiOptions, cW as DiscountErrorReasonCode, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, E as EventsClient, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, I as ExtractArrayType, cX as FeaturedImagePointerInput, cY as GetOrderByPaymentIdParams, cZ as LegacyProductSelectionParamEvent, c_ as ListingGroupsParams, c$ as MAX_CART_LINE_ADMISSIONS, d0 as ManagedPaymentNextAction, d1 as ManagedPublicPaymentSession, d2 as MarketDTO, d3 as MediaValue, J as MembershipStatus, K as Money, d4 as NormalizedOptionSwatch, d5 as NormalizedProductSelection, O as OpenCheckoutPaymentState, d6 as OrderApi, d7 as OrderApiOptions, d8 as OrderByPaymentResult, d9 as PRODUCT_PLP_FIND_OPTIONS, da as PRODUCT_UPSERT_READONLY_FIELD_REASON, db as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, L as PayloadMutationResponse, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, dc as PrepareFulfillmentOrderParams, dd as PrepareFulfillmentOrderResponse, de as ProductApi, df as ProductApiOptions, dg as ProductDetailBrand, c7 as ProductDetailCatalogResult, dh as ProductDetailCatalogVariant, di as ProductDetailCategory, dj as ProductDetailImage, dk as ProductDetailImageMedia, dl as ProductDetailMedia, dm as ProductDetailOption, dn as ProductDetailOptionValue, c6 as ProductDetailParams, dp as ProductDetailResult, dq as ProductDetailTag, dr as ProductDetailUnavailableReason, ds as ProductDetailVariant, dt as ProductDetailVariantOptionValue, du as ProductDetailVideo, dv as ProductFallbackLocaleOption, dw as ProductHrefGroup, dx as ProductHrefOptions, dy as ProductHrefProduct, dz as ProductListingCard, dA as ProductListingCardOptions, dB as ProductListingCardPriceRange, dC as ProductListingCardRepresentativeVariant, dD as ProductListingGroup, dE as ProductListingGroupCatalogSummary, dF as ProductListingGroupCatalogVariant, dG as ProductListingGroupProjection, dH as ProductListingGroupSummary, dI as ProductListingGroupVariant, ca as ProductListingGroupsCatalogItem, dJ as ProductListingGroupsCatalogProduct, dK as ProductListingGroupsCatalogResponse, cc as ProductListingGroupsItem, dL as ProductListingGroupsProduct, dM as ProductListingGroupsResponse, c5 as ProductListingPageBaseParams, c8 as ProductListingPageCatalogParams, dN as ProductListingPageFilters, cb as ProductListingPageFullParams, c4 as ProductListingPageParams, c9 as ProductListingPageResult, dO as ProductListingPageSort, dP as ProductListingProductShape, dQ as ProductListingSwatch, dR as ProductLocaleOption, dS as ProductLocaleReadParams, dT as ProductLocalizedText, dU as ProductLocalizedValue, dV as ProductMediaResolutionSource, dW as ProductMoneyRange, dX as ProductOptionMatrix, dY as ProductOptionMatrixOption, dZ as ProductOptionMatrixValue, d_ as ProductOptionMatrixVariant, d$ as ProductOptionShape, e0 as ProductOptionValueShape, e1 as ProductOptionValueSwatch, e2 as ProductOptionValueSwatchInput, e3 as ProductPriceRange, e4 as ProductSelectionAvailableSwatch, e5 as ProductSelectionAvailableValue, e6 as ProductSelectionByOptionValue, e7 as ProductSelectionCodecError, e8 as ProductSelectionCodecOptions, e9 as ProductSelectionInput, ea as ProductSelectionOptionValue, eb as ProductSelectionResolution, ec as ProductSelectionResolutionContext, ed as ProductSelectionUrlEmit, ee as ProductSelectionVariant, ef as ProductUpsertFieldValidationErrorBody, eg as ProductUpsertFieldValidationErrorReason, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, eh as ProductVariantShape, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, ei as PublicCheckoutBase, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, bX as PublicReadQueryOptions, af as ReconciliationRequired, ag as RemoveItemParams, ej as RequestOptions, ek as ResolveCancelRefundFailedResponse, el as ResolveCancelRefundOutcome, em as ResolveCancelRefundParams, en as ResolveCancelRefundResponse, eo as ResolveCancelRefundSucceededResponse, ep as ResolveProductDisplayMediaInput, eq as ResolveProductDisplayMediaResult, er as ResolvedCatalogPrice, ah as RetrieveBrowserPaymentSessionParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bA as RetrieveServerCheckoutParams, ak as RetryConfig, es as ReturnCancellationReasonCode, et as ReturnItem, eu as ReturnReason, ev as ReturnWithRefundItem, ew as ReturnWithRefundParams, al as RootClient, am as RootCollectionClient, an as RootReadOnlyQueryBuilder, ex as ShippingApi, ey as ShippingApiOptions, ao as ShippingLine, ap as Sort, aq as SpentCheckoutPaymentState, ez as StockCheckParams, eA as StockCheckResponse, eB as StockCheckResult, eC as StockSnapshotItem, eD as StockSnapshotParams, ar as StorefrontContentListOptions, as as StorefrontContentReference, at as StorefrontGalleryItem, au as StorefrontGalleryItemsListOptions, av as StorefrontGalleryItemsSort, aw as StorefrontLink, ax as StorefrontLinksListOptions, ay as StorefrontLinksSort, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, eE as UpdateFulfillmentParams, aB as UpdateItemParams, eF as UpdateOrderParams, c3 as UpdateProfileData, eG as UpdateReturnParams, eH as ValidateDiscountParams, eI as ValidateDiscountResult, aC as VariantInput, aD as Where, eJ as WithIdempotencyKey, eK as buildProductHref, eL as buildProductListingCard, eM as buildProductListingGroupProjection, eN as buildProductListingGroupsByOption, eO as buildProductOptionMatrix, eP as buildProductOptionMatrixFromDetail, eQ as createProductSelectionCodec, eR as getAvailableOptionValues, eS as getProductSelectionImages, eT as getSelectedValueByOptionId, eU as getVariantAvailableForSale, eV as getVariantAvailableStock, eW as isProductUpsertFieldValidationErrorBody, eX as normalizeProductSelection, eY as normalizeProductSelectionFromMatrix, eZ as normalizeSelectedValueIds, e_ as parseProductSelection, e$ as projectProductToListingShape, f0 as resolveFeaturedImagePointer, f1 as resolveProductDisplayMedia, f2 as resolveProductSelection, f3 as resolveProductSelectionFromMatrix, f4 as resolveProductSelectionMedia, f5 as resolveVariantForSelection, f6 as selectNext, f7 as selectedSwatchMediaItemId, f8 as stringifyProductSelection, f9 as toShopifyPriceRangeV2 } from './types-1UeOk1Uy.cjs';
|
|
3
|
+
import { P as Product } from './payload-types-MKbx5MuJ.cjs';
|
|
4
|
+
export { A as Article, f as ArticleAuthor, g as ArticleCategory, h as ArticleTag, D as Document, I as Image, i as Post, j as PostCategory, T as Tenant, V as Video } from './payload-types-MKbx5MuJ.cjs';
|
|
5
|
+
export { C as CollectionType, P as Market, a as Product, b as ProductCollection, c as ProductVariant } from './types-BKr_2avj.cjs';
|
|
6
|
+
export { C as COMMERCE_NOTIFICATION_EVENTS, a as COMMERCE_NOTIFICATION_EVENT_TYPE, b as COMMERCE_NOTIFICATION_OPERATION, c as CUSTOMER_PASSWORD_RESET_OPERATION, d as CollectionWebhookOperation, e as CommerceEmailChannel, f as CommerceEmailConfig, g as CommerceEmailEventConfig, h as CommerceEmailEventHandlers, i as CommerceEmailHandlerContext, j as CommerceNotification, k as CommerceNotificationData, l as CommerceNotificationEventHandlers, m as CommerceNotificationEventName, n as CommerceNotificationHandlerContext, o as CommerceNotificationSource, p as CommerceNotificationSourceCollection, q as CommerceNotificationWebhookEvent, r as CustomerAuthWebhookEvent, s as CustomerAuthWebhookHandlers, t as CustomerPasswordResetWebhookData, u as CustomerPasswordResetWebhookEvent, O as ORDER_CHANGED_EVENT_TYPE, v as OrderChangedWebhookEvent, W as WebhookChange, w as WebhookCommerceNotificationChange, x as WebhookEvent, y as WebhookHandler, z as WebhookKnownOperation, A as WebhookOperation, B as WebhookOptions, D as WebhookOrderChange, E as WebhookOrderMoved, F as WebhookOrderScope, G as createCommerceEmailWebhookHandler, H as createCommerceNotificationWebhookHandler, I as createCustomerAuthWebhookHandler, J as createTypedWebhookHandler, K as defineCommerceEmailConfig, L as getCommerceNotificationIdempotencyKey, M as handleWebhook, N as isCommerceNotificationWebhookEvent, P as isCustomerPasswordResetWebhookEvent, Q as isOrderChangedWebhookEvent, R as isValidWebhookEvent, S as isWebhookCollection, T as isWebhookOperation } from './index-CbKyoEzy.cjs';
|
|
7
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS, P as PublicCollection, b as SERVER_COLLECTIONS, c as SERVER_ONLY_COLLECTIONS } from './const-CBba4lDo.cjs';
|
|
8
8
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
9
9
|
export { a as IMAGE_SIZES, I as ImageData, b as ImageDataSizeEntry, c as ImageDataSizes, d as ImagePalette, e as ImagePlaceholderOptions, g as getImageLqip, f as getImagePalette, h as getImagePlaceholderStyle, i as getImageSrcSet, j as getImageUrl } from './image-BDjHp03R.cjs';
|
|
10
10
|
export { V as VideoGifOptions, a as VideoThumbnailOptions, g as getVideoGif, b as getVideoMp4Url, c as getVideoStoryboard, d as getVideoStreamUrl, e as getVideoThumbnail } from './video-WR_TFO9a.cjs';
|
|
11
11
|
export { Analytics, AnalyticsConfig, createAnalytics } from './analytics.cjs';
|
|
12
|
-
export { ApiError, AuthError, COMMERCE_ERROR_CODES, CommerceErrorCode, CommerceSDKError, ConfigError, ConflictError, GoneError, NetworkError, NotFoundError, PermissionError, RateLimitError, SDKError, ServiceUnavailableError, TimeoutError, UsageLimitError, ValidationError, createAuthError, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.cjs';
|
|
12
|
+
export { ApiError, AuthError, COMMERCE_ERROR_CODES, CommerceErrorCode, CommerceSDKError, ConfigError, ConflictError, GoneError, NetworkError, NotFoundError, PermissionError, RateLimitError, SDKError, ServiceUnavailableError, TimeoutError, UsageLimitError, ValidationError, createAuthError, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, getSDKErrorReason, isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.cjs';
|
|
13
13
|
|
|
14
14
|
declare function isCommerceIdempotencyKey(value: unknown): value is string;
|
|
15
15
|
declare function assertCommerceIdempotencyKey(value: unknown): asserts value is string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { cd as BaseApi, aF as ServerApiOptions, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, ce as ProductDetail, cf as ProductDetailCatalog, cg as StockSnapshotResponse, ch as ProductSelectionMediaSource, ci as ProductDisplayMediaSource, cj as ResolveProductSelectionMediaInput, ck as ResolveProductSelectionMediaResult, cl as ProductSelectionMediaPointer, h as ClientConfig, cm as RootClientWithEvents } from './types-
|
|
2
|
-
export { A as AddItemParams, i as ApiQueryOptions, cn as BulkImportFulfillmentsParams, co as BulkImportFulfillmentsResponse, cp as CalculateShippingParams, cq as CalculateShippingResult, j as CancelBrowserPaymentSessionParams, cr as CancelOrderParams, cs as CancelOrderResponse, ct as CancelReasonCode, cu as CartDiscountCode, k as CartMergeParams, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, cv as CartWarning, cw as CartWarningCode, o as CheckoutAbandonedReason, p as CheckoutAmounts, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, s as CheckoutShippingAddress, t as ClearCartParams, al as Client, u as ClientMetadata, g as ClientState, al as ClientType, cx as Comment, C as CommerceClient, cy as CommerceClientOptions, a as CommunityClient, cz as CommunityClientOptions, cA as CommunityComment, cB as CommunityCommentListSort, cC as CommunityPost, cD as CommunityPostCategory, cE as CommunityPostListSort, cF as CommunityPostTag, cG as CommunityPublicAuthorSnapshot, cH as CommunityPublicMediaAsset, cI as CommunityPublicReference, cJ as CompatibilityProductSelectionParamEvent, b as ContentClient, v as ContentClientOptions, w as CreateCartParams, x as CreateCartResult, y as CreateCheckoutParams, z as CreateCheckoutResult, cK as CreateFulfillmentParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, cL as CreateReturnParams, bY as CustomerAuth, cM as CustomerAuthOptions, b_ as CustomerAuthResponse, cN as CustomerAuthorizationUrlInput, cO as CustomerAuthorizationUrlResult, b$ as CustomerLoginData, d as CustomerMembershipView, c as CustomerNamespace, cP as CustomerOAuth, cQ as CustomerOAuthCallbackResult, cR as CustomerOAuthConfig, cS as CustomerOAuthTokenSet, cT as CustomerOrderListOptions, bZ as CustomerProfile, c2 as CustomerRefreshResponse, c1 as CustomerRegisterData, c0 as CustomerRegisterResponse, F as CustomerSnapshot, G as DebugConfig, H as DeepPartial, cU as DiscountApi, cV as DiscountApiOptions, cW as DiscountErrorReasonCode, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, E as EventsClient, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, I as ExtractArrayType, cX as FeaturedImagePointerInput, cY as GetOrderByPaymentIdParams, cZ as LegacyProductSelectionParamEvent, c_ as ListingGroupsParams, c$ as MAX_CART_LINE_ADMISSIONS, d0 as ManagedPaymentNextAction, d1 as ManagedPublicPaymentSession, d2 as MarketDTO, d3 as MediaValue, J as MembershipStatus, K as Money, d4 as NormalizedOptionSwatch, d5 as NormalizedProductSelection, O as OpenCheckoutPaymentState, d6 as OrderApi, d7 as OrderApiOptions, d8 as OrderByPaymentResult, d9 as PRODUCT_PLP_FIND_OPTIONS, da as PRODUCT_UPSERT_READONLY_FIELD_REASON, db as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, L as PayloadMutationResponse, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, dc as PrepareFulfillmentOrderParams, dd as PrepareFulfillmentOrderResponse, de as ProductApi, df as ProductApiOptions, dg as ProductDetailBrand, c7 as ProductDetailCatalogResult, dh as ProductDetailCatalogVariant, di as ProductDetailCategory, dj as ProductDetailImage, dk as ProductDetailImageMedia, dl as ProductDetailMedia, dm as ProductDetailOption, dn as ProductDetailOptionValue, c6 as ProductDetailParams, dp as ProductDetailResult, dq as ProductDetailTag, dr as ProductDetailUnavailableReason, ds as ProductDetailVariant, dt as ProductDetailVariantOptionValue, du as ProductDetailVideo, dv as ProductFallbackLocaleOption, dw as ProductHrefGroup, dx as ProductHrefOptions, dy as ProductHrefProduct, dz as ProductListingCard, dA as ProductListingCardOptions, dB as ProductListingCardPriceRange, dC as ProductListingCardRepresentativeVariant, dD as ProductListingGroup, dE as ProductListingGroupCatalogSummary, dF as ProductListingGroupCatalogVariant, dG as ProductListingGroupProjection, dH as ProductListingGroupSummary, dI as ProductListingGroupVariant, ca as ProductListingGroupsCatalogItem, dJ as ProductListingGroupsCatalogProduct, dK as ProductListingGroupsCatalogResponse, cc as ProductListingGroupsItem, dL as ProductListingGroupsProduct, dM as ProductListingGroupsResponse, c5 as ProductListingPageBaseParams, c8 as ProductListingPageCatalogParams, dN as ProductListingPageFilters, cb as ProductListingPageFullParams, c4 as ProductListingPageParams, c9 as ProductListingPageResult, dO as ProductListingPageSort, dP as ProductListingProductShape, dQ as ProductListingSwatch, dR as ProductLocaleOption, dS as ProductLocaleReadParams, dT as ProductLocalizedText, dU as ProductLocalizedValue, dV as ProductMediaResolutionSource, dW as ProductMoneyRange, dX as ProductOptionMatrix, dY as ProductOptionMatrixOption, dZ as ProductOptionMatrixValue, d_ as ProductOptionMatrixVariant, d$ as ProductOptionShape, e0 as ProductOptionValueShape, e1 as ProductOptionValueSwatch, e2 as ProductOptionValueSwatchInput, e3 as ProductPriceRange, e4 as ProductSelectionAvailableSwatch, e5 as ProductSelectionAvailableValue, e6 as ProductSelectionByOptionValue, e7 as ProductSelectionCodecError, e8 as ProductSelectionCodecOptions, e9 as ProductSelectionInput, ea as ProductSelectionOptionValue, eb as ProductSelectionResolution, ec as ProductSelectionResolutionContext, ed as ProductSelectionUrlEmit, ee as ProductSelectionVariant, ef as ProductUpsertFieldValidationErrorBody, eg as ProductUpsertFieldValidationErrorReason, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, eh as ProductVariantShape, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, ei as PublicCheckoutBase, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, bX as PublicReadQueryOptions, af as ReconciliationRequired, ag as RemoveItemParams, ej as RequestOptions, ek as ResolveCancelRefundFailedResponse, el as ResolveCancelRefundOutcome, em as ResolveCancelRefundParams, en as ResolveCancelRefundResponse, eo as ResolveCancelRefundSucceededResponse, ep as ResolveProductDisplayMediaInput, eq as ResolveProductDisplayMediaResult, er as ResolvedCatalogPrice, ah as RetrieveBrowserPaymentSessionParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bA as RetrieveServerCheckoutParams, ak as RetryConfig, es as ReturnCancellationReasonCode, et as ReturnItem, eu as ReturnReason, ev as ReturnWithRefundItem, ew as ReturnWithRefundParams, al as RootClient, am as RootCollectionClient, an as RootReadOnlyQueryBuilder, ex as ShippingApi, ey as ShippingApiOptions, ao as ShippingLine, ap as Sort, aq as SpentCheckoutPaymentState, ez as StockCheckParams, eA as StockCheckResponse, eB as StockCheckResult, eC as StockSnapshotItem, eD as StockSnapshotParams, ar as StorefrontContentListOptions, as as StorefrontContentReference, at as StorefrontGalleryItem, au as StorefrontGalleryItemsListOptions, av as StorefrontGalleryItemsSort, aw as StorefrontLink, ax as StorefrontLinksListOptions, ay as StorefrontLinksSort, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, eE as UpdateFulfillmentParams, aB as UpdateItemParams, eF as UpdateOrderParams, c3 as UpdateProfileData, eG as UpdateReturnParams, eH as ValidateDiscountParams, eI as ValidateDiscountResult, aC as VariantInput, aD as Where, eJ as WithIdempotencyKey, eK as buildProductHref, eL as buildProductListingCard, eM as buildProductListingGroupProjection, eN as buildProductListingGroupsByOption, eO as buildProductOptionMatrix, eP as buildProductOptionMatrixFromDetail, eQ as createProductSelectionCodec, eR as getAvailableOptionValues, eS as getProductSelectionImages, eT as getSelectedValueByOptionId, eU as getVariantAvailableForSale, eV as getVariantAvailableStock, eW as isProductUpsertFieldValidationErrorBody, eX as normalizeProductSelection, eY as normalizeProductSelectionFromMatrix, eZ as normalizeSelectedValueIds, e_ as parseProductSelection, e$ as projectProductToListingShape, f0 as resolveFeaturedImagePointer, f1 as resolveProductDisplayMedia, f2 as resolveProductSelection, f3 as resolveProductSelectionFromMatrix, f4 as resolveProductSelectionMedia, f5 as resolveVariantForSelection, f6 as selectNext, f7 as selectedSwatchMediaItemId, f8 as stringifyProductSelection, f9 as toShopifyPriceRangeV2 } from './types-
|
|
3
|
-
import { P as Product } from './payload-types-
|
|
4
|
-
export { A as Article, f as ArticleAuthor, g as ArticleCategory, h as ArticleTag, D as Document, I as Image, i as Post, j as PostCategory, T as Tenant, V as Video } from './payload-types-
|
|
5
|
-
export { C as CollectionType, P as Market, a as Product, b as ProductCollection, c as ProductVariant } from './types-
|
|
6
|
-
export { C as COMMERCE_NOTIFICATION_EVENTS, a as COMMERCE_NOTIFICATION_EVENT_TYPE, b as COMMERCE_NOTIFICATION_OPERATION, c as CUSTOMER_PASSWORD_RESET_OPERATION, d as CollectionWebhookOperation, e as CommerceEmailChannel, f as CommerceEmailConfig, g as CommerceEmailEventConfig, h as CommerceEmailEventHandlers, i as CommerceEmailHandlerContext, j as CommerceNotification, k as CommerceNotificationData, l as CommerceNotificationEventHandlers, m as CommerceNotificationEventName, n as CommerceNotificationHandlerContext, o as CommerceNotificationSource, p as CommerceNotificationSourceCollection, q as CommerceNotificationWebhookEvent, r as CustomerAuthWebhookEvent, s as CustomerAuthWebhookHandlers, t as CustomerPasswordResetWebhookData, u as CustomerPasswordResetWebhookEvent, O as ORDER_CHANGED_EVENT_TYPE, v as OrderChangedWebhookEvent, W as WebhookChange, w as WebhookCommerceNotificationChange, x as WebhookEvent, y as WebhookHandler, z as WebhookKnownOperation, A as WebhookOperation, B as WebhookOptions, D as WebhookOrderChange, E as WebhookOrderMoved, F as WebhookOrderScope, G as createCommerceEmailWebhookHandler, H as createCommerceNotificationWebhookHandler, I as createCustomerAuthWebhookHandler, J as createTypedWebhookHandler, K as defineCommerceEmailConfig, L as getCommerceNotificationIdempotencyKey, M as handleWebhook, N as isCommerceNotificationWebhookEvent, P as isCustomerPasswordResetWebhookEvent, Q as isOrderChangedWebhookEvent, R as isValidWebhookEvent, S as isWebhookCollection, T as isWebhookOperation } from './index-
|
|
7
|
-
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS, P as PublicCollection, b as SERVER_COLLECTIONS, c as SERVER_ONLY_COLLECTIONS } from './const-
|
|
1
|
+
import { cd as BaseApi, aF as ServerApiOptions, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, ce as ProductDetail, cf as ProductDetailCatalog, cg as StockSnapshotResponse, ch as ProductSelectionMediaSource, ci as ProductDisplayMediaSource, cj as ResolveProductSelectionMediaInput, ck as ResolveProductSelectionMediaResult, cl as ProductSelectionMediaPointer, h as ClientConfig, cm as RootClientWithEvents } from './types-Du4s5anw.js';
|
|
2
|
+
export { A as AddItemParams, i as ApiQueryOptions, cn as BulkImportFulfillmentsParams, co as BulkImportFulfillmentsResponse, cp as CalculateShippingParams, cq as CalculateShippingResult, j as CancelBrowserPaymentSessionParams, cr as CancelOrderParams, cs as CancelOrderResponse, ct as CancelReasonCode, cu as CartDiscountCode, k as CartMergeParams, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, cv as CartWarning, cw as CartWarningCode, o as CheckoutAbandonedReason, p as CheckoutAmounts, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, s as CheckoutShippingAddress, t as ClearCartParams, al as Client, u as ClientMetadata, g as ClientState, al as ClientType, cx as Comment, C as CommerceClient, cy as CommerceClientOptions, a as CommunityClient, cz as CommunityClientOptions, cA as CommunityComment, cB as CommunityCommentListSort, cC as CommunityPost, cD as CommunityPostCategory, cE as CommunityPostListSort, cF as CommunityPostTag, cG as CommunityPublicAuthorSnapshot, cH as CommunityPublicMediaAsset, cI as CommunityPublicReference, cJ as CompatibilityProductSelectionParamEvent, b as ContentClient, v as ContentClientOptions, w as CreateCartParams, x as CreateCartResult, y as CreateCheckoutParams, z as CreateCheckoutResult, cK as CreateFulfillmentParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, cL as CreateReturnParams, bY as CustomerAuth, cM as CustomerAuthOptions, b_ as CustomerAuthResponse, cN as CustomerAuthorizationUrlInput, cO as CustomerAuthorizationUrlResult, b$ as CustomerLoginData, d as CustomerMembershipView, c as CustomerNamespace, cP as CustomerOAuth, cQ as CustomerOAuthCallbackResult, cR as CustomerOAuthConfig, cS as CustomerOAuthTokenSet, cT as CustomerOrderListOptions, bZ as CustomerProfile, c2 as CustomerRefreshResponse, c1 as CustomerRegisterData, c0 as CustomerRegisterResponse, F as CustomerSnapshot, G as DebugConfig, H as DeepPartial, cU as DiscountApi, cV as DiscountApiOptions, cW as DiscountErrorReasonCode, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, E as EventsClient, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, I as ExtractArrayType, cX as FeaturedImagePointerInput, cY as GetOrderByPaymentIdParams, cZ as LegacyProductSelectionParamEvent, c_ as ListingGroupsParams, c$ as MAX_CART_LINE_ADMISSIONS, d0 as ManagedPaymentNextAction, d1 as ManagedPublicPaymentSession, d2 as MarketDTO, d3 as MediaValue, J as MembershipStatus, K as Money, d4 as NormalizedOptionSwatch, d5 as NormalizedProductSelection, O as OpenCheckoutPaymentState, d6 as OrderApi, d7 as OrderApiOptions, d8 as OrderByPaymentResult, d9 as PRODUCT_PLP_FIND_OPTIONS, da as PRODUCT_UPSERT_READONLY_FIELD_REASON, db as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, L as PayloadMutationResponse, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, dc as PrepareFulfillmentOrderParams, dd as PrepareFulfillmentOrderResponse, de as ProductApi, df as ProductApiOptions, dg as ProductDetailBrand, c7 as ProductDetailCatalogResult, dh as ProductDetailCatalogVariant, di as ProductDetailCategory, dj as ProductDetailImage, dk as ProductDetailImageMedia, dl as ProductDetailMedia, dm as ProductDetailOption, dn as ProductDetailOptionValue, c6 as ProductDetailParams, dp as ProductDetailResult, dq as ProductDetailTag, dr as ProductDetailUnavailableReason, ds as ProductDetailVariant, dt as ProductDetailVariantOptionValue, du as ProductDetailVideo, dv as ProductFallbackLocaleOption, dw as ProductHrefGroup, dx as ProductHrefOptions, dy as ProductHrefProduct, dz as ProductListingCard, dA as ProductListingCardOptions, dB as ProductListingCardPriceRange, dC as ProductListingCardRepresentativeVariant, dD as ProductListingGroup, dE as ProductListingGroupCatalogSummary, dF as ProductListingGroupCatalogVariant, dG as ProductListingGroupProjection, dH as ProductListingGroupSummary, dI as ProductListingGroupVariant, ca as ProductListingGroupsCatalogItem, dJ as ProductListingGroupsCatalogProduct, dK as ProductListingGroupsCatalogResponse, cc as ProductListingGroupsItem, dL as ProductListingGroupsProduct, dM as ProductListingGroupsResponse, c5 as ProductListingPageBaseParams, c8 as ProductListingPageCatalogParams, dN as ProductListingPageFilters, cb as ProductListingPageFullParams, c4 as ProductListingPageParams, c9 as ProductListingPageResult, dO as ProductListingPageSort, dP as ProductListingProductShape, dQ as ProductListingSwatch, dR as ProductLocaleOption, dS as ProductLocaleReadParams, dT as ProductLocalizedText, dU as ProductLocalizedValue, dV as ProductMediaResolutionSource, dW as ProductMoneyRange, dX as ProductOptionMatrix, dY as ProductOptionMatrixOption, dZ as ProductOptionMatrixValue, d_ as ProductOptionMatrixVariant, d$ as ProductOptionShape, e0 as ProductOptionValueShape, e1 as ProductOptionValueSwatch, e2 as ProductOptionValueSwatchInput, e3 as ProductPriceRange, e4 as ProductSelectionAvailableSwatch, e5 as ProductSelectionAvailableValue, e6 as ProductSelectionByOptionValue, e7 as ProductSelectionCodecError, e8 as ProductSelectionCodecOptions, e9 as ProductSelectionInput, ea as ProductSelectionOptionValue, eb as ProductSelectionResolution, ec as ProductSelectionResolutionContext, ed as ProductSelectionUrlEmit, ee as ProductSelectionVariant, ef as ProductUpsertFieldValidationErrorBody, eg as ProductUpsertFieldValidationErrorReason, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, eh as ProductVariantShape, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, ei as PublicCheckoutBase, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, bX as PublicReadQueryOptions, af as ReconciliationRequired, ag as RemoveItemParams, ej as RequestOptions, ek as ResolveCancelRefundFailedResponse, el as ResolveCancelRefundOutcome, em as ResolveCancelRefundParams, en as ResolveCancelRefundResponse, eo as ResolveCancelRefundSucceededResponse, ep as ResolveProductDisplayMediaInput, eq as ResolveProductDisplayMediaResult, er as ResolvedCatalogPrice, ah as RetrieveBrowserPaymentSessionParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bA as RetrieveServerCheckoutParams, ak as RetryConfig, es as ReturnCancellationReasonCode, et as ReturnItem, eu as ReturnReason, ev as ReturnWithRefundItem, ew as ReturnWithRefundParams, al as RootClient, am as RootCollectionClient, an as RootReadOnlyQueryBuilder, ex as ShippingApi, ey as ShippingApiOptions, ao as ShippingLine, ap as Sort, aq as SpentCheckoutPaymentState, ez as StockCheckParams, eA as StockCheckResponse, eB as StockCheckResult, eC as StockSnapshotItem, eD as StockSnapshotParams, ar as StorefrontContentListOptions, as as StorefrontContentReference, at as StorefrontGalleryItem, au as StorefrontGalleryItemsListOptions, av as StorefrontGalleryItemsSort, aw as StorefrontLink, ax as StorefrontLinksListOptions, ay as StorefrontLinksSort, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, eE as UpdateFulfillmentParams, aB as UpdateItemParams, eF as UpdateOrderParams, c3 as UpdateProfileData, eG as UpdateReturnParams, eH as ValidateDiscountParams, eI as ValidateDiscountResult, aC as VariantInput, aD as Where, eJ as WithIdempotencyKey, eK as buildProductHref, eL as buildProductListingCard, eM as buildProductListingGroupProjection, eN as buildProductListingGroupsByOption, eO as buildProductOptionMatrix, eP as buildProductOptionMatrixFromDetail, eQ as createProductSelectionCodec, eR as getAvailableOptionValues, eS as getProductSelectionImages, eT as getSelectedValueByOptionId, eU as getVariantAvailableForSale, eV as getVariantAvailableStock, eW as isProductUpsertFieldValidationErrorBody, eX as normalizeProductSelection, eY as normalizeProductSelectionFromMatrix, eZ as normalizeSelectedValueIds, e_ as parseProductSelection, e$ as projectProductToListingShape, f0 as resolveFeaturedImagePointer, f1 as resolveProductDisplayMedia, f2 as resolveProductSelection, f3 as resolveProductSelectionFromMatrix, f4 as resolveProductSelectionMedia, f5 as resolveVariantForSelection, f6 as selectNext, f7 as selectedSwatchMediaItemId, f8 as stringifyProductSelection, f9 as toShopifyPriceRangeV2 } from './types-Du4s5anw.js';
|
|
3
|
+
import { P as Product } from './payload-types-MKbx5MuJ.js';
|
|
4
|
+
export { A as Article, f as ArticleAuthor, g as ArticleCategory, h as ArticleTag, D as Document, I as Image, i as Post, j as PostCategory, T as Tenant, V as Video } from './payload-types-MKbx5MuJ.js';
|
|
5
|
+
export { C as CollectionType, P as Market, a as Product, b as ProductCollection, c as ProductVariant } from './types-L_nh-ED7.js';
|
|
6
|
+
export { C as COMMERCE_NOTIFICATION_EVENTS, a as COMMERCE_NOTIFICATION_EVENT_TYPE, b as COMMERCE_NOTIFICATION_OPERATION, c as CUSTOMER_PASSWORD_RESET_OPERATION, d as CollectionWebhookOperation, e as CommerceEmailChannel, f as CommerceEmailConfig, g as CommerceEmailEventConfig, h as CommerceEmailEventHandlers, i as CommerceEmailHandlerContext, j as CommerceNotification, k as CommerceNotificationData, l as CommerceNotificationEventHandlers, m as CommerceNotificationEventName, n as CommerceNotificationHandlerContext, o as CommerceNotificationSource, p as CommerceNotificationSourceCollection, q as CommerceNotificationWebhookEvent, r as CustomerAuthWebhookEvent, s as CustomerAuthWebhookHandlers, t as CustomerPasswordResetWebhookData, u as CustomerPasswordResetWebhookEvent, O as ORDER_CHANGED_EVENT_TYPE, v as OrderChangedWebhookEvent, W as WebhookChange, w as WebhookCommerceNotificationChange, x as WebhookEvent, y as WebhookHandler, z as WebhookKnownOperation, A as WebhookOperation, B as WebhookOptions, D as WebhookOrderChange, E as WebhookOrderMoved, F as WebhookOrderScope, G as createCommerceEmailWebhookHandler, H as createCommerceNotificationWebhookHandler, I as createCustomerAuthWebhookHandler, J as createTypedWebhookHandler, K as defineCommerceEmailConfig, L as getCommerceNotificationIdempotencyKey, M as handleWebhook, N as isCommerceNotificationWebhookEvent, P as isCustomerPasswordResetWebhookEvent, Q as isOrderChangedWebhookEvent, R as isValidWebhookEvent, S as isWebhookCollection, T as isWebhookOperation } from './index-DUuIqUS8.js';
|
|
7
|
+
export { a as COLLECTIONS, C as Collection, I as INTERNAL_COLLECTIONS, P as PublicCollection, b as SERVER_COLLECTIONS, c as SERVER_ONLY_COLLECTIONS } from './const-DCNV5Kq7.js';
|
|
8
8
|
export { a as RealtimeConnection, R as RealtimeEvent, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
9
9
|
export { a as IMAGE_SIZES, I as ImageData, b as ImageDataSizeEntry, c as ImageDataSizes, d as ImagePalette, e as ImagePlaceholderOptions, g as getImageLqip, f as getImagePalette, h as getImagePlaceholderStyle, i as getImageSrcSet, j as getImageUrl } from './image-BDjHp03R.js';
|
|
10
10
|
export { V as VideoGifOptions, a as VideoThumbnailOptions, g as getVideoGif, b as getVideoMp4Url, c as getVideoStoryboard, d as getVideoStreamUrl, e as getVideoThumbnail } from './video-WR_TFO9a.js';
|
|
11
11
|
export { Analytics, AnalyticsConfig, createAnalytics } from './analytics.js';
|
|
12
|
-
export { ApiError, AuthError, COMMERCE_ERROR_CODES, CommerceErrorCode, CommerceSDKError, ConfigError, ConflictError, GoneError, NetworkError, NotFoundError, PermissionError, RateLimitError, SDKError, ServiceUnavailableError, TimeoutError, UsageLimitError, ValidationError, createAuthError, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.js';
|
|
12
|
+
export { ApiError, AuthError, COMMERCE_ERROR_CODES, CommerceErrorCode, CommerceSDKError, ConfigError, ConflictError, GoneError, NetworkError, NotFoundError, PermissionError, RateLimitError, SDKError, ServiceUnavailableError, TimeoutError, UsageLimitError, ValidationError, createAuthError, createConflictError, createNotFoundError, createPermissionError, createRateLimitError, getSDKErrorReason, isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.js';
|
|
13
13
|
|
|
14
14
|
declare function isCommerceIdempotencyKey(value: unknown): value is string;
|
|
15
15
|
declare function assertCommerceIdempotencyKey(value: unknown): asserts value is string;
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
import { stringify } from "qs-esm";
|
|
3
3
|
|
|
4
4
|
// src/core/errors.ts
|
|
5
|
+
var SDK_ERROR_BRAND = /* @__PURE__ */ Symbol.for("@01.software/sdk/SDKError");
|
|
6
|
+
var SDK_ERROR_TYPE_BRAND = /* @__PURE__ */ Symbol.for("@01.software/sdk/SDKError.type");
|
|
7
|
+
function defineSDKErrorBrand(error) {
|
|
8
|
+
Object.defineProperty(error, SDK_ERROR_BRAND, {
|
|
9
|
+
value: true,
|
|
10
|
+
enumerable: false,
|
|
11
|
+
configurable: false,
|
|
12
|
+
writable: false
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function defineSDKErrorType(error, type) {
|
|
16
|
+
Object.defineProperty(error, SDK_ERROR_TYPE_BRAND, {
|
|
17
|
+
value: type,
|
|
18
|
+
enumerable: false,
|
|
19
|
+
configurable: false,
|
|
20
|
+
writable: false
|
|
21
|
+
});
|
|
22
|
+
}
|
|
5
23
|
var SDKError = class extends Error {
|
|
6
24
|
constructor(code, message, status, details, userMessage, suggestion, requestId) {
|
|
7
25
|
super(message);
|
|
@@ -12,6 +30,7 @@ var SDKError = class extends Error {
|
|
|
12
30
|
this.userMessage = userMessage;
|
|
13
31
|
this.suggestion = suggestion;
|
|
14
32
|
this.requestId = requestId;
|
|
33
|
+
defineSDKErrorBrand(this);
|
|
15
34
|
if (Error.captureStackTrace) {
|
|
16
35
|
Error.captureStackTrace(this, new.target);
|
|
17
36
|
}
|
|
@@ -32,6 +51,7 @@ var SDKError = class extends Error {
|
|
|
32
51
|
...this.kind !== void 0 && { kind: this.kind },
|
|
33
52
|
...this.reason !== void 0 && { reason: this.reason },
|
|
34
53
|
...this.rawReason !== void 0 && { rawReason: this.rawReason },
|
|
54
|
+
...this.apiReason !== void 0 && { apiReason: this.apiReason },
|
|
35
55
|
...this.retryable !== void 0 && { retryable: this.retryable },
|
|
36
56
|
...this.retryAfter !== void 0 && { retryAfter: this.retryAfter }
|
|
37
57
|
};
|
|
@@ -205,8 +225,16 @@ function enhanceCommerceError(error, body, headerRequestId) {
|
|
|
205
225
|
});
|
|
206
226
|
return error;
|
|
207
227
|
}
|
|
228
|
+
function enhanceNonCommerceError(error, reason) {
|
|
229
|
+
if (typeof reason === "string") Object.assign(error, { apiReason: reason });
|
|
230
|
+
return error;
|
|
231
|
+
}
|
|
232
|
+
function getSDKErrorReason(error) {
|
|
233
|
+
if (error.kind !== "commerce") return error.apiReason;
|
|
234
|
+
return error.reason === "unknown_commerce_error" ? error.rawReason : error.reason;
|
|
235
|
+
}
|
|
208
236
|
function isCommerceSDKError(error) {
|
|
209
|
-
if (!(error
|
|
237
|
+
if (!isSDKError(error) || error.kind !== "commerce") return false;
|
|
210
238
|
if (typeof error.requestId !== "string" || typeof error.retryable !== "boolean" || error.retryAfter !== void 0 && (!Number.isSafeInteger(error.retryAfter) || error.retryAfter < 0) || typeof error.reason !== "string") {
|
|
211
239
|
return false;
|
|
212
240
|
}
|
|
@@ -216,12 +244,14 @@ var NetworkError = class extends SDKError {
|
|
|
216
244
|
constructor(message, status, details, userMessage, suggestion) {
|
|
217
245
|
super("NETWORK_ERROR", message, status, details, userMessage, suggestion);
|
|
218
246
|
this.name = "NetworkError";
|
|
247
|
+
defineSDKErrorType(this, "NetworkError");
|
|
219
248
|
}
|
|
220
249
|
};
|
|
221
250
|
var ValidationError = class extends SDKError {
|
|
222
251
|
constructor(message, details, userMessage, suggestion, status = 400) {
|
|
223
252
|
super("VALIDATION_ERROR", message, status, details, userMessage, suggestion);
|
|
224
253
|
this.name = "ValidationError";
|
|
254
|
+
defineSDKErrorType(this, "ValidationError");
|
|
225
255
|
}
|
|
226
256
|
};
|
|
227
257
|
var ApiError = class extends SDKError {
|
|
@@ -236,24 +266,28 @@ var ApiError = class extends SDKError {
|
|
|
236
266
|
requestId
|
|
237
267
|
);
|
|
238
268
|
this.name = "ApiError";
|
|
269
|
+
defineSDKErrorType(this, "ApiError");
|
|
239
270
|
}
|
|
240
271
|
};
|
|
241
272
|
var ConfigError = class extends SDKError {
|
|
242
273
|
constructor(message, details, userMessage, suggestion) {
|
|
243
274
|
super("CONFIG_ERROR", message, void 0, details, userMessage, suggestion);
|
|
244
275
|
this.name = "ConfigError";
|
|
276
|
+
defineSDKErrorType(this, "ConfigError");
|
|
245
277
|
}
|
|
246
278
|
};
|
|
247
279
|
var TimeoutError = class extends SDKError {
|
|
248
280
|
constructor(message = "Request timed out.", details, userMessage, suggestion) {
|
|
249
281
|
super("TIMEOUT_ERROR", message, 408, details, userMessage, suggestion);
|
|
250
282
|
this.name = "TimeoutError";
|
|
283
|
+
defineSDKErrorType(this, "TimeoutError");
|
|
251
284
|
}
|
|
252
285
|
};
|
|
253
286
|
var GoneError = class extends SDKError {
|
|
254
287
|
constructor(message = "The requested resource is no longer available.", details, userMessage, suggestion) {
|
|
255
288
|
super("GONE_ERROR", message, 410, details, userMessage, suggestion);
|
|
256
289
|
this.name = "GoneError";
|
|
290
|
+
defineSDKErrorType(this, "GoneError");
|
|
257
291
|
}
|
|
258
292
|
};
|
|
259
293
|
var ServiceUnavailableError = class extends SDKError {
|
|
@@ -268,6 +302,7 @@ var ServiceUnavailableError = class extends SDKError {
|
|
|
268
302
|
);
|
|
269
303
|
this.name = "ServiceUnavailableError";
|
|
270
304
|
this.retryAfter = retryAfter;
|
|
305
|
+
defineSDKErrorType(this, "ServiceUnavailableError");
|
|
271
306
|
}
|
|
272
307
|
};
|
|
273
308
|
var UsageLimitError = class extends SDKError {
|
|
@@ -275,6 +310,7 @@ var UsageLimitError = class extends SDKError {
|
|
|
275
310
|
super("USAGE_LIMIT_ERROR", message, 429, details, userMessage, suggestion);
|
|
276
311
|
this.name = "UsageLimitError";
|
|
277
312
|
this.usage = usage;
|
|
313
|
+
defineSDKErrorType(this, "UsageLimitError");
|
|
278
314
|
}
|
|
279
315
|
toJSON() {
|
|
280
316
|
return {
|
|
@@ -295,6 +331,7 @@ var AuthError = class extends SDKError {
|
|
|
295
331
|
requestId
|
|
296
332
|
);
|
|
297
333
|
this.name = "AuthError";
|
|
334
|
+
defineSDKErrorType(this, "AuthError");
|
|
298
335
|
}
|
|
299
336
|
};
|
|
300
337
|
var PermissionError = class extends SDKError {
|
|
@@ -309,6 +346,7 @@ var PermissionError = class extends SDKError {
|
|
|
309
346
|
requestId
|
|
310
347
|
);
|
|
311
348
|
this.name = "PermissionError";
|
|
349
|
+
defineSDKErrorType(this, "PermissionError");
|
|
312
350
|
}
|
|
313
351
|
};
|
|
314
352
|
var NotFoundError = class extends SDKError {
|
|
@@ -323,12 +361,14 @@ var NotFoundError = class extends SDKError {
|
|
|
323
361
|
requestId
|
|
324
362
|
);
|
|
325
363
|
this.name = "NotFoundError";
|
|
364
|
+
defineSDKErrorType(this, "NotFoundError");
|
|
326
365
|
}
|
|
327
366
|
};
|
|
328
367
|
var ConflictError = class extends SDKError {
|
|
329
368
|
constructor(message, details, userMessage, suggestion, requestId) {
|
|
330
369
|
super("conflict", message, 409, details, userMessage, suggestion, requestId);
|
|
331
370
|
this.name = "ConflictError";
|
|
371
|
+
defineSDKErrorType(this, "ConflictError");
|
|
332
372
|
}
|
|
333
373
|
};
|
|
334
374
|
var RateLimitError = class extends SDKError {
|
|
@@ -344,52 +384,63 @@ var RateLimitError = class extends SDKError {
|
|
|
344
384
|
);
|
|
345
385
|
this.name = "RateLimitError";
|
|
346
386
|
this.retryAfter = retryAfter;
|
|
387
|
+
defineSDKErrorType(this, "RateLimitError");
|
|
347
388
|
}
|
|
348
389
|
};
|
|
390
|
+
function hasBrandedSDKErrorShape(error) {
|
|
391
|
+
if (error === null || typeof error !== "object") return false;
|
|
392
|
+
const candidate = error;
|
|
393
|
+
return candidate[SDK_ERROR_BRAND] === true && typeof candidate.name === "string" && typeof candidate.code === "string" && typeof candidate.message === "string" && (candidate.status === void 0 || typeof candidate.status === "number") && (candidate.userMessage === void 0 || typeof candidate.userMessage === "string") && (candidate.suggestion === void 0 || typeof candidate.suggestion === "string") && (candidate.requestId === void 0 || typeof candidate.requestId === "string") && (candidate.kind === void 0 || candidate.kind === "commerce") && (candidate.reason === void 0 || typeof candidate.reason === "string") && (candidate.rawReason === void 0 || typeof candidate.rawReason === "string") && (candidate.apiReason === void 0 || typeof candidate.apiReason === "string") && (candidate.retryable === void 0 || typeof candidate.retryable === "boolean") && (candidate.retryAfter === void 0 || typeof candidate.retryAfter === "number") && typeof candidate.getUserMessage === "function" && typeof candidate.toJSON === "function";
|
|
394
|
+
}
|
|
395
|
+
function hasSDKErrorType(error, type) {
|
|
396
|
+
return hasBrandedSDKErrorShape(error) && error[SDK_ERROR_TYPE_BRAND] === type;
|
|
397
|
+
}
|
|
349
398
|
function isSDKError(error) {
|
|
350
|
-
return error instanceof SDKError;
|
|
399
|
+
return error instanceof SDKError || hasBrandedSDKErrorShape(error);
|
|
351
400
|
}
|
|
352
401
|
function isNetworkError(error) {
|
|
353
|
-
return error instanceof NetworkError;
|
|
402
|
+
return error instanceof NetworkError || hasSDKErrorType(error, "NetworkError");
|
|
354
403
|
}
|
|
355
404
|
function isValidationError(error) {
|
|
356
|
-
if (error instanceof ValidationError)
|
|
405
|
+
if (error instanceof ValidationError || hasSDKErrorType(error, "ValidationError")) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
357
408
|
if (error == null || typeof error !== "object") return false;
|
|
358
409
|
const candidate = error;
|
|
359
410
|
return candidate.name === "ValidationError" && candidate.code === "VALIDATION_ERROR" && typeof candidate.message === "string" && typeof candidate.getUserMessage === "function" && typeof candidate.toJSON === "function";
|
|
360
411
|
}
|
|
361
412
|
function isApiError(error) {
|
|
362
|
-
return error instanceof ApiError;
|
|
413
|
+
return error instanceof ApiError || hasSDKErrorType(error, "ApiError");
|
|
363
414
|
}
|
|
364
415
|
function isConfigError(error) {
|
|
365
|
-
return error instanceof ConfigError;
|
|
416
|
+
return error instanceof ConfigError || hasSDKErrorType(error, "ConfigError");
|
|
366
417
|
}
|
|
367
418
|
function isTimeoutError(error) {
|
|
368
|
-
return error instanceof TimeoutError;
|
|
419
|
+
return error instanceof TimeoutError || hasSDKErrorType(error, "TimeoutError");
|
|
369
420
|
}
|
|
370
421
|
function isGoneError(error) {
|
|
371
|
-
return error instanceof GoneError;
|
|
422
|
+
return error instanceof GoneError || hasSDKErrorType(error, "GoneError");
|
|
372
423
|
}
|
|
373
424
|
function isServiceUnavailableError(error) {
|
|
374
|
-
return error instanceof ServiceUnavailableError;
|
|
425
|
+
return error instanceof ServiceUnavailableError || hasSDKErrorType(error, "ServiceUnavailableError");
|
|
375
426
|
}
|
|
376
427
|
function isUsageLimitError(error) {
|
|
377
|
-
return error instanceof UsageLimitError;
|
|
428
|
+
return error instanceof UsageLimitError || hasSDKErrorType(error, "UsageLimitError");
|
|
378
429
|
}
|
|
379
430
|
function isAuthError(error) {
|
|
380
|
-
return error instanceof AuthError;
|
|
431
|
+
return error instanceof AuthError || hasSDKErrorType(error, "AuthError");
|
|
381
432
|
}
|
|
382
433
|
function isPermissionError(error) {
|
|
383
|
-
return error instanceof PermissionError;
|
|
434
|
+
return error instanceof PermissionError || hasSDKErrorType(error, "PermissionError");
|
|
384
435
|
}
|
|
385
436
|
function isNotFoundError(error) {
|
|
386
|
-
return error instanceof NotFoundError;
|
|
437
|
+
return error instanceof NotFoundError || hasSDKErrorType(error, "NotFoundError");
|
|
387
438
|
}
|
|
388
439
|
function isConflictError(error) {
|
|
389
|
-
return error instanceof ConflictError;
|
|
440
|
+
return error instanceof ConflictError || hasSDKErrorType(error, "ConflictError");
|
|
390
441
|
}
|
|
391
442
|
function isRateLimitError(error) {
|
|
392
|
-
return error instanceof RateLimitError;
|
|
443
|
+
return error instanceof RateLimitError || hasSDKErrorType(error, "RateLimitError");
|
|
393
444
|
}
|
|
394
445
|
var createNetworkError = (message, status, details, userMessage, suggestion) => new NetworkError(message, status, details, userMessage, suggestion);
|
|
395
446
|
var createValidationError = (message, details, userMessage, suggestion, status) => new ValidationError(message, details, userMessage, suggestion, status);
|
|
@@ -600,7 +651,7 @@ function mapResponseToError(status, parsed, details, requestId, retryAfter, erro
|
|
|
600
651
|
if (retryAfter !== void 0) {
|
|
601
652
|
Object.assign(withRequestId, { retryAfter });
|
|
602
653
|
}
|
|
603
|
-
return errorFamily === "commerce" ? enhanceCommerceError(withRequestId, parsed.body, requestId) : withRequestId;
|
|
654
|
+
return errorFamily === "commerce" ? enhanceCommerceError(withRequestId, parsed.body, requestId) : enhanceNonCommerceError(withRequestId, parsed.reason);
|
|
604
655
|
};
|
|
605
656
|
if (status === 400 || status === 422) {
|
|
606
657
|
return finalize(
|
|
@@ -787,7 +838,7 @@ async function httpFetch(url, options) {
|
|
|
787
838
|
),
|
|
788
839
|
requestId
|
|
789
840
|
);
|
|
790
|
-
throw errorFamily === "commerce" ? enhanceCommerceError(usageError, parsed.body, requestId) : usageError;
|
|
841
|
+
throw errorFamily === "commerce" ? enhanceCommerceError(usageError, parsed.body, requestId) : enhanceNonCommerceError(usageError, parsed.reason);
|
|
791
842
|
}
|
|
792
843
|
if (response.status === 401 && onUnauthorized && customerToken && !hasRetried401 && (commerceEnvelope?.reason ?? parsed.reason) === "token_expired") {
|
|
793
844
|
hasRetried401 = true;
|
|
@@ -1241,7 +1292,7 @@ async function parseApiResponse(response, endpoint2, options = {}) {
|
|
|
1241
1292
|
}
|
|
1242
1293
|
const withRequestId = attachRequestId(error, requestId);
|
|
1243
1294
|
if (retryAfter !== void 0) Object.assign(withRequestId, { retryAfter });
|
|
1244
|
-
throw options.errorFamily === "commerce" ? enhanceCommerceError(withRequestId, data, requestId) : withRequestId;
|
|
1295
|
+
throw options.errorFamily === "commerce" ? enhanceCommerceError(withRequestId, data, requestId) : enhanceNonCommerceError(withRequestId, reason);
|
|
1245
1296
|
}
|
|
1246
1297
|
return data;
|
|
1247
1298
|
}
|
|
@@ -1665,13 +1716,7 @@ function unwrapPayloadDoc(value) {
|
|
|
1665
1716
|
return value;
|
|
1666
1717
|
}
|
|
1667
1718
|
function hasCanonicalNotFoundReason(error) {
|
|
1668
|
-
|
|
1669
|
-
if (typeof details !== "object" || details === null) return false;
|
|
1670
|
-
if ("reason" in details && details.reason === "not_found") return true;
|
|
1671
|
-
if (!("body" in details) || typeof details.body !== "object" || details.body === null) {
|
|
1672
|
-
return false;
|
|
1673
|
-
}
|
|
1674
|
-
return "reason" in details.body && details.body.reason === "not_found";
|
|
1719
|
+
return getSDKErrorReason(error) === "not_found";
|
|
1675
1720
|
}
|
|
1676
1721
|
var CommunityClient = class extends RawCustomerScopedApi {
|
|
1677
1722
|
constructor(options) {
|
|
@@ -3277,9 +3322,77 @@ function validateRequiredReconciliation(value, allowed, resource, path) {
|
|
|
3277
3322
|
function validateNextAction(value, provider, resource, path) {
|
|
3278
3323
|
const action = record(value, resource, path);
|
|
3279
3324
|
if (provider === "portone") {
|
|
3325
|
+
if (action.type === "portone_sdk") {
|
|
3326
|
+
exact(
|
|
3327
|
+
action,
|
|
3328
|
+
[
|
|
3329
|
+
"type",
|
|
3330
|
+
"version",
|
|
3331
|
+
"storeId",
|
|
3332
|
+
"channelKey",
|
|
3333
|
+
"paymentId",
|
|
3334
|
+
"orderName",
|
|
3335
|
+
"totalAmount",
|
|
3336
|
+
"currency",
|
|
3337
|
+
"payMethod",
|
|
3338
|
+
"redirectUrl"
|
|
3339
|
+
],
|
|
3340
|
+
[],
|
|
3341
|
+
resource,
|
|
3342
|
+
path
|
|
3343
|
+
);
|
|
3344
|
+
if (action.version !== "v2") fail(resource, `${path}.version`, "v2");
|
|
3345
|
+
for (const key of ["storeId", "channelKey"]) {
|
|
3346
|
+
boundedString(action[key], 255, resource, `${path}.${key}`);
|
|
3347
|
+
}
|
|
3348
|
+
const paymentId = boundedString(
|
|
3349
|
+
action.paymentId,
|
|
3350
|
+
40,
|
|
3351
|
+
resource,
|
|
3352
|
+
`${path}.paymentId`
|
|
3353
|
+
);
|
|
3354
|
+
if (!/^[A-Za-z0-9]{6,40}$/.test(paymentId)) {
|
|
3355
|
+
fail(
|
|
3356
|
+
resource,
|
|
3357
|
+
`${path}.paymentId`,
|
|
3358
|
+
"6-40 ASCII alphanumeric characters"
|
|
3359
|
+
);
|
|
3360
|
+
}
|
|
3361
|
+
boundedString(
|
|
3362
|
+
action.orderName,
|
|
3363
|
+
MAX_COMMERCE_SHORT_TEXT_LENGTH,
|
|
3364
|
+
resource,
|
|
3365
|
+
`${path}.orderName`
|
|
3366
|
+
);
|
|
3367
|
+
positiveInteger(action.totalAmount, resource, `${path}.totalAmount`);
|
|
3368
|
+
if (action.currency !== "CURRENCY_KRW") {
|
|
3369
|
+
fail(resource, `${path}.currency`, "CURRENCY_KRW");
|
|
3370
|
+
}
|
|
3371
|
+
if (action.payMethod !== "CARD")
|
|
3372
|
+
fail(resource, `${path}.payMethod`, "CARD");
|
|
3373
|
+
const redirectUrl = boundedString(
|
|
3374
|
+
action.redirectUrl,
|
|
3375
|
+
2048,
|
|
3376
|
+
resource,
|
|
3377
|
+
`${path}.redirectUrl`
|
|
3378
|
+
);
|
|
3379
|
+
try {
|
|
3380
|
+
const parsed = new URL(redirectUrl);
|
|
3381
|
+
const loopback = parsed.protocol === "http:" && (parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1");
|
|
3382
|
+
if (!loopback && parsed.protocol !== "https:" || parsed.username || parsed.password)
|
|
3383
|
+
throw new Error("unsafe redirect URL");
|
|
3384
|
+
} catch {
|
|
3385
|
+
fail(
|
|
3386
|
+
resource,
|
|
3387
|
+
`${path}.redirectUrl`,
|
|
3388
|
+
"HTTPS or loopback URL without embedded credentials"
|
|
3389
|
+
);
|
|
3390
|
+
}
|
|
3391
|
+
return;
|
|
3392
|
+
}
|
|
3280
3393
|
exact(action, ["type", "checkoutUrl"], [], resource, path);
|
|
3281
3394
|
if (action.type !== "portone_checkout") {
|
|
3282
|
-
fail(resource, `${path}.type`, "portone_checkout");
|
|
3395
|
+
fail(resource, `${path}.type`, "portone_checkout | portone_sdk");
|
|
3283
3396
|
}
|
|
3284
3397
|
const checkoutUrl = boundedString(
|
|
3285
3398
|
action.checkoutUrl,
|
|
@@ -5954,21 +6067,11 @@ var PRODUCT_DETAIL_UNAVAILABLE_REASONS = /* @__PURE__ */ new Set([
|
|
|
5954
6067
|
"not_published",
|
|
5955
6068
|
"feature_disabled"
|
|
5956
6069
|
]);
|
|
5957
|
-
function isRecord(value) {
|
|
5958
|
-
return typeof value === "object" && value !== null;
|
|
5959
|
-
}
|
|
5960
|
-
function readProductDetailUnavailableReason(value) {
|
|
5961
|
-
if (!isRecord(value)) return void 0;
|
|
5962
|
-
const directReason = value.reason ?? value.code;
|
|
5963
|
-
if (typeof directReason === "string" && PRODUCT_DETAIL_UNAVAILABLE_REASONS.has(directReason)) {
|
|
5964
|
-
return directReason;
|
|
5965
|
-
}
|
|
5966
|
-
return readProductDetailUnavailableReason(value.body);
|
|
5967
|
-
}
|
|
5968
6070
|
function productDetailResultFromError(error) {
|
|
5969
6071
|
if (!(error instanceof SDKError) || error.status !== 404) return void 0;
|
|
5970
|
-
const reason =
|
|
5971
|
-
if (!reason
|
|
6072
|
+
const reason = getSDKErrorReason(error);
|
|
6073
|
+
if (!reason || !PRODUCT_DETAIL_UNAVAILABLE_REASONS.has(reason))
|
|
6074
|
+
return void 0;
|
|
5972
6075
|
return { found: false, reason };
|
|
5973
6076
|
}
|
|
5974
6077
|
var MARKET_PRICE_QUERY_UNSUPPORTED_MESSAGE = "Market listing pages do not support base price filters or price sorts.";
|
|
@@ -6565,7 +6668,7 @@ function isStringOrNumber(value) {
|
|
|
6565
6668
|
return typeof value === "string" || typeof value === "number";
|
|
6566
6669
|
}
|
|
6567
6670
|
function isWebhookOrderScope(value) {
|
|
6568
|
-
if (!
|
|
6671
|
+
if (!isRecord(value)) return false;
|
|
6569
6672
|
if (value.kind === "collection") {
|
|
6570
6673
|
return typeof value.collection === "string";
|
|
6571
6674
|
}
|
|
@@ -6575,14 +6678,14 @@ function isWebhookOrderScope(value) {
|
|
|
6575
6678
|
return false;
|
|
6576
6679
|
}
|
|
6577
6680
|
function isWebhookOrderMoved(value) {
|
|
6578
|
-
if (!
|
|
6681
|
+
if (!isRecord(value)) return false;
|
|
6579
6682
|
return typeof value.collection === "string" && isStringOrNumber(value.id) && (value.relatedCollection === void 0 || typeof value.relatedCollection === "string") && (value.relatedId === void 0 || isStringOrNumber(value.relatedId));
|
|
6580
6683
|
}
|
|
6581
6684
|
function hasOptionalOrderValue(value, key) {
|
|
6582
6685
|
return value[key] === void 0 || value[key] === null || typeof value[key] === "string";
|
|
6583
6686
|
}
|
|
6584
6687
|
function isWebhookOrderChange(value) {
|
|
6585
|
-
if (!
|
|
6688
|
+
if (!isRecord(value)) return false;
|
|
6586
6689
|
return value.type === "order" && value.source === "payload-orderable" && (value.orderableFieldName === void 0 || typeof value.orderableFieldName === "string") && hasOptionalOrderValue(value, "previousOrder") && hasOptionalOrderValue(value, "nextOrder") && isWebhookOrderScope(value.scope) && isWebhookOrderMoved(value.moved);
|
|
6587
6690
|
}
|
|
6588
6691
|
function isCommerceNotificationEventName(value) {
|
|
@@ -6592,18 +6695,18 @@ function isCommerceNotificationSourceCollection(value) {
|
|
|
6592
6695
|
return value === "orders" || value === "fulfillments" || value === "returns";
|
|
6593
6696
|
}
|
|
6594
6697
|
function isCommerceNotificationData(value) {
|
|
6595
|
-
if (!
|
|
6596
|
-
if (value.source !== void 0 && (!
|
|
6698
|
+
if (!isRecord(value)) return false;
|
|
6699
|
+
if (value.source !== void 0 && (!isRecord(value.source) || !isCommerceNotificationSourceCollection(value.source.collection) || !isStringOrNumber(value.source.id))) {
|
|
6597
6700
|
return false;
|
|
6598
6701
|
}
|
|
6599
6702
|
return (value.orderId === void 0 || isStringOrNumber(value.orderId)) && (value.orderNumber === void 0 || typeof value.orderNumber === "string") && (value.status === void 0 || typeof value.status === "string") && (value.totalAmount === void 0 || typeof value.totalAmount === "number") && (value.currency === void 0 || typeof value.currency === "string") && (value.fulfillmentId === void 0 || isStringOrNumber(value.fulfillmentId)) && (value.fulfillmentStatus === void 0 || typeof value.fulfillmentStatus === "string") && (value.shippedAt === void 0 || typeof value.shippedAt === "string") && (value.returnId === void 0 || isStringOrNumber(value.returnId)) && (value.returnStatus === void 0 || typeof value.returnStatus === "string") && (value.refundAmount === void 0 || typeof value.refundAmount === "number") && (value.completedAt === void 0 || typeof value.completedAt === "string");
|
|
6600
6703
|
}
|
|
6601
6704
|
function isCommerceNotification(value) {
|
|
6602
|
-
if (!
|
|
6705
|
+
if (!isRecord(value)) return false;
|
|
6603
6706
|
return isCommerceNotificationEventName(value.event) && typeof value.intentId === "string" && value.intentId.length > 0 && typeof value.dedupeKey === "string" && value.dedupeKey.length > 0 && (value.orderId === void 0 || typeof value.orderId === "string") && (value.fulfillmentId === void 0 || typeof value.fulfillmentId === "string") && (value.returnId === void 0 || typeof value.returnId === "string");
|
|
6604
6707
|
}
|
|
6605
6708
|
function isWebhookCommerceNotificationChange(value) {
|
|
6606
|
-
if (!
|
|
6709
|
+
if (!isRecord(value)) return false;
|
|
6607
6710
|
return value.type === "notification" && value.source === "commerce-notifications" && isCommerceNotificationEventName(value.event) && isCommerceNotificationSourceCollection(value.sourceCollection) && isStringOrNumber(value.sourceId);
|
|
6608
6711
|
}
|
|
6609
6712
|
function matchesOptionalId(actual, expected) {
|
|
@@ -6685,7 +6788,7 @@ function isWebhookOperation(event, operation2) {
|
|
|
6685
6788
|
return isValidWebhookEvent(event) && event.operation === operation2;
|
|
6686
6789
|
}
|
|
6687
6790
|
var CUSTOMER_PASSWORD_RESET_OPERATION = "password-reset";
|
|
6688
|
-
function
|
|
6791
|
+
function isRecord(value) {
|
|
6689
6792
|
return typeof value === "object" && value !== null;
|
|
6690
6793
|
}
|
|
6691
6794
|
function hasString(value, key) {
|
|
@@ -6695,7 +6798,7 @@ function hasStringOrNumber(value, key) {
|
|
|
6695
6798
|
return typeof value[key] === "string" || typeof value[key] === "number";
|
|
6696
6799
|
}
|
|
6697
6800
|
function isCustomerPasswordResetWebhookEvent(event) {
|
|
6698
|
-
if (event.collection !== "customers" || event.operation !== CUSTOMER_PASSWORD_RESET_OPERATION || !
|
|
6801
|
+
if (event.collection !== "customers" || event.operation !== CUSTOMER_PASSWORD_RESET_OPERATION || !isRecord(event.data)) {
|
|
6699
6802
|
return false;
|
|
6700
6803
|
}
|
|
6701
6804
|
return hasStringOrNumber(event.data, "customerId") && hasString(event.data, "email") && hasString(event.data, "name") && hasString(event.data, "resetPasswordToken") && hasString(event.data, "resetPasswordExpiresAt");
|
|
@@ -7648,6 +7751,7 @@ export {
|
|
|
7648
7751
|
getImageSrcSet,
|
|
7649
7752
|
getImageUrl,
|
|
7650
7753
|
getProductSelectionImages,
|
|
7754
|
+
getSDKErrorReason,
|
|
7651
7755
|
getSelectedValueByOptionId,
|
|
7652
7756
|
getVariantAvailableForSale,
|
|
7653
7757
|
getVariantAvailableStock,
|