jazz-tools 0.13.17 → 0.13.19
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 +7 -7
- package/CHANGELOG.md +17 -0
- package/dist/{chunk-PYBQOYML.js → chunk-4HBHY4I7.js} +735 -595
- package/dist/chunk-4HBHY4I7.js.map +1 -0
- package/dist/coValues/account.d.ts +5 -4
- package/dist/coValues/account.d.ts.map +1 -1
- package/dist/coValues/coFeed.d.ts +1 -0
- package/dist/coValues/coFeed.d.ts.map +1 -1
- package/dist/coValues/coList.d.ts +1 -0
- package/dist/coValues/coList.d.ts.map +1 -1
- package/dist/coValues/coMap.d.ts +4 -2
- package/dist/coValues/coMap.d.ts.map +1 -1
- package/dist/coValues/coPlainText.d.ts +2 -2
- package/dist/coValues/coPlainText.d.ts.map +1 -1
- package/dist/coValues/deepLoading.d.ts +1 -9
- package/dist/coValues/deepLoading.d.ts.map +1 -1
- package/dist/coValues/extensions/imageDef.d.ts.map +1 -1
- package/dist/coValues/group.d.ts.map +1 -1
- package/dist/coValues/inbox.d.ts.map +1 -1
- package/dist/coValues/interfaces.d.ts +4 -1
- package/dist/coValues/interfaces.d.ts.map +1 -1
- package/dist/implementation/createContext.d.ts.map +1 -1
- package/dist/implementation/refs.d.ts +5 -10
- package/dist/implementation/refs.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/subscribe/CoValueCoreSubscription.d.ts +14 -0
- package/dist/subscribe/CoValueCoreSubscription.d.ts.map +1 -0
- package/dist/subscribe/JazzError.d.ts +16 -0
- package/dist/subscribe/JazzError.d.ts.map +1 -0
- package/dist/subscribe/SubscriptionScope.d.ts +43 -0
- package/dist/subscribe/SubscriptionScope.d.ts.map +1 -0
- package/dist/subscribe/index.d.ts +21 -0
- package/dist/subscribe/index.d.ts.map +1 -0
- package/dist/subscribe/types.d.ts +12 -0
- package/dist/subscribe/types.d.ts.map +1 -0
- package/dist/subscribe/utils.d.ts +10 -0
- package/dist/subscribe/utils.d.ts.map +1 -0
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/tests/coMap.record.test.d.ts +2 -0
- package/dist/tests/coMap.record.test.d.ts.map +1 -0
- package/dist/tests/utils.d.ts +2 -2
- package/dist/tests/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/coValues/account.ts +43 -31
- package/src/coValues/coFeed.ts +11 -7
- package/src/coValues/coList.ts +13 -17
- package/src/coValues/coMap.ts +72 -80
- package/src/coValues/coPlainText.ts +13 -2
- package/src/coValues/deepLoading.ts +4 -277
- package/src/coValues/extensions/imageDef.ts +1 -7
- package/src/coValues/group.ts +7 -6
- package/src/coValues/inbox.ts +4 -11
- package/src/coValues/interfaces.ts +54 -111
- package/src/implementation/createContext.ts +3 -4
- package/src/implementation/invites.ts +2 -2
- package/src/implementation/refs.ts +30 -121
- package/src/internal.ts +1 -2
- package/src/subscribe/CoValueCoreSubscription.ts +71 -0
- package/src/subscribe/JazzError.ts +48 -0
- package/src/subscribe/SubscriptionScope.ts +536 -0
- package/src/subscribe/index.ts +82 -0
- package/src/subscribe/types.ts +7 -0
- package/src/subscribe/utils.ts +36 -0
- package/src/testing.ts +1 -1
- package/src/tests/ContextManager.test.ts +13 -9
- package/src/tests/coFeed.test.ts +6 -6
- package/src/tests/coList.test.ts +304 -115
- package/src/tests/coMap.record.test.ts +325 -0
- package/src/tests/coMap.test.ts +718 -645
- package/src/tests/coPlainText.test.ts +2 -2
- package/src/tests/createContext.test.ts +8 -8
- package/src/tests/deepLoading.test.ts +8 -34
- package/src/tests/groupsAndAccounts.test.ts +6 -4
- package/src/tests/subscribe.test.ts +614 -42
- package/src/tests/utils.ts +8 -6
- package/dist/chunk-PYBQOYML.js.map +0 -1
- package/dist/implementation/subscriptionScope.d.ts +0 -34
- package/dist/implementation/subscriptionScope.d.ts.map +0 -1
- package/src/implementation/subscriptionScope.ts +0 -165
package/src/tests/utils.ts
CHANGED
@@ -34,7 +34,7 @@ export async function setupAccount() {
|
|
34
34
|
await createJazzContextFromExistingCredentials({
|
35
35
|
credentials: {
|
36
36
|
accountID: me.id,
|
37
|
-
secret: me._raw.agentSecret,
|
37
|
+
secret: me._raw.core.node.getCurrentAgent().agentSecret,
|
38
38
|
},
|
39
39
|
sessionProvider: randomSessionProvider,
|
40
40
|
peersToLoadFrom: [initialAsPeer],
|
@@ -96,11 +96,13 @@ export async function setupTwoNodes(options?: {
|
|
96
96
|
};
|
97
97
|
}
|
98
98
|
|
99
|
-
export function waitFor(
|
99
|
+
export function waitFor(
|
100
|
+
callback: () => boolean | void | Promise<boolean | void>,
|
101
|
+
) {
|
100
102
|
return new Promise<void>((resolve, reject) => {
|
101
|
-
const checkPassed = () => {
|
103
|
+
const checkPassed = async () => {
|
102
104
|
try {
|
103
|
-
return { ok: callback(), error: null };
|
105
|
+
return { ok: await callback(), error: null };
|
104
106
|
} catch (error) {
|
105
107
|
return { ok: false, error };
|
106
108
|
}
|
@@ -108,8 +110,8 @@ export function waitFor(callback: () => boolean | void) {
|
|
108
110
|
|
109
111
|
let retries = 0;
|
110
112
|
|
111
|
-
const interval = setInterval(() => {
|
112
|
-
const { ok, error } = checkPassed();
|
113
|
+
const interval = setInterval(async () => {
|
114
|
+
const { ok, error } = await checkPassed();
|
113
115
|
|
114
116
|
if (ok !== false) {
|
115
117
|
clearInterval(interval);
|