@cimplify/sdk 0.102.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 +23 -22
- package/dist/advanced.mjs +4 -3
- package/dist/{chunk-DCMXUKDQ.mjs → chunk-2WPVUIHX.mjs} +455 -105
- package/dist/{chunk-NIOUSKQQ.js → chunk-4BKOKHE3.js} +9 -0
- package/dist/{chunk-YDA46OZ6.js → chunk-5BDYDZ4U.js} +722 -90
- package/dist/{chunk-4KNFBPV2.mjs → chunk-5RT4HYMP.mjs} +61 -15
- package/dist/{chunk-WMEC5JWN.js → chunk-7PDEX54K.js} +50 -13
- package/dist/chunk-CNN7Z2IP.js +125 -0
- package/dist/{chunk-DLW3RWRK.mjs → chunk-DYIAX3WI.mjs} +46 -12
- package/dist/{chunk-LOWSMGRT.js → chunk-E4K2VQDD.js} +64 -16
- package/dist/chunk-GOHSXBKW.mjs +105 -0
- package/dist/{chunk-O3YUHLZL.mjs → chunk-H3RATH4B.mjs} +9 -0
- package/dist/{chunk-YER7DIOM.js → chunk-IQFFSKE2.js} +753 -594
- package/dist/{chunk-Z3K2D3TE.mjs → chunk-OCCNG6MO.mjs} +735 -558
- package/dist/{chunk-DKLHCZ5M.mjs → chunk-OKADBZAI.mjs} +652 -25
- package/dist/{chunk-EAZGA7LD.js → chunk-YVAEY3VC.js} +457 -107
- package/dist/{client-nsiMwuC1.d.ts → client-BVNWjk6W.d.ts} +2 -2
- package/dist/{client-B40KFazg.d.ts → client-BuLcOWLv.d.ts} +202 -319
- package/dist/{client-BizGfqB7.d.mts → client-D5AoobFc.d.mts} +202 -319
- package/dist/{client-BdErclfU.d.mts → client-fM716k7G.d.mts} +2 -2
- package/dist/{index-DpmnI__D.d.mts → index-BtcoqrY1.d.ts} +14 -4
- package/dist/{index-nEyXWIyR.d.ts → index-D7Tf3v7c.d.mts} +14 -4
- package/dist/index.d.mts +83 -8
- package/dist/index.d.ts +83 -8
- package/dist/index.js +203 -169
- package/dist/index.mjs +7 -5
- package/dist/link-D9iSVxt5.d.mts +308 -0
- package/dist/link-D9iSVxt5.d.ts +308 -0
- package/dist/mock/cli.mjs +463 -104
- package/dist/mock/library.js +463 -104
- package/dist/mock/library.mjs +463 -104
- package/dist/mock/msw.js +463 -104
- package/dist/mock/msw.mjs +463 -104
- package/dist/{product-Byf0unSy.d.mts → payment-g0HFkEDU.d.mts} +708 -61
- package/dist/{product-Byf0unSy.d.ts → payment-g0HFkEDU.d.ts} +708 -61
- package/dist/{price-BstChV9a.d.ts → price-BLIeAb8K.d.ts} +1 -1
- package/dist/{price-CS4E5zLS.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 +194 -169
- package/dist/react.mjs +55 -30
- package/dist/{server-DqbZh8Bk.d.mts → server-BkVhOIwn.d.mts} +14 -10
- package/dist/{server-Cj40R2ZD.d.ts → server-DKK_D-PP.d.ts} +14 -10
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +12 -10
- package/dist/server.mjs +6 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +4 -3
- package/dist/testing/msw.mjs +3 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +26 -25
- package/dist/testing/suite.mjs +7 -6
- package/dist/testing.d.mts +195 -56
- package/dist/testing.d.ts +195 -56
- package/dist/testing.js +95 -82
- package/dist/testing.mjs +14 -9
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +37 -29
- package/dist/utils.mjs +2 -2
- package/package.json +7 -1
- package/registry/chat-widget.json +1 -1
- package/dist/payment-l0rkieEQ.d.mts +0 -113
- package/dist/payment-vzNnIi1n.d.ts +0 -113
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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;
|
|
@@ -777,300 +779,6 @@ interface RelatedProductsEnrichment {
|
|
|
777
779
|
cross_sells: RelatedCandidate[];
|
|
778
780
|
}
|
|
779
781
|
|
|
780
|
-
declare const CHECKOUT_MODE: {
|
|
781
|
-
readonly LINK: "link";
|
|
782
|
-
readonly GUEST: "guest";
|
|
783
|
-
};
|
|
784
|
-
declare const ORDER_TYPE: {
|
|
785
|
-
readonly DELIVERY: "delivery";
|
|
786
|
-
readonly PICKUP: "pickup";
|
|
787
|
-
readonly DINE_IN: "dine-in";
|
|
788
|
-
readonly WALK_IN: "walk-in";
|
|
789
|
-
};
|
|
790
|
-
declare const PAYMENT_METHOD: {
|
|
791
|
-
readonly MOBILE_MONEY: "mobile_money";
|
|
792
|
-
readonly CARD: "card";
|
|
793
|
-
};
|
|
794
|
-
declare const CHECKOUT_STEP: {
|
|
795
|
-
readonly AUTHENTICATION: "authentication";
|
|
796
|
-
readonly ORDER_DETAILS: "order_details";
|
|
797
|
-
readonly PAYMENT_METHOD: "payment_method";
|
|
798
|
-
readonly PAYMENT: "payment";
|
|
799
|
-
readonly CONFIRMATION: "confirmation";
|
|
800
|
-
};
|
|
801
|
-
declare const PAYMENT_STATE: {
|
|
802
|
-
readonly INITIAL: "initial";
|
|
803
|
-
readonly PREPARING: "preparing";
|
|
804
|
-
readonly PROCESSING: "processing";
|
|
805
|
-
readonly VERIFYING: "verifying";
|
|
806
|
-
readonly AWAITING_AUTHORIZATION: "awaiting_authorization";
|
|
807
|
-
readonly SUCCESS: "success";
|
|
808
|
-
readonly ERROR: "error";
|
|
809
|
-
readonly TIMEOUT: "timeout";
|
|
810
|
-
};
|
|
811
|
-
declare const PICKUP_TIME_TYPE: {
|
|
812
|
-
readonly ASAP: "asap";
|
|
813
|
-
readonly SCHEDULED: "scheduled";
|
|
814
|
-
};
|
|
815
|
-
declare const MOBILE_MONEY_PROVIDER: {
|
|
816
|
-
readonly MTN: "mtn";
|
|
817
|
-
readonly VODAFONE: "vodafone";
|
|
818
|
-
readonly TELECEL: "telecel";
|
|
819
|
-
readonly AIRTEL: "airtel";
|
|
820
|
-
readonly AIRTELTIGO: "airteltigo";
|
|
821
|
-
readonly MPESA: "mpesa";
|
|
822
|
-
};
|
|
823
|
-
declare const AUTHORIZATION_TYPE: {
|
|
824
|
-
readonly OTP: "otp";
|
|
825
|
-
readonly PIN: "pin";
|
|
826
|
-
readonly PHONE: "phone";
|
|
827
|
-
readonly BIRTHDAY: "birthday";
|
|
828
|
-
readonly ADDRESS: "address";
|
|
829
|
-
};
|
|
830
|
-
declare const DEVICE_TYPE: {
|
|
831
|
-
readonly MOBILE: "mobile";
|
|
832
|
-
readonly DESKTOP: "desktop";
|
|
833
|
-
readonly TABLET: "tablet";
|
|
834
|
-
readonly UNKNOWN: "unknown";
|
|
835
|
-
};
|
|
836
|
-
declare const CONTACT_TYPE: {
|
|
837
|
-
readonly PHONE: "phone";
|
|
838
|
-
readonly EMAIL: "email";
|
|
839
|
-
};
|
|
840
|
-
declare const LINK_QUERY: {
|
|
841
|
-
readonly DATA: "link.data";
|
|
842
|
-
readonly ADDRESSES: "link.addresses";
|
|
843
|
-
readonly MOBILE_MONEY: "link.mobile_money";
|
|
844
|
-
readonly PREFERENCES: "link.preferences";
|
|
845
|
-
readonly SESSIONS: "link.sessions";
|
|
846
|
-
};
|
|
847
|
-
declare const LINK_MUTATION: {
|
|
848
|
-
readonly CHECK_STATUS: "link.check_status";
|
|
849
|
-
readonly ENROLL: "link.enroll";
|
|
850
|
-
readonly ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order";
|
|
851
|
-
readonly UPDATE_PREFERENCES: "link.update_preferences";
|
|
852
|
-
readonly CREATE_ADDRESS: "link.create_address";
|
|
853
|
-
readonly UPDATE_ADDRESS: "link.update_address";
|
|
854
|
-
readonly DELETE_ADDRESS: "link.delete_address";
|
|
855
|
-
readonly SET_DEFAULT_ADDRESS: "link.set_default_address";
|
|
856
|
-
readonly TRACK_ADDRESS_USAGE: "link.track_address_usage";
|
|
857
|
-
readonly CREATE_MOBILE_MONEY: "link.create_mobile_money";
|
|
858
|
-
readonly DELETE_MOBILE_MONEY: "link.delete_mobile_money";
|
|
859
|
-
readonly SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money";
|
|
860
|
-
readonly TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage";
|
|
861
|
-
readonly VERIFY_MOBILE_MONEY: "link.verify_mobile_money";
|
|
862
|
-
readonly REVOKE_SESSION: "link.revoke_session";
|
|
863
|
-
readonly REVOKE_ALL_SESSIONS: "link.revoke_all_sessions";
|
|
864
|
-
};
|
|
865
|
-
declare const AUTH_MUTATION: {
|
|
866
|
-
readonly REQUEST_OTP: "auth.request_otp";
|
|
867
|
-
readonly VERIFY_OTP: "auth.verify_otp";
|
|
868
|
-
};
|
|
869
|
-
declare const CHECKOUT_MUTATION: {
|
|
870
|
-
readonly PROCESS: "checkout.process";
|
|
871
|
-
};
|
|
872
|
-
declare const PAYMENT_MUTATION: {
|
|
873
|
-
readonly SUBMIT_AUTHORIZATION: "payment.submit_authorization";
|
|
874
|
-
readonly CHECK_STATUS: "order.poll_payment_status";
|
|
875
|
-
};
|
|
876
|
-
declare const ORDER_MUTATION: {
|
|
877
|
-
readonly UPDATE_CUSTOMER: "order.update_order_customer";
|
|
878
|
-
};
|
|
879
|
-
declare const DEFAULT_CURRENCY = "GHS";
|
|
880
|
-
declare const DEFAULT_COUNTRY = "GHA";
|
|
881
|
-
|
|
882
|
-
type MobileMoneyProvider = (typeof MOBILE_MONEY_PROVIDER)[keyof typeof MOBILE_MONEY_PROVIDER];
|
|
883
|
-
interface Customer {
|
|
884
|
-
id: string;
|
|
885
|
-
email: string | null;
|
|
886
|
-
phone: string | null;
|
|
887
|
-
name: string;
|
|
888
|
-
delivery_address: string | null;
|
|
889
|
-
created_at: string;
|
|
890
|
-
updated_at: string;
|
|
891
|
-
metadata?: Record<string, unknown> | null;
|
|
892
|
-
account_id?: string | null;
|
|
893
|
-
}
|
|
894
|
-
interface CustomerAddress {
|
|
895
|
-
id: string;
|
|
896
|
-
customer_id: string;
|
|
897
|
-
label: string;
|
|
898
|
-
street_address: string;
|
|
899
|
-
apartment: string | null;
|
|
900
|
-
city: string;
|
|
901
|
-
region: string;
|
|
902
|
-
postal_code: string | null;
|
|
903
|
-
country: string | null;
|
|
904
|
-
delivery_instructions: string | null;
|
|
905
|
-
phone_for_delivery: string | null;
|
|
906
|
-
latitude: number | null;
|
|
907
|
-
longitude: number | null;
|
|
908
|
-
is_default: boolean | null;
|
|
909
|
-
usage_count: number | null;
|
|
910
|
-
last_used_at: string | null;
|
|
911
|
-
created_at: string;
|
|
912
|
-
updated_at: string;
|
|
913
|
-
}
|
|
914
|
-
interface CustomerMobileMoney {
|
|
915
|
-
id: string;
|
|
916
|
-
customer_id: string;
|
|
917
|
-
phone_number: string;
|
|
918
|
-
provider: string;
|
|
919
|
-
label: string;
|
|
920
|
-
is_verified: boolean | null;
|
|
921
|
-
verification_date: string | null;
|
|
922
|
-
is_default: boolean | null;
|
|
923
|
-
usage_count: number | null;
|
|
924
|
-
last_used_at: string | null;
|
|
925
|
-
success_rate: number | null;
|
|
926
|
-
created_at: string;
|
|
927
|
-
updated_at: string;
|
|
928
|
-
}
|
|
929
|
-
interface CustomerLinkPreferences {
|
|
930
|
-
customer_id: string;
|
|
931
|
-
is_link_enabled: boolean | null;
|
|
932
|
-
enrolled_at: string | null;
|
|
933
|
-
enrollment_business_id: string | null;
|
|
934
|
-
preferred_order_type: string | null;
|
|
935
|
-
default_address_id: string | null;
|
|
936
|
-
default_mobile_money_id: string | null;
|
|
937
|
-
remember_me: boolean | null;
|
|
938
|
-
session_duration_days: number | null;
|
|
939
|
-
two_factor_enabled: boolean | null;
|
|
940
|
-
notify_on_order: boolean | null;
|
|
941
|
-
notify_on_payment: boolean | null;
|
|
942
|
-
created_at: string;
|
|
943
|
-
updated_at: string;
|
|
944
|
-
}
|
|
945
|
-
interface LinkData {
|
|
946
|
-
customer: Customer;
|
|
947
|
-
addresses: CustomerAddress[];
|
|
948
|
-
mobile_money: CustomerMobileMoney[];
|
|
949
|
-
preferences: CustomerLinkPreferences;
|
|
950
|
-
default_address: CustomerAddress | null;
|
|
951
|
-
default_mobile_money: CustomerMobileMoney | null;
|
|
952
|
-
}
|
|
953
|
-
interface CreateAddressInput {
|
|
954
|
-
label?: string;
|
|
955
|
-
street_address: string;
|
|
956
|
-
apartment?: string;
|
|
957
|
-
city: string;
|
|
958
|
-
region?: string;
|
|
959
|
-
postal_code?: string;
|
|
960
|
-
country?: string;
|
|
961
|
-
delivery_instructions?: string;
|
|
962
|
-
phone_for_delivery?: string;
|
|
963
|
-
latitude?: number;
|
|
964
|
-
longitude?: number;
|
|
965
|
-
}
|
|
966
|
-
interface UpdateAddressInput {
|
|
967
|
-
address_id: string;
|
|
968
|
-
label?: string;
|
|
969
|
-
street_address?: string;
|
|
970
|
-
apartment?: string;
|
|
971
|
-
city?: string;
|
|
972
|
-
region?: string;
|
|
973
|
-
postal_code?: string;
|
|
974
|
-
country?: string;
|
|
975
|
-
delivery_instructions?: string;
|
|
976
|
-
phone_for_delivery?: string;
|
|
977
|
-
latitude?: number;
|
|
978
|
-
longitude?: number;
|
|
979
|
-
clear_coordinates?: boolean;
|
|
980
|
-
}
|
|
981
|
-
interface CreateMobileMoneyInput {
|
|
982
|
-
phone_number: string;
|
|
983
|
-
provider: MobileMoneyProvider;
|
|
984
|
-
label?: string;
|
|
985
|
-
}
|
|
986
|
-
interface EnrollmentData {
|
|
987
|
-
contact: string;
|
|
988
|
-
name?: string;
|
|
989
|
-
}
|
|
990
|
-
interface AddressData {
|
|
991
|
-
label: string;
|
|
992
|
-
street_address: string;
|
|
993
|
-
apartment?: string;
|
|
994
|
-
city: string;
|
|
995
|
-
region: string;
|
|
996
|
-
postal_code?: string;
|
|
997
|
-
country?: string;
|
|
998
|
-
delivery_instructions?: string;
|
|
999
|
-
phone_for_delivery?: string;
|
|
1000
|
-
latitude?: number;
|
|
1001
|
-
longitude?: number;
|
|
1002
|
-
}
|
|
1003
|
-
interface MobileMoneyData {
|
|
1004
|
-
phone_number: string;
|
|
1005
|
-
provider: string;
|
|
1006
|
-
label: string;
|
|
1007
|
-
}
|
|
1008
|
-
interface EnrollAndLinkOrderInput {
|
|
1009
|
-
order_id: string;
|
|
1010
|
-
business_id: string;
|
|
1011
|
-
address?: AddressData;
|
|
1012
|
-
mobile_money?: MobileMoneyData;
|
|
1013
|
-
order_type?: string;
|
|
1014
|
-
}
|
|
1015
|
-
interface LinkStatusResult {
|
|
1016
|
-
is_link_customer: boolean;
|
|
1017
|
-
}
|
|
1018
|
-
interface LinkEnrollResult {
|
|
1019
|
-
success: boolean;
|
|
1020
|
-
customer_id: string;
|
|
1021
|
-
contact?: string;
|
|
1022
|
-
enrolled_at?: string;
|
|
1023
|
-
preferences?: CustomerLinkPreferences;
|
|
1024
|
-
}
|
|
1025
|
-
interface EnrollAndLinkOrderResult {
|
|
1026
|
-
success: boolean;
|
|
1027
|
-
customer_id: string;
|
|
1028
|
-
order_id: string;
|
|
1029
|
-
enrollment_result: unknown;
|
|
1030
|
-
linked_at: string;
|
|
1031
|
-
}
|
|
1032
|
-
type DeviceType = (typeof DEVICE_TYPE)[keyof typeof DEVICE_TYPE];
|
|
1033
|
-
interface LinkSession {
|
|
1034
|
-
id: string;
|
|
1035
|
-
device_name: string | null;
|
|
1036
|
-
device_type: DeviceType | null;
|
|
1037
|
-
ip_address: string | null;
|
|
1038
|
-
last_used_at: string | null;
|
|
1039
|
-
created_at: string;
|
|
1040
|
-
is_current: boolean;
|
|
1041
|
-
}
|
|
1042
|
-
interface RevokeSessionResult {
|
|
1043
|
-
success: boolean;
|
|
1044
|
-
session_id: string;
|
|
1045
|
-
message: string;
|
|
1046
|
-
}
|
|
1047
|
-
interface RevokeAllSessionsResult {
|
|
1048
|
-
success: boolean;
|
|
1049
|
-
revoked_count: number;
|
|
1050
|
-
message: string;
|
|
1051
|
-
}
|
|
1052
|
-
type ContactType = (typeof CONTACT_TYPE)[keyof typeof CONTACT_TYPE];
|
|
1053
|
-
interface RequestOtpInput {
|
|
1054
|
-
contact: string;
|
|
1055
|
-
contact_type: ContactType;
|
|
1056
|
-
}
|
|
1057
|
-
interface VerifyOtpInput {
|
|
1058
|
-
contact: string;
|
|
1059
|
-
contact_type: ContactType;
|
|
1060
|
-
otp_code: string;
|
|
1061
|
-
}
|
|
1062
|
-
interface AuthResponse {
|
|
1063
|
-
success: boolean;
|
|
1064
|
-
session_token: string | null;
|
|
1065
|
-
refresh_token?: string | null;
|
|
1066
|
-
account_id?: string | null;
|
|
1067
|
-
customer_id: string | null;
|
|
1068
|
-
name?: string | null;
|
|
1069
|
-
email?: string | null;
|
|
1070
|
-
phone?: string | null;
|
|
1071
|
-
message: string;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
782
|
type OrderType = "delivery" | "pickup" | "dine-in" | "walk-in";
|
|
1075
783
|
declare const ELEMENT_TYPES: {
|
|
1076
784
|
readonly AUTH: "auth";
|
|
@@ -1084,6 +792,7 @@ declare const MESSAGE_TYPES: {
|
|
|
1084
792
|
readonly INIT: "init";
|
|
1085
793
|
readonly SET_TOKEN: "set_token";
|
|
1086
794
|
readonly SET_SESSION: "set_session";
|
|
795
|
+
readonly SESSION_CLEARED: "session_cleared";
|
|
1087
796
|
readonly SET_CART: "set_cart";
|
|
1088
797
|
readonly GET_DATA: "get_data";
|
|
1089
798
|
readonly NAVIGATE: "navigate";
|
|
@@ -1100,6 +809,8 @@ declare const MESSAGE_TYPES: {
|
|
|
1100
809
|
readonly LOGOUT_COMPLETE: "logout_complete";
|
|
1101
810
|
readonly AUTH_REQUESTED: "auth_requested";
|
|
1102
811
|
readonly SESSION_ESTABLISHED: "session_established";
|
|
812
|
+
readonly SESSION_ESTABLISHMENT_FAILED: "session_establishment_failed";
|
|
813
|
+
readonly CONTINUE_WITHOUT_SAVED_DETAILS: "continue_without_saved_details";
|
|
1103
814
|
readonly CONTACT_PROVIDED: "contact_provided";
|
|
1104
815
|
readonly CHECKOUT_STATUS: "checkout_status";
|
|
1105
816
|
readonly CHECKOUT_COMPLETE: "checkout_complete";
|
|
@@ -1269,10 +980,22 @@ type ParentToIframeMessage = {
|
|
|
1269
980
|
} | {
|
|
1270
981
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
1271
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;
|
|
1272
990
|
} | {
|
|
1273
991
|
/** Host cart session; the iframe adopts it so destination quotes read the host's cart. */
|
|
1274
992
|
type: typeof MESSAGE_TYPES.SET_SESSION;
|
|
1275
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;
|
|
1276
999
|
} | {
|
|
1277
1000
|
type: typeof MESSAGE_TYPES.NAVIGATE;
|
|
1278
1001
|
path: string;
|
|
@@ -1329,6 +1052,12 @@ type IframeToParentMessage = {
|
|
|
1329
1052
|
saveToLink: boolean;
|
|
1330
1053
|
} | {
|
|
1331
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;
|
|
1332
1061
|
} | {
|
|
1333
1062
|
type: typeof MESSAGE_TYPES.SESSION_ESTABLISHED;
|
|
1334
1063
|
accessToken: string;
|
|
@@ -1383,6 +1112,19 @@ type CheckoutOrderType = (typeof ORDER_TYPE)[keyof typeof ORDER_TYPE];
|
|
|
1383
1112
|
type CheckoutPaymentMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
|
|
1384
1113
|
type CheckoutStep = (typeof CHECKOUT_STEP)[keyof typeof CHECKOUT_STEP];
|
|
1385
1114
|
type PickupTimeType = (typeof PICKUP_TIME_TYPE)[keyof typeof PICKUP_TIME_TYPE];
|
|
1115
|
+
type CheckoutCollectionMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
|
|
1116
|
+
/** Storefront-safe collection capability. Provider and route identities stay server-side. */
|
|
1117
|
+
type CheckoutCollectionOption = {
|
|
1118
|
+
method: typeof PAYMENT_METHOD.CARD;
|
|
1119
|
+
network: null;
|
|
1120
|
+
} | {
|
|
1121
|
+
method: typeof PAYMENT_METHOD.MOBILE_MONEY;
|
|
1122
|
+
network: string;
|
|
1123
|
+
};
|
|
1124
|
+
interface CheckoutCollectionOptions {
|
|
1125
|
+
presentment_currency: CurrencyCode;
|
|
1126
|
+
options: CheckoutCollectionOption[];
|
|
1127
|
+
}
|
|
1386
1128
|
interface PickupTime {
|
|
1387
1129
|
type: PickupTimeType;
|
|
1388
1130
|
scheduled_time?: string;
|
|
@@ -1452,6 +1194,7 @@ type NextAction = {
|
|
|
1452
1194
|
provider: string;
|
|
1453
1195
|
client_secret: string;
|
|
1454
1196
|
public_key: string;
|
|
1197
|
+
provider_account_id?: string;
|
|
1455
1198
|
} | {
|
|
1456
1199
|
type: "redirect";
|
|
1457
1200
|
authorization_url: string;
|
|
@@ -1466,6 +1209,8 @@ interface CheckoutResult {
|
|
|
1466
1209
|
order_id: string;
|
|
1467
1210
|
order_number: string;
|
|
1468
1211
|
bill_token?: string;
|
|
1212
|
+
/** Tenant-scoped Cimplify payment id used for payment mutations. */
|
|
1213
|
+
payment_id?: string;
|
|
1469
1214
|
payment_reference?: string;
|
|
1470
1215
|
payment_status: string;
|
|
1471
1216
|
requires_authorization: boolean;
|
|
@@ -1488,7 +1233,7 @@ interface CheckoutResult {
|
|
|
1488
1233
|
type CheckoutStatus = "preparing" | "recovering" | "processing" | "awaiting_authorization" | "polling" | "finalizing" | "success" | "failed";
|
|
1489
1234
|
interface CheckoutStatusContext {
|
|
1490
1235
|
display_text?: string;
|
|
1491
|
-
authorization_type?:
|
|
1236
|
+
authorization_type?: PaymentAuthorizationKind;
|
|
1492
1237
|
poll_attempt?: number;
|
|
1493
1238
|
max_poll_attempts?: number;
|
|
1494
1239
|
order_id?: string;
|
|
@@ -1531,7 +1276,12 @@ interface ProcessAndResolveOptions {
|
|
|
1531
1276
|
poll_interval_ms?: number;
|
|
1532
1277
|
max_poll_attempts?: number;
|
|
1533
1278
|
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
1534
|
-
|
|
1279
|
+
/**
|
|
1280
|
+
* Reports the lifetime of provider-owned authorization UI. Hosts with their
|
|
1281
|
+
* own modal focus boundary can suspend it while the provider surface is open.
|
|
1282
|
+
*/
|
|
1283
|
+
on_authorization_ui_change?: (open: boolean) => void;
|
|
1284
|
+
on_authorization_required?: (type: PaymentAuthorizationKind, submit: (authorization: PaymentAuthorizationSubmission) => Promise<void>) => void | Promise<void>;
|
|
1535
1285
|
return_url?: string;
|
|
1536
1286
|
signal?: AbortSignal;
|
|
1537
1287
|
}
|
|
@@ -1539,11 +1289,68 @@ type AbortablePromise<T> = Promise<T> & {
|
|
|
1539
1289
|
abort: () => void;
|
|
1540
1290
|
};
|
|
1541
1291
|
|
|
1292
|
+
type CardPopupAction = Extract<NextAction, {
|
|
1293
|
+
type: "card_popup";
|
|
1294
|
+
}>;
|
|
1295
|
+
interface PaymentAuthorizationContext {
|
|
1296
|
+
action: CardPopupAction;
|
|
1297
|
+
email: string;
|
|
1298
|
+
currency: CurrencyCode;
|
|
1299
|
+
reference?: string;
|
|
1300
|
+
returnUrl?: string;
|
|
1301
|
+
signal?: AbortSignal;
|
|
1302
|
+
}
|
|
1303
|
+
type AuthorizeCardPopupOptions = Omit<PaymentAuthorizationContext, "action">;
|
|
1304
|
+
/**
|
|
1305
|
+
* Provider UI completed or handed control to a provider. This is deliberately
|
|
1306
|
+
* not named "success": only the Cimplify payment-status endpoint can establish
|
|
1307
|
+
* that money was collected.
|
|
1308
|
+
*/
|
|
1309
|
+
type PaymentAuthorizationOutcome = {
|
|
1310
|
+
status: "submitted";
|
|
1311
|
+
reference?: string;
|
|
1312
|
+
} | {
|
|
1313
|
+
status: "cancelled";
|
|
1314
|
+
} | {
|
|
1315
|
+
status: "failed";
|
|
1316
|
+
code: "POPUP_BLOCKED" | "PROVIDER_UNAVAILABLE" | "AUTHORIZATION_FAILED" | "PAYMENT_FAILED";
|
|
1317
|
+
message: string;
|
|
1318
|
+
recoverable: boolean;
|
|
1319
|
+
};
|
|
1320
|
+
/** Provider-specific browser UI for one `card_popup` action. */
|
|
1321
|
+
interface PaymentAuthorizationAdapter {
|
|
1322
|
+
readonly provider: string;
|
|
1323
|
+
authorize(context: PaymentAuthorizationContext): Promise<PaymentAuthorizationOutcome>;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Per-client adapter registry. It contains no process-global state, so tests,
|
|
1328
|
+
* storefronts, and concurrently-rendered tenants cannot affect each other.
|
|
1329
|
+
*/
|
|
1330
|
+
declare class PaymentAuthorizationAdapterRegistry {
|
|
1331
|
+
private readonly adapters;
|
|
1332
|
+
constructor(adapters?: Iterable<PaymentAuthorizationAdapter>);
|
|
1333
|
+
register(adapter: PaymentAuthorizationAdapter): this;
|
|
1334
|
+
unregister(provider: string): boolean;
|
|
1335
|
+
get(provider: string): PaymentAuthorizationAdapter | undefined;
|
|
1336
|
+
supports(provider: string): boolean;
|
|
1337
|
+
providers(): string[];
|
|
1338
|
+
authorize(action: CardPopupAction, options: AuthorizeCardPopupOptions): Promise<PaymentAuthorizationOutcome>;
|
|
1339
|
+
}
|
|
1340
|
+
declare function createDefaultPaymentAuthorizationAdapterRegistry(): PaymentAuthorizationAdapterRegistry;
|
|
1341
|
+
|
|
1542
1342
|
declare class CheckoutService {
|
|
1543
1343
|
private client;
|
|
1544
1344
|
constructor(client: CimplifyClient);
|
|
1545
1345
|
private validateCheckoutData;
|
|
1546
1346
|
private orderTokenParam;
|
|
1347
|
+
/** Available storefront collection methods for one presentment currency. */
|
|
1348
|
+
collectionOptions(currency: CurrencyCode): Promise<Result<CheckoutCollectionOptions, CimplifyError>>;
|
|
1349
|
+
/**
|
|
1350
|
+
* Run provider-owned UI for a backend `card_popup` action. A submitted
|
|
1351
|
+
* outcome is not proof of payment; callers must poll/verify with Cimplify.
|
|
1352
|
+
*/
|
|
1353
|
+
authorizeCardPopup(action: CardPopupAction, options: AuthorizeCardPopupOptions): Promise<PaymentAuthorizationOutcome>;
|
|
1547
1354
|
process(data: CheckoutFormData): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
1548
1355
|
initializePayment(_orderId: string, _method: PaymentMethod): Promise<Result<InitializePaymentResult, CimplifyError>>;
|
|
1549
1356
|
submitAuthorization(input: SubmitAuthorizationInput): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
@@ -1763,6 +1570,10 @@ interface GetLinkOrderOptions {
|
|
|
1763
1570
|
interface IdempotencyOption$6 {
|
|
1764
1571
|
idempotencyKey?: string;
|
|
1765
1572
|
}
|
|
1573
|
+
interface LinkAuthOption extends IdempotencyOption$6 {
|
|
1574
|
+
/** Return verified credentials without installing them on the shared client. */
|
|
1575
|
+
activateSession?: boolean;
|
|
1576
|
+
}
|
|
1766
1577
|
interface SuccessResult {
|
|
1767
1578
|
success: boolean;
|
|
1768
1579
|
message?: string;
|
|
@@ -1793,10 +1604,15 @@ interface SuccessResult {
|
|
|
1793
1604
|
*/
|
|
1794
1605
|
declare class LinkService {
|
|
1795
1606
|
private client;
|
|
1607
|
+
private activationGeneration;
|
|
1796
1608
|
constructor(client: CimplifyClient);
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
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>>;
|
|
1800
1616
|
logout(): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1801
1617
|
checkStatus(contact: string): Promise<Result<LinkStatusResult, CimplifyError>>;
|
|
1802
1618
|
getLinkData(): Promise<Result<LinkData, CimplifyError>>;
|
|
@@ -2550,6 +2366,8 @@ interface DeliveryFeeResponse {
|
|
|
2550
2366
|
currency: string | null;
|
|
2551
2367
|
details: DeliveryFeeDetails | null;
|
|
2552
2368
|
}
|
|
2369
|
+
/** Whether delivery is priced on-platform or arranged directly with the seller. */
|
|
2370
|
+
type DeliveryFeeStatus = "priced" | "arranged";
|
|
2553
2371
|
/** One entry on the delivery menu — a merchant-named rate ("Standard",
|
|
2554
2372
|
* "Express", "Outside Accra") priced for the address when required, or the
|
|
2555
2373
|
* synthesized default when the business has no named rates (`rate_id: null`). */
|
|
@@ -2558,6 +2376,7 @@ interface DeliveryOption {
|
|
|
2558
2376
|
name: string;
|
|
2559
2377
|
description?: string;
|
|
2560
2378
|
fee: Money;
|
|
2379
|
+
fee_status: DeliveryFeeStatus;
|
|
2561
2380
|
currency: string;
|
|
2562
2381
|
free_delivery_applied: boolean;
|
|
2563
2382
|
/** Order value at/above this makes the option free — render "Free over X". */
|
|
@@ -2602,6 +2421,8 @@ type SenderType = "customer" | "agent" | "system" | "bot";
|
|
|
2602
2421
|
type ContentType = "text" | "image" | "video" | "audio" | "voice" | "document" | "sticker" | "location" | "contact" | "reaction" | "interactive" | "story_mention" | "share";
|
|
2603
2422
|
interface ChatMessage {
|
|
2604
2423
|
id: string;
|
|
2424
|
+
/** Monotonic server sequence; absent only on a local optimistic bubble. */
|
|
2425
|
+
sequence?: number;
|
|
2605
2426
|
sender_type: SenderType;
|
|
2606
2427
|
content: string;
|
|
2607
2428
|
content_type: ContentType;
|
|
@@ -2611,6 +2432,9 @@ interface ChatMessage {
|
|
|
2611
2432
|
reply_to?: ChatReplyContext | null;
|
|
2612
2433
|
/** Echo of the sender's idempotency key on widget customer messages. */
|
|
2613
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;
|
|
2614
2438
|
created_at: string;
|
|
2615
2439
|
}
|
|
2616
2440
|
/**
|
|
@@ -2637,17 +2461,26 @@ interface ChatAttachment {
|
|
|
2637
2461
|
interface ChatUploadAttachment extends ChatAttachment {
|
|
2638
2462
|
upload_id: string;
|
|
2639
2463
|
}
|
|
2464
|
+
interface ChatPersona {
|
|
2465
|
+
persona_type: "account" | "business";
|
|
2466
|
+
persona_id: string;
|
|
2467
|
+
}
|
|
2468
|
+
/** Direct Account↔Business thread projection from the Chat core. */
|
|
2640
2469
|
interface ChatConversation {
|
|
2641
2470
|
id: string;
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2471
|
+
account_id: string;
|
|
2472
|
+
business_id: string;
|
|
2473
|
+
kind: "direct";
|
|
2474
|
+
ai_mode: "auto" | "assist" | "off";
|
|
2475
|
+
ai_mode_version: number;
|
|
2646
2476
|
message_count: number;
|
|
2647
|
-
|
|
2477
|
+
last_message_id?: string | null;
|
|
2648
2478
|
last_message_at: string | null;
|
|
2649
|
-
|
|
2650
|
-
|
|
2479
|
+
created_at: string;
|
|
2480
|
+
updated_at: string;
|
|
2481
|
+
archived_at?: string | null;
|
|
2482
|
+
account: ChatPersona;
|
|
2483
|
+
business: ChatPersona;
|
|
2651
2484
|
}
|
|
2652
2485
|
/** Structured card references an AI reply may carry in `metadata.cards`. */
|
|
2653
2486
|
type ChatReplyCard = {
|
|
@@ -2669,9 +2502,30 @@ interface ChatConversationResponse {
|
|
|
2669
2502
|
interface ClaimConversationResult {
|
|
2670
2503
|
/** The rotated, customer-bound session token; the SDK adopts it automatically. */
|
|
2671
2504
|
session_token: string;
|
|
2672
|
-
/** The
|
|
2673
|
-
|
|
2505
|
+
/** The account's canonical direct Chat thread for this business. */
|
|
2506
|
+
thread: ChatConversation;
|
|
2674
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;
|
|
2675
2529
|
}
|
|
2676
2530
|
interface ChatWidgetStarter {
|
|
2677
2531
|
icon?: string;
|
|
@@ -2694,13 +2548,22 @@ declare class SupportService {
|
|
|
2694
2548
|
* Claim the anonymous session for the verified Link identity: the server
|
|
2695
2549
|
* verifies the access token, rotates the session token (adopted here, so
|
|
2696
2550
|
* every subsequent request rides the bound session), folds the guest cart
|
|
2697
|
-
* in, and
|
|
2551
|
+
* in, and opens or reuses the account's canonical direct Chat thread.
|
|
2698
2552
|
*
|
|
2699
2553
|
* Idempotent and single-flight: concurrent calls share one request, and a
|
|
2700
2554
|
* token already claimed by this instance short-circuits without a network
|
|
2701
|
-
* 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.
|
|
2702
2558
|
*/
|
|
2703
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>>;
|
|
2704
2567
|
/**
|
|
2705
2568
|
* Peek at the conversation without creating one: resolves the existing
|
|
2706
2569
|
* thread (or null) so a page load can hydrate history without littering
|
|
@@ -2726,16 +2589,14 @@ declare class SupportService {
|
|
|
2726
2589
|
* backward for scrollback into older history.
|
|
2727
2590
|
*/
|
|
2728
2591
|
getMessages(options?: {
|
|
2729
|
-
|
|
2730
|
-
|
|
2592
|
+
afterSequence?: number;
|
|
2593
|
+
beforeSequence?: number;
|
|
2731
2594
|
limit?: number;
|
|
2732
2595
|
}): Promise<Result<ChatMessage[], CimplifyError>>;
|
|
2733
2596
|
/** React to a message in the active conversation by its `ChatMessage.id`. */
|
|
2734
2597
|
reactToMessage(messageId: string, emoji: string): Promise<Result<ChatMessage, CimplifyError>>;
|
|
2735
2598
|
/** Ask for a person: flags the thread for the merchant's inbox. */
|
|
2736
|
-
requestHuman(opts?: IdempotencyOption): Promise<Result<
|
|
2737
|
-
requested: boolean;
|
|
2738
|
-
}, CimplifyError>>;
|
|
2599
|
+
requestHuman(opts?: IdempotencyOption): Promise<Result<ChatHandoffResponse, CimplifyError>>;
|
|
2739
2600
|
}
|
|
2740
2601
|
|
|
2741
2602
|
declare class CimplifyElements {
|
|
@@ -2752,6 +2613,8 @@ declare class CimplifyElements {
|
|
|
2752
2613
|
private paymentData;
|
|
2753
2614
|
private checkoutInProgress;
|
|
2754
2615
|
private authInProgress;
|
|
2616
|
+
private authEstablishmentInProgress;
|
|
2617
|
+
private authGeneration;
|
|
2755
2618
|
private activeCheckoutAbort;
|
|
2756
2619
|
private boundHandleMessage;
|
|
2757
2620
|
private businessIdResolvePromise;
|
|
@@ -2770,14 +2633,18 @@ declare class CimplifyElements {
|
|
|
2770
2633
|
getBusinessId(): string | null;
|
|
2771
2634
|
resolveBusinessId(): Promise<string | null>;
|
|
2772
2635
|
getAppearance(): ElementsOptions["appearance"];
|
|
2636
|
+
private isAuthGenerationCurrent;
|
|
2773
2637
|
private hydrateCustomerData;
|
|
2774
2638
|
private sourceElementFor;
|
|
2775
2639
|
private sessionStorageKey;
|
|
2776
2640
|
private persistRefreshToken;
|
|
2777
2641
|
private clearPersistedSession;
|
|
2642
|
+
private clearClaimedAuthorityAfterRestoreFailure;
|
|
2778
2643
|
private restoreSession;
|
|
2779
2644
|
private applyAccessToken;
|
|
2645
|
+
private waitForAuthEstablishment;
|
|
2780
2646
|
private broadcastAccessToken;
|
|
2647
|
+
private broadcastClearedSession;
|
|
2781
2648
|
private startEmbeddedAuth;
|
|
2782
2649
|
private handleMessage;
|
|
2783
2650
|
_setAddressData(data: AddressInfo): void;
|
|
@@ -2876,6 +2743,12 @@ interface CimplifyConfig {
|
|
|
2876
2743
|
fetch?: typeof fetch;
|
|
2877
2744
|
/** Auto-record page views in the browser. Default true; false to gate on consent. */
|
|
2878
2745
|
trackPageViews?: boolean;
|
|
2746
|
+
/**
|
|
2747
|
+
* Per-client card-authorization adapters. Omit for the built-in lazy
|
|
2748
|
+
* Paystack and Stripe adapters; inject a registry to override or extend
|
|
2749
|
+
* provider UI without mutating process-global state.
|
|
2750
|
+
*/
|
|
2751
|
+
authorizationAdapterRegistry?: PaymentAuthorizationAdapterRegistry;
|
|
2879
2752
|
}
|
|
2880
2753
|
declare class CimplifyClient {
|
|
2881
2754
|
private baseUrl;
|
|
@@ -2893,6 +2766,8 @@ declare class CimplifyClient {
|
|
|
2893
2766
|
private context;
|
|
2894
2767
|
private businessId;
|
|
2895
2768
|
private businessIdResolvePromise;
|
|
2769
|
+
private publicKeyEpoch;
|
|
2770
|
+
readonly authorizationAdapters: PaymentAuthorizationAdapterRegistry;
|
|
2896
2771
|
private inflightRequests;
|
|
2897
2772
|
/**
|
|
2898
2773
|
* App-level event channel. Subscribe to surface mutation rollbacks, outbox
|
|
@@ -2935,7 +2810,8 @@ declare class CimplifyClient {
|
|
|
2935
2810
|
* refresh restore) binds the anonymous session so the conversation, cart
|
|
2936
2811
|
* and orders survive a cleared browser. Best-effort by design — a failed
|
|
2937
2812
|
* claim leaves the session anonymous, exactly as it was. Called by the
|
|
2938
|
-
* 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.
|
|
2939
2815
|
*/
|
|
2940
2816
|
autoClaimChatIdentity(): void;
|
|
2941
2817
|
/**
|
|
@@ -2946,7 +2822,14 @@ declare class CimplifyClient {
|
|
|
2946
2822
|
adoptSessionToken(token: string): void;
|
|
2947
2823
|
clearSession(): void;
|
|
2948
2824
|
getSessionEpoch(): number;
|
|
2825
|
+
/** Monotonic fence for async work scoped to the current storefront tenant. */
|
|
2826
|
+
getPublicKeyEpoch(): number;
|
|
2949
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;
|
|
2950
2833
|
publishSessionClaimed(customerName: string | null): void;
|
|
2951
2834
|
private broadcastSessionSync;
|
|
2952
2835
|
private watchCrossTabSession;
|
|
@@ -3009,4 +2892,4 @@ declare class CimplifyClient {
|
|
|
3009
2892
|
}
|
|
3010
2893
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
3011
2894
|
|
|
3012
|
-
export { 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 };
|