@warp-drive/legacy 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/dist/unpkg/{prod-deprecated/-private-B1pSSN52.js → dev/-private-DbaSCSym.js} +65 -70
- package/dist/unpkg/dev/adapter/-private.js +1 -1
- package/dist/unpkg/dev/adapter/error.js +2 -3
- package/dist/unpkg/dev/adapter/json-api.js +144 -5
- package/dist/unpkg/dev/adapter/rest.js +15 -17
- package/dist/unpkg/dev/adapter.js +9 -10
- package/dist/unpkg/dev/compat/-private.js +1 -1
- package/dist/unpkg/dev/compat/builders.js +30 -28
- package/dist/unpkg/dev/compat/extensions.js +4 -5
- package/dist/unpkg/dev/compat/utils.js +2 -3
- package/dist/unpkg/dev/compat.js +226 -100
- package/dist/unpkg/{dev-deprecated/errors-CIGPcDvd.js → dev/errors-DD96TBEs.js} +78 -82
- package/dist/unpkg/{dev-deprecated/hooks-QqRnX108.js → dev/hooks-CqWjNWeL.js} +14 -15
- package/dist/unpkg/dev/index.js +23 -21
- package/dist/unpkg/dev/{json-BNrV8EYG.js → json-CCU-ZQ4b.js} +6 -9
- package/dist/unpkg/dev/model/-private.js +1 -1
- package/dist/unpkg/dev/model/migration-support.js +6 -34
- package/dist/unpkg/dev/model.js +57 -46
- package/dist/unpkg/{dev-deprecated/schema-provider-g5MfTj8n.js → dev/schema-provider-B8jiJOYC.js} +113 -222
- package/dist/unpkg/{prod/serialize-into-hash-BnYvPex3.js → dev/serialize-into-hash-CPAZXrQU.js} +16 -18
- package/dist/unpkg/dev/serializer/json-api.js +140 -19
- package/dist/unpkg/dev/serializer/json.js +1 -3
- package/dist/unpkg/dev/serializer/rest.js +12 -13
- package/dist/unpkg/dev/store.js +55 -55
- package/dist/unpkg/dev/util-DvanW33H.js +20 -0
- package/dist/unpkg/dev/utils-BhvS1iTS.js +8 -0
- package/dist/unpkg/dev-deprecated/{-private-B1pSSN52.js → -private-DbaSCSym.js} +65 -70
- package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/adapter/error.js +2 -3
- package/dist/unpkg/dev-deprecated/adapter/json-api.js +144 -5
- package/dist/unpkg/dev-deprecated/adapter/rest.js +15 -17
- package/dist/unpkg/dev-deprecated/adapter.js +9 -10
- package/dist/unpkg/dev-deprecated/compat/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/compat/builders.js +30 -28
- package/dist/unpkg/dev-deprecated/compat/extensions.js +4 -5
- package/dist/unpkg/dev-deprecated/compat/utils.js +2 -3
- package/dist/unpkg/dev-deprecated/compat.js +226 -100
- package/dist/unpkg/{dev/errors-CIGPcDvd.js → dev-deprecated/errors-DEnabIZj.js} +78 -79
- package/dist/unpkg/{prod-deprecated/hooks-QqRnX108.js → dev-deprecated/hooks-CAll-Ets.js} +14 -15
- package/dist/unpkg/dev-deprecated/index.js +22 -21
- package/dist/unpkg/{prod-deprecated/json-BNrV8EYG.js → dev-deprecated/json-CCU-ZQ4b.js} +6 -9
- package/dist/unpkg/dev-deprecated/model/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/model/migration-support.js +7 -18
- package/dist/unpkg/dev-deprecated/model.js +58 -43
- package/dist/unpkg/{prod-deprecated/schema-provider-g5MfTj8n.js → dev-deprecated/schema-provider-k2qXQTBg.js} +114 -198
- package/dist/unpkg/{prod-deprecated/serialize-into-hash-BnYvPex3.js → dev-deprecated/serialize-into-hash-CPAZXrQU.js} +16 -18
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +140 -19
- package/dist/unpkg/dev-deprecated/serializer/json.js +1 -3
- package/dist/unpkg/dev-deprecated/serializer/rest.js +12 -13
- package/dist/unpkg/dev-deprecated/store.js +55 -55
- package/dist/unpkg/{prod-deprecated/util-Dul6TZts.js → dev-deprecated/util-CWr5WQOT.js} +2 -13
- package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +12 -0
- package/dist/unpkg/prod/{-private-B1pSSN52.js → -private-Cvf_97EG.js} +6 -246
- package/dist/unpkg/prod/adapter/-private.js +1 -1
- package/dist/unpkg/prod/adapter/error.js +0 -6
- package/dist/unpkg/prod/adapter/json-api.js +142 -8
- package/dist/unpkg/prod/adapter/rest.js +1 -40
- package/dist/unpkg/prod/adapter.js +7 -41
- package/dist/unpkg/prod/compat/-private.js +1 -1
- package/dist/unpkg/prod/compat/builders.js +4 -67
- package/dist/unpkg/prod/compat/extensions.js +0 -11
- package/dist/unpkg/prod/compat/utils.js +0 -6
- package/dist/unpkg/prod/compat.js +13 -307
- package/dist/unpkg/prod/{errors-CIGPcDvd.js → errors-CXnfnBfQ.js} +4 -256
- package/dist/unpkg/prod/hooks-DvyWhLNg.js +41 -0
- package/dist/unpkg/prod/index.js +9 -53
- package/dist/unpkg/prod/{json-BNrV8EYG.js → json-BYrUP8ao.js} +0 -16
- package/dist/unpkg/prod/model/-private.js +1 -1
- package/dist/unpkg/prod/model/migration-support.js +3 -38
- package/dist/unpkg/prod/model.js +31 -105
- package/dist/unpkg/{dev/schema-provider-g5MfTj8n.js → prod/schema-provider-CHujJvA9.js} +20 -454
- package/dist/unpkg/{dev-deprecated/serialize-into-hash-BnYvPex3.js → prod/serialize-into-hash-DYU2egXl.js} +1 -47
- package/dist/unpkg/prod/serializer/json-api.js +124 -60
- package/dist/unpkg/prod/serializer/json.js +1 -3
- package/dist/unpkg/prod/serializer/rest.js +2 -35
- package/dist/unpkg/prod/store.js +4 -136
- package/dist/unpkg/prod/util-DvanW33H.js +20 -0
- package/dist/unpkg/prod/utils-BhvS1iTS.js +8 -0
- package/dist/unpkg/{dev/-private-B1pSSN52.js → prod-deprecated/-private-Cvf_97EG.js} +6 -246
- package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/adapter/error.js +0 -6
- package/dist/unpkg/prod-deprecated/adapter/json-api.js +142 -8
- package/dist/unpkg/prod-deprecated/adapter/rest.js +1 -40
- package/dist/unpkg/prod-deprecated/adapter.js +7 -41
- package/dist/unpkg/prod-deprecated/compat/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/compat/builders.js +4 -67
- package/dist/unpkg/prod-deprecated/compat/extensions.js +0 -11
- package/dist/unpkg/prod-deprecated/compat/utils.js +0 -6
- package/dist/unpkg/prod-deprecated/compat.js +13 -307
- package/dist/unpkg/prod-deprecated/{errors-CIGPcDvd.js → errors-CG1SPYVg.js} +4 -253
- package/dist/unpkg/prod-deprecated/hooks-BIUBiNGR.js +41 -0
- package/dist/unpkg/prod-deprecated/index.js +8 -53
- package/dist/unpkg/{dev-deprecated/json-BNrV8EYG.js → prod-deprecated/json-BYrUP8ao.js} +0 -16
- package/dist/unpkg/prod-deprecated/model/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/model/migration-support.js +4 -22
- package/dist/unpkg/prod-deprecated/model.js +31 -102
- package/dist/unpkg/{prod/schema-provider-g5MfTj8n.js → prod-deprecated/schema-provider-BJ4TWnZf.js} +21 -412
- package/dist/unpkg/{dev/serialize-into-hash-BnYvPex3.js → prod-deprecated/serialize-into-hash-DYU2egXl.js} +1 -47
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +124 -60
- package/dist/unpkg/prod-deprecated/serializer/json.js +1 -3
- package/dist/unpkg/prod-deprecated/serializer/rest.js +2 -35
- package/dist/unpkg/prod-deprecated/store.js +4 -136
- package/dist/unpkg/{dev/util-Dul6TZts.js → prod-deprecated/util-B6cn-i93.js} +1 -13
- package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +11 -0
- package/package.json +14 -22
- package/dist/unpkg/dev/declarations/adapter/-private/build-url-mixin.d.ts +0 -33
- package/dist/unpkg/dev/declarations/adapter/-private/fastboot-interface.d.ts +0 -8
- package/dist/unpkg/dev/declarations/adapter/-private/utils/continue-on-reject.d.ts +0 -1
- package/dist/unpkg/dev/declarations/adapter/-private/utils/determine-body-promise.d.ts +0 -4
- package/dist/unpkg/dev/declarations/adapter/-private/utils/fetch.d.ts +0 -8
- package/dist/unpkg/dev/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
- package/dist/unpkg/dev/declarations/adapter/-private/utils/serialize-into-hash.d.ts +0 -6
- package/dist/unpkg/dev/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -5
- package/dist/unpkg/dev/declarations/adapter/-private.d.ts +0 -5
- package/dist/unpkg/dev/declarations/adapter/error.d.ts +0 -215
- package/dist/unpkg/dev/declarations/adapter/json-api.d.ts +0 -231
- package/dist/unpkg/dev/declarations/adapter/rest.d.ts +0 -815
- package/dist/unpkg/dev/declarations/adapter.d.ts +0 -770
- package/dist/unpkg/dev/declarations/compat/-private.d.ts +0 -13
- package/dist/unpkg/dev/declarations/compat/builders/find-all.d.ts +0 -35
- package/dist/unpkg/dev/declarations/compat/builders/find-record.d.ts +0 -56
- package/dist/unpkg/dev/declarations/compat/builders/query.d.ts +0 -66
- package/dist/unpkg/dev/declarations/compat/builders/save-record.d.ts +0 -34
- package/dist/unpkg/dev/declarations/compat/builders/utils.d.ts +0 -3
- package/dist/unpkg/dev/declarations/compat/builders.d.ts +0 -14
- package/dist/unpkg/dev/declarations/compat/extensions.d.ts +0 -59
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/fetch-manager.d.ts +0 -55
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +0 -2
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +0 -11
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +0 -5
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +0 -2
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -524
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -213
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/serializer-response.d.ts +0 -6
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +0 -110
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/snapshot.d.ts +0 -255
- package/dist/unpkg/dev/declarations/compat/utils.d.ts +0 -137
- package/dist/unpkg/dev/declarations/compat.d.ts +0 -157
- package/dist/unpkg/dev/declarations/index.d.ts +0 -70
- package/dist/unpkg/dev/declarations/model/-private/attr.d.ts +0 -170
- package/dist/unpkg/dev/declarations/model/-private/belongs-to.d.ts +0 -174
- package/dist/unpkg/dev/declarations/model/-private/debug/assert-polymorphic-type.d.ts +0 -5
- package/dist/unpkg/dev/declarations/model/-private/errors.d.ts +0 -289
- package/dist/unpkg/dev/declarations/model/-private/has-many.d.ts +0 -162
- package/dist/unpkg/dev/declarations/model/-private/hooks.d.ts +0 -10
- package/dist/unpkg/dev/declarations/model/-private/legacy-relationships-support.d.ts +0 -47
- package/dist/unpkg/dev/declarations/model/-private/model-for-mixin.d.ts +0 -3
- package/dist/unpkg/dev/declarations/model/-private/model-methods.d.ts +0 -39
- package/dist/unpkg/dev/declarations/model/-private/model.d.ts +0 -1269
- package/dist/unpkg/dev/declarations/model/-private/notify-changes.d.ts +0 -4
- package/dist/unpkg/dev/declarations/model/-private/promise-belongs-to.d.ts +0 -40
- package/dist/unpkg/dev/declarations/model/-private/promise-many-array.d.ts +0 -124
- package/dist/unpkg/dev/declarations/model/-private/record-state.d.ts +0 -58
- package/dist/unpkg/dev/declarations/model/-private/references/belongs-to.d.ts +0 -498
- package/dist/unpkg/dev/declarations/model/-private/references/has-many.d.ts +0 -500
- package/dist/unpkg/dev/declarations/model/-private/schema-provider.d.ts +0 -56
- package/dist/unpkg/dev/declarations/model/-private/type-utils.d.ts +0 -57
- package/dist/unpkg/dev/declarations/model/-private/util.d.ts +0 -5
- package/dist/unpkg/dev/declarations/model/-private.d.ts +0 -8
- package/dist/unpkg/dev/declarations/model/migration-support.d.ts +0 -280
- package/dist/unpkg/dev/declarations/model-fragments/extensions/fragment-array.d.ts +0 -16
- package/dist/unpkg/dev/declarations/model-fragments/extensions/fragment.d.ts +0 -15
- package/dist/unpkg/dev/declarations/model-fragments/hooks/model-for.d.ts +0 -20
- package/dist/unpkg/dev/declarations/model-fragments/index.d.ts +0 -5
- package/dist/unpkg/dev/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -9
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -15
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -20
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -19
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-legacy.d.ts +0 -3
- package/dist/unpkg/dev/declarations/model-fragments.d.ts +0 -9
- package/dist/unpkg/dev/declarations/model.d.ts +0 -49
- package/dist/unpkg/dev/declarations/serializer/-private/embedded-records-mixin.d.ts +0 -91
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/boolean.d.ts +0 -47
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/date.d.ts +0 -28
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/number.d.ts +0 -29
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/string.d.ts +0 -29
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/transform.d.ts +0 -118
- package/dist/unpkg/dev/declarations/serializer/-private/utils.d.ts +0 -3
- package/dist/unpkg/dev/declarations/serializer/json-api.d.ts +0 -123
- package/dist/unpkg/dev/declarations/serializer/json.d.ts +0 -75
- package/dist/unpkg/dev/declarations/serializer/rest.d.ts +0 -51
- package/dist/unpkg/dev/declarations/serializer/transform.d.ts +0 -5
- package/dist/unpkg/dev/declarations/serializer.d.ts +0 -254
- package/dist/unpkg/dev/declarations/store/-private.d.ts +0 -223
- package/dist/unpkg/dev/declarations/store.d.ts +0 -3
- package/dist/unpkg/dev/hooks-QqRnX108.js +0 -74
- package/dist/unpkg/dev/utils-Cqw9eRj5.js +0 -23
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/build-url-mixin.d.ts +0 -33
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/fastboot-interface.d.ts +0 -8
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/continue-on-reject.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/determine-body-promise.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/fetch.d.ts +0 -8
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts +0 -6
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/adapter/error.d.ts +0 -215
- package/dist/unpkg/dev-deprecated/declarations/adapter/json-api.d.ts +0 -231
- package/dist/unpkg/dev-deprecated/declarations/adapter/rest.d.ts +0 -815
- package/dist/unpkg/dev-deprecated/declarations/adapter.d.ts +0 -770
- package/dist/unpkg/dev-deprecated/declarations/compat/-private.d.ts +0 -13
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/find-all.d.ts +0 -35
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/find-record.d.ts +0 -56
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/query.d.ts +0 -66
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/save-record.d.ts +0 -34
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/utils.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/compat/builders.d.ts +0 -14
- package/dist/unpkg/dev-deprecated/declarations/compat/extensions.d.ts +0 -59
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/fetch-manager.d.ts +0 -55
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +0 -2
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +0 -11
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +0 -2
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -524
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -213
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/serializer-response.d.ts +0 -6
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +0 -110
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/snapshot.d.ts +0 -255
- package/dist/unpkg/dev-deprecated/declarations/compat/utils.d.ts +0 -137
- package/dist/unpkg/dev-deprecated/declarations/compat.d.ts +0 -157
- package/dist/unpkg/dev-deprecated/declarations/index.d.ts +0 -70
- package/dist/unpkg/dev-deprecated/declarations/model/-private/attr.d.ts +0 -170
- package/dist/unpkg/dev-deprecated/declarations/model/-private/belongs-to.d.ts +0 -174
- package/dist/unpkg/dev-deprecated/declarations/model/-private/debug/assert-polymorphic-type.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/model/-private/errors.d.ts +0 -289
- package/dist/unpkg/dev-deprecated/declarations/model/-private/has-many.d.ts +0 -162
- package/dist/unpkg/dev-deprecated/declarations/model/-private/hooks.d.ts +0 -10
- package/dist/unpkg/dev-deprecated/declarations/model/-private/legacy-relationships-support.d.ts +0 -47
- package/dist/unpkg/dev-deprecated/declarations/model/-private/model-for-mixin.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/model/-private/model-methods.d.ts +0 -39
- package/dist/unpkg/dev-deprecated/declarations/model/-private/model.d.ts +0 -1269
- package/dist/unpkg/dev-deprecated/declarations/model/-private/notify-changes.d.ts +0 -4
- package/dist/unpkg/dev-deprecated/declarations/model/-private/promise-belongs-to.d.ts +0 -40
- package/dist/unpkg/dev-deprecated/declarations/model/-private/promise-many-array.d.ts +0 -124
- package/dist/unpkg/dev-deprecated/declarations/model/-private/record-state.d.ts +0 -58
- package/dist/unpkg/dev-deprecated/declarations/model/-private/references/belongs-to.d.ts +0 -498
- package/dist/unpkg/dev-deprecated/declarations/model/-private/references/has-many.d.ts +0 -500
- package/dist/unpkg/dev-deprecated/declarations/model/-private/schema-provider.d.ts +0 -56
- package/dist/unpkg/dev-deprecated/declarations/model/-private/type-utils.d.ts +0 -57
- package/dist/unpkg/dev-deprecated/declarations/model/-private/util.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/model/-private.d.ts +0 -8
- package/dist/unpkg/dev-deprecated/declarations/model/migration-support.d.ts +0 -280
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/extensions/fragment-array.d.ts +0 -16
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/extensions/fragment.d.ts +0 -15
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/hooks/model-for.d.ts +0 -20
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/index.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -9
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -15
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -20
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -19
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-legacy.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/model-fragments.d.ts +0 -9
- package/dist/unpkg/dev-deprecated/declarations/model.d.ts +0 -49
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/embedded-records-mixin.d.ts +0 -91
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/boolean.d.ts +0 -47
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/date.d.ts +0 -28
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/number.d.ts +0 -29
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/string.d.ts +0 -29
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/transform.d.ts +0 -118
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/utils.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/declarations/serializer/json-api.d.ts +0 -123
- package/dist/unpkg/dev-deprecated/declarations/serializer/json.d.ts +0 -75
- package/dist/unpkg/dev-deprecated/declarations/serializer/rest.d.ts +0 -51
- package/dist/unpkg/dev-deprecated/declarations/serializer/transform.d.ts +0 -5
- package/dist/unpkg/dev-deprecated/declarations/serializer.d.ts +0 -254
- package/dist/unpkg/dev-deprecated/declarations/store/-private.d.ts +0 -223
- package/dist/unpkg/dev-deprecated/declarations/store.d.ts +0 -3
- package/dist/unpkg/dev-deprecated/util-Dul6TZts.js +0 -35
- package/dist/unpkg/dev-deprecated/utils-Cqw9eRj5.js +0 -23
- package/dist/unpkg/prod/declarations/adapter/-private/build-url-mixin.d.ts +0 -33
- package/dist/unpkg/prod/declarations/adapter/-private/fastboot-interface.d.ts +0 -8
- package/dist/unpkg/prod/declarations/adapter/-private/utils/continue-on-reject.d.ts +0 -1
- package/dist/unpkg/prod/declarations/adapter/-private/utils/determine-body-promise.d.ts +0 -4
- package/dist/unpkg/prod/declarations/adapter/-private/utils/fetch.d.ts +0 -8
- package/dist/unpkg/prod/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
- package/dist/unpkg/prod/declarations/adapter/-private/utils/serialize-into-hash.d.ts +0 -6
- package/dist/unpkg/prod/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -5
- package/dist/unpkg/prod/declarations/adapter/-private.d.ts +0 -5
- package/dist/unpkg/prod/declarations/adapter/error.d.ts +0 -215
- package/dist/unpkg/prod/declarations/adapter/json-api.d.ts +0 -231
- package/dist/unpkg/prod/declarations/adapter/rest.d.ts +0 -815
- package/dist/unpkg/prod/declarations/adapter.d.ts +0 -770
- package/dist/unpkg/prod/declarations/compat/-private.d.ts +0 -13
- package/dist/unpkg/prod/declarations/compat/builders/find-all.d.ts +0 -35
- package/dist/unpkg/prod/declarations/compat/builders/find-record.d.ts +0 -56
- package/dist/unpkg/prod/declarations/compat/builders/query.d.ts +0 -66
- package/dist/unpkg/prod/declarations/compat/builders/save-record.d.ts +0 -34
- package/dist/unpkg/prod/declarations/compat/builders/utils.d.ts +0 -3
- package/dist/unpkg/prod/declarations/compat/builders.d.ts +0 -14
- package/dist/unpkg/prod/declarations/compat/extensions.d.ts +0 -59
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/fetch-manager.d.ts +0 -55
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +0 -2
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +0 -11
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +0 -5
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +0 -2
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -524
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -213
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/serializer-response.d.ts +0 -6
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +0 -110
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/snapshot.d.ts +0 -255
- package/dist/unpkg/prod/declarations/compat/utils.d.ts +0 -137
- package/dist/unpkg/prod/declarations/compat.d.ts +0 -157
- package/dist/unpkg/prod/declarations/index.d.ts +0 -70
- package/dist/unpkg/prod/declarations/model/-private/attr.d.ts +0 -170
- package/dist/unpkg/prod/declarations/model/-private/belongs-to.d.ts +0 -174
- package/dist/unpkg/prod/declarations/model/-private/debug/assert-polymorphic-type.d.ts +0 -5
- package/dist/unpkg/prod/declarations/model/-private/errors.d.ts +0 -289
- package/dist/unpkg/prod/declarations/model/-private/has-many.d.ts +0 -162
- package/dist/unpkg/prod/declarations/model/-private/hooks.d.ts +0 -10
- package/dist/unpkg/prod/declarations/model/-private/legacy-relationships-support.d.ts +0 -47
- package/dist/unpkg/prod/declarations/model/-private/model-for-mixin.d.ts +0 -3
- package/dist/unpkg/prod/declarations/model/-private/model-methods.d.ts +0 -39
- package/dist/unpkg/prod/declarations/model/-private/model.d.ts +0 -1269
- package/dist/unpkg/prod/declarations/model/-private/notify-changes.d.ts +0 -4
- package/dist/unpkg/prod/declarations/model/-private/promise-belongs-to.d.ts +0 -40
- package/dist/unpkg/prod/declarations/model/-private/promise-many-array.d.ts +0 -124
- package/dist/unpkg/prod/declarations/model/-private/record-state.d.ts +0 -58
- package/dist/unpkg/prod/declarations/model/-private/references/belongs-to.d.ts +0 -498
- package/dist/unpkg/prod/declarations/model/-private/references/has-many.d.ts +0 -500
- package/dist/unpkg/prod/declarations/model/-private/schema-provider.d.ts +0 -56
- package/dist/unpkg/prod/declarations/model/-private/type-utils.d.ts +0 -57
- package/dist/unpkg/prod/declarations/model/-private/util.d.ts +0 -5
- package/dist/unpkg/prod/declarations/model/-private.d.ts +0 -8
- package/dist/unpkg/prod/declarations/model/migration-support.d.ts +0 -280
- package/dist/unpkg/prod/declarations/model-fragments/extensions/fragment-array.d.ts +0 -16
- package/dist/unpkg/prod/declarations/model-fragments/extensions/fragment.d.ts +0 -15
- package/dist/unpkg/prod/declarations/model-fragments/hooks/model-for.d.ts +0 -20
- package/dist/unpkg/prod/declarations/model-fragments/index.d.ts +0 -5
- package/dist/unpkg/prod/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -9
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -15
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -20
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -19
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-legacy.d.ts +0 -3
- package/dist/unpkg/prod/declarations/model-fragments.d.ts +0 -9
- package/dist/unpkg/prod/declarations/model.d.ts +0 -49
- package/dist/unpkg/prod/declarations/serializer/-private/embedded-records-mixin.d.ts +0 -91
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/boolean.d.ts +0 -47
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/date.d.ts +0 -28
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/number.d.ts +0 -29
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/string.d.ts +0 -29
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/transform.d.ts +0 -118
- package/dist/unpkg/prod/declarations/serializer/-private/utils.d.ts +0 -3
- package/dist/unpkg/prod/declarations/serializer/json-api.d.ts +0 -123
- package/dist/unpkg/prod/declarations/serializer/json.d.ts +0 -75
- package/dist/unpkg/prod/declarations/serializer/rest.d.ts +0 -51
- package/dist/unpkg/prod/declarations/serializer/transform.d.ts +0 -5
- package/dist/unpkg/prod/declarations/serializer.d.ts +0 -254
- package/dist/unpkg/prod/declarations/store/-private.d.ts +0 -223
- package/dist/unpkg/prod/declarations/store.d.ts +0 -3
- package/dist/unpkg/prod/hooks-QqRnX108.js +0 -74
- package/dist/unpkg/prod/util-Dul6TZts.js +0 -35
- package/dist/unpkg/prod/utils-Cqw9eRj5.js +0 -23
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/build-url-mixin.d.ts +0 -33
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/fastboot-interface.d.ts +0 -8
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/continue-on-reject.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/determine-body-promise.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/fetch.d.ts +0 -8
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts +0 -6
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/adapter/error.d.ts +0 -215
- package/dist/unpkg/prod-deprecated/declarations/adapter/json-api.d.ts +0 -231
- package/dist/unpkg/prod-deprecated/declarations/adapter/rest.d.ts +0 -815
- package/dist/unpkg/prod-deprecated/declarations/adapter.d.ts +0 -770
- package/dist/unpkg/prod-deprecated/declarations/compat/-private.d.ts +0 -13
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/find-all.d.ts +0 -35
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/find-record.d.ts +0 -56
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/query.d.ts +0 -66
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/save-record.d.ts +0 -34
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/utils.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/compat/builders.d.ts +0 -14
- package/dist/unpkg/prod-deprecated/declarations/compat/extensions.d.ts +0 -59
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/fetch-manager.d.ts +0 -55
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +0 -2
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +0 -11
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +0 -2
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -524
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -213
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/serializer-response.d.ts +0 -6
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +0 -110
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/snapshot.d.ts +0 -255
- package/dist/unpkg/prod-deprecated/declarations/compat/utils.d.ts +0 -137
- package/dist/unpkg/prod-deprecated/declarations/compat.d.ts +0 -157
- package/dist/unpkg/prod-deprecated/declarations/index.d.ts +0 -70
- package/dist/unpkg/prod-deprecated/declarations/model/-private/attr.d.ts +0 -170
- package/dist/unpkg/prod-deprecated/declarations/model/-private/belongs-to.d.ts +0 -174
- package/dist/unpkg/prod-deprecated/declarations/model/-private/debug/assert-polymorphic-type.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/model/-private/errors.d.ts +0 -289
- package/dist/unpkg/prod-deprecated/declarations/model/-private/has-many.d.ts +0 -162
- package/dist/unpkg/prod-deprecated/declarations/model/-private/hooks.d.ts +0 -10
- package/dist/unpkg/prod-deprecated/declarations/model/-private/legacy-relationships-support.d.ts +0 -47
- package/dist/unpkg/prod-deprecated/declarations/model/-private/model-for-mixin.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/model/-private/model-methods.d.ts +0 -39
- package/dist/unpkg/prod-deprecated/declarations/model/-private/model.d.ts +0 -1269
- package/dist/unpkg/prod-deprecated/declarations/model/-private/notify-changes.d.ts +0 -4
- package/dist/unpkg/prod-deprecated/declarations/model/-private/promise-belongs-to.d.ts +0 -40
- package/dist/unpkg/prod-deprecated/declarations/model/-private/promise-many-array.d.ts +0 -124
- package/dist/unpkg/prod-deprecated/declarations/model/-private/record-state.d.ts +0 -58
- package/dist/unpkg/prod-deprecated/declarations/model/-private/references/belongs-to.d.ts +0 -498
- package/dist/unpkg/prod-deprecated/declarations/model/-private/references/has-many.d.ts +0 -500
- package/dist/unpkg/prod-deprecated/declarations/model/-private/schema-provider.d.ts +0 -56
- package/dist/unpkg/prod-deprecated/declarations/model/-private/type-utils.d.ts +0 -57
- package/dist/unpkg/prod-deprecated/declarations/model/-private/util.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/model/-private.d.ts +0 -8
- package/dist/unpkg/prod-deprecated/declarations/model/migration-support.d.ts +0 -280
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/extensions/fragment-array.d.ts +0 -16
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/extensions/fragment.d.ts +0 -15
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/hooks/model-for.d.ts +0 -20
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/index.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -9
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -15
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -20
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -19
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-legacy.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/model-fragments.d.ts +0 -9
- package/dist/unpkg/prod-deprecated/declarations/model.d.ts +0 -49
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/embedded-records-mixin.d.ts +0 -91
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/boolean.d.ts +0 -47
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/date.d.ts +0 -28
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/number.d.ts +0 -29
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/string.d.ts +0 -29
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/transform.d.ts +0 -118
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/utils.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/declarations/serializer/json-api.d.ts +0 -123
- package/dist/unpkg/prod-deprecated/declarations/serializer/json.d.ts +0 -75
- package/dist/unpkg/prod-deprecated/declarations/serializer/rest.d.ts +0 -51
- package/dist/unpkg/prod-deprecated/declarations/serializer/transform.d.ts +0 -5
- package/dist/unpkg/prod-deprecated/declarations/serializer.d.ts +0 -254
- package/dist/unpkg/prod-deprecated/declarations/store/-private.d.ts +0 -223
- package/dist/unpkg/prod-deprecated/declarations/store.d.ts +0 -3
- package/dist/unpkg/prod-deprecated/utils-Cqw9eRj5.js +0 -23
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Context } from '@warp-drive/core/reactive/-private';
|
|
2
|
-
import { memoized, defineSignal, assertPrivateStore, defineNonEnumerableSignal,
|
|
2
|
+
import { memoized, defineSignal, assertPrivateStore, defineNonEnumerableSignal, recordIdentifierFor, isPrivateStore, storeFor, fastPush, createLegacyManyArray, notifyInternalSignal } from '@warp-drive/core/store/-private';
|
|
3
3
|
import { getOrSetGlobal } from '@warp-drive/core/types/-private';
|
|
4
4
|
import { EnableHydration } from '@warp-drive/core/types/request';
|
|
5
|
-
import { u as upgradeStore } from "./-private-
|
|
5
|
+
import { u as upgradeStore } from "./-private-Cvf_97EG.js";
|
|
6
6
|
import { computed, get } from '@ember/object';
|
|
7
7
|
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
|
|
8
8
|
import ObjectProxy from '@ember/object/proxy';
|
|
9
|
-
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
10
9
|
import { d as decorateMethodV2, a as decorateFieldV2, i as initializeDeferredDecorator } from "./runtime-BPCpkOf1-BKOwiRJp.js";
|
|
11
10
|
import { A } from '@ember/array';
|
|
12
11
|
import ArrayProxy from '@ember/array/proxy';
|
|
@@ -45,25 +44,12 @@ class PromiseBelongsTo extends Extended {
|
|
|
45
44
|
decorateMethodV2(this.prototype, "id", [memoized]);
|
|
46
45
|
}
|
|
47
46
|
get meta() {
|
|
48
|
-
// eslint-disable-next-line no-constant-condition
|
|
49
|
-
{
|
|
50
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
51
|
-
{
|
|
52
|
-
throw new Error('You attempted to access meta on the promise for the async belongsTo relationship ' + `${this._belongsToState.modelName}:${this._belongsToState.key}'.` + '\nUse `record.belongsTo(relationshipName).meta()` instead.');
|
|
53
|
-
}
|
|
54
|
-
})() : {};
|
|
55
|
-
}
|
|
56
47
|
return;
|
|
57
48
|
}
|
|
58
49
|
static {
|
|
59
50
|
decorateMethodV2(this.prototype, "meta", [computed()]);
|
|
60
51
|
}
|
|
61
52
|
async reload(options) {
|
|
62
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
63
|
-
if (!test) {
|
|
64
|
-
throw new Error('You are trying to reload an async belongsTo before it has been created');
|
|
65
|
-
}
|
|
66
|
-
})(this.content !== undefined) : {};
|
|
67
53
|
const {
|
|
68
54
|
key,
|
|
69
55
|
legacySupport
|
|
@@ -105,10 +91,7 @@ class PromiseManyArray {
|
|
|
105
91
|
get length() {
|
|
106
92
|
// shouldn't be needed, but ends up being needed
|
|
107
93
|
// for computed chains even in 4.x
|
|
108
|
-
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
110
|
-
this['[]'];
|
|
111
|
-
}
|
|
94
|
+
|
|
112
95
|
return this.content ? this.content.length : 0;
|
|
113
96
|
}
|
|
114
97
|
|
|
@@ -152,11 +135,6 @@ class PromiseManyArray {
|
|
|
152
135
|
* @return
|
|
153
136
|
*/
|
|
154
137
|
reload(options) {
|
|
155
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
156
|
-
if (!test) {
|
|
157
|
-
throw new Error('You are trying to reload an async manyArray before it has been created');
|
|
158
|
-
}
|
|
159
|
-
})(this.content) : {};
|
|
160
138
|
void this.content.reload(options);
|
|
161
139
|
return this;
|
|
162
140
|
}
|
|
@@ -299,43 +277,6 @@ function tapPromise(proxy, promise) {
|
|
|
299
277
|
throw error;
|
|
300
278
|
});
|
|
301
279
|
}
|
|
302
|
-
|
|
303
|
-
/*
|
|
304
|
-
Assert that `addedRecord` has a valid type so it can be added to the
|
|
305
|
-
relationship of the `record`.
|
|
306
|
-
|
|
307
|
-
The assert basically checks if the `addedRecord` can be added to the
|
|
308
|
-
relationship (specified via `relationshipMeta`) of the `record`.
|
|
309
|
-
|
|
310
|
-
This utility should only be used internally, as both record parameters must
|
|
311
|
-
be stable record identifiers and the `relationshipMeta` needs to be the meta
|
|
312
|
-
information about the relationship, retrieved via
|
|
313
|
-
`record.relationshipFor(key)`.
|
|
314
|
-
*/
|
|
315
|
-
let assertPolymorphicType;
|
|
316
|
-
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
317
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
318
|
-
assertPolymorphicType = function assertPolymorphicType(parentIdentifier, parentDefinition, addedIdentifier, store) {
|
|
319
|
-
if (parentDefinition.inverseIsImplicit) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
if (parentDefinition.isPolymorphic) {
|
|
323
|
-
const meta = store.schema.fields(addedIdentifier)?.get(parentDefinition.inverseKey);
|
|
324
|
-
if (meta) {
|
|
325
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
326
|
-
if (!test) {
|
|
327
|
-
throw new Error(`Expected the schema for the field ${parentDefinition.inverseKey} on ${addedIdentifier.type} to be for a legacy relationship`);
|
|
328
|
-
}
|
|
329
|
-
})(meta.kind === 'belongsTo' || meta.kind === 'hasMany') : {};
|
|
330
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
331
|
-
if (!test) {
|
|
332
|
-
throw new Error(`The schema for the relationship '${parentDefinition.inverseKey}' on '${addedIdentifier.type}' type does not implement '${parentDefinition.type}' and thus cannot be assigned to the '${parentDefinition.key}' relationship in '${parentIdentifier.type}'. The definition should specify 'as: "${parentDefinition.type}"' in options.`);
|
|
333
|
-
}
|
|
334
|
-
})(meta?.options?.as === parentDefinition.type) : {};
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
280
|
function isResourceIdentiferWithRelatedLinks$1(value) {
|
|
340
281
|
return Boolean(value && value.links && value.links.related);
|
|
341
282
|
}
|
|
@@ -718,23 +659,10 @@ class HasManyReference {
|
|
|
718
659
|
data: doc
|
|
719
660
|
} : doc;
|
|
720
661
|
const isResourceData = Array.isArray(dataDoc.data) && dataDoc.data.length > 0 && isMaybeResource(dataDoc.data[0]);
|
|
721
|
-
|
|
722
|
-
// enforce that one of links, meta or data is present
|
|
723
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
724
|
-
if (!test) {
|
|
725
|
-
throw new Error(`You must provide at least one of 'links', 'meta' or 'data' when calling hasManyReference.push`);
|
|
726
|
-
}
|
|
727
|
-
})('links' in dataDoc || 'meta' in dataDoc || 'data' in dataDoc) : {};
|
|
728
662
|
const identifiers = !Array.isArray(dataDoc.data) ? [] : isResourceData ? store._push(dataDoc, true) : dataDoc.data.map(i => store.cacheKeyManager.getOrCreateRecordIdentifier(i));
|
|
729
663
|
const {
|
|
730
664
|
identifier
|
|
731
665
|
} = this.hasManyRelationship;
|
|
732
|
-
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
733
|
-
const relationshipMeta = this.hasManyRelationship.definition;
|
|
734
|
-
identifiers.forEach(added => {
|
|
735
|
-
assertPolymorphicType(identifier, relationshipMeta, added, store);
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
666
|
const newData = {};
|
|
739
667
|
// only set data if it was passed in
|
|
740
668
|
if (Array.isArray(dataDoc.data)) {
|
|
@@ -932,11 +860,6 @@ function ensureRefCanSubscribe(rel) {
|
|
|
932
860
|
// we force accessed to be true here. When we make the graph public we should create a
|
|
933
861
|
// subscribe/unsubscribe API
|
|
934
862
|
const edge = rel.graph.get(rel.___identifier, rel.key);
|
|
935
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
936
|
-
if (!test) {
|
|
937
|
-
throw new Error(`Expected a hasMany relationship for ${rel.___identifier.type}:${rel.key}`);
|
|
938
|
-
}
|
|
939
|
-
})('accessed' in edge) : {};
|
|
940
863
|
edge.accessed = true;
|
|
941
864
|
return false;
|
|
942
865
|
}
|
|
@@ -1316,11 +1239,6 @@ class BelongsToReference {
|
|
|
1316
1239
|
const {
|
|
1317
1240
|
identifier
|
|
1318
1241
|
} = this.belongsToRelationship;
|
|
1319
|
-
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
1320
|
-
if (added) {
|
|
1321
|
-
assertPolymorphicType(identifier, this.belongsToRelationship.definition, added, store);
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
1242
|
const newData = {};
|
|
1325
1243
|
|
|
1326
1244
|
// only set data if it was passed in
|
|
@@ -1500,18 +1418,8 @@ defineNonEnumerableSignal(BelongsToReference.prototype, '_ref', 0);
|
|
|
1500
1418
|
const LEGACY_SUPPORT = getOrSetGlobal('LEGACY_SUPPORT', new Map());
|
|
1501
1419
|
function lookupLegacySupport(record) {
|
|
1502
1420
|
const identifier = recordIdentifierFor(record);
|
|
1503
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1504
|
-
if (!test) {
|
|
1505
|
-
throw new Error(`Expected a record`);
|
|
1506
|
-
}
|
|
1507
|
-
})(identifier) : {};
|
|
1508
1421
|
let support = LEGACY_SUPPORT.get(identifier);
|
|
1509
1422
|
if (!support) {
|
|
1510
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1511
|
-
if (!test) {
|
|
1512
|
-
throw new Error(`Memory Leak Detected`);
|
|
1513
|
-
}
|
|
1514
|
-
})(!record.isDestroyed && !record.isDestroying) : {};
|
|
1515
1423
|
support = new LegacySupport(record, identifier);
|
|
1516
1424
|
LEGACY_SUPPORT.set(identifier, support);
|
|
1517
1425
|
}
|
|
@@ -1595,11 +1503,6 @@ class LegacySupport {
|
|
|
1595
1503
|
const name = getRealFieldName(this, key);
|
|
1596
1504
|
const resource = this.store.cache.getRelationship(this.identifier, name);
|
|
1597
1505
|
const relationship = this.graph.get(this.identifier, name);
|
|
1598
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1599
|
-
if (!test) {
|
|
1600
|
-
throw new Error(`Expected ${key === name ? name : `${key} (source: ${name})`} to be a belongs-to relationship`);
|
|
1601
|
-
}
|
|
1602
|
-
})(isBelongsTo(relationship)) : {};
|
|
1603
1506
|
relationship.state.hasFailedLoadAttempt = false;
|
|
1604
1507
|
relationship.state.shouldForceReload = true;
|
|
1605
1508
|
const promise = this._findBelongsTo(name, resource, relationship, options);
|
|
@@ -1618,18 +1521,8 @@ class LegacySupport {
|
|
|
1618
1521
|
const name = getRealFieldName(this, key);
|
|
1619
1522
|
const resource = this.store.cache.getRelationship(this.identifier, name);
|
|
1620
1523
|
const relatedIdentifier = resource && resource.data ? resource.data : null;
|
|
1621
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1622
|
-
if (!test) {
|
|
1623
|
-
throw new Error(`Expected a stable identifier`);
|
|
1624
|
-
}
|
|
1625
|
-
})(!relatedIdentifier || isResourceKey(relatedIdentifier)) : {};
|
|
1626
1524
|
const store = this.store;
|
|
1627
1525
|
const relationship = this.graph.get(this.identifier, name);
|
|
1628
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1629
|
-
if (!test) {
|
|
1630
|
-
throw new Error(`Expected ${key === name ? name : `${key} (source: ${name})`} to be a belongs-to relationship`);
|
|
1631
|
-
}
|
|
1632
|
-
})(isBelongsTo(relationship)) : {};
|
|
1633
1526
|
const isAsync = relationship.definition.isAsync;
|
|
1634
1527
|
const _belongsToState = {
|
|
1635
1528
|
key,
|
|
@@ -1652,11 +1545,6 @@ class LegacySupport {
|
|
|
1652
1545
|
if (relatedIdentifier === null) {
|
|
1653
1546
|
return null;
|
|
1654
1547
|
} else {
|
|
1655
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1656
|
-
if (!test) {
|
|
1657
|
-
throw new Error(`You looked up the '${key === name ? name : `${key} (source: ${name})`}' relationship on a '${identifier.type}' with id ${identifier.id || 'null'} but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (\`belongsTo(<type>, { async: true, inverse: <inverse> })\`)`);
|
|
1658
|
-
}
|
|
1659
|
-
})(store._instanceCache.recordIsLoaded(relatedIdentifier, true)) : {};
|
|
1660
1548
|
return store._instanceCache.getRecord(relatedIdentifier);
|
|
1661
1549
|
}
|
|
1662
1550
|
}
|
|
@@ -1679,11 +1567,6 @@ class LegacySupport {
|
|
|
1679
1567
|
if (jsonApi.data) {
|
|
1680
1568
|
for (let i = 0; i < jsonApi.data.length; i++) {
|
|
1681
1569
|
const relatedIdentifier = jsonApi.data[i];
|
|
1682
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1683
|
-
if (!test) {
|
|
1684
|
-
throw new Error(`Expected a stable identifier`);
|
|
1685
|
-
}
|
|
1686
|
-
})(isResourceKey(relatedIdentifier)) : {};
|
|
1687
1570
|
if (cache.recordIsLoaded(relatedIdentifier, true)) {
|
|
1688
1571
|
identifiers.push(relatedIdentifier);
|
|
1689
1572
|
}
|
|
@@ -1720,11 +1603,6 @@ class LegacySupport {
|
|
|
1720
1603
|
}
|
|
1721
1604
|
return manyArray;
|
|
1722
1605
|
}
|
|
1723
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1724
|
-
{
|
|
1725
|
-
throw new Error('hasMany only works with the JSONAPICache');
|
|
1726
|
-
}
|
|
1727
|
-
})() : {};
|
|
1728
1606
|
}
|
|
1729
1607
|
fetchAsyncHasMany(key, relationship, manyArray, options) {
|
|
1730
1608
|
const name = getRealFieldName(this, key);
|
|
@@ -1743,11 +1621,6 @@ class LegacySupport {
|
|
|
1743
1621
|
this._relationshipPromisesCache[name] = loadingPromise;
|
|
1744
1622
|
return loadingPromise;
|
|
1745
1623
|
}
|
|
1746
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1747
|
-
{
|
|
1748
|
-
throw new Error('hasMany only works with the JSONAPICache');
|
|
1749
|
-
}
|
|
1750
|
-
})() : {};
|
|
1751
1624
|
}
|
|
1752
1625
|
reloadHasMany(key, options) {
|
|
1753
1626
|
const name = getRealFieldName(this, key);
|
|
@@ -1772,11 +1645,6 @@ class LegacySupport {
|
|
|
1772
1645
|
}
|
|
1773
1646
|
return promise;
|
|
1774
1647
|
}
|
|
1775
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1776
|
-
{
|
|
1777
|
-
throw new Error(`hasMany only works with the JSONAPICache`);
|
|
1778
|
-
}
|
|
1779
|
-
})() : {};
|
|
1780
1648
|
}
|
|
1781
1649
|
getHasMany(key, options) {
|
|
1782
1650
|
const name = getRealFieldName(this, key);
|
|
@@ -1797,19 +1665,9 @@ class LegacySupport {
|
|
|
1797
1665
|
content: manyArray
|
|
1798
1666
|
});
|
|
1799
1667
|
} else {
|
|
1800
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1801
|
-
if (!test) {
|
|
1802
|
-
throw new Error(`You looked up the '${key === name ? name : `${key} (source: ${name})`}' relationship on a '${this.identifier.type}' with id ${this.identifier.id || 'null'} but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async ('hasMany(<type>, { async: true, inverse: <inverse> })')`);
|
|
1803
|
-
}
|
|
1804
|
-
})(!anyUnloaded(this.store, relationship)) : {};
|
|
1805
1668
|
return manyArray;
|
|
1806
1669
|
}
|
|
1807
1670
|
}
|
|
1808
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1809
|
-
{
|
|
1810
|
-
throw new Error(`hasMany only works with the JSONAPICache`);
|
|
1811
|
-
}
|
|
1812
|
-
})() : {};
|
|
1813
1671
|
}
|
|
1814
1672
|
_updatePromiseProxyFor(kind, key, args) {
|
|
1815
1673
|
let promiseProxy = this._relationshipProxyCache[key];
|
|
@@ -1819,11 +1677,6 @@ class LegacySupport {
|
|
|
1819
1677
|
content
|
|
1820
1678
|
} = args;
|
|
1821
1679
|
if (promiseProxy) {
|
|
1822
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1823
|
-
if (!test) {
|
|
1824
|
-
throw new Error(`Expected a PromiseManyArray`);
|
|
1825
|
-
}
|
|
1826
|
-
})('_update' in promiseProxy) : {};
|
|
1827
1680
|
promiseProxy._update(promise, content);
|
|
1828
1681
|
} else {
|
|
1829
1682
|
promiseProxy = this._relationshipProxyCache[key] = new PromiseManyArray(promise, content);
|
|
@@ -1835,11 +1688,6 @@ class LegacySupport {
|
|
|
1835
1688
|
promise,
|
|
1836
1689
|
content
|
|
1837
1690
|
} = args;
|
|
1838
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1839
|
-
if (!test) {
|
|
1840
|
-
throw new Error(`Expected a PromiseBelongsTo`);
|
|
1841
|
-
}
|
|
1842
|
-
})('_belongsToState' in promiseProxy) : {};
|
|
1843
1691
|
if (content !== undefined) {
|
|
1844
1692
|
promiseProxy.set('content', content);
|
|
1845
1693
|
}
|
|
@@ -1854,32 +1702,12 @@ class LegacySupport {
|
|
|
1854
1702
|
const name = getRealFieldName(this, key);
|
|
1855
1703
|
let reference = this.references[name];
|
|
1856
1704
|
if (!reference) {
|
|
1857
|
-
if (!this.graph)
|
|
1858
|
-
// TODO @runspired while this feels odd, it is not a regression in capability because we do
|
|
1859
|
-
// not today support references pulling from RecordDatas other than our own
|
|
1860
|
-
// because of the intimate API access involved. This is something we will need to redesign.
|
|
1861
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1862
|
-
{
|
|
1863
|
-
throw new Error(`snapshot.belongsTo only supported when using the JSONAPICache`);
|
|
1864
|
-
}
|
|
1865
|
-
})() : {};
|
|
1866
|
-
}
|
|
1705
|
+
if (!this.graph) ;
|
|
1867
1706
|
const {
|
|
1868
1707
|
graph,
|
|
1869
1708
|
identifier
|
|
1870
1709
|
} = this;
|
|
1871
1710
|
const relationship = graph.get(identifier, name);
|
|
1872
|
-
if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
1873
|
-
if (kind) {
|
|
1874
|
-
const modelName = identifier.type;
|
|
1875
|
-
const actualRelationshipKind = relationship.definition.kind;
|
|
1876
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1877
|
-
if (!test) {
|
|
1878
|
-
throw new Error(`You tried to get the '${key === name ? name : `${key} (source: ${name})`}' relationship on a '${modelName}' via record.${kind}('${key}'), but the relationship is of kind '${actualRelationshipKind}'. Use record.${actualRelationshipKind}('${key}') instead.`);
|
|
1879
|
-
}
|
|
1880
|
-
})(actualRelationshipKind === kind) : {};
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
1711
|
const relationshipKind = relationship.definition.kind;
|
|
1884
1712
|
if (relationshipKind === 'belongsTo') {
|
|
1885
1713
|
reference = new BelongsToReference(this.store, graph, identifier, relationship, key);
|
|
@@ -1914,11 +1742,6 @@ class LegacySupport {
|
|
|
1914
1742
|
const field = this.store.schema.fields({
|
|
1915
1743
|
type: definition.inverseType
|
|
1916
1744
|
}).get(definition.key);
|
|
1917
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1918
|
-
if (!test) {
|
|
1919
|
-
throw new Error(`Expected a hasMany field definition for ${definition.inverseType}.${definition.key}`);
|
|
1920
|
-
}
|
|
1921
|
-
})(field && field.kind === 'hasMany') : {};
|
|
1922
1745
|
const request = {
|
|
1923
1746
|
useLink: shouldFindViaLink,
|
|
1924
1747
|
field,
|
|
@@ -1930,16 +1753,6 @@ class LegacySupport {
|
|
|
1930
1753
|
|
|
1931
1754
|
// fetch via link
|
|
1932
1755
|
if (shouldFindViaLink) {
|
|
1933
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1934
|
-
if (!test) {
|
|
1935
|
-
throw new Error(`Expected collection to be an array`);
|
|
1936
|
-
}
|
|
1937
|
-
})(!identifiers || Array.isArray(identifiers)) : {};
|
|
1938
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1939
|
-
if (!test) {
|
|
1940
|
-
throw new Error(`Expected stable identifiers`);
|
|
1941
|
-
}
|
|
1942
|
-
})(!identifiers || identifiers.every(isResourceKey)) : {};
|
|
1943
1756
|
const req = field.options.linksMode ? {
|
|
1944
1757
|
url: getRelatedLink(resource),
|
|
1945
1758
|
op: 'findHasMany',
|
|
@@ -1965,16 +1778,6 @@ class LegacySupport {
|
|
|
1965
1778
|
}
|
|
1966
1779
|
const hasData = hasReceivedData && !isEmpty;
|
|
1967
1780
|
if (attemptLocalCache || hasData || hasLocalPartialData) {
|
|
1968
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1969
|
-
if (!test) {
|
|
1970
|
-
throw new Error(`Expected collection to be an array`);
|
|
1971
|
-
}
|
|
1972
|
-
})(Array.isArray(identifiers)) : {};
|
|
1973
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1974
|
-
if (!test) {
|
|
1975
|
-
throw new Error(`Expected stable identifiers`);
|
|
1976
|
-
}
|
|
1977
|
-
})(identifiers.every(isResourceKey)) : {};
|
|
1978
1781
|
options.reload = options.reload || !attemptLocalCache || undefined;
|
|
1979
1782
|
return this.store.request({
|
|
1980
1783
|
op: 'findHasMany',
|
|
@@ -1990,11 +1793,6 @@ class LegacySupport {
|
|
|
1990
1793
|
// TODO if the relationshipIsStale, should we hit the adapter anyway?
|
|
1991
1794
|
return;
|
|
1992
1795
|
}
|
|
1993
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1994
|
-
{
|
|
1995
|
-
throw new Error(`hasMany only works with the JSONAPICache`);
|
|
1996
|
-
}
|
|
1997
|
-
})() : {};
|
|
1998
1796
|
}
|
|
1999
1797
|
_findBelongsToByJsonApiResource(resource, parentIdentifier, relationship, options = {}) {
|
|
2000
1798
|
if (!resource) {
|
|
@@ -2010,11 +1808,6 @@ class LegacySupport {
|
|
|
2010
1808
|
return this._pending[name];
|
|
2011
1809
|
}
|
|
2012
1810
|
const identifier = resource.data ? resource.data : null;
|
|
2013
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2014
|
-
if (!test) {
|
|
2015
|
-
throw new Error(`Expected a stable identifier`);
|
|
2016
|
-
}
|
|
2017
|
-
})(!identifier || isResourceKey(identifier)) : {};
|
|
2018
1811
|
const {
|
|
2019
1812
|
isStale,
|
|
2020
1813
|
hasDematerializedInverse,
|
|
@@ -2025,11 +1818,6 @@ class LegacySupport {
|
|
|
2025
1818
|
const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);
|
|
2026
1819
|
const shouldFindViaLink = resource.links?.related && (shouldForceReload || hasDematerializedInverse || isStale || !allInverseRecordsAreLoaded && !isEmpty);
|
|
2027
1820
|
const field = this.store.schema.fields(this.identifier).get(relationship.definition.key);
|
|
2028
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2029
|
-
if (!test) {
|
|
2030
|
-
throw new Error(`Attempted to access a belongsTo relationship but no definition exists for it`);
|
|
2031
|
-
}
|
|
2032
|
-
})(field && field.kind === 'belongsTo') : {};
|
|
2033
1821
|
const request = {
|
|
2034
1822
|
useLink: shouldFindViaLink,
|
|
2035
1823
|
field,
|
|
@@ -2081,11 +1869,6 @@ class LegacySupport {
|
|
|
2081
1869
|
|
|
2082
1870
|
// we may need to fetch
|
|
2083
1871
|
if (identifier) {
|
|
2084
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2085
|
-
if (!test) {
|
|
2086
|
-
throw new Error(`Cannot fetch belongs-to relationship with no information`);
|
|
2087
|
-
}
|
|
2088
|
-
})(identifier) : {};
|
|
2089
1872
|
options.reload = options.reload || !attemptLocalCache || undefined;
|
|
2090
1873
|
this._pending[name] = this.store.request({
|
|
2091
1874
|
op: 'findBelongsTo',
|
|
@@ -2129,11 +1912,6 @@ class LegacySupport {
|
|
|
2129
1912
|
}
|
|
2130
1913
|
function getRelatedLink(resource) {
|
|
2131
1914
|
const related = resource.links?.related;
|
|
2132
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2133
|
-
if (!test) {
|
|
2134
|
-
throw new Error(`Expected a related link`);
|
|
2135
|
-
}
|
|
2136
|
-
})(related) : {};
|
|
2137
1915
|
return typeof related === 'object' ? related.href : related;
|
|
2138
1916
|
}
|
|
2139
1917
|
function handleCompletedRelationshipRequest(recordExt, key, relationship, value, error) {
|
|
@@ -2180,33 +1958,11 @@ function extractIdentifierFromRecord(record) {
|
|
|
2180
1958
|
}
|
|
2181
1959
|
return recordIdentifierFor(record);
|
|
2182
1960
|
}
|
|
2183
|
-
function anyUnloaded(store, relationship) {
|
|
2184
|
-
assertPrivateStore(store);
|
|
2185
|
-
const graph = store._graph;
|
|
2186
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2187
|
-
if (!test) {
|
|
2188
|
-
throw new Error(`Expected a Graph instance to be available`);
|
|
2189
|
-
}
|
|
2190
|
-
})(graph) : {};
|
|
2191
|
-
const relationshipData = graph.getData(relationship.identifier, relationship.definition.key);
|
|
2192
|
-
const state = relationshipData.data;
|
|
2193
|
-
const cache = store._instanceCache;
|
|
2194
|
-
const unloaded = state?.find(s => {
|
|
2195
|
-
const isLoaded = cache.recordIsLoaded(s, true);
|
|
2196
|
-
return !isLoaded;
|
|
2197
|
-
});
|
|
2198
|
-
return unloaded || false;
|
|
2199
|
-
}
|
|
2200
1961
|
function areAllInverseRecordsLoaded(store, resource) {
|
|
2201
1962
|
assertPrivateStore(store);
|
|
2202
1963
|
const instanceCache = store._instanceCache;
|
|
2203
1964
|
const identifiers = resource.data;
|
|
2204
1965
|
if (Array.isArray(identifiers)) {
|
|
2205
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2206
|
-
if (!test) {
|
|
2207
|
-
throw new Error(`Expected stable identifiers`);
|
|
2208
|
-
}
|
|
2209
|
-
})(identifiers.every(isResourceKey)) : {};
|
|
2210
1966
|
// treat as collection
|
|
2211
1967
|
// check for unloaded records
|
|
2212
1968
|
return identifiers.every(identifier => instanceCache.recordIsLoaded(identifier));
|
|
@@ -2214,16 +1970,8 @@ function areAllInverseRecordsLoaded(store, resource) {
|
|
|
2214
1970
|
|
|
2215
1971
|
// treat as single resource
|
|
2216
1972
|
if (!identifiers) return true;
|
|
2217
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
2218
|
-
if (!test) {
|
|
2219
|
-
throw new Error(`Expected stable identifiers`);
|
|
2220
|
-
}
|
|
2221
|
-
})(isResourceKey(identifiers)) : {};
|
|
2222
1973
|
return instanceCache.recordIsLoaded(identifiers);
|
|
2223
1974
|
}
|
|
2224
|
-
function isBelongsTo(relationship) {
|
|
2225
|
-
return relationship.definition.kind === 'belongsTo';
|
|
2226
|
-
}
|
|
2227
1975
|
function getField(context, key) {
|
|
2228
1976
|
const {
|
|
2229
1977
|
identifier,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { setOwner, getOwner } from '@ember/application';
|
|
2
|
+
import { assertPrivateStore, setRecordIdentifier, StoreMap } from '@warp-drive/core/store/-private';
|
|
3
|
+
import { g as getModelFactory } from "./schema-provider-CHujJvA9.js";
|
|
4
|
+
import { n as normalizeModelName } from "./util-DvanW33H.js";
|
|
5
|
+
function instantiateRecord(identifier, createRecordArgs) {
|
|
6
|
+
const type = identifier.type;
|
|
7
|
+
|
|
8
|
+
// TODO deprecate allowing unknown args setting
|
|
9
|
+
const createOptions = {
|
|
10
|
+
_createProps: createRecordArgs ?? {},
|
|
11
|
+
// TODO @deprecate consider deprecating accessing record properties during init which the below is necessary for
|
|
12
|
+
_secretInit: {
|
|
13
|
+
identifier,
|
|
14
|
+
store: this,
|
|
15
|
+
cb: secretInit
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// ensure that `getOwner(this)` works inside a model instance
|
|
20
|
+
setOwner(createOptions, getOwner(this));
|
|
21
|
+
const factory = getModelFactory(this, type);
|
|
22
|
+
return factory.class.create(createOptions);
|
|
23
|
+
}
|
|
24
|
+
function teardownRecord(record) {
|
|
25
|
+
record.destroy();
|
|
26
|
+
}
|
|
27
|
+
function modelFor(modelName) {
|
|
28
|
+
assertPrivateStore(this);
|
|
29
|
+
const type = normalizeModelName(modelName);
|
|
30
|
+
const maybeFactory = getModelFactory(this, type);
|
|
31
|
+
const klass = maybeFactory && maybeFactory.class ? maybeFactory.class : null;
|
|
32
|
+
const ignoreType = !klass || !klass.isModel || this._forceShim;
|
|
33
|
+
if (!ignoreType) {
|
|
34
|
+
return klass;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function secretInit(record, identifier, store) {
|
|
38
|
+
setRecordIdentifier(record, identifier);
|
|
39
|
+
StoreMap.set(record, store);
|
|
40
|
+
}
|
|
41
|
+
export { instantiateRecord as i, modelFor as m, teardownRecord as t };
|
package/dist/unpkg/prod/index.js
CHANGED
|
@@ -5,13 +5,12 @@ import { LegacyNetworkHandler, adapterFor, serializerFor, pushPayload, normalize
|
|
|
5
5
|
import { EmberArrayLikeExtension, EmberObjectArrayExtension, EmberObjectExtension } from './compat/extensions.js';
|
|
6
6
|
import '@ember/object';
|
|
7
7
|
import '@warp-drive/core/types/symbols';
|
|
8
|
-
import '@ember/debug';
|
|
9
8
|
import '@warp-drive/utilities/string';
|
|
10
|
-
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
11
9
|
import '@warp-drive/core/store/-private';
|
|
12
|
-
import "./errors-
|
|
13
|
-
import "./schema-provider-
|
|
14
|
-
import { i as instantiateRecord, t as teardownRecord, m as modelFor } from "./hooks-
|
|
10
|
+
import "./errors-CXnfnBfQ.js";
|
|
11
|
+
import "./schema-provider-CHujJvA9.js";
|
|
12
|
+
import { i as instantiateRecord, t as teardownRecord, m as modelFor } from "./hooks-DvyWhLNg.js";
|
|
13
|
+
import '@ember/application';
|
|
15
14
|
import { registerDerivations as registerDerivations$1, DelegatingSchemaService } from './model/migration-support.js';
|
|
16
15
|
import { F as FragmentExtension, a as FragmentArrayExtension, f as fragmentsModelFor } from "./model-for-CqXsIKws.js";
|
|
17
16
|
import { restoreDeprecatedStoreBehaviors } from './store.js';
|
|
@@ -21,15 +20,13 @@ import { restoreDeprecatedStoreBehaviors } from './store.js';
|
|
|
21
20
|
* @mergeModuleWith <project>
|
|
22
21
|
*/
|
|
23
22
|
|
|
23
|
+
//export type ConfiguredStore<T = unknown> = typeof Store;
|
|
24
|
+
|
|
24
25
|
/**
|
|
25
26
|
* Use the legacy store with the given options.
|
|
26
27
|
*/
|
|
28
|
+
|
|
27
29
|
function useLegacyStore(options, StoreKlass = Store) {
|
|
28
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
29
|
-
if (!test) {
|
|
30
|
-
throw new Error(`If legacyRequests is true, linksMode must be false`);
|
|
31
|
-
}
|
|
32
|
-
})(!(options.linksMode && options.legacyRequests)) : {};
|
|
33
30
|
// we extend the store to ensure we don't leak our prototype overrides to other stores below.
|
|
34
31
|
class BaseKlass extends StoreKlass {}
|
|
35
32
|
class LegacyConfiguredStore extends BaseKlass {
|
|
@@ -112,15 +109,7 @@ function useLegacyStore(options, StoreKlass = Store) {
|
|
|
112
109
|
return teardownRecord$1(record);
|
|
113
110
|
}
|
|
114
111
|
modelFor(type) {
|
|
115
|
-
assertType(this.schema
|
|
116
|
-
// TODO I'm not sure this is right
|
|
117
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
118
|
-
if (!test) {
|
|
119
|
-
throw new Error(`modelFor should only be used to lookup legacy models when in linksMode: false`);
|
|
120
|
-
}
|
|
121
|
-
})(!options.linksMode || !this.schema.isDelegated({
|
|
122
|
-
type
|
|
123
|
-
})) : {};
|
|
112
|
+
assertType(this.schema);
|
|
124
113
|
const klass =
|
|
125
114
|
// prefer real models if present
|
|
126
115
|
modelFor.call(this, type) || (
|
|
@@ -131,44 +120,19 @@ function useLegacyStore(options, StoreKlass = Store) {
|
|
|
131
120
|
return klass;
|
|
132
121
|
}
|
|
133
122
|
adapterFor(modelName, _allowMissing) {
|
|
134
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
135
|
-
if (!test) {
|
|
136
|
-
throw new Error(`useLegacyStore was setup in linksMode. linksMode assumes that all requests have been migrated away from adapters and serializers.`);
|
|
137
|
-
}
|
|
138
|
-
})(!options.linksMode) : {};
|
|
139
123
|
// @ts-expect-error
|
|
140
124
|
return adapterFor.call(this, modelName, _allowMissing);
|
|
141
125
|
}
|
|
142
126
|
serializerFor(...args) {
|
|
143
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
144
|
-
if (!test) {
|
|
145
|
-
throw new Error(`useLegacyStore was setup in linksMode. linksMode assumes that all requests have been migrated away from adapters and serializers.`);
|
|
146
|
-
}
|
|
147
|
-
})(!options.linksMode) : {};
|
|
148
127
|
return serializerFor.call(this, ...args);
|
|
149
128
|
}
|
|
150
129
|
pushPayload(...args) {
|
|
151
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
152
|
-
if (!test) {
|
|
153
|
-
throw new Error(`useLegacyStore was setup in linksMode. linksMode assumes that all requests have been migrated away from adapters and serializers.`);
|
|
154
|
-
}
|
|
155
|
-
})(!options.linksMode) : {};
|
|
156
130
|
return pushPayload.call(this, ...args);
|
|
157
131
|
}
|
|
158
132
|
normalize(...args) {
|
|
159
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
160
|
-
if (!test) {
|
|
161
|
-
throw new Error(`useLegacyStore was setup in linksMode. linksMode assumes that all requests have been migrated away from adapters and serializers.`);
|
|
162
|
-
}
|
|
163
|
-
})(!options.linksMode) : {};
|
|
164
133
|
return normalize.call(this, ...args);
|
|
165
134
|
}
|
|
166
135
|
serializeRecord(...args) {
|
|
167
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
168
|
-
if (!test) {
|
|
169
|
-
throw new Error(`useLegacyStore was setup in linksMode. linksMode assumes that all requests have been migrated away from adapters and serializers.`);
|
|
170
|
-
}
|
|
171
|
-
})(!options.linksMode) : {};
|
|
172
136
|
return serializeRecord.call(this, ...args);
|
|
173
137
|
}
|
|
174
138
|
destroy() {
|
|
@@ -183,13 +147,5 @@ function useLegacyStore(options, StoreKlass = Store) {
|
|
|
183
147
|
}
|
|
184
148
|
return LegacyConfiguredStore;
|
|
185
149
|
}
|
|
186
|
-
function assertType(schema, type) {
|
|
187
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
188
|
-
if (!test) {
|
|
189
|
-
throw new Error(`Expected type ${type} to be a valid ResourceType`);
|
|
190
|
-
}
|
|
191
|
-
})(schema.hasResource({
|
|
192
|
-
type
|
|
193
|
-
})) : {};
|
|
194
|
-
}
|
|
150
|
+
function assertType(schema, type) {}
|
|
195
151
|
export { useLegacyStore };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { getOwner } from '@ember/application';
|
|
2
|
-
import { warn } from '@ember/debug';
|
|
3
2
|
import { dasherize, singularize } from '@warp-drive/utilities/string';
|
|
4
3
|
import { Serializer } from './serializer.js';
|
|
5
|
-
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
6
4
|
function coerceId(id) {
|
|
7
5
|
if (id === null || id === undefined || id === '') {
|
|
8
6
|
return null;
|
|
@@ -385,11 +383,6 @@ const JSONSerializer = Serializer.extend({
|
|
|
385
383
|
};
|
|
386
384
|
const meta = this.extractMeta(store, primaryModelClass, payload);
|
|
387
385
|
if (meta) {
|
|
388
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
389
|
-
if (!test) {
|
|
390
|
-
throw new Error('The `meta` returned from `extractMeta` has to be an object, not "' + typeof meta + '".');
|
|
391
|
-
}
|
|
392
|
-
})(typeof meta === 'object') : {};
|
|
393
386
|
// @ts-expect-error untyped
|
|
394
387
|
documentHash.meta = meta;
|
|
395
388
|
}
|
|
@@ -702,10 +695,6 @@ const JSONSerializer = Serializer.extend({
|
|
|
702
695
|
@private
|
|
703
696
|
*/
|
|
704
697
|
_getMappedKey(key, modelClass) {
|
|
705
|
-
warn('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', modelClass.attributes.has(key) || modelClass.relationshipsByName.has(key), {
|
|
706
|
-
id: 'ds.serializer.no-mapped-attrs-key'
|
|
707
|
-
});
|
|
708
|
-
// @ts-expect-error attrs is dynamically injected
|
|
709
698
|
const attrs = this.attrs;
|
|
710
699
|
let mappedKey;
|
|
711
700
|
if (attrs && attrs[key]) {
|
|
@@ -1261,11 +1250,6 @@ const JSONSerializer = Serializer.extend({
|
|
|
1261
1250
|
*/
|
|
1262
1251
|
transformFor(attributeType, skipAssertion) {
|
|
1263
1252
|
const transform = getOwner(this).lookup(`transform:${attributeType}`);
|
|
1264
|
-
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
1265
|
-
if (!test) {
|
|
1266
|
-
throw new Error(`Unable to find the transform for \`attr('${attributeType}')\``);
|
|
1267
|
-
}
|
|
1268
|
-
})(skipAssertion || !!transform) : {};
|
|
1269
1253
|
return transform;
|
|
1270
1254
|
}
|
|
1271
1255
|
});
|