@cimplify/sdk 0.103.0 → 0.104.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/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{chunk-C2JSNJUC.mjs → chunk-2WPVUIHX.mjs} +52 -11
- package/dist/{chunk-JG5CQNCB.js → chunk-4BKOKHE3.js} +4 -0
- package/dist/{chunk-R6OLQ33I.js → chunk-5BDYDZ4U.js} +239 -87
- package/dist/{chunk-H7ACMHM3.mjs → chunk-5RT4HYMP.mjs} +32 -4
- package/dist/{chunk-NNG6IFFX.js → chunk-7PDEX54K.js} +3 -3
- package/dist/{chunk-M4URVKHE.mjs → chunk-DYIAX3WI.mjs} +1 -1
- package/dist/{chunk-QOWPGS7Z.js → chunk-E4K2VQDD.js} +35 -5
- package/dist/{chunk-VNPEYLB2.mjs → chunk-H3RATH4B.mjs} +4 -0
- package/dist/{chunk-JSWJ4XDE.js → chunk-IQFFSKE2.js} +315 -108
- package/dist/{chunk-J6PNHDHL.mjs → chunk-OCCNG6MO.mjs} +284 -77
- package/dist/{chunk-GERXZQSX.mjs → chunk-OKADBZAI.mjs} +171 -20
- package/dist/{chunk-VIL6IQCG.js → chunk-YVAEY3VC.js} +54 -13
- package/dist/{client-Dqg2mc-7.d.ts → client-BVNWjk6W.d.ts} +2 -2
- package/dist/{client-BfpNjJ_a.d.mts → client-BuLcOWLv.d.ts} +115 -23
- package/dist/{client-DHBwvh7U.d.ts → client-D5AoobFc.d.mts} +115 -23
- package/dist/{client-DpqRobY9.d.mts → client-fM716k7G.d.mts} +2 -2
- package/dist/{index-C8uDqLwJ.d.ts → index-BtcoqrY1.d.ts} +3 -3
- package/dist/{index-e2y6AK70.d.mts → index-D7Tf3v7c.d.mts} +3 -3
- package/dist/index.d.mts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +107 -106
- package/dist/index.mjs +6 -5
- package/dist/{link-cuNVYc2s.d.mts → link-D9iSVxt5.d.mts} +12 -1
- package/dist/{link-cuNVYc2s.d.ts → link-D9iSVxt5.d.ts} +12 -1
- package/dist/mock/cli.mjs +53 -10
- package/dist/mock/library.js +53 -10
- package/dist/mock/library.mjs +53 -10
- package/dist/mock/msw.js +53 -10
- package/dist/mock/msw.mjs +53 -10
- package/dist/{payment-H5LoIvXU.d.mts → payment-g0HFkEDU.d.mts} +519 -54
- package/dist/{payment-H5LoIvXU.d.ts → payment-g0HFkEDU.d.ts} +519 -54
- package/dist/{price-C2RqscMY.d.ts → price-BLIeAb8K.d.ts} +1 -1
- package/dist/{price-BvePgDXe.d.mts → price-Czq_cTC_.d.mts} +1 -1
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +193 -169
- package/dist/react.mjs +54 -30
- package/dist/{server-C7FyLdrz.d.mts → server-BkVhOIwn.d.mts} +4 -2
- package/dist/{server-DoXIpSd7.d.ts → server-DKK_D-PP.d.ts} +4 -2
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +11 -10
- package/dist/server.mjs +5 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +46 -6
- package/dist/testing.d.ts +46 -6
- package/dist/testing.js +94 -82
- package/dist/testing.mjs +13 -9
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +31 -31
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
- package/registry/chat-widget.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as CimplifyError, U as Category, be as Product, f as AddOnWithOptions, aW as Pagination, bs as ProductWithDetails, bq as ProductVariant, bY as VariantAxis, bZ as VariantAxisSelection, A as AddOn, Y as Collection, I as BundleSummary, w as Bundle, a5 as Composite, a3 as ComponentSelectionInput, aa as CompositePriceResult, af as CurrencyCode, W as ChosenPrice, bz as SaleInfo, bn as ProductTaxonomy, bQ as TaxonomyWithChildren, aC as EligiblePlansQuery, bi as ProductBillingPlan, bo as ProductTimeProfile, bh as ProductAvailabilityNow, al as Deal, bj as ProductDealInfo, au as DiscountValidation, bM as TagsResponse, ag as CustomAttributeDefinition, ah as CustomAttributeValue, bt as PropertyFacet, bP as TaxonomyAttributeTemplate, aP as KnowledgeArticle, bR as UICart, N as CartItem, aq as DestinationQuoteInput, ao as DestinationQuote, S as CartSummary, g as AddToCartInput, P as CartMutationResult, bX as UpdateCartItemInput, at as DiscountDetails, aU as Money, aQ as LineConfiguration, bO as TaxPriceDisplayMode, q as AuthorizationType, aZ as PaymentAuthorizationKind, a_ as PaymentAuthorizationSubmission, b0 as PaymentMethod, aL as InitializePaymentResult, bF as SubmitAuthorizationInput, b6 as PaymentStatusResponse, c2 as VariantDetails, c3 as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, F as BundleSelectionData, ac as CompositeSelectionData, ai as CustomerInputValue, c9 as components, bB as SchedulingMode, aA as DurationUnit, bG as Subscription, bK as SubscriptionWithDetails } from './payment-
|
|
2
|
-
import { P as PAYMENT_METHOD, B as ORDER_TYPE, z as MobileMoneyProvider, C as CHECKOUT_MODE, e as CHECKOUT_STEP, H as PICKUP_TIME_TYPE, R as RequestOtpInput, V as VerifyOtpInput, c as AuthResponse, w as LinkStatusResult, t as LinkData, k as CustomerAddress, m as CustomerMobileMoney, l as CustomerLinkPreferences, j as Customer, r as EnrollmentData, u as LinkEnrollResult, E as EnrollAndLinkOrderInput, q as EnrollAndLinkOrderResult, h as CreateAddressInput, U as UpdateAddressInput, i as CreateMobileMoneyInput, v as LinkSession,
|
|
1
|
+
import { X as CimplifyError, U as Category, be as Product, f as AddOnWithOptions, aW as Pagination, bs as ProductWithDetails, bq as ProductVariant, bY as VariantAxis, bZ as VariantAxisSelection, A as AddOn, Y as Collection, I as BundleSummary, w as Bundle, a5 as Composite, a3 as ComponentSelectionInput, aa as CompositePriceResult, af as CurrencyCode, W as ChosenPrice, bz as SaleInfo, bn as ProductTaxonomy, bQ as TaxonomyWithChildren, aC as EligiblePlansQuery, bi as ProductBillingPlan, bo as ProductTimeProfile, bh as ProductAvailabilityNow, al as Deal, bj as ProductDealInfo, au as DiscountValidation, bM as TagsResponse, ag as CustomAttributeDefinition, ah as CustomAttributeValue, bt as PropertyFacet, bP as TaxonomyAttributeTemplate, aP as KnowledgeArticle, bR as UICart, N as CartItem, aq as DestinationQuoteInput, ao as DestinationQuote, S as CartSummary, g as AddToCartInput, P as CartMutationResult, bX as UpdateCartItemInput, at as DiscountDetails, aU as Money, aQ as LineConfiguration, bO as TaxPriceDisplayMode, q as AuthorizationType, aZ as PaymentAuthorizationKind, a_ as PaymentAuthorizationSubmission, b0 as PaymentMethod, aL as InitializePaymentResult, bF as SubmitAuthorizationInput, b6 as PaymentStatusResponse, c2 as VariantDetails, c3 as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, F as BundleSelectionData, ac as CompositeSelectionData, ai as CustomerInputValue, c9 as components, bB as SchedulingMode, aA as DurationUnit, bG as Subscription, bK as SubscriptionWithDetails } from './payment-g0HFkEDU.js';
|
|
2
|
+
import { P as PAYMENT_METHOD, B as ORDER_TYPE, z as MobileMoneyProvider, C as CHECKOUT_MODE, e as CHECKOUT_STEP, H as PICKUP_TIME_TYPE, R as RequestOtpInput, I as RequestOtpResult$1, V as VerifyOtpInput, c as AuthResponse, w as LinkStatusResult, t as LinkData, k as CustomerAddress, m as CustomerMobileMoney, l as CustomerLinkPreferences, j as Customer, r as EnrollmentData, u as LinkEnrollResult, E as EnrollAndLinkOrderInput, q as EnrollAndLinkOrderResult, h as CreateAddressInput, U as UpdateAddressInput, i as CreateMobileMoneyInput, v as LinkSession, K as RevokeSessionResult, J as RevokeAllSessionsResult } from './link-D9iSVxt5.js';
|
|
3
3
|
|
|
4
4
|
interface RequestContext {
|
|
5
5
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
@@ -735,11 +735,13 @@ interface LocationBooking {
|
|
|
735
735
|
service_status: ServiceStatus;
|
|
736
736
|
}
|
|
737
737
|
type ProviderResolutionSource = "zone" | "hint" | "fallback" | "rate" | "best_price";
|
|
738
|
+
type DeliveryFeeStatus$1 = "priced" | "arranged";
|
|
738
739
|
interface DeliveryFeeDetails {
|
|
739
740
|
zone_id?: string;
|
|
740
741
|
zone_name?: string;
|
|
741
742
|
provider: string;
|
|
742
743
|
provider_resolved_from: ProviderResolutionSource;
|
|
744
|
+
fee_status?: DeliveryFeeStatus$1;
|
|
743
745
|
/** Named rate this fee was priced under, if any. */
|
|
744
746
|
rate_id?: string;
|
|
745
747
|
rate_name?: string;
|
|
@@ -790,6 +792,7 @@ declare const MESSAGE_TYPES: {
|
|
|
790
792
|
readonly INIT: "init";
|
|
791
793
|
readonly SET_TOKEN: "set_token";
|
|
792
794
|
readonly SET_SESSION: "set_session";
|
|
795
|
+
readonly SESSION_CLEARED: "session_cleared";
|
|
793
796
|
readonly SET_CART: "set_cart";
|
|
794
797
|
readonly GET_DATA: "get_data";
|
|
795
798
|
readonly NAVIGATE: "navigate";
|
|
@@ -806,6 +809,8 @@ declare const MESSAGE_TYPES: {
|
|
|
806
809
|
readonly LOGOUT_COMPLETE: "logout_complete";
|
|
807
810
|
readonly AUTH_REQUESTED: "auth_requested";
|
|
808
811
|
readonly SESSION_ESTABLISHED: "session_established";
|
|
812
|
+
readonly SESSION_ESTABLISHMENT_FAILED: "session_establishment_failed";
|
|
813
|
+
readonly CONTINUE_WITHOUT_SAVED_DETAILS: "continue_without_saved_details";
|
|
809
814
|
readonly CONTACT_PROVIDED: "contact_provided";
|
|
810
815
|
readonly CHECKOUT_STATUS: "checkout_status";
|
|
811
816
|
readonly CHECKOUT_COMPLETE: "checkout_complete";
|
|
@@ -975,10 +980,22 @@ type ParentToIframeMessage = {
|
|
|
975
980
|
} | {
|
|
976
981
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
977
982
|
token: string;
|
|
983
|
+
} | {
|
|
984
|
+
/** Host could not claim the iframe-verified Link identity. The echoed
|
|
985
|
+
* bearer correlates this response to the still-current OTP handoff. */
|
|
986
|
+
type: typeof MESSAGE_TYPES.SESSION_ESTABLISHMENT_FAILED;
|
|
987
|
+
accessToken: string;
|
|
988
|
+
code: string;
|
|
989
|
+
message: string;
|
|
978
990
|
} | {
|
|
979
991
|
/** Host cart session; the iframe adopts it so destination quotes read the host's cart. */
|
|
980
992
|
type: typeof MESSAGE_TYPES.SET_SESSION;
|
|
981
993
|
sessionToken: string;
|
|
994
|
+
} | {
|
|
995
|
+
/** The host rotated back to anonymous authority. Every sibling iframe
|
|
996
|
+
* must discard its bearer and identity-derived projections. */
|
|
997
|
+
type: typeof MESSAGE_TYPES.SESSION_CLEARED;
|
|
998
|
+
sessionToken: string;
|
|
982
999
|
} | {
|
|
983
1000
|
type: typeof MESSAGE_TYPES.NAVIGATE;
|
|
984
1001
|
path: string;
|
|
@@ -1035,6 +1052,12 @@ type IframeToParentMessage = {
|
|
|
1035
1052
|
saveToLink: boolean;
|
|
1036
1053
|
} | {
|
|
1037
1054
|
type: typeof MESSAGE_TYPES.LOGOUT_COMPLETE;
|
|
1055
|
+
} | {
|
|
1056
|
+
/** Buyer declined or could not establish Link saved-detail authority.
|
|
1057
|
+
* The merchant host decides whether its current session must rotate. */
|
|
1058
|
+
type: typeof MESSAGE_TYPES.CONTINUE_WITHOUT_SAVED_DETAILS;
|
|
1059
|
+
contact: string;
|
|
1060
|
+
contactType: ElementsAuthContactType;
|
|
1038
1061
|
} | {
|
|
1039
1062
|
type: typeof MESSAGE_TYPES.SESSION_ESTABLISHED;
|
|
1040
1063
|
accessToken: string;
|
|
@@ -1171,6 +1194,7 @@ type NextAction = {
|
|
|
1171
1194
|
provider: string;
|
|
1172
1195
|
client_secret: string;
|
|
1173
1196
|
public_key: string;
|
|
1197
|
+
provider_account_id?: string;
|
|
1174
1198
|
} | {
|
|
1175
1199
|
type: "redirect";
|
|
1176
1200
|
authorization_url: string;
|
|
@@ -1546,6 +1570,10 @@ interface GetLinkOrderOptions {
|
|
|
1546
1570
|
interface IdempotencyOption$6 {
|
|
1547
1571
|
idempotencyKey?: string;
|
|
1548
1572
|
}
|
|
1573
|
+
interface LinkAuthOption extends IdempotencyOption$6 {
|
|
1574
|
+
/** Return verified credentials without installing them on the shared client. */
|
|
1575
|
+
activateSession?: boolean;
|
|
1576
|
+
}
|
|
1549
1577
|
interface SuccessResult {
|
|
1550
1578
|
success: boolean;
|
|
1551
1579
|
message?: string;
|
|
@@ -1576,10 +1604,15 @@ interface SuccessResult {
|
|
|
1576
1604
|
*/
|
|
1577
1605
|
declare class LinkService {
|
|
1578
1606
|
private client;
|
|
1607
|
+
private activationGeneration;
|
|
1579
1608
|
constructor(client: CimplifyClient);
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1609
|
+
private beginActivation;
|
|
1610
|
+
private isActivationFenceCurrent;
|
|
1611
|
+
private supersededActivation;
|
|
1612
|
+
private activateAuthenticatedSession;
|
|
1613
|
+
requestOtp(input: RequestOtpInput, opts?: IdempotencyOption$6): Promise<Result<RequestOtpResult$1, CimplifyError>>;
|
|
1614
|
+
verifyOtp(input: VerifyOtpInput, opts?: LinkAuthOption): Promise<Result<AuthResponse, CimplifyError>>;
|
|
1615
|
+
refreshSession(sessionToken?: string, opts?: LinkAuthOption): Promise<Result<AuthResponse, CimplifyError>>;
|
|
1583
1616
|
logout(): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1584
1617
|
checkStatus(contact: string): Promise<Result<LinkStatusResult, CimplifyError>>;
|
|
1585
1618
|
getLinkData(): Promise<Result<LinkData, CimplifyError>>;
|
|
@@ -2333,6 +2366,8 @@ interface DeliveryFeeResponse {
|
|
|
2333
2366
|
currency: string | null;
|
|
2334
2367
|
details: DeliveryFeeDetails | null;
|
|
2335
2368
|
}
|
|
2369
|
+
/** Whether delivery is priced on-platform or arranged directly with the seller. */
|
|
2370
|
+
type DeliveryFeeStatus = "priced" | "arranged";
|
|
2336
2371
|
/** One entry on the delivery menu — a merchant-named rate ("Standard",
|
|
2337
2372
|
* "Express", "Outside Accra") priced for the address when required, or the
|
|
2338
2373
|
* synthesized default when the business has no named rates (`rate_id: null`). */
|
|
@@ -2341,6 +2376,7 @@ interface DeliveryOption {
|
|
|
2341
2376
|
name: string;
|
|
2342
2377
|
description?: string;
|
|
2343
2378
|
fee: Money;
|
|
2379
|
+
fee_status: DeliveryFeeStatus;
|
|
2344
2380
|
currency: string;
|
|
2345
2381
|
free_delivery_applied: boolean;
|
|
2346
2382
|
/** Order value at/above this makes the option free — render "Free over X". */
|
|
@@ -2385,6 +2421,8 @@ type SenderType = "customer" | "agent" | "system" | "bot";
|
|
|
2385
2421
|
type ContentType = "text" | "image" | "video" | "audio" | "voice" | "document" | "sticker" | "location" | "contact" | "reaction" | "interactive" | "story_mention" | "share";
|
|
2386
2422
|
interface ChatMessage {
|
|
2387
2423
|
id: string;
|
|
2424
|
+
/** Monotonic server sequence; absent only on a local optimistic bubble. */
|
|
2425
|
+
sequence?: number;
|
|
2388
2426
|
sender_type: SenderType;
|
|
2389
2427
|
content: string;
|
|
2390
2428
|
content_type: ContentType;
|
|
@@ -2394,6 +2432,9 @@ interface ChatMessage {
|
|
|
2394
2432
|
reply_to?: ChatReplyContext | null;
|
|
2395
2433
|
/** Echo of the sender's idempotency key on widget customer messages. */
|
|
2396
2434
|
client_id?: string | null;
|
|
2435
|
+
/** Trusted provider mutation stamps; deleted messages are removed by the hook. */
|
|
2436
|
+
edited_at?: string | null;
|
|
2437
|
+
deleted_at?: string | null;
|
|
2397
2438
|
created_at: string;
|
|
2398
2439
|
}
|
|
2399
2440
|
/**
|
|
@@ -2420,17 +2461,26 @@ interface ChatAttachment {
|
|
|
2420
2461
|
interface ChatUploadAttachment extends ChatAttachment {
|
|
2421
2462
|
upload_id: string;
|
|
2422
2463
|
}
|
|
2464
|
+
interface ChatPersona {
|
|
2465
|
+
persona_type: "account" | "business";
|
|
2466
|
+
persona_id: string;
|
|
2467
|
+
}
|
|
2468
|
+
/** Direct Account↔Business thread projection from the Chat core. */
|
|
2423
2469
|
interface ChatConversation {
|
|
2424
2470
|
id: string;
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2471
|
+
account_id: string;
|
|
2472
|
+
business_id: string;
|
|
2473
|
+
kind: "direct";
|
|
2474
|
+
ai_mode: "auto" | "assist" | "off";
|
|
2475
|
+
ai_mode_version: number;
|
|
2429
2476
|
message_count: number;
|
|
2430
|
-
|
|
2477
|
+
last_message_id?: string | null;
|
|
2431
2478
|
last_message_at: string | null;
|
|
2432
|
-
|
|
2433
|
-
|
|
2479
|
+
created_at: string;
|
|
2480
|
+
updated_at: string;
|
|
2481
|
+
archived_at?: string | null;
|
|
2482
|
+
account: ChatPersona;
|
|
2483
|
+
business: ChatPersona;
|
|
2434
2484
|
}
|
|
2435
2485
|
/** Structured card references an AI reply may carry in `metadata.cards`. */
|
|
2436
2486
|
type ChatReplyCard = {
|
|
@@ -2452,9 +2502,30 @@ interface ChatConversationResponse {
|
|
|
2452
2502
|
interface ClaimConversationResult {
|
|
2453
2503
|
/** The rotated, customer-bound session token; the SDK adopts it automatically. */
|
|
2454
2504
|
session_token: string;
|
|
2455
|
-
/** The
|
|
2456
|
-
|
|
2505
|
+
/** The account's canonical direct Chat thread for this business. */
|
|
2506
|
+
thread: ChatConversation;
|
|
2457
2507
|
customer_name: string;
|
|
2508
|
+
/** Per-envelope, PII-minimal WhatsApp history claim outcomes. */
|
|
2509
|
+
external_claims: ExternalChatClaimAttempt[];
|
|
2510
|
+
/** Candidate discovery failed; retry `claimExternalChats()` later. */
|
|
2511
|
+
external_claims_unavailable: boolean;
|
|
2512
|
+
}
|
|
2513
|
+
type ExternalChatClaimDisposition = "claimed" | "replayed" | "conflict" | "contact_unverified" | "business_unavailable" | "history_empty" | "history_oversize" | "failed";
|
|
2514
|
+
interface ExternalChatClaimAttempt {
|
|
2515
|
+
status: ExternalChatClaimDisposition;
|
|
2516
|
+
thread_id: string | null;
|
|
2517
|
+
imported_message_count: number | null;
|
|
2518
|
+
replayed: boolean;
|
|
2519
|
+
observed_message_count: number | null;
|
|
2520
|
+
maximum_message_count: number | null;
|
|
2521
|
+
}
|
|
2522
|
+
interface ClaimExternalChatsResult {
|
|
2523
|
+
claims: ExternalChatClaimAttempt[];
|
|
2524
|
+
}
|
|
2525
|
+
interface ChatHandoffResponse {
|
|
2526
|
+
thread: ChatConversation;
|
|
2527
|
+
cancelled_turns: number;
|
|
2528
|
+
spending_turns: number;
|
|
2458
2529
|
}
|
|
2459
2530
|
interface ChatWidgetStarter {
|
|
2460
2531
|
icon?: string;
|
|
@@ -2477,13 +2548,22 @@ declare class SupportService {
|
|
|
2477
2548
|
* Claim the anonymous session for the verified Link identity: the server
|
|
2478
2549
|
* verifies the access token, rotates the session token (adopted here, so
|
|
2479
2550
|
* every subsequent request rides the bound session), folds the guest cart
|
|
2480
|
-
* in, and
|
|
2551
|
+
* in, and opens or reuses the account's canonical direct Chat thread.
|
|
2481
2552
|
*
|
|
2482
2553
|
* Idempotent and single-flight: concurrent calls share one request, and a
|
|
2483
2554
|
* token already claimed by this instance short-circuits without a network
|
|
2484
|
-
* round trip.
|
|
2555
|
+
* round trip. A session already bound to another Link account is rejected
|
|
2556
|
+
* rather than transferring that account's cart. Emits `session:claimed` on
|
|
2557
|
+
* the client's event channel.
|
|
2485
2558
|
*/
|
|
2486
2559
|
claimConversation(): Promise<Result<ClaimConversationResult, CimplifyError>>;
|
|
2560
|
+
/**
|
|
2561
|
+
* Retry verified external-history discovery for the current storefront.
|
|
2562
|
+
* Launch scope is intentionally WhatsApp-only because it is the registered
|
|
2563
|
+
* bidirectional transport. Results are per envelope and omit provider ids,
|
|
2564
|
+
* contact values, account ids, and message bodies.
|
|
2565
|
+
*/
|
|
2566
|
+
claimExternalChats(): Promise<Result<ClaimExternalChatsResult, CimplifyError>>;
|
|
2487
2567
|
/**
|
|
2488
2568
|
* Peek at the conversation without creating one: resolves the existing
|
|
2489
2569
|
* thread (or null) so a page load can hydrate history without littering
|
|
@@ -2509,16 +2589,14 @@ declare class SupportService {
|
|
|
2509
2589
|
* backward for scrollback into older history.
|
|
2510
2590
|
*/
|
|
2511
2591
|
getMessages(options?: {
|
|
2512
|
-
|
|
2513
|
-
|
|
2592
|
+
afterSequence?: number;
|
|
2593
|
+
beforeSequence?: number;
|
|
2514
2594
|
limit?: number;
|
|
2515
2595
|
}): Promise<Result<ChatMessage[], CimplifyError>>;
|
|
2516
2596
|
/** React to a message in the active conversation by its `ChatMessage.id`. */
|
|
2517
2597
|
reactToMessage(messageId: string, emoji: string): Promise<Result<ChatMessage, CimplifyError>>;
|
|
2518
2598
|
/** Ask for a person: flags the thread for the merchant's inbox. */
|
|
2519
|
-
requestHuman(opts?: IdempotencyOption): Promise<Result<
|
|
2520
|
-
requested: boolean;
|
|
2521
|
-
}, CimplifyError>>;
|
|
2599
|
+
requestHuman(opts?: IdempotencyOption): Promise<Result<ChatHandoffResponse, CimplifyError>>;
|
|
2522
2600
|
}
|
|
2523
2601
|
|
|
2524
2602
|
declare class CimplifyElements {
|
|
@@ -2535,6 +2613,8 @@ declare class CimplifyElements {
|
|
|
2535
2613
|
private paymentData;
|
|
2536
2614
|
private checkoutInProgress;
|
|
2537
2615
|
private authInProgress;
|
|
2616
|
+
private authEstablishmentInProgress;
|
|
2617
|
+
private authGeneration;
|
|
2538
2618
|
private activeCheckoutAbort;
|
|
2539
2619
|
private boundHandleMessage;
|
|
2540
2620
|
private businessIdResolvePromise;
|
|
@@ -2553,14 +2633,18 @@ declare class CimplifyElements {
|
|
|
2553
2633
|
getBusinessId(): string | null;
|
|
2554
2634
|
resolveBusinessId(): Promise<string | null>;
|
|
2555
2635
|
getAppearance(): ElementsOptions["appearance"];
|
|
2636
|
+
private isAuthGenerationCurrent;
|
|
2556
2637
|
private hydrateCustomerData;
|
|
2557
2638
|
private sourceElementFor;
|
|
2558
2639
|
private sessionStorageKey;
|
|
2559
2640
|
private persistRefreshToken;
|
|
2560
2641
|
private clearPersistedSession;
|
|
2642
|
+
private clearClaimedAuthorityAfterRestoreFailure;
|
|
2561
2643
|
private restoreSession;
|
|
2562
2644
|
private applyAccessToken;
|
|
2645
|
+
private waitForAuthEstablishment;
|
|
2563
2646
|
private broadcastAccessToken;
|
|
2647
|
+
private broadcastClearedSession;
|
|
2564
2648
|
private startEmbeddedAuth;
|
|
2565
2649
|
private handleMessage;
|
|
2566
2650
|
_setAddressData(data: AddressInfo): void;
|
|
@@ -2726,7 +2810,8 @@ declare class CimplifyClient {
|
|
|
2726
2810
|
* refresh restore) binds the anonymous session so the conversation, cart
|
|
2727
2811
|
* and orders survive a cleared browser. Best-effort by design — a failed
|
|
2728
2812
|
* claim leaves the session anonymous, exactly as it was. Called by the
|
|
2729
|
-
* auth flows, never by the raw token setter.
|
|
2813
|
+
* merchant auth flows, never by the raw token setter. Global Link clients
|
|
2814
|
+
* have no storefront tenant and therefore activate without this step.
|
|
2730
2815
|
*/
|
|
2731
2816
|
autoClaimChatIdentity(): void;
|
|
2732
2817
|
/**
|
|
@@ -2737,7 +2822,14 @@ declare class CimplifyClient {
|
|
|
2737
2822
|
adoptSessionToken(token: string): void;
|
|
2738
2823
|
clearSession(): void;
|
|
2739
2824
|
getSessionEpoch(): number;
|
|
2825
|
+
/** Monotonic fence for async work scoped to the current storefront tenant. */
|
|
2826
|
+
getPublicKeyEpoch(): number;
|
|
2740
2827
|
getSessionToken(): string | null;
|
|
2828
|
+
/** Whether the current transport session is known to have been claimed for
|
|
2829
|
+
* a Link identity, even when its in-memory bearer is absent after reload or
|
|
2830
|
+
* a failed refresh. The sync marker is written only after canonical claim
|
|
2831
|
+
* rotation and is replaced with `cleared` when a fresh session is minted. */
|
|
2832
|
+
hasClaimedSessionAuthority(): boolean;
|
|
2741
2833
|
publishSessionClaimed(customerName: string | null): void;
|
|
2742
2834
|
private broadcastSessionSync;
|
|
2743
2835
|
private watchCrossTabSession;
|
|
@@ -2800,4 +2892,4 @@ declare class CimplifyClient {
|
|
|
2800
2892
|
}
|
|
2801
2893
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2802
2894
|
|
|
2803
|
-
export { type CheckoutCollectionOption as $, type AbortablePromise as A, type Booking as B, type CacheOptions as C, type CancelBookingInput as D, type CancelBookingResult as E, type CancelOrderInput as F, type CancellationPolicy as G, type CardPopupAction as H, CartOperations as I, CatalogueQueries as J, type CatalogueResult as K, type CatalogueSnapshot as L, type CategoryInfo as M, type ChatAttachment as N, type ChatConversation as O, type ChatConversationResponse as P, type ChatMessage as Q, type ChatReplyCard as R, type ChatReplyContext as S, type ChatUploadAttachment as T, type ChatWidgetStarter as U, type CheckSlotAvailabilityInput as V, type CheckSlotAvailabilityResult as W, type CheckoutAddressInfo as X, type CheckoutCartData as Y, type CheckoutCartItem as Z, type CheckoutCollectionMethod as _, type ActivityRecommendation as a, type
|
|
2895
|
+
export { type CheckoutCollectionOption as $, type AbortablePromise as A, type Booking as B, type CacheOptions as C, type CancelBookingInput as D, type CancelBookingResult as E, type CancelOrderInput as F, type CancellationPolicy as G, type CardPopupAction as H, CartOperations as I, CatalogueQueries as J, type CatalogueResult as K, type CatalogueSnapshot as L, type CategoryInfo as M, type ChatAttachment as N, type ChatConversation as O, type ChatConversationResponse as P, type ChatMessage as Q, type ChatReplyCard as R, type ChatReplyContext as S, type ChatUploadAttachment as T, type ChatWidgetStarter as U, type CheckSlotAvailabilityInput as V, type CheckSlotAvailabilityResult as W, type CheckoutAddressInfo as X, type CheckoutCartData as Y, type CheckoutCartItem as Z, type CheckoutCollectionMethod as _, type ActivityRecommendation as a, type FxQuoteStatus as a$, type CheckoutCollectionOptions as a0, type CheckoutCustomerInfo as a1, type CheckoutFormData as a2, type CheckoutInput as a3, type CheckoutMode as a4, type CheckoutOrderType as a5, type CheckoutPaymentMethod as a6, type CheckoutResult as a7, CheckoutService as a8, type CheckoutStatus as a9, EVENT_TYPES as aA, type ElementAppearance as aB, type ElementEventHandler as aC, type ElementEventType as aD, type ElementOptions as aE, type ElementType as aF, type ElementsAuthContactType as aG, type ElementsAuthMode as aH, type ElementsAuthOptions as aI, type ElementsAuthPrompt as aJ, type ElementsCheckoutData as aK, type ElementsCheckoutResult as aL, type ElementsCustomerInfo as aM, type ElementsOptions as aN, type EnrichedOrder as aO, type EnrichedOrderItem as aP, type Err as aQ, type ExternalChatClaimAttempt as aR, type ExternalChatClaimDisposition as aS, type FeeBearerType as aT, type FetchQuoteInput as aU, type FulfillmentLink as aV, type FulfillmentStatus as aW, type FulfillmentSummaryDTO as aX, type FulfillmentType as aY, type FxQuote as aZ, type FxQuoteRequest as a_, type CheckoutStatusContext as aa, type CheckoutStep as ab, CimplifyClient as ac, type CimplifyConfig as ad, CimplifyElement as ae, CimplifyElements as af, type ClaimConversationResult as ag, type ClaimExternalChatsResult as ah, type ContentType as ai, type CustomerBooking as aj, type CustomerBookingServiceItem as ak, type CustomerServicePreferences as al, type DayAvailability as am, type DeliveryFeeDetails as an, type DeliveryFeeResponse as ao, type DeliveryFeeStatus as ap, type DeliveryOption as aq, type DeliveryOptionsQuery as ar, type DeliveryOptionsResponse as as, DeliveryService as at, type DepositResult as au, type DismissMessageResponse as av, ELEMENTS_AUTH_CONTACT_TYPES as aw, ELEMENTS_AUTH_MODES as ax, ELEMENTS_AUTH_PROMPTS as ay, ELEMENT_TYPES as az, type ActivityRecommendationsResponse as b, type PaymentState as b$, type FxRateResponse as b0, FxService as b1, type GetAvailableSlotsInput as b2, type GetDeliveryOptionsParams as b3, type GetOrdersOptions as b4, type GetProductsOptions as b5, type GroupOrderInfo as b6, type IframeToParentMessage as b7, InventoryService as b8, type LifecyclePhase as b9, type OrderGroupPaymentState as bA, type OrderGroupPaymentStatus as bB, type OrderGroupPaymentSummary as bC, type OrderGroupStatus as bD, type OrderHistory as bE, type OrderLineState as bF, type OrderLineStatus as bG, type OrderLocationInfo as bH, type OrderPaymentEvent as bI, type OrderPricingView as bJ, OrderQueries as bK, type OrderSplitDetail as bL, type OrderStaffInfo as bM, type OrderStatus as bN, type OrderTimestampsDTO as bO, type OrderType as bP, type Origin as bQ, type OriginActor as bR, type OriginChannel as bS, type OtpResult as bT, type ParentToIframeMessage as bU, type PaymentAuthorizationAdapter as bV, PaymentAuthorizationAdapterRegistry as bW, type PaymentAuthorizationContext as bX, type PaymentAuthorizationOutcome as bY, type PaymentInfoDTO as bZ, type PaymentMethodInfo as b_, type LineItem as ba, type LineType as bb, LinkService as bc, type LiteBootstrap as bd, type LiteDayHours as be, type LiteHoursRange as bf, LiteService as bg, type Location as bh, type LocationBooking as bi, type LocationTaxBehavior as bj, type LocationTaxOverrides as bk, type LocationTimeProfile as bl, type LocationWithDetails as bm, MESSAGE_TYPES as bn, type MobileMoneyDetails as bo, type NextAction as bp, type ObservabilityHooks as bq, type Ok as br, type Order as bs, type OrderCustomerInfo as bt, type OrderDiscountInfo as bu, type OrderFilter as bv, type OrderFulfillmentSummary as bw, type OrderGroup as bx, type OrderGroupDetails as by, type OrderGroupPayment as bz, ActivityService as c, StoreCreditQueries as c$, type PickupTime as c0, type PickupTimeType as c1, type PlaceDetailsResponse as c2, PlacesService as c3, type PriceQuote as c4, type PricingOverrides as c5, type ProcessAndResolveOptions as c6, type ProcessCheckoutOptions as c7, type ProcessCheckoutResult as c8, type ProviderResolutionSource as c9, type ResourceInfo as cA, type Result as cB, type RetryEvent as cC, type Room as cD, type SchedulingMetadata as cE, type SchedulingResult as cF, SchedulingService as cG, type SenderType as cH, type Service as cI, type ServiceAvailabilityParams as cJ, type ServiceAvailabilityResult as cK, type ServiceCharge as cL, type ServiceNotes as cM, type ServiceScheduleRequest as cN, type ServiceStatus as cO, type SessionActivityData as cP, type SessionChangeEvent as cQ, type SessionMessage as cR, type SlotResourceInfo as cS, type SlotStaffInfo as cT, type Staff as cU, type StaffAssignment as cV, type StaffRole as cW, type StaffScheduleItem as cX, type StockLevel as cY, type StockStatus as cZ, type StoreCreditBalance as c_, type QuoteBundleSelectionInput as ca, type QuoteCompositeSelectionInput as cb, type QuoteDynamicBuckets as cc, type QuoteStatus as cd, type QuoteUiMessage as ce, type ReadRequestOptions as cf, type RefreshQuoteInput as cg, type RefreshQuoteResult as ch, type RefundOrderInput as ci, type RelatedCandidate as cj, type RelatedProduct as ck, type RelatedProductsEnrichment as cl, type RelationType as cm, type ReminderMethod as cn, type ReminderSettings as co, type ReorderResult as cp, type RequestContext as cq, type RequestErrorEvent as cr, type RequestOptions as cs, type RequestSource as ct, type RequestStartEvent as cu, type RequestSuccessEvent as cv, type RescheduleBookingInput as cw, type RescheduleBookingResult as cx, type RescheduleHistoryRecord as cy, type ResourceAssignment as cz, type ActivityStateResponse as d, type StorefrontBootstrap as d0, SubscriptionService as d1, SupportService as d2, type Table as d3, type TimeRange as d4, type TimeRanges as d5, type TimeSlot as d6, type TrackCategoryViewOptions as d7, type TrackProductViewOptions as d8, type UpdateOrderStatusInput as d9, type UpdateProfileInput as da, type UploadInitResponse as db, type UploadResult as dc, UploadService as dd, combine as de, combineObject as df, createCimplifyClient as dg, createDefaultPaymentAuthorizationAdapterRegistry as dh, createElements as di, err as dj, flatMap as dk, fromPromise as dl, getOrElse as dm, isErr as dn, isOk as dp, mapError as dq, mapResult as dr, ok as ds, toNullable as dt, tryCatch as du, unwrap as dv, type AddressInfo as e, type AmountToPay as f, AuthService as g, type AuthStatus as h, type AuthenticatedCustomer as i, type AuthenticatedData as j, type AuthorizeCardPopupOptions as k, type AutocompletePrediction as l, type AutocompleteResponse as m, type AvailabilityResult as n, type AvailableSlot as o, type BookingModificationType as p, type BookingStatus as q, type BookingWithDetails as r, type BufferTimes as s, type Business as t, type BusinessDetailsDTO as u, type BusinessHours as v, type BusinessPreferences as w, BusinessService as x, type BusinessSettings as y, type BusinessWithLocations as z };
|