@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/instatx.ts
DELETED
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
IContainEntitiesAndLinks,
|
|
3
|
-
LinkParams,
|
|
4
|
-
CreateParams,
|
|
5
|
-
UpdateParams,
|
|
6
|
-
UpdateOpts,
|
|
7
|
-
RuleParams,
|
|
8
|
-
UniqueKeys,
|
|
9
|
-
ResolveEntityAttrs,
|
|
10
|
-
} from './schemaTypes.ts';
|
|
11
|
-
|
|
12
|
-
type Action =
|
|
13
|
-
| 'create'
|
|
14
|
-
| 'update'
|
|
15
|
-
| 'link'
|
|
16
|
-
| 'unlink'
|
|
17
|
-
| 'delete'
|
|
18
|
-
| 'merge'
|
|
19
|
-
| 'ruleParams';
|
|
20
|
-
type EType = string;
|
|
21
|
-
type Id = string;
|
|
22
|
-
type Args = any;
|
|
23
|
-
type LookupRef = [string, any];
|
|
24
|
-
type Lookup = string;
|
|
25
|
-
type Opts = UpdateOpts;
|
|
26
|
-
export type Op = [Action, EType, Id | LookupRef, Args, Opts?];
|
|
27
|
-
|
|
28
|
-
export interface TransactionChunk<
|
|
29
|
-
Schema extends IContainEntitiesAndLinks<any, any>,
|
|
30
|
-
EntityName extends keyof Schema['entities'],
|
|
31
|
-
> {
|
|
32
|
-
__ops: Op[];
|
|
33
|
-
__etype: EntityName;
|
|
34
|
-
/**
|
|
35
|
-
* Create objects. Throws an error if the object with the provided ID already
|
|
36
|
-
* exists.
|
|
37
|
-
*/
|
|
38
|
-
create: (
|
|
39
|
-
args: CreateParams<Schema, EntityName>,
|
|
40
|
-
) => TransactionChunk<Schema, EntityName>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Create and update objects. By default works in upsert mode (will create
|
|
44
|
-
* entity if that doesn't exist). Can be optionally put into "strict update"
|
|
45
|
-
* mode by providing { upsert: false } option as second argument:
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* const goalId = id();
|
|
49
|
-
* // upsert
|
|
50
|
-
* db.tx.goals[goalId].update({title: "Get fit", difficulty: 5})
|
|
51
|
-
*
|
|
52
|
-
* // strict update
|
|
53
|
-
* db.tx.goals[goalId].update({title: "Get fit"}, {upsert: false})
|
|
54
|
-
*/
|
|
55
|
-
update: (
|
|
56
|
-
args: UpdateParams<Schema, EntityName>,
|
|
57
|
-
opts?: UpdateOpts,
|
|
58
|
-
) => TransactionChunk<Schema, EntityName>;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Link two objects together
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* const goalId = id();
|
|
65
|
-
* const todoId = id();
|
|
66
|
-
* db.transact([
|
|
67
|
-
* db.tx.goals[goalId].update({title: "Get fit"}),
|
|
68
|
-
* db.tx.todos[todoId].update({title: "Go on a run"}),
|
|
69
|
-
* db.tx.goals[goalId].link({todos: todoId}),
|
|
70
|
-
* ])
|
|
71
|
-
*
|
|
72
|
-
* // Now, if you query:
|
|
73
|
-
* useQuery({ goals: { todos: {} } })
|
|
74
|
-
* // You'll get back:
|
|
75
|
-
*
|
|
76
|
-
* // { goals: [{ title: "Get fit", todos: [{ title: "Go on a run" }]}
|
|
77
|
-
*/
|
|
78
|
-
link: (
|
|
79
|
-
args: LinkParams<Schema, EntityName>,
|
|
80
|
-
) => TransactionChunk<Schema, EntityName>;
|
|
81
|
-
/**
|
|
82
|
-
* Unlink two objects
|
|
83
|
-
* @example
|
|
84
|
-
* // to "unlink" a todo from a goal:
|
|
85
|
-
* db.tx.goals[goalId].unlink({todos: todoId})
|
|
86
|
-
*/
|
|
87
|
-
unlink: (
|
|
88
|
-
args: LinkParams<Schema, EntityName>,
|
|
89
|
-
) => TransactionChunk<Schema, EntityName>;
|
|
90
|
-
/**
|
|
91
|
-
* Delete an object, alongside all of its links.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* db.tx.goals[goalId].delete()
|
|
95
|
-
*/
|
|
96
|
-
delete: () => TransactionChunk<Schema, EntityName>;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
*
|
|
100
|
-
* Similar to `update`, but instead of overwriting the current value, it will merge the provided values into the current value.
|
|
101
|
-
*
|
|
102
|
-
* This is useful for deeply nested, document-style values, or for updating a single attribute at an arbitrary depth without overwriting the rest of the object.
|
|
103
|
-
*
|
|
104
|
-
* For example, if you have a goal with a nested `metrics` object:
|
|
105
|
-
*
|
|
106
|
-
* ```js
|
|
107
|
-
* goal = { name: "Get fit", metrics: { progress: 0.3 } }
|
|
108
|
-
* ```
|
|
109
|
-
*
|
|
110
|
-
* You can update the `progress` attribute like so:
|
|
111
|
-
*
|
|
112
|
-
* ```js
|
|
113
|
-
* db.tx.goals[goalId].merge({ metrics: { progress: 0.5 }, category: "Fitness" })
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* And the resulting object will be:
|
|
117
|
-
*
|
|
118
|
-
* ```js
|
|
119
|
-
* goal = { name: "Get fit", metrics: { progress: 0.5 }, category: "Fitness" }
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* const goalId = id();
|
|
124
|
-
* db.tx.goals[goalId].merge({title: "Get fitter"})
|
|
125
|
-
*/
|
|
126
|
-
merge: (
|
|
127
|
-
args: {
|
|
128
|
-
[attribute: string]: any;
|
|
129
|
-
},
|
|
130
|
-
opts?: UpdateOpts,
|
|
131
|
-
) => TransactionChunk<Schema, EntityName>;
|
|
132
|
-
|
|
133
|
-
ruleParams: (args: RuleParams) => TransactionChunk<Schema, EntityName>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// This is a hack to get typescript to enforce that
|
|
137
|
-
// `allTransactionChunkKeys` contains all the keys of `TransactionChunk`
|
|
138
|
-
type TransactionChunkKey = keyof TransactionChunk<any, any>;
|
|
139
|
-
function getAllTransactionChunkKeys(): Set<TransactionChunkKey> {
|
|
140
|
-
const v: any = 1;
|
|
141
|
-
const _dummy: TransactionChunk<any, any> = {
|
|
142
|
-
__etype: v,
|
|
143
|
-
__ops: v,
|
|
144
|
-
create: v,
|
|
145
|
-
update: v,
|
|
146
|
-
link: v,
|
|
147
|
-
unlink: v,
|
|
148
|
-
delete: v,
|
|
149
|
-
merge: v,
|
|
150
|
-
ruleParams: v,
|
|
151
|
-
};
|
|
152
|
-
return new Set(Object.keys(_dummy)) as Set<TransactionChunkKey>;
|
|
153
|
-
}
|
|
154
|
-
const allTransactionChunkKeys = getAllTransactionChunkKeys();
|
|
155
|
-
|
|
156
|
-
export type ETypeChunk<
|
|
157
|
-
Schema extends IContainEntitiesAndLinks<any, any>,
|
|
158
|
-
EntityName extends keyof Schema['entities'],
|
|
159
|
-
> = {
|
|
160
|
-
[id: Id]: TransactionChunk<Schema, EntityName>;
|
|
161
|
-
} & {
|
|
162
|
-
lookup: <Name extends UniqueKeys<Schema['entities'][EntityName]['attrs']>>(
|
|
163
|
-
attrName: Name,
|
|
164
|
-
value: ResolveEntityAttrs<Schema['entities'][EntityName]>[Name],
|
|
165
|
-
) => TransactionChunk<Schema, EntityName>;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
export type TxChunk<Schema extends IContainEntitiesAndLinks<any, any>> = {
|
|
169
|
-
[EntityName in keyof Schema['entities']]: ETypeChunk<Schema, EntityName>;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
function transactionChunk(
|
|
173
|
-
etype: EType,
|
|
174
|
-
id: Id | LookupRef,
|
|
175
|
-
prevOps: Op[],
|
|
176
|
-
): TransactionChunk<any, any> {
|
|
177
|
-
const target = {
|
|
178
|
-
__etype: etype,
|
|
179
|
-
__ops: prevOps,
|
|
180
|
-
};
|
|
181
|
-
return new Proxy(target as unknown as TransactionChunk<any, any>, {
|
|
182
|
-
get: (_target, cmd: keyof TransactionChunk<any, any>) => {
|
|
183
|
-
if (cmd === '__ops') return prevOps;
|
|
184
|
-
if (cmd === '__etype') return etype;
|
|
185
|
-
if (!allTransactionChunkKeys.has(cmd)) {
|
|
186
|
-
return undefined;
|
|
187
|
-
}
|
|
188
|
-
return (args: Args, opts?: Opts) => {
|
|
189
|
-
return transactionChunk(etype, id, [
|
|
190
|
-
...prevOps,
|
|
191
|
-
opts ? [cmd, etype, id, args, opts] : [cmd, etype, id, args],
|
|
192
|
-
]);
|
|
193
|
-
};
|
|
194
|
-
},
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Creates a lookup to use in place of an id in a transaction
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* db.tx.users[lookup('email', 'lyndon@example.com')].update({name: 'Lyndon'})
|
|
203
|
-
*/
|
|
204
|
-
export function lookup(attribute: string, value: any): Lookup {
|
|
205
|
-
return `lookup__${attribute}__${JSON.stringify(value)}`;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export function isLookup(k: string): boolean {
|
|
209
|
-
return k.startsWith('lookup__');
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export function parseLookup(k: string): LookupRef {
|
|
213
|
-
const [_, attribute, ...vJSON] = k.split('__');
|
|
214
|
-
return [attribute, JSON.parse(vJSON.join('__'))];
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function etypeChunk(etype: EType): ETypeChunk<any, EType> {
|
|
218
|
-
return new Proxy(
|
|
219
|
-
{
|
|
220
|
-
__etype: etype,
|
|
221
|
-
} as unknown as ETypeChunk<any, EType>,
|
|
222
|
-
{
|
|
223
|
-
get(_target, cmd: Id) {
|
|
224
|
-
if (cmd === 'lookup') {
|
|
225
|
-
return (attrName: string, value: any) =>
|
|
226
|
-
transactionChunk(etype, parseLookup(lookup(attrName, value)), []);
|
|
227
|
-
}
|
|
228
|
-
if (cmd === '__etype') return etype;
|
|
229
|
-
const id = cmd;
|
|
230
|
-
if (isLookup(id)) {
|
|
231
|
-
return transactionChunk(etype, parseLookup(id), []);
|
|
232
|
-
}
|
|
233
|
-
return transactionChunk(etype, id, []);
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export function txInit<
|
|
240
|
-
Schema extends IContainEntitiesAndLinks<any, any>,
|
|
241
|
-
>(): TxChunk<Schema> {
|
|
242
|
-
return new Proxy(
|
|
243
|
-
{},
|
|
244
|
-
{
|
|
245
|
-
get(_target, ns: EType) {
|
|
246
|
-
return etypeChunk(ns);
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
) as any;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* A handy builder for changes.
|
|
254
|
-
*
|
|
255
|
-
* You must start with the `namespace` you want to change:
|
|
256
|
-
*
|
|
257
|
-
* @example
|
|
258
|
-
* db.tx.goals[goalId].update({title: "Get fit"})
|
|
259
|
-
* // Note: you don't need to create `goals` ahead of time.
|
|
260
|
-
*/
|
|
261
|
-
export const tx = txInit();
|
|
262
|
-
|
|
263
|
-
export function getOps(x: TransactionChunk<any, any>): Op[] {
|
|
264
|
-
return x.__ops;
|
|
265
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
function _extractTriplesHelper(idNodes, acc = []) {
|
|
2
|
-
idNodes.forEach((idNode) => {
|
|
3
|
-
const { data } = idNode;
|
|
4
|
-
const { 'datalog-result': datalogResult } = data;
|
|
5
|
-
const { 'join-rows': joinRows } = datalogResult;
|
|
6
|
-
for (const rows of joinRows) {
|
|
7
|
-
for (const triple of rows) {
|
|
8
|
-
acc.push(triple);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
_extractTriplesHelper(idNode['child-nodes'], acc);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Marshall instaql-result into list of triples. Instaql-result may have
|
|
17
|
-
* multiple datalog-results, each datalog-result may have multiple join-rows
|
|
18
|
-
* and each join-row may have triples.The union of these triples may have
|
|
19
|
-
* duplicates, so we dedup them.
|
|
20
|
-
*/
|
|
21
|
-
export function extractTriples(idNodes) {
|
|
22
|
-
const triples = [];
|
|
23
|
-
_extractTriplesHelper(idNodes, triples);
|
|
24
|
-
return triples;
|
|
25
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { i } from './schema.ts';
|
|
2
|
-
import { DataAttrDef, BackendRelaySchemaDef } from './schemaTypes.ts';
|
|
3
|
-
|
|
4
|
-
export const parseSchemaFromJSON = (
|
|
5
|
-
s: any,
|
|
6
|
-
): BackendRelaySchemaDef<any, any, any> => {
|
|
7
|
-
// Parse entities
|
|
8
|
-
const entities: Record<string, any> = {};
|
|
9
|
-
|
|
10
|
-
for (const [entityName, entityInfo] of Object.entries(s.entities)) {
|
|
11
|
-
const entityDef = entityInfo as any;
|
|
12
|
-
const attrs: Record<string, any> = {};
|
|
13
|
-
|
|
14
|
-
// Parse attributes
|
|
15
|
-
for (const [attrName, attrInfo] of Object.entries(entityDef.attrs)) {
|
|
16
|
-
const attrDef = attrInfo as any;
|
|
17
|
-
let attr: DataAttrDef<any, any, any>;
|
|
18
|
-
|
|
19
|
-
// Create the appropriate attribute type
|
|
20
|
-
switch (attrDef.valueType) {
|
|
21
|
-
case 'string':
|
|
22
|
-
attr = i.string();
|
|
23
|
-
break;
|
|
24
|
-
case 'number':
|
|
25
|
-
attr = i.number();
|
|
26
|
-
break;
|
|
27
|
-
case 'boolean':
|
|
28
|
-
attr = i.boolean();
|
|
29
|
-
break;
|
|
30
|
-
case 'date':
|
|
31
|
-
attr = i.date();
|
|
32
|
-
break;
|
|
33
|
-
case 'json':
|
|
34
|
-
attr = i.json();
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
attr = i.json();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Apply modifiers
|
|
41
|
-
if (!attrDef.required) {
|
|
42
|
-
attr = attr.optional();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (attrDef.config?.indexed) {
|
|
46
|
-
attr = attr.indexed();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (attrDef.config?.unique) {
|
|
50
|
-
attr = attr.unique();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
attrs[attrName] = attr;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
entities[entityName] = i.entity(attrs);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Parse links
|
|
60
|
-
const links: Record<string, any> = s.links || {};
|
|
61
|
-
|
|
62
|
-
// Parse rooms
|
|
63
|
-
const rooms: Record<string, any> = {};
|
|
64
|
-
|
|
65
|
-
if (s.rooms) {
|
|
66
|
-
for (const [roomName, roomInfo] of Object.entries(s.rooms)) {
|
|
67
|
-
const roomDef = roomInfo as any;
|
|
68
|
-
|
|
69
|
-
// Parse presence
|
|
70
|
-
const presenceAttrs: Record<string, any> = {};
|
|
71
|
-
for (const [attrName, attrInfo] of Object.entries(
|
|
72
|
-
roomDef.presence.attrs,
|
|
73
|
-
)) {
|
|
74
|
-
const attrDef = attrInfo as any;
|
|
75
|
-
let attr: DataAttrDef<any, any, any>;
|
|
76
|
-
|
|
77
|
-
switch (attrDef.valueType) {
|
|
78
|
-
case 'string':
|
|
79
|
-
attr = i.string();
|
|
80
|
-
break;
|
|
81
|
-
case 'number':
|
|
82
|
-
attr = i.number();
|
|
83
|
-
break;
|
|
84
|
-
case 'boolean':
|
|
85
|
-
attr = i.boolean();
|
|
86
|
-
break;
|
|
87
|
-
case 'date':
|
|
88
|
-
attr = i.date();
|
|
89
|
-
break;
|
|
90
|
-
case 'json':
|
|
91
|
-
attr = i.json();
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
94
|
-
attr = i.json();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (!attrDef.required) {
|
|
98
|
-
attr = attr.optional();
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (attrDef.config?.indexed) {
|
|
102
|
-
attr = attr.indexed();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (attrDef.config?.unique) {
|
|
106
|
-
attr = attr.unique();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
presenceAttrs[attrName] = attr;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Parse topics
|
|
113
|
-
const topics: Record<string, any> = {};
|
|
114
|
-
if (roomDef.topics) {
|
|
115
|
-
for (const [topicName, topicInfo] of Object.entries(roomDef.topics)) {
|
|
116
|
-
const topicDef = topicInfo as any;
|
|
117
|
-
const topicAttrs: Record<string, any> = {};
|
|
118
|
-
|
|
119
|
-
for (const [attrName, attrInfo] of Object.entries(topicDef.attrs)) {
|
|
120
|
-
const attrDef = attrInfo as any;
|
|
121
|
-
let attr: DataAttrDef<any, any, any>;
|
|
122
|
-
|
|
123
|
-
switch (attrDef.valueType) {
|
|
124
|
-
case 'string':
|
|
125
|
-
attr = i.string();
|
|
126
|
-
break;
|
|
127
|
-
case 'number':
|
|
128
|
-
attr = i.number();
|
|
129
|
-
break;
|
|
130
|
-
case 'boolean':
|
|
131
|
-
attr = i.boolean();
|
|
132
|
-
break;
|
|
133
|
-
case 'date':
|
|
134
|
-
attr = i.date();
|
|
135
|
-
break;
|
|
136
|
-
case 'json':
|
|
137
|
-
attr = i.json();
|
|
138
|
-
break;
|
|
139
|
-
default:
|
|
140
|
-
attr = i.json();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (!attrDef.required) {
|
|
144
|
-
attr = attr.optional();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (attrDef.config?.indexed) {
|
|
148
|
-
attr = attr.indexed();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (attrDef.config?.unique) {
|
|
152
|
-
attr = attr.unique();
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
topicAttrs[attrName] = attr;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
topics[topicName] = i.entity(topicAttrs);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
rooms[roomName] = {
|
|
163
|
-
presence: i.entity(presenceAttrs),
|
|
164
|
-
topics,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const resultingSchema = i.schema({
|
|
170
|
-
entities,
|
|
171
|
-
links,
|
|
172
|
-
rooms,
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
return resultingSchema;
|
|
176
|
-
};
|
package/src/presence.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { pick } from './utils/pick.js';
|
|
2
|
-
import { areObjectsShallowEqual, areObjectKeysEqual } from './utils/object.js';
|
|
3
|
-
|
|
4
|
-
export type RoomSchemaShape = {
|
|
5
|
-
[k: string]: {
|
|
6
|
-
presence?: { [k: string]: any };
|
|
7
|
-
topics?: {
|
|
8
|
-
[k: string]: {
|
|
9
|
-
[k: string]: any;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type PresenceOpts<PresenceShape, Keys extends keyof PresenceShape> = {
|
|
16
|
-
user?: boolean;
|
|
17
|
-
peers?: string[];
|
|
18
|
-
keys?: Keys[];
|
|
19
|
-
/**
|
|
20
|
-
* If you haven't joined this room yet, initialPresence lets you set
|
|
21
|
-
* the very first presence state for the user.
|
|
22
|
-
*/
|
|
23
|
-
initialPresence?: Partial<PresenceShape>;
|
|
24
|
-
|
|
25
|
-
/** @deprecated use `initialPresence` */
|
|
26
|
-
initialData?: Partial<PresenceShape>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
type PresencePeer<PresenceShape, Keys extends keyof PresenceShape> = Pick<
|
|
30
|
-
PresenceShape,
|
|
31
|
-
Keys
|
|
32
|
-
> & {
|
|
33
|
-
peerId: string;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type PresenceSlice<PresenceShape, Keys extends keyof PresenceShape> = {
|
|
37
|
-
user?: PresencePeer<PresenceShape, Keys>;
|
|
38
|
-
peers: {
|
|
39
|
-
[peerId: string]: PresencePeer<PresenceShape, Keys>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type PresenceResponse<
|
|
44
|
-
PresenceShape,
|
|
45
|
-
Keys extends keyof PresenceShape,
|
|
46
|
-
> = PresenceSlice<PresenceShape, Keys> & {
|
|
47
|
-
isLoading: boolean;
|
|
48
|
-
error?: string;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export function buildPresenceSlice<
|
|
52
|
-
PresenceShape,
|
|
53
|
-
Keys extends keyof PresenceShape,
|
|
54
|
-
>(
|
|
55
|
-
data: {
|
|
56
|
-
user?: PresenceShape;
|
|
57
|
-
peers: Record<string, PresenceShape>;
|
|
58
|
-
},
|
|
59
|
-
opts: PresenceOpts<PresenceShape, Keys>,
|
|
60
|
-
userPeerId: string,
|
|
61
|
-
): PresenceSlice<PresenceShape, Keys> {
|
|
62
|
-
const slice: PresenceSlice<PresenceShape, Keys> = {
|
|
63
|
-
peers: {},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const includeUser = opts && 'user' in opts ? opts.user : true;
|
|
67
|
-
|
|
68
|
-
if (includeUser) {
|
|
69
|
-
const user = pick(data.user ?? {}, opts?.keys);
|
|
70
|
-
slice.user = { ...user, peerId: userPeerId };
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
for (const id of Object.keys(data.peers ?? {})) {
|
|
74
|
-
const shouldIncludeAllPeers = opts?.peers === undefined;
|
|
75
|
-
const isPeerIncluded =
|
|
76
|
-
Array.isArray(opts?.peers) && opts?.peers.includes(id);
|
|
77
|
-
|
|
78
|
-
if (shouldIncludeAllPeers || isPeerIncluded) {
|
|
79
|
-
const peer = pick(data.peers[id], opts?.keys);
|
|
80
|
-
slice.peers[id] = { ...peer, peerId: id };
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return slice;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Compare two presence slices
|
|
89
|
-
* 0. compare isLoading and error
|
|
90
|
-
* 1. shallow compare user
|
|
91
|
-
* 2. compare peers keys
|
|
92
|
-
* 3. shallow compare each peer
|
|
93
|
-
*/
|
|
94
|
-
export function hasPresenceResponseChanged<
|
|
95
|
-
PresenceShape,
|
|
96
|
-
Keys extends keyof PresenceShape,
|
|
97
|
-
>(
|
|
98
|
-
a: PresenceResponse<PresenceShape, Keys>,
|
|
99
|
-
b: PresenceResponse<PresenceShape, Keys>,
|
|
100
|
-
) {
|
|
101
|
-
if (a.isLoading !== b.isLoading) return true;
|
|
102
|
-
if (a.error !== b.error) return true;
|
|
103
|
-
|
|
104
|
-
if (a.user || b.user) {
|
|
105
|
-
if (!a.user || !b.user) return true;
|
|
106
|
-
|
|
107
|
-
const same = areObjectsShallowEqual(a.user, b.user);
|
|
108
|
-
|
|
109
|
-
if (!same) return true;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const sameKeys = areObjectKeysEqual(a.peers, b.peers);
|
|
113
|
-
|
|
114
|
-
if (!sameKeys) return true;
|
|
115
|
-
|
|
116
|
-
for (const id of Object.keys(a.peers)) {
|
|
117
|
-
const same = areObjectsShallowEqual(a.peers[id], b.peers[id]);
|
|
118
|
-
|
|
119
|
-
if (!same) return true;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return false;
|
|
123
|
-
}
|
package/src/presenceTypes.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Presence Utility Types
|
|
2
|
-
// ---------------------
|
|
3
|
-
|
|
4
|
-
import type { Expand } from './queryTypes.ts';
|
|
5
|
-
import type { EntityDef, ResolveEntityAttrs, RoomsDef } from './schemaTypes.ts';
|
|
6
|
-
|
|
7
|
-
type ExtractPresenceAttrs<PresenceEntity> =
|
|
8
|
-
PresenceEntity extends EntityDef<any, any, any>
|
|
9
|
-
? ResolveEntityAttrs<PresenceEntity>
|
|
10
|
-
: never;
|
|
11
|
-
|
|
12
|
-
export type PresencePeer<
|
|
13
|
-
Schema extends { rooms: RoomsDef },
|
|
14
|
-
RoomType extends Extract<keyof Schema['rooms'], string>,
|
|
15
|
-
> = Expand<
|
|
16
|
-
ExtractPresenceAttrs<Schema['rooms'][RoomType]['presence']> & {
|
|
17
|
-
peerId: string;
|
|
18
|
-
}
|
|
19
|
-
>;
|