@backendrelay/core 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.js +1 -1
- package/dist/standalone/index.umd.cjs +1 -1
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts +20 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js +5 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js +88 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js +131 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js +65 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts +725 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.js +1159 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js +91 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts +17 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js +26 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js +50 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js +33 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts +39 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js +306 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.js +5 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts +20 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js +4 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js +86 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js +129 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.js +63 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.d.ts +725 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.js +1146 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js +89 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts +17 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.js +22 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js +48 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js +31 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts +39 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.js +300 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/admin/dist/esm/version.d.ts.map +1 -0
- package/{src/version.ts → node_modules/@backendrelay/admin/dist/esm/version.js} +1 -1
- package/node_modules/@backendrelay/admin/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/admin/package.json +52 -0
- package/node_modules/@backendrelay/functions/README.md +131 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts +3 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js +3 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js +51 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts +230 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.js +415 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts +3 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js +2 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js +49 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.d.ts +230 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.js +403 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/functions/package.json +49 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts +43 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js +63 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts +43 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.js +59 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/hatchet/package.json +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts +18 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js +77 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js +177 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js +15 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js +25 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts +285 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js +426 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts +24 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js +108 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts +188 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js +412 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts +9 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.js +12 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts +89 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js +357 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts +146 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.js +251 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts +2 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js +29 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts +11 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.js +17 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js +26 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts +19 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.js +76 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js +52 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js +597 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts +98 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js +275 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts +12 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js +26 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.js +66 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js +31 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts +161 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.js +174 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts +25 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js +68 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts +17 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js +314 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.js +55 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.js +5 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts +18 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js +73 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.js +165 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.js +12 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.js +39 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.js +21 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts +285 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js +421 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts +24 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts +188 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.js +393 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.d.ts +9 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.js +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts +89 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js +354 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts +146 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.js +240 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts +2 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.js +26 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts +11 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.js +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.js +21 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.d.ts +19 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.js +18 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js +47 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.js +588 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts +98 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.js +266 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts +12 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js +22 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.js +62 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.js +28 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.js +43 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts +161 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.js +158 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts +25 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js +64 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts +17 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js +310 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.js +46 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.js +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/standalone/index.js +13738 -0
- package/node_modules/@backendrelay/platform/dist/standalone/index.umd.cjs +72 -0
- package/node_modules/@backendrelay/platform/package.json +51 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts +67 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js +129 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts +67 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js +126 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.js +4354 -0
- package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.umd.cjs +6 -0
- package/node_modules/@backendrelay/resumable-stream/package.json +47 -0
- package/node_modules/@backendrelay/rules/README.md +34 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts +117 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.js +68 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.d.ts +117 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.js +64 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/rules/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/rules/package.json +46 -0
- package/node_modules/@backendrelay/test/README.md +75 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts +74 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.js +197 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js +45 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/test/dist/esm/index.d.ts +74 -0
- package/node_modules/@backendrelay/test/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/index.js +192 -0
- package/node_modules/@backendrelay/test/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js +43 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/test/package.json +49 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.js +6 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.js +10 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/index.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/index.js +3 -0
- package/node_modules/@backendrelay/version/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/version/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/esm/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/version.js +7 -0
- package/node_modules/@backendrelay/version/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/standalone/index.js +4 -0
- package/node_modules/@backendrelay/version/dist/standalone/index.umd.cjs +1 -0
- package/node_modules/@backendrelay/version/package.json +44 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts +12 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js +5 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js +82 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts +607 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js +830 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js +139 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts +12 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js +4 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js +80 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts +607 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.js +825 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js +137 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/webhooks/package.json +46 -0
- package/package.json +129 -56
- package/subpaths/admin/index.cjs +1 -0
- package/subpaths/admin/index.d.ts +1 -0
- package/subpaths/admin/index.mjs +3 -0
- package/subpaths/functions/index.cjs +1 -0
- package/subpaths/functions/index.d.ts +1 -0
- package/subpaths/functions/index.mjs +3 -0
- package/subpaths/hatchet/index.cjs +1 -0
- package/subpaths/hatchet/index.d.ts +1 -0
- package/subpaths/hatchet/index.mjs +3 -0
- package/subpaths/platform/index.cjs +1 -0
- package/subpaths/platform/index.d.ts +1 -0
- package/subpaths/platform/index.mjs +3 -0
- package/subpaths/resumable-stream/index.cjs +1 -0
- package/subpaths/resumable-stream/index.d.ts +1 -0
- package/subpaths/resumable-stream/index.mjs +3 -0
- package/subpaths/rules/index.cjs +1 -0
- package/subpaths/rules/index.d.ts +1 -0
- package/subpaths/rules/index.mjs +3 -0
- package/subpaths/test/index.cjs +1 -0
- package/subpaths/test/index.d.ts +1 -0
- package/subpaths/test/index.mjs +3 -0
- package/subpaths/version/index.cjs +1 -0
- package/subpaths/version/index.d.ts +1 -0
- package/subpaths/version/index.mjs +3 -0
- package/subpaths/webhooks/index.cjs +1 -0
- package/subpaths/webhooks/index.d.ts +1 -0
- package/subpaths/webhooks/index.mjs +3 -0
- package/.tshy/build.json +0 -8
- package/.tshy/commonjs.json +0 -16
- package/.tshy/esm.json +0 -15
- package/__example__/standalone.esm.html +0 -23
- package/__example__/standalone.umd.html +0 -21
- package/__tests__/src/Connection.test.ts +0 -292
- package/__tests__/src/IndexedDBStorage.test.ts +0 -96
- package/__tests__/src/Reactor.test.ts +0 -1179
- package/__tests__/src/auth-extra-fields.e2e.test.ts +0 -160
- package/__tests__/src/byop.e2e.test.ts +0 -762
- package/__tests__/src/config.test.ts +0 -85
- package/__tests__/src/cookieSync.e2e.test.ts +0 -163
- package/__tests__/src/data/movies/attrs.json +0 -145
- package/__tests__/src/data/movies/triples.json +0 -1507
- package/__tests__/src/data/zeneca/attrs.json +0 -251
- package/__tests__/src/data/zeneca/triples.json +0 -15854
- package/__tests__/src/datalog.test.ts +0 -175
- package/__tests__/src/devtool.test.ts +0 -23
- package/__tests__/src/framework.test.ts +0 -173
- package/__tests__/src/infiniteQuery.e2e.test.ts +0 -467
- package/__tests__/src/instaml.test.ts +0 -1593
- package/__tests__/src/instaql.bench.ts +0 -34
- package/__tests__/src/instaql.test.ts +0 -1497
- package/__tests__/src/instaqlInference.test.ts +0 -243
- package/__tests__/src/presence.test.ts +0 -49
- package/__tests__/src/queryValidation.test.ts +0 -1101
- package/__tests__/src/schema.test.ts +0 -653
- package/__tests__/src/serializeSchema.test.ts +0 -123
- package/__tests__/src/simple.e2e.test.ts +0 -133
- package/__tests__/src/storage-upload.test.ts +0 -37
- package/__tests__/src/store.test.ts +0 -960
- package/__tests__/src/syncTable.e2e.test.ts +0 -245
- package/__tests__/src/syncTable.test.ts +0 -235
- package/__tests__/src/transactionValidation.test.ts +0 -450
- package/__tests__/src/typeUtils.ts +0 -39
- package/__tests__/src/upstream-improvements.e2e.test.ts +0 -54
- package/__tests__/src/utils/MutationStorage.test.ts +0 -77
- package/__tests__/src/utils/PersistedObject.test.ts +0 -569
- package/__tests__/src/utils/dates.test.ts +0 -111
- package/__tests__/src/utils/e2e.ts +0 -100
- package/__tests__/src/utils/msw.ts +0 -3
- package/__tests__/src/utils/object.test.ts +0 -78
- package/__tests__/src/utils/weakHash.test.ts +0 -68
- package/__tests__/src/utils/weakHashLegacy.test.ts +0 -22
- package/__tests__/src/vite.env.d.ts +0 -1
- package/src/BackendRelayError.ts +0 -50
- package/src/Connection.ts +0 -361
- package/src/InMemoryStorage.ts +0 -34
- package/src/IndexedDBStorage.ts +0 -398
- package/src/Reactor.js +0 -1541
- package/src/StorageAPI.ts +0 -147
- package/src/Stream.ts +0 -1252
- package/src/SyncTable.ts +0 -750
- package/src/WindowNetworkListener.js +0 -19
- package/src/__types__/fieldsTypeTest.ts +0 -111
- package/src/__types__/typeUtils.ts +0 -39
- package/src/__types__/useDatesTypeTest.ts +0 -66
- package/src/attrTypes.ts +0 -37
- package/src/authAPI.ts +0 -205
- package/src/clientTypes.ts +0 -28
- package/src/coreTypes.ts +0 -58
- package/src/createRouteHandler.ts +0 -68
- package/src/datalog.js +0 -116
- package/src/devtool.ts +0 -179
- package/src/framework.ts +0 -450
- package/src/helperTypes.ts +0 -117
- package/src/index.ts +0 -1293
- package/src/infiniteQuery.ts +0 -599
- package/src/instaml.ts +0 -676
- package/src/instaql.ts +0 -999
- package/src/instatx.ts +0 -265
- package/src/model/instaqlResult.js +0 -25
- package/src/parseSchemaFromJSON.ts +0 -176
- package/src/presence.ts +0 -123
- package/src/presenceTypes.ts +0 -19
- package/src/queryTypes.ts +0 -749
- package/src/queryValidation.ts +0 -598
- package/src/reactorAuth.js +0 -236
- package/src/reactorEvents.js +0 -414
- package/src/reactorMutations.js +0 -354
- package/src/reactorRooms.js +0 -297
- package/src/reactorStorage.js +0 -180
- package/src/reactorSubs.js +0 -275
- package/src/reactorTransport.js +0 -391
- package/src/reactorTypes.ts +0 -41
- package/src/routeHandlerProtocol.ts +0 -25
- package/src/rulesTypes.ts +0 -132
- package/src/sanityCheckQueries.ts +0 -191
- package/src/schema.ts +0 -206
- package/src/schemaTypes.ts +0 -664
- package/src/store.ts +0 -1165
- package/src/transactionValidation.ts +0 -204
- package/src/urls.ts +0 -50
- package/src/utils/Deferred.ts +0 -20
- package/src/utils/MutationStorage.ts +0 -89
- package/src/utils/PersistedObject.ts +0 -612
- package/src/utils/dates.ts +0 -269
- package/src/utils/error.ts +0 -9
- package/src/utils/fetch.ts +0 -131
- package/src/utils/flags.ts +0 -14
- package/src/utils/id.ts +0 -28
- package/src/utils/linkIndex.ts +0 -33
- package/src/utils/log.ts +0 -23
- package/src/utils/object.js +0 -180
- package/src/utils/pgtime.ts +0 -199
- package/src/utils/pick.js +0 -9
- package/src/utils/strings.ts +0 -19
- package/src/utils/weakHash.ts +0 -77
- package/src/utils/weakHashLegacy.ts +0 -75
- package/src/warningToggle.ts +0 -5
- package/tsconfig.cjs.dev.json +0 -15
- package/tsconfig.dev.json +0 -14
- package/tsconfig.json +0 -13
- package/tsconfig.test.json +0 -5
- package/vite.config.ts +0 -19
- package/vitest.config.ts +0 -54
package/src/instaql.ts
DELETED
|
@@ -1,999 +0,0 @@
|
|
|
1
|
-
import { query as datalogQuery } from './datalog.js';
|
|
2
|
-
import { uuidCompare } from './utils/id.ts';
|
|
3
|
-
import { stringCompare } from './utils/strings.ts';
|
|
4
|
-
import { coerceToDate } from './utils/dates.ts';
|
|
5
|
-
import * as s from './store.ts';
|
|
6
|
-
import { BackendRelayDBAttr } from './attrTypes.ts';
|
|
7
|
-
import { Cursor } from './queryTypes.ts';
|
|
8
|
-
import { warningEnabled } from './warningToggle.ts';
|
|
9
|
-
|
|
10
|
-
type Pat = [string | any, string, string | any, string | number];
|
|
11
|
-
type Pats = Array<Pat>;
|
|
12
|
-
type OrPat = {
|
|
13
|
-
or: {
|
|
14
|
-
patterns: FullPats;
|
|
15
|
-
joinSym: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
type AndPat = {
|
|
19
|
-
and: {
|
|
20
|
-
patterns: FullPats;
|
|
21
|
-
joinSym: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type FullPat = Pat | OrPat | AndPat;
|
|
25
|
-
type FullPats = Array<FullPat>;
|
|
26
|
-
|
|
27
|
-
// Pattern variables
|
|
28
|
-
// -----------------
|
|
29
|
-
|
|
30
|
-
type MakeVar = (x: string, level: number) => string;
|
|
31
|
-
|
|
32
|
-
let _seed = 0;
|
|
33
|
-
|
|
34
|
-
function wildcard(friendlyName: string) {
|
|
35
|
-
return makeVarImpl(`_${friendlyName}`, _seed++);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function makeVarImpl(x: string, level: number): string {
|
|
39
|
-
return `?${x}-${level}`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Where
|
|
43
|
-
// -----------------
|
|
44
|
-
|
|
45
|
-
class AttrNotFoundError extends Error {
|
|
46
|
-
constructor(message) {
|
|
47
|
-
super(message);
|
|
48
|
-
this.name = 'AttrNotFoundError';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function idAttr(attrsStore: s.AttrsStore, ns: string): BackendRelayDBAttr {
|
|
53
|
-
const attr = s.getPrimaryKeyAttr(attrsStore, ns);
|
|
54
|
-
|
|
55
|
-
if (!attr) {
|
|
56
|
-
throw new AttrNotFoundError(`Could not find id attr for ${ns}`);
|
|
57
|
-
}
|
|
58
|
-
return attr;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function defaultWhere(
|
|
62
|
-
makeVar: MakeVar,
|
|
63
|
-
attrsStore: s.AttrsStore,
|
|
64
|
-
etype: string,
|
|
65
|
-
level: number,
|
|
66
|
-
): Pats {
|
|
67
|
-
return [eidWhere(makeVar, attrsStore, etype, level)];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function eidWhere(
|
|
71
|
-
makeVar: MakeVar,
|
|
72
|
-
attrsStore: s.AttrsStore,
|
|
73
|
-
etype: string,
|
|
74
|
-
level: number,
|
|
75
|
-
): Pat {
|
|
76
|
-
return [
|
|
77
|
-
makeVar(etype, level),
|
|
78
|
-
idAttr(attrsStore, etype).id,
|
|
79
|
-
makeVar(etype, level),
|
|
80
|
-
makeVar('time', level),
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function replaceInAttrPat(attrPat: Pat, needle: string, v: any): Pat {
|
|
85
|
-
return attrPat.map((x) => (x === needle ? v : x)) as Pat;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function refAttrPat(
|
|
89
|
-
makeVar: MakeVar,
|
|
90
|
-
attrsStore: s.AttrsStore,
|
|
91
|
-
etype: string,
|
|
92
|
-
level: number,
|
|
93
|
-
label: string,
|
|
94
|
-
): [string, number, Pat, BackendRelayDBAttr, boolean] {
|
|
95
|
-
const fwdAttr = s.getAttrByFwdIdentName(attrsStore, etype, label);
|
|
96
|
-
const revAttr = s.getAttrByReverseIdentName(attrsStore, etype, label);
|
|
97
|
-
const attr = fwdAttr || revAttr;
|
|
98
|
-
|
|
99
|
-
if (!attr) {
|
|
100
|
-
throw new AttrNotFoundError(`Could not find attr for ${[etype, label]}`);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (attr['value-type'] !== 'ref') {
|
|
104
|
-
throw new Error(`Attr ${attr.id} is not a ref`);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const [_f, fwdEtype] = attr['forward-identity'];
|
|
108
|
-
const [_r, revEtype] = attr['reverse-identity']!;
|
|
109
|
-
const nextLevel = level + 1;
|
|
110
|
-
const attrPat: Pat = fwdAttr
|
|
111
|
-
? [
|
|
112
|
-
makeVar(fwdEtype, level),
|
|
113
|
-
attr.id,
|
|
114
|
-
makeVar(revEtype, nextLevel),
|
|
115
|
-
wildcard('time'),
|
|
116
|
-
]
|
|
117
|
-
: [
|
|
118
|
-
makeVar(fwdEtype, nextLevel),
|
|
119
|
-
attr.id,
|
|
120
|
-
makeVar(revEtype, level),
|
|
121
|
-
wildcard('time'),
|
|
122
|
-
];
|
|
123
|
-
|
|
124
|
-
const nextEtype = fwdAttr ? revEtype : fwdEtype;
|
|
125
|
-
|
|
126
|
-
const isForward = Boolean(fwdAttr);
|
|
127
|
-
|
|
128
|
-
return [nextEtype, nextLevel, attrPat, attr, isForward];
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function makeLikeMatcher(caseSensitive: boolean, pattern: string) {
|
|
132
|
-
if (typeof pattern !== 'string') {
|
|
133
|
-
return function likeMatcher(_value) {
|
|
134
|
-
return false;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const escapedPattern = pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
139
|
-
const regexPattern = escapedPattern.replace(/%/g, '.*').replace(/_/g, '.');
|
|
140
|
-
|
|
141
|
-
// The `s` (dotall) flag makes `%` (-> .*) and `_` (-> .) match newline
|
|
142
|
-
// characters, matching Postgres LIKE/ILIKE on the server.
|
|
143
|
-
const regex = new RegExp(`^${regexPattern}$`, caseSensitive ? 's' : 'is');
|
|
144
|
-
|
|
145
|
-
return function likeMatcher(value) {
|
|
146
|
-
if (typeof value !== 'string') {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
return regex.test(value);
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function parseValue(attr: BackendRelayDBAttr, v: any) {
|
|
154
|
-
if (
|
|
155
|
-
typeof v !== 'object' ||
|
|
156
|
-
v.hasOwnProperty('$in') ||
|
|
157
|
-
v.hasOwnProperty('in')
|
|
158
|
-
) {
|
|
159
|
-
return v;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const isDate = attr['checked-data-type'] === 'date';
|
|
163
|
-
|
|
164
|
-
function comparator(order: 'gt' | 'gte' | 'lt' | 'lte', value: any) {
|
|
165
|
-
return {
|
|
166
|
-
$comparator: true,
|
|
167
|
-
$order: order,
|
|
168
|
-
$dataType: attr['checked-data-type'],
|
|
169
|
-
$value: value,
|
|
170
|
-
$op: isDate
|
|
171
|
-
? function dateComparator(triple) {
|
|
172
|
-
const candidate = comparableDate(triple[2]);
|
|
173
|
-
const target = comparableDate(value);
|
|
174
|
-
switch (order) {
|
|
175
|
-
case 'gt':
|
|
176
|
-
return candidate > target;
|
|
177
|
-
case 'gte':
|
|
178
|
-
return candidate >= target;
|
|
179
|
-
case 'lt':
|
|
180
|
-
return candidate < target;
|
|
181
|
-
case 'lte':
|
|
182
|
-
return candidate <= target;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
: function valueComparator(triple) {
|
|
186
|
-
switch (order) {
|
|
187
|
-
case 'gt':
|
|
188
|
-
return triple[2] > value;
|
|
189
|
-
case 'gte':
|
|
190
|
-
return triple[2] >= value;
|
|
191
|
-
case 'lt':
|
|
192
|
-
return triple[2] < value;
|
|
193
|
-
case 'lte':
|
|
194
|
-
return triple[2] <= value;
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (v.hasOwnProperty('$gt')) {
|
|
201
|
-
return comparator('gt', v.$gt);
|
|
202
|
-
}
|
|
203
|
-
if (v.hasOwnProperty('$gte')) {
|
|
204
|
-
return comparator('gte', v.$gte);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (v.hasOwnProperty('$lt')) {
|
|
208
|
-
return comparator('lt', v.$lt);
|
|
209
|
-
}
|
|
210
|
-
if (v.hasOwnProperty('$lte')) {
|
|
211
|
-
return comparator('lte', v.$lte);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (v.hasOwnProperty('$like')) {
|
|
215
|
-
const matcher = makeLikeMatcher(true, v.$like);
|
|
216
|
-
return {
|
|
217
|
-
$comparator: true,
|
|
218
|
-
$op: function like(triple) {
|
|
219
|
-
return matcher(triple[2]);
|
|
220
|
-
},
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (v.hasOwnProperty('$ilike')) {
|
|
225
|
-
const matcher = makeLikeMatcher(false, v.$ilike);
|
|
226
|
-
return {
|
|
227
|
-
$comparator: true,
|
|
228
|
-
$op: function ilike(triple) {
|
|
229
|
-
return matcher(triple[2]);
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return v;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function valueAttrPat(
|
|
238
|
-
makeVar: MakeVar,
|
|
239
|
-
attrsStore: s.AttrsStore,
|
|
240
|
-
valueEtype: string,
|
|
241
|
-
valueLevel: number,
|
|
242
|
-
valueLabel: string,
|
|
243
|
-
v: any,
|
|
244
|
-
): Pat {
|
|
245
|
-
const fwdAttr = s.getAttrByFwdIdentName(attrsStore, valueEtype, valueLabel);
|
|
246
|
-
const revAttr = s.getAttrByReverseIdentName(
|
|
247
|
-
attrsStore,
|
|
248
|
-
valueEtype,
|
|
249
|
-
valueLabel,
|
|
250
|
-
);
|
|
251
|
-
const attr = fwdAttr || revAttr;
|
|
252
|
-
|
|
253
|
-
if (!attr) {
|
|
254
|
-
throw new AttrNotFoundError(
|
|
255
|
-
`No attr for etype = ${valueEtype} label = ${valueLabel}`,
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (v?.hasOwnProperty('$isNull')) {
|
|
260
|
-
const idAttr = s.getAttrByFwdIdentName(attrsStore, valueEtype, 'id');
|
|
261
|
-
if (!idAttr) {
|
|
262
|
-
throw new AttrNotFoundError(
|
|
263
|
-
`No attr for etype = ${valueEtype} label = id`,
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return [
|
|
268
|
-
makeVar(valueEtype, valueLevel),
|
|
269
|
-
idAttr.id,
|
|
270
|
-
{ $isNull: { attrId: attr.id, isNull: v.$isNull, reverse: !fwdAttr } },
|
|
271
|
-
wildcard('time'),
|
|
272
|
-
];
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (fwdAttr) {
|
|
276
|
-
return [
|
|
277
|
-
makeVar(valueEtype, valueLevel),
|
|
278
|
-
attr.id,
|
|
279
|
-
parseValue(attr, v),
|
|
280
|
-
wildcard('time'),
|
|
281
|
-
];
|
|
282
|
-
}
|
|
283
|
-
return [v, attr.id, makeVar(valueEtype, valueLevel), wildcard('time')];
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function refAttrPats(
|
|
287
|
-
makeVar: MakeVar,
|
|
288
|
-
attrsStore: s.AttrsStore,
|
|
289
|
-
etype: string,
|
|
290
|
-
level: number,
|
|
291
|
-
refsPath: string[],
|
|
292
|
-
): [string, number, Pats] {
|
|
293
|
-
const [lastEtype, lastLevel, attrPats] = refsPath.reduce(
|
|
294
|
-
(acc, label) => {
|
|
295
|
-
const [etype, level, attrPats] = acc;
|
|
296
|
-
const [nextEtype, nextLevel, attrPat] = refAttrPat(
|
|
297
|
-
makeVar,
|
|
298
|
-
attrsStore,
|
|
299
|
-
etype,
|
|
300
|
-
level,
|
|
301
|
-
label,
|
|
302
|
-
);
|
|
303
|
-
return [nextEtype, nextLevel, [...attrPats, attrPat]];
|
|
304
|
-
},
|
|
305
|
-
[etype, level, []],
|
|
306
|
-
);
|
|
307
|
-
|
|
308
|
-
return [lastEtype, lastLevel, attrPats];
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
function whereCondAttrPats(
|
|
312
|
-
makeVar: MakeVar,
|
|
313
|
-
attrsStore: s.AttrsStore,
|
|
314
|
-
etype: string,
|
|
315
|
-
level: number,
|
|
316
|
-
path: string[],
|
|
317
|
-
v: any,
|
|
318
|
-
): Pats {
|
|
319
|
-
const refsPath = path.slice(0, path.length - 1);
|
|
320
|
-
const valueLabel = path[path.length - 1];
|
|
321
|
-
const [lastEtype, lastLevel, refPats] = refAttrPats(
|
|
322
|
-
makeVar,
|
|
323
|
-
attrsStore,
|
|
324
|
-
etype,
|
|
325
|
-
level,
|
|
326
|
-
refsPath,
|
|
327
|
-
);
|
|
328
|
-
const valuePat = valueAttrPat(
|
|
329
|
-
makeVar,
|
|
330
|
-
attrsStore,
|
|
331
|
-
lastEtype,
|
|
332
|
-
lastLevel,
|
|
333
|
-
valueLabel,
|
|
334
|
-
v,
|
|
335
|
-
);
|
|
336
|
-
|
|
337
|
-
return refPats.concat([valuePat]);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function withJoin(where, join) {
|
|
341
|
-
return join ? [join].concat(where) : where;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function isOrClauses([k, v]): boolean {
|
|
345
|
-
return k === 'or' && Array.isArray(v);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
function isAndClauses([k, v]): boolean {
|
|
349
|
-
return k === 'and' && Array.isArray(v);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// Creates a makeVar that will namespace symbols for or clauses
|
|
353
|
-
// to prevent conflicts, except for the base etype
|
|
354
|
-
function genMakeVar(baseMakeVar: MakeVar, joinSym: string, orIdx: number) {
|
|
355
|
-
return (x, lvl) => {
|
|
356
|
-
const base = baseMakeVar(x, lvl);
|
|
357
|
-
if (joinSym == base) {
|
|
358
|
-
return base;
|
|
359
|
-
}
|
|
360
|
-
return `${base}-${orIdx}`;
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// These operators are evaluated by the server. The client cannot reproduce
|
|
365
|
-
// them against the local store, so it drops them before datalog evaluation.
|
|
366
|
-
const SERVER_ONLY_WHERE_OPS = ['$search', '$nearest'] as const;
|
|
367
|
-
|
|
368
|
-
function hasServerOnlyWhereOp(where: Record<string, any>): boolean {
|
|
369
|
-
if (!where || typeof where !== 'object') return false;
|
|
370
|
-
return Object.entries(where).some(([key, value]) => {
|
|
371
|
-
if ((key === 'or' || key === 'and') && Array.isArray(value)) {
|
|
372
|
-
return value.some(hasServerOnlyWhereOp);
|
|
373
|
-
}
|
|
374
|
-
return (
|
|
375
|
-
value !== null &&
|
|
376
|
-
typeof value === 'object' &&
|
|
377
|
-
!Array.isArray(value) &&
|
|
378
|
-
SERVER_ONLY_WHERE_OPS.some((op) =>
|
|
379
|
-
Object.prototype.hasOwnProperty.call(value, op),
|
|
380
|
-
)
|
|
381
|
-
);
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
function parseWhereClauses(
|
|
386
|
-
makeVar: MakeVar,
|
|
387
|
-
clauseType: 'or' | 'and' /* 'or' | 'and' */,
|
|
388
|
-
attrsStore: s.AttrsStore,
|
|
389
|
-
etype: string,
|
|
390
|
-
level: number,
|
|
391
|
-
whereValue: any,
|
|
392
|
-
): FullPats {
|
|
393
|
-
const joinSym = makeVar(etype, level);
|
|
394
|
-
// `$search` and `$nearest` are evaluated by the server. In an OR clause a
|
|
395
|
-
// branch the client cannot evaluate would exclude rows that matched only
|
|
396
|
-
// that branch, so skip the whole clause and trust the server-filtered store.
|
|
397
|
-
if (clauseType === 'or' && whereValue.some(hasServerOnlyWhereOp)) {
|
|
398
|
-
return [];
|
|
399
|
-
}
|
|
400
|
-
const patterns: FullPats[] = whereValue
|
|
401
|
-
.map((w, i) => {
|
|
402
|
-
const makeNamespacedVar = genMakeVar(makeVar, joinSym, i);
|
|
403
|
-
return parseWhere(makeNamespacedVar, attrsStore, etype, level, w);
|
|
404
|
-
})
|
|
405
|
-
.filter((pattern: FullPats) => pattern.length > 0);
|
|
406
|
-
if (patterns.length === 0) return [];
|
|
407
|
-
const pattern: any = { [clauseType]: { patterns, joinSym } };
|
|
408
|
-
return [pattern];
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
// Given a path, returns a list of paths leading up to this path:
|
|
412
|
-
// growPath([1, 2, 3]) -> [[1], [1, 2], [1, 2, 3]]
|
|
413
|
-
function growPath<T>(path: T[]) {
|
|
414
|
-
const ret: Array<T[]> = [];
|
|
415
|
-
for (let i = 1; i <= path.length; i++) {
|
|
416
|
-
ret.push(path.slice(0, i));
|
|
417
|
-
}
|
|
418
|
-
return ret;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
// Returns array of pattern arrays that should be grouped in OR
|
|
422
|
-
// to capture any intermediate nulls
|
|
423
|
-
function whereCondAttrPatsForNullIsTrue(
|
|
424
|
-
makeVar: MakeVar,
|
|
425
|
-
attrsStore: s.AttrsStore,
|
|
426
|
-
etype: string,
|
|
427
|
-
level: number,
|
|
428
|
-
path: string[],
|
|
429
|
-
): Pats[] {
|
|
430
|
-
return growPath(path).map((path) =>
|
|
431
|
-
whereCondAttrPats(makeVar, attrsStore, etype, level, path, {
|
|
432
|
-
$isNull: true,
|
|
433
|
-
}),
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
function parseWhere(
|
|
438
|
-
makeVar: MakeVar,
|
|
439
|
-
attrsStore: s.AttrsStore,
|
|
440
|
-
etype: string,
|
|
441
|
-
level: number,
|
|
442
|
-
where: Record<string, any>,
|
|
443
|
-
): FullPats {
|
|
444
|
-
return Object.entries(where).flatMap(([k, v]) => {
|
|
445
|
-
if (isOrClauses([k, v])) {
|
|
446
|
-
return parseWhereClauses(makeVar, 'or', attrsStore, etype, level, v);
|
|
447
|
-
}
|
|
448
|
-
if (isAndClauses([k, v])) {
|
|
449
|
-
return parseWhereClauses(makeVar, 'and', attrsStore, etype, level, v);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// Temporary hack until we have support for a uuid index on `id`
|
|
453
|
-
if (k === '$entityIdStartsWith') {
|
|
454
|
-
return [];
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// The server applies `$search` and `$nearest` and returns the matching
|
|
458
|
-
// store; the client only projects it. Remove those operators so the local
|
|
459
|
-
// datalog evaluation does not treat them as an exact-match value.
|
|
460
|
-
if (v !== null && typeof v === 'object' && !Array.isArray(v)) {
|
|
461
|
-
const serverOnlyOps = SERVER_ONLY_WHERE_OPS.filter((op) =>
|
|
462
|
-
Object.prototype.hasOwnProperty.call(v, op),
|
|
463
|
-
);
|
|
464
|
-
if (serverOnlyOps.length) {
|
|
465
|
-
const rest = { ...v };
|
|
466
|
-
for (const op of serverOnlyOps) delete rest[op];
|
|
467
|
-
if (Object.keys(rest).length === 0) return [];
|
|
468
|
-
v = rest;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
const path = k.split('.');
|
|
473
|
-
|
|
474
|
-
// Normalize $ne to $not
|
|
475
|
-
if (v?.hasOwnProperty('$ne')) {
|
|
476
|
-
v = { ...v, $not: v.$ne };
|
|
477
|
-
delete v.$ne;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
if (v?.hasOwnProperty('$not')) {
|
|
481
|
-
// `$not` won't pick up entities that are missing the attr, so we
|
|
482
|
-
// add in a `$isNull` to catch those too.
|
|
483
|
-
const notPats = whereCondAttrPats(
|
|
484
|
-
makeVar,
|
|
485
|
-
attrsStore,
|
|
486
|
-
etype,
|
|
487
|
-
level,
|
|
488
|
-
path,
|
|
489
|
-
v,
|
|
490
|
-
);
|
|
491
|
-
const nilPats = whereCondAttrPatsForNullIsTrue(
|
|
492
|
-
makeVar,
|
|
493
|
-
attrsStore,
|
|
494
|
-
etype,
|
|
495
|
-
level,
|
|
496
|
-
path,
|
|
497
|
-
);
|
|
498
|
-
return [
|
|
499
|
-
{
|
|
500
|
-
or: {
|
|
501
|
-
patterns: [notPats, ...nilPats],
|
|
502
|
-
joinSym: makeVar(etype, level),
|
|
503
|
-
},
|
|
504
|
-
} as any,
|
|
505
|
-
];
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
if (v?.hasOwnProperty('$isNull') && v.$isNull === true && path.length > 1) {
|
|
509
|
-
// Make sure we're capturing all of the intermediate paths that might be null
|
|
510
|
-
// by checking for null at each step along the path
|
|
511
|
-
return [
|
|
512
|
-
{
|
|
513
|
-
or: {
|
|
514
|
-
patterns: whereCondAttrPatsForNullIsTrue(
|
|
515
|
-
makeVar,
|
|
516
|
-
attrsStore,
|
|
517
|
-
etype,
|
|
518
|
-
level,
|
|
519
|
-
path,
|
|
520
|
-
),
|
|
521
|
-
joinSym: makeVar(etype, level),
|
|
522
|
-
},
|
|
523
|
-
} as any,
|
|
524
|
-
];
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
return whereCondAttrPats(makeVar, attrsStore, etype, level, path, v);
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
function makeWhere(
|
|
532
|
-
attrsStore: s.AttrsStore,
|
|
533
|
-
etype: string,
|
|
534
|
-
level: number,
|
|
535
|
-
where: Record<string, any> | null,
|
|
536
|
-
): FullPats {
|
|
537
|
-
const makeVar = makeVarImpl;
|
|
538
|
-
if (!where) {
|
|
539
|
-
return defaultWhere(makeVar, attrsStore, etype, level);
|
|
540
|
-
}
|
|
541
|
-
const parsedWhere = parseWhere(makeVar, attrsStore, etype, level, where);
|
|
542
|
-
return parsedWhere.concat(defaultWhere(makeVar, attrsStore, etype, level));
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
// Find
|
|
546
|
-
// -----------------
|
|
547
|
-
|
|
548
|
-
function makeFind(makeVar: MakeVar, etype: string, level: number) {
|
|
549
|
-
return [makeVar(etype, level), makeVar('time', level)];
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// extendObjects
|
|
553
|
-
// -----------------
|
|
554
|
-
|
|
555
|
-
function makeJoin(
|
|
556
|
-
makeVar: MakeVar,
|
|
557
|
-
attrsStore: s.AttrsStore,
|
|
558
|
-
etype: string,
|
|
559
|
-
level: number,
|
|
560
|
-
label: string,
|
|
561
|
-
eid: string,
|
|
562
|
-
) {
|
|
563
|
-
const [nextEtype, nextLevel, pat, attr, isForward] = refAttrPat(
|
|
564
|
-
makeVar,
|
|
565
|
-
attrsStore,
|
|
566
|
-
etype,
|
|
567
|
-
level,
|
|
568
|
-
label,
|
|
569
|
-
);
|
|
570
|
-
const actualized = replaceInAttrPat(pat, makeVar(etype, level), eid);
|
|
571
|
-
return [nextEtype, nextLevel, actualized, attr, isForward];
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
function extendObjects(
|
|
575
|
-
makeVar: MakeVar,
|
|
576
|
-
store: s.Store,
|
|
577
|
-
attrsStore: s.AttrsStore,
|
|
578
|
-
{ etype, level, form },
|
|
579
|
-
objects,
|
|
580
|
-
) {
|
|
581
|
-
const childQueries = Object.keys(form).filter((c) => c !== '$');
|
|
582
|
-
if (!childQueries.length) {
|
|
583
|
-
return Object.values(objects);
|
|
584
|
-
}
|
|
585
|
-
return Object.entries(objects).map(function extendChildren([eid, parent]) {
|
|
586
|
-
const childResults = childQueries.map(function getChildResult(label) {
|
|
587
|
-
const isSingular = Boolean(
|
|
588
|
-
store.cardinalityInference &&
|
|
589
|
-
attrsStore.linkIndex?.[etype]?.[label]?.isSingular,
|
|
590
|
-
);
|
|
591
|
-
|
|
592
|
-
try {
|
|
593
|
-
const [nextEtype, nextLevel, join] = makeJoin(
|
|
594
|
-
makeVar,
|
|
595
|
-
attrsStore,
|
|
596
|
-
etype,
|
|
597
|
-
level,
|
|
598
|
-
label,
|
|
599
|
-
eid,
|
|
600
|
-
);
|
|
601
|
-
|
|
602
|
-
const childrenArray = queryOne(store, attrsStore, {
|
|
603
|
-
etype: nextEtype,
|
|
604
|
-
level: nextLevel,
|
|
605
|
-
form: form[label],
|
|
606
|
-
join,
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
const childOrChildren = isSingular ? childrenArray[0] : childrenArray;
|
|
610
|
-
|
|
611
|
-
return { [label]: childOrChildren };
|
|
612
|
-
} catch (e) {
|
|
613
|
-
if (e instanceof AttrNotFoundError) {
|
|
614
|
-
return { [label]: isSingular ? undefined : [] };
|
|
615
|
-
}
|
|
616
|
-
throw e;
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
|
|
620
|
-
return childResults.reduce(function reduceChildren(parent, child) {
|
|
621
|
-
return { ...parent, ...child };
|
|
622
|
-
}, parent);
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
// resolveObjects
|
|
627
|
-
// -----------------
|
|
628
|
-
|
|
629
|
-
function shouldIgnoreAttr(attrs, id) {
|
|
630
|
-
const attr = attrs[id];
|
|
631
|
-
return attr['value-type'] === 'ref' && attr['forward-identity'][2] !== 'id';
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
// Compares values where we already know that the two values are distinct
|
|
635
|
-
// and not null.
|
|
636
|
-
// Takes into account the data type.
|
|
637
|
-
function compareDisparateValues(a, b, dataType) {
|
|
638
|
-
if (dataType === 'string') {
|
|
639
|
-
return stringCompare(a, b);
|
|
640
|
-
}
|
|
641
|
-
if (a > b) {
|
|
642
|
-
return 1;
|
|
643
|
-
}
|
|
644
|
-
return -1;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
export function compareOrder(id_a: string, v_a, id_b: string, v_b, dataType) {
|
|
648
|
-
if (v_a === v_b || (v_a == null && v_b == null)) {
|
|
649
|
-
return uuidCompare(id_a, id_b);
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
if (v_b == null) {
|
|
653
|
-
return 1;
|
|
654
|
-
}
|
|
655
|
-
if (v_a == null) {
|
|
656
|
-
return -1;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
return compareDisparateValues(v_a, v_b, dataType);
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
function compareOrderTriples(
|
|
663
|
-
[id_a, v_a]: [string, any],
|
|
664
|
-
[id_b, v_b]: [string, any],
|
|
665
|
-
dataType,
|
|
666
|
-
) {
|
|
667
|
-
return compareOrder(id_a, v_a, id_b, v_b, dataType);
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
function comparableDate(x) {
|
|
671
|
-
if (x == null) {
|
|
672
|
-
return x;
|
|
673
|
-
}
|
|
674
|
-
return coerceToDate(x)?.getTime();
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
function compareToCursor(cursor, orderAttr, idVec) {
|
|
678
|
-
const [c_e, _c_a, c_v, c_t] = cursor;
|
|
679
|
-
|
|
680
|
-
if (orderAttr['forward-identity']?.[2] === 'id') {
|
|
681
|
-
return compareOrderTriples(idVec, [c_e, c_t], null);
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
const [e, v] = idVec;
|
|
685
|
-
const dataType = orderAttr['checked-data-type'];
|
|
686
|
-
const v_new = dataType === 'date' ? comparableDate(v) : v;
|
|
687
|
-
const c_v_new = dataType === 'date' ? comparableDate(c_v) : c_v;
|
|
688
|
-
|
|
689
|
-
return compareOrderTriples([e, v_new], [c_e, c_v_new], dataType);
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
function isBefore(startCursor, orderAttr, direction, idVec) {
|
|
693
|
-
const cmp = compareToCursor(startCursor, orderAttr, idVec);
|
|
694
|
-
return direction === 'desc' ? cmp > 0 : cmp < 0;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
function isAfter(endCursor, orderAttr, direction, idVec) {
|
|
698
|
-
const cmp = compareToCursor(endCursor, orderAttr, idVec);
|
|
699
|
-
return direction === 'desc' ? cmp < 0 : cmp > 0;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
function orderAttrFromCursor(attrsStore: s.AttrsStore, cursor) {
|
|
703
|
-
const cursorAttrId = cursor[1];
|
|
704
|
-
return attrsStore.getAttr(cursorAttrId);
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
function orderAttrFromOrder(attrsStore: s.AttrsStore, etype, order) {
|
|
708
|
-
const label = Object.keys(order)[0];
|
|
709
|
-
return s.getAttrByFwdIdentName(attrsStore, etype, label);
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
function getOrderAttr(attrsStore: s.AttrsStore, etype, cursor, order) {
|
|
713
|
-
if (cursor) {
|
|
714
|
-
return orderAttrFromCursor(attrsStore, cursor);
|
|
715
|
-
}
|
|
716
|
-
if (order) {
|
|
717
|
-
return orderAttrFromOrder(attrsStore, etype, order);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
function objectAttrs(
|
|
722
|
-
attrsStore: s.AttrsStore,
|
|
723
|
-
etype,
|
|
724
|
-
dq,
|
|
725
|
-
): Map<string, BackendRelayDBAttr> | undefined {
|
|
726
|
-
if (!Array.isArray(dq.fields)) {
|
|
727
|
-
return s.getBlobAttrs(attrsStore, etype);
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
const attrs = new Map();
|
|
731
|
-
|
|
732
|
-
for (const field of dq.fields) {
|
|
733
|
-
const attr = s.getAttrByFwdIdentName(attrsStore, etype, field);
|
|
734
|
-
const label = attr?.['forward-identity']?.[2];
|
|
735
|
-
if (label && s.isBlob(attr)) {
|
|
736
|
-
attrs.set(label, attr);
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
// Ensure we add the id field to avoid empty objects
|
|
740
|
-
if (!attrs.has('id')) {
|
|
741
|
-
const attr = s.getAttrByFwdIdentName(attrsStore, etype, 'id');
|
|
742
|
-
const label = attr?.['forward-identity']?.[2];
|
|
743
|
-
if (label) {
|
|
744
|
-
attrs.set(label, attr);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
return attrs;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
function runDataloadAndReturnObjects(
|
|
752
|
-
store: s.Store,
|
|
753
|
-
attrsStore: s.AttrsStore,
|
|
754
|
-
{ etype, pageInfo, dq, form },
|
|
755
|
-
) {
|
|
756
|
-
const order = form?.$?.order;
|
|
757
|
-
const isLeadingQuery = isLeading(form);
|
|
758
|
-
const direction = determineDirection(form);
|
|
759
|
-
|
|
760
|
-
let idVecs = datalogQuery(store, dq);
|
|
761
|
-
|
|
762
|
-
const startCursor = pageInfo?.['start-cursor'];
|
|
763
|
-
const endCursor = pageInfo?.['end-cursor'];
|
|
764
|
-
const orderAttr = getOrderAttr(attrsStore, etype, startCursor, order);
|
|
765
|
-
|
|
766
|
-
if (orderAttr && orderAttr?.['forward-identity']?.[2] !== 'id') {
|
|
767
|
-
const isDate = orderAttr['checked-data-type'] === 'date';
|
|
768
|
-
const a = orderAttr.id;
|
|
769
|
-
idVecs = idVecs.map(([id]) => {
|
|
770
|
-
// order attr is required to be cardinality one, so there will
|
|
771
|
-
// be at most one value here
|
|
772
|
-
let v = store.eav.get(id)?.get(a)?.values()?.next()?.value?.[2];
|
|
773
|
-
if (isDate) {
|
|
774
|
-
v = comparableDate(v);
|
|
775
|
-
}
|
|
776
|
-
return [id, v];
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
idVecs.sort(
|
|
781
|
-
direction === 'asc'
|
|
782
|
-
? function compareIdVecs(a, b) {
|
|
783
|
-
return compareOrderTriples(a, b, orderAttr?.['checked-data-type']);
|
|
784
|
-
}
|
|
785
|
-
: function compareIdVecs(a, b) {
|
|
786
|
-
return compareOrderTriples(b, a, orderAttr?.['checked-data-type']);
|
|
787
|
-
},
|
|
788
|
-
);
|
|
789
|
-
|
|
790
|
-
let objects = {};
|
|
791
|
-
const attrs = objectAttrs(attrsStore, etype, dq);
|
|
792
|
-
|
|
793
|
-
for (const idVec of idVecs) {
|
|
794
|
-
const [id] = idVec;
|
|
795
|
-
if (objects[id]) {
|
|
796
|
-
continue;
|
|
797
|
-
}
|
|
798
|
-
if (
|
|
799
|
-
!isLeadingQuery &&
|
|
800
|
-
startCursor &&
|
|
801
|
-
orderAttr &&
|
|
802
|
-
isBefore(startCursor, orderAttr, direction, idVec)
|
|
803
|
-
) {
|
|
804
|
-
continue;
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
if (
|
|
808
|
-
!isLeadingQuery &&
|
|
809
|
-
endCursor &&
|
|
810
|
-
orderAttr &&
|
|
811
|
-
isAfter(endCursor, orderAttr, direction, idVec)
|
|
812
|
-
) {
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
const obj = s.getAsObject(store, attrs, id);
|
|
817
|
-
if (obj) {
|
|
818
|
-
objects[id] = obj;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
return objects;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
function determineDirection(form) {
|
|
825
|
-
const orderOpts = form.$?.order;
|
|
826
|
-
if (!orderOpts) {
|
|
827
|
-
return 'asc';
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
return orderOpts[Object.keys(orderOpts)[0]] || 'asc';
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
/**
|
|
834
|
-
* A "leading" query has no `offset`, `before`, or `after`
|
|
835
|
-
*
|
|
836
|
-
* It is at the 'beginning' of the order
|
|
837
|
-
*/
|
|
838
|
-
function isLeading(form) {
|
|
839
|
-
const offset = form.$?.offset;
|
|
840
|
-
const before = form.$?.before;
|
|
841
|
-
const after = form.$?.after;
|
|
842
|
-
return !offset && !before && !after;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* Given a query like:
|
|
847
|
-
*
|
|
848
|
-
* {
|
|
849
|
-
* users: {
|
|
850
|
-
* $: { where: { name: "Joe" } },
|
|
851
|
-
* },
|
|
852
|
-
* };
|
|
853
|
-
*
|
|
854
|
-
* `resolveObjects`, turns where clause: `{ name: "Joe" }`
|
|
855
|
-
* into a datalog query. We then run the datalog query,
|
|
856
|
-
* and reduce all the triples into objects.
|
|
857
|
-
*/
|
|
858
|
-
function resolveObjects(
|
|
859
|
-
store: s.Store,
|
|
860
|
-
attrsStore: s.AttrsStore,
|
|
861
|
-
{ etype, level, form, join, pageInfo },
|
|
862
|
-
) {
|
|
863
|
-
// Wait for server to tell us where we start if we don't start from the beginning
|
|
864
|
-
if (!isLeading(form) && (!pageInfo || !pageInfo['start-cursor'])) {
|
|
865
|
-
return [];
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
const where = withJoin(
|
|
869
|
-
makeWhere(attrsStore, etype, level, form.$?.where),
|
|
870
|
-
join,
|
|
871
|
-
);
|
|
872
|
-
const find = makeFind(makeVarImpl, etype, level);
|
|
873
|
-
const fields = form.$?.fields;
|
|
874
|
-
|
|
875
|
-
const objs = runDataloadAndReturnObjects(store, attrsStore, {
|
|
876
|
-
etype,
|
|
877
|
-
pageInfo,
|
|
878
|
-
form,
|
|
879
|
-
dq: { where, find, fields },
|
|
880
|
-
});
|
|
881
|
-
|
|
882
|
-
const limit = form.$?.limit || form.$?.first || form.$?.last;
|
|
883
|
-
if (limit != null) {
|
|
884
|
-
if (level > 0 && warningEnabled) {
|
|
885
|
-
console.warn(
|
|
886
|
-
'WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.',
|
|
887
|
-
);
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
const entries = Object.entries(objs);
|
|
891
|
-
if (entries.length <= limit) {
|
|
892
|
-
return objs;
|
|
893
|
-
}
|
|
894
|
-
return Object.fromEntries(entries.slice(0, limit));
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
return objs;
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* It's possible that we query
|
|
902
|
-
* for an attribute that doesn't exist yet.
|
|
903
|
-
*
|
|
904
|
-
* { users: { $: { where: { nonExistentProperty: "foo" } } } }
|
|
905
|
-
*
|
|
906
|
-
* This swallows the missing attr error and returns
|
|
907
|
-
* an empty result instead
|
|
908
|
-
*/
|
|
909
|
-
function guardedResolveObjects(store: s.Store, attrsStore: s.AttrsStore, opts) {
|
|
910
|
-
try {
|
|
911
|
-
return resolveObjects(store, attrsStore, opts);
|
|
912
|
-
} catch (e) {
|
|
913
|
-
if (e instanceof AttrNotFoundError) {
|
|
914
|
-
return {};
|
|
915
|
-
}
|
|
916
|
-
throw e;
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
/**
|
|
920
|
-
* Given a query like:
|
|
921
|
-
*
|
|
922
|
-
* {
|
|
923
|
-
* users: {
|
|
924
|
-
* $: { where: { name: "Joe" } },
|
|
925
|
-
* posts: {},
|
|
926
|
-
* },
|
|
927
|
-
* };
|
|
928
|
-
*
|
|
929
|
-
* `guardResolveObjects` will return the relevant `users` objects
|
|
930
|
-
* `extendObjects` will then extend each `user` object with relevant `posts`.
|
|
931
|
-
*/
|
|
932
|
-
function queryOne(store: s.Store, attrsStore: s.AttrsStore, opts) {
|
|
933
|
-
const objects = guardedResolveObjects(store, attrsStore, opts);
|
|
934
|
-
return extendObjects(makeVarImpl, store, attrsStore, opts, objects);
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
function formatPageInfo(
|
|
938
|
-
pageInfo: Record<
|
|
939
|
-
string,
|
|
940
|
-
{
|
|
941
|
-
'start-cursor'?: Cursor | null;
|
|
942
|
-
'end-cursor'?: Cursor | null;
|
|
943
|
-
'has-next-page?'?: boolean | null;
|
|
944
|
-
'has-previous-page?'?: boolean | null;
|
|
945
|
-
}
|
|
946
|
-
>,
|
|
947
|
-
) {
|
|
948
|
-
const res = {};
|
|
949
|
-
for (const [k, v] of Object.entries(pageInfo)) {
|
|
950
|
-
res[k] = {
|
|
951
|
-
startCursor: v['start-cursor'],
|
|
952
|
-
endCursor: v['end-cursor'],
|
|
953
|
-
hasNextPage: v['has-next-page?'],
|
|
954
|
-
hasPreviousPage: v['has-previous-page?'],
|
|
955
|
-
};
|
|
956
|
-
}
|
|
957
|
-
return res;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
export default function query(
|
|
961
|
-
{
|
|
962
|
-
store,
|
|
963
|
-
attrsStore,
|
|
964
|
-
pageInfo,
|
|
965
|
-
aggregate,
|
|
966
|
-
}: {
|
|
967
|
-
store: s.Store;
|
|
968
|
-
attrsStore: s.AttrsStore;
|
|
969
|
-
pageInfo?: any;
|
|
970
|
-
aggregate?: any;
|
|
971
|
-
},
|
|
972
|
-
q,
|
|
973
|
-
) {
|
|
974
|
-
const data = Object.keys(q).reduce(function reduceResult(res, k) {
|
|
975
|
-
if (aggregate?.[k] || '$$ruleParams' === k) {
|
|
976
|
-
// Aggregate doesn't return any join rows and has no children,
|
|
977
|
-
// so don't bother querying further
|
|
978
|
-
return res;
|
|
979
|
-
}
|
|
980
|
-
res[k] = queryOne(store, attrsStore, {
|
|
981
|
-
etype: k,
|
|
982
|
-
form: q[k],
|
|
983
|
-
level: 0,
|
|
984
|
-
pageInfo: pageInfo?.[k],
|
|
985
|
-
});
|
|
986
|
-
return res;
|
|
987
|
-
}, {});
|
|
988
|
-
|
|
989
|
-
const result: { data: any; pageInfo?: any; aggregate?: any } = { data };
|
|
990
|
-
if (pageInfo) {
|
|
991
|
-
result.pageInfo = formatPageInfo(pageInfo);
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
if (aggregate) {
|
|
995
|
-
result.aggregate = aggregate;
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
return result;
|
|
999
|
-
}
|