@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,450 +0,0 @@
|
|
|
1
|
-
import { i } from '../../src/schema';
|
|
2
|
-
import { validateTransactions } from '../../src/transactionValidation.ts';
|
|
3
|
-
import { lookup, tx as originalTx, TxChunk } from '../../src/instatx.ts';
|
|
4
|
-
import id from '../../src/utils/id.ts';
|
|
5
|
-
import { expect, test } from 'vitest';
|
|
6
|
-
import { BackendRelaySchemaDef } from '../../src';
|
|
7
|
-
|
|
8
|
-
const testSchema = i.schema({
|
|
9
|
-
entities: {
|
|
10
|
-
users: i.entity({
|
|
11
|
-
name: i.string(),
|
|
12
|
-
email: i.string().indexed().unique(),
|
|
13
|
-
bio: i.string().optional(),
|
|
14
|
-
stuff: i.json<{ custom: string }>().optional(),
|
|
15
|
-
junk: i.any().optional(),
|
|
16
|
-
}),
|
|
17
|
-
posts: i.entity({
|
|
18
|
-
title: i.string(),
|
|
19
|
-
body: i.string(),
|
|
20
|
-
}),
|
|
21
|
-
comments: i.entity({
|
|
22
|
-
body: i.string(),
|
|
23
|
-
}),
|
|
24
|
-
unlinkedWithAnything: i.entity({
|
|
25
|
-
animal: i.string(),
|
|
26
|
-
count: i.string(),
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
links: {
|
|
30
|
-
usersPosts: {
|
|
31
|
-
forward: {
|
|
32
|
-
on: 'users',
|
|
33
|
-
has: 'many',
|
|
34
|
-
label: 'posts',
|
|
35
|
-
},
|
|
36
|
-
reverse: {
|
|
37
|
-
on: 'posts',
|
|
38
|
-
has: 'one',
|
|
39
|
-
label: 'author',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
postsComments: {
|
|
43
|
-
forward: {
|
|
44
|
-
on: 'posts',
|
|
45
|
-
has: 'many',
|
|
46
|
-
label: 'comments',
|
|
47
|
-
},
|
|
48
|
-
reverse: {
|
|
49
|
-
on: 'comments',
|
|
50
|
-
has: 'one',
|
|
51
|
-
label: 'post',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
friendships: {
|
|
55
|
-
forward: {
|
|
56
|
-
on: 'users',
|
|
57
|
-
has: 'many',
|
|
58
|
-
label: 'friends',
|
|
59
|
-
},
|
|
60
|
-
reverse: {
|
|
61
|
-
on: 'users',
|
|
62
|
-
has: 'many',
|
|
63
|
-
label: '_friends',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const beValid = (
|
|
70
|
-
chunk: any,
|
|
71
|
-
schema: BackendRelaySchemaDef<any, any, any> | null = testSchema,
|
|
72
|
-
) => {
|
|
73
|
-
expect(() => validateTransactions(chunk, schema ?? undefined)).not.toThrow();
|
|
74
|
-
if (schema) {
|
|
75
|
-
expect(() => validateTransactions(chunk, undefined)).not.toThrow();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const beWrong = (
|
|
80
|
-
chunk: any,
|
|
81
|
-
schema: BackendRelaySchemaDef<any, any, any> | null = testSchema,
|
|
82
|
-
) => {
|
|
83
|
-
expect(() => validateTransactions(chunk, schema ?? undefined)).toThrow();
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const tx = originalTx as unknown as TxChunk<typeof testSchema>;
|
|
87
|
-
|
|
88
|
-
test('validates basic transaction chunk', () => {
|
|
89
|
-
const userId = id();
|
|
90
|
-
const validChunk = tx.users[userId].create({
|
|
91
|
-
name: 'John',
|
|
92
|
-
email: 'john@example.com',
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
beValid(validChunk);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
test('validates transaction chunk arrays', () => {
|
|
99
|
-
const userId = id();
|
|
100
|
-
const postId = id();
|
|
101
|
-
const chunks = [
|
|
102
|
-
tx.users[userId].create({ name: 'John', email: 'john@example.com' }),
|
|
103
|
-
tx.posts[postId].create({ title: 'Hello', body: 'World' }),
|
|
104
|
-
];
|
|
105
|
-
|
|
106
|
-
beValid(chunks);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
test('validates create operations', () => {
|
|
110
|
-
const userId = id();
|
|
111
|
-
|
|
112
|
-
// Valid create
|
|
113
|
-
beValid(tx.users[userId].create({ name: 'John', email: 'john@example.com' }));
|
|
114
|
-
|
|
115
|
-
// Valid create with optional field
|
|
116
|
-
beValid(
|
|
117
|
-
tx.users[userId].create({
|
|
118
|
-
name: 'John',
|
|
119
|
-
email: 'john@example.com',
|
|
120
|
-
bio: 'Developer',
|
|
121
|
-
}),
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
// Valid create with any type
|
|
125
|
-
beValid(
|
|
126
|
-
tx.users[userId].create({
|
|
127
|
-
name: 'John',
|
|
128
|
-
email: 'john@example.com',
|
|
129
|
-
junk: { anything: 'goes' },
|
|
130
|
-
}),
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
// Invalid create - wrong type
|
|
134
|
-
// @ts-expect-error
|
|
135
|
-
beWrong(tx.users[userId].create({ name: 123, email: 'john@example.com' }));
|
|
136
|
-
|
|
137
|
-
// Valid create - creates unknown attributes
|
|
138
|
-
beValid(
|
|
139
|
-
tx.users[userId].create({
|
|
140
|
-
name: 'John',
|
|
141
|
-
email: 'john@example.com',
|
|
142
|
-
// @ts-expect-error
|
|
143
|
-
unknownField: 'value',
|
|
144
|
-
}),
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
// Invalid create - non-object args
|
|
148
|
-
beWrong({
|
|
149
|
-
__ops: [['create', 'users', userId, 'not an object']],
|
|
150
|
-
__etype: 'users',
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
test('validates update operations', () => {
|
|
155
|
-
const userId = id();
|
|
156
|
-
|
|
157
|
-
// Valid update
|
|
158
|
-
beValid(tx.users[userId].update({ name: 'Jane' }));
|
|
159
|
-
|
|
160
|
-
// Valid update with multiple fields
|
|
161
|
-
beValid(tx.users[userId].update({ name: 'Jane', bio: 'Updated bio' }));
|
|
162
|
-
|
|
163
|
-
// Invalid update - wrong type
|
|
164
|
-
// @ts-expect-error
|
|
165
|
-
beWrong(tx.users[userId].update({ name: 123 }));
|
|
166
|
-
|
|
167
|
-
// Invalid update - unknown attribute
|
|
168
|
-
// @ts-expect-error
|
|
169
|
-
beValid(tx.users[userId].update({ unknownField: 'value' }));
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
test('validates merge operations', () => {
|
|
173
|
-
const userId = id();
|
|
174
|
-
|
|
175
|
-
// Valid merge
|
|
176
|
-
beValid(tx.users[userId].merge({ stuff: { custom: 'value' } }));
|
|
177
|
-
|
|
178
|
-
// Invalid merge - wrong type
|
|
179
|
-
beWrong(tx.users[userId].merge({ name: 123 }));
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
test('validates delete operations', () => {
|
|
183
|
-
const userId = id();
|
|
184
|
-
|
|
185
|
-
// Valid delete
|
|
186
|
-
beValid(tx.users[userId].delete());
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
test('validates link operations', () => {
|
|
190
|
-
const userId = id();
|
|
191
|
-
const postId = id();
|
|
192
|
-
|
|
193
|
-
// Valid link
|
|
194
|
-
beValid(tx.users[userId].link({ posts: postId }));
|
|
195
|
-
|
|
196
|
-
// Valid link with array
|
|
197
|
-
beValid(tx.users[userId].link({ posts: [postId, id()] }));
|
|
198
|
-
|
|
199
|
-
// Invalid link - unknown link
|
|
200
|
-
// @ts-expect-error
|
|
201
|
-
beWrong(tx.users[userId].link({ unknownLink: postId }));
|
|
202
|
-
|
|
203
|
-
// Invalid link - non-object args
|
|
204
|
-
beWrong({
|
|
205
|
-
__ops: [['link', 'users', userId, 'not an object']],
|
|
206
|
-
__etype: 'users',
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
test('validates unlink operations', () => {
|
|
211
|
-
const userId = id();
|
|
212
|
-
const postId = id();
|
|
213
|
-
|
|
214
|
-
// Valid unlink
|
|
215
|
-
beValid(tx.users[userId].unlink({ posts: postId }));
|
|
216
|
-
|
|
217
|
-
// Valid unlink with array
|
|
218
|
-
beValid(tx.users[userId].unlink({ posts: [postId, id()] }));
|
|
219
|
-
|
|
220
|
-
// Invalid unlink - unknown link
|
|
221
|
-
// @ts-expect-error
|
|
222
|
-
beWrong(tx.users[userId].unlink({ unknownLink: postId }));
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
test('validates entity existence', () => {
|
|
226
|
-
const unknownId = id();
|
|
227
|
-
|
|
228
|
-
// Invalid entity
|
|
229
|
-
beWrong({
|
|
230
|
-
__ops: [['create', 'unknownNamespace', unknownId, { field: 'value' }]],
|
|
231
|
-
__etype: 'unknownNamespace',
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
// Valid without schema
|
|
235
|
-
beValid(
|
|
236
|
-
{
|
|
237
|
-
__ops: [['create', 'unknownNamespace', unknownId, { field: 'value' }]],
|
|
238
|
-
__etype: 'unknownNamespace',
|
|
239
|
-
},
|
|
240
|
-
null,
|
|
241
|
-
);
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
test('validates attribute types', () => {
|
|
245
|
-
const userId = id();
|
|
246
|
-
|
|
247
|
-
// Valid string
|
|
248
|
-
beValid(tx.users[userId].create({ name: 'John', email: 'john@example.com' }));
|
|
249
|
-
|
|
250
|
-
// Invalid string - number
|
|
251
|
-
// @ts-expect-error
|
|
252
|
-
beWrong(tx.users[userId].create({ name: 123, email: 'john@example.com' }));
|
|
253
|
-
|
|
254
|
-
// Invalid string - boolean
|
|
255
|
-
// @ts-expect-error
|
|
256
|
-
beWrong(tx.users[userId].create({ name: true, email: 'john@example.com' }));
|
|
257
|
-
|
|
258
|
-
// Valid any type
|
|
259
|
-
beValid(
|
|
260
|
-
tx.users[userId].create({
|
|
261
|
-
name: 'John',
|
|
262
|
-
email: 'john@example.com',
|
|
263
|
-
junk: 'this is the junk type',
|
|
264
|
-
}),
|
|
265
|
-
);
|
|
266
|
-
beValid(
|
|
267
|
-
tx.users[userId].create({
|
|
268
|
-
name: 'John',
|
|
269
|
-
email: 'john@example.com',
|
|
270
|
-
junk: 123,
|
|
271
|
-
}),
|
|
272
|
-
);
|
|
273
|
-
beValid(
|
|
274
|
-
tx.users[userId].create({
|
|
275
|
-
name: 'John',
|
|
276
|
-
email: 'john@example.com',
|
|
277
|
-
junk: { complex: 'object' },
|
|
278
|
-
}),
|
|
279
|
-
);
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
test('validates transaction chunk structure', () => {
|
|
283
|
-
// Invalid chunk - not an object
|
|
284
|
-
beWrong('not an object');
|
|
285
|
-
beWrong(123);
|
|
286
|
-
beWrong(null);
|
|
287
|
-
|
|
288
|
-
// Invalid chunk - missing __ops
|
|
289
|
-
beWrong({ __etype: 'users' });
|
|
290
|
-
|
|
291
|
-
// Invalid chunk - __ops not an array
|
|
292
|
-
beWrong({ __ops: 'not an array', __etype: 'users' });
|
|
293
|
-
|
|
294
|
-
// Invalid operation - not an array
|
|
295
|
-
beWrong({ __ops: ['not an array'], __etype: 'users' });
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
test('validates operation structure', () => {
|
|
299
|
-
const userId = id();
|
|
300
|
-
|
|
301
|
-
// Invalid entity name - not a string
|
|
302
|
-
beWrong({ __ops: [['create', 123, userId, {}]], __etype: 'users' });
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
test('validates chained operations', () => {
|
|
306
|
-
const userId = id();
|
|
307
|
-
const postId = id();
|
|
308
|
-
|
|
309
|
-
// Valid chained operations
|
|
310
|
-
beValid(
|
|
311
|
-
tx.users[userId]
|
|
312
|
-
.create({ name: 'John', email: 'john@example.com' })
|
|
313
|
-
.link({ posts: postId }),
|
|
314
|
-
);
|
|
315
|
-
|
|
316
|
-
// Valid complex chain
|
|
317
|
-
beValid(
|
|
318
|
-
tx.users[userId]
|
|
319
|
-
.create({ name: 'John', email: 'john@example.com' })
|
|
320
|
-
.link({ posts: postId })
|
|
321
|
-
.update({ bio: 'Updated' }),
|
|
322
|
-
);
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
test('validates multiple entity types', () => {
|
|
326
|
-
const userId = id();
|
|
327
|
-
const postId = id();
|
|
328
|
-
const commentId = id();
|
|
329
|
-
|
|
330
|
-
const chunks = [
|
|
331
|
-
tx.users[userId].create({ name: 'John', email: 'john@example.com' }),
|
|
332
|
-
tx.posts[postId].create({ title: 'Hello', body: 'World' }),
|
|
333
|
-
tx.comments[commentId].create({ body: 'Nice post!' }),
|
|
334
|
-
tx.posts[postId].link({ comments: commentId }),
|
|
335
|
-
tx.users[userId].link({ posts: postId }),
|
|
336
|
-
];
|
|
337
|
-
|
|
338
|
-
beValid(chunks);
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
test('validates link relationships', () => {
|
|
342
|
-
const userId = id();
|
|
343
|
-
const postId = id();
|
|
344
|
-
const commentId = id();
|
|
345
|
-
|
|
346
|
-
// Valid link between users and posts
|
|
347
|
-
beValid(tx.users[userId].link({ posts: postId }));
|
|
348
|
-
|
|
349
|
-
// Valid link between posts and comments
|
|
350
|
-
beValid(tx.posts[postId].link({ comments: commentId }));
|
|
351
|
-
|
|
352
|
-
// Valid self-referential link (friendships)
|
|
353
|
-
beValid(tx.users[userId].link({ friends: id() }));
|
|
354
|
-
|
|
355
|
-
// Invalid link - no relationship exists
|
|
356
|
-
// @ts-expect-error
|
|
357
|
-
beWrong(tx.users[userId].link({ unlinkedWithAnything: id() }));
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
test('validates without schema', () => {
|
|
361
|
-
const userId = id();
|
|
362
|
-
// Should not throw without schema
|
|
363
|
-
beValid(
|
|
364
|
-
originalTx.randomEntity[userId].create({ anyField: 'anyValue' }),
|
|
365
|
-
null,
|
|
366
|
-
);
|
|
367
|
-
beValid(originalTx.randomEntity[userId].update({ anyField: 123 }), null);
|
|
368
|
-
beValid(originalTx.randomEntity[userId].link({ anyLink: id() }), null);
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
test('validates UUID format for entity IDs', () => {
|
|
372
|
-
// Valid UUID should pass
|
|
373
|
-
const validUuid = id();
|
|
374
|
-
beValid(
|
|
375
|
-
tx.users[validUuid].create({ name: 'John', email: 'john@example.com' }),
|
|
376
|
-
);
|
|
377
|
-
|
|
378
|
-
beWrong(
|
|
379
|
-
tx.users['not a valid uuid'].create({
|
|
380
|
-
name: 'John',
|
|
381
|
-
email: 'john@example.com',
|
|
382
|
-
}),
|
|
383
|
-
);
|
|
384
|
-
|
|
385
|
-
// Test for links
|
|
386
|
-
beValid(tx.users[validUuid].link({ posts: id() }));
|
|
387
|
-
beWrong(tx.users[validUuid].link({ posts: 'not-a-uuid' }));
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
test('allows lookup values in square bracket', () => {
|
|
391
|
-
beValid(
|
|
392
|
-
tx.users[lookup('email', 'john@example.net')].update({ name: 'John' }),
|
|
393
|
-
);
|
|
394
|
-
beValid(tx.users[lookup('email', 'john@example.net')].link({ posts: id() }));
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
test('allows lookup values in link', () => {
|
|
398
|
-
beValid(tx.users[id()].link({ posts: lookup('title', 'Hello') }));
|
|
399
|
-
beWrong(tx.users[id()].link({ posts: 'non lookup or uuid' }));
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
test('lookup proxy', () => {
|
|
403
|
-
const dbTx = tx.users.lookup('email', 'dsharris').update({
|
|
404
|
-
email: 'dsharris@example.com',
|
|
405
|
-
name: 'David Harris',
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
const oldVersion = tx.users[lookup('email', 'dsharris')].update({
|
|
409
|
-
email: 'dsharris@example.com',
|
|
410
|
-
name: 'David Harris',
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
expect(oldVersion).toEqual(dbTx);
|
|
414
|
-
|
|
415
|
-
const animalSchema = i.schema({
|
|
416
|
-
entities: {
|
|
417
|
-
otter: i.entity({
|
|
418
|
-
name: i.string(),
|
|
419
|
-
uniqueName: i.string().unique(),
|
|
420
|
-
uniqueDate: i.date().unique(),
|
|
421
|
-
}),
|
|
422
|
-
elephant: i.entity({
|
|
423
|
-
name: i.string(),
|
|
424
|
-
uniqueIdNumber: i.string().unique(),
|
|
425
|
-
favoriteColor: i.string(),
|
|
426
|
-
}),
|
|
427
|
-
},
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
const animalTx = originalTx as unknown as TxChunk<typeof animalSchema>;
|
|
431
|
-
|
|
432
|
-
const otterNameUnique = animalTx.otter.lookup('uniqueName', '8932');
|
|
433
|
-
// Note: doesn't allow date type, would have to do a lot of threading to implement, easier to change useDates default
|
|
434
|
-
const otterDateUnique = animalTx.otter.lookup('uniqueDate', '8932');
|
|
435
|
-
|
|
436
|
-
expect(otterNameUnique).toEqual(animalTx.otter[lookup('uniqueName', '8932')]);
|
|
437
|
-
expect(otterDateUnique).toEqual(animalTx.otter[lookup('uniqueDate', '8932')]);
|
|
438
|
-
|
|
439
|
-
const elephantIdNumberUnique = animalTx.elephant.lookup(
|
|
440
|
-
'uniqueIdNumber',
|
|
441
|
-
'1234567890',
|
|
442
|
-
);
|
|
443
|
-
|
|
444
|
-
// @ts-expect-error
|
|
445
|
-
const _invalidLookup = animalTx.elephant.lookup('favoriteColor', 'blue');
|
|
446
|
-
|
|
447
|
-
expect(elephantIdNumberUnique).toEqual(
|
|
448
|
-
animalTx.elephant[lookup('uniqueIdNumber', '1234567890')],
|
|
449
|
-
);
|
|
450
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Type testing utils from
|
|
2
|
-
// https://github.com/type-challenges/type-challenges/blob/main/utils/index.d.ts
|
|
3
|
-
|
|
4
|
-
export type Expect<T extends true> = T;
|
|
5
|
-
export type ExpectTrue<T extends true> = T;
|
|
6
|
-
export type ExpectFalse<T extends false> = T;
|
|
7
|
-
export type IsTrue<T extends true> = T;
|
|
8
|
-
export type IsFalse<T extends false> = T;
|
|
9
|
-
|
|
10
|
-
export type Equal<X, Y> =
|
|
11
|
-
(<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2
|
|
12
|
-
? true
|
|
13
|
-
: false;
|
|
14
|
-
export type NotEqual<X, Y> = true extends Equal<X, Y> ? false : true;
|
|
15
|
-
|
|
16
|
-
// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
|
|
17
|
-
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
18
|
-
export type NotAny<T> = true extends IsAny<T> ? false : true;
|
|
19
|
-
|
|
20
|
-
export type Debug<T> = { [K in keyof T]: T[K] };
|
|
21
|
-
export type MergeInsertions<T> = T extends object
|
|
22
|
-
? { [K in keyof T]: MergeInsertions<T[K]> }
|
|
23
|
-
: T;
|
|
24
|
-
|
|
25
|
-
export type Alike<X, Y> = Equal<MergeInsertions<X>, MergeInsertions<Y>>;
|
|
26
|
-
|
|
27
|
-
export type ExpectExtends<VALUE, EXPECTED> = EXPECTED extends VALUE
|
|
28
|
-
? true
|
|
29
|
-
: false;
|
|
30
|
-
export type ExpectValidArgs<
|
|
31
|
-
FUNC extends (...args: any[]) => any,
|
|
32
|
-
ARGS extends any[],
|
|
33
|
-
> = ARGS extends Parameters<FUNC> ? true : false;
|
|
34
|
-
|
|
35
|
-
export type UnionToIntersection<U> = (
|
|
36
|
-
U extends any ? (k: U) => void : never
|
|
37
|
-
) extends (k: infer I) => void
|
|
38
|
-
? I
|
|
39
|
-
: never;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { afterEach, expect, test, vi } from 'vitest';
|
|
2
|
-
import IndexedDBStorage from '../../src/IndexedDBStorage';
|
|
3
|
-
import { createDevtool } from '../../src/devtool';
|
|
4
|
-
|
|
5
|
-
afterEach(() => vi.unstubAllGlobals());
|
|
6
|
-
|
|
7
|
-
test('native browser persistence survives reopening and independent mutation deletion', async () => {
|
|
8
|
-
const appId = crypto.randomUUID();
|
|
9
|
-
const storage = new IndexedDBStorage(appId, 'mutations');
|
|
10
|
-
await storage.multiSet([
|
|
11
|
-
['a', { op: 'transact', order: 1 }],
|
|
12
|
-
['b', { op: 'transact', order: 2 }],
|
|
13
|
-
]);
|
|
14
|
-
(await storage._dbPromise)?.close();
|
|
15
|
-
const reopened = new IndexedDBStorage(appId, 'mutations');
|
|
16
|
-
expect(await reopened.getItem('a')).toEqual({ op: 'transact', order: 1 });
|
|
17
|
-
await reopened.removeItem('a');
|
|
18
|
-
expect(await reopened.getItem('a')).toBeNull();
|
|
19
|
-
expect(await reopened.getItem('b')).toEqual({ op: 'transact', order: 2 });
|
|
20
|
-
(await reopened._dbPromise)?.close();
|
|
21
|
-
indexedDB.deleteDatabase(`instant_${appId}_7`);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test('restricted browser can read and write through the memory fallback', async () => {
|
|
25
|
-
vi.stubGlobal('indexedDB', undefined);
|
|
26
|
-
const storage = new IndexedDBStorage(crypto.randomUUID(), 'mutations');
|
|
27
|
-
await storage.multiSet([['pending', { op: 'transact' }]]);
|
|
28
|
-
expect(await storage.getItem('pending')).toEqual({ op: 'transact' });
|
|
29
|
-
await storage.removeItem('pending');
|
|
30
|
-
expect(await storage.getItem('pending')).toBeNull();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('devtool opens the configured self-hosted dashboard from its actual toggle', async () => {
|
|
34
|
-
const dashURI = window.location.origin;
|
|
35
|
-
createDevtool('test-app', {
|
|
36
|
-
dashURI,
|
|
37
|
-
position: 'bottom-right',
|
|
38
|
-
allowedHosts: [window.location.hostname],
|
|
39
|
-
});
|
|
40
|
-
const toggle = document.querySelector<HTMLElement>(
|
|
41
|
-
'.backendrelay-devtool-toggler',
|
|
42
|
-
)!;
|
|
43
|
-
toggle.click();
|
|
44
|
-
const frame = document.querySelector<HTMLIFrameElement>(
|
|
45
|
-
'.backendrelay-devtool-iframe',
|
|
46
|
-
)!;
|
|
47
|
-
expect(frame.src).toBe(`${dashURI}/_devtool?appId=test-app`);
|
|
48
|
-
expect(frame.isConnected).toBe(true);
|
|
49
|
-
toggle.click();
|
|
50
|
-
expect(
|
|
51
|
-
document.querySelector<HTMLElement>('.backendrelay-devtool-container')!
|
|
52
|
-
.style.display,
|
|
53
|
-
).toBe('none');
|
|
54
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { expect, test } from 'vitest';
|
|
2
|
-
import { MutationStorage } from '../../../src/utils/MutationStorage';
|
|
3
|
-
import { META_KEY, StoreInterface } from '../../../src/utils/PersistedObject';
|
|
4
|
-
|
|
5
|
-
function fixture() {
|
|
6
|
-
const data = new Map<string, Map<string, any>>();
|
|
7
|
-
let fail = false;
|
|
8
|
-
class Storage extends StoreInterface {
|
|
9
|
-
values: Map<string, any>;
|
|
10
|
-
constructor(app: string, store: any) {
|
|
11
|
-
super(app, store);
|
|
12
|
-
const id = `${app}:${store}`;
|
|
13
|
-
if (!data.has(id)) data.set(id, new Map());
|
|
14
|
-
this.values = data.get(id)!;
|
|
15
|
-
}
|
|
16
|
-
async getItem(k: string) {
|
|
17
|
-
return this.values.get(k) ?? null;
|
|
18
|
-
}
|
|
19
|
-
async getAllKeys() {
|
|
20
|
-
return [...this.values.keys()];
|
|
21
|
-
}
|
|
22
|
-
async removeItem(k: string) {
|
|
23
|
-
this.values.delete(k);
|
|
24
|
-
}
|
|
25
|
-
async multiSet(entries: Array<[string, any]>) {
|
|
26
|
-
for (const [k, v] of entries) {
|
|
27
|
-
this.values.set(k, structuredClone(v));
|
|
28
|
-
if (fail) throw new Error('interrupted write');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
Storage,
|
|
34
|
-
setFailure: (v: boolean) => {
|
|
35
|
-
fail = v;
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
test('custom stores migrate legacy mutations before load and never restore deleted entries', async () => {
|
|
41
|
-
const { Storage } = fixture();
|
|
42
|
-
const kv = new Storage('app', 'kv');
|
|
43
|
-
const event = { op: 'transact', 'tx-steps': [], order: 1 };
|
|
44
|
-
await kv.multiSet([['pendingMutations', JSON.stringify([['event', event]])]]);
|
|
45
|
-
const first = new MutationStorage('app', Storage);
|
|
46
|
-
const second = new MutationStorage('app', Storage);
|
|
47
|
-
expect(await first.getItem('event')).toEqual(event);
|
|
48
|
-
expect(await second.getItem(META_KEY)).toMatchObject({
|
|
49
|
-
objects: { event: { size: 0 } },
|
|
50
|
-
});
|
|
51
|
-
expect(await kv.getItem('pendingMutations')).toBeNull();
|
|
52
|
-
await first.removeItem('event');
|
|
53
|
-
expect(await new MutationStorage('app', Storage).getItem('event')).toBeNull();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test('interrupted custom-store migration retains the old queue and retries without overwriting confirmations', async () => {
|
|
57
|
-
const { Storage, setFailure } = fixture();
|
|
58
|
-
const kv = new Storage('app', 'kv');
|
|
59
|
-
const entries = [
|
|
60
|
-
['a', { order: 1 }],
|
|
61
|
-
['b', { order: 2 }],
|
|
62
|
-
];
|
|
63
|
-
await kv.multiSet([['pendingMutations', entries]]);
|
|
64
|
-
setFailure(true);
|
|
65
|
-
await expect(
|
|
66
|
-
new MutationStorage('app', Storage).getAllKeys(),
|
|
67
|
-
).rejects.toThrow('interrupted');
|
|
68
|
-
expect(await kv.getItem('pendingMutations')).toEqual(entries);
|
|
69
|
-
setFailure(false);
|
|
70
|
-
await new Storage('app', 'mutations').multiSet([
|
|
71
|
-
['a', { order: 1, 'tx-id': 42 }],
|
|
72
|
-
]);
|
|
73
|
-
const retried = new MutationStorage('app', Storage);
|
|
74
|
-
expect(await retried.getItem('a')).toEqual({ order: 1, 'tx-id': 42 });
|
|
75
|
-
expect(await retried.getItem('b')).toEqual({ order: 2 });
|
|
76
|
-
expect(await kv.getItem('pendingMutations')).toBeNull();
|
|
77
|
-
});
|