@backendrelay/core 1.1.0 → 2.0.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/dist/standalone/index.js +1 -1
- package/dist/standalone/index.umd.cjs +1 -1
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts +20 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js +5 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js +88 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js +131 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js +65 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts +725 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.js +1159 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js +91 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts +17 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js +26 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js +50 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js +33 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts +39 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js +306 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.js +5 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts +20 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js +4 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js +86 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js +129 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.js +63 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.d.ts +725 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.js +1146 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js +89 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts +17 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.js +22 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js +48 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js +31 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts +39 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.js +300 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/admin/dist/esm/version.d.ts.map +1 -0
- package/{src/version.ts → node_modules/@backendrelay/admin/dist/esm/version.js} +1 -1
- package/node_modules/@backendrelay/admin/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/admin/package.json +52 -0
- package/node_modules/@backendrelay/functions/README.md +131 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts +3 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js +3 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js +51 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts +230 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.js +415 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts +3 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js +2 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js +49 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.d.ts +230 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.js +403 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/functions/package.json +49 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts +43 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js +63 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts +43 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.js +59 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/hatchet/package.json +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts +18 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js +77 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js +177 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js +15 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js +25 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts +285 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js +426 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts +24 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js +108 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts +188 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js +412 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts +9 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.js +12 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts +89 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js +357 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts +146 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.js +251 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts +2 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js +29 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts +11 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.js +17 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js +26 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts +19 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.js +76 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js +52 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js +597 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts +98 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js +275 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts +12 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js +26 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.js +66 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js +31 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts +161 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.js +174 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts +25 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js +68 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts +17 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js +314 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.js +55 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.js +5 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts +18 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js +73 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.js +165 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.js +12 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.js +39 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.js +21 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts +285 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js +421 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts +24 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts +188 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.js +393 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.d.ts +9 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.js +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts +89 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js +354 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts +146 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.js +240 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts +2 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.js +26 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts +11 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.js +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.js +21 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.d.ts +19 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.js +18 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js +47 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.js +588 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts +98 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.js +266 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts +12 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js +22 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.js +62 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.js +28 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.js +43 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts +161 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.js +158 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts +25 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js +64 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts +17 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js +310 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.js +46 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.js +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/standalone/index.js +13738 -0
- package/node_modules/@backendrelay/platform/dist/standalone/index.umd.cjs +72 -0
- package/node_modules/@backendrelay/platform/package.json +51 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts +67 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js +129 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts +67 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js +126 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.js +4354 -0
- package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.umd.cjs +6 -0
- package/node_modules/@backendrelay/resumable-stream/package.json +47 -0
- package/node_modules/@backendrelay/rules/README.md +34 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts +117 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.js +68 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.d.ts +117 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.js +64 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/rules/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/rules/package.json +46 -0
- package/node_modules/@backendrelay/test/README.md +75 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts +74 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.js +197 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js +45 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/test/dist/esm/index.d.ts +74 -0
- package/node_modules/@backendrelay/test/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/index.js +192 -0
- package/node_modules/@backendrelay/test/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js +43 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/test/package.json +49 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.js +6 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.js +10 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/index.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/index.js +3 -0
- package/node_modules/@backendrelay/version/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/version/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/esm/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/version.js +7 -0
- package/node_modules/@backendrelay/version/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/standalone/index.js +4 -0
- package/node_modules/@backendrelay/version/dist/standalone/index.umd.cjs +1 -0
- package/node_modules/@backendrelay/version/package.json +44 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts +12 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js +5 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js +82 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts +607 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js +830 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js +139 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts +12 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js +4 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js +80 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts +607 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.js +825 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js +137 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/webhooks/package.json +46 -0
- package/package.json +129 -56
- package/subpaths/admin/index.cjs +1 -0
- package/subpaths/admin/index.d.ts +1 -0
- package/subpaths/admin/index.mjs +3 -0
- package/subpaths/functions/index.cjs +1 -0
- package/subpaths/functions/index.d.ts +1 -0
- package/subpaths/functions/index.mjs +3 -0
- package/subpaths/hatchet/index.cjs +1 -0
- package/subpaths/hatchet/index.d.ts +1 -0
- package/subpaths/hatchet/index.mjs +3 -0
- package/subpaths/platform/index.cjs +1 -0
- package/subpaths/platform/index.d.ts +1 -0
- package/subpaths/platform/index.mjs +3 -0
- package/subpaths/resumable-stream/index.cjs +1 -0
- package/subpaths/resumable-stream/index.d.ts +1 -0
- package/subpaths/resumable-stream/index.mjs +3 -0
- package/subpaths/rules/index.cjs +1 -0
- package/subpaths/rules/index.d.ts +1 -0
- package/subpaths/rules/index.mjs +3 -0
- package/subpaths/test/index.cjs +1 -0
- package/subpaths/test/index.d.ts +1 -0
- package/subpaths/test/index.mjs +3 -0
- package/subpaths/version/index.cjs +1 -0
- package/subpaths/version/index.d.ts +1 -0
- package/subpaths/version/index.mjs +3 -0
- package/subpaths/webhooks/index.cjs +1 -0
- package/subpaths/webhooks/index.d.ts +1 -0
- package/subpaths/webhooks/index.mjs +3 -0
- package/.tshy/build.json +0 -8
- package/.tshy/commonjs.json +0 -16
- package/.tshy/esm.json +0 -15
- package/__example__/standalone.esm.html +0 -23
- package/__example__/standalone.umd.html +0 -21
- package/__tests__/src/Connection.test.ts +0 -292
- package/__tests__/src/IndexedDBStorage.test.ts +0 -96
- package/__tests__/src/Reactor.test.ts +0 -1179
- package/__tests__/src/auth-extra-fields.e2e.test.ts +0 -160
- package/__tests__/src/byop.e2e.test.ts +0 -762
- package/__tests__/src/config.test.ts +0 -85
- package/__tests__/src/cookieSync.e2e.test.ts +0 -163
- package/__tests__/src/data/movies/attrs.json +0 -145
- package/__tests__/src/data/movies/triples.json +0 -1507
- package/__tests__/src/data/zeneca/attrs.json +0 -251
- package/__tests__/src/data/zeneca/triples.json +0 -15854
- package/__tests__/src/datalog.test.ts +0 -175
- package/__tests__/src/devtool.test.ts +0 -23
- package/__tests__/src/framework.test.ts +0 -173
- package/__tests__/src/infiniteQuery.e2e.test.ts +0 -467
- package/__tests__/src/instaml.test.ts +0 -1593
- package/__tests__/src/instaql.bench.ts +0 -34
- package/__tests__/src/instaql.test.ts +0 -1497
- package/__tests__/src/instaqlInference.test.ts +0 -243
- package/__tests__/src/presence.test.ts +0 -49
- package/__tests__/src/queryValidation.test.ts +0 -1101
- package/__tests__/src/schema.test.ts +0 -653
- package/__tests__/src/serializeSchema.test.ts +0 -123
- package/__tests__/src/simple.e2e.test.ts +0 -133
- package/__tests__/src/storage-upload.test.ts +0 -37
- package/__tests__/src/store.test.ts +0 -960
- package/__tests__/src/syncTable.e2e.test.ts +0 -245
- package/__tests__/src/syncTable.test.ts +0 -235
- package/__tests__/src/transactionValidation.test.ts +0 -450
- package/__tests__/src/typeUtils.ts +0 -39
- package/__tests__/src/upstream-improvements.e2e.test.ts +0 -54
- package/__tests__/src/utils/MutationStorage.test.ts +0 -77
- package/__tests__/src/utils/PersistedObject.test.ts +0 -569
- package/__tests__/src/utils/dates.test.ts +0 -111
- package/__tests__/src/utils/e2e.ts +0 -100
- package/__tests__/src/utils/msw.ts +0 -3
- package/__tests__/src/utils/object.test.ts +0 -78
- package/__tests__/src/utils/weakHash.test.ts +0 -68
- package/__tests__/src/utils/weakHashLegacy.test.ts +0 -22
- package/__tests__/src/vite.env.d.ts +0 -1
- package/src/BackendRelayError.ts +0 -50
- package/src/Connection.ts +0 -361
- package/src/InMemoryStorage.ts +0 -34
- package/src/IndexedDBStorage.ts +0 -398
- package/src/Reactor.js +0 -1541
- package/src/StorageAPI.ts +0 -147
- package/src/Stream.ts +0 -1252
- package/src/SyncTable.ts +0 -750
- package/src/WindowNetworkListener.js +0 -19
- package/src/__types__/fieldsTypeTest.ts +0 -111
- package/src/__types__/typeUtils.ts +0 -39
- package/src/__types__/useDatesTypeTest.ts +0 -66
- package/src/attrTypes.ts +0 -37
- package/src/authAPI.ts +0 -205
- package/src/clientTypes.ts +0 -28
- package/src/coreTypes.ts +0 -58
- package/src/createRouteHandler.ts +0 -68
- package/src/datalog.js +0 -116
- package/src/devtool.ts +0 -179
- package/src/framework.ts +0 -450
- package/src/helperTypes.ts +0 -117
- package/src/index.ts +0 -1293
- package/src/infiniteQuery.ts +0 -599
- package/src/instaml.ts +0 -676
- package/src/instaql.ts +0 -999
- package/src/instatx.ts +0 -265
- package/src/model/instaqlResult.js +0 -25
- package/src/parseSchemaFromJSON.ts +0 -176
- package/src/presence.ts +0 -123
- package/src/presenceTypes.ts +0 -19
- package/src/queryTypes.ts +0 -749
- package/src/queryValidation.ts +0 -598
- package/src/reactorAuth.js +0 -236
- package/src/reactorEvents.js +0 -414
- package/src/reactorMutations.js +0 -354
- package/src/reactorRooms.js +0 -297
- package/src/reactorStorage.js +0 -180
- package/src/reactorSubs.js +0 -275
- package/src/reactorTransport.js +0 -391
- package/src/reactorTypes.ts +0 -41
- package/src/routeHandlerProtocol.ts +0 -25
- package/src/rulesTypes.ts +0 -132
- package/src/sanityCheckQueries.ts +0 -191
- package/src/schema.ts +0 -206
- package/src/schemaTypes.ts +0 -664
- package/src/store.ts +0 -1165
- package/src/transactionValidation.ts +0 -204
- package/src/urls.ts +0 -50
- package/src/utils/Deferred.ts +0 -20
- package/src/utils/MutationStorage.ts +0 -89
- package/src/utils/PersistedObject.ts +0 -612
- package/src/utils/dates.ts +0 -269
- package/src/utils/error.ts +0 -9
- package/src/utils/fetch.ts +0 -131
- package/src/utils/flags.ts +0 -14
- package/src/utils/id.ts +0 -28
- package/src/utils/linkIndex.ts +0 -33
- package/src/utils/log.ts +0 -23
- package/src/utils/object.js +0 -180
- package/src/utils/pgtime.ts +0 -199
- package/src/utils/pick.js +0 -9
- package/src/utils/strings.ts +0 -19
- package/src/utils/weakHash.ts +0 -77
- package/src/utils/weakHashLegacy.ts +0 -75
- package/src/warningToggle.ts +0 -5
- package/tsconfig.cjs.dev.json +0 -15
- package/tsconfig.dev.json +0 -14
- package/tsconfig.json +0 -13
- package/tsconfig.test.json +0 -5
- package/vite.config.ts +0 -19
- package/vitest.config.ts +0 -54
package/src/reactorMutations.js
DELETED
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import * as s from './store.ts';
|
|
3
|
-
import * as instaml from './instaml.ts';
|
|
4
|
-
import { STATUS } from './reactorTypes.ts';
|
|
5
|
-
import { BackendRelayError } from './BackendRelayError.ts';
|
|
6
|
-
import { BackendRelayAPIError } from './utils/fetch.ts';
|
|
7
|
-
|
|
8
|
-
/** @typedef {import('./store.ts').AttrsStore} AttrsStore */
|
|
9
|
-
|
|
10
|
-
export const PENDING_TX_CLEANUP_TIMEOUT = 30_000;
|
|
11
|
-
export const PENDING_MUTATION_CLEANUP_THRESHOLD = 200;
|
|
12
|
-
|
|
13
|
-
export function sortedMutationEntries(entries) {
|
|
14
|
-
return [...entries].sort((a, b) => {
|
|
15
|
-
const [ka, muta] = a;
|
|
16
|
-
const [kb, mutb] = b;
|
|
17
|
-
const a_order = muta.order || 0;
|
|
18
|
-
const b_order = mutb.order || 0;
|
|
19
|
-
if (a_order == b_order) {
|
|
20
|
-
return ka < kb ? -1 : ka > kb ? 1 : 0;
|
|
21
|
-
}
|
|
22
|
-
return a_order - b_order;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param {'enqueued' | 'pending' | 'synced' | 'timeout' | 'error' } status
|
|
28
|
-
* @param {string} eventId
|
|
29
|
-
* @param {{message?: string, type?: string, status?: number, hint?: unknown, traceId?: string}} [errorMsg]
|
|
30
|
-
*/
|
|
31
|
-
export function finishTransaction(reactor, status, eventId, errorMsg) {
|
|
32
|
-
const dfd = reactor.mutationDeferredStore.get(eventId);
|
|
33
|
-
reactor.mutationDeferredStore.delete(eventId);
|
|
34
|
-
const ok = status !== 'error' && status !== 'timeout';
|
|
35
|
-
|
|
36
|
-
if (!dfd && !ok) {
|
|
37
|
-
// console.erroring here, as there are no listeners to let know
|
|
38
|
-
console.error('Mutation failed', { status, eventId, ...errorMsg });
|
|
39
|
-
}
|
|
40
|
-
if (!dfd) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (ok) {
|
|
44
|
-
dfd.resolve({ status, eventId });
|
|
45
|
-
} else {
|
|
46
|
-
// Check if error comes from server or client
|
|
47
|
-
if (errorMsg?.type) {
|
|
48
|
-
const { status, ...body } = errorMsg;
|
|
49
|
-
dfd.reject(
|
|
50
|
-
new BackendRelayAPIError({
|
|
51
|
-
// @ts-expect-error body.type is not constant typed
|
|
52
|
-
body,
|
|
53
|
-
status: status ?? 0,
|
|
54
|
-
}),
|
|
55
|
-
);
|
|
56
|
-
} else {
|
|
57
|
-
dfd.reject(
|
|
58
|
-
new BackendRelayError(
|
|
59
|
-
errorMsg?.message || 'Unknown error',
|
|
60
|
-
errorMsg?.hint,
|
|
61
|
-
errorMsg?.traceId,
|
|
62
|
-
),
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @param {'timeout' | 'error'} status
|
|
70
|
-
* @param {string} eventId
|
|
71
|
-
* @param {{message?: string, type?: string, status?: number, hint?: unknown, traceId?: string}} errorMsg
|
|
72
|
-
*/
|
|
73
|
-
export function handleMutationError(reactor, status, eventId, errorMsg) {
|
|
74
|
-
const mut = reactor._pendingMutations().get(eventId);
|
|
75
|
-
|
|
76
|
-
if (mut && (status !== 'timeout' || !mut['tx-id'])) {
|
|
77
|
-
reactor._updatePendingMutations((prev) => {
|
|
78
|
-
delete prev[eventId];
|
|
79
|
-
});
|
|
80
|
-
reactor._inFlightMutationEventIds.delete(eventId);
|
|
81
|
-
const errDetails = {
|
|
82
|
-
message: errorMsg.message,
|
|
83
|
-
hint: errorMsg.hint,
|
|
84
|
-
traceId: errorMsg.traceId,
|
|
85
|
-
};
|
|
86
|
-
reactor.notifyAll();
|
|
87
|
-
reactor.notifyAttrsSubs();
|
|
88
|
-
reactor.notifyMutationErrorSubs(errDetails);
|
|
89
|
-
reactor._notifyError(
|
|
90
|
-
new BackendRelayError(
|
|
91
|
-
errDetails.message || 'Transaction failed.',
|
|
92
|
-
errDetails.hint,
|
|
93
|
-
errDetails.traceId,
|
|
94
|
-
),
|
|
95
|
-
);
|
|
96
|
-
reactor._finishTransaction(status, eventId, errorMsg);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Sends mutation to server and schedules a timeout to cancel it if
|
|
102
|
-
* we don't hear back in time.
|
|
103
|
-
* Note: If we're offline we don't schedule a timeout, we'll schedule it
|
|
104
|
-
* later once we're back online and send the mutation again
|
|
105
|
-
*
|
|
106
|
-
*/
|
|
107
|
-
export function sendMutation(reactor, eventId, mutation) {
|
|
108
|
-
if (mutation.optimistic) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (mutation.error) {
|
|
112
|
-
reactor._handleMutationError('error', eventId, {
|
|
113
|
-
message: mutation.error.message,
|
|
114
|
-
});
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (reactor.status !== STATUS.AUTHENTICATED) {
|
|
118
|
-
reactor._finishTransaction('enqueued', eventId);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const timeoutMs = Math.max(
|
|
122
|
-
6000,
|
|
123
|
-
Math.min(
|
|
124
|
-
reactor._inFlightMutationEventIds.size + 1,
|
|
125
|
-
// Defensive code in case we don't clean up in flight mutation event ids
|
|
126
|
-
reactor._pendingMutations().size + 1,
|
|
127
|
-
) * 6000,
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
if (!reactor._isOnline) {
|
|
131
|
-
reactor._finishTransaction('enqueued', eventId);
|
|
132
|
-
} else {
|
|
133
|
-
reactor._trySend(eventId, mutation);
|
|
134
|
-
|
|
135
|
-
setTimeout(() => {
|
|
136
|
-
if (!reactor._isOnline) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
// If we are here, this means that we have sent this mutation, we are online
|
|
140
|
-
// but we have not received a response. If it's this long, something must be wrong,
|
|
141
|
-
// so we error with a timeout.
|
|
142
|
-
reactor._handleMutationError('timeout', eventId, {
|
|
143
|
-
message: 'transaction timed out',
|
|
144
|
-
});
|
|
145
|
-
}, timeoutMs);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// When we `pushTx`, it's possible that we don't yet have `reactor.attrs`
|
|
150
|
-
// This means that `tx-steps` in `pendingMutations` will include `add-attr`
|
|
151
|
-
// commands for attrs that already exist.
|
|
152
|
-
//
|
|
153
|
-
// This will also affect `add-triple` and `retract-triple` which
|
|
154
|
-
// reference attr-ids that do not match the server.
|
|
155
|
-
//
|
|
156
|
-
// We fix this by rewriting `tx-steps` in each `pendingMutation`.
|
|
157
|
-
// We remove `add-attr` commands for attrs that already exist.
|
|
158
|
-
// We update `add-triple` and `retract-triple` commands to use the
|
|
159
|
-
// server attr-ids.
|
|
160
|
-
/**
|
|
161
|
-
*
|
|
162
|
-
* @param {s.AttrsStore} attrs
|
|
163
|
-
* @param {any} muts
|
|
164
|
-
* @param {number} [processedTxId]
|
|
165
|
-
*/
|
|
166
|
-
export function rewriteMutations(attrs, muts, processedTxId) {
|
|
167
|
-
if (!attrs) return muts;
|
|
168
|
-
if (!muts) return new Map();
|
|
169
|
-
const findExistingAttr = (attr) => {
|
|
170
|
-
const [_, etype, label] = attr['forward-identity'];
|
|
171
|
-
const existing = s.getAttrByFwdIdentName(attrs, etype, label);
|
|
172
|
-
return existing;
|
|
173
|
-
};
|
|
174
|
-
const findReverseAttr = (attr) => {
|
|
175
|
-
const [_, etype, label] = attr['forward-identity'];
|
|
176
|
-
const revAttr = s.getAttrByReverseIdentName(attrs, etype, label);
|
|
177
|
-
return revAttr;
|
|
178
|
-
};
|
|
179
|
-
const mapping = { attrIdMap: {}, refSwapAttrIds: new Set() };
|
|
180
|
-
let mappingChanged = false;
|
|
181
|
-
|
|
182
|
-
const rewriteTxSteps = (txSteps, txId) => {
|
|
183
|
-
const retTxSteps = [];
|
|
184
|
-
for (const txStep of txSteps) {
|
|
185
|
-
const [action] = txStep;
|
|
186
|
-
|
|
187
|
-
// Handles add-attr
|
|
188
|
-
// If existing, we drop it, and track it
|
|
189
|
-
// to update add/retract triples
|
|
190
|
-
if (action === 'add-attr') {
|
|
191
|
-
const [_action, attr] = txStep;
|
|
192
|
-
const existing = findExistingAttr(attr);
|
|
193
|
-
if (existing && attr.id !== existing.id) {
|
|
194
|
-
mapping.attrIdMap[attr.id] = existing.id;
|
|
195
|
-
mappingChanged = true;
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
if (attr['value-type'] === 'ref') {
|
|
199
|
-
const revAttr = findReverseAttr(attr);
|
|
200
|
-
if (revAttr) {
|
|
201
|
-
mapping.attrIdMap[attr.id] = revAttr.id;
|
|
202
|
-
mapping.refSwapAttrIds.add(attr.id);
|
|
203
|
-
mappingChanged = true;
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (
|
|
210
|
-
(processedTxId &&
|
|
211
|
-
txId &&
|
|
212
|
-
processedTxId >= txId &&
|
|
213
|
-
action === 'add-attr') ||
|
|
214
|
-
action === 'update-attr' ||
|
|
215
|
-
action === 'delete-attr'
|
|
216
|
-
) {
|
|
217
|
-
mappingChanged = true;
|
|
218
|
-
// Don't add this step because we already have the newer attrs
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
// Handles add-triple|retract-triple
|
|
222
|
-
// If in mapping, we update the attr-id
|
|
223
|
-
const newTxStep = mappingChanged
|
|
224
|
-
? instaml.rewriteStep(mapping, txStep)
|
|
225
|
-
: txStep;
|
|
226
|
-
|
|
227
|
-
retTxSteps.push(newTxStep);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return mappingChanged ? retTxSteps : txSteps;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
const rewritten = new Map();
|
|
234
|
-
for (const [k, mut] of muts.entries()) {
|
|
235
|
-
rewritten.set(k, {
|
|
236
|
-
...mut,
|
|
237
|
-
'tx-steps': rewriteTxSteps(mut['tx-steps'], mut['tx-id']),
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
if (!mappingChanged) {
|
|
241
|
-
return muts;
|
|
242
|
-
}
|
|
243
|
-
return rewritten;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export function rewriteMutationsSorted(reactor, attrs, muts) {
|
|
247
|
-
return sortedMutationEntries(
|
|
248
|
-
reactor._rewriteMutations(attrs, muts).entries(),
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* @returns {s.AttrsStore}
|
|
254
|
-
*/
|
|
255
|
-
export function optimisticAttrs(reactor) {
|
|
256
|
-
const pendingMutationSteps = [...reactor._pendingMutations().values()] // hack due to Map()
|
|
257
|
-
.flatMap((x) => x['tx-steps']);
|
|
258
|
-
|
|
259
|
-
const deletedAttrIds = new Set(
|
|
260
|
-
pendingMutationSteps
|
|
261
|
-
.filter(([action, _attr]) => action === 'delete-attr')
|
|
262
|
-
.map(([_action, id]) => id),
|
|
263
|
-
);
|
|
264
|
-
|
|
265
|
-
const pendingAttrs = [];
|
|
266
|
-
for (const [_action, attr] of pendingMutationSteps) {
|
|
267
|
-
if (_action === 'add-attr') {
|
|
268
|
-
pendingAttrs.push(attr);
|
|
269
|
-
} else if (
|
|
270
|
-
_action === 'update-attr' &&
|
|
271
|
-
attr.id &&
|
|
272
|
-
reactor.attrs?.getAttr(attr.id)
|
|
273
|
-
) {
|
|
274
|
-
const fullAttr = { ...reactor.attrs.getAttr(attr.id), ...attr };
|
|
275
|
-
pendingAttrs.push(fullAttr);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (!deletedAttrIds.size && !pendingAttrs.length) {
|
|
280
|
-
return reactor.attrs || new s.AttrsStoreClass({}, reactor._linkIndex);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const attrs = { ...(reactor.attrs?.attrs || {}) };
|
|
284
|
-
for (const attr of pendingAttrs) {
|
|
285
|
-
attrs[attr.id] = attr;
|
|
286
|
-
}
|
|
287
|
-
for (const id of deletedAttrIds) {
|
|
288
|
-
delete attrs[id];
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return new s.AttrsStoreClass(attrs, reactor._linkIndex);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export function applyOptimisticUpdates(
|
|
295
|
-
store,
|
|
296
|
-
attrsStore,
|
|
297
|
-
mutations,
|
|
298
|
-
processedTxId,
|
|
299
|
-
) {
|
|
300
|
-
for (const [_, mut] of mutations) {
|
|
301
|
-
if (!mut['tx-id'] || (processedTxId && mut['tx-id'] > processedTxId)) {
|
|
302
|
-
const result = s.transact(store, attrsStore, mut['tx-steps']);
|
|
303
|
-
store = result.store;
|
|
304
|
-
attrsStore = result.attrsStore;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return { store, attrsStore };
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Clean up pendingMutations that all queries have seen
|
|
312
|
-
*/
|
|
313
|
-
export function cleanupPendingMutationsQueries(reactor) {
|
|
314
|
-
let minProcessedTxId = Number.MAX_SAFE_INTEGER;
|
|
315
|
-
for (const { result } of Object.values(reactor.querySubs.currentValue)) {
|
|
316
|
-
if (result?.processedTxId) {
|
|
317
|
-
minProcessedTxId = Math.min(minProcessedTxId, result?.processedTxId);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
reactor._updatePendingMutations((prev) => {
|
|
322
|
-
for (const [eventId, mut] of Object.entries(prev)) {
|
|
323
|
-
if (mut['tx-id'] && mut['tx-id'] <= minProcessedTxId) {
|
|
324
|
-
delete prev[eventId];
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* After mutations is confirmed by server, we give each query 30 sec
|
|
332
|
-
* to update its results. If that doesn't happen, we assume query is
|
|
333
|
-
* unaffected by this mutation and it’s safe to delete it from local queue
|
|
334
|
-
*/
|
|
335
|
-
export function cleanupPendingMutationsTimeout(reactor) {
|
|
336
|
-
if (
|
|
337
|
-
reactor._pendingMutations().size < reactor._pendingMutationCleanupThreshold
|
|
338
|
-
) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
const now = Date.now();
|
|
343
|
-
|
|
344
|
-
reactor._updatePendingMutations((prev) => {
|
|
345
|
-
for (const [eventId, mut] of Object.entries(prev)) {
|
|
346
|
-
if (
|
|
347
|
-
mut.confirmed &&
|
|
348
|
-
mut.confirmed + reactor._pendingTxCleanupTimeout < now
|
|
349
|
-
) {
|
|
350
|
-
delete prev[eventId];
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
}
|
package/src/reactorRooms.js
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import uuid from './utils/id.ts';
|
|
3
|
-
import { create } from 'mutative';
|
|
4
|
-
import {
|
|
5
|
-
assocInMutative,
|
|
6
|
-
dissocInMutative,
|
|
7
|
-
insertInMutative,
|
|
8
|
-
} from './utils/object.js';
|
|
9
|
-
import { buildPresenceSlice, hasPresenceResponseChanged } from './presence.ts';
|
|
10
|
-
|
|
11
|
-
export function flushEnqueuedRoomData(reactor, roomId) {
|
|
12
|
-
const enqueuedUserPresence = reactor._presence[roomId]?.result?.user;
|
|
13
|
-
const enqueuedBroadcasts = reactor._broadcastQueue[roomId];
|
|
14
|
-
|
|
15
|
-
reactor._broadcastQueue[roomId] = [];
|
|
16
|
-
|
|
17
|
-
if (enqueuedUserPresence) {
|
|
18
|
-
reactor._trySetPresence(roomId, enqueuedUserPresence);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (enqueuedBroadcasts) {
|
|
22
|
-
for (const item of enqueuedBroadcasts) {
|
|
23
|
-
const { topic, roomType, data } = item;
|
|
24
|
-
reactor._tryBroadcast(roomId, roomType, topic, data);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @param {string} roomType
|
|
31
|
-
* @param {string} roomId
|
|
32
|
-
* @param {any | null | undefined} [initialPresence] -- initial presence data to send when joining the room
|
|
33
|
-
* @returns () => void
|
|
34
|
-
*/
|
|
35
|
-
export function joinRoom(reactor, roomType, roomId, initialPresence) {
|
|
36
|
-
let needsToSendJoin = false;
|
|
37
|
-
if (!reactor._rooms[roomId]) {
|
|
38
|
-
needsToSendJoin = true;
|
|
39
|
-
reactor._rooms[roomId] = {
|
|
40
|
-
roomType,
|
|
41
|
-
isConnected: false,
|
|
42
|
-
error: undefined,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
reactor._presence[roomId] = reactor._presence[roomId] || {};
|
|
47
|
-
const previousResult = reactor._presence[roomId].result;
|
|
48
|
-
if (initialPresence && !previousResult) {
|
|
49
|
-
reactor._presence[roomId].result = reactor._presence[roomId].result || {};
|
|
50
|
-
reactor._presence[roomId].result.user = initialPresence;
|
|
51
|
-
reactor._notifyPresenceSubs(roomId);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (needsToSendJoin) {
|
|
55
|
-
reactor._tryJoinRoom(roomType, roomId, initialPresence);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return () => {
|
|
59
|
-
reactor._cleanupRoom(roomId);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function cleanupRoom(reactor, roomId) {
|
|
64
|
-
if (
|
|
65
|
-
!reactor._presence[roomId]?.handlers?.length &&
|
|
66
|
-
!Object.keys(reactor._broadcastSubs[roomId] ?? {}).length
|
|
67
|
-
) {
|
|
68
|
-
const isConnected = reactor._rooms[roomId]?.isConnected;
|
|
69
|
-
|
|
70
|
-
delete reactor._rooms[roomId];
|
|
71
|
-
delete reactor._presence[roomId];
|
|
72
|
-
delete reactor._broadcastSubs[roomId];
|
|
73
|
-
|
|
74
|
-
if (isConnected) {
|
|
75
|
-
reactor._tryLeaveRoom(roomId);
|
|
76
|
-
} else {
|
|
77
|
-
reactor._roomsPendingLeave[roomId] = true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// TODO: look into typing again
|
|
83
|
-
export function getPresence(reactor, roomType, roomId, opts = {}) {
|
|
84
|
-
const room = reactor._rooms[roomId];
|
|
85
|
-
const presence = reactor._presence[roomId];
|
|
86
|
-
if (!room || !presence || !presence.result) return null;
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
...buildPresenceSlice(presence.result, opts, reactor._sessionId),
|
|
90
|
-
isLoading: !room.isConnected,
|
|
91
|
-
error: room.error,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// TODO: look into typing again
|
|
96
|
-
export function publishPresence(reactor, roomType, roomId, partialData) {
|
|
97
|
-
const room = reactor._rooms[roomId];
|
|
98
|
-
const presence = reactor._presence[roomId];
|
|
99
|
-
|
|
100
|
-
if (!room || !presence) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
presence.result = presence.result || {};
|
|
105
|
-
const data = {
|
|
106
|
-
...presence.result.user,
|
|
107
|
-
...partialData,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
presence.result.user = data;
|
|
111
|
-
|
|
112
|
-
if (!room.isConnected) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
reactor._trySetPresence(roomId, data);
|
|
117
|
-
reactor._notifyPresenceSubs(roomId);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function trySetPresence(reactor, roomId, data) {
|
|
121
|
-
reactor._trySendAuthed(uuid(), {
|
|
122
|
-
op: 'set-presence',
|
|
123
|
-
'room-id': roomId,
|
|
124
|
-
data,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function tryJoinRoom(reactor, roomType, roomId, data) {
|
|
129
|
-
reactor._trySendAuthed(uuid(), {
|
|
130
|
-
op: 'join-room',
|
|
131
|
-
'room-type': roomType,
|
|
132
|
-
'room-id': roomId,
|
|
133
|
-
data,
|
|
134
|
-
});
|
|
135
|
-
delete reactor._roomsPendingLeave[roomId];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function tryLeaveRoom(reactor, roomId) {
|
|
139
|
-
reactor._trySendAuthed(uuid(), { op: 'leave-room', 'room-id': roomId });
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function trySetRoomConnected(reactor, roomId, isConnected) {
|
|
143
|
-
const room = reactor._rooms[roomId];
|
|
144
|
-
if (room) {
|
|
145
|
-
room.isConnected = isConnected;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// TODO: look into typing again
|
|
150
|
-
export function subscribePresence(reactor, roomType, roomId, opts, cb) {
|
|
151
|
-
const leaveRoom = reactor.joinRoom(
|
|
152
|
-
roomType,
|
|
153
|
-
roomId,
|
|
154
|
-
// Oct 28, 2025
|
|
155
|
-
// Note: initialData is deprecated.
|
|
156
|
-
// Keeping here for backwards compatibility
|
|
157
|
-
opts.initialPresence || opts.initialData,
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
const handler = { ...opts, roomId, cb, prev: null };
|
|
161
|
-
|
|
162
|
-
reactor._presence[roomId] = reactor._presence[roomId] || {};
|
|
163
|
-
reactor._presence[roomId].handlers = reactor._presence[roomId].handlers || [];
|
|
164
|
-
reactor._presence[roomId].handlers.push(handler);
|
|
165
|
-
|
|
166
|
-
reactor._notifyPresenceSub(roomId, handler);
|
|
167
|
-
|
|
168
|
-
return () => {
|
|
169
|
-
reactor._presence[roomId].handlers =
|
|
170
|
-
reactor._presence[roomId]?.handlers?.filter((x) => x !== handler) ?? [];
|
|
171
|
-
|
|
172
|
-
leaveRoom();
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export function notifyPresenceSubs(reactor, roomId) {
|
|
177
|
-
reactor._presence[roomId]?.handlers?.forEach((handler) => {
|
|
178
|
-
reactor._notifyPresenceSub(roomId, handler);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export function notifyPresenceSub(reactor, roomId, handler) {
|
|
183
|
-
const slice = reactor.getPresence('', roomId, handler);
|
|
184
|
-
|
|
185
|
-
if (!slice) {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (handler.prev && !hasPresenceResponseChanged(slice, handler.prev)) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
handler.prev = slice;
|
|
194
|
-
handler.cb(slice);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export function patchPresencePeers(reactor, roomId, edits) {
|
|
198
|
-
const peers = reactor._presence[roomId]?.result?.peers || {};
|
|
199
|
-
let sessions = Object.fromEntries(
|
|
200
|
-
Object.entries(peers).map(([k, v]) => [k, { data: v }]),
|
|
201
|
-
);
|
|
202
|
-
const myPresence = reactor._presence[roomId]?.result;
|
|
203
|
-
const newSessions = create(sessions, (draft) => {
|
|
204
|
-
for (let [path, op, value] of edits) {
|
|
205
|
-
switch (op) {
|
|
206
|
-
case '+':
|
|
207
|
-
insertInMutative(draft, path, value);
|
|
208
|
-
break;
|
|
209
|
-
case 'r':
|
|
210
|
-
assocInMutative(draft, path, value);
|
|
211
|
-
break;
|
|
212
|
-
case '-':
|
|
213
|
-
dissocInMutative(draft, path);
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
// Ignore our own edits
|
|
218
|
-
delete draft[reactor._sessionId];
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
reactor._setPresencePeers(roomId, newSessions);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export function setPresencePeers(reactor, roomId, data) {
|
|
225
|
-
const sessions = { ...data };
|
|
226
|
-
// no need to keep track of `user`
|
|
227
|
-
delete sessions[reactor._sessionId];
|
|
228
|
-
const peers = Object.fromEntries(
|
|
229
|
-
Object.entries(sessions).map(([k, v]) => [k, v.data]),
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
reactor._presence = create(reactor._presence, (draft) => {
|
|
233
|
-
assocInMutative(draft, [roomId, 'result', 'peers'], peers);
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export function publishTopic(reactor, { roomType, roomId, topic, data }) {
|
|
238
|
-
const room = reactor._rooms[roomId];
|
|
239
|
-
|
|
240
|
-
if (!room) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (!room.isConnected) {
|
|
245
|
-
reactor._broadcastQueue[roomId] = reactor._broadcastQueue[roomId] ?? [];
|
|
246
|
-
reactor._broadcastQueue[roomId].push({ topic, roomType, data });
|
|
247
|
-
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
reactor._tryBroadcast(roomId, roomType, topic, data);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export function tryBroadcast(reactor, roomId, roomType, topic, data) {
|
|
255
|
-
reactor._trySendAuthed(uuid(), {
|
|
256
|
-
op: 'client-broadcast',
|
|
257
|
-
'room-id': roomId,
|
|
258
|
-
roomType,
|
|
259
|
-
topic,
|
|
260
|
-
data,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export function subscribeTopic(reactor, roomType, roomId, topic, cb) {
|
|
265
|
-
const leaveRoom = reactor.joinRoom(roomType, roomId);
|
|
266
|
-
|
|
267
|
-
reactor._broadcastSubs[roomId] = reactor._broadcastSubs[roomId] || {};
|
|
268
|
-
reactor._broadcastSubs[roomId][topic] =
|
|
269
|
-
reactor._broadcastSubs[roomId][topic] || [];
|
|
270
|
-
reactor._broadcastSubs[roomId][topic].push(cb);
|
|
271
|
-
reactor._presence[roomId] = reactor._presence[roomId] || {};
|
|
272
|
-
|
|
273
|
-
return () => {
|
|
274
|
-
reactor._broadcastSubs[roomId][topic] = reactor._broadcastSubs[roomId][
|
|
275
|
-
topic
|
|
276
|
-
].filter((x) => x !== cb);
|
|
277
|
-
|
|
278
|
-
if (!reactor._broadcastSubs[roomId][topic].length) {
|
|
279
|
-
delete reactor._broadcastSubs[roomId][topic];
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
leaveRoom();
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
export function notifyBroadcastSubs(reactor, room, topic, msg) {
|
|
287
|
-
reactor._broadcastSubs?.[room]?.[topic]?.forEach((cb) => {
|
|
288
|
-
const data = msg.data?.data;
|
|
289
|
-
|
|
290
|
-
const peer =
|
|
291
|
-
msg.data['peer-id'] === reactor._sessionId
|
|
292
|
-
? reactor._presence[room]?.result?.user
|
|
293
|
-
: reactor._presence[room]?.result?.peers?.[msg.data['peer-id']];
|
|
294
|
-
|
|
295
|
-
return cb(data, peer);
|
|
296
|
-
});
|
|
297
|
-
}
|