@plusauth/plusauth-rest-js
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -46,3 +46,3 @@ /** | ||
*/ | ||
create(api: Omit<IApi, 'system'>): Promise<IApi>; | ||
create(api: IBaseApi): Promise<IApi>; | ||
/** | ||
@@ -67,3 +67,3 @@ * Update an existing API. | ||
*/ | ||
update(apiId: string, api: Partial<Omit<IApi, 'system' | 'audience'>>): Promise<void>; | ||
update(apiId: string, api: Partial<Omit<IBaseApi, 'audience'>>): Promise<IApi>; | ||
/** | ||
@@ -112,3 +112,3 @@ * Remove an existing API | ||
*/ | ||
createPermission(apiId: string, permission: Omit<IPermission, 'id'>): Promise<IPermission>; | ||
createPermission(apiId: string, permission: IBasePermission): Promise<IPermission>; | ||
/** | ||
@@ -225,9 +225,2 @@ * Delete an existing permission from the API | ||
*/ | ||
export declare interface BaseModel { | ||
id: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
declare type BodyType = Record<string, any> | string; | ||
@@ -505,2 +498,30 @@ | ||
*/ | ||
declare interface HasApi { | ||
readonly api_id: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
declare interface HasId { | ||
readonly id: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
declare interface HasTenant { | ||
readonly tenant_id: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
declare interface HasUser { | ||
readonly user_id: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare type HookPackage = { | ||
@@ -674,8 +695,5 @@ name: string; | ||
*/ | ||
export declare interface IApi { | ||
name: string; | ||
description?: string; | ||
readonly audience?: string; | ||
readonly system?: boolean; | ||
} | ||
export declare type IApi = IBaseApi & HasId & HasTenant & Timestamped & { | ||
readonly system: boolean; | ||
}; | ||
@@ -693,2 +711,79 @@ /** | ||
*/ | ||
export declare interface IBaseApi { | ||
name: string; | ||
description?: string; | ||
readonly audience: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare interface IBasePermission { | ||
name: string; | ||
description?: string; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare interface IBaseRole { | ||
name: string; | ||
description?: string; | ||
assignOnSignup?: boolean; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare interface IBaseRoleGroup { | ||
name: string; | ||
description?: string; | ||
assignOnSignup?: boolean; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare interface IBaseUser { | ||
username?: string; | ||
password?: string; | ||
blocked?: boolean; | ||
user_details?: IBaseUserDetails; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare interface IBaseUserDetails { | ||
name?: string; | ||
given_name?: string; | ||
family_name?: string; | ||
middle_name?: string; | ||
nickname?: string; | ||
preferred_username?: string; | ||
profile?: string; | ||
picture?: string; | ||
website?: string; | ||
email?: string; | ||
email_verified?: boolean; | ||
gender?: string; | ||
birthdate?: string; | ||
zoneinfo?: string; | ||
locale?: string; | ||
phone_number?: string; | ||
phone_verified?: boolean; | ||
address?: { | ||
formatted?: string; | ||
street_address?: string; | ||
locality?: string; | ||
region?: string; | ||
postal_code?: number; | ||
country?: string; | ||
}; | ||
metadata?: Record<string, string | number | boolean>; | ||
} | ||
/** | ||
* @public | ||
*/ | ||
export declare interface IClient { | ||
@@ -784,8 +879,3 @@ client_name: string; | ||
*/ | ||
export declare interface IPermission { | ||
id: string; | ||
api_id: string; | ||
name: string; | ||
description?: string; | ||
} | ||
export declare type IPermission = IBasePermission & HasId & HasApi; | ||
@@ -810,8 +900,3 @@ /** | ||
*/ | ||
export declare interface IRole { | ||
id: string; | ||
name: string; | ||
description?: string; | ||
assignOnSignup?: boolean; | ||
} | ||
export declare type IRole = IBaseRole & HasId & HasTenant & Timestamped; | ||
@@ -821,8 +906,3 @@ /** | ||
*/ | ||
export declare interface IRoleGroup { | ||
id: string; | ||
name: string; | ||
description?: string; | ||
assignOnSignup?: boolean; | ||
} | ||
export declare type IRoleGroup = IBaseRoleGroup & HasId & HasTenant & Timestamped; | ||
@@ -944,11 +1024,8 @@ /** | ||
*/ | ||
export declare interface IUser { | ||
readonly id: string; | ||
salt?: string; | ||
export declare type IUser = IBaseUser & HasId & HasTenant & Timestamped & { | ||
user_details: IUserDetails; | ||
} & { | ||
salt: string; | ||
func: number; | ||
username?: string; | ||
password?: string; | ||
blocked?: boolean; | ||
user_details?: IUserDetails; | ||
} | ||
}; | ||
@@ -958,31 +1035,3 @@ /** | ||
*/ | ||
export declare interface IUserDetails extends BaseModel { | ||
user_id?: string; | ||
name?: string; | ||
given_name?: string; | ||
family_name?: string; | ||
middle_name?: string; | ||
nickname?: string; | ||
preferred_username?: string; | ||
profile?: string; | ||
picture?: string; | ||
website?: string; | ||
email?: string; | ||
email_verified?: boolean; | ||
gender?: string; | ||
birthdate?: string; | ||
zoneinfo?: string; | ||
locale?: string; | ||
phone_number?: string; | ||
phone_verified?: boolean; | ||
address?: { | ||
formatted: string; | ||
street_address: string; | ||
locality: string; | ||
region: string; | ||
postal_code: number; | ||
country: string; | ||
}; | ||
metadata?: Record<string, string | number>; | ||
} | ||
export declare type IUserDetails = IBaseUserDetails & HasUser; | ||
@@ -1189,12 +1238,2 @@ /** | ||
/** Deeply omit members of an interface or type, making all members optional. */ | ||
declare type PartialDeepOmit<T, K> = T extends Primitive ? T : Partial<{ | ||
[P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends Primitive ? TP : TP extends any[] ? PartialDeepOmitArray<TP, K> : PartialDeepOmit<TP, K> : never; | ||
}>; | ||
/** Deeply omit members of an array of interface or array of type, making all members optional. */ | ||
declare type PartialDeepOmitArray<T extends any[], K> = Partial<{ | ||
[P in Partial<keyof T>]: Partial<PartialDeepOmit<T[P], K>>; | ||
}>; | ||
/** | ||
@@ -1268,5 +1307,2 @@ * | ||
/** Union of primitives to skip with deep omit utilities. */ | ||
declare type Primitive = string | Function | number | boolean | Symbol | undefined | null; | ||
/** | ||
@@ -1317,3 +1353,3 @@ * Service for interacting PlusAuth roleGroups. | ||
*/ | ||
create(roleGroupObject: Omit<IRoleGroup, 'id'>): Promise<IRoleGroup>; | ||
create(roleGroupObject: IBaseRoleGroup): Promise<IRoleGroup>; | ||
/** | ||
@@ -1329,3 +1365,3 @@ * Update an existing role group | ||
*/ | ||
update(roleGroupId: string, roleGroup: Partial<Omit<IRoleGroup, 'id'>>): Promise<void>; | ||
update(roleGroupId: string, roleGroup: Partial<IBaseRoleGroup>): Promise<IRoleGroup>; | ||
/** | ||
@@ -1438,3 +1474,3 @@ * Remove an existing role group | ||
*/ | ||
create(role: Omit<IRole, 'id'>): Promise<IRole>; | ||
create(role: IBaseRole): Promise<IRole>; | ||
/** | ||
@@ -1450,3 +1486,3 @@ * Update an existing role | ||
*/ | ||
update(roleId: string, role: Partial<Omit<IRole, 'id'>>): Promise<void>; | ||
update(roleId: string, role: Partial<IBaseRole>): Promise<IRole>; | ||
/** | ||
@@ -1773,2 +1809,10 @@ * Remove an existing role | ||
/** | ||
* @public | ||
*/ | ||
declare interface Timestamped { | ||
readonly created_at: string; | ||
readonly updated_at: string; | ||
} | ||
/** | ||
* Service for interacting PlusAuth users. | ||
@@ -1782,15 +1826,15 @@ * | ||
get(userId: string): Promise<IUser>; | ||
create(userObject: PartialDeepOmit<IUser, 'id' | 'user_id'>): Promise<IUser>; | ||
create(userObject: IBaseUser): Promise<IUser>; | ||
remove(userId: string): Promise<void>; | ||
update(userId: string, user: PartialDeepOmit<IUser, 'id' | 'user_id'>): Promise<IUser>; | ||
update(userId: string, user: IBaseUser): Promise<IUser>; | ||
getSessions(userId: string): Promise<IUserSession[]>; | ||
endSession(userId: string, sessionId: string): Promise<void>; | ||
getTenants(userId: string): Promise<ITenant>; | ||
getRoleGroups(userId: string): Promise<IRoleGroup>; | ||
getRoleGroups(userId: string): Promise<PaginatedResult<IRoleGroup>>; | ||
assignRoleGroups(userId: string, roleGroupIDs: string[]): Promise<void>; | ||
unAssignRoleGroups(userId: string, roleGroupIDs: string[]): Promise<void>; | ||
getRoles(userId: string): Promise<IRole>; | ||
getRoles(userId: string): Promise<PaginatedResult<IRole>>; | ||
assignRoles(userId: string, roleIDs: string[]): Promise<void>; | ||
unAssignRoles(userId: string, roleIDs: string[]): Promise<void>; | ||
getPermissions(userId: string): Promise<IPermission>; | ||
getPermissions(userId: string): Promise<PaginatedResult<IPermission>>; | ||
assignPermissions(userId: string, permissionIDs: string[]): Promise<void>; | ||
@@ -1797,0 +1841,0 @@ unAssignPermissions(userId: string, permissionIDs: string[]): Promise<void>; |
{ | ||
"name": "@plusauth/plusauth-rest-js", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "PlusAuth JavaScript Rest Client", | ||
@@ -5,0 +5,0 @@ "main": "dist/plusauth-rest-js.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
402215
11008