ccsini 0.1.29 → 0.1.30
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.js +28 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27996,7 +27996,7 @@ var {
|
|
|
27996
27996
|
} = import__.default;
|
|
27997
27997
|
|
|
27998
27998
|
// src/version.ts
|
|
27999
|
-
var VERSION = "0.1.
|
|
27999
|
+
var VERSION = "0.1.30";
|
|
28000
28000
|
|
|
28001
28001
|
// src/commands/init.ts
|
|
28002
28002
|
init_source();
|
|
@@ -29430,7 +29430,33 @@ function registerInitCommand(program2) {
|
|
|
29430
29430
|
spinner.fail(e.message);
|
|
29431
29431
|
process.exit(1);
|
|
29432
29432
|
}
|
|
29433
|
-
|
|
29433
|
+
let isMultiDevice = !!existingSalt;
|
|
29434
|
+
if (isMultiDevice) {
|
|
29435
|
+
const { freshStart } = await dist_default12.prompt([
|
|
29436
|
+
{
|
|
29437
|
+
type: "confirm",
|
|
29438
|
+
name: "freshStart",
|
|
29439
|
+
message: "Existing encryption data found. Start fresh with a new password?",
|
|
29440
|
+
default: false
|
|
29441
|
+
}
|
|
29442
|
+
]);
|
|
29443
|
+
if (freshStart) {
|
|
29444
|
+
const wipeSpinner = ora("Wiping previous account data...").start();
|
|
29445
|
+
try {
|
|
29446
|
+
const { importPrivateKey: importPrivateKey2, createDeviceJWT: createDeviceJWT2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
|
|
29447
|
+
const privateKey = await importPrivateKey2(privateKeyB64);
|
|
29448
|
+
const jwt = await createDeviceJWT2(privateKey, deviceId);
|
|
29449
|
+
const authedClient = new CcsiniClient("https://ccsini-api.anis-maisara190.workers.dev", jwt);
|
|
29450
|
+
await authedClient.resetAll();
|
|
29451
|
+
wipeSpinner.succeed("Previous account data wiped");
|
|
29452
|
+
} catch (e) {
|
|
29453
|
+
wipeSpinner.fail(`Could not wipe server data: ${e.message}`);
|
|
29454
|
+
process.exit(1);
|
|
29455
|
+
}
|
|
29456
|
+
existingSalt = null;
|
|
29457
|
+
isMultiDevice = false;
|
|
29458
|
+
}
|
|
29459
|
+
}
|
|
29434
29460
|
let masterKey;
|
|
29435
29461
|
let salt;
|
|
29436
29462
|
if (isMultiDevice) {
|