@astrogate/sdk 0.0.0-stage → 0.1.0
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 +6 -2
- package/THIRD_PARTY_NOTICES.md +17 -0
- package/dist/browser.d.ts +85 -0
- package/dist/browser.js +16 -0
- package/dist/database-binding.d.ts +7 -0
- package/dist/database-binding.js +11 -0
- package/dist/hosted-session.d.ts +1 -0
- package/dist/hosted-session.js +11 -0
- package/dist/http.d.ts +24 -0
- package/dist/http.js +92 -0
- package/dist/inventory.d.ts +7 -0
- package/dist/inventory.js +18 -0
- package/dist/management-read.d.ts +17 -0
- package/dist/management-read.js +104 -0
- package/dist/management.d.ts +347 -0
- package/dist/management.js +137 -0
- package/dist/operator.d.ts +136 -0
- package/dist/operator.js +53 -0
- package/dist/react.d.ts +16 -0
- package/dist/react.js +10 -0
- package/dist/server.d.ts +27 -0
- package/dist/server.js +30 -0
- package/dist/services.d.ts +7 -0
- package/dist/services.js +53 -0
- package/dist/storage.d.ts +68 -0
- package/dist/storage.js +30 -0
- package/dist/tasks.d.ts +42 -0
- package/dist/tasks.js +24 -0
- package/dist/wire.gen.d.ts +7107 -0
- package/dist/wire.gen.js +5 -0
- package/native-provenance.json +15 -0
- package/node_modules/@instantdb/admin/LICENSE +202 -0
- package/node_modules/@instantdb/admin/dist/esm/index.d.ts +607 -0
- package/node_modules/@instantdb/admin/dist/esm/index.js +1036 -0
- package/node_modules/@instantdb/admin/dist/esm/polyfill.d.ts +16 -0
- package/node_modules/@instantdb/admin/dist/esm/polyfill.js +21 -0
- package/node_modules/@instantdb/admin/dist/esm/subscribe.d.ts +38 -0
- package/node_modules/@instantdb/admin/dist/esm/subscribe.js +301 -0
- package/node_modules/@instantdb/admin/dist/esm/version.d.ts +2 -0
- package/node_modules/@instantdb/admin/dist/esm/version.js +2 -0
- package/node_modules/@instantdb/admin/package.json +23 -0
- package/node_modules/@instantdb/core/LICENSE +202 -0
- package/node_modules/@instantdb/core/dist/esm/Connection.d.ts +92 -0
- package/node_modules/@instantdb/core/dist/esm/Connection.js +188 -0
- package/node_modules/@instantdb/core/dist/esm/InMemoryStorage.d.ts +10 -0
- package/node_modules/@instantdb/core/dist/esm/InMemoryStorage.js +25 -0
- package/node_modules/@instantdb/core/dist/esm/IndexedDBStorage.d.ts +17 -0
- package/node_modules/@instantdb/core/dist/esm/IndexedDBStorage.js +309 -0
- package/node_modules/@instantdb/core/dist/esm/InstantError.d.ts +6 -0
- package/node_modules/@instantdb/core/dist/esm/InstantError.js +23 -0
- package/node_modules/@instantdb/core/dist/esm/Reactor.d.ts +430 -0
- package/node_modules/@instantdb/core/dist/esm/Reactor.js +2369 -0
- package/node_modules/@instantdb/core/dist/esm/StorageAPI.d.ts +39 -0
- package/node_modules/@instantdb/core/dist/esm/StorageAPI.js +65 -0
- package/node_modules/@instantdb/core/dist/esm/Stream.d.ts +120 -0
- package/node_modules/@instantdb/core/dist/esm/Stream.js +811 -0
- package/node_modules/@instantdb/core/dist/esm/SyncTable.d.ts +144 -0
- package/node_modules/@instantdb/core/dist/esm/SyncTable.js +523 -0
- package/node_modules/@instantdb/core/dist/esm/WindowNetworkListener.d.ts +4 -0
- package/node_modules/@instantdb/core/dist/esm/WindowNetworkListener.js +19 -0
- package/node_modules/@instantdb/core/dist/esm/attrTypes.d.ts +25 -0
- package/node_modules/@instantdb/core/dist/esm/attrTypes.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/authAPI.d.ts +64 -0
- package/node_modules/@instantdb/core/dist/esm/authAPI.js +103 -0
- package/node_modules/@instantdb/core/dist/esm/clientTypes.d.ts +40 -0
- package/node_modules/@instantdb/core/dist/esm/clientTypes.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/coreTypes.d.ts +33 -0
- package/node_modules/@instantdb/core/dist/esm/coreTypes.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/createRouteHandler.d.ts +7 -0
- package/node_modules/@instantdb/core/dist/esm/createRouteHandler.js +51 -0
- package/node_modules/@instantdb/core/dist/esm/datalog.d.ts +7 -0
- package/node_modules/@instantdb/core/dist/esm/datalog.js +99 -0
- package/node_modules/@instantdb/core/dist/esm/devtool.d.ts +3 -0
- package/node_modules/@instantdb/core/dist/esm/devtool.js +144 -0
- package/node_modules/@instantdb/core/dist/esm/framework.d.ts +80 -0
- package/node_modules/@instantdb/core/dist/esm/framework.js +243 -0
- package/node_modules/@instantdb/core/dist/esm/helperTypes.d.ts +75 -0
- package/node_modules/@instantdb/core/dist/esm/helperTypes.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/index.d.ts +597 -0
- package/node_modules/@instantdb/core/dist/esm/index.js +649 -0
- package/node_modules/@instantdb/core/dist/esm/infiniteQuery.d.ts +25 -0
- package/node_modules/@instantdb/core/dist/esm/infiniteQuery.js +430 -0
- package/node_modules/@instantdb/core/dist/esm/instaml.d.ts +17 -0
- package/node_modules/@instantdb/core/dist/esm/instaml.js +576 -0
- package/node_modules/@instantdb/core/dist/esm/instaql.d.ts +12 -0
- package/node_modules/@instantdb/core/dist/esm/instaql.js +632 -0
- package/node_modules/@instantdb/core/dist/esm/instatx.d.ts +127 -0
- package/node_modules/@instantdb/core/dist/esm/instatx.js +93 -0
- package/node_modules/@instantdb/core/dist/esm/model/instaqlResult.d.ts +7 -0
- package/node_modules/@instantdb/core/dist/esm/model/instaqlResult.js +24 -0
- package/node_modules/@instantdb/core/dist/esm/parseSchemaFromJSON.d.ts +2 -0
- package/node_modules/@instantdb/core/dist/esm/parseSchemaFromJSON.js +142 -0
- package/node_modules/@instantdb/core/dist/esm/presence.d.ts +50 -0
- package/node_modules/@instantdb/core/dist/esm/presence.js +50 -0
- package/node_modules/@instantdb/core/dist/esm/presenceTypes.d.ts +9 -0
- package/node_modules/@instantdb/core/dist/esm/presenceTypes.js +3 -0
- package/node_modules/@instantdb/core/dist/esm/queryTypes.d.ts +271 -0
- package/node_modules/@instantdb/core/dist/esm/queryTypes.js +3 -0
- package/node_modules/@instantdb/core/dist/esm/queryValidation.d.ts +5 -0
- package/node_modules/@instantdb/core/dist/esm/queryValidation.js +287 -0
- package/node_modules/@instantdb/core/dist/esm/reactorTypes.d.ts +29 -0
- package/node_modules/@instantdb/core/dist/esm/reactorTypes.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/routeHandlerProtocol.d.ts +19 -0
- package/node_modules/@instantdb/core/dist/esm/routeHandlerProtocol.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/rulesTypes.d.ts +85 -0
- package/node_modules/@instantdb/core/dist/esm/rulesTypes.js +1 -0
- package/node_modules/@instantdb/core/dist/esm/sanityCheckQueries.d.ts +18 -0
- package/node_modules/@instantdb/core/dist/esm/sanityCheckQueries.js +152 -0
- package/node_modules/@instantdb/core/dist/esm/schema.d.ts +72 -0
- package/node_modules/@instantdb/core/dist/esm/schema.js +128 -0
- package/node_modules/@instantdb/core/dist/esm/schemaTypes.d.ts +244 -0
- package/node_modules/@instantdb/core/dist/esm/schemaTypes.js +106 -0
- package/node_modules/@instantdb/core/dist/esm/store.d.ts +89 -0
- package/node_modules/@instantdb/core/dist/esm/store.js +722 -0
- package/node_modules/@instantdb/core/dist/esm/transactionValidation.d.ts +7 -0
- package/node_modules/@instantdb/core/dist/esm/transactionValidation.js +130 -0
- package/node_modules/@instantdb/core/dist/esm/utils/Deferred.d.ts +8 -0
- package/node_modules/@instantdb/core/dist/esm/utils/Deferred.js +17 -0
- package/node_modules/@instantdb/core/dist/esm/utils/PersistedObject.d.ts +80 -0
- package/node_modules/@instantdb/core/dist/esm/utils/PersistedObject.js +448 -0
- package/node_modules/@instantdb/core/dist/esm/utils/dates.d.ts +1 -0
- package/node_modules/@instantdb/core/dist/esm/utils/dates.js +211 -0
- package/node_modules/@instantdb/core/dist/esm/utils/error.d.ts +2 -0
- package/node_modules/@instantdb/core/dist/esm/utils/error.js +8 -0
- package/node_modules/@instantdb/core/dist/esm/utils/fetch.d.ts +125 -0
- package/node_modules/@instantdb/core/dist/esm/utils/fetch.js +31 -0
- package/node_modules/@instantdb/core/dist/esm/utils/flags.d.ts +4 -0
- package/node_modules/@instantdb/core/dist/esm/utils/flags.js +10 -0
- package/node_modules/@instantdb/core/dist/esm/utils/id.d.ts +3 -0
- package/node_modules/@instantdb/core/dist/esm/utils/id.js +25 -0
- package/node_modules/@instantdb/core/dist/esm/utils/linkIndex.d.ts +7 -0
- package/node_modules/@instantdb/core/dist/esm/utils/linkIndex.js +17 -0
- package/node_modules/@instantdb/core/dist/esm/utils/log.d.ts +6 -0
- package/node_modules/@instantdb/core/dist/esm/utils/log.js +13 -0
- package/node_modules/@instantdb/core/dist/esm/utils/object.d.ts +16 -0
- package/node_modules/@instantdb/core/dist/esm/utils/object.js +143 -0
- package/node_modules/@instantdb/core/dist/esm/utils/pgtime.d.ts +197 -0
- package/node_modules/@instantdb/core/dist/esm/utils/pgtime.js +197 -0
- package/node_modules/@instantdb/core/dist/esm/utils/pick.d.ts +1 -0
- package/node_modules/@instantdb/core/dist/esm/utils/pick.js +9 -0
- package/node_modules/@instantdb/core/dist/esm/utils/strings.d.ts +1 -0
- package/node_modules/@instantdb/core/dist/esm/utils/strings.js +15 -0
- package/node_modules/@instantdb/core/dist/esm/utils/weakHash.d.ts +15 -0
- package/node_modules/@instantdb/core/dist/esm/utils/weakHash.js +71 -0
- package/node_modules/@instantdb/core/dist/esm/utils/weakHashLegacy.d.ts +7 -0
- package/node_modules/@instantdb/core/dist/esm/utils/weakHashLegacy.js +72 -0
- package/node_modules/@instantdb/core/dist/esm/version.d.ts +2 -0
- package/node_modules/@instantdb/core/dist/esm/version.js +2 -0
- package/node_modules/@instantdb/core/dist/esm/warningToggle.d.ts +2 -0
- package/node_modules/@instantdb/core/dist/esm/warningToggle.js +4 -0
- package/node_modules/@instantdb/core/package.json +20 -0
- package/node_modules/@instantdb/eventsource/LICENSE +22 -0
- package/node_modules/@instantdb/eventsource/README.md +226 -0
- package/node_modules/@instantdb/eventsource/dist/index.cjs +279 -0
- package/node_modules/@instantdb/eventsource/dist/index.cjs.map +1 -0
- package/node_modules/@instantdb/eventsource/dist/index.d.cts +346 -0
- package/node_modules/@instantdb/eventsource/dist/index.d.ts +346 -0
- package/node_modules/@instantdb/eventsource/dist/index.js +279 -0
- package/node_modules/@instantdb/eventsource/dist/index.js.map +1 -0
- package/node_modules/@instantdb/eventsource/package.json +128 -0
- package/node_modules/@instantdb/eventsource/src/EventSource.ts +614 -0
- package/node_modules/@instantdb/eventsource/src/errors.ts +141 -0
- package/node_modules/@instantdb/eventsource/src/index.ts +3 -0
- package/node_modules/@instantdb/eventsource/src/types.ts +164 -0
- package/node_modules/@instantdb/react/LICENSE +202 -0
- package/node_modules/@instantdb/react/dist/esm/Cursors.d.ts +18 -0
- package/node_modules/@instantdb/react/dist/esm/Cursors.js +103 -0
- package/node_modules/@instantdb/react/dist/esm/InstantReactWebDatabase.d.ts +5 -0
- package/node_modules/@instantdb/react/dist/esm/InstantReactWebDatabase.js +5 -0
- package/node_modules/@instantdb/react/dist/esm/index.d.ts +6 -0
- package/node_modules/@instantdb/react/dist/esm/index.js +22 -0
- package/node_modules/@instantdb/react/dist/esm/init.d.ts +40 -0
- package/node_modules/@instantdb/react/dist/esm/init.js +49 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/HydrationStreamProvider.d.ts +65 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/HydrationStreamProvider.js +96 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantNextDatabase.d.ts +11 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantNextDatabase.js +31 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantSuspenseProvider.d.ts +24 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/InstantSuspenseProvider.js +162 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/getUserFromInstantCookie.d.ts +9 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/getUserFromInstantCookie.js +16 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/htmlescape.d.ts +2 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/htmlescape.js +20 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/index.d.ts +29 -0
- package/node_modules/@instantdb/react/dist/esm/next-ssr/index.js +34 -0
- package/node_modules/@instantdb/react/dist/esm/version.d.ts +2 -0
- package/node_modules/@instantdb/react/dist/esm/version.js +2 -0
- package/node_modules/@instantdb/react/package.json +24 -0
- package/node_modules/@instantdb/react-common/LICENSE +202 -0
- package/node_modules/@instantdb/react-common/dist/esm/InstantReactAbstractDatabase.d.ts +282 -0
- package/node_modules/@instantdb/react-common/dist/esm/InstantReactAbstractDatabase.js +386 -0
- package/node_modules/@instantdb/react-common/dist/esm/InstantReactRoom.d.ts +182 -0
- package/node_modules/@instantdb/react-common/dist/esm/InstantReactRoom.js +280 -0
- package/node_modules/@instantdb/react-common/dist/esm/index.d.ts +4 -0
- package/node_modules/@instantdb/react-common/dist/esm/index.js +3 -0
- package/node_modules/@instantdb/react-common/dist/esm/useInfiniteQuerySubscription.d.ts +27 -0
- package/node_modules/@instantdb/react-common/dist/esm/useInfiniteQuerySubscription.js +53 -0
- package/node_modules/@instantdb/react-common/dist/esm/useQuery.d.ts +6 -0
- package/node_modules/@instantdb/react-common/dist/esm/useQuery.js +75 -0
- package/node_modules/@instantdb/react-common/dist/esm/useTimeout.d.ts +4 -0
- package/node_modules/@instantdb/react-common/dist/esm/useTimeout.js +17 -0
- package/node_modules/@instantdb/react-common/dist/esm/version.d.ts +2 -0
- package/node_modules/@instantdb/react-common/dist/esm/version.js +2 -0
- package/node_modules/@instantdb/react-common/package.json +22 -0
- package/node_modules/@instantdb/version/LICENSE +202 -0
- package/node_modules/@instantdb/version/dist/esm/index.d.ts +2 -0
- package/node_modules/@instantdb/version/dist/esm/index.js +2 -0
- package/node_modules/@instantdb/version/dist/esm/version.d.ts +2 -0
- package/node_modules/@instantdb/version/dist/esm/version.js +5 -0
- package/node_modules/@instantdb/version/package.json +16 -0
- package/node_modules/@instantdb/webhooks/LICENSE +202 -0
- package/node_modules/@instantdb/webhooks/dist/esm/index.d.ts +587 -0
- package/node_modules/@instantdb/webhooks/dist/esm/index.js +748 -0
- package/node_modules/@instantdb/webhooks/package.json +18 -0
- package/node_modules/cookie/LICENSE +24 -0
- package/node_modules/cookie/README.md +295 -0
- package/node_modules/cookie/dist/index.d.ts +143 -0
- package/node_modules/cookie/dist/index.js +355 -0
- package/node_modules/cookie/dist/index.js.map +1 -0
- package/node_modules/cookie/package.json +57 -0
- package/node_modules/eventsource/LICENSE +22 -0
- package/node_modules/eventsource/README.md +252 -0
- package/node_modules/eventsource/dist/EventSource.d.ts +128 -0
- package/node_modules/eventsource/dist/EventSource.d.ts.map +1 -0
- package/node_modules/eventsource/dist/EventSource.js +556 -0
- package/node_modules/eventsource/dist/EventSource.js.map +1 -0
- package/node_modules/eventsource/dist/errors.d.ts +53 -0
- package/node_modules/eventsource/dist/errors.d.ts.map +1 -0
- package/node_modules/eventsource/dist/errors.js +120 -0
- package/node_modules/eventsource/dist/errors.js.map +1 -0
- package/node_modules/eventsource/dist/index.d.ts +4 -0
- package/node_modules/eventsource/dist/index.d.ts.map +1 -0
- package/node_modules/eventsource/dist/index.js +3 -0
- package/node_modules/eventsource/dist/index.js.map +1 -0
- package/node_modules/eventsource/dist/types.d.ts +156 -0
- package/node_modules/eventsource/dist/types.d.ts.map +1 -0
- package/node_modules/eventsource/dist/types.js +2 -0
- package/node_modules/eventsource/dist/types.js.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/LICENSE +21 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/README.md +177 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.d.ts +35 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.d.ts.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.js +16 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/errors.js.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.d.ts +4 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.d.ts.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.js +3 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/index.js.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.d.ts +12 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.d.ts.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.js +509 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/parse.js.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.d.ts +76 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.d.ts.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.js +59 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/stream.js.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.d.ts +130 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.d.ts.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.js +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/dist/types.js.map +1 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/package.json +96 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/src/errors.ts +44 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/src/index.ts +3 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/src/parse.ts +576 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/src/stream.ts +118 -0
- package/node_modules/eventsource/node_modules/eventsource-parser/src/types.ts +138 -0
- package/node_modules/eventsource/package.json +103 -0
- package/node_modules/eventsource/src/EventSource.ts +844 -0
- package/node_modules/eventsource/src/errors.ts +141 -0
- package/node_modules/eventsource/src/index.ts +3 -0
- package/node_modules/eventsource/src/types.ts +166 -0
- package/node_modules/eventsource-parser/LICENSE +21 -0
- package/node_modules/eventsource-parser/README.md +157 -0
- package/node_modules/eventsource-parser/dist/index.cjs +177 -0
- package/node_modules/eventsource-parser/dist/index.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/index.d.cts +169 -0
- package/node_modules/eventsource-parser/dist/index.d.ts +169 -0
- package/node_modules/eventsource-parser/dist/index.js +177 -0
- package/node_modules/eventsource-parser/dist/index.js.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.cjs +29 -0
- package/node_modules/eventsource-parser/dist/stream.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.d.cts +134 -0
- package/node_modules/eventsource-parser/dist/stream.d.ts +134 -0
- package/node_modules/eventsource-parser/dist/stream.js +30 -0
- package/node_modules/eventsource-parser/dist/stream.js.map +1 -0
- package/node_modules/eventsource-parser/package.json +92 -0
- package/node_modules/eventsource-parser/src/errors.ts +44 -0
- package/node_modules/eventsource-parser/src/index.ts +8 -0
- package/node_modules/eventsource-parser/src/parse.ts +439 -0
- package/node_modules/eventsource-parser/src/stream.ts +107 -0
- package/node_modules/eventsource-parser/src/types.ts +122 -0
- package/node_modules/eventsource-parser/stream.js +2 -0
- package/node_modules/mutative/LICENSE +21 -0
- package/node_modules/mutative/README.md +870 -0
- package/node_modules/mutative/dist/apply.d.ts +31 -0
- package/node_modules/mutative/dist/array.d.ts +45 -0
- package/node_modules/mutative/dist/constant.d.ts +8 -0
- package/node_modules/mutative/dist/create.d.ts +46 -0
- package/node_modules/mutative/dist/current.d.ts +23 -0
- package/node_modules/mutative/dist/draft.d.ts +3 -0
- package/node_modules/mutative/dist/draftify.d.ts +2 -0
- package/node_modules/mutative/dist/error.d.ts +54 -0
- package/node_modules/mutative/dist/index.d.mts +1 -0
- package/node_modules/mutative/dist/index.d.ts +12 -0
- package/node_modules/mutative/dist/index.js +8 -0
- package/node_modules/mutative/dist/index.mjs +3 -0
- package/node_modules/mutative/dist/interface.d.ts +200 -0
- package/node_modules/mutative/dist/internal.d.ts +4 -0
- package/node_modules/mutative/dist/makeCreator.d.ts +54 -0
- package/node_modules/mutative/dist/map.d.ts +15 -0
- package/node_modules/mutative/dist/mutative.cjs.development.js +2126 -0
- package/node_modules/mutative/dist/mutative.cjs.development.js.map +1 -0
- package/node_modules/mutative/dist/mutative.cjs.production.min.js +2 -0
- package/node_modules/mutative/dist/mutative.cjs.production.min.js.map +1 -0
- package/node_modules/mutative/dist/mutative.esm.js +2123 -0
- package/node_modules/mutative/dist/mutative.esm.js.map +1 -0
- package/node_modules/mutative/dist/mutative.esm.mjs +2123 -0
- package/node_modules/mutative/dist/mutative.esm.mjs.map +1 -0
- package/node_modules/mutative/dist/mutative.esm.production.min.mjs +2 -0
- package/node_modules/mutative/dist/mutative.esm.production.min.mjs.map +1 -0
- package/node_modules/mutative/dist/mutative.umd.development.js +2132 -0
- package/node_modules/mutative/dist/mutative.umd.development.js.map +1 -0
- package/node_modules/mutative/dist/mutative.umd.production.min.js +2 -0
- package/node_modules/mutative/dist/mutative.umd.production.min.js.map +1 -0
- package/node_modules/mutative/dist/original.d.ts +19 -0
- package/node_modules/mutative/dist/patch.d.ts +2 -0
- package/node_modules/mutative/dist/rawReturn.d.ts +19 -0
- package/node_modules/mutative/dist/set.d.ts +14 -0
- package/node_modules/mutative/dist/unsafe.d.ts +34 -0
- package/node_modules/mutative/dist/utils/cast.d.ts +13 -0
- package/node_modules/mutative/dist/utils/copy.d.ts +5 -0
- package/node_modules/mutative/dist/utils/deepFreeze.d.ts +1 -0
- package/node_modules/mutative/dist/utils/draft.d.ts +27 -0
- package/node_modules/mutative/dist/utils/finalize.d.ts +13 -0
- package/node_modules/mutative/dist/utils/forEach.d.ts +1 -0
- package/node_modules/mutative/dist/utils/index.d.ts +7 -0
- package/node_modules/mutative/dist/utils/mark.d.ts +2 -0
- package/node_modules/mutative/dist/utils/marker.d.ts +5 -0
- package/node_modules/mutative/dist/utils/proto.d.ts +10 -0
- package/node_modules/mutative/package.json +142 -0
- package/node_modules/mutative/src/apply.ts +239 -0
- package/node_modules/mutative/src/array.ts +679 -0
- package/node_modules/mutative/src/constant.ts +17 -0
- package/node_modules/mutative/src/create.ts +27 -0
- package/node_modules/mutative/src/current.ts +206 -0
- package/node_modules/mutative/src/draft.ts +489 -0
- package/node_modules/mutative/src/draftify.ts +57 -0
- package/node_modules/mutative/src/error.ts +129 -0
- package/node_modules/mutative/src/index.ts +21 -0
- package/node_modules/mutative/src/interface.ts +321 -0
- package/node_modules/mutative/src/internal.ts +5 -0
- package/node_modules/mutative/src/makeCreator.ts +382 -0
- package/node_modules/mutative/src/map.ts +160 -0
- package/node_modules/mutative/src/original.ts +28 -0
- package/node_modules/mutative/src/patch.ts +386 -0
- package/node_modules/mutative/src/rawReturn.ts +41 -0
- package/node_modules/mutative/src/set.ts +201 -0
- package/node_modules/mutative/src/unsafe.ts +66 -0
- package/node_modules/mutative/src/utils/cast.ts +22 -0
- package/node_modules/mutative/src/utils/copy.ts +224 -0
- package/node_modules/mutative/src/utils/deepFreeze.ts +103 -0
- package/node_modules/mutative/src/utils/draft.ts +189 -0
- package/node_modules/mutative/src/utils/finalize.ts +232 -0
- package/node_modules/mutative/src/utils/forEach.ts +24 -0
- package/node_modules/mutative/src/utils/index.ts +7 -0
- package/node_modules/mutative/src/utils/mark.ts +11 -0
- package/node_modules/mutative/src/utils/marker.ts +34 -0
- package/node_modules/mutative/src/utils/proto.ts +38 -0
- package/node_modules/uuid/LICENSE.md +9 -0
- package/node_modules/uuid/README.md +491 -0
- package/node_modules/uuid/dist/index.d.ts +15 -0
- package/node_modules/uuid/dist/index.js +14 -0
- package/node_modules/uuid/dist/max.d.ts +2 -0
- package/node_modules/uuid/dist/max.js +1 -0
- package/node_modules/uuid/dist/md5.d.ts +2 -0
- package/node_modules/uuid/dist/md5.js +135 -0
- package/node_modules/uuid/dist/nil.d.ts +2 -0
- package/node_modules/uuid/dist/nil.js +1 -0
- package/node_modules/uuid/dist/parse.d.ts +3 -0
- package/node_modules/uuid/dist/parse.js +9 -0
- package/node_modules/uuid/dist/regex.d.ts +2 -0
- package/node_modules/uuid/dist/regex.js +1 -0
- package/node_modules/uuid/dist/rng.d.ts +1 -0
- package/node_modules/uuid/dist/rng.js +4 -0
- package/node_modules/uuid/dist/sha1.d.ts +2 -0
- package/node_modules/uuid/dist/sha1.js +70 -0
- package/node_modules/uuid/dist/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/stringify.js +35 -0
- package/node_modules/uuid/dist/types.d.ts +22 -0
- package/node_modules/uuid/dist/types.js +1 -0
- package/node_modules/uuid/dist/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/uuid-bin.js +70 -0
- package/node_modules/uuid/dist/v1.d.ts +11 -0
- package/node_modules/uuid/dist/v1.js +87 -0
- package/node_modules/uuid/dist/v1ToV6.d.ts +3 -0
- package/node_modules/uuid/dist/v1ToV6.js +10 -0
- package/node_modules/uuid/dist/v3.d.ts +9 -0
- package/node_modules/uuid/dist/v3.js +9 -0
- package/node_modules/uuid/dist/v35.d.ts +7 -0
- package/node_modules/uuid/dist/v35.js +39 -0
- package/node_modules/uuid/dist/v4.d.ts +4 -0
- package/node_modules/uuid/dist/v4.js +29 -0
- package/node_modules/uuid/dist/v5.d.ts +9 -0
- package/node_modules/uuid/dist/v5.js +9 -0
- package/node_modules/uuid/dist/v6.d.ts +4 -0
- package/node_modules/uuid/dist/v6.js +20 -0
- package/node_modules/uuid/dist/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/v6ToV1.js +10 -0
- package/node_modules/uuid/dist/v7.d.ts +9 -0
- package/node_modules/uuid/dist/v7.js +68 -0
- package/node_modules/uuid/dist/validate.d.ts +2 -0
- package/node_modules/uuid/dist/validate.js +5 -0
- package/node_modules/uuid/dist/version.d.ts +2 -0
- package/node_modules/uuid/dist/version.js +8 -0
- package/node_modules/uuid/dist-node/bin/uuid +2 -0
- package/node_modules/uuid/dist-node/index.js +14 -0
- package/node_modules/uuid/dist-node/max.js +1 -0
- package/node_modules/uuid/dist-node/md5.js +11 -0
- package/node_modules/uuid/dist-node/nil.js +1 -0
- package/node_modules/uuid/dist-node/parse.js +9 -0
- package/node_modules/uuid/dist-node/regex.js +1 -0
- package/node_modules/uuid/dist-node/rng.js +4 -0
- package/node_modules/uuid/dist-node/sha1.js +11 -0
- package/node_modules/uuid/dist-node/stringify.js +35 -0
- package/node_modules/uuid/dist-node/types.js +1 -0
- package/node_modules/uuid/dist-node/uuid-bin.js +70 -0
- package/node_modules/uuid/dist-node/v1.js +87 -0
- package/node_modules/uuid/dist-node/v1ToV6.js +10 -0
- package/node_modules/uuid/dist-node/v3.js +9 -0
- package/node_modules/uuid/dist-node/v35.js +39 -0
- package/node_modules/uuid/dist-node/v4.js +29 -0
- package/node_modules/uuid/dist-node/v5.js +9 -0
- package/node_modules/uuid/dist-node/v6.js +20 -0
- package/node_modules/uuid/dist-node/v6ToV1.js +10 -0
- package/node_modules/uuid/dist-node/v7.js +68 -0
- package/node_modules/uuid/dist-node/validate.js +5 -0
- package/node_modules/uuid/dist-node/version.js +8 -0
- package/node_modules/uuid/package.json +115 -0
- package/package.json +80 -4
- package/release.json +78 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import * as s from './store.ts';
|
|
2
|
+
import IndexedDBStorage from './IndexedDBStorage.ts';
|
|
3
|
+
import WindowNetworkListener from './WindowNetworkListener.js';
|
|
4
|
+
import * as authAPI from './authAPI.ts';
|
|
5
|
+
import * as StorageApi from './StorageAPI.ts';
|
|
6
|
+
import { Deferred } from './utils/Deferred.ts';
|
|
7
|
+
import { PersistedObject } from './utils/PersistedObject.ts';
|
|
8
|
+
import { SyncTable } from './SyncTable.ts';
|
|
9
|
+
import { InstantStream } from './Stream.ts';
|
|
10
|
+
export type Logger = import('./utils/log.ts').Logger;
|
|
11
|
+
export type Connection = import('./Connection.ts').Connection<WebSocket | import('./Connection.ts').EventSourceType>;
|
|
12
|
+
export type TransportType = import('./Connection.ts').TransportType;
|
|
13
|
+
export type EventSourceConstructor = import('./Connection.ts').EventSourceConstructor;
|
|
14
|
+
export type QuerySub = import('./reactorTypes.ts').QuerySub;
|
|
15
|
+
export type QuerySubInStorage = import('./reactorTypes.ts').QuerySubInStorage;
|
|
16
|
+
export type User = import('./clientTypes.ts').User;
|
|
17
|
+
export type AuthState = import('./clientTypes.ts').AuthState;
|
|
18
|
+
export type FrameworkClient = import('./framework.ts').FrameworkClient;
|
|
19
|
+
/** @typedef {import('./utils/log.ts').Logger} Logger */
|
|
20
|
+
/** @typedef {import('./Connection.ts').Connection<WebSocket | import('./Connection.ts').EventSourceType>} Connection */
|
|
21
|
+
/** @typedef {import('./Connection.ts').TransportType} TransportType */
|
|
22
|
+
/** @typedef {import('./Connection.ts').EventSourceConstructor} EventSourceConstructor */
|
|
23
|
+
/** @typedef {import('./reactorTypes.ts').QuerySub} QuerySub */
|
|
24
|
+
/** @typedef {import('./reactorTypes.ts').QuerySubInStorage} QuerySubInStorage */
|
|
25
|
+
/** @typedef {import('./clientTypes.ts').User} User */
|
|
26
|
+
/** @typedef {import('./clientTypes.ts').AuthState} AuthState */
|
|
27
|
+
/** @typedef {import('./framework.ts').FrameworkClient} FrameworkClient */
|
|
28
|
+
export declare const STATUS: {
|
|
29
|
+
CONNECTING: string;
|
|
30
|
+
OPENED: string;
|
|
31
|
+
AUTHENTICATED: string;
|
|
32
|
+
CLOSED: string;
|
|
33
|
+
ERRORED: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const COOKIE_SYNC_LAST_UPDATED_KEY = "lastSyncedUserCookie";
|
|
36
|
+
/**
|
|
37
|
+
* @template {import('./presence.ts').RoomSchemaShape} [RoomSchema = {}]
|
|
38
|
+
*/
|
|
39
|
+
export default class Reactor<RoomSchema extends import('./presence.ts').RoomSchemaShape = {}> {
|
|
40
|
+
queryCacheLimit: any;
|
|
41
|
+
versions: any;
|
|
42
|
+
_sessionId: any;
|
|
43
|
+
/** @type {s.AttrsStore | undefined} */
|
|
44
|
+
attrs: s.AttrsStore | undefined;
|
|
45
|
+
_isOnline: boolean;
|
|
46
|
+
_isShutdown: boolean;
|
|
47
|
+
status: string;
|
|
48
|
+
/** @type {PersistedObject<string, QuerySub, QuerySubInStorage>} */
|
|
49
|
+
querySubs: PersistedObject<string, QuerySub, QuerySubInStorage>;
|
|
50
|
+
/** @type {PersistedObject} */
|
|
51
|
+
kv: PersistedObject<any, any, any>;
|
|
52
|
+
/** @type {SyncTable} */
|
|
53
|
+
_syncTable: SyncTable;
|
|
54
|
+
/** @type {InstantStream} */
|
|
55
|
+
_instantStream: InstantStream;
|
|
56
|
+
/** @type {Record<string, Array<{ q: any, cb: (data: any) => any }>>} */
|
|
57
|
+
queryCbs: Record<string, Array<{
|
|
58
|
+
q: any;
|
|
59
|
+
cb: (data: any) => any;
|
|
60
|
+
}>>;
|
|
61
|
+
/** @type {Record<string, Array<{ q: any, eventId: string, dfd: Deferred }>>} */
|
|
62
|
+
queryOnceDfds: Record<string, Array<{
|
|
63
|
+
q: any;
|
|
64
|
+
eventId: string;
|
|
65
|
+
dfd: Deferred;
|
|
66
|
+
}>>;
|
|
67
|
+
authCbs: any[];
|
|
68
|
+
attrsCbs: any[];
|
|
69
|
+
mutationErrorCbs: any[];
|
|
70
|
+
connectionStatusCbs: any[];
|
|
71
|
+
appStatusCbs: any[];
|
|
72
|
+
/**
|
|
73
|
+
* Carries the raw server status off the public type: `disabled` is an
|
|
74
|
+
* operator-level state we don't surface to apps.
|
|
75
|
+
* @type {import('./clientTypes.ts').AppStatusState & { status?: 'active' | 'read-only' | 'disabled' }}
|
|
76
|
+
*/
|
|
77
|
+
_appStatusState: import('./clientTypes.ts').AppStatusState & {
|
|
78
|
+
status?: 'active' | 'read-only' | 'disabled';
|
|
79
|
+
};
|
|
80
|
+
config: any;
|
|
81
|
+
mutationDeferredStore: Map<any, any>;
|
|
82
|
+
/** @type {ReturnType<typeof setTimeout> | null} */
|
|
83
|
+
_reconnectTimeoutId: ReturnType<typeof setTimeout> | null;
|
|
84
|
+
_reconnectTimeoutMs: number;
|
|
85
|
+
_networkUnsubscribe: any;
|
|
86
|
+
/** @type {Connection} */
|
|
87
|
+
_transport: Connection;
|
|
88
|
+
/** @type {TransportType} */
|
|
89
|
+
_transportType: TransportType;
|
|
90
|
+
/** @type {EventSourceConstructor} */
|
|
91
|
+
_EventSource: EventSourceConstructor;
|
|
92
|
+
/** @type {boolean | null} */
|
|
93
|
+
_wsOk: boolean | null;
|
|
94
|
+
_localIdPromises: {};
|
|
95
|
+
_errorMessage: null;
|
|
96
|
+
/** @type {Promise<null | {error: {message: string}}> | null}**/
|
|
97
|
+
_oauthCallbackResponse: Promise<null | {
|
|
98
|
+
error: {
|
|
99
|
+
message: string;
|
|
100
|
+
};
|
|
101
|
+
}> | null;
|
|
102
|
+
/** @type {null | import('./utils/linkIndex.ts').LinkIndex}} */
|
|
103
|
+
_linkIndex: null | import('./utils/linkIndex.ts').LinkIndex;
|
|
104
|
+
/** @type BroadcastChannel | undefined */
|
|
105
|
+
_broadcastChannel: BroadcastChannel | undefined;
|
|
106
|
+
/** @type {Record<string, {roomType: string; isConnected: boolean; error: any}>} */
|
|
107
|
+
_rooms: Record<string, {
|
|
108
|
+
roomType: string;
|
|
109
|
+
isConnected: boolean;
|
|
110
|
+
error: any;
|
|
111
|
+
}>;
|
|
112
|
+
/** @type {Record<string, boolean>} */
|
|
113
|
+
_roomsPendingLeave: Record<string, boolean>;
|
|
114
|
+
_presence: {};
|
|
115
|
+
_broadcastQueue: any[];
|
|
116
|
+
_broadcastSubs: {};
|
|
117
|
+
/** @type {{isLoading: boolean; error: any | undefined, user: any | undefined}} */
|
|
118
|
+
_currentUserCached: {
|
|
119
|
+
isLoading: boolean;
|
|
120
|
+
error: any | undefined;
|
|
121
|
+
user: any | undefined;
|
|
122
|
+
};
|
|
123
|
+
_beforeUnloadCbs: any[];
|
|
124
|
+
_dataForQueryCache: {};
|
|
125
|
+
/** @type {Logger} */
|
|
126
|
+
_log: Logger;
|
|
127
|
+
_pendingTxCleanupTimeout: any;
|
|
128
|
+
_pendingMutationCleanupThreshold: any;
|
|
129
|
+
_inFlightMutationEventIds: Set<any>;
|
|
130
|
+
/** @type FrameworkClient | null */
|
|
131
|
+
_frameworkClient: FrameworkClient | null;
|
|
132
|
+
constructor(config: any, Storage: typeof IndexedDBStorage | undefined, NetworkListener: typeof WindowNetworkListener | undefined, versions: any, EventSourceConstructor: any);
|
|
133
|
+
getFrameworkClient(): import("./framework.ts").FrameworkClient | null;
|
|
134
|
+
/** @param {FrameworkClient} client */
|
|
135
|
+
setFrameworkClient(client: FrameworkClient): void;
|
|
136
|
+
ensureAttrs(): s.AttrsStore;
|
|
137
|
+
updateSchema(schema: any): void;
|
|
138
|
+
_reactorStats(): {
|
|
139
|
+
inFlightMutationCount: number;
|
|
140
|
+
storedMutationCount: any;
|
|
141
|
+
transportType: import("./Connection.ts").TransportType;
|
|
142
|
+
};
|
|
143
|
+
_onQuerySubLoaded(hash: any): void;
|
|
144
|
+
_initStorage(Storage: any): void;
|
|
145
|
+
_beforeUnload(): void;
|
|
146
|
+
/**
|
|
147
|
+
* @param {'enqueued' | 'pending' | 'synced' | 'timeout' | 'error' } status
|
|
148
|
+
* @param {string} eventId
|
|
149
|
+
* @param {{message?: string, type?: string, status?: number, hint?: unknown, traceId?: string}} [errorMsg]
|
|
150
|
+
*/
|
|
151
|
+
_finishTransaction(status: 'enqueued' | 'pending' | 'synced' | 'timeout' | 'error', eventId: string, errorMsg?: {
|
|
152
|
+
message?: string;
|
|
153
|
+
type?: string;
|
|
154
|
+
status?: number;
|
|
155
|
+
hint?: unknown;
|
|
156
|
+
traceId?: string;
|
|
157
|
+
}): void;
|
|
158
|
+
_setStatus(status: any, err: any): void;
|
|
159
|
+
_onMergeKv: (key: any, storageV: any, inMemoryV: any) => any;
|
|
160
|
+
_flushEnqueuedRoomData(roomId: any): void;
|
|
161
|
+
/**
|
|
162
|
+
* Does the same thing as add-query-ok
|
|
163
|
+
* but called as a result of receiving query info from ssr
|
|
164
|
+
* @param {any} q
|
|
165
|
+
* @param {{ triples: any; pageInfo: any; }} result
|
|
166
|
+
* @param {boolean} enableCardinalityInference
|
|
167
|
+
*/
|
|
168
|
+
_addQueryData(q: any, result: {
|
|
169
|
+
triples: any;
|
|
170
|
+
pageInfo: any;
|
|
171
|
+
}, enableCardinalityInference: boolean): void;
|
|
172
|
+
_handleReceive(connId: any, msg: any): void;
|
|
173
|
+
createWriteStream(opts: any): import("./Stream.ts").InstantWritableStream<string>;
|
|
174
|
+
createReadStream(opts: any): import("./Stream.ts").InstantReadableStream<string>;
|
|
175
|
+
_pendingMutations(): any;
|
|
176
|
+
_updatePendingMutations(f: any): void;
|
|
177
|
+
/**
|
|
178
|
+
* @param {'timeout' | 'error'} status
|
|
179
|
+
* @param {string} eventId
|
|
180
|
+
* @param {{message?: string, type?: string, status?: number, hint?: unknown, traceId?: string}} errorMsg
|
|
181
|
+
*/
|
|
182
|
+
_handleMutationError(status: 'timeout' | 'error', eventId: string, errorMsg: {
|
|
183
|
+
message?: string;
|
|
184
|
+
type?: string;
|
|
185
|
+
status?: number;
|
|
186
|
+
hint?: unknown;
|
|
187
|
+
traceId?: string;
|
|
188
|
+
}): void;
|
|
189
|
+
_handleReceiveError(msg: any): void;
|
|
190
|
+
notifyQueryOnceError(q: any, hash: any, eventId: any, e: any): void;
|
|
191
|
+
_setAttrs(attrs: any): void;
|
|
192
|
+
getPreviousResult: (q: any) => any;
|
|
193
|
+
_startQuerySub(q: any, hash: any): string;
|
|
194
|
+
_tryMigrateLegacyQuerySub(q: any, newHash: any): Promise<void>;
|
|
195
|
+
subscribeTable(q: any, cb: any): (opts?: {
|
|
196
|
+
keepSubscription?: boolean | null | undefined;
|
|
197
|
+
} | null | undefined) => void;
|
|
198
|
+
/**
|
|
199
|
+
* When a user subscribes to a query the following side effects occur:
|
|
200
|
+
*
|
|
201
|
+
* - We update querySubs to include the new query
|
|
202
|
+
* - We update queryCbs to include the new cb
|
|
203
|
+
* - If we already have a result for the query we call cb immediately
|
|
204
|
+
* - We send the server an `add-query` message
|
|
205
|
+
*
|
|
206
|
+
* Returns an unsubscribe function
|
|
207
|
+
*/
|
|
208
|
+
subscribeQuery(q: any, cb: any, opts: any): () => void;
|
|
209
|
+
queryOnce(q: any, opts: any): Promise<any>;
|
|
210
|
+
_completeQueryOnce(q: any, hash: any, dfd: any): void;
|
|
211
|
+
_unsubQuery(q: any, hash: any, cb: any): void;
|
|
212
|
+
_hasQueryListeners(hash: any): boolean;
|
|
213
|
+
_cleanupQuery(q: any, hash: any): void;
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
* @param {s.AttrsStore} attrs
|
|
217
|
+
* @param {any} muts
|
|
218
|
+
* @param {number} [processedTxId]
|
|
219
|
+
*/
|
|
220
|
+
_rewriteMutations(attrs: s.AttrsStore, muts: any, processedTxId?: number): any;
|
|
221
|
+
_rewriteMutationsSorted(attrs: any, muts: any): any[];
|
|
222
|
+
/**
|
|
223
|
+
* @returns {s.AttrsStore}
|
|
224
|
+
*/
|
|
225
|
+
optimisticAttrs(): s.AttrsStore;
|
|
226
|
+
/** Runs instaql on a query and a store */
|
|
227
|
+
dataForQuery(hash: any, applyOptimistic?: boolean): any;
|
|
228
|
+
_applyOptimisticUpdates(store: any, attrsStore: any, mutations: any, processedTxId: any): {
|
|
229
|
+
store: any;
|
|
230
|
+
attrsStore: any;
|
|
231
|
+
};
|
|
232
|
+
/** Re-run instaql and call all callbacks with new data */
|
|
233
|
+
notifyOne: (hash: any) => void;
|
|
234
|
+
notifyOneQueryOnce: (hash: any) => void;
|
|
235
|
+
notifyQueryError: (hash: any, error: any) => void;
|
|
236
|
+
/** Re-compute all subscriptions */
|
|
237
|
+
notifyAll(): void;
|
|
238
|
+
loadedNotifyAll(): void;
|
|
239
|
+
/** Applies transactions locally and sends transact message to server */
|
|
240
|
+
pushTx: (chunks: any) => Promise<any>;
|
|
241
|
+
/**
|
|
242
|
+
* @param {*} txSteps
|
|
243
|
+
* @param {*} [error]
|
|
244
|
+
* @returns
|
|
245
|
+
*/
|
|
246
|
+
pushOps: (txSteps: any, error?: any) => Promise<any>;
|
|
247
|
+
shutdown(): void;
|
|
248
|
+
/**
|
|
249
|
+
* Sends mutation to server and schedules a timeout to cancel it if
|
|
250
|
+
* we don't hear back in time.
|
|
251
|
+
* Note: If we're offline we don't schedule a timeout, we'll schedule it
|
|
252
|
+
* later once we're back online and send the mutation again
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
_sendMutation(eventId: any, mutation: any): void;
|
|
256
|
+
/** Send messages we accumulated while we were connecting */
|
|
257
|
+
_flushPendingMessages(): void;
|
|
258
|
+
/**
|
|
259
|
+
* Clean up pendingMutations that all queries have seen
|
|
260
|
+
*/
|
|
261
|
+
_cleanupPendingMutationsQueries(): void;
|
|
262
|
+
/**
|
|
263
|
+
* After mutations is confirmed by server, we give each query 30 sec
|
|
264
|
+
* to update its results. If that doesn't happen, we assume query is
|
|
265
|
+
* unaffected by this mutation and it’s safe to delete it from local queue
|
|
266
|
+
*/
|
|
267
|
+
_cleanupPendingMutationsTimeout(): void;
|
|
268
|
+
_trySendAuthed(...args: any[]): void;
|
|
269
|
+
_trySend(eventId: any, msg: any, opts: any): void;
|
|
270
|
+
_transportOnOpen: (e: any) => void;
|
|
271
|
+
_transportOnMessage: (e: any) => void;
|
|
272
|
+
_transportOnError: (e: any) => void;
|
|
273
|
+
_scheduleReconnect: () => void;
|
|
274
|
+
_transportOnClose: (e: any) => void;
|
|
275
|
+
_startSocket(): void;
|
|
276
|
+
/**
|
|
277
|
+
* Given a key, returns a stable local id, unique to this device and app.
|
|
278
|
+
*
|
|
279
|
+
* This can be useful if you want to create guest ids for example.
|
|
280
|
+
*
|
|
281
|
+
* Note: If the user deletes their local storage, this id will change.
|
|
282
|
+
*
|
|
283
|
+
*/
|
|
284
|
+
getLocalId(name: any): Promise<any>;
|
|
285
|
+
_replaceUrlAfterOAuth(): void;
|
|
286
|
+
/**
|
|
287
|
+
*
|
|
288
|
+
* @returns Promise<null | {error: {message: string}}>
|
|
289
|
+
*/
|
|
290
|
+
_oauthLoginInit(): Promise<{
|
|
291
|
+
error: {
|
|
292
|
+
message: any;
|
|
293
|
+
};
|
|
294
|
+
} | null>;
|
|
295
|
+
_waitForOAuthCallbackResponse(): Promise<{
|
|
296
|
+
error: {
|
|
297
|
+
message: string;
|
|
298
|
+
};
|
|
299
|
+
} | null>;
|
|
300
|
+
__subscribeMutationErrors(cb: any): () => void;
|
|
301
|
+
subscribeAuth(cb: any): () => void;
|
|
302
|
+
getAuth(): Promise<import("./clientTypes.ts").User | null>;
|
|
303
|
+
subscribeConnectionStatus(cb: any): () => void;
|
|
304
|
+
/**
|
|
305
|
+
* @param {'active' | 'read-only' | 'disabled' | undefined} status
|
|
306
|
+
*/
|
|
307
|
+
_setAppStatus(status: 'active' | 'read-only' | 'disabled' | undefined): void;
|
|
308
|
+
subscribeAppStatus(cb: any): () => void;
|
|
309
|
+
subscribeAttrs(cb: any): () => void;
|
|
310
|
+
notifyAuthSubs(user: any): void;
|
|
311
|
+
notifyMutationErrorSubs(error: any): void;
|
|
312
|
+
notifyAttrsSubs(): void;
|
|
313
|
+
notifyConnectionStatusSubs(status: any): void;
|
|
314
|
+
notifyAppStatusSubs(state: any): void;
|
|
315
|
+
setCurrentUser(user: any): Promise<void>;
|
|
316
|
+
getCurrentUserCached(): {
|
|
317
|
+
isLoading: boolean;
|
|
318
|
+
error: any | undefined;
|
|
319
|
+
user: any | undefined;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* @param {{ forceReadFromStorage?: boolean }} [opts]
|
|
323
|
+
* @returns {Promise<User | undefined>}
|
|
324
|
+
*/
|
|
325
|
+
_getCurrentUser(opts?: {
|
|
326
|
+
forceReadFromStorage?: boolean;
|
|
327
|
+
}): Promise<User | undefined>;
|
|
328
|
+
/**
|
|
329
|
+
* @param {{ forceReadFromStorage?: boolean }} [opts]
|
|
330
|
+
* @returns {Promise<AuthState>}
|
|
331
|
+
*/
|
|
332
|
+
getCurrentUser(opts?: {
|
|
333
|
+
forceReadFromStorage?: boolean;
|
|
334
|
+
}): Promise<AuthState>;
|
|
335
|
+
_hasCurrentUser(): Promise<boolean>;
|
|
336
|
+
changeCurrentUser(newUser: any): Promise<void>;
|
|
337
|
+
setupUserSyncTimer(): Promise<void>;
|
|
338
|
+
syncUserToEndpoint(user: any): Promise<void>;
|
|
339
|
+
updateUser(newUser: any): Promise<void>;
|
|
340
|
+
sendMagicCode({ email }: {
|
|
341
|
+
email: any;
|
|
342
|
+
}): Promise<authAPI.SendMagicCodeResponse>;
|
|
343
|
+
signInWithMagicCode(params: any): Promise<authAPI.CheckMagicCodeResponse>;
|
|
344
|
+
signInWithCustomToken(authToken: any): Promise<authAPI.VerifyResponse>;
|
|
345
|
+
signInAsGuest(params: any): Promise<authAPI.VerifyResponse>;
|
|
346
|
+
potentiallyInvalidateToken(currentUser: any, opts: any): void;
|
|
347
|
+
signOut(opts: any): Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* Creates an OAuth authorization URL.
|
|
350
|
+
*
|
|
351
|
+
* @param {Object} params - The parameters to create the authorization URL.
|
|
352
|
+
* @param {string} params.clientName - The name of the client requesting authorization.
|
|
353
|
+
* @param {string} params.redirectURL - The URL to redirect users to after authorization.
|
|
354
|
+
* @param {Record<string, any>} [params.extraFields] - Extra fields to write to $users on creation
|
|
355
|
+
* @returns {string} The created authorization URL.
|
|
356
|
+
*/
|
|
357
|
+
createAuthorizationURL({ clientName, redirectURL, extraFields }: {
|
|
358
|
+
clientName: string;
|
|
359
|
+
redirectURL: string;
|
|
360
|
+
extraFields?: Record<string, any>;
|
|
361
|
+
}): string;
|
|
362
|
+
/**
|
|
363
|
+
* @param {Object} params
|
|
364
|
+
* @param {string} params.code - The code received from the OAuth service.
|
|
365
|
+
* @param {string} [params.codeVerifier] - The code verifier used to generate the code challenge.
|
|
366
|
+
* @param {Record<string, any>} [params.extraFields] - Extra fields to write to $users on creation
|
|
367
|
+
*/
|
|
368
|
+
exchangeCodeForToken({ code, codeVerifier, extraFields }: {
|
|
369
|
+
code: string;
|
|
370
|
+
codeVerifier?: string;
|
|
371
|
+
extraFields?: Record<string, any>;
|
|
372
|
+
}): Promise<authAPI.CheckMagicCodeResponse>;
|
|
373
|
+
issuerURI(): string;
|
|
374
|
+
/**
|
|
375
|
+
* @param {Object} params
|
|
376
|
+
* @param {string} params.clientName - The name of the client requesting authorization.
|
|
377
|
+
* @param {string} params.idToken - The id_token from the external service
|
|
378
|
+
* @param {string | null | undefined} [params.nonce] - The nonce used when requesting the id_token from the external service
|
|
379
|
+
* @param {Record<string, any>} [params.extraFields] - Extra fields to write to $users on creation
|
|
380
|
+
*/
|
|
381
|
+
signInWithIdToken(params: {
|
|
382
|
+
clientName: string;
|
|
383
|
+
idToken: string;
|
|
384
|
+
nonce?: string | null | undefined;
|
|
385
|
+
extraFields?: Record<string, any>;
|
|
386
|
+
}): Promise<authAPI.CheckMagicCodeResponse>;
|
|
387
|
+
/**
|
|
388
|
+
* @param {string} roomType
|
|
389
|
+
* @param {string} roomId
|
|
390
|
+
* @param {any | null | undefined} [initialPresence] -- initial presence data to send when joining the room
|
|
391
|
+
* @returns () => void
|
|
392
|
+
*/
|
|
393
|
+
joinRoom(roomType: string, roomId: string, initialPresence?: any | null | undefined): () => void;
|
|
394
|
+
_cleanupRoom(roomId: any): void;
|
|
395
|
+
getPresence(roomType: any, roomId: any, opts?: {}): {
|
|
396
|
+
user?: (Pick<any, string | number | symbol> & {
|
|
397
|
+
peerId: string;
|
|
398
|
+
}) | undefined;
|
|
399
|
+
peers: {
|
|
400
|
+
[peerId: string]: Pick<any, string | number | symbol> & {
|
|
401
|
+
peerId: string;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
isLoading: boolean;
|
|
405
|
+
error: any;
|
|
406
|
+
} | null;
|
|
407
|
+
publishPresence(roomType: any, roomId: any, partialData: any): void;
|
|
408
|
+
_trySetPresence(roomId: any, data: any): void;
|
|
409
|
+
_tryJoinRoom(roomType: any, roomId: any, data: any): void;
|
|
410
|
+
_tryLeaveRoom(roomId: any): void;
|
|
411
|
+
_trySetRoomConnected(roomId: any, isConnected: any): void;
|
|
412
|
+
subscribePresence(roomType: any, roomId: any, opts: any, cb: any): () => void;
|
|
413
|
+
_notifyPresenceSubs(roomId: any): void;
|
|
414
|
+
_notifyPresenceSub(roomId: any, handler: any): void;
|
|
415
|
+
_patchPresencePeers(roomId: any, edits: any): void;
|
|
416
|
+
_setPresencePeers(roomId: any, data: any): void;
|
|
417
|
+
publishTopic({ roomType, roomId, topic, data }: {
|
|
418
|
+
data: any;
|
|
419
|
+
roomId: any;
|
|
420
|
+
roomType: any;
|
|
421
|
+
topic: any;
|
|
422
|
+
}): void;
|
|
423
|
+
_tryBroadcast(roomId: any, roomType: any, topic: any, data: any): void;
|
|
424
|
+
subscribeTopic(roomType: any, roomId: any, topic: any, cb: any): () => void;
|
|
425
|
+
_notifyBroadcastSubs(room: any, topic: any, msg: any): void;
|
|
426
|
+
uploadFile(path: any, file: any, opts: any): Promise<StorageApi.UploadFileResponse>;
|
|
427
|
+
deleteFile(path: any): Promise<StorageApi.DeleteFileResponse>;
|
|
428
|
+
upload(path: any, file: any): Promise<boolean>;
|
|
429
|
+
getDownloadUrl(path: any): Promise<any>;
|
|
430
|
+
}
|