@wacht/jsx 0.0.1-alpha.25 → 0.0.1-alpha.28

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
@@ -1,6 +1,7 @@
1
1
  import { ApiResult } from '@wacht/types';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
3
  import { Client } from '@wacht/types';
4
+ import { CreateEnterpriseConnectionPayload } from '@wacht/types';
4
5
  import { CSSProperties } from 'react';
5
6
  import { CurrentUser } from '@wacht/types';
6
7
  import { default as default_2 } from 'react';
@@ -8,6 +9,7 @@ import { Deployment } from '@wacht/types';
8
9
  import { DeploymentContextType as DeploymentContextType_2 } from '..';
9
10
  import { DeploymentUISettings } from '@wacht/types';
10
11
  import { DetailedHTMLProps } from 'react';
12
+ import { EnterpriseConnection } from '@wacht/types';
11
13
  import { ErrorInterface } from '@wacht/types';
12
14
  import { FastOmit } from 'styled-components';
13
15
  import { FC } from 'react';
@@ -35,6 +37,7 @@ import { ReactNode } from 'react';
35
37
  import { RefAttributes } from 'react';
36
38
  import { RoleCreate } from '@wacht/types';
37
39
  import { SecondFactorPolicy } from '@wacht/types';
40
+ import { Segment } from '@wacht/types';
38
41
  import { Session } from '@wacht/types';
39
42
  import { SignIn as SignIn_2 } from '@wacht/types';
40
43
  import { SigninAttempt } from '@wacht/types';
@@ -42,6 +45,7 @@ import { SignupAttempt } from '@wacht/types';
42
45
  import { SignUpParams } from '@wacht/types';
43
46
  import { SocialConnection } from '@wacht/types';
44
47
  import { Substitute } from 'styled-components/dist/types';
48
+ import { UpdateEnterpriseConnectionPayload } from '@wacht/types';
45
49
  import { UserAuthenticator } from '@wacht/types';
46
50
  import { UserEmailAddress } from '@wacht/types';
47
51
  import { UserPhoneNumber } from '@wacht/types';
