@01.software/sdk 0.40.0 → 0.41.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 +492 -0
- package/MIGRATION.md +183 -0
- package/README.md +12 -1
- package/dist/client.cjs +4 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +4 -1
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-VYwYi6u6.d.cts → collection-client-Bymfni8u.d.cts} +1 -1
- package/dist/{collection-client-CKFa99C6.d.ts → collection-client-CN4lj6gi.d.ts} +1 -1
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/query.d.cts +2 -2
- package/dist/query.d.ts +2 -2
- package/dist/server.cjs +4 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +4 -1
- package/dist/server.js.map +1 -1
- package/dist/{types-D5uHrPLr.d.cts → types-Bl-m9ttd.d.cts} +31 -1
- package/dist/{types-Umd-YTjM.d.ts → types-CHrzs2GB.d.ts} +31 -1
- package/package.json +6 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, 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
|
|
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-Bl-m9ttd.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 getVariantAvailableForSale, de as getVariantAvailableStock, df as isProductUpsertFieldValidationErrorBody, dg as normalizeProductSelection, dh as normalizeProductSelectionFromMatrix, di as normalizeSelectedValueIds, dj as parseProductSelection, dk as projectProductToListingShape, dl as resolveFeaturedImagePointer, dm as resolveProductDisplayMedia, dn as resolveProductSelection, dp as resolveProductSelectionFromMatrix, dq as resolveProductSelectionMedia, dr as resolveVariantForSelection, ds as selectNext, dt as selectedSwatchMediaItemId, du as stringifyProductSelection, dv as toShopifyPriceRangeV2 } from './types-Bl-m9ttd.cjs';
|
|
3
3
|
import { P as Product } from './payload-types-DC0xzR9i.cjs';
|
|
4
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
5
|
export { C as CollectionType, P as Product, a as ProductCollection } from './types-BvpjooU-.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, 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
|
|
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-CHrzs2GB.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 getVariantAvailableForSale, de as getVariantAvailableStock, df as isProductUpsertFieldValidationErrorBody, dg as normalizeProductSelection, dh as normalizeProductSelectionFromMatrix, di as normalizeSelectedValueIds, dj as parseProductSelection, dk as projectProductToListingShape, dl as resolveFeaturedImagePointer, dm as resolveProductDisplayMedia, dn as resolveProductSelection, dp as resolveProductSelectionFromMatrix, dq as resolveProductSelectionMedia, dr as resolveVariantForSelection, ds as selectNext, dt as selectedSwatchMediaItemId, du as stringifyProductSelection, dv as toShopifyPriceRangeV2 } from './types-CHrzs2GB.js';
|
|
3
3
|
import { P as Product } from './payload-types-DC0xzR9i.js';
|
|
4
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
5
|
export { C as CollectionType, P as Product, a as ProductCollection } from './types-Bh2p-EMc.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,
|