@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/infiniteQuery.ts
DELETED
|
@@ -1,599 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
coerceQuery,
|
|
3
|
-
QueryValidationError,
|
|
4
|
-
type BackendRelayCoreDatabase,
|
|
5
|
-
type ValidQuery,
|
|
6
|
-
} from './index.ts';
|
|
7
|
-
import {
|
|
8
|
-
InstaQLResponse,
|
|
9
|
-
InstaQLOptions,
|
|
10
|
-
Cursor,
|
|
11
|
-
Order,
|
|
12
|
-
} from './queryTypes.ts';
|
|
13
|
-
import { BackendRelaySchemaDef } from './schemaTypes.ts';
|
|
14
|
-
import { assert } from './utils/error.ts';
|
|
15
|
-
|
|
16
|
-
// Example for {order: {value: "asc"}}
|
|
17
|
-
//
|
|
18
|
-
// 0
|
|
19
|
-
// <------------------|------------------------------------------------------>
|
|
20
|
-
// <- starter sub ->
|
|
21
|
-
//
|
|
22
|
-
// Bootstrap phase: until the limit (4 in this example) items are reached, the
|
|
23
|
-
// starter subscription is the only subscription and it writes to the forwardChunks map with the key PRE_BOOTSTRAP_CURSOR.
|
|
24
|
-
//
|
|
25
|
-
// When the limit is reached it automatically becomes a real forward chunk and has a definite start and end.
|
|
26
|
-
// A new reverse chunk gets added to watch for any new items at the start of the list.
|
|
27
|
-
//
|
|
28
|
-
// 0 1 2 3
|
|
29
|
-
// <------------------|------------------------------------------------------>
|
|
30
|
-
// <- starter sub ->
|
|
31
|
-
//
|
|
32
|
-
// ↓ BECOMES ↓
|
|
33
|
-
//
|
|
34
|
-
// 0 1 2 3
|
|
35
|
-
// <------------------|------------------------------------------------------>
|
|
36
|
-
// <-reverse chunk][forward chunk ]
|
|
37
|
-
//
|
|
38
|
-
// 0 1 2 3 4
|
|
39
|
-
// <------------------|------------------------------------------------------>
|
|
40
|
-
// <-reverse chunk][forward chunk ]
|
|
41
|
-
// When item 4 is added, the forward chunk subscription gets updated so that
|
|
42
|
-
// hasNextPage is `true`. This tells the user that a new page can be loaded.
|
|
43
|
-
//
|
|
44
|
-
// User clicks: loadNextPage
|
|
45
|
-
// 0 1 2 3 4
|
|
46
|
-
// <------------------|------------------------------------------------------>
|
|
47
|
-
// <-reverse chunk][ frozen forward chunk ][ new forward chunk ]
|
|
48
|
-
//
|
|
49
|
-
// More numbers get added
|
|
50
|
-
// 0 1 2 3 4 5 6 7 8
|
|
51
|
-
// <------------------|------------------------------------------------------>
|
|
52
|
-
// <-reverse chunk][ frozen forward chunk ][ forward chunk ] ^
|
|
53
|
-
// hasNextPage=true^
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
// User clicks: loadNextPage
|
|
57
|
-
//
|
|
58
|
-
// 0 1 2 3 4 5 6 7 8
|
|
59
|
-
// <------------------|------------------------------------------------------>
|
|
60
|
-
// <-reverse chunk][ frozen forward chunk ][ frozen forward chunk ][ new chunk
|
|
61
|
-
//
|
|
62
|
-
// The reverse chunks work in the same way as the forward chunks but the order in the query is reversed.
|
|
63
|
-
// When a reverse chunks recieves an update it will check to see if more can be loaded and it will
|
|
64
|
-
// automatically freeze the chunk and add a new one. i.e. : works the same as if
|
|
65
|
-
// loadNextPage was automatically clicked when hasNextPage became true.
|
|
66
|
-
//
|
|
67
|
-
// Chunks are indexed by their starting point cursor, for forward chunks this is the "[" point.
|
|
68
|
-
// Their starting point cursor is inclusive in the query and exclusive from the following query
|
|
69
|
-
|
|
70
|
-
const makeCursorKey = (cursor: Cursor) => JSON.stringify(cursor);
|
|
71
|
-
const makeChunkKey = (cursor: Cursor, afterInclusive = false) =>
|
|
72
|
-
JSON.stringify([cursor, afterInclusive]);
|
|
73
|
-
const parseChunkKey = (chunkKey: string) => {
|
|
74
|
-
const [cursor, afterInclusive] = JSON.parse(chunkKey) as [Cursor, boolean];
|
|
75
|
-
return { cursor, afterInclusive };
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// Chunk sub key is used to create keys to keep track of the subscriptions
|
|
79
|
-
// while chunk maps are keyed by [cursor, afterInclusive], we still distinguish
|
|
80
|
-
// between forward and reverse to avoid clashes that can share the same key.
|
|
81
|
-
const chunkSubKey = (
|
|
82
|
-
direction: 'forward' | 'reverse',
|
|
83
|
-
cursor: Cursor,
|
|
84
|
-
afterInclusive = false,
|
|
85
|
-
) => `${direction}:${makeChunkKey(cursor, afterInclusive)}`;
|
|
86
|
-
|
|
87
|
-
export type ChunkStatus = 'pre-bootstrap' | 'bootstrapping' | 'frozen';
|
|
88
|
-
type Chunk = {
|
|
89
|
-
status: ChunkStatus;
|
|
90
|
-
data: any[];
|
|
91
|
-
hasMore?: boolean;
|
|
92
|
-
endCursor?: Cursor;
|
|
93
|
-
afterInclusive?: boolean;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
type ChunkWithEndCursor = Chunk & { endCursor: Cursor };
|
|
97
|
-
|
|
98
|
-
const chunkHasEndCursor = (chunk: Chunk): chunk is ChunkWithEndCursor => {
|
|
99
|
-
return !!chunk.endCursor;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export interface InfiniteQuerySubscription {
|
|
103
|
-
unsubscribe: () => void;
|
|
104
|
-
loadNextPage: () => void;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const readCanLoadNextPage = (forwardChunks: Map<string, Chunk>) => {
|
|
108
|
-
const chunksInOrder = Array.from(forwardChunks.values());
|
|
109
|
-
if (chunksInOrder.length === 0) return false;
|
|
110
|
-
return chunksInOrder[chunksInOrder.length - 1]?.hasMore || false;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const reverseOrder = <
|
|
114
|
-
Schema extends BackendRelaySchemaDef<any, any, any>,
|
|
115
|
-
Entity extends keyof Schema['entities'],
|
|
116
|
-
>(
|
|
117
|
-
order?: Order<Schema, Entity>,
|
|
118
|
-
): Order<Schema, Entity> => {
|
|
119
|
-
if (!order) {
|
|
120
|
-
return {
|
|
121
|
-
serverCreatedAt: 'asc',
|
|
122
|
-
} satisfies Order<Schema, Entity>;
|
|
123
|
-
}
|
|
124
|
-
const key = Object.keys(order).at(0);
|
|
125
|
-
if (!key) {
|
|
126
|
-
return {
|
|
127
|
-
serverCreatedAt: 'asc',
|
|
128
|
-
} satisfies Order<Schema, Entity>;
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
[key]: order[key as keyof typeof order] === 'asc' ? 'desc' : 'asc',
|
|
132
|
-
} as Order<Schema, Entity>;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const resolveOrder = <
|
|
136
|
-
Schema extends BackendRelaySchemaDef<any, any, any>,
|
|
137
|
-
Entity extends keyof Schema['entities'],
|
|
138
|
-
>(
|
|
139
|
-
order?: Order<Schema, Entity>,
|
|
140
|
-
): Order<Schema, Entity> => {
|
|
141
|
-
if (order && Object.keys(order).length > 0) return order;
|
|
142
|
-
// serverCreatedAt: 'asc' is the implicit order in queries without an `order`
|
|
143
|
-
// field. We need this to be explicit, because when doing `reverse` queries, we rely
|
|
144
|
-
// on inverting this order.
|
|
145
|
-
return {
|
|
146
|
-
serverCreatedAt: 'asc',
|
|
147
|
-
} satisfies Order<Schema, Entity>;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const normalizeChunks = (
|
|
151
|
-
forwardChunks: Map<string, Chunk>,
|
|
152
|
-
reverseChunks: Map<string, Chunk>,
|
|
153
|
-
): { chunks: Chunk[]; data: any[] } => {
|
|
154
|
-
const chunks = [
|
|
155
|
-
...Array.from(reverseChunks.values()).slice().reverse(),
|
|
156
|
-
...Array.from(forwardChunks.values()),
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
const data = [
|
|
160
|
-
...Array.from(reverseChunks.values())
|
|
161
|
-
.slice()
|
|
162
|
-
.reverse()
|
|
163
|
-
.flatMap((chunk) => chunk.data.slice().reverse()),
|
|
164
|
-
...Array.from(forwardChunks.values()).flatMap((chunk) => chunk.data),
|
|
165
|
-
];
|
|
166
|
-
return { chunks, data };
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const PRE_BOOTSTRAP_CURSOR: Cursor = ['bootstrap', 'bootstrap', 'bootstrap', 1];
|
|
170
|
-
|
|
171
|
-
export type InfiniteQueryCallbackResponse<
|
|
172
|
-
Schema extends BackendRelaySchemaDef<any, any, any>,
|
|
173
|
-
Query extends Record<string, any>,
|
|
174
|
-
UseDatesLocal extends boolean,
|
|
175
|
-
> =
|
|
176
|
-
| {
|
|
177
|
-
error: { message: string };
|
|
178
|
-
data: undefined;
|
|
179
|
-
canLoadNextPage: boolean;
|
|
180
|
-
}
|
|
181
|
-
| {
|
|
182
|
-
error: undefined;
|
|
183
|
-
data: InstaQLResponse<Schema, Query, UseDatesLocal>;
|
|
184
|
-
canLoadNextPage: boolean;
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export const subscribeInfiniteQuery = <
|
|
188
|
-
Schema extends BackendRelaySchemaDef<any, any, any>,
|
|
189
|
-
Q extends ValidQuery<Q, Schema>,
|
|
190
|
-
UseDates extends boolean,
|
|
191
|
-
>(
|
|
192
|
-
db: BackendRelayCoreDatabase<Schema, UseDates>,
|
|
193
|
-
fullQuery: Q,
|
|
194
|
-
cb: (resp: InfiniteQueryCallbackResponse<Schema, Q, UseDates>) => void,
|
|
195
|
-
opts?: InstaQLOptions,
|
|
196
|
-
): InfiniteQuerySubscription => {
|
|
197
|
-
const { entityName, entityQuery: query } = splitAndValidateQuery(fullQuery);
|
|
198
|
-
|
|
199
|
-
const pageSize = query.$?.limit || 10;
|
|
200
|
-
const entity = entityName;
|
|
201
|
-
const order = resolveOrder(query.$?.order);
|
|
202
|
-
|
|
203
|
-
const forwardChunks = new Map<string, Chunk>();
|
|
204
|
-
const reverseChunks = new Map<string, Chunk>();
|
|
205
|
-
// Keeps track of all subscriptions (besides starter sub)
|
|
206
|
-
const allUnsubs = new Map<string, () => void>();
|
|
207
|
-
|
|
208
|
-
let hasKickstarted = false;
|
|
209
|
-
let isActive = true;
|
|
210
|
-
let lastReverseAdvancedChunkKey: string | null = null;
|
|
211
|
-
let starterUnsub: (() => void) | null = null;
|
|
212
|
-
|
|
213
|
-
const sendError = (err: { message: string }) => {
|
|
214
|
-
cb({ error: err, data: undefined, canLoadNextPage: false });
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const pushUpdate = () => {
|
|
218
|
-
if (!isActive) return;
|
|
219
|
-
|
|
220
|
-
const { chunks, data } = normalizeChunks(forwardChunks, reverseChunks);
|
|
221
|
-
cb({
|
|
222
|
-
data: { [entity]: data } as InstaQLResponse<
|
|
223
|
-
Schema,
|
|
224
|
-
typeof query,
|
|
225
|
-
UseDates
|
|
226
|
-
>,
|
|
227
|
-
// @ts-expect-error hidden debug variable
|
|
228
|
-
chunks,
|
|
229
|
-
canLoadNextPage: readCanLoadNextPage(forwardChunks),
|
|
230
|
-
});
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
const setForwardChunk = (startCursor: Cursor, chunk: Chunk) => {
|
|
234
|
-
forwardChunks.set(makeChunkKey(startCursor, chunk.afterInclusive), chunk);
|
|
235
|
-
pushUpdate();
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
const setReverseChunk = (startCursor: Cursor, chunk: Chunk) => {
|
|
239
|
-
reverseChunks.set(makeChunkKey(startCursor), chunk);
|
|
240
|
-
maybeAdvanceReverse();
|
|
241
|
-
pushUpdate();
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
const freezeReverse = (chunkKey: string, chunk: ChunkWithEndCursor) => {
|
|
245
|
-
const { cursor: startCursor } = parseChunkKey(chunkKey);
|
|
246
|
-
const currentSub = allUnsubs.get(chunkSubKey('reverse', startCursor));
|
|
247
|
-
currentSub?.();
|
|
248
|
-
|
|
249
|
-
const nextSub = db.subscribeQuery(
|
|
250
|
-
{
|
|
251
|
-
[entity]: {
|
|
252
|
-
...query,
|
|
253
|
-
$: {
|
|
254
|
-
after: startCursor,
|
|
255
|
-
before: chunk.endCursor,
|
|
256
|
-
beforeInclusive: true,
|
|
257
|
-
where: query.$?.where,
|
|
258
|
-
fields: query.$?.fields,
|
|
259
|
-
order: reverseOrder(order),
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
} as unknown as Q,
|
|
263
|
-
(frozenData) => {
|
|
264
|
-
if (frozenData.error) {
|
|
265
|
-
return sendError(frozenData.error);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
const rows = frozenData.data?.[entity];
|
|
269
|
-
const pageInfo = frozenData.pageInfo?.[entity];
|
|
270
|
-
if (!rows || !pageInfo) return;
|
|
271
|
-
|
|
272
|
-
setReverseChunk(startCursor, {
|
|
273
|
-
data: rows,
|
|
274
|
-
status: 'frozen',
|
|
275
|
-
hasMore: pageInfo.hasNextPage,
|
|
276
|
-
endCursor: pageInfo.endCursor,
|
|
277
|
-
});
|
|
278
|
-
},
|
|
279
|
-
opts,
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
allUnsubs.set(chunkSubKey('reverse', startCursor), nextSub);
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
const pushNewReverse = (startCursor: Cursor) => {
|
|
286
|
-
const querySub = db.subscribeQuery(
|
|
287
|
-
{
|
|
288
|
-
[entity]: {
|
|
289
|
-
...query,
|
|
290
|
-
$: {
|
|
291
|
-
limit: pageSize,
|
|
292
|
-
after: startCursor,
|
|
293
|
-
where: query.$?.where,
|
|
294
|
-
fields: query.$?.fields,
|
|
295
|
-
order: reverseOrder(order),
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
} as unknown as Q,
|
|
299
|
-
(windowData) => {
|
|
300
|
-
if (windowData.error) {
|
|
301
|
-
return sendError(windowData.error);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const rows = windowData.data?.[entity];
|
|
305
|
-
const pageInfo = windowData.pageInfo?.[entity];
|
|
306
|
-
// Optimistic notifications can arrive before the first server-backed
|
|
307
|
-
// page metadata. Wait for the complete page instead of rejecting the
|
|
308
|
-
// subscription callback during that startup race.
|
|
309
|
-
if (!rows || !pageInfo) return;
|
|
310
|
-
|
|
311
|
-
setReverseChunk(startCursor, {
|
|
312
|
-
data: rows,
|
|
313
|
-
status: 'bootstrapping',
|
|
314
|
-
hasMore: pageInfo.hasNextPage,
|
|
315
|
-
endCursor: pageInfo.endCursor,
|
|
316
|
-
});
|
|
317
|
-
},
|
|
318
|
-
opts,
|
|
319
|
-
);
|
|
320
|
-
|
|
321
|
-
allUnsubs.set(chunkSubKey('reverse', startCursor), querySub);
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
const pushNewForward = (startCursor: Cursor, afterInclusive = false) => {
|
|
325
|
-
const querySub = db.subscribeQuery(
|
|
326
|
-
{
|
|
327
|
-
[entity]: {
|
|
328
|
-
...query,
|
|
329
|
-
$: {
|
|
330
|
-
limit: pageSize,
|
|
331
|
-
after: startCursor,
|
|
332
|
-
afterInclusive,
|
|
333
|
-
where: query.$?.where,
|
|
334
|
-
fields: query.$?.fields,
|
|
335
|
-
order,
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
} as unknown as Q,
|
|
339
|
-
(windowData) => {
|
|
340
|
-
if (windowData.error) {
|
|
341
|
-
return sendError(windowData.error);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
const rows = windowData.data?.[entity];
|
|
345
|
-
const pageInfo = windowData.pageInfo?.[entity];
|
|
346
|
-
if (!rows || !pageInfo) return;
|
|
347
|
-
|
|
348
|
-
setForwardChunk(startCursor, {
|
|
349
|
-
data: rows,
|
|
350
|
-
status: 'bootstrapping',
|
|
351
|
-
hasMore: pageInfo.hasNextPage,
|
|
352
|
-
endCursor: pageInfo.endCursor,
|
|
353
|
-
afterInclusive,
|
|
354
|
-
});
|
|
355
|
-
},
|
|
356
|
-
opts,
|
|
357
|
-
);
|
|
358
|
-
|
|
359
|
-
allUnsubs.set(
|
|
360
|
-
chunkSubKey('forward', startCursor, afterInclusive),
|
|
361
|
-
querySub,
|
|
362
|
-
);
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
const freezeForward = (startCursor: Cursor, afterInclusive = false) => {
|
|
366
|
-
const key = makeChunkKey(startCursor, afterInclusive);
|
|
367
|
-
const currentSub = allUnsubs.get(
|
|
368
|
-
chunkSubKey('forward', startCursor, afterInclusive),
|
|
369
|
-
);
|
|
370
|
-
currentSub?.();
|
|
371
|
-
|
|
372
|
-
const chunk = forwardChunks.get(key);
|
|
373
|
-
if (!chunk?.endCursor) return;
|
|
374
|
-
|
|
375
|
-
const nextSub = db.subscribeQuery(
|
|
376
|
-
{
|
|
377
|
-
[entity]: {
|
|
378
|
-
...query,
|
|
379
|
-
$: {
|
|
380
|
-
after: startCursor,
|
|
381
|
-
afterInclusive: chunk.afterInclusive,
|
|
382
|
-
before: chunk.endCursor,
|
|
383
|
-
beforeInclusive: true,
|
|
384
|
-
where: query.$?.where,
|
|
385
|
-
fields: query.$?.fields,
|
|
386
|
-
order,
|
|
387
|
-
},
|
|
388
|
-
},
|
|
389
|
-
} as unknown as Q,
|
|
390
|
-
(frozenData) => {
|
|
391
|
-
if (frozenData.error) {
|
|
392
|
-
return sendError(frozenData.error);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
const rows = frozenData.data?.[entity];
|
|
396
|
-
const pageInfo = frozenData.pageInfo?.[entity];
|
|
397
|
-
if (!rows || !pageInfo) return;
|
|
398
|
-
|
|
399
|
-
setForwardChunk(startCursor, {
|
|
400
|
-
data: rows,
|
|
401
|
-
status: 'frozen',
|
|
402
|
-
hasMore: pageInfo.hasNextPage,
|
|
403
|
-
endCursor: pageInfo.endCursor,
|
|
404
|
-
afterInclusive: chunk.afterInclusive,
|
|
405
|
-
});
|
|
406
|
-
},
|
|
407
|
-
opts,
|
|
408
|
-
);
|
|
409
|
-
|
|
410
|
-
allUnsubs.set(chunkSubKey('forward', startCursor, afterInclusive), nextSub);
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
// Consider order: {val: "asc"} with pageItems = 4
|
|
414
|
-
// A reverse chunk captures all the new items coming in before us.
|
|
415
|
-
// If we hit 4 then we freeze the current chunk and create a new reverse chunk
|
|
416
|
-
const maybeAdvanceReverse = () => {
|
|
417
|
-
const tailEntry = Array.from(reverseChunks.entries()).at(-1);
|
|
418
|
-
if (!tailEntry) return;
|
|
419
|
-
|
|
420
|
-
const [chunkKey, chunk] = tailEntry;
|
|
421
|
-
|
|
422
|
-
// If a chunk has more, then it must have an endCursor
|
|
423
|
-
if (!chunk?.hasMore) return;
|
|
424
|
-
if (!chunkHasEndCursor(chunk)) return;
|
|
425
|
-
|
|
426
|
-
// maybeAdvanceReverse can run multiple times if multiple changes are made
|
|
427
|
-
// to the reverse chunk
|
|
428
|
-
// This prevents adding the same new reverse frame twice
|
|
429
|
-
const advanceKey = `${chunkKey}:${makeCursorKey(chunk.endCursor)}`;
|
|
430
|
-
if (advanceKey == lastReverseAdvancedChunkKey) return;
|
|
431
|
-
lastReverseAdvancedChunkKey = advanceKey;
|
|
432
|
-
|
|
433
|
-
freezeReverse(chunkKey, chunk);
|
|
434
|
-
pushNewReverse(chunk.endCursor);
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
const loadNextPage = () => {
|
|
438
|
-
const tailEntry = Array.from(forwardChunks.entries()).at(-1);
|
|
439
|
-
if (!tailEntry) return;
|
|
440
|
-
|
|
441
|
-
const [chunkKey, chunk] = tailEntry;
|
|
442
|
-
|
|
443
|
-
// If the chunk has more items after it, it must have an end cursor, and we can
|
|
444
|
-
// load more items
|
|
445
|
-
// if (!chunk?.hasMore) return;
|
|
446
|
-
if (!chunk.endCursor) return;
|
|
447
|
-
|
|
448
|
-
const { cursor: startCursor, afterInclusive } = parseChunkKey(chunkKey);
|
|
449
|
-
freezeForward(startCursor, afterInclusive);
|
|
450
|
-
pushNewForward(chunk.endCursor);
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
starterUnsub = db.subscribeQuery(
|
|
454
|
-
{
|
|
455
|
-
[entity]: {
|
|
456
|
-
...query,
|
|
457
|
-
$: {
|
|
458
|
-
limit: pageSize,
|
|
459
|
-
where: query.$?.where,
|
|
460
|
-
fields: query.$?.fields,
|
|
461
|
-
order,
|
|
462
|
-
},
|
|
463
|
-
},
|
|
464
|
-
} as unknown as Q,
|
|
465
|
-
async (starterData) => {
|
|
466
|
-
if (hasKickstarted) return;
|
|
467
|
-
if (starterData.error) {
|
|
468
|
-
return sendError(starterData.error);
|
|
469
|
-
}
|
|
470
|
-
const pageInfo = starterData.pageInfo?.[entity];
|
|
471
|
-
const rows = starterData?.data?.[entity];
|
|
472
|
-
if (!rows || !pageInfo) return;
|
|
473
|
-
|
|
474
|
-
if (rows.length < pageSize) {
|
|
475
|
-
// If the rows are less than the page size, then we don't need to
|
|
476
|
-
// create forward and reverse chunks.
|
|
477
|
-
// We just treat the starter query as a forward chunk
|
|
478
|
-
setForwardChunk(PRE_BOOTSTRAP_CURSOR, {
|
|
479
|
-
data: rows,
|
|
480
|
-
status: 'pre-bootstrap',
|
|
481
|
-
});
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
// Consider a query with no items; the server will return a result with
|
|
486
|
-
// no start cursor. If we add {pageSize} optimistic updates we can
|
|
487
|
-
// get here and still have no startCursor.
|
|
488
|
-
// For now we treat the data we currently have like a pre boostrap
|
|
489
|
-
// state.
|
|
490
|
-
const initialForwardCursor = pageInfo.startCursor;
|
|
491
|
-
if (!initialForwardCursor) {
|
|
492
|
-
setForwardChunk(PRE_BOOTSTRAP_CURSOR, {
|
|
493
|
-
data: rows,
|
|
494
|
-
status: 'pre-bootstrap',
|
|
495
|
-
});
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
forwardChunks.delete(makeChunkKey(PRE_BOOTSTRAP_CURSOR));
|
|
500
|
-
|
|
501
|
-
pushNewForward(initialForwardCursor, true);
|
|
502
|
-
pushNewReverse(pageInfo.startCursor);
|
|
503
|
-
hasKickstarted = true;
|
|
504
|
-
},
|
|
505
|
-
opts,
|
|
506
|
-
);
|
|
507
|
-
|
|
508
|
-
const unsubscribe = () => {
|
|
509
|
-
if (!isActive) return;
|
|
510
|
-
isActive = false;
|
|
511
|
-
starterUnsub?.();
|
|
512
|
-
starterUnsub = null;
|
|
513
|
-
for (const unsub of allUnsubs.values()) {
|
|
514
|
-
unsub?.();
|
|
515
|
-
}
|
|
516
|
-
allUnsubs.clear();
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
return {
|
|
520
|
-
unsubscribe,
|
|
521
|
-
loadNextPage,
|
|
522
|
-
};
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
export const getInfiniteQueryInitialSnapshot = <
|
|
526
|
-
Schema extends BackendRelaySchemaDef<any, any, any>,
|
|
527
|
-
Q extends ValidQuery<Q, Schema>,
|
|
528
|
-
UseDates extends boolean,
|
|
529
|
-
>(
|
|
530
|
-
db: BackendRelayCoreDatabase<Schema, UseDates>,
|
|
531
|
-
fullQuery: Q | null,
|
|
532
|
-
opts?: InstaQLOptions,
|
|
533
|
-
):
|
|
534
|
-
| InfiniteQueryCallbackResponse<Schema, Q, UseDates>
|
|
535
|
-
| {
|
|
536
|
-
canLoadNextPage: false;
|
|
537
|
-
data: undefined;
|
|
538
|
-
error: undefined;
|
|
539
|
-
} => {
|
|
540
|
-
if (!fullQuery) {
|
|
541
|
-
return {
|
|
542
|
-
canLoadNextPage: false,
|
|
543
|
-
data: undefined,
|
|
544
|
-
error: undefined,
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
const { entityName, entityQuery } = splitAndValidateQuery(fullQuery);
|
|
548
|
-
|
|
549
|
-
const pageSize = entityQuery.$?.limit || 10;
|
|
550
|
-
const order = resolveOrder(entityQuery.$?.order);
|
|
551
|
-
|
|
552
|
-
let coercedQuery = fullQuery
|
|
553
|
-
? coerceQuery({
|
|
554
|
-
[entityName]: {
|
|
555
|
-
...entityQuery,
|
|
556
|
-
$: {
|
|
557
|
-
limit: pageSize,
|
|
558
|
-
where: entityQuery.$?.where,
|
|
559
|
-
fields: entityQuery.$?.fields,
|
|
560
|
-
order,
|
|
561
|
-
},
|
|
562
|
-
},
|
|
563
|
-
})
|
|
564
|
-
: null;
|
|
565
|
-
|
|
566
|
-
if (opts && 'ruleParams' in opts) {
|
|
567
|
-
coercedQuery = {
|
|
568
|
-
$$ruleParams: opts.ruleParams,
|
|
569
|
-
...coercedQuery,
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
const queryResult = db._reactor.getPreviousResult(coercedQuery);
|
|
573
|
-
|
|
574
|
-
return {
|
|
575
|
-
canLoadNextPage: false,
|
|
576
|
-
data: queryResult?.data || undefined,
|
|
577
|
-
error: undefined,
|
|
578
|
-
};
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* @throws QueryValidationError
|
|
583
|
-
* @param fullQuery a ValidQuery with one key (entity)
|
|
584
|
-
*/
|
|
585
|
-
const splitAndValidateQuery = (fullQuery: Record<string, any>) => {
|
|
586
|
-
const entityNames = Object.keys(fullQuery);
|
|
587
|
-
if (entityNames.length !== 1) {
|
|
588
|
-
throw new QueryValidationError(
|
|
589
|
-
'subscribeInfiniteQuery expects exactly one entity',
|
|
590
|
-
);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
const [entityName, entityQuery] = Object.entries(fullQuery)[0];
|
|
594
|
-
|
|
595
|
-
if (!entityName || !entityQuery) {
|
|
596
|
-
throw new QueryValidationError('No query provided for infinite query');
|
|
597
|
-
}
|
|
598
|
-
return { entityName, entityQuery };
|
|
599
|
-
};
|