@tblabs/storage 5.7.0 → 5.7.1
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/DatabaseInfo.d.ts +5 -0
- package/DatabaseInfo.js +1 -0
- package/OnlineStorage.d.ts +2 -5
- package/OnlineStorage.js +9 -0
- package/package.json +1 -1
- package/tblabs-storage-5.7.1.tgz +0 -0
- package/tblabs-storage-5.7.0.tgz +0 -0
package/DatabaseInfo.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/OnlineStorage.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Dataset } from "./Dataset";
|
|
|
7
7
|
import { IStorageUser } from "./IStorageUser";
|
|
8
8
|
import { IConverter } from "./IConverter";
|
|
9
9
|
import { IStorageUserPrivileges } from "./IStorageUserPrivileges";
|
|
10
|
+
import { DatabaseInfo } from "./DatabaseInfo";
|
|
10
11
|
export declare class OnlineStorage {
|
|
11
12
|
private server;
|
|
12
13
|
private database;
|
|
@@ -57,9 +58,5 @@ export declare class OnlineStorage {
|
|
|
57
58
|
ListDatabases(): Promise<DatabaseInfo[]>;
|
|
58
59
|
CreateDatabase(databaseDir: string): Promise<void>;
|
|
59
60
|
DeleteDatabase(databaseDir: string): Promise<void>;
|
|
60
|
-
|
|
61
|
-
export interface DatabaseInfo {
|
|
62
|
-
Dir: string;
|
|
63
|
-
DatasetsCount: number;
|
|
64
|
-
UsersCount: number;
|
|
61
|
+
CanUser(action: keyof IStorageUserPrivileges): boolean;
|
|
65
62
|
}
|
package/OnlineStorage.js
CHANGED
|
@@ -290,4 +290,13 @@ export class OnlineStorage {
|
|
|
290
290
|
throw new Error(`Could not delete database: ${result.ErrorMessage}`);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
+
CanUser(action) {
|
|
294
|
+
if (!this.User.Privileges) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
if (typeof this.User.Privileges[action] === "boolean" && this.User.Privileges[action]) {
|
|
298
|
+
return !!this.User.Privileges[action];
|
|
299
|
+
}
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
293
302
|
}
|
package/package.json
CHANGED
|
Binary file
|
package/tblabs-storage-5.7.0.tgz
DELETED
|
Binary file
|