jazz-tools 0.10.13 → 0.10.14
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-GSIV52ZH.js → chunk-5YDDEUNX.js} +15 -18
- package/dist/chunk-5YDDEUNX.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/src/auth/AuthSecretStorage.ts +10 -9
- package/src/implementation/ContextManager.ts +1 -7
- package/src/implementation/createContext.ts +3 -3
- package/src/tests/AuthSecretStorage.test.ts +8 -9
- package/src/tests/PassphraseAuth.test.ts +1 -2
- package/tsconfig.json +1 -1
- package/dist/chunk-GSIV52ZH.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.10.
|
2
|
+
> jazz-tools@0.10.14 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -11,8 +11,8 @@
|
|
11
11
|
[34mESM[39m Build start
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m1.50 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.28 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-5YDDEUNX.js [22m[32m115.67 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m259.00 B[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.41 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-5YDDEUNX.js.map [22m[32m275.90 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 38ms
|
package/CHANGELOG.md
CHANGED
@@ -545,7 +545,7 @@ async function createJazzContext(options) {
|
|
545
545
|
AccountSchema: options.AccountSchema,
|
546
546
|
sessionProvider: options.sessionProvider,
|
547
547
|
onLogOut: () => {
|
548
|
-
authSecretStorage.
|
548
|
+
authSecretStorage.clearWithoutNotify();
|
549
549
|
}
|
550
550
|
});
|
551
551
|
} else {
|
@@ -561,11 +561,11 @@ async function createJazzContext(options) {
|
|
561
561
|
crypto,
|
562
562
|
AccountSchema: options.AccountSchema,
|
563
563
|
onLogOut: async () => {
|
564
|
-
await authSecretStorage.
|
564
|
+
await authSecretStorage.clearWithoutNotify();
|
565
565
|
}
|
566
566
|
});
|
567
567
|
if (!options.newAccountProps) {
|
568
|
-
await authSecretStorage.
|
568
|
+
await authSecretStorage.setWithoutNotify({
|
569
569
|
accountID: context.account.id,
|
570
570
|
secretSeed,
|
571
571
|
accountSecret: context.node.account.agentSecret,
|
@@ -3457,7 +3457,6 @@ var KvStoreContext_default = KvStoreContext;
|
|
3457
3457
|
var STORAGE_KEY = "jazz-logged-in-secret";
|
3458
3458
|
var AuthSecretStorage = class {
|
3459
3459
|
constructor() {
|
3460
|
-
this.notify = false;
|
3461
3460
|
this.listeners = /* @__PURE__ */ new Set();
|
3462
3461
|
this.isAuthenticated = false;
|
3463
3462
|
}
|
@@ -3522,7 +3521,7 @@ var AuthSecretStorage = class {
|
|
3522
3521
|
provider: parsed.provider
|
3523
3522
|
};
|
3524
3523
|
}
|
3525
|
-
async
|
3524
|
+
async setWithoutNotify(payload) {
|
3526
3525
|
const kvStore = KvStoreContext_default.getInstance().getStorage();
|
3527
3526
|
await kvStore.set(
|
3528
3527
|
STORAGE_KEY,
|
@@ -3533,9 +3532,10 @@ var AuthSecretStorage = class {
|
|
3533
3532
|
provider: payload.provider
|
3534
3533
|
})
|
3535
3534
|
);
|
3536
|
-
|
3537
|
-
|
3538
|
-
|
3535
|
+
}
|
3536
|
+
async set(payload) {
|
3537
|
+
this.setWithoutNotify(payload);
|
3538
|
+
this.emitUpdate(payload);
|
3539
3539
|
}
|
3540
3540
|
getIsAuthenticated(data) {
|
3541
3541
|
if (!data) return false;
|
@@ -3555,12 +3555,13 @@ var AuthSecretStorage = class {
|
|
3555
3555
|
listener(this.isAuthenticated);
|
3556
3556
|
}
|
3557
3557
|
}
|
3558
|
-
async
|
3558
|
+
async clearWithoutNotify() {
|
3559
3559
|
const kvStore = KvStoreContext_default.getInstance().getStorage();
|
3560
3560
|
await kvStore.delete(STORAGE_KEY);
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3561
|
+
}
|
3562
|
+
async clear() {
|
3563
|
+
await this.clearWithoutNotify();
|
3564
|
+
this.emitUpdate(null);
|
3564
3565
|
}
|
3565
3566
|
};
|
3566
3567
|
|
@@ -3590,10 +3591,6 @@ import { cojsonInternals as cojsonInternals4 } from "cojson";
|
|
3590
3591
|
var JazzContextManager = class {
|
3591
3592
|
constructor() {
|
3592
3593
|
this.authSecretStorage = new AuthSecretStorage();
|
3593
|
-
this.authSecretStorageWithNotify = Object.assign(
|
3594
|
-
Object.create(this.authSecretStorage),
|
3595
|
-
{ notify: true }
|
3596
|
-
);
|
3597
3594
|
this.authenticating = false;
|
3598
3595
|
this.logOut = async () => {
|
3599
3596
|
if (!this.context || !this.props) {
|
@@ -3696,7 +3693,7 @@ var JazzContextManager = class {
|
|
3696
3693
|
return this.value;
|
3697
3694
|
}
|
3698
3695
|
getAuthSecretStorage() {
|
3699
|
-
return this.
|
3696
|
+
return this.authSecretStorage;
|
3700
3697
|
}
|
3701
3698
|
async handleAnonymousAccountMigration(prevContext) {
|
3702
3699
|
if (!this.props) {
|
@@ -4048,4 +4045,4 @@ export {
|
|
4048
4045
|
consumeInviteLink
|
4049
4046
|
};
|
4050
4047
|
/* istanbul ignore file -- @preserve */
|
4051
|
-
//# sourceMappingURL=chunk-
|
4048
|
+
//# sourceMappingURL=chunk-5YDDEUNX.js.map
|