Skip to content

Commit

Permalink
update group struct with roles and actions
Browse files Browse the repository at this point in the history
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
  • Loading branch information
ianmuchyri committed Dec 2, 2024
1 parent e3fc611 commit 5a65dfc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const mySdk = new SDK({
usersUrl: `${defaultUrl}:9002`,
});

const token = "token";
const token = "<token>";
const domainId = "<domainId>";

mySdk.domains
Expand Down
33 changes: 12 additions & 21 deletions src/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface UserBasicInfo {

export interface User extends UserBasicInfo {
role?: string;
permissions?: string[];
tags?: string[];
metadata?: Record<string, any>;
created_at?: Date;
Expand Down Expand Up @@ -50,7 +49,6 @@ export interface Client extends ClientBasicInfo {
created_at?: Date;
updated_at?: Date;
updated_by?: string | UserBasicInfo;
permissions?: string[];
identity?: string;
}

Expand All @@ -71,15 +69,21 @@ export interface GroupBasicInfo {
export interface Group extends GroupBasicInfo {
domain_id?: string | DomainBasicInfo;
parent_id?: string | GroupBasicInfo;
name?: string;
metadata?: Record<string, any>;
level?: number;
path?: string;
children?: Group[];
created_at?: Date;
updated_at?: Date;
updated_by?: string | UserBasicInfo;
permissions?: string[];
role_id?: string;
role_name?: string;
actions?: string[];
access_type?: string;
access_provider_id?: string;
access_provider_role_id?: string;
access_provider_role_name?: string;
access_provider_role_actions?: string;
}

export interface GroupsPage {
Expand Down Expand Up @@ -115,7 +119,6 @@ export interface Channel extends ChannelBasicInfo {
created_at?: Date;
updated_at?: Date;
updated_by?: string;
permissions?: string[];
}

export interface ChannelsPage {
Expand Down Expand Up @@ -147,7 +150,6 @@ export interface Domain extends DomainBasicInfo {
tags?: string[];
metadata?: Record<string, any>;
permission?: string;
permissions?: string[];
created_by?: string | UserBasicInfo;
updated_by?: string | UserBasicInfo;
created_at?: Date;
Expand All @@ -169,7 +171,6 @@ export interface Invitation {
invited_by?: string | UserBasicInfo;
user_id?: string | UserBasicInfo;
domain_id?: string | DomainBasicInfo;
relation?: Relation;
token?: string;
created_at?: Date;
updated_at?: Date;
Expand All @@ -189,19 +190,6 @@ export interface Response {
message?: string;
}

export type Relation =
| "administrator"
| "editor"
| "contributor"
| "member"
| "guest";

export type GroupRelation =
| "administrator"
| "editor"
| "contributor"
| "guest";

export type Status = "enabled" | "disabled";

export interface BasicPageMeta {
Expand All @@ -227,7 +215,6 @@ export interface PageMetadata extends BasicPageMeta {
action?: string;
subject?: string;
object?: string;
permission?: string;
tag?: string;
id?: string;
tree?: boolean;
Expand All @@ -245,6 +232,10 @@ export interface PageMetadata extends BasicPageMeta {
relation?: string;
from?: number;
to?: number;
access_type?: string;
actions?: string[];
role_id?: string;
role_name?: string;
}

export interface MessagesPage {
Expand Down
2 changes: 0 additions & 2 deletions src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export type {
CertsPage,
Invitation,
InvitationsPage,
Relation,
GroupRelation,
UserCredentials,
ClientCredentials,
UserBasicInfo,
Expand Down

0 comments on commit 5a65dfc

Please sign in to comment.