@cimplify/sdk 0.53.0 → 0.55.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/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-EJUKGJTZ.js → chunk-6W3AH4QW.js} +2 -2
- package/dist/{chunk-NEK7CVE2.mjs → chunk-F4WS3OIF.mjs} +1 -1
- package/dist/{chunk-B3Y4C4A7.mjs → chunk-I4IXPQIX.mjs} +7 -4
- package/dist/{chunk-YJLOOC3L.js → chunk-JGBDWEPJ.js} +7 -4
- package/dist/chunk-JYPLT56O.js +272 -0
- package/dist/{chunk-IJ32BXKZ.js → chunk-MW7ICTVK.js} +35 -35
- package/dist/{chunk-6QZQQRBB.mjs → chunk-SQ7U3BWY.mjs} +1 -1
- package/dist/chunk-XYI4NXWG.mjs +259 -0
- package/dist/{client-D1Gknspz.d.mts → client-Bhvlelij.d.mts} +1 -1
- package/dist/{client-Bj2apl_y.d.mts → client-DKg-5OWu.d.mts} +16 -1
- package/dist/{client-306peWZ0.d.ts → client-Dfg_hmkP.d.ts} +16 -1
- package/dist/{client-C2bKMy5g.d.ts → client-DlGJqSDd.d.ts} +1 -1
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +160 -72
- package/dist/index.mjs +91 -3
- package/dist/react.d.mts +52 -5
- package/dist/react.d.ts +52 -5
- package/dist/react.js +592 -512
- package/dist/react.mjs +136 -58
- package/dist/server.d.mts +59 -35
- package/dist/server.d.ts +59 -35
- package/dist/server.js +160 -79
- package/dist/server.mjs +153 -78
- package/dist/{ads-C2c2Aald.d.mts → sign-in-TL01-awQ.d.mts} +17 -1
- package/dist/{ads-C2c2Aald.d.ts → sign-in-TL01-awQ.d.ts} +17 -1
- package/dist/styles.css +1 -1
- package/dist/testing/suite.d.mts +2 -2
- package/dist/testing/suite.d.ts +2 -2
- package/dist/testing/suite.js +22 -22
- package/dist/testing/suite.mjs +3 -3
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +78 -78
- package/dist/testing.mjs +4 -4
- package/package.json +2 -1
- package/registry/account.json +1 -1
- package/dist/chunk-MN4PNKJA.js +0 -129
- package/dist/chunk-NRDRVZ62.mjs +0 -119
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as AUTHORIZATION_TYPE, a as AUTH_MUTATION, b as AbortablePromise, c as ActivityRecommendation, d as ActivityRecommendationsResponse, e as ActivityService, f as ActivityStateResponse, g as AddressData, h as AddressInfo, i as AmountToPay, j as AuthResponse, k as AuthService, l as AuthStatus, m as AuthenticatedCustomer, n as AuthenticatedData, o as AutocompletePrediction, p as AutocompleteResponse, q as AvailabilityResult, r as AvailableSlot, B as Booking, s as BookingModificationType, t as BookingStatus, u as BookingWithDetails, v as BufferTimes, w as Business, x as BusinessHours, y as BusinessPreferences, z as BusinessService, C as BusinessSettings, D as BusinessType, E as BusinessWithLocations, F as CHECKOUT_MODE, G as CHECKOUT_MUTATION, H as CHECKOUT_STEP, I as CONTACT_TYPE, J as CacheOptions, K as CancelBookingInput, L as CancelBookingResult, M as CancelOrderInput, N as CancellationPolicy, O as CartOperations, P as CatalogueQueries, Q as CatalogueResult, R as CatalogueSnapshot, S as CategoryInfo, T as ChatAttachment, U as ChatConversation, V as ChatConversationResponse, W as ChatMessage, X as ChatWidgetStarter, Y as CheckSlotAvailabilityInput, Z as CheckSlotAvailabilityResult, _ as CheckoutAddressInfo, $ as CheckoutCartData, a0 as CheckoutCartItem, a1 as CheckoutCustomerInfo, a2 as CheckoutFormData, a3 as CheckoutInput, a4 as CheckoutMode, a8 as CheckoutOperations, a5 as CheckoutOrderType, a6 as CheckoutPaymentMethod, a7 as CheckoutResult, a8 as CheckoutService, a9 as CheckoutStatus, aa as CheckoutStatusContext, ab as CheckoutStep, ac as CimplifyClient, ad as CimplifyConfig, ae as CimplifyElement, af as CimplifyElements, ag as ContactType, ah as ContentType, ai as CreateAddressInput, aj as CreateMobileMoneyInput, ak as Customer, al as CustomerAddress, am as CustomerBooking, an as CustomerBookingServiceItem, ao as CustomerLinkPreferences, ap as CustomerMobileMoney, aq as CustomerServicePreferences, ar as DEFAULT_COUNTRY, as as DEFAULT_CURRENCY, at as DEVICE_TYPE, au as DayAvailability, av as DeliveryFeeDetails, aw as DeliveryFeeResponse, ax as DeliveryService, ay as DepositResult, az as DeviceType, aA as DismissMessageResponse, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aD as ElementAppearance, aE as ElementEventHandler, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aI as ElementsCheckoutData, aJ as ElementsCheckoutResult, aK as ElementsCustomerInfo, aL as ElementsOptions, aM as EnrollAndLinkOrderInput, aN as EnrollAndLinkOrderResult, aO as EnrollmentData, aP as Err, aQ as FeeBearerType, aR as FetchQuoteInput, aS as FulfillmentLink, aT as FulfillmentStatus, aU as FulfillmentType, aV as FxQuote, aW as FxQuoteRequest, aX as FxRateResponse, aY as FxService, aZ as GetAvailableSlotsInput, a_ as GetOrdersOptions, a$ as GetProductsOptions, b0 as IframeToParentMessage, b1 as InventoryService, b2 as LINK_MUTATION, b3 as LINK_QUERY, b4 as LineItem, b5 as LineType, b6 as LinkData, b7 as LinkEnrollResult, b8 as LinkService, b9 as LinkSession, ba as LinkStatusResult, bb as LiteBootstrap, bc as LiteService, bd as Location, be as LocationBooking, bf as LocationTaxBehavior, bg as LocationTaxOverrides, bh as LocationTimeProfile, bi as LocationWithDetails, bj as MESSAGE_TYPES, bk as MOBILE_MONEY_PROVIDER, bl as MobileMoneyData, bm as MobileMoneyDetails, bn as MobileMoneyProvider, bo as NextAction, bp as ORDER_MUTATION, bq as ORDER_TYPE, br as ObservabilityHooks, bs as Ok, bt as Order, bu as OrderChannel, bv as OrderFilter, bw as OrderFulfillmentSummary, bx as OrderGroup, by as OrderGroupDetails, bz as OrderGroupPayment, bA as OrderGroupPaymentState, bB as OrderGroupPaymentStatus, bC as OrderGroupPaymentSummary, bD as OrderGroupStatus, bE as OrderHistory, bF as OrderLineState, bG as OrderLineStatus, bH as OrderPaymentEvent, bI as OrderQueries, bJ as OrderSplitDetail, bK as OrderStatus, bL as OrderType, bM as OtpResult, bN as PAYMENT_METHOD, bO as PAYMENT_MUTATION, bP as PAYMENT_STATE, bQ as PICKUP_TIME_TYPE, bR as ParentToIframeMessage, bS as PaymentMethodInfo, bT as PaymentState, bU as PickupTime, bV as PickupTimeType, bW as PlaceDetailsResponse, bX as PlacesService, bY as PriceQuote, bZ as PricingOverrides, b_ as ProcessAndResolveOptions, b$ as ProcessCheckoutOptions, c0 as ProcessCheckoutResult, c1 as ProviderResolutionSource, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c7 as ReadRequestOptions, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, ca as RefundOrderInput, cb as RelatedCandidate, cc as RelatedProduct, cd as RelatedProductsEnrichment, ce as RelationType, cf as ReminderMethod, cg as ReminderSettings, ch as ReorderResult, ci as RequestContext, cj as RequestErrorEvent, ck as RequestOptions, cl as RequestOtpInput, cm as RequestSource, cn as RequestStartEvent, co as RequestSuccessEvent, cp as RescheduleBookingInput, cq as RescheduleBookingResult, cr as RescheduleHistoryRecord, cs as ResourceAssignment, ct as Result, cu as RetryEvent, cv as RevokeAllSessionsResult, cw as RevokeSessionResult, cx as Room, cy as SchedulingMetadata, cz as SchedulingResult, cA as SchedulingService, cB as SenderType, cC as Service, cD as ServiceAvailabilityParams, cE as ServiceAvailabilityResult, cF as ServiceCharge, cG as ServiceNotes, cH as ServiceScheduleRequest, cI as ServiceStatus, cJ as SessionActivityData, cK as SessionChangeEvent, cL as SessionMessage, cM as SlotResourceInfo, cN as SlotStaffInfo, cO as Staff, cP as StaffAssignment, cQ as StaffRole, cR as StaffScheduleItem, cS as StockLevel, cT as StockStatus, cU as StorefrontBootstrap, cV as SubscriptionService, cW as SupportService, cX as Table, cY as TableInfo, cZ as TimeRange, c_ as TimeRanges, c$ as TimeSlot, d0 as TrackCategoryViewOptions, d1 as TrackProductViewOptions, d2 as UpdateAddressInput, d3 as UpdateOrderStatusInput, d4 as UpdateProfileInput, d5 as UploadInitResponse, d6 as UploadResult, d7 as UploadService, d8 as VerifyOtpInput, d9 as combine, da as combineObject, db as createCimplifyClient, dc as createElements, dd as err, de as flatMap, df as fromPromise, dg as getOrElse, dh as isErr, di as isOk, dj as mapError, dk as mapResult, dl as ok, dm as toNullable, dn as tryCatch, dp as unwrap } from './client-
|
|
1
|
+
export { A as AUTHORIZATION_TYPE, a as AUTH_MUTATION, b as AbortablePromise, c as ActivityRecommendation, d as ActivityRecommendationsResponse, e as ActivityService, f as ActivityStateResponse, g as AddressData, h as AddressInfo, i as AmountToPay, j as AuthResponse, k as AuthService, l as AuthStatus, m as AuthenticatedCustomer, n as AuthenticatedData, o as AutocompletePrediction, p as AutocompleteResponse, q as AvailabilityResult, r as AvailableSlot, B as Booking, s as BookingModificationType, t as BookingStatus, u as BookingWithDetails, v as BufferTimes, w as Business, x as BusinessHours, y as BusinessPreferences, z as BusinessService, C as BusinessSettings, D as BusinessType, E as BusinessWithLocations, F as CHECKOUT_MODE, G as CHECKOUT_MUTATION, H as CHECKOUT_STEP, I as CONTACT_TYPE, J as CacheOptions, K as CancelBookingInput, L as CancelBookingResult, M as CancelOrderInput, N as CancellationPolicy, O as CartOperations, P as CatalogueQueries, Q as CatalogueResult, R as CatalogueSnapshot, S as CategoryInfo, T as ChatAttachment, U as ChatConversation, V as ChatConversationResponse, W as ChatMessage, X as ChatWidgetStarter, Y as CheckSlotAvailabilityInput, Z as CheckSlotAvailabilityResult, _ as CheckoutAddressInfo, $ as CheckoutCartData, a0 as CheckoutCartItem, a1 as CheckoutCustomerInfo, a2 as CheckoutFormData, a3 as CheckoutInput, a4 as CheckoutMode, a8 as CheckoutOperations, a5 as CheckoutOrderType, a6 as CheckoutPaymentMethod, a7 as CheckoutResult, a8 as CheckoutService, a9 as CheckoutStatus, aa as CheckoutStatusContext, ab as CheckoutStep, ac as CimplifyClient, ad as CimplifyConfig, ae as CimplifyElement, af as CimplifyElements, ag as ContactType, ah as ContentType, ai as CreateAddressInput, aj as CreateMobileMoneyInput, ak as Customer, al as CustomerAddress, am as CustomerBooking, an as CustomerBookingServiceItem, ao as CustomerLinkPreferences, ap as CustomerMobileMoney, aq as CustomerServicePreferences, ar as DEFAULT_COUNTRY, as as DEFAULT_CURRENCY, at as DEVICE_TYPE, au as DayAvailability, av as DeliveryFeeDetails, aw as DeliveryFeeResponse, ax as DeliveryService, ay as DepositResult, az as DeviceType, aA as DismissMessageResponse, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aD as ElementAppearance, aE as ElementEventHandler, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aI as ElementsCheckoutData, aJ as ElementsCheckoutResult, aK as ElementsCustomerInfo, aL as ElementsOptions, aM as EnrollAndLinkOrderInput, aN as EnrollAndLinkOrderResult, aO as EnrollmentData, aP as Err, aQ as FeeBearerType, aR as FetchQuoteInput, aS as FulfillmentLink, aT as FulfillmentStatus, aU as FulfillmentType, aV as FxQuote, aW as FxQuoteRequest, aX as FxRateResponse, aY as FxService, aZ as GetAvailableSlotsInput, a_ as GetOrdersOptions, a$ as GetProductsOptions, b0 as IframeToParentMessage, b1 as InventoryService, b2 as LINK_MUTATION, b3 as LINK_QUERY, b4 as LineItem, b5 as LineType, b6 as LinkData, b7 as LinkEnrollResult, b8 as LinkService, b9 as LinkSession, ba as LinkStatusResult, bb as LiteBootstrap, bc as LiteService, bd as Location, be as LocationBooking, bf as LocationTaxBehavior, bg as LocationTaxOverrides, bh as LocationTimeProfile, bi as LocationWithDetails, bj as MESSAGE_TYPES, bk as MOBILE_MONEY_PROVIDER, bl as MobileMoneyData, bm as MobileMoneyDetails, bn as MobileMoneyProvider, bo as NextAction, bp as ORDER_MUTATION, bq as ORDER_TYPE, br as ObservabilityHooks, bs as Ok, bt as Order, bu as OrderChannel, bv as OrderFilter, bw as OrderFulfillmentSummary, bx as OrderGroup, by as OrderGroupDetails, bz as OrderGroupPayment, bA as OrderGroupPaymentState, bB as OrderGroupPaymentStatus, bC as OrderGroupPaymentSummary, bD as OrderGroupStatus, bE as OrderHistory, bF as OrderLineState, bG as OrderLineStatus, bH as OrderPaymentEvent, bI as OrderQueries, bJ as OrderSplitDetail, bK as OrderStatus, bL as OrderType, bM as OtpResult, bN as PAYMENT_METHOD, bO as PAYMENT_MUTATION, bP as PAYMENT_STATE, bQ as PICKUP_TIME_TYPE, bR as ParentToIframeMessage, bS as PaymentMethodInfo, bT as PaymentState, bU as PickupTime, bV as PickupTimeType, bW as PlaceDetailsResponse, bX as PlacesService, bY as PriceQuote, bZ as PricingOverrides, b_ as ProcessAndResolveOptions, b$ as ProcessCheckoutOptions, c0 as ProcessCheckoutResult, c1 as ProviderResolutionSource, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c7 as ReadRequestOptions, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, ca as RefundOrderInput, cb as RelatedCandidate, cc as RelatedProduct, cd as RelatedProductsEnrichment, ce as RelationType, cf as ReminderMethod, cg as ReminderSettings, ch as ReorderResult, ci as RequestContext, cj as RequestErrorEvent, ck as RequestOptions, cl as RequestOtpInput, cm as RequestSource, cn as RequestStartEvent, co as RequestSuccessEvent, cp as RescheduleBookingInput, cq as RescheduleBookingResult, cr as RescheduleHistoryRecord, cs as ResourceAssignment, ct as Result, cu as RetryEvent, cv as RevokeAllSessionsResult, cw as RevokeSessionResult, cx as Room, cy as SchedulingMetadata, cz as SchedulingResult, cA as SchedulingService, cB as SenderType, cC as Service, cD as ServiceAvailabilityParams, cE as ServiceAvailabilityResult, cF as ServiceCharge, cG as ServiceNotes, cH as ServiceScheduleRequest, cI as ServiceStatus, cJ as SessionActivityData, cK as SessionChangeEvent, cL as SessionMessage, cM as SlotResourceInfo, cN as SlotStaffInfo, cO as Staff, cP as StaffAssignment, cQ as StaffRole, cR as StaffScheduleItem, cS as StockLevel, cT as StockStatus, cU as StorefrontBootstrap, cV as SubscriptionService, cW as SupportService, cX as Table, cY as TableInfo, cZ as TimeRange, c_ as TimeRanges, c$ as TimeSlot, d0 as TrackCategoryViewOptions, d1 as TrackProductViewOptions, d2 as UpdateAddressInput, d3 as UpdateOrderStatusInput, d4 as UpdateProfileInput, d5 as UploadInitResponse, d6 as UploadResult, d7 as UploadService, d8 as VerifyOtpInput, d9 as combine, da as combineObject, db as createCimplifyClient, dc as createElements, dd as err, de as flatMap, df as fromPromise, dg as getOrElse, dh as isErr, di as isOk, dj as mapError, dk as mapResult, dl as ok, dm as toNullable, dn as tryCatch, dp as unwrap } from './client-Dfg_hmkP.js';
|
|
2
2
|
import { j as ApiError } from './product-B_kS4Oxa.js';
|
|
3
3
|
export { A as AddOn, a as AddOnDetails, b as AddOnGroupDetails, c as AddOnOption, d as AddOnOptionDetails, e as AddOnOptionPrice, f as AddOnWithOptions, g as AddToCartInput, h as AddressValue, i as AdjustmentType, k as AppliedDiscount, l as AttributeAppliesTo, m as AttributeType, n as AttributeValidationRules, o as AttributeVisibility, B as BenefitType, p as BillingFrequency, q as BillingMarkupType, r as BillingPlanType, s as Bundle, t as BundleComponentData, u as BundleComponentInfo, v as BundleComponentVariantView, w as BundleComponentView, x as BundlePriceType, y as BundleProduct, z as BundleSelectionData, C as BundleSelectionInput, D as BundleStoredSelection, E as BundleSummary, F as BundleWithDetails, G as Cart, H as CartAddOn, I as CartChannel, J as CartItem, K as CartItemDetails, L as CartMutationResult, M as CartNotice, N as CartStatus, O as CartSummary, P as CartTotals, Q as Category, R as CategorySummary, S as ChosenPrice, T as CimplifyError, U as Collection, V as CollectionProduct, W as CollectionSummary, X as ComponentGroup, Y as ComponentGroupWithComponents, Z as ComponentPriceBreakdown, _ as ComponentSchedulingData, $ as ComponentSelectionInput, a0 as ComponentSourceType, a1 as Composite, a2 as CompositeComponent, a3 as CompositeComponentView, a4 as CompositeGroupView, a5 as CompositePriceBreakdown, a6 as CompositePriceResult, a7 as CompositePricingMode, a8 as CompositeSelectionData, $ as CompositeSelectionInput, a9 as CompositeStoredSelection, aa as CompositeWithDetails, ab as CurrencyCode, ac as CustomAttributeDefinition, ad as CustomAttributeValue, ae as CustomerInputValue, af as DURATION_UNIT, ag as DateRangeValue, ah as Deal, ai as DealBenefitType, aj as DepositType, ak as DigitalProductType, al as DiscountBreakdown, am as DiscountDetails, an as DiscountValidation, ao as DisplayAddOn, ap as DisplayAddOnOption, aq as DisplayCart, ar as DisplayCartItem, as as DisplayMode, at as DurationUnit, au as ERROR_HINTS, av as EligiblePlansQuery, aw as ErrorCode, ax as ErrorCodeType, ay as ErrorHint, az as FacetValue, aA as FormattedPlanOption, aB as GroupPricingBehavior, aC as INPUT_FIELD_TYPE, aD as IdempotencyMismatchError, aE as InputFieldType, aF as InputFieldValidation, aG as InventoryType, aH as KnowledgeArticle, aI as LineConfiguration, aJ as LocationProductPrice, aK as LocationValue, aL as MeasurementValue, aM as Money, aN as PRODUCT_TYPE, aO as Pagination, aP as PaginationParams, aQ as PhoneValue, aR as Price, aS as PriceAdjustment, aT as PriceDecisionPath, aU as PriceEntryType, aV as PricePathTaxInfo, aW as PriceSource, aX as Product, aY as ProductAddOn, aZ as ProductAvailability, a_ as ProductAvailabilityNow, a$ as ProductBillingPlan, b0 as ProductDealInfo, b1 as ProductInputField, b2 as ProductProperty, b3 as ProductRenderHint, b4 as ProductTaxonomy, b5 as ProductTimeProfile, b6 as ProductType, b7 as ProductVariant, b8 as ProductVariantValue, b9 as ProductWithDetails, ba as PropertyFacet, bb as PropertySource, bc as QuantityPricingTier, bd as RENDER_HINT, be as RelatedProductView, bf as SalesChannel, bg as SchedulingMode, bh as SelectedAddOnOption, bi as SemanticKind, bj as SignatureValue, bk as Subscription, bl as SubscriptionInvoice, bm as SubscriptionItem, bn as SubscriptionStatus, bo as SubscriptionWithDetails, bp as Tag, bq as TagsResponse, br as TaxPathComponent, bs as TaxonomyAttributeTemplate, bt as TaxonomyWithChildren, bu as UICart, bv as UICartBusiness, bw as UICartCustomer, bx as UICartLocation, by as UICartPricing, bz as UpdateCartItemInput, bA as VariantAxis, bB as VariantAxisSelection, bC as VariantAxisValue, bD as VariantAxisValueView, bE as VariantAxisView, bF as VariantAxisWithValues, bG as VariantDetails, bH as VariantDetailsDTO, bI as VariantDisplayAttribute, bJ as VariantLocationAvailability, bK as VariantStrategy, bL as VariantView, bM as ZERO, bN as currencyCode, bO as enrichError, bP as getErrorHint, bQ as isCimplifyError, bR as isIdempotencyMismatchError, bS as isQuoteConflictRequiringConsent, bT as isQuoteError, bU as isRetryableError, bV as isSupportedCurrency, bW as money, bX as moneyFromNumber } from './product-B_kS4Oxa.js';
|
|
4
4
|
export { C as CURRENCY_SYMBOLS, M as MOBILE_MONEY_PROVIDERS, c as categorizePaymentError, d as detectMobileMoneyProvider, f as formatMoney, a as formatNumberCompact, b as formatPrice, e as formatPriceAdjustment, g as formatPriceCompact, h as formatPriceRange, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, p as getPriceRange, q as getProductCurrency, r as getTaxAmount, s as getUnitPriceAtQuantity, t as hasTaxInfo, u as isOnSale, v as isPaymentStatusFailure, w as isPaymentStatusRequiresAction, x as isPaymentStatusSuccess, y as isTaxInclusive, z as isValidPhoneForContext, A as normalizePaymentResponse, B as normalizePhoneToE164, D as normalizeStatusResponse, E as parsePrice, F as resolvePhoneCountryCode } from './index-DIIlPUOC.js';
|
|
5
|
-
export { A as AdConfig, a as AdContextValue, b as AdCreative, c as AdPosition, d as AdSlot, e as AdTheme, g as getVariantDisplayName } from './
|
|
5
|
+
export { A as AdConfig, a as AdContextValue, b as AdCreative, c as AdPosition, d as AdSlot, e as AdTheme, S as SignInOptions, g as getVariantDisplayName, s as startSignIn } from './sign-in-TL01-awQ.js';
|
|
6
6
|
export { A as AddressAuthorizationData, a as AuthorizationType, I as InitializePaymentResult, P as Payment, b as PaymentErrorDetails, c as PaymentMethod, d as PaymentMethodType, e as PaymentProcessingState, f as PaymentProvider, g as PaymentResponse, h as PaymentStatus, i as PaymentStatusResponse, S as SubmitAuthorizationInput } from './payment-sn-yGL7v.js';
|
|
7
7
|
export { F as FormatCompactOptions, a as FormatPriceOptions, P as ProductWithPrice } from './price-9T1Y47oS.js';
|
|
8
8
|
export { generateIdempotencyKey } from './advanced.js';
|
|
@@ -66,6 +66,21 @@ interface ApiResponse<T> {
|
|
|
66
66
|
metadata?: ResponseMetadata;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
interface SilentSignInOptions {
|
|
70
|
+
clientId: string;
|
|
71
|
+
redirectUri: string;
|
|
72
|
+
callbackUri?: string;
|
|
73
|
+
sessionUri?: string;
|
|
74
|
+
scope?: string;
|
|
75
|
+
authUrl?: string;
|
|
76
|
+
timeoutMs?: number;
|
|
77
|
+
}
|
|
78
|
+
interface SilentSignInResult {
|
|
79
|
+
ok: boolean;
|
|
80
|
+
reason?: "already_signed_in" | "login_required" | "callback_failed" | "timeout" | "state_mismatch" | "exception";
|
|
81
|
+
}
|
|
82
|
+
declare function signInSilent(opts: SilentSignInOptions): Promise<SilentSignInResult>;
|
|
83
|
+
|
|
69
84
|
declare const DEFAULT_CDN_BASE_URL = "https://storefrontassetscdn.cimplify.io";
|
|
70
85
|
declare const CIMPLIFY_CDN_HOSTS: readonly ["storefrontassetscdn.cimplify.io", "cdn.cimplify.io", "static-tmp.cimplify.io"];
|
|
71
86
|
interface AssetTransform {
|
|
@@ -80,4 +95,4 @@ interface AssetUrlOptions extends AssetTransform {
|
|
|
80
95
|
declare function assetUrl(path: string, opts?: AssetUrlOptions): string;
|
|
81
96
|
declare function isCimplifyAsset(src: string, base?: string): boolean;
|
|
82
97
|
|
|
83
|
-
export { ApiError, type ApiResponse, type AssetTransform, type AssetUrlOptions, CIMPLIFY_CDN_HOSTS, type CustomerGroup, type CustomerPricingInfo, DEFAULT_CDN_BASE_URL, type FrontendContext, type MutationRequest, type PriceListItem, type QuantityBreak, type QueryRequest, type ResolvedQuantityBreak, type ResponseMetadata, assetUrl, isCimplifyAsset };
|
|
98
|
+
export { ApiError, type ApiResponse, type AssetTransform, type AssetUrlOptions, CIMPLIFY_CDN_HOSTS, type CustomerGroup, type CustomerPricingInfo, DEFAULT_CDN_BASE_URL, type FrontendContext, type MutationRequest, type PriceListItem, type QuantityBreak, type QueryRequest, type ResolvedQuantityBreak, type ResponseMetadata, type SilentSignInOptions, type SilentSignInResult, assetUrl, isCimplifyAsset, signInSilent };
|
package/dist/index.js
CHANGED
|
@@ -1,50 +1,137 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJYPLT56O_js = require('./chunk-JYPLT56O.js');
|
|
4
4
|
var chunkL5GKVQVJ_js = require('./chunk-L5GKVQVJ.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkMW7ICTVK_js = require('./chunk-MW7ICTVK.js');
|
|
6
|
+
var chunkJGBDWEPJ_js = require('./chunk-JGBDWEPJ.js');
|
|
7
7
|
var chunk7Y2O3E4D_js = require('./chunk-7Y2O3E4D.js');
|
|
8
8
|
var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
|
|
9
9
|
require('./chunk-OWW5GUSB.js');
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/silent-sign-in.ts
|
|
12
|
+
var DEFAULT_AUTH_URL = "https://auth.cimplify.io";
|
|
13
|
+
var DEFAULT_SCOPE = "openid email phone profile";
|
|
14
|
+
var DEFAULT_TIMEOUT_MS = 12e3;
|
|
15
|
+
async function signInSilent(opts) {
|
|
16
|
+
const sessionUri = opts.sessionUri ?? "/auth/session";
|
|
17
|
+
try {
|
|
18
|
+
const sess = await fetch(sessionUri, { credentials: "include" });
|
|
19
|
+
if (sess.ok) {
|
|
20
|
+
const body = await sess.json().catch(() => null);
|
|
21
|
+
if (body?.sub) return { ok: true, reason: "already_signed_in" };
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
const authUrl = (opts.authUrl ?? DEFAULT_AUTH_URL).replace(/\/$/, "");
|
|
26
|
+
const callbackUri = opts.callbackUri ?? "/auth/callback";
|
|
27
|
+
const pkce = await chunkJYPLT56O_js.generatePkce();
|
|
28
|
+
const state = chunkJYPLT56O_js.generateState();
|
|
29
|
+
const params = new URLSearchParams({
|
|
30
|
+
response_type: "code",
|
|
31
|
+
response_mode: "web_message",
|
|
32
|
+
prompt: "none",
|
|
33
|
+
client_id: opts.clientId,
|
|
34
|
+
redirect_uri: opts.redirectUri,
|
|
35
|
+
scope: opts.scope ?? DEFAULT_SCOPE,
|
|
36
|
+
state,
|
|
37
|
+
code_challenge: pkce.challenge,
|
|
38
|
+
code_challenge_method: pkce.method
|
|
39
|
+
});
|
|
40
|
+
const src = `${authUrl}/oauth/authorize?${params.toString()}`;
|
|
41
|
+
const expectedOrigin = new URL(authUrl).origin;
|
|
42
|
+
const iframe = document.createElement("iframe");
|
|
43
|
+
iframe.style.display = "none";
|
|
44
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
45
|
+
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin");
|
|
46
|
+
iframe.src = src;
|
|
47
|
+
document.body.appendChild(iframe);
|
|
48
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
49
|
+
return new Promise((resolve) => {
|
|
50
|
+
let settled = false;
|
|
51
|
+
const cleanup = () => {
|
|
52
|
+
window.removeEventListener("message", handler);
|
|
53
|
+
iframe.remove();
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
};
|
|
56
|
+
const finish = (result) => {
|
|
57
|
+
if (settled) return;
|
|
58
|
+
settled = true;
|
|
59
|
+
cleanup();
|
|
60
|
+
resolve(result);
|
|
61
|
+
};
|
|
62
|
+
const timer = setTimeout(() => finish({ ok: false, reason: "timeout" }), timeoutMs);
|
|
63
|
+
const handler = async (event) => {
|
|
64
|
+
if (event.origin !== expectedOrigin) return;
|
|
65
|
+
const data = event.data;
|
|
66
|
+
if (!data || typeof data !== "object" || data.type !== "authorization_response") return;
|
|
67
|
+
const response = data.response;
|
|
68
|
+
if (response.error === "login_required") {
|
|
69
|
+
finish({ ok: false, reason: "login_required" });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (response.error || !response.code) {
|
|
73
|
+
finish({ ok: false, reason: "login_required" });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (response.state !== state) {
|
|
77
|
+
finish({ ok: false, reason: "state_mismatch" });
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const res = await fetch(callbackUri, {
|
|
82
|
+
method: "POST",
|
|
83
|
+
credentials: "include",
|
|
84
|
+
headers: { "Content-Type": "application/json" },
|
|
85
|
+
body: JSON.stringify({ code: response.code, codeVerifier: pkce.verifier, state })
|
|
86
|
+
});
|
|
87
|
+
finish(res.ok ? { ok: true } : { ok: false, reason: "callback_failed" });
|
|
88
|
+
} catch {
|
|
89
|
+
finish({ ok: false, reason: "exception" });
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
window.addEventListener("message", handler);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
12
95
|
|
|
13
96
|
Object.defineProperty(exports, "CIMPLIFY_CDN_HOSTS", {
|
|
14
97
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkJYPLT56O_js.CIMPLIFY_CDN_HOSTS; }
|
|
16
99
|
});
|
|
17
100
|
Object.defineProperty(exports, "DEFAULT_CDN_BASE_URL", {
|
|
18
101
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkJYPLT56O_js.DEFAULT_CDN_BASE_URL; }
|
|
20
103
|
});
|
|
21
104
|
Object.defineProperty(exports, "DURATION_UNIT", {
|
|
22
105
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkJYPLT56O_js.DURATION_UNIT; }
|
|
24
107
|
});
|
|
25
108
|
Object.defineProperty(exports, "INPUT_FIELD_TYPE", {
|
|
26
109
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkJYPLT56O_js.INPUT_FIELD_TYPE; }
|
|
28
111
|
});
|
|
29
112
|
Object.defineProperty(exports, "PRODUCT_TYPE", {
|
|
30
113
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkJYPLT56O_js.PRODUCT_TYPE; }
|
|
32
115
|
});
|
|
33
116
|
Object.defineProperty(exports, "RENDER_HINT", {
|
|
34
117
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkJYPLT56O_js.RENDER_HINT; }
|
|
36
119
|
});
|
|
37
120
|
Object.defineProperty(exports, "assetUrl", {
|
|
38
121
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkJYPLT56O_js.assetUrl; }
|
|
40
123
|
});
|
|
41
124
|
Object.defineProperty(exports, "getVariantDisplayName", {
|
|
42
125
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkJYPLT56O_js.getVariantDisplayName; }
|
|
44
127
|
});
|
|
45
128
|
Object.defineProperty(exports, "isCimplifyAsset", {
|
|
46
129
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkJYPLT56O_js.isCimplifyAsset; }
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "startSignIn", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () { return chunkJYPLT56O_js.startSignIn; }
|
|
48
135
|
});
|
|
49
136
|
Object.defineProperty(exports, "isValidPhoneForContext", {
|
|
50
137
|
enumerable: true,
|
|
@@ -60,239 +147,239 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
|
|
|
60
147
|
});
|
|
61
148
|
Object.defineProperty(exports, "ActivityService", {
|
|
62
149
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkMW7ICTVK_js.ActivityService; }
|
|
64
151
|
});
|
|
65
152
|
Object.defineProperty(exports, "CimplifyClient", {
|
|
66
153
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkMW7ICTVK_js.CimplifyClient; }
|
|
68
155
|
});
|
|
69
156
|
Object.defineProperty(exports, "DeliveryService", {
|
|
70
157
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkMW7ICTVK_js.DeliveryService; }
|
|
72
159
|
});
|
|
73
160
|
Object.defineProperty(exports, "PlacesService", {
|
|
74
161
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkMW7ICTVK_js.PlacesService; }
|
|
76
163
|
});
|
|
77
164
|
Object.defineProperty(exports, "SubscriptionService", {
|
|
78
165
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkMW7ICTVK_js.SubscriptionService; }
|
|
80
167
|
});
|
|
81
168
|
Object.defineProperty(exports, "SupportService", {
|
|
82
169
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkMW7ICTVK_js.SupportService; }
|
|
84
171
|
});
|
|
85
172
|
Object.defineProperty(exports, "UploadService", {
|
|
86
173
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkMW7ICTVK_js.UploadService; }
|
|
88
175
|
});
|
|
89
176
|
Object.defineProperty(exports, "createCimplifyClient", {
|
|
90
177
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkMW7ICTVK_js.createCimplifyClient; }
|
|
92
179
|
});
|
|
93
180
|
Object.defineProperty(exports, "AUTHORIZATION_TYPE", {
|
|
94
181
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkJGBDWEPJ_js.AUTHORIZATION_TYPE; }
|
|
96
183
|
});
|
|
97
184
|
Object.defineProperty(exports, "AUTH_MUTATION", {
|
|
98
185
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunkJGBDWEPJ_js.AUTH_MUTATION; }
|
|
100
187
|
});
|
|
101
188
|
Object.defineProperty(exports, "AuthService", {
|
|
102
189
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkJGBDWEPJ_js.AuthService; }
|
|
104
191
|
});
|
|
105
192
|
Object.defineProperty(exports, "BusinessService", {
|
|
106
193
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkJGBDWEPJ_js.BusinessService; }
|
|
108
195
|
});
|
|
109
196
|
Object.defineProperty(exports, "CHECKOUT_MODE", {
|
|
110
197
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkJGBDWEPJ_js.CHECKOUT_MODE; }
|
|
112
199
|
});
|
|
113
200
|
Object.defineProperty(exports, "CHECKOUT_MUTATION", {
|
|
114
201
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkJGBDWEPJ_js.CHECKOUT_MUTATION; }
|
|
116
203
|
});
|
|
117
204
|
Object.defineProperty(exports, "CHECKOUT_STEP", {
|
|
118
205
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkJGBDWEPJ_js.CHECKOUT_STEP; }
|
|
120
207
|
});
|
|
121
208
|
Object.defineProperty(exports, "CONTACT_TYPE", {
|
|
122
209
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkJGBDWEPJ_js.CONTACT_TYPE; }
|
|
124
211
|
});
|
|
125
212
|
Object.defineProperty(exports, "CartOperations", {
|
|
126
213
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkJGBDWEPJ_js.CartOperations; }
|
|
128
215
|
});
|
|
129
216
|
Object.defineProperty(exports, "CatalogueQueries", {
|
|
130
217
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkJGBDWEPJ_js.CatalogueQueries; }
|
|
132
219
|
});
|
|
133
220
|
Object.defineProperty(exports, "CheckoutOperations", {
|
|
134
221
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkJGBDWEPJ_js.CheckoutService; }
|
|
136
223
|
});
|
|
137
224
|
Object.defineProperty(exports, "CheckoutService", {
|
|
138
225
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkJGBDWEPJ_js.CheckoutService; }
|
|
140
227
|
});
|
|
141
228
|
Object.defineProperty(exports, "CimplifyElement", {
|
|
142
229
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkJGBDWEPJ_js.CimplifyElement; }
|
|
144
231
|
});
|
|
145
232
|
Object.defineProperty(exports, "CimplifyElements", {
|
|
146
233
|
enumerable: true,
|
|
147
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkJGBDWEPJ_js.CimplifyElements; }
|
|
148
235
|
});
|
|
149
236
|
Object.defineProperty(exports, "DEFAULT_COUNTRY", {
|
|
150
237
|
enumerable: true,
|
|
151
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkJGBDWEPJ_js.DEFAULT_COUNTRY; }
|
|
152
239
|
});
|
|
153
240
|
Object.defineProperty(exports, "DEFAULT_CURRENCY", {
|
|
154
241
|
enumerable: true,
|
|
155
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkJGBDWEPJ_js.DEFAULT_CURRENCY; }
|
|
156
243
|
});
|
|
157
244
|
Object.defineProperty(exports, "DEVICE_TYPE", {
|
|
158
245
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkJGBDWEPJ_js.DEVICE_TYPE; }
|
|
160
247
|
});
|
|
161
248
|
Object.defineProperty(exports, "ELEMENT_TYPES", {
|
|
162
249
|
enumerable: true,
|
|
163
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkJGBDWEPJ_js.ELEMENT_TYPES; }
|
|
164
251
|
});
|
|
165
252
|
Object.defineProperty(exports, "EVENT_TYPES", {
|
|
166
253
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkJGBDWEPJ_js.EVENT_TYPES; }
|
|
168
255
|
});
|
|
169
256
|
Object.defineProperty(exports, "FxService", {
|
|
170
257
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkJGBDWEPJ_js.FxService; }
|
|
172
259
|
});
|
|
173
260
|
Object.defineProperty(exports, "InventoryService", {
|
|
174
261
|
enumerable: true,
|
|
175
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkJGBDWEPJ_js.InventoryService; }
|
|
176
263
|
});
|
|
177
264
|
Object.defineProperty(exports, "LINK_MUTATION", {
|
|
178
265
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkJGBDWEPJ_js.LINK_MUTATION; }
|
|
180
267
|
});
|
|
181
268
|
Object.defineProperty(exports, "LINK_QUERY", {
|
|
182
269
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkJGBDWEPJ_js.LINK_QUERY; }
|
|
184
271
|
});
|
|
185
272
|
Object.defineProperty(exports, "LinkService", {
|
|
186
273
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkJGBDWEPJ_js.LinkService; }
|
|
188
275
|
});
|
|
189
276
|
Object.defineProperty(exports, "LiteService", {
|
|
190
277
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
278
|
+
get: function () { return chunkJGBDWEPJ_js.LiteService; }
|
|
192
279
|
});
|
|
193
280
|
Object.defineProperty(exports, "MESSAGE_TYPES", {
|
|
194
281
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
282
|
+
get: function () { return chunkJGBDWEPJ_js.MESSAGE_TYPES; }
|
|
196
283
|
});
|
|
197
284
|
Object.defineProperty(exports, "MOBILE_MONEY_PROVIDER", {
|
|
198
285
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
286
|
+
get: function () { return chunkJGBDWEPJ_js.MOBILE_MONEY_PROVIDER; }
|
|
200
287
|
});
|
|
201
288
|
Object.defineProperty(exports, "ORDER_MUTATION", {
|
|
202
289
|
enumerable: true,
|
|
203
|
-
get: function () { return
|
|
290
|
+
get: function () { return chunkJGBDWEPJ_js.ORDER_MUTATION; }
|
|
204
291
|
});
|
|
205
292
|
Object.defineProperty(exports, "ORDER_TYPE", {
|
|
206
293
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
294
|
+
get: function () { return chunkJGBDWEPJ_js.ORDER_TYPE; }
|
|
208
295
|
});
|
|
209
296
|
Object.defineProperty(exports, "OrderQueries", {
|
|
210
297
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
298
|
+
get: function () { return chunkJGBDWEPJ_js.OrderQueries; }
|
|
212
299
|
});
|
|
213
300
|
Object.defineProperty(exports, "PAYMENT_METHOD", {
|
|
214
301
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
302
|
+
get: function () { return chunkJGBDWEPJ_js.PAYMENT_METHOD; }
|
|
216
303
|
});
|
|
217
304
|
Object.defineProperty(exports, "PAYMENT_MUTATION", {
|
|
218
305
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
306
|
+
get: function () { return chunkJGBDWEPJ_js.PAYMENT_MUTATION; }
|
|
220
307
|
});
|
|
221
308
|
Object.defineProperty(exports, "PAYMENT_STATE", {
|
|
222
309
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
310
|
+
get: function () { return chunkJGBDWEPJ_js.PAYMENT_STATE; }
|
|
224
311
|
});
|
|
225
312
|
Object.defineProperty(exports, "PICKUP_TIME_TYPE", {
|
|
226
313
|
enumerable: true,
|
|
227
|
-
get: function () { return
|
|
314
|
+
get: function () { return chunkJGBDWEPJ_js.PICKUP_TIME_TYPE; }
|
|
228
315
|
});
|
|
229
316
|
Object.defineProperty(exports, "SchedulingService", {
|
|
230
317
|
enumerable: true,
|
|
231
|
-
get: function () { return
|
|
318
|
+
get: function () { return chunkJGBDWEPJ_js.SchedulingService; }
|
|
232
319
|
});
|
|
233
320
|
Object.defineProperty(exports, "combine", {
|
|
234
321
|
enumerable: true,
|
|
235
|
-
get: function () { return
|
|
322
|
+
get: function () { return chunkJGBDWEPJ_js.combine; }
|
|
236
323
|
});
|
|
237
324
|
Object.defineProperty(exports, "combineObject", {
|
|
238
325
|
enumerable: true,
|
|
239
|
-
get: function () { return
|
|
326
|
+
get: function () { return chunkJGBDWEPJ_js.combineObject; }
|
|
240
327
|
});
|
|
241
328
|
Object.defineProperty(exports, "createElements", {
|
|
242
329
|
enumerable: true,
|
|
243
|
-
get: function () { return
|
|
330
|
+
get: function () { return chunkJGBDWEPJ_js.createElements; }
|
|
244
331
|
});
|
|
245
332
|
Object.defineProperty(exports, "err", {
|
|
246
333
|
enumerable: true,
|
|
247
|
-
get: function () { return
|
|
334
|
+
get: function () { return chunkJGBDWEPJ_js.err; }
|
|
248
335
|
});
|
|
249
336
|
Object.defineProperty(exports, "flatMap", {
|
|
250
337
|
enumerable: true,
|
|
251
|
-
get: function () { return
|
|
338
|
+
get: function () { return chunkJGBDWEPJ_js.flatMap; }
|
|
252
339
|
});
|
|
253
340
|
Object.defineProperty(exports, "fromPromise", {
|
|
254
341
|
enumerable: true,
|
|
255
|
-
get: function () { return
|
|
342
|
+
get: function () { return chunkJGBDWEPJ_js.fromPromise; }
|
|
256
343
|
});
|
|
257
344
|
Object.defineProperty(exports, "generateIdempotencyKey", {
|
|
258
345
|
enumerable: true,
|
|
259
|
-
get: function () { return
|
|
346
|
+
get: function () { return chunkJGBDWEPJ_js.generateIdempotencyKey; }
|
|
260
347
|
});
|
|
261
348
|
Object.defineProperty(exports, "getOrElse", {
|
|
262
349
|
enumerable: true,
|
|
263
|
-
get: function () { return
|
|
350
|
+
get: function () { return chunkJGBDWEPJ_js.getOrElse; }
|
|
264
351
|
});
|
|
265
352
|
Object.defineProperty(exports, "isErr", {
|
|
266
353
|
enumerable: true,
|
|
267
|
-
get: function () { return
|
|
354
|
+
get: function () { return chunkJGBDWEPJ_js.isErr; }
|
|
268
355
|
});
|
|
269
356
|
Object.defineProperty(exports, "isOk", {
|
|
270
357
|
enumerable: true,
|
|
271
|
-
get: function () { return
|
|
358
|
+
get: function () { return chunkJGBDWEPJ_js.isOk; }
|
|
272
359
|
});
|
|
273
360
|
Object.defineProperty(exports, "mapError", {
|
|
274
361
|
enumerable: true,
|
|
275
|
-
get: function () { return
|
|
362
|
+
get: function () { return chunkJGBDWEPJ_js.mapError; }
|
|
276
363
|
});
|
|
277
364
|
Object.defineProperty(exports, "mapResult", {
|
|
278
365
|
enumerable: true,
|
|
279
|
-
get: function () { return
|
|
366
|
+
get: function () { return chunkJGBDWEPJ_js.mapResult; }
|
|
280
367
|
});
|
|
281
368
|
Object.defineProperty(exports, "ok", {
|
|
282
369
|
enumerable: true,
|
|
283
|
-
get: function () { return
|
|
370
|
+
get: function () { return chunkJGBDWEPJ_js.ok; }
|
|
284
371
|
});
|
|
285
372
|
Object.defineProperty(exports, "toNullable", {
|
|
286
373
|
enumerable: true,
|
|
287
|
-
get: function () { return
|
|
374
|
+
get: function () { return chunkJGBDWEPJ_js.toNullable; }
|
|
288
375
|
});
|
|
289
376
|
Object.defineProperty(exports, "tryCatch", {
|
|
290
377
|
enumerable: true,
|
|
291
|
-
get: function () { return
|
|
378
|
+
get: function () { return chunkJGBDWEPJ_js.tryCatch; }
|
|
292
379
|
});
|
|
293
380
|
Object.defineProperty(exports, "unwrap", {
|
|
294
381
|
enumerable: true,
|
|
295
|
-
get: function () { return
|
|
382
|
+
get: function () { return chunkJGBDWEPJ_js.unwrap; }
|
|
296
383
|
});
|
|
297
384
|
Object.defineProperty(exports, "CURRENCY_SYMBOLS", {
|
|
298
385
|
enumerable: true,
|
|
@@ -478,3 +565,4 @@ Object.defineProperty(exports, "moneyFromNumber", {
|
|
|
478
565
|
enumerable: true,
|
|
479
566
|
get: function () { return chunkXA3ZNR75_js.moneyFromNumber; }
|
|
480
567
|
});
|
|
568
|
+
exports.signInSilent = signInSilent;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
import { generatePkce, generateState } from './chunk-XYI4NXWG.mjs';
|
|
2
|
+
export { CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, assetUrl, getVariantDisplayName, isCimplifyAsset, startSignIn } from './chunk-XYI4NXWG.mjs';
|
|
2
3
|
export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
|
|
3
|
-
export { ActivityService, CimplifyClient, DeliveryService, PlacesService, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-
|
|
4
|
-
export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, toNullable, tryCatch, unwrap } from './chunk-
|
|
4
|
+
export { ActivityService, CimplifyClient, DeliveryService, PlacesService, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-SQ7U3BWY.mjs';
|
|
5
|
+
export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, toNullable, tryCatch, unwrap } from './chunk-I4IXPQIX.mjs';
|
|
5
6
|
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-TD3AY34U.mjs';
|
|
6
7
|
export { CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-AMZXALF6.mjs';
|
|
7
8
|
import './chunk-3G6RQLXK.mjs';
|
|
9
|
+
|
|
10
|
+
// src/silent-sign-in.ts
|
|
11
|
+
var DEFAULT_AUTH_URL = "https://auth.cimplify.io";
|
|
12
|
+
var DEFAULT_SCOPE = "openid email phone profile";
|
|
13
|
+
var DEFAULT_TIMEOUT_MS = 12e3;
|
|
14
|
+
async function signInSilent(opts) {
|
|
15
|
+
const sessionUri = opts.sessionUri ?? "/auth/session";
|
|
16
|
+
try {
|
|
17
|
+
const sess = await fetch(sessionUri, { credentials: "include" });
|
|
18
|
+
if (sess.ok) {
|
|
19
|
+
const body = await sess.json().catch(() => null);
|
|
20
|
+
if (body?.sub) return { ok: true, reason: "already_signed_in" };
|
|
21
|
+
}
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
const authUrl = (opts.authUrl ?? DEFAULT_AUTH_URL).replace(/\/$/, "");
|
|
25
|
+
const callbackUri = opts.callbackUri ?? "/auth/callback";
|
|
26
|
+
const pkce = await generatePkce();
|
|
27
|
+
const state = generateState();
|
|
28
|
+
const params = new URLSearchParams({
|
|
29
|
+
response_type: "code",
|
|
30
|
+
response_mode: "web_message",
|
|
31
|
+
prompt: "none",
|
|
32
|
+
client_id: opts.clientId,
|
|
33
|
+
redirect_uri: opts.redirectUri,
|
|
34
|
+
scope: opts.scope ?? DEFAULT_SCOPE,
|
|
35
|
+
state,
|
|
36
|
+
code_challenge: pkce.challenge,
|
|
37
|
+
code_challenge_method: pkce.method
|
|
38
|
+
});
|
|
39
|
+
const src = `${authUrl}/oauth/authorize?${params.toString()}`;
|
|
40
|
+
const expectedOrigin = new URL(authUrl).origin;
|
|
41
|
+
const iframe = document.createElement("iframe");
|
|
42
|
+
iframe.style.display = "none";
|
|
43
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
44
|
+
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin");
|
|
45
|
+
iframe.src = src;
|
|
46
|
+
document.body.appendChild(iframe);
|
|
47
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
let settled = false;
|
|
50
|
+
const cleanup = () => {
|
|
51
|
+
window.removeEventListener("message", handler);
|
|
52
|
+
iframe.remove();
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
};
|
|
55
|
+
const finish = (result) => {
|
|
56
|
+
if (settled) return;
|
|
57
|
+
settled = true;
|
|
58
|
+
cleanup();
|
|
59
|
+
resolve(result);
|
|
60
|
+
};
|
|
61
|
+
const timer = setTimeout(() => finish({ ok: false, reason: "timeout" }), timeoutMs);
|
|
62
|
+
const handler = async (event) => {
|
|
63
|
+
if (event.origin !== expectedOrigin) return;
|
|
64
|
+
const data = event.data;
|
|
65
|
+
if (!data || typeof data !== "object" || data.type !== "authorization_response") return;
|
|
66
|
+
const response = data.response;
|
|
67
|
+
if (response.error === "login_required") {
|
|
68
|
+
finish({ ok: false, reason: "login_required" });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (response.error || !response.code) {
|
|
72
|
+
finish({ ok: false, reason: "login_required" });
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (response.state !== state) {
|
|
76
|
+
finish({ ok: false, reason: "state_mismatch" });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const res = await fetch(callbackUri, {
|
|
81
|
+
method: "POST",
|
|
82
|
+
credentials: "include",
|
|
83
|
+
headers: { "Content-Type": "application/json" },
|
|
84
|
+
body: JSON.stringify({ code: response.code, codeVerifier: pkce.verifier, state })
|
|
85
|
+
});
|
|
86
|
+
finish(res.ok ? { ok: true } : { ok: false, reason: "callback_failed" });
|
|
87
|
+
} catch {
|
|
88
|
+
finish({ ok: false, reason: "exception" });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
window.addEventListener("message", handler);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { signInSilent };
|