@unicitylabs/sphere-sdk 0.1.6 → 0.1.8
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/README.md +2 -2
- package/dist/core/index.cjs +36 -11
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +14 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.js +36 -11
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +14 -3
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +14 -3
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +18 -3
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.js +18 -3
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +36 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -12
- package/dist/index.d.ts +51 -12
- package/dist/index.js +36 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -348,10 +348,18 @@ var FileTokenStorageProvider = class {
|
|
|
348
348
|
const files = fs2.readdirSync(this.tokensDir).filter((f) => f.endsWith(".json") && f !== "_meta.json");
|
|
349
349
|
for (const file of files) {
|
|
350
350
|
try {
|
|
351
|
+
const basename2 = path2.basename(file, ".json");
|
|
352
|
+
if (basename2.startsWith("token-") || basename2.startsWith("nametag-")) {
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
351
355
|
const content = fs2.readFileSync(path2.join(this.tokensDir, file), "utf-8");
|
|
352
356
|
const token = JSON.parse(content);
|
|
353
|
-
|
|
354
|
-
|
|
357
|
+
if (basename2.startsWith("archived-")) {
|
|
358
|
+
data[basename2] = token;
|
|
359
|
+
} else {
|
|
360
|
+
const key = `_${basename2}`;
|
|
361
|
+
data[key] = token;
|
|
362
|
+
}
|
|
355
363
|
} catch {
|
|
356
364
|
}
|
|
357
365
|
}
|
|
@@ -376,13 +384,20 @@ var FileTokenStorageProvider = class {
|
|
|
376
384
|
path2.join(this.tokensDir, "_meta.json"),
|
|
377
385
|
JSON.stringify(data._meta, null, 2)
|
|
378
386
|
);
|
|
387
|
+
const reservedKeys = ["_meta", "_tombstones", "_outbox", "_sent", "_invalid"];
|
|
379
388
|
for (const [key, value] of Object.entries(data)) {
|
|
380
|
-
if (
|
|
389
|
+
if (reservedKeys.includes(key)) continue;
|
|
390
|
+
if (key.startsWith("_")) {
|
|
381
391
|
const tokenId = key.slice(1);
|
|
382
392
|
fs2.writeFileSync(
|
|
383
393
|
path2.join(this.tokensDir, `${tokenId}.json`),
|
|
384
394
|
JSON.stringify(value, null, 2)
|
|
385
395
|
);
|
|
396
|
+
} else if (key.startsWith("archived-")) {
|
|
397
|
+
fs2.writeFileSync(
|
|
398
|
+
path2.join(this.tokensDir, `${key}.json`),
|
|
399
|
+
JSON.stringify(value, null, 2)
|
|
400
|
+
);
|
|
386
401
|
}
|
|
387
402
|
}
|
|
388
403
|
if (data._tombstones) {
|