@authara/react-native 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +250 -2
- package/dist/button-appearance.d.ts +43 -0
- package/dist/button-appearance.js +103 -0
- package/dist/button-contract.d.ts +69 -0
- package/dist/button-contract.js +17 -0
- package/dist/button-error.d.ts +40 -0
- package/dist/button-error.js +70 -0
- package/dist/buttons.d.ts +53 -0
- package/dist/buttons.js +195 -0
- package/dist/client.d.ts +65 -0
- package/dist/client.js +190 -0
- package/dist/context.d.ts +12 -0
- package/dist/context.js +16 -0
- package/dist/expo-apple-authentication.d.ts +2 -0
- package/dist/expo-apple-authentication.js +38 -0
- package/dist/expo-microsoft-auth-session.d.ts +7 -0
- package/dist/expo-microsoft-auth-session.js +57 -0
- package/dist/expo-secure-store.d.ts +6 -0
- package/dist/expo-secure-store.js +9 -0
- package/dist/generated/api.d.ts +296 -0
- package/dist/generated/api.js +381 -0
- package/dist/generated/error-codes.d.ts +8 -0
- package/dist/generated/error-codes.js +42 -0
- package/dist/generated/operations.d.ts +1060 -0
- package/dist/generated/operations.js +1128 -0
- package/dist/generated/types.d.ts +355 -0
- package/dist/generated/types.js +2 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +8 -0
- package/dist/native-client.d.ts +43 -0
- package/dist/native-client.js +215 -0
- package/dist/nitro-google-signin.d.ts +5 -0
- package/dist/nitro-google-signin.js +25 -0
- package/dist/storage.d.ts +6 -0
- package/dist/storage.js +14 -0
- package/package.json +114 -4
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { AutharaClient } from "../client.js";
|
|
2
|
+
import type * as API from "./types.js";
|
|
3
|
+
export type GetCurrentAccountOptions = {
|
|
4
|
+
sessions_cursor?: string;
|
|
5
|
+
sessions_limit?: number;
|
|
6
|
+
passkeys_cursor?: string;
|
|
7
|
+
passkeys_limit?: number;
|
|
8
|
+
};
|
|
9
|
+
export type LinkCurrentUserAppleOptions = {
|
|
10
|
+
body: API.AppleAuthorizationRequest;
|
|
11
|
+
};
|
|
12
|
+
export type LinkCurrentUserGoogleOptions = {
|
|
13
|
+
body: API.GoogleLoginRequest;
|
|
14
|
+
};
|
|
15
|
+
export type LinkCurrentUserMicrosoftOptions = {
|
|
16
|
+
body: API.MicrosoftLoginRequest;
|
|
17
|
+
};
|
|
18
|
+
export type UnlinkCurrentUserAuthMethodOptions = {
|
|
19
|
+
provider: "password" | "google" | "apple" | "microsoft";
|
|
20
|
+
};
|
|
21
|
+
export type StartCurrentUserEmailChangeOptions = {
|
|
22
|
+
body: API.EmailChangeRequest;
|
|
23
|
+
};
|
|
24
|
+
export type VerifyCurrentUserEmailChangeOptions = {
|
|
25
|
+
body: API.ChallengeVerification;
|
|
26
|
+
};
|
|
27
|
+
export type DeleteCurrentUserPasskeyOptions = {
|
|
28
|
+
passkeyID: string;
|
|
29
|
+
};
|
|
30
|
+
export type AddCurrentUserPasswordOptions = {
|
|
31
|
+
body: API.SetPasswordRequest;
|
|
32
|
+
};
|
|
33
|
+
export type ChangeCurrentUserPasswordOptions = {
|
|
34
|
+
body: API.ChangePasswordRequest;
|
|
35
|
+
};
|
|
36
|
+
export type RevokeCurrentUserSessionOptions = {
|
|
37
|
+
sessionID: string;
|
|
38
|
+
};
|
|
39
|
+
export type ChangeCurrentUsernameOptions = {
|
|
40
|
+
body: API.ChangeUsernameRequest;
|
|
41
|
+
};
|
|
42
|
+
export type ResendChallengeOptions = {
|
|
43
|
+
session_transport?: "cookie" | "token";
|
|
44
|
+
body: API.ChallengeReference;
|
|
45
|
+
};
|
|
46
|
+
export type AcceptInvitationOptions = {
|
|
47
|
+
audience?: "app";
|
|
48
|
+
body: API.InvitationTokenRequest;
|
|
49
|
+
};
|
|
50
|
+
export type AuthenticateAndAcceptInvitationWithGoogleOptions = {
|
|
51
|
+
audience?: "app";
|
|
52
|
+
body: API.InvitationGoogleRequest;
|
|
53
|
+
};
|
|
54
|
+
export type LoginAndAcceptInvitationOptions = {
|
|
55
|
+
audience?: "app";
|
|
56
|
+
body: API.InvitationPasswordLoginRequest;
|
|
57
|
+
};
|
|
58
|
+
export type PreviewInvitationOptions = {
|
|
59
|
+
token: string;
|
|
60
|
+
};
|
|
61
|
+
export type LoginWithPasswordOptions = {
|
|
62
|
+
audience?: "app" | "admin" | "operator";
|
|
63
|
+
session_transport?: "cookie" | "token";
|
|
64
|
+
body: API.PasswordLoginRequest;
|
|
65
|
+
};
|
|
66
|
+
export type LoginWithAppleOptions = {
|
|
67
|
+
audience?: "app" | "admin" | "operator";
|
|
68
|
+
session_transport?: "cookie" | "token";
|
|
69
|
+
body: API.AppleAuthorizationRequest;
|
|
70
|
+
};
|
|
71
|
+
export type GetAppleLoginOptionsOptions = {
|
|
72
|
+
session_transport?: "cookie" | "token";
|
|
73
|
+
};
|
|
74
|
+
export type LoginWithGoogleOptions = {
|
|
75
|
+
audience?: "app" | "admin" | "operator";
|
|
76
|
+
session_transport?: "cookie" | "token";
|
|
77
|
+
body: API.GoogleLoginRequest;
|
|
78
|
+
};
|
|
79
|
+
export type GetGoogleLoginOptionsOptions = {
|
|
80
|
+
session_transport?: "cookie" | "token";
|
|
81
|
+
};
|
|
82
|
+
export type LoginWithMicrosoftOptions = {
|
|
83
|
+
audience?: "app" | "admin" | "operator";
|
|
84
|
+
session_transport?: "cookie" | "token";
|
|
85
|
+
body: API.MicrosoftLoginRequest;
|
|
86
|
+
};
|
|
87
|
+
export type GetMicrosoftLoginOptionsOptions = {
|
|
88
|
+
session_transport?: "cookie" | "token";
|
|
89
|
+
};
|
|
90
|
+
export type ListCurrentUserOrganizationsOptions = {
|
|
91
|
+
cursor?: string;
|
|
92
|
+
limit?: number;
|
|
93
|
+
};
|
|
94
|
+
export type ListCurrentOrganizationMembersOptions = {
|
|
95
|
+
cursor?: string;
|
|
96
|
+
limit?: number;
|
|
97
|
+
};
|
|
98
|
+
export type GetPublicOrganizationOptions = {
|
|
99
|
+
organizationID: string;
|
|
100
|
+
};
|
|
101
|
+
export type UpdatePublicOrganizationOptions = {
|
|
102
|
+
organizationID: string;
|
|
103
|
+
body: API.UpdateOrganizationRequest;
|
|
104
|
+
};
|
|
105
|
+
export type ListPublicOrganizationInvitationsOptions = {
|
|
106
|
+
organizationID: string;
|
|
107
|
+
cursor?: string;
|
|
108
|
+
limit?: number;
|
|
109
|
+
};
|
|
110
|
+
export type GetPublicOrganizationInvitationOptions = {
|
|
111
|
+
organizationID: string;
|
|
112
|
+
invitationID: string;
|
|
113
|
+
};
|
|
114
|
+
export type RevokePublicOrganizationInvitationOptions = {
|
|
115
|
+
organizationID: string;
|
|
116
|
+
invitationID: string;
|
|
117
|
+
};
|
|
118
|
+
export type ListPublicOrganizationMembersOptions = {
|
|
119
|
+
organizationID: string;
|
|
120
|
+
cursor?: string;
|
|
121
|
+
limit?: number;
|
|
122
|
+
};
|
|
123
|
+
export type GetPublicOrganizationMemberOptions = {
|
|
124
|
+
organizationID: string;
|
|
125
|
+
userID: string;
|
|
126
|
+
};
|
|
127
|
+
export type UpdatePublicOrganizationMemberOptions = {
|
|
128
|
+
organizationID: string;
|
|
129
|
+
userID: string;
|
|
130
|
+
body: API.UpdateOrganizationMemberRequest;
|
|
131
|
+
};
|
|
132
|
+
export type SwitchOrganizationOptions = {
|
|
133
|
+
organizationID: string;
|
|
134
|
+
audience?: "app" | "admin" | "operator";
|
|
135
|
+
};
|
|
136
|
+
export type FinishPasskeyAuthenticationOptions = {
|
|
137
|
+
audience?: "app" | "admin" | "operator";
|
|
138
|
+
session_transport?: "cookie" | "token";
|
|
139
|
+
body: API.PasskeyAuthenticationFinishRequest;
|
|
140
|
+
};
|
|
141
|
+
export type BeginPasskeyAuthenticationOptions = {
|
|
142
|
+
session_transport?: "cookie" | "token";
|
|
143
|
+
};
|
|
144
|
+
export type FinishPasskeyRegistrationOptions = {
|
|
145
|
+
body: API.PasskeyRegistrationFinishRequest;
|
|
146
|
+
};
|
|
147
|
+
export type StartPasswordResetChallengeOptions = {
|
|
148
|
+
session_transport?: "cookie" | "token";
|
|
149
|
+
body: API.PasswordResetRequest;
|
|
150
|
+
};
|
|
151
|
+
export type VerifyPasswordResetChallengeOptions = {
|
|
152
|
+
session_transport?: "cookie" | "token";
|
|
153
|
+
body: API.PasswordResetChallengeVerification;
|
|
154
|
+
};
|
|
155
|
+
export type StartGoogleAccountRecoveryLinkOptions = {
|
|
156
|
+
body: API.GoogleLoginRequest;
|
|
157
|
+
};
|
|
158
|
+
export type CompleteAccountRecoveryLinkWithAppleOptions = {
|
|
159
|
+
linkID: string;
|
|
160
|
+
audience?: "app";
|
|
161
|
+
body: API.AccountRecoveryAppleProofRequest;
|
|
162
|
+
};
|
|
163
|
+
export type CompleteAccountRecoveryLinkWithGoogleOptions = {
|
|
164
|
+
linkID: string;
|
|
165
|
+
audience?: "app";
|
|
166
|
+
body: API.AccountRecoveryGoogleProofRequest;
|
|
167
|
+
};
|
|
168
|
+
export type CompleteAccountRecoveryLinkWithMicrosoftOptions = {
|
|
169
|
+
linkID: string;
|
|
170
|
+
audience?: "app";
|
|
171
|
+
body: API.AccountRecoveryMicrosoftProofRequest;
|
|
172
|
+
};
|
|
173
|
+
export type CompleteAccountRecoveryLinkWithPasswordOptions = {
|
|
174
|
+
linkID: string;
|
|
175
|
+
audience?: "app";
|
|
176
|
+
body: API.AccountRecoveryPasswordProofRequest;
|
|
177
|
+
};
|
|
178
|
+
export type ReauthenticateWithAppleOptions = {
|
|
179
|
+
body: API.AppleReauthenticationRequest;
|
|
180
|
+
};
|
|
181
|
+
export type ReauthenticateWithGoogleOptions = {
|
|
182
|
+
body: API.GoogleReauthenticationRequest;
|
|
183
|
+
};
|
|
184
|
+
export type ReauthenticateWithMicrosoftOptions = {
|
|
185
|
+
body: API.MicrosoftReauthenticationRequest;
|
|
186
|
+
};
|
|
187
|
+
export type FinishPasskeyReauthenticationOptions = {
|
|
188
|
+
body: API.PasskeyReauthenticationFinishRequest;
|
|
189
|
+
};
|
|
190
|
+
export type BeginPasskeyReauthenticationOptions = {
|
|
191
|
+
body: API.AuthenticationChallengeReference;
|
|
192
|
+
};
|
|
193
|
+
export type ReauthenticateWithPasswordOptions = {
|
|
194
|
+
body: API.PasswordReauthenticationRequest;
|
|
195
|
+
};
|
|
196
|
+
export type RefreshSessionOptions = {
|
|
197
|
+
audience?: "app" | "admin" | "operator";
|
|
198
|
+
};
|
|
199
|
+
export type StartSignupChallengeOptions = {
|
|
200
|
+
audience?: "app";
|
|
201
|
+
session_transport?: "cookie" | "token";
|
|
202
|
+
body: API.SignupRequest;
|
|
203
|
+
};
|
|
204
|
+
export type VerifySignupChallengeOptions = {
|
|
205
|
+
audience?: "app";
|
|
206
|
+
session_transport?: "cookie" | "token";
|
|
207
|
+
body: API.SignupChallengeVerification;
|
|
208
|
+
};
|
|
209
|
+
export type SignupDirectOptions = {
|
|
210
|
+
audience?: "app";
|
|
211
|
+
session_transport?: "cookie" | "token";
|
|
212
|
+
body: API.SignupRequest;
|
|
213
|
+
};
|
|
214
|
+
export type RefreshTokensOptions = {
|
|
215
|
+
body: API.TokenRefreshRequest;
|
|
216
|
+
};
|
|
217
|
+
export type RevokeTokensOptions = {
|
|
218
|
+
body: API.TokenRevocationRequest;
|
|
219
|
+
};
|
|
220
|
+
export type SetCurrentUserPasswordOptions = {
|
|
221
|
+
body: API.SetPasswordRequest;
|
|
222
|
+
};
|
|
223
|
+
export type ListPublicUserMembershipsOptions = {
|
|
224
|
+
userID: string;
|
|
225
|
+
cursor?: string;
|
|
226
|
+
limit?: number;
|
|
227
|
+
};
|
|
228
|
+
export declare class GeneratedAutharaApiClient extends AutharaClient {
|
|
229
|
+
getCurrentAccount(options?: GetCurrentAccountOptions): Promise<API.Account>;
|
|
230
|
+
linkCurrentUserApple(options: LinkCurrentUserAppleOptions): Promise<void>;
|
|
231
|
+
linkCurrentUserGoogle(options: LinkCurrentUserGoogleOptions): Promise<void>;
|
|
232
|
+
linkCurrentUserMicrosoft(options: LinkCurrentUserMicrosoftOptions): Promise<void>;
|
|
233
|
+
unlinkCurrentUserAuthMethod(options: UnlinkCurrentUserAuthMethodOptions): Promise<void>;
|
|
234
|
+
startCurrentUserEmailChange(options: StartCurrentUserEmailChangeOptions): Promise<API.ChallengeReference>;
|
|
235
|
+
verifyCurrentUserEmailChange(options: VerifyCurrentUserEmailChangeOptions): Promise<void>;
|
|
236
|
+
deleteCurrentUserPasskey(options: DeleteCurrentUserPasskeyOptions): Promise<void>;
|
|
237
|
+
addCurrentUserPassword(options: AddCurrentUserPasswordOptions): Promise<void>;
|
|
238
|
+
changeCurrentUserPassword(options: ChangeCurrentUserPasswordOptions): Promise<void>;
|
|
239
|
+
revokeCurrentUserOtherSessions(): Promise<void>;
|
|
240
|
+
revokeCurrentUserSession(options: RevokeCurrentUserSessionOptions): Promise<void>;
|
|
241
|
+
changeCurrentUsername(options: ChangeCurrentUsernameOptions): Promise<void>;
|
|
242
|
+
getPublicCapabilities(): Promise<API.Capabilities>;
|
|
243
|
+
resendChallenge(options: ResendChallengeOptions): Promise<void>;
|
|
244
|
+
getCsrfToken(): Promise<API.CSRFToken>;
|
|
245
|
+
acceptInvitation(options: AcceptInvitationOptions): Promise<API.Tokens>;
|
|
246
|
+
authenticateAndAcceptInvitationWithGoogle(options: AuthenticateAndAcceptInvitationWithGoogleOptions): Promise<API.InvitationGoogleResult>;
|
|
247
|
+
loginAndAcceptInvitation(options: LoginAndAcceptInvitationOptions): Promise<API.AuthSession>;
|
|
248
|
+
previewInvitation(options: PreviewInvitationOptions): Promise<API.InvitationPreview>;
|
|
249
|
+
loginWithPassword(options: LoginWithPasswordOptions): Promise<API.AuthSession>;
|
|
250
|
+
loginWithApple(options: LoginWithAppleOptions): Promise<API.AuthSession>;
|
|
251
|
+
getAppleLoginOptions(options?: GetAppleLoginOptionsOptions): Promise<API.AppleLoginOptions>;
|
|
252
|
+
loginWithGoogle(options: LoginWithGoogleOptions): Promise<API.AuthSession>;
|
|
253
|
+
getGoogleLoginOptions(options?: GetGoogleLoginOptionsOptions): Promise<API.GoogleLoginOptions>;
|
|
254
|
+
loginWithMicrosoft(options: LoginWithMicrosoftOptions): Promise<API.AuthSession>;
|
|
255
|
+
getMicrosoftLoginOptions(options?: GetMicrosoftLoginOptionsOptions): Promise<API.MicrosoftLoginOptions>;
|
|
256
|
+
listCurrentUserOrganizations(options?: ListCurrentUserOrganizationsOptions): Promise<API.OrganizationSummaries>;
|
|
257
|
+
getCurrentOrganization(): Promise<API.OrganizationSummary>;
|
|
258
|
+
listCurrentOrganizationMembers(options?: ListCurrentOrganizationMembersOptions): Promise<API.CurrentOrganizationMembers>;
|
|
259
|
+
getPublicOrganization(options: GetPublicOrganizationOptions): Promise<API.OrganizationEnvelope>;
|
|
260
|
+
updatePublicOrganization(options: UpdatePublicOrganizationOptions): Promise<API.OrganizationEnvelope>;
|
|
261
|
+
listPublicOrganizationInvitations(options: ListPublicOrganizationInvitationsOptions): Promise<API.OrganizationInvitations>;
|
|
262
|
+
getPublicOrganizationInvitation(options: GetPublicOrganizationInvitationOptions): Promise<API.OrganizationInvitationEnvelope>;
|
|
263
|
+
revokePublicOrganizationInvitation(options: RevokePublicOrganizationInvitationOptions): Promise<API.OrganizationInvitationEnvelope>;
|
|
264
|
+
listPublicOrganizationMembers(options: ListPublicOrganizationMembersOptions): Promise<API.OrganizationMembers>;
|
|
265
|
+
getPublicOrganizationMember(options: GetPublicOrganizationMemberOptions): Promise<API.OrganizationMemberEnvelope>;
|
|
266
|
+
updatePublicOrganizationMember(options: UpdatePublicOrganizationMemberOptions): Promise<API.OrganizationMemberEnvelope>;
|
|
267
|
+
switchOrganization(options: SwitchOrganizationOptions): Promise<API.Tokens>;
|
|
268
|
+
finishPasskeyAuthentication(options: FinishPasskeyAuthenticationOptions): Promise<API.AuthSession>;
|
|
269
|
+
beginPasskeyAuthentication(options?: BeginPasskeyAuthenticationOptions): Promise<API.PasskeyOptions>;
|
|
270
|
+
finishPasskeyRegistration(options: FinishPasskeyRegistrationOptions): Promise<void>;
|
|
271
|
+
beginPasskeyRegistration(): Promise<API.PasskeyOptions>;
|
|
272
|
+
startPasswordResetChallenge(options: StartPasswordResetChallengeOptions): Promise<API.ChallengeReference>;
|
|
273
|
+
verifyPasswordResetChallenge(options: VerifyPasswordResetChallengeOptions): Promise<void>;
|
|
274
|
+
startGoogleAccountRecoveryLink(options: StartGoogleAccountRecoveryLinkOptions): Promise<API.AccountRecoveryLink>;
|
|
275
|
+
completeAccountRecoveryLinkWithApple(options: CompleteAccountRecoveryLinkWithAppleOptions): Promise<API.AuthSession>;
|
|
276
|
+
completeAccountRecoveryLinkWithGoogle(options: CompleteAccountRecoveryLinkWithGoogleOptions): Promise<API.AuthSession>;
|
|
277
|
+
completeAccountRecoveryLinkWithMicrosoft(options: CompleteAccountRecoveryLinkWithMicrosoftOptions): Promise<API.AuthSession>;
|
|
278
|
+
completeAccountRecoveryLinkWithPassword(options: CompleteAccountRecoveryLinkWithPasswordOptions): Promise<API.AuthSession>;
|
|
279
|
+
reauthenticateWithApple(options: ReauthenticateWithAppleOptions): Promise<void>;
|
|
280
|
+
checkRecentAuthentication(): Promise<void>;
|
|
281
|
+
reauthenticateWithGoogle(options: ReauthenticateWithGoogleOptions): Promise<void>;
|
|
282
|
+
reauthenticateWithMicrosoft(options: ReauthenticateWithMicrosoftOptions): Promise<void>;
|
|
283
|
+
finishPasskeyReauthentication(options: FinishPasskeyReauthenticationOptions): Promise<void>;
|
|
284
|
+
beginPasskeyReauthentication(options: BeginPasskeyReauthenticationOptions): Promise<API.PasskeyOptions>;
|
|
285
|
+
reauthenticateWithPassword(options: ReauthenticateWithPasswordOptions): Promise<void>;
|
|
286
|
+
logout(): Promise<void>;
|
|
287
|
+
refreshSession(options?: RefreshSessionOptions): Promise<void>;
|
|
288
|
+
startSignupChallenge(options: StartSignupChallengeOptions): Promise<API.SignupChallenge>;
|
|
289
|
+
verifySignupChallenge(options: VerifySignupChallengeOptions): Promise<API.AuthSession>;
|
|
290
|
+
signupDirect(options: SignupDirectOptions): Promise<API.AuthSession>;
|
|
291
|
+
refreshTokens(options: RefreshTokensOptions): Promise<API.Tokens>;
|
|
292
|
+
revokeTokens(options: RevokeTokensOptions): Promise<void>;
|
|
293
|
+
getCurrentUser(): Promise<API.CurrentUser>;
|
|
294
|
+
setCurrentUserPassword(options: SetCurrentUserPasswordOptions): Promise<void>;
|
|
295
|
+
listPublicUserMemberships(options: ListPublicUserMembershipsOptions): Promise<API.UserMemberships>;
|
|
296
|
+
}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
// Code generated from authara-core/contract/openapi.yaml; DO NOT EDIT.
|
|
2
|
+
import { AutharaClient } from "../client.js";
|
|
3
|
+
export class GeneratedAutharaApiClient extends AutharaClient {
|
|
4
|
+
getCurrentAccount(options) {
|
|
5
|
+
return this.request("GET", `/auth/api/v1/account`, {
|
|
6
|
+
query: {
|
|
7
|
+
sessions_cursor: options?.sessions_cursor,
|
|
8
|
+
sessions_limit: options?.sessions_limit,
|
|
9
|
+
passkeys_cursor: options?.passkeys_cursor,
|
|
10
|
+
passkeys_limit: options?.passkeys_limit,
|
|
11
|
+
},
|
|
12
|
+
authenticated: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
linkCurrentUserApple(options) {
|
|
16
|
+
return this.request("POST", `/auth/api/v1/account/auth-methods/apple`, { body: options.body, csrf: true, authenticated: true });
|
|
17
|
+
}
|
|
18
|
+
linkCurrentUserGoogle(options) {
|
|
19
|
+
return this.request("POST", `/auth/api/v1/account/auth-methods/google`, { body: options.body, csrf: true, authenticated: true });
|
|
20
|
+
}
|
|
21
|
+
linkCurrentUserMicrosoft(options) {
|
|
22
|
+
return this.request("POST", `/auth/api/v1/account/auth-methods/microsoft`, { body: options.body, csrf: true, authenticated: true });
|
|
23
|
+
}
|
|
24
|
+
unlinkCurrentUserAuthMethod(options) {
|
|
25
|
+
return this.request("DELETE", `/auth/api/v1/account/auth-methods/${encodeURIComponent(String(options.provider))}`, { csrf: true, authenticated: true });
|
|
26
|
+
}
|
|
27
|
+
startCurrentUserEmailChange(options) {
|
|
28
|
+
return this.request("POST", `/auth/api/v1/account/email-change/challenges`, { body: options.body, csrf: true, authenticated: true });
|
|
29
|
+
}
|
|
30
|
+
verifyCurrentUserEmailChange(options) {
|
|
31
|
+
return this.request("POST", `/auth/api/v1/account/email-change/challenges/verify`, { body: options.body, csrf: true, authenticated: true });
|
|
32
|
+
}
|
|
33
|
+
deleteCurrentUserPasskey(options) {
|
|
34
|
+
return this.request("DELETE", `/auth/api/v1/account/passkeys/${encodeURIComponent(String(options.passkeyID))}`, { csrf: true, authenticated: true });
|
|
35
|
+
}
|
|
36
|
+
addCurrentUserPassword(options) {
|
|
37
|
+
return this.request("POST", `/auth/api/v1/account/password`, {
|
|
38
|
+
body: options.body,
|
|
39
|
+
csrf: true,
|
|
40
|
+
authenticated: true,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
changeCurrentUserPassword(options) {
|
|
44
|
+
return this.request("PUT", `/auth/api/v1/account/password`, {
|
|
45
|
+
body: options.body,
|
|
46
|
+
csrf: true,
|
|
47
|
+
authenticated: true,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
revokeCurrentUserOtherSessions() {
|
|
51
|
+
return this.request("DELETE", `/auth/api/v1/account/sessions/others`, { csrf: true, authenticated: true });
|
|
52
|
+
}
|
|
53
|
+
revokeCurrentUserSession(options) {
|
|
54
|
+
return this.request("DELETE", `/auth/api/v1/account/sessions/${encodeURIComponent(String(options.sessionID))}`, { csrf: true, authenticated: true });
|
|
55
|
+
}
|
|
56
|
+
changeCurrentUsername(options) {
|
|
57
|
+
return this.request("PATCH", `/auth/api/v1/account/username`, {
|
|
58
|
+
body: options.body,
|
|
59
|
+
csrf: true,
|
|
60
|
+
authenticated: true,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
getPublicCapabilities() {
|
|
64
|
+
return this.request("GET", `/auth/api/v1/capabilities`, {
|
|
65
|
+
authenticated: true,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
resendChallenge(options) {
|
|
69
|
+
return this.request("POST", `/auth/api/v1/challenges/resend`, {
|
|
70
|
+
query: { session_transport: options?.session_transport },
|
|
71
|
+
body: options.body,
|
|
72
|
+
csrf: true,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
getCsrfToken() {
|
|
76
|
+
return this.request("GET", `/auth/api/v1/csrf`);
|
|
77
|
+
}
|
|
78
|
+
acceptInvitation(options) {
|
|
79
|
+
return this.request("POST", `/auth/api/v1/invitations/accept`, {
|
|
80
|
+
query: { audience: options?.audience },
|
|
81
|
+
body: options.body,
|
|
82
|
+
csrf: true,
|
|
83
|
+
authenticated: true,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
authenticateAndAcceptInvitationWithGoogle(options) {
|
|
87
|
+
return this.request("POST", `/auth/api/v1/invitations/google`, {
|
|
88
|
+
query: { audience: options?.audience },
|
|
89
|
+
body: options.body,
|
|
90
|
+
csrf: true,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
loginAndAcceptInvitation(options) {
|
|
94
|
+
return this.request("POST", `/auth/api/v1/invitations/login`, {
|
|
95
|
+
query: { audience: options?.audience },
|
|
96
|
+
body: options.body,
|
|
97
|
+
csrf: true,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
previewInvitation(options) {
|
|
101
|
+
return this.request("GET", `/auth/api/v1/invitations/preview`, { query: { token: options?.token } });
|
|
102
|
+
}
|
|
103
|
+
loginWithPassword(options) {
|
|
104
|
+
return this.request("POST", `/auth/api/v1/login`, {
|
|
105
|
+
query: {
|
|
106
|
+
audience: options?.audience,
|
|
107
|
+
session_transport: options?.session_transport,
|
|
108
|
+
},
|
|
109
|
+
body: options.body,
|
|
110
|
+
csrf: true,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
loginWithApple(options) {
|
|
114
|
+
return this.request("POST", `/auth/api/v1/oauth/apple`, {
|
|
115
|
+
query: {
|
|
116
|
+
audience: options?.audience,
|
|
117
|
+
session_transport: options?.session_transport,
|
|
118
|
+
},
|
|
119
|
+
body: options.body,
|
|
120
|
+
csrf: true,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
getAppleLoginOptions(options) {
|
|
124
|
+
return this.request("GET", `/auth/api/v1/oauth/apple/options`, { query: { session_transport: options?.session_transport } });
|
|
125
|
+
}
|
|
126
|
+
loginWithGoogle(options) {
|
|
127
|
+
return this.request("POST", `/auth/api/v1/oauth/google`, {
|
|
128
|
+
query: {
|
|
129
|
+
audience: options?.audience,
|
|
130
|
+
session_transport: options?.session_transport,
|
|
131
|
+
},
|
|
132
|
+
body: options.body,
|
|
133
|
+
csrf: true,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
getGoogleLoginOptions(options) {
|
|
137
|
+
return this.request("GET", `/auth/api/v1/oauth/google/options`, { query: { session_transport: options?.session_transport } });
|
|
138
|
+
}
|
|
139
|
+
loginWithMicrosoft(options) {
|
|
140
|
+
return this.request("POST", `/auth/api/v1/oauth/microsoft`, {
|
|
141
|
+
query: {
|
|
142
|
+
audience: options?.audience,
|
|
143
|
+
session_transport: options?.session_transport,
|
|
144
|
+
},
|
|
145
|
+
body: options.body,
|
|
146
|
+
csrf: true,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
getMicrosoftLoginOptions(options) {
|
|
150
|
+
return this.request("GET", `/auth/api/v1/oauth/microsoft/options`, { query: { session_transport: options?.session_transport } });
|
|
151
|
+
}
|
|
152
|
+
listCurrentUserOrganizations(options) {
|
|
153
|
+
return this.request("GET", `/auth/api/v1/organizations`, {
|
|
154
|
+
query: { cursor: options?.cursor, limit: options?.limit },
|
|
155
|
+
authenticated: true,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
getCurrentOrganization() {
|
|
159
|
+
return this.request("GET", `/auth/api/v1/organizations/current`, { authenticated: true });
|
|
160
|
+
}
|
|
161
|
+
listCurrentOrganizationMembers(options) {
|
|
162
|
+
return this.request("GET", `/auth/api/v1/organizations/current/members`, {
|
|
163
|
+
query: { cursor: options?.cursor, limit: options?.limit },
|
|
164
|
+
authenticated: true,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
getPublicOrganization(options) {
|
|
168
|
+
return this.request("GET", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}`, { authenticated: true });
|
|
169
|
+
}
|
|
170
|
+
updatePublicOrganization(options) {
|
|
171
|
+
return this.request("PATCH", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}`, { body: options.body, csrf: true, authenticated: true });
|
|
172
|
+
}
|
|
173
|
+
listPublicOrganizationInvitations(options) {
|
|
174
|
+
return this.request("GET", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/invitations`, {
|
|
175
|
+
query: { cursor: options?.cursor, limit: options?.limit },
|
|
176
|
+
authenticated: true,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
getPublicOrganizationInvitation(options) {
|
|
180
|
+
return this.request("GET", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/invitations/${encodeURIComponent(String(options.invitationID))}`, { authenticated: true });
|
|
181
|
+
}
|
|
182
|
+
revokePublicOrganizationInvitation(options) {
|
|
183
|
+
return this.request("POST", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/invitations/${encodeURIComponent(String(options.invitationID))}/revoke`, { csrf: true, authenticated: true });
|
|
184
|
+
}
|
|
185
|
+
listPublicOrganizationMembers(options) {
|
|
186
|
+
return this.request("GET", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/members`, {
|
|
187
|
+
query: { cursor: options?.cursor, limit: options?.limit },
|
|
188
|
+
authenticated: true,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
getPublicOrganizationMember(options) {
|
|
192
|
+
return this.request("GET", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/members/${encodeURIComponent(String(options.userID))}`, { authenticated: true });
|
|
193
|
+
}
|
|
194
|
+
updatePublicOrganizationMember(options) {
|
|
195
|
+
return this.request("PATCH", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/members/${encodeURIComponent(String(options.userID))}`, { body: options.body, csrf: true, authenticated: true });
|
|
196
|
+
}
|
|
197
|
+
switchOrganization(options) {
|
|
198
|
+
return this.request("POST", `/auth/api/v1/organizations/${encodeURIComponent(String(options.organizationID))}/switch`, {
|
|
199
|
+
query: { audience: options?.audience },
|
|
200
|
+
csrf: true,
|
|
201
|
+
authenticated: true,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
finishPasskeyAuthentication(options) {
|
|
205
|
+
return this.request("POST", `/auth/api/v1/passkeys/authenticate/finish`, {
|
|
206
|
+
query: {
|
|
207
|
+
audience: options?.audience,
|
|
208
|
+
session_transport: options?.session_transport,
|
|
209
|
+
},
|
|
210
|
+
body: options.body,
|
|
211
|
+
csrf: true,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
beginPasskeyAuthentication(options) {
|
|
215
|
+
return this.request("POST", `/auth/api/v1/passkeys/authenticate/options`, { query: { session_transport: options?.session_transport }, csrf: true });
|
|
216
|
+
}
|
|
217
|
+
finishPasskeyRegistration(options) {
|
|
218
|
+
return this.request("POST", `/auth/api/v1/passkeys/register/finish`, {
|
|
219
|
+
body: options.body,
|
|
220
|
+
csrf: true,
|
|
221
|
+
authenticated: true,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
beginPasskeyRegistration() {
|
|
225
|
+
return this.request("POST", `/auth/api/v1/passkeys/register/options`, { csrf: true, authenticated: true });
|
|
226
|
+
}
|
|
227
|
+
startPasswordResetChallenge(options) {
|
|
228
|
+
return this.request("POST", `/auth/api/v1/password-reset/challenges`, {
|
|
229
|
+
query: { session_transport: options?.session_transport },
|
|
230
|
+
body: options.body,
|
|
231
|
+
csrf: true,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
verifyPasswordResetChallenge(options) {
|
|
235
|
+
return this.request("POST", `/auth/api/v1/password-reset/challenges/verify`, {
|
|
236
|
+
query: { session_transport: options?.session_transport },
|
|
237
|
+
body: options.body,
|
|
238
|
+
csrf: true,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
startGoogleAccountRecoveryLink(options) {
|
|
242
|
+
return this.request("POST", `/auth/api/v1/provider-links/recovery/google`, { body: options.body, csrf: true });
|
|
243
|
+
}
|
|
244
|
+
completeAccountRecoveryLinkWithApple(options) {
|
|
245
|
+
return this.request("POST", `/auth/api/v1/provider-links/recovery/${encodeURIComponent(String(options.linkID))}/apple`, {
|
|
246
|
+
query: { audience: options?.audience },
|
|
247
|
+
body: options.body,
|
|
248
|
+
csrf: true,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
completeAccountRecoveryLinkWithGoogle(options) {
|
|
252
|
+
return this.request("POST", `/auth/api/v1/provider-links/recovery/${encodeURIComponent(String(options.linkID))}/google`, {
|
|
253
|
+
query: { audience: options?.audience },
|
|
254
|
+
body: options.body,
|
|
255
|
+
csrf: true,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
completeAccountRecoveryLinkWithMicrosoft(options) {
|
|
259
|
+
return this.request("POST", `/auth/api/v1/provider-links/recovery/${encodeURIComponent(String(options.linkID))}/microsoft`, {
|
|
260
|
+
query: { audience: options?.audience },
|
|
261
|
+
body: options.body,
|
|
262
|
+
csrf: true,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
completeAccountRecoveryLinkWithPassword(options) {
|
|
266
|
+
return this.request("POST", `/auth/api/v1/provider-links/recovery/${encodeURIComponent(String(options.linkID))}/password`, {
|
|
267
|
+
query: { audience: options?.audience },
|
|
268
|
+
body: options.body,
|
|
269
|
+
csrf: true,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
reauthenticateWithApple(options) {
|
|
273
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/apple`, {
|
|
274
|
+
body: options.body,
|
|
275
|
+
csrf: true,
|
|
276
|
+
authenticated: true,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
checkRecentAuthentication() {
|
|
280
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/check`, {
|
|
281
|
+
csrf: true,
|
|
282
|
+
authenticated: true,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
reauthenticateWithGoogle(options) {
|
|
286
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/google`, {
|
|
287
|
+
body: options.body,
|
|
288
|
+
csrf: true,
|
|
289
|
+
authenticated: true,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
reauthenticateWithMicrosoft(options) {
|
|
293
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/microsoft`, {
|
|
294
|
+
body: options.body,
|
|
295
|
+
csrf: true,
|
|
296
|
+
authenticated: true,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
finishPasskeyReauthentication(options) {
|
|
300
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/passkeys/finish`, { body: options.body, csrf: true, authenticated: true });
|
|
301
|
+
}
|
|
302
|
+
beginPasskeyReauthentication(options) {
|
|
303
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/passkeys/options`, { body: options.body, csrf: true, authenticated: true });
|
|
304
|
+
}
|
|
305
|
+
reauthenticateWithPassword(options) {
|
|
306
|
+
return this.request("POST", `/auth/api/v1/reauthenticate/password`, {
|
|
307
|
+
body: options.body,
|
|
308
|
+
csrf: true,
|
|
309
|
+
authenticated: true,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
logout() {
|
|
313
|
+
return this.request("POST", `/auth/api/v1/sessions/logout`, {
|
|
314
|
+
csrf: true,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
refreshSession(options) {
|
|
318
|
+
return this.request("POST", `/auth/api/v1/sessions/refresh`, {
|
|
319
|
+
query: { audience: options?.audience },
|
|
320
|
+
csrf: true,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
startSignupChallenge(options) {
|
|
324
|
+
return this.request("POST", `/auth/api/v1/signup/challenges`, {
|
|
325
|
+
query: {
|
|
326
|
+
audience: options?.audience,
|
|
327
|
+
session_transport: options?.session_transport,
|
|
328
|
+
},
|
|
329
|
+
body: options.body,
|
|
330
|
+
csrf: true,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
verifySignupChallenge(options) {
|
|
334
|
+
return this.request("POST", `/auth/api/v1/signup/challenges/verify`, {
|
|
335
|
+
query: {
|
|
336
|
+
audience: options?.audience,
|
|
337
|
+
session_transport: options?.session_transport,
|
|
338
|
+
},
|
|
339
|
+
body: options.body,
|
|
340
|
+
csrf: true,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
signupDirect(options) {
|
|
344
|
+
return this.request("POST", `/auth/api/v1/signup/direct`, {
|
|
345
|
+
query: {
|
|
346
|
+
audience: options?.audience,
|
|
347
|
+
session_transport: options?.session_transport,
|
|
348
|
+
},
|
|
349
|
+
body: options.body,
|
|
350
|
+
csrf: true,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
refreshTokens(options) {
|
|
354
|
+
return this.request("POST", `/auth/api/v1/tokens/refresh`, {
|
|
355
|
+
body: options.body,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
revokeTokens(options) {
|
|
359
|
+
return this.request("POST", `/auth/api/v1/tokens/revoke`, {
|
|
360
|
+
body: options.body,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
getCurrentUser() {
|
|
364
|
+
return this.request("GET", `/auth/api/v1/user`, {
|
|
365
|
+
authenticated: true,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
setCurrentUserPassword(options) {
|
|
369
|
+
return this.request("PUT", `/auth/api/v1/users/password`, {
|
|
370
|
+
body: options.body,
|
|
371
|
+
csrf: true,
|
|
372
|
+
authenticated: true,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
listPublicUserMemberships(options) {
|
|
376
|
+
return this.request("GET", `/auth/api/v1/users/${encodeURIComponent(String(options.userID))}/memberships`, {
|
|
377
|
+
query: { cursor: options?.cursor, limit: options?.limit },
|
|
378
|
+
authenticated: true,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const autharaActionErrorCodes: {
|
|
2
|
+
readonly login: readonly ["account_link_required", "forbidden", "internal_error", "invalid_request", "not_found", "unauthorized"];
|
|
3
|
+
readonly link: readonly ["auth_method_already_linked", "forbidden", "internal_error", "invalid_request", "not_found", "recent_authentication_required", "unauthorized"];
|
|
4
|
+
readonly reauthenticate: readonly ["internal_error", "invalid_authentication_challenge", "invalid_request", "not_found", "unauthorized"];
|
|
5
|
+
readonly recover: readonly ["auth_method_already_linked", "forbidden", "internal_error", "invalid_request", "invitation_already_accepted", "invitation_email_mismatch", "invitation_expired", "invitation_not_found", "invitation_revoked", "not_found", "organization_membership_conflict", "provider_link_expired", "unauthorized"];
|
|
6
|
+
};
|
|
7
|
+
export type AutharaContractAction = keyof typeof autharaActionErrorCodes;
|
|
8
|
+
export type AutharaContractErrorCode<Action extends AutharaContractAction> = (typeof autharaActionErrorCodes)[Action][number];
|