@wacht/jsx 0.0.1-alpha.26 → 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';
@@ -43,6 +45,7 @@ import { SignupAttempt } from '@wacht/types';
43
45
  import { SignUpParams } from '@wacht/types';
44
46
  import { SocialConnection } from '@wacht/types';
45
47
  import { Substitute } from 'styled-components/dist/types';
48
+ import { UpdateEnterpriseConnectionPayload } from '@wacht/types';
46
49
  import { UserAuthenticator } from '@wacht/types';
47
50
  import { UserEmailAddress } from '@wacht/types';
48
51
  import { UserPhoneNumber } from '@wacht/types';
@@ -365,6 +368,13 @@ declare type GenericSignInParams = {
365
368
 
366
369
  export declare function hasIncompleteProfile(session: Session): boolean;
367
370
 
371
+ export declare interface IdentifyResult {
372
+ strategy: "sso" | "social" | "password";
373
+ connection_id?: string;
374
+ idp_url?: string;
375
+ provider?: string;
376
+ }
377
+
368
378
  declare interface ImageData_2 {
369
379
  mime_type: string;
370
380
  data?: string;
@@ -688,6 +698,11 @@ declare type SignIn = {
688
698
  prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
689
699
  completeVerification: (verificationCode: string) => Promise<Session>;
690
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
+ }>;
691
706
  };
692
707
 
693
708
  declare type SignInEmailOTP = ({ email, }: EmailOTPSignInParams) => Promise<ApiResult<Session>>;
@@ -822,24 +837,30 @@ export declare const useActiveOrganization: () => {
822
837
  discardInvitation: never;
823
838
  resendInvitation: never;
824
839
  leave: never;
840
+ getEnterpriseConnections: never;
841
+ createEnterpriseConnection: never;
842
+ updateEnterpriseConnection: never;
843
+ deleteEnterpriseConnection: never;
825
844
  refetch?: undefined;
826
845
  } | {
827
846
  activeOrganization: Organization | null;
828
847
  loading: boolean;
829
848
  refetch: () => Promise<void>;
830
849
  getRoles: () => Promise<OrganizationRole[]>;
831
- updateOrganization: (update: OrganizationUpdate) => Promise<{
832
- data: never;
833
- errors: ErrorInterface[];
834
- } | never[] | {
850
+ updateOrganization: (update: OrganizationUpdate) => Promise<never[] | {
835
851
  data: Organization;
836
- errors: never;
837
852
  }>;
838
853
  getMembers: () => Promise<OrganizationMembership[]>;
839
854
  getDomains: () => Promise<OrganizationDomain[]>;
840
- addDomain: (domain: NewDomain) => Promise<ApiResult<OrganizationDomain> | undefined>;
841
- verifyDomain: (domain: OrganizationDomain) => Promise<ApiResult<OrganizationDomain> | undefined>;
842
- 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>;
843
864
  getInvitations: () => Promise<OrganizationInvitation[]>;
844
865
  removeMember: (member: OrganizationMembership) => Promise<void | never[]>;
845
866
  leave: () => Promise<void>;
@@ -849,6 +870,10 @@ export declare const useActiveOrganization: () => {
849
870
  inviteMember: (invitationPayload: OrganizationInvitationPayload) => Promise<OrganizationInvitation | undefined>;
850
871
  discardInvitation: (invitation: OrganizationInvitation) => Promise<OrganizationInvitation | undefined>;
851
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>;
852
877
  error: null;
853
878
  };
854
879
 
@@ -951,7 +976,6 @@ declare type UseConversationSessionsReturnType = {
951
976
  export declare function useDeployment(): DeploymentContextType_2;
952
977
 
953
978
  export declare function useForgotPassword(): {
954
- error: Error | null;
955
979
  loading: boolean;
956
980
  forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
957
981
  verifyOtp: (email: string, otp: string) => Promise<ApiResult<{
@@ -975,7 +999,6 @@ export declare function useMagicLinkVerification(): UseMagicLinkVerificationRetu
975
999
  export declare interface UseMagicLinkVerificationReturnType {
976
1000
  loading: boolean;
977
1001
  verifyMagicLink: (params: MagicLinkParams) => Promise<ApiResult<{}, ErrorInterface>>;
978
- error: Error | null;
979
1002
  success: boolean | null;
980
1003
  }
981
1004
 
@@ -1059,6 +1082,10 @@ export declare const useOrganizationList: () => {
1059
1082
  addRole: (organization: Organization, newRole: RoleCreate) => Promise<ApiResult<OrganizationRole>>;
1060
1083
  removeOrganizationRoles: (organization: Organization, role: OrganizationRole) => Promise<void>;
1061
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>;
1062
1089
  };
1063
1090
 
1064
1091
  export declare const useOrganizationMemberships: () => {
@@ -1127,14 +1154,12 @@ declare type UseSignInReturnType = {
1127
1154
  signinAttempt: SigninAttempt | null;
1128
1155
  discardSignInAttempt: () => void;
1129
1156
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1130
- error: ApiResult<unknown, ErrorInterface> | null;
1131
1157
  } | {
1132
1158
  loading: true;
1133
1159
  signIn: never;
1134
1160
  signinAttempt: null;
1135
1161
  discardSignInAttempt: () => void;
1136
1162
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1137
- error: null;
1138
1163
  };
1139
1164
 
1140
1165
  export declare function useSignInWithStrategy<T extends SignInStrategy>(strategy: T): UseSignInWithStrategyReturnType<T>;
@@ -1145,7 +1170,6 @@ export declare type UseSignInWithStrategyReturnType<T extends SignInStrategy> =
1145
1170
  signinAttempt: null;
1146
1171
  discardSignInAttempt: () => void;
1147
1172
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1148
- error: null;
1149
1173
  } | {
1150
1174
  loading: false;
1151
1175
  signIn: {
@@ -1153,11 +1177,15 @@ export declare type UseSignInWithStrategyReturnType<T extends SignInStrategy> =
1153
1177
  completeVerification: (verificationCode: string) => Promise<Session>;
1154
1178
  prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
1155
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
+ }>;
1156
1185
  };
1157
1186
  signinAttempt: SigninAttempt | null;
1158
1187
  discardSignInAttempt: () => void;
1159
1188
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1160
- error: ApiResult<unknown, ErrorInterface> | null;
1161
1189
  };
1162
1190
 
1163
1191
  export declare function useSignUp(): UseSignUpReturnType;
@@ -1167,13 +1195,11 @@ export declare type UseSignUpReturnType = {
1167
1195
  signUp: never;
1168
1196
  signupAttempt: null;
1169
1197
  discardSignupAttempt: () => void;
1170
- errors: null;
1171
1198
  } | {
1172
1199
  loading: false;
1173
1200
  signUp: SignUpFunction;
1174
1201
  signupAttempt: SignupAttempt | null;
1175
1202
  discardSignupAttempt: () => void;
1176
- errors: ApiResult<unknown, ErrorInterface> | null;
1177
1203
  };
1178
1204
 
1179
1205
  /**
@@ -1253,7 +1279,6 @@ export declare function useUserSignins(): {
1253
1279
 
1254
1280
  export declare function useWaitlist(): {
1255
1281
  loading: boolean;
1256
- error: ApiResult<unknown, ErrorInterface> | null;
1257
1282
  joinWaitlist: (params: WaitlistParams) => Promise<ApiResult<WaitlistResponse, ErrorInterface>>;
1258
1283
  };
1259
1284