@tblabs/storage 5.12.7 → 5.12.9
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/PicturesDataset/PicturesDataset.d.ts +2 -0
- package/Datasets/PicturesDataset/PicturesDataset.js +8 -1
- package/Messages/GetPictureQuery.d.ts +2 -2
- package/Messages/GetPictureQuery.js +2 -2
- package/package.json +1 -1
- package/tblabs-storage-5.12.9.tgz +0 -0
- package/tblabs-storage-5.12.7.tgz +0 -0
|
@@ -11,6 +11,8 @@ export declare class PicturesDataset extends DatasetBase {
|
|
|
11
11
|
protected picsConfig: PicsConfig;
|
|
12
12
|
Type: DatasetType;
|
|
13
13
|
constructor(_db: OnlineStorage, dataset: dir, picsConfig?: PicsConfig);
|
|
14
|
+
SetConfig(config: PicsConfig): void;
|
|
15
|
+
GetConfig(): PicsConfig;
|
|
14
16
|
GetAllIds(): Promise<string[]>;
|
|
15
17
|
GetOne(id: string): Promise<PicturePack>;
|
|
16
18
|
GetAll(): Promise<PicturePack[]>;
|
|
@@ -18,6 +18,12 @@ export class PicturesDataset extends DatasetBase {
|
|
|
18
18
|
this.dataset = dataset;
|
|
19
19
|
this.picsConfig = picsConfig;
|
|
20
20
|
}
|
|
21
|
+
SetConfig(config) {
|
|
22
|
+
this.picsConfig = config;
|
|
23
|
+
}
|
|
24
|
+
GetConfig() {
|
|
25
|
+
return this.picsConfig;
|
|
26
|
+
}
|
|
21
27
|
async GetAllIds() {
|
|
22
28
|
const result = await this._db.Send(new ListPicturesIdsQuery(this._db.DatabaseDir, this.dataset));
|
|
23
29
|
if (!result.IsSuccess) {
|
|
@@ -26,7 +32,7 @@ export class PicturesDataset extends DatasetBase {
|
|
|
26
32
|
return result.Result;
|
|
27
33
|
}
|
|
28
34
|
async GetOne(id) {
|
|
29
|
-
const result = await this._db.Send(new GetPictureQuery(this._db.DatabaseDir, this.dataset, id));
|
|
35
|
+
const result = await this._db.Send(new GetPictureQuery(this._db.Server, this._db.DatabaseDir, this.dataset, id));
|
|
30
36
|
if (!result.IsSuccess) {
|
|
31
37
|
throw new Error("Failed to get picture: " + result.ErrorMessage);
|
|
32
38
|
}
|
|
@@ -48,6 +54,7 @@ export class PicturesDataset extends DatasetBase {
|
|
|
48
54
|
for (let i = 0; i < files.length; i++) {
|
|
49
55
|
formData.append('files[]', files[i]); // Tak, te [] w nazwie zmiennej są konieczne! bez tego php (mimo że odbiera przez $_FILES["files"]) nie jest w stanie odebrać wielu plików xd
|
|
50
56
|
}
|
|
57
|
+
formData.append('server', this._db.Server);
|
|
51
58
|
formData.append('database', this._db.DatabaseDir);
|
|
52
59
|
formData.append('dataset', this.dataset);
|
|
53
60
|
formData.append('config', JSON.stringify(this.picsConfig));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Message } from '../MessageBus/Message';
|
|
2
|
-
import { dir } from '../Types/dir';
|
|
2
|
+
import { dir, url } from '../Types/dir';
|
|
3
3
|
export declare class GetPictureQuery extends Message {
|
|
4
|
-
constructor(Database: dir, Dataset: dir, FileId: string);
|
|
4
|
+
constructor(Server: url, Database: dir, Dataset: dir, FileId: string);
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Message } from '../MessageBus/Message';
|
|
2
2
|
export class GetPictureQuery extends Message {
|
|
3
|
-
constructor(Database, Dataset, FileId) {
|
|
4
|
-
super("GetPicture", { Database, Dataset, FileId });
|
|
3
|
+
constructor(Server, Database, Dataset, FileId) {
|
|
4
|
+
super("GetPicture", { Server, Database, Dataset, FileId });
|
|
5
5
|
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|