jazz-tools 0.14.10 → 0.14.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 +6 -6
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-YLZ5746T.js → chunk-GRIN3FQP.js} +36 -3
- package/dist/chunk-GRIN3FQP.js.map +1 -0
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/implementation/ContextManager.d.ts +5 -2
- package/dist/implementation/ContextManager.d.ts.map +1 -1
- package/dist/implementation/createContext.d.ts +1 -1
- package/dist/implementation/createContext.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/subscribe/SubscriptionScope.d.ts +1 -0
- package/dist/subscribe/SubscriptionScope.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/src/exports.ts +1 -0
- package/src/implementation/ContextManager.ts +34 -2
- package/src/implementation/createContext.ts +2 -2
- package/src/subscribe/SubscriptionScope.ts +6 -0
- package/dist/chunk-YLZ5746T.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.14.
|
2
|
+
> jazz-tools@0.14.14 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -9,14 +9,14 @@
|
|
9
9
|
[34mCLI[39m Target: es2021
|
10
10
|
[34mCLI[39m Cleaning output folder
|
11
11
|
[34mESM[39m Build start
|
12
|
-
[32mESM[39m [1mdist/index.js [22m[32m11.
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m11.11 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.31 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-GRIN3FQP.js [22m[32m133.77 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m18.38 KB[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.57 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-GRIN3FQP.js.map [22m[32m309.59 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 59ms
|
19
19
|
|
20
|
-
> jazz-tools@0.14.
|
20
|
+
> jazz-tools@0.14.14 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
21
21
|
> tsc --outDir dist
|
22
22
|
|
package/CHANGELOG.md
CHANGED
@@ -2970,6 +2970,11 @@ var SubscriptionScope = class _SubscriptionScope {
|
|
2970
2970
|
}
|
2971
2971
|
return true;
|
2972
2972
|
}
|
2973
|
+
getCurrentValue() {
|
2974
|
+
if (!this.shouldSendUpdates()) return;
|
2975
|
+
if (this.errorFromChildren) return this.errorFromChildren;
|
2976
|
+
return this.value;
|
2977
|
+
}
|
2973
2978
|
triggerUpdate() {
|
2974
2979
|
if (!this.shouldSendUpdates()) return;
|
2975
2980
|
if (!this.dirty) return;
|
@@ -3403,7 +3408,7 @@ async function createJazzContext(options) {
|
|
3403
3408
|
authSecretStorage
|
3404
3409
|
};
|
3405
3410
|
}
|
3406
|
-
|
3411
|
+
function createAnonymousJazzContext({
|
3407
3412
|
peersToLoadFrom,
|
3408
3413
|
crypto
|
3409
3414
|
}) {
|
@@ -3990,6 +3995,7 @@ var ImageDefinition = ImageDefinitionBase.withHelpers((Self) => ({
|
|
3990
3995
|
|
3991
3996
|
// src/implementation/ContextManager.ts
|
3992
3997
|
import { cojsonInternals as cojsonInternals4 } from "cojson";
|
3998
|
+
import { PureJSCrypto } from "cojson/dist/crypto/PureJSCrypto";
|
3993
3999
|
|
3994
4000
|
// src/auth/KvStoreContext.ts
|
3995
4001
|
var KvStoreContext = class _KvStoreContext {
|
@@ -4153,8 +4159,28 @@ var InMemoryKVStore = class {
|
|
4153
4159
|
};
|
4154
4160
|
|
4155
4161
|
// src/implementation/ContextManager.ts
|
4162
|
+
function getAnonymousFallback() {
|
4163
|
+
const context = createAnonymousJazzContext({
|
4164
|
+
peersToLoadFrom: [],
|
4165
|
+
crypto: new PureJSCrypto()
|
4166
|
+
});
|
4167
|
+
return {
|
4168
|
+
guest: context.agent,
|
4169
|
+
node: context.agent.node,
|
4170
|
+
done: () => {
|
4171
|
+
},
|
4172
|
+
logOut: async () => {
|
4173
|
+
},
|
4174
|
+
isAuthenticated: false,
|
4175
|
+
authenticate: async () => {
|
4176
|
+
},
|
4177
|
+
register: async () => {
|
4178
|
+
throw new Error("Not implemented");
|
4179
|
+
}
|
4180
|
+
};
|
4181
|
+
}
|
4156
4182
|
var JazzContextManager = class {
|
4157
|
-
constructor() {
|
4183
|
+
constructor(opts) {
|
4158
4184
|
this.authSecretStorage = new AuthSecretStorage();
|
4159
4185
|
this.keepContextOpen = false;
|
4160
4186
|
this.logOut = async () => {
|
@@ -4231,6 +4257,9 @@ var JazzContextManager = class {
|
|
4231
4257
|
};
|
4232
4258
|
};
|
4233
4259
|
KvStoreContext.getInstance().initialize(this.getKvStore());
|
4260
|
+
if (opts?.useAnonymousFallback) {
|
4261
|
+
this.value = getAnonymousFallback();
|
4262
|
+
}
|
4234
4263
|
}
|
4235
4264
|
getKvStore() {
|
4236
4265
|
return new InMemoryKVStore();
|
@@ -4282,6 +4311,9 @@ var JazzContextManager = class {
|
|
4282
4311
|
getCurrentValue() {
|
4283
4312
|
return this.value;
|
4284
4313
|
}
|
4314
|
+
setCurrentValue(value) {
|
4315
|
+
this.value = value;
|
4316
|
+
}
|
4285
4317
|
getAuthSecretStorage() {
|
4286
4318
|
return this.authSecretStorage;
|
4287
4319
|
}
|
@@ -4627,6 +4659,7 @@ export {
|
|
4627
4659
|
activeAccountContext,
|
4628
4660
|
Encoders,
|
4629
4661
|
coField,
|
4662
|
+
SubscriptionScope,
|
4630
4663
|
randomSessionProvider,
|
4631
4664
|
createJazzContextFromExistingCredentials,
|
4632
4665
|
createJazzContextForNewAccount,
|
@@ -4642,4 +4675,4 @@ export {
|
|
4642
4675
|
JazzContextManager
|
4643
4676
|
};
|
4644
4677
|
/* istanbul ignore file -- @preserve */
|
4645
|
-
//# sourceMappingURL=chunk-
|
4678
|
+
//# sourceMappingURL=chunk-GRIN3FQP.js.map
|