@gbozee/ultimate 0.0.2-120 → 0.0.2-122

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/dist/index.cjs CHANGED
@@ -51616,6 +51616,26 @@ class AppDatabase {
51616
51616
  });
51617
51617
  }
51618
51618
  }
51619
+ async changeUserPassword(payload) {
51620
+ const { password } = payload;
51621
+ const credentials = await this.getUserCredentials();
51622
+ if (credentials) {
51623
+ const encryptedCredentials = encryptObject(credentials, password);
51624
+ if (this.salt && this.email) {
51625
+ const user = await this.getUserByEmail();
51626
+ const encryptedPassword = encryptObject(password, this.salt);
51627
+ await this.pb.collection("users").update(user.id, {
51628
+ settings: {
51629
+ ...user.settings,
51630
+ password: encryptedPassword,
51631
+ credentials: encryptedCredentials
51632
+ }
51633
+ });
51634
+ return true;
51635
+ }
51636
+ }
51637
+ return false;
51638
+ }
51619
51639
  async addNewCredential(params) {
51620
51640
  const { password, payload } = params;
51621
51641
  let credentials = await this.getCredentials({ password });
package/dist/index.d.ts CHANGED
@@ -550,6 +550,9 @@ export declare class AppDatabase {
550
550
  password?: string;
551
551
  credentials: any;
552
552
  }): Promise<import("pocketbase").RecordModel>;
553
+ changeUserPassword(payload: {
554
+ password: string;
555
+ }): Promise<boolean>;
553
556
  addNewCredential(params: {
554
557
  password?: string;
555
558
  payload: {
@@ -1623,7 +1626,10 @@ declare class ExchangePosition {
1623
1626
  }): Promise<any>;
1624
1627
  }
1625
1628
  declare class ExchangeAccount$1 {
1626
- private instance;
1629
+ instance: {
1630
+ owner: string;
1631
+ exchange: string;
1632
+ };
1627
1633
  exchange: BaseExchange;
1628
1634
  main_exchange?: BaseExchange;
1629
1635
  private app_db;
package/dist/index.js CHANGED
@@ -51566,6 +51566,26 @@ class AppDatabase {
51566
51566
  });
51567
51567
  }
51568
51568
  }
51569
+ async changeUserPassword(payload) {
51570
+ const { password } = payload;
51571
+ const credentials = await this.getUserCredentials();
51572
+ if (credentials) {
51573
+ const encryptedCredentials = encryptObject(credentials, password);
51574
+ if (this.salt && this.email) {
51575
+ const user = await this.getUserByEmail();
51576
+ const encryptedPassword = encryptObject(password, this.salt);
51577
+ await this.pb.collection("users").update(user.id, {
51578
+ settings: {
51579
+ ...user.settings,
51580
+ password: encryptedPassword,
51581
+ credentials: encryptedCredentials
51582
+ }
51583
+ });
51584
+ return true;
51585
+ }
51586
+ }
51587
+ return false;
51588
+ }
51569
51589
  async addNewCredential(params) {
51570
51590
  const { password, payload } = params;
51571
51591
  let credentials = await this.getCredentials({ password });
@@ -58320,6 +58320,26 @@ class AppDatabase {
58320
58320
  });
58321
58321
  }
58322
58322
  }
58323
+ async changeUserPassword(payload) {
58324
+ const { password } = payload;
58325
+ const credentials = await this.getUserCredentials();
58326
+ if (credentials) {
58327
+ const encryptedCredentials = encryptObject(credentials, password);
58328
+ if (this.salt && this.email) {
58329
+ const user = await this.getUserByEmail();
58330
+ const encryptedPassword = encryptObject(password, this.salt);
58331
+ await this.pb.collection("users").update(user.id, {
58332
+ settings: {
58333
+ ...user.settings,
58334
+ password: encryptedPassword,
58335
+ credentials: encryptedCredentials
58336
+ }
58337
+ });
58338
+ return true;
58339
+ }
58340
+ }
58341
+ return false;
58342
+ }
58323
58343
  async addNewCredential(params) {
58324
58344
  const { password, payload } = params;
58325
58345
  let credentials = await this.getCredentials({ password });
@@ -58297,6 +58297,26 @@ class AppDatabase {
58297
58297
  });
58298
58298
  }
58299
58299
  }
58300
+ async changeUserPassword(payload) {
58301
+ const { password } = payload;
58302
+ const credentials = await this.getUserCredentials();
58303
+ if (credentials) {
58304
+ const encryptedCredentials = encryptObject(credentials, password);
58305
+ if (this.salt && this.email) {
58306
+ const user = await this.getUserByEmail();
58307
+ const encryptedPassword = encryptObject(password, this.salt);
58308
+ await this.pb.collection("users").update(user.id, {
58309
+ settings: {
58310
+ ...user.settings,
58311
+ password: encryptedPassword,
58312
+ credentials: encryptedCredentials
58313
+ }
58314
+ });
58315
+ return true;
58316
+ }
58317
+ }
58318
+ return false;
58319
+ }
58300
58320
  async addNewCredential(params) {
58301
58321
  const { password, payload } = params;
58302
58322
  let credentials = await this.getCredentials({ password });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-120",
4
+ "version": "0.0.2-122",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",