@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
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
import { tx, lookup, i, id, BackendRelayAPIError, setBackendRelayWarningsEnabled, type BackendRelayIssue, type TransactionChunk, type AuthToken, type User, type Query, BackendRelayError, type BackendRelayErrorHandler, type QueryResponse, type InstaQLResponse, type InstaQLParams, type ValidQuery, type InstaQLFields, type BackendRelayQuery, type BackendRelayQueryResult, type BackendRelaySchema, type BackendRelaySchemaDatabase, type BackendRelayObject, type BackendRelayEntity, type BackwardsCompatibleSchema, type IBackendRelayDatabase, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type BackendRelayGraph, type LinkAttrDef, type LinkDef, type BackendRelayUnknownSchemaDef, type LinksDef, type RoomsOf, type RoomsDef, type PresenceOf, type RoomHandle, type ResolveAttrs, type ValueTypes, type BackendRelaySchemaDef, type BackendRelayUnknownSchema, type InstaQLEntity, type InstaQLResult, type InstaQLEntitySubquery, type BackendRelayRules, type UpdateParams, type CreateParams, type LinkParams, type RuleParams, type FileOpts, type UploadFileResponse, type DeleteFileResponse, createBackendRelayRouteHandler, type BackendRelayRouteHandlerPayloadByType, type BackendRelayRouteHandlerType, type BackendRelayRouteHandlerBody, BackendRelayStream, type WritableStreamCtor, type ReadableStreamCtor, BackendRelayWritableStream, BackendRelayReadableStream, type Logger } from '@backendrelay/core';
|
|
2
|
+
import { SubscribeQueryCallback, SubscribeQueryResponse, SubscribeQueryPayload, SubscriptionReadyState } from './subscribe.ts';
|
|
3
|
+
import { Webhooks, WebhooksManager, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams } from '@backendrelay/webhooks';
|
|
4
|
+
type DebugCheckResult = {
|
|
5
|
+
/** The ID of the record. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The namespace/table of the record. */
|
|
8
|
+
entity: string;
|
|
9
|
+
/** The value of the record. */
|
|
10
|
+
record: Record<string, any>;
|
|
11
|
+
/** The result of evaluating the corresponding permissions rule for a record. */
|
|
12
|
+
check: any;
|
|
13
|
+
};
|
|
14
|
+
type Config = {
|
|
15
|
+
appId: string;
|
|
16
|
+
adminToken?: string;
|
|
17
|
+
apiURI?: string;
|
|
18
|
+
useDateObjects?: boolean;
|
|
19
|
+
disableValidation?: boolean;
|
|
20
|
+
verbose?: boolean;
|
|
21
|
+
logger?: Logger;
|
|
22
|
+
onError?: BackendRelayErrorHandler;
|
|
23
|
+
/** Correlation ID sent as `x-request-id` on admin requests. */
|
|
24
|
+
requestId?: string;
|
|
25
|
+
};
|
|
26
|
+
export type BackendRelayConfig<Schema extends BackendRelaySchemaDef<any, any, any>, UseDates extends boolean = false> = {
|
|
27
|
+
appId: string;
|
|
28
|
+
adminToken?: string;
|
|
29
|
+
apiURI?: string;
|
|
30
|
+
schema?: Schema;
|
|
31
|
+
useDateObjects: UseDates;
|
|
32
|
+
disableValidation?: boolean;
|
|
33
|
+
verbose?: boolean;
|
|
34
|
+
logger?: Logger;
|
|
35
|
+
onError?: BackendRelayErrorHandler;
|
|
36
|
+
WritableStream?: WritableStreamCtor;
|
|
37
|
+
ReadableStream?: ReadableStreamCtor;
|
|
38
|
+
/** Correlation ID sent as `x-request-id` on admin requests. */
|
|
39
|
+
requestId?: string;
|
|
40
|
+
};
|
|
41
|
+
type BackendRelayConfigFilled<Schema extends BackendRelaySchemaDef<any, any, any>, UseDates extends boolean> = BackendRelayConfig<Schema, UseDates> & {
|
|
42
|
+
apiURI: string;
|
|
43
|
+
};
|
|
44
|
+
type FilledConfig = Config & {
|
|
45
|
+
apiURI: string;
|
|
46
|
+
};
|
|
47
|
+
type ImpersonationOpts = {
|
|
48
|
+
email: string;
|
|
49
|
+
} | {
|
|
50
|
+
token: AuthToken;
|
|
51
|
+
} | {
|
|
52
|
+
guest: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type HatchetCredentials = {
|
|
55
|
+
url: string;
|
|
56
|
+
grpc_url: string;
|
|
57
|
+
dashboard_url: string;
|
|
58
|
+
tenant_id: string;
|
|
59
|
+
token: string;
|
|
60
|
+
};
|
|
61
|
+
type DebugTransactResult = {
|
|
62
|
+
'tx-id': number;
|
|
63
|
+
'all-checks-ok?': boolean;
|
|
64
|
+
};
|
|
65
|
+
export type AdminTransactResult = {
|
|
66
|
+
'tx-id': number;
|
|
67
|
+
};
|
|
68
|
+
/** A server-side assertion evaluated before an admin transaction writes. */
|
|
69
|
+
export type AdminTransactionCondition = ['equals', string, string, string, any] | ['exists', string, string] | ['not-exists', string, string] | [
|
|
70
|
+
'count',
|
|
71
|
+
string,
|
|
72
|
+
Record<string, any>,
|
|
73
|
+
'<' | '<=' | '>' | '>=' | '==' | '!=',
|
|
74
|
+
number
|
|
75
|
+
];
|
|
76
|
+
/** An atomic numeric increment applied with the admin transaction. */
|
|
77
|
+
export type AdminTransactionIncrement = [string, string, string, number];
|
|
78
|
+
/**
|
|
79
|
+
* Admin-only preconditions. They run in the same PostgreSQL transaction as the
|
|
80
|
+
* writes; a failed assertion rolls the whole transaction back.
|
|
81
|
+
*/
|
|
82
|
+
export type AdminTransactionConditions = {
|
|
83
|
+
assert?: AdminTransactionCondition[];
|
|
84
|
+
increment?: AdminTransactionIncrement[];
|
|
85
|
+
};
|
|
86
|
+
export type AdminFunctionLog = {
|
|
87
|
+
function: string;
|
|
88
|
+
level: string;
|
|
89
|
+
message: string;
|
|
90
|
+
data?: any;
|
|
91
|
+
};
|
|
92
|
+
export type AdminTrace = {
|
|
93
|
+
requestId: string;
|
|
94
|
+
transactions: any[];
|
|
95
|
+
logs: any[];
|
|
96
|
+
webhooks: any[];
|
|
97
|
+
};
|
|
98
|
+
export type AdminAggregateParams = {
|
|
99
|
+
etype: string;
|
|
100
|
+
filters?: Record<string, any>;
|
|
101
|
+
groupBy?: string;
|
|
102
|
+
field?: string;
|
|
103
|
+
sum?: boolean;
|
|
104
|
+
avg?: boolean;
|
|
105
|
+
min?: boolean;
|
|
106
|
+
max?: boolean;
|
|
107
|
+
};
|
|
108
|
+
export type AdminNearestParams = {
|
|
109
|
+
etype: string;
|
|
110
|
+
attr: string;
|
|
111
|
+
vector: number[];
|
|
112
|
+
limit?: number;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* The first step: init your application!
|
|
117
|
+
*
|
|
118
|
+
* Visit your BackendRelay dashboard to get your `appId` and `adminToken`, and
|
|
119
|
+
* pass the API origin as `apiURI` :) The admin SDK no longer defaults to
|
|
120
|
+
* backendrelay.com.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* import { init } from "@backendrelay/admin"
|
|
124
|
+
*
|
|
125
|
+
* const db = init({
|
|
126
|
+
* appId: process.env.BACKENDRELAY_APP_ID!,
|
|
127
|
+
* adminToken: process.env.BACKENDRELAY_APP_ADMIN_TOKEN,
|
|
128
|
+
* apiURI: process.env.BACKENDRELAY_API_URI!,
|
|
129
|
+
* })
|
|
130
|
+
*
|
|
131
|
+
* // You can also provide a schema for type safety and editor autocomplete!
|
|
132
|
+
*
|
|
133
|
+
* import { init } from "@backendrelay/admin"
|
|
134
|
+
* import schema from ""../backendrelay.schema.ts";
|
|
135
|
+
*
|
|
136
|
+
* const db = init({
|
|
137
|
+
* appId: process.env.BACKENDRELAY_APP_ID!,
|
|
138
|
+
* adminToken: process.env.BACKENDRELAY_APP_ADMIN_TOKEN,
|
|
139
|
+
* apiURI: process.env.BACKENDRELAY_API_URI!,
|
|
140
|
+
* schema,
|
|
141
|
+
* })
|
|
142
|
+
*/
|
|
143
|
+
declare function init<Schema extends BackendRelaySchemaDef<any, any, any> = BackendRelayUnknownSchema, UseDates extends boolean = false>(config: Omit<BackendRelayConfig<Schema, UseDates>, 'useDateObjects'> & {
|
|
144
|
+
useDateObjects?: UseDates;
|
|
145
|
+
}): BackendRelayAdminDatabase<Schema, UseDates, BackendRelayConfig<Schema, UseDates>>;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated
|
|
148
|
+
* `init_experimental` is deprecated. You can replace it with `init`.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
*
|
|
152
|
+
* // Before
|
|
153
|
+
* import { init_experimental } from "@backendrelay/admin"
|
|
154
|
+
* const db = init_experimental({ ... });
|
|
155
|
+
*
|
|
156
|
+
* // After
|
|
157
|
+
* import { init } from "@backendrelay/admin"
|
|
158
|
+
* const db = init({ ... });
|
|
159
|
+
*/
|
|
160
|
+
declare const init_experimental: typeof init;
|
|
161
|
+
type PresenceResult<Data> = {
|
|
162
|
+
[peerId: string]: {
|
|
163
|
+
data: Data;
|
|
164
|
+
'peer-id': string;
|
|
165
|
+
user: User | null;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
declare class Rooms<Schema extends BackendRelaySchemaDef<any, any, any>> {
|
|
169
|
+
config: FilledConfig;
|
|
170
|
+
_fetch: (input: RequestInfo, init?: RequestInit) => Promise<any>;
|
|
171
|
+
constructor(config: FilledConfig);
|
|
172
|
+
getPresence<RoomType extends string & keyof RoomsOf<Schema>>(roomType: RoomType, roomId: string): Promise<PresenceResult<PresenceOf<Schema, RoomType>>>;
|
|
173
|
+
}
|
|
174
|
+
declare class Auth<Schema extends BackendRelaySchemaDef<any, any, any>> {
|
|
175
|
+
config: FilledConfig;
|
|
176
|
+
_fetch: (input: RequestInfo, init?: RequestInit) => Promise<any>;
|
|
177
|
+
constructor(config: FilledConfig);
|
|
178
|
+
/**
|
|
179
|
+
* Generates a magic code for the user with the given email.
|
|
180
|
+
* This is useful if you want to use your own email provider
|
|
181
|
+
* to send magic codes.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* // Generate a magic code
|
|
185
|
+
* const { code } = await db.auth.generateMagicCode({ email })
|
|
186
|
+
* // Send the magic code to the user with your own email provider
|
|
187
|
+
* await customEmailProvider.sendMagicCode(email, code)
|
|
188
|
+
*
|
|
189
|
+
* @see https://backendrelay.com/docs/backend#custom-magic-codes
|
|
190
|
+
*/
|
|
191
|
+
generateMagicCode: (email: string) => Promise<{
|
|
192
|
+
code: string;
|
|
193
|
+
}>;
|
|
194
|
+
/**
|
|
195
|
+
* Sends a magic code to the user with the given email.
|
|
196
|
+
* This uses BackendRelay's built-in email provider.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* // Send an email to user with magic code
|
|
200
|
+
* await db.auth.sendMagicCode({ email })
|
|
201
|
+
*
|
|
202
|
+
* @see https://backendrelay.com/docs/backend#custom-magic-codes
|
|
203
|
+
*/
|
|
204
|
+
sendMagicCode: (email: string) => Promise<{
|
|
205
|
+
code: string;
|
|
206
|
+
}>;
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated Use {@link checkMagicCode} instead to get the `created` field
|
|
209
|
+
* and support `extraFields`.
|
|
210
|
+
*
|
|
211
|
+
* @see https://backendrelay.com/docs/backend#custom-magic-codes
|
|
212
|
+
*/
|
|
213
|
+
verifyMagicCode: (email: string, code: string) => Promise<User>;
|
|
214
|
+
/**
|
|
215
|
+
* Verifies a magic code and returns the user along with whether
|
|
216
|
+
* the user was newly created. Supports `extraFields` to set custom
|
|
217
|
+
* `$users` properties at signup.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* const { user, created } = await db.auth.checkMagicCode(
|
|
221
|
+
* email,
|
|
222
|
+
* code,
|
|
223
|
+
* { extraFields: { nickname: 'ari' } },
|
|
224
|
+
* );
|
|
225
|
+
*
|
|
226
|
+
* @see https://backendrelay.com/docs/backend#custom-magic-codes
|
|
227
|
+
*/
|
|
228
|
+
checkMagicCode: (email: string, code: string, options?: {
|
|
229
|
+
extraFields?: UpdateParams<Schema, "$users">;
|
|
230
|
+
}) => Promise<{
|
|
231
|
+
user: User;
|
|
232
|
+
created: boolean;
|
|
233
|
+
}>;
|
|
234
|
+
/**
|
|
235
|
+
* Creates a login token for the user with the given email.
|
|
236
|
+
* If that user does not exist, we create one.
|
|
237
|
+
*
|
|
238
|
+
* This is often useful for writing custom auth flows.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* app.post('/custom_sign_in', async (req, res) => {
|
|
242
|
+
* // ... your custom flow for users
|
|
243
|
+
* const token = await db.auth.createToken({ email })
|
|
244
|
+
* return res.status(200).send({ token })
|
|
245
|
+
* })
|
|
246
|
+
*
|
|
247
|
+
* @see https://backendrelay.com/docs/backend#custom-auth
|
|
248
|
+
*/
|
|
249
|
+
createToken(email: {
|
|
250
|
+
email: string;
|
|
251
|
+
} | {
|
|
252
|
+
id: string;
|
|
253
|
+
}): Promise<AuthToken>;
|
|
254
|
+
/**
|
|
255
|
+
*
|
|
256
|
+
* @deprecated Passing an email string directly is deprecated.
|
|
257
|
+
*
|
|
258
|
+
* Use an object with the `email` key instead.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* // Before
|
|
262
|
+
* const token = await auth.createToken(email)
|
|
263
|
+
* // After
|
|
264
|
+
* const token = await auth.createToken({ email })
|
|
265
|
+
*/
|
|
266
|
+
createToken(email: string): Promise<AuthToken>;
|
|
267
|
+
/**
|
|
268
|
+
* Verifies a given token and returns the associated user.
|
|
269
|
+
*
|
|
270
|
+
* This is often useful for writing custom endpoints, where you need
|
|
271
|
+
* to authenticate users.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* app.post('/custom_endpoint', async (req, res) => {
|
|
275
|
+
* const user = await db.auth.verifyToken(req.headers['token'])
|
|
276
|
+
* if (!user) {
|
|
277
|
+
* return res.status(401).send('Uh oh, you are not authenticated')
|
|
278
|
+
* }
|
|
279
|
+
* // ...
|
|
280
|
+
* })
|
|
281
|
+
* @see https://backendrelay.com/docs/backend#custom-endpoints
|
|
282
|
+
*/
|
|
283
|
+
verifyToken: (token: AuthToken) => Promise<User>;
|
|
284
|
+
/**
|
|
285
|
+
* Retrieves an app user by id, email, or refresh token.
|
|
286
|
+
* Resolves to `null` when no user matches; throws on malformed
|
|
287
|
+
* input or auth errors.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* const user = await db.auth.getUser({ email });
|
|
291
|
+
* if (!user) {
|
|
292
|
+
* console.log("No user found");
|
|
293
|
+
* return;
|
|
294
|
+
* }
|
|
295
|
+
* console.log("Found user:", user);
|
|
296
|
+
*
|
|
297
|
+
* @see https://backendrelay.com/docs/backend#retrieve-a-user
|
|
298
|
+
*/
|
|
299
|
+
getUser: (params: {
|
|
300
|
+
email: string;
|
|
301
|
+
} | {
|
|
302
|
+
id: string;
|
|
303
|
+
} | {
|
|
304
|
+
refresh_token: string;
|
|
305
|
+
}) => Promise<Omit<User, "refresh_token"> | null>;
|
|
306
|
+
/**
|
|
307
|
+
* Deletes an app user by id, email, or refresh token.
|
|
308
|
+
* Resolves to `null` when no user matches; throws on malformed
|
|
309
|
+
* input or auth errors.
|
|
310
|
+
*
|
|
311
|
+
* NB: This _only_ deletes the user; it does not delete all user data.
|
|
312
|
+
* You will need to handle this manually.
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* const deletedUser = await db.auth.deleteUser({ email });
|
|
316
|
+
* if (!deletedUser) {
|
|
317
|
+
* console.log("No user found to delete");
|
|
318
|
+
* return;
|
|
319
|
+
* }
|
|
320
|
+
* console.log("Deleted user:", deletedUser);
|
|
321
|
+
*
|
|
322
|
+
* @see https://backendrelay.com/docs/backend#delete-a-user
|
|
323
|
+
*/
|
|
324
|
+
deleteUser: (params: {
|
|
325
|
+
email: string;
|
|
326
|
+
} | {
|
|
327
|
+
id: string;
|
|
328
|
+
} | {
|
|
329
|
+
refresh_token: string;
|
|
330
|
+
}) => Promise<User | null>;
|
|
331
|
+
/**
|
|
332
|
+
* Signs out the user with the given email.
|
|
333
|
+
* This invalidates any tokens associated with the user.
|
|
334
|
+
* If the user is not found, an error will be thrown.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* try {
|
|
338
|
+
* await auth.signOut({ email: "alyssa_p_hacker@backendrelay.com" });
|
|
339
|
+
* console.log("Successfully signed out");
|
|
340
|
+
* } catch (err) {
|
|
341
|
+
* console.error("Sign out failed:", err.message);
|
|
342
|
+
* }
|
|
343
|
+
*
|
|
344
|
+
* @see https://backendrelay.com/docs/backend#sign-out
|
|
345
|
+
*/
|
|
346
|
+
signOut(params: {
|
|
347
|
+
email: string;
|
|
348
|
+
} | {
|
|
349
|
+
id: string;
|
|
350
|
+
} | {
|
|
351
|
+
refresh_token: string;
|
|
352
|
+
}): Promise<void>;
|
|
353
|
+
/**
|
|
354
|
+
* @deprecated Passing an email string directly is deprecated.
|
|
355
|
+
* Use an object with the `email` key instead.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* // Before
|
|
359
|
+
* auth.signOut(email)
|
|
360
|
+
*
|
|
361
|
+
* // After
|
|
362
|
+
* auth.signOut({ email })
|
|
363
|
+
*/
|
|
364
|
+
signOut(email: string): Promise<void>;
|
|
365
|
+
/**
|
|
366
|
+
* Get instant user from Request
|
|
367
|
+
*
|
|
368
|
+
* Reads cookies and gets a validated user
|
|
369
|
+
* @param req The request containing a cookie synced with createBackendRelayRouteHandler
|
|
370
|
+
* @param opts Allow disabling validation of refresh token
|
|
371
|
+
*/
|
|
372
|
+
getUserFromRequest: (req: Request, opts?: {
|
|
373
|
+
disableValidation?: boolean;
|
|
374
|
+
}) => Promise<User | null>;
|
|
375
|
+
}
|
|
376
|
+
type StorageFile = {
|
|
377
|
+
key: string;
|
|
378
|
+
name: string;
|
|
379
|
+
size: number;
|
|
380
|
+
etag: string;
|
|
381
|
+
last_modified: number;
|
|
382
|
+
};
|
|
383
|
+
type DeleteManyFileResponse = {
|
|
384
|
+
data: {
|
|
385
|
+
ids: string[] | null;
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* The part of a Node.js `Readable` the SDK uses for streamed uploads.
|
|
390
|
+
*
|
|
391
|
+
* Declared structurally instead of importing `node:stream` so the published
|
|
392
|
+
* types do not require `@types/node`, which edge runtimes do not install.
|
|
393
|
+
*/
|
|
394
|
+
type NodeReadableStream = {
|
|
395
|
+
pipe: (...args: any[]) => unknown;
|
|
396
|
+
read: (...args: any[]) => unknown;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Functions to manage file storage.
|
|
400
|
+
*/
|
|
401
|
+
declare class Storage {
|
|
402
|
+
config: FilledConfig;
|
|
403
|
+
impersonationOpts?: ImpersonationOpts;
|
|
404
|
+
_fetch: (input: RequestInfo, init?: RequestInit) => Promise<any>;
|
|
405
|
+
constructor(config: FilledConfig, impersonationOpts?: ImpersonationOpts);
|
|
406
|
+
/**
|
|
407
|
+
* Uploads file at the provided path. Accepts bytes (`Uint8Array`, including
|
|
408
|
+
* Node's `Buffer`), a Node `Readable`, or a web `ReadableStream`.
|
|
409
|
+
*
|
|
410
|
+
* @see https://backendrelay.com/docs/storage
|
|
411
|
+
* @example
|
|
412
|
+
* const buffer = fs.readFileSync('demo.png');
|
|
413
|
+
* const isSuccess = await db.storage.uploadFile('photos/demo.png', buffer);
|
|
414
|
+
*/
|
|
415
|
+
uploadFile: (path: string, file: NodeReadableStream | ReadableStream | Uint8Array, metadata?: FileOpts) => Promise<UploadFileResponse>;
|
|
416
|
+
/**
|
|
417
|
+
* Deletes a file by its path name (e.g. "photos/demo.png").
|
|
418
|
+
*
|
|
419
|
+
* @deprecated Use `db.transact` to delete files instead:
|
|
420
|
+
* @example
|
|
421
|
+
* // Delete by id
|
|
422
|
+
* await db.transact(db.tx.$files[fileId].delete());
|
|
423
|
+
*
|
|
424
|
+
* // Delete by path
|
|
425
|
+
* await db.transact(db.tx.$files[lookup('path', 'photos/demo.png')].delete());
|
|
426
|
+
*
|
|
427
|
+
* @see https://backendrelay.com/docs/storage
|
|
428
|
+
*/
|
|
429
|
+
delete: (pathname: string) => Promise<DeleteFileResponse>;
|
|
430
|
+
/**
|
|
431
|
+
* Deletes multiple files by their path names.
|
|
432
|
+
*
|
|
433
|
+
* @deprecated Use `db.transact` to delete files instead:
|
|
434
|
+
* @example
|
|
435
|
+
* // Delete multiple files by path
|
|
436
|
+
* const paths = ['images/1.png', 'images/2.png', 'images/3.png'];
|
|
437
|
+
* await db.transact(paths.map(p => db.tx.$files[lookup('path', p)].delete()));
|
|
438
|
+
*
|
|
439
|
+
* @see https://backendrelay.com/docs/storage
|
|
440
|
+
*/
|
|
441
|
+
deleteMany: (pathnames: string[]) => Promise<DeleteManyFileResponse>;
|
|
442
|
+
/**
|
|
443
|
+
* @deprecated. This method will be removed in the future. Use `uploadFile`
|
|
444
|
+
* instead
|
|
445
|
+
*/
|
|
446
|
+
upload: (pathname: string, file: Uint8Array, metadata?: FileOpts) => Promise<boolean>;
|
|
447
|
+
/**
|
|
448
|
+
* @deprecated. This method will be removed in the future. Use `query` instead
|
|
449
|
+
* @example
|
|
450
|
+
* const files = await db.query({ $files: {}})
|
|
451
|
+
*/
|
|
452
|
+
list: () => Promise<StorageFile[]>;
|
|
453
|
+
/**
|
|
454
|
+
* @deprecated. getDownloadUrl will be removed in the future.
|
|
455
|
+
* Use `query` instead to query and fetch for valid urls
|
|
456
|
+
*
|
|
457
|
+
* db.useQuery({
|
|
458
|
+
* $files: {
|
|
459
|
+
* $: {
|
|
460
|
+
* where: {
|
|
461
|
+
* path: "moop.png"
|
|
462
|
+
* }
|
|
463
|
+
* }
|
|
464
|
+
* }
|
|
465
|
+
* })
|
|
466
|
+
*/
|
|
467
|
+
getDownloadUrl: (pathname: string) => Promise<string>;
|
|
468
|
+
}
|
|
469
|
+
type CreateReadStreamOpts = {
|
|
470
|
+
clientId?: string | null | undefined;
|
|
471
|
+
streamId?: string | null | undefined;
|
|
472
|
+
byteOffset?: number | null | undefined;
|
|
473
|
+
ruleParams?: RuleParams | null | undefined;
|
|
474
|
+
};
|
|
475
|
+
type CreateWriteStreamOpts = {
|
|
476
|
+
clientId: string;
|
|
477
|
+
/**
|
|
478
|
+
* A function that takes a promise and ensures that the current program stays alive
|
|
479
|
+
* until the promise is resolved.
|
|
480
|
+
*
|
|
481
|
+
* Useful in serverless environments to ensure the writer fully flushes before the
|
|
482
|
+
* environment is shut down.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* import { after } from 'next/server'
|
|
486
|
+
* db.streams.createWriteStream({clientId, waitUntil: after})
|
|
487
|
+
*/
|
|
488
|
+
waitUntil?: (promise: Promise<any>) => void | null | undefined;
|
|
489
|
+
ruleParams?: RuleParams | null | undefined;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* Functions to manage streams.
|
|
493
|
+
*/
|
|
494
|
+
declare class Streams {
|
|
495
|
+
#private;
|
|
496
|
+
constructor(ensureBackendRelayStream: () => BackendRelayStream);
|
|
497
|
+
/**
|
|
498
|
+
* Creates a new ReadableStream for the given clientId.
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* const stream = db.streams.createReadStream({clientId: clientId})
|
|
502
|
+
* for await (const chunk of stream) {
|
|
503
|
+
* console.log(chunk);
|
|
504
|
+
* }
|
|
505
|
+
*/
|
|
506
|
+
createReadStream: (opts: CreateReadStreamOpts) => BackendRelayReadableStream<string>;
|
|
507
|
+
/**
|
|
508
|
+
* Creates a new WritableStream for the given clientId.
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* const writeStream = db.streams.createWriteStream({clientId: clientId})
|
|
512
|
+
* const writer = writeStream.getWriter();
|
|
513
|
+
* writer.write('Hello world');
|
|
514
|
+
* writer.close();
|
|
515
|
+
*/
|
|
516
|
+
createWriteStream: (opts: CreateWriteStreamOpts) => BackendRelayWritableStream<string>;
|
|
517
|
+
}
|
|
518
|
+
type AdminQueryOpts = {
|
|
519
|
+
ruleParams?: RuleParams;
|
|
520
|
+
fetchOpts?: RequestInit;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
*
|
|
524
|
+
* The first step: init your application!
|
|
525
|
+
*
|
|
526
|
+
* Visit your BackendRelay dashboard to get your `appId` and `adminToken`, and
|
|
527
|
+
* pass the API origin as `apiURI` :) The admin SDK no longer defaults to
|
|
528
|
+
* backendrelay.com.
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* const db = init({ appId: "my-app-id", adminToken: "my-admin-token", apiURI: "https://api.example.com" })
|
|
532
|
+
*/
|
|
533
|
+
declare class BackendRelayAdminDatabase<Schema extends BackendRelaySchemaDef<any, any, any>, UseDates extends boolean = false, Config extends BackendRelayConfig<Schema, UseDates> = BackendRelayConfig<Schema, UseDates>> {
|
|
534
|
+
#private;
|
|
535
|
+
config: BackendRelayConfigFilled<Schema, UseDates>;
|
|
536
|
+
auth: Auth<Schema>;
|
|
537
|
+
storage: Storage;
|
|
538
|
+
streams: Streams;
|
|
539
|
+
rooms: Rooms<Schema>;
|
|
540
|
+
impersonationOpts?: ImpersonationOpts;
|
|
541
|
+
webhooks: Webhooks<Schema>;
|
|
542
|
+
hatchet: {
|
|
543
|
+
credentials: () => Promise<{
|
|
544
|
+
hatchet: HatchetCredentials;
|
|
545
|
+
}>;
|
|
546
|
+
};
|
|
547
|
+
_fetch: (input: RequestInfo, init?: RequestInit) => Promise<any>;
|
|
548
|
+
tx: import("@backendrelay/core").TxChunk<NonNullable<Schema>>;
|
|
549
|
+
constructor(_config: Config);
|
|
550
|
+
/**
|
|
551
|
+
* Sometimes you want to scope queries to a specific user.
|
|
552
|
+
*
|
|
553
|
+
* You can provide a user's auth token, email, or impersonate a guest.
|
|
554
|
+
*
|
|
555
|
+
* @see https://backendrelay.com/docs/backend#impersonating-users
|
|
556
|
+
* @example
|
|
557
|
+
* await db.asUser({email: "stopa@backendrelay.com"}).query({ goals: {} })
|
|
558
|
+
*/
|
|
559
|
+
asUser: (opts: ImpersonationOpts) => BackendRelayAdminDatabase<Schema, UseDates, Config>;
|
|
560
|
+
/**
|
|
561
|
+
* Use this to query your data!
|
|
562
|
+
*
|
|
563
|
+
* @see https://backendrelay.com/docs/instaql
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* // fetch all goals
|
|
567
|
+
* await db.query({ goals: {} })
|
|
568
|
+
*
|
|
569
|
+
* // goals where the title is "Get Fit"
|
|
570
|
+
* await db.query({ goals: { $: { where: { title: "Get Fit" } } } })
|
|
571
|
+
*
|
|
572
|
+
* // all goals, _alongside_ their todos
|
|
573
|
+
* await db.query({ goals: { todos: {} } })
|
|
574
|
+
*/
|
|
575
|
+
query: <Q extends ValidQuery<Q, Schema>>(query: Q, opts?: AdminQueryOpts) => Promise<InstaQLResponse<Schema, Q, UseDates>>;
|
|
576
|
+
/**
|
|
577
|
+
* Returns the current version counter for each entity id, defaulting to 0.
|
|
578
|
+
*
|
|
579
|
+
* Pass the versions returned here as `conditions.assert` version checks when
|
|
580
|
+
* another request writes the same entities.
|
|
581
|
+
*/
|
|
582
|
+
versions: (entityIds: string[]) => Promise<Record<string, number>>;
|
|
583
|
+
/**
|
|
584
|
+
* Writes function log lines for a request. The functions runtime calls this
|
|
585
|
+
* with `ctx.log` output and the inbound `x-request-id`.
|
|
586
|
+
*/
|
|
587
|
+
log: (entries: AdminFunctionLog[], requestId?: string | null) => Promise<void>;
|
|
588
|
+
/** Returns the transactions, logs and webhook events for one request id. */
|
|
589
|
+
trace: (requestId: string) => Promise<AdminTrace>;
|
|
590
|
+
/**
|
|
591
|
+
* Runs count/sum/avg/min/max over one entity type, optionally grouped by an
|
|
592
|
+
* attribute. Aggregates are admin-only because per-record rules are not
|
|
593
|
+
* evaluated inside SQL aggregates.
|
|
594
|
+
*/
|
|
595
|
+
aggregate: (params: AdminAggregateParams) => Promise<{
|
|
596
|
+
rows: any[];
|
|
597
|
+
}>;
|
|
598
|
+
/**
|
|
599
|
+
* Returns the nearest vectors for an attribute. Requires the pgvector
|
|
600
|
+
* extension on the database. Admin-only for the same reason as aggregate.
|
|
601
|
+
*/
|
|
602
|
+
nearest: (params: AdminNearestParams) => Promise<{
|
|
603
|
+
rows: any[];
|
|
604
|
+
}>;
|
|
605
|
+
/**
|
|
606
|
+
* Use this to to get a live view of your data!
|
|
607
|
+
*
|
|
608
|
+
* @see https://www.backendrelay.com/docs/backend
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* // create a subscription to a query
|
|
612
|
+
* const query = { goals: { $: { where: { title: "Get Fit" } } } }
|
|
613
|
+
* const sub = db.subscribeQuery(query);
|
|
614
|
+
*
|
|
615
|
+
* // iterate through the results with an async iterator
|
|
616
|
+
* for await (const payload of sub) {
|
|
617
|
+
* if (payload.error) {
|
|
618
|
+
* console.log(payload.error);
|
|
619
|
+
* // Stop the subscription
|
|
620
|
+
* sub.close();
|
|
621
|
+
* } else {
|
|
622
|
+
* console.log(payload.data);
|
|
623
|
+
* }
|
|
624
|
+
* }
|
|
625
|
+
*
|
|
626
|
+
* // Stop the subscription
|
|
627
|
+
* sub.close();
|
|
628
|
+
*
|
|
629
|
+
* // Create a subscription with a callback
|
|
630
|
+
* const sub = db.subscribeQuery(query, (payload) => {
|
|
631
|
+
* if (payload.error) {
|
|
632
|
+
* console.log(payload.error);
|
|
633
|
+
* // Stop the subscription
|
|
634
|
+
* sub.close();
|
|
635
|
+
* } else {
|
|
636
|
+
* console.log(payload.data);
|
|
637
|
+
* }
|
|
638
|
+
* });
|
|
639
|
+
*/
|
|
640
|
+
subscribeQuery<Q extends ValidQuery<Q, Schema>>(query: Q, cb?: SubscribeQueryCallback<Schema, Q, UseDates>, opts?: AdminQueryOpts): SubscribeQueryResponse<Schema, Q, UseDates>;
|
|
641
|
+
/**
|
|
642
|
+
* Use this to write data! You can create, update, delete, and link objects
|
|
643
|
+
*
|
|
644
|
+
* @see https://backendrelay.com/docs/instaml
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* // Create a new object in the `goals` namespace
|
|
648
|
+
* const goalId = id();
|
|
649
|
+
* db.transact(db.tx.goals[goalId].update({title: "Get fit"}))
|
|
650
|
+
*
|
|
651
|
+
* // Update the title
|
|
652
|
+
* db.transact(db.tx.goals[goalId].update({title: "Get super fit"}))
|
|
653
|
+
*
|
|
654
|
+
* // Delete it
|
|
655
|
+
* db.transact(db.tx.goals[goalId].delete())
|
|
656
|
+
*
|
|
657
|
+
* // Or create an association:
|
|
658
|
+
* todoId = id();
|
|
659
|
+
* db.transact([
|
|
660
|
+
* db.tx.todos[todoId].update({ title: 'Go on a run' }),
|
|
661
|
+
* db.tx.goals[goalId].link({todos: todoId}),
|
|
662
|
+
* ])
|
|
663
|
+
*/
|
|
664
|
+
transact: (inputChunks: TransactionChunk<any, any> | TransactionChunk<any, any>[], options?: {
|
|
665
|
+
conditions?: AdminTransactionConditions;
|
|
666
|
+
}) => Promise<AdminTransactResult>;
|
|
667
|
+
/**
|
|
668
|
+
* Like `query`, but returns debugging information
|
|
669
|
+
* for permissions checks along with the result.
|
|
670
|
+
* Useful for inspecting the values returned by the permissions checks.
|
|
671
|
+
* Note, this will return debug information for *all* entities
|
|
672
|
+
* that match the query's `where` clauses.
|
|
673
|
+
*
|
|
674
|
+
* Requires a user/guest context to be set with `asUser`,
|
|
675
|
+
* since permissions checks are user-specific.
|
|
676
|
+
*
|
|
677
|
+
* Accepts an optional configuration object with a `rules` key.
|
|
678
|
+
* The provided rules will override the rules in the database for the query.
|
|
679
|
+
*
|
|
680
|
+
* @see https://backendrelay.com/docs/instaql
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* await db.asUser({ guest: true }).debugQuery(
|
|
684
|
+
* { goals: {} },
|
|
685
|
+
* { rules: { goals: { allow: { read: "auth.id != null" } } }
|
|
686
|
+
* )
|
|
687
|
+
*/
|
|
688
|
+
debugQuery: <Q extends ValidQuery<Q, Schema>>(query: Q, opts?: {
|
|
689
|
+
rules?: any;
|
|
690
|
+
ruleParams?: {
|
|
691
|
+
[key: string]: any;
|
|
692
|
+
};
|
|
693
|
+
ip?: string | null | undefined;
|
|
694
|
+
origin?: string | null | undefined;
|
|
695
|
+
cardinalityInference?: boolean;
|
|
696
|
+
}) => Promise<{
|
|
697
|
+
result: InstaQLResponse<Schema, Q, UseDates>;
|
|
698
|
+
checkResults: DebugCheckResult[];
|
|
699
|
+
}>;
|
|
700
|
+
/**
|
|
701
|
+
* Like `transact`, but does not write to the database.
|
|
702
|
+
* Returns debugging information for permissions checks.
|
|
703
|
+
* Useful for inspecting the values returned by the permissions checks.
|
|
704
|
+
*
|
|
705
|
+
* Requires a user/guest context to be set with `asUser`,
|
|
706
|
+
* since permissions checks are user-specific.
|
|
707
|
+
*
|
|
708
|
+
* Accepts an optional configuration object with a `rules` key.
|
|
709
|
+
* The provided rules will override the rules in the database for the duration of the transaction.
|
|
710
|
+
*
|
|
711
|
+
* @example
|
|
712
|
+
* const goalId = id();
|
|
713
|
+
* db.asUser({ guest: true }).debugTransact(
|
|
714
|
+
* [db.tx.goals[goalId].update({title: "Get fit"})],
|
|
715
|
+
* { rules: { goals: { allow: { update: "auth.id != null" } } }
|
|
716
|
+
* )
|
|
717
|
+
*/
|
|
718
|
+
debugTransact: (inputChunks: TransactionChunk<any, any> | TransactionChunk<any, any>[], opts?: {
|
|
719
|
+
rules?: any;
|
|
720
|
+
ip?: string | null | undefined;
|
|
721
|
+
origin?: string | null | undefined;
|
|
722
|
+
}) => Promise<DebugTransactResult>;
|
|
723
|
+
}
|
|
724
|
+
export { init, init_experimental, id, tx, lookup, i, createBackendRelayRouteHandler, type BackendRelayRouteHandlerPayloadByType, type BackendRelayRouteHandlerType, type BackendRelayRouteHandlerBody, Webhooks, WebhooksManager, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams, BackendRelayAPIError, setBackendRelayWarningsEnabled, type Config, type ImpersonationOpts, type TransactionChunk, type DebugCheckResult, type BackendRelayAdminDatabase, type User, type InstaQLParams, type ValidQuery, type Query, BackendRelayError, type QueryResponse, type InstaQLResponse, type BackendRelayQuery, type BackendRelayUnknownSchemaDef, type BackendRelayQueryResult, type BackendRelaySchema, type BackendRelaySchemaDatabase, type IBackendRelayDatabase, type BackendRelayObject, type BackendRelayEntity, type BackwardsCompatibleSchema, type InstaQLFields, type SubscribeQueryCallback, type SubscribeQueryResponse, type SubscribeQueryPayload, type SubscriptionReadyState, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type BackendRelayGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type RoomsOf, type PresenceOf, type RoomsDef, type RoomHandle, type ValueTypes, type BackendRelaySchemaDef, type BackendRelayUnknownSchema, type InstaQLEntity, type InstaQLResult, type InstaQLEntitySubquery, type BackendRelayRules, type CreateParams, type UpdateParams, type LinkParams, type FileOpts, type UploadFileResponse, type DeleteFileResponse, type DeleteManyFileResponse, type CreateReadStreamOpts, type CreateWriteStreamOpts, type BackendRelayWritableStream, type BackendRelayIssue, type Logger, };
|
|
725
|
+
//# sourceMappingURL=index.d.ts.map
|