@1interface/chat-core 0.15.5 → 0.16.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/index.d.ts CHANGED
@@ -358,6 +358,8 @@ export declare function buildBrandSkin(styles: ChatThemeStyles, resolvedTheme: "
358
358
 
359
359
  export declare function buildCallbackUrl(givenId?: string | null): string;
360
360
 
361
+ export declare function buildHostedPaymentPageThemeMessage(skin: PaymentSkin): HostedPaymentPageThemeMessage;
362
+
361
363
  export declare const CHAT_INPUT_MODES: {
362
364
  readonly NORMAL: "normal";
363
365
  readonly RECORDING: "recording";
@@ -863,10 +865,51 @@ export declare function guestLoginApi(): Promise<AuthApiResult>;
863
865
 
864
866
  export declare const hasAnyExtraData: (msg: any) => boolean;
865
867
 
868
+ export declare const HOSTED_PAYMENT_PAGE_CALLBACK_ACTIONS: {
869
+ readonly LOADED: "loaded";
870
+ readonly DONE: "done";
871
+ };
872
+
873
+ export declare const HOSTED_PAYMENT_PAGE_CALLBACK_MESSAGE_TYPE = "hosted-payment-page-callback";
874
+
875
+ export declare const HOSTED_PAYMENT_PAGE_CALLBACK_PATH = "/payment-callback.html";
876
+
877
+ export declare const HOSTED_PAYMENT_PAGE_STATUSES: {
878
+ readonly SUCCESS: "success";
879
+ readonly FAILED: "failed";
880
+ };
881
+
882
+ export declare const HOSTED_PAYMENT_PAGE_THEME_MESSAGE_TYPE = "hosted-payment-page-theme";
883
+
884
+ export declare type HostedPaymentPageCallbackAction = (typeof HOSTED_PAYMENT_PAGE_CALLBACK_ACTIONS)[keyof typeof HOSTED_PAYMENT_PAGE_CALLBACK_ACTIONS];
885
+
886
+ export declare interface HostedPaymentPageCallbackMessage {
887
+ type: typeof HOSTED_PAYMENT_PAGE_CALLBACK_MESSAGE_TYPE;
888
+ action: HostedPaymentPageCallbackAction;
889
+ search: string;
890
+ }
891
+
892
+ export declare interface HostedPaymentPageCallbackResult {
893
+ paymentId: string;
894
+ paymentStatus: HostedPaymentPageStatus;
895
+ }
896
+
897
+ export declare type HostedPaymentPageStatus = (typeof HOSTED_PAYMENT_PAGE_STATUSES)[keyof typeof HOSTED_PAYMENT_PAGE_STATUSES];
898
+
899
+ export declare interface HostedPaymentPageThemeMessage {
900
+ type: typeof HOSTED_PAYMENT_PAGE_THEME_MESSAGE_TYPE;
901
+ colorScheme: PaymentSkin["colorScheme"];
902
+ vars: Record<`--hpp-${string}`, string>;
903
+ }
904
+
866
905
  export declare function isApiServerError(err: unknown): boolean;
867
906
 
868
907
  export declare const isEmptyMessage: (v: any) => boolean;
869
908
 
909
+ export declare function isHostedPaymentPageCallbackMessage(value: unknown): value is HostedPaymentPageCallbackMessage;
910
+
911
+ export declare function isHostedPaymentPageUrl(value: unknown): value is string;
912
+
870
913
  export declare function loginApi(email: string, password: string): Promise<AuthApiResult>;
871
914
 
872
915
  export declare function logoutApi(payload: LogoutRequest, options?: {
@@ -932,6 +975,8 @@ export declare const PAGINATION: {
932
975
  readonly MESSAGE_PAGE_SIZE: 25;
933
976
  };
934
977
 
978
+ export declare function parseHostedPaymentPageCallback(search: string): HostedPaymentPageCallbackResult | null;
979
+
935
980
  export declare function parseMoyasarCallbackFromUrl(search: string): MoyasarCallbackResult | null;
936
981
 
937
982
  export declare interface PaymentAdapter {
@@ -963,12 +1008,14 @@ export declare type PaymentResult = {
963
1008
  paymentId: string;
964
1009
  amount?: number;
965
1010
  currency?: string;
1011
+ dismissed?: boolean;
966
1012
  } | {
967
1013
  status: "failure";
968
1014
  provider: PaymentProviderType;
969
1015
  code?: string;
970
1016
  message: string;
971
1017
  paymentId?: string;
1018
+ dismissed?: boolean;
972
1019
  } | {
973
1020
  status: "cancel";
974
1021
  provider: PaymentProviderType;
@@ -984,6 +1031,12 @@ export declare interface PaymentSkin {
984
1031
  accent: string;
985
1032
  accentText: string;
986
1033
  focus: string;
1034
+ success: string;
1035
+ successBg: string;
1036
+ warning: string;
1037
+ warningBg: string;
1038
+ danger: string;
1039
+ dangerBg: string;
987
1040
  pillBg: string;
988
1041
  pillBorder: string;
989
1042
  pillText: string;