@rebasepro/client 0.2.4 → 0.2.5
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.
- package/dist/admin.d.ts +1 -31
- package/dist/index.es.js +0 -28
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +0 -28
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/admin.ts +1 -41
package/dist/admin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transport } from "./transport";
|
|
1
|
+
import type { Transport } from "./transport";
|
|
2
2
|
export interface AdminUser {
|
|
3
3
|
uid: string;
|
|
4
4
|
email: string;
|
|
@@ -9,12 +9,6 @@ export interface AdminUser {
|
|
|
9
9
|
createdAt: string;
|
|
10
10
|
updatedAt: string;
|
|
11
11
|
}
|
|
12
|
-
export interface RebaseRole {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
isAdmin: boolean;
|
|
16
|
-
defaultPermissions: Record<string, unknown> | null;
|
|
17
|
-
}
|
|
18
12
|
export interface CreateAdminOptions {
|
|
19
13
|
adminPath?: string;
|
|
20
14
|
}
|
|
@@ -56,30 +50,6 @@ export declare function createAdmin(transport: Transport, options?: CreateAdminO
|
|
|
56
50
|
deleteUser: (userId: string) => Promise<{
|
|
57
51
|
success: boolean;
|
|
58
52
|
}>;
|
|
59
|
-
listRoles: () => Promise<{
|
|
60
|
-
roles: RebaseRole[];
|
|
61
|
-
}>;
|
|
62
|
-
getRole: (roleId: string) => Promise<{
|
|
63
|
-
role: RebaseRole;
|
|
64
|
-
}>;
|
|
65
|
-
createRole: (data: {
|
|
66
|
-
id: string;
|
|
67
|
-
name: string;
|
|
68
|
-
isAdmin?: boolean;
|
|
69
|
-
defaultPermissions?: Record<string, unknown>;
|
|
70
|
-
}) => Promise<{
|
|
71
|
-
role: RebaseRole;
|
|
72
|
-
}>;
|
|
73
|
-
updateRole: (roleId: string, data: {
|
|
74
|
-
name?: string;
|
|
75
|
-
isAdmin?: boolean;
|
|
76
|
-
defaultPermissions?: Record<string, unknown>;
|
|
77
|
-
}) => Promise<{
|
|
78
|
-
role: RebaseRole;
|
|
79
|
-
}>;
|
|
80
|
-
deleteRole: (roleId: string) => Promise<{
|
|
81
|
-
success: boolean;
|
|
82
|
-
}>;
|
|
83
53
|
bootstrap: () => Promise<{
|
|
84
54
|
success: boolean;
|
|
85
55
|
message: string;
|
package/dist/index.es.js
CHANGED
|
@@ -742,29 +742,6 @@ function createAdmin(transport, options) {
|
|
|
742
742
|
method: "DELETE"
|
|
743
743
|
});
|
|
744
744
|
}
|
|
745
|
-
async function listRoles() {
|
|
746
|
-
return transport.request(adminPath + "/roles", { method: "GET" });
|
|
747
|
-
}
|
|
748
|
-
async function getRole(roleId) {
|
|
749
|
-
return transport.request(adminPath + "/roles/" + encodeURIComponent(roleId), { method: "GET" });
|
|
750
|
-
}
|
|
751
|
-
async function createRole(data) {
|
|
752
|
-
return transport.request(adminPath + "/roles", {
|
|
753
|
-
method: "POST",
|
|
754
|
-
body: JSON.stringify(data)
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
async function updateRole(roleId, data) {
|
|
758
|
-
return transport.request(adminPath + "/roles/" + encodeURIComponent(roleId), {
|
|
759
|
-
method: "PUT",
|
|
760
|
-
body: JSON.stringify(data)
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
async function deleteRole(roleId) {
|
|
764
|
-
return transport.request(adminPath + "/roles/" + encodeURIComponent(roleId), {
|
|
765
|
-
method: "DELETE"
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
745
|
async function bootstrap() {
|
|
769
746
|
return transport.request(adminPath + "/bootstrap", {
|
|
770
747
|
method: "POST"
|
|
@@ -777,11 +754,6 @@ function createAdmin(transport, options) {
|
|
|
777
754
|
createUser,
|
|
778
755
|
updateUser,
|
|
779
756
|
deleteUser,
|
|
780
|
-
listRoles,
|
|
781
|
-
getRole,
|
|
782
|
-
createRole,
|
|
783
|
-
updateRole,
|
|
784
|
-
deleteRole,
|
|
785
757
|
bootstrap
|
|
786
758
|
};
|
|
787
759
|
}
|