@tblabs/storage 5.14.0 → 5.14.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/Datasets/DatasetBase.js +2 -2
- package/Datasets/Picture/PicturesDataset.js +1 -1
- package/Datasets/Text/ITextRepo.d.ts +2 -0
- package/Messages/ListPicturesQuery.d.ts +1 -1
- package/Messages/ListPicturesQuery.js +2 -2
- package/package.json +1 -1
- package/tblabs-storage-5.14.1.tgz +0 -0
- package/tblabs-storage-5.14.0.tgz +0 -0
package/Datasets/DatasetBase.js
CHANGED
|
@@ -26,10 +26,10 @@ export class DatasetBase {
|
|
|
26
26
|
if (!this._db.User.Privileges) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
|
-
if (
|
|
29
|
+
if (this._db.User.Privileges?.[action] && typeof this._db.User.Privileges[action] === "object") {
|
|
30
30
|
return (this._db.User.Privileges[action].Datasets == "all" || this._db.User.Privileges[action].Datasets?.includes(this.dataset)) ?? false;
|
|
31
31
|
}
|
|
32
|
-
if (
|
|
32
|
+
if (this._db.User.Privileges?.[action] && typeof this._db.User.Privileges[action] === "boolean") {
|
|
33
33
|
return this._db.User.Privileges[action];
|
|
34
34
|
}
|
|
35
35
|
return false;
|
|
@@ -39,7 +39,7 @@ export class PicturesDataset extends DatasetBase {
|
|
|
39
39
|
return result.Result;
|
|
40
40
|
}
|
|
41
41
|
async GetAll() {
|
|
42
|
-
const result = await this._db.Send(new ListPicturesQuery(this._db.DatabaseDir, this.dataset));
|
|
42
|
+
const result = await this._db.Send(new ListPicturesQuery(this._db.Server, this._db.DatabaseDir, this.dataset));
|
|
43
43
|
if (!result.IsSuccess) {
|
|
44
44
|
throw new Error("Failed to list picture packs: " + result.ErrorMessage);
|
|
45
45
|
}
|
|
@@ -5,6 +5,8 @@ export interface ITextRepo extends IRepoBase {
|
|
|
5
5
|
GetAllIds(): Promise<string[]>;
|
|
6
6
|
AppendText(id: string, text: string): Promise<void>;
|
|
7
7
|
AppendLine(id: string, line: string): Promise<void>;
|
|
8
|
+
Clear(id: string): Promise<void>;
|
|
9
|
+
ReplaceText(id: string, text: string): Promise<void>;
|
|
8
10
|
Delete(id: string): Promise<void>;
|
|
9
11
|
Drop(): Promise<void>;
|
|
10
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Message } from '../MessageBus/Message';
|
|
2
2
|
export class ListPicturesQuery extends Message {
|
|
3
|
-
constructor(Database, Dataset) {
|
|
4
|
-
super("ListPictures", { Database, Dataset });
|
|
3
|
+
constructor(Server, Database, Dataset) {
|
|
4
|
+
super("ListPictures", { Server, Database, Dataset });
|
|
5
5
|
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|