forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth0.d.ts
95 lines (80 loc) · 2.33 KB
/
auth0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Type definitions for auth0 v2.3.1
// Project: https://github.com/auth0/node-auth0
// Definitions by: Seth Westphal <https://github.com/westy92>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
declare module "auth0" {
import * as Promise from 'bluebird';
export interface ManagementClientOptions {
token: string;
domain?: string;
}
export interface UserData {
connection: string;
email?: string;
username?: string;
password?: string;
phone_number?: string;
user_metadata?: {};
email_verified?: boolean;
app_metadata?: {};
}
export interface GetUsersData {
per_page?: number;
page?: number;
include_totals?: boolean;
sort?: string;
connection?: string;
fields?: string;
include_fields?: boolean;
q?: string;
search_engine?: string;
}
export interface User {
email?: string;
email_verified?: boolean;
username?: string;
phone_number?: string;
phone_verified?: boolean;
user_id?: string;
created_at?: string;
updated_at?: string;
identities?: Identity[];
app_metadata?: {};
user_metadata?: {};
picture?: string;
name?: string;
nickname?: string;
multifactor?: string[];
last_ip?: string;
last_login?: string;
logins_count?: number;
blocked?: boolean;
}
export interface Identity {
connection: string;
user_id: string;
provider: string;
isSocial: boolean;
}
export class ManagementClient {
constructor(options: ManagementClientOptions);
getUsers(params?: GetUsersData): Promise<User[]>;
getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void;
createUser(data: UserData): Promise<User>;
createUser(data: UserData, cb: (err: Error, data: User) => void): void;
}
export interface AuthenticationClientOptions {
clientId?: string;
domain: string;
}
export interface RequestChangePasswordEmailData {
connection: string;
email: string;
}
export class AuthenticationClient {
constructor(options: AuthenticationClientOptions);
requestChangePasswordEmail(data: RequestChangePasswordEmailData): Promise<string>;
requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void;
}
}