@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
package/dist/unpkg/{dev-deprecated/schema-provider-g5MfTj8n.js → dev/schema-provider-B8jiJOYC.js}
RENAMED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { getOwner } from '@ember/application';
|
|
2
|
-
import { deprecate } from '@ember/debug';
|
|
3
2
|
import EmberObject from '@ember/object';
|
|
4
3
|
import { recordIdentifierFor, storeFor } from '@warp-drive/core';
|
|
5
4
|
import { assertPrivateStore, notifyInternalSignal, peekInternalSignal, withSignalStore, recordIdentifierFor as recordIdentifierFor$1, gate, memoized, defineSignal, coerceId, entangleSignal, defineGate } from '@warp-drive/core/store/-private';
|
|
6
5
|
import { RecordStore } from '@warp-drive/core/types/symbols';
|
|
7
|
-
import { l as lookupLegacySupport, L as LEGACY_SUPPORT, E as Errors } from "./errors-
|
|
8
|
-
import { u as upgradeStore, F as FetchManager } from "./-private-
|
|
9
|
-
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
6
|
+
import { l as lookupLegacySupport, L as LEGACY_SUPPORT, E as Errors } from "./errors-DD96TBEs.js";
|
|
7
|
+
import { u as upgradeStore, F as FetchManager } from "./-private-DbaSCSym.js";
|
|
10
8
|
import { cacheFor } from '@ember/object/internals';
|
|
11
9
|
import { Context } from '@warp-drive/core/reactive/-private';
|
|
12
10
|
import { d as decorateMethodV2 } from "./runtime-BPCpkOf1-BKOwiRJp.js";
|
|
13
|
-
import { n as normalizeModelName } from "./util-
|
|
11
|
+
import { n as normalizeModelName } from "./util-DvanW33H.js";
|
|
14
12
|
function rollbackAttributes() {
|
|
15
13
|
const {
|
|
16
14
|
currentState
|
|
@@ -42,35 +40,23 @@ function hasMany(prop) {
|
|
|
42
40
|
return lookupLegacySupport(this).referenceFor('hasMany', prop);
|
|
43
41
|
}
|
|
44
42
|
function reload(options = {}) {
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
{
|
|
44
|
+
(test => {
|
|
47
45
|
{
|
|
48
46
|
throw new Error(`You cannot use reload() on a record when ENABLE_LEGACY_REQUEST_METHODS is false.`);
|
|
49
47
|
}
|
|
50
|
-
})()
|
|
51
|
-
} else {
|
|
52
|
-
deprecate(`record.reload is deprecated, please use store.request to initiate a request instead.`, false, {
|
|
53
|
-
id: 'warp-drive:deprecate-legacy-request-methods',
|
|
54
|
-
until: '6.0',
|
|
55
|
-
for: '@warp-drive/core',
|
|
56
|
-
url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',
|
|
57
|
-
since: {
|
|
58
|
-
enabled: '5.7',
|
|
59
|
-
available: '5.7'
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return _reload.call(this, options);
|
|
48
|
+
})();
|
|
63
49
|
}
|
|
64
50
|
}
|
|
65
51
|
function _reload(options = {}) {
|
|
66
52
|
options.isReloading = true;
|
|
67
53
|
options.reload = true;
|
|
68
54
|
const identifier = recordIdentifierFor(this);
|
|
69
|
-
|
|
55
|
+
(test => {
|
|
70
56
|
if (!test) {
|
|
71
57
|
throw new Error(`You cannot reload a record without an ID`);
|
|
72
58
|
}
|
|
73
|
-
})(identifier.id)
|
|
59
|
+
})(identifier.id);
|
|
74
60
|
this.isReloading = true;
|
|
75
61
|
const promise = this[RecordStore].request({
|
|
76
62
|
op: 'findRecord',
|
|
@@ -100,24 +86,12 @@ function deleteRecord() {
|
|
|
100
86
|
}
|
|
101
87
|
}
|
|
102
88
|
function save(options) {
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
{
|
|
90
|
+
(test => {
|
|
105
91
|
{
|
|
106
92
|
throw new Error(`You cannot use save() on a record when ENABLE_LEGACY_REQUEST_METHODS is false.`);
|
|
107
93
|
}
|
|
108
|
-
})()
|
|
109
|
-
} else {
|
|
110
|
-
deprecate(`record.save is deprecated, please use store.request to initiate a request instead.`, false, {
|
|
111
|
-
id: 'warp-drive:deprecate-legacy-request-methods',
|
|
112
|
-
until: '6.0',
|
|
113
|
-
for: '@warp-drive/core',
|
|
114
|
-
url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',
|
|
115
|
-
since: {
|
|
116
|
-
enabled: '5.7',
|
|
117
|
-
available: '5.7'
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
return _save.call(this, options);
|
|
94
|
+
})();
|
|
121
95
|
}
|
|
122
96
|
}
|
|
123
97
|
function _save(options) {
|
|
@@ -131,24 +105,12 @@ function _save(options) {
|
|
|
131
105
|
return promise;
|
|
132
106
|
}
|
|
133
107
|
function destroyRecord(options) {
|
|
134
|
-
|
|
135
|
-
|
|
108
|
+
{
|
|
109
|
+
(test => {
|
|
136
110
|
{
|
|
137
111
|
throw new Error(`You cannot use destroyRecord() on a record when ENABLE_LEGACY_REQUEST_METHODS is false.`);
|
|
138
112
|
}
|
|
139
|
-
})()
|
|
140
|
-
} else {
|
|
141
|
-
deprecate(`record.destroyRecord is deprecated, please use store.request to initiate a request instead.`, false, {
|
|
142
|
-
id: 'warp-drive:deprecate-legacy-request-methods',
|
|
143
|
-
until: '6.0',
|
|
144
|
-
for: '@warp-drive/core',
|
|
145
|
-
url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',
|
|
146
|
-
since: {
|
|
147
|
-
enabled: '5.7',
|
|
148
|
-
available: '5.7'
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
return _destroyRecord.call(this, options);
|
|
113
|
+
})();
|
|
152
114
|
}
|
|
153
115
|
}
|
|
154
116
|
function _destroyRecord(options) {
|
|
@@ -188,11 +150,11 @@ function notifyChanges(identifier, value, key, record, store) {
|
|
|
188
150
|
case 'relationships':
|
|
189
151
|
if (key) {
|
|
190
152
|
const meta = record.constructor.relationshipsByName.get(key);
|
|
191
|
-
|
|
153
|
+
(test => {
|
|
192
154
|
if (!test) {
|
|
193
155
|
throw new Error(`Expected to find a relationship for ${key} on ${identifier.type}`);
|
|
194
156
|
}
|
|
195
|
-
})(meta)
|
|
157
|
+
})(meta);
|
|
196
158
|
notifyRelationship(identifier, key, record, meta);
|
|
197
159
|
} else {
|
|
198
160
|
record.eachRelationship((name, meta) => {
|
|
@@ -223,16 +185,16 @@ function notifyRelationship(identifier, key, record, meta) {
|
|
|
223
185
|
//We need to notifyPropertyChange in the adding case because we need to make sure
|
|
224
186
|
//we fetch the newly added record in case it is unloaded
|
|
225
187
|
//TODO(Igor): Consider whether we could do this only if the record state is unloaded
|
|
226
|
-
|
|
188
|
+
(test => {
|
|
227
189
|
if (!test) {
|
|
228
190
|
throw new Error(`Expected options to exist on relationship meta`);
|
|
229
191
|
}
|
|
230
|
-
})(meta.options)
|
|
231
|
-
|
|
192
|
+
})(meta.options);
|
|
193
|
+
(test => {
|
|
232
194
|
if (!test) {
|
|
233
195
|
throw new Error(`Expected async to exist on relationship meta options`);
|
|
234
196
|
}
|
|
235
|
-
})('async' in meta.options)
|
|
197
|
+
})('async' in meta.options);
|
|
236
198
|
if (meta.options.async) {
|
|
237
199
|
record.notifyPropertyChange(key);
|
|
238
200
|
}
|
|
@@ -422,11 +384,11 @@ class RecordState {
|
|
|
422
384
|
|
|
423
385
|
/** @internal */
|
|
424
386
|
updateInvalidErrors(errors) {
|
|
425
|
-
|
|
387
|
+
(test => {
|
|
426
388
|
if (!test) {
|
|
427
389
|
throw new Error(`Expected the Cache instance for ${this.identifier.lid} to implement getErrors(identifier)`);
|
|
428
390
|
}
|
|
429
|
-
})(typeof this.cache.getErrors === 'function')
|
|
391
|
+
})(typeof this.cache.getErrors === 'function');
|
|
430
392
|
const jsonApiErrors = this.cache.getErrors(this.identifier);
|
|
431
393
|
errors.clear();
|
|
432
394
|
for (let i = 0; i < jsonApiErrors.length; i++) {
|
|
@@ -441,11 +403,11 @@ class RecordState {
|
|
|
441
403
|
}
|
|
442
404
|
if (key) {
|
|
443
405
|
const errMsg = error.detail || error.title;
|
|
444
|
-
|
|
406
|
+
(test => {
|
|
445
407
|
if (!test) {
|
|
446
408
|
throw new Error(`Expected field error to have a detail or title to use as the message`);
|
|
447
409
|
}
|
|
448
|
-
})(errMsg)
|
|
410
|
+
})(errMsg);
|
|
449
411
|
errors.add(key, errMsg);
|
|
450
412
|
}
|
|
451
413
|
}
|
|
@@ -478,11 +440,11 @@ class RecordState {
|
|
|
478
440
|
get isSaved() {
|
|
479
441
|
const rd = this.cache;
|
|
480
442
|
if (this.isDeleted) {
|
|
481
|
-
|
|
443
|
+
(test => {
|
|
482
444
|
if (!test) {
|
|
483
445
|
throw new Error(`Expected Cache to implement isDeletionCommitted()`);
|
|
484
446
|
}
|
|
485
|
-
})(typeof rd.isDeletionCommitted === 'function')
|
|
447
|
+
})(typeof rd.isDeletionCommitted === 'function');
|
|
486
448
|
return rd.isDeletionCommitted(this.identifier);
|
|
487
449
|
}
|
|
488
450
|
if (this.isNew || this.isEmpty || !this.isValid || this.isDirty || this.isLoading) {
|
|
@@ -497,11 +459,11 @@ class RecordState {
|
|
|
497
459
|
const rd = this.cache;
|
|
498
460
|
// TODO this is not actually an RFC'd concept. Determine the
|
|
499
461
|
// correct heuristic to replace this with.
|
|
500
|
-
|
|
462
|
+
(test => {
|
|
501
463
|
if (!test) {
|
|
502
464
|
throw new Error(`Expected Cache to implement isEmpty()`);
|
|
503
465
|
}
|
|
504
|
-
})(typeof rd.isEmpty === 'function')
|
|
466
|
+
})(typeof rd.isEmpty === 'function');
|
|
505
467
|
return !this.isNew && rd.isEmpty(this.identifier);
|
|
506
468
|
}
|
|
507
469
|
static {
|
|
@@ -509,11 +471,11 @@ class RecordState {
|
|
|
509
471
|
}
|
|
510
472
|
get isNew() {
|
|
511
473
|
const rd = this.cache;
|
|
512
|
-
|
|
474
|
+
(test => {
|
|
513
475
|
if (!test) {
|
|
514
476
|
throw new Error(`Expected Cache to implement isNew()`);
|
|
515
477
|
}
|
|
516
|
-
})(typeof rd.isNew === 'function')
|
|
478
|
+
})(typeof rd.isNew === 'function');
|
|
517
479
|
return rd.isNew(this.identifier);
|
|
518
480
|
}
|
|
519
481
|
static {
|
|
@@ -521,11 +483,11 @@ class RecordState {
|
|
|
521
483
|
}
|
|
522
484
|
get isDeleted() {
|
|
523
485
|
const rd = this.cache;
|
|
524
|
-
|
|
486
|
+
(test => {
|
|
525
487
|
if (!test) {
|
|
526
488
|
throw new Error(`Expected Cache to implement isDeleted()`);
|
|
527
489
|
}
|
|
528
|
-
})(typeof rd.isDeleted === 'function')
|
|
490
|
+
})(typeof rd.isDeleted === 'function');
|
|
529
491
|
return rd.isDeleted(this.identifier);
|
|
530
492
|
}
|
|
531
493
|
static {
|
|
@@ -730,7 +692,7 @@ function computeOnce(target, propertyName, desc) {
|
|
|
730
692
|
class Model extends EmberObject {
|
|
731
693
|
/** @internal */
|
|
732
694
|
init(options) {
|
|
733
|
-
|
|
695
|
+
{
|
|
734
696
|
if (!options?._secretInit && !options?._createProps) {
|
|
735
697
|
throw new Error('You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.');
|
|
736
698
|
}
|
|
@@ -744,7 +706,7 @@ class Model extends EmberObject {
|
|
|
744
706
|
this[RecordStore] = store;
|
|
745
707
|
const identity = _secretInit.identifier;
|
|
746
708
|
_secretInit.cb(this, identity, _secretInit.store);
|
|
747
|
-
this.___recordState =
|
|
709
|
+
this.___recordState = new RecordState(this);
|
|
748
710
|
this.setProperties(createProps);
|
|
749
711
|
const notifications = store.notifications;
|
|
750
712
|
this.___private_notifications = notifications.subscribe(identity, (identifier, type, field) => {
|
|
@@ -1000,7 +962,7 @@ class Model extends EmberObject {
|
|
|
1000
962
|
decorateMethodV2(this.prototype, "isError", [memoized]);
|
|
1001
963
|
}
|
|
1002
964
|
set isError(v) {
|
|
1003
|
-
|
|
965
|
+
{
|
|
1004
966
|
throw new Error(`isError is not directly settable`);
|
|
1005
967
|
}
|
|
1006
968
|
}
|
|
@@ -1037,7 +999,7 @@ class Model extends EmberObject {
|
|
|
1037
999
|
// this guard exists, because some dev-only deprecation code
|
|
1038
1000
|
// (addListener via validatePropertyInjections) invokes toString before the
|
|
1039
1001
|
// object is real.
|
|
1040
|
-
|
|
1002
|
+
{
|
|
1041
1003
|
try {
|
|
1042
1004
|
return recordIdentifierFor(this).id;
|
|
1043
1005
|
} catch {
|
|
@@ -1054,11 +1016,11 @@ class Model extends EmberObject {
|
|
|
1054
1016
|
const identifier = recordIdentifierFor(this);
|
|
1055
1017
|
const didChange = normalizedId !== identifier.id;
|
|
1056
1018
|
assertPrivateStore(this.store);
|
|
1057
|
-
|
|
1019
|
+
(test => {
|
|
1058
1020
|
if (!test) {
|
|
1059
1021
|
throw new Error(`Cannot set ${identifier.type} record's id to ${id}, because id is already ${identifier.id}`);
|
|
1060
1022
|
}
|
|
1061
|
-
})(!didChange || identifier.id === null)
|
|
1023
|
+
})(!didChange || identifier.id === null);
|
|
1062
1024
|
if (normalizedId !== null && didChange) {
|
|
1063
1025
|
this.store._instanceCache.setRecordId(identifier, normalizedId);
|
|
1064
1026
|
this.store.notifications.notify(identifier, 'identity', null);
|
|
@@ -1079,11 +1041,7 @@ class Model extends EmberObject {
|
|
|
1079
1041
|
// when using legacy/classic ember classes. Basically: lazy in prod and eager in dev.
|
|
1080
1042
|
// so we do this to try to steer folks to the nicer "dont user currentState"
|
|
1081
1043
|
// error.
|
|
1082
|
-
|
|
1083
|
-
if (!this.___recordState) {
|
|
1084
|
-
this.___recordState = new RecordState(this);
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1044
|
+
|
|
1087
1045
|
return this.___recordState;
|
|
1088
1046
|
}
|
|
1089
1047
|
static {
|
|
@@ -1186,11 +1144,11 @@ class Model extends EmberObject {
|
|
|
1186
1144
|
|
|
1187
1145
|
/** @internal */
|
|
1188
1146
|
attr() {
|
|
1189
|
-
|
|
1147
|
+
(test => {
|
|
1190
1148
|
{
|
|
1191
1149
|
throw new Error('The `attr` method is not available on Model, a Snapshot was probably expected. Are you passing a Model instead of a Snapshot to your serializer?');
|
|
1192
1150
|
}
|
|
1193
|
-
})()
|
|
1151
|
+
})();
|
|
1194
1152
|
}
|
|
1195
1153
|
|
|
1196
1154
|
/**
|
|
@@ -1306,20 +1264,20 @@ class Model extends EmberObject {
|
|
|
1306
1264
|
@return the type of the relationship, or undefined
|
|
1307
1265
|
*/
|
|
1308
1266
|
static typeForRelationship(name, store) {
|
|
1309
|
-
|
|
1267
|
+
(test => {
|
|
1310
1268
|
if (!test) {
|
|
1311
1269
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1312
1270
|
}
|
|
1313
|
-
})(this.modelName)
|
|
1271
|
+
})(this.modelName);
|
|
1314
1272
|
const relationship = this.relationshipsByName.get(name);
|
|
1315
1273
|
return relationship && store.modelFor(relationship.type);
|
|
1316
1274
|
}
|
|
1317
1275
|
static get inverseMap() {
|
|
1318
|
-
|
|
1276
|
+
(test => {
|
|
1319
1277
|
if (!test) {
|
|
1320
1278
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1321
1279
|
}
|
|
1322
|
-
})(this.modelName)
|
|
1280
|
+
})(this.modelName);
|
|
1323
1281
|
return Object.create(null);
|
|
1324
1282
|
}
|
|
1325
1283
|
|
|
@@ -1351,11 +1309,11 @@ class Model extends EmberObject {
|
|
|
1351
1309
|
decorateMethodV2(this, "inverseMap", [computeOnce]);
|
|
1352
1310
|
}
|
|
1353
1311
|
static inverseFor(name, store) {
|
|
1354
|
-
|
|
1312
|
+
(test => {
|
|
1355
1313
|
if (!test) {
|
|
1356
1314
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1357
1315
|
}
|
|
1358
|
-
})(this.modelName)
|
|
1316
|
+
})(this.modelName);
|
|
1359
1317
|
const inverseMap = this.inverseMap;
|
|
1360
1318
|
if (inverseMap[name]) {
|
|
1361
1319
|
return inverseMap[name];
|
|
@@ -1368,46 +1326,46 @@ class Model extends EmberObject {
|
|
|
1368
1326
|
|
|
1369
1327
|
//Calculate the inverse, ignoring the cache
|
|
1370
1328
|
static _findInverseFor(name, store) {
|
|
1371
|
-
|
|
1329
|
+
(test => {
|
|
1372
1330
|
if (!test) {
|
|
1373
1331
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1374
1332
|
}
|
|
1375
|
-
})(this.modelName)
|
|
1333
|
+
})(this.modelName);
|
|
1376
1334
|
const relationship = this.relationshipsByName.get(name);
|
|
1377
|
-
|
|
1335
|
+
(test => {
|
|
1378
1336
|
if (!test) {
|
|
1379
1337
|
throw new Error(`No relationship named '${name}' on '${this.modelName}' exists.`);
|
|
1380
1338
|
}
|
|
1381
|
-
})(relationship)
|
|
1339
|
+
})(relationship);
|
|
1382
1340
|
if (!relationship) {
|
|
1383
1341
|
return null;
|
|
1384
1342
|
}
|
|
1385
1343
|
const {
|
|
1386
1344
|
options
|
|
1387
1345
|
} = relationship;
|
|
1388
|
-
|
|
1346
|
+
(test => {
|
|
1389
1347
|
if (!test) {
|
|
1390
1348
|
throw new Error(`Expected the relationship ${name} on ${this.modelName} to define an inverse.`);
|
|
1391
1349
|
}
|
|
1392
|
-
})(options.inverse === null || typeof options.inverse === 'string' && options.inverse.length > 0)
|
|
1350
|
+
})(options.inverse === null || typeof options.inverse === 'string' && options.inverse.length > 0);
|
|
1393
1351
|
if (options.inverse === null) {
|
|
1394
1352
|
return null;
|
|
1395
1353
|
}
|
|
1396
1354
|
const schemaExists = store.schema.hasResource(relationship);
|
|
1397
|
-
|
|
1355
|
+
(test => {
|
|
1398
1356
|
if (!test) {
|
|
1399
1357
|
throw new Error(`No associated schema found for '${relationship.type}' while calculating the inverse of ${name} on ${this.modelName}`);
|
|
1400
1358
|
}
|
|
1401
|
-
})(schemaExists)
|
|
1359
|
+
})(schemaExists);
|
|
1402
1360
|
if (!schemaExists) {
|
|
1403
1361
|
return null;
|
|
1404
1362
|
}
|
|
1405
1363
|
const inverseField = store.schema.fields(relationship).get(options.inverse);
|
|
1406
|
-
|
|
1364
|
+
(test => {
|
|
1407
1365
|
if (!test) {
|
|
1408
1366
|
throw new Error(`No inverse relationship found for '${name}' on '${this.modelName}'`);
|
|
1409
1367
|
}
|
|
1410
|
-
})(inverseField && (inverseField.kind === 'belongsTo' || inverseField.kind === 'hasMany'))
|
|
1368
|
+
})(inverseField && (inverseField.kind === 'belongsTo' || inverseField.kind === 'hasMany'));
|
|
1411
1369
|
return inverseField || null;
|
|
1412
1370
|
}
|
|
1413
1371
|
|
|
@@ -1444,11 +1402,11 @@ class Model extends EmberObject {
|
|
|
1444
1402
|
*/
|
|
1445
1403
|
|
|
1446
1404
|
static get relationships() {
|
|
1447
|
-
|
|
1405
|
+
(test => {
|
|
1448
1406
|
if (!test) {
|
|
1449
1407
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1450
1408
|
}
|
|
1451
|
-
})(this.modelName)
|
|
1409
|
+
})(this.modelName);
|
|
1452
1410
|
const map = new Map();
|
|
1453
1411
|
const relationshipsByName = this.relationshipsByName;
|
|
1454
1412
|
|
|
@@ -1494,11 +1452,11 @@ class Model extends EmberObject {
|
|
|
1494
1452
|
decorateMethodV2(this, "relationships", [computeOnce]);
|
|
1495
1453
|
}
|
|
1496
1454
|
static get relationshipNames() {
|
|
1497
|
-
|
|
1455
|
+
(test => {
|
|
1498
1456
|
if (!test) {
|
|
1499
1457
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1500
1458
|
}
|
|
1501
|
-
})(this.modelName)
|
|
1459
|
+
})(this.modelName);
|
|
1502
1460
|
const names = {
|
|
1503
1461
|
hasMany: [],
|
|
1504
1462
|
belongsTo: []
|
|
@@ -1538,11 +1496,11 @@ class Model extends EmberObject {
|
|
|
1538
1496
|
decorateMethodV2(this, "relationshipNames", [computeOnce]);
|
|
1539
1497
|
}
|
|
1540
1498
|
static get relatedTypes() {
|
|
1541
|
-
|
|
1499
|
+
(test => {
|
|
1542
1500
|
if (!test) {
|
|
1543
1501
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1544
1502
|
}
|
|
1545
|
-
})(this.modelName)
|
|
1503
|
+
})(this.modelName);
|
|
1546
1504
|
const types = [];
|
|
1547
1505
|
const rels = this.relationshipsObject;
|
|
1548
1506
|
const relationships = Object.keys(rels);
|
|
@@ -1590,11 +1548,11 @@ class Model extends EmberObject {
|
|
|
1590
1548
|
decorateMethodV2(this, "relatedTypes", [computeOnce]);
|
|
1591
1549
|
}
|
|
1592
1550
|
static get relationshipsByName() {
|
|
1593
|
-
|
|
1551
|
+
(test => {
|
|
1594
1552
|
if (!test) {
|
|
1595
1553
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1596
1554
|
}
|
|
1597
|
-
})(this.modelName)
|
|
1555
|
+
})(this.modelName);
|
|
1598
1556
|
const map = new Map();
|
|
1599
1557
|
const rels = this.relationshipsObject;
|
|
1600
1558
|
const relationships = Object.keys(rels);
|
|
@@ -1609,11 +1567,11 @@ class Model extends EmberObject {
|
|
|
1609
1567
|
decorateMethodV2(this, "relationshipsByName", [computeOnce]);
|
|
1610
1568
|
}
|
|
1611
1569
|
static get relationshipsObject() {
|
|
1612
|
-
|
|
1570
|
+
(test => {
|
|
1613
1571
|
if (!test) {
|
|
1614
1572
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1615
1573
|
}
|
|
1616
|
-
})(this.modelName)
|
|
1574
|
+
})(this.modelName);
|
|
1617
1575
|
const relationships = Object.create(null);
|
|
1618
1576
|
const modelName = this.modelName;
|
|
1619
1577
|
this.eachComputedProperty((name, meta) => {
|
|
@@ -1624,16 +1582,16 @@ class Model extends EmberObject {
|
|
|
1624
1582
|
meta.key = name;
|
|
1625
1583
|
meta.name = name;
|
|
1626
1584
|
relationships[name] = meta;
|
|
1627
|
-
|
|
1585
|
+
(test => {
|
|
1628
1586
|
if (!test) {
|
|
1629
1587
|
throw new Error(`Expected options in meta`);
|
|
1630
1588
|
}
|
|
1631
|
-
})(meta.options && typeof meta.options === 'object')
|
|
1632
|
-
|
|
1589
|
+
})(meta.options && typeof meta.options === 'object');
|
|
1590
|
+
(test => {
|
|
1633
1591
|
if (!test) {
|
|
1634
1592
|
throw new Error(`You should not specify both options.as and options.inverse as null on ${modelName}.${meta.name}, 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.`);
|
|
1635
1593
|
}
|
|
1636
|
-
})(!(meta.options.inverse === null && meta.options.as?.length))
|
|
1594
|
+
})(!(meta.options.inverse === null && meta.options.as?.length));
|
|
1637
1595
|
});
|
|
1638
1596
|
return relationships;
|
|
1639
1597
|
}
|
|
@@ -1672,11 +1630,11 @@ class Model extends EmberObject {
|
|
|
1672
1630
|
decorateMethodV2(this, "relationshipsObject", [computeOnce]);
|
|
1673
1631
|
}
|
|
1674
1632
|
static get fields() {
|
|
1675
|
-
|
|
1633
|
+
(test => {
|
|
1676
1634
|
if (!test) {
|
|
1677
1635
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1678
1636
|
}
|
|
1679
|
-
})(this.modelName)
|
|
1637
|
+
})(this.modelName);
|
|
1680
1638
|
const map = new Map();
|
|
1681
1639
|
this.eachComputedProperty((name, meta) => {
|
|
1682
1640
|
if (isRelationshipSchema(meta)) {
|
|
@@ -1700,11 +1658,11 @@ class Model extends EmberObject {
|
|
|
1700
1658
|
decorateMethodV2(this, "fields", [computeOnce]);
|
|
1701
1659
|
}
|
|
1702
1660
|
static eachRelationship(callback, binding) {
|
|
1703
|
-
|
|
1661
|
+
(test => {
|
|
1704
1662
|
if (!test) {
|
|
1705
1663
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1706
1664
|
}
|
|
1707
|
-
})(this.modelName)
|
|
1665
|
+
})(this.modelName);
|
|
1708
1666
|
this.relationshipsByName.forEach((relationship, name) => {
|
|
1709
1667
|
callback.call(binding, name, relationship);
|
|
1710
1668
|
});
|
|
@@ -1720,11 +1678,11 @@ class Model extends EmberObject {
|
|
|
1720
1678
|
@param {any} binding the value to which the callback's `this` should be bound
|
|
1721
1679
|
*/
|
|
1722
1680
|
static eachRelatedType(callback, binding) {
|
|
1723
|
-
|
|
1681
|
+
(test => {
|
|
1724
1682
|
if (!test) {
|
|
1725
1683
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1726
1684
|
}
|
|
1727
|
-
})(this.modelName)
|
|
1685
|
+
})(this.modelName);
|
|
1728
1686
|
const relationshipTypes = this.relatedTypes;
|
|
1729
1687
|
for (let i = 0; i < relationshipTypes.length; i++) {
|
|
1730
1688
|
const type = relationshipTypes[i];
|
|
@@ -1738,11 +1696,11 @@ class Model extends EmberObject {
|
|
|
1738
1696
|
* @deprecated
|
|
1739
1697
|
*/
|
|
1740
1698
|
static determineRelationshipType(knownSide, store) {
|
|
1741
|
-
|
|
1699
|
+
(test => {
|
|
1742
1700
|
if (!test) {
|
|
1743
1701
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1744
1702
|
}
|
|
1745
|
-
})(this.modelName)
|
|
1703
|
+
})(this.modelName);
|
|
1746
1704
|
const knownKey = knownSide.name;
|
|
1747
1705
|
const knownKind = knownSide.kind;
|
|
1748
1706
|
const inverse = this.inverseFor(knownKey, store);
|
|
@@ -1790,19 +1748,19 @@ class Model extends EmberObject {
|
|
|
1790
1748
|
@readonly
|
|
1791
1749
|
*/
|
|
1792
1750
|
static get attributes() {
|
|
1793
|
-
|
|
1751
|
+
(test => {
|
|
1794
1752
|
if (!test) {
|
|
1795
1753
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1796
1754
|
}
|
|
1797
|
-
})(this.modelName)
|
|
1755
|
+
})(this.modelName);
|
|
1798
1756
|
const map = new Map();
|
|
1799
1757
|
this.eachComputedProperty((name, meta) => {
|
|
1800
1758
|
if (isAttributeSchema(meta)) {
|
|
1801
|
-
|
|
1759
|
+
(test => {
|
|
1802
1760
|
if (!test) {
|
|
1803
1761
|
throw new Error("You may not set 'id' as an attribute on your model. Please remove any lines that look like: `id: attr('<type>')` from " + this.toString());
|
|
1804
1762
|
}
|
|
1805
|
-
})(name !== 'id')
|
|
1763
|
+
})(name !== 'id');
|
|
1806
1764
|
|
|
1807
1765
|
// TODO deprecate key being here
|
|
1808
1766
|
meta.key = name;
|
|
@@ -1845,11 +1803,11 @@ class Model extends EmberObject {
|
|
|
1845
1803
|
decorateMethodV2(this, "attributes", [computeOnce]);
|
|
1846
1804
|
}
|
|
1847
1805
|
static get transformedAttributes() {
|
|
1848
|
-
|
|
1806
|
+
(test => {
|
|
1849
1807
|
if (!test) {
|
|
1850
1808
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1851
1809
|
}
|
|
1852
|
-
})(this.modelName)
|
|
1810
|
+
})(this.modelName);
|
|
1853
1811
|
const map = new Map();
|
|
1854
1812
|
this.eachAttribute((name, meta) => {
|
|
1855
1813
|
if (meta.type) {
|
|
@@ -1895,11 +1853,11 @@ class Model extends EmberObject {
|
|
|
1895
1853
|
decorateMethodV2(this, "transformedAttributes", [computeOnce]);
|
|
1896
1854
|
}
|
|
1897
1855
|
static eachAttribute(callback, binding) {
|
|
1898
|
-
|
|
1856
|
+
(test => {
|
|
1899
1857
|
if (!test) {
|
|
1900
1858
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1901
1859
|
}
|
|
1902
|
-
})(this.modelName)
|
|
1860
|
+
})(this.modelName);
|
|
1903
1861
|
this.attributes.forEach((meta, name) => {
|
|
1904
1862
|
callback.call(binding, name, meta);
|
|
1905
1863
|
});
|
|
@@ -1939,11 +1897,11 @@ class Model extends EmberObject {
|
|
|
1939
1897
|
@param {Object} [binding] the value to which the callback's `this` should be bound
|
|
1940
1898
|
*/
|
|
1941
1899
|
static eachTransformedAttribute(callback, binding) {
|
|
1942
|
-
|
|
1900
|
+
(test => {
|
|
1943
1901
|
if (!test) {
|
|
1944
1902
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1945
1903
|
}
|
|
1946
|
-
})(this.modelName)
|
|
1904
|
+
})(this.modelName);
|
|
1947
1905
|
this.transformedAttributes.forEach((type, name) => {
|
|
1948
1906
|
callback.call(binding, name, type);
|
|
1949
1907
|
});
|
|
@@ -1954,11 +1912,11 @@ class Model extends EmberObject {
|
|
|
1954
1912
|
@public
|
|
1955
1913
|
*/
|
|
1956
1914
|
static toString() {
|
|
1957
|
-
|
|
1915
|
+
(test => {
|
|
1958
1916
|
if (!test) {
|
|
1959
1917
|
throw new Error(`Accessing schema information on Models without looking up the model via the store is disallowed.`);
|
|
1960
1918
|
}
|
|
1961
|
-
})(this.modelName)
|
|
1919
|
+
})(this.modelName);
|
|
1962
1920
|
return `model:${this.modelName}`;
|
|
1963
1921
|
}
|
|
1964
1922
|
}
|
|
@@ -1978,16 +1936,7 @@ Model.prototype.rollbackAttributes = rollbackAttributes;
|
|
|
1978
1936
|
Model.prototype.reload = reload;
|
|
1979
1937
|
defineGate(Model.prototype, 'isReloading', {
|
|
1980
1938
|
get() {
|
|
1981
|
-
|
|
1982
|
-
id: 'warp-drive:deprecate-legacy-request-methods',
|
|
1983
|
-
until: '6.0',
|
|
1984
|
-
for: '@warp-drive/core',
|
|
1985
|
-
url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',
|
|
1986
|
-
since: {
|
|
1987
|
-
enabled: '5.7',
|
|
1988
|
-
available: '5.7'
|
|
1989
|
-
}
|
|
1990
|
-
});
|
|
1939
|
+
console.warn(`record.isReloading is deprecated, please use store.request and either <Request> or getRequuestState to keep track of the request state instead.`);
|
|
1991
1940
|
return this._isReloading ?? false;
|
|
1992
1941
|
},
|
|
1993
1942
|
set(v) {
|
|
@@ -2019,7 +1968,7 @@ function restoreDeprecatedModelRequestBehaviors(ModelKlass) {
|
|
|
2019
1968
|
// the values initialized during create to `setUnknownProperty`
|
|
2020
1969
|
Model.prototype._createProps = null;
|
|
2021
1970
|
Model.prototype._secretInit = null;
|
|
2022
|
-
|
|
1971
|
+
{
|
|
2023
1972
|
const lookupDescriptor = function lookupDescriptor(obj, keyName) {
|
|
2024
1973
|
let current = obj;
|
|
2025
1974
|
do {
|
|
@@ -2110,41 +2059,41 @@ class ModelSchemaProvider {
|
|
|
2110
2059
|
return Array.from(this._schemas.keys());
|
|
2111
2060
|
}
|
|
2112
2061
|
hasTrait(type) {
|
|
2113
|
-
|
|
2062
|
+
(test => {
|
|
2114
2063
|
{
|
|
2115
2064
|
throw new Error(`hasTrait is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2116
2065
|
}
|
|
2117
|
-
})()
|
|
2066
|
+
})();
|
|
2118
2067
|
return false;
|
|
2119
2068
|
}
|
|
2120
2069
|
resourceHasTrait(resource, trait) {
|
|
2121
|
-
|
|
2070
|
+
(test => {
|
|
2122
2071
|
{
|
|
2123
2072
|
throw new Error(`resourceHasTrait is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2124
2073
|
}
|
|
2125
|
-
})()
|
|
2074
|
+
})();
|
|
2126
2075
|
return false;
|
|
2127
2076
|
}
|
|
2128
2077
|
transformation(field) {
|
|
2129
|
-
|
|
2078
|
+
(test => {
|
|
2130
2079
|
{
|
|
2131
2080
|
throw new Error(`transformation is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2132
2081
|
}
|
|
2133
|
-
})()
|
|
2082
|
+
})();
|
|
2134
2083
|
}
|
|
2135
2084
|
derivation(field) {
|
|
2136
|
-
|
|
2085
|
+
(test => {
|
|
2137
2086
|
{
|
|
2138
2087
|
throw new Error(`derivation is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2139
2088
|
}
|
|
2140
|
-
})()
|
|
2089
|
+
})();
|
|
2141
2090
|
}
|
|
2142
2091
|
hashFn(field) {
|
|
2143
|
-
|
|
2092
|
+
(test => {
|
|
2144
2093
|
{
|
|
2145
2094
|
throw new Error(`hashFn is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2146
2095
|
}
|
|
2147
|
-
})()
|
|
2096
|
+
})();
|
|
2148
2097
|
}
|
|
2149
2098
|
resource(resource) {
|
|
2150
2099
|
const type = normalizeModelName(resource.type);
|
|
@@ -2154,39 +2103,39 @@ class ModelSchemaProvider {
|
|
|
2154
2103
|
return this._schemas.get(type).schema;
|
|
2155
2104
|
}
|
|
2156
2105
|
registerResources(schemas) {
|
|
2157
|
-
|
|
2106
|
+
(test => {
|
|
2158
2107
|
{
|
|
2159
2108
|
throw new Error(`registerResources is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2160
2109
|
}
|
|
2161
|
-
})()
|
|
2110
|
+
})();
|
|
2162
2111
|
}
|
|
2163
2112
|
registerResource(schema) {
|
|
2164
|
-
|
|
2113
|
+
(test => {
|
|
2165
2114
|
{
|
|
2166
2115
|
throw new Error(`registerResource is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2167
2116
|
}
|
|
2168
|
-
})()
|
|
2117
|
+
})();
|
|
2169
2118
|
}
|
|
2170
2119
|
registerTransformation(transform) {
|
|
2171
|
-
|
|
2120
|
+
(test => {
|
|
2172
2121
|
{
|
|
2173
2122
|
throw new Error(`registerTransformation is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2174
2123
|
}
|
|
2175
|
-
})()
|
|
2124
|
+
})();
|
|
2176
2125
|
}
|
|
2177
2126
|
registerDerivation(derivation) {
|
|
2178
|
-
|
|
2127
|
+
(test => {
|
|
2179
2128
|
{
|
|
2180
2129
|
throw new Error(`registerDerivation is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2181
2130
|
}
|
|
2182
|
-
})()
|
|
2131
|
+
})();
|
|
2183
2132
|
}
|
|
2184
2133
|
registerHashFn(hashFn) {
|
|
2185
|
-
|
|
2134
|
+
(test => {
|
|
2186
2135
|
{
|
|
2187
2136
|
throw new Error(`registerHashFn is not available with @warp-drive/legacy/model's SchemaService`);
|
|
2188
2137
|
}
|
|
2189
|
-
})()
|
|
2138
|
+
})();
|
|
2190
2139
|
}
|
|
2191
2140
|
/** @internal */
|
|
2192
2141
|
_loadModelSchema(type) {
|
|
@@ -2244,64 +2193,6 @@ class ModelSchemaProvider {
|
|
|
2244
2193
|
return true;
|
|
2245
2194
|
}
|
|
2246
2195
|
}
|
|
2247
|
-
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA_SERVICE)) {
|
|
2248
|
-
ModelSchemaProvider.prototype.doesTypeExist = function (type) {
|
|
2249
|
-
deprecate(`Use \`schema.hasResource({ type })\` instead of \`schema.doesTypeExist(type)\``, false, {
|
|
2250
|
-
id: 'ember-data:schema-service-updates',
|
|
2251
|
-
until: '6.0',
|
|
2252
|
-
for: 'ember-data',
|
|
2253
|
-
since: {
|
|
2254
|
-
available: '4.13',
|
|
2255
|
-
enabled: '5.4'
|
|
2256
|
-
}
|
|
2257
|
-
});
|
|
2258
|
-
return this.hasResource({
|
|
2259
|
-
type
|
|
2260
|
-
});
|
|
2261
|
-
};
|
|
2262
|
-
ModelSchemaProvider.prototype.attributesDefinitionFor = function (resource) {
|
|
2263
|
-
deprecate(`Use \`schema.fields({ type })\` instead of \`schema.attributesDefinitionFor({ type })\``, false, {
|
|
2264
|
-
id: 'ember-data:schema-service-updates',
|
|
2265
|
-
until: '6.0',
|
|
2266
|
-
for: 'ember-data',
|
|
2267
|
-
since: {
|
|
2268
|
-
available: '4.13',
|
|
2269
|
-
enabled: '5.4'
|
|
2270
|
-
}
|
|
2271
|
-
});
|
|
2272
|
-
const type = normalizeModelName(resource.type);
|
|
2273
|
-
|
|
2274
|
-
// @ts-expect-error intentional use of internal API
|
|
2275
|
-
if (!this._schemas.has(type)) {
|
|
2276
|
-
// @ts-expect-error intentional use of internal API
|
|
2277
|
-
this._loadModelSchema(type);
|
|
2278
|
-
}
|
|
2279
|
-
|
|
2280
|
-
// @ts-expect-error intentional use of internal API
|
|
2281
|
-
return this._schemas.get(type).attributes;
|
|
2282
|
-
};
|
|
2283
|
-
ModelSchemaProvider.prototype.relationshipsDefinitionFor = function (resource) {
|
|
2284
|
-
deprecate(`Use \`schema.fields({ type })\` instead of \`schema.relationshipsDefinitionFor({ type })\``, false, {
|
|
2285
|
-
id: 'ember-data:schema-service-updates',
|
|
2286
|
-
until: '6.0',
|
|
2287
|
-
for: 'ember-data',
|
|
2288
|
-
since: {
|
|
2289
|
-
available: '4.13',
|
|
2290
|
-
enabled: '5.4'
|
|
2291
|
-
}
|
|
2292
|
-
});
|
|
2293
|
-
const type = normalizeModelName(resource.type);
|
|
2294
|
-
|
|
2295
|
-
// @ts-expect-error intentional use of internal API
|
|
2296
|
-
if (!this._schemas.has(type)) {
|
|
2297
|
-
// @ts-expect-error intentional use of internal API
|
|
2298
|
-
this._loadModelSchema(type);
|
|
2299
|
-
}
|
|
2300
|
-
|
|
2301
|
-
// @ts-expect-error intentional use of internal API
|
|
2302
|
-
return this._schemas.get(type).relationships;
|
|
2303
|
-
};
|
|
2304
|
-
}
|
|
2305
2196
|
function buildSchema(store) {
|
|
2306
2197
|
return new ModelSchemaProvider(store);
|
|
2307
2198
|
}
|