@cimplify/sdk 0.88.0 → 0.90.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 +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/{chunk-A7NODD4Q.mjs → chunk-2UDEWILL.mjs} +83 -17
- package/dist/{chunk-W5BVGAO6.js → chunk-BN4V4ONE.js} +83 -17
- package/dist/{chunk-6JA4HBBD.js → chunk-JVWFIFQ7.js} +4 -4
- package/dist/{chunk-ROBTTS3Q.js → chunk-KJP4U6L3.js} +28 -1
- package/dist/{chunk-VU5LFNEX.mjs → chunk-NGE37REW.mjs} +2 -2
- package/dist/{chunk-APBLFZ2I.mjs → chunk-NNGKC3MM.mjs} +28 -1
- package/dist/chunk-U4MW6PYU.mjs +23 -0
- package/dist/chunk-XREIZ56K.js +26 -0
- package/dist/{client-D0PrO1-Q.d.ts → client-CR1f94wY.d.ts} +97 -7
- package/dist/{client-B3FBDfTg.d.ts → client-CqpOcbin.d.ts} +2 -2
- package/dist/{client-B-8ceVyt.d.mts → client-DMttx1xk.d.mts} +2 -2
- package/dist/{client-r5VSGFRU.d.mts → client-YiSelM7x.d.mts} +97 -7
- package/dist/{index-C-Pxrzna.d.ts → index-CxTVu0HZ.d.ts} +3 -3
- package/dist/{index-DLulxmF1.d.mts → index-DD9z396M.d.mts} +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +17 -10
- package/dist/index.mjs +8 -2
- package/dist/mock/cli.mjs +49 -1
- package/dist/mock/library.js +49 -1
- package/dist/mock/library.mjs +49 -1
- package/dist/mock/msw.js +49 -1
- package/dist/mock/msw.mjs +49 -1
- package/dist/{payment-TnJUoHqL.d.mts → payment-5d8FTA1q.d.mts} +1 -1
- package/dist/{payment-Cfoo9MT7.d.ts → payment-BX7ccIKY.d.ts} +1 -1
- package/dist/{price-CCDSrIsc.d.ts → price-DtfP_Xfq.d.ts} +1 -1
- package/dist/{price-CM0zVSyM.d.mts → price-arl_4Rzn.d.mts} +1 -1
- package/dist/{product-DoA36Eqh.d.mts → product-DZX4QuKS.d.mts} +68 -4
- package/dist/{product-DoA36Eqh.d.ts → product-DZX4QuKS.d.ts} +68 -4
- package/dist/react.d.mts +405 -7
- package/dist/react.d.ts +405 -7
- package/dist/react.js +2345 -74
- package/dist/react.mjs +2323 -72
- package/dist/{server-CI1CUFVu.d.mts → server-BceZMxcK.d.mts} +8 -1
- package/dist/{server-CHfYeTAa.d.ts → server-DoJGSC7L.d.ts} +8 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +2 -2
- package/dist/server.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -2
- package/dist/testing/msw.mjs +2 -1
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +23 -22
- package/dist/testing/suite.mjs +4 -3
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +79 -78
- package/dist/testing.mjs +5 -4
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/package.json +4 -1
- package/registry/chat-widget.json +1 -1
- package/registry/product-customizer.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 BusinessDetailsDTO, y as BusinessHours, z as BusinessPreferences, C as BusinessService, D as BusinessSettings, 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
|
|
2
|
-
import { bb as ProductWithDetails, j as ApiError } from './product-
|
|
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 BOUNDARY_KIND, p as BenefitType, q as BillingFrequency, r as BillingMarkupType, s as BillingPlanType, t as BoundaryKind, u as Bundle, v as BundleComponentData, w as BundleComponentInfo, x as BundleComponentVariantView, y as BundleComponentView, z as BundlePriceType, C as BundleProduct, D as BundleSelectionData, E as BundleSelectionInput, F as BundleStoredSelection, G as BundleSummary, H as BundleWithDetails, I as Cart, J as CartAddOn, K as CartChannel, L as CartItem, M as CartItemDetails, N as CartMutationResult, O as CartNotice, P as CartStatus, Q as CartSummary, R as CartTotals, S as Category, T as CategorySummary, U as ChosenPrice, V as CimplifyError, W as Collection, X as CollectionProduct, Y as CollectionSummary, Z as ComponentGroup, _ as ComponentGroupWithComponents, $ as ComponentPriceBreakdown, a0 as ComponentSchedulingData, a1 as ComponentSelectionInput, a2 as ComponentSourceType, a3 as Composite, a4 as CompositeComponent, a5 as CompositeComponentView, a6 as CompositeGroupView, a7 as CompositePriceBreakdown, a8 as CompositePriceResult, a9 as CompositePricingMode, aa as CompositeSelectionData, a1 as CompositeSelectionInput, ab as CompositeStoredSelection, ac as CompositeWithDetails, ad as CurrencyCode, ae as CustomAttributeDefinition, af as CustomAttributeValue, ag as CustomerInputValue, ah as DURATION_UNIT, ai as DateRangeValue, aj as Deal, ak as DealBenefitType, al as DepositType, am as DigitalProductType, an as DiscountBreakdown, ao as DiscountDetails, ap as DiscountValidation, aq as DisplayAddOn, ar as DisplayAddOnOption, as as DisplayCart, at as DisplayCartItem, au as DisplayMode, av as DurationUnit, aw as ERROR_HINTS, ax as EligiblePlansQuery, ay as ErrorCode, az as ErrorCodeType, aA as ErrorHint, aB as FacetValue, aC as FormattedPlanOption, aD as GroupPricingBehavior, aE as INPUT_FIELD_TYPE, aF as IdempotencyMismatchError, aG as InputFieldType, aH as InputFieldValidation, aI as InventoryType, aJ as KnowledgeArticle, aK as LineConfiguration, aL as LocationProductPrice, aM as LocationValue, aN as MeasurementValue, aO as Money, aP as PRODUCT_TYPE, aQ as Pagination, aR as PaginationParams, aS as PhoneValue, aT as Price, aU as PriceAdjustment, aV as PriceDecisionPath, aW as PriceEntryType, aX as PricePathTaxInfo, aY as PriceSource, aZ as Product, a_ as ProductAddOn, a$ as ProductAvailability, b0 as ProductAvailabilityNow, b1 as ProductBillingPlan, b2 as ProductDealInfo, b3 as ProductInputField, b4 as ProductProperty, b5 as ProductRenderHint, b6 as ProductTaxonomy, b7 as ProductTimeProfile, b8 as ProductType, b9 as ProductVariant, ba as ProductVariantValue, bc as PropertyFacet, bd as PropertySource, be as QuantityPricingTier, bf as RENDER_HINT, bg as RelatedProductView, bh as SaleCapInfo, bi as SaleInfo, bj as SalesChannel, bk as SchedulingMode, bl as SelectedAddOnOption, bm as SemanticKind, bn as SignatureValue, bo as Subscription, bp as SubscriptionInvoice, bq as SubscriptionItem, br as SubscriptionStatus, bs as SubscriptionWithDetails, bt as Tag, bu as TagsResponse, bv as TaxPathComponent, bw as TaxonomyAttributeTemplate, bx as TaxonomyWithChildren, by as UICart, bz as UICartBusiness, bA as UICartCustomer, bB as UICartLocation, bC as UICartPricing, bD as UpcomingSale, bE as UpdateCartItemInput, bF as VariantAxis, bG as VariantAxisSelection, bH as VariantAxisValue, bI as VariantAxisValueView, bJ as VariantAxisView, bK as VariantAxisWithValues, bL as VariantDetails, bM as VariantDetailsDTO, bN as VariantDisplayAttribute, bO as VariantLocationAvailability, bP as VariantStrategy, bQ as VariantView, bR as ZERO, bT as currencyCode, bU as enrichError, bV as getErrorHint, bW as isCimplifyError, bX as isIdempotencyMismatchError, bY as isQuoteConflictRequiringConsent, bZ as isQuoteError, b_ as isRetryableError, b$ as isSupportedCurrency, c0 as money, c1 as moneyFromNumber } from './product-
|
|
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-
|
|
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 BusinessDetailsDTO, y as BusinessHours, z as BusinessPreferences, C as BusinessService, D as BusinessSettings, 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 ChatReplyCard, Y as ChatReplyContext, Z as ChatUploadAttachment, _ as ChatWidgetStarter, $ as CheckSlotAvailabilityInput, a0 as CheckSlotAvailabilityResult, a1 as CheckoutAddressInfo, a2 as CheckoutCartData, a3 as CheckoutCartItem, a4 as CheckoutCustomerInfo, a5 as CheckoutFormData, a6 as CheckoutInput, a7 as CheckoutMode, ab as CheckoutOperations, a8 as CheckoutOrderType, a9 as CheckoutPaymentMethod, aa as CheckoutResult, ab as CheckoutService, ac as CheckoutStatus, ad as CheckoutStatusContext, ae as CheckoutStep, af as CimplifyClient, ag as CimplifyConfig, ah as CimplifyElement, ai as CimplifyElements, aj as ContactType, ak as ContentType, al as CreateAddressInput, am as CreateMobileMoneyInput, an as Customer, ao as CustomerAddress, ap as CustomerBooking, aq as CustomerBookingServiceItem, ar as CustomerLinkPreferences, as as CustomerMobileMoney, at as CustomerServicePreferences, au as DEFAULT_COUNTRY, av as DEFAULT_CURRENCY, aw as DEVICE_TYPE, ax as DayAvailability, ay as DeliveryFeeDetails, az as DeliveryFeeResponse, aA as DeliveryOption, aB as DeliveryOptionsResponse, aC as DeliveryService, aD as DepositResult, aE as DeviceType, aF as DismissMessageResponse, aG as ELEMENTS_AUTH_CONTACT_TYPES, aH as ELEMENTS_AUTH_MODES, aI as ELEMENTS_AUTH_PROMPTS, aJ as ELEMENT_TYPES, aK as EVENT_TYPES, aL as ElementAppearance, aM as ElementEventHandler, aN as ElementEventType, aO as ElementOptions, aP as ElementType, aQ as ElementsAuthContactType, aR as ElementsAuthMode, aS as ElementsAuthOptions, aT as ElementsAuthPrompt, aU as ElementsCheckoutData, aV as ElementsCheckoutResult, aW as ElementsCustomerInfo, aX as ElementsOptions, aY as EnrichedOrder, aZ as EnrichedOrderItem, a_ as EnrollAndLinkOrderInput, a$ as EnrollAndLinkOrderResult, b0 as EnrollmentData, b1 as Err, b2 as FeeBearerType, b3 as FetchQuoteInput, b4 as FulfillmentLink, b5 as FulfillmentStatus, b6 as FulfillmentSummaryDTO, b7 as FulfillmentType, b8 as FxQuote, b9 as FxQuoteRequest, ba as FxQuoteStatus, bb as FxRateResponse, bc as FxService, bd as GetAvailableSlotsInput, be as GetDeliveryOptionsParams, bf as GetOrdersOptions, bg as GetProductsOptions, bh as GroupOrderInfo, bi as IframeToParentMessage, bj as InventoryService, bk as LINK_MUTATION, bl as LINK_QUERY, bm as LifecyclePhase, bn as LineItem, bo as LineType, bp as LinkData, bq as LinkEnrollResult, br as LinkService, bs as LinkSession, bt as LinkStatusResult, bu as LiteBootstrap, bv as LiteDayHours, bw as LiteHoursRange, bx as LiteService, by as Location, bz as LocationBooking, bA as LocationTaxBehavior, bB as LocationTaxOverrides, bC as LocationTimeProfile, bD as LocationWithDetails, bE as MESSAGE_TYPES, bF as MOBILE_MONEY_PROVIDER, bG as MobileMoneyData, bH as MobileMoneyDetails, bI as MobileMoneyProvider, bJ as NextAction, bK as ORDER_MUTATION, bL as ORDER_TYPE, bM as ObservabilityHooks, bN as Ok, bO as Order, bP as OrderCustomerInfo, bQ as OrderDiscountInfo, bR as OrderFilter, bS as OrderFulfillmentSummary, bT as OrderGroup, bU as OrderGroupDetails, bV as OrderGroupPayment, bW as OrderGroupPaymentState, bX as OrderGroupPaymentStatus, bY as OrderGroupPaymentSummary, bZ as OrderGroupStatus, b_ as OrderHistory, b$ as OrderLineState, c0 as OrderLineStatus, c1 as OrderLocationInfo, c2 as OrderPaymentEvent, c3 as OrderPricingView, c4 as OrderQueries, c5 as OrderSplitDetail, c6 as OrderStaffInfo, c7 as OrderStatus, c8 as OrderTimestampsDTO, c9 as OrderType, ca as Origin, cb as OriginActor, cc as OriginChannel, cd as OtpResult, ce as PAYMENT_METHOD, cf as PAYMENT_MUTATION, cg as PAYMENT_STATE, ch as PICKUP_TIME_TYPE, ci as ParentToIframeMessage, cj as PaymentInfoDTO, ck as PaymentMethodInfo, cl as PaymentState, cm as PickupTime, cn as PickupTimeType, co as PlaceDetailsResponse, cp as PlacesService, cq as PriceQuote, cr as PricingOverrides, cs as ProcessAndResolveOptions, ct as ProcessCheckoutOptions, cu as ProcessCheckoutResult, cv as ProviderResolutionSource, cw as QuoteBundleSelectionInput, cx as QuoteCompositeSelectionInput, cy as QuoteDynamicBuckets, cz as QuoteStatus, cA as QuoteUiMessage, cB as ReadRequestOptions, cC as RefreshQuoteInput, cD as RefreshQuoteResult, cE as RefundOrderInput, cF as RelatedCandidate, cG as RelatedProduct, cH as RelatedProductsEnrichment, cI as RelationType, cJ as ReminderMethod, cK as ReminderSettings, cL as ReorderResult, cM as RequestContext, cN as RequestErrorEvent, cO as RequestOptions, cP as RequestOtpInput, cQ as RequestSource, cR as RequestStartEvent, cS as RequestSuccessEvent, cT as RescheduleBookingInput, cU as RescheduleBookingResult, cV as RescheduleHistoryRecord, cW as ResourceAssignment, cX as ResourceInfo, cY as Result, cZ as RetryEvent, c_ as RevokeAllSessionsResult, c$ as RevokeSessionResult, d0 as Room, d1 as SchedulingMetadata, d2 as SchedulingResult, d3 as SchedulingService, d4 as SenderType, d5 as Service, d6 as ServiceAvailabilityParams, d7 as ServiceAvailabilityResult, d8 as ServiceCharge, d9 as ServiceNotes, da as ServiceScheduleRequest, db as ServiceStatus, dc as SessionActivityData, dd as SessionChangeEvent, de as SessionMessage, df as SlotResourceInfo, dg as SlotStaffInfo, dh as Staff, di as StaffAssignment, dj as StaffRole, dk as StaffScheduleItem, dl as StockLevel, dm as StockStatus, dn as StoreCreditBalance, dp as StoreCreditQueries, dq as StorefrontBootstrap, dr as SubscriptionService, ds as SupportService, dt as Table, du as TimeRange, dv as TimeRanges, dw as TimeSlot, dx as TrackCategoryViewOptions, dy as TrackProductViewOptions, dz as UpdateAddressInput, dA as UpdateOrderStatusInput, dB as UpdateProfileInput, dC as UploadInitResponse, dD as UploadResult, dE as UploadService, dF as VerifyOtpInput, dG as chatMessageCards, dH as combine, dI as combineObject, dJ as createCimplifyClient, dK as createElements, dL as err, dM as flatMap, dN as fromPromise, dO as getOrElse, dP as isErr, dQ as isOk, dR as mapError, dS as mapResult, dT as ok, dU as toNullable, dV as tryCatch, dW as unwrap } from './client-CR1f94wY.js';
|
|
2
|
+
import { bb as ProductWithDetails, j as ApiError } from './product-DZX4QuKS.js';
|
|
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 BOUNDARY_KIND, p as BenefitType, q as BillingFrequency, r as BillingMarkupType, s as BillingPlanType, t as BoundaryKind, u as Bundle, v as BundleComponentData, w as BundleComponentInfo, x as BundleComponentVariantView, y as BundleComponentView, z as BundlePriceType, C as BundleProduct, D as BundleSelectionData, E as BundleSelectionInput, F as BundleStoredSelection, G as BundleSummary, H as BundleWithDetails, I as Cart, J as CartAddOn, K as CartChannel, L as CartItem, M as CartItemDetails, N as CartMutationResult, O as CartNotice, P as CartStatus, Q as CartSummary, R as CartTotals, S as Category, T as CategorySummary, U as ChosenPrice, V as CimplifyError, W as Collection, X as CollectionProduct, Y as CollectionSummary, Z as ComponentGroup, _ as ComponentGroupWithComponents, $ as ComponentPriceBreakdown, a0 as ComponentSchedulingData, a1 as ComponentSelectionInput, a2 as ComponentSourceType, a3 as Composite, a4 as CompositeComponent, a5 as CompositeComponentView, a6 as CompositeGroupView, a7 as CompositePriceBreakdown, a8 as CompositePriceResult, a9 as CompositePricingMode, aa as CompositeSelectionData, a1 as CompositeSelectionInput, ab as CompositeStoredSelection, ac as CompositeWithDetails, ad as CurrencyCode, ae as CustomAttributeDefinition, af as CustomAttributeValue, ag as CustomerInputValue, ah as DURATION_UNIT, ai as DateRangeValue, aj as Deal, ak as DealBenefitType, al as DepositType, am as DigitalProductType, an as DiscountBreakdown, ao as DiscountDetails, ap as DiscountValidation, aq as DisplayAddOn, ar as DisplayAddOnOption, as as DisplayCart, at as DisplayCartItem, au as DisplayMode, av as DurationUnit, aw as ERROR_HINTS, ax as EligiblePlansQuery, ay as ErrorCode, az as ErrorCodeType, aA as ErrorHint, aB as FacetValue, aC as FormattedPlanOption, aD as GroupPricingBehavior, aE as INPUT_FIELD_TYPE, aF as IdempotencyMismatchError, aG as InputFieldType, aH as InputFieldValidation, aI as InventoryType, aJ as KnowledgeArticle, aK as LineConfiguration, aL as LocationProductPrice, aM as LocationValue, aN as MeasurementValue, aO as Money, aP as PRODUCT_TYPE, aQ as Pagination, aR as PaginationParams, aS as PhoneValue, aT as Price, aU as PriceAdjustment, aV as PriceDecisionPath, aW as PriceEntryType, aX as PricePathTaxInfo, aY as PriceSource, aZ as Product, a_ as ProductAddOn, a$ as ProductAvailability, b0 as ProductAvailabilityNow, b1 as ProductBillingPlan, b2 as ProductDealInfo, b3 as ProductInputField, b4 as ProductProperty, b5 as ProductRenderHint, b6 as ProductTaxonomy, b7 as ProductTimeProfile, b8 as ProductType, b9 as ProductVariant, ba as ProductVariantValue, bc as PropertyFacet, bd as PropertySource, be as QuantityPricingTier, bf as RENDER_HINT, bg as RelatedProductView, bh as SaleCapInfo, bi as SaleInfo, bj as SalesChannel, bk as SchedulingMode, bl as SelectedAddOnOption, bm as SemanticKind, bn as SignatureValue, bo as Subscription, bp as SubscriptionInvoice, bq as SubscriptionItem, br as SubscriptionStatus, bs as SubscriptionWithDetails, bt as Tag, bu as TagsResponse, bv as TaxPathComponent, bw as TaxonomyAttributeTemplate, bx as TaxonomyWithChildren, by as UICart, bz as UICartBusiness, bA as UICartCustomer, bB as UICartLocation, bC as UICartPricing, bD as UpcomingSale, bE as UpdateCartItemInput, bF as VariantAxis, bG as VariantAxisSelection, bH as VariantAxisValue, bI as VariantAxisValueView, bJ as VariantAxisView, bK as VariantAxisWithValues, bL as VariantDetails, bM as VariantDetailsDTO, bN as VariantDisplayAttribute, bO as VariantLocationAvailability, bP as VariantStrategy, bQ as VariantView, bR as ZERO, bT as currencyCode, bU as enrichError, bV as getErrorHint, bW as isCimplifyError, bX as isIdempotencyMismatchError, bY as isQuoteConflictRequiringConsent, bZ as isQuoteError, b_ as isRetryableError, b$ as isSupportedCurrency, c0 as money, c1 as moneyFromNumber } from './product-DZX4QuKS.js';
|
|
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-CxTVu0HZ.js';
|
|
5
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-DQlIdqsi.js';
|
|
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-
|
|
7
|
-
export { F as FormatCompactOptions, a as FormatPriceOptions, P as ProductWithPrice } from './price-
|
|
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-BX7ccIKY.js';
|
|
7
|
+
export { F as FormatCompactOptions, a as FormatPriceOptions, P as ProductWithPrice } from './price-DtfP_Xfq.js';
|
|
8
8
|
export { generateIdempotencyKey } from './advanced.js';
|
|
9
9
|
import 'libphonenumber-js';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkT7Z25EY4_js = require('./chunk-T7Z25EY4.js');
|
|
4
4
|
var chunkL5GKVQVJ_js = require('./chunk-L5GKVQVJ.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkBN4V4ONE_js = require('./chunk-BN4V4ONE.js');
|
|
6
6
|
var chunkGHFDYM5K_js = require('./chunk-GHFDYM5K.js');
|
|
7
7
|
var chunkPTPOQVXS_js = require('./chunk-PTPOQVXS.js');
|
|
8
8
|
var chunkAETVRBKI_js = require('./chunk-AETVRBKI.js');
|
|
9
9
|
require('./chunk-OWW5GUSB.js');
|
|
10
10
|
|
|
11
|
+
// src/types/support.ts
|
|
12
|
+
function chatMessageCards(message) {
|
|
13
|
+
const cards = message.metadata?.["cards"];
|
|
14
|
+
return Array.isArray(cards) ? cards : [];
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
// src/silent-sign-in.ts
|
|
12
18
|
var DEFAULT_SCOPE = "openid email phone profile";
|
|
13
19
|
var DEFAULT_TIMEOUT_MS = 12e3;
|
|
@@ -159,39 +165,39 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
|
|
|
159
165
|
});
|
|
160
166
|
Object.defineProperty(exports, "ActivityService", {
|
|
161
167
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkBN4V4ONE_js.ActivityService; }
|
|
163
169
|
});
|
|
164
170
|
Object.defineProperty(exports, "CimplifyClient", {
|
|
165
171
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
172
|
+
get: function () { return chunkBN4V4ONE_js.CimplifyClient; }
|
|
167
173
|
});
|
|
168
174
|
Object.defineProperty(exports, "DeliveryService", {
|
|
169
175
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunkBN4V4ONE_js.DeliveryService; }
|
|
171
177
|
});
|
|
172
178
|
Object.defineProperty(exports, "PlacesService", {
|
|
173
179
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkBN4V4ONE_js.PlacesService; }
|
|
175
181
|
});
|
|
176
182
|
Object.defineProperty(exports, "StoreCreditQueries", {
|
|
177
183
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkBN4V4ONE_js.StoreCreditQueries; }
|
|
179
185
|
});
|
|
180
186
|
Object.defineProperty(exports, "SubscriptionService", {
|
|
181
187
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkBN4V4ONE_js.SubscriptionService; }
|
|
183
189
|
});
|
|
184
190
|
Object.defineProperty(exports, "SupportService", {
|
|
185
191
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkBN4V4ONE_js.SupportService; }
|
|
187
193
|
});
|
|
188
194
|
Object.defineProperty(exports, "UploadService", {
|
|
189
195
|
enumerable: true,
|
|
190
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkBN4V4ONE_js.UploadService; }
|
|
191
197
|
});
|
|
192
198
|
Object.defineProperty(exports, "createCimplifyClient", {
|
|
193
199
|
enumerable: true,
|
|
194
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkBN4V4ONE_js.createCimplifyClient; }
|
|
195
201
|
});
|
|
196
202
|
Object.defineProperty(exports, "AUTHORIZATION_TYPE", {
|
|
197
203
|
enumerable: true,
|
|
@@ -597,4 +603,5 @@ Object.defineProperty(exports, "moneyFromNumber", {
|
|
|
597
603
|
enumerable: true,
|
|
598
604
|
get: function () { return chunkAETVRBKI_js.moneyFromNumber; }
|
|
599
605
|
});
|
|
606
|
+
exports.chatMessageCards = chatMessageCards;
|
|
600
607
|
exports.signInSilent = signInSilent;
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
export { BOUNDARY_KIND, CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, getVariantDisplayName, isCimplifyAsset, resolveGallery } from './chunk-OZDDHSIB.mjs';
|
|
2
2
|
export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
|
|
3
|
-
export { ActivityService, CimplifyClient, DeliveryService, PlacesService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-
|
|
3
|
+
export { ActivityService, CimplifyClient, DeliveryService, PlacesService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-2UDEWILL.mjs';
|
|
4
4
|
import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-ZU4ZRYUR.mjs';
|
|
5
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, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, 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, startSignIn, toNullable, tryCatch, unwrap } from './chunk-ZU4ZRYUR.mjs';
|
|
6
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-KFLGQGMC.mjs';
|
|
7
7
|
export { CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-K5EN2W2Q.mjs';
|
|
8
8
|
import './chunk-3G6RQLXK.mjs';
|
|
9
9
|
|
|
10
|
+
// src/types/support.ts
|
|
11
|
+
function chatMessageCards(message) {
|
|
12
|
+
const cards = message.metadata?.["cards"];
|
|
13
|
+
return Array.isArray(cards) ? cards : [];
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
// src/silent-sign-in.ts
|
|
11
17
|
var DEFAULT_SCOPE = "openid email phone profile";
|
|
12
18
|
var DEFAULT_TIMEOUT_MS = 12e3;
|
|
@@ -96,4 +102,4 @@ async function signInSilent(opts) {
|
|
|
96
102
|
});
|
|
97
103
|
}
|
|
98
104
|
|
|
99
|
-
export { signInSilent };
|
|
105
|
+
export { chatMessageCards, signInSilent };
|
package/dist/mock/cli.mjs
CHANGED
|
@@ -3494,13 +3494,18 @@ function buildV1(deps) {
|
|
|
3494
3494
|
const body = await c.req.json().catch(() => ({}));
|
|
3495
3495
|
return tryRoute(
|
|
3496
3496
|
c,
|
|
3497
|
-
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type })
|
|
3497
|
+
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type, reply_to_message_id: body.reply_to_message_id })
|
|
3498
3498
|
);
|
|
3499
3499
|
});
|
|
3500
3500
|
app.get(
|
|
3501
3501
|
"/support/conversation/messages",
|
|
3502
3502
|
(c) => tryRoute(c, () => deps.support.listMessages(c.req.query("conversation_id") ?? "", { limit: getQueryNum(c, "limit") }))
|
|
3503
3503
|
);
|
|
3504
|
+
app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
|
|
3505
|
+
const body = await c.req.json().catch(() => ({}));
|
|
3506
|
+
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
3507
|
+
});
|
|
3508
|
+
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
3504
3509
|
app.get(
|
|
3505
3510
|
"/support/conversation/ws",
|
|
3506
3511
|
(c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
|
|
@@ -6445,6 +6450,28 @@ function createActivityService(opts) {
|
|
|
6445
6450
|
};
|
|
6446
6451
|
}
|
|
6447
6452
|
|
|
6453
|
+
// src/genui/segments.ts
|
|
6454
|
+
var FENCE_PATTERN = /```genui\s*\n([\s\S]*?)(?:```|$)/g;
|
|
6455
|
+
function splitGenUIContent(content) {
|
|
6456
|
+
const segments = [];
|
|
6457
|
+
let cursor = 0;
|
|
6458
|
+
for (const match2 of content.matchAll(FENCE_PATTERN)) {
|
|
6459
|
+
const prose = content.slice(cursor, match2.index).trim();
|
|
6460
|
+
if (prose) segments.push({ kind: "prose", text: prose });
|
|
6461
|
+
const source = match2[1].trim();
|
|
6462
|
+
if (source) segments.push({ kind: "program", source });
|
|
6463
|
+
cursor = match2.index + match2[0].length;
|
|
6464
|
+
}
|
|
6465
|
+
const tail = content.slice(cursor).trim();
|
|
6466
|
+
if (tail) segments.push({ kind: "prose", text: tail });
|
|
6467
|
+
return segments;
|
|
6468
|
+
}
|
|
6469
|
+
function messagePreview(content, max = 90) {
|
|
6470
|
+
const prose = splitGenUIContent(content).filter((segment) => segment.kind === "prose").map((segment) => segment.text).join(" ").replace(/\s+/g, " ").trim();
|
|
6471
|
+
if (!prose) return "Structured answer";
|
|
6472
|
+
return prose.length > max ? `${prose.slice(0, max)}\u2026` : prose;
|
|
6473
|
+
}
|
|
6474
|
+
|
|
6448
6475
|
// src/mock/domain/support.ts
|
|
6449
6476
|
function createSupportService(opts) {
|
|
6450
6477
|
const { registry, clock, ids, bus } = opts;
|
|
@@ -6474,12 +6501,14 @@ function createSupportService(opts) {
|
|
|
6474
6501
|
sendMessage(conversationId, body) {
|
|
6475
6502
|
const conv = registry.conversations.get(conversationId);
|
|
6476
6503
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
|
6504
|
+
const target = body.reply_to_message_id ? conv.messages.find((m) => m.id === body.reply_to_message_id) : void 0;
|
|
6477
6505
|
const msg = {
|
|
6478
6506
|
id: ids.message(),
|
|
6479
6507
|
conversation_id: conversationId,
|
|
6480
6508
|
sender_type: body.sender_type ?? "customer",
|
|
6481
6509
|
content_type: body.content_type ?? "text",
|
|
6482
6510
|
content: body.content,
|
|
6511
|
+
reply_to: target ? { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) } : void 0,
|
|
6483
6512
|
created_at: clock.iso()
|
|
6484
6513
|
};
|
|
6485
6514
|
conv.messages.push(msg);
|
|
@@ -6501,6 +6530,25 @@ function createSupportService(opts) {
|
|
|
6501
6530
|
}
|
|
6502
6531
|
return msg;
|
|
6503
6532
|
},
|
|
6533
|
+
react(messageId, emoji) {
|
|
6534
|
+
for (const conv of registry.conversations.values()) {
|
|
6535
|
+
const target = conv.messages.find((m) => m.id === messageId);
|
|
6536
|
+
if (!target) continue;
|
|
6537
|
+
const reaction = {
|
|
6538
|
+
id: ids.message(),
|
|
6539
|
+
conversation_id: conv.id,
|
|
6540
|
+
sender_type: "customer",
|
|
6541
|
+
content_type: "text",
|
|
6542
|
+
content: emoji,
|
|
6543
|
+
reply_to: { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) },
|
|
6544
|
+
created_at: clock.iso()
|
|
6545
|
+
};
|
|
6546
|
+
conv.messages.push(reaction);
|
|
6547
|
+
registry.conversations.put(conv.id, conv);
|
|
6548
|
+
return reaction;
|
|
6549
|
+
}
|
|
6550
|
+
throw notFound(`Message ${messageId} not found`);
|
|
6551
|
+
},
|
|
6504
6552
|
listMessages(conversationId, opts2) {
|
|
6505
6553
|
const conv = registry.conversations.get(conversationId);
|
|
6506
6554
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
package/dist/mock/library.js
CHANGED
|
@@ -2556,13 +2556,18 @@ function buildV1(deps) {
|
|
|
2556
2556
|
const body = await c.req.json().catch(() => ({}));
|
|
2557
2557
|
return tryRoute(
|
|
2558
2558
|
c,
|
|
2559
|
-
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type })
|
|
2559
|
+
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type, reply_to_message_id: body.reply_to_message_id })
|
|
2560
2560
|
);
|
|
2561
2561
|
});
|
|
2562
2562
|
app.get(
|
|
2563
2563
|
"/support/conversation/messages",
|
|
2564
2564
|
(c) => tryRoute(c, () => deps.support.listMessages(c.req.query("conversation_id") ?? "", { limit: getQueryNum(c, "limit") }))
|
|
2565
2565
|
);
|
|
2566
|
+
app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
|
|
2567
|
+
const body = await c.req.json().catch(() => ({}));
|
|
2568
|
+
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
2569
|
+
});
|
|
2570
|
+
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
2566
2571
|
app.get(
|
|
2567
2572
|
"/support/conversation/ws",
|
|
2568
2573
|
(c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
|
|
@@ -5507,6 +5512,28 @@ function createActivityService(opts) {
|
|
|
5507
5512
|
};
|
|
5508
5513
|
}
|
|
5509
5514
|
|
|
5515
|
+
// src/genui/segments.ts
|
|
5516
|
+
var FENCE_PATTERN = /```genui\s*\n([\s\S]*?)(?:```|$)/g;
|
|
5517
|
+
function splitGenUIContent(content) {
|
|
5518
|
+
const segments = [];
|
|
5519
|
+
let cursor = 0;
|
|
5520
|
+
for (const match2 of content.matchAll(FENCE_PATTERN)) {
|
|
5521
|
+
const prose = content.slice(cursor, match2.index).trim();
|
|
5522
|
+
if (prose) segments.push({ kind: "prose", text: prose });
|
|
5523
|
+
const source = match2[1].trim();
|
|
5524
|
+
if (source) segments.push({ kind: "program", source });
|
|
5525
|
+
cursor = match2.index + match2[0].length;
|
|
5526
|
+
}
|
|
5527
|
+
const tail = content.slice(cursor).trim();
|
|
5528
|
+
if (tail) segments.push({ kind: "prose", text: tail });
|
|
5529
|
+
return segments;
|
|
5530
|
+
}
|
|
5531
|
+
function messagePreview(content, max = 90) {
|
|
5532
|
+
const prose = splitGenUIContent(content).filter((segment) => segment.kind === "prose").map((segment) => segment.text).join(" ").replace(/\s+/g, " ").trim();
|
|
5533
|
+
if (!prose) return "Structured answer";
|
|
5534
|
+
return prose.length > max ? `${prose.slice(0, max)}\u2026` : prose;
|
|
5535
|
+
}
|
|
5536
|
+
|
|
5510
5537
|
// src/mock/domain/support.ts
|
|
5511
5538
|
function createSupportService(opts) {
|
|
5512
5539
|
const { registry, clock, ids, bus } = opts;
|
|
@@ -5536,12 +5563,14 @@ function createSupportService(opts) {
|
|
|
5536
5563
|
sendMessage(conversationId, body) {
|
|
5537
5564
|
const conv = registry.conversations.get(conversationId);
|
|
5538
5565
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
|
5566
|
+
const target = body.reply_to_message_id ? conv.messages.find((m) => m.id === body.reply_to_message_id) : void 0;
|
|
5539
5567
|
const msg = {
|
|
5540
5568
|
id: ids.message(),
|
|
5541
5569
|
conversation_id: conversationId,
|
|
5542
5570
|
sender_type: body.sender_type ?? "customer",
|
|
5543
5571
|
content_type: body.content_type ?? "text",
|
|
5544
5572
|
content: body.content,
|
|
5573
|
+
reply_to: target ? { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) } : void 0,
|
|
5545
5574
|
created_at: clock.iso()
|
|
5546
5575
|
};
|
|
5547
5576
|
conv.messages.push(msg);
|
|
@@ -5563,6 +5592,25 @@ function createSupportService(opts) {
|
|
|
5563
5592
|
}
|
|
5564
5593
|
return msg;
|
|
5565
5594
|
},
|
|
5595
|
+
react(messageId, emoji) {
|
|
5596
|
+
for (const conv of registry.conversations.values()) {
|
|
5597
|
+
const target = conv.messages.find((m) => m.id === messageId);
|
|
5598
|
+
if (!target) continue;
|
|
5599
|
+
const reaction = {
|
|
5600
|
+
id: ids.message(),
|
|
5601
|
+
conversation_id: conv.id,
|
|
5602
|
+
sender_type: "customer",
|
|
5603
|
+
content_type: "text",
|
|
5604
|
+
content: emoji,
|
|
5605
|
+
reply_to: { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) },
|
|
5606
|
+
created_at: clock.iso()
|
|
5607
|
+
};
|
|
5608
|
+
conv.messages.push(reaction);
|
|
5609
|
+
registry.conversations.put(conv.id, conv);
|
|
5610
|
+
return reaction;
|
|
5611
|
+
}
|
|
5612
|
+
throw notFound(`Message ${messageId} not found`);
|
|
5613
|
+
},
|
|
5566
5614
|
listMessages(conversationId, opts2) {
|
|
5567
5615
|
const conv = registry.conversations.get(conversationId);
|
|
5568
5616
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
package/dist/mock/library.mjs
CHANGED
|
@@ -2554,13 +2554,18 @@ function buildV1(deps) {
|
|
|
2554
2554
|
const body = await c.req.json().catch(() => ({}));
|
|
2555
2555
|
return tryRoute(
|
|
2556
2556
|
c,
|
|
2557
|
-
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type })
|
|
2557
|
+
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type, reply_to_message_id: body.reply_to_message_id })
|
|
2558
2558
|
);
|
|
2559
2559
|
});
|
|
2560
2560
|
app.get(
|
|
2561
2561
|
"/support/conversation/messages",
|
|
2562
2562
|
(c) => tryRoute(c, () => deps.support.listMessages(c.req.query("conversation_id") ?? "", { limit: getQueryNum(c, "limit") }))
|
|
2563
2563
|
);
|
|
2564
|
+
app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
|
|
2565
|
+
const body = await c.req.json().catch(() => ({}));
|
|
2566
|
+
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
2567
|
+
});
|
|
2568
|
+
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
2564
2569
|
app.get(
|
|
2565
2570
|
"/support/conversation/ws",
|
|
2566
2571
|
(c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
|
|
@@ -5505,6 +5510,28 @@ function createActivityService(opts) {
|
|
|
5505
5510
|
};
|
|
5506
5511
|
}
|
|
5507
5512
|
|
|
5513
|
+
// src/genui/segments.ts
|
|
5514
|
+
var FENCE_PATTERN = /```genui\s*\n([\s\S]*?)(?:```|$)/g;
|
|
5515
|
+
function splitGenUIContent(content) {
|
|
5516
|
+
const segments = [];
|
|
5517
|
+
let cursor = 0;
|
|
5518
|
+
for (const match2 of content.matchAll(FENCE_PATTERN)) {
|
|
5519
|
+
const prose = content.slice(cursor, match2.index).trim();
|
|
5520
|
+
if (prose) segments.push({ kind: "prose", text: prose });
|
|
5521
|
+
const source = match2[1].trim();
|
|
5522
|
+
if (source) segments.push({ kind: "program", source });
|
|
5523
|
+
cursor = match2.index + match2[0].length;
|
|
5524
|
+
}
|
|
5525
|
+
const tail = content.slice(cursor).trim();
|
|
5526
|
+
if (tail) segments.push({ kind: "prose", text: tail });
|
|
5527
|
+
return segments;
|
|
5528
|
+
}
|
|
5529
|
+
function messagePreview(content, max = 90) {
|
|
5530
|
+
const prose = splitGenUIContent(content).filter((segment) => segment.kind === "prose").map((segment) => segment.text).join(" ").replace(/\s+/g, " ").trim();
|
|
5531
|
+
if (!prose) return "Structured answer";
|
|
5532
|
+
return prose.length > max ? `${prose.slice(0, max)}\u2026` : prose;
|
|
5533
|
+
}
|
|
5534
|
+
|
|
5508
5535
|
// src/mock/domain/support.ts
|
|
5509
5536
|
function createSupportService(opts) {
|
|
5510
5537
|
const { registry, clock, ids, bus } = opts;
|
|
@@ -5534,12 +5561,14 @@ function createSupportService(opts) {
|
|
|
5534
5561
|
sendMessage(conversationId, body) {
|
|
5535
5562
|
const conv = registry.conversations.get(conversationId);
|
|
5536
5563
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
|
5564
|
+
const target = body.reply_to_message_id ? conv.messages.find((m) => m.id === body.reply_to_message_id) : void 0;
|
|
5537
5565
|
const msg = {
|
|
5538
5566
|
id: ids.message(),
|
|
5539
5567
|
conversation_id: conversationId,
|
|
5540
5568
|
sender_type: body.sender_type ?? "customer",
|
|
5541
5569
|
content_type: body.content_type ?? "text",
|
|
5542
5570
|
content: body.content,
|
|
5571
|
+
reply_to: target ? { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) } : void 0,
|
|
5543
5572
|
created_at: clock.iso()
|
|
5544
5573
|
};
|
|
5545
5574
|
conv.messages.push(msg);
|
|
@@ -5561,6 +5590,25 @@ function createSupportService(opts) {
|
|
|
5561
5590
|
}
|
|
5562
5591
|
return msg;
|
|
5563
5592
|
},
|
|
5593
|
+
react(messageId, emoji) {
|
|
5594
|
+
for (const conv of registry.conversations.values()) {
|
|
5595
|
+
const target = conv.messages.find((m) => m.id === messageId);
|
|
5596
|
+
if (!target) continue;
|
|
5597
|
+
const reaction = {
|
|
5598
|
+
id: ids.message(),
|
|
5599
|
+
conversation_id: conv.id,
|
|
5600
|
+
sender_type: "customer",
|
|
5601
|
+
content_type: "text",
|
|
5602
|
+
content: emoji,
|
|
5603
|
+
reply_to: { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) },
|
|
5604
|
+
created_at: clock.iso()
|
|
5605
|
+
};
|
|
5606
|
+
conv.messages.push(reaction);
|
|
5607
|
+
registry.conversations.put(conv.id, conv);
|
|
5608
|
+
return reaction;
|
|
5609
|
+
}
|
|
5610
|
+
throw notFound(`Message ${messageId} not found`);
|
|
5611
|
+
},
|
|
5564
5612
|
listMessages(conversationId, opts2) {
|
|
5565
5613
|
const conv = registry.conversations.get(conversationId);
|
|
5566
5614
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
package/dist/mock/msw.js
CHANGED
|
@@ -2554,13 +2554,18 @@ function buildV1(deps) {
|
|
|
2554
2554
|
const body = await c.req.json().catch(() => ({}));
|
|
2555
2555
|
return tryRoute(
|
|
2556
2556
|
c,
|
|
2557
|
-
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type })
|
|
2557
|
+
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type, reply_to_message_id: body.reply_to_message_id })
|
|
2558
2558
|
);
|
|
2559
2559
|
});
|
|
2560
2560
|
app.get(
|
|
2561
2561
|
"/support/conversation/messages",
|
|
2562
2562
|
(c) => tryRoute(c, () => deps.support.listMessages(c.req.query("conversation_id") ?? "", { limit: getQueryNum(c, "limit") }))
|
|
2563
2563
|
);
|
|
2564
|
+
app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
|
|
2565
|
+
const body = await c.req.json().catch(() => ({}));
|
|
2566
|
+
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
2567
|
+
});
|
|
2568
|
+
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
2564
2569
|
app.get(
|
|
2565
2570
|
"/support/conversation/ws",
|
|
2566
2571
|
(c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
|
|
@@ -5505,6 +5510,28 @@ function createActivityService(opts) {
|
|
|
5505
5510
|
};
|
|
5506
5511
|
}
|
|
5507
5512
|
|
|
5513
|
+
// src/genui/segments.ts
|
|
5514
|
+
var FENCE_PATTERN = /```genui\s*\n([\s\S]*?)(?:```|$)/g;
|
|
5515
|
+
function splitGenUIContent(content) {
|
|
5516
|
+
const segments = [];
|
|
5517
|
+
let cursor = 0;
|
|
5518
|
+
for (const match2 of content.matchAll(FENCE_PATTERN)) {
|
|
5519
|
+
const prose = content.slice(cursor, match2.index).trim();
|
|
5520
|
+
if (prose) segments.push({ kind: "prose", text: prose });
|
|
5521
|
+
const source = match2[1].trim();
|
|
5522
|
+
if (source) segments.push({ kind: "program", source });
|
|
5523
|
+
cursor = match2.index + match2[0].length;
|
|
5524
|
+
}
|
|
5525
|
+
const tail = content.slice(cursor).trim();
|
|
5526
|
+
if (tail) segments.push({ kind: "prose", text: tail });
|
|
5527
|
+
return segments;
|
|
5528
|
+
}
|
|
5529
|
+
function messagePreview(content, max = 90) {
|
|
5530
|
+
const prose = splitGenUIContent(content).filter((segment) => segment.kind === "prose").map((segment) => segment.text).join(" ").replace(/\s+/g, " ").trim();
|
|
5531
|
+
if (!prose) return "Structured answer";
|
|
5532
|
+
return prose.length > max ? `${prose.slice(0, max)}\u2026` : prose;
|
|
5533
|
+
}
|
|
5534
|
+
|
|
5508
5535
|
// src/mock/domain/support.ts
|
|
5509
5536
|
function createSupportService(opts) {
|
|
5510
5537
|
const { registry, clock, ids, bus } = opts;
|
|
@@ -5534,12 +5561,14 @@ function createSupportService(opts) {
|
|
|
5534
5561
|
sendMessage(conversationId, body) {
|
|
5535
5562
|
const conv = registry.conversations.get(conversationId);
|
|
5536
5563
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
|
5564
|
+
const target = body.reply_to_message_id ? conv.messages.find((m) => m.id === body.reply_to_message_id) : void 0;
|
|
5537
5565
|
const msg = {
|
|
5538
5566
|
id: ids.message(),
|
|
5539
5567
|
conversation_id: conversationId,
|
|
5540
5568
|
sender_type: body.sender_type ?? "customer",
|
|
5541
5569
|
content_type: body.content_type ?? "text",
|
|
5542
5570
|
content: body.content,
|
|
5571
|
+
reply_to: target ? { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) } : void 0,
|
|
5543
5572
|
created_at: clock.iso()
|
|
5544
5573
|
};
|
|
5545
5574
|
conv.messages.push(msg);
|
|
@@ -5561,6 +5590,25 @@ function createSupportService(opts) {
|
|
|
5561
5590
|
}
|
|
5562
5591
|
return msg;
|
|
5563
5592
|
},
|
|
5593
|
+
react(messageId, emoji) {
|
|
5594
|
+
for (const conv of registry.conversations.values()) {
|
|
5595
|
+
const target = conv.messages.find((m) => m.id === messageId);
|
|
5596
|
+
if (!target) continue;
|
|
5597
|
+
const reaction = {
|
|
5598
|
+
id: ids.message(),
|
|
5599
|
+
conversation_id: conv.id,
|
|
5600
|
+
sender_type: "customer",
|
|
5601
|
+
content_type: "text",
|
|
5602
|
+
content: emoji,
|
|
5603
|
+
reply_to: { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) },
|
|
5604
|
+
created_at: clock.iso()
|
|
5605
|
+
};
|
|
5606
|
+
conv.messages.push(reaction);
|
|
5607
|
+
registry.conversations.put(conv.id, conv);
|
|
5608
|
+
return reaction;
|
|
5609
|
+
}
|
|
5610
|
+
throw notFound(`Message ${messageId} not found`);
|
|
5611
|
+
},
|
|
5564
5612
|
listMessages(conversationId, opts2) {
|
|
5565
5613
|
const conv = registry.conversations.get(conversationId);
|
|
5566
5614
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
package/dist/mock/msw.mjs
CHANGED
|
@@ -2552,13 +2552,18 @@ function buildV1(deps) {
|
|
|
2552
2552
|
const body = await c.req.json().catch(() => ({}));
|
|
2553
2553
|
return tryRoute(
|
|
2554
2554
|
c,
|
|
2555
|
-
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type })
|
|
2555
|
+
() => deps.support.sendMessage(body.conversation_id ?? "", { content: body.content ?? "", content_type: body.content_type, sender_type: body.sender_type, reply_to_message_id: body.reply_to_message_id })
|
|
2556
2556
|
);
|
|
2557
2557
|
});
|
|
2558
2558
|
app.get(
|
|
2559
2559
|
"/support/conversation/messages",
|
|
2560
2560
|
(c) => tryRoute(c, () => deps.support.listMessages(c.req.query("conversation_id") ?? "", { limit: getQueryNum(c, "limit") }))
|
|
2561
2561
|
);
|
|
2562
|
+
app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
|
|
2563
|
+
const body = await c.req.json().catch(() => ({}));
|
|
2564
|
+
return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
|
|
2565
|
+
});
|
|
2566
|
+
app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
|
|
2562
2567
|
app.get(
|
|
2563
2568
|
"/support/conversation/ws",
|
|
2564
2569
|
(c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
|
|
@@ -5503,6 +5508,28 @@ function createActivityService(opts) {
|
|
|
5503
5508
|
};
|
|
5504
5509
|
}
|
|
5505
5510
|
|
|
5511
|
+
// src/genui/segments.ts
|
|
5512
|
+
var FENCE_PATTERN = /```genui\s*\n([\s\S]*?)(?:```|$)/g;
|
|
5513
|
+
function splitGenUIContent(content) {
|
|
5514
|
+
const segments = [];
|
|
5515
|
+
let cursor = 0;
|
|
5516
|
+
for (const match2 of content.matchAll(FENCE_PATTERN)) {
|
|
5517
|
+
const prose = content.slice(cursor, match2.index).trim();
|
|
5518
|
+
if (prose) segments.push({ kind: "prose", text: prose });
|
|
5519
|
+
const source = match2[1].trim();
|
|
5520
|
+
if (source) segments.push({ kind: "program", source });
|
|
5521
|
+
cursor = match2.index + match2[0].length;
|
|
5522
|
+
}
|
|
5523
|
+
const tail = content.slice(cursor).trim();
|
|
5524
|
+
if (tail) segments.push({ kind: "prose", text: tail });
|
|
5525
|
+
return segments;
|
|
5526
|
+
}
|
|
5527
|
+
function messagePreview(content, max = 90) {
|
|
5528
|
+
const prose = splitGenUIContent(content).filter((segment) => segment.kind === "prose").map((segment) => segment.text).join(" ").replace(/\s+/g, " ").trim();
|
|
5529
|
+
if (!prose) return "Structured answer";
|
|
5530
|
+
return prose.length > max ? `${prose.slice(0, max)}\u2026` : prose;
|
|
5531
|
+
}
|
|
5532
|
+
|
|
5506
5533
|
// src/mock/domain/support.ts
|
|
5507
5534
|
function createSupportService(opts) {
|
|
5508
5535
|
const { registry, clock, ids, bus } = opts;
|
|
@@ -5532,12 +5559,14 @@ function createSupportService(opts) {
|
|
|
5532
5559
|
sendMessage(conversationId, body) {
|
|
5533
5560
|
const conv = registry.conversations.get(conversationId);
|
|
5534
5561
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
|
5562
|
+
const target = body.reply_to_message_id ? conv.messages.find((m) => m.id === body.reply_to_message_id) : void 0;
|
|
5535
5563
|
const msg = {
|
|
5536
5564
|
id: ids.message(),
|
|
5537
5565
|
conversation_id: conversationId,
|
|
5538
5566
|
sender_type: body.sender_type ?? "customer",
|
|
5539
5567
|
content_type: body.content_type ?? "text",
|
|
5540
5568
|
content: body.content,
|
|
5569
|
+
reply_to: target ? { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) } : void 0,
|
|
5541
5570
|
created_at: clock.iso()
|
|
5542
5571
|
};
|
|
5543
5572
|
conv.messages.push(msg);
|
|
@@ -5559,6 +5588,25 @@ function createSupportService(opts) {
|
|
|
5559
5588
|
}
|
|
5560
5589
|
return msg;
|
|
5561
5590
|
},
|
|
5591
|
+
react(messageId, emoji) {
|
|
5592
|
+
for (const conv of registry.conversations.values()) {
|
|
5593
|
+
const target = conv.messages.find((m) => m.id === messageId);
|
|
5594
|
+
if (!target) continue;
|
|
5595
|
+
const reaction = {
|
|
5596
|
+
id: ids.message(),
|
|
5597
|
+
conversation_id: conv.id,
|
|
5598
|
+
sender_type: "customer",
|
|
5599
|
+
content_type: "text",
|
|
5600
|
+
content: emoji,
|
|
5601
|
+
reply_to: { id: target.id, sender_type: target.sender_type, preview: messagePreview(target.content) },
|
|
5602
|
+
created_at: clock.iso()
|
|
5603
|
+
};
|
|
5604
|
+
conv.messages.push(reaction);
|
|
5605
|
+
registry.conversations.put(conv.id, conv);
|
|
5606
|
+
return reaction;
|
|
5607
|
+
}
|
|
5608
|
+
throw notFound(`Message ${messageId} not found`);
|
|
5609
|
+
},
|
|
5562
5610
|
listMessages(conversationId, opts2) {
|
|
5563
5611
|
const conv = registry.conversations.get(conversationId);
|
|
5564
5612
|
if (!conv) throw notFound(`Conversation ${conversationId} not found`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aO as Money, ad as CurrencyCode } from './product-
|
|
1
|
+
import { aO as Money, ad as CurrencyCode } from './product-DZX4QuKS.mjs';
|
|
2
2
|
|
|
3
3
|
type PaymentStatus = "initialized" | "pending" | "processing" | "authorized" | "captured" | "failed" | "cancelled" | "refunded" | "unknown" | "voided" | "requires_action" | "abandoned" | "reversed" | "disputed" | "refund_pending";
|
|
4
4
|
type PaymentProvider = "stripe" | "paystack" | "cellulant" | "mtn_momo" | "offline" | "mtn" | "vodafone" | "airtel" | "cash" | "manual";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aO as Money, ad as CurrencyCode } from './product-
|
|
1
|
+
import { aO as Money, ad as CurrencyCode } from './product-DZX4QuKS.js';
|
|
2
2
|
|
|
3
3
|
type PaymentStatus = "initialized" | "pending" | "processing" | "authorized" | "captured" | "failed" | "cancelled" | "refunded" | "unknown" | "voided" | "requires_action" | "abandoned" | "reversed" | "disputed" | "refund_pending";
|
|
4
4
|
type PaymentProvider = "stripe" | "paystack" | "cellulant" | "mtn_momo" | "offline" | "mtn" | "vodafone" | "airtel" | "cash" | "manual";
|