ccsini 0.1.30 → 0.1.31
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 +12 -6
- 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.31";
|
|
28000
28000
|
|
|
28001
28001
|
// src/commands/init.ts
|
|
28002
28002
|
init_source();
|
|
@@ -29001,6 +29001,15 @@ class CcsiniClient {
|
|
|
29001
29001
|
throw new Error("Failed to delete blobs");
|
|
29002
29002
|
return res.json();
|
|
29003
29003
|
}
|
|
29004
|
+
async wipeAccount(deviceId, publicKey) {
|
|
29005
|
+
const res = await fetch(`${this.apiUrl}/api/devices/wipe-account`, {
|
|
29006
|
+
method: "POST",
|
|
29007
|
+
headers: { "Content-Type": "application/json" },
|
|
29008
|
+
body: JSON.stringify({ deviceId, publicKey })
|
|
29009
|
+
});
|
|
29010
|
+
if (!res.ok)
|
|
29011
|
+
throw new Error("Failed to wipe account data");
|
|
29012
|
+
}
|
|
29004
29013
|
async resetAll() {
|
|
29005
29014
|
const res = await fetch(`${this.apiUrl}/api/sync/reset`, {
|
|
29006
29015
|
method: "DELETE",
|
|
@@ -29443,11 +29452,8 @@ function registerInitCommand(program2) {
|
|
|
29443
29452
|
if (freshStart) {
|
|
29444
29453
|
const wipeSpinner = ora("Wiping previous account data...").start();
|
|
29445
29454
|
try {
|
|
29446
|
-
const
|
|
29447
|
-
|
|
29448
|
-
const jwt = await createDeviceJWT2(privateKey, deviceId);
|
|
29449
|
-
const authedClient = new CcsiniClient("https://ccsini-api.anis-maisara190.workers.dev", jwt);
|
|
29450
|
-
await authedClient.resetAll();
|
|
29455
|
+
const client = new CcsiniClient("https://ccsini-api.anis-maisara190.workers.dev", "");
|
|
29456
|
+
await client.wipeAccount(deviceId, publicKeyB64);
|
|
29451
29457
|
wipeSpinner.succeed("Previous account data wiped");
|
|
29452
29458
|
} catch (e) {
|
|
29453
29459
|
wipeSpinner.fail(`Could not wipe server data: ${e.message}`);
|