@warp-drive/core 5.8.0-alpha.37 → 5.8.0-alpha.40
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/declarations/index.d.ts +0 -4
- package/dist/{index-D4si_DxB.js → index-BKcD4JZK.js} +12 -8
- package/dist/index.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/store/-private.js +1 -1
- package/dist/types/-private.js +1 -1
- package/dist/unpkg/{prod-deprecated/symbols-sql1_mdx.js → dev/-private-3C1OkYtZ.js} +1 -1
- package/dist/unpkg/{dev-deprecated/configure-C3x8YXzL.js → dev/configure-BC66sfNO.js} +13 -11
- package/dist/unpkg/dev/configure.js +1 -1
- package/dist/unpkg/dev/graph/-private.js +206 -449
- package/dist/unpkg/dev/{index-D4si_DxB.js → index-DqhXrNZ_.js} +741 -1327
- package/dist/unpkg/dev/index.js +5 -7
- package/dist/unpkg/dev/reactive/-private.js +1 -1
- package/dist/unpkg/dev/reactive.js +4 -6
- package/dist/unpkg/{dev-deprecated/request-oqoLC9rz.js → dev/request-CA9K0gXq.js} +10 -16
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/runtime-DGG4CvlW.js +135 -0
- package/dist/unpkg/dev/store/-private.js +56 -2
- package/dist/unpkg/dev/store.js +558 -1
- package/dist/unpkg/dev/types/-private.js +5 -15
- package/dist/unpkg/dev/types/identifier.js +1 -3
- package/dist/unpkg/dev/utils/string.js +5 -6
- package/dist/unpkg/dev-deprecated/{symbols-sql1_mdx.js → -private-3C1OkYtZ.js} +1 -1
- package/dist/unpkg/{prod-deprecated/configure-C3x8YXzL.js → dev-deprecated/configure-BC66sfNO.js} +13 -11
- package/dist/unpkg/dev-deprecated/configure.js +1 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +216 -264
- package/dist/unpkg/dev-deprecated/{index-D4si_DxB.js → index-BBlq5is_.js} +834 -805
- package/dist/unpkg/dev-deprecated/index.js +4 -7
- package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive.js +4 -6
- package/dist/unpkg/{prod-deprecated/request-oqoLC9rz.js → dev-deprecated/request-CA9K0gXq.js} +10 -16
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/runtime-DfhJzpZH.js +135 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +2 -2
- package/dist/unpkg/dev-deprecated/store.js +558 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +5 -15
- package/dist/unpkg/dev-deprecated/types/identifier.js +1 -3
- package/dist/unpkg/dev-deprecated/utils/string.js +5 -6
- package/dist/unpkg/{dev/symbols-sql1_mdx.js → prod/-private-3C1OkYtZ.js} +1 -1
- package/dist/unpkg/prod/{configure-C3x8YXzL.js → configure-C0C1LpG6.js} +5 -28
- package/dist/unpkg/prod/configure.js +1 -1
- package/dist/unpkg/prod/graph/-private.js +4 -1144
- package/dist/unpkg/prod/handler-LAyD1Y5l.js +1619 -0
- package/dist/unpkg/prod/hooks-BfiqDg3O.js +26 -0
- package/dist/unpkg/prod/index.js +481 -8
- package/dist/unpkg/prod/promise-state-ipG60SdD.js +6738 -0
- package/dist/unpkg/prod/reactive/-private.js +1 -1
- package/dist/unpkg/prod/reactive.js +5 -7
- package/dist/unpkg/prod/request-CN2LxbYX.js +437 -0
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/store/-private.js +127 -2
- package/dist/unpkg/prod/store.js +437 -1
- package/dist/unpkg/prod/types/-private.js +4 -34
- package/dist/unpkg/prod/types/identifier.js +2 -4
- package/dist/unpkg/prod/utils/string.js +0 -20
- package/dist/unpkg/{prod/symbols-sql1_mdx.js → prod-deprecated/-private-3C1OkYtZ.js} +1 -1
- package/dist/unpkg/{dev/configure-C3x8YXzL.js → prod-deprecated/configure-BQ8CpIcW.js} +4 -27
- package/dist/unpkg/prod-deprecated/configure.js +1 -1
- package/dist/unpkg/prod-deprecated/graph/-private.js +12 -979
- package/dist/unpkg/prod-deprecated/handler-D639oFvl.js +334 -0
- package/dist/unpkg/prod-deprecated/hooks-DGvi9teJ.js +26 -0
- package/dist/unpkg/prod-deprecated/index.js +481 -8
- package/dist/unpkg/prod-deprecated/{index-D4si_DxB.js → promise-state-CYvoIPna.js} +278 -3566
- package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive.js +4 -7
- package/dist/unpkg/prod-deprecated/request-CN2LxbYX.js +437 -0
- package/dist/unpkg/prod-deprecated/request.js +1 -1
- package/dist/unpkg/prod-deprecated/store/-private.js +89 -2
- package/dist/unpkg/prod-deprecated/store.js +437 -1
- package/dist/unpkg/prod-deprecated/types/-private.js +4 -34
- package/dist/unpkg/prod-deprecated/types/identifier.js +2 -4
- package/dist/unpkg/prod-deprecated/utils/string.js +0 -20
- package/package.json +11 -19
- package/dist/unpkg/dev/declarations/build-config/babel-macros.d.ts +0 -1
- package/dist/unpkg/dev/declarations/build-config/canary-features.d.ts +0 -1
- package/dist/unpkg/dev/declarations/build-config/debugging.d.ts +0 -1
- package/dist/unpkg/dev/declarations/build-config/deprecations.d.ts +0 -1
- package/dist/unpkg/dev/declarations/build-config/env.d.ts +0 -1
- package/dist/unpkg/dev/declarations/build-config/macros.d.ts +0 -1
- package/dist/unpkg/dev/declarations/build-config.d.ts +0 -18
- package/dist/unpkg/dev/declarations/configure.d.ts +0 -7
- package/dist/unpkg/dev/declarations/graph/-private/-diff.d.ts +0 -19
- package/dist/unpkg/dev/declarations/graph/-private/-edge-definition.d.ts +0 -149
- package/dist/unpkg/dev/declarations/graph/-private/-state.d.ts +0 -9
- package/dist/unpkg/dev/declarations/graph/-private/-utils.d.ts +0 -25
- package/dist/unpkg/dev/declarations/graph/-private/coerce-id.d.ts +0 -4
- package/dist/unpkg/dev/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -6
- package/dist/unpkg/dev/declarations/graph/-private/edges/collection.d.ts +0 -39
- package/dist/unpkg/dev/declarations/graph/-private/edges/implicit.d.ts +0 -43
- package/dist/unpkg/dev/declarations/graph/-private/edges/resource.d.ts +0 -23
- package/dist/unpkg/dev/declarations/graph/-private/graph.d.ts +0 -56
- package/dist/unpkg/dev/declarations/graph/-private/normalize-link.d.ts +0 -2
- package/dist/unpkg/dev/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
- package/dist/unpkg/dev/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
- package/dist/unpkg/dev/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
- package/dist/unpkg/dev/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
- package/dist/unpkg/dev/declarations/graph/-private/operations/replace-related-records.d.ts +0 -7
- package/dist/unpkg/dev/declarations/graph/-private/operations/update-relationship.d.ts +0 -9
- package/dist/unpkg/dev/declarations/graph/-private.d.ts +0 -13
- package/dist/unpkg/dev/declarations/index.d.ts +0 -100
- package/dist/unpkg/dev/declarations/reactive/-private/default-mode.d.ts +0 -73
- package/dist/unpkg/dev/declarations/reactive/-private/document.d.ts +0 -142
- package/dist/unpkg/dev/declarations/reactive/-private/fields/extension.d.ts +0 -8
- package/dist/unpkg/dev/declarations/reactive/-private/fields/get-field-key.d.ts +0 -8
- package/dist/unpkg/dev/declarations/reactive/-private/fields/managed-array.d.ts +0 -18
- package/dist/unpkg/dev/declarations/reactive/-private/fields/managed-object.d.ts +0 -17
- package/dist/unpkg/dev/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
- package/dist/unpkg/dev/declarations/reactive/-private/hooks.d.ts +0 -5
- package/dist/unpkg/dev/declarations/reactive/-private/kind/alias-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/array-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/attribute-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/belongs-to-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/collection-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/derived-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/generic-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/has-many-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/hash-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/identity-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/local-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/object-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/resource-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/schema-array-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/kind/schema-object-field.d.ts +0 -4
- package/dist/unpkg/dev/declarations/reactive/-private/record.d.ts +0 -83
- package/dist/unpkg/dev/declarations/reactive/-private/schema.d.ts +0 -326
- package/dist/unpkg/dev/declarations/reactive/-private/symbols.d.ts +0 -5
- package/dist/unpkg/dev/declarations/reactive/-private.d.ts +0 -2
- package/dist/unpkg/dev/declarations/reactive.d.ts +0 -287
- package/dist/unpkg/dev/declarations/request/-private/context.d.ts +0 -39
- package/dist/unpkg/dev/declarations/request/-private/debug.d.ts +0 -4
- package/dist/unpkg/dev/declarations/request/-private/fetch.d.ts +0 -33
- package/dist/unpkg/dev/declarations/request/-private/future.d.ts +0 -7
- package/dist/unpkg/dev/declarations/request/-private/manager.d.ts +0 -158
- package/dist/unpkg/dev/declarations/request/-private/promise-cache.d.ts +0 -28
- package/dist/unpkg/dev/declarations/request/-private/types.d.ts +0 -234
- package/dist/unpkg/dev/declarations/request/-private/utils.d.ts +0 -57
- package/dist/unpkg/dev/declarations/request.d.ts +0 -52
- package/dist/unpkg/dev/declarations/store/-private/cache-handler/handler.d.ts +0 -56
- package/dist/unpkg/dev/declarations/store/-private/cache-handler/types.d.ts +0 -98
- package/dist/unpkg/dev/declarations/store/-private/cache-handler/utils.d.ts +0 -31
- package/dist/unpkg/dev/declarations/store/-private/caches/instance-cache.d.ts +0 -58
- package/dist/unpkg/dev/declarations/store/-private/caches/resource-utils.d.ts +0 -9
- package/dist/unpkg/dev/declarations/store/-private/debug/utils.d.ts +0 -7
- package/dist/unpkg/dev/declarations/store/-private/default-cache-policy.d.ts +0 -387
- package/dist/unpkg/dev/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -34
- package/dist/unpkg/dev/declarations/store/-private/managers/cache-key-manager.d.ts +0 -304
- package/dist/unpkg/dev/declarations/store/-private/managers/cache-manager.d.ts +0 -380
- package/dist/unpkg/dev/declarations/store/-private/managers/notification-manager.d.ts +0 -83
- package/dist/unpkg/dev/declarations/store/-private/managers/record-array-manager.d.ts +0 -100
- package/dist/unpkg/dev/declarations/store/-private/network/request-cache.d.ts +0 -103
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +0 -24
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/promise-state.d.ts +0 -264
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +0 -138
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +0 -154
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +0 -56
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/request-state.d.ts +0 -372
- package/dist/unpkg/dev/declarations/store/-private/new-core-tmp/request-subscription.d.ts +0 -177
- package/dist/unpkg/dev/declarations/store/-private/record-arrays/-utils.d.ts +0 -80
- package/dist/unpkg/dev/declarations/store/-private/record-arrays/legacy-live-array.d.ts +0 -81
- package/dist/unpkg/dev/declarations/store/-private/record-arrays/legacy-many-array.d.ts +0 -133
- package/dist/unpkg/dev/declarations/store/-private/record-arrays/legacy-query.d.ts +0 -81
- package/dist/unpkg/dev/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -3
- package/dist/unpkg/dev/declarations/store/-private/record-arrays/resource-array.d.ts +0 -67
- package/dist/unpkg/dev/declarations/store/-private/store-service.d.ts +0 -874
- package/dist/unpkg/dev/declarations/store/-private/utils/coerce-id.d.ts +0 -4
- package/dist/unpkg/dev/declarations/store/-private/utils/construct-resource.d.ts +0 -6
- package/dist/unpkg/dev/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/dist/unpkg/dev/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/dist/unpkg/dev/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/dist/unpkg/dev/declarations/store/-private.d.ts +0 -29
- package/dist/unpkg/dev/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -90
- package/dist/unpkg/dev/declarations/store/-types/q/identifier.d.ts +0 -23
- package/dist/unpkg/dev/declarations/store/-types/q/record-instance.d.ts +0 -22
- package/dist/unpkg/dev/declarations/store/-types/q/store.d.ts +0 -31
- package/dist/unpkg/dev/declarations/store/deprecated/-private.d.ts +0 -223
- package/dist/unpkg/dev/declarations/store/deprecated/store.d.ts +0 -784
- package/dist/unpkg/dev/declarations/store.d.ts +0 -2
- package/dist/unpkg/dev/declarations/types/-private.d.ts +0 -22
- package/dist/unpkg/dev/declarations/types/cache/aliases.d.ts +0 -1
- package/dist/unpkg/dev/declarations/types/cache/change.d.ts +0 -6
- package/dist/unpkg/dev/declarations/types/cache/mutations.d.ts +0 -38
- package/dist/unpkg/dev/declarations/types/cache/operations.d.ts +0 -168
- package/dist/unpkg/dev/declarations/types/cache/relationship.d.ts +0 -13
- package/dist/unpkg/dev/declarations/types/cache.d.ts +0 -429
- package/dist/unpkg/dev/declarations/types/graph.d.ts +0 -47
- package/dist/unpkg/dev/declarations/types/identifier.d.ts +0 -86
- package/dist/unpkg/dev/declarations/types/json/raw.d.ts +0 -6
- package/dist/unpkg/dev/declarations/types/params.d.ts +0 -8
- package/dist/unpkg/dev/declarations/types/record.d.ts +0 -269
- package/dist/unpkg/dev/declarations/types/request.d.ts +0 -367
- package/dist/unpkg/dev/declarations/types/runtime.d.ts +0 -14
- package/dist/unpkg/dev/declarations/types/schema/concepts.d.ts +0 -23
- package/dist/unpkg/dev/declarations/types/schema/fields.d.ts +0 -2200
- package/dist/unpkg/dev/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/dist/unpkg/dev/declarations/types/schema/schema-service.d.ts +0 -380
- package/dist/unpkg/dev/declarations/types/spec/document.d.ts +0 -67
- package/dist/unpkg/dev/declarations/types/spec/error.d.ts +0 -18
- package/dist/unpkg/dev/declarations/types/spec/json-api-raw.d.ts +0 -139
- package/dist/unpkg/dev/declarations/types/symbols.d.ts +0 -78
- package/dist/unpkg/dev/declarations/types/utils.d.ts +0 -5
- package/dist/unpkg/dev/declarations/types.d.ts +0 -11
- package/dist/unpkg/dev/declarations/utils/string.d.ts +0 -47
- package/dist/unpkg/dev/default-cache-policy-D7_u4YRH.js +0 -572
- package/dist/unpkg/dev/request-oqoLC9rz.js +0 -725
- package/dist/unpkg/dev-deprecated/declarations/build-config/babel-macros.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/build-config/canary-features.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/build-config/debugging.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/build-config/deprecations.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/build-config/env.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/build-config/macros.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/build-config.d.ts +0 -18
- package/dist/unpkg/dev-deprecated/declarations/configure.d.ts +0 -7
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/-diff.d.ts +0 -19
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/-edge-definition.d.ts +0 -149
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/-state.d.ts +0 -9
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/-utils.d.ts +0 -25
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/coerce-id.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -6
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/edges/collection.d.ts +0 -39
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/edges/implicit.d.ts +0 -43
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/edges/resource.d.ts +0 -23
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/graph.d.ts +0 -56
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/normalize-link.d.ts +0 -2
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/operations/replace-related-records.d.ts +0 -7
- package/dist/unpkg/dev-deprecated/declarations/graph/-private/operations/update-relationship.d.ts +0 -9
- package/dist/unpkg/dev-deprecated/declarations/graph/-private.d.ts +0 -13
- package/dist/unpkg/dev-deprecated/declarations/index.d.ts +0 -100
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/default-mode.d.ts +0 -73
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/document.d.ts +0 -142
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/fields/extension.d.ts +0 -8
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/fields/get-field-key.d.ts +0 -8
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/fields/managed-array.d.ts +0 -18
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/fields/managed-object.d.ts +0 -17
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/hooks.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/alias-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/array-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/attribute-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/belongs-to-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/collection-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/derived-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/generic-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/has-many-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/hash-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/identity-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/local-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/object-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/resource-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/schema-array-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/kind/schema-object-field.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/record.d.ts +0 -83
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/schema.d.ts +0 -326
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private/symbols.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/reactive/-private.d.ts +0 -2
- package/dist/unpkg/dev-deprecated/declarations/reactive.d.ts +0 -287
- package/dist/unpkg/dev-deprecated/declarations/request/-private/context.d.ts +0 -39
- package/dist/unpkg/dev-deprecated/declarations/request/-private/debug.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/request/-private/fetch.d.ts +0 -33
- package/dist/unpkg/dev-deprecated/declarations/request/-private/future.d.ts +0 -7
- package/dist/unpkg/dev-deprecated/declarations/request/-private/manager.d.ts +0 -158
- package/dist/unpkg/dev-deprecated/declarations/request/-private/promise-cache.d.ts +0 -28
- package/dist/unpkg/dev-deprecated/declarations/request/-private/types.d.ts +0 -234
- package/dist/unpkg/dev-deprecated/declarations/request/-private/utils.d.ts +0 -57
- package/dist/unpkg/dev-deprecated/declarations/request.d.ts +0 -52
- package/dist/unpkg/dev-deprecated/declarations/store/-private/cache-handler/handler.d.ts +0 -56
- package/dist/unpkg/dev-deprecated/declarations/store/-private/cache-handler/types.d.ts +0 -98
- package/dist/unpkg/dev-deprecated/declarations/store/-private/cache-handler/utils.d.ts +0 -31
- package/dist/unpkg/dev-deprecated/declarations/store/-private/caches/instance-cache.d.ts +0 -58
- package/dist/unpkg/dev-deprecated/declarations/store/-private/caches/resource-utils.d.ts +0 -9
- package/dist/unpkg/dev-deprecated/declarations/store/-private/debug/utils.d.ts +0 -7
- package/dist/unpkg/dev-deprecated/declarations/store/-private/default-cache-policy.d.ts +0 -387
- package/dist/unpkg/dev-deprecated/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -34
- package/dist/unpkg/dev-deprecated/declarations/store/-private/managers/cache-key-manager.d.ts +0 -304
- package/dist/unpkg/dev-deprecated/declarations/store/-private/managers/cache-manager.d.ts +0 -380
- package/dist/unpkg/dev-deprecated/declarations/store/-private/managers/notification-manager.d.ts +0 -83
- package/dist/unpkg/dev-deprecated/declarations/store/-private/managers/record-array-manager.d.ts +0 -100
- package/dist/unpkg/dev-deprecated/declarations/store/-private/network/request-cache.d.ts +0 -103
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +0 -24
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/promise-state.d.ts +0 -264
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +0 -138
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +0 -154
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +0 -56
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/request-state.d.ts +0 -372
- package/dist/unpkg/dev-deprecated/declarations/store/-private/new-core-tmp/request-subscription.d.ts +0 -177
- package/dist/unpkg/dev-deprecated/declarations/store/-private/record-arrays/-utils.d.ts +0 -80
- package/dist/unpkg/dev-deprecated/declarations/store/-private/record-arrays/legacy-live-array.d.ts +0 -81
- package/dist/unpkg/dev-deprecated/declarations/store/-private/record-arrays/legacy-many-array.d.ts +0 -133
- package/dist/unpkg/dev-deprecated/declarations/store/-private/record-arrays/legacy-query.d.ts +0 -81
- package/dist/unpkg/dev-deprecated/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/store/-private/record-arrays/resource-array.d.ts +0 -67
- package/dist/unpkg/dev-deprecated/declarations/store/-private/store-service.d.ts +0 -874
- package/dist/unpkg/dev-deprecated/declarations/store/-private/utils/coerce-id.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/store/-private/utils/construct-resource.d.ts +0 -6
- package/dist/unpkg/dev-deprecated/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/store/-private.d.ts +0 -29
- package/dist/unpkg/dev-deprecated/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -90
- package/dist/unpkg/dev-deprecated/declarations/store/-types/q/identifier.d.ts +0 -23
- package/dist/unpkg/dev-deprecated/declarations/store/-types/q/record-instance.d.ts +0 -22
- package/dist/unpkg/dev-deprecated/declarations/store/-types/q/store.d.ts +0 -31
- package/dist/unpkg/dev-deprecated/declarations/store/deprecated/-private.d.ts +0 -223
- package/dist/unpkg/dev-deprecated/declarations/store/deprecated/store.d.ts +0 -784
- package/dist/unpkg/dev-deprecated/declarations/store.d.ts +0 -2
- package/dist/unpkg/dev-deprecated/declarations/types/-private.d.ts +0 -22
- package/dist/unpkg/dev-deprecated/declarations/types/cache/aliases.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/types/cache/change.d.ts +0 -6
- package/dist/unpkg/dev-deprecated/declarations/types/cache/mutations.d.ts +0 -38
- package/dist/unpkg/dev-deprecated/declarations/types/cache/operations.d.ts +0 -168
- package/dist/unpkg/dev-deprecated/declarations/types/cache/relationship.d.ts +0 -13
- package/dist/unpkg/dev-deprecated/declarations/types/cache.d.ts +0 -429
- package/dist/unpkg/dev-deprecated/declarations/types/graph.d.ts +0 -47
- package/dist/unpkg/dev-deprecated/declarations/types/identifier.d.ts +0 -86
- package/dist/unpkg/dev-deprecated/declarations/types/json/raw.d.ts +0 -6
- package/dist/unpkg/dev-deprecated/declarations/types/params.d.ts +0 -8
- package/dist/unpkg/dev-deprecated/declarations/types/record.d.ts +0 -269
- package/dist/unpkg/dev-deprecated/declarations/types/request.d.ts +0 -367
- package/dist/unpkg/dev-deprecated/declarations/types/runtime.d.ts +0 -14
- package/dist/unpkg/dev-deprecated/declarations/types/schema/concepts.d.ts +0 -23
- package/dist/unpkg/dev-deprecated/declarations/types/schema/fields.d.ts +0 -2200
- package/dist/unpkg/dev-deprecated/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/types/schema/schema-service.d.ts +0 -380
- package/dist/unpkg/dev-deprecated/declarations/types/spec/document.d.ts +0 -67
- package/dist/unpkg/dev-deprecated/declarations/types/spec/error.d.ts +0 -18
- package/dist/unpkg/dev-deprecated/declarations/types/spec/json-api-raw.d.ts +0 -139
- package/dist/unpkg/dev-deprecated/declarations/types/symbols.d.ts +0 -78
- package/dist/unpkg/dev-deprecated/declarations/types/utils.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/types.d.ts +0 -11
- package/dist/unpkg/dev-deprecated/declarations/utils/string.d.ts +0 -47
- package/dist/unpkg/dev-deprecated/default-cache-policy-D7_u4YRH.js +0 -572
- package/dist/unpkg/prod/declarations/build-config/babel-macros.d.ts +0 -1
- package/dist/unpkg/prod/declarations/build-config/canary-features.d.ts +0 -1
- package/dist/unpkg/prod/declarations/build-config/debugging.d.ts +0 -1
- package/dist/unpkg/prod/declarations/build-config/deprecations.d.ts +0 -1
- package/dist/unpkg/prod/declarations/build-config/env.d.ts +0 -1
- package/dist/unpkg/prod/declarations/build-config/macros.d.ts +0 -1
- package/dist/unpkg/prod/declarations/build-config.d.ts +0 -18
- package/dist/unpkg/prod/declarations/configure.d.ts +0 -7
- package/dist/unpkg/prod/declarations/graph/-private/-diff.d.ts +0 -19
- package/dist/unpkg/prod/declarations/graph/-private/-edge-definition.d.ts +0 -149
- package/dist/unpkg/prod/declarations/graph/-private/-state.d.ts +0 -9
- package/dist/unpkg/prod/declarations/graph/-private/-utils.d.ts +0 -25
- package/dist/unpkg/prod/declarations/graph/-private/coerce-id.d.ts +0 -4
- package/dist/unpkg/prod/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -6
- package/dist/unpkg/prod/declarations/graph/-private/edges/collection.d.ts +0 -39
- package/dist/unpkg/prod/declarations/graph/-private/edges/implicit.d.ts +0 -43
- package/dist/unpkg/prod/declarations/graph/-private/edges/resource.d.ts +0 -23
- package/dist/unpkg/prod/declarations/graph/-private/graph.d.ts +0 -56
- package/dist/unpkg/prod/declarations/graph/-private/normalize-link.d.ts +0 -2
- package/dist/unpkg/prod/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
- package/dist/unpkg/prod/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
- package/dist/unpkg/prod/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
- package/dist/unpkg/prod/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
- package/dist/unpkg/prod/declarations/graph/-private/operations/replace-related-records.d.ts +0 -7
- package/dist/unpkg/prod/declarations/graph/-private/operations/update-relationship.d.ts +0 -9
- package/dist/unpkg/prod/declarations/graph/-private.d.ts +0 -13
- package/dist/unpkg/prod/declarations/index.d.ts +0 -100
- package/dist/unpkg/prod/declarations/reactive/-private/default-mode.d.ts +0 -73
- package/dist/unpkg/prod/declarations/reactive/-private/document.d.ts +0 -142
- package/dist/unpkg/prod/declarations/reactive/-private/fields/extension.d.ts +0 -8
- package/dist/unpkg/prod/declarations/reactive/-private/fields/get-field-key.d.ts +0 -8
- package/dist/unpkg/prod/declarations/reactive/-private/fields/managed-array.d.ts +0 -18
- package/dist/unpkg/prod/declarations/reactive/-private/fields/managed-object.d.ts +0 -17
- package/dist/unpkg/prod/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
- package/dist/unpkg/prod/declarations/reactive/-private/hooks.d.ts +0 -5
- package/dist/unpkg/prod/declarations/reactive/-private/kind/alias-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/array-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/attribute-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/belongs-to-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/collection-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/derived-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/generic-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/has-many-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/hash-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/identity-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/local-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/object-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/resource-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/schema-array-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/kind/schema-object-field.d.ts +0 -4
- package/dist/unpkg/prod/declarations/reactive/-private/record.d.ts +0 -83
- package/dist/unpkg/prod/declarations/reactive/-private/schema.d.ts +0 -326
- package/dist/unpkg/prod/declarations/reactive/-private/symbols.d.ts +0 -5
- package/dist/unpkg/prod/declarations/reactive/-private.d.ts +0 -2
- package/dist/unpkg/prod/declarations/reactive.d.ts +0 -287
- package/dist/unpkg/prod/declarations/request/-private/context.d.ts +0 -39
- package/dist/unpkg/prod/declarations/request/-private/debug.d.ts +0 -4
- package/dist/unpkg/prod/declarations/request/-private/fetch.d.ts +0 -33
- package/dist/unpkg/prod/declarations/request/-private/future.d.ts +0 -7
- package/dist/unpkg/prod/declarations/request/-private/manager.d.ts +0 -158
- package/dist/unpkg/prod/declarations/request/-private/promise-cache.d.ts +0 -28
- package/dist/unpkg/prod/declarations/request/-private/types.d.ts +0 -234
- package/dist/unpkg/prod/declarations/request/-private/utils.d.ts +0 -57
- package/dist/unpkg/prod/declarations/request.d.ts +0 -52
- package/dist/unpkg/prod/declarations/store/-private/cache-handler/handler.d.ts +0 -56
- package/dist/unpkg/prod/declarations/store/-private/cache-handler/types.d.ts +0 -98
- package/dist/unpkg/prod/declarations/store/-private/cache-handler/utils.d.ts +0 -31
- package/dist/unpkg/prod/declarations/store/-private/caches/instance-cache.d.ts +0 -58
- package/dist/unpkg/prod/declarations/store/-private/caches/resource-utils.d.ts +0 -9
- package/dist/unpkg/prod/declarations/store/-private/debug/utils.d.ts +0 -7
- package/dist/unpkg/prod/declarations/store/-private/default-cache-policy.d.ts +0 -387
- package/dist/unpkg/prod/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -34
- package/dist/unpkg/prod/declarations/store/-private/managers/cache-key-manager.d.ts +0 -304
- package/dist/unpkg/prod/declarations/store/-private/managers/cache-manager.d.ts +0 -380
- package/dist/unpkg/prod/declarations/store/-private/managers/notification-manager.d.ts +0 -83
- package/dist/unpkg/prod/declarations/store/-private/managers/record-array-manager.d.ts +0 -100
- package/dist/unpkg/prod/declarations/store/-private/network/request-cache.d.ts +0 -103
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +0 -24
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/promise-state.d.ts +0 -264
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +0 -138
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +0 -154
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +0 -56
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/request-state.d.ts +0 -372
- package/dist/unpkg/prod/declarations/store/-private/new-core-tmp/request-subscription.d.ts +0 -177
- package/dist/unpkg/prod/declarations/store/-private/record-arrays/-utils.d.ts +0 -80
- package/dist/unpkg/prod/declarations/store/-private/record-arrays/legacy-live-array.d.ts +0 -81
- package/dist/unpkg/prod/declarations/store/-private/record-arrays/legacy-many-array.d.ts +0 -133
- package/dist/unpkg/prod/declarations/store/-private/record-arrays/legacy-query.d.ts +0 -81
- package/dist/unpkg/prod/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -3
- package/dist/unpkg/prod/declarations/store/-private/record-arrays/resource-array.d.ts +0 -67
- package/dist/unpkg/prod/declarations/store/-private/store-service.d.ts +0 -874
- package/dist/unpkg/prod/declarations/store/-private/utils/coerce-id.d.ts +0 -4
- package/dist/unpkg/prod/declarations/store/-private/utils/construct-resource.d.ts +0 -6
- package/dist/unpkg/prod/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/dist/unpkg/prod/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/dist/unpkg/prod/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/dist/unpkg/prod/declarations/store/-private.d.ts +0 -29
- package/dist/unpkg/prod/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -90
- package/dist/unpkg/prod/declarations/store/-types/q/identifier.d.ts +0 -23
- package/dist/unpkg/prod/declarations/store/-types/q/record-instance.d.ts +0 -22
- package/dist/unpkg/prod/declarations/store/-types/q/store.d.ts +0 -31
- package/dist/unpkg/prod/declarations/store/deprecated/-private.d.ts +0 -223
- package/dist/unpkg/prod/declarations/store/deprecated/store.d.ts +0 -784
- package/dist/unpkg/prod/declarations/store.d.ts +0 -2
- package/dist/unpkg/prod/declarations/types/-private.d.ts +0 -22
- package/dist/unpkg/prod/declarations/types/cache/aliases.d.ts +0 -1
- package/dist/unpkg/prod/declarations/types/cache/change.d.ts +0 -6
- package/dist/unpkg/prod/declarations/types/cache/mutations.d.ts +0 -38
- package/dist/unpkg/prod/declarations/types/cache/operations.d.ts +0 -168
- package/dist/unpkg/prod/declarations/types/cache/relationship.d.ts +0 -13
- package/dist/unpkg/prod/declarations/types/cache.d.ts +0 -429
- package/dist/unpkg/prod/declarations/types/graph.d.ts +0 -47
- package/dist/unpkg/prod/declarations/types/identifier.d.ts +0 -86
- package/dist/unpkg/prod/declarations/types/json/raw.d.ts +0 -6
- package/dist/unpkg/prod/declarations/types/params.d.ts +0 -8
- package/dist/unpkg/prod/declarations/types/record.d.ts +0 -269
- package/dist/unpkg/prod/declarations/types/request.d.ts +0 -367
- package/dist/unpkg/prod/declarations/types/runtime.d.ts +0 -14
- package/dist/unpkg/prod/declarations/types/schema/concepts.d.ts +0 -23
- package/dist/unpkg/prod/declarations/types/schema/fields.d.ts +0 -2200
- package/dist/unpkg/prod/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/dist/unpkg/prod/declarations/types/schema/schema-service.d.ts +0 -380
- package/dist/unpkg/prod/declarations/types/spec/document.d.ts +0 -67
- package/dist/unpkg/prod/declarations/types/spec/error.d.ts +0 -18
- package/dist/unpkg/prod/declarations/types/spec/json-api-raw.d.ts +0 -139
- package/dist/unpkg/prod/declarations/types/symbols.d.ts +0 -78
- package/dist/unpkg/prod/declarations/types/utils.d.ts +0 -5
- package/dist/unpkg/prod/declarations/types.d.ts +0 -11
- package/dist/unpkg/prod/declarations/utils/string.d.ts +0 -47
- package/dist/unpkg/prod/default-cache-policy-D7_u4YRH.js +0 -572
- package/dist/unpkg/prod/index-D4si_DxB.js +0 -11746
- package/dist/unpkg/prod/request-oqoLC9rz.js +0 -725
- package/dist/unpkg/prod-deprecated/declarations/build-config/babel-macros.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/build-config/canary-features.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/build-config/debugging.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/build-config/deprecations.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/build-config/env.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/build-config/macros.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/build-config.d.ts +0 -18
- package/dist/unpkg/prod-deprecated/declarations/configure.d.ts +0 -7
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/-diff.d.ts +0 -19
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/-edge-definition.d.ts +0 -149
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/-state.d.ts +0 -9
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/-utils.d.ts +0 -25
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/coerce-id.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -6
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/edges/collection.d.ts +0 -39
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/edges/implicit.d.ts +0 -43
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/edges/resource.d.ts +0 -23
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/graph.d.ts +0 -56
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/normalize-link.d.ts +0 -2
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/operations/replace-related-records.d.ts +0 -7
- package/dist/unpkg/prod-deprecated/declarations/graph/-private/operations/update-relationship.d.ts +0 -9
- package/dist/unpkg/prod-deprecated/declarations/graph/-private.d.ts +0 -13
- package/dist/unpkg/prod-deprecated/declarations/index.d.ts +0 -100
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/default-mode.d.ts +0 -73
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/document.d.ts +0 -142
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/fields/extension.d.ts +0 -8
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/fields/get-field-key.d.ts +0 -8
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/fields/managed-array.d.ts +0 -18
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/fields/managed-object.d.ts +0 -17
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/hooks.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/alias-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/array-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/attribute-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/belongs-to-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/collection-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/derived-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/generic-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/has-many-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/hash-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/identity-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/local-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/object-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/resource-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/schema-array-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/kind/schema-object-field.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/record.d.ts +0 -83
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/schema.d.ts +0 -326
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private/symbols.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/reactive/-private.d.ts +0 -2
- package/dist/unpkg/prod-deprecated/declarations/reactive.d.ts +0 -287
- package/dist/unpkg/prod-deprecated/declarations/request/-private/context.d.ts +0 -39
- package/dist/unpkg/prod-deprecated/declarations/request/-private/debug.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/request/-private/fetch.d.ts +0 -33
- package/dist/unpkg/prod-deprecated/declarations/request/-private/future.d.ts +0 -7
- package/dist/unpkg/prod-deprecated/declarations/request/-private/manager.d.ts +0 -158
- package/dist/unpkg/prod-deprecated/declarations/request/-private/promise-cache.d.ts +0 -28
- package/dist/unpkg/prod-deprecated/declarations/request/-private/types.d.ts +0 -234
- package/dist/unpkg/prod-deprecated/declarations/request/-private/utils.d.ts +0 -57
- package/dist/unpkg/prod-deprecated/declarations/request.d.ts +0 -52
- package/dist/unpkg/prod-deprecated/declarations/store/-private/cache-handler/handler.d.ts +0 -56
- package/dist/unpkg/prod-deprecated/declarations/store/-private/cache-handler/types.d.ts +0 -98
- package/dist/unpkg/prod-deprecated/declarations/store/-private/cache-handler/utils.d.ts +0 -31
- package/dist/unpkg/prod-deprecated/declarations/store/-private/caches/instance-cache.d.ts +0 -58
- package/dist/unpkg/prod-deprecated/declarations/store/-private/caches/resource-utils.d.ts +0 -9
- package/dist/unpkg/prod-deprecated/declarations/store/-private/debug/utils.d.ts +0 -7
- package/dist/unpkg/prod-deprecated/declarations/store/-private/default-cache-policy.d.ts +0 -387
- package/dist/unpkg/prod-deprecated/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -34
- package/dist/unpkg/prod-deprecated/declarations/store/-private/managers/cache-key-manager.d.ts +0 -304
- package/dist/unpkg/prod-deprecated/declarations/store/-private/managers/cache-manager.d.ts +0 -380
- package/dist/unpkg/prod-deprecated/declarations/store/-private/managers/notification-manager.d.ts +0 -83
- package/dist/unpkg/prod-deprecated/declarations/store/-private/managers/record-array-manager.d.ts +0 -100
- package/dist/unpkg/prod-deprecated/declarations/store/-private/network/request-cache.d.ts +0 -103
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/expensive-subscription.d.ts +0 -24
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/promise-state.d.ts +0 -264
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +0 -138
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +0 -154
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +0 -56
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/request-state.d.ts +0 -372
- package/dist/unpkg/prod-deprecated/declarations/store/-private/new-core-tmp/request-subscription.d.ts +0 -177
- package/dist/unpkg/prod-deprecated/declarations/store/-private/record-arrays/-utils.d.ts +0 -80
- package/dist/unpkg/prod-deprecated/declarations/store/-private/record-arrays/legacy-live-array.d.ts +0 -81
- package/dist/unpkg/prod-deprecated/declarations/store/-private/record-arrays/legacy-many-array.d.ts +0 -133
- package/dist/unpkg/prod-deprecated/declarations/store/-private/record-arrays/legacy-query.d.ts +0 -81
- package/dist/unpkg/prod-deprecated/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/store/-private/record-arrays/resource-array.d.ts +0 -67
- package/dist/unpkg/prod-deprecated/declarations/store/-private/store-service.d.ts +0 -874
- package/dist/unpkg/prod-deprecated/declarations/store/-private/utils/coerce-id.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/store/-private/utils/construct-resource.d.ts +0 -6
- package/dist/unpkg/prod-deprecated/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/store/-private.d.ts +0 -29
- package/dist/unpkg/prod-deprecated/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -90
- package/dist/unpkg/prod-deprecated/declarations/store/-types/q/identifier.d.ts +0 -23
- package/dist/unpkg/prod-deprecated/declarations/store/-types/q/record-instance.d.ts +0 -22
- package/dist/unpkg/prod-deprecated/declarations/store/-types/q/store.d.ts +0 -31
- package/dist/unpkg/prod-deprecated/declarations/store/deprecated/-private.d.ts +0 -223
- package/dist/unpkg/prod-deprecated/declarations/store/deprecated/store.d.ts +0 -784
- package/dist/unpkg/prod-deprecated/declarations/store.d.ts +0 -2
- package/dist/unpkg/prod-deprecated/declarations/types/-private.d.ts +0 -22
- package/dist/unpkg/prod-deprecated/declarations/types/cache/aliases.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/types/cache/change.d.ts +0 -6
- package/dist/unpkg/prod-deprecated/declarations/types/cache/mutations.d.ts +0 -38
- package/dist/unpkg/prod-deprecated/declarations/types/cache/operations.d.ts +0 -168
- package/dist/unpkg/prod-deprecated/declarations/types/cache/relationship.d.ts +0 -13
- package/dist/unpkg/prod-deprecated/declarations/types/cache.d.ts +0 -429
- package/dist/unpkg/prod-deprecated/declarations/types/graph.d.ts +0 -47
- package/dist/unpkg/prod-deprecated/declarations/types/identifier.d.ts +0 -86
- package/dist/unpkg/prod-deprecated/declarations/types/json/raw.d.ts +0 -6
- package/dist/unpkg/prod-deprecated/declarations/types/params.d.ts +0 -8
- package/dist/unpkg/prod-deprecated/declarations/types/record.d.ts +0 -269
- package/dist/unpkg/prod-deprecated/declarations/types/request.d.ts +0 -367
- package/dist/unpkg/prod-deprecated/declarations/types/runtime.d.ts +0 -14
- package/dist/unpkg/prod-deprecated/declarations/types/schema/concepts.d.ts +0 -23
- package/dist/unpkg/prod-deprecated/declarations/types/schema/fields.d.ts +0 -2200
- package/dist/unpkg/prod-deprecated/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/types/schema/schema-service.d.ts +0 -380
- package/dist/unpkg/prod-deprecated/declarations/types/spec/document.d.ts +0 -67
- package/dist/unpkg/prod-deprecated/declarations/types/spec/error.d.ts +0 -18
- package/dist/unpkg/prod-deprecated/declarations/types/spec/json-api-raw.d.ts +0 -139
- package/dist/unpkg/prod-deprecated/declarations/types/symbols.d.ts +0 -78
- package/dist/unpkg/prod-deprecated/declarations/types/utils.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/types.d.ts +0 -11
- package/dist/unpkg/prod-deprecated/declarations/utils/string.d.ts +0 -47
- package/dist/unpkg/prod-deprecated/default-cache-policy-D7_u4YRH.js +0 -572
|
@@ -1,38 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
1
|
+
import { g as getGlobalConfig } from "../runtime-DfhJzpZH.js";
|
|
3
2
|
import { getOrSetGlobal, peekTransient, setTransient } from '../types/-private.js';
|
|
3
|
+
|
|
4
|
+
// Used by the store to normalize IDs entering the store. Despite the fact
|
|
5
|
+
// that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),
|
|
6
|
+
// it is important that internally we use strings, since IDs may be serialized
|
|
7
|
+
// and lose type information. For example, Ember's router may put a record's
|
|
8
|
+
// ID into the URL, and if we later try to deserialize that URL and find the
|
|
9
|
+
// corresponding record, we will not know if it is a string or a number.
|
|
4
10
|
function coerceId(id) {
|
|
5
|
-
|
|
11
|
+
{
|
|
6
12
|
let normalized;
|
|
7
13
|
if (id === null || id === undefined || id === '') {
|
|
8
14
|
normalized = null;
|
|
9
15
|
} else {
|
|
10
16
|
normalized = String(id);
|
|
11
17
|
}
|
|
12
|
-
|
|
13
|
-
id: 'ember-data:deprecate-non-strict-id',
|
|
14
|
-
until: '6.0',
|
|
15
|
-
for: 'ember-data',
|
|
16
|
-
since: {
|
|
17
|
-
available: '4.13',
|
|
18
|
-
enabled: '5.3'
|
|
19
|
-
}
|
|
20
|
-
});
|
|
18
|
+
!(normalized === id) && console.warn(`The resource id '<${typeof id}> ${String(id)} ' is not normalized. Update your application code to use '${JSON.stringify(normalized)}' instead.`);
|
|
21
19
|
return normalized;
|
|
22
20
|
}
|
|
23
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
24
|
-
if (!test) {
|
|
25
|
-
throw new Error(`Resource IDs must be a non-empty string or null. Received '${String(id)}'.`);
|
|
26
|
-
}
|
|
27
|
-
})(id === null || typeof id === 'string' && id.length > 0) : {};
|
|
28
|
-
return id;
|
|
29
21
|
}
|
|
30
22
|
function getStore(wrapper) {
|
|
31
|
-
|
|
23
|
+
(test => {
|
|
32
24
|
if (!test) {
|
|
33
25
|
throw new Error(`expected a private _store property`);
|
|
34
26
|
}
|
|
35
|
-
})('_store' in wrapper)
|
|
27
|
+
})('_store' in wrapper);
|
|
36
28
|
return wrapper._store;
|
|
37
29
|
}
|
|
38
30
|
function expandingGet(cache, key1, key2) {
|
|
@@ -45,11 +37,11 @@ function expandingSet(cache, key1, key2, value) {
|
|
|
45
37
|
}
|
|
46
38
|
function assertValidRelationshipPayload(graph, op) {
|
|
47
39
|
const relationship = graph.get(op.record, op.field);
|
|
48
|
-
|
|
40
|
+
(test => {
|
|
49
41
|
if (!test) {
|
|
50
42
|
throw new Error(`Cannot update an implicit relationship`);
|
|
51
43
|
}
|
|
52
|
-
})(isHasMany(relationship) || isBelongsTo(relationship))
|
|
44
|
+
})(isHasMany(relationship) || isBelongsTo(relationship));
|
|
53
45
|
const payload = op.value;
|
|
54
46
|
const {
|
|
55
47
|
definition,
|
|
@@ -67,23 +59,23 @@ function assertValidRelationshipPayload(graph, op) {
|
|
|
67
59
|
kind
|
|
68
60
|
} = definition;
|
|
69
61
|
if (payload.links) {
|
|
70
|
-
warn(`You pushed a record of type '${type}' with a relationship '${field}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. WarpDrive will treat this relationship as known-to-be-empty.`, isAsync || !!payload.data || state.hasReceivedData, {
|
|
62
|
+
console.warn(`You pushed a record of type '${type}' with a relationship '${field}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. WarpDrive will treat this relationship as known-to-be-empty.`, isAsync || !!payload.data || state.hasReceivedData, {
|
|
71
63
|
id: 'ds.store.push-link-for-sync-relationship'
|
|
72
64
|
});
|
|
73
65
|
} else if (payload.data) {
|
|
74
66
|
if (kind === 'belongsTo') {
|
|
75
|
-
|
|
67
|
+
(test => {
|
|
76
68
|
if (!test) {
|
|
77
69
|
throw new Error(`A ${type} record was pushed into the store with the value of ${field} being ${inspect(payload.data)}, but ${field} is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.`);
|
|
78
70
|
}
|
|
79
|
-
})(!Array.isArray(payload.data))
|
|
71
|
+
})(!Array.isArray(payload.data));
|
|
80
72
|
assertRelationshipData(getStore(graph.store), identifier, payload.data, definition);
|
|
81
73
|
} else if (kind === 'hasMany') {
|
|
82
|
-
|
|
74
|
+
(test => {
|
|
83
75
|
if (!test) {
|
|
84
76
|
throw new Error(`A ${type} record was pushed into the store with the value of ${field} being '${inspect(payload.data)}', but ${field} is a hasMany relationship so the value must be an array. You should probably check your data payload or serializer.`);
|
|
85
77
|
}
|
|
86
|
-
})(Array.isArray(payload.data))
|
|
78
|
+
})(Array.isArray(payload.data));
|
|
87
79
|
if (Array.isArray(payload.data)) {
|
|
88
80
|
for (let i = 0; i < payload.data.length; i++) {
|
|
89
81
|
assertRelationshipData(getStore(graph.store), identifier, payload.data[i], definition);
|
|
@@ -211,7 +203,7 @@ function notifyChange(graph, relationship) {
|
|
|
211
203
|
const resourceKey = relationship.identifier;
|
|
212
204
|
const key = relationship.definition.key;
|
|
213
205
|
if (resourceKey === graph._removing) {
|
|
214
|
-
|
|
206
|
+
{
|
|
215
207
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
216
208
|
// eslint-disable-next-line no-console
|
|
217
209
|
console.log(`Graph: ignoring relationship change for removed identifier ${String(resourceKey)} ${key}`);
|
|
@@ -219,7 +211,7 @@ function notifyChange(graph, relationship) {
|
|
|
219
211
|
}
|
|
220
212
|
return;
|
|
221
213
|
}
|
|
222
|
-
|
|
214
|
+
{
|
|
223
215
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
224
216
|
// eslint-disable-next-line no-console
|
|
225
217
|
console.log(`Graph: notifying relationship change for ${String(resourceKey)} ${key}`);
|
|
@@ -228,33 +220,33 @@ function notifyChange(graph, relationship) {
|
|
|
228
220
|
graph.store.notifyChange(resourceKey, 'relationships', key);
|
|
229
221
|
}
|
|
230
222
|
function assertRelationshipData(store, resourceKey, data, meta) {
|
|
231
|
-
|
|
223
|
+
(test => {
|
|
232
224
|
if (!test) {
|
|
233
225
|
throw new Error(`A ${resourceKey.type} record was pushed into the store with the value of ${meta.key} being '${JSON.stringify(data)}', but ${meta.key} is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.`);
|
|
234
226
|
}
|
|
235
|
-
})(!Array.isArray(data))
|
|
236
|
-
|
|
227
|
+
})(!Array.isArray(data));
|
|
228
|
+
(test => {
|
|
237
229
|
if (!test) {
|
|
238
230
|
throw new Error(`Encountered a relationship identifier without a type for the ${meta.kind} relationship '${meta.key}' on <${resourceKey.type}:${String(resourceKey.id)}>, expected an identifier with type '${meta.type}' but found\n\n'${JSON.stringify(data, null, 2)}'\n\nPlease check your serializer and make sure it is serializing the relationship payload into a JSON API format.`);
|
|
239
231
|
}
|
|
240
|
-
})(data === null || 'type' in data && typeof data.type === 'string' && data.type.length)
|
|
241
|
-
|
|
232
|
+
})(data === null || 'type' in data && typeof data.type === 'string' && data.type.length);
|
|
233
|
+
(test => {
|
|
242
234
|
if (!test) {
|
|
243
235
|
throw new Error(`Encountered a relationship identifier without an id for the ${meta.kind} relationship '${meta.key}' on <${resourceKey.type}:${String(resourceKey.id)}>, expected an identifier but found\n\n'${JSON.stringify(data, null, 2)}'\n\nPlease check your serializer and make sure it is serializing the relationship payload into a JSON API format.`);
|
|
244
236
|
}
|
|
245
|
-
})(data === null || !!coerceId(data.id))
|
|
237
|
+
})(data === null || !!coerceId(data.id));
|
|
246
238
|
if (data?.type === meta.type) {
|
|
247
|
-
|
|
239
|
+
(test => {
|
|
248
240
|
if (!test) {
|
|
249
241
|
throw new Error(`Missing Schema: Encountered a relationship identifier { type: '${data.type}', id: '${String(data.id)}' } for the '${resourceKey.type}.${meta.key}' ${meta.kind} relationship on <${resourceKey.type}:${String(resourceKey.id)}>, but no schema exists for that type.`);
|
|
250
242
|
}
|
|
251
|
-
})(store.schema.hasResource(data))
|
|
243
|
+
})(store.schema.hasResource(data));
|
|
252
244
|
} else {
|
|
253
|
-
|
|
245
|
+
(test => {
|
|
254
246
|
if (!test) {
|
|
255
247
|
throw new Error(`Missing Schema: Encountered a relationship identifier with type '${data.type}' for the ${meta.kind} relationship '${meta.key}' on <${resourceKey.type}:${String(resourceKey.id)}>, Expected an identifier with type '${meta.type}'. No schema was found for '${data.type}'.`);
|
|
256
248
|
}
|
|
257
|
-
})(data === null || !data.type || store.schema.hasResource(data))
|
|
249
|
+
})(data === null || !data.type || store.schema.hasResource(data));
|
|
258
250
|
}
|
|
259
251
|
}
|
|
260
252
|
const RELATIONSHIP_KINDS = ['belongsTo', 'hasMany', 'resource', 'collection'];
|
|
@@ -370,11 +362,11 @@ function upgradeMeta(meta) {
|
|
|
370
362
|
niceMeta.key = meta.sourceKey ?? meta.name;
|
|
371
363
|
niceMeta.name = meta.name;
|
|
372
364
|
niceMeta.type = meta.type;
|
|
373
|
-
|
|
365
|
+
(test => {
|
|
374
366
|
if (!test) {
|
|
375
367
|
throw new Error(`Expected relationship definition to specify async`);
|
|
376
368
|
}
|
|
377
|
-
})(typeof options?.async === 'boolean')
|
|
369
|
+
})(typeof options?.async === 'boolean');
|
|
378
370
|
niceMeta.isAsync = options.async;
|
|
379
371
|
niceMeta.isImplicit = false;
|
|
380
372
|
niceMeta.isCollection = meta.kind === 'hasMany';
|
|
@@ -393,7 +385,7 @@ function upgradeMeta(meta) {
|
|
|
393
385
|
return niceMeta;
|
|
394
386
|
}
|
|
395
387
|
function assertConfiguration(info, type, key) {
|
|
396
|
-
|
|
388
|
+
{
|
|
397
389
|
const isSelfReferential = info.isSelfReferential;
|
|
398
390
|
if (isSelfReferential) {
|
|
399
391
|
return true;
|
|
@@ -472,7 +464,7 @@ function assertConfiguration(info, type, key) {
|
|
|
472
464
|
function isLHS(info, type, key) {
|
|
473
465
|
const isSelfReferential = info.isSelfReferential;
|
|
474
466
|
const isRelationship = key === info.lhs_relationshipName;
|
|
475
|
-
|
|
467
|
+
{
|
|
476
468
|
assertConfiguration(info, type, key);
|
|
477
469
|
}
|
|
478
470
|
if (isRelationship === true) {
|
|
@@ -499,18 +491,18 @@ function upgradeDefinition(graph, key, propertyName, isImplicit = false) {
|
|
|
499
491
|
if (cached !== undefined) {
|
|
500
492
|
return cached;
|
|
501
493
|
}
|
|
502
|
-
|
|
494
|
+
(test => {
|
|
503
495
|
if (!test) {
|
|
504
496
|
throw new Error(`Expected to find relationship definition in the cache for the implicit relationship ${propertyName}`);
|
|
505
497
|
}
|
|
506
|
-
})(!isImplicit)
|
|
498
|
+
})(!isImplicit);
|
|
507
499
|
const relationships = storeWrapper.schema.fields(key);
|
|
508
500
|
const relationshipsBySourceKey = storeWrapper.schema.cacheFields?.(key) ?? relationships;
|
|
509
|
-
|
|
501
|
+
(test => {
|
|
510
502
|
if (!test) {
|
|
511
503
|
throw new Error(`Expected to have a relationship definition for ${type} but none was found.`);
|
|
512
504
|
}
|
|
513
|
-
})(relationships)
|
|
505
|
+
})(relationships);
|
|
514
506
|
const meta = relationshipsBySourceKey.get(propertyName);
|
|
515
507
|
if (!meta) {
|
|
516
508
|
// TODO potentially we should just be permissive here since this is an implicit relationship
|
|
@@ -529,19 +521,19 @@ function upgradeDefinition(graph, key, propertyName, isImplicit = false) {
|
|
|
529
521
|
|
|
530
522
|
// CASE: We don't have a relationship at all
|
|
531
523
|
// we should only hit this in prod
|
|
532
|
-
|
|
524
|
+
(test => {
|
|
533
525
|
if (!test) {
|
|
534
526
|
throw new Error(`Expected a relationship schema for '${type}.${propertyName}', but no relationship schema was found.`);
|
|
535
527
|
}
|
|
536
|
-
})(meta)
|
|
528
|
+
})(meta);
|
|
537
529
|
cache[type][propertyName] = null;
|
|
538
530
|
return null;
|
|
539
531
|
}
|
|
540
|
-
|
|
532
|
+
(test => {
|
|
541
533
|
if (!test) {
|
|
542
534
|
throw new Error(`Expected ${propertyName} to be a relationship`);
|
|
543
535
|
}
|
|
544
|
-
})(isRelationshipField(meta))
|
|
536
|
+
})(isRelationshipField(meta));
|
|
545
537
|
const definition = /*#__NOINLINE__*/upgradeMeta(meta);
|
|
546
538
|
let inverseDefinition;
|
|
547
539
|
let inverseKey;
|
|
@@ -550,11 +542,11 @@ function upgradeDefinition(graph, key, propertyName, isImplicit = false) {
|
|
|
550
542
|
// CASE: Inverse is explicitly null
|
|
551
543
|
if (definition.inverseKey === null) {
|
|
552
544
|
// TODO probably dont need this assertion if polymorphic
|
|
553
|
-
|
|
545
|
+
(test => {
|
|
554
546
|
if (!test) {
|
|
555
547
|
throw new Error(`Expected the inverse model to exist`);
|
|
556
548
|
}
|
|
557
|
-
})(getStore(storeWrapper).modelFor(inverseType))
|
|
549
|
+
})(getStore(storeWrapper).modelFor(inverseType));
|
|
558
550
|
inverseDefinition = null;
|
|
559
551
|
} else {
|
|
560
552
|
inverseKey = /*#__NOINLINE__*/inverseForRelationship(getStore(storeWrapper), key, propertyName);
|
|
@@ -587,22 +579,22 @@ function upgradeDefinition(graph, key, propertyName, isImplicit = false) {
|
|
|
587
579
|
const inverseDefinitions = storeWrapper.schema.fields({
|
|
588
580
|
type: inverseType
|
|
589
581
|
});
|
|
590
|
-
|
|
582
|
+
(test => {
|
|
591
583
|
if (!test) {
|
|
592
584
|
throw new Error(`Expected to have a relationship definition for ${inverseType} but none was found.`);
|
|
593
585
|
}
|
|
594
|
-
})(inverseDefinitions)
|
|
586
|
+
})(inverseDefinitions);
|
|
595
587
|
const metaFromInverse = inverseDefinitions.get(inverseKey);
|
|
596
|
-
|
|
588
|
+
(test => {
|
|
597
589
|
if (!test) {
|
|
598
590
|
throw new Error(`Expected a relationship schema for '${inverseType}.${inverseKey}' to match the inverse of '${type}.${propertyName}', but no relationship schema was found.`);
|
|
599
591
|
}
|
|
600
|
-
})(metaFromInverse)
|
|
601
|
-
|
|
592
|
+
})(metaFromInverse);
|
|
593
|
+
(test => {
|
|
602
594
|
if (!test) {
|
|
603
595
|
throw new Error(`Expected ${inverseKey} to be a relationship`);
|
|
604
596
|
}
|
|
605
|
-
})(isRelationshipField(metaFromInverse))
|
|
597
|
+
})(isRelationshipField(metaFromInverse));
|
|
606
598
|
inverseDefinition = upgradeMeta(metaFromInverse);
|
|
607
599
|
}
|
|
608
600
|
}
|
|
@@ -659,19 +651,19 @@ function upgradeDefinition(graph, key, propertyName, isImplicit = false) {
|
|
|
659
651
|
*/
|
|
660
652
|
// CASE: We may have already discovered the inverse for the baseModelName
|
|
661
653
|
// CASE: We have already discovered the inverse
|
|
662
|
-
|
|
654
|
+
(test => {
|
|
663
655
|
if (!test) {
|
|
664
656
|
throw new Error(`We should have determined an inverseKey by now, open an issue if this is hit`);
|
|
665
657
|
}
|
|
666
|
-
})(typeof inverseKey === 'string' && inverseKey.length > 0)
|
|
658
|
+
})(typeof inverseKey === 'string' && inverseKey.length > 0);
|
|
667
659
|
cached = expandingGet(cache, baseType, propertyName) || expandingGet(cache, inverseType, inverseKey);
|
|
668
660
|
if (cached) {
|
|
669
661
|
// TODO this assert can be removed if the above assert is enabled
|
|
670
|
-
|
|
662
|
+
(test => {
|
|
671
663
|
if (!test) {
|
|
672
664
|
throw new Error(`The ${inverseType}:${inverseKey} relationship declares 'inverse: null', but it was resolved as the inverse for ${type}:${propertyName}.`);
|
|
673
665
|
}
|
|
674
|
-
})(cached.hasInverse !== false)
|
|
666
|
+
})(cached.hasInverse !== false);
|
|
675
667
|
const _isLHS = cached.lhs_baseModelName === baseType;
|
|
676
668
|
const modelNames = _isLHS ? cached.lhs_modelNames : cached.rhs_modelNames;
|
|
677
669
|
// make this lookup easier in the future by caching the key
|
|
@@ -721,24 +713,36 @@ function inverseForRelationship(store, resourceKey, key) {
|
|
|
721
713
|
if (!definition) {
|
|
722
714
|
return null;
|
|
723
715
|
}
|
|
724
|
-
|
|
716
|
+
(test => {
|
|
725
717
|
if (!test) {
|
|
726
718
|
throw new Error(`Expected ${key} to be a relationship`);
|
|
727
719
|
}
|
|
728
|
-
})(isRelationshipField(definition))
|
|
729
|
-
|
|
720
|
+
})(isRelationshipField(definition));
|
|
721
|
+
(test => {
|
|
730
722
|
if (!test) {
|
|
731
723
|
throw new Error(`Expected the relationship defintion to specify the inverse type or null.`);
|
|
732
724
|
}
|
|
733
|
-
})(definition.options?.inverse === null || typeof definition.options?.inverse === 'string' && definition.options.inverse.length > 0)
|
|
725
|
+
})(definition.options?.inverse === null || typeof definition.options?.inverse === 'string' && definition.options.inverse.length > 0);
|
|
734
726
|
return definition.options.inverse;
|
|
735
727
|
}
|
|
736
728
|
|
|
737
729
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
738
730
|
|
|
731
|
+
/*
|
|
732
|
+
Assert that `addedRecord` has a valid type so it can be added to the
|
|
733
|
+
relationship of the `record`.
|
|
734
|
+
|
|
735
|
+
The assert basically checks if the `addedRecord` can be added to the
|
|
736
|
+
relationship (specified via `relationshipMeta`) of the `record`.
|
|
737
|
+
|
|
738
|
+
This utility should only be used internally, as both record parameters must
|
|
739
|
+
be ResourceKeys and the `relationshipMeta` needs to be the meta
|
|
740
|
+
information about the relationship, retrieved via
|
|
741
|
+
`record.relationshipFor(key)`.
|
|
742
|
+
*/
|
|
739
743
|
let assertPolymorphicType;
|
|
740
744
|
let assertInheritedSchema;
|
|
741
|
-
|
|
745
|
+
{
|
|
742
746
|
function validateSchema(definition, meta) {
|
|
743
747
|
const errors = new Map();
|
|
744
748
|
if (definition.inverseKey !== meta.name) {
|
|
@@ -870,61 +874,61 @@ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
|
870
874
|
}
|
|
871
875
|
if (parentDefinition.isPolymorphic) {
|
|
872
876
|
let meta = store.schema.fields(addedIdentifier).get(parentDefinition.inverseKey);
|
|
873
|
-
|
|
877
|
+
(test => {
|
|
874
878
|
if (!test) {
|
|
875
879
|
throw new Error(`No '${parentDefinition.inverseKey}' field exists on '${addedIdentifier.type}'. To use this type in the polymorphic relationship '${parentDefinition.inverseType}.${parentDefinition.key}' the relationships schema definition for ${addedIdentifier.type} should include:${expectedSchema(parentDefinition)}`);
|
|
876
880
|
}
|
|
877
|
-
})(meta)
|
|
878
|
-
|
|
881
|
+
})(meta);
|
|
882
|
+
(test => {
|
|
879
883
|
if (!test) {
|
|
880
884
|
throw new Error(`Expected the field ${parentDefinition.inverseKey} to be a relationship`);
|
|
881
885
|
}
|
|
882
|
-
})(meta && isRelationshipField(meta))
|
|
886
|
+
})(meta && isRelationshipField(meta));
|
|
883
887
|
meta = isLegacyField(meta) ? meta : temporaryConvertToLegacy(meta);
|
|
884
|
-
|
|
888
|
+
(test => {
|
|
885
889
|
if (!test) {
|
|
886
890
|
throw new Error(`You should not specify both options.as and options.inverse as null on ${addedIdentifier.type}.${parentDefinition.inverseKey}, as if there is no inverse field there is no abstract type to conform to. You may have intended for this relationship to be polymorphic, or you may have mistakenly set inverse to null.`);
|
|
887
891
|
}
|
|
888
|
-
})(!(meta.options.inverse === null && meta?.options.as?.length))
|
|
892
|
+
})(!(meta.options.inverse === null && meta?.options.as?.length));
|
|
889
893
|
const errors = validateSchema(parentDefinition, meta);
|
|
890
|
-
|
|
894
|
+
(test => {
|
|
891
895
|
if (!test) {
|
|
892
896
|
throw new Error(`The schema for the relationship '${parentDefinition.inverseKey}' on '${addedIdentifier.type}' type does not correctly implement '${parentDefinition.type}' and thus cannot be assigned to the '${parentDefinition.key}' relationship in '${parentIdentifier.type}'. If using this record in this polymorphic relationship is desired, correct the errors in the schema shown below:${printSchema(meta, errors)}`);
|
|
893
897
|
}
|
|
894
|
-
})(errors.size === 0)
|
|
898
|
+
})(errors.size === 0);
|
|
895
899
|
} else if (addedIdentifier.type !== parentDefinition.type) {
|
|
896
900
|
// if we are not polymorphic
|
|
897
901
|
// then the addedIdentifier.type must be the same as the parentDefinition.type
|
|
898
902
|
let meta = store.schema.fields(addedIdentifier).get(parentDefinition.inverseKey);
|
|
899
|
-
|
|
903
|
+
(test => {
|
|
900
904
|
if (!test) {
|
|
901
905
|
throw new Error(`Expected the field ${parentDefinition.inverseKey} to be a relationship`);
|
|
902
906
|
}
|
|
903
|
-
})(!meta || isRelationshipField(meta))
|
|
907
|
+
})(!meta || isRelationshipField(meta));
|
|
904
908
|
meta = meta && (isLegacyField(meta) ? meta : temporaryConvertToLegacy(meta));
|
|
905
909
|
if (meta?.options.as === parentDefinition.type) {
|
|
906
910
|
// inverse is likely polymorphic but missing the polymorphic flag
|
|
907
911
|
let meta = store.schema.fields({
|
|
908
912
|
type: parentDefinition.inverseType
|
|
909
913
|
}).get(parentDefinition.key);
|
|
910
|
-
|
|
914
|
+
(test => {
|
|
911
915
|
if (!test) {
|
|
912
916
|
throw new Error(`Expected the field ${parentDefinition.key} to be a relationship`);
|
|
913
917
|
}
|
|
914
|
-
})(meta && isRelationshipField(meta))
|
|
918
|
+
})(meta && isRelationshipField(meta));
|
|
915
919
|
meta = isLegacyField(meta) ? meta : temporaryConvertToLegacy(meta);
|
|
916
920
|
const errors = validateSchema(definitionWithPolymorphic(inverseDefinition(parentDefinition)), meta);
|
|
917
|
-
|
|
921
|
+
(test => {
|
|
918
922
|
{
|
|
919
923
|
throw new Error(`The '<${addedIdentifier.type}>.${parentDefinition.inverseKey}' relationship cannot be used polymorphically because '<${parentDefinition.inverseType}>.${parentDefinition.key} is not a polymorphic relationship. To use this relationship in a polymorphic manner, fix the following schema issues on the relationships schema for '${parentDefinition.inverseType}':${printSchema(meta, errors)}`);
|
|
920
924
|
}
|
|
921
|
-
})()
|
|
925
|
+
})();
|
|
922
926
|
} else {
|
|
923
|
-
|
|
927
|
+
(test => {
|
|
924
928
|
{
|
|
925
929
|
throw new Error(`The '${addedIdentifier.type}' type does not implement '${parentDefinition.type}' and thus cannot be assigned to the '${parentDefinition.key}' relationship in '${parentIdentifier.type}'. If this relationship should be polymorphic, mark ${parentDefinition.inverseType}.${parentDefinition.key} as \`polymorphic: true\` and ${addedIdentifier.type}.${parentDefinition.inverseKey} as implementing it via \`as: '${parentDefinition.type}'\`.`);
|
|
926
930
|
}
|
|
927
|
-
})()
|
|
931
|
+
})();
|
|
928
932
|
}
|
|
929
933
|
}
|
|
930
934
|
};
|
|
@@ -1000,11 +1004,11 @@ function replaceRelatedRecords(graph, op, isRemote) {
|
|
|
1000
1004
|
function replaceRelatedRecordsLocal(graph, op, isRemote) {
|
|
1001
1005
|
const resourceKeys = op.value;
|
|
1002
1006
|
const relationship = graph.get(op.record, op.field);
|
|
1003
|
-
|
|
1007
|
+
(test => {
|
|
1004
1008
|
if (!test) {
|
|
1005
1009
|
throw new Error(`expected hasMany relationship`);
|
|
1006
1010
|
}
|
|
1007
|
-
})(isHasMany(relationship))
|
|
1011
|
+
})(isHasMany(relationship));
|
|
1008
1012
|
relationship.state.hasReceivedData = true;
|
|
1009
1013
|
const {
|
|
1010
1014
|
additions,
|
|
@@ -1019,7 +1023,7 @@ function replaceRelatedRecordsLocal(graph, op, isRemote) {
|
|
|
1019
1023
|
} = op;
|
|
1020
1024
|
const wasDirty = relationship.isDirty;
|
|
1021
1025
|
let localBecameDirty = false;
|
|
1022
|
-
|
|
1026
|
+
{
|
|
1023
1027
|
if (getGlobalConfig().WarpDrive.debug.LOG_METRIC_COUNTS || globalThis.getWarpDriveRuntimeConfig().debug.LOG_METRIC_COUNTS) {
|
|
1024
1028
|
count(`replaceRelatedRecordsLocal ${'type' in record ? record.type : '<document>'} ${op.field}`);
|
|
1025
1029
|
}
|
|
@@ -1030,7 +1034,7 @@ function replaceRelatedRecordsLocal(graph, op, isRemote) {
|
|
|
1030
1034
|
const removalsHas = removals?.has(resourceKey);
|
|
1031
1035
|
if (removalsHas || !additions?.has(resourceKey)) {
|
|
1032
1036
|
if (type !== resourceKey.type) {
|
|
1033
|
-
|
|
1037
|
+
{
|
|
1034
1038
|
assertPolymorphicType(relationship.identifier, relationship.definition, resourceKey, graph.store);
|
|
1035
1039
|
}
|
|
1036
1040
|
graph.registerPolymorphicType(type, resourceKey.type);
|
|
@@ -1094,16 +1098,16 @@ function replaceRelatedRecordsLocal(graph, op, isRemote) {
|
|
|
1094
1098
|
function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
1095
1099
|
const resourceKeys = op.value;
|
|
1096
1100
|
const relationship = graph.get(op.record, op.field);
|
|
1097
|
-
|
|
1101
|
+
{
|
|
1098
1102
|
if (getGlobalConfig().WarpDrive.debug.LOG_METRIC_COUNTS || globalThis.getWarpDriveRuntimeConfig().debug.LOG_METRIC_COUNTS) {
|
|
1099
1103
|
count(`replaceRelatedRecordsRemote ${'type' in op.record ? op.record.type : '<document>'} ${op.field}`);
|
|
1100
1104
|
}
|
|
1101
1105
|
}
|
|
1102
|
-
|
|
1106
|
+
(test => {
|
|
1103
1107
|
if (!test) {
|
|
1104
1108
|
throw new Error(`You can only '${op.op}' on a hasMany relationship. ${op.record.type}.${op.field} is a ${relationship.definition.kind}`);
|
|
1105
1109
|
}
|
|
1106
|
-
})(isHasMany(relationship))
|
|
1110
|
+
})(isHasMany(relationship));
|
|
1107
1111
|
if (isRemote) {
|
|
1108
1112
|
graph._addToTransaction(relationship);
|
|
1109
1113
|
}
|
|
@@ -1126,7 +1130,7 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
1126
1130
|
} = relationship.definition;
|
|
1127
1131
|
const diff = diffCollection(resourceKeys, relationship, resourceKey => {
|
|
1128
1132
|
if (type !== resourceKey.type) {
|
|
1129
|
-
|
|
1133
|
+
{
|
|
1130
1134
|
assertPolymorphicType(relationship.identifier, relationship.definition, resourceKey, graph.store);
|
|
1131
1135
|
}
|
|
1132
1136
|
graph.registerPolymorphicType(type, resourceKey.type);
|
|
@@ -1137,7 +1141,7 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
1137
1141
|
if (relationship.additions?.has(resourceKey)) {
|
|
1138
1142
|
relationship.additions.delete(resourceKey);
|
|
1139
1143
|
} else {
|
|
1140
|
-
|
|
1144
|
+
{
|
|
1141
1145
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1142
1146
|
if (!relationship.isDirty) {
|
|
1143
1147
|
// eslint-disable-next-line no-console
|
|
@@ -1154,7 +1158,7 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
1154
1158
|
if (relationship.removals?.has(resourceKey)) {
|
|
1155
1159
|
relationship.removals.delete(resourceKey);
|
|
1156
1160
|
} else {
|
|
1157
|
-
|
|
1161
|
+
{
|
|
1158
1162
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1159
1163
|
if (!relationship.isDirty) {
|
|
1160
1164
|
// eslint-disable-next-line no-console
|
|
@@ -1179,7 +1183,7 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
1179
1183
|
// may allow us to more efficiently patch
|
|
1180
1184
|
// the associated ManyArray
|
|
1181
1185
|
relationship._diff = diff;
|
|
1182
|
-
|
|
1186
|
+
{
|
|
1183
1187
|
// only do this for legacy hasMany, not collection
|
|
1184
1188
|
// and provide a way to incrementally migrate
|
|
1185
1189
|
if (
|
|
@@ -1225,16 +1229,7 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
1225
1229
|
}
|
|
1226
1230
|
}
|
|
1227
1231
|
if (deprecationInfo.triggered) {
|
|
1228
|
-
|
|
1229
|
-
id: 'ember-data:deprecate-relationship-remote-update-clearing-local-state',
|
|
1230
|
-
for: 'ember-data',
|
|
1231
|
-
since: {
|
|
1232
|
-
enabled: '5.3',
|
|
1233
|
-
available: '4.13'
|
|
1234
|
-
},
|
|
1235
|
-
until: '6.0',
|
|
1236
|
-
url: 'https://deprecations.emberjs.com/v5.x#ember-data-deprecate-relationship-remote-update-clearing-local-state'
|
|
1237
|
-
});
|
|
1232
|
+
console.warn(`WarpDrive is changing the default semantics of updates to the remote state of relationships.\n\nThe following local state was cleared from the <${relationship.identifier.type}>.${relationship.definition.key} hasMany relationship but will not be once this deprecation is resolved by opting into the new behavior:\n\n\tAdded: [${deprecationInfo.additions.map(i => i.lid).join(', ')}]\n\tRemoved: [${deprecationInfo.removals.map(i => i.lid).join(', ')}]`);
|
|
1238
1233
|
}
|
|
1239
1234
|
}
|
|
1240
1235
|
}
|
|
@@ -1248,7 +1243,7 @@ function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
1248
1243
|
type
|
|
1249
1244
|
} = relationship.definition;
|
|
1250
1245
|
if (type !== value.type) {
|
|
1251
|
-
|
|
1246
|
+
{
|
|
1252
1247
|
assertPolymorphicType(relationship.identifier, relationship.definition, value, graph.store);
|
|
1253
1248
|
}
|
|
1254
1249
|
graph.registerPolymorphicType(type, value.type);
|
|
@@ -1360,11 +1355,11 @@ function flushCanonical(graph, rel) {
|
|
|
1360
1355
|
}
|
|
1361
1356
|
function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
1362
1357
|
const relationship = graph.get(op.record, op.field);
|
|
1363
|
-
|
|
1358
|
+
(test => {
|
|
1364
1359
|
if (!test) {
|
|
1365
1360
|
throw new Error(`You can only '${op.op}' on a belongsTo relationship. ${op.record.type}.${op.field} is a ${relationship.definition.kind}`);
|
|
1366
1361
|
}
|
|
1367
|
-
})(isBelongsTo(relationship))
|
|
1362
|
+
})(isBelongsTo(relationship));
|
|
1368
1363
|
if (isRemote) {
|
|
1369
1364
|
graph._addToTransaction(relationship);
|
|
1370
1365
|
}
|
|
@@ -1425,21 +1420,12 @@ function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
|
1425
1420
|
}
|
|
1426
1421
|
if (existingState && localState === existingState) {
|
|
1427
1422
|
notifyInverseOfPotentialMaterialization(graph, existingState, definition.inverseKey, op.record, isRemote);
|
|
1428
|
-
} else
|
|
1423
|
+
} else {
|
|
1429
1424
|
// if localState does not match existingState then we know
|
|
1430
1425
|
// we have a local mutation that has not been persisted yet
|
|
1431
1426
|
if (localState !== op.value && relationship.definition.resetOnRemoteUpdate !== false) {
|
|
1432
1427
|
relationship.localState = existingState;
|
|
1433
|
-
|
|
1434
|
-
id: 'ember-data:deprecate-relationship-remote-update-clearing-local-state',
|
|
1435
|
-
for: 'ember-data',
|
|
1436
|
-
since: {
|
|
1437
|
-
enabled: '5.3',
|
|
1438
|
-
available: '4.13'
|
|
1439
|
-
},
|
|
1440
|
-
until: '6.0',
|
|
1441
|
-
url: 'https://deprecations.emberjs.com/v5.x#ember-data-deprecate-relationship-remote-update-clearing-local-state'
|
|
1442
|
-
});
|
|
1428
|
+
console.warn(`WarpDrive is changing the default semantics of updates to the remote state of relationships.\n\nThe following local state was cleared from the <${relationship.identifier.type}>.${relationship.definition.key} belongsTo relationship but will not be once this deprecation is resolved:\n\n\t${localState ? 'Added: ' + localState.lid + '\n\t' : ''}${existingState ? 'Removed: ' + existingState.lid : ''}`);
|
|
1443
1429
|
notifyChange(graph, relationship);
|
|
1444
1430
|
}
|
|
1445
1431
|
}
|
|
@@ -1469,7 +1455,7 @@ function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
|
1469
1455
|
// but the record does turn out to be polymorphic
|
|
1470
1456
|
// this should still assert if the user is relying on legacy inheritance/mixins to
|
|
1471
1457
|
// provide polymorphic behavior and has not yet added the polymorphic flags
|
|
1472
|
-
|
|
1458
|
+
{
|
|
1473
1459
|
assertPolymorphicType(relationship.identifier, definition, op.value, graph.store);
|
|
1474
1460
|
}
|
|
1475
1461
|
graph.registerPolymorphicType(definition.type, op.value.type);
|
|
@@ -1493,19 +1479,10 @@ function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
|
1493
1479
|
// But when localState does not match the new remoteState and
|
|
1494
1480
|
// and localState !== existingState then we know we have a local mutation
|
|
1495
1481
|
// that has not been persisted yet.
|
|
1496
|
-
} else
|
|
1482
|
+
} else {
|
|
1497
1483
|
if (localState !== remoteState && localState !== existingState && relationship.definition.resetOnRemoteUpdate !== false) {
|
|
1498
1484
|
relationship.localState = remoteState;
|
|
1499
|
-
|
|
1500
|
-
id: 'ember-data:deprecate-relationship-remote-update-clearing-local-state',
|
|
1501
|
-
for: 'ember-data',
|
|
1502
|
-
since: {
|
|
1503
|
-
enabled: '5.3',
|
|
1504
|
-
available: '4.13'
|
|
1505
|
-
},
|
|
1506
|
-
until: '6.0',
|
|
1507
|
-
url: 'https://deprecations.emberjs.com/v5.x#ember-data-deprecate-relationship-remote-update-clearing-local-state'
|
|
1508
|
-
});
|
|
1485
|
+
console.warn(`WarpDrive is changing the default semantics of updates to the remote state of relationships.\n\nThe following local state was cleared from the <${relationship.identifier.type}>.${relationship.definition.key} belongsTo relationship but will not be once this deprecation is resolved:\n\n\t${localState ? 'Added: ' + localState.lid + '\n\t' : ''}${existingState ? 'Removed: ' + existingState.lid : ''}`);
|
|
1509
1486
|
notifyChange(graph, relationship);
|
|
1510
1487
|
}
|
|
1511
1488
|
}
|
|
@@ -1570,7 +1547,7 @@ function _deprecatedCompare(priorLocalState, newState, newMembers, prevState, pr
|
|
|
1570
1547
|
// however: if the new remote order matches the current local order
|
|
1571
1548
|
// we can disregard the change notification generation so long as
|
|
1572
1549
|
// we are not configured to reset on remote update (which is deprecated)
|
|
1573
|
-
|
|
1550
|
+
{
|
|
1574
1551
|
if (!remoteClearsLocal && i < priorLocalLength) {
|
|
1575
1552
|
const priorLocalMember = priorLocalState[j];
|
|
1576
1553
|
if (priorLocalMember !== member) {
|
|
@@ -1579,21 +1556,12 @@ function _deprecatedCompare(priorLocalState, newState, newMembers, prevState, pr
|
|
|
1579
1556
|
} else {
|
|
1580
1557
|
changed = true;
|
|
1581
1558
|
}
|
|
1582
|
-
} else {
|
|
1583
|
-
if (i < priorLocalLength) {
|
|
1584
|
-
const priorLocalMember = priorLocalState[j];
|
|
1585
|
-
if (priorLocalMember !== member) {
|
|
1586
|
-
changed = true;
|
|
1587
|
-
}
|
|
1588
|
-
} else {
|
|
1589
|
-
changed = true;
|
|
1590
|
-
}
|
|
1591
1559
|
}
|
|
1592
1560
|
|
|
1593
1561
|
// if remote order hasn't changed but local order differs
|
|
1594
1562
|
// and we are configured to reset on remote update (which is deprecated)
|
|
1595
1563
|
// then we still need to mark the relationship as changed
|
|
1596
|
-
} else
|
|
1564
|
+
} else {
|
|
1597
1565
|
if (remoteClearsLocal) {
|
|
1598
1566
|
if (!changed && j < priorLocalLength) {
|
|
1599
1567
|
const priorLocalMember = priorLocalState[j];
|
|
@@ -1638,7 +1606,7 @@ function _compare(priorLocalState, finalState, finalSet, prevState, prevSet, onA
|
|
|
1638
1606
|
const added = new Set();
|
|
1639
1607
|
const removed = new Set();
|
|
1640
1608
|
const priorLocalLength = priorLocalState?.length ?? 0;
|
|
1641
|
-
|
|
1609
|
+
{
|
|
1642
1610
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1643
1611
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
1644
1612
|
changed &&
|
|
@@ -1657,7 +1625,7 @@ function _compare(priorLocalState, finalState, finalSet, prevState, prevSet, onA
|
|
|
1657
1625
|
if (i < priorLocalLength) {
|
|
1658
1626
|
const priorLocalMember = priorLocalState[i];
|
|
1659
1627
|
if (priorLocalMember !== member) {
|
|
1660
|
-
|
|
1628
|
+
{
|
|
1661
1629
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1662
1630
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
|
|
1663
1631
|
!changed && console.log(`changed because priorLocalMember !== member && !prevSet.has(member)`);
|
|
@@ -1687,7 +1655,7 @@ function _compare(priorLocalState, finalState, finalSet, prevState, prevSet, onA
|
|
|
1687
1655
|
if (i < priorLocalLength) {
|
|
1688
1656
|
const priorLocalMember = priorLocalState[i];
|
|
1689
1657
|
if (priorLocalMember !== member) {
|
|
1690
|
-
|
|
1658
|
+
{
|
|
1691
1659
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1692
1660
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
|
|
1693
1661
|
!changed && console.log(`changed because priorLocalMember !== member && member !== prevMember`);
|
|
@@ -1698,7 +1666,7 @@ function _compare(priorLocalState, finalState, finalSet, prevState, prevSet, onA
|
|
|
1698
1666
|
} else if (i < finalLength) {
|
|
1699
1667
|
// if we have exceeded the length of priorLocalState and we are within the range
|
|
1700
1668
|
// of the finalState then we must have changed
|
|
1701
|
-
|
|
1669
|
+
{
|
|
1702
1670
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1703
1671
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
|
|
1704
1672
|
!changed && console.log(`changed because priorMember !== member && index >= priorLocalLength`);
|
|
@@ -1710,12 +1678,12 @@ function _compare(priorLocalState, finalState, finalSet, prevState, prevSet, onA
|
|
|
1710
1678
|
// if remote order hasn't changed but local order differs
|
|
1711
1679
|
// and we are configured to reset on remote update (which is deprecated)
|
|
1712
1680
|
// then we still need to mark the relationship as changed
|
|
1713
|
-
} else
|
|
1681
|
+
} else {
|
|
1714
1682
|
if (remoteClearsLocal) {
|
|
1715
1683
|
if (equalLength && !changed && i < priorLocalLength) {
|
|
1716
1684
|
const priorLocalMember = priorLocalState[i];
|
|
1717
1685
|
if (priorLocalMember !== prevMember) {
|
|
1718
|
-
|
|
1686
|
+
{
|
|
1719
1687
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1720
1688
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-console
|
|
1721
1689
|
!changed && console.log(`changed because priorLocalMember !== prevMember && remoteClearsLocal`);
|
|
@@ -1765,15 +1733,14 @@ function _compare(priorLocalState, finalState, finalSet, prevState, prevSet, onA
|
|
|
1765
1733
|
// if you do not have a priorLocalState you can't be changed
|
|
1766
1734
|
// ergo, we never need to set changed in this branch.
|
|
1767
1735
|
// this log can still be useful for debugging.
|
|
1768
|
-
|
|
1736
|
+
{
|
|
1769
1737
|
if (getGlobalConfig().WarpDrive.debug.DEBUG_RELATIONSHIP_NOTIFICATIONS || globalThis.getWarpDriveRuntimeConfig().debug.DEBUG_RELATIONSHIP_NOTIFICATIONS) {
|
|
1770
1738
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
1771
1739
|
!changed &&
|
|
1772
1740
|
// eslint-disable-next-line no-console
|
|
1773
1741
|
console.log(`changed because i >= priorLocalLength && i < finalLength && !finalSet.has(prevMember)`);
|
|
1774
1742
|
}
|
|
1775
|
-
}
|
|
1776
|
-
//
|
|
1743
|
+
} //
|
|
1777
1744
|
// we do still set remoteOrderChanged as it has
|
|
1778
1745
|
remoteOrderChanged = true;
|
|
1779
1746
|
removed.add(prevMember);
|
|
@@ -1797,43 +1764,28 @@ function diffCollection(finalState, relationship, onAdd, onDel) {
|
|
|
1797
1764
|
remoteState,
|
|
1798
1765
|
remoteMembers
|
|
1799
1766
|
} = relationship;
|
|
1800
|
-
|
|
1767
|
+
{
|
|
1801
1768
|
if (finalState.length !== finalSet.size) {
|
|
1802
1769
|
const {
|
|
1803
1770
|
diff,
|
|
1804
1771
|
duplicates
|
|
1805
1772
|
} = _deprecatedCompare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
id: 'ember-data:deprecate-non-unique-relationship-entries',
|
|
1809
|
-
for: 'ember-data',
|
|
1810
|
-
until: '6.0',
|
|
1811
|
-
since: {
|
|
1812
|
-
available: '4.13',
|
|
1813
|
-
enabled: '5.3'
|
|
1814
|
-
}
|
|
1815
|
-
});
|
|
1816
|
-
// eslint-disable-next-line no-console
|
|
1773
|
+
{
|
|
1774
|
+
console.warn(`Expected all entries in the relationship ${relationship.definition.type}:${relationship.definition.key} to be unique, see log for a list of duplicate entry indeces`); // eslint-disable-next-line no-console
|
|
1817
1775
|
console.log(duplicates);
|
|
1818
1776
|
}
|
|
1819
1777
|
return diff;
|
|
1820
1778
|
}
|
|
1821
|
-
} else {
|
|
1822
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1823
|
-
if (!test) {
|
|
1824
|
-
throw new Error(`Expected all entries in the relationship to be unique, found duplicates`);
|
|
1825
|
-
}
|
|
1826
|
-
})(finalState.length === finalSet.size) : {};
|
|
1827
1779
|
}
|
|
1828
1780
|
return _compare(priorLocalState, finalState, finalSet, remoteState, remoteMembers, onAdd, onDel, relationship.definition.resetOnRemoteUpdate);
|
|
1829
1781
|
}
|
|
1830
1782
|
function computeLocalState(storage) {
|
|
1831
1783
|
if (!storage.isDirty) {
|
|
1832
|
-
|
|
1784
|
+
(test => {
|
|
1833
1785
|
if (!test) {
|
|
1834
1786
|
throw new Error(`Expected localState to be present`);
|
|
1835
1787
|
}
|
|
1836
|
-
})(Array.isArray(storage.localState))
|
|
1788
|
+
})(Array.isArray(storage.localState));
|
|
1837
1789
|
return storage.localState;
|
|
1838
1790
|
}
|
|
1839
1791
|
const state = storage.remoteState.slice();
|
|
@@ -1865,33 +1817,33 @@ function _add(graph, record, relationship, value, index, isRemote) {
|
|
|
1865
1817
|
return !isRemote ? _addLocal(graph, record, relationship, value, index) : _addRemote(graph, record, relationship, value, index);
|
|
1866
1818
|
}
|
|
1867
1819
|
function _addRemote(graph, record, relationship, value, index) {
|
|
1868
|
-
|
|
1820
|
+
(test => {
|
|
1869
1821
|
if (!test) {
|
|
1870
1822
|
throw new Error(`expected an identifier to add to the collection relationship`);
|
|
1871
1823
|
}
|
|
1872
|
-
})(value)
|
|
1824
|
+
})(value);
|
|
1873
1825
|
const {
|
|
1874
1826
|
remoteMembers,
|
|
1875
1827
|
additions,
|
|
1876
1828
|
removals,
|
|
1877
1829
|
remoteState
|
|
1878
1830
|
} = relationship;
|
|
1879
|
-
|
|
1831
|
+
(test => {
|
|
1880
1832
|
if (!test) {
|
|
1881
1833
|
throw new Error(`Cannot add a resource that is already present`);
|
|
1882
1834
|
}
|
|
1883
|
-
})(!remoteMembers.has(value))
|
|
1835
|
+
})(!remoteMembers.has(value));
|
|
1884
1836
|
if (remoteMembers.has(value)) {
|
|
1885
1837
|
return false;
|
|
1886
1838
|
}
|
|
1887
1839
|
|
|
1888
1840
|
// add to the remote state
|
|
1889
1841
|
remoteMembers.add(value);
|
|
1890
|
-
|
|
1842
|
+
(test => {
|
|
1891
1843
|
if (!test) {
|
|
1892
1844
|
throw new Error(`Cannot insert at an index that is not in bounds`);
|
|
1893
1845
|
}
|
|
1894
|
-
})(index === null || index >= 0 && index < remoteState.length)
|
|
1846
|
+
})(index === null || index >= 0 && index < remoteState.length);
|
|
1895
1847
|
const hasValidIndex = index !== null && index >= 0 && index < remoteState.length;
|
|
1896
1848
|
if (hasValidIndex) {
|
|
1897
1849
|
remoteState.splice(index, 0, value);
|
|
@@ -1906,11 +1858,11 @@ function _addRemote(graph, record, relationship, value, index) {
|
|
|
1906
1858
|
// nothing more to do this was our state already
|
|
1907
1859
|
return false;
|
|
1908
1860
|
}
|
|
1909
|
-
|
|
1861
|
+
(test => {
|
|
1910
1862
|
if (!test) {
|
|
1911
1863
|
throw new Error(`Remote state indicated addition of a resource that was present only as a local mutation`);
|
|
1912
1864
|
}
|
|
1913
|
-
})(!removals?.has(value))
|
|
1865
|
+
})(!removals?.has(value));
|
|
1914
1866
|
|
|
1915
1867
|
// if the relationship already needs to recalc, we don't bother
|
|
1916
1868
|
// attempting to patch the localState
|
|
@@ -1945,11 +1897,11 @@ function _addLocal(graph, record, relationship, value, index) {
|
|
|
1945
1897
|
let additions = relationship.additions;
|
|
1946
1898
|
const hasPresence = remoteMembers.has(value) || additions?.has(value);
|
|
1947
1899
|
if (hasPresence && !removals?.has(value)) {
|
|
1948
|
-
|
|
1900
|
+
(test => {
|
|
1949
1901
|
if (!test) {
|
|
1950
1902
|
throw new Error(`Attempted to add the resource '${value.lid}' to the collection <${relationship.identifier.type}>.${relationship.definition.key} it was already in`);
|
|
1951
1903
|
}
|
|
1952
|
-
})(hasPresence && !removals?.has(value))
|
|
1904
|
+
})(hasPresence && !removals?.has(value));
|
|
1953
1905
|
return false;
|
|
1954
1906
|
}
|
|
1955
1907
|
if (removals?.has(value)) {
|
|
@@ -1964,7 +1916,7 @@ function _addLocal(graph, record, relationship, value, index) {
|
|
|
1964
1916
|
type
|
|
1965
1917
|
} = relationship.definition;
|
|
1966
1918
|
if (type !== value.type) {
|
|
1967
|
-
|
|
1919
|
+
{
|
|
1968
1920
|
assertPolymorphicType(record, relationship.definition, value, graph.store);
|
|
1969
1921
|
}
|
|
1970
1922
|
graph.registerPolymorphicType(value.type, type);
|
|
@@ -1991,11 +1943,11 @@ function _remove(graph, record, relationship, value, index, isRemote) {
|
|
|
1991
1943
|
return !isRemote ? _removeLocal(relationship, value) : _removeRemote(relationship, value);
|
|
1992
1944
|
}
|
|
1993
1945
|
function _removeLocal(relationship, value) {
|
|
1994
|
-
|
|
1946
|
+
(test => {
|
|
1995
1947
|
if (!test) {
|
|
1996
1948
|
throw new Error(`expected an identifier to remove from the collection relationship`);
|
|
1997
1949
|
}
|
|
1998
|
-
})(value)
|
|
1950
|
+
})(value);
|
|
1999
1951
|
const {
|
|
2000
1952
|
remoteMembers,
|
|
2001
1953
|
additions
|
|
@@ -2003,11 +1955,11 @@ function _removeLocal(relationship, value) {
|
|
|
2003
1955
|
let removals = relationship.removals;
|
|
2004
1956
|
const hasPresence = remoteMembers.has(value) || additions?.has(value);
|
|
2005
1957
|
if (!hasPresence || removals?.has(value)) {
|
|
2006
|
-
|
|
1958
|
+
(test => {
|
|
2007
1959
|
if (!test) {
|
|
2008
1960
|
throw new Error(`Attempted to remove the resource '${value.lid}' from the collection <${relationship.identifier.type}>.${relationship.definition.key} but it was not present`);
|
|
2009
1961
|
}
|
|
2010
|
-
})(!hasPresence || removals?.has(value))
|
|
1962
|
+
})(!hasPresence || removals?.has(value));
|
|
2011
1963
|
return false;
|
|
2012
1964
|
}
|
|
2013
1965
|
if (additions?.has(value)) {
|
|
@@ -2027,37 +1979,37 @@ function _removeLocal(relationship, value) {
|
|
|
2027
1979
|
// be relied upon as any remote change will blow it away
|
|
2028
1980
|
if (relationship.localState) {
|
|
2029
1981
|
const index = relationship.localState.indexOf(value);
|
|
2030
|
-
|
|
1982
|
+
(test => {
|
|
2031
1983
|
if (!test) {
|
|
2032
1984
|
throw new Error(`Cannot remove a resource that is not present`);
|
|
2033
1985
|
}
|
|
2034
|
-
})(index !== -1)
|
|
1986
|
+
})(index !== -1);
|
|
2035
1987
|
relationship.localState.splice(index, 1);
|
|
2036
1988
|
}
|
|
2037
|
-
|
|
1989
|
+
(test => {
|
|
2038
1990
|
if (!test) {
|
|
2039
1991
|
throw new Error(`Expected relationship to be dirty when performing a local mutation`);
|
|
2040
1992
|
}
|
|
2041
|
-
})(relationship.localState || relationship.isDirty)
|
|
1993
|
+
})(relationship.localState || relationship.isDirty);
|
|
2042
1994
|
return true;
|
|
2043
1995
|
}
|
|
2044
1996
|
function _removeRemote(relationship, value) {
|
|
2045
|
-
|
|
1997
|
+
(test => {
|
|
2046
1998
|
if (!test) {
|
|
2047
1999
|
throw new Error(`expected an identifier to remove from the collection relationship`);
|
|
2048
2000
|
}
|
|
2049
|
-
})(value)
|
|
2001
|
+
})(value);
|
|
2050
2002
|
const {
|
|
2051
2003
|
remoteMembers,
|
|
2052
2004
|
additions,
|
|
2053
2005
|
removals,
|
|
2054
2006
|
remoteState
|
|
2055
2007
|
} = relationship;
|
|
2056
|
-
|
|
2008
|
+
(test => {
|
|
2057
2009
|
if (!test) {
|
|
2058
2010
|
throw new Error(`Cannot remove a resource that is not present`);
|
|
2059
2011
|
}
|
|
2060
|
-
})(remoteMembers.has(value))
|
|
2012
|
+
})(remoteMembers.has(value));
|
|
2061
2013
|
if (!remoteMembers.has(value)) {
|
|
2062
2014
|
return false;
|
|
2063
2015
|
}
|
|
@@ -2065,11 +2017,11 @@ function _removeRemote(relationship, value) {
|
|
|
2065
2017
|
// remove from remote state
|
|
2066
2018
|
remoteMembers.delete(value);
|
|
2067
2019
|
let index = remoteState.indexOf(value);
|
|
2068
|
-
|
|
2020
|
+
(test => {
|
|
2069
2021
|
if (!test) {
|
|
2070
2022
|
throw new Error(`Cannot remove a resource that is not present`);
|
|
2071
2023
|
}
|
|
2072
|
-
})(index !== -1)
|
|
2024
|
+
})(index !== -1);
|
|
2073
2025
|
remoteState.splice(index, 1);
|
|
2074
2026
|
|
|
2075
2027
|
// remove from removals if present
|
|
@@ -2079,11 +2031,11 @@ function _removeRemote(relationship, value) {
|
|
|
2079
2031
|
// nothing more to do this was our state already
|
|
2080
2032
|
return false;
|
|
2081
2033
|
}
|
|
2082
|
-
|
|
2034
|
+
(test => {
|
|
2083
2035
|
if (!test) {
|
|
2084
2036
|
throw new Error(`Remote state indicated removal of a resource that was present only as a local mutation`);
|
|
2085
2037
|
}
|
|
2086
|
-
})(!additions?.has(value))
|
|
2038
|
+
})(!additions?.has(value));
|
|
2087
2039
|
|
|
2088
2040
|
// if we have existing localState
|
|
2089
2041
|
// and we have an index
|
|
@@ -2094,18 +2046,18 @@ function _removeRemote(relationship, value) {
|
|
|
2094
2046
|
// be relied upon as any remote change will blow it away
|
|
2095
2047
|
if (relationship.localState) {
|
|
2096
2048
|
index = relationship.localState.indexOf(value);
|
|
2097
|
-
|
|
2049
|
+
(test => {
|
|
2098
2050
|
if (!test) {
|
|
2099
2051
|
throw new Error(`Cannot remove a resource that is not present`);
|
|
2100
2052
|
}
|
|
2101
|
-
})(index !== -1)
|
|
2053
|
+
})(index !== -1);
|
|
2102
2054
|
relationship.localState.splice(index, 1);
|
|
2103
2055
|
}
|
|
2104
|
-
|
|
2056
|
+
(test => {
|
|
2105
2057
|
if (!test) {
|
|
2106
2058
|
throw new Error(`Expected relationship to be dirty when performing a local mutation`);
|
|
2107
2059
|
}
|
|
2108
|
-
})(relationship.localState || relationship.isDirty)
|
|
2060
|
+
})(relationship.localState || relationship.isDirty);
|
|
2109
2061
|
return true;
|
|
2110
2062
|
}
|
|
2111
2063
|
function rollbackRelationship(graph, key, field, relationship) {
|
|
@@ -2275,18 +2227,18 @@ function addToRelatedRecords(graph, op, isRemote) {
|
|
|
2275
2227
|
};
|
|
2276
2228
|
return replaceRelatedRecord(graph, newOp, isRemote);
|
|
2277
2229
|
}
|
|
2278
|
-
|
|
2230
|
+
(test => {
|
|
2279
2231
|
if (!test) {
|
|
2280
2232
|
throw new Error(`Expected '${value?.lid}' (the value to add) to NOT be the same as the remote state '${relationship.remoteState?.lid ?? '<null>'}'`);
|
|
2281
2233
|
}
|
|
2282
|
-
})(value === relationship.remoteState)
|
|
2234
|
+
})(value === relationship.remoteState);
|
|
2283
2235
|
return;
|
|
2284
2236
|
}
|
|
2285
|
-
|
|
2237
|
+
(test => {
|
|
2286
2238
|
if (!test) {
|
|
2287
2239
|
throw new Error(`You can only '${op.op}' on a hasMany relationship. ${record.type}.${op.field} is a ${relationship.definition.kind}`);
|
|
2288
2240
|
}
|
|
2289
|
-
})(isHasMany(relationship))
|
|
2241
|
+
})(isHasMany(relationship));
|
|
2290
2242
|
|
|
2291
2243
|
// if we are not dirty but have a null localState then we
|
|
2292
2244
|
// are mutating a relationship that has never been fetched
|
|
@@ -2304,11 +2256,11 @@ function addToRelatedRecords(graph, op, isRemote) {
|
|
|
2304
2256
|
notifyChange(graph, relationship);
|
|
2305
2257
|
}
|
|
2306
2258
|
function addRelatedRecord(graph, relationship, record, value, index, isRemote) {
|
|
2307
|
-
|
|
2259
|
+
(test => {
|
|
2308
2260
|
if (!test) {
|
|
2309
2261
|
throw new Error(`expected an identifier to add to the collection relationship`);
|
|
2310
2262
|
}
|
|
2311
|
-
})(value)
|
|
2263
|
+
})(value);
|
|
2312
2264
|
if (_add(graph, record, relationship, value, index, isRemote)) {
|
|
2313
2265
|
addToInverse(graph, value, relationship.definition.inverseKey, record, isRemote);
|
|
2314
2266
|
}
|
|
@@ -2396,18 +2348,18 @@ function removeFromRelatedRecords(graph, op, isRemote) {
|
|
|
2396
2348
|
};
|
|
2397
2349
|
return replaceRelatedRecord(graph, newOp, isRemote);
|
|
2398
2350
|
}
|
|
2399
|
-
|
|
2351
|
+
(test => {
|
|
2400
2352
|
if (!test) {
|
|
2401
2353
|
throw new Error(`Expected '${value?.lid}' (the value to remove) to be the same as the remote state '${relationship.remoteState?.lid ?? '<null>'}'`);
|
|
2402
2354
|
}
|
|
2403
|
-
})(value === relationship.remoteState)
|
|
2355
|
+
})(value === relationship.remoteState);
|
|
2404
2356
|
return;
|
|
2405
2357
|
}
|
|
2406
|
-
|
|
2358
|
+
(test => {
|
|
2407
2359
|
if (!test) {
|
|
2408
2360
|
throw new Error(`You can only '${op.op}' on a hasMany relationship. ${record.type}.${op.field} is a ${relationship.definition.kind}`);
|
|
2409
2361
|
}
|
|
2410
|
-
})(isHasMany(relationship))
|
|
2362
|
+
})(isHasMany(relationship));
|
|
2411
2363
|
if (Array.isArray(value)) {
|
|
2412
2364
|
for (let i = 0; i < value.length; i++) {
|
|
2413
2365
|
removeRelatedRecord(graph, record, relationship, value[i], op.index ?? null, isRemote);
|
|
@@ -2418,11 +2370,11 @@ function removeFromRelatedRecords(graph, op, isRemote) {
|
|
|
2418
2370
|
notifyChange(graph, relationship);
|
|
2419
2371
|
}
|
|
2420
2372
|
function removeRelatedRecord(graph, record, relationship, value, index, isRemote) {
|
|
2421
|
-
|
|
2373
|
+
(test => {
|
|
2422
2374
|
if (!test) {
|
|
2423
2375
|
throw new Error(`expected an identifier to remove from the collection relationship`);
|
|
2424
2376
|
}
|
|
2425
|
-
})(value)
|
|
2377
|
+
})(value);
|
|
2426
2378
|
if (_remove(graph, record, relationship, value, index, isRemote)) {
|
|
2427
2379
|
removeFromInverse(graph, value, relationship.definition.inverseKey, record, isRemote);
|
|
2428
2380
|
}
|
|
@@ -2451,11 +2403,11 @@ function _normalizeLink(link) {
|
|
|
2451
2403
|
*/
|
|
2452
2404
|
function updateRelationshipOperation(graph, op) {
|
|
2453
2405
|
const relationship = graph.get(op.record, op.field);
|
|
2454
|
-
|
|
2406
|
+
(test => {
|
|
2455
2407
|
if (!test) {
|
|
2456
2408
|
throw new Error(`Cannot update an implicit relationship`);
|
|
2457
2409
|
}
|
|
2458
|
-
})(isHasMany(relationship) || isBelongsTo(relationship))
|
|
2410
|
+
})(isHasMany(relationship) || isBelongsTo(relationship));
|
|
2459
2411
|
const {
|
|
2460
2412
|
definition,
|
|
2461
2413
|
state,
|
|
@@ -2478,11 +2430,11 @@ function updateRelationshipOperation(graph, op) {
|
|
|
2478
2430
|
if (payload.data === null) {
|
|
2479
2431
|
payload.data = [];
|
|
2480
2432
|
}
|
|
2481
|
-
|
|
2433
|
+
(test => {
|
|
2482
2434
|
if (!test) {
|
|
2483
2435
|
throw new Error(`Expected an array`);
|
|
2484
2436
|
}
|
|
2485
|
-
})(Array.isArray(payload.data))
|
|
2437
|
+
})(Array.isArray(payload.data));
|
|
2486
2438
|
const cache = graph.store.cacheKeyManager;
|
|
2487
2439
|
graph.update({
|
|
2488
2440
|
op: 'replaceRelatedRecords',
|
|
@@ -2524,14 +2476,14 @@ function updateRelationshipOperation(graph, op) {
|
|
|
2524
2476
|
const currentLink = originalLinks && originalLinks.related ? _normalizeLink(originalLinks.related) : null;
|
|
2525
2477
|
const currentLinkHref = currentLink ? currentLink.href : null;
|
|
2526
2478
|
if (relatedLink && relatedLink.href && relatedLink.href !== currentLinkHref) {
|
|
2527
|
-
warn(`You pushed a record of type '${identifier.type}' with a relationship '${definition.key}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. WarpDrive will treat this relationship as known-to-be-empty.`, definition.isAsync || state.hasReceivedData, {
|
|
2479
|
+
console.warn(`You pushed a record of type '${identifier.type}' with a relationship '${definition.key}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. WarpDrive will treat this relationship as known-to-be-empty.`, definition.isAsync || state.hasReceivedData, {
|
|
2528
2480
|
id: 'ds.store.push-link-for-sync-relationship'
|
|
2529
2481
|
});
|
|
2530
|
-
|
|
2482
|
+
(test => {
|
|
2531
2483
|
if (!test) {
|
|
2532
2484
|
throw new Error(`You have pushed a record of type '${identifier.type}' with '${definition.key}' as a link, but the value of that link is not a string.`);
|
|
2533
2485
|
}
|
|
2534
|
-
})(typeof relatedLink.href === 'string' || relatedLink.href === null)
|
|
2486
|
+
})(typeof relatedLink.href === 'string' || relatedLink.href === null);
|
|
2535
2487
|
hasUpdatedLink = true;
|
|
2536
2488
|
}
|
|
2537
2489
|
}
|
|
@@ -2643,11 +2595,11 @@ class Graph {
|
|
|
2643
2595
|
let meta = defs?.[propertyName];
|
|
2644
2596
|
if (!meta) {
|
|
2645
2597
|
const info = /*#__NOINLINE__*/upgradeDefinition(this, resourceKey, propertyName);
|
|
2646
|
-
|
|
2598
|
+
(test => {
|
|
2647
2599
|
if (!test) {
|
|
2648
2600
|
throw new Error(`Could not determine relationship information for ${resourceKey.type}.${propertyName}`);
|
|
2649
2601
|
}
|
|
2650
|
-
})(info !== null)
|
|
2602
|
+
})(info !== null);
|
|
2651
2603
|
|
|
2652
2604
|
// if (info.rhs_definition?.kind === 'implicit') {
|
|
2653
2605
|
// we should possibly also do this
|
|
@@ -2662,11 +2614,11 @@ class Graph {
|
|
|
2662
2614
|
return meta;
|
|
2663
2615
|
}
|
|
2664
2616
|
get(resourceKey, propertyName) {
|
|
2665
|
-
|
|
2617
|
+
(test => {
|
|
2666
2618
|
if (!test) {
|
|
2667
2619
|
throw new Error(`expected propertyName`);
|
|
2668
2620
|
}
|
|
2669
|
-
})(propertyName)
|
|
2621
|
+
})(propertyName);
|
|
2670
2622
|
let relationships = this.identifiers.get(resourceKey);
|
|
2671
2623
|
if (!relationships) {
|
|
2672
2624
|
relationships = Object.create(null);
|
|
@@ -2680,11 +2632,11 @@ class Graph {
|
|
|
2680
2632
|
} else if (meta.kind === 'hasMany') {
|
|
2681
2633
|
relationship = relationships[propertyName] = createCollectionEdge(meta, resourceKey);
|
|
2682
2634
|
} else {
|
|
2683
|
-
|
|
2635
|
+
(test => {
|
|
2684
2636
|
if (!test) {
|
|
2685
2637
|
throw new Error(`Expected kind to be implicit`);
|
|
2686
2638
|
}
|
|
2687
|
-
})(meta.kind === 'implicit' && meta.isImplicit === true)
|
|
2639
|
+
})(meta.kind === 'implicit' && meta.isImplicit === true);
|
|
2688
2640
|
relationship = relationships[propertyName] = createImplicitEdge(meta, resourceKey);
|
|
2689
2641
|
}
|
|
2690
2642
|
}
|
|
@@ -2692,11 +2644,11 @@ class Graph {
|
|
|
2692
2644
|
}
|
|
2693
2645
|
getData(resourceKey, propertyName) {
|
|
2694
2646
|
const relationship = this.get(resourceKey, propertyName);
|
|
2695
|
-
|
|
2647
|
+
(test => {
|
|
2696
2648
|
if (!test) {
|
|
2697
2649
|
throw new Error(`Cannot getData() on an implicit relationship`);
|
|
2698
2650
|
}
|
|
2699
|
-
})(!isImplicit(relationship))
|
|
2651
|
+
})(!isImplicit(relationship));
|
|
2700
2652
|
if (isBelongsTo(relationship)) {
|
|
2701
2653
|
return legacyGetResourceRelationshipData(relationship, false);
|
|
2702
2654
|
}
|
|
@@ -2704,11 +2656,11 @@ class Graph {
|
|
|
2704
2656
|
}
|
|
2705
2657
|
getRemoteData(resourceKey, propertyName) {
|
|
2706
2658
|
const relationship = this.get(resourceKey, propertyName);
|
|
2707
|
-
|
|
2659
|
+
(test => {
|
|
2708
2660
|
if (!test) {
|
|
2709
2661
|
throw new Error(`Cannot getRemoteData() on an implicit relationship`);
|
|
2710
2662
|
}
|
|
2711
|
-
})(!isImplicit(relationship))
|
|
2663
|
+
})(!isImplicit(relationship));
|
|
2712
2664
|
if (isBelongsTo(relationship)) {
|
|
2713
2665
|
return legacyGetResourceRelationshipData(relationship, true);
|
|
2714
2666
|
}
|
|
@@ -2742,7 +2694,7 @@ class Graph {
|
|
|
2742
2694
|
isReleasable(resourceKey) {
|
|
2743
2695
|
const relationships = this.identifiers.get(resourceKey);
|
|
2744
2696
|
if (!relationships) {
|
|
2745
|
-
|
|
2697
|
+
{
|
|
2746
2698
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2747
2699
|
// eslint-disable-next-line no-console
|
|
2748
2700
|
console.log(`graph: RELEASABLE ${String(resourceKey)}`);
|
|
@@ -2758,13 +2710,13 @@ class Graph {
|
|
|
2758
2710
|
if (relationship === undefined) {
|
|
2759
2711
|
continue;
|
|
2760
2712
|
}
|
|
2761
|
-
|
|
2713
|
+
(test => {
|
|
2762
2714
|
if (!test) {
|
|
2763
2715
|
throw new Error(`Expected a relationship`);
|
|
2764
2716
|
}
|
|
2765
|
-
})(relationship)
|
|
2717
|
+
})(relationship);
|
|
2766
2718
|
if (relationship.definition.inverseIsAsync && !checkIfNew(this._realStore, resourceKey)) {
|
|
2767
|
-
|
|
2719
|
+
{
|
|
2768
2720
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2769
2721
|
// eslint-disable-next-line no-console
|
|
2770
2722
|
console.log(`graph: <<NOT>> RELEASABLE ${String(resourceKey)}`);
|
|
@@ -2773,7 +2725,7 @@ class Graph {
|
|
|
2773
2725
|
return false;
|
|
2774
2726
|
}
|
|
2775
2727
|
}
|
|
2776
|
-
|
|
2728
|
+
{
|
|
2777
2729
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2778
2730
|
// eslint-disable-next-line no-console
|
|
2779
2731
|
console.log(`graph: RELEASABLE ${String(resourceKey)}`);
|
|
@@ -2782,7 +2734,7 @@ class Graph {
|
|
|
2782
2734
|
return true;
|
|
2783
2735
|
}
|
|
2784
2736
|
unload(resourceKey, silenceNotifications) {
|
|
2785
|
-
|
|
2737
|
+
{
|
|
2786
2738
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2787
2739
|
// eslint-disable-next-line no-console
|
|
2788
2740
|
console.log(`graph: unload ${String(resourceKey)}`);
|
|
@@ -2897,17 +2849,17 @@ class Graph {
|
|
|
2897
2849
|
return changed;
|
|
2898
2850
|
}
|
|
2899
2851
|
remove(resourceKey) {
|
|
2900
|
-
|
|
2852
|
+
{
|
|
2901
2853
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2902
2854
|
// eslint-disable-next-line no-console
|
|
2903
2855
|
console.log(`graph: remove ${String(resourceKey)}`);
|
|
2904
2856
|
}
|
|
2905
2857
|
}
|
|
2906
|
-
|
|
2858
|
+
(test => {
|
|
2907
2859
|
if (!test) {
|
|
2908
2860
|
throw new Error(`Cannot remove ${String(resourceKey)} while still removing ${String(this._removing)}`);
|
|
2909
2861
|
}
|
|
2910
|
-
})(!this._removing)
|
|
2862
|
+
})(!this._removing);
|
|
2911
2863
|
this._removing = resourceKey;
|
|
2912
2864
|
this.unload(resourceKey);
|
|
2913
2865
|
this.identifiers.delete(resourceKey);
|
|
@@ -2918,7 +2870,7 @@ class Graph {
|
|
|
2918
2870
|
* Remote state changes
|
|
2919
2871
|
*/
|
|
2920
2872
|
push(op) {
|
|
2921
|
-
|
|
2873
|
+
{
|
|
2922
2874
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2923
2875
|
// eslint-disable-next-line no-console
|
|
2924
2876
|
console.log(`graph: push ${String(op.record)}`, op);
|
|
@@ -2928,11 +2880,11 @@ class Graph {
|
|
|
2928
2880
|
this._pushedUpdates.deletions.push(op);
|
|
2929
2881
|
} else {
|
|
2930
2882
|
const definition = this.getDefinition(op.record, op.field);
|
|
2931
|
-
|
|
2883
|
+
(test => {
|
|
2932
2884
|
if (!test) {
|
|
2933
2885
|
throw new Error(`Cannot push a remote update for an implicit relationship`);
|
|
2934
2886
|
}
|
|
2935
|
-
})(definition.kind !== 'implicit')
|
|
2887
|
+
})(definition.kind !== 'implicit');
|
|
2936
2888
|
addPending(this._pushedUpdates, definition, op);
|
|
2937
2889
|
}
|
|
2938
2890
|
if (!this._willSyncRemote) {
|
|
@@ -2951,12 +2903,12 @@ class Graph {
|
|
|
2951
2903
|
*/
|
|
2952
2904
|
|
|
2953
2905
|
update(op, isRemote = false) {
|
|
2954
|
-
|
|
2906
|
+
(test => {
|
|
2955
2907
|
if (!test) {
|
|
2956
2908
|
throw new Error(`Cannot update an implicit relationship`);
|
|
2957
2909
|
}
|
|
2958
|
-
})(op.op === 'deleteRecord' || op.op === 'mergeIdentifiers' || !isImplicit(this.get(op.record, op.field)))
|
|
2959
|
-
|
|
2910
|
+
})(op.op === 'deleteRecord' || op.op === 'mergeIdentifiers' || !isImplicit(this.get(op.record, op.field)));
|
|
2911
|
+
{
|
|
2960
2912
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
2961
2913
|
// eslint-disable-next-line no-console
|
|
2962
2914
|
console.log(`graph: update (${isRemote ? 'remote' : 'local'}) ${String(op.record)}`, op);
|
|
@@ -2973,12 +2925,12 @@ class Graph {
|
|
|
2973
2925
|
}
|
|
2974
2926
|
case 'update':
|
|
2975
2927
|
case 'updateRelationship':
|
|
2976
|
-
|
|
2928
|
+
(test => {
|
|
2977
2929
|
if (!test) {
|
|
2978
2930
|
throw new Error(`Can only perform the operation updateRelationship on remote state`);
|
|
2979
2931
|
}
|
|
2980
|
-
})(isRemote)
|
|
2981
|
-
|
|
2932
|
+
})(isRemote);
|
|
2933
|
+
{
|
|
2982
2934
|
// in debug, assert payload validity eagerly
|
|
2983
2935
|
// TODO add deprecations/assertion here for duplicates
|
|
2984
2936
|
assertValidRelationshipPayload(this, op);
|
|
@@ -2988,11 +2940,11 @@ class Graph {
|
|
|
2988
2940
|
break;
|
|
2989
2941
|
case 'deleteRecord':
|
|
2990
2942
|
{
|
|
2991
|
-
|
|
2943
|
+
(test => {
|
|
2992
2944
|
if (!test) {
|
|
2993
2945
|
throw new Error(`Can only perform the operation deleteRelationship on remote state`);
|
|
2994
2946
|
}
|
|
2995
|
-
})(isRemote)
|
|
2947
|
+
})(isRemote);
|
|
2996
2948
|
const identifier = op.record;
|
|
2997
2949
|
const relationships = this.identifiers.get(identifier);
|
|
2998
2950
|
if (relationships) {
|
|
@@ -3024,11 +2976,11 @@ class Graph {
|
|
|
3024
2976
|
/*#__NOINLINE__*/replaceRelatedRecords(this, op, isRemote);
|
|
3025
2977
|
break;
|
|
3026
2978
|
default:
|
|
3027
|
-
|
|
2979
|
+
(test => {
|
|
3028
2980
|
{
|
|
3029
2981
|
throw new Error(`No local relationship update operation exists for '${op.op}'`);
|
|
3030
2982
|
}
|
|
3031
|
-
})()
|
|
2983
|
+
})();
|
|
3032
2984
|
}
|
|
3033
2985
|
}
|
|
3034
2986
|
_scheduleLocalSync(relationship) {
|
|
@@ -3042,7 +2994,7 @@ class Graph {
|
|
|
3042
2994
|
if (!this._willSyncRemote) {
|
|
3043
2995
|
return;
|
|
3044
2996
|
}
|
|
3045
|
-
|
|
2997
|
+
{
|
|
3046
2998
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
3047
2999
|
// eslint-disable-next-line no-console
|
|
3048
3000
|
console.groupCollapsed(`Graph: Initialized Transaction`);
|
|
@@ -3071,7 +3023,7 @@ class Graph {
|
|
|
3071
3023
|
flushPending(this, belongsTo);
|
|
3072
3024
|
}
|
|
3073
3025
|
this._transaction = null;
|
|
3074
|
-
|
|
3026
|
+
{
|
|
3075
3027
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
3076
3028
|
// eslint-disable-next-line no-console
|
|
3077
3029
|
console.log(`Graph: transaction finalized`);
|
|
@@ -3081,12 +3033,12 @@ class Graph {
|
|
|
3081
3033
|
}
|
|
3082
3034
|
}
|
|
3083
3035
|
_addToTransaction(relationship) {
|
|
3084
|
-
|
|
3036
|
+
(test => {
|
|
3085
3037
|
if (!test) {
|
|
3086
3038
|
throw new Error(`expected a transaction`);
|
|
3087
3039
|
}
|
|
3088
|
-
})(this._transaction !== null)
|
|
3089
|
-
|
|
3040
|
+
})(this._transaction !== null);
|
|
3041
|
+
{
|
|
3090
3042
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) {
|
|
3091
3043
|
// eslint-disable-next-line no-console
|
|
3092
3044
|
console.log(`Graph: ${String(relationship.identifier)} ${relationship.definition.key} added to transaction`);
|
|
@@ -3110,15 +3062,15 @@ class Graph {
|
|
|
3110
3062
|
}
|
|
3111
3063
|
destroy() {
|
|
3112
3064
|
Graphs.delete(this.store);
|
|
3113
|
-
|
|
3065
|
+
{
|
|
3114
3066
|
Graphs.delete(getStore(this.store));
|
|
3115
3067
|
if (Graphs.size) {
|
|
3116
3068
|
Graphs.forEach((_, key) => {
|
|
3117
|
-
|
|
3069
|
+
(test => {
|
|
3118
3070
|
if (!test) {
|
|
3119
3071
|
throw new Error(`Memory Leak Detected, likely the test or app instance previous to this was not torn down properly`);
|
|
3120
3072
|
}
|
|
3121
|
-
})(!key.isDestroyed && !key.isDestroying)
|
|
3073
|
+
})(!key.isDestroyed && !key.isDestroying);
|
|
3122
3074
|
});
|
|
3123
3075
|
}
|
|
3124
3076
|
}
|
|
@@ -3187,11 +3139,11 @@ function notifyInverseOfDematerialization(graph, inverseIdentifier, inverseKey,
|
|
|
3187
3139
|
return;
|
|
3188
3140
|
}
|
|
3189
3141
|
const relationship = graph.get(inverseIdentifier, inverseKey);
|
|
3190
|
-
|
|
3142
|
+
(test => {
|
|
3191
3143
|
if (!test) {
|
|
3192
3144
|
throw new Error(`expected no implicit`);
|
|
3193
3145
|
}
|
|
3194
|
-
})(!isImplicit(relationship))
|
|
3146
|
+
})(!isImplicit(relationship));
|
|
3195
3147
|
|
|
3196
3148
|
// For remote members, it is possible that inverseRecordData has already been associated to
|
|
3197
3149
|
// to another record. For such cases, do not dematerialize the inverseRecordData
|
|
@@ -3363,7 +3315,7 @@ function graphFor(store) {
|
|
|
3363
3315
|
graph = new Graph(wrapper);
|
|
3364
3316
|
Graphs.set(wrapper, graph);
|
|
3365
3317
|
getStore(wrapper)._graph = graph;
|
|
3366
|
-
|
|
3318
|
+
{
|
|
3367
3319
|
if (getStore(wrapper).isDestroying) {
|
|
3368
3320
|
throw new Error(`Memory Leak Detected During Teardown`);
|
|
3369
3321
|
}
|