@staticbackend/backend 1.5.0-alpha.0 → 1.5.0-alpha.3
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/backend.d.ts +12 -0
- package/dist/backend.js +16 -0
- package/package.json +1 -1
package/dist/backend.d.ts
CHANGED
|
@@ -61,6 +61,18 @@ export declare class Backend {
|
|
|
61
61
|
ok: boolean;
|
|
62
62
|
content: any;
|
|
63
63
|
}>;
|
|
64
|
+
addUser(token: string, email: string, password: string): Promise<{
|
|
65
|
+
ok: boolean;
|
|
66
|
+
content: any;
|
|
67
|
+
}>;
|
|
68
|
+
removeUser(token: string, userId: string): Promise<{
|
|
69
|
+
ok: boolean;
|
|
70
|
+
content: any;
|
|
71
|
+
}>;
|
|
72
|
+
users(token: string): Promise<{
|
|
73
|
+
ok: boolean;
|
|
74
|
+
content: any;
|
|
75
|
+
}>;
|
|
64
76
|
cacheGet(rootToken: string, key: string): Promise<{
|
|
65
77
|
ok: boolean;
|
|
66
78
|
content: any;
|
package/dist/backend.js
CHANGED
|
@@ -108,6 +108,22 @@ class Backend {
|
|
|
108
108
|
return yield this.req(token, "GET", "/me");
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
+
addUser(token, email, password) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const body = { email: email, password: password };
|
|
114
|
+
return yield this.req(token, "POST", "/account/users", body);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
removeUser(token, userId) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
return yield this.req(token, "DELETE", `/account/users/${userId}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
users(token) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
return yield this.req(token, "GET", "/account/users");
|
|
125
|
+
});
|
|
126
|
+
}
|
|
111
127
|
cacheGet(rootToken, key) {
|
|
112
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
129
|
return yield this.req(rootToken, "GET", `/sudo/cache?key=${key}`);
|