@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,588 @@
|
|
|
1
|
+
import { id, } from '@backendrelay/core';
|
|
2
|
+
import { attrDefToNewAttrTx, linkDefToNewAttrTx } from "./migrationUtils.js";
|
|
3
|
+
import { relationshipConstraints } from "./relationships.js";
|
|
4
|
+
const getExistingAttrThrowing = (ident, existingAttrs) => {
|
|
5
|
+
const found = existingAttrs.find((attr) => {
|
|
6
|
+
return (attr['forward-identity'][1] === ident.namespace &&
|
|
7
|
+
attr['forward-identity'][2] === ident.attrName);
|
|
8
|
+
}) || null;
|
|
9
|
+
if (!found) {
|
|
10
|
+
throw new Error(`Attribute ${ident.namespace}.${ident.attrName} not found`);
|
|
11
|
+
}
|
|
12
|
+
return found;
|
|
13
|
+
};
|
|
14
|
+
const convertSimpleConstraintUpdate = (tx, existing) => {
|
|
15
|
+
const found = getExistingAttrThrowing(tx.identifier, existing);
|
|
16
|
+
return {
|
|
17
|
+
'attr-id': found.id,
|
|
18
|
+
'forward-identity': found['forward-identity'],
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
// converts migration operations from Identifier (namespace/name) based
|
|
22
|
+
// into transaction steps that use database ids
|
|
23
|
+
const CONVERTERS = {
|
|
24
|
+
index: convertSimpleConstraintUpdate,
|
|
25
|
+
unique: convertSimpleConstraintUpdate,
|
|
26
|
+
required: convertSimpleConstraintUpdate,
|
|
27
|
+
'remove-index': convertSimpleConstraintUpdate,
|
|
28
|
+
'remove-unique': convertSimpleConstraintUpdate,
|
|
29
|
+
'remove-required': convertSimpleConstraintUpdate,
|
|
30
|
+
'delete-attr': (from, existing) => {
|
|
31
|
+
const found = getExistingAttrThrowing(from.identifier, existing);
|
|
32
|
+
return found.id;
|
|
33
|
+
},
|
|
34
|
+
'update-attr': (from, existing) => {
|
|
35
|
+
const found = getExistingAttrThrowing(from.identifier, existing);
|
|
36
|
+
return {
|
|
37
|
+
id: found.id,
|
|
38
|
+
'forward-identity': from.partialAttr['forward-identity']
|
|
39
|
+
? [
|
|
40
|
+
found.id,
|
|
41
|
+
from.partialAttr['forward-identity'].namespace,
|
|
42
|
+
from.partialAttr['forward-identity'].attrName,
|
|
43
|
+
]
|
|
44
|
+
: undefined,
|
|
45
|
+
'reverse-identity': from.partialAttr['reverse-identity']
|
|
46
|
+
? [
|
|
47
|
+
found.id,
|
|
48
|
+
from.partialAttr['reverse-identity'].namespace,
|
|
49
|
+
from.partialAttr['reverse-identity'].attrName,
|
|
50
|
+
]
|
|
51
|
+
: undefined,
|
|
52
|
+
cardinality: from.partialAttr['cardinality']
|
|
53
|
+
? from.partialAttr['cardinality']
|
|
54
|
+
: undefined,
|
|
55
|
+
'on-delete': from.partialAttr['on-delete']
|
|
56
|
+
? from.partialAttr['on-delete']
|
|
57
|
+
: undefined,
|
|
58
|
+
'on-delete-reverse': from.partialAttr['on-delete-reverse']
|
|
59
|
+
? from.partialAttr['on-delete-reverse']
|
|
60
|
+
: undefined,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
'add-attr': (from, _existing) => {
|
|
64
|
+
const attrId = id();
|
|
65
|
+
const forwardIdentity = [
|
|
66
|
+
attrId,
|
|
67
|
+
from.identifier.namespace,
|
|
68
|
+
from.identifier.attrName,
|
|
69
|
+
];
|
|
70
|
+
const steps = [];
|
|
71
|
+
// First, create the attribute without unique, required, or indexed
|
|
72
|
+
steps.push([
|
|
73
|
+
'add-attr',
|
|
74
|
+
{
|
|
75
|
+
'forward-identity': forwardIdentity,
|
|
76
|
+
'reverse-identity': from['reverse-identity']
|
|
77
|
+
? [
|
|
78
|
+
id(),
|
|
79
|
+
from['reverse-identity'].namespace,
|
|
80
|
+
from['reverse-identity'].attrName,
|
|
81
|
+
]
|
|
82
|
+
: null,
|
|
83
|
+
'inferred-types': null,
|
|
84
|
+
'value-type': from['value-type'],
|
|
85
|
+
id: attrId,
|
|
86
|
+
cardinality: from.cardinality,
|
|
87
|
+
'index?': false,
|
|
88
|
+
'required?': false,
|
|
89
|
+
'unique?': false,
|
|
90
|
+
catalog: 'user',
|
|
91
|
+
'on-delete': from['on-delete'],
|
|
92
|
+
'on-delete-reverse': from['on-delete-reverse'],
|
|
93
|
+
'checked-data-type': from['checked-data-type'],
|
|
94
|
+
},
|
|
95
|
+
]);
|
|
96
|
+
// Then add separate steps for unique, required, and indexed
|
|
97
|
+
if (from['unique?']) {
|
|
98
|
+
steps.push([
|
|
99
|
+
'unique',
|
|
100
|
+
{
|
|
101
|
+
'attr-id': attrId,
|
|
102
|
+
'forward-identity': forwardIdentity,
|
|
103
|
+
},
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
106
|
+
if (from['required?']) {
|
|
107
|
+
steps.push([
|
|
108
|
+
'required',
|
|
109
|
+
{
|
|
110
|
+
'attr-id': attrId,
|
|
111
|
+
'forward-identity': forwardIdentity,
|
|
112
|
+
},
|
|
113
|
+
]);
|
|
114
|
+
}
|
|
115
|
+
if (from['index?']) {
|
|
116
|
+
steps.push([
|
|
117
|
+
'index',
|
|
118
|
+
{
|
|
119
|
+
'attr-id': attrId,
|
|
120
|
+
'forward-identity': forwardIdentity,
|
|
121
|
+
},
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
return steps;
|
|
125
|
+
},
|
|
126
|
+
'remove-data-type': convertSimpleConstraintUpdate,
|
|
127
|
+
'check-data-type': (from, existing) => {
|
|
128
|
+
const found = getExistingAttrThrowing(from.identifier, existing);
|
|
129
|
+
return {
|
|
130
|
+
'attr-id': found.id,
|
|
131
|
+
'checked-data-type': from['checked-data-type'],
|
|
132
|
+
'forward-identity': found['forward-identity'],
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
function isSystemCatalogAttr(systemCatalogIdentNames, entityName, attrName) {
|
|
137
|
+
return !!systemCatalogIdentNames[entityName]?.has(attrName);
|
|
138
|
+
}
|
|
139
|
+
export const convertTxSteps = (txs, existingAttrs) => {
|
|
140
|
+
if (!existingAttrs) {
|
|
141
|
+
throw new Error('Existing attributes are required');
|
|
142
|
+
}
|
|
143
|
+
const result = [];
|
|
144
|
+
txs.forEach((tx) => {
|
|
145
|
+
const converter = CONVERTERS[tx.type];
|
|
146
|
+
if (!converter) {
|
|
147
|
+
throw new Error(`Unknown transaction type: ${tx.type}`);
|
|
148
|
+
}
|
|
149
|
+
const converted = converter(tx, existingAttrs);
|
|
150
|
+
if (Array.isArray(converted)) {
|
|
151
|
+
result.push(...converted);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
result.push([tx.type, converted]);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return result;
|
|
158
|
+
};
|
|
159
|
+
export const diffSchemas = async (oldSchema, newSchema, resolveFn, systemCatalogIdentNames) => {
|
|
160
|
+
const transactions = [];
|
|
161
|
+
const oldEntities = oldSchema.entities;
|
|
162
|
+
const newEntities = newSchema.entities;
|
|
163
|
+
const oldEntityNames = Object.keys(oldEntities);
|
|
164
|
+
const newEntityNames = Object.keys(newEntities);
|
|
165
|
+
const deletedEntityNames = oldEntityNames.filter((name) => !newEntityNames.includes(name));
|
|
166
|
+
for (const entityName of deletedEntityNames) {
|
|
167
|
+
Object.keys(oldEntities[entityName].attrs).forEach((attrName) => {
|
|
168
|
+
if (isSystemCatalogAttr(systemCatalogIdentNames, entityName, attrName))
|
|
169
|
+
return;
|
|
170
|
+
transactions.push({
|
|
171
|
+
type: 'delete-attr',
|
|
172
|
+
identifier: {
|
|
173
|
+
attrName,
|
|
174
|
+
namespace: entityName,
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
if (isSystemCatalogAttr(systemCatalogIdentNames, entityName, 'id')) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
transactions.push({
|
|
182
|
+
type: 'delete-attr',
|
|
183
|
+
identifier: {
|
|
184
|
+
attrName: 'id',
|
|
185
|
+
namespace: entityName,
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
const addedEntityNames = newEntityNames.filter((name) => !oldEntityNames.includes(name));
|
|
190
|
+
for (const entityName of addedEntityNames) {
|
|
191
|
+
if (!isSystemCatalogAttr(systemCatalogIdentNames, entityName, 'id')) {
|
|
192
|
+
transactions.push({
|
|
193
|
+
type: 'add-attr',
|
|
194
|
+
'forward-identity': {
|
|
195
|
+
namespace: entityName,
|
|
196
|
+
attrName: 'id',
|
|
197
|
+
},
|
|
198
|
+
identifier: {
|
|
199
|
+
attrName: 'id',
|
|
200
|
+
namespace: entityName,
|
|
201
|
+
},
|
|
202
|
+
'index?': false,
|
|
203
|
+
'required?': true,
|
|
204
|
+
cardinality: 'one',
|
|
205
|
+
'unique?': true,
|
|
206
|
+
'value-type': 'blob',
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
for (const attrName of Object.keys(newEntities[entityName].attrs)) {
|
|
210
|
+
if (isSystemCatalogAttr(systemCatalogIdentNames, entityName, attrName)) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const attrInSchema = newEntities[entityName].attrs[attrName];
|
|
214
|
+
transactions.push(attrDefToNewAttrTx(attrInSchema, entityName, attrName));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const innerEntityNames = oldEntityNames.filter((name) => newEntityNames.includes(name));
|
|
218
|
+
for (const entityName of innerEntityNames) {
|
|
219
|
+
// BLOB ATTRIBUTES
|
|
220
|
+
const addedFields = Object.keys(newEntities[entityName].attrs).filter((field) => {
|
|
221
|
+
if (isSystemCatalogAttr(systemCatalogIdentNames, entityName, field))
|
|
222
|
+
return false;
|
|
223
|
+
const oldEntityHasIt = Object.keys(oldEntities[entityName].attrs).includes(field);
|
|
224
|
+
return !oldEntityHasIt;
|
|
225
|
+
});
|
|
226
|
+
const removedFields = Object.keys(oldEntities[entityName].attrs).filter((field) => {
|
|
227
|
+
if (isSystemCatalogAttr(systemCatalogIdentNames, entityName, field))
|
|
228
|
+
return false;
|
|
229
|
+
const newEntityHasIt = Object.keys(newEntities[entityName].attrs).includes(field);
|
|
230
|
+
return !newEntityHasIt;
|
|
231
|
+
});
|
|
232
|
+
const resolved = await resolveRenames(addedFields, removedFields, resolveFn, {
|
|
233
|
+
type: 'attribute',
|
|
234
|
+
entityName: entityName,
|
|
235
|
+
});
|
|
236
|
+
const consistentFields = Object.keys(oldEntities[entityName].attrs).filter((field) => Object.keys(newEntities[entityName].attrs).includes(field));
|
|
237
|
+
consistentFields.forEach((fieldName) => {
|
|
238
|
+
if (isSystemCatalogAttr(systemCatalogIdentNames, entityName, fieldName)) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
transactions.push(...compareBlobs({
|
|
242
|
+
attrName: fieldName,
|
|
243
|
+
namespace: entityName,
|
|
244
|
+
}, oldEntities[entityName].attrs[fieldName], newEntities[entityName].attrs[fieldName]));
|
|
245
|
+
});
|
|
246
|
+
resolved.deleted.forEach((attrName) => {
|
|
247
|
+
transactions.push({
|
|
248
|
+
type: 'delete-attr',
|
|
249
|
+
identifier: {
|
|
250
|
+
attrName,
|
|
251
|
+
namespace: entityName,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
resolved.created.forEach((createdName) => {
|
|
256
|
+
const attrInSchema = newSchema.entities[entityName].attrs[createdName];
|
|
257
|
+
transactions.push(attrDefToNewAttrTx(attrInSchema, entityName, createdName));
|
|
258
|
+
});
|
|
259
|
+
resolved.renamed.forEach((renamed) => {
|
|
260
|
+
transactions.push({
|
|
261
|
+
type: 'update-attr',
|
|
262
|
+
identifier: {
|
|
263
|
+
attrName: renamed.from,
|
|
264
|
+
namespace: entityName,
|
|
265
|
+
},
|
|
266
|
+
partialAttr: {
|
|
267
|
+
'value-type': 'blob',
|
|
268
|
+
cardinality: 'one',
|
|
269
|
+
'forward-identity': {
|
|
270
|
+
attrName: renamed.to,
|
|
271
|
+
namespace: entityName,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
transactions.push(...compareBlobs({
|
|
276
|
+
attrName: renamed.from,
|
|
277
|
+
namespace: entityName,
|
|
278
|
+
}, oldEntities[entityName].attrs[renamed.from], newEntities[entityName].attrs[renamed.to]));
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
const oldLinks = Object.values(oldSchema.links).filter((link) => !isSystemCatalogAttr(systemCatalogIdentNames, link.forward.on, link.forward.label));
|
|
282
|
+
const newLinks = Object.values(newSchema.links).filter((link) => !isSystemCatalogAttr(systemCatalogIdentNames, link.forward.on, link.forward.label));
|
|
283
|
+
// Group links by their forward namespace-label combination for comparison
|
|
284
|
+
const createLinkKey = (link) => `${link.forward.on}<->${link.reverse.on}`;
|
|
285
|
+
const createLinkIdentity = (link) => `${link.forward.on}.${link.forward.label}<->${link.reverse.on}.${link.reverse.label}`;
|
|
286
|
+
const newLinksByKey = new Map();
|
|
287
|
+
const oldLinksByKey = new Map();
|
|
288
|
+
for (const link of newLinks) {
|
|
289
|
+
const key = createLinkKey(link);
|
|
290
|
+
const links = newLinksByKey.get(key) || [];
|
|
291
|
+
links.push(link);
|
|
292
|
+
newLinksByKey.set(key, links);
|
|
293
|
+
}
|
|
294
|
+
for (const link of oldLinks) {
|
|
295
|
+
const key = createLinkKey(link);
|
|
296
|
+
const links = oldLinksByKey.get(key) || [];
|
|
297
|
+
links.push(link);
|
|
298
|
+
oldLinksByKey.set(key, links);
|
|
299
|
+
}
|
|
300
|
+
const allLinkKeys = new Set([
|
|
301
|
+
...oldLinksByKey.keys(),
|
|
302
|
+
...newLinksByKey.keys(),
|
|
303
|
+
]);
|
|
304
|
+
for (const linkKey of allLinkKeys) {
|
|
305
|
+
const oldLinksInGroup = oldLinksByKey.get(linkKey) || [];
|
|
306
|
+
const newLinksInGroup = newLinksByKey.get(linkKey) || [];
|
|
307
|
+
const oldIdentities = oldLinksInGroup.map((link) => createLinkIdentity(link));
|
|
308
|
+
const newIdentities = newLinksInGroup.map((link) => createLinkIdentity(link));
|
|
309
|
+
const addedIdentities = newIdentities.filter((identity) => !oldIdentities.includes(identity));
|
|
310
|
+
const removedIdentities = oldIdentities.filter((identity) => !newIdentities.includes(identity));
|
|
311
|
+
const consistentIdentities = oldIdentities.filter((identity) => newIdentities.includes(identity));
|
|
312
|
+
consistentIdentities.forEach((identity) => {
|
|
313
|
+
const oldLink = oldLinksInGroup.find((l) => createLinkIdentity(l) === identity);
|
|
314
|
+
const newLink = newLinksInGroup.find((l) => createLinkIdentity(l) === identity);
|
|
315
|
+
if (!oldLink || !newLink)
|
|
316
|
+
return;
|
|
317
|
+
transactions.push(...compareLinks({
|
|
318
|
+
namespace: oldLink.forward.on,
|
|
319
|
+
attrName: oldLink.forward.label,
|
|
320
|
+
}, oldLink, newLink));
|
|
321
|
+
});
|
|
322
|
+
const resolved = await resolveRenames(addedIdentities, removedIdentities, resolveFn, {
|
|
323
|
+
type: 'link',
|
|
324
|
+
forwardEntityName: oldLinksInGroup[0]?.forward.on,
|
|
325
|
+
reverseEntityName: oldLinksInGroup[0]?.reverse.on,
|
|
326
|
+
});
|
|
327
|
+
resolved.deleted.forEach((identity) => {
|
|
328
|
+
const link = oldLinksInGroup.find((l) => createLinkIdentity(l) === identity);
|
|
329
|
+
if (!link)
|
|
330
|
+
return;
|
|
331
|
+
transactions.push({
|
|
332
|
+
type: 'delete-attr',
|
|
333
|
+
identifier: {
|
|
334
|
+
attrName: link.forward.label,
|
|
335
|
+
namespace: link.forward.on,
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
resolved.created.forEach((identity) => {
|
|
340
|
+
const link = newLinksInGroup.find((l) => createLinkIdentity(l) === identity);
|
|
341
|
+
if (!link)
|
|
342
|
+
return;
|
|
343
|
+
transactions.push(linkDefToNewAttrTx(link));
|
|
344
|
+
});
|
|
345
|
+
resolved.renamed.forEach((renamed) => {
|
|
346
|
+
const oldLink = oldLinksInGroup.find((l) => createLinkIdentity(l) === renamed.from);
|
|
347
|
+
const newLink = newLinksInGroup.find((l) => createLinkIdentity(l) === renamed.to);
|
|
348
|
+
if (!oldLink || !newLink)
|
|
349
|
+
return;
|
|
350
|
+
transactions.push({
|
|
351
|
+
type: 'update-attr',
|
|
352
|
+
identifier: {
|
|
353
|
+
attrName: oldLink.forward.label,
|
|
354
|
+
namespace: oldLink.forward.on,
|
|
355
|
+
},
|
|
356
|
+
partialAttr: {
|
|
357
|
+
'value-type': 'ref',
|
|
358
|
+
cardinality: newLink.forward.has === 'one' ? 'one' : 'many',
|
|
359
|
+
'forward-identity': {
|
|
360
|
+
attrName: newLink.forward.label,
|
|
361
|
+
namespace: newLink.forward.on,
|
|
362
|
+
},
|
|
363
|
+
'reverse-identity': {
|
|
364
|
+
attrName: newLink.reverse.label,
|
|
365
|
+
namespace: newLink.reverse.on,
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
transactions.push(...compareLinks({
|
|
370
|
+
attrName: oldLink.forward.label,
|
|
371
|
+
namespace: oldLink.forward.on,
|
|
372
|
+
}, oldLink, newLink));
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return transactions;
|
|
376
|
+
};
|
|
377
|
+
export const compareBlobs = (identity, oldBlob, newBlob) => {
|
|
378
|
+
const results = [];
|
|
379
|
+
const sendType = (type) => {
|
|
380
|
+
results.push({
|
|
381
|
+
type,
|
|
382
|
+
identifier: identity,
|
|
383
|
+
});
|
|
384
|
+
};
|
|
385
|
+
// check if index needs to be added
|
|
386
|
+
if (oldBlob.isIndexed === false && newBlob.isIndexed === true)
|
|
387
|
+
sendType('index');
|
|
388
|
+
// check if index needs to be removed
|
|
389
|
+
if (oldBlob.isIndexed === true && newBlob.isIndexed === false)
|
|
390
|
+
sendType('remove-index');
|
|
391
|
+
// check if needs to become unique
|
|
392
|
+
if (oldBlob.config.unique === false && newBlob.config.unique === true)
|
|
393
|
+
sendType('unique');
|
|
394
|
+
// check if needs to become non-unique
|
|
395
|
+
if (oldBlob.config.unique === true && newBlob.config.unique === false)
|
|
396
|
+
sendType('remove-unique');
|
|
397
|
+
// check if needs to become required
|
|
398
|
+
if (oldBlob.required === false && newBlob.required === true)
|
|
399
|
+
sendType('required');
|
|
400
|
+
// check if needs to become non-required
|
|
401
|
+
if (oldBlob.required === true && newBlob.required === false)
|
|
402
|
+
sendType('remove-required');
|
|
403
|
+
// check if data type needs to be changed / added
|
|
404
|
+
if (oldBlob.valueType !== 'json' && newBlob.valueType === 'json') {
|
|
405
|
+
results.push({
|
|
406
|
+
type: 'remove-data-type',
|
|
407
|
+
identifier: identity,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
else if (oldBlob.valueType !== newBlob.valueType &&
|
|
411
|
+
newBlob.valueType !== 'json') {
|
|
412
|
+
results.push({
|
|
413
|
+
type: 'check-data-type',
|
|
414
|
+
identifier: identity,
|
|
415
|
+
'checked-data-type': newBlob.valueType,
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
return results;
|
|
419
|
+
};
|
|
420
|
+
export const compareLinks = (identity, oldLink, newLink) => {
|
|
421
|
+
const results = [];
|
|
422
|
+
const oldRelationship = `${oldLink.forward.has}-${oldLink.reverse.has}`;
|
|
423
|
+
const { cardinality: oldCardinal, 'unique?': oldUnique } = relationshipConstraints[oldRelationship];
|
|
424
|
+
const oldRequired = !!oldLink.forward.required;
|
|
425
|
+
const newRelationship = `${newLink.forward.has}-${newLink.reverse.has}`;
|
|
426
|
+
const { cardinality: newCardinal, 'unique?': newUnique } = relationshipConstraints[newRelationship];
|
|
427
|
+
const newRequired = !!newLink.forward.required;
|
|
428
|
+
if (!oldUnique && newUnique) {
|
|
429
|
+
results.push({
|
|
430
|
+
type: 'unique',
|
|
431
|
+
identifier: identity,
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
if (!newUnique && newUnique !== oldUnique) {
|
|
435
|
+
results.push({
|
|
436
|
+
type: 'remove-unique',
|
|
437
|
+
identifier: identity,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
if (newRequired !== oldRequired) {
|
|
441
|
+
results.push({
|
|
442
|
+
type: newRequired ? 'required' : 'remove-required',
|
|
443
|
+
identifier: identity,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
if (oldLink.reverse.onDelete !== newLink.reverse.onDelete ||
|
|
447
|
+
oldLink.forward.onDelete !== newLink.forward.onDelete ||
|
|
448
|
+
oldCardinal !== newCardinal) {
|
|
449
|
+
results.push({
|
|
450
|
+
type: 'update-attr',
|
|
451
|
+
identifier: identity,
|
|
452
|
+
partialAttr: {
|
|
453
|
+
'value-type': 'ref',
|
|
454
|
+
'on-delete-reverse': newLink.reverse.onDelete,
|
|
455
|
+
'on-delete': newLink.forward.onDelete,
|
|
456
|
+
cardinality: newCardinal,
|
|
457
|
+
},
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
return results;
|
|
461
|
+
};
|
|
462
|
+
export const isRenamePromptItem = (item) => {
|
|
463
|
+
if (typeof item === 'object')
|
|
464
|
+
return true;
|
|
465
|
+
return false;
|
|
466
|
+
};
|
|
467
|
+
const resolveRenames = async (newItems, missingItems, resolveFn, extraInfo) => {
|
|
468
|
+
if (missingItems.length === 0 || newItems.length === 0) {
|
|
469
|
+
return {
|
|
470
|
+
created: newItems,
|
|
471
|
+
deleted: missingItems,
|
|
472
|
+
renamed: [],
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
const result = { created: [], renamed: [], deleted: [] };
|
|
476
|
+
let index = 0;
|
|
477
|
+
let leftMissing = [...missingItems];
|
|
478
|
+
do {
|
|
479
|
+
const created = newItems[index];
|
|
480
|
+
const renames = leftMissing.map((it) => {
|
|
481
|
+
return { from: it, to: created };
|
|
482
|
+
});
|
|
483
|
+
const promptData = [created, ...renames];
|
|
484
|
+
const data = await resolveFn(created, promptData, extraInfo);
|
|
485
|
+
if (isRenamePromptItem(data)) {
|
|
486
|
+
if (data.from !== data.to) {
|
|
487
|
+
result.renamed.push(data);
|
|
488
|
+
}
|
|
489
|
+
delete leftMissing[leftMissing.indexOf(data.from)];
|
|
490
|
+
leftMissing = leftMissing.filter(Boolean);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
result.created.push(created);
|
|
494
|
+
}
|
|
495
|
+
index += 1;
|
|
496
|
+
} while (index < newItems.length);
|
|
497
|
+
result.deleted.push(...leftMissing);
|
|
498
|
+
return result;
|
|
499
|
+
};
|
|
500
|
+
function validateRenameLookup(lookup) {
|
|
501
|
+
const [etype, label] = lookup.split('.').map((x) => x.trim());
|
|
502
|
+
if (!etype || !label) {
|
|
503
|
+
throw new Error(`Invalid lookup. Got '${lookup}'. We expect a pattern like 'entityname.columname;.` +
|
|
504
|
+
'For example: posts.title');
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
// RenameMap goes from `to` -> `from`
|
|
508
|
+
function parseRenameCommands(renames) {
|
|
509
|
+
// Parse rename options: format is "from:to"
|
|
510
|
+
// note that it saves backwards since we will be testing against the base
|
|
511
|
+
// case of a created attr
|
|
512
|
+
const renameMap = new Map();
|
|
513
|
+
for (const renameStr of renames) {
|
|
514
|
+
let [from, to] = renameStr.split(':').map((x) => x.trim());
|
|
515
|
+
if (!from || !to) {
|
|
516
|
+
throw new Error(`Invalid rename command: ${renameStr}. We could not parse a distinct 'from' and 'to'.` +
|
|
517
|
+
" The structure should look like 'from:to'. For example: 'posts.name:posts.title'");
|
|
518
|
+
}
|
|
519
|
+
validateRenameLookup(from);
|
|
520
|
+
validateRenameLookup(to);
|
|
521
|
+
renameMap.set(to.trim(), from.trim());
|
|
522
|
+
}
|
|
523
|
+
return renameMap;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Given a list of RenameCommands, builds a cusotm `resolveFn` for
|
|
527
|
+
* `diffSchemas`, which automatically resolves rename conflicts with these commands.
|
|
528
|
+
*/
|
|
529
|
+
export function buildAutoRenameSelector(renames) {
|
|
530
|
+
const renameMap = parseRenameCommands(renames);
|
|
531
|
+
const renameFn = async function (created, promptData, extraInfo) {
|
|
532
|
+
let lookupNames = [];
|
|
533
|
+
if (extraInfo?.type === 'attribute' && extraInfo?.entityName) {
|
|
534
|
+
lookupNames = [`${extraInfo.entityName}.${created}`];
|
|
535
|
+
}
|
|
536
|
+
else if (extraInfo?.type === 'link') {
|
|
537
|
+
// Extract both forward and reverse parts
|
|
538
|
+
const parts = created.split('<->');
|
|
539
|
+
lookupNames = [parts[0], parts[1]];
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
return created;
|
|
543
|
+
}
|
|
544
|
+
// Try to find a match in the rename map using the lookup names
|
|
545
|
+
let fromAttr = null;
|
|
546
|
+
for (const lookupName of lookupNames) {
|
|
547
|
+
if (renameMap.has(lookupName)) {
|
|
548
|
+
fromAttr = renameMap.get(lookupName) || null;
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (fromAttr) {
|
|
553
|
+
let fromValue;
|
|
554
|
+
if (extraInfo?.type === 'attribute') {
|
|
555
|
+
fromValue = fromAttr.split('.').pop();
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
const matchingItem = promptData.find((item) => {
|
|
559
|
+
const itemStr = typeof item === 'string' ? item : item.from;
|
|
560
|
+
const itemParts = itemStr.split('<->');
|
|
561
|
+
return itemParts[0] === fromAttr || itemParts[1] === fromAttr;
|
|
562
|
+
});
|
|
563
|
+
if (matchingItem) {
|
|
564
|
+
fromValue =
|
|
565
|
+
typeof matchingItem === 'string' ? matchingItem : matchingItem.from;
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
return created;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const hasMatch = promptData.some((item) => {
|
|
572
|
+
if (typeof item === 'string') {
|
|
573
|
+
return item === fromValue;
|
|
574
|
+
}
|
|
575
|
+
else if (item.from) {
|
|
576
|
+
return item.from === fromValue;
|
|
577
|
+
}
|
|
578
|
+
return false;
|
|
579
|
+
});
|
|
580
|
+
if (fromValue && hasMatch) {
|
|
581
|
+
return { from: fromValue, to: created };
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return created;
|
|
585
|
+
};
|
|
586
|
+
return renameFn;
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=migrations.js.map
|