@01.software/sdk 0.39.0 → 0.40.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/README.md +52 -20
- package/dist/client.cjs +43 -68
- 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 +43 -68
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-CaMgs5KE.d.ts → collection-client-CKFa99C6.d.ts} +3 -3
- package/dist/{collection-client-DVfB0Em1.d.cts → collection-client-VYwYi6u6.d.cts} +3 -3
- package/dist/const-4BUtUdGU.d.cts +32 -0
- package/dist/const-ymprfiPf.d.ts +32 -0
- package/dist/{index-BOLQxveo.d.cts → index-Dquv4xTL.d.cts} +3 -3
- package/dist/{index-CSwR2HSg.d.ts → index-w36lpSkU.d.ts} +3 -3
- package/dist/index.cjs +101 -131
- 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 +101 -131
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-m3jjhxk9.d.cts → payload-types-DC0xzR9i.d.cts} +470 -265
- package/dist/{payload-types-m3jjhxk9.d.ts → payload-types-DC0xzR9i.d.ts} +470 -265
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +36 -68
- 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 +36 -68
- package/dist/server.js.map +1 -1
- package/dist/{types-Cmrd1ezc.d.ts → types-Bh2p-EMc.d.ts} +5 -1
- package/dist/{types-D0ubzQw0.d.cts → types-BvpjooU-.d.cts} +5 -1
- package/dist/{types-CVf8sCZ-.d.ts → types-D5uHrPLr.d.cts} +99 -77
- package/dist/{types-BQo7UdI9.d.cts → types-Umd-YTjM.d.ts} +99 -77
- 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 +1 -1
- package/dist/const-6XHz_jej.d.ts +0 -32
- package/dist/const-B5KT72c7.d.cts +0 -32
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { aP as ProductDetail, aQ as ProductDetailCatalog, aR as StockSnapshotResponse, aS as ProductSelectionMediaSource, aT as ProductDisplayMediaSource, aU as ResolveProductSelectionMediaInput, aV as ResolveProductSelectionMediaResult, aW as ProductSelectionMediaPointer, e as ClientConfig, aX as RootClientWithEvents } from './types-
|
|
2
|
-
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi, aY as BulkImportFulfillmentsParams, aZ as BulkImportFulfillmentsResponse, a_ as CalculateShippingParams, a$ as CalculateShippingResult, b0 as CancelOrderParams, b1 as CancelOrderReconciliationStatus, b2 as CancelOrderResponse, b3 as CancelReasonCode, b4 as CartApi, b5 as CartApiOptions, h as CheckoutParams, i as ClearCartParams, y as Client, j as ClientMetadata, d as ClientState, y as ClientType, b6 as Comment, C as CommerceClient, b7 as CommerceClientOptions, a as CommunityClient, b8 as CommunityClientOptions, b9 as CommunityComment, ba as CommunityCommentListSort, bb as CommunityPost, bc as CommunityPostCategory, bd as CommunityPostListSort, be as CommunityPostTag, bf as CommunityPublicAuthorSnapshot, bg as CommunityPublicMediaAsset, bh as CommunityPublicReference, bi as CompatibilityProductSelectionParamEvent, bj as ConfirmPaymentParams, bk as ConfirmPaymentResponse, b as ContentClient, k as ContentClientOptions, bl as CreateFulfillmentParams, bm as CreateOrderItem, bn as CreateOrderParams, bo as CreateReturnParams, ay as CustomerAuth, bp as CustomerAuthOptions, aA as CustomerAuthResponse, aB as CustomerLoginData, c as CustomerNamespace, az as CustomerProfile, aE as CustomerRefreshResponse, aD as CustomerRegisterData, aC as CustomerRegisterResponse,
|
|
3
|
-
import { P as Product } from './payload-types-
|
|
4
|
-
export { A as Article,
|
|
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 { aP as ProductDetail, aQ as ProductDetailCatalog, aR as StockSnapshotResponse, aS as ProductSelectionMediaSource, aT as ProductDisplayMediaSource, aU as ResolveProductSelectionMediaInput, aV as ResolveProductSelectionMediaResult, aW as ProductSelectionMediaPointer, e as ClientConfig, aX as RootClientWithEvents } from './types-D5uHrPLr.cjs';
|
|
2
|
+
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi, aY as BulkImportFulfillmentsParams, aZ as BulkImportFulfillmentsResponse, a_ as CalculateShippingParams, a$ as CalculateShippingResult, b0 as CancelOrderParams, b1 as CancelOrderReconciliationStatus, b2 as CancelOrderResponse, b3 as CancelReasonCode, b4 as CartApi, b5 as CartApiOptions, h as CheckoutParams, i as ClearCartParams, y as Client, j as ClientMetadata, d as ClientState, y as ClientType, b6 as Comment, C as CommerceClient, b7 as CommerceClientOptions, a as CommunityClient, b8 as CommunityClientOptions, b9 as CommunityComment, ba as CommunityCommentListSort, bb as CommunityPost, bc as CommunityPostCategory, bd as CommunityPostListSort, be as CommunityPostTag, bf as CommunityPublicAuthorSnapshot, bg as CommunityPublicMediaAsset, bh as CommunityPublicReference, bi as CompatibilityProductSelectionParamEvent, bj as ConfirmPaymentParams, bk as ConfirmPaymentResponse, b as ContentClient, k as ContentClientOptions, bl as CreateFulfillmentParams, bm as CreateOrderItem, bn as CreateOrderParams, bo as CreateReturnParams, ay as CustomerAuth, bp as CustomerAuthOptions, aA as CustomerAuthResponse, aB as CustomerLoginData, c as CustomerNamespace, bq as CustomerOrderListOptions, az as CustomerProfile, aE as CustomerRefreshResponse, aD as CustomerRegisterData, aC as CustomerRegisterResponse, br as CustomerSnapshot, D as DebugConfig, l as DeepPartial, bs as DiscountApi, bt 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, bu as FeaturedImagePointerInput, bv as LegacyProductSelectionParamEvent, bw as ListingGroupsParams, bx as MediaValue, by as NormalizedOptionSwatch, bz as NormalizedProductSelection, bA as OrderApi, bB as OrderApiOptions, bC as PRODUCT_PLP_FIND_OPTIONS, bD as PRODUCT_UPSERT_READONLY_FIELD_REASON, bE as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, n as PayloadMutationResponse, bF as PrepareFulfillmentOrderParams, bG as PrepareFulfillmentOrderResponse, bH as ProductApi, bI as ProductApiOptions, bJ as ProductDetailBrand, bK as ProductDetailCatalogResult, bL as ProductDetailCatalogVariant, bM as ProductDetailCategory, bN as ProductDetailImage, bO as ProductDetailImageMedia, bP as ProductDetailMedia, bQ as ProductDetailOption, bR as ProductDetailOptionValue, aI as ProductDetailParams, aJ as ProductDetailResult, bS as ProductDetailTag, bT as ProductDetailUnavailableReason, bU as ProductDetailVariant, bV as ProductDetailVariantOptionValue, bW as ProductDetailVideo, bX as ProductHrefGroup, bY as ProductHrefOptions, bZ as ProductHrefProduct, b_ as ProductListingCard, b$ as ProductListingCardOptions, c0 as ProductListingCardPriceRange, c1 as ProductListingCardRepresentativeVariant, c2 as ProductListingGroup, c3 as ProductListingGroupCatalogSummary, c4 as ProductListingGroupCatalogVariant, c5 as ProductListingGroupProjection, c6 as ProductListingGroupSummary, c7 as ProductListingGroupVariant, aM as ProductListingGroupsCatalogItem, c8 as ProductListingGroupsCatalogProduct, c9 as ProductListingGroupsCatalogResponse, aO as ProductListingGroupsItem, ca as ProductListingGroupsProduct, cb as ProductListingGroupsResponse, aG as ProductListingPageBaseParams, aK as ProductListingPageCatalogParams, cc as ProductListingPageFilters, aN as ProductListingPageFullParams, aH as ProductListingPageParams, aL as ProductListingPageResult, cd as ProductListingPageSort, ce as ProductListingProductShape, cf as ProductListingSwatch, cg as ProductMediaResolutionSource, ch as ProductMoneyRange, ci as ProductOptionMatrix, cj as ProductOptionMatrixOption, ck as ProductOptionMatrixValue, cl as ProductOptionMatrixVariant, cm as ProductOptionShape, cn as ProductOptionValueShape, co as ProductOptionValueSwatch, cp as ProductOptionValueSwatchInput, cq as ProductPriceRange, cr as ProductSelectionAvailableSwatch, cs as ProductSelectionAvailableValue, ct as ProductSelectionByOptionValue, cu as ProductSelectionCodecError, cv as ProductSelectionCodecOptions, cw as ProductSelectionInput, cx as ProductSelectionOptionValue, cy as ProductSelectionResolution, cz as ProductSelectionResolutionContext, cA as ProductSelectionUrlEmit, cB as ProductSelectionVariant, cC as ProductUpsertFieldValidationErrorBody, cD as ProductUpsertFieldValidationErrorReason, cE 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, ax as PublicReadQueryOptions, R as RemoveDiscountParams, w as RemoveItemParams, cF as RequestOptions, cG as ResolveCancelRefundFailedResponse, cH as ResolveCancelRefundOutcome, cI as ResolveCancelRefundParams, cJ as ResolveCancelRefundResponse, cK as ResolveCancelRefundSucceededResponse, cL as ResolveProductDisplayMediaInput, cM as ResolveProductDisplayMediaResult, x as RetryConfig, cN as ReturnItem, cO as ReturnReason, cP as ReturnWithRefundItem, cQ as ReturnWithRefundParams, y as RootClient, z as RootCollectionClient, B as RootReadOnlyQueryBuilder, O as ServerApiOptions, cR as ShippingApi, cS as ShippingApiOptions, S as Sort, cT as StockCheckParams, cU as StockCheckResponse, cV as StockCheckResult, cW as StockSnapshotItem, cX 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, cY as UpdateFulfillmentParams, U as UpdateItemParams, cZ as UpdateOrderParams, aF as UpdateProfileData, c_ as UpdateReturnParams, c$ as UpdateTransactionParams, d0 as ValidateDiscountParams, d1 as ValidateDiscountResult, W as Where, d2 as WithIdempotencyKey, d3 as buildProductHref, d4 as buildProductListingCard, d5 as buildProductListingGroupProjection, d6 as buildProductListingGroupsByOption, d7 as buildProductOptionMatrix, d8 as buildProductOptionMatrixFromDetail, d9 as createProductSelectionCodec, da as getAvailableOptionValues, db as getProductSelectionImages, dc as getSelectedValueByOptionId, dd as isProductUpsertFieldValidationErrorBody, de as normalizeProductSelection, df as normalizeProductSelectionFromMatrix, dg as normalizeSelectedValueIds, dh as parseProductSelection, di as resolveFeaturedImagePointer, dj as resolveProductDisplayMedia, dk as resolveProductSelection, dl as resolveProductSelectionFromMatrix, dm as resolveProductSelectionMedia, dn as resolveVariantForSelection, dp as selectNext, dq as selectedSwatchMediaItemId, dr as stringifyProductSelection, ds as toShopifyPriceRangeV2 } from './types-D5uHrPLr.cjs';
|
|
3
|
+
import { P as Product } from './payload-types-DC0xzR9i.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-DC0xzR9i.cjs';
|
|
5
|
+
export { C as CollectionType, P as Product, a as ProductCollection } from './types-BvpjooU-.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-Dquv4xTL.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-4BUtUdGU.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';
|
|
@@ -63,7 +63,7 @@ type ResolveProductGalleryInput<TMedia> = ResolveProductSelectionMediaInput<TMed
|
|
|
63
63
|
mediaSets?: ProductMediaSetInput[] | null;
|
|
64
64
|
selectedVariantId?: string | number | null;
|
|
65
65
|
selectedOptionValueIds?: Array<string | number | null | undefined> | null;
|
|
66
|
-
|
|
66
|
+
featuredImage?: ProductSelectionMediaPointer;
|
|
67
67
|
};
|
|
68
68
|
/** @deprecated Use selection or display media source types. */
|
|
69
69
|
type ProductGallerySource = ProductSelectionMediaSource | ProductDisplayMediaSource | LegacyProductGallerySource;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { aP as ProductDetail, aQ as ProductDetailCatalog, aR as StockSnapshotResponse, aS as ProductSelectionMediaSource, aT as ProductDisplayMediaSource, aU as ResolveProductSelectionMediaInput, aV as ResolveProductSelectionMediaResult, aW as ProductSelectionMediaPointer, e as ClientConfig, aX as RootClientWithEvents } from './types-
|
|
2
|
-
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi, aY as BulkImportFulfillmentsParams, aZ as BulkImportFulfillmentsResponse, a_ as CalculateShippingParams, a$ as CalculateShippingResult, b0 as CancelOrderParams, b1 as CancelOrderReconciliationStatus, b2 as CancelOrderResponse, b3 as CancelReasonCode, b4 as CartApi, b5 as CartApiOptions, h as CheckoutParams, i as ClearCartParams, y as Client, j as ClientMetadata, d as ClientState, y as ClientType, b6 as Comment, C as CommerceClient, b7 as CommerceClientOptions, a as CommunityClient, b8 as CommunityClientOptions, b9 as CommunityComment, ba as CommunityCommentListSort, bb as CommunityPost, bc as CommunityPostCategory, bd as CommunityPostListSort, be as CommunityPostTag, bf as CommunityPublicAuthorSnapshot, bg as CommunityPublicMediaAsset, bh as CommunityPublicReference, bi as CompatibilityProductSelectionParamEvent, bj as ConfirmPaymentParams, bk as ConfirmPaymentResponse, b as ContentClient, k as ContentClientOptions, bl as CreateFulfillmentParams, bm as CreateOrderItem, bn as CreateOrderParams, bo as CreateReturnParams, ay as CustomerAuth, bp as CustomerAuthOptions, aA as CustomerAuthResponse, aB as CustomerLoginData, c as CustomerNamespace, az as CustomerProfile, aE as CustomerRefreshResponse, aD as CustomerRegisterData, aC as CustomerRegisterResponse,
|
|
3
|
-
import { P as Product } from './payload-types-
|
|
4
|
-
export { A as Article,
|
|
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 { aP as ProductDetail, aQ as ProductDetailCatalog, aR as StockSnapshotResponse, aS as ProductSelectionMediaSource, aT as ProductDisplayMediaSource, aU as ResolveProductSelectionMediaInput, aV as ResolveProductSelectionMediaResult, aW as ProductSelectionMediaPointer, e as ClientConfig, aX as RootClientWithEvents } from './types-Umd-YTjM.js';
|
|
2
|
+
export { A as AddItemParams, f as ApiQueryOptions, g as ApplyDiscountParams, N as BaseApi, aY as BulkImportFulfillmentsParams, aZ as BulkImportFulfillmentsResponse, a_ as CalculateShippingParams, a$ as CalculateShippingResult, b0 as CancelOrderParams, b1 as CancelOrderReconciliationStatus, b2 as CancelOrderResponse, b3 as CancelReasonCode, b4 as CartApi, b5 as CartApiOptions, h as CheckoutParams, i as ClearCartParams, y as Client, j as ClientMetadata, d as ClientState, y as ClientType, b6 as Comment, C as CommerceClient, b7 as CommerceClientOptions, a as CommunityClient, b8 as CommunityClientOptions, b9 as CommunityComment, ba as CommunityCommentListSort, bb as CommunityPost, bc as CommunityPostCategory, bd as CommunityPostListSort, be as CommunityPostTag, bf as CommunityPublicAuthorSnapshot, bg as CommunityPublicMediaAsset, bh as CommunityPublicReference, bi as CompatibilityProductSelectionParamEvent, bj as ConfirmPaymentParams, bk as ConfirmPaymentResponse, b as ContentClient, k as ContentClientOptions, bl as CreateFulfillmentParams, bm as CreateOrderItem, bn as CreateOrderParams, bo as CreateReturnParams, ay as CustomerAuth, bp as CustomerAuthOptions, aA as CustomerAuthResponse, aB as CustomerLoginData, c as CustomerNamespace, bq as CustomerOrderListOptions, az as CustomerProfile, aE as CustomerRefreshResponse, aD as CustomerRegisterData, aC as CustomerRegisterResponse, br as CustomerSnapshot, D as DebugConfig, l as DeepPartial, bs as DiscountApi, bt 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, bu as FeaturedImagePointerInput, bv as LegacyProductSelectionParamEvent, bw as ListingGroupsParams, bx as MediaValue, by as NormalizedOptionSwatch, bz as NormalizedProductSelection, bA as OrderApi, bB as OrderApiOptions, bC as PRODUCT_PLP_FIND_OPTIONS, bD as PRODUCT_UPSERT_READONLY_FIELD_REASON, bE as PRODUCT_UPSERT_UNKNOWN_FIELD_REASON, P as PayloadFindResponse, n as PayloadMutationResponse, bF as PrepareFulfillmentOrderParams, bG as PrepareFulfillmentOrderResponse, bH as ProductApi, bI as ProductApiOptions, bJ as ProductDetailBrand, bK as ProductDetailCatalogResult, bL as ProductDetailCatalogVariant, bM as ProductDetailCategory, bN as ProductDetailImage, bO as ProductDetailImageMedia, bP as ProductDetailMedia, bQ as ProductDetailOption, bR as ProductDetailOptionValue, aI as ProductDetailParams, aJ as ProductDetailResult, bS as ProductDetailTag, bT as ProductDetailUnavailableReason, bU as ProductDetailVariant, bV as ProductDetailVariantOptionValue, bW as ProductDetailVideo, bX as ProductHrefGroup, bY as ProductHrefOptions, bZ as ProductHrefProduct, b_ as ProductListingCard, b$ as ProductListingCardOptions, c0 as ProductListingCardPriceRange, c1 as ProductListingCardRepresentativeVariant, c2 as ProductListingGroup, c3 as ProductListingGroupCatalogSummary, c4 as ProductListingGroupCatalogVariant, c5 as ProductListingGroupProjection, c6 as ProductListingGroupSummary, c7 as ProductListingGroupVariant, aM as ProductListingGroupsCatalogItem, c8 as ProductListingGroupsCatalogProduct, c9 as ProductListingGroupsCatalogResponse, aO as ProductListingGroupsItem, ca as ProductListingGroupsProduct, cb as ProductListingGroupsResponse, aG as ProductListingPageBaseParams, aK as ProductListingPageCatalogParams, cc as ProductListingPageFilters, aN as ProductListingPageFullParams, aH as ProductListingPageParams, aL as ProductListingPageResult, cd as ProductListingPageSort, ce as ProductListingProductShape, cf as ProductListingSwatch, cg as ProductMediaResolutionSource, ch as ProductMoneyRange, ci as ProductOptionMatrix, cj as ProductOptionMatrixOption, ck as ProductOptionMatrixValue, cl as ProductOptionMatrixVariant, cm as ProductOptionShape, cn as ProductOptionValueShape, co as ProductOptionValueSwatch, cp as ProductOptionValueSwatchInput, cq as ProductPriceRange, cr as ProductSelectionAvailableSwatch, cs as ProductSelectionAvailableValue, ct as ProductSelectionByOptionValue, cu as ProductSelectionCodecError, cv as ProductSelectionCodecOptions, cw as ProductSelectionInput, cx as ProductSelectionOptionValue, cy as ProductSelectionResolution, cz as ProductSelectionResolutionContext, cA as ProductSelectionUrlEmit, cB as ProductSelectionVariant, cC as ProductUpsertFieldValidationErrorBody, cD as ProductUpsertFieldValidationErrorReason, cE 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, ax as PublicReadQueryOptions, R as RemoveDiscountParams, w as RemoveItemParams, cF as RequestOptions, cG as ResolveCancelRefundFailedResponse, cH as ResolveCancelRefundOutcome, cI as ResolveCancelRefundParams, cJ as ResolveCancelRefundResponse, cK as ResolveCancelRefundSucceededResponse, cL as ResolveProductDisplayMediaInput, cM as ResolveProductDisplayMediaResult, x as RetryConfig, cN as ReturnItem, cO as ReturnReason, cP as ReturnWithRefundItem, cQ as ReturnWithRefundParams, y as RootClient, z as RootCollectionClient, B as RootReadOnlyQueryBuilder, O as ServerApiOptions, cR as ShippingApi, cS as ShippingApiOptions, S as Sort, cT as StockCheckParams, cU as StockCheckResponse, cV as StockCheckResult, cW as StockSnapshotItem, cX 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, cY as UpdateFulfillmentParams, U as UpdateItemParams, cZ as UpdateOrderParams, aF as UpdateProfileData, c_ as UpdateReturnParams, c$ as UpdateTransactionParams, d0 as ValidateDiscountParams, d1 as ValidateDiscountResult, W as Where, d2 as WithIdempotencyKey, d3 as buildProductHref, d4 as buildProductListingCard, d5 as buildProductListingGroupProjection, d6 as buildProductListingGroupsByOption, d7 as buildProductOptionMatrix, d8 as buildProductOptionMatrixFromDetail, d9 as createProductSelectionCodec, da as getAvailableOptionValues, db as getProductSelectionImages, dc as getSelectedValueByOptionId, dd as isProductUpsertFieldValidationErrorBody, de as normalizeProductSelection, df as normalizeProductSelectionFromMatrix, dg as normalizeSelectedValueIds, dh as parseProductSelection, di as resolveFeaturedImagePointer, dj as resolveProductDisplayMedia, dk as resolveProductSelection, dl as resolveProductSelectionFromMatrix, dm as resolveProductSelectionMedia, dn as resolveVariantForSelection, dp as selectNext, dq as selectedSwatchMediaItemId, dr as stringifyProductSelection, ds as toShopifyPriceRangeV2 } from './types-Umd-YTjM.js';
|
|
3
|
+
import { P as Product } from './payload-types-DC0xzR9i.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-DC0xzR9i.js';
|
|
5
|
+
export { C as CollectionType, P as Product, a as ProductCollection } from './types-Bh2p-EMc.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-w36lpSkU.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-ymprfiPf.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';
|
|
@@ -63,7 +63,7 @@ type ResolveProductGalleryInput<TMedia> = ResolveProductSelectionMediaInput<TMed
|
|
|
63
63
|
mediaSets?: ProductMediaSetInput[] | null;
|
|
64
64
|
selectedVariantId?: string | number | null;
|
|
65
65
|
selectedOptionValueIds?: Array<string | number | null | undefined> | null;
|
|
66
|
-
|
|
66
|
+
featuredImage?: ProductSelectionMediaPointer;
|
|
67
67
|
};
|
|
68
68
|
/** @deprecated Use selection or display media source types. */
|
|
69
69
|
type ProductGallerySource = ProductSelectionMediaSource | ProductDisplayMediaSource | LegacyProductGallerySource;
|
package/dist/index.js
CHANGED
|
@@ -1526,6 +1526,19 @@ var CustomerAuth = class {
|
|
|
1526
1526
|
const params = new URLSearchParams();
|
|
1527
1527
|
if (options?.page) params.set("page", String(options.page));
|
|
1528
1528
|
if (options?.limit) params.set("limit", String(options.limit));
|
|
1529
|
+
if (options?.displayFinancialStatus) {
|
|
1530
|
+
params.set("displayFinancialStatus", options.displayFinancialStatus);
|
|
1531
|
+
}
|
|
1532
|
+
if (options?.displayFulfillmentStatus) {
|
|
1533
|
+
params.set("displayFulfillmentStatus", options.displayFulfillmentStatus);
|
|
1534
|
+
}
|
|
1535
|
+
if (options?.returnStatus) params.set("returnStatus", options.returnStatus);
|
|
1536
|
+
if (options?.primaryDisplayStatus) {
|
|
1537
|
+
params.set("primaryDisplayStatus", options.primaryDisplayStatus);
|
|
1538
|
+
}
|
|
1539
|
+
if (options?.returnDisplayStatus) {
|
|
1540
|
+
params.set("returnDisplayStatus", options.returnDisplayStatus);
|
|
1541
|
+
}
|
|
1529
1542
|
if (options?.status) params.set("status", options.status);
|
|
1530
1543
|
const qs = params.toString();
|
|
1531
1544
|
return this.requestJson(`/api/customers/me/orders${qs ? `?${qs}` : ""}`, {
|
|
@@ -1798,25 +1811,14 @@ function resolveProductSelectionMedia(input) {
|
|
|
1798
1811
|
function resolveProductDisplayMedia(input) {
|
|
1799
1812
|
const pool = mediaArray(input.productMediaPool);
|
|
1800
1813
|
const poolById = buildPoolById(pool);
|
|
1801
|
-
const
|
|
1802
|
-
if (
|
|
1803
|
-
const
|
|
1804
|
-
if (
|
|
1814
|
+
const featuredImagePointer = toPointerId(input.featuredImage);
|
|
1815
|
+
if (featuredImagePointer) {
|
|
1816
|
+
const featuredImage = poolById.get(featuredImagePointer);
|
|
1817
|
+
if (featuredImage) {
|
|
1805
1818
|
return {
|
|
1806
|
-
primaryImage:
|
|
1807
|
-
images: uniqueWithPrimaryFirst(
|
|
1808
|
-
source: "
|
|
1809
|
-
};
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
const productPrimaryPointer = getMediaId(input.productPrimaryMediaItemId);
|
|
1813
|
-
if (productPrimaryPointer) {
|
|
1814
|
-
const productPrimary = poolById.get(productPrimaryPointer);
|
|
1815
|
-
if (productPrimary) {
|
|
1816
|
-
return {
|
|
1817
|
-
primaryImage: productPrimary,
|
|
1818
|
-
images: uniqueWithPrimaryFirst(productPrimary, pool),
|
|
1819
|
-
source: "product_primary"
|
|
1819
|
+
primaryImage: featuredImage,
|
|
1820
|
+
images: uniqueWithPrimaryFirst(featuredImage, pool),
|
|
1821
|
+
source: "featured_image"
|
|
1820
1822
|
};
|
|
1821
1823
|
}
|
|
1822
1824
|
}
|
|
@@ -1836,22 +1838,16 @@ function resolveProductDisplayMedia(input) {
|
|
|
1836
1838
|
source: "none"
|
|
1837
1839
|
};
|
|
1838
1840
|
}
|
|
1839
|
-
function
|
|
1841
|
+
function resolveFeaturedImagePointer(input) {
|
|
1840
1842
|
const pool = mediaArray(input.productMediaPool);
|
|
1841
1843
|
const resolvedPointer = getMediaId(input.resolvedPrimary);
|
|
1842
1844
|
if (resolvedPointer && input.resolvedSource !== "product_pool" && input.resolvedSource !== "none") {
|
|
1843
1845
|
return resolvedPointer;
|
|
1844
1846
|
}
|
|
1845
1847
|
const poolById = buildPoolById(pool);
|
|
1846
|
-
const
|
|
1847
|
-
if (
|
|
1848
|
-
return
|
|
1849
|
-
}
|
|
1850
|
-
const primaryPointer = toPointerId(input.productPrimaryMediaItemId);
|
|
1851
|
-
if (primaryPointer && poolById.has(primaryPointer)) return primaryPointer;
|
|
1852
|
-
const thumbnailPointer = getMediaId(input.productThumbnail);
|
|
1853
|
-
if (thumbnailPointer && poolById.has(thumbnailPointer)) {
|
|
1854
|
-
return thumbnailPointer;
|
|
1848
|
+
const featuredImagePointer = getMediaId(input.featuredImage);
|
|
1849
|
+
if (featuredImagePointer && poolById.has(featuredImagePointer)) {
|
|
1850
|
+
return featuredImagePointer;
|
|
1855
1851
|
}
|
|
1856
1852
|
if (pool.length > 0) {
|
|
1857
1853
|
const firstPoolId = getMediaId(pool[0]);
|
|
@@ -1930,18 +1926,22 @@ function getFirstMediaId(values) {
|
|
|
1930
1926
|
}
|
|
1931
1927
|
return null;
|
|
1932
1928
|
}
|
|
1929
|
+
function inProductMediaPool(product, mediaId2) {
|
|
1930
|
+
if (mediaId2 == null) return null;
|
|
1931
|
+
const images = Array.isArray(product?.images) ? product.images : [];
|
|
1932
|
+
for (const image of images) {
|
|
1933
|
+
if (extractEntityId(image) === mediaId2) return mediaId2;
|
|
1934
|
+
}
|
|
1935
|
+
return null;
|
|
1936
|
+
}
|
|
1933
1937
|
function getVariantPrimaryImage(variant) {
|
|
1934
1938
|
if (!variant) return null;
|
|
1935
1939
|
return extractEntityId(variant.thumbnail) ?? getFirstMediaId(variant.images);
|
|
1936
1940
|
}
|
|
1937
1941
|
function resolveGenericListingPrimaryImage(product, resolvedPrimary, resolvedSource) {
|
|
1938
|
-
return
|
|
1942
|
+
return resolveFeaturedImagePointer({
|
|
1939
1943
|
productMediaPool: product?.images ?? [],
|
|
1940
|
-
|
|
1941
|
-
product?.primaryMediaItemId ?? null
|
|
1942
|
-
),
|
|
1943
|
-
productThumbnail: product?.thumbnail ?? null,
|
|
1944
|
-
listingPrimaryImage: product?.listing?.primaryImage ?? null,
|
|
1944
|
+
featuredImage: product?.featuredImage ?? null,
|
|
1945
1945
|
resolvedPrimary,
|
|
1946
1946
|
resolvedSource
|
|
1947
1947
|
});
|
|
@@ -2594,7 +2594,7 @@ function normalizedSelectionFromByOptionId(matrix, selectedByOptionId, variantId
|
|
|
2594
2594
|
variantId
|
|
2595
2595
|
};
|
|
2596
2596
|
}
|
|
2597
|
-
function buildFilledNormalizedSelection(matrix, normalizedSelection,
|
|
2597
|
+
function buildFilledNormalizedSelection(matrix, normalizedSelection, selectionHintVariant) {
|
|
2598
2598
|
const selectedByOptionId = new Map(
|
|
2599
2599
|
Object.entries(normalizedSelection.byOptionId)
|
|
2600
2600
|
);
|
|
@@ -2635,7 +2635,7 @@ function buildFilledNormalizedSelection(matrix, normalizedSelection, listing) {
|
|
|
2635
2635
|
const orderedMatches = [...matchingVariantEntries].sort(
|
|
2636
2636
|
(left, right) => compareVariantOrder(left.source, right.source)
|
|
2637
2637
|
);
|
|
2638
|
-
const hintVariantId =
|
|
2638
|
+
const hintVariantId = selectionHintVariant != null ? String(selectionHintVariant) : null;
|
|
2639
2639
|
const hintedEntry = hintVariantId != null ? orderedMatches.find((entry) => entry.id === hintVariantId) : void 0;
|
|
2640
2640
|
const availableEntry = orderedMatches.find(
|
|
2641
2641
|
(entry) => isVariantAvailableForSale(entry.source)
|
|
@@ -2694,7 +2694,6 @@ function buildSelectionMedia(detail, selectedVariant, matchingVariants, selected
|
|
|
2694
2694
|
const productPool = mediaArray2(detail.images);
|
|
2695
2695
|
const resolvedMedia = resolveProductSelectionMedia({
|
|
2696
2696
|
productMediaPool: productPool,
|
|
2697
|
-
productPrimaryMediaItemId: getRelationID(detail.primaryMediaItemId),
|
|
2698
2697
|
selectedVariant: selectedVariant ? {
|
|
2699
2698
|
id: selectedVariant.id,
|
|
2700
2699
|
images: selectedVariant.images
|
|
@@ -2717,8 +2716,7 @@ function buildSelectionMedia(detail, selectedVariant, matchingVariants, selected
|
|
|
2717
2716
|
}
|
|
2718
2717
|
const displayMedia = resolveProductDisplayMedia({
|
|
2719
2718
|
productMediaPool: productPool,
|
|
2720
|
-
|
|
2721
|
-
listingPrimaryImage: detail.listing.primaryImage ?? null
|
|
2719
|
+
featuredImage: detail.featuredImage ?? null
|
|
2722
2720
|
});
|
|
2723
2721
|
if (displayMedia.source !== "none") {
|
|
2724
2722
|
return {
|
|
@@ -2788,14 +2786,15 @@ function getCandidateVariantsForValue(matrix, optionId, valueId, selectedValueId
|
|
|
2788
2786
|
}
|
|
2789
2787
|
function getResolutionContext(context) {
|
|
2790
2788
|
return {
|
|
2789
|
+
featuredImage: context?.featuredImage ?? context?.detail?.featuredImage,
|
|
2791
2790
|
images: context?.images ?? context?.detail?.images ?? [],
|
|
2792
|
-
|
|
2793
|
-
primaryMediaItemId: context?.primaryMediaItemId ?? context?.detail?.primaryMediaItemId ?? null
|
|
2791
|
+
selectedOrFirstAvailableVariant: context?.selectedOrFirstAvailableVariant ?? context?.detail?.selectedOrFirstAvailableVariant
|
|
2794
2792
|
};
|
|
2795
2793
|
}
|
|
2796
2794
|
function resolveProductSelectionFromMatrix(matrix, selection = {}, options, context) {
|
|
2797
|
-
const {
|
|
2798
|
-
const
|
|
2795
|
+
const { featuredImage, images, selectedOrFirstAvailableVariant } = getResolutionContext(context);
|
|
2796
|
+
const selectionHintVariant = getRelationID(selectedOrFirstAvailableVariant);
|
|
2797
|
+
const effectiveSelection = hasExplicitSelection(selection) || selectionHintVariant == null ? selection : { ...selection, variantId: selectionHintVariant };
|
|
2799
2798
|
let normalizedSelection = normalizeProductSelectionFromMatrix(
|
|
2800
2799
|
matrix,
|
|
2801
2800
|
effectiveSelection,
|
|
@@ -2805,7 +2804,7 @@ function resolveProductSelectionFromMatrix(matrix, selection = {}, options, cont
|
|
|
2805
2804
|
normalizedSelection = buildFilledNormalizedSelection(
|
|
2806
2805
|
matrix,
|
|
2807
2806
|
normalizedSelection,
|
|
2808
|
-
|
|
2807
|
+
selectionHintVariant
|
|
2809
2808
|
);
|
|
2810
2809
|
}
|
|
2811
2810
|
const matchingVariantEntries = getMatchingVariantEntries(
|
|
@@ -2876,11 +2875,8 @@ function resolveProductSelectionFromMatrix(matrix, selection = {}, options, cont
|
|
|
2876
2875
|
price: buildSelectionPrice(priceVariants),
|
|
2877
2876
|
media: buildSelectionMedia(
|
|
2878
2877
|
{
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
primaryImage: listing.primaryImage ?? null
|
|
2882
|
-
},
|
|
2883
|
-
primaryMediaItemId
|
|
2878
|
+
featuredImage,
|
|
2879
|
+
images
|
|
2884
2880
|
},
|
|
2885
2881
|
selectedVariant,
|
|
2886
2882
|
matchingVariants,
|
|
@@ -2897,7 +2893,9 @@ function resolveProductSelection(detail, selection = {}, options) {
|
|
|
2897
2893
|
}
|
|
2898
2894
|
function selectNext(detail, current = {}, optionSlug, valueSlug, options) {
|
|
2899
2895
|
const matrix = buildProductOptionMatrixFromDetail(detail);
|
|
2900
|
-
const
|
|
2896
|
+
const selectionHintVariant = getRelationID(
|
|
2897
|
+
detail.selectedOrFirstAvailableVariant
|
|
2898
|
+
);
|
|
2901
2899
|
const normalizedCurrent = normalizeProductSelectionFromMatrix(
|
|
2902
2900
|
matrix,
|
|
2903
2901
|
current,
|
|
@@ -2933,7 +2931,7 @@ function selectNext(detail, current = {}, optionSlug, valueSlug, options) {
|
|
|
2933
2931
|
return buildFilledNormalizedSelection(
|
|
2934
2932
|
matrix,
|
|
2935
2933
|
normalizedSelectionFromByOptionId(matrix, selectedByOptionId, null),
|
|
2936
|
-
|
|
2934
|
+
selectionHintVariant
|
|
2937
2935
|
);
|
|
2938
2936
|
};
|
|
2939
2937
|
const keepPriorSelection = () => {
|
|
@@ -2944,7 +2942,7 @@ function selectNext(detail, current = {}, optionSlug, valueSlug, options) {
|
|
|
2944
2942
|
return buildFilledNormalizedSelection(
|
|
2945
2943
|
matrix,
|
|
2946
2944
|
normalizedSelectionFromByOptionId(matrix, selectedByOptionId, null),
|
|
2947
|
-
|
|
2945
|
+
selectionHintVariant
|
|
2948
2946
|
);
|
|
2949
2947
|
};
|
|
2950
2948
|
const clickedResult = keepClickedSelection();
|
|
@@ -3154,7 +3152,7 @@ function getMinMax(values) {
|
|
|
3154
3152
|
max: Math.max(...numbers)
|
|
3155
3153
|
};
|
|
3156
3154
|
}
|
|
3157
|
-
function
|
|
3155
|
+
function buildProductListingGroupProjection(product, variants) {
|
|
3158
3156
|
const orderedVariants = [...variants].sort(compareVariantOrder);
|
|
3159
3157
|
const activeVariants = orderedVariants.filter(
|
|
3160
3158
|
(variant) => variant.isActive !== false
|
|
@@ -3175,7 +3173,6 @@ function buildProductListingProjection(product, variants) {
|
|
|
3175
3173
|
const mediaSelectionVariants = sortVariantsForMediaSelection(variants);
|
|
3176
3174
|
const resolvedProductMedia = resolveProductSelectionMedia({
|
|
3177
3175
|
productMediaPool,
|
|
3178
|
-
productPrimaryMediaItemId: getRelationID(product?.primaryMediaItemId),
|
|
3179
3176
|
selectedVariant: selectionHintVariant && selectionHintHasPoolMedia ? {
|
|
3180
3177
|
id: selectionHintVariant.id,
|
|
3181
3178
|
images: selectionHintVariant.images
|
|
@@ -3201,47 +3198,22 @@ function buildProductListingCard(item, options = {}) {
|
|
|
3201
3198
|
const product = item.product;
|
|
3202
3199
|
const groups = item.groups;
|
|
3203
3200
|
const variants = getProductListingCardVariants(item);
|
|
3204
|
-
const projectedListing =
|
|
3205
|
-
const selectionHintVariant = getRelationID(
|
|
3206
|
-
product.listing && "selectionHintVariant" in product.listing ? product.listing.selectionHintVariant : null
|
|
3207
|
-
) ?? projectedListing.selectionHintVariant;
|
|
3201
|
+
const projectedListing = buildProductListingGroupProjection(product, variants);
|
|
3202
|
+
const selectionHintVariant = getRelationID(product.selectedOrFirstAvailableVariant) ?? projectedListing.selectionHintVariant;
|
|
3208
3203
|
const representativeVariant = findListingCardRepresentativeVariant(
|
|
3209
3204
|
variants,
|
|
3210
3205
|
selectionHintVariant
|
|
3211
3206
|
);
|
|
3212
3207
|
const productMediaPool = mediaArray2(product.images);
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
(poolItem) => getRelationID(poolItem) === getRelationID(image)
|
|
3217
|
-
)
|
|
3218
|
-
)
|
|
3219
|
-
);
|
|
3220
|
-
const resolvedPrimaryMedia = resolveProductSelectionMedia(
|
|
3221
|
-
{
|
|
3222
|
-
productMediaPool,
|
|
3223
|
-
productPrimaryMediaItemId: getRelationID(product.primaryMediaItemId),
|
|
3224
|
-
selectedVariant: representativeHasPoolMedia ? representativeVariant : null,
|
|
3225
|
-
matchingVariants: representativeHasPoolMedia ? [] : variants
|
|
3226
|
-
}
|
|
3227
|
-
);
|
|
3228
|
-
const listingPrimaryPointer = resolveListingPrimaryImagePointer({
|
|
3229
|
-
productMediaPool,
|
|
3230
|
-
productPrimaryMediaItemId: getRelationID(product.primaryMediaItemId),
|
|
3231
|
-
productThumbnail: product.thumbnail ?? null,
|
|
3232
|
-
listingPrimaryImage: product.listing?.primaryImage ?? null,
|
|
3233
|
-
resolvedPrimary: resolvedPrimaryMedia.primaryImage,
|
|
3234
|
-
resolvedSource: resolvedPrimaryMedia.source
|
|
3235
|
-
});
|
|
3236
|
-
const listingPrimaryMedia = listingPrimaryPointer ? productMediaPool.find(
|
|
3237
|
-
(item2) => getRelationID(item2) === listingPrimaryPointer
|
|
3238
|
-
) ?? resolvedPrimaryMedia.primaryImage ?? null : null;
|
|
3208
|
+
const featuredImageId = getRelationID(product.featuredImage);
|
|
3209
|
+
const featuredImageFromPool = featuredImageId ? productMediaPool.find((item2) => getRelationID(item2) === featuredImageId) : void 0;
|
|
3210
|
+
const listingPrimaryMedia = featuredImageFromPool ?? product.featuredImage ?? productMediaPool[0] ?? null;
|
|
3239
3211
|
const priceRange = resolveListingCardPriceRange(
|
|
3240
3212
|
product,
|
|
3241
3213
|
projectedListing,
|
|
3242
3214
|
groups
|
|
3243
3215
|
);
|
|
3244
|
-
const availableForSale = product.
|
|
3216
|
+
const availableForSale = product.availableForSale != null ? product.availableForSale : groups.length > 0 ? groups.some((group) => group.listing.availableForSale) : projectedListing.availableForSale;
|
|
3245
3217
|
const swatches = groups.length > 1 ? groups.map((group) => buildListingSwatch(product, group, options)) : [];
|
|
3246
3218
|
return {
|
|
3247
3219
|
id: String(product.id),
|
|
@@ -3287,23 +3259,20 @@ function toShopifyPriceRangeV2(listing) {
|
|
|
3287
3259
|
maxVariantPrice: { amount: listing.maxPrice ?? null }
|
|
3288
3260
|
};
|
|
3289
3261
|
}
|
|
3290
|
-
function
|
|
3291
|
-
return
|
|
3292
|
-
}
|
|
3293
|
-
function listingDefinesCompareAtProjection(listing) {
|
|
3294
|
-
return "minCompareAtPrice" in listing || "maxCompareAtPrice" in listing;
|
|
3262
|
+
function hasCompleteProductPriceRange(priceRange) {
|
|
3263
|
+
return priceRange?.minVariantPrice?.amount != null && priceRange?.maxVariantPrice?.amount != null;
|
|
3295
3264
|
}
|
|
3296
3265
|
function resolveListingCardPriceRange(product, projectedListing, groups) {
|
|
3297
|
-
|
|
3298
|
-
if (hasCompleteListingPriceProjection(listing)) {
|
|
3266
|
+
if (hasCompleteProductPriceRange(product.priceRange)) {
|
|
3299
3267
|
const groupRange = groups.length > 0 ? aggregateListingPriceRange(groups) : null;
|
|
3300
|
-
const
|
|
3268
|
+
const minCompareAtPrice = product.compareAtPriceRange?.minVariantPrice?.amount ?? groupRange?.minCompareAtPrice ?? null;
|
|
3269
|
+
const maxCompareAtPrice = product.compareAtPriceRange?.maxVariantPrice?.amount ?? groupRange?.maxCompareAtPrice ?? null;
|
|
3301
3270
|
return {
|
|
3302
|
-
minPrice:
|
|
3303
|
-
maxPrice:
|
|
3304
|
-
minCompareAtPrice
|
|
3305
|
-
maxCompareAtPrice
|
|
3306
|
-
isPriceRange:
|
|
3271
|
+
minPrice: product.priceRange.minVariantPrice.amount,
|
|
3272
|
+
maxPrice: product.priceRange.maxVariantPrice.amount,
|
|
3273
|
+
minCompareAtPrice,
|
|
3274
|
+
maxCompareAtPrice,
|
|
3275
|
+
isPriceRange: product.priceRange.isPriceRange ?? product.priceRange.minVariantPrice.amount !== product.priceRange.maxVariantPrice.amount
|
|
3307
3276
|
};
|
|
3308
3277
|
}
|
|
3309
3278
|
if (groups.length > 0) {
|
|
@@ -3385,26 +3354,13 @@ function buildProductListingGroupsByOption(args) {
|
|
|
3385
3354
|
if (variants.length === 0) {
|
|
3386
3355
|
return [];
|
|
3387
3356
|
}
|
|
3388
|
-
const listingBase =
|
|
3389
|
-
const
|
|
3390
|
-
const
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
productPrimaryMediaItemId: extractEntityId(
|
|
3396
|
-
args.product?.primaryMediaItemId ?? null
|
|
3397
|
-
),
|
|
3398
|
-
selectedVariant: null,
|
|
3399
|
-
matchingVariants: orderedVariants,
|
|
3400
|
-
selectedOptionValues: [
|
|
3401
|
-
{
|
|
3402
|
-
id: value.id,
|
|
3403
|
-
swatch: normalizeMatrixSwatch(value.swatch)
|
|
3404
|
-
}
|
|
3405
|
-
]
|
|
3406
|
-
});
|
|
3407
|
-
const groupPrimaryImage = extractEntityId(resolvedMedia.primaryImage) ?? getFirstAvailableVariantPrimaryImage(variants) ?? extractEntityId(args.product?.thumbnail) ?? getFirstMediaId(args.product?.images);
|
|
3357
|
+
const listingBase = buildProductListingGroupProjection(void 0, variants);
|
|
3358
|
+
const normalizedSwatch = normalizeMatrixSwatch(value.swatch);
|
|
3359
|
+
const swatchMediaId = normalizedSwatch?.mediaItemId == null ? null : String(normalizedSwatch.mediaItemId);
|
|
3360
|
+
const groupPrimaryImage = inProductMediaPool(args.product, swatchMediaId) ?? inProductMediaPool(
|
|
3361
|
+
args.product,
|
|
3362
|
+
getFirstAvailableVariantPrimaryImage(variants)
|
|
3363
|
+
) ?? getFirstMediaId(args.product?.images);
|
|
3408
3364
|
return [
|
|
3409
3365
|
{
|
|
3410
3366
|
optionId: primaryOption.id,
|
|
@@ -3477,15 +3433,19 @@ function buildProductListingPageWhere(params) {
|
|
|
3477
3433
|
if (tagIds) clauses.push({ tags: { in: tagIds } });
|
|
3478
3434
|
const minPrice = filters?.price?.min;
|
|
3479
3435
|
if (minPrice != null) {
|
|
3480
|
-
clauses.push({
|
|
3436
|
+
clauses.push({
|
|
3437
|
+
"priceRange.maxVariantPrice.amount": { greater_than_equal: minPrice }
|
|
3438
|
+
});
|
|
3481
3439
|
}
|
|
3482
3440
|
const maxPrice = filters?.price?.max;
|
|
3483
3441
|
if (maxPrice != null) {
|
|
3484
|
-
clauses.push({
|
|
3442
|
+
clauses.push({
|
|
3443
|
+
"priceRange.minVariantPrice.amount": { less_than_equal: maxPrice }
|
|
3444
|
+
});
|
|
3485
3445
|
}
|
|
3486
3446
|
if (filters?.availableForSale != null) {
|
|
3487
3447
|
clauses.push({
|
|
3488
|
-
|
|
3448
|
+
availableForSale: { equals: filters.availableForSale }
|
|
3489
3449
|
});
|
|
3490
3450
|
}
|
|
3491
3451
|
if (clauses.length === 0) return void 0;
|
|
@@ -3710,6 +3670,12 @@ var OrderApi = class extends BaseApi {
|
|
|
3710
3670
|
idempotencyRequestOptions(params.idempotencyKey)
|
|
3711
3671
|
);
|
|
3712
3672
|
}
|
|
3673
|
+
/**
|
|
3674
|
+
* Returns a `PublicOrder`-compatible shape even when the server backs the
|
|
3675
|
+
* response with a Checkout (checkout/order separation, #1285). `orderNumber`
|
|
3676
|
+
* stays the stable cross-window key. A breaking `PublicCheckout` split is a
|
|
3677
|
+
* deferred follow-up (design D10 / Q3-b); do not change this return type here.
|
|
3678
|
+
*/
|
|
3713
3679
|
checkout(params) {
|
|
3714
3680
|
const { body, idempotencyKey } = splitIdempotencyKey(params);
|
|
3715
3681
|
return this.request(
|
|
@@ -4087,17 +4053,19 @@ function mergeProductDetailWithStock(catalog, snapshot) {
|
|
|
4087
4053
|
(sum, variant) => sum + Math.max(0, (variant.stock ?? 0) - (variant.reservedStock ?? 0)),
|
|
4088
4054
|
0
|
|
4089
4055
|
);
|
|
4090
|
-
const { liveStockRequired: _liveStockRequired, ...listingBase } = catalog.listing;
|
|
4091
4056
|
const availableForSale = snapshot.snapshots.some(
|
|
4092
4057
|
(item) => item.status === "available" && item.availableForSale
|
|
4093
4058
|
);
|
|
4059
|
+
const selectedVariantId = typeof catalog.selectedOrFirstAvailableVariant === "object" && catalog.selectedOrFirstAvailableVariant !== null ? String(catalog.selectedOrFirstAvailableVariant.id) : catalog.selectedOrFirstAvailableVariant != null ? String(catalog.selectedOrFirstAvailableVariant) : null;
|
|
4060
|
+
const selectedOrFirstAvailableVariant = selectedVariantId != null ? variants.find((variant) => String(variant.id) === selectedVariantId) ?? selectedVariantId : null;
|
|
4094
4061
|
return {
|
|
4095
4062
|
stockMergeStatus: missingSnapshotCount === 0 ? "complete" : "partial",
|
|
4096
4063
|
product: {
|
|
4097
4064
|
...catalog,
|
|
4098
4065
|
product: { ...catalog.product, totalInventory },
|
|
4099
4066
|
variants,
|
|
4100
|
-
|
|
4067
|
+
availableForSale,
|
|
4068
|
+
selectedOrFirstAvailableVariant
|
|
4101
4069
|
}
|
|
4102
4070
|
};
|
|
4103
4071
|
}
|
|
@@ -4377,6 +4345,7 @@ var INTERNAL_COLLECTIONS = [
|
|
|
4377
4345
|
"commerce-notification-intents",
|
|
4378
4346
|
"product-collection-items",
|
|
4379
4347
|
"order-status-logs",
|
|
4348
|
+
"tenant-commerce-config",
|
|
4380
4349
|
"api-keys",
|
|
4381
4350
|
"personal-access-tokens",
|
|
4382
4351
|
"tenant-entitlements",
|
|
@@ -4401,6 +4370,7 @@ var COLLECTIONS = [
|
|
|
4401
4370
|
"product-collections",
|
|
4402
4371
|
"brands",
|
|
4403
4372
|
"customer-profiles",
|
|
4373
|
+
"customer-profile-stats",
|
|
4404
4374
|
"discounts",
|
|
4405
4375
|
"shipping-policies",
|
|
4406
4376
|
"shipping-zones",
|
|
@@ -4429,8 +4399,6 @@ var COLLECTIONS = [
|
|
|
4429
4399
|
"canvas-edge-types",
|
|
4430
4400
|
"canvas-categories",
|
|
4431
4401
|
"canvas-tags",
|
|
4432
|
-
"canvas-nodes",
|
|
4433
|
-
"canvas-edges",
|
|
4434
4402
|
"video-categories",
|
|
4435
4403
|
"video-tags",
|
|
4436
4404
|
"forms",
|
|
@@ -4465,11 +4433,15 @@ var SERVER_ONLY_COLLECTIONS = [
|
|
|
4465
4433
|
"form-submissions",
|
|
4466
4434
|
"carts",
|
|
4467
4435
|
"cart-items",
|
|
4436
|
+
"checkouts",
|
|
4437
|
+
"checkout-items",
|
|
4468
4438
|
"posts",
|
|
4469
4439
|
"comments",
|
|
4470
4440
|
"reactions",
|
|
4471
4441
|
"bookmarks",
|
|
4472
4442
|
"live-streams",
|
|
4443
|
+
"canvas-nodes",
|
|
4444
|
+
"canvas-edges",
|
|
4473
4445
|
"customer-groups",
|
|
4474
4446
|
"reports",
|
|
4475
4447
|
"community-bans",
|
|
@@ -4647,8 +4619,7 @@ function resolveProductMedia(input) {
|
|
|
4647
4619
|
};
|
|
4648
4620
|
}
|
|
4649
4621
|
const display = resolveProductDisplayMedia({
|
|
4650
|
-
productMediaPool: input.productMediaPool
|
|
4651
|
-
productPrimaryMediaItemId: input.productPrimaryMediaItemId
|
|
4622
|
+
productMediaPool: input.productMediaPool
|
|
4652
4623
|
});
|
|
4653
4624
|
return {
|
|
4654
4625
|
primaryImage: display.primaryImage,
|
|
@@ -4776,8 +4747,7 @@ function resolveProductGallery(input) {
|
|
|
4776
4747
|
if (legacyResolved && legacyResolved.source !== "none") return legacyResolved;
|
|
4777
4748
|
return resolveProductDisplayMedia({
|
|
4778
4749
|
productMediaPool: input.productMediaPool ?? input.pool ?? null,
|
|
4779
|
-
|
|
4780
|
-
listingPrimaryImage: input.listingPrimaryImage
|
|
4750
|
+
featuredImage: input.featuredImage
|
|
4781
4751
|
});
|
|
4782
4752
|
}
|
|
4783
4753
|
|
|
@@ -5146,8 +5116,8 @@ export {
|
|
|
5146
5116
|
ValidationError,
|
|
5147
5117
|
buildProductHref,
|
|
5148
5118
|
buildProductListingCard,
|
|
5119
|
+
buildProductListingGroupProjection,
|
|
5149
5120
|
buildProductListingGroupsByOption,
|
|
5150
|
-
buildProductListingProjection,
|
|
5151
5121
|
buildProductOptionMatrix,
|
|
5152
5122
|
buildProductOptionMatrixFromDetail,
|
|
5153
5123
|
createAnalytics,
|
|
@@ -5206,7 +5176,7 @@ export {
|
|
|
5206
5176
|
normalizeProductSelectionFromMatrix,
|
|
5207
5177
|
normalizeSelectedValueIds,
|
|
5208
5178
|
parseProductSelection,
|
|
5209
|
-
|
|
5179
|
+
resolveFeaturedImagePointer,
|
|
5210
5180
|
resolveProductDisplayMedia,
|
|
5211
5181
|
resolveProductGallery,
|
|
5212
5182
|
resolveProductMedia,
|