@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
|
@@ -1,762 +0,0 @@
|
|
|
1
|
-
import { expect, it } from 'vitest';
|
|
2
|
-
import { init, id } from '../../src';
|
|
3
|
-
import { apiUrl } from './utils/e2e';
|
|
4
|
-
|
|
5
|
-
declare const __BYOP_APP_ID__: string;
|
|
6
|
-
declare const __BYOP_MUTATOR_URL__: string;
|
|
7
|
-
declare const __BYOP_MUTATOR_TOKEN__: string;
|
|
8
|
-
|
|
9
|
-
const enabled =
|
|
10
|
-
!!__BYOP_APP_ID__ && !!__BYOP_MUTATOR_URL__ && !!__BYOP_MUTATOR_TOKEN__;
|
|
11
|
-
const test = enabled ? it : it.skip;
|
|
12
|
-
const websocketURI = `${apiUrl.replace(/^http/, 'ws')}/runtime/session`;
|
|
13
|
-
|
|
14
|
-
async function insertVisibleTodo(todoId: string): Promise<void> {
|
|
15
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
16
|
-
method: 'POST',
|
|
17
|
-
headers: { 'content-type': 'text/plain' },
|
|
18
|
-
body: JSON.stringify({
|
|
19
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
20
|
-
id: todoId,
|
|
21
|
-
title: 'core-external-wal-refresh',
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
if (!response.ok) {
|
|
25
|
-
throw new Error(
|
|
26
|
-
`BYOP mutation failed: ${response.status} ${await response.text()}`,
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async function insertOwnedAndForeignTodos(
|
|
32
|
-
ownedId: string,
|
|
33
|
-
foreignId: string,
|
|
34
|
-
ownerId: string,
|
|
35
|
-
ownerAlias: string,
|
|
36
|
-
): Promise<void> {
|
|
37
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
headers: { 'content-type': 'text/plain' },
|
|
40
|
-
body: JSON.stringify({
|
|
41
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
42
|
-
id: ownedId,
|
|
43
|
-
foreignId,
|
|
44
|
-
ownerId,
|
|
45
|
-
ownerAlias,
|
|
46
|
-
title: 'core-owned-wal-refresh',
|
|
47
|
-
}),
|
|
48
|
-
});
|
|
49
|
-
if (!response.ok) {
|
|
50
|
-
throw new Error(
|
|
51
|
-
`BYOP authenticated mutation failed: ${response.status} ${await response.text()}`,
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function rotateOwnedRelationshipAlias(
|
|
57
|
-
todoId: string,
|
|
58
|
-
ownerAlias: string,
|
|
59
|
-
): Promise<void> {
|
|
60
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
61
|
-
method: 'POST',
|
|
62
|
-
headers: { 'content-type': 'text/plain' },
|
|
63
|
-
body: JSON.stringify({
|
|
64
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
65
|
-
id: todoId,
|
|
66
|
-
ownerAlias,
|
|
67
|
-
title: 'core-rotate-viewer-alias',
|
|
68
|
-
}),
|
|
69
|
-
});
|
|
70
|
-
if (!response.ok) {
|
|
71
|
-
throw new Error(
|
|
72
|
-
`BYOP relationship rotation failed: ${response.status} ${await response.text()}`,
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function deleteOwnedAccount(todoId: string): Promise<void> {
|
|
78
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
79
|
-
method: 'POST',
|
|
80
|
-
headers: { 'content-type': 'text/plain' },
|
|
81
|
-
body: JSON.stringify({
|
|
82
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
83
|
-
id: todoId,
|
|
84
|
-
title: 'core-delete-owned-account',
|
|
85
|
-
}),
|
|
86
|
-
});
|
|
87
|
-
if (!response.ok) {
|
|
88
|
-
throw new Error(
|
|
89
|
-
`BYOP relationship cascade failed: ${response.status} ${await response.text()}`,
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async function mutateOwnedTodoOwnerLink(
|
|
95
|
-
todoId: string,
|
|
96
|
-
title: 'core-clear-owner-link' | 'core-restore-owner-link',
|
|
97
|
-
): Promise<void> {
|
|
98
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
99
|
-
method: 'POST',
|
|
100
|
-
headers: { 'content-type': 'text/plain' },
|
|
101
|
-
body: JSON.stringify({
|
|
102
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
103
|
-
id: todoId,
|
|
104
|
-
title,
|
|
105
|
-
}),
|
|
106
|
-
});
|
|
107
|
-
if (!response.ok) {
|
|
108
|
-
throw new Error(
|
|
109
|
-
`BYOP nullable relationship mutation failed: ${response.status} ${await response.text()}`,
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
async function concurrentlyRotateOwnedRelationship(
|
|
115
|
-
todoId: string,
|
|
116
|
-
ownerAlias: string,
|
|
117
|
-
): Promise<void> {
|
|
118
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
119
|
-
method: 'POST',
|
|
120
|
-
headers: { 'content-type': 'text/plain' },
|
|
121
|
-
body: JSON.stringify({
|
|
122
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
123
|
-
id: todoId,
|
|
124
|
-
ownerAlias,
|
|
125
|
-
title: 'core-concurrent-relationship-rotation',
|
|
126
|
-
}),
|
|
127
|
-
});
|
|
128
|
-
if (!response.ok) {
|
|
129
|
-
throw new Error(
|
|
130
|
-
`BYOP concurrent relationship rotation failed: ${response.status} ${await response.text()}`,
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
async function injectFailedRelationshipRotation(
|
|
136
|
-
todoId: string,
|
|
137
|
-
ownerAlias: string,
|
|
138
|
-
): Promise<void> {
|
|
139
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
140
|
-
method: 'POST',
|
|
141
|
-
headers: { 'content-type': 'text/plain' },
|
|
142
|
-
body: JSON.stringify({
|
|
143
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
144
|
-
id: todoId,
|
|
145
|
-
ownerAlias,
|
|
146
|
-
title: 'core-fail-relationship-rotation',
|
|
147
|
-
}),
|
|
148
|
-
});
|
|
149
|
-
if (response.status !== 500) {
|
|
150
|
-
throw new Error(
|
|
151
|
-
`BYOP failure injection returned unexpected status ${response.status}`,
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
async function recoverRelationshipRotation(
|
|
157
|
-
todoId: string,
|
|
158
|
-
ownerAlias: string,
|
|
159
|
-
): Promise<void> {
|
|
160
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
161
|
-
method: 'POST',
|
|
162
|
-
headers: { 'content-type': 'text/plain' },
|
|
163
|
-
body: JSON.stringify({
|
|
164
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
165
|
-
id: todoId,
|
|
166
|
-
ownerAlias,
|
|
167
|
-
title: 'core-recover-relationship-rotation',
|
|
168
|
-
}),
|
|
169
|
-
});
|
|
170
|
-
if (!response.ok) {
|
|
171
|
-
throw new Error(
|
|
172
|
-
`BYOP relationship recovery failed: ${response.status} ${await response.text()}`,
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
async function restartByopReplication(): Promise<void> {
|
|
178
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
179
|
-
method: 'POST',
|
|
180
|
-
headers: { 'content-type': 'text/plain' },
|
|
181
|
-
body: JSON.stringify({
|
|
182
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
183
|
-
id: id(),
|
|
184
|
-
title: 'core-restart-replication',
|
|
185
|
-
}),
|
|
186
|
-
});
|
|
187
|
-
if (!response.ok) {
|
|
188
|
-
throw new Error(
|
|
189
|
-
`BYOP replication restart failed: ${response.status} ${await response.text()}`,
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
async function rotateAfterReplicationReconnect(
|
|
195
|
-
todoId: string,
|
|
196
|
-
ownerAlias: string,
|
|
197
|
-
): Promise<void> {
|
|
198
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
199
|
-
method: 'POST',
|
|
200
|
-
headers: { 'content-type': 'text/plain' },
|
|
201
|
-
body: JSON.stringify({
|
|
202
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
203
|
-
id: todoId,
|
|
204
|
-
ownerAlias,
|
|
205
|
-
title: 'core-post-reconnect-rotation',
|
|
206
|
-
}),
|
|
207
|
-
});
|
|
208
|
-
if (!response.ok) {
|
|
209
|
-
throw new Error(
|
|
210
|
-
`BYOP post-reconnect rotation failed: ${response.status} ${await response.text()}`,
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
async function applyContendedRelationshipRotation(
|
|
216
|
-
todoId: string,
|
|
217
|
-
ownerAlias: string,
|
|
218
|
-
): Promise<void> {
|
|
219
|
-
const response = await fetch(__BYOP_MUTATOR_URL__, {
|
|
220
|
-
method: 'POST',
|
|
221
|
-
headers: { 'content-type': 'text/plain' },
|
|
222
|
-
body: JSON.stringify({
|
|
223
|
-
token: __BYOP_MUTATOR_TOKEN__,
|
|
224
|
-
id: todoId,
|
|
225
|
-
ownerAlias,
|
|
226
|
-
title: 'core-contended-relationship-rotation',
|
|
227
|
-
}),
|
|
228
|
-
});
|
|
229
|
-
if (!response.ok) {
|
|
230
|
-
throw new Error(
|
|
231
|
-
`BYOP contended relationship rotation failed: ${response.status} ${await response.text()}`,
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function watchTodos(
|
|
237
|
-
db: ReturnType<typeof init>,
|
|
238
|
-
query: { todos: { owners: { accounts: Record<string, never> } } },
|
|
239
|
-
): {
|
|
240
|
-
waitFor: (
|
|
241
|
-
predicate: (todos: Array<{ title: string }>) => boolean,
|
|
242
|
-
) => Promise<Array<{ title: string }>>;
|
|
243
|
-
unsubscribe: () => void;
|
|
244
|
-
} {
|
|
245
|
-
type Todos = Array<{ title: string }>;
|
|
246
|
-
type Waiter = {
|
|
247
|
-
predicate: (todos: Todos) => boolean;
|
|
248
|
-
resolve: (todos: Todos) => void;
|
|
249
|
-
reject: (error: Error) => void;
|
|
250
|
-
timeout: ReturnType<typeof setTimeout>;
|
|
251
|
-
};
|
|
252
|
-
let latest: Todos | undefined;
|
|
253
|
-
let failure: Error | undefined;
|
|
254
|
-
const waiters: Waiter[] = [];
|
|
255
|
-
const unsubscribe = db.subscribeQuery(query, (result) => {
|
|
256
|
-
if (result.error) {
|
|
257
|
-
failure = new Error(result.error.message);
|
|
258
|
-
for (const waiter of waiters.splice(0)) {
|
|
259
|
-
clearTimeout(waiter.timeout);
|
|
260
|
-
waiter.reject(failure);
|
|
261
|
-
}
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
latest = result.data.todos;
|
|
265
|
-
for (let index = waiters.length - 1; index >= 0; index -= 1) {
|
|
266
|
-
const waiter = waiters[index];
|
|
267
|
-
if (waiter.predicate(latest)) {
|
|
268
|
-
waiters.splice(index, 1);
|
|
269
|
-
clearTimeout(waiter.timeout);
|
|
270
|
-
waiter.resolve(latest);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
return {
|
|
275
|
-
waitFor: (predicate) => {
|
|
276
|
-
if (failure) return Promise.reject(failure);
|
|
277
|
-
if (latest && predicate(latest)) return Promise.resolve(latest);
|
|
278
|
-
return new Promise((resolve, reject) => {
|
|
279
|
-
const waiter: Waiter = {
|
|
280
|
-
predicate,
|
|
281
|
-
resolve,
|
|
282
|
-
reject,
|
|
283
|
-
timeout: setTimeout(() => {
|
|
284
|
-
const index = waiters.indexOf(waiter);
|
|
285
|
-
if (index >= 0) waiters.splice(index, 1);
|
|
286
|
-
reject(new Error('Core BYOP subscription timed out'));
|
|
287
|
-
}, 20_000),
|
|
288
|
-
};
|
|
289
|
-
waiters.push(waiter);
|
|
290
|
-
});
|
|
291
|
-
},
|
|
292
|
-
unsubscribe,
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
function watchAccounts(
|
|
297
|
-
db: ReturnType<typeof init>,
|
|
298
|
-
query: {
|
|
299
|
-
accounts: {
|
|
300
|
-
owners: { todos: Record<string, never> };
|
|
301
|
-
profiles: Record<string, never>;
|
|
302
|
-
};
|
|
303
|
-
},
|
|
304
|
-
): {
|
|
305
|
-
waitFor: (
|
|
306
|
-
predicate: (accounts: Array<{ user_id: string }>) => boolean,
|
|
307
|
-
) => Promise<Array<{ user_id: string }>>;
|
|
308
|
-
unsubscribe: () => void;
|
|
309
|
-
} {
|
|
310
|
-
type Accounts = Array<{ user_id: string }>;
|
|
311
|
-
type Waiter = {
|
|
312
|
-
predicate: (accounts: Accounts) => boolean;
|
|
313
|
-
resolve: (accounts: Accounts) => void;
|
|
314
|
-
reject: (error: Error) => void;
|
|
315
|
-
timeout: ReturnType<typeof setTimeout>;
|
|
316
|
-
};
|
|
317
|
-
let latest: Accounts | undefined;
|
|
318
|
-
let failure: Error | undefined;
|
|
319
|
-
const waiters: Waiter[] = [];
|
|
320
|
-
const unsubscribe = db.subscribeQuery(query, (result) => {
|
|
321
|
-
if (result.error) {
|
|
322
|
-
failure = new Error(result.error.message);
|
|
323
|
-
for (const waiter of waiters.splice(0)) {
|
|
324
|
-
clearTimeout(waiter.timeout);
|
|
325
|
-
waiter.reject(failure);
|
|
326
|
-
}
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
latest = result.data.accounts;
|
|
330
|
-
for (let index = waiters.length - 1; index >= 0; index -= 1) {
|
|
331
|
-
const waiter = waiters[index];
|
|
332
|
-
if (waiter.predicate(latest)) {
|
|
333
|
-
waiters.splice(index, 1);
|
|
334
|
-
clearTimeout(waiter.timeout);
|
|
335
|
-
waiter.resolve(latest);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
return {
|
|
340
|
-
waitFor: (predicate) => {
|
|
341
|
-
if (failure) return Promise.reject(failure);
|
|
342
|
-
if (latest && predicate(latest)) return Promise.resolve(latest);
|
|
343
|
-
return new Promise((resolve, reject) => {
|
|
344
|
-
const waiter: Waiter = {
|
|
345
|
-
predicate,
|
|
346
|
-
resolve,
|
|
347
|
-
reject,
|
|
348
|
-
timeout: setTimeout(() => {
|
|
349
|
-
const index = waiters.indexOf(waiter);
|
|
350
|
-
if (index >= 0) waiters.splice(index, 1);
|
|
351
|
-
reject(new Error('Core reverse BYOP subscription timed out'));
|
|
352
|
-
}, 20_000),
|
|
353
|
-
};
|
|
354
|
-
waiters.push(waiter);
|
|
355
|
-
});
|
|
356
|
-
},
|
|
357
|
-
unsubscribe,
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
test('applies custom auth.ref and data.ref rules across BYOP WAL refreshes', async () => {
|
|
362
|
-
const db = init({
|
|
363
|
-
appId: __BYOP_APP_ID__,
|
|
364
|
-
apiURI: apiUrl,
|
|
365
|
-
websocketURI,
|
|
366
|
-
});
|
|
367
|
-
const query = { todos: { owners: { accounts: {} } } };
|
|
368
|
-
const reverseQuery = { accounts: { owners: { todos: {} }, profiles: {} } };
|
|
369
|
-
|
|
370
|
-
try {
|
|
371
|
-
const initial = await db.queryOnce(query);
|
|
372
|
-
expect(initial.data.todos.map((todo) => todo.title)).toEqual(['seed']);
|
|
373
|
-
|
|
374
|
-
const anonymous = watchTodos(db, query);
|
|
375
|
-
|
|
376
|
-
try {
|
|
377
|
-
await anonymous.waitFor((todos) =>
|
|
378
|
-
todos.some((todo) => todo.title === 'seed'),
|
|
379
|
-
);
|
|
380
|
-
await insertVisibleTodo(id());
|
|
381
|
-
await anonymous.waitFor((todos) =>
|
|
382
|
-
todos.some((todo) => todo.title === 'core-external-wal-refresh'),
|
|
383
|
-
);
|
|
384
|
-
} finally {
|
|
385
|
-
anonymous.unsubscribe();
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
const username = `byop-user-${id()}`;
|
|
389
|
-
const rotatedUsername = `byop-user-${id()}`;
|
|
390
|
-
const concurrentUsername = `byop-user-${id()}`;
|
|
391
|
-
const recoveryUsername = `byop-user-${id()}`;
|
|
392
|
-
const reconnectUsername = `byop-user-${id()}`;
|
|
393
|
-
const contentionUsername = `byop-user-${id()}`;
|
|
394
|
-
const { user } = await db.auth.signInAsGuest({
|
|
395
|
-
extraFields: { username },
|
|
396
|
-
});
|
|
397
|
-
expect(user.isGuest).toBe(true);
|
|
398
|
-
const teamId = id();
|
|
399
|
-
const rotatedTeamId = id();
|
|
400
|
-
const concurrentTeamId = id();
|
|
401
|
-
const recoveryTeamId = id();
|
|
402
|
-
const reconnectTeamId = id();
|
|
403
|
-
const contentionTeamId = id();
|
|
404
|
-
await db.transact([
|
|
405
|
-
db.tx.teams[teamId].update({ slug: username }),
|
|
406
|
-
db.tx.teams[rotatedTeamId].update({ slug: rotatedUsername }),
|
|
407
|
-
db.tx.teams[concurrentTeamId].update({ slug: concurrentUsername }),
|
|
408
|
-
db.tx.teams[recoveryTeamId].update({ slug: recoveryUsername }),
|
|
409
|
-
db.tx.teams[reconnectTeamId].update({ slug: reconnectUsername }),
|
|
410
|
-
db.tx.teams[contentionTeamId].update({ slug: contentionUsername }),
|
|
411
|
-
db.tx.$users[user.id].link({
|
|
412
|
-
teams: [
|
|
413
|
-
teamId,
|
|
414
|
-
rotatedTeamId,
|
|
415
|
-
concurrentTeamId,
|
|
416
|
-
recoveryTeamId,
|
|
417
|
-
reconnectTeamId,
|
|
418
|
-
contentionTeamId,
|
|
419
|
-
],
|
|
420
|
-
}),
|
|
421
|
-
]);
|
|
422
|
-
|
|
423
|
-
const authenticated = watchTodos(db, query);
|
|
424
|
-
const reverse = watchAccounts(db, reverseQuery);
|
|
425
|
-
try {
|
|
426
|
-
await authenticated.waitFor((todos) =>
|
|
427
|
-
todos.some((todo) => todo.title === 'core-external-wal-refresh'),
|
|
428
|
-
);
|
|
429
|
-
await reverse.waitFor((accounts) => accounts.length === 0);
|
|
430
|
-
const ownedId = id();
|
|
431
|
-
const foreignId = id();
|
|
432
|
-
await insertOwnedAndForeignTodos(ownedId, foreignId, user.id, username);
|
|
433
|
-
const todos = await authenticated.waitFor((rows) =>
|
|
434
|
-
rows.some((todo) => todo.title === 'core-owned-wal-refresh'),
|
|
435
|
-
);
|
|
436
|
-
expect(
|
|
437
|
-
todos.some((todo) => todo.title === 'core-owned-wal-refresh'),
|
|
438
|
-
).toBe(true);
|
|
439
|
-
expect(todos.some((todo) => todo.title === 'core-foreign-hidden')).toBe(
|
|
440
|
-
false,
|
|
441
|
-
);
|
|
442
|
-
const owned = todos.find(
|
|
443
|
-
(todo) => todo.title === 'core-owned-wal-refresh',
|
|
444
|
-
) as
|
|
445
|
-
| ({
|
|
446
|
-
owners?:
|
|
447
|
-
| {
|
|
448
|
-
accounts?: { user_id?: string } | Array<{ user_id?: string }>;
|
|
449
|
-
}
|
|
450
|
-
| Array<{
|
|
451
|
-
accounts?: { user_id?: string } | Array<{ user_id?: string }>;
|
|
452
|
-
}>;
|
|
453
|
-
} & {
|
|
454
|
-
title: string;
|
|
455
|
-
})
|
|
456
|
-
| undefined;
|
|
457
|
-
const owners = Array.isArray(owned?.owners)
|
|
458
|
-
? owned.owners
|
|
459
|
-
: owned?.owners
|
|
460
|
-
? [owned.owners]
|
|
461
|
-
: [];
|
|
462
|
-
const accounts = owners.flatMap((owner) =>
|
|
463
|
-
Array.isArray(owner.accounts)
|
|
464
|
-
? owner.accounts
|
|
465
|
-
: owner.accounts
|
|
466
|
-
? [owner.accounts]
|
|
467
|
-
: [],
|
|
468
|
-
);
|
|
469
|
-
expect(accounts.map((account) => account.user_id)).toEqual([user.id]);
|
|
470
|
-
|
|
471
|
-
const reverseAccounts = await reverse.waitFor((rows) =>
|
|
472
|
-
rows.some((account) => account.user_id === user.id),
|
|
473
|
-
);
|
|
474
|
-
expect(reverseAccounts).toHaveLength(1);
|
|
475
|
-
const reverseAccount = reverseAccounts[0] as {
|
|
476
|
-
user_id: string;
|
|
477
|
-
profiles?: Array<{ viewer_alias?: string }> | { viewer_alias?: string };
|
|
478
|
-
owners?:
|
|
479
|
-
| Array<{
|
|
480
|
-
todos?: Array<{ title?: string }> | { title?: string };
|
|
481
|
-
}>
|
|
482
|
-
| {
|
|
483
|
-
todos?: Array<{ title?: string }> | { title?: string };
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
const reverseOwners = Array.isArray(reverseAccount.owners)
|
|
487
|
-
? reverseAccount.owners
|
|
488
|
-
: reverseAccount.owners
|
|
489
|
-
? [reverseAccount.owners]
|
|
490
|
-
: [];
|
|
491
|
-
const reverseTodos = reverseOwners.flatMap((owner) =>
|
|
492
|
-
Array.isArray(owner.todos)
|
|
493
|
-
? owner.todos
|
|
494
|
-
: owner.todos
|
|
495
|
-
? [owner.todos]
|
|
496
|
-
: [],
|
|
497
|
-
);
|
|
498
|
-
expect(reverseTodos.map((todo) => todo.title)).toEqual([
|
|
499
|
-
'core-owned-wal-refresh',
|
|
500
|
-
]);
|
|
501
|
-
const profiles = Array.isArray(reverseAccount.profiles)
|
|
502
|
-
? reverseAccount.profiles
|
|
503
|
-
: reverseAccount.profiles
|
|
504
|
-
? [reverseAccount.profiles]
|
|
505
|
-
: [];
|
|
506
|
-
expect(profiles.map((profile) => profile.viewer_alias)).toEqual([
|
|
507
|
-
username,
|
|
508
|
-
]);
|
|
509
|
-
|
|
510
|
-
await db.transact(db.tx.$users[user.id].unlink({ teams: teamId }));
|
|
511
|
-
await reverse.waitFor((accounts) => accounts.length === 0);
|
|
512
|
-
|
|
513
|
-
await rotateOwnedRelationshipAlias(ownedId, rotatedUsername);
|
|
514
|
-
const rotatedAccounts = await reverse.waitFor((rows) =>
|
|
515
|
-
rows.some((account) => account.user_id === user.id),
|
|
516
|
-
);
|
|
517
|
-
expect(rotatedAccounts).toHaveLength(1);
|
|
518
|
-
const rotatedAccount = rotatedAccounts[0] as {
|
|
519
|
-
profiles?: Array<{ viewer_alias?: string }> | { viewer_alias?: string };
|
|
520
|
-
};
|
|
521
|
-
const rotatedProfiles = Array.isArray(rotatedAccount.profiles)
|
|
522
|
-
? rotatedAccount.profiles
|
|
523
|
-
: rotatedAccount.profiles
|
|
524
|
-
? [rotatedAccount.profiles]
|
|
525
|
-
: [];
|
|
526
|
-
expect(rotatedProfiles.map((profile) => profile.viewer_alias)).toEqual([
|
|
527
|
-
rotatedUsername,
|
|
528
|
-
]);
|
|
529
|
-
|
|
530
|
-
await mutateOwnedTodoOwnerLink(ownedId, 'core-clear-owner-link');
|
|
531
|
-
await reverse.waitFor((accounts) => accounts.length === 0);
|
|
532
|
-
const afterClear = await authenticated.waitFor(
|
|
533
|
-
(todos) =>
|
|
534
|
-
!todos.some((todo) => todo.title === 'core-owned-wal-refresh'),
|
|
535
|
-
);
|
|
536
|
-
expect(
|
|
537
|
-
afterClear.some((todo) => todo.title === 'core-external-wal-refresh'),
|
|
538
|
-
).toBe(true);
|
|
539
|
-
|
|
540
|
-
await mutateOwnedTodoOwnerLink(ownedId, 'core-restore-owner-link');
|
|
541
|
-
await reverse.waitFor((rows) =>
|
|
542
|
-
rows.some((account) => account.user_id === user.id),
|
|
543
|
-
);
|
|
544
|
-
const afterRestore = await authenticated.waitFor((todos) =>
|
|
545
|
-
todos.some((todo) => todo.title === 'core-owned-wal-refresh'),
|
|
546
|
-
);
|
|
547
|
-
expect(
|
|
548
|
-
afterRestore.some((todo) => todo.title === 'core-external-wal-refresh'),
|
|
549
|
-
).toBe(true);
|
|
550
|
-
|
|
551
|
-
await concurrentlyRotateOwnedRelationship(ownedId, concurrentUsername);
|
|
552
|
-
const concurrentAccounts = await reverse.waitFor((rows) =>
|
|
553
|
-
rows.some((account) => {
|
|
554
|
-
const accountProfiles = (
|
|
555
|
-
account as {
|
|
556
|
-
profiles?:
|
|
557
|
-
| Array<{ viewer_alias?: string }>
|
|
558
|
-
| { viewer_alias?: string };
|
|
559
|
-
}
|
|
560
|
-
).profiles;
|
|
561
|
-
const values = Array.isArray(accountProfiles)
|
|
562
|
-
? accountProfiles
|
|
563
|
-
: accountProfiles
|
|
564
|
-
? [accountProfiles]
|
|
565
|
-
: [];
|
|
566
|
-
return values.some(
|
|
567
|
-
(profile) => profile.viewer_alias === concurrentUsername,
|
|
568
|
-
);
|
|
569
|
-
}),
|
|
570
|
-
);
|
|
571
|
-
expect(concurrentAccounts).toHaveLength(1);
|
|
572
|
-
const afterConcurrentRotation = await authenticated.waitFor((todos) =>
|
|
573
|
-
todos.some((todo) => todo.title === 'core-owned-concurrent-restored'),
|
|
574
|
-
);
|
|
575
|
-
expect(
|
|
576
|
-
afterConcurrentRotation.some(
|
|
577
|
-
(todo) => todo.title === 'core-owned-wal-refresh',
|
|
578
|
-
),
|
|
579
|
-
).toBe(false);
|
|
580
|
-
expect(
|
|
581
|
-
afterConcurrentRotation.some(
|
|
582
|
-
(todo) => todo.title === 'core-external-wal-refresh',
|
|
583
|
-
),
|
|
584
|
-
).toBe(true);
|
|
585
|
-
|
|
586
|
-
await injectFailedRelationshipRotation(ownedId, recoveryUsername);
|
|
587
|
-
const afterFailedForward = await db.queryOnce(query);
|
|
588
|
-
expect(
|
|
589
|
-
afterFailedForward.data.todos.some(
|
|
590
|
-
(todo) => todo.title === 'core-owned-concurrent-restored',
|
|
591
|
-
),
|
|
592
|
-
).toBe(true);
|
|
593
|
-
expect(
|
|
594
|
-
afterFailedForward.data.todos.some(
|
|
595
|
-
(todo) => todo.title === 'core-owned-failure-staged',
|
|
596
|
-
),
|
|
597
|
-
).toBe(false);
|
|
598
|
-
const afterFailedReverse = await db.queryOnce(reverseQuery);
|
|
599
|
-
const rollbackAccount = afterFailedReverse.data.accounts.find(
|
|
600
|
-
(account) => account.user_id === user.id,
|
|
601
|
-
) as
|
|
602
|
-
| {
|
|
603
|
-
profiles?:
|
|
604
|
-
| Array<{ viewer_alias?: string }>
|
|
605
|
-
| { viewer_alias?: string };
|
|
606
|
-
owners?:
|
|
607
|
-
| Array<{
|
|
608
|
-
todos?: Array<{ title?: string }> | { title?: string };
|
|
609
|
-
}>
|
|
610
|
-
| {
|
|
611
|
-
todos?: Array<{ title?: string }> | { title?: string };
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
|
-
| undefined;
|
|
615
|
-
const rollbackProfiles = Array.isArray(rollbackAccount?.profiles)
|
|
616
|
-
? rollbackAccount.profiles
|
|
617
|
-
: rollbackAccount?.profiles
|
|
618
|
-
? [rollbackAccount.profiles]
|
|
619
|
-
: [];
|
|
620
|
-
expect(rollbackProfiles.map((profile) => profile.viewer_alias)).toEqual([
|
|
621
|
-
concurrentUsername,
|
|
622
|
-
]);
|
|
623
|
-
const rollbackOwners = Array.isArray(rollbackAccount?.owners)
|
|
624
|
-
? rollbackAccount.owners
|
|
625
|
-
: rollbackAccount?.owners
|
|
626
|
-
? [rollbackAccount.owners]
|
|
627
|
-
: [];
|
|
628
|
-
const rollbackTodos = rollbackOwners.flatMap((owner) =>
|
|
629
|
-
Array.isArray(owner.todos)
|
|
630
|
-
? owner.todos
|
|
631
|
-
: owner.todos
|
|
632
|
-
? [owner.todos]
|
|
633
|
-
: [],
|
|
634
|
-
);
|
|
635
|
-
expect(rollbackTodos.map((todo) => todo.title)).toEqual([
|
|
636
|
-
'core-owned-concurrent-restored',
|
|
637
|
-
]);
|
|
638
|
-
|
|
639
|
-
await recoverRelationshipRotation(ownedId, recoveryUsername);
|
|
640
|
-
await reverse.waitFor((rows) =>
|
|
641
|
-
rows.some((account) => {
|
|
642
|
-
const accountProfiles = (
|
|
643
|
-
account as {
|
|
644
|
-
profiles?:
|
|
645
|
-
| Array<{ viewer_alias?: string }>
|
|
646
|
-
| { viewer_alias?: string };
|
|
647
|
-
}
|
|
648
|
-
).profiles;
|
|
649
|
-
const values = Array.isArray(accountProfiles)
|
|
650
|
-
? accountProfiles
|
|
651
|
-
: accountProfiles
|
|
652
|
-
? [accountProfiles]
|
|
653
|
-
: [];
|
|
654
|
-
return values.some(
|
|
655
|
-
(profile) => profile.viewer_alias === recoveryUsername,
|
|
656
|
-
);
|
|
657
|
-
}),
|
|
658
|
-
);
|
|
659
|
-
const afterRecovery = await authenticated.waitFor((todos) =>
|
|
660
|
-
todos.some((todo) => todo.title === 'core-owned-failure-recovered'),
|
|
661
|
-
);
|
|
662
|
-
expect(
|
|
663
|
-
afterRecovery.some(
|
|
664
|
-
(todo) => todo.title === 'core-owned-concurrent-restored',
|
|
665
|
-
),
|
|
666
|
-
).toBe(false);
|
|
667
|
-
expect(
|
|
668
|
-
afterRecovery.some(
|
|
669
|
-
(todo) => todo.title === 'core-external-wal-refresh',
|
|
670
|
-
),
|
|
671
|
-
).toBe(true);
|
|
672
|
-
|
|
673
|
-
await restartByopReplication();
|
|
674
|
-
await rotateAfterReplicationReconnect(ownedId, reconnectUsername);
|
|
675
|
-
const afterReconnectAccounts = await reverse.waitFor((rows) =>
|
|
676
|
-
rows.some((account) => {
|
|
677
|
-
const accountProfiles = (
|
|
678
|
-
account as {
|
|
679
|
-
profiles?:
|
|
680
|
-
| Array<{ viewer_alias?: string }>
|
|
681
|
-
| { viewer_alias?: string };
|
|
682
|
-
}
|
|
683
|
-
).profiles;
|
|
684
|
-
const values = Array.isArray(accountProfiles)
|
|
685
|
-
? accountProfiles
|
|
686
|
-
: accountProfiles
|
|
687
|
-
? [accountProfiles]
|
|
688
|
-
: [];
|
|
689
|
-
return values.some(
|
|
690
|
-
(profile) => profile.viewer_alias === reconnectUsername,
|
|
691
|
-
);
|
|
692
|
-
}),
|
|
693
|
-
);
|
|
694
|
-
expect(afterReconnectAccounts).toHaveLength(1);
|
|
695
|
-
const afterReconnect = await authenticated.waitFor((todos) =>
|
|
696
|
-
todos.some((todo) => todo.title === 'core-owned-post-reconnect'),
|
|
697
|
-
);
|
|
698
|
-
expect(
|
|
699
|
-
afterReconnect.some(
|
|
700
|
-
(todo) => todo.title === 'core-owned-failure-recovered',
|
|
701
|
-
),
|
|
702
|
-
).toBe(false);
|
|
703
|
-
expect(
|
|
704
|
-
afterReconnect.some(
|
|
705
|
-
(todo) => todo.title === 'core-external-wal-refresh',
|
|
706
|
-
),
|
|
707
|
-
).toBe(true);
|
|
708
|
-
|
|
709
|
-
await applyContendedRelationshipRotation(ownedId, contentionUsername);
|
|
710
|
-
const afterContentionAccounts = await reverse.waitFor((rows) =>
|
|
711
|
-
rows.some((account) => {
|
|
712
|
-
const accountProfiles = (
|
|
713
|
-
account as {
|
|
714
|
-
profiles?:
|
|
715
|
-
| Array<{ viewer_alias?: string }>
|
|
716
|
-
| { viewer_alias?: string };
|
|
717
|
-
}
|
|
718
|
-
).profiles;
|
|
719
|
-
const values = Array.isArray(accountProfiles)
|
|
720
|
-
? accountProfiles
|
|
721
|
-
: accountProfiles
|
|
722
|
-
? [accountProfiles]
|
|
723
|
-
: [];
|
|
724
|
-
return values.some(
|
|
725
|
-
(profile) => profile.viewer_alias === contentionUsername,
|
|
726
|
-
);
|
|
727
|
-
}),
|
|
728
|
-
);
|
|
729
|
-
expect(afterContentionAccounts).toHaveLength(1);
|
|
730
|
-
const afterContention = await authenticated.waitFor((todos) =>
|
|
731
|
-
todos.some((todo) => todo.title === 'core-owned-contention-converged'),
|
|
732
|
-
);
|
|
733
|
-
expect(
|
|
734
|
-
afterContention.some(
|
|
735
|
-
(todo) => todo.title === 'core-owned-post-reconnect',
|
|
736
|
-
),
|
|
737
|
-
).toBe(false);
|
|
738
|
-
expect(
|
|
739
|
-
afterContention.some(
|
|
740
|
-
(todo) => todo.title === 'core-external-wal-refresh',
|
|
741
|
-
),
|
|
742
|
-
).toBe(true);
|
|
743
|
-
|
|
744
|
-
await deleteOwnedAccount(ownedId);
|
|
745
|
-
await reverse.waitFor((accounts) => accounts.length === 0);
|
|
746
|
-
const afterCascade = await authenticated.waitFor(
|
|
747
|
-
(todos) =>
|
|
748
|
-
!todos.some(
|
|
749
|
-
(todo) => todo.title === 'core-owned-contention-converged',
|
|
750
|
-
),
|
|
751
|
-
);
|
|
752
|
-
expect(
|
|
753
|
-
afterCascade.some((todo) => todo.title === 'core-external-wal-refresh'),
|
|
754
|
-
).toBe(true);
|
|
755
|
-
} finally {
|
|
756
|
-
authenticated.unsubscribe();
|
|
757
|
-
reverse.unsubscribe();
|
|
758
|
-
}
|
|
759
|
-
} finally {
|
|
760
|
-
db.shutdown();
|
|
761
|
-
}
|
|
762
|
-
}, 220_000);
|