@01.software/sdk 0.40.0 → 0.41.1
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 +506 -0
- package/MIGRATION.md +183 -0
- package/README.md +12 -1
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +4 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +4 -1
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-CKFa99C6.d.ts → collection-client-BdcxkW7l.d.ts} +5 -5
- package/dist/{collection-client-VYwYi6u6.d.cts → collection-client-Bk--pNzW.d.cts} +5 -5
- package/dist/{const-ymprfiPf.d.ts → const-HwdntWtG.d.ts} +1 -1
- package/dist/{const-4BUtUdGU.d.cts → const-qGGI7Uii.d.cts} +1 -1
- package/dist/{index-w36lpSkU.d.ts → index-B1oW50RY.d.ts} +3 -3
- package/dist/{index-Dquv4xTL.d.cts → index-DiXtjVab.d.cts} +3 -3
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-DC0xzR9i.d.cts → payload-types-CqJOgON7.d.cts} +0 -3
- package/dist/{payload-types-DC0xzR9i.d.ts → payload-types-CqJOgON7.d.ts} +0 -3
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js.map +1 -1
- package/dist/server.cjs +10 -5
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +10 -5
- package/dist/server.js.map +1 -1
- package/dist/{types-Umd-YTjM.d.ts → types-BKa9z9s2.d.cts} +36 -5
- package/dist/{types-Bh2p-EMc.d.ts → types-BMI3M0nb.d.ts} +1 -1
- package/dist/{types-BvpjooU-.d.cts → types-ByLSG-O3.d.cts} +1 -1
- package/dist/{types-D5uHrPLr.d.cts → types-DgfXb7iV.d.ts} +36 -5
- 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 +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi,
|
|
3
|
-
import { P as Product } from './payload-types-
|
|
4
|
-
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, h as Cart, i as CartItem, D as Document, I as Image, O as Order, j as Post, k as PostCategory, l as ProductVariant, T as Tenant, V as Video } from './payload-types-
|
|
5
|
-
export { C as CollectionType, P as Product, a as ProductCollection } 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 { aQ as ProductDetail, aR as ProductDetailCatalog, aS as StockSnapshotResponse, aT as ProductSelectionMediaSource, aU as ProductDisplayMediaSource, aV as ResolveProductSelectionMediaInput, aW as ResolveProductSelectionMediaResult, aX as ProductSelectionMediaPointer, e as ClientConfig, aY as RootClientWithEvents } from './types-BKa9z9s2.cjs';
|
|
2
|
+
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi, aZ as BulkImportFulfillmentsParams, a_ as BulkImportFulfillmentsResponse, a$ as CalculateShippingParams, b0 as CalculateShippingResult, b1 as CancelOrderParams, b2 as CancelOrderReconciliationStatus, b3 as CancelOrderResponse, b4 as CancelReasonCode, b5 as CartApi, b6 as CartApiOptions, h as CheckoutParams, i as ClearCartParams, y as Client, j as ClientMetadata, d as ClientState, y as ClientType, b7 as Comment, C as CommerceClient, b8 as CommerceClientOptions, a as CommunityClient, b9 as CommunityClientOptions, ba as CommunityComment, bb as CommunityCommentListSort, bc as CommunityPost, bd as CommunityPostCategory, be as CommunityPostListSort, bf as CommunityPostTag, bg as CommunityPublicAuthorSnapshot, bh as CommunityPublicMediaAsset, bi as CommunityPublicReference, bj as CompatibilityProductSelectionParamEvent, bk as ConfirmPaymentParams, bl as ConfirmPaymentResponse, b as ContentClient, k as ContentClientOptions, bm as CreateFulfillmentParams, bn as CreateOrderItem, bo as CreateOrderParams, bp as CreateReturnParams, az as CustomerAuth, bq as CustomerAuthOptions, aB as CustomerAuthResponse, aC as CustomerLoginData, c as CustomerNamespace, br as CustomerOrderListOptions, aA as CustomerProfile, aF as CustomerRefreshResponse, aE as CustomerRegisterData, aD as CustomerRegisterResponse, bs as CustomerSnapshot, D as DebugConfig, l as DeepPartial, bt as DiscountApi, bu as DiscountApiOptions, a1 as EventGuestCancelParams, a2 as EventGuestRegistration, a3 as EventGuestRegistrationResponse, a4 as EventRegistrationAnswerInput, a5 as EventRegistrationAttendeeInput, a6 as EventRegistrationPublic, a7 as EventRegistrationRegisterParams, a8 as EventRegistrationRegisterResponse, a9 as EventsCalendarItem, E as EventsClient, aa as EventsClientOptions, ab as EventsDateParam, ac as EventsExternalSource, ad as EventsLocation, ae as EventsOccurrenceLocation, af as EventsRangeEvent, ag as EventsRangeOccurrence, ah as EventsRangeParams, ai as EventsRangeResponse, aj as EventsTaxonomyItem, m as ExtractArrayType, bv as FeaturedImagePointerInput, bw as LegacyProductSelectionParamEvent, bx as ListingGroupsParams, by as MediaValue, bz as NormalizedOptionSwatch, bA as NormalizedProductSelection, bB as OrderApi, bC as OrderApiOptions, bD as PRODUCT_PLP_FIND_OPTIONS, bE as PRODUCT_UPSERT_READONLY_FIELD_REASON, bF as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, n as PayloadMutationResponse, bG as PrepareFulfillmentOrderParams, bH as PrepareFulfillmentOrderResponse, bI as ProductApi, bJ as ProductApiOptions, bK as ProductDetailBrand, bL as ProductDetailCatalogResult, bM as ProductDetailCatalogVariant, bN as ProductDetailCategory, bO as ProductDetailImage, bP as ProductDetailImageMedia, bQ as ProductDetailMedia, bR as ProductDetailOption, bS as ProductDetailOptionValue, aJ as ProductDetailParams, aK as ProductDetailResult, bT as ProductDetailTag, bU as ProductDetailUnavailableReason, bV as ProductDetailVariant, bW as ProductDetailVariantOptionValue, bX as ProductDetailVideo, bY as ProductHrefGroup, bZ as ProductHrefOptions, b_ as ProductHrefProduct, b$ as ProductListingCard, c0 as ProductListingCardOptions, c1 as ProductListingCardPriceRange, c2 as ProductListingCardRepresentativeVariant, c3 as ProductListingGroup, c4 as ProductListingGroupCatalogSummary, c5 as ProductListingGroupCatalogVariant, c6 as ProductListingGroupProjection, c7 as ProductListingGroupSummary, c8 as ProductListingGroupVariant, aN as ProductListingGroupsCatalogItem, c9 as ProductListingGroupsCatalogProduct, ca as ProductListingGroupsCatalogResponse, aP as ProductListingGroupsItem, cb as ProductListingGroupsProduct, cc as ProductListingGroupsResponse, aH as ProductListingPageBaseParams, aL as ProductListingPageCatalogParams, cd as ProductListingPageFilters, aO as ProductListingPageFullParams, aI as ProductListingPageParams, aM as ProductListingPageResult, ce as ProductListingPageSort, cf as ProductListingProductShape, cg as ProductListingSwatch, ch as ProductMediaResolutionSource, ci as ProductMoneyRange, cj as ProductOptionMatrix, ck as ProductOptionMatrixOption, cl as ProductOptionMatrixValue, cm as ProductOptionMatrixVariant, cn as ProductOptionShape, co as ProductOptionValueShape, cp as ProductOptionValueSwatch, cq as ProductOptionValueSwatchInput, cr as ProductPriceRange, cs as ProductSelectionAvailableSwatch, ct as ProductSelectionAvailableValue, cu as ProductSelectionByOptionValue, cv as ProductSelectionCodecError, cw as ProductSelectionCodecOptions, cx as ProductSelectionInput, cy as ProductSelectionOptionValue, cz as ProductSelectionResolution, cA as ProductSelectionResolutionContext, cB as ProductSelectionUrlEmit, cC as ProductSelectionVariant, cD as ProductUpsertFieldValidationErrorBody, cE as ProductUpsertFieldValidationErrorReason, cF as ProductVariantShape, o as PublicCart, p as PublicCartItem, q as PublicCartReference, r as PublicMediaAsset, s as PublicMediaSize, t as PublicOrder, u as PublicOrderItem, v as PublicOrderReference, ay as PublicReadQueryOptions, R as RemoveDiscountParams, w as RemoveItemParams, cG as RequestOptions, cH as ResolveCancelRefundFailedResponse, cI as ResolveCancelRefundOutcome, cJ as ResolveCancelRefundParams, cK as ResolveCancelRefundResponse, cL as ResolveCancelRefundSucceededResponse, cM as ResolveProductDisplayMediaInput, cN as ResolveProductDisplayMediaResult, x as RetryConfig, cO as ReturnItem, cP as ReturnReason, cQ as ReturnWithRefundItem, cR as ReturnWithRefundParams, y as RootClient, z as RootCollectionClient, B as RootReadOnlyQueryBuilder, O as ServerApiOptions, cS as ShippingApi, cT as ShippingApiOptions, S as Sort, cU as StockCheckParams, cV as StockCheckResponse, cW as StockCheckResult, cX as StockSnapshotItem, cY as StockSnapshotParams, F as StorefrontContentListOptions, G as StorefrontContentReference, H as StorefrontGalleryItem, I as StorefrontGalleryItemsListOptions, J as StorefrontGalleryItemsSort, K as StorefrontLink, L as StorefrontLinksListOptions, M as StorefrontLinksSort, cZ as UpdateFulfillmentParams, U as UpdateItemParams, c_ as UpdateOrderParams, aG as UpdateProfileData, c$ as UpdateReturnParams, d0 as UpdateTransactionParams, d1 as ValidateDiscountParams, d2 as ValidateDiscountResult, W as Where, d3 as WithIdempotencyKey, d4 as buildProductHref, d5 as buildProductListingCard, d6 as buildProductListingGroupProjection, d7 as buildProductListingGroupsByOption, d8 as buildProductOptionMatrix, d9 as buildProductOptionMatrixFromDetail, da as createProductSelectionCodec, db as getAvailableOptionValues, dc as getProductSelectionImages, dd as getSelectedValueByOptionId, de as getVariantAvailableForSale, df as getVariantAvailableStock, dg as isProductUpsertFieldValidationErrorBody, dh as normalizeProductSelection, di as normalizeProductSelectionFromMatrix, dj as normalizeSelectedValueIds, dk as parseProductSelection, dl as projectProductToListingShape, dm as resolveFeaturedImagePointer, dn as resolveProductDisplayMedia, dp as resolveProductSelection, dq as resolveProductSelectionFromMatrix, dr as resolveProductSelectionMedia, ds as resolveVariantForSelection, dt as selectNext, du as selectedSwatchMediaItemId, dv as stringifyProductSelection, dw as toShopifyPriceRangeV2 } from './types-BKa9z9s2.cjs';
|
|
3
|
+
import { P as Product } from './payload-types-CqJOgON7.cjs';
|
|
4
|
+
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, h as Cart, i as CartItem, D as Document, I as Image, O as Order, j as Post, k as PostCategory, l as ProductVariant, T as Tenant, V as Video } from './payload-types-CqJOgON7.cjs';
|
|
5
|
+
export { C as CollectionType, P as Product, a as ProductCollection } from './types-ByLSG-O3.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-DiXtjVab.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-qGGI7Uii.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';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi,
|
|
3
|
-
import { P as Product } from './payload-types-
|
|
4
|
-
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, h as Cart, i as CartItem, D as Document, I as Image, O as Order, j as Post, k as PostCategory, l as ProductVariant, T as Tenant, V as Video } from './payload-types-
|
|
5
|
-
export { C as CollectionType, P as Product, a as ProductCollection } 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 { aQ as ProductDetail, aR as ProductDetailCatalog, aS as StockSnapshotResponse, aT as ProductSelectionMediaSource, aU as ProductDisplayMediaSource, aV as ResolveProductSelectionMediaInput, aW as ResolveProductSelectionMediaResult, aX as ProductSelectionMediaPointer, e as ClientConfig, aY as RootClientWithEvents } from './types-DgfXb7iV.js';
|
|
2
|
+
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi, aZ as BulkImportFulfillmentsParams, a_ as BulkImportFulfillmentsResponse, a$ as CalculateShippingParams, b0 as CalculateShippingResult, b1 as CancelOrderParams, b2 as CancelOrderReconciliationStatus, b3 as CancelOrderResponse, b4 as CancelReasonCode, b5 as CartApi, b6 as CartApiOptions, h as CheckoutParams, i as ClearCartParams, y as Client, j as ClientMetadata, d as ClientState, y as ClientType, b7 as Comment, C as CommerceClient, b8 as CommerceClientOptions, a as CommunityClient, b9 as CommunityClientOptions, ba as CommunityComment, bb as CommunityCommentListSort, bc as CommunityPost, bd as CommunityPostCategory, be as CommunityPostListSort, bf as CommunityPostTag, bg as CommunityPublicAuthorSnapshot, bh as CommunityPublicMediaAsset, bi as CommunityPublicReference, bj as CompatibilityProductSelectionParamEvent, bk as ConfirmPaymentParams, bl as ConfirmPaymentResponse, b as ContentClient, k as ContentClientOptions, bm as CreateFulfillmentParams, bn as CreateOrderItem, bo as CreateOrderParams, bp as CreateReturnParams, az as CustomerAuth, bq as CustomerAuthOptions, aB as CustomerAuthResponse, aC as CustomerLoginData, c as CustomerNamespace, br as CustomerOrderListOptions, aA as CustomerProfile, aF as CustomerRefreshResponse, aE as CustomerRegisterData, aD as CustomerRegisterResponse, bs as CustomerSnapshot, D as DebugConfig, l as DeepPartial, bt as DiscountApi, bu as DiscountApiOptions, a1 as EventGuestCancelParams, a2 as EventGuestRegistration, a3 as EventGuestRegistrationResponse, a4 as EventRegistrationAnswerInput, a5 as EventRegistrationAttendeeInput, a6 as EventRegistrationPublic, a7 as EventRegistrationRegisterParams, a8 as EventRegistrationRegisterResponse, a9 as EventsCalendarItem, E as EventsClient, aa as EventsClientOptions, ab as EventsDateParam, ac as EventsExternalSource, ad as EventsLocation, ae as EventsOccurrenceLocation, af as EventsRangeEvent, ag as EventsRangeOccurrence, ah as EventsRangeParams, ai as EventsRangeResponse, aj as EventsTaxonomyItem, m as ExtractArrayType, bv as FeaturedImagePointerInput, bw as LegacyProductSelectionParamEvent, bx as ListingGroupsParams, by as MediaValue, bz as NormalizedOptionSwatch, bA as NormalizedProductSelection, bB as OrderApi, bC as OrderApiOptions, bD as PRODUCT_PLP_FIND_OPTIONS, bE as PRODUCT_UPSERT_READONLY_FIELD_REASON, bF as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, n as PayloadMutationResponse, bG as PrepareFulfillmentOrderParams, bH as PrepareFulfillmentOrderResponse, bI as ProductApi, bJ as ProductApiOptions, bK as ProductDetailBrand, bL as ProductDetailCatalogResult, bM as ProductDetailCatalogVariant, bN as ProductDetailCategory, bO as ProductDetailImage, bP as ProductDetailImageMedia, bQ as ProductDetailMedia, bR as ProductDetailOption, bS as ProductDetailOptionValue, aJ as ProductDetailParams, aK as ProductDetailResult, bT as ProductDetailTag, bU as ProductDetailUnavailableReason, bV as ProductDetailVariant, bW as ProductDetailVariantOptionValue, bX as ProductDetailVideo, bY as ProductHrefGroup, bZ as ProductHrefOptions, b_ as ProductHrefProduct, b$ as ProductListingCard, c0 as ProductListingCardOptions, c1 as ProductListingCardPriceRange, c2 as ProductListingCardRepresentativeVariant, c3 as ProductListingGroup, c4 as ProductListingGroupCatalogSummary, c5 as ProductListingGroupCatalogVariant, c6 as ProductListingGroupProjection, c7 as ProductListingGroupSummary, c8 as ProductListingGroupVariant, aN as ProductListingGroupsCatalogItem, c9 as ProductListingGroupsCatalogProduct, ca as ProductListingGroupsCatalogResponse, aP as ProductListingGroupsItem, cb as ProductListingGroupsProduct, cc as ProductListingGroupsResponse, aH as ProductListingPageBaseParams, aL as ProductListingPageCatalogParams, cd as ProductListingPageFilters, aO as ProductListingPageFullParams, aI as ProductListingPageParams, aM as ProductListingPageResult, ce as ProductListingPageSort, cf as ProductListingProductShape, cg as ProductListingSwatch, ch as ProductMediaResolutionSource, ci as ProductMoneyRange, cj as ProductOptionMatrix, ck as ProductOptionMatrixOption, cl as ProductOptionMatrixValue, cm as ProductOptionMatrixVariant, cn as ProductOptionShape, co as ProductOptionValueShape, cp as ProductOptionValueSwatch, cq as ProductOptionValueSwatchInput, cr as ProductPriceRange, cs as ProductSelectionAvailableSwatch, ct as ProductSelectionAvailableValue, cu as ProductSelectionByOptionValue, cv as ProductSelectionCodecError, cw as ProductSelectionCodecOptions, cx as ProductSelectionInput, cy as ProductSelectionOptionValue, cz as ProductSelectionResolution, cA as ProductSelectionResolutionContext, cB as ProductSelectionUrlEmit, cC as ProductSelectionVariant, cD as ProductUpsertFieldValidationErrorBody, cE as ProductUpsertFieldValidationErrorReason, cF as ProductVariantShape, o as PublicCart, p as PublicCartItem, q as PublicCartReference, r as PublicMediaAsset, s as PublicMediaSize, t as PublicOrder, u as PublicOrderItem, v as PublicOrderReference, ay as PublicReadQueryOptions, R as RemoveDiscountParams, w as RemoveItemParams, cG as RequestOptions, cH as ResolveCancelRefundFailedResponse, cI as ResolveCancelRefundOutcome, cJ as ResolveCancelRefundParams, cK as ResolveCancelRefundResponse, cL as ResolveCancelRefundSucceededResponse, cM as ResolveProductDisplayMediaInput, cN as ResolveProductDisplayMediaResult, x as RetryConfig, cO as ReturnItem, cP as ReturnReason, cQ as ReturnWithRefundItem, cR as ReturnWithRefundParams, y as RootClient, z as RootCollectionClient, B as RootReadOnlyQueryBuilder, O as ServerApiOptions, cS as ShippingApi, cT as ShippingApiOptions, S as Sort, cU as StockCheckParams, cV as StockCheckResponse, cW as StockCheckResult, cX as StockSnapshotItem, cY as StockSnapshotParams, F as StorefrontContentListOptions, G as StorefrontContentReference, H as StorefrontGalleryItem, I as StorefrontGalleryItemsListOptions, J as StorefrontGalleryItemsSort, K as StorefrontLink, L as StorefrontLinksListOptions, M as StorefrontLinksSort, cZ as UpdateFulfillmentParams, U as UpdateItemParams, c_ as UpdateOrderParams, aG as UpdateProfileData, c$ as UpdateReturnParams, d0 as UpdateTransactionParams, d1 as ValidateDiscountParams, d2 as ValidateDiscountResult, W as Where, d3 as WithIdempotencyKey, d4 as buildProductHref, d5 as buildProductListingCard, d6 as buildProductListingGroupProjection, d7 as buildProductListingGroupsByOption, d8 as buildProductOptionMatrix, d9 as buildProductOptionMatrixFromDetail, da as createProductSelectionCodec, db as getAvailableOptionValues, dc as getProductSelectionImages, dd as getSelectedValueByOptionId, de as getVariantAvailableForSale, df as getVariantAvailableStock, dg as isProductUpsertFieldValidationErrorBody, dh as normalizeProductSelection, di as normalizeProductSelectionFromMatrix, dj as normalizeSelectedValueIds, dk as parseProductSelection, dl as projectProductToListingShape, dm as resolveFeaturedImagePointer, dn as resolveProductDisplayMedia, dp as resolveProductSelection, dq as resolveProductSelectionFromMatrix, dr as resolveProductSelectionMedia, ds as resolveVariantForSelection, dt as selectNext, du as selectedSwatchMediaItemId, dv as stringifyProductSelection, dw as toShopifyPriceRangeV2 } from './types-DgfXb7iV.js';
|
|
3
|
+
import { P as Product } from './payload-types-CqJOgON7.js';
|
|
4
|
+
export { A as Article, e as ArticleAuthor, f as ArticleCategory, g as ArticleTag, h as Cart, i as CartItem, D as Document, I as Image, O as Order, j as Post, k as PostCategory, l as ProductVariant, T as Tenant, V as Video } from './payload-types-CqJOgON7.js';
|
|
5
|
+
export { C as CollectionType, P as Product, a as ProductCollection } from './types-BMI3M0nb.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-B1oW50RY.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-HwdntWtG.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';
|
package/dist/index.js
CHANGED
|
@@ -2729,10 +2729,9 @@ function buildSelectionMedia(detail, selectedVariant, matchingVariants, selected
|
|
|
2729
2729
|
}
|
|
2730
2730
|
function buildSelectionStock(selectedVariant, matchingVariants) {
|
|
2731
2731
|
if (selectedVariant) {
|
|
2732
|
-
const availableStock =
|
|
2733
|
-
const isActive = selectedVariant.isActive !== false;
|
|
2732
|
+
const availableStock = getVariantAvailableStock(selectedVariant);
|
|
2734
2733
|
return {
|
|
2735
|
-
availableForSale:
|
|
2734
|
+
availableForSale: getVariantAvailableForSale(selectedVariant),
|
|
2736
2735
|
isUnlimited: selectedVariant.isUnlimited,
|
|
2737
2736
|
stock: selectedVariant.stock,
|
|
2738
2737
|
reservedStock: selectedVariant.reservedStock,
|
|
@@ -2753,7 +2752,7 @@ function buildAvailableValueStock(variants) {
|
|
|
2753
2752
|
);
|
|
2754
2753
|
const isUnlimited = activeVariants.some((variant) => variant.isUnlimited);
|
|
2755
2754
|
const availableStock = isUnlimited ? null : activeVariants.reduce(
|
|
2756
|
-
(sum, variant) => sum +
|
|
2755
|
+
(sum, variant) => sum + (getVariantAvailableStock(variant) ?? 0),
|
|
2757
2756
|
0
|
|
2758
2757
|
);
|
|
2759
2758
|
return {
|
|
@@ -3115,11 +3114,18 @@ function compareVariantOrder(a, b) {
|
|
|
3115
3114
|
const bId = String(getRelationID(b.id) ?? "");
|
|
3116
3115
|
return aId.localeCompare(bId);
|
|
3117
3116
|
}
|
|
3118
|
-
function
|
|
3117
|
+
function getVariantAvailableForSale(variant) {
|
|
3119
3118
|
if (variant.isActive === false) return false;
|
|
3120
3119
|
if (variant.isUnlimited) return true;
|
|
3121
3120
|
return (variant.stock ?? 0) - (variant.reservedStock ?? 0) > 0;
|
|
3122
3121
|
}
|
|
3122
|
+
function getVariantAvailableStock(variant) {
|
|
3123
|
+
if (variant.isUnlimited) return null;
|
|
3124
|
+
return Math.max(0, (variant.stock ?? 0) - (variant.reservedStock ?? 0));
|
|
3125
|
+
}
|
|
3126
|
+
function isVariantAvailableForSale(variant) {
|
|
3127
|
+
return getVariantAvailableForSale(variant);
|
|
3128
|
+
}
|
|
3123
3129
|
function sortVariantsForMediaSelection(variants) {
|
|
3124
3130
|
const orderedVariants = [...variants].sort(compareVariantOrder);
|
|
3125
3131
|
const activeVariants = orderedVariants.filter(
|
|
@@ -3338,6 +3344,10 @@ var PRODUCT_PLP_FIND_OPTIONS = {
|
|
|
3338
3344
|
options: { limit: 50, sort: "_order" }
|
|
3339
3345
|
}
|
|
3340
3346
|
};
|
|
3347
|
+
function projectProductToListingShape(product) {
|
|
3348
|
+
const featuredImage = product.featuredImage != null ? product.featuredImage : product.images?.find((image) => image != null);
|
|
3349
|
+
return { ...product, featuredImage };
|
|
3350
|
+
}
|
|
3341
3351
|
function buildProductListingGroupsByOption(args) {
|
|
3342
3352
|
const primaryOptionId = args.primaryOptionId ?? void 0;
|
|
3343
3353
|
if (!primaryOptionId) return [];
|
|
@@ -5144,6 +5154,8 @@ export {
|
|
|
5144
5154
|
getImageUrl,
|
|
5145
5155
|
getProductSelectionImages,
|
|
5146
5156
|
getSelectedValueByOptionId,
|
|
5157
|
+
getVariantAvailableForSale,
|
|
5158
|
+
getVariantAvailableStock,
|
|
5147
5159
|
getVideoGif,
|
|
5148
5160
|
getVideoMp4Url,
|
|
5149
5161
|
getVideoStoryboard,
|
|
@@ -5176,6 +5188,7 @@ export {
|
|
|
5176
5188
|
normalizeProductSelectionFromMatrix,
|
|
5177
5189
|
normalizeSelectedValueIds,
|
|
5178
5190
|
parseProductSelection,
|
|
5191
|
+
projectProductToListingShape,
|
|
5179
5192
|
resolveFeaturedImagePointer,
|
|
5180
5193
|
resolveProductDisplayMedia,
|
|
5181
5194
|
resolveProductGallery,
|