types/auth0: Add rules config types (#43230)

* types/auth0: Add rules config types

* types/auth0: Fix trailing whitespaces
This commit is contained in:
lil.sad 2020-03-23 16:27:29 +01:00 committed by GitHub
parent 0ae7aa751a
commit 1168acc915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

View File

@ -569,3 +569,13 @@ management.unblockUserByIdentifier({ identifier: 'email' }, (err, response) => {
}
console.log(response);
});
// Rules configurations
management.setRulesConfig({key: 'test'}, {value: 'test'}).then((config) => console.log(config));
management.setRulesConfig({key: 'test'}, {value: 'test'}, (err, config) => console.log(config));
management.deleteRulesConfig({key: 'test'}).then(() => {});
management.deleteRulesConfig({key: 'test'}, (err) => {});
management.getRulesConfigs().then((configs) => console.log(configs));
management.getRulesConfigs((err, configs) => console.log(configs));

View File

@ -118,6 +118,20 @@ export interface Rule {
order?: number;
}
export interface RulesConfig {
/**
* Key for a rules config variable.
*/
key: string;
}
export interface RulesConfigData {
/**
* Value for a rules config variable.
*/
value: string
}
export interface Role {
id?: string;
name?: string;
@ -961,6 +975,16 @@ export class ManagementClient<A=AppMetadata, U=UserMetadata> {
deleteRule(params: ObjectWithId): Promise<void>;
deleteRule(params: ObjectWithId, cb: (err: Error) => void): void;
// Rules Configurations
getRulesConfigs(): Promise<RulesConfig[]>;
getRulesConfigs(cb: (err: Error, rulesConfigs: RulesConfig[]) => void): void;
setRulesConfig(params: RulesConfig, data: RulesConfigData): Promise<RulesConfig & RulesConfigData>;
setRulesConfig(params: RulesConfig, data: RulesConfigData,
cb: (err: Error, rulesConfig: RulesConfig & RulesConfigData) => void):void;
deleteRulesConfig(params: RulesConfig): Promise<void>;
deleteRulesConfig(params: RulesConfig, cb: (err: Error) => void): void;
// Users
getUsers(params: GetUsersDataPaged): Promise<UserPage<A, U>>;