jazz-tools 0.14.28 → 0.15.1
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/.svelte-kit/__package__/Provider.svelte +61 -0
- package/.svelte-kit/__package__/Provider.svelte.d.ts +19 -0
- package/.svelte-kit/__package__/Provider.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.d.ts +11 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PasskeyAuth.svelte.js +20 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte.d.ts +9 -0
- package/.svelte-kit/__package__/auth/PasskeyAuthBasicUI.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.d.ts +12 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/PassphraseAuth.svelte.js +30 -0
- package/.svelte-kit/__package__/auth/index.d.ts +4 -0
- package/.svelte-kit/__package__/auth/index.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/index.js +3 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.d.ts +6 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/auth/useIsAuthenticated.svelte.js +22 -0
- package/.svelte-kit/__package__/index.d.ts +6 -0
- package/.svelte-kit/__package__/index.d.ts.map +1 -0
- package/.svelte-kit/__package__/index.js +5 -0
- package/.svelte-kit/__package__/jazz.class.svelte.d.ts +21 -0
- package/.svelte-kit/__package__/jazz.class.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/jazz.class.svelte.js +117 -0
- package/.svelte-kit/__package__/jazz.svelte.d.ts +39 -0
- package/.svelte-kit/__package__/jazz.svelte.d.ts.map +1 -0
- package/.svelte-kit/__package__/jazz.svelte.js +70 -0
- package/.svelte-kit/__package__/testing.d.ts +10 -0
- package/.svelte-kit/__package__/testing.d.ts.map +1 -0
- package/.svelte-kit/__package__/testing.js +23 -0
- package/.turbo/turbo-build.log +180 -11
- package/CHANGELOG.md +26 -0
- package/README.md +2 -2
- package/dist/browser/BrowserContextManager.d.ts +31 -0
- package/dist/browser/BrowserContextManager.d.ts.map +1 -0
- package/dist/browser/auth/LocalStorageKVStore.d.ts +9 -0
- package/dist/browser/auth/LocalStorageKVStore.d.ts.map +1 -0
- package/dist/browser/auth/PasskeyAuth.d.ts +27 -0
- package/dist/browser/auth/PasskeyAuth.d.ts.map +1 -0
- package/dist/browser/createBrowserContext.d.ts +47 -0
- package/dist/browser/createBrowserContext.d.ts.map +1 -0
- package/dist/browser/index.d.ts +23 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +469 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/storageOptions.d.ts +8 -0
- package/dist/browser/storageOptions.d.ts.map +1 -0
- package/dist/browser/tests/LocalStorageKVStore.test.d.ts +2 -0
- package/dist/browser/tests/LocalStorageKVStore.test.d.ts.map +1 -0
- package/dist/browser/tests/PasskeyAuth.test.d.ts +2 -0
- package/dist/browser/tests/PasskeyAuth.test.d.ts.map +1 -0
- package/dist/browser/tests/createInviteLink.test.d.ts +2 -0
- package/dist/browser/tests/createInviteLink.test.d.ts.map +1 -0
- package/dist/browser/tests/storageOptions.test.d.ts +2 -0
- package/dist/browser/tests/storageOptions.test.d.ts.map +1 -0
- package/dist/browser/tests/utils.d.ts +11 -0
- package/dist/browser/tests/utils.d.ts.map +1 -0
- package/dist/browser/utils/export-account-inspector.d.ts +6 -0
- package/dist/browser/utils/export-account-inspector.d.ts.map +1 -0
- package/dist/browser-media-images/index.d.ts +7 -0
- package/dist/browser-media-images/index.d.ts.map +1 -0
- package/dist/browser-media-images/index.js +70 -0
- package/dist/browser-media-images/index.js.map +1 -0
- package/dist/chunk-VBDJM6Z5.js +4938 -0
- package/dist/chunk-VBDJM6Z5.js.map +1 -0
- package/dist/expo/auth/clerk/index.d.ts +7 -0
- package/dist/expo/auth/clerk/index.d.ts.map +1 -0
- package/dist/expo/crypto.d.ts +2 -0
- package/dist/expo/crypto.d.ts.map +1 -0
- package/dist/expo/crypto.js +3 -0
- package/dist/expo/crypto.js.map +1 -0
- package/dist/expo/index.d.ts +6 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +168 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/expo/provider.d.ts +4 -0
- package/dist/expo/provider.d.ts.map +1 -0
- package/dist/expo/storage/expo-secure-store-adapter.d.ts +8 -0
- package/dist/expo/storage/expo-secure-store-adapter.d.ts.map +1 -0
- package/dist/expo/storage/expo-sqlite-adapter.d.ts +18 -0
- package/dist/expo/storage/expo-sqlite-adapter.d.ts.map +1 -0
- package/dist/expo/testing.d.ts +2 -0
- package/dist/expo/testing.d.ts.map +1 -0
- package/dist/expo/testing.js +3 -0
- package/dist/expo/testing.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +172 -6
- package/dist/index.js.map +1 -1
- package/dist/inspector/custom-element-CWW72LEG.js +31971 -0
- package/dist/inspector/custom-element-CWW72LEG.js.map +1 -0
- package/dist/inspector/custom-element.d.ts +13 -0
- package/dist/inspector/custom-element.d.ts.map +1 -0
- package/dist/inspector/index.d.ts +12 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +2053 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/inspector/register-custom-element.d.ts +2 -0
- package/dist/inspector/register-custom-element.d.ts.map +1 -0
- package/dist/inspector/register-custom-element.js +5 -0
- package/dist/inspector/register-custom-element.js.map +1 -0
- package/dist/inspector/ui/badge.d.ts +4 -0
- package/dist/inspector/ui/badge.d.ts.map +1 -0
- package/dist/inspector/ui/button.d.ts +9 -0
- package/dist/inspector/ui/button.d.ts.map +1 -0
- package/dist/inspector/ui/card.d.ts +10 -0
- package/dist/inspector/ui/card.d.ts.map +1 -0
- package/dist/inspector/ui/global-styles.d.ts +4 -0
- package/dist/inspector/ui/global-styles.d.ts.map +1 -0
- package/dist/inspector/ui/grid.d.ts +4 -0
- package/dist/inspector/ui/grid.d.ts.map +1 -0
- package/dist/inspector/ui/heading.d.ts +4 -0
- package/dist/inspector/ui/heading.d.ts.map +1 -0
- package/dist/inspector/ui/icon.d.ts +30 -0
- package/dist/inspector/ui/icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/chevron-down-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/chevron-down-icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/delete-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/delete-icon.d.ts.map +1 -0
- package/dist/inspector/ui/icons/link-icon.d.ts +2 -0
- package/dist/inspector/ui/icons/link-icon.d.ts.map +1 -0
- package/dist/inspector/ui/input.d.ts +11 -0
- package/dist/inspector/ui/input.d.ts.map +1 -0
- package/dist/inspector/ui/select.d.ts +5 -0
- package/dist/inspector/ui/select.d.ts.map +1 -0
- package/dist/inspector/ui/table.d.ts +8 -0
- package/dist/inspector/ui/table.d.ts.map +1 -0
- package/dist/inspector/ui/text.d.ts +10 -0
- package/dist/inspector/ui/text.d.ts.map +1 -0
- package/dist/inspector/viewer/account-or-group-text.d.ts +8 -0
- package/dist/inspector/viewer/account-or-group-text.d.ts.map +1 -0
- package/dist/inspector/viewer/account-view.d.ts +8 -0
- package/dist/inspector/viewer/account-view.d.ts.map +1 -0
- package/dist/inspector/viewer/breadcrumbs.d.ts +9 -0
- package/dist/inspector/viewer/breadcrumbs.d.ts.map +1 -0
- package/dist/inspector/viewer/co-stream-view.d.ts +18 -0
- package/dist/inspector/viewer/co-stream-view.d.ts.map +1 -0
- package/dist/inspector/viewer/grid-view.d.ts +9 -0
- package/dist/inspector/viewer/grid-view.d.ts.map +1 -0
- package/dist/inspector/viewer/group-view.d.ts +8 -0
- package/dist/inspector/viewer/group-view.d.ts.map +1 -0
- package/dist/inspector/viewer/inpsector-button.d.ts +6 -0
- package/dist/inspector/viewer/inpsector-button.d.ts.map +1 -0
- package/dist/inspector/viewer/new-app.d.ts +11 -0
- package/dist/inspector/viewer/new-app.d.ts.map +1 -0
- package/dist/inspector/viewer/page-stack.d.ts +15 -0
- package/dist/inspector/viewer/page-stack.d.ts.map +1 -0
- package/dist/inspector/viewer/page.d.ts +16 -0
- package/dist/inspector/viewer/page.d.ts.map +1 -0
- package/dist/inspector/viewer/raw-data-card.d.ts +5 -0
- package/dist/inspector/viewer/raw-data-card.d.ts.map +1 -0
- package/dist/inspector/viewer/role-display.d.ts +6 -0
- package/dist/inspector/viewer/role-display.d.ts.map +1 -0
- package/dist/inspector/viewer/table-viewer.d.ts +9 -0
- package/dist/inspector/viewer/table-viewer.d.ts.map +1 -0
- package/dist/inspector/viewer/type-icon.d.ts +11 -0
- package/dist/inspector/viewer/type-icon.d.ts.map +1 -0
- package/dist/inspector/viewer/types.d.ts +7 -0
- package/dist/inspector/viewer/types.d.ts.map +1 -0
- package/dist/inspector/viewer/use-open-inspector.d.ts +2 -0
- package/dist/inspector/viewer/use-open-inspector.d.ts.map +1 -0
- package/dist/inspector/viewer/use-page-path.d.ts +10 -0
- package/dist/inspector/viewer/use-page-path.d.ts.map +1 -0
- package/dist/inspector/viewer/use-resolve-covalue.d.ts +67 -0
- package/dist/inspector/viewer/use-resolve-covalue.d.ts.map +1 -0
- package/dist/inspector/viewer/value-renderer.d.ts +12 -0
- package/dist/inspector/viewer/value-renderer.d.ts.map +1 -0
- package/dist/prosemirror/index.d.ts +3 -0
- package/dist/prosemirror/index.d.ts.map +1 -0
- package/dist/prosemirror/index.js +2185 -0
- package/dist/prosemirror/index.js.map +1 -0
- package/dist/prosemirror/lib/converter.d.ts +33 -0
- package/dist/prosemirror/lib/converter.d.ts.map +1 -0
- package/dist/prosemirror/lib/plugin.d.ts +43 -0
- package/dist/prosemirror/lib/plugin.d.ts.map +1 -0
- package/dist/prosemirror/lib/sync.d.ts +35 -0
- package/dist/prosemirror/lib/sync.d.ts.map +1 -0
- package/dist/prosemirror/tests/plugin.test.d.ts +2 -0
- package/dist/prosemirror/tests/plugin.test.d.ts.map +1 -0
- package/dist/react/auth/Clerk.d.ts +7 -0
- package/dist/react/auth/Clerk.d.ts.map +1 -0
- package/dist/react/auth/DemoAuth.d.ts +5 -0
- package/dist/react/auth/DemoAuth.d.ts.map +1 -0
- package/dist/react/auth/PasskeyAuth.d.ts +24 -0
- package/dist/react/auth/PasskeyAuth.d.ts.map +1 -0
- package/dist/react/auth/PassphraseAuth.d.ts +6 -0
- package/dist/react/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/react/auth/auth.d.ts +6 -0
- package/dist/react/auth/auth.d.ts.map +1 -0
- package/dist/react/hooks.d.ts +9 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +698 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/media.d.ts +24 -0
- package/dist/react/media.d.ts.map +1 -0
- package/dist/react/provider.d.ts +10 -0
- package/dist/react/provider.d.ts.map +1 -0
- package/dist/react/ssr.d.ts +4 -0
- package/dist/react/ssr.d.ts.map +1 -0
- package/dist/react/ssr.js +25 -0
- package/dist/react/ssr.js.map +1 -0
- package/dist/react/testing.d.ts +2 -0
- package/dist/react/testing.d.ts.map +1 -0
- package/dist/react/testing.js +3 -0
- package/dist/react/testing.js.map +1 -0
- package/dist/react/tests/testUtils.d.ts +14 -0
- package/dist/react/tests/testUtils.d.ts.map +1 -0
- package/dist/react/tests/useAcceptInvite.test.d.ts +2 -0
- package/dist/react/tests/useAcceptInvite.test.d.ts.map +1 -0
- package/dist/react-core/auth/DemoAuth.d.ts +17 -0
- package/dist/react-core/auth/DemoAuth.d.ts.map +1 -0
- package/dist/react-core/auth/PassphraseAuth.d.ts +21 -0
- package/dist/react-core/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/react-core/auth/index.d.ts +3 -0
- package/dist/react-core/auth/index.d.ts.map +1 -0
- package/dist/react-core/chunk-7DYMJ74I.js +12 -0
- package/dist/react-core/chunk-7DYMJ74I.js.map +1 -0
- package/dist/react-core/hooks.d.ts +17 -0
- package/dist/react-core/hooks.d.ts.map +1 -0
- package/dist/react-core/index.d.ts +4 -0
- package/dist/react-core/index.d.ts.map +1 -0
- package/dist/react-core/index.js +302 -0
- package/dist/react-core/index.js.map +1 -0
- package/dist/react-core/provider.d.ts +5 -0
- package/dist/react-core/provider.d.ts.map +1 -0
- package/dist/react-core/testing.d.ts +10 -0
- package/dist/react-core/testing.d.ts.map +1 -0
- package/dist/react-core/testing.js +43 -0
- package/dist/react-core/testing.js.map +1 -0
- package/dist/react-core/tests/fixtures.d.ts.map +1 -0
- package/dist/react-core/tests/testUtils.d.ts +15 -0
- package/dist/react-core/tests/testUtils.d.ts.map +1 -0
- package/dist/react-core/tests/useAccount.test.d.ts +2 -0
- package/dist/react-core/tests/useAccount.test.d.ts.map +1 -0
- package/dist/react-core/tests/useCoState.test.d.ts +2 -0
- package/dist/react-core/tests/useCoState.test.d.ts.map +1 -0
- package/dist/react-core/tests/useInboxSender.test.d.ts +2 -0
- package/dist/react-core/tests/useInboxSender.test.d.ts.map +1 -0
- package/dist/react-core/tests/useIsAuthenticated.test.d.ts +2 -0
- package/dist/react-core/tests/useIsAuthenticated.test.d.ts.map +1 -0
- package/dist/react-core/tests/usePassPhraseAuth.test.d.ts +2 -0
- package/dist/react-core/tests/usePassPhraseAuth.test.d.ts.map +1 -0
- package/dist/react-core/utils.d.ts +4 -0
- package/dist/react-core/utils.d.ts.map +1 -0
- package/dist/react-native/crypto.d.ts +2 -0
- package/dist/react-native/crypto.d.ts.map +1 -0
- package/dist/react-native/crypto.js +3 -0
- package/dist/react-native/crypto.js.map +1 -0
- package/dist/react-native/index.d.ts +5 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +103 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/provider.d.ts +4 -0
- package/dist/react-native/provider.d.ts.map +1 -0
- package/dist/react-native/storage/mmkv-store-adapter.d.ts +8 -0
- package/dist/react-native/storage/mmkv-store-adapter.d.ts.map +1 -0
- package/dist/react-native/storage/op-sqlite-adapter.d.ts +13 -0
- package/dist/react-native/storage/op-sqlite-adapter.d.ts.map +1 -0
- package/dist/react-native/testing.d.ts +2 -0
- package/dist/react-native/testing.d.ts.map +1 -0
- package/dist/react-native/testing.js +3 -0
- package/dist/react-native/testing.js.map +1 -0
- package/dist/react-native-core/ReactNativeContextManager.d.ts +31 -0
- package/dist/react-native-core/ReactNativeContextManager.d.ts.map +1 -0
- package/dist/react-native-core/auth/DemoAuthUI.d.ts +8 -0
- package/dist/react-native-core/auth/DemoAuthUI.d.ts.map +1 -0
- package/dist/react-native-core/auth/auth.d.ts +3 -0
- package/dist/react-native-core/auth/auth.d.ts.map +1 -0
- package/dist/react-native-core/crypto/RNQuickCrypto.d.ts +15 -0
- package/dist/react-native-core/crypto/RNQuickCrypto.d.ts.map +1 -0
- package/dist/react-native-core/crypto/index.d.ts +2 -0
- package/dist/react-native-core/crypto/index.d.ts.map +1 -0
- package/dist/react-native-core/crypto.js +65 -0
- package/dist/react-native-core/crypto.js.map +1 -0
- package/dist/react-native-core/hooks.d.ts +8 -0
- package/dist/react-native-core/hooks.d.ts.map +1 -0
- package/dist/react-native-core/index.d.ts +9 -0
- package/dist/react-native-core/index.d.ts.map +1 -0
- package/dist/react-native-core/index.js +653 -0
- package/dist/react-native-core/index.js.map +1 -0
- package/dist/react-native-core/media.d.ts +24 -0
- package/dist/react-native-core/media.d.ts.map +1 -0
- package/dist/react-native-core/platform.d.ts +45 -0
- package/dist/react-native-core/platform.d.ts.map +1 -0
- package/dist/react-native-core/provider.d.ts +10 -0
- package/dist/react-native-core/provider.d.ts.map +1 -0
- package/dist/react-native-core/storage/kv-store-context.d.ts +17 -0
- package/dist/react-native-core/storage/kv-store-context.d.ts.map +1 -0
- package/dist/react-native-core/storage/sqlite-react-native.d.ts +9 -0
- package/dist/react-native-core/storage/sqlite-react-native.d.ts.map +1 -0
- package/dist/react-native-core/testing.js +3 -0
- package/dist/react-native-core/testing.js.map +1 -0
- package/dist/react-native-media-images/index.d.ts +7 -0
- package/dist/react-native-media-images/index.d.ts.map +1 -0
- package/dist/react-native-media-images/index.js +177 -0
- package/dist/react-native-media-images/index.js.map +1 -0
- package/dist/svelte/Provider.svelte +61 -0
- package/dist/svelte/Provider.svelte.d.ts +19 -0
- package/dist/svelte/Provider.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.d.ts +11 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PasskeyAuth.svelte.js +20 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte.d.ts +9 -0
- package/dist/svelte/auth/PasskeyAuthBasicUI.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.d.ts +12 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/PassphraseAuth.svelte.js +30 -0
- package/dist/svelte/auth/index.d.ts +4 -0
- package/dist/svelte/auth/index.d.ts.map +1 -0
- package/dist/svelte/auth/index.js +3 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.d.ts +6 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.d.ts.map +1 -0
- package/dist/svelte/auth/useIsAuthenticated.svelte.js +22 -0
- package/dist/svelte/index.d.ts +6 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +5 -0
- package/dist/svelte/jazz.class.svelte.d.ts +21 -0
- package/dist/svelte/jazz.class.svelte.d.ts.map +1 -0
- package/dist/svelte/jazz.class.svelte.js +117 -0
- package/dist/svelte/jazz.svelte.d.ts +39 -0
- package/dist/svelte/jazz.svelte.d.ts.map +1 -0
- package/dist/svelte/jazz.svelte.js +70 -0
- package/dist/svelte/testing.d.ts +10 -0
- package/dist/svelte/testing.d.ts.map +1 -0
- package/dist/svelte/testing.js +23 -0
- package/dist/testing.d.ts +1 -42
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/tiptap/index.d.ts +11 -0
- package/dist/tiptap/index.d.ts.map +1 -0
- package/dist/tiptap/index.js +22 -0
- package/dist/tiptap/index.js.map +1 -0
- package/dist/tools/auth/AuthSecretStorage.d.ts.map +1 -0
- package/dist/tools/auth/DemoAuth.d.ts.map +1 -0
- package/dist/tools/auth/InMemoryKVStore.d.ts.map +1 -0
- package/dist/tools/auth/KvStoreContext.d.ts.map +1 -0
- package/dist/tools/auth/PassphraseAuth.d.ts.map +1 -0
- package/dist/tools/auth/clerk/getClerkUsername.d.ts +3 -0
- package/dist/tools/auth/clerk/getClerkUsername.d.ts.map +1 -0
- package/dist/tools/auth/clerk/index.d.ts +25 -0
- package/dist/tools/auth/clerk/index.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/JazzClerkAuth.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/JazzClerkAuth.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/getClerkUsername.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/getClerkUsername.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/tests/types.test.d.ts +2 -0
- package/dist/tools/auth/clerk/tests/types.test.d.ts.map +1 -0
- package/dist/tools/auth/clerk/types.d.ts +32 -0
- package/dist/tools/auth/clerk/types.d.ts.map +1 -0
- package/dist/tools/coValues/CoValueBase.d.ts.map +1 -0
- package/dist/tools/coValues/account.d.ts.map +1 -0
- package/dist/tools/coValues/coFeed.d.ts +377 -0
- package/dist/tools/coValues/coFeed.d.ts.map +1 -0
- package/dist/tools/coValues/coList.d.ts.map +1 -0
- package/dist/tools/coValues/coMap.d.ts +625 -0
- package/dist/tools/coValues/coMap.d.ts.map +1 -0
- package/dist/tools/coValues/coPlainText.d.ts.map +1 -0
- package/dist/tools/coValues/coRichText.d.ts.map +1 -0
- package/dist/tools/coValues/deepLoading.d.ts.map +1 -0
- package/dist/tools/coValues/extensions/imageDef.d.ts.map +1 -0
- package/dist/tools/coValues/group.d.ts.map +1 -0
- package/dist/tools/coValues/inbox.d.ts.map +1 -0
- package/dist/tools/coValues/interfaces.d.ts +116 -0
- package/dist/tools/coValues/interfaces.d.ts.map +1 -0
- package/dist/tools/coValues/profile.d.ts.map +1 -0
- package/dist/tools/coValues/registeredSchemas.d.ts.map +1 -0
- package/dist/tools/coValues/schemaUnion.d.ts.map +1 -0
- package/dist/tools/exports.d.ts +24 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/implementation/ContextManager.d.ts.map +1 -0
- package/dist/tools/implementation/activeAccountContext.d.ts.map +1 -0
- package/dist/tools/implementation/anonymousJazzAgent.d.ts.map +1 -0
- package/dist/tools/implementation/createContext.d.ts.map +1 -0
- package/dist/tools/implementation/devtoolsFormatters.d.ts.map +1 -0
- package/dist/tools/implementation/errors.d.ts.map +1 -0
- package/dist/tools/implementation/inspect.d.ts.map +1 -0
- package/dist/tools/implementation/invites.d.ts.map +1 -0
- package/dist/tools/implementation/refs.d.ts.map +1 -0
- package/dist/tools/implementation/schema.d.ts.map +1 -0
- package/dist/tools/implementation/symbols.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/coExport.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +64 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/unionUtils.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodReExport.d.ts.map +1 -0
- package/dist/tools/implementation/zodSchema/zodSchema.d.ts.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/internal.d.ts.map +1 -0
- package/dist/tools/lib/cache.d.ts.map +1 -0
- package/dist/tools/lib/cache.test.d.ts.map +1 -0
- package/dist/tools/lib/migration.d.ts.map +1 -0
- package/dist/tools/subscribe/CoValueCoreSubscription.d.ts +15 -0
- package/dist/tools/subscribe/CoValueCoreSubscription.d.ts.map +1 -0
- package/dist/tools/subscribe/JazzError.d.ts.map +1 -0
- package/dist/tools/subscribe/SubscriptionScope.d.ts +47 -0
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -0
- package/dist/tools/subscribe/index.d.ts.map +1 -0
- package/dist/tools/subscribe/types.d.ts.map +1 -0
- package/dist/tools/subscribe/utils.d.ts.map +1 -0
- package/dist/tools/testing.d.ts +43 -0
- package/dist/tools/testing.d.ts.map +1 -0
- package/dist/tools/tests/AuthSecretStorage.test.d.ts.map +1 -0
- package/dist/tools/tests/ContextManager.test.d.ts.map +1 -0
- package/dist/tools/tests/DemoAuth.test.d.ts.map +1 -0
- package/dist/tools/tests/PassphraseAuth.test.d.ts.map +1 -0
- package/dist/tools/tests/account.test.d.ts.map +1 -0
- package/dist/tools/tests/coFeed.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coFeed.test.d.ts.map +1 -0
- package/dist/tools/tests/coList.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coList.test.d.ts.map +1 -0
- package/dist/tools/tests/coMap.record.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coMap.record.test.d.ts.map +1 -0
- package/dist/tools/tests/coMap.test-d.d.ts.map +1 -0
- package/dist/tools/tests/coMap.test.d.ts.map +1 -0
- package/dist/tools/tests/coPlainText.test.d.ts.map +1 -0
- package/dist/tools/tests/createContext.test.d.ts.map +1 -0
- package/dist/tools/tests/deepLoading.test.d.ts.map +1 -0
- package/dist/tools/tests/fixtures.d.ts +2 -0
- package/dist/tools/tests/fixtures.d.ts.map +1 -0
- package/dist/tools/tests/groupsAndAccounts.test.d.ts.map +1 -0
- package/dist/tools/tests/imageDef.test.d.ts.map +1 -0
- package/dist/tools/tests/inbox.test.d.ts.map +1 -0
- package/dist/tools/tests/interfaces.test.d.ts.map +1 -0
- package/dist/tools/tests/invites.test.d.ts.map +1 -0
- package/dist/tools/tests/load.test.d.ts.map +1 -0
- package/dist/tools/tests/patterns/notifications.test.d.ts.map +1 -0
- package/dist/tools/tests/patterns/requestToJoin.test.d.ts.map +1 -0
- package/dist/tools/tests/schema.test.d.ts.map +1 -0
- package/dist/tools/tests/schemaUnion.test.d.ts.map +1 -0
- package/dist/tools/tests/subscribe.test.d.ts.map +1 -0
- package/dist/tools/tests/testing.test.d.ts.map +1 -0
- package/dist/tools/tests/utils.d.ts.map +1 -0
- package/dist/tools/tests/zod.test.d.ts.map +1 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/worker/index.d.ts +25 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +93 -0
- package/dist/worker/index.js.map +1 -0
- package/package.json +193 -11
- package/src/browser/BrowserContextManager.ts +85 -0
- package/src/browser/auth/LocalStorageKVStore.ts +21 -0
- package/src/browser/auth/PasskeyAuth.ts +175 -0
- package/src/browser/createBrowserContext.ts +326 -0
- package/src/browser/index.ts +72 -0
- package/src/browser/storageOptions.ts +17 -0
- package/src/browser/tests/LocalStorageKVStore.test.ts +67 -0
- package/src/browser/tests/PasskeyAuth.test.ts +242 -0
- package/src/browser/tests/createInviteLink.test.ts +18 -0
- package/src/browser/tests/storageOptions.test.ts +33 -0
- package/src/browser/tests/utils.ts +93 -0
- package/src/browser/utils/export-account-inspector.ts +58 -0
- package/src/browser-media-images/index.ts +130 -0
- package/src/expo/auth/clerk/README.md +44 -0
- package/src/expo/auth/clerk/index.tsx +80 -0
- package/src/expo/crypto.ts +1 -0
- package/src/expo/index.ts +6 -0
- package/src/expo/provider.tsx +29 -0
- package/src/expo/storage/expo-secure-store-adapter.ts +29 -0
- package/src/expo/storage/expo-sqlite-adapter.ts +94 -0
- package/src/expo/testing.ts +1 -0
- package/src/index.ts +1 -3
- package/src/inspector/custom-element.tsx +63 -0
- package/src/inspector/index.ts +23 -0
- package/src/inspector/register-custom-element.ts +3 -0
- package/src/inspector/ui/badge.tsx +20 -0
- package/src/inspector/ui/button.tsx +81 -0
- package/src/inspector/ui/card.tsx +23 -0
- package/src/inspector/ui/global-styles.tsx +74 -0
- package/src/inspector/ui/grid.tsx +48 -0
- package/src/inspector/ui/heading.tsx +15 -0
- package/src/inspector/ui/icon.tsx +71 -0
- package/src/inspector/ui/icons/chevron-down-icon.tsx +16 -0
- package/src/inspector/ui/icons/delete-icon.tsx +19 -0
- package/src/inspector/ui/icons/link-icon.tsx +18 -0
- package/src/inspector/ui/input.tsx +51 -0
- package/src/inspector/ui/select.tsx +73 -0
- package/src/inspector/ui/table.tsx +90 -0
- package/src/inspector/ui/text.tsx +62 -0
- package/src/inspector/viewer/account-or-group-text.tsx +52 -0
- package/src/inspector/viewer/account-view.tsx +34 -0
- package/src/inspector/viewer/breadcrumbs.tsx +52 -0
- package/src/inspector/viewer/co-stream-view.tsx +374 -0
- package/src/inspector/viewer/grid-view.tsx +90 -0
- package/src/inspector/viewer/group-view.tsx +67 -0
- package/src/inspector/viewer/inpsector-button.tsx +89 -0
- package/src/inspector/viewer/new-app.tsx +172 -0
- package/src/inspector/viewer/page-stack.tsx +56 -0
- package/src/inspector/viewer/page.tsx +199 -0
- package/src/inspector/viewer/raw-data-card.tsx +53 -0
- package/src/inspector/viewer/role-display.tsx +28 -0
- package/src/inspector/viewer/table-viewer.tsx +184 -0
- package/src/inspector/viewer/type-icon.tsx +63 -0
- package/src/inspector/viewer/types.ts +11 -0
- package/src/inspector/viewer/use-open-inspector.ts +18 -0
- package/src/inspector/viewer/use-page-path.ts +65 -0
- package/src/inspector/viewer/use-resolve-covalue.ts +214 -0
- package/src/inspector/viewer/value-renderer.tsx +266 -0
- package/src/prosemirror/index.ts +2 -0
- package/src/prosemirror/lib/converter.ts +50 -0
- package/src/prosemirror/lib/plugin.ts +120 -0
- package/src/prosemirror/lib/sync.ts +96 -0
- package/src/prosemirror/tests/plugin.test.ts +127 -0
- package/src/react/auth/Clerk.tsx +82 -0
- package/src/react/auth/DemoAuth.tsx +121 -0
- package/src/react/auth/PasskeyAuth.tsx +168 -0
- package/src/react/auth/PassphraseAuth.tsx +196 -0
- package/src/react/auth/auth.ts +9 -0
- package/src/react/hooks.tsx +53 -0
- package/src/react/index.ts +16 -0
- package/src/react/media.tsx +74 -0
- package/src/react/provider.tsx +114 -0
- package/src/react/scratch.tsx +50 -0
- package/src/react/ssr.ts +25 -0
- package/src/react/testing.tsx +1 -0
- package/src/react/tests/testUtils.tsx +54 -0
- package/src/react/tests/useAcceptInvite.test.ts +55 -0
- package/src/react-core/auth/DemoAuth.tsx +47 -0
- package/src/react-core/auth/PassphraseAuth.tsx +58 -0
- package/src/react-core/auth/index.ts +2 -0
- package/src/react-core/hooks.ts +310 -0
- package/src/react-core/index.ts +3 -0
- package/src/react-core/provider.tsx +11 -0
- package/src/react-core/testing.tsx +42 -0
- package/src/react-core/tests/testUtils.tsx +65 -0
- package/src/react-core/tests/useAccount.test.ts +238 -0
- package/src/react-core/tests/useCoState.test.ts +553 -0
- package/src/react-core/tests/useDemoAuth.test.tsx +84 -0
- package/src/react-core/tests/useInboxSender.test.ts +58 -0
- package/src/react-core/tests/useIsAuthenticated.test.ts +34 -0
- package/src/react-core/tests/usePassPhraseAuth.test.ts +180 -0
- package/src/react-core/utils.ts +28 -0
- package/src/react-native/crypto.ts +1 -0
- package/src/react-native/index.ts +5 -0
- package/src/react-native/provider.tsx +30 -0
- package/src/react-native/storage/mmkv-store-adapter.ts +24 -0
- package/src/react-native/storage/op-sqlite-adapter.ts +79 -0
- package/src/react-native/testing.ts +1 -0
- package/src/react-native-core/ReactNativeContextManager.ts +84 -0
- package/src/react-native-core/auth/DemoAuthUI.tsx +202 -0
- package/src/react-native-core/auth/auth.ts +14 -0
- package/src/react-native-core/crypto/RNQuickCrypto.ts +92 -0
- package/src/react-native-core/crypto/index.ts +1 -0
- package/src/react-native-core/hooks.tsx +64 -0
- package/src/react-native-core/index.ts +9 -0
- package/src/react-native-core/media.tsx +79 -0
- package/src/react-native-core/platform.ts +250 -0
- package/src/react-native-core/provider.tsx +115 -0
- package/src/react-native-core/storage/sqlite-react-native.ts +19 -0
- package/src/react-native-core/testing.tsx +1 -0
- package/src/react-native-media-images/index.ts +238 -0
- package/src/svelte/Provider.svelte +61 -0
- package/src/svelte/auth/PasskeyAuth.svelte.ts +42 -0
- package/src/svelte/auth/PasskeyAuthBasicUI.svelte +81 -0
- package/src/svelte/auth/PassphraseAuth.svelte.ts +49 -0
- package/src/svelte/auth/index.ts +3 -0
- package/src/svelte/auth/useIsAuthenticated.svelte.ts +28 -0
- package/src/svelte/index.ts +5 -0
- package/src/svelte/jazz.class.svelte.ts +172 -0
- package/src/svelte/jazz.svelte.ts +109 -0
- package/src/svelte/testing.ts +42 -0
- package/src/testing.ts +1 -312
- package/src/tiptap/index.ts +28 -0
- package/src/tools/auth/KvStoreContext.ts +39 -0
- package/src/tools/auth/clerk/getClerkUsername.ts +36 -0
- package/src/tools/auth/clerk/index.ts +174 -0
- package/src/tools/auth/clerk/tests/JazzClerkAuth.test.ts +284 -0
- package/src/tools/auth/clerk/tests/getClerkUsername.test.ts +81 -0
- package/src/tools/auth/clerk/tests/types.test.ts +49 -0
- package/src/tools/auth/clerk/types.ts +56 -0
- package/src/tools/coValues/coFeed.ts +981 -0
- package/src/tools/coValues/coMap.ts +929 -0
- package/src/tools/coValues/interfaces.ts +464 -0
- package/src/tools/exports.ts +117 -0
- package/src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts +188 -0
- package/src/tools/implementation/zodSchema/zodCo.ts +370 -0
- package/src/tools/index.ts +8 -0
- package/src/tools/subscribe/CoValueCoreSubscription.ts +74 -0
- package/src/tools/subscribe/SubscriptionScope.ts +626 -0
- package/src/tools/testing.ts +301 -0
- package/src/tools/tests/coFeed.test.ts +840 -0
- package/src/tools/tests/coMap.test.ts +2113 -0
- package/src/tools/tests/fixtures.ts +2050 -0
- package/src/tools/tests/load.test.ts +117 -0
- package/src/worker/index.ts +127 -0
- package/tsconfig.json +10 -3
- package/tsconfig.svelte.json +6 -0
- package/tsup.config.ts +143 -9
- package/dist/auth/AuthSecretStorage.d.ts.map +0 -1
- package/dist/auth/DemoAuth.d.ts.map +0 -1
- package/dist/auth/InMemoryKVStore.d.ts.map +0 -1
- package/dist/auth/KvStoreContext.d.ts.map +0 -1
- package/dist/auth/PassphraseAuth.d.ts.map +0 -1
- package/dist/chunk-AUQIX4E7.js +0 -4827
- package/dist/chunk-AUQIX4E7.js.map +0 -1
- package/dist/coValues/CoValueBase.d.ts.map +0 -1
- package/dist/coValues/account.d.ts.map +0 -1
- package/dist/coValues/coFeed.d.ts +0 -368
- package/dist/coValues/coFeed.d.ts.map +0 -1
- package/dist/coValues/coList.d.ts.map +0 -1
- package/dist/coValues/coMap.d.ts +0 -529
- package/dist/coValues/coMap.d.ts.map +0 -1
- package/dist/coValues/coPlainText.d.ts.map +0 -1
- package/dist/coValues/coRichText.d.ts.map +0 -1
- package/dist/coValues/deepLoading.d.ts.map +0 -1
- package/dist/coValues/extensions/imageDef.d.ts.map +0 -1
- package/dist/coValues/group.d.ts.map +0 -1
- package/dist/coValues/inbox.d.ts.map +0 -1
- package/dist/coValues/interfaces.d.ts +0 -113
- package/dist/coValues/interfaces.d.ts.map +0 -1
- package/dist/coValues/profile.d.ts.map +0 -1
- package/dist/coValues/registeredSchemas.d.ts.map +0 -1
- package/dist/coValues/schemaUnion.d.ts.map +0 -1
- package/dist/exports.d.ts +0 -23
- package/dist/exports.d.ts.map +0 -1
- package/dist/implementation/ContextManager.d.ts.map +0 -1
- package/dist/implementation/activeAccountContext.d.ts.map +0 -1
- package/dist/implementation/anonymousJazzAgent.d.ts.map +0 -1
- package/dist/implementation/createContext.d.ts.map +0 -1
- package/dist/implementation/devtoolsFormatters.d.ts.map +0 -1
- package/dist/implementation/errors.d.ts.map +0 -1
- package/dist/implementation/inspect.d.ts.map +0 -1
- package/dist/implementation/invites.d.ts.map +0 -1
- package/dist/implementation/refs.d.ts.map +0 -1
- package/dist/implementation/schema.d.ts.map +0 -1
- package/dist/implementation/symbols.d.ts.map +0 -1
- package/dist/implementation/zodSchema/coExport.d.ts.map +0 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +0 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +0 -52
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +0 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +0 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodCo.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts.map +0 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts.map +0 -1
- package/dist/internal.d.ts.map +0 -1
- package/dist/lib/cache.d.ts.map +0 -1
- package/dist/lib/cache.test.d.ts.map +0 -1
- package/dist/lib/migration.d.ts.map +0 -1
- package/dist/subscribe/CoValueCoreSubscription.d.ts +0 -14
- package/dist/subscribe/CoValueCoreSubscription.d.ts.map +0 -1
- package/dist/subscribe/JazzError.d.ts.map +0 -1
- package/dist/subscribe/SubscriptionScope.d.ts +0 -46
- package/dist/subscribe/SubscriptionScope.d.ts.map +0 -1
- package/dist/subscribe/index.d.ts.map +0 -1
- package/dist/subscribe/types.d.ts.map +0 -1
- package/dist/subscribe/utils.d.ts.map +0 -1
- package/dist/tests/AuthSecretStorage.test.d.ts.map +0 -1
- package/dist/tests/ContextManager.test.d.ts.map +0 -1
- package/dist/tests/DemoAuth.test.d.ts.map +0 -1
- package/dist/tests/PassphraseAuth.test.d.ts.map +0 -1
- package/dist/tests/account.test.d.ts.map +0 -1
- package/dist/tests/coFeed.test-d.d.ts.map +0 -1
- package/dist/tests/coFeed.test.d.ts.map +0 -1
- package/dist/tests/coList.test-d.d.ts.map +0 -1
- package/dist/tests/coList.test.d.ts.map +0 -1
- package/dist/tests/coMap.record.test-d.d.ts.map +0 -1
- package/dist/tests/coMap.record.test.d.ts.map +0 -1
- package/dist/tests/coMap.test-d.d.ts.map +0 -1
- package/dist/tests/coMap.test.d.ts.map +0 -1
- package/dist/tests/coPlainText.test.d.ts.map +0 -1
- package/dist/tests/createContext.test.d.ts.map +0 -1
- package/dist/tests/deepLoading.test.d.ts.map +0 -1
- package/dist/tests/fixtures.d.ts.map +0 -1
- package/dist/tests/groupsAndAccounts.test.d.ts.map +0 -1
- package/dist/tests/imageDef.test.d.ts.map +0 -1
- package/dist/tests/inbox.test.d.ts.map +0 -1
- package/dist/tests/interfaces.test.d.ts.map +0 -1
- package/dist/tests/invites.test.d.ts.map +0 -1
- package/dist/tests/load.test.d.ts.map +0 -1
- package/dist/tests/patterns/notifications.test.d.ts.map +0 -1
- package/dist/tests/patterns/requestToJoin.test.d.ts.map +0 -1
- package/dist/tests/schema.test.d.ts.map +0 -1
- package/dist/tests/schemaUnion.test.d.ts.map +0 -1
- package/dist/tests/subscribe.test.d.ts.map +0 -1
- package/dist/tests/testing.test.d.ts.map +0 -1
- package/dist/tests/utils.d.ts.map +0 -1
- package/dist/tests/zod.test.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/src/coValues/coFeed.ts +0 -943
- package/src/coValues/coMap.ts +0 -825
- package/src/coValues/interfaces.ts +0 -454
- package/src/exports.ts +0 -108
- package/src/implementation/zodSchema/schemaTypes/CoMapSchema.ts +0 -150
- package/src/implementation/zodSchema/zodCo.ts +0 -364
- package/src/subscribe/CoValueCoreSubscription.ts +0 -71
- package/src/subscribe/SubscriptionScope.ts +0 -614
- package/src/tests/coFeed.test.ts +0 -771
- package/src/tests/coMap.test.ts +0 -1637
- package/src/tests/load.test.ts +0 -116
- /package/dist/{tests → react-core/tests}/fixtures.d.ts +0 -0
- /package/dist/{auth → tools/auth}/AuthSecretStorage.d.ts +0 -0
- /package/dist/{auth → tools/auth}/DemoAuth.d.ts +0 -0
- /package/dist/{auth → tools/auth}/InMemoryKVStore.d.ts +0 -0
- /package/dist/{auth → tools/auth}/KvStoreContext.d.ts +0 -0
- /package/dist/{auth → tools/auth}/PassphraseAuth.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/CoValueBase.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/account.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coList.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coPlainText.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/coRichText.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/deepLoading.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/extensions/imageDef.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/group.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/inbox.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/profile.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/registeredSchemas.d.ts +0 -0
- /package/dist/{coValues → tools/coValues}/schemaUnion.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/ContextManager.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/activeAccountContext.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/anonymousJazzAgent.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/createContext.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/devtoolsFormatters.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/errors.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/inspect.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/invites.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/refs.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/schema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/symbols.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/coExport.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/AccountSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoFeedSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoListSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/CoRecordSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/FileStreamSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/PlainTextSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/schemaTypes/RichTextSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/unionUtils.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodCo.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodReExport.d.ts +0 -0
- /package/dist/{implementation → tools/implementation}/zodSchema/zodSchema.d.ts +0 -0
- /package/dist/{internal.d.ts → tools/internal.d.ts} +0 -0
- /package/dist/{lib → tools/lib}/cache.d.ts +0 -0
- /package/dist/{lib → tools/lib}/cache.test.d.ts +0 -0
- /package/dist/{lib → tools/lib}/migration.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/JazzError.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/index.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/types.d.ts +0 -0
- /package/dist/{subscribe → tools/subscribe}/utils.d.ts +0 -0
- /package/dist/{tests → tools/tests}/AuthSecretStorage.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/ContextManager.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/DemoAuth.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/PassphraseAuth.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/account.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coFeed.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coFeed.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coList.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coList.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.record.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.record.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.test-d.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coMap.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/coPlainText.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/createContext.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/deepLoading.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/groupsAndAccounts.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/imageDef.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/inbox.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/interfaces.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/invites.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/load.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/patterns/notifications.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/patterns/requestToJoin.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/schema.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/schemaUnion.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/subscribe.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/testing.test.d.ts +0 -0
- /package/dist/{tests → tools/tests}/utils.d.ts +0 -0
- /package/dist/{tests → tools/tests}/zod.test.d.ts +0 -0
- /package/dist/{types.d.ts → tools/types.d.ts} +0 -0
- /package/src/{tests → react-core/tests}/fixtures.ts +0 -0
- /package/src/{auth/KvStoreContext.ts → react-native-core/storage/kv-store-context.ts} +0 -0
- /package/src/{auth → tools/auth}/AuthSecretStorage.ts +0 -0
- /package/src/{auth → tools/auth}/DemoAuth.ts +0 -0
- /package/src/{auth → tools/auth}/InMemoryKVStore.ts +0 -0
- /package/src/{auth → tools/auth}/PassphraseAuth.ts +0 -0
- /package/src/{coValues → tools/coValues}/CoValueBase.ts +0 -0
- /package/src/{coValues → tools/coValues}/account.ts +0 -0
- /package/src/{coValues → tools/coValues}/coList.ts +0 -0
- /package/src/{coValues → tools/coValues}/coPlainText.ts +0 -0
- /package/src/{coValues → tools/coValues}/coRichText.ts +0 -0
- /package/src/{coValues → tools/coValues}/deepLoading.ts +0 -0
- /package/src/{coValues → tools/coValues}/extensions/imageDef.ts +0 -0
- /package/src/{coValues → tools/coValues}/group.ts +0 -0
- /package/src/{coValues → tools/coValues}/inbox.ts +0 -0
- /package/src/{coValues → tools/coValues}/profile.ts +0 -0
- /package/src/{coValues → tools/coValues}/registeredSchemas.ts +0 -0
- /package/src/{coValues → tools/coValues}/schemaUnion.ts +0 -0
- /package/src/{implementation → tools/implementation}/ContextManager.ts +0 -0
- /package/src/{implementation → tools/implementation}/activeAccountContext.ts +0 -0
- /package/src/{implementation → tools/implementation}/anonymousJazzAgent.ts +0 -0
- /package/src/{implementation → tools/implementation}/createContext.ts +0 -0
- /package/src/{implementation → tools/implementation}/devtoolsFormatters.ts +0 -0
- /package/src/{implementation → tools/implementation}/errors.ts +0 -0
- /package/src/{implementation → tools/implementation}/inspect.ts +0 -0
- /package/src/{implementation → tools/implementation}/invites.ts +0 -0
- /package/src/{implementation → tools/implementation}/refs.ts +0 -0
- /package/src/{implementation → tools/implementation}/schema.ts +0 -0
- /package/src/{implementation → tools/implementation}/symbols.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/coExport.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/AccountSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoFeedSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoListSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/CoRecordSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/FileStreamSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/PlainTextSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/schemaTypes/RichTextSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/unionUtils.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodReExport.ts +0 -0
- /package/src/{implementation → tools/implementation}/zodSchema/zodSchema.ts +0 -0
- /package/src/{internal.ts → tools/internal.ts} +0 -0
- /package/src/{lib → tools/lib}/cache.test.ts +0 -0
- /package/src/{lib → tools/lib}/cache.ts +0 -0
- /package/src/{lib → tools/lib}/migration.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/JazzError.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/index.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/types.ts +0 -0
- /package/src/{subscribe → tools/subscribe}/utils.ts +0 -0
- /package/src/{tests → tools/tests}/AuthSecretStorage.test.ts +0 -0
- /package/src/{tests → tools/tests}/ContextManager.test.ts +0 -0
- /package/src/{tests → tools/tests}/DemoAuth.test.ts +0 -0
- /package/src/{tests → tools/tests}/PassphraseAuth.test.ts +0 -0
- /package/src/{tests → tools/tests}/account.test.ts +0 -0
- /package/src/{tests → tools/tests}/coFeed.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coList.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coList.test.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.record.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.record.test.ts +0 -0
- /package/src/{tests → tools/tests}/coMap.test-d.ts +0 -0
- /package/src/{tests → tools/tests}/coPlainText.test.ts +0 -0
- /package/src/{tests → tools/tests}/createContext.test.ts +0 -0
- /package/src/{tests → tools/tests}/deepLoading.test.ts +0 -0
- /package/src/{tests → tools/tests}/groupsAndAccounts.test.ts +0 -0
- /package/src/{tests → tools/tests}/imageDef.test.ts +0 -0
- /package/src/{tests → tools/tests}/inbox.test.ts +0 -0
- /package/src/{tests → tools/tests}/interfaces.test.ts +0 -0
- /package/src/{tests → tools/tests}/invites.test.ts +0 -0
- /package/src/{tests → tools/tests}/patterns/notifications.test.ts +0 -0
- /package/src/{tests → tools/tests}/patterns/requestToJoin.test.ts +0 -0
- /package/src/{tests → tools/tests}/schema.test.ts +0 -0
- /package/src/{tests → tools/tests}/schemaUnion.test.ts +0 -0
- /package/src/{tests → tools/tests}/subscribe.test.ts +0 -0
- /package/src/{tests → tools/tests}/testing.test.ts +0 -0
- /package/src/{tests → tools/tests}/utils.ts +0 -0
- /package/src/{tests → tools/tests}/zod.test.ts +0 -0
- /package/src/{types.ts → tools/types.ts} +0 -0
@@ -1,454 +0,0 @@
|
|
1
|
-
import type { CoValueUniqueness, RawCoValue } from "cojson";
|
2
|
-
import {
|
3
|
-
type Account,
|
4
|
-
AnonymousJazzAgent,
|
5
|
-
CoValueOrZodSchema,
|
6
|
-
type Group,
|
7
|
-
Loaded,
|
8
|
-
RefsToResolve,
|
9
|
-
RefsToResolveStrict,
|
10
|
-
RegisteredSchemas,
|
11
|
-
ResolveQuery,
|
12
|
-
ResolveQueryStrict,
|
13
|
-
Resolved,
|
14
|
-
SubscriptionScope,
|
15
|
-
type SubscriptionValue,
|
16
|
-
activeAccountContext,
|
17
|
-
anySchemaToCoSchema,
|
18
|
-
inspect,
|
19
|
-
} from "../internal.js";
|
20
|
-
|
21
|
-
/** @category Abstract interfaces */
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
23
|
-
export interface CoValueClass<Value extends CoValue = CoValue> {
|
24
|
-
/** @ignore */
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
26
|
-
new (...args: any[]): Value;
|
27
|
-
}
|
28
|
-
|
29
|
-
export interface CoValueFromRaw<V extends CoValue> {
|
30
|
-
fromRaw(raw: V["_raw"]): V;
|
31
|
-
}
|
32
|
-
|
33
|
-
/** @category Abstract interfaces */
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
35
|
-
export interface CoValue {
|
36
|
-
/** @category Content */
|
37
|
-
readonly id: ID<this>;
|
38
|
-
/** @category Type Helpers */
|
39
|
-
_type: string;
|
40
|
-
/** @category Collaboration */
|
41
|
-
_owner: Account | Group;
|
42
|
-
/** @category Internals */
|
43
|
-
_raw: RawCoValue;
|
44
|
-
|
45
|
-
/** @internal */
|
46
|
-
_subscriptionScope?: SubscriptionScope<this>;
|
47
|
-
|
48
|
-
/** @internal */
|
49
|
-
readonly _loadedAs: Account | AnonymousJazzAgent;
|
50
|
-
/** @category Stringifying & Inspection */
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
52
|
-
toJSON(key?: string, seenAbove?: ID<CoValue>[]): any[] | object | string;
|
53
|
-
/** @category Stringifying & Inspection */
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
55
|
-
[inspect](): any;
|
56
|
-
}
|
57
|
-
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
59
|
-
export function isCoValue(value: any): value is CoValue {
|
60
|
-
return value && value._type !== undefined;
|
61
|
-
}
|
62
|
-
|
63
|
-
export function isCoValueClass<V extends CoValue>(
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
65
|
-
value: any,
|
66
|
-
): value is CoValueClass<V> & CoValueFromRaw<V> {
|
67
|
-
return typeof value === "function" && value.fromRaw !== undefined;
|
68
|
-
}
|
69
|
-
|
70
|
-
/**
|
71
|
-
* IDs are unique identifiers for `CoValue`s.
|
72
|
-
* Can be used with a type argument to refer to a specific `CoValue` type.
|
73
|
-
*
|
74
|
-
* @example
|
75
|
-
*
|
76
|
-
* ```ts
|
77
|
-
* type AccountID = ID<Account>;
|
78
|
-
* ```
|
79
|
-
*
|
80
|
-
* @category CoValues
|
81
|
-
*/
|
82
|
-
export type ID<T> = string;
|
83
|
-
|
84
|
-
export function loadCoValueWithoutMe<
|
85
|
-
V extends CoValue,
|
86
|
-
const R extends RefsToResolve<V>,
|
87
|
-
>(
|
88
|
-
cls: CoValueClass<V>,
|
89
|
-
id: ID<CoValue>,
|
90
|
-
options?: {
|
91
|
-
resolve?: RefsToResolveStrict<V, R>;
|
92
|
-
loadAs?: Account | AnonymousJazzAgent;
|
93
|
-
},
|
94
|
-
): Promise<Resolved<V, R> | null> {
|
95
|
-
return loadCoValue(cls, id, {
|
96
|
-
...options,
|
97
|
-
loadAs: options?.loadAs ?? activeAccountContext.get(),
|
98
|
-
});
|
99
|
-
}
|
100
|
-
|
101
|
-
export function loadCoValue<
|
102
|
-
V extends CoValue,
|
103
|
-
const R extends RefsToResolve<V>,
|
104
|
-
>(
|
105
|
-
cls: CoValueClass<V>,
|
106
|
-
id: ID<CoValue>,
|
107
|
-
options: {
|
108
|
-
resolve?: RefsToResolveStrict<V, R>;
|
109
|
-
loadAs: Account | AnonymousJazzAgent;
|
110
|
-
},
|
111
|
-
): Promise<Resolved<V, R> | null> {
|
112
|
-
return new Promise((resolve) => {
|
113
|
-
subscribeToCoValue<V, R>(
|
114
|
-
cls,
|
115
|
-
id,
|
116
|
-
{
|
117
|
-
resolve: options.resolve,
|
118
|
-
loadAs: options.loadAs,
|
119
|
-
syncResolution: true,
|
120
|
-
onUnavailable: () => {
|
121
|
-
resolve(null);
|
122
|
-
},
|
123
|
-
onUnauthorized: () => {
|
124
|
-
resolve(null);
|
125
|
-
},
|
126
|
-
},
|
127
|
-
(value, unsubscribe) => {
|
128
|
-
resolve(value);
|
129
|
-
unsubscribe();
|
130
|
-
},
|
131
|
-
);
|
132
|
-
});
|
133
|
-
}
|
134
|
-
|
135
|
-
export async function ensureCoValueLoaded<
|
136
|
-
V extends CoValue,
|
137
|
-
const R extends RefsToResolve<V>,
|
138
|
-
>(
|
139
|
-
existing: V,
|
140
|
-
options?: { resolve?: RefsToResolveStrict<V, R> } | undefined,
|
141
|
-
): Promise<Resolved<V, R>> {
|
142
|
-
const response = await loadCoValue(
|
143
|
-
existing.constructor as CoValueClass<V>,
|
144
|
-
existing.id,
|
145
|
-
{
|
146
|
-
loadAs: existing._loadedAs,
|
147
|
-
resolve: options?.resolve,
|
148
|
-
},
|
149
|
-
);
|
150
|
-
|
151
|
-
if (!response) {
|
152
|
-
throw new Error("Failed to deeply load CoValue " + existing.id);
|
153
|
-
}
|
154
|
-
|
155
|
-
return response;
|
156
|
-
}
|
157
|
-
|
158
|
-
type SubscribeListener<V extends CoValue, R extends RefsToResolve<V>> = (
|
159
|
-
value: Resolved<V, R>,
|
160
|
-
unsubscribe: () => void,
|
161
|
-
) => void;
|
162
|
-
|
163
|
-
export type SubscribeListenerOptions<
|
164
|
-
V extends CoValue,
|
165
|
-
R extends RefsToResolve<V>,
|
166
|
-
> = {
|
167
|
-
resolve?: RefsToResolveStrict<V, R>;
|
168
|
-
loadAs?: Account | AnonymousJazzAgent;
|
169
|
-
onUnauthorized?: () => void;
|
170
|
-
onUnavailable?: () => void;
|
171
|
-
};
|
172
|
-
|
173
|
-
export type SubscribeRestArgs<V extends CoValue, R extends RefsToResolve<V>> =
|
174
|
-
| [options: SubscribeListenerOptions<V, R>, listener: SubscribeListener<V, R>]
|
175
|
-
| [listener: SubscribeListener<V, R>];
|
176
|
-
|
177
|
-
export function parseSubscribeRestArgs<
|
178
|
-
V extends CoValue,
|
179
|
-
R extends RefsToResolve<V>,
|
180
|
-
>(
|
181
|
-
args: SubscribeRestArgs<V, R>,
|
182
|
-
): {
|
183
|
-
options: SubscribeListenerOptions<V, R>;
|
184
|
-
listener: SubscribeListener<V, R>;
|
185
|
-
} {
|
186
|
-
if (args.length === 2) {
|
187
|
-
if (
|
188
|
-
typeof args[0] === "object" &&
|
189
|
-
args[0] &&
|
190
|
-
typeof args[1] === "function"
|
191
|
-
) {
|
192
|
-
return {
|
193
|
-
options: {
|
194
|
-
resolve: args[0].resolve,
|
195
|
-
loadAs: args[0].loadAs,
|
196
|
-
onUnauthorized: args[0].onUnauthorized,
|
197
|
-
onUnavailable: args[0].onUnavailable,
|
198
|
-
},
|
199
|
-
listener: args[1],
|
200
|
-
};
|
201
|
-
} else {
|
202
|
-
throw new Error("Invalid arguments");
|
203
|
-
}
|
204
|
-
} else {
|
205
|
-
if (typeof args[0] === "function") {
|
206
|
-
return { options: {}, listener: args[0] };
|
207
|
-
} else {
|
208
|
-
throw new Error("Invalid arguments");
|
209
|
-
}
|
210
|
-
}
|
211
|
-
}
|
212
|
-
|
213
|
-
export function subscribeToCoValueWithoutMe<
|
214
|
-
V extends CoValue,
|
215
|
-
const R extends RefsToResolve<V>,
|
216
|
-
>(
|
217
|
-
cls: CoValueClass<V>,
|
218
|
-
id: ID<CoValue>,
|
219
|
-
options: SubscribeListenerOptions<V, R>,
|
220
|
-
listener: SubscribeListener<V, R>,
|
221
|
-
) {
|
222
|
-
return subscribeToCoValue(
|
223
|
-
cls,
|
224
|
-
id,
|
225
|
-
{
|
226
|
-
...options,
|
227
|
-
loadAs: options.loadAs ?? activeAccountContext.get(),
|
228
|
-
},
|
229
|
-
listener,
|
230
|
-
);
|
231
|
-
}
|
232
|
-
|
233
|
-
export function subscribeToCoValue<
|
234
|
-
V extends CoValue,
|
235
|
-
const R extends RefsToResolve<V>,
|
236
|
-
>(
|
237
|
-
cls: CoValueClass<V>,
|
238
|
-
id: ID<CoValue>,
|
239
|
-
options: {
|
240
|
-
resolve?: RefsToResolveStrict<V, R>;
|
241
|
-
loadAs: Account | AnonymousJazzAgent;
|
242
|
-
onUnavailable?: () => void;
|
243
|
-
onUnauthorized?: () => void;
|
244
|
-
syncResolution?: boolean;
|
245
|
-
},
|
246
|
-
listener: SubscribeListener<V, R>,
|
247
|
-
): () => void {
|
248
|
-
const loadAs = options.loadAs ?? activeAccountContext.get();
|
249
|
-
const node = "node" in loadAs ? loadAs.node : loadAs._raw.core.node;
|
250
|
-
|
251
|
-
const resolve = options.resolve ?? true;
|
252
|
-
|
253
|
-
let unsubscribed = false;
|
254
|
-
|
255
|
-
const rootNode = new SubscriptionScope<V>(node, resolve, id as ID<V>, {
|
256
|
-
ref: cls,
|
257
|
-
optional: false,
|
258
|
-
});
|
259
|
-
|
260
|
-
const handleUpdate = (value: SubscriptionValue<V, any>) => {
|
261
|
-
if (unsubscribed) return;
|
262
|
-
|
263
|
-
if (value.type === "unavailable") {
|
264
|
-
options.onUnavailable?.();
|
265
|
-
|
266
|
-
console.error(value.toString());
|
267
|
-
} else if (value.type === "unauthorized") {
|
268
|
-
options.onUnauthorized?.();
|
269
|
-
|
270
|
-
console.error(value.toString());
|
271
|
-
} else if (value.type === "loaded") {
|
272
|
-
listener(value.value as Resolved<V, R>, unsubscribe);
|
273
|
-
}
|
274
|
-
};
|
275
|
-
|
276
|
-
let shouldDefer = !options.syncResolution;
|
277
|
-
|
278
|
-
rootNode.setListener((value) => {
|
279
|
-
if (shouldDefer) {
|
280
|
-
shouldDefer = false;
|
281
|
-
Promise.resolve().then(() => {
|
282
|
-
handleUpdate(value);
|
283
|
-
});
|
284
|
-
} else {
|
285
|
-
handleUpdate(value);
|
286
|
-
}
|
287
|
-
});
|
288
|
-
|
289
|
-
function unsubscribe() {
|
290
|
-
unsubscribed = true;
|
291
|
-
rootNode.destroy();
|
292
|
-
}
|
293
|
-
|
294
|
-
return unsubscribe;
|
295
|
-
}
|
296
|
-
|
297
|
-
/**
|
298
|
-
* @deprecated Used for the React integration in the past, but we moved to use SubscriptionScope directly.
|
299
|
-
*
|
300
|
-
* Going to be removed in the next minor version.
|
301
|
-
*/
|
302
|
-
export function createCoValueObservable<
|
303
|
-
S extends CoValueOrZodSchema,
|
304
|
-
const R extends ResolveQuery<S>,
|
305
|
-
>(initialValue: undefined | null = undefined) {
|
306
|
-
let currentValue: Loaded<S, R> | undefined | null = initialValue;
|
307
|
-
let subscriberCount = 0;
|
308
|
-
|
309
|
-
function subscribe(
|
310
|
-
cls: S,
|
311
|
-
id: string,
|
312
|
-
options: {
|
313
|
-
loadAs: Account | AnonymousJazzAgent;
|
314
|
-
resolve?: ResolveQueryStrict<S, R>;
|
315
|
-
onUnavailable?: () => void;
|
316
|
-
onUnauthorized?: () => void;
|
317
|
-
syncResolution?: boolean;
|
318
|
-
},
|
319
|
-
listener: () => void,
|
320
|
-
) {
|
321
|
-
subscriberCount++;
|
322
|
-
|
323
|
-
const unsubscribe = subscribeToCoValue(
|
324
|
-
anySchemaToCoSchema(cls),
|
325
|
-
id,
|
326
|
-
{
|
327
|
-
loadAs: options.loadAs,
|
328
|
-
resolve: options.resolve as any,
|
329
|
-
onUnavailable: () => {
|
330
|
-
currentValue = null;
|
331
|
-
options.onUnavailable?.();
|
332
|
-
},
|
333
|
-
onUnauthorized: () => {
|
334
|
-
currentValue = null;
|
335
|
-
options.onUnauthorized?.();
|
336
|
-
},
|
337
|
-
syncResolution: options.syncResolution,
|
338
|
-
},
|
339
|
-
(value) => {
|
340
|
-
currentValue = value as Loaded<S, R>;
|
341
|
-
listener();
|
342
|
-
},
|
343
|
-
);
|
344
|
-
|
345
|
-
return () => {
|
346
|
-
unsubscribe();
|
347
|
-
subscriberCount--;
|
348
|
-
if (subscriberCount === 0) {
|
349
|
-
currentValue = undefined;
|
350
|
-
}
|
351
|
-
};
|
352
|
-
}
|
353
|
-
|
354
|
-
const observable = {
|
355
|
-
getCurrentValue: () => currentValue,
|
356
|
-
subscribe,
|
357
|
-
};
|
358
|
-
|
359
|
-
return observable;
|
360
|
-
}
|
361
|
-
|
362
|
-
export function subscribeToExistingCoValue<
|
363
|
-
V extends CoValue,
|
364
|
-
const R extends RefsToResolve<V>,
|
365
|
-
>(
|
366
|
-
existing: V,
|
367
|
-
options:
|
368
|
-
| {
|
369
|
-
resolve?: RefsToResolveStrict<V, R>;
|
370
|
-
onUnavailable?: () => void;
|
371
|
-
onUnauthorized?: () => void;
|
372
|
-
}
|
373
|
-
| undefined,
|
374
|
-
listener: SubscribeListener<V, R>,
|
375
|
-
): () => void {
|
376
|
-
return subscribeToCoValue(
|
377
|
-
existing.constructor as CoValueClass<V>,
|
378
|
-
existing.id,
|
379
|
-
{
|
380
|
-
loadAs: existing._loadedAs,
|
381
|
-
resolve: options?.resolve,
|
382
|
-
onUnavailable: options?.onUnavailable,
|
383
|
-
onUnauthorized: options?.onUnauthorized,
|
384
|
-
},
|
385
|
-
listener,
|
386
|
-
);
|
387
|
-
}
|
388
|
-
|
389
|
-
export function isAccountInstance(instance: unknown): instance is Account {
|
390
|
-
if (typeof instance !== "object" || instance === null) {
|
391
|
-
return false;
|
392
|
-
}
|
393
|
-
|
394
|
-
return "_type" in instance && instance._type === "Account";
|
395
|
-
}
|
396
|
-
|
397
|
-
export function isAnonymousAgentInstance(
|
398
|
-
instance: unknown,
|
399
|
-
): instance is AnonymousJazzAgent {
|
400
|
-
if (typeof instance !== "object" || instance === null) {
|
401
|
-
return false;
|
402
|
-
}
|
403
|
-
|
404
|
-
return "_type" in instance && instance._type === "Anonymous";
|
405
|
-
}
|
406
|
-
|
407
|
-
export function parseCoValueCreateOptions(
|
408
|
-
options:
|
409
|
-
| {
|
410
|
-
owner?: Account | Group;
|
411
|
-
unique?: CoValueUniqueness["uniqueness"];
|
412
|
-
}
|
413
|
-
| Account
|
414
|
-
| Group
|
415
|
-
| undefined,
|
416
|
-
) {
|
417
|
-
const Group = RegisteredSchemas["Group"];
|
418
|
-
|
419
|
-
if (!options) {
|
420
|
-
return { owner: Group.create(), uniqueness: undefined };
|
421
|
-
}
|
422
|
-
|
423
|
-
if ("_type" in options) {
|
424
|
-
if (options._type === "Account" || options._type === "Group") {
|
425
|
-
return { owner: options, uniqueness: undefined };
|
426
|
-
}
|
427
|
-
}
|
428
|
-
|
429
|
-
const uniqueness = options.unique
|
430
|
-
? { uniqueness: options.unique }
|
431
|
-
: undefined;
|
432
|
-
|
433
|
-
return {
|
434
|
-
owner: options.owner ?? Group.create(),
|
435
|
-
uniqueness,
|
436
|
-
};
|
437
|
-
}
|
438
|
-
|
439
|
-
export function parseGroupCreateOptions(
|
440
|
-
options:
|
441
|
-
| {
|
442
|
-
owner?: Account;
|
443
|
-
}
|
444
|
-
| Account
|
445
|
-
| undefined,
|
446
|
-
) {
|
447
|
-
if (!options) {
|
448
|
-
return { owner: activeAccountContext.get() };
|
449
|
-
}
|
450
|
-
|
451
|
-
return "_type" in options && isAccountInstance(options)
|
452
|
-
? { owner: options }
|
453
|
-
: { owner: options.owner ?? activeAccountContext.get() };
|
454
|
-
}
|
package/src/exports.ts
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
export type {
|
2
|
-
AgentID,
|
3
|
-
CoValueUniqueness,
|
4
|
-
CryptoProvider,
|
5
|
-
InviteSecret,
|
6
|
-
Peer,
|
7
|
-
SessionID,
|
8
|
-
SyncMessage,
|
9
|
-
} from "cojson";
|
10
|
-
|
11
|
-
export * as z from "./implementation/zodSchema/zodReExport.js";
|
12
|
-
|
13
|
-
export type { CoValue, ID } from "./internal.js";
|
14
|
-
|
15
|
-
export { Encoders, coField } from "./internal.js";
|
16
|
-
|
17
|
-
export { Inbox, InboxSender } from "./internal.js";
|
18
|
-
|
19
|
-
export { Group } from "./internal.js";
|
20
|
-
export { CoValueBase } from "./internal.js";
|
21
|
-
export { Profile } from "./internal.js";
|
22
|
-
export { SchemaUnion } from "./internal.js";
|
23
|
-
|
24
|
-
export { co } from "./internal.js";
|
25
|
-
|
26
|
-
export type {
|
27
|
-
CoValueClass,
|
28
|
-
CoValueFromRaw,
|
29
|
-
DeeplyLoaded,
|
30
|
-
Resolved,
|
31
|
-
RefsToResolve,
|
32
|
-
RefsToResolveStrict,
|
33
|
-
CoMapInit,
|
34
|
-
CoFeedEntry,
|
35
|
-
TextPos,
|
36
|
-
AccountClass,
|
37
|
-
AccountCreationProps,
|
38
|
-
} from "./internal.js";
|
39
|
-
|
40
|
-
export {
|
41
|
-
CoMap,
|
42
|
-
CoList,
|
43
|
-
BinaryCoStream,
|
44
|
-
CoFeed,
|
45
|
-
CoStream,
|
46
|
-
FileStream,
|
47
|
-
CoPlainText,
|
48
|
-
CoRichText,
|
49
|
-
Account,
|
50
|
-
isControlledAccount,
|
51
|
-
createCoValueObservable,
|
52
|
-
loadCoValue,
|
53
|
-
subscribeToCoValue,
|
54
|
-
ImageDefinition,
|
55
|
-
SubscriptionScope,
|
56
|
-
} from "./internal.js";
|
57
|
-
|
58
|
-
export {
|
59
|
-
JazzContextManager,
|
60
|
-
type JazzContextManagerAuthProps,
|
61
|
-
} from "./internal.js";
|
62
|
-
|
63
|
-
export { AuthSecretStorage } from "./auth/AuthSecretStorage.js";
|
64
|
-
export { KvStoreContext, type KvStore } from "./auth/KvStoreContext.js";
|
65
|
-
export { InMemoryKVStore } from "./auth/InMemoryKVStore.js";
|
66
|
-
export { DemoAuth } from "./auth/DemoAuth.js";
|
67
|
-
export { PassphraseAuth } from "./auth/PassphraseAuth.js";
|
68
|
-
|
69
|
-
export {
|
70
|
-
createInviteLink,
|
71
|
-
parseInviteLink,
|
72
|
-
consumeInviteLink,
|
73
|
-
} from "./implementation/invites.js";
|
74
|
-
|
75
|
-
export {
|
76
|
-
AnonymousJazzAgent,
|
77
|
-
createAnonymousJazzContext,
|
78
|
-
createJazzContextFromExistingCredentials,
|
79
|
-
createJazzContextForNewAccount,
|
80
|
-
createJazzContext,
|
81
|
-
randomSessionProvider,
|
82
|
-
type AuthResult,
|
83
|
-
type Credentials,
|
84
|
-
type JazzContextWithAccount,
|
85
|
-
} from "./internal.js";
|
86
|
-
|
87
|
-
export type * from "./types.js";
|
88
|
-
|
89
|
-
export {
|
90
|
-
zodSchemaToCoSchema,
|
91
|
-
anySchemaToCoSchema,
|
92
|
-
type InstanceOfSchema,
|
93
|
-
type InstanceOfSchemaCoValuesNullable,
|
94
|
-
type CoValueOrZodSchema,
|
95
|
-
type Loaded,
|
96
|
-
type AccountSchema,
|
97
|
-
type AnyAccountSchema,
|
98
|
-
type CoListSchema,
|
99
|
-
type CoMapSchema,
|
100
|
-
type CoFeedSchema,
|
101
|
-
type PlainTextSchema,
|
102
|
-
type FileStreamSchema,
|
103
|
-
type ResolveQuery,
|
104
|
-
type ResolveQueryStrict,
|
105
|
-
type InitFor,
|
106
|
-
type CoRecordSchema,
|
107
|
-
type CoProfileSchema,
|
108
|
-
} from "./internal.js";
|
@@ -1,150 +0,0 @@
|
|
1
|
-
import { CoValueUniqueness } from "cojson";
|
2
|
-
import {
|
3
|
-
Account,
|
4
|
-
CoMap,
|
5
|
-
Group,
|
6
|
-
RefsToResolve,
|
7
|
-
RefsToResolveStrict,
|
8
|
-
Resolved,
|
9
|
-
Simplify,
|
10
|
-
SubscribeListenerOptions,
|
11
|
-
} from "../../../internal.js";
|
12
|
-
import { AnonymousJazzAgent } from "../../anonymousJazzAgent.js";
|
13
|
-
import { InstanceOrPrimitiveOfSchema } from "../typeConverters/InstanceOrPrimitiveOfSchema.js";
|
14
|
-
import { InstanceOrPrimitiveOfSchemaCoValuesNullable } from "../typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.js";
|
15
|
-
import { z } from "../zodReExport.js";
|
16
|
-
import { WithHelpers } from "../zodSchema.js";
|
17
|
-
|
18
|
-
export type CoMapSchema<
|
19
|
-
Shape extends z.core.$ZodLooseShape,
|
20
|
-
Config extends z.core.$ZodObjectConfig = z.core.$ZodObjectConfig,
|
21
|
-
Owner extends Account | Group = Account | Group,
|
22
|
-
> = z.core.$ZodObject<Shape, Config> &
|
23
|
-
z.$ZodTypeDiscriminable & {
|
24
|
-
collaborative: true;
|
25
|
-
|
26
|
-
create: (
|
27
|
-
init: Simplify<CoMapInitZod<Shape>>,
|
28
|
-
options?:
|
29
|
-
| {
|
30
|
-
owner: Owner;
|
31
|
-
unique?: CoValueUniqueness["uniqueness"];
|
32
|
-
}
|
33
|
-
| Owner,
|
34
|
-
) => (Shape extends Record<string, never>
|
35
|
-
? {}
|
36
|
-
: {
|
37
|
-
-readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchema<
|
38
|
-
Shape[key]
|
39
|
-
>;
|
40
|
-
}) &
|
41
|
-
(unknown extends Config["out"][string]
|
42
|
-
? {}
|
43
|
-
: {
|
44
|
-
[key: string]: Config["out"][string];
|
45
|
-
}) &
|
46
|
-
CoMap;
|
47
|
-
|
48
|
-
load<
|
49
|
-
const R extends RefsToResolve<
|
50
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap
|
51
|
-
> = true,
|
52
|
-
>(
|
53
|
-
id: string,
|
54
|
-
options?: {
|
55
|
-
resolve?: RefsToResolveStrict<
|
56
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap,
|
57
|
-
R
|
58
|
-
>;
|
59
|
-
loadAs?: Account | AnonymousJazzAgent;
|
60
|
-
},
|
61
|
-
): Promise<Resolved<
|
62
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap,
|
63
|
-
R
|
64
|
-
> | null>;
|
65
|
-
|
66
|
-
subscribe<
|
67
|
-
const R extends RefsToResolve<
|
68
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap
|
69
|
-
> = true,
|
70
|
-
>(
|
71
|
-
id: string,
|
72
|
-
options: SubscribeListenerOptions<
|
73
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap,
|
74
|
-
R
|
75
|
-
>,
|
76
|
-
listener: (
|
77
|
-
value: Resolved<
|
78
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap,
|
79
|
-
R
|
80
|
-
>,
|
81
|
-
unsubscribe: () => void,
|
82
|
-
) => void,
|
83
|
-
): () => void;
|
84
|
-
|
85
|
-
findUnique(
|
86
|
-
unique: CoValueUniqueness["uniqueness"],
|
87
|
-
ownerID: string,
|
88
|
-
as?: Account | Group | AnonymousJazzAgent,
|
89
|
-
): string;
|
90
|
-
|
91
|
-
catchall<T extends z.core.$ZodType>(
|
92
|
-
schema: T,
|
93
|
-
): CoMapSchema<Shape, z.core.$catchall<T>>;
|
94
|
-
|
95
|
-
/** @deprecated Define your helper methods separately, in standalone functions. */
|
96
|
-
withHelpers<S extends z.core.$ZodType, T extends object>(
|
97
|
-
this: S,
|
98
|
-
helpers: (Self: S) => T,
|
99
|
-
): WithHelpers<S, T>;
|
100
|
-
|
101
|
-
withMigration(
|
102
|
-
migration: (
|
103
|
-
value: Resolved<
|
104
|
-
Simplify<CoMapInstanceCoValuesNullable<Shape>> & CoMap,
|
105
|
-
true
|
106
|
-
>,
|
107
|
-
) => undefined,
|
108
|
-
): CoMapSchema<Shape, Config, Owner>;
|
109
|
-
|
110
|
-
getCoSchema: () => typeof CoMap;
|
111
|
-
};
|
112
|
-
|
113
|
-
export type optionalKeys<Shape extends z.core.$ZodLooseShape> = {
|
114
|
-
[key in keyof Shape]: Shape[key] extends z.core.$ZodOptional<any>
|
115
|
-
? key
|
116
|
-
: never;
|
117
|
-
}[keyof Shape];
|
118
|
-
|
119
|
-
export type requiredKeys<Shape extends z.core.$ZodLooseShape> = {
|
120
|
-
[key in keyof Shape]: Shape[key] extends z.core.$ZodOptional<any>
|
121
|
-
? never
|
122
|
-
: key;
|
123
|
-
}[keyof Shape];
|
124
|
-
|
125
|
-
export type CoMapInitZod<Shape extends z.core.$ZodLooseShape> = {
|
126
|
-
[key in optionalKeys<Shape>]?: NonNullable<
|
127
|
-
InstanceOrPrimitiveOfSchemaCoValuesNullable<Shape[key]>
|
128
|
-
>;
|
129
|
-
} & {
|
130
|
-
[key in requiredKeys<Shape>]: NonNullable<
|
131
|
-
InstanceOrPrimitiveOfSchemaCoValuesNullable<Shape[key]>
|
132
|
-
>;
|
133
|
-
} & { [key in keyof Shape]?: unknown };
|
134
|
-
|
135
|
-
// less precise verion to avoid circularity issues and allow matching against
|
136
|
-
export type AnyCoMapSchema<
|
137
|
-
Shape extends z.core.$ZodLooseShape = z.core.$ZodLooseShape,
|
138
|
-
Config extends z.core.$ZodObjectConfig = z.core.$ZodObjectConfig,
|
139
|
-
> = z.core.$ZodObject<Shape, Config> & { collaborative: true };
|
140
|
-
|
141
|
-
export type CoMapInstance<Shape extends z.core.$ZodLooseShape> = {
|
142
|
-
-readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchema<Shape[key]>;
|
143
|
-
} & CoMap;
|
144
|
-
|
145
|
-
export type CoMapInstanceCoValuesNullable<Shape extends z.core.$ZodLooseShape> =
|
146
|
-
{
|
147
|
-
-readonly [key in keyof Shape]: InstanceOrPrimitiveOfSchemaCoValuesNullable<
|
148
|
-
Shape[key]
|
149
|
-
>;
|
150
|
-
};
|