mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[auth0] added user blocks functions (#40774)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
4ed6d134ac
commit
df1ba4bfe8
@@ -517,3 +517,55 @@ management.getEmailTemplate({name: 'template_name'}).then(data => {console.log(d
|
||||
management.getEmailTemplate({name: 'template_name'}, (err, data) => {console.log(data)});
|
||||
management.updateEmailTemplate({name: 'template_name'}, {type:'type'}).then(data => {console.log(data)});
|
||||
management.updateEmailTemplate({name: 'template_name'}, {type:'type'}, (err, data) => {console.log(data)});
|
||||
|
||||
management.getUserBlocks({ id: 'user_id' })
|
||||
.then(response => {
|
||||
response.blocked_for.forEach(blockedFor => console.log(`${blockedFor.identifier}:${blockedFor.ip}`));
|
||||
})
|
||||
.catch(err => console.log('Error: ' + err));
|
||||
|
||||
management.getUserBlocks({ id: 'user_id' }, (err, response) => {
|
||||
if (err) {
|
||||
console.log('Error: ' + err);
|
||||
return;
|
||||
}
|
||||
response.blocked_for.forEach(blockedFor => console.log(`${blockedFor.identifier}:${blockedFor.ip}`));
|
||||
});
|
||||
|
||||
management.getUserBlocksByIdentifier({ identifier: 'email' })
|
||||
.then(response => {
|
||||
response.blocked_for.forEach(blockedFor => console.log(`${blockedFor.identifier}:${blockedFor.ip}`));
|
||||
})
|
||||
.catch(err => console.log('Error: ' + err));
|
||||
|
||||
management.getUserBlocksByIdentifier({ identifier: 'email' }, (err, response) => {
|
||||
if (err) {
|
||||
console.log('Error: ' + err);
|
||||
return;
|
||||
}
|
||||
response.blocked_for.forEach(blockedFor => console.log(`${blockedFor.identifier}:${blockedFor.ip}`));
|
||||
});
|
||||
|
||||
management.unblockUser({ id: 'user_id' })
|
||||
.then(response => console.log(response))
|
||||
.catch(err => console.log('Error: ' + err));
|
||||
|
||||
management.unblockUser({ id: 'user_id' }, (err, response) => {
|
||||
if (err) {
|
||||
console.log('Error: ' + err);
|
||||
return;
|
||||
}
|
||||
console.log(response);
|
||||
});
|
||||
|
||||
management.unblockUserByIdentifier({ identifier: 'email' })
|
||||
.then(response => console.log(response))
|
||||
.catch(err => console.log('Error: ' + err));
|
||||
|
||||
management.unblockUserByIdentifier({ identifier: 'email' }, (err, response) => {
|
||||
if (err) {
|
||||
console.log('Error: ' + err);
|
||||
return;
|
||||
}
|
||||
console.log(response);
|
||||
});
|
||||
|
||||
Vendored
+26
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for auth0 2.9.4
|
||||
// Type definitions for auth0 2.20.0
|
||||
// Project: https://github.com/auth0/node-auth0
|
||||
// Definitions by: Seth Westphal <https://github.com/westy92>
|
||||
// Ian Howe <https://github.com/ianhowe76>
|
||||
@@ -6,6 +6,7 @@
|
||||
// Dan Rumney <https://github.com/dancrumb>
|
||||
// Peter <https://github.com/pwrnrd>
|
||||
// Anthony Messerschmidt <https://github.com/CatGuardian>
|
||||
// Johannes Schneider <https://github.com/neshanjo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -782,6 +783,20 @@ export interface GetClientsOptions {
|
||||
app_type?: ClientAppType[];
|
||||
}
|
||||
|
||||
export interface ObjectWithIdentifier {
|
||||
identifier: string;
|
||||
}
|
||||
|
||||
export interface BlockedForEntry {
|
||||
identifier: string;
|
||||
ip?: string;
|
||||
}
|
||||
|
||||
export interface UserBlocks {
|
||||
blocked_for: BlockedForEntry[];
|
||||
}
|
||||
|
||||
|
||||
export class AuthenticationClient {
|
||||
|
||||
// Members
|
||||
@@ -1017,6 +1032,16 @@ export class ManagementClient<A=AppMetadata, U=UserMetadata> {
|
||||
assignPermissionsToUser(params: ObjectWithId, data: PermissionsData): Promise<void>;
|
||||
assignPermissionsToUser(params: ObjectWithId, data: PermissionsData, cb: (err: Error) => void): void;
|
||||
|
||||
// User Blocks
|
||||
getUserBlocks(params: ObjectWithId): Promise<UserBlocks>;
|
||||
getUserBlocks(params: ObjectWithId, cb: (err: Error, response: UserBlocks) => void): void;
|
||||
getUserBlocksByIdentifier(params: ObjectWithIdentifier): Promise<UserBlocks>;
|
||||
getUserBlocksByIdentifier(params: ObjectWithIdentifier, cb: (err: Error, response: UserBlocks) => void): void;
|
||||
unblockUser(params: ObjectWithId): Promise<string>;
|
||||
unblockUser(params: ObjectWithId, cb: (err: Error, response: string) => void): void;
|
||||
unblockUserByIdentifier(params: ObjectWithIdentifier): Promise<string>;
|
||||
unblockUserByIdentifier(params: ObjectWithIdentifier, cb: (err: Error, response: string) => void): void;
|
||||
|
||||
// Tokens
|
||||
getBlacklistedTokens(): Promise<any>;
|
||||
getBlacklistedTokens(cb?: (err: Error, data: any) => void): void;
|
||||
|
||||
Reference in New Issue
Block a user