@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/reactorTransport.js
DELETED
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import uuid from './utils/id.ts';
|
|
3
|
-
import { STATUS } from './reactorTypes.ts';
|
|
4
|
-
import { BackendRelayError } from './BackendRelayError.ts';
|
|
5
|
-
import { sortedMutationEntries } from './reactorMutations.js';
|
|
6
|
-
import { WSConnection, SSEConnection } from './Connection.ts';
|
|
7
|
-
|
|
8
|
-
/** @typedef {import('./utils/log.ts').Logger} Logger */
|
|
9
|
-
/** @typedef {import('./Connection.ts').Connection} Connection */
|
|
10
|
-
/** @typedef {import('./Connection.ts').TransportType} TransportType */
|
|
11
|
-
/** @typedef {import('./Connection.ts').EventSourceConstructor} EventSourceConstructor */
|
|
12
|
-
|
|
13
|
-
// Reconnect delay uses full-jitter exponential backoff: a uniform random delay
|
|
14
|
-
// in [0, min(cap, base * 2^attempt)). Jitter spreads a fleet of clients that
|
|
15
|
-
// were disconnected by one restart instead of synchronising their retries.
|
|
16
|
-
const RECONNECT_BASE_DELAY_MS = 250;
|
|
17
|
-
const RECONNECT_MAX_DELAY_MS = 10_000;
|
|
18
|
-
const RECONNECT_MAX_EXPONENT = 32;
|
|
19
|
-
// WebSocket close code 1012 (IANA: "service restart"). Treat it as an expected
|
|
20
|
-
// restart so the first retry is immediate instead of backing off as if the
|
|
21
|
-
// network had failed.
|
|
22
|
-
const SERVICE_RESTART_CLOSE_CODE = 1012;
|
|
23
|
-
// `add-query` errors the server emits while shedding load. They are retryable
|
|
24
|
-
// because the same query succeeds once capacity returns.
|
|
25
|
-
const TRANSIENT_ADD_QUERY_STATUSES = new Set([429, 503]);
|
|
26
|
-
const TRANSIENT_ADD_QUERY_TYPES = new Set([
|
|
27
|
-
'rate-limited',
|
|
28
|
-
'timeout',
|
|
29
|
-
'unavailable',
|
|
30
|
-
]);
|
|
31
|
-
const MAX_ADD_QUERY_RETRIES = 5;
|
|
32
|
-
|
|
33
|
-
export const ignoreLogging = {
|
|
34
|
-
'set-presence': true,
|
|
35
|
-
'set-presence-ok': true,
|
|
36
|
-
'refresh-presence': true,
|
|
37
|
-
'patch-presence': true,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export function reconnectDelayMs(attempt) {
|
|
41
|
-
const ceiling = Math.min(
|
|
42
|
-
RECONNECT_MAX_DELAY_MS,
|
|
43
|
-
RECONNECT_BASE_DELAY_MS * 2 ** Math.min(attempt, RECONNECT_MAX_EXPONENT),
|
|
44
|
-
);
|
|
45
|
-
return Math.random() * ceiling;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function isTransientAddQueryError(msg) {
|
|
49
|
-
return (
|
|
50
|
-
TRANSIENT_ADD_QUERY_STATUSES.has(msg.status) ||
|
|
51
|
-
TRANSIENT_ADD_QUERY_TYPES.has(msg.type)
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @param {Object} config
|
|
57
|
-
* @param {TransportType} config.transportType
|
|
58
|
-
* @param {string} config.appId
|
|
59
|
-
* @param {string} config.apiURI
|
|
60
|
-
* @param {string} config.wsURI
|
|
61
|
-
* @param {EventSourceConstructor} config.EventSourceImpl
|
|
62
|
-
* @returns {WSConnection | SSEConnection}
|
|
63
|
-
*/
|
|
64
|
-
export function createTransport({
|
|
65
|
-
transportType,
|
|
66
|
-
appId,
|
|
67
|
-
apiURI,
|
|
68
|
-
wsURI,
|
|
69
|
-
EventSourceImpl,
|
|
70
|
-
}) {
|
|
71
|
-
if (!EventSourceImpl) {
|
|
72
|
-
return new WSConnection(`${wsURI}?app_id=${appId}`);
|
|
73
|
-
}
|
|
74
|
-
switch (transportType) {
|
|
75
|
-
case 'ws':
|
|
76
|
-
return new WSConnection(`${wsURI}?app_id=${appId}`);
|
|
77
|
-
case 'sse':
|
|
78
|
-
return new SSEConnection(
|
|
79
|
-
EventSourceImpl,
|
|
80
|
-
`${apiURI}/runtime/sse?app_id=${appId}`,
|
|
81
|
-
);
|
|
82
|
-
default:
|
|
83
|
-
throw new Error('Unknown transport type ' + transportType);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Re-sends an `add-query` whose last error was transient. Returns true when
|
|
89
|
-
* the retry was scheduled, or false when the error should surface because the
|
|
90
|
-
* attempt budget is exhausted.
|
|
91
|
-
*/
|
|
92
|
-
export function retryAddQuery(reactor, q, hash) {
|
|
93
|
-
const attempts = reactor._addQueryRetryAttempts.get(hash) ?? 0;
|
|
94
|
-
if (attempts >= MAX_ADD_QUERY_RETRIES) {
|
|
95
|
-
reactor._addQueryRetryAttempts.delete(hash);
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
reactor._addQueryRetryAttempts.set(hash, attempts + 1);
|
|
99
|
-
const delay = reconnectDelayMs(attempts);
|
|
100
|
-
const transport = reactor._transport;
|
|
101
|
-
reactor._log.info(
|
|
102
|
-
'[socket][query]',
|
|
103
|
-
'transient add-query error, retry in ms =',
|
|
104
|
-
delay,
|
|
105
|
-
);
|
|
106
|
-
setTimeout(() => {
|
|
107
|
-
if (
|
|
108
|
-
reactor._isShutdown ||
|
|
109
|
-
reactor._transport !== transport ||
|
|
110
|
-
reactor.status !== STATUS.AUTHENTICATED
|
|
111
|
-
) {
|
|
112
|
-
// A reconnect resends every query from `_flushPendingMessages`.
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
reactor._trySendAuthed(uuid(), { op: 'add-query', q });
|
|
116
|
-
}, delay);
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function trySendAuthed(reactor, ...args) {
|
|
121
|
-
if (reactor.status !== STATUS.AUTHENTICATED) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
reactor._trySend(...args);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function trySend(reactor, eventId, msg, opts) {
|
|
128
|
-
if (!reactor._transport.isOpen()) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
if (!ignoreLogging[msg.op]) {
|
|
132
|
-
reactor._log.info('[send]', reactor._transport.id, msg.op, {
|
|
133
|
-
'client-event-id': eventId,
|
|
134
|
-
...msg,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
switch (msg.op) {
|
|
138
|
-
case 'transact': {
|
|
139
|
-
reactor._inFlightMutationEventIds.add(eventId);
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
case 'init': {
|
|
143
|
-
// New connection, so we can't have any mutations in flight
|
|
144
|
-
reactor._inFlightMutationEventIds.clear();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
reactor._transport.send({ 'client-event-id': eventId, ...msg });
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/** Send messages we accumulated while we were connecting */
|
|
151
|
-
export function flushPendingMessages(reactor) {
|
|
152
|
-
const subs = Object.keys(reactor.queryCbs).map((hash) => {
|
|
153
|
-
return reactor.querySubs.currentValue[hash];
|
|
154
|
-
});
|
|
155
|
-
// Note: we should not have any nulls in subs, but we're
|
|
156
|
-
// doing this defensively just in case.
|
|
157
|
-
const safeSubs = subs.filter((x) => x);
|
|
158
|
-
safeSubs.forEach(({ eventId, q }) => {
|
|
159
|
-
reactor._trySendAuthed(eventId, { op: 'add-query', q });
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
Object.values(reactor.queryOnceDfds)
|
|
163
|
-
.flat()
|
|
164
|
-
.forEach(({ eventId, q }) => {
|
|
165
|
-
reactor._trySendAuthed(eventId, { op: 'query-once', q });
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
const rewrittenMutations = reactor._rewriteMutations(
|
|
169
|
-
reactor.ensureAttrs(),
|
|
170
|
-
reactor._pendingMutations(),
|
|
171
|
-
);
|
|
172
|
-
if (rewrittenMutations !== reactor._pendingMutations()) {
|
|
173
|
-
// Persist rewritten mutations to avoid stale attr ids in future txs.
|
|
174
|
-
reactor._setPendingMutations(rewrittenMutations);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const muts = sortedMutationEntries(rewrittenMutations.entries());
|
|
178
|
-
muts.forEach(([eventId, mut]) => {
|
|
179
|
-
if (!mut['tx-id'] && !mut.optimistic) {
|
|
180
|
-
reactor._sendMutation(eventId, mut);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
reactor._syncTable.flushPending();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export function transportOnOpen(reactor, e) {
|
|
188
|
-
const targetTransport = e.target;
|
|
189
|
-
if (reactor._transport !== targetTransport) {
|
|
190
|
-
reactor._log.info(
|
|
191
|
-
'[socket][open]',
|
|
192
|
-
targetTransport.id,
|
|
193
|
-
'skip; this is no longer the current transport',
|
|
194
|
-
);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
reactor._log.info('[socket][open]', reactor._transport.id);
|
|
198
|
-
reactor._setStatus(STATUS.OPENED);
|
|
199
|
-
|
|
200
|
-
reactor
|
|
201
|
-
.getCurrentUser()
|
|
202
|
-
.then((resp) => {
|
|
203
|
-
reactor._trySend(uuid(), {
|
|
204
|
-
op: 'init',
|
|
205
|
-
'app-id': reactor.config.appId,
|
|
206
|
-
'refresh-token': resp.user?.['refresh_token'],
|
|
207
|
-
versions: reactor.versions,
|
|
208
|
-
// If an admin token is provided for an app, we will
|
|
209
|
-
// skip all permission checks. This is an advanced feature,
|
|
210
|
-
// to let users write internal tools
|
|
211
|
-
// This option is not exposed in `Config`, as it's
|
|
212
|
-
// not ready for prime time
|
|
213
|
-
'__admin-token': reactor.config.__adminToken,
|
|
214
|
-
});
|
|
215
|
-
})
|
|
216
|
-
.catch((e) => {
|
|
217
|
-
reactor._log.error('[socket][error]', targetTransport.id, e);
|
|
218
|
-
reactor._notifyError(
|
|
219
|
-
e instanceof Error
|
|
220
|
-
? e
|
|
221
|
-
: new BackendRelayError('Failed to initialize the realtime session.'),
|
|
222
|
-
);
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export function transportOnMessage(reactor, e) {
|
|
227
|
-
const targetTransport = e.target;
|
|
228
|
-
const m = e.message;
|
|
229
|
-
if (reactor._transport !== targetTransport) {
|
|
230
|
-
reactor._log.info(
|
|
231
|
-
'[socket][message]',
|
|
232
|
-
targetTransport.id,
|
|
233
|
-
m,
|
|
234
|
-
'skip; this is no longer the current transport',
|
|
235
|
-
);
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (!reactor._wsOk && targetTransport.type === 'ws') {
|
|
240
|
-
reactor._wsOk = true;
|
|
241
|
-
}
|
|
242
|
-
// Try to reconnect via websocket the next time we connect
|
|
243
|
-
reactor._transportType = 'ws';
|
|
244
|
-
if (Array.isArray(e.message)) {
|
|
245
|
-
for (const msg of e.message) {
|
|
246
|
-
// One handler throwing (e.g. a subscriber cb) must not drop the
|
|
247
|
-
// rest of the batch; keep going and log what failed.
|
|
248
|
-
try {
|
|
249
|
-
reactor._handleReceive(targetTransport.id, msg);
|
|
250
|
-
} catch (err) {
|
|
251
|
-
reactor._log.error('[socket][message]', targetTransport.id, err);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
} else {
|
|
255
|
-
reactor._handleReceive(targetTransport.id, e.message);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export function transportOnError(reactor, e) {
|
|
260
|
-
const targetTransport = e.target;
|
|
261
|
-
if (reactor._transport !== targetTransport) {
|
|
262
|
-
reactor._log.info(
|
|
263
|
-
'[socket][error]',
|
|
264
|
-
targetTransport.id,
|
|
265
|
-
'skip; this is no longer the current transport',
|
|
266
|
-
);
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
reactor._log.error('[socket][error]', targetTransport.id, e);
|
|
270
|
-
reactor._notifyError(
|
|
271
|
-
e?.error instanceof Error
|
|
272
|
-
? e.error
|
|
273
|
-
: new BackendRelayError('Realtime connection error.'),
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export function scheduleReconnect(reactor, { immediate = false } = {}) {
|
|
278
|
-
// If we couldn't connect with a websocket last time, try sse
|
|
279
|
-
if (!reactor._wsOk && reactor._transportType !== 'sse') {
|
|
280
|
-
reactor._transportType = 'sse';
|
|
281
|
-
reactor._reconnectAttempt = 0;
|
|
282
|
-
}
|
|
283
|
-
const attempt = immediate ? 0 : reactor._reconnectAttempt;
|
|
284
|
-
reactor._reconnectTimeoutMs = reconnectDelayMs(attempt);
|
|
285
|
-
// A service restart starts the sequence over, so a later real failure is
|
|
286
|
-
// not penalised for restarts the operator caused.
|
|
287
|
-
reactor._reconnectAttempt = immediate ? 1 : attempt + 1;
|
|
288
|
-
setTimeout(() => {
|
|
289
|
-
if (!reactor._isOnline) {
|
|
290
|
-
reactor._log.info(
|
|
291
|
-
'[socket][close]',
|
|
292
|
-
reactor._transport.id,
|
|
293
|
-
'we are offline, no need to start socket',
|
|
294
|
-
);
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
reactor._startSocket();
|
|
299
|
-
}, reactor._reconnectTimeoutMs);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export function transportOnClose(reactor, e) {
|
|
303
|
-
const targetTransport = e.target;
|
|
304
|
-
if (reactor._transport !== targetTransport) {
|
|
305
|
-
reactor._log.info(
|
|
306
|
-
'[socket][close]',
|
|
307
|
-
targetTransport.id,
|
|
308
|
-
'skip; this is no longer the current transport',
|
|
309
|
-
);
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
reactor._setStatus(STATUS.CLOSED);
|
|
314
|
-
|
|
315
|
-
for (const room of Object.values(reactor._rooms)) {
|
|
316
|
-
room.isConnected = false;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
if (reactor._isShutdown) {
|
|
320
|
-
reactor._log.info(
|
|
321
|
-
'[socket][close]',
|
|
322
|
-
targetTransport.id,
|
|
323
|
-
'Reactor has been shut down and will not reconnect',
|
|
324
|
-
);
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
const serviceRestart = e.code === SERVICE_RESTART_CLOSE_CODE;
|
|
328
|
-
reactor._scheduleReconnect({ immediate: serviceRestart });
|
|
329
|
-
reactor._log.info(
|
|
330
|
-
'[socket][close]',
|
|
331
|
-
targetTransport.id,
|
|
332
|
-
serviceRestart ? 'server restart,' : '',
|
|
333
|
-
'schedule reconnect, ms =',
|
|
334
|
-
reactor._reconnectTimeoutMs,
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function startSocket(reactor) {
|
|
339
|
-
// Reset whether we support websockets each time we connect
|
|
340
|
-
// new networks may not support websockets
|
|
341
|
-
reactor._wsOk = null;
|
|
342
|
-
if (reactor._isShutdown) {
|
|
343
|
-
reactor._log.info(
|
|
344
|
-
'[socket][start]',
|
|
345
|
-
reactor.config.appId,
|
|
346
|
-
'Reactor has been shut down and will not start a new socket',
|
|
347
|
-
);
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
if (reactor._transport && reactor._transport.isConnecting()) {
|
|
351
|
-
// Our current websocket is in a 'connecting' state.
|
|
352
|
-
// There's no need to start another one, as the socket is
|
|
353
|
-
// effectively fresh.
|
|
354
|
-
reactor._log.info(
|
|
355
|
-
'[socket][start]',
|
|
356
|
-
reactor._transport.id,
|
|
357
|
-
'maintained as current transport, we were still in a connecting state',
|
|
358
|
-
);
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
const prevTransport = reactor._transport;
|
|
362
|
-
reactor._transport = createTransport({
|
|
363
|
-
transportType: reactor._transportType,
|
|
364
|
-
appId: reactor.config.appId,
|
|
365
|
-
apiURI: reactor.config.apiURI,
|
|
366
|
-
wsURI: reactor.config.websocketURI,
|
|
367
|
-
EventSourceImpl: reactor._EventSource,
|
|
368
|
-
});
|
|
369
|
-
reactor._transport.onopen = reactor._transportOnOpen;
|
|
370
|
-
reactor._transport.onmessage = reactor._transportOnMessage;
|
|
371
|
-
reactor._transport.onclose = reactor._transportOnClose;
|
|
372
|
-
reactor._transport.onerror = reactor._transportOnError;
|
|
373
|
-
reactor._log.info('[socket][start]', reactor._transport.id);
|
|
374
|
-
if (prevTransport?.isOpen()) {
|
|
375
|
-
// When the network dies, it doesn't always mean that our
|
|
376
|
-
// socket connection will fire a close event.
|
|
377
|
-
//
|
|
378
|
-
// We _could_ re-use the old socket, if the network drop was a
|
|
379
|
-
// few seconds. But, to be safe right now we always create a new socket.
|
|
380
|
-
//
|
|
381
|
-
// This means that we have to make sure to kill the previous one ourselves.
|
|
382
|
-
// c.f https://issues.chromium.org/issues/41343684
|
|
383
|
-
reactor._log.info(
|
|
384
|
-
'[socket][start]',
|
|
385
|
-
reactor._transport.id,
|
|
386
|
-
'close previous transport id = ',
|
|
387
|
-
prevTransport.id,
|
|
388
|
-
);
|
|
389
|
-
prevTransport.close();
|
|
390
|
-
}
|
|
391
|
-
}
|
package/src/reactorTypes.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { PageInfoResponse } from './queryTypes.ts';
|
|
2
|
-
import { AttrsStore, AttrsStoreJson, Store, StoreJson } from './store.ts';
|
|
3
|
-
|
|
4
|
-
export const STATUS = {
|
|
5
|
-
CONNECTING: 'connecting',
|
|
6
|
-
OPENED: 'opened',
|
|
7
|
-
AUTHENTICATED: 'authenticated',
|
|
8
|
-
CLOSED: 'closed',
|
|
9
|
-
ERRORED: 'errored',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type QuerySubResult = {
|
|
13
|
-
store: Store;
|
|
14
|
-
attrsStore: AttrsStore;
|
|
15
|
-
pageInfo?: PageInfoResponse<any> | null | undefined;
|
|
16
|
-
aggregate?: any;
|
|
17
|
-
processedTxId?: number;
|
|
18
|
-
isExternal?: boolean;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type QuerySub = {
|
|
22
|
-
q: Object;
|
|
23
|
-
eventId?: string;
|
|
24
|
-
lastAccessed?: number | null | undefined;
|
|
25
|
-
result?: QuerySubResult;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type QuerySubResultInStorage = {
|
|
29
|
-
store: StoreJson;
|
|
30
|
-
attrsStore: AttrsStoreJson;
|
|
31
|
-
pageInfo?: PageInfoResponse<any> | null | undefined;
|
|
32
|
-
aggregate?: any;
|
|
33
|
-
processedTxId?: number;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type QuerySubInStorage = {
|
|
37
|
-
q: Object;
|
|
38
|
-
eventId?: string;
|
|
39
|
-
lastAccessed?: number | null | undefined;
|
|
40
|
-
result?: QuerySubResultInStorage;
|
|
41
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { User } from './clientTypes.ts';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Known payloads sent to `firstPartyPath` and handled by
|
|
5
|
-
* `createBackendRelayRouteHandler`.
|
|
6
|
-
*/
|
|
7
|
-
export type BackendRelayRouteHandlerPayloadByType = {
|
|
8
|
-
'sync-user': {
|
|
9
|
-
appId: string;
|
|
10
|
-
user: User | null;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Known `type` values for BackendRelay route handler request bodies. */
|
|
15
|
-
export type BackendRelayRouteHandlerType =
|
|
16
|
-
keyof BackendRelayRouteHandlerPayloadByType;
|
|
17
|
-
|
|
18
|
-
/** A valid request body for BackendRelay's first-party route handler protocol. */
|
|
19
|
-
export type BackendRelayRouteHandlerBody<
|
|
20
|
-
Type extends BackendRelayRouteHandlerType = BackendRelayRouteHandlerType,
|
|
21
|
-
> = {
|
|
22
|
-
[KnownType in Type]: {
|
|
23
|
-
type: KnownType;
|
|
24
|
-
} & BackendRelayRouteHandlerPayloadByType[KnownType];
|
|
25
|
-
}[Type];
|
package/src/rulesTypes.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BackendRelaySchemaDef,
|
|
3
|
-
BackendRelayUnknownSchema,
|
|
4
|
-
} from './schemaTypes.ts';
|
|
5
|
-
|
|
6
|
-
type BackendRelayRulesAttrsAllowBlock = {
|
|
7
|
-
$default?: string | null | undefined;
|
|
8
|
-
view?: string | null | undefined;
|
|
9
|
-
create?: string | null | undefined;
|
|
10
|
-
update?: string | null | undefined;
|
|
11
|
-
delete?: string | null | undefined;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type BackendRelayRulesAllowBlock = BackendRelayRulesAttrsAllowBlock & {
|
|
15
|
-
link?: { [key: string]: string } | null | undefined;
|
|
16
|
-
unlink?: { [key: string]: string } | null | undefined;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* How tokens refill in a rate limit bucket.
|
|
21
|
-
* - `'greedy'`: tokens trickle in continuously over the period.
|
|
22
|
-
* - `'interval'`: all tokens are added at once when the period elapses.
|
|
23
|
-
*/
|
|
24
|
-
export type BackendRelayRulesRateLimitRefillType = 'interval' | 'greedy';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Configuration for how a rate limit bucket refills.
|
|
28
|
-
* All fields are optional and have sensible defaults.
|
|
29
|
-
*/
|
|
30
|
-
export type BackendRelayRulesRateLimitRefill = {
|
|
31
|
-
/** Number of tokens added per refill. Defaults to the bucket's capacity. */
|
|
32
|
-
amount?: number | null | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* How often tokens refill, as a duration string (e.g. `"1 hour"`, `"30 minutes"`, `"1 day"`).
|
|
35
|
-
* Must be between 1 second and 24 hours. Defaults to `"1 hour"`.
|
|
36
|
-
*/
|
|
37
|
-
period?: string | null | undefined;
|
|
38
|
-
/** Refill strategy. Defaults to `"greedy"`. */
|
|
39
|
-
type?: BackendRelayRulesRateLimitRefillType | null | undefined;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* A single rate limit within a bucket. Each limit represents one token bucket
|
|
44
|
-
* constraint. You can combine multiple limits (e.g. a burst limit and a sustained limit).
|
|
45
|
-
*/
|
|
46
|
-
export type BackendRelayRulesRateLimitLimit = {
|
|
47
|
-
/** Maximum number of tokens in the bucket. */
|
|
48
|
-
capacity: number;
|
|
49
|
-
/** Refill configuration. Defaults to greedy refill of the full capacity every hour. */
|
|
50
|
-
refill?: BackendRelayRulesRateLimitRefill | null | undefined;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* A named rate limit bucket configuration. Use in permission rules via
|
|
55
|
-
* `rateLimit.bucketName.limit(key)`.
|
|
56
|
-
*/
|
|
57
|
-
export type BackendRelayRulesRateLimit = {
|
|
58
|
-
/** One or more token bucket limits to apply. */
|
|
59
|
-
limits: Array<BackendRelayRulesRateLimitLimit>;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Map of rate limit names to their configurations.
|
|
64
|
-
* Defined under the `$rateLimits` key in your permission rules.
|
|
65
|
-
*/
|
|
66
|
-
export type BackendRelayRulesRateLimits = Record<
|
|
67
|
-
string,
|
|
68
|
-
BackendRelayRulesRateLimit
|
|
69
|
-
>;
|
|
70
|
-
|
|
71
|
-
type BackendRelayRulesEntityBlock<
|
|
72
|
-
Schema extends BackendRelaySchemaDef<any, any, any>,
|
|
73
|
-
EntityName extends keyof Schema['entities'],
|
|
74
|
-
> = {
|
|
75
|
-
bind?: string[] | Record<string, string>;
|
|
76
|
-
allow: BackendRelayRulesAllowBlock;
|
|
77
|
-
fields?: {
|
|
78
|
-
[AttrName in Exclude<
|
|
79
|
-
keyof Schema['entities'][EntityName]['attrs'],
|
|
80
|
-
'id'
|
|
81
|
-
>]?: string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// The rules type is a bit complicated because we need to handle two cases
|
|
86
|
-
// 1. If you don't pass a Schema, `keyof Schema['entities']` is just string
|
|
87
|
-
// so we have to leave it out of `K`. `K` would collapse to `string`, so `attrs`,
|
|
88
|
-
// `$default`, and `$rateLimits` would get ignored as separate keys.
|
|
89
|
-
// 2. If you do pass a schema, then we can handle each special key separately
|
|
90
|
-
// without it collapsing into string.
|
|
91
|
-
|
|
92
|
-
export type BackendRelayRules<
|
|
93
|
-
Schema extends BackendRelaySchemaDef<
|
|
94
|
-
any,
|
|
95
|
-
any,
|
|
96
|
-
any
|
|
97
|
-
> = BackendRelayUnknownSchema,
|
|
98
|
-
> = {
|
|
99
|
-
[K in 'attrs' | '$default' | '$rateLimits']?: K extends 'attrs'
|
|
100
|
-
? {
|
|
101
|
-
bind?: string[] | Record<string, string>;
|
|
102
|
-
allow: BackendRelayRulesAttrsAllowBlock;
|
|
103
|
-
}
|
|
104
|
-
: K extends '$default'
|
|
105
|
-
? {
|
|
106
|
-
bind?: string[] | Record<string, string>;
|
|
107
|
-
allow: BackendRelayRulesAllowBlock;
|
|
108
|
-
}
|
|
109
|
-
: K extends '$rateLimits'
|
|
110
|
-
? BackendRelayRulesRateLimits
|
|
111
|
-
: never;
|
|
112
|
-
} & {
|
|
113
|
-
[K in
|
|
114
|
-
| keyof Schema['entities']
|
|
115
|
-
| 'attrs'
|
|
116
|
-
| '$default'
|
|
117
|
-
| '$rateLimits']?: K extends 'attrs'
|
|
118
|
-
? {
|
|
119
|
-
bind?: string[] | Record<string, string>;
|
|
120
|
-
allow: BackendRelayRulesAttrsAllowBlock;
|
|
121
|
-
}
|
|
122
|
-
: K extends '$default'
|
|
123
|
-
? {
|
|
124
|
-
bind?: string[] | Record<string, string>;
|
|
125
|
-
allow: BackendRelayRulesAllowBlock;
|
|
126
|
-
}
|
|
127
|
-
: K extends '$rateLimits'
|
|
128
|
-
? BackendRelayRulesRateLimits
|
|
129
|
-
: K extends keyof Schema['entities']
|
|
130
|
-
? BackendRelayRulesEntityBlock<Schema, K>
|
|
131
|
-
: never;
|
|
132
|
-
};
|