@tblabs/storage 5.5.2 → 5.6.0
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/IStorageUserPrivileges.d.ts +1 -0
- package/IStorageUserPrivileges.js +1 -0
- package/MessageBus/Message.d.ts +7 -2
- package/Messages/GetLogQuery.d.ts +5 -0
- package/Messages/GetLogQuery.js +6 -0
- package/Messages/GetLogsListQuery.d.ts +5 -0
- package/Messages/GetLogsListQuery.js +6 -0
- package/OnlineStorage.d.ts +2 -0
- package/OnlineStorage.js +16 -0
- package/package.json +2 -1
- package/tblabs-storage-5.6.0.tgz +0 -0
- package/tblabs-storage-5.5.2.tgz +0 -0
package/MessageBus/Message.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { dir } from "../Types/dir";
|
|
2
|
+
export interface MessageBody {
|
|
3
|
+
Database: dir;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
1
6
|
export declare class Message {
|
|
2
7
|
Name: string;
|
|
3
|
-
Body:
|
|
4
|
-
constructor(Name: string, Body:
|
|
8
|
+
Body: MessageBody;
|
|
9
|
+
constructor(Name: string, Body: MessageBody);
|
|
5
10
|
}
|
package/OnlineStorage.d.ts
CHANGED
|
@@ -52,4 +52,6 @@ export declare class OnlineStorage {
|
|
|
52
52
|
DatasetExists(datasetName: string): Promise<boolean>;
|
|
53
53
|
RemoveDataset(datasetName: string): Promise<void>;
|
|
54
54
|
Move(fileId: string, sourceDataset: Dataset<any>, targetDataset: Dataset<any>): Promise<void>;
|
|
55
|
+
GetLogsList(): Promise<string[]>;
|
|
56
|
+
GetLog(id: string): Promise<string>;
|
|
55
57
|
}
|
package/OnlineStorage.js
CHANGED
|
@@ -12,6 +12,8 @@ import { AddUserCommand } from "./Messages/AddUserCommand";
|
|
|
12
12
|
import { DeleteUserCommand } from "./Messages/DeleteUserCommand";
|
|
13
13
|
import { GetUserQuery } from "./Messages/GetUserQuery";
|
|
14
14
|
import { USER_PRIVILEGES_NAMES } from "./IStorageUserPrivileges";
|
|
15
|
+
import { GetLogQuery } from "./Messages/GetLogQuery";
|
|
16
|
+
import { ListLogsIdsQuery } from "./Messages/GetLogsListQuery";
|
|
15
17
|
export class OnlineStorage {
|
|
16
18
|
server;
|
|
17
19
|
database;
|
|
@@ -230,4 +232,18 @@ export class OnlineStorage {
|
|
|
230
232
|
}
|
|
231
233
|
this.Log(`"${fileId}" moved from "${sourceDataset.Name}" to "${targetDataset.Name}".`);
|
|
232
234
|
}
|
|
235
|
+
async GetLogsList() {
|
|
236
|
+
const result = await this._bus.SendMessage(new ListLogsIdsQuery(this.DatabaseDir));
|
|
237
|
+
if (!result.IsSuccess) {
|
|
238
|
+
throw new Error(`Could not get logs list: ${result.ErrorMessage}`);
|
|
239
|
+
}
|
|
240
|
+
return result.Result;
|
|
241
|
+
}
|
|
242
|
+
async GetLog(id) {
|
|
243
|
+
const result = await this._bus.SendMessage(new GetLogQuery(this.DatabaseDir, id));
|
|
244
|
+
if (!result.IsSuccess) {
|
|
245
|
+
throw new Error(`Could not get log '${id}': ${result.ErrorMessage}`);
|
|
246
|
+
}
|
|
247
|
+
return result.Result;
|
|
248
|
+
}
|
|
233
249
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tblabs/storage",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"description": "online storage module with auth",
|
|
5
5
|
"license": "beerware",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
+
"test": "jest --runInBand",
|
|
9
10
|
"pack": "cd ./bin && npm pack",
|
|
10
11
|
"clean": "rm ./bin -rf && rm *.tgz -rf",
|
|
11
12
|
"build": "npm run clean && tsc ./src/index.ts --declaration --outDir ./bin && cp ./package.json ./bin/package.json",
|
|
Binary file
|
package/tblabs-storage-5.5.2.tgz
DELETED
|
Binary file
|