@backendrelay/core 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.js +1 -1
- package/dist/standalone/index.umd.cjs +1 -1
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts +20 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js +5 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js +88 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js +131 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js +65 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts +725 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.js +1159 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js +91 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts +17 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js +26 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js +50 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js +33 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts +39 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js +306 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.js +5 -0
- package/node_modules/@backendrelay/admin/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts +20 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js +4 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js +86 -0
- package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js +129 -0
- package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.js +63 -0
- package/node_modules/@backendrelay/admin/dist/esm/config.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.d.ts +725 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.js +1146 -0
- package/node_modules/@backendrelay/admin/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js +89 -0
- package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts +17 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.js +22 -0
- package/node_modules/@backendrelay/admin/dist/esm/polyfill.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js +48 -0
- package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts +2 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js +31 -0
- package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts +39 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.js +300 -0
- package/node_modules/@backendrelay/admin/dist/esm/subscribe.js.map +1 -0
- package/node_modules/@backendrelay/admin/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/admin/dist/esm/version.d.ts.map +1 -0
- package/{src/version.ts → node_modules/@backendrelay/admin/dist/esm/version.js} +1 -1
- package/node_modules/@backendrelay/admin/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/admin/package.json +52 -0
- package/node_modules/@backendrelay/functions/README.md +131 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts +3 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js +3 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js +51 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts +230 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.js +415 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts +3 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js +2 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js +49 -0
- package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.d.ts +230 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.js +403 -0
- package/node_modules/@backendrelay/functions/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/functions/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/functions/package.json +49 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts +43 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js +63 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts +43 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.js +59 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/hatchet/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/hatchet/package.json +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts +18 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js +77 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js +177 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js +15 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js +25 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts +285 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js +426 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts +24 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js +108 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts +188 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js +412 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts +9 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.js +12 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts +89 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js +357 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts +146 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.js +251 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/backups.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts +2 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js +29 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts +11 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.js +17 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/consts.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js +26 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts +19 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.js +76 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js +52 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js +597 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts +98 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js +275 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts +12 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js +26 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.js +66 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js +31 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js +46 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts +161 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.js +174 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts +25 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js +68 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts +17 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js +314 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.js +55 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/util.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.js +5 -0
- package/node_modules/@backendrelay/platform/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts +18 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js +73 -0
- package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.js +165 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/apps.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.js +12 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/auth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.js +39 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/http.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.js +21 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts +285 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js +421 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts +24 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts +188 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.js +393 -0
- package/node_modules/@backendrelay/platform/dist/esm/api/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.d.ts +9 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.js +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/api.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts +89 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js +354 -0
- package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts +146 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.js +240 -0
- package/node_modules/@backendrelay/platform/dist/esm/backups.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts +2 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.js +26 -0
- package/node_modules/@backendrelay/platform/dist/esm/clerk.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts +11 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.js +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/consts.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.js +21 -0
- package/node_modules/@backendrelay/platform/dist/esm/crypto.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.d.ts +19 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.js +18 -0
- package/node_modules/@backendrelay/platform/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts +4 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js +47 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts +99 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.js +588 -0
- package/node_modules/@backendrelay/platform/dist/esm/migrations.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts +98 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.js +266 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts +12 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js +22 -0
- package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.js +62 -0
- package/node_modules/@backendrelay/platform/dist/esm/perms.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.js +28 -0
- package/node_modules/@backendrelay/platform/dist/esm/privateFields.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts +7 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.js +43 -0
- package/node_modules/@backendrelay/platform/dist/esm/relationships.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts +161 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.js +158 -0
- package/node_modules/@backendrelay/platform/dist/esm/schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts +25 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js +64 -0
- package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts +17 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js +310 -0
- package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.d.ts +13 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.js +46 -0
- package/node_modules/@backendrelay/platform/dist/esm/util.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.js +3 -0
- package/node_modules/@backendrelay/platform/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/platform/dist/standalone/index.js +13738 -0
- package/node_modules/@backendrelay/platform/dist/standalone/index.umd.cjs +72 -0
- package/node_modules/@backendrelay/platform/package.json +51 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts +67 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js +129 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts +67 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js +126 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/resumable-stream/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.js +4354 -0
- package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.umd.cjs +6 -0
- package/node_modules/@backendrelay/resumable-stream/package.json +47 -0
- package/node_modules/@backendrelay/rules/README.md +34 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts +117 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.js +68 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/rules/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.d.ts +117 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.js +64 -0
- package/node_modules/@backendrelay/rules/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/rules/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/rules/package.json +46 -0
- package/node_modules/@backendrelay/test/README.md +75 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts +74 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.js +197 -0
- package/node_modules/@backendrelay/test/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js +45 -0
- package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/test/dist/esm/index.d.ts +74 -0
- package/node_modules/@backendrelay/test/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/index.js +192 -0
- package/node_modules/@backendrelay/test/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js +43 -0
- package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/test/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/test/package.json +49 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.js +6 -0
- package/node_modules/@backendrelay/version/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.js +10 -0
- package/node_modules/@backendrelay/version/dist/commonjs/version.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/index.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/index.js +3 -0
- package/node_modules/@backendrelay/version/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/version/dist/esm/version.d.ts +3 -0
- package/node_modules/@backendrelay/version/dist/esm/version.d.ts.map +1 -0
- package/node_modules/@backendrelay/version/dist/esm/version.js +7 -0
- package/node_modules/@backendrelay/version/dist/esm/version.js.map +1 -0
- package/node_modules/@backendrelay/version/dist/standalone/index.js +4 -0
- package/node_modules/@backendrelay/version/dist/standalone/index.umd.cjs +1 -0
- package/node_modules/@backendrelay/version/package.json +44 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts +12 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js +5 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js +82 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts +607 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js +830 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js +139 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/commonjs/package.json +3 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts +12 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js +4 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js +80 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts +607 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.js +825 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/index.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts +2 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js +137 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js.map +1 -0
- package/node_modules/@backendrelay/webhooks/dist/esm/package.json +3 -0
- package/node_modules/@backendrelay/webhooks/package.json +46 -0
- package/package.json +129 -56
- package/subpaths/admin/index.cjs +1 -0
- package/subpaths/admin/index.d.ts +1 -0
- package/subpaths/admin/index.mjs +3 -0
- package/subpaths/functions/index.cjs +1 -0
- package/subpaths/functions/index.d.ts +1 -0
- package/subpaths/functions/index.mjs +3 -0
- package/subpaths/hatchet/index.cjs +1 -0
- package/subpaths/hatchet/index.d.ts +1 -0
- package/subpaths/hatchet/index.mjs +3 -0
- package/subpaths/platform/index.cjs +1 -0
- package/subpaths/platform/index.d.ts +1 -0
- package/subpaths/platform/index.mjs +3 -0
- package/subpaths/resumable-stream/index.cjs +1 -0
- package/subpaths/resumable-stream/index.d.ts +1 -0
- package/subpaths/resumable-stream/index.mjs +3 -0
- package/subpaths/rules/index.cjs +1 -0
- package/subpaths/rules/index.d.ts +1 -0
- package/subpaths/rules/index.mjs +3 -0
- package/subpaths/test/index.cjs +1 -0
- package/subpaths/test/index.d.ts +1 -0
- package/subpaths/test/index.mjs +3 -0
- package/subpaths/version/index.cjs +1 -0
- package/subpaths/version/index.d.ts +1 -0
- package/subpaths/version/index.mjs +3 -0
- package/subpaths/webhooks/index.cjs +1 -0
- package/subpaths/webhooks/index.d.ts +1 -0
- package/subpaths/webhooks/index.mjs +3 -0
- package/.tshy/build.json +0 -8
- package/.tshy/commonjs.json +0 -16
- package/.tshy/esm.json +0 -15
- package/__example__/standalone.esm.html +0 -23
- package/__example__/standalone.umd.html +0 -21
- package/__tests__/src/Connection.test.ts +0 -292
- package/__tests__/src/IndexedDBStorage.test.ts +0 -96
- package/__tests__/src/Reactor.test.ts +0 -1179
- package/__tests__/src/auth-extra-fields.e2e.test.ts +0 -160
- package/__tests__/src/byop.e2e.test.ts +0 -762
- package/__tests__/src/config.test.ts +0 -85
- package/__tests__/src/cookieSync.e2e.test.ts +0 -163
- package/__tests__/src/data/movies/attrs.json +0 -145
- package/__tests__/src/data/movies/triples.json +0 -1507
- package/__tests__/src/data/zeneca/attrs.json +0 -251
- package/__tests__/src/data/zeneca/triples.json +0 -15854
- package/__tests__/src/datalog.test.ts +0 -175
- package/__tests__/src/devtool.test.ts +0 -23
- package/__tests__/src/framework.test.ts +0 -173
- package/__tests__/src/infiniteQuery.e2e.test.ts +0 -467
- package/__tests__/src/instaml.test.ts +0 -1593
- package/__tests__/src/instaql.bench.ts +0 -34
- package/__tests__/src/instaql.test.ts +0 -1497
- package/__tests__/src/instaqlInference.test.ts +0 -243
- package/__tests__/src/presence.test.ts +0 -49
- package/__tests__/src/queryValidation.test.ts +0 -1101
- package/__tests__/src/schema.test.ts +0 -653
- package/__tests__/src/serializeSchema.test.ts +0 -123
- package/__tests__/src/simple.e2e.test.ts +0 -133
- package/__tests__/src/storage-upload.test.ts +0 -37
- package/__tests__/src/store.test.ts +0 -960
- package/__tests__/src/syncTable.e2e.test.ts +0 -245
- package/__tests__/src/syncTable.test.ts +0 -235
- package/__tests__/src/transactionValidation.test.ts +0 -450
- package/__tests__/src/typeUtils.ts +0 -39
- package/__tests__/src/upstream-improvements.e2e.test.ts +0 -54
- package/__tests__/src/utils/MutationStorage.test.ts +0 -77
- package/__tests__/src/utils/PersistedObject.test.ts +0 -569
- package/__tests__/src/utils/dates.test.ts +0 -111
- package/__tests__/src/utils/e2e.ts +0 -100
- package/__tests__/src/utils/msw.ts +0 -3
- package/__tests__/src/utils/object.test.ts +0 -78
- package/__tests__/src/utils/weakHash.test.ts +0 -68
- package/__tests__/src/utils/weakHashLegacy.test.ts +0 -22
- package/__tests__/src/vite.env.d.ts +0 -1
- package/src/BackendRelayError.ts +0 -50
- package/src/Connection.ts +0 -361
- package/src/InMemoryStorage.ts +0 -34
- package/src/IndexedDBStorage.ts +0 -398
- package/src/Reactor.js +0 -1541
- package/src/StorageAPI.ts +0 -147
- package/src/Stream.ts +0 -1252
- package/src/SyncTable.ts +0 -750
- package/src/WindowNetworkListener.js +0 -19
- package/src/__types__/fieldsTypeTest.ts +0 -111
- package/src/__types__/typeUtils.ts +0 -39
- package/src/__types__/useDatesTypeTest.ts +0 -66
- package/src/attrTypes.ts +0 -37
- package/src/authAPI.ts +0 -205
- package/src/clientTypes.ts +0 -28
- package/src/coreTypes.ts +0 -58
- package/src/createRouteHandler.ts +0 -68
- package/src/datalog.js +0 -116
- package/src/devtool.ts +0 -179
- package/src/framework.ts +0 -450
- package/src/helperTypes.ts +0 -117
- package/src/index.ts +0 -1293
- package/src/infiniteQuery.ts +0 -599
- package/src/instaml.ts +0 -676
- package/src/instaql.ts +0 -999
- package/src/instatx.ts +0 -265
- package/src/model/instaqlResult.js +0 -25
- package/src/parseSchemaFromJSON.ts +0 -176
- package/src/presence.ts +0 -123
- package/src/presenceTypes.ts +0 -19
- package/src/queryTypes.ts +0 -749
- package/src/queryValidation.ts +0 -598
- package/src/reactorAuth.js +0 -236
- package/src/reactorEvents.js +0 -414
- package/src/reactorMutations.js +0 -354
- package/src/reactorRooms.js +0 -297
- package/src/reactorStorage.js +0 -180
- package/src/reactorSubs.js +0 -275
- package/src/reactorTransport.js +0 -391
- package/src/reactorTypes.ts +0 -41
- package/src/routeHandlerProtocol.ts +0 -25
- package/src/rulesTypes.ts +0 -132
- package/src/sanityCheckQueries.ts +0 -191
- package/src/schema.ts +0 -206
- package/src/schemaTypes.ts +0 -664
- package/src/store.ts +0 -1165
- package/src/transactionValidation.ts +0 -204
- package/src/urls.ts +0 -50
- package/src/utils/Deferred.ts +0 -20
- package/src/utils/MutationStorage.ts +0 -89
- package/src/utils/PersistedObject.ts +0 -612
- package/src/utils/dates.ts +0 -269
- package/src/utils/error.ts +0 -9
- package/src/utils/fetch.ts +0 -131
- package/src/utils/flags.ts +0 -14
- package/src/utils/id.ts +0 -28
- package/src/utils/linkIndex.ts +0 -33
- package/src/utils/log.ts +0 -23
- package/src/utils/object.js +0 -180
- package/src/utils/pgtime.ts +0 -199
- package/src/utils/pick.js +0 -9
- package/src/utils/strings.ts +0 -19
- package/src/utils/weakHash.ts +0 -77
- package/src/utils/weakHashLegacy.ts +0 -75
- package/src/warningToggle.ts +0 -5
- package/tsconfig.cjs.dev.json +0 -15
- package/tsconfig.dev.json +0 -14
- package/tsconfig.json +0 -13
- package/tsconfig.test.json +0 -5
- package/vite.config.ts +0 -19
- package/vitest.config.ts +0 -54
|
@@ -1,960 +0,0 @@
|
|
|
1
|
-
import { test, expect, vi } from 'vitest';
|
|
2
|
-
import zenecaAttrs from './data/zeneca/attrs.json';
|
|
3
|
-
import zenecaTriples from './data/zeneca/triples.json';
|
|
4
|
-
import {
|
|
5
|
-
createStore,
|
|
6
|
-
allMapValues,
|
|
7
|
-
toJSON,
|
|
8
|
-
fromJSON,
|
|
9
|
-
transact,
|
|
10
|
-
AttrsStoreClass,
|
|
11
|
-
getAttrByFwdIdentName,
|
|
12
|
-
getTriples,
|
|
13
|
-
Store,
|
|
14
|
-
AttrsStore,
|
|
15
|
-
attrsStoreFromJSON,
|
|
16
|
-
} from '../../src/store';
|
|
17
|
-
import query from '../../src/instaql';
|
|
18
|
-
import uuid from '../../src/utils/id';
|
|
19
|
-
import { tx } from '../../src/instatx';
|
|
20
|
-
import * as instaml from '../../src/instaml';
|
|
21
|
-
import * as datalog from '../../src/datalog';
|
|
22
|
-
import * as instatx from '../../src/instatx';
|
|
23
|
-
import { i, id } from '../../src';
|
|
24
|
-
import { createLinkIndex } from '../../src/utils/linkIndex';
|
|
25
|
-
|
|
26
|
-
const zenecaAttrsStore = new AttrsStoreClass(
|
|
27
|
-
zenecaAttrs.reduce((res, x) => {
|
|
28
|
-
res[x.id] = x;
|
|
29
|
-
return res;
|
|
30
|
-
}, {}),
|
|
31
|
-
null,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const store = createStore(
|
|
35
|
-
zenecaAttrsStore,
|
|
36
|
-
zenecaTriples as [string, string, any, number][],
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
function checkIndexIntegrity({
|
|
40
|
-
store,
|
|
41
|
-
attrsStore,
|
|
42
|
-
}: {
|
|
43
|
-
store: Store;
|
|
44
|
-
attrsStore: AttrsStore;
|
|
45
|
-
}) {
|
|
46
|
-
const tripleSort = (a, b) => {
|
|
47
|
-
const [e_a, aid_a, v_a, t_a] = a;
|
|
48
|
-
const [e_b, aid_b, v_b, t_b] = b;
|
|
49
|
-
|
|
50
|
-
const e_compare = e_a.localeCompare(e_b);
|
|
51
|
-
if (e_compare !== 0) {
|
|
52
|
-
return e_compare;
|
|
53
|
-
}
|
|
54
|
-
const a_compare = aid_a.localeCompare(aid_b);
|
|
55
|
-
if (a_compare !== 0) {
|
|
56
|
-
return a_compare;
|
|
57
|
-
}
|
|
58
|
-
const v_compare = JSON.stringify(v_a).localeCompare(JSON.stringify(v_b));
|
|
59
|
-
if (v_compare !== 0) {
|
|
60
|
-
return v_compare;
|
|
61
|
-
}
|
|
62
|
-
return t_a - t_b;
|
|
63
|
-
};
|
|
64
|
-
const eavTriples = allMapValues(store.eav, 3).sort(tripleSort);
|
|
65
|
-
const aevTriples = allMapValues(store.aev, 3).sort(tripleSort);
|
|
66
|
-
const aveTriples = allMapValues(store.ave, 3).sort(tripleSort);
|
|
67
|
-
const vaeTriples = allMapValues(store.vae, 3);
|
|
68
|
-
|
|
69
|
-
// Check eav, aev, and ave have all the same triples
|
|
70
|
-
for (let i = 0; i < eavTriples.length; i++) {
|
|
71
|
-
const et = eavTriples[i];
|
|
72
|
-
const at = aevTriples[i];
|
|
73
|
-
const av = aveTriples[i];
|
|
74
|
-
expect(et).toEqual(at);
|
|
75
|
-
expect(et).toEqual(av);
|
|
76
|
-
}
|
|
77
|
-
expect(eavTriples.length).toEqual(aevTriples.length);
|
|
78
|
-
expect(eavTriples.length).toEqual(aveTriples.length);
|
|
79
|
-
|
|
80
|
-
// Check vae doesn't have extra triples
|
|
81
|
-
for (const triple of vaeTriples) {
|
|
82
|
-
const [e, a, v] = triple;
|
|
83
|
-
expect(store.eav.get(e)?.get(a)?.get(v)).toEqual(triple);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Check vae has all of the triples it should have
|
|
87
|
-
for (const triple of eavTriples) {
|
|
88
|
-
const [e, a, v] = triple;
|
|
89
|
-
const attr = attrsStore.getAttr(a)!;
|
|
90
|
-
if (attr['value-type'] === 'ref') {
|
|
91
|
-
expect(store.vae.get(v)?.get(a)?.get(e)).toEqual(triple);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
test('simple add', () => {
|
|
97
|
-
const id = uuid();
|
|
98
|
-
const chunk = tx.users[id].update({ handle: 'bobby' });
|
|
99
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, chunk);
|
|
100
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
101
|
-
expect(query(newCtx, { users: {} }).data.users.map((x) => x.handle)).contains(
|
|
102
|
-
'bobby',
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
checkIndexIntegrity(newCtx);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
test('cardinality-one add', () => {
|
|
109
|
-
const id = uuid();
|
|
110
|
-
const chunk = tx.users[id]
|
|
111
|
-
.update({ handle: 'bobby' })
|
|
112
|
-
.update({ handle: 'bob' });
|
|
113
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, chunk);
|
|
114
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
115
|
-
const ret = datalog
|
|
116
|
-
.query(newCtx.store, {
|
|
117
|
-
find: ['?v'],
|
|
118
|
-
where: [[id, '?attr', '?v']],
|
|
119
|
-
})
|
|
120
|
-
.flatMap((vec) => vec[0]);
|
|
121
|
-
expect(ret).contains('bob');
|
|
122
|
-
expect(ret).not.contains('bobby');
|
|
123
|
-
checkIndexIntegrity(newCtx);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
test('link/unlink', () => {
|
|
127
|
-
const bookshelfId = uuid();
|
|
128
|
-
const userId = uuid();
|
|
129
|
-
const userChunk = tx.users[userId]
|
|
130
|
-
.update({ handle: 'bobby' })
|
|
131
|
-
.link({ bookshelves: bookshelfId });
|
|
132
|
-
const bookshelfChunk = tx.bookshelves[bookshelfId].update({
|
|
133
|
-
name: 'my books',
|
|
134
|
-
});
|
|
135
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
136
|
-
userChunk,
|
|
137
|
-
bookshelfChunk,
|
|
138
|
-
]);
|
|
139
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
140
|
-
expect(
|
|
141
|
-
query(newCtx, {
|
|
142
|
-
users: {
|
|
143
|
-
$: { where: { handle: 'bobby' } },
|
|
144
|
-
bookshelves: {},
|
|
145
|
-
},
|
|
146
|
-
}).data.users.map((x) => [x.handle, x.bookshelves.map((x) => x.name)]),
|
|
147
|
-
).toEqual([['bobby', ['my books']]]);
|
|
148
|
-
checkIndexIntegrity(newCtx);
|
|
149
|
-
|
|
150
|
-
const secondBookshelfId = uuid();
|
|
151
|
-
const secondBookshelfChunk = tx.bookshelves[secondBookshelfId].update({
|
|
152
|
-
name: 'my second books',
|
|
153
|
-
});
|
|
154
|
-
const unlinkFirstChunk = tx.users[userId]
|
|
155
|
-
.unlink({
|
|
156
|
-
bookshelves: bookshelfId,
|
|
157
|
-
})
|
|
158
|
-
.link({ bookshelves: secondBookshelfId });
|
|
159
|
-
const secondTxSteps = instaml.transform({ attrsStore: newCtx.attrsStore }, [
|
|
160
|
-
unlinkFirstChunk,
|
|
161
|
-
secondBookshelfChunk,
|
|
162
|
-
]);
|
|
163
|
-
const secondCtx = transact(newCtx.store, newCtx.attrsStore, secondTxSteps);
|
|
164
|
-
expect(
|
|
165
|
-
query(secondCtx, {
|
|
166
|
-
users: {
|
|
167
|
-
$: { where: { handle: 'bobby' } },
|
|
168
|
-
bookshelves: {},
|
|
169
|
-
},
|
|
170
|
-
}).data.users.map((x) => [x.handle, x.bookshelves.map((x) => x.name)]),
|
|
171
|
-
).toEqual([['bobby', ['my second books']]]);
|
|
172
|
-
checkIndexIntegrity(secondCtx);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
test('link/unlink multi', () => {
|
|
176
|
-
const bookshelfId1 = uuid();
|
|
177
|
-
const bookshelfId2 = uuid();
|
|
178
|
-
const userId = uuid();
|
|
179
|
-
const userChunk = tx.users[userId]
|
|
180
|
-
.update({ handle: 'bobby' })
|
|
181
|
-
.link({ bookshelves: [bookshelfId1, bookshelfId2] });
|
|
182
|
-
|
|
183
|
-
const bookshelf1Chunk = tx.bookshelves[bookshelfId1].update({
|
|
184
|
-
name: 'my books 1',
|
|
185
|
-
});
|
|
186
|
-
const bookshelf2Chunk = tx.bookshelves[bookshelfId2].update({
|
|
187
|
-
name: 'my books 2',
|
|
188
|
-
});
|
|
189
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
190
|
-
userChunk,
|
|
191
|
-
bookshelf1Chunk,
|
|
192
|
-
bookshelf2Chunk,
|
|
193
|
-
]);
|
|
194
|
-
|
|
195
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
196
|
-
expect(
|
|
197
|
-
query(newCtx, {
|
|
198
|
-
users: {
|
|
199
|
-
$: { where: { handle: 'bobby' } },
|
|
200
|
-
bookshelves: {},
|
|
201
|
-
},
|
|
202
|
-
}).data.users.map((x) => [x.handle, x.bookshelves.map((x) => x.name)]),
|
|
203
|
-
).toEqual([['bobby', ['my books 1', 'my books 2']]]);
|
|
204
|
-
checkIndexIntegrity(newCtx);
|
|
205
|
-
|
|
206
|
-
const bookshelfId3 = uuid();
|
|
207
|
-
const bookshelf3Chunk = tx.bookshelves[bookshelfId3].update({
|
|
208
|
-
name: 'my books 3',
|
|
209
|
-
});
|
|
210
|
-
const unlinkChunk = tx.users[userId]
|
|
211
|
-
.unlink({
|
|
212
|
-
bookshelves: [bookshelfId1, bookshelfId2],
|
|
213
|
-
})
|
|
214
|
-
.link({ bookshelves: bookshelfId3 });
|
|
215
|
-
const secondTxSteps = instaml.transform({ attrsStore: newCtx.attrsStore }, [
|
|
216
|
-
unlinkChunk,
|
|
217
|
-
bookshelf3Chunk,
|
|
218
|
-
]);
|
|
219
|
-
const secondCtx = transact(newCtx.store, newCtx.attrsStore, secondTxSteps);
|
|
220
|
-
expect(
|
|
221
|
-
query(secondCtx, {
|
|
222
|
-
users: {
|
|
223
|
-
$: { where: { handle: 'bobby' } },
|
|
224
|
-
bookshelves: {},
|
|
225
|
-
},
|
|
226
|
-
}).data.users.map((x) => [x.handle, x.bookshelves.map((x) => x.name)]),
|
|
227
|
-
).toEqual([['bobby', ['my books 3']]]);
|
|
228
|
-
checkIndexIntegrity(secondCtx);
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
test('link/unlink without update', () => {
|
|
232
|
-
const bookshelfId = uuid();
|
|
233
|
-
const userId = uuid();
|
|
234
|
-
const userChunk = tx.users[userId].update({ handle: 'bobby' });
|
|
235
|
-
const bookshelfChunk = tx.bookshelves[bookshelfId].update({
|
|
236
|
-
name: 'my books',
|
|
237
|
-
});
|
|
238
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
239
|
-
userChunk,
|
|
240
|
-
bookshelfChunk,
|
|
241
|
-
]);
|
|
242
|
-
const ctx2 = transact(store, zenecaAttrsStore, txSteps);
|
|
243
|
-
|
|
244
|
-
const linkChunk = tx.users[userId].link({ bookshelves: bookshelfId });
|
|
245
|
-
const ctx3 = transact(
|
|
246
|
-
ctx2.store,
|
|
247
|
-
ctx2.attrsStore,
|
|
248
|
-
instaml.transform(ctx2, [linkChunk]),
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
expect(
|
|
252
|
-
query(ctx3, {
|
|
253
|
-
users: {
|
|
254
|
-
$: { where: { handle: 'bobby' } },
|
|
255
|
-
bookshelves: {},
|
|
256
|
-
},
|
|
257
|
-
}).data.users.map((x) => [x.handle, x.bookshelves.map((x) => x.name)]),
|
|
258
|
-
).toEqual([['bobby', ['my books']]]);
|
|
259
|
-
checkIndexIntegrity(ctx3);
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
test('delete entity', () => {
|
|
263
|
-
const bookshelfId = uuid();
|
|
264
|
-
const userId = uuid();
|
|
265
|
-
const userChunk = tx.users[userId]
|
|
266
|
-
.update({ handle: 'bobby' })
|
|
267
|
-
.link({ bookshelves: bookshelfId });
|
|
268
|
-
const bookshelfChunk = tx.bookshelves[bookshelfId].update({
|
|
269
|
-
name: 'my books',
|
|
270
|
-
});
|
|
271
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
272
|
-
userChunk,
|
|
273
|
-
bookshelfChunk,
|
|
274
|
-
]);
|
|
275
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
276
|
-
checkIndexIntegrity(newCtx);
|
|
277
|
-
|
|
278
|
-
const retOne = datalog
|
|
279
|
-
.query(newCtx.store, {
|
|
280
|
-
find: ['?v'],
|
|
281
|
-
where: [[bookshelfId, '?attr', '?v']],
|
|
282
|
-
})
|
|
283
|
-
.flatMap((vec) => vec[0]);
|
|
284
|
-
const retTwo = datalog
|
|
285
|
-
.query(newCtx.store, {
|
|
286
|
-
find: ['?v'],
|
|
287
|
-
where: [['?v', '?attr', bookshelfId]],
|
|
288
|
-
})
|
|
289
|
-
.flatMap((vec) => vec[0]);
|
|
290
|
-
expect(retOne).contains('my books');
|
|
291
|
-
expect(retTwo).contains(userId);
|
|
292
|
-
|
|
293
|
-
const txStepsTwo = instaml.transform(
|
|
294
|
-
newCtx,
|
|
295
|
-
tx.bookshelves[bookshelfId].delete(),
|
|
296
|
-
);
|
|
297
|
-
const newCtxTwo = transact(newCtx.store, newCtx.attrsStore, txStepsTwo);
|
|
298
|
-
const retThree = datalog
|
|
299
|
-
.query(newCtxTwo.store, {
|
|
300
|
-
find: ['?v'],
|
|
301
|
-
where: [[bookshelfId, '?attr', '?v']],
|
|
302
|
-
})
|
|
303
|
-
.flatMap((vec) => vec[0]);
|
|
304
|
-
const retFour = datalog
|
|
305
|
-
.query(newCtxTwo.store, {
|
|
306
|
-
find: ['?v'],
|
|
307
|
-
where: [['?v', '?attr', bookshelfId]],
|
|
308
|
-
})
|
|
309
|
-
.flatMap((vec) => vec[0]);
|
|
310
|
-
|
|
311
|
-
expect(retThree).toEqual([]);
|
|
312
|
-
expect(retFour).toEqual([]);
|
|
313
|
-
checkIndexIntegrity(newCtxTwo);
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
test('on-delete cascade', () => {
|
|
317
|
-
const book1 = uuid();
|
|
318
|
-
const book2 = uuid();
|
|
319
|
-
const book3 = uuid();
|
|
320
|
-
const chunk1 = tx.books[book1].update({
|
|
321
|
-
title: 'book1',
|
|
322
|
-
description: 'series',
|
|
323
|
-
});
|
|
324
|
-
const chunk2 = tx.books[book2]
|
|
325
|
-
.update({ title: 'book2', description: 'series' })
|
|
326
|
-
.link({ prequel: book1 });
|
|
327
|
-
const chunk3 = tx.books[book3]
|
|
328
|
-
.update({ title: 'book3', description: 'series' })
|
|
329
|
-
.link({ prequel: book2 });
|
|
330
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
331
|
-
chunk1,
|
|
332
|
-
chunk2,
|
|
333
|
-
chunk3,
|
|
334
|
-
]);
|
|
335
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
336
|
-
checkIndexIntegrity(newCtx);
|
|
337
|
-
expect(
|
|
338
|
-
query(newCtx, {
|
|
339
|
-
books: { $: { where: { description: 'series' } } },
|
|
340
|
-
}).data.books.map((x) => x.title),
|
|
341
|
-
).toEqual(['book1', 'book2', 'book3']);
|
|
342
|
-
|
|
343
|
-
const txStepsTwo = instaml.transform(newCtx, tx.books[book1].delete());
|
|
344
|
-
const newCtxTwo = transact(newCtx.store, newCtx.attrsStore, txStepsTwo);
|
|
345
|
-
expect(
|
|
346
|
-
query(newCtxTwo, {
|
|
347
|
-
books: { $: { where: { description: 'series' } } },
|
|
348
|
-
}).data.books.map((x) => x.title),
|
|
349
|
-
).toEqual([]);
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
test('on-delete-reverse cascade', () => {
|
|
353
|
-
const book1 = uuid();
|
|
354
|
-
const book2 = uuid();
|
|
355
|
-
const book3 = uuid();
|
|
356
|
-
|
|
357
|
-
const chunk2 = tx.books[book2].update({
|
|
358
|
-
title: 'book2',
|
|
359
|
-
description: 'series',
|
|
360
|
-
});
|
|
361
|
-
const chunk3 = tx.books[book3].update({
|
|
362
|
-
title: 'book3',
|
|
363
|
-
description: 'series',
|
|
364
|
-
});
|
|
365
|
-
const chunk1 = tx.books[book1]
|
|
366
|
-
.update({
|
|
367
|
-
title: 'book1',
|
|
368
|
-
description: 'series',
|
|
369
|
-
})
|
|
370
|
-
.link({ next: [book2, book3] });
|
|
371
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
372
|
-
chunk2,
|
|
373
|
-
chunk3,
|
|
374
|
-
chunk1,
|
|
375
|
-
]);
|
|
376
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
377
|
-
checkIndexIntegrity(newCtx);
|
|
378
|
-
expect(
|
|
379
|
-
query(newCtx, {
|
|
380
|
-
books: { $: { where: { description: 'series' } } },
|
|
381
|
-
}).data.books.map((x) => x.title),
|
|
382
|
-
).toEqual(['book2', 'book3', 'book1']);
|
|
383
|
-
|
|
384
|
-
const txStepsTwo = instaml.transform(newCtx, tx.books[book1].delete());
|
|
385
|
-
const newCtxTwo = transact(newCtx.store, newCtx.attrsStore, txStepsTwo);
|
|
386
|
-
expect(
|
|
387
|
-
query(newCtxTwo, {
|
|
388
|
-
books: { $: { where: { description: 'series' } } },
|
|
389
|
-
}).data.books.map((x) => x.title),
|
|
390
|
-
).toEqual([]);
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
test('new attrs', () => {
|
|
394
|
-
const colorId = uuid();
|
|
395
|
-
const userId = uuid();
|
|
396
|
-
const userChunk = tx.users[userId]
|
|
397
|
-
.update({ handle: 'bobby' })
|
|
398
|
-
.link({ colors: colorId });
|
|
399
|
-
const colorChunk = tx.colors[colorId].update({ name: 'red' });
|
|
400
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, [
|
|
401
|
-
userChunk,
|
|
402
|
-
colorChunk,
|
|
403
|
-
]);
|
|
404
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
405
|
-
expect(
|
|
406
|
-
query(newCtx, {
|
|
407
|
-
users: {
|
|
408
|
-
$: { where: { handle: 'bobby' } },
|
|
409
|
-
colors: {},
|
|
410
|
-
},
|
|
411
|
-
}).data.users.map((x) => [x.handle, x.colors.map((x) => x.name)]),
|
|
412
|
-
).toEqual([['bobby', ['red']]]);
|
|
413
|
-
|
|
414
|
-
checkIndexIntegrity(newCtx);
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
test('delete attr', () => {
|
|
418
|
-
expect(
|
|
419
|
-
query(
|
|
420
|
-
{ store, attrsStore: zenecaAttrsStore },
|
|
421
|
-
{ users: {} },
|
|
422
|
-
).data.users.map((x) => [x.handle, x.fullName]),
|
|
423
|
-
).toEqual([
|
|
424
|
-
['joe', 'Joe Averbukh'],
|
|
425
|
-
['alex', 'Alex'],
|
|
426
|
-
['stopa', 'Stepan Parunashvili'],
|
|
427
|
-
['nicolegf', 'Nicole'],
|
|
428
|
-
]);
|
|
429
|
-
const fullNameAttr = getAttrByFwdIdentName(
|
|
430
|
-
zenecaAttrsStore,
|
|
431
|
-
'users',
|
|
432
|
-
'fullName',
|
|
433
|
-
);
|
|
434
|
-
const newCtx = transact(store, zenecaAttrsStore, [
|
|
435
|
-
['delete-attr', fullNameAttr!.id],
|
|
436
|
-
]);
|
|
437
|
-
expect(
|
|
438
|
-
query(newCtx, { users: {} }).data.users.map((x) => [x.handle, x.fullName]),
|
|
439
|
-
).toEqual([
|
|
440
|
-
['joe', undefined],
|
|
441
|
-
['alex', undefined],
|
|
442
|
-
['stopa', undefined],
|
|
443
|
-
['nicolegf', undefined],
|
|
444
|
-
]);
|
|
445
|
-
|
|
446
|
-
checkIndexIntegrity(newCtx);
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
test('update attr', () => {
|
|
450
|
-
expect(
|
|
451
|
-
query(
|
|
452
|
-
{ store, attrsStore: zenecaAttrsStore },
|
|
453
|
-
{ users: {} },
|
|
454
|
-
).data.users.map((x) => [x.handle, x.fullName]),
|
|
455
|
-
).toEqual([
|
|
456
|
-
['joe', 'Joe Averbukh'],
|
|
457
|
-
['alex', 'Alex'],
|
|
458
|
-
['stopa', 'Stepan Parunashvili'],
|
|
459
|
-
['nicolegf', 'Nicole'],
|
|
460
|
-
]);
|
|
461
|
-
const fullNameAttr = getAttrByFwdIdentName(
|
|
462
|
-
zenecaAttrsStore,
|
|
463
|
-
'users',
|
|
464
|
-
'fullName',
|
|
465
|
-
);
|
|
466
|
-
const fwdIdent = fullNameAttr!['forward-identity'];
|
|
467
|
-
const newCtx = transact(store, zenecaAttrsStore, [
|
|
468
|
-
[
|
|
469
|
-
'update-attr',
|
|
470
|
-
{
|
|
471
|
-
id: fullNameAttr!.id,
|
|
472
|
-
'forward-identity': [fwdIdent[0], 'users', 'fullNamez'],
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
]);
|
|
476
|
-
expect(
|
|
477
|
-
query(newCtx, { users: {} }).data.users.map((x) => [x.handle, x.fullNamez]),
|
|
478
|
-
).toEqual([
|
|
479
|
-
['joe', 'Joe Averbukh'],
|
|
480
|
-
['alex', 'Alex'],
|
|
481
|
-
['stopa', 'Stepan Parunashvili'],
|
|
482
|
-
['nicolegf', 'Nicole'],
|
|
483
|
-
]);
|
|
484
|
-
});
|
|
485
|
-
|
|
486
|
-
test('JSON serialization round-trips', () => {
|
|
487
|
-
const newStore = fromJSON(zenecaAttrsStore, toJSON(store));
|
|
488
|
-
expect(store).toEqual(newStore);
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
test('ruleParams no-ops', () => {
|
|
492
|
-
const id = uuid();
|
|
493
|
-
const chunk = tx.users[id]
|
|
494
|
-
.ruleParams({ guestId: 'bobby' })
|
|
495
|
-
.update({ handle: 'bobby' });
|
|
496
|
-
|
|
497
|
-
const txSteps = instaml.transform({ attrsStore: zenecaAttrsStore }, chunk);
|
|
498
|
-
const newCtx = transact(store, zenecaAttrsStore, txSteps);
|
|
499
|
-
expect(query(newCtx, { users: {} }).data.users.map((x) => x.handle)).contains(
|
|
500
|
-
'bobby',
|
|
501
|
-
);
|
|
502
|
-
|
|
503
|
-
checkIndexIntegrity(newCtx);
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
test('deepMerge', () => {
|
|
507
|
-
const gameId = uuid();
|
|
508
|
-
const gameCtx = transact(
|
|
509
|
-
store,
|
|
510
|
-
zenecaAttrsStore,
|
|
511
|
-
instaml.transform(
|
|
512
|
-
{ attrsStore: zenecaAttrsStore },
|
|
513
|
-
tx.games[gameId].update({
|
|
514
|
-
state: {
|
|
515
|
-
score: 100,
|
|
516
|
-
playerStats: { health: 50, mana: 30, ambitions: { win: true } },
|
|
517
|
-
inventory: ['sword', 'potion'],
|
|
518
|
-
locations: ['forest', 'castle'],
|
|
519
|
-
level: 2,
|
|
520
|
-
},
|
|
521
|
-
}),
|
|
522
|
-
),
|
|
523
|
-
);
|
|
524
|
-
|
|
525
|
-
checkIndexIntegrity(gameCtx);
|
|
526
|
-
|
|
527
|
-
const updatedCtx = transact(
|
|
528
|
-
gameCtx.store,
|
|
529
|
-
gameCtx.attrsStore,
|
|
530
|
-
instaml.transform(
|
|
531
|
-
gameCtx,
|
|
532
|
-
tx.games[gameId].merge({
|
|
533
|
-
state: {
|
|
534
|
-
// Objects update deeply
|
|
535
|
-
playerStats: {
|
|
536
|
-
mana: 40,
|
|
537
|
-
stamina: 20,
|
|
538
|
-
ambitions: { acquireWisdom: true, find: ['love'] },
|
|
539
|
-
},
|
|
540
|
-
// arrays overwrite
|
|
541
|
-
inventory: ['shield'],
|
|
542
|
-
// null removes the key
|
|
543
|
-
score: null,
|
|
544
|
-
// undefined is ignored
|
|
545
|
-
level: undefined,
|
|
546
|
-
// undefined is kept in arrays
|
|
547
|
-
locations: ['forest', undefined, 'castle'],
|
|
548
|
-
},
|
|
549
|
-
}),
|
|
550
|
-
),
|
|
551
|
-
);
|
|
552
|
-
|
|
553
|
-
const updatedGame = query(updatedCtx, {
|
|
554
|
-
games: { $: { where: { id: gameId } } },
|
|
555
|
-
}).data.games[0];
|
|
556
|
-
expect(updatedGame.state).toEqual({
|
|
557
|
-
playerStats: {
|
|
558
|
-
health: 50,
|
|
559
|
-
mana: 40,
|
|
560
|
-
stamina: 20,
|
|
561
|
-
ambitions: { win: true, acquireWisdom: true, find: ['love'] },
|
|
562
|
-
},
|
|
563
|
-
level: 2,
|
|
564
|
-
inventory: ['shield'],
|
|
565
|
-
locations: ['forest', undefined, 'castle'],
|
|
566
|
-
});
|
|
567
|
-
checkIndexIntegrity(updatedCtx);
|
|
568
|
-
});
|
|
569
|
-
|
|
570
|
-
test('recursive links w same id', () => {
|
|
571
|
-
const schema = i.schema({
|
|
572
|
-
entities: {
|
|
573
|
-
$files: i.entity({
|
|
574
|
-
path: i.string().unique().indexed(),
|
|
575
|
-
url: i.string(),
|
|
576
|
-
}),
|
|
577
|
-
fakeUsers: i.entity({
|
|
578
|
-
email: i.string().unique().indexed().optional(),
|
|
579
|
-
}),
|
|
580
|
-
todos: i.entity({
|
|
581
|
-
completed: i.boolean().optional(),
|
|
582
|
-
title: i.string().optional(),
|
|
583
|
-
}),
|
|
584
|
-
},
|
|
585
|
-
links: {
|
|
586
|
-
todosCreatedBy: {
|
|
587
|
-
forward: {
|
|
588
|
-
on: 'todos',
|
|
589
|
-
has: 'one',
|
|
590
|
-
label: 'createdBy',
|
|
591
|
-
onDelete: 'cascade',
|
|
592
|
-
},
|
|
593
|
-
reverse: {
|
|
594
|
-
on: 'fakeUsers',
|
|
595
|
-
has: 'many',
|
|
596
|
-
label: 'todos',
|
|
597
|
-
},
|
|
598
|
-
},
|
|
599
|
-
},
|
|
600
|
-
});
|
|
601
|
-
const sameId = id();
|
|
602
|
-
const ops = [
|
|
603
|
-
instatx.tx.todos[sameId].update({
|
|
604
|
-
title: 'todo',
|
|
605
|
-
completed: false,
|
|
606
|
-
}),
|
|
607
|
-
instatx.tx.fakeUsers[sameId].update({
|
|
608
|
-
email: 'test@test.com',
|
|
609
|
-
}),
|
|
610
|
-
instatx.tx.todos[sameId].link({
|
|
611
|
-
createdBy: sameId,
|
|
612
|
-
}),
|
|
613
|
-
];
|
|
614
|
-
|
|
615
|
-
const attrsStore = new AttrsStoreClass({}, createLinkIndex(schema));
|
|
616
|
-
const steps = instaml.transform({ attrsStore, schema }, ops);
|
|
617
|
-
const store = createStore(attrsStore, [], true, !!schema);
|
|
618
|
-
const newCtx = transact(store, attrsStore, steps);
|
|
619
|
-
|
|
620
|
-
const result = query(newCtx, {
|
|
621
|
-
todos: {},
|
|
622
|
-
fakeUsers: {},
|
|
623
|
-
});
|
|
624
|
-
|
|
625
|
-
expect(result.data.todos.length).toBe(1);
|
|
626
|
-
expect(result.data.fakeUsers.length).toBe(1);
|
|
627
|
-
|
|
628
|
-
const removeOp = [instatx.tx.todos[sameId].delete()];
|
|
629
|
-
|
|
630
|
-
const removeSteps = instaml.transform(newCtx, removeOp);
|
|
631
|
-
const postRemoveCtx = transact(newCtx.store, newCtx.attrsStore, removeSteps);
|
|
632
|
-
|
|
633
|
-
const removeResult = query(postRemoveCtx, {
|
|
634
|
-
todos: {},
|
|
635
|
-
fakeUsers: {},
|
|
636
|
-
});
|
|
637
|
-
|
|
638
|
-
expect(removeResult.data.todos.length).toBe(0);
|
|
639
|
-
expect(removeResult.data.fakeUsers.length).toBe(1);
|
|
640
|
-
});
|
|
641
|
-
|
|
642
|
-
test('date conversion', () => {
|
|
643
|
-
expect(() => {
|
|
644
|
-
const schema = i.schema({
|
|
645
|
-
entities: {
|
|
646
|
-
todos: i.entity({
|
|
647
|
-
completed: i.boolean().optional(),
|
|
648
|
-
createdAt: i.date().optional(),
|
|
649
|
-
title: i.string().optional(),
|
|
650
|
-
}),
|
|
651
|
-
},
|
|
652
|
-
});
|
|
653
|
-
const sameId = id();
|
|
654
|
-
const ops = [
|
|
655
|
-
instatx.tx.todos[sameId].update({
|
|
656
|
-
title: 'todo',
|
|
657
|
-
completed: false,
|
|
658
|
-
createdAt: new Date(),
|
|
659
|
-
}),
|
|
660
|
-
];
|
|
661
|
-
|
|
662
|
-
const attrsStore = new AttrsStoreClass({}, null);
|
|
663
|
-
const steps = instaml.transform({ attrsStore, schema }, ops);
|
|
664
|
-
const store = createStore(attrsStore, [], true, true);
|
|
665
|
-
const newCtx = transact(store, attrsStore, steps);
|
|
666
|
-
|
|
667
|
-
const result = query(newCtx, {
|
|
668
|
-
todos: {},
|
|
669
|
-
});
|
|
670
|
-
|
|
671
|
-
expect(result.data.todos.length).toBe(1);
|
|
672
|
-
expect(result.data.todos[0].createdAt).toBeInstanceOf(Date);
|
|
673
|
-
}).not.toThrow();
|
|
674
|
-
|
|
675
|
-
expect(() => {
|
|
676
|
-
const schema = i.schema({
|
|
677
|
-
entities: {
|
|
678
|
-
todos: i.entity({
|
|
679
|
-
completed: i.boolean().optional(),
|
|
680
|
-
createdAt: i.date().optional(),
|
|
681
|
-
title: i.string().optional(),
|
|
682
|
-
}),
|
|
683
|
-
},
|
|
684
|
-
});
|
|
685
|
-
const sameId = id();
|
|
686
|
-
const ops = [
|
|
687
|
-
instatx.tx.todos[sameId].update({
|
|
688
|
-
title: 'todo',
|
|
689
|
-
completed: false,
|
|
690
|
-
createdAt: 99999999999999,
|
|
691
|
-
}),
|
|
692
|
-
];
|
|
693
|
-
|
|
694
|
-
const attrsStore = new AttrsStoreClass({}, null);
|
|
695
|
-
const steps = instaml.transform({ attrsStore, schema }, ops);
|
|
696
|
-
const store = createStore(attrsStore, [], true, false);
|
|
697
|
-
const newCtx = transact(store, attrsStore, steps);
|
|
698
|
-
|
|
699
|
-
const result = query(newCtx, {
|
|
700
|
-
todos: {},
|
|
701
|
-
});
|
|
702
|
-
|
|
703
|
-
expect(result.data.todos.length).toBe(1);
|
|
704
|
-
expect(result.data.todos[0].createdAt).toBeTypeOf('number');
|
|
705
|
-
}).not.toThrow();
|
|
706
|
-
});
|
|
707
|
-
|
|
708
|
-
test('lookup refs use the AVE index after values change', () => {
|
|
709
|
-
const schema = i.schema({
|
|
710
|
-
entities: {
|
|
711
|
-
users: i.entity({
|
|
712
|
-
email: i.string().unique(),
|
|
713
|
-
name: i.string(),
|
|
714
|
-
}),
|
|
715
|
-
},
|
|
716
|
-
});
|
|
717
|
-
const attrsStore = new AttrsStoreClass({}, createLinkIndex(schema));
|
|
718
|
-
const initialCtx = {
|
|
719
|
-
store: createStore(attrsStore, []),
|
|
720
|
-
attrsStore,
|
|
721
|
-
schema,
|
|
722
|
-
};
|
|
723
|
-
const userId = uuid();
|
|
724
|
-
const createdCtx = transact(
|
|
725
|
-
initialCtx.store,
|
|
726
|
-
initialCtx.attrsStore,
|
|
727
|
-
instaml.transform(
|
|
728
|
-
initialCtx,
|
|
729
|
-
tx.users[userId].update({ email: 'before@example.com' }),
|
|
730
|
-
),
|
|
731
|
-
);
|
|
732
|
-
const emailAttr = getAttrByFwdIdentName(
|
|
733
|
-
createdCtx.attrsStore,
|
|
734
|
-
'users',
|
|
735
|
-
'email',
|
|
736
|
-
)!;
|
|
737
|
-
|
|
738
|
-
expect(
|
|
739
|
-
createdCtx.store.ave
|
|
740
|
-
.get(emailAttr.id)
|
|
741
|
-
?.get('before@example.com')
|
|
742
|
-
?.get(userId),
|
|
743
|
-
).toBeDefined();
|
|
744
|
-
|
|
745
|
-
const updatedCtx = transact(
|
|
746
|
-
createdCtx.store,
|
|
747
|
-
createdCtx.attrsStore,
|
|
748
|
-
instaml.transform(
|
|
749
|
-
{ ...createdCtx, schema },
|
|
750
|
-
tx.users[instatx.lookup('email', 'before@example.com')].update({
|
|
751
|
-
email: 'after@example.com',
|
|
752
|
-
}),
|
|
753
|
-
),
|
|
754
|
-
);
|
|
755
|
-
|
|
756
|
-
expect(
|
|
757
|
-
updatedCtx.store.ave
|
|
758
|
-
.get(emailAttr.id)
|
|
759
|
-
?.get('before@example.com')
|
|
760
|
-
?.get(userId),
|
|
761
|
-
).toBeUndefined();
|
|
762
|
-
expect(
|
|
763
|
-
updatedCtx.store.ave
|
|
764
|
-
.get(emailAttr.id)
|
|
765
|
-
?.get('after@example.com')
|
|
766
|
-
?.get(userId),
|
|
767
|
-
).toBeDefined();
|
|
768
|
-
|
|
769
|
-
const lookedUpCtx = transact(
|
|
770
|
-
updatedCtx.store,
|
|
771
|
-
updatedCtx.attrsStore,
|
|
772
|
-
instaml.transform(
|
|
773
|
-
{ ...updatedCtx, schema },
|
|
774
|
-
tx.users[instatx.lookup('email', 'after@example.com')].update({
|
|
775
|
-
name: 'Updated by lookup',
|
|
776
|
-
}),
|
|
777
|
-
),
|
|
778
|
-
);
|
|
779
|
-
|
|
780
|
-
expect(query(lookedUpCtx, { users: {} }).data.users).toEqual([
|
|
781
|
-
{ id: userId, email: 'after@example.com', name: 'Updated by lookup' },
|
|
782
|
-
]);
|
|
783
|
-
});
|
|
784
|
-
|
|
785
|
-
test('ordered predicates use the sorted attribute index in AEV order', () => {
|
|
786
|
-
const attrsStore = new AttrsStoreClass(
|
|
787
|
-
{
|
|
788
|
-
score: {
|
|
789
|
-
id: 'score',
|
|
790
|
-
'value-type': 'blob',
|
|
791
|
-
cardinality: 'one',
|
|
792
|
-
'forward-identity': ['score-fwd', 'scores', 'value'],
|
|
793
|
-
'unique?': false,
|
|
794
|
-
'index?': true,
|
|
795
|
-
'required?': false,
|
|
796
|
-
'inferred-types': ['number'],
|
|
797
|
-
catalog: 'user',
|
|
798
|
-
'checked-data-type': 'number',
|
|
799
|
-
},
|
|
800
|
-
},
|
|
801
|
-
null,
|
|
802
|
-
);
|
|
803
|
-
const indexedStore = createStore(
|
|
804
|
-
attrsStore,
|
|
805
|
-
Array.from({ length: 64 }, (_, i) => [`score-${i}`, 'score', i, i]) as [
|
|
806
|
-
string,
|
|
807
|
-
string,
|
|
808
|
-
number,
|
|
809
|
-
number,
|
|
810
|
-
][],
|
|
811
|
-
);
|
|
812
|
-
const op = vi.fn((triple) => triple[2] > 1);
|
|
813
|
-
|
|
814
|
-
expect(indexedStore.orderedAV.has('score')).toBe(false);
|
|
815
|
-
expect(
|
|
816
|
-
getTriples(indexedStore, [
|
|
817
|
-
undefined,
|
|
818
|
-
'score',
|
|
819
|
-
{
|
|
820
|
-
$comparator: true,
|
|
821
|
-
$order: 'gt',
|
|
822
|
-
$dataType: 'number',
|
|
823
|
-
$value: 1,
|
|
824
|
-
$op: op,
|
|
825
|
-
},
|
|
826
|
-
]),
|
|
827
|
-
).toEqual(
|
|
828
|
-
Array.from({ length: 62 }, (_, i) => [
|
|
829
|
-
`score-${i + 2}`,
|
|
830
|
-
'score',
|
|
831
|
-
i + 2,
|
|
832
|
-
i + 2,
|
|
833
|
-
]),
|
|
834
|
-
);
|
|
835
|
-
expect(op).toHaveBeenCalledTimes(64);
|
|
836
|
-
expect(indexedStore.orderedAV.has('score')).toBe(false);
|
|
837
|
-
|
|
838
|
-
op.mockClear();
|
|
839
|
-
op.mockImplementation((triple) => triple[2] > 62);
|
|
840
|
-
getTriples(indexedStore, [
|
|
841
|
-
undefined,
|
|
842
|
-
'score',
|
|
843
|
-
{
|
|
844
|
-
$comparator: true,
|
|
845
|
-
$order: 'gt',
|
|
846
|
-
$dataType: 'number',
|
|
847
|
-
$value: 62,
|
|
848
|
-
$op: op,
|
|
849
|
-
},
|
|
850
|
-
]);
|
|
851
|
-
const cachedIndex = indexedStore.orderedAV.get('score');
|
|
852
|
-
expect(cachedIndex).toBeDefined();
|
|
853
|
-
expect(op).toHaveBeenCalledTimes(64);
|
|
854
|
-
|
|
855
|
-
op.mockClear();
|
|
856
|
-
op.mockImplementation((triple) => triple[2] >= 62);
|
|
857
|
-
getTriples(indexedStore, [
|
|
858
|
-
undefined,
|
|
859
|
-
'score',
|
|
860
|
-
{
|
|
861
|
-
$comparator: true,
|
|
862
|
-
$order: 'gte',
|
|
863
|
-
$dataType: 'number',
|
|
864
|
-
$value: 62,
|
|
865
|
-
$op: op,
|
|
866
|
-
},
|
|
867
|
-
]);
|
|
868
|
-
expect(indexedStore.orderedAV.get('score')).toBe(cachedIndex);
|
|
869
|
-
expect(op).not.toHaveBeenCalled();
|
|
870
|
-
|
|
871
|
-
op.mockClear();
|
|
872
|
-
op.mockImplementation((triple) => triple[2] >= 1);
|
|
873
|
-
expect(
|
|
874
|
-
getTriples(indexedStore, [
|
|
875
|
-
undefined,
|
|
876
|
-
'score',
|
|
877
|
-
{
|
|
878
|
-
$comparator: true,
|
|
879
|
-
$order: 'gte',
|
|
880
|
-
$dataType: 'number',
|
|
881
|
-
$value: 1,
|
|
882
|
-
$op: op,
|
|
883
|
-
},
|
|
884
|
-
]),
|
|
885
|
-
).toHaveLength(63);
|
|
886
|
-
expect(op).toHaveBeenCalledTimes(64);
|
|
887
|
-
|
|
888
|
-
const updatedStore = transact(indexedStore, attrsStore, [
|
|
889
|
-
['add-triple', 'score-63', 'score', 100],
|
|
890
|
-
]).store;
|
|
891
|
-
expect(updatedStore.orderedAV.has('score')).toBe(false);
|
|
892
|
-
op.mockImplementation((triple) => triple[2] > 99);
|
|
893
|
-
expect(
|
|
894
|
-
getTriples(updatedStore, [
|
|
895
|
-
undefined,
|
|
896
|
-
'score',
|
|
897
|
-
{
|
|
898
|
-
$comparator: true,
|
|
899
|
-
$order: 'gt',
|
|
900
|
-
$dataType: 'number',
|
|
901
|
-
$value: 99,
|
|
902
|
-
$op: op,
|
|
903
|
-
},
|
|
904
|
-
]),
|
|
905
|
-
).toEqual([['score-63', 'score', 100, expect.any(Number)]]);
|
|
906
|
-
expect(updatedStore.orderedAV.has('score')).toBe(false);
|
|
907
|
-
|
|
908
|
-
getTriples(updatedStore, [
|
|
909
|
-
undefined,
|
|
910
|
-
'score',
|
|
911
|
-
{
|
|
912
|
-
$comparator: true,
|
|
913
|
-
$order: 'gt',
|
|
914
|
-
$dataType: 'number',
|
|
915
|
-
$value: 99,
|
|
916
|
-
$op: op,
|
|
917
|
-
},
|
|
918
|
-
]);
|
|
919
|
-
expect(updatedStore.orderedAV.has('score')).toBe(true);
|
|
920
|
-
|
|
921
|
-
const unboundOp = vi.fn((triple) => triple[2] > 1);
|
|
922
|
-
expect(
|
|
923
|
-
getTriples(indexedStore, [
|
|
924
|
-
undefined,
|
|
925
|
-
undefined,
|
|
926
|
-
{
|
|
927
|
-
$comparator: true,
|
|
928
|
-
$order: 'gt',
|
|
929
|
-
$dataType: 'number',
|
|
930
|
-
$value: 1,
|
|
931
|
-
$op: unboundOp,
|
|
932
|
-
},
|
|
933
|
-
]),
|
|
934
|
-
).toEqual(
|
|
935
|
-
Array.from({ length: 62 }, (_, i) => [
|
|
936
|
-
`score-${i + 2}`,
|
|
937
|
-
'score',
|
|
938
|
-
i + 2,
|
|
939
|
-
i + 2,
|
|
940
|
-
]),
|
|
941
|
-
);
|
|
942
|
-
expect(unboundOp).toHaveBeenCalledTimes(64);
|
|
943
|
-
});
|
|
944
|
-
|
|
945
|
-
test('v0 store restores', () => {
|
|
946
|
-
function toJSONOld(store) {
|
|
947
|
-
return {
|
|
948
|
-
__type: store.__type,
|
|
949
|
-
attrs: store.attrs,
|
|
950
|
-
triples: allMapValues(store.eav, 3),
|
|
951
|
-
cardinalityInference: store.cardinalityInference,
|
|
952
|
-
linkIndex: store.linkIndex,
|
|
953
|
-
useDateObjects: store.useDateObjects,
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
const v0Json = toJSONOld({ ...store, attrs: zenecaAttrsStore.attrs });
|
|
957
|
-
const attrsStore = attrsStoreFromJSON(null, v0Json);
|
|
958
|
-
const restored = fromJSON(attrsStore!, v0Json);
|
|
959
|
-
expect(restored).toEqual(store);
|
|
960
|
-
});
|