@machhub-dev/sdk-ts 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,4 +25,5 @@ export declare class Auth {
|
|
|
25
25
|
createGroup(name: string, features: Feature[]): Promise<Group>;
|
|
26
26
|
addUserToGroup(userId: string, groupId: string): Promise<ActionResponse>;
|
|
27
27
|
addPermissionsToGroup(group_id: string, permissions: Feature[]): Promise<ActionResponse>;
|
|
28
|
+
getPermissions(): Promise<Feature[]>;
|
|
28
29
|
}
|
package/dist/cjs/classes/auth.js
CHANGED
|
@@ -142,6 +142,10 @@ class Auth {
|
|
|
142
142
|
group_id, permissions
|
|
143
143
|
}).post("/auth/permission");
|
|
144
144
|
}
|
|
145
|
+
async getPermissions() {
|
|
146
|
+
const res = await this.httpService.request.get("/auth/permission");
|
|
147
|
+
return res.permissions ?? [];
|
|
148
|
+
}
|
|
145
149
|
}
|
|
146
150
|
exports.Auth = Auth;
|
|
147
151
|
// In-memory fallback for environments without localStorage (e.g. Node.js)
|
package/dist/classes/auth.d.ts
CHANGED
|
@@ -25,4 +25,5 @@ export declare class Auth {
|
|
|
25
25
|
createGroup(name: string, features: Feature[]): Promise<Group>;
|
|
26
26
|
addUserToGroup(userId: string, groupId: string): Promise<ActionResponse>;
|
|
27
27
|
addPermissionsToGroup(group_id: string, permissions: Feature[]): Promise<ActionResponse>;
|
|
28
|
+
getPermissions(): Promise<Feature[]>;
|
|
28
29
|
}
|
package/dist/classes/auth.js
CHANGED
|
@@ -139,6 +139,10 @@ export class Auth {
|
|
|
139
139
|
group_id, permissions
|
|
140
140
|
}).post("/auth/permission");
|
|
141
141
|
}
|
|
142
|
+
async getPermissions() {
|
|
143
|
+
const res = await this.httpService.request.get("/auth/permission");
|
|
144
|
+
return res.permissions ?? [];
|
|
145
|
+
}
|
|
142
146
|
}
|
|
143
147
|
// In-memory fallback for environments without localStorage (e.g. Node.js)
|
|
144
148
|
Auth.memoryStore = new Map();
|
package/package.json
CHANGED
package/src/classes/auth.ts
CHANGED
|
@@ -161,4 +161,9 @@ export class Auth {
|
|
|
161
161
|
group_id, permissions
|
|
162
162
|
}).post("/auth/permission");
|
|
163
163
|
}
|
|
164
|
+
|
|
165
|
+
public async getPermissions(): Promise<Feature[]> {
|
|
166
|
+
const res: {permissions: Feature[]} = await this.httpService.request.get("/auth/permission");
|
|
167
|
+
return res.permissions ?? [];
|
|
168
|
+
}
|
|
164
169
|
}
|