@tblabs/storage 5.12.4 → 5.12.6

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.
@@ -11,7 +11,7 @@ export class Dataset extends DatasetBase {
11
11
  _db;
12
12
  _converter;
13
13
  dataset;
14
- Type = DatasetType.Objects;
14
+ Type = DatasetType.Object;
15
15
  constructor(_db, _converter, dataset) {
16
16
  super(_db, dataset);
17
17
  this._db = _db;
@@ -12,9 +12,9 @@ export declare class PicturesDataset extends DatasetBase {
12
12
  Type: DatasetType;
13
13
  constructor(_db: OnlineStorage, dataset: dir, picsConfig?: PicsConfig);
14
14
  GetAllIds(): Promise<string[]>;
15
- GetPicture(id: string): Promise<PicturePack>;
16
- GetAllPictures(): Promise<PicturePack[]>;
17
- UploadPictures(files: File[]): Promise<PicturesUploadResult>;
15
+ GetOne(id: string): Promise<PicturePack>;
16
+ GetAll(): Promise<PicturePack[]>;
17
+ Add(files: File[]): Promise<PicturesUploadResult>;
18
18
  Delete(id: string): Promise<void>;
19
19
  Drop(): Promise<void>;
20
20
  }
@@ -11,7 +11,7 @@ export class PicturesDataset extends DatasetBase {
11
11
  _db;
12
12
  dataset;
13
13
  picsConfig;
14
- Type = DatasetType.Pictures;
14
+ Type = DatasetType.Picture;
15
15
  constructor(_db, dataset, picsConfig = DefaultPicsConfig) {
16
16
  super(_db, dataset);
17
17
  this._db = _db;
@@ -25,21 +25,21 @@ export class PicturesDataset extends DatasetBase {
25
25
  }
26
26
  return result.Result;
27
27
  }
28
- async GetPicture(id) {
28
+ async GetOne(id) {
29
29
  const result = await this._db.Send(new GetPictureQuery(this._db.DatabaseDir, this.dataset, id));
30
30
  if (!result.IsSuccess) {
31
31
  throw new Error("Failed to get picture: " + result.ErrorMessage);
32
32
  }
33
33
  return result.Result;
34
34
  }
35
- async GetAllPictures() {
35
+ async GetAll() {
36
36
  const result = await this._db.Send(new ListPicturesQuery(this._db.DatabaseDir, this.dataset));
37
37
  if (!result.IsSuccess) {
38
38
  throw new Error("Failed to list picture packs: " + result.ErrorMessage);
39
39
  }
40
40
  return result.Result;
41
41
  }
42
- async UploadPictures(files) {
42
+ async Add(files) {
43
43
  try {
44
44
  if (!files) {
45
45
  return PicturesUploadResult.Failure("No files provided");
@@ -56,7 +56,7 @@ export class PicturesDataset extends DatasetBase {
56
56
  {
57
57
  serverUrl = serverUrl.slice(0, -1);
58
58
  }
59
- const response = await fetch(serverUrl + "/picures-upload", {
59
+ const response = await fetch(serverUrl + "/pictures-upload", {
60
60
  method: 'POST',
61
61
  body: formData,
62
62
  });
@@ -9,7 +9,7 @@ import { DatasetType } from "../Services/DatasetType";
9
9
  export class RawTextDataset extends DatasetBase {
10
10
  _db;
11
11
  dataset;
12
- Type = DatasetType.Texts;
12
+ Type = DatasetType.Text;
13
13
  constructor(_db, dataset) {
14
14
  super(_db, dataset);
15
15
  this._db = _db;
@@ -1,6 +1,6 @@
1
1
  export declare enum DatasetType {
2
- Unknown = "unknown",
3
- Objects = "objects",
4
- Texts = "texts",
5
- Pictures = "pictures"
2
+ Unknown = "Unknown",
3
+ Object = "Object",
4
+ Text = "Text",
5
+ Picture = "Picture"
6
6
  }
@@ -1,7 +1,7 @@
1
1
  export var DatasetType;
2
2
  (function (DatasetType) {
3
- DatasetType["Unknown"] = "unknown";
4
- DatasetType["Objects"] = "objects";
5
- DatasetType["Texts"] = "texts";
6
- DatasetType["Pictures"] = "pictures";
3
+ DatasetType["Unknown"] = "Unknown";
4
+ DatasetType["Object"] = "Object";
5
+ DatasetType["Text"] = "Text";
6
+ DatasetType["Picture"] = "Picture";
7
7
  })(DatasetType || (DatasetType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tblabs/storage",
3
- "version": "5.12.4",
3
+ "version": "5.12.6",
4
4
  "description": "online storage module with auth",
5
5
  "license": "beerware",
6
6
  "main": "index.js",
Binary file
Binary file