@tblabs/storage 5.2.2 → 5.2.4

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/Dataset.js CHANGED
@@ -68,7 +68,8 @@ export class Dataset {
68
68
  // }
69
69
  async Add(id, item) {
70
70
  this._db.Log(`Adding "${id}" to "${this.DatasetPath}"...`);
71
- const result = await this._db.Send(new AddCommand(this._db.DatabaseDir, this.dataset, id, item));
71
+ const rawItem = this._converter.ToRaw(item);
72
+ const result = await this._db.Send(new AddCommand(this._db.DatabaseDir, this.dataset, id, rawItem));
72
73
  if (!result.IsSuccess) {
73
74
  throw new Error(`Could not add file: ${result.ErrorMessage}`);
74
75
  }
@@ -77,7 +78,8 @@ export class Dataset {
77
78
  ;
78
79
  async Update(id, item) {
79
80
  this._db.Log(`Updating "${id}"...`);
80
- const result = await this._db.Send(new UpdateCommand(this._db.DatabaseDir, this.dataset, id, item));
81
+ const rawItem = this._converter.ToRaw(item);
82
+ const result = await this._db.Send(new UpdateCommand(this._db.DatabaseDir, this.dataset, id, rawItem));
81
83
  if (!result.IsSuccess) {
82
84
  throw new Error(`Could not update file: ${result.ErrorMessage}`);
83
85
  }
package/OnlineStorage.js CHANGED
@@ -54,6 +54,7 @@ export class OnlineStorage {
54
54
  }
55
55
  OnUserChange(handler) {
56
56
  this.onUserChange.push(handler);
57
+ handler(this.user);
57
58
  return this;
58
59
  }
59
60
  async Register(id, role, name, password, privileges, icon, tags) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tblabs/storage",
3
- "version": "5.2.2",
3
+ "version": "5.2.4",
4
4
  "description": "online storage module with auth",
5
5
  "license": "beerware",
6
6
  "main": "index.js",
Binary file
Binary file