@spica-devkit/auth 0.10.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/index.d.ts ADDED
@@ -0,0 +1,618 @@
1
+ interface User {
2
+ _id: string;
3
+ username: string;
4
+ password: string;
5
+ policies: string[];
6
+ lastLogin?: Date;
7
+ failedAttempts?: Date[];
8
+ }
9
+ type UserCreate = Omit<User, "_id" | "lastLogin" | "failedAttempts" | "policies">;
10
+ type UserGet = Omit<User, "password">;
11
+ type UserUpdate = Pick<User, "password">;
12
+ type TokenScheme = {
13
+ token: string;
14
+ };
15
+ type VerificationStrategy = "Otp" | "MagicLink";
16
+ type Provider = "email" | "phone";
17
+ interface VerificationStartResponse {
18
+ message: string;
19
+ value: string;
20
+ metadata: Record<string, any>;
21
+ }
22
+ interface VerificationCompleteResponse {
23
+ message: string;
24
+ provider: string;
25
+ destination: string;
26
+ }
27
+ interface PasswordResetStartResponse {
28
+ message: string;
29
+ }
30
+ interface PasswordResetCompleteResponse {
31
+ message: string;
32
+ }
33
+ interface PasswordlessLoginStartResponse {
34
+ message: string;
35
+ metadata?: Record<string, any>;
36
+ }
37
+ interface PasswordlessLoginCompleteResponse {
38
+ token: string;
39
+ scheme: string;
40
+ issuer: string;
41
+ }
42
+ interface VerifiedToken {
43
+ _id: string;
44
+ username: string;
45
+ [key: string]: any;
46
+ }
47
+
48
+ interface HttpService {
49
+ baseUrl: string;
50
+ setBaseUrl(url: string): void;
51
+ setAuthorization(authorization: string): void;
52
+ getAuthorization(): string;
53
+ setWriteDefaults(writeDefaults: {
54
+ headers: {
55
+ [key: string]: string;
56
+ };
57
+ }): void;
58
+ get<T>(url: string, options?: any): Promise<T>;
59
+ post<T>(url: string, body: any, options?: any): Promise<T>;
60
+ put<T>(url: string, body: any, options?: any): Promise<T>;
61
+ patch<T>(url: string, body: any, options?: any): Promise<T>;
62
+ delete(url: string, options?: any): any;
63
+ request<T>(options: any): Promise<T>;
64
+ }
65
+ interface PublicInitialization {
66
+ publicUrl?: string;
67
+ }
68
+ interface ApikeyInitialization extends PublicInitialization {
69
+ apikey: string;
70
+ }
71
+ interface IdentityInitialization extends PublicInitialization {
72
+ identity: string;
73
+ }
74
+ interface UserInitialization extends PublicInitialization {
75
+ user: string;
76
+ }
77
+
78
+ declare class UserSession {
79
+ private _token;
80
+ private readonly _userId;
81
+ private readonly _username;
82
+ private readonly _service;
83
+ constructor(params: {
84
+ token: string;
85
+ userId: string;
86
+ username: string;
87
+ service: HttpService;
88
+ });
89
+ get token(): string;
90
+ get userId(): string;
91
+ get username(): string;
92
+ private getAuthHeaders;
93
+ get(headers?: object): Promise<UserGet>;
94
+ updatePassword(password: string, headers?: object): Promise<UserGet>;
95
+ refreshAccessToken(headers?: object): Promise<string>;
96
+ addEmail(value: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationStartResponse>;
97
+ verifyEmail(code: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationCompleteResponse>;
98
+ addPhoneNumber(value: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationStartResponse>;
99
+ verifyPhoneNumber(code: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationCompleteResponse>;
100
+ completePasswordReset(code: string, newPassword: string, provider: Provider, headers?: object): Promise<PasswordResetCompleteResponse>;
101
+ }
102
+
103
+ /*! *****************************************************************************
104
+ Copyright (C) Microsoft. All rights reserved.
105
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
106
+ this file except in compliance with the License. You may obtain a copy of the
107
+ License at http://www.apache.org/licenses/LICENSE-2.0
108
+
109
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
110
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
111
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
112
+ MERCHANTABLITY OR NON-INFRINGEMENT.
113
+
114
+ See the Apache Version 2.0 License for specific language governing permissions
115
+ and limitations under the License.
116
+ ***************************************************************************** */
117
+
118
+
119
+
120
+ declare global {
121
+ namespace Reflect {
122
+ /**
123
+ * Applies a set of decorators to a target object.
124
+ * @param decorators An array of decorators.
125
+ * @param target The target object.
126
+ * @returns The result of applying the provided decorators.
127
+ * @remarks Decorators are applied in reverse order of their positions in the array.
128
+ * @example
129
+ *
130
+ * class Example { }
131
+ *
132
+ * // constructor
133
+ * Example = Reflect.decorate(decoratorsArray, Example);
134
+ *
135
+ */
136
+ function decorate(decorators: ClassDecorator[], target: Function): Function;
137
+ /**
138
+ * Applies a set of decorators to a property of a target object.
139
+ * @param decorators An array of decorators.
140
+ * @param target The target object.
141
+ * @param propertyKey The property key to decorate.
142
+ * @param attributes A property descriptor.
143
+ * @remarks Decorators are applied in reverse order.
144
+ * @example
145
+ *
146
+ * class Example {
147
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
148
+ * // static staticProperty;
149
+ * // property;
150
+ *
151
+ * static staticMethod() { }
152
+ * method() { }
153
+ * }
154
+ *
155
+ * // property (on constructor)
156
+ * Reflect.decorate(decoratorsArray, Example, "staticProperty");
157
+ *
158
+ * // property (on prototype)
159
+ * Reflect.decorate(decoratorsArray, Example.prototype, "property");
160
+ *
161
+ * // method (on constructor)
162
+ * Object.defineProperty(Example, "staticMethod",
163
+ * Reflect.decorate(decoratorsArray, Example, "staticMethod",
164
+ * Object.getOwnPropertyDescriptor(Example, "staticMethod")));
165
+ *
166
+ * // method (on prototype)
167
+ * Object.defineProperty(Example.prototype, "method",
168
+ * Reflect.decorate(decoratorsArray, Example.prototype, "method",
169
+ * Object.getOwnPropertyDescriptor(Example.prototype, "method")));
170
+ *
171
+ */
172
+ function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, propertyKey: string | symbol, attributes?: PropertyDescriptor): PropertyDescriptor;
173
+ /**
174
+ * A default metadata decorator factory that can be used on a class, class member, or parameter.
175
+ * @param metadataKey The key for the metadata entry.
176
+ * @param metadataValue The value for the metadata entry.
177
+ * @returns A decorator function.
178
+ * @remarks
179
+ * If `metadataKey` is already defined for the target and target key, the
180
+ * metadataValue for that key will be overwritten.
181
+ * @example
182
+ *
183
+ * // constructor
184
+ * @Reflect.metadata(key, value)
185
+ * class Example {
186
+ * }
187
+ *
188
+ * // property (on constructor, TypeScript only)
189
+ * class Example {
190
+ * @Reflect.metadata(key, value)
191
+ * static staticProperty;
192
+ * }
193
+ *
194
+ * // property (on prototype, TypeScript only)
195
+ * class Example {
196
+ * @Reflect.metadata(key, value)
197
+ * property;
198
+ * }
199
+ *
200
+ * // method (on constructor)
201
+ * class Example {
202
+ * @Reflect.metadata(key, value)
203
+ * static staticMethod() { }
204
+ * }
205
+ *
206
+ * // method (on prototype)
207
+ * class Example {
208
+ * @Reflect.metadata(key, value)
209
+ * method() { }
210
+ * }
211
+ *
212
+ */
213
+ function metadata(metadataKey: any, metadataValue: any): {
214
+ (target: Function): void;
215
+ (target: Object, propertyKey: string | symbol): void;
216
+ };
217
+ /**
218
+ * Define a unique metadata entry on the target.
219
+ * @param metadataKey A key used to store and retrieve metadata.
220
+ * @param metadataValue A value that contains attached metadata.
221
+ * @param target The target object on which to define metadata.
222
+ * @example
223
+ *
224
+ * class Example {
225
+ * }
226
+ *
227
+ * // constructor
228
+ * Reflect.defineMetadata("custom:annotation", options, Example);
229
+ *
230
+ * // decorator factory as metadata-producing annotation.
231
+ * function MyAnnotation(options): ClassDecorator {
232
+ * return target => Reflect.defineMetadata("custom:annotation", options, target);
233
+ * }
234
+ *
235
+ */
236
+ function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void;
237
+ /**
238
+ * Define a unique metadata entry on the target.
239
+ * @param metadataKey A key used to store and retrieve metadata.
240
+ * @param metadataValue A value that contains attached metadata.
241
+ * @param target The target object on which to define metadata.
242
+ * @param propertyKey The property key for the target.
243
+ * @example
244
+ *
245
+ * class Example {
246
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
247
+ * // static staticProperty;
248
+ * // property;
249
+ *
250
+ * static staticMethod(p) { }
251
+ * method(p) { }
252
+ * }
253
+ *
254
+ * // property (on constructor)
255
+ * Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
256
+ *
257
+ * // property (on prototype)
258
+ * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
259
+ *
260
+ * // method (on constructor)
261
+ * Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
262
+ *
263
+ * // method (on prototype)
264
+ * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
265
+ *
266
+ * // decorator factory as metadata-producing annotation.
267
+ * function MyAnnotation(options): PropertyDecorator {
268
+ * return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
269
+ * }
270
+ *
271
+ */
272
+ function defineMetadata(metadataKey: any, metadataValue: any, target: Object, propertyKey: string | symbol): void;
273
+ /**
274
+ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
275
+ * @param metadataKey A key used to store and retrieve metadata.
276
+ * @param target The target object on which the metadata is defined.
277
+ * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
278
+ * @example
279
+ *
280
+ * class Example {
281
+ * }
282
+ *
283
+ * // constructor
284
+ * result = Reflect.hasMetadata("custom:annotation", Example);
285
+ *
286
+ */
287
+ function hasMetadata(metadataKey: any, target: Object): boolean;
288
+ /**
289
+ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
290
+ * @param metadataKey A key used to store and retrieve metadata.
291
+ * @param target The target object on which the metadata is defined.
292
+ * @param propertyKey The property key for the target.
293
+ * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
294
+ * @example
295
+ *
296
+ * class Example {
297
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
298
+ * // static staticProperty;
299
+ * // property;
300
+ *
301
+ * static staticMethod(p) { }
302
+ * method(p) { }
303
+ * }
304
+ *
305
+ * // property (on constructor)
306
+ * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
307
+ *
308
+ * // property (on prototype)
309
+ * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
310
+ *
311
+ * // method (on constructor)
312
+ * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
313
+ *
314
+ * // method (on prototype)
315
+ * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
316
+ *
317
+ */
318
+ function hasMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
319
+ /**
320
+ * Gets a value indicating whether the target object has the provided metadata key defined.
321
+ * @param metadataKey A key used to store and retrieve metadata.
322
+ * @param target The target object on which the metadata is defined.
323
+ * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
324
+ * @example
325
+ *
326
+ * class Example {
327
+ * }
328
+ *
329
+ * // constructor
330
+ * result = Reflect.hasOwnMetadata("custom:annotation", Example);
331
+ *
332
+ */
333
+ function hasOwnMetadata(metadataKey: any, target: Object): boolean;
334
+ /**
335
+ * Gets a value indicating whether the target object has the provided metadata key defined.
336
+ * @param metadataKey A key used to store and retrieve metadata.
337
+ * @param target The target object on which the metadata is defined.
338
+ * @param propertyKey The property key for the target.
339
+ * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
340
+ * @example
341
+ *
342
+ * class Example {
343
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
344
+ * // static staticProperty;
345
+ * // property;
346
+ *
347
+ * static staticMethod(p) { }
348
+ * method(p) { }
349
+ * }
350
+ *
351
+ * // property (on constructor)
352
+ * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
353
+ *
354
+ * // property (on prototype)
355
+ * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
356
+ *
357
+ * // method (on constructor)
358
+ * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
359
+ *
360
+ * // method (on prototype)
361
+ * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
362
+ *
363
+ */
364
+ function hasOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
365
+ /**
366
+ * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
367
+ * @param metadataKey A key used to store and retrieve metadata.
368
+ * @param target The target object on which the metadata is defined.
369
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
370
+ * @example
371
+ *
372
+ * class Example {
373
+ * }
374
+ *
375
+ * // constructor
376
+ * result = Reflect.getMetadata("custom:annotation", Example);
377
+ *
378
+ */
379
+ function getMetadata(metadataKey: any, target: Object): any;
380
+ /**
381
+ * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
382
+ * @param metadataKey A key used to store and retrieve metadata.
383
+ * @param target The target object on which the metadata is defined.
384
+ * @param propertyKey The property key for the target.
385
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
386
+ * @example
387
+ *
388
+ * class Example {
389
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
390
+ * // static staticProperty;
391
+ * // property;
392
+ *
393
+ * static staticMethod(p) { }
394
+ * method(p) { }
395
+ * }
396
+ *
397
+ * // property (on constructor)
398
+ * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
399
+ *
400
+ * // property (on prototype)
401
+ * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
402
+ *
403
+ * // method (on constructor)
404
+ * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
405
+ *
406
+ * // method (on prototype)
407
+ * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
408
+ *
409
+ */
410
+ function getMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
411
+ /**
412
+ * Gets the metadata value for the provided metadata key on the target object.
413
+ * @param metadataKey A key used to store and retrieve metadata.
414
+ * @param target The target object on which the metadata is defined.
415
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
416
+ * @example
417
+ *
418
+ * class Example {
419
+ * }
420
+ *
421
+ * // constructor
422
+ * result = Reflect.getOwnMetadata("custom:annotation", Example);
423
+ *
424
+ */
425
+ function getOwnMetadata(metadataKey: any, target: Object): any;
426
+ /**
427
+ * Gets the metadata value for the provided metadata key on the target object.
428
+ * @param metadataKey A key used to store and retrieve metadata.
429
+ * @param target The target object on which the metadata is defined.
430
+ * @param propertyKey The property key for the target.
431
+ * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
432
+ * @example
433
+ *
434
+ * class Example {
435
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
436
+ * // static staticProperty;
437
+ * // property;
438
+ *
439
+ * static staticMethod(p) { }
440
+ * method(p) { }
441
+ * }
442
+ *
443
+ * // property (on constructor)
444
+ * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
445
+ *
446
+ * // property (on prototype)
447
+ * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
448
+ *
449
+ * // method (on constructor)
450
+ * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
451
+ *
452
+ * // method (on prototype)
453
+ * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
454
+ *
455
+ */
456
+ function getOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
457
+ /**
458
+ * Gets the metadata keys defined on the target object or its prototype chain.
459
+ * @param target The target object on which the metadata is defined.
460
+ * @returns An array of unique metadata keys.
461
+ * @example
462
+ *
463
+ * class Example {
464
+ * }
465
+ *
466
+ * // constructor
467
+ * result = Reflect.getMetadataKeys(Example);
468
+ *
469
+ */
470
+ function getMetadataKeys(target: Object): any[];
471
+ /**
472
+ * Gets the metadata keys defined on the target object or its prototype chain.
473
+ * @param target The target object on which the metadata is defined.
474
+ * @param propertyKey The property key for the target.
475
+ * @returns An array of unique metadata keys.
476
+ * @example
477
+ *
478
+ * class Example {
479
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
480
+ * // static staticProperty;
481
+ * // property;
482
+ *
483
+ * static staticMethod(p) { }
484
+ * method(p) { }
485
+ * }
486
+ *
487
+ * // property (on constructor)
488
+ * result = Reflect.getMetadataKeys(Example, "staticProperty");
489
+ *
490
+ * // property (on prototype)
491
+ * result = Reflect.getMetadataKeys(Example.prototype, "property");
492
+ *
493
+ * // method (on constructor)
494
+ * result = Reflect.getMetadataKeys(Example, "staticMethod");
495
+ *
496
+ * // method (on prototype)
497
+ * result = Reflect.getMetadataKeys(Example.prototype, "method");
498
+ *
499
+ */
500
+ function getMetadataKeys(target: Object, propertyKey: string | symbol): any[];
501
+ /**
502
+ * Gets the unique metadata keys defined on the target object.
503
+ * @param target The target object on which the metadata is defined.
504
+ * @returns An array of unique metadata keys.
505
+ * @example
506
+ *
507
+ * class Example {
508
+ * }
509
+ *
510
+ * // constructor
511
+ * result = Reflect.getOwnMetadataKeys(Example);
512
+ *
513
+ */
514
+ function getOwnMetadataKeys(target: Object): any[];
515
+ /**
516
+ * Gets the unique metadata keys defined on the target object.
517
+ * @param target The target object on which the metadata is defined.
518
+ * @param propertyKey The property key for the target.
519
+ * @returns An array of unique metadata keys.
520
+ * @example
521
+ *
522
+ * class Example {
523
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
524
+ * // static staticProperty;
525
+ * // property;
526
+ *
527
+ * static staticMethod(p) { }
528
+ * method(p) { }
529
+ * }
530
+ *
531
+ * // property (on constructor)
532
+ * result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
533
+ *
534
+ * // property (on prototype)
535
+ * result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
536
+ *
537
+ * // method (on constructor)
538
+ * result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
539
+ *
540
+ * // method (on prototype)
541
+ * result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
542
+ *
543
+ */
544
+ function getOwnMetadataKeys(target: Object, propertyKey: string | symbol): any[];
545
+ /**
546
+ * Deletes the metadata entry from the target object with the provided key.
547
+ * @param metadataKey A key used to store and retrieve metadata.
548
+ * @param target The target object on which the metadata is defined.
549
+ * @returns `true` if the metadata entry was found and deleted; otherwise, false.
550
+ * @example
551
+ *
552
+ * class Example {
553
+ * }
554
+ *
555
+ * // constructor
556
+ * result = Reflect.deleteMetadata("custom:annotation", Example);
557
+ *
558
+ */
559
+ function deleteMetadata(metadataKey: any, target: Object): boolean;
560
+ /**
561
+ * Deletes the metadata entry from the target object with the provided key.
562
+ * @param metadataKey A key used to store and retrieve metadata.
563
+ * @param target The target object on which the metadata is defined.
564
+ * @param propertyKey The property key for the target.
565
+ * @returns `true` if the metadata entry was found and deleted; otherwise, false.
566
+ * @example
567
+ *
568
+ * class Example {
569
+ * // property declarations are not part of ES6, though they are valid in TypeScript:
570
+ * // static staticProperty;
571
+ * // property;
572
+ *
573
+ * static staticMethod(p) { }
574
+ * method(p) { }
575
+ * }
576
+ *
577
+ * // property (on constructor)
578
+ * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
579
+ *
580
+ * // property (on prototype)
581
+ * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
582
+ *
583
+ * // method (on constructor)
584
+ * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
585
+ *
586
+ * // method (on prototype)
587
+ * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
588
+ *
589
+ */
590
+ function deleteMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
591
+ }
592
+ }
593
+
594
+ type UserSelfUpdate = {
595
+ password: string;
596
+ };
597
+
598
+ declare function initialize(options: ApikeyInitialization | IdentityInitialization | UserInitialization | PublicInitialization): void;
599
+ declare function verifyToken(token: string, headers?: object): Promise<unknown>;
600
+ declare function signIn(username: string, password: string, tokenLifeSpan?: number, headers?: object): Promise<UserSession>;
601
+ declare function signUp(user: UserCreate, headers?: object): Promise<UserGet>;
602
+ declare function get(id: string, headers?: object): Promise<UserGet>;
603
+ declare function updatePassword(id: string, user: UserSelfUpdate, headers?: object): Promise<UserGet>;
604
+ declare function refreshAccessToken(accessToken: string, headers?: object): Promise<string>;
605
+ declare function updateUsername(id: string, username: string, headers?: object): Promise<UserGet>;
606
+ declare function ban(id: string, bannedUntil: Date, headers?: object): Promise<UserGet>;
607
+ declare function deactivateUserTokens(id: string, deactivateJwtsBefore: Date, headers?: object): Promise<UserGet>;
608
+ declare function addEmail(id: string, value: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationStartResponse>;
609
+ declare function verifyEmail(id: string, code: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationCompleteResponse>;
610
+ declare function addPhoneNumber(id: string, value: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationStartResponse>;
611
+ declare function verifyPhoneNumber(id: string, code: string, strategy: VerificationStrategy, headers?: object): Promise<VerificationCompleteResponse>;
612
+ declare function requestPasswordReset(username: string, provider: Provider, headers?: object): Promise<PasswordResetStartResponse>;
613
+ declare function completePasswordReset(username: string, code: string, newPassword: string, provider: Provider, headers?: object): Promise<PasswordResetCompleteResponse>;
614
+ declare function passwordlessLogin(username: string, provider: Provider, headers?: object): Promise<PasswordlessLoginStartResponse>;
615
+ declare function completePasswordlessLogin(username: string, code: string, provider: Provider, headers?: object): Promise<UserSession>;
616
+
617
+ export { UserSession, addEmail, addPhoneNumber, ban, completePasswordReset, completePasswordlessLogin, deactivateUserTokens, get, initialize, passwordlessLogin, refreshAccessToken, requestPasswordReset, signIn, signUp, updatePassword, updateUsername, verifyEmail, verifyPhoneNumber, verifyToken };
618
+ export type { PasswordResetCompleteResponse, PasswordResetStartResponse, PasswordlessLoginCompleteResponse, PasswordlessLoginStartResponse, Provider, TokenScheme, UserCreate, UserGet, UserUpdate, VerificationCompleteResponse, VerificationStartResponse, VerificationStrategy, VerifiedToken };