@@ -364,6 +368,13 @@ declare type GenericSignInParams = {
364
368
 
365
369
  export declare function hasIncompleteProfile(session: Session): boolean;
366
370
 
371
+ export declare interface IdentifyResult {
372
+ strategy: "sso" | "social" | "password";
373
+ connection_id?: string;
374
+ idp_url?: string;
375
+ provider?: string;
376
+ }
377
+
367
378
  declare interface ImageData_2 {
368
379
  mime_type: string;
369
380
  data?: string;
@@ -687,6 +698,11 @@ declare type SignIn = {
687
698
  prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
688
699
  completeVerification: (verificationCode: string) => Promise<Session>;
689
700
  completeProfile: (data: ProfileCompletionData) => Promise<Session>;
701
+ identify: (identifier: string) => Promise<IdentifyResult>;
702
+ initEnterpriseSso: (connectionId: string, redirectUri?: string) => Promise<{
703
+ sso_url: string;
704
+ session: Session;
705
+ }>;
690
706
  };
691
707
 
692
708
  declare type SignInEmailOTP = ({ email, }: EmailOTPSignInParams) => Promise<ApiResult<Session>>;
@@ -821,24 +837,30 @@ export declare const useActiveOrganization: () => {
821
837
  discardInvitation: never;
822
838
  resendInvitation: never;
823
839
  leave: never;
840
+ getEnterpriseConnections: never;
841
+ createEnterpriseConnection: never;
842
+ updateEnterpriseConnection: never;
843
+ deleteEnterpriseConnection: never;
824
844
  refetch?: undefined;
825
845
  } | {
826
846
  activeOrganization: Organization | null;
827
847
  loading: boolean;
828
848
  refetch: () => Promise<void>;
829
849
  getRoles: () => Promise<OrganizationRole[]>;
830
- updateOrganization: (update: OrganizationUpdate) => Promise<{
831
- data: never;
832
- errors: ErrorInterface[];
833
- } | never[] | {
850
+ updateOrganization: (update: OrganizationUpdate) => Promise<never[] | {
834
851
  data: Organization;
835
- errors: never;
836
852
  }>;
837
853
  getMembers: () => Promise<OrganizationMembership[]>;
838
854
  getDomains: () => Promise<OrganizationDomain[]>;
839
- addDomain: (domain: NewDomain) => Promise<ApiResult<OrganizationDomain> | undefined>;
840
- verifyDomain: (domain: OrganizationDomain) => Promise<ApiResult<OrganizationDomain> | undefined>;
841
- removeDomain: (domain: OrganizationDomain) => Promise<ApiResult<OrganizationDomain> | undefined>;
855
+ addDomain: (domain: NewDomain) => Promise<{
856
+ data: OrganizationDomain;
857
+ } | undefined>;
858
+ verifyDomain: (domain: OrganizationDomain) => Promise<{
859
+ data: OrganizationDomain;
860
+ } | undefined>;
861
+ removeDomain: (domain: OrganizationDomain) => Promise<{
862
+ data: OrganizationDomain;
863
+ } | undefined>;
842
864
  getInvitations: () => Promise<OrganizationInvitation[]>;
843
865
  removeMember: (member: OrganizationMembership) => Promise<void | never[]>;
844
866
  leave: () => Promise<void>;
@@ -848,6 +870,10 @@ export declare const useActiveOrganization: () => {
848
870
  inviteMember: (invitationPayload: OrganizationInvitationPayload) => Promise<OrganizationInvitation | undefined>;
849
871
  discardInvitation: (invitation: OrganizationInvitation) => Promise<OrganizationInvitation | undefined>;
850
872
  resendInvitation: (invitation: OrganizationInvitation) => Promise<OrganizationInvitation | undefined>;
873
+ getEnterpriseConnections: () => Promise<EnterpriseConnection[]>;
874
+ createEnterpriseConnection: (payload: CreateEnterpriseConnectionPayload) => Promise<EnterpriseConnection | undefined>;
875
+ updateEnterpriseConnection: (connectionId: string, payload: UpdateEnterpriseConnectionPayload) => Promise<EnterpriseConnection | undefined>;
876
+ deleteEnterpriseConnection: (connectionId: string) => Promise<void>;
851
877
  error: null;
852
878
  };
853
879
 
@@ -950,7 +976,6 @@ declare type UseConversationSessionsReturnType = {
950
976
  export declare function useDeployment(): DeploymentContextType_2;
951
977
 
952
978
  export declare function useForgotPassword(): {
953
- error: Error | null;
954
979
  loading: boolean;
955
980
  forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
956
981
  verifyOtp: (email: string, otp: string) => Promise<ApiResult<{
@@ -974,7 +999,6 @@ export declare function useMagicLinkVerification(): UseMagicLinkVerificationRetu
974
999
  export declare interface UseMagicLinkVerificationReturnType {
975
1000
  loading: boolean;
976
1001
  verifyMagicLink: (params: MagicLinkParams) => Promise<ApiResult<{}, ErrorInterface>>;
977
- error: Error | null;
978
1002
  success: boolean | null;
979
1003
  }
980
1004
 
@@ -1058,6 +1082,10 @@ export declare const useOrganizationList: () => {
1058
1082
  addRole: (organization: Organization, newRole: RoleCreate) => Promise<ApiResult<OrganizationRole>>;
1059
1083
  removeOrganizationRoles: (organization: Organization, role: OrganizationRole) => Promise<void>;
1060
1084
  deleteOrganization: (organization: Organization) => Promise<void>;
1085
+ getEnterpriseConnections: (organization: Organization) => Promise<EnterpriseConnection[]>;
1086
+ createEnterpriseConnection: (organization: Organization, payload: CreateEnterpriseConnectionPayload) => Promise<EnterpriseConnection>;
1087
+ updateEnterpriseConnection: (organization: Organization, connectionId: string, payload: UpdateEnterpriseConnectionPayload) => Promise<EnterpriseConnection>;
1088
+ deleteEnterpriseConnection: (organization: Organization, connectionId: string) => Promise<void>;
1061
1089
  };
1062
1090
 
1063
1091
  export declare const useOrganizationMemberships: () => {
@@ -1126,14 +1154,12 @@ declare type UseSignInReturnType = {
1126
1154
  signinAttempt: SigninAttempt | null;
1127
1155
  discardSignInAttempt: () => void;
1128
1156
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1129
- error: ApiResult<unknown, ErrorInterface> | null;
1130
1157
  } | {
1131
1158
  loading: true;
1132
1159
  signIn: never;
1133
1160
  signinAttempt: null;
1134
1161
  discardSignInAttempt: () => void;
1135
1162
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1136
- error: null;
1137
1163
  };
1138
1164
 
1139
1165
  export declare function useSignInWithStrategy<T extends SignInStrategy>(strategy: T): UseSignInWithStrategyReturnType<T>;
@@ -1144,7 +1170,6 @@ export declare type UseSignInWithStrategyReturnType<T extends SignInStrategy> =
1144
1170
  signinAttempt: null;
1145
1171
  discardSignInAttempt: () => void;
1146
1172
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1147
- error: null;
1148
1173
  } | {
1149
1174
  loading: false;
1150
1175
  signIn: {
@@ -1152,11 +1177,15 @@ export declare type UseSignInWithStrategyReturnType<T extends SignInStrategy> =
1152
1177
  completeVerification: (verificationCode: string) => Promise<Session>;
1153
1178
  prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
1154
1179
  completeProfile: (data: ProfileCompletionData) => Promise<Session>;
1180
+ identify: (identifier: string) => Promise<IdentifyResult>;
1181
+ initEnterpriseSso: (connectionId: string, redirectUri?: string) => Promise<{
1182
+ sso_url: string;
1183
+ session: Session;
1184
+ }>;
1155
1185
  };
1156
1186
  signinAttempt: SigninAttempt | null;
1157
1187
  discardSignInAttempt: () => void;
1158
1188
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1159
- error: ApiResult<unknown, ErrorInterface> | null;
1160
1189
  };
1161
1190
 
1162
1191
  export declare function useSignUp(): UseSignUpReturnType;
@@ -1166,13 +1195,11 @@ export declare type UseSignUpReturnType = {
1166
1195
  signUp: never;
1167
1196
  signupAttempt: null;
1168
1197
  discardSignupAttempt: () => void;
1169
- errors: null;
1170
1198
  } | {
1171
1199
  loading: false;
1172
1200
  signUp: SignUpFunction;
1173
1201
  signupAttempt: SignupAttempt | null;
1174
1202
  discardSignupAttempt: () => void;
1175
- errors: ApiResult<unknown, ErrorInterface> | null;
1176
1203
  };
1177
1204
 
1178
1205
  /**
@@ -1207,6 +1234,7 @@ export declare function useUser(): {
1207
1234
  backup_codes?: string[];
1208
1235
  has_password?: boolean | undefined;
1209
1236
  public_metadata?: Record<string, unknown> | undefined;
1237
+ segments?: Segment[] | undefined;
1210
1238
  };
1211
1239
  loading: boolean;
1212
1240
  error: any;
@@ -1251,7 +1279,6 @@ export declare function useUserSignins(): {
1251
1279
 
1252
1280
  export declare function useWaitlist(): {
1253
1281
  loading: boolean;
1254
- error: ApiResult<unknown, ErrorInterface> | null;
1255
1282
  joinWaitlist: (params: WaitlistParams) => Promise<ApiResult<WaitlistResponse, ErrorInterface>>;
1256
1283
  };
1257
1284