@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
|
@@ -2,11 +2,10 @@ import { Context } from '@warp-drive/core/reactive/-private';
|
|
|
2
2
|
import { memoized, defineSignal, assertPrivateStore, defineNonEnumerableSignal, isResourceKey, 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-DbaSCSym.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';
|
|
@@ -47,11 +46,11 @@ class PromiseBelongsTo extends Extended {
|
|
|
47
46
|
get meta() {
|
|
48
47
|
// eslint-disable-next-line no-constant-condition
|
|
49
48
|
{
|
|
50
|
-
|
|
49
|
+
(test => {
|
|
51
50
|
{
|
|
52
51
|
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
52
|
}
|
|
54
|
-
})()
|
|
53
|
+
})();
|
|
55
54
|
}
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
@@ -59,11 +58,11 @@ class PromiseBelongsTo extends Extended {
|
|
|
59
58
|
decorateMethodV2(this.prototype, "meta", [computed()]);
|
|
60
59
|
}
|
|
61
60
|
async reload(options) {
|
|
62
|
-
|
|
61
|
+
(test => {
|
|
63
62
|
if (!test) {
|
|
64
63
|
throw new Error('You are trying to reload an async belongsTo before it has been created');
|
|
65
64
|
}
|
|
66
|
-
})(this.content !== undefined)
|
|
65
|
+
})(this.content !== undefined);
|
|
67
66
|
const {
|
|
68
67
|
key,
|
|
69
68
|
legacySupport
|
|
@@ -105,10 +104,7 @@ class PromiseManyArray {
|
|
|
105
104
|
get length() {
|
|
106
105
|
// shouldn't be needed, but ends up being needed
|
|
107
106
|
// for computed chains even in 4.x
|
|
108
|
-
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
110
|
-
this['[]'];
|
|
111
|
-
}
|
|
107
|
+
|
|
112
108
|
return this.content ? this.content.length : 0;
|
|
113
109
|
}
|
|
114
110
|
|
|
@@ -152,11 +148,11 @@ class PromiseManyArray {
|
|
|
152
148
|
* @return
|
|
153
149
|
*/
|
|
154
150
|
reload(options) {
|
|
155
|
-
|
|
151
|
+
(test => {
|
|
156
152
|
if (!test) {
|
|
157
153
|
throw new Error('You are trying to reload an async manyArray before it has been created');
|
|
158
154
|
}
|
|
159
|
-
})(this.content)
|
|
155
|
+
})(this.content);
|
|
160
156
|
void this.content.reload(options);
|
|
161
157
|
return this;
|
|
162
158
|
}
|
|
@@ -313,7 +309,7 @@ function tapPromise(proxy, promise) {
|
|
|
313
309
|
`record.relationshipFor(key)`.
|
|
314
310
|
*/
|
|
315
311
|
let assertPolymorphicType;
|
|
316
|
-
|
|
312
|
+
{
|
|
317
313
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
318
314
|
assertPolymorphicType = function assertPolymorphicType(parentIdentifier, parentDefinition, addedIdentifier, store) {
|
|
319
315
|
if (parentDefinition.inverseIsImplicit) {
|
|
@@ -322,16 +318,16 @@ if (macroCondition(getGlobalConfig().WarpDrive.env.DEBUG)) {
|
|
|
322
318
|
if (parentDefinition.isPolymorphic) {
|
|
323
319
|
const meta = store.schema.fields(addedIdentifier)?.get(parentDefinition.inverseKey);
|
|
324
320
|
if (meta) {
|
|
325
|
-
|
|
321
|
+
(test => {
|
|
326
322
|
if (!test) {
|
|
327
323
|
throw new Error(`Expected the schema for the field ${parentDefinition.inverseKey} on ${addedIdentifier.type} to be for a legacy relationship`);
|
|
328
324
|
}
|
|
329
|
-
})(meta.kind === 'belongsTo' || meta.kind === 'hasMany')
|
|
330
|
-
|
|
325
|
+
})(meta.kind === 'belongsTo' || meta.kind === 'hasMany');
|
|
326
|
+
(test => {
|
|
331
327
|
if (!test) {
|
|
332
328
|
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
329
|
}
|
|
334
|
-
})(meta?.options?.as === parentDefinition.type)
|
|
330
|
+
})(meta?.options?.as === parentDefinition.type);
|
|
335
331
|
}
|
|
336
332
|
}
|
|
337
333
|
};
|
|
@@ -720,16 +716,16 @@ class HasManyReference {
|
|
|
720
716
|
const isResourceData = Array.isArray(dataDoc.data) && dataDoc.data.length > 0 && isMaybeResource(dataDoc.data[0]);
|
|
721
717
|
|
|
722
718
|
// enforce that one of links, meta or data is present
|
|
723
|
-
|
|
719
|
+
(test => {
|
|
724
720
|
if (!test) {
|
|
725
721
|
throw new Error(`You must provide at least one of 'links', 'meta' or 'data' when calling hasManyReference.push`);
|
|
726
722
|
}
|
|
727
|
-
})('links' in dataDoc || 'meta' in dataDoc || 'data' in dataDoc)
|
|
723
|
+
})('links' in dataDoc || 'meta' in dataDoc || 'data' in dataDoc);
|
|
728
724
|
const identifiers = !Array.isArray(dataDoc.data) ? [] : isResourceData ? store._push(dataDoc, true) : dataDoc.data.map(i => store.cacheKeyManager.getOrCreateRecordIdentifier(i));
|
|
729
725
|
const {
|
|
730
726
|
identifier
|
|
731
727
|
} = this.hasManyRelationship;
|
|
732
|
-
|
|
728
|
+
{
|
|
733
729
|
const relationshipMeta = this.hasManyRelationship.definition;
|
|
734
730
|
identifiers.forEach(added => {
|
|
735
731
|
assertPolymorphicType(identifier, relationshipMeta, added, store);
|
|
@@ -932,11 +928,11 @@ function ensureRefCanSubscribe(rel) {
|
|
|
932
928
|
// we force accessed to be true here. When we make the graph public we should create a
|
|
933
929
|
// subscribe/unsubscribe API
|
|
934
930
|
const edge = rel.graph.get(rel.___identifier, rel.key);
|
|
935
|
-
|
|
931
|
+
(test => {
|
|
936
932
|
if (!test) {
|
|
937
933
|
throw new Error(`Expected a hasMany relationship for ${rel.___identifier.type}:${rel.key}`);
|
|
938
934
|
}
|
|
939
|
-
})('accessed' in edge)
|
|
935
|
+
})('accessed' in edge);
|
|
940
936
|
edge.accessed = true;
|
|
941
937
|
return false;
|
|
942
938
|
}
|
|
@@ -1316,7 +1312,7 @@ class BelongsToReference {
|
|
|
1316
1312
|
const {
|
|
1317
1313
|
identifier
|
|
1318
1314
|
} = this.belongsToRelationship;
|
|
1319
|
-
|
|
1315
|
+
{
|
|
1320
1316
|
if (added) {
|
|
1321
1317
|
assertPolymorphicType(identifier, this.belongsToRelationship.definition, added, store);
|
|
1322
1318
|
}
|
|
@@ -1500,18 +1496,18 @@ defineNonEnumerableSignal(BelongsToReference.prototype, '_ref', 0);
|
|
|
1500
1496
|
const LEGACY_SUPPORT = getOrSetGlobal('LEGACY_SUPPORT', new Map());
|
|
1501
1497
|
function lookupLegacySupport(record) {
|
|
1502
1498
|
const identifier = recordIdentifierFor(record);
|
|
1503
|
-
|
|
1499
|
+
(test => {
|
|
1504
1500
|
if (!test) {
|
|
1505
1501
|
throw new Error(`Expected a record`);
|
|
1506
1502
|
}
|
|
1507
|
-
})(identifier)
|
|
1503
|
+
})(identifier);
|
|
1508
1504
|
let support = LEGACY_SUPPORT.get(identifier);
|
|
1509
1505
|
if (!support) {
|
|
1510
|
-
|
|
1506
|
+
(test => {
|
|
1511
1507
|
if (!test) {
|
|
1512
1508
|
throw new Error(`Memory Leak Detected`);
|
|
1513
1509
|
}
|
|
1514
|
-
})(!record.isDestroyed && !record.isDestroying)
|
|
1510
|
+
})(!record.isDestroyed && !record.isDestroying);
|
|
1515
1511
|
support = new LegacySupport(record, identifier);
|
|
1516
1512
|
LEGACY_SUPPORT.set(identifier, support);
|
|
1517
1513
|
}
|
|
@@ -1595,11 +1591,11 @@ class LegacySupport {
|
|
|
1595
1591
|
const name = getRealFieldName(this, key);
|
|
1596
1592
|
const resource = this.store.cache.getRelationship(this.identifier, name);
|
|
1597
1593
|
const relationship = this.graph.get(this.identifier, name);
|
|
1598
|
-
|
|
1594
|
+
(test => {
|
|
1599
1595
|
if (!test) {
|
|
1600
1596
|
throw new Error(`Expected ${key === name ? name : `${key} (source: ${name})`} to be a belongs-to relationship`);
|
|
1601
1597
|
}
|
|
1602
|
-
})(isBelongsTo(relationship))
|
|
1598
|
+
})(isBelongsTo(relationship));
|
|
1603
1599
|
relationship.state.hasFailedLoadAttempt = false;
|
|
1604
1600
|
relationship.state.shouldForceReload = true;
|
|
1605
1601
|
const promise = this._findBelongsTo(name, resource, relationship, options);
|
|
@@ -1618,18 +1614,18 @@ class LegacySupport {
|
|
|
1618
1614
|
const name = getRealFieldName(this, key);
|
|
1619
1615
|
const resource = this.store.cache.getRelationship(this.identifier, name);
|
|
1620
1616
|
const relatedIdentifier = resource && resource.data ? resource.data : null;
|
|
1621
|
-
|
|
1617
|
+
(test => {
|
|
1622
1618
|
if (!test) {
|
|
1623
1619
|
throw new Error(`Expected a stable identifier`);
|
|
1624
1620
|
}
|
|
1625
|
-
})(!relatedIdentifier || isResourceKey(relatedIdentifier))
|
|
1621
|
+
})(!relatedIdentifier || isResourceKey(relatedIdentifier));
|
|
1626
1622
|
const store = this.store;
|
|
1627
1623
|
const relationship = this.graph.get(this.identifier, name);
|
|
1628
|
-
|
|
1624
|
+
(test => {
|
|
1629
1625
|
if (!test) {
|
|
1630
1626
|
throw new Error(`Expected ${key === name ? name : `${key} (source: ${name})`} to be a belongs-to relationship`);
|
|
1631
1627
|
}
|
|
1632
|
-
})(isBelongsTo(relationship))
|
|
1628
|
+
})(isBelongsTo(relationship));
|
|
1633
1629
|
const isAsync = relationship.definition.isAsync;
|
|
1634
1630
|
const _belongsToState = {
|
|
1635
1631
|
key,
|
|
@@ -1652,11 +1648,11 @@ class LegacySupport {
|
|
|
1652
1648
|
if (relatedIdentifier === null) {
|
|
1653
1649
|
return null;
|
|
1654
1650
|
} else {
|
|
1655
|
-
|
|
1651
|
+
(test => {
|
|
1656
1652
|
if (!test) {
|
|
1657
1653
|
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
1654
|
}
|
|
1659
|
-
})(store._instanceCache.recordIsLoaded(relatedIdentifier, true))
|
|
1655
|
+
})(store._instanceCache.recordIsLoaded(relatedIdentifier, true));
|
|
1660
1656
|
return store._instanceCache.getRecord(relatedIdentifier);
|
|
1661
1657
|
}
|
|
1662
1658
|
}
|
|
@@ -1679,11 +1675,11 @@ class LegacySupport {
|
|
|
1679
1675
|
if (jsonApi.data) {
|
|
1680
1676
|
for (let i = 0; i < jsonApi.data.length; i++) {
|
|
1681
1677
|
const relatedIdentifier = jsonApi.data[i];
|
|
1682
|
-
|
|
1678
|
+
(test => {
|
|
1683
1679
|
if (!test) {
|
|
1684
1680
|
throw new Error(`Expected a stable identifier`);
|
|
1685
1681
|
}
|
|
1686
|
-
})(isResourceKey(relatedIdentifier))
|
|
1682
|
+
})(isResourceKey(relatedIdentifier));
|
|
1687
1683
|
if (cache.recordIsLoaded(relatedIdentifier, true)) {
|
|
1688
1684
|
identifiers.push(relatedIdentifier);
|
|
1689
1685
|
}
|
|
@@ -1720,11 +1716,11 @@ class LegacySupport {
|
|
|
1720
1716
|
}
|
|
1721
1717
|
return manyArray;
|
|
1722
1718
|
}
|
|
1723
|
-
|
|
1719
|
+
(test => {
|
|
1724
1720
|
{
|
|
1725
1721
|
throw new Error('hasMany only works with the JSONAPICache');
|
|
1726
1722
|
}
|
|
1727
|
-
})()
|
|
1723
|
+
})();
|
|
1728
1724
|
}
|
|
1729
1725
|
fetchAsyncHasMany(key, relationship, manyArray, options) {
|
|
1730
1726
|
const name = getRealFieldName(this, key);
|
|
@@ -1743,11 +1739,11 @@ class LegacySupport {
|
|
|
1743
1739
|
this._relationshipPromisesCache[name] = loadingPromise;
|
|
1744
1740
|
return loadingPromise;
|
|
1745
1741
|
}
|
|
1746
|
-
|
|
1742
|
+
(test => {
|
|
1747
1743
|
{
|
|
1748
1744
|
throw new Error('hasMany only works with the JSONAPICache');
|
|
1749
1745
|
}
|
|
1750
|
-
})()
|
|
1746
|
+
})();
|
|
1751
1747
|
}
|
|
1752
1748
|
reloadHasMany(key, options) {
|
|
1753
1749
|
const name = getRealFieldName(this, key);
|
|
@@ -1772,11 +1768,11 @@ class LegacySupport {
|
|
|
1772
1768
|
}
|
|
1773
1769
|
return promise;
|
|
1774
1770
|
}
|
|
1775
|
-
|
|
1771
|
+
(test => {
|
|
1776
1772
|
{
|
|
1777
1773
|
throw new Error(`hasMany only works with the JSONAPICache`);
|
|
1778
1774
|
}
|
|
1779
|
-
})()
|
|
1775
|
+
})();
|
|
1780
1776
|
}
|
|
1781
1777
|
getHasMany(key, options) {
|
|
1782
1778
|
const name = getRealFieldName(this, key);
|
|
@@ -1797,19 +1793,19 @@ class LegacySupport {
|
|
|
1797
1793
|
content: manyArray
|
|
1798
1794
|
});
|
|
1799
1795
|
} else {
|
|
1800
|
-
|
|
1796
|
+
(test => {
|
|
1801
1797
|
if (!test) {
|
|
1802
1798
|
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
1799
|
}
|
|
1804
|
-
})(!anyUnloaded(this.store, relationship))
|
|
1800
|
+
})(!anyUnloaded(this.store, relationship));
|
|
1805
1801
|
return manyArray;
|
|
1806
1802
|
}
|
|
1807
1803
|
}
|
|
1808
|
-
|
|
1804
|
+
(test => {
|
|
1809
1805
|
{
|
|
1810
1806
|
throw new Error(`hasMany only works with the JSONAPICache`);
|
|
1811
1807
|
}
|
|
1812
|
-
})()
|
|
1808
|
+
})();
|
|
1813
1809
|
}
|
|
1814
1810
|
_updatePromiseProxyFor(kind, key, args) {
|
|
1815
1811
|
let promiseProxy = this._relationshipProxyCache[key];
|
|
@@ -1819,11 +1815,11 @@ class LegacySupport {
|
|
|
1819
1815
|
content
|
|
1820
1816
|
} = args;
|
|
1821
1817
|
if (promiseProxy) {
|
|
1822
|
-
|
|
1818
|
+
(test => {
|
|
1823
1819
|
if (!test) {
|
|
1824
1820
|
throw new Error(`Expected a PromiseManyArray`);
|
|
1825
1821
|
}
|
|
1826
|
-
})('_update' in promiseProxy)
|
|
1822
|
+
})('_update' in promiseProxy);
|
|
1827
1823
|
promiseProxy._update(promise, content);
|
|
1828
1824
|
} else {
|
|
1829
1825
|
promiseProxy = this._relationshipProxyCache[key] = new PromiseManyArray(promise, content);
|
|
@@ -1835,11 +1831,11 @@ class LegacySupport {
|
|
|
1835
1831
|
promise,
|
|
1836
1832
|
content
|
|
1837
1833
|
} = args;
|
|
1838
|
-
|
|
1834
|
+
(test => {
|
|
1839
1835
|
if (!test) {
|
|
1840
1836
|
throw new Error(`Expected a PromiseBelongsTo`);
|
|
1841
1837
|
}
|
|
1842
|
-
})('_belongsToState' in promiseProxy)
|
|
1838
|
+
})('_belongsToState' in promiseProxy);
|
|
1843
1839
|
if (content !== undefined) {
|
|
1844
1840
|
promiseProxy.set('content', content);
|
|
1845
1841
|
}
|
|
@@ -1858,26 +1854,26 @@ class LegacySupport {
|
|
|
1858
1854
|
// TODO @runspired while this feels odd, it is not a regression in capability because we do
|
|
1859
1855
|
// not today support references pulling from RecordDatas other than our own
|
|
1860
1856
|
// because of the intimate API access involved. This is something we will need to redesign.
|
|
1861
|
-
|
|
1857
|
+
(test => {
|
|
1862
1858
|
{
|
|
1863
1859
|
throw new Error(`snapshot.belongsTo only supported when using the JSONAPICache`);
|
|
1864
1860
|
}
|
|
1865
|
-
})()
|
|
1861
|
+
})();
|
|
1866
1862
|
}
|
|
1867
1863
|
const {
|
|
1868
1864
|
graph,
|
|
1869
1865
|
identifier
|
|
1870
1866
|
} = this;
|
|
1871
1867
|
const relationship = graph.get(identifier, name);
|
|
1872
|
-
|
|
1868
|
+
{
|
|
1873
1869
|
if (kind) {
|
|
1874
1870
|
const modelName = identifier.type;
|
|
1875
1871
|
const actualRelationshipKind = relationship.definition.kind;
|
|
1876
|
-
|
|
1872
|
+
(test => {
|
|
1877
1873
|
if (!test) {
|
|
1878
1874
|
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
1875
|
}
|
|
1880
|
-
})(actualRelationshipKind === kind)
|
|
1876
|
+
})(actualRelationshipKind === kind);
|
|
1881
1877
|
}
|
|
1882
1878
|
}
|
|
1883
1879
|
const relationshipKind = relationship.definition.kind;
|
|
@@ -1914,11 +1910,11 @@ class LegacySupport {
|
|
|
1914
1910
|
const field = this.store.schema.fields({
|
|
1915
1911
|
type: definition.inverseType
|
|
1916
1912
|
}).get(definition.key);
|
|
1917
|
-
|
|
1913
|
+
(test => {
|
|
1918
1914
|
if (!test) {
|
|
1919
1915
|
throw new Error(`Expected a hasMany field definition for ${definition.inverseType}.${definition.key}`);
|
|
1920
1916
|
}
|
|
1921
|
-
})(field && field.kind === 'hasMany')
|
|
1917
|
+
})(field && field.kind === 'hasMany');
|
|
1922
1918
|
const request = {
|
|
1923
1919
|
useLink: shouldFindViaLink,
|
|
1924
1920
|
field,
|
|
@@ -1930,16 +1926,16 @@ class LegacySupport {
|
|
|
1930
1926
|
|
|
1931
1927
|
// fetch via link
|
|
1932
1928
|
if (shouldFindViaLink) {
|
|
1933
|
-
|
|
1929
|
+
(test => {
|
|
1934
1930
|
if (!test) {
|
|
1935
1931
|
throw new Error(`Expected collection to be an array`);
|
|
1936
1932
|
}
|
|
1937
|
-
})(!identifiers || Array.isArray(identifiers))
|
|
1938
|
-
|
|
1933
|
+
})(!identifiers || Array.isArray(identifiers));
|
|
1934
|
+
(test => {
|
|
1939
1935
|
if (!test) {
|
|
1940
1936
|
throw new Error(`Expected stable identifiers`);
|
|
1941
1937
|
}
|
|
1942
|
-
})(!identifiers || identifiers.every(isResourceKey))
|
|
1938
|
+
})(!identifiers || identifiers.every(isResourceKey));
|
|
1943
1939
|
const req = field.options.linksMode ? {
|
|
1944
1940
|
url: getRelatedLink(resource),
|
|
1945
1941
|
op: 'findHasMany',
|
|
@@ -1965,16 +1961,16 @@ class LegacySupport {
|
|
|
1965
1961
|
}
|
|
1966
1962
|
const hasData = hasReceivedData && !isEmpty;
|
|
1967
1963
|
if (attemptLocalCache || hasData || hasLocalPartialData) {
|
|
1968
|
-
|
|
1964
|
+
(test => {
|
|
1969
1965
|
if (!test) {
|
|
1970
1966
|
throw new Error(`Expected collection to be an array`);
|
|
1971
1967
|
}
|
|
1972
|
-
})(Array.isArray(identifiers))
|
|
1973
|
-
|
|
1968
|
+
})(Array.isArray(identifiers));
|
|
1969
|
+
(test => {
|
|
1974
1970
|
if (!test) {
|
|
1975
1971
|
throw new Error(`Expected stable identifiers`);
|
|
1976
1972
|
}
|
|
1977
|
-
})(identifiers.every(isResourceKey))
|
|
1973
|
+
})(identifiers.every(isResourceKey));
|
|
1978
1974
|
options.reload = options.reload || !attemptLocalCache || undefined;
|
|
1979
1975
|
return this.store.request({
|
|
1980
1976
|
op: 'findHasMany',
|
|
@@ -1990,11 +1986,11 @@ class LegacySupport {
|
|
|
1990
1986
|
// TODO if the relationshipIsStale, should we hit the adapter anyway?
|
|
1991
1987
|
return;
|
|
1992
1988
|
}
|
|
1993
|
-
|
|
1989
|
+
(test => {
|
|
1994
1990
|
{
|
|
1995
1991
|
throw new Error(`hasMany only works with the JSONAPICache`);
|
|
1996
1992
|
}
|
|
1997
|
-
})()
|
|
1993
|
+
})();
|
|
1998
1994
|
}
|
|
1999
1995
|
_findBelongsToByJsonApiResource(resource, parentIdentifier, relationship, options = {}) {
|
|
2000
1996
|
if (!resource) {
|
|
@@ -2010,11 +2006,11 @@ class LegacySupport {
|
|
|
2010
2006
|
return this._pending[name];
|
|
2011
2007
|
}
|
|
2012
2008
|
const identifier = resource.data ? resource.data : null;
|
|
2013
|
-
|
|
2009
|
+
(test => {
|
|
2014
2010
|
if (!test) {
|
|
2015
2011
|
throw new Error(`Expected a stable identifier`);
|
|
2016
2012
|
}
|
|
2017
|
-
})(!identifier || isResourceKey(identifier))
|
|
2013
|
+
})(!identifier || isResourceKey(identifier));
|
|
2018
2014
|
const {
|
|
2019
2015
|
isStale,
|
|
2020
2016
|
hasDematerializedInverse,
|
|
@@ -2025,11 +2021,11 @@ class LegacySupport {
|
|
|
2025
2021
|
const allInverseRecordsAreLoaded = areAllInverseRecordsLoaded(this.store, resource);
|
|
2026
2022
|
const shouldFindViaLink = resource.links?.related && (shouldForceReload || hasDematerializedInverse || isStale || !allInverseRecordsAreLoaded && !isEmpty);
|
|
2027
2023
|
const field = this.store.schema.fields(this.identifier).get(relationship.definition.key);
|
|
2028
|
-
|
|
2024
|
+
(test => {
|
|
2029
2025
|
if (!test) {
|
|
2030
2026
|
throw new Error(`Attempted to access a belongsTo relationship but no definition exists for it`);
|
|
2031
2027
|
}
|
|
2032
|
-
})(field && field.kind === 'belongsTo')
|
|
2028
|
+
})(field && field.kind === 'belongsTo');
|
|
2033
2029
|
const request = {
|
|
2034
2030
|
useLink: shouldFindViaLink,
|
|
2035
2031
|
field,
|
|
@@ -2081,11 +2077,11 @@ class LegacySupport {
|
|
|
2081
2077
|
|
|
2082
2078
|
// we may need to fetch
|
|
2083
2079
|
if (identifier) {
|
|
2084
|
-
|
|
2080
|
+
(test => {
|
|
2085
2081
|
if (!test) {
|
|
2086
2082
|
throw new Error(`Cannot fetch belongs-to relationship with no information`);
|
|
2087
2083
|
}
|
|
2088
|
-
})(identifier)
|
|
2084
|
+
})(identifier);
|
|
2089
2085
|
options.reload = options.reload || !attemptLocalCache || undefined;
|
|
2090
2086
|
this._pending[name] = this.store.request({
|
|
2091
2087
|
op: 'findBelongsTo',
|
|
@@ -2129,11 +2125,11 @@ class LegacySupport {
|
|
|
2129
2125
|
}
|
|
2130
2126
|
function getRelatedLink(resource) {
|
|
2131
2127
|
const related = resource.links?.related;
|
|
2132
|
-
|
|
2128
|
+
(test => {
|
|
2133
2129
|
if (!test) {
|
|
2134
2130
|
throw new Error(`Expected a related link`);
|
|
2135
2131
|
}
|
|
2136
|
-
})(related)
|
|
2132
|
+
})(related);
|
|
2137
2133
|
return typeof related === 'object' ? related.href : related;
|
|
2138
2134
|
}
|
|
2139
2135
|
function handleCompletedRelationshipRequest(recordExt, key, relationship, value, error) {
|
|
@@ -2183,11 +2179,11 @@ function extractIdentifierFromRecord(record) {
|
|
|
2183
2179
|
function anyUnloaded(store, relationship) {
|
|
2184
2180
|
assertPrivateStore(store);
|
|
2185
2181
|
const graph = store._graph;
|
|
2186
|
-
|
|
2182
|
+
(test => {
|
|
2187
2183
|
if (!test) {
|
|
2188
2184
|
throw new Error(`Expected a Graph instance to be available`);
|
|
2189
2185
|
}
|
|
2190
|
-
})(graph)
|
|
2186
|
+
})(graph);
|
|
2191
2187
|
const relationshipData = graph.getData(relationship.identifier, relationship.definition.key);
|
|
2192
2188
|
const state = relationshipData.data;
|
|
2193
2189
|
const cache = store._instanceCache;
|
|
@@ -2202,11 +2198,11 @@ function areAllInverseRecordsLoaded(store, resource) {
|
|
|
2202
2198
|
const instanceCache = store._instanceCache;
|
|
2203
2199
|
const identifiers = resource.data;
|
|
2204
2200
|
if (Array.isArray(identifiers)) {
|
|
2205
|
-
|
|
2201
|
+
(test => {
|
|
2206
2202
|
if (!test) {
|
|
2207
2203
|
throw new Error(`Expected stable identifiers`);
|
|
2208
2204
|
}
|
|
2209
|
-
})(identifiers.every(isResourceKey))
|
|
2205
|
+
})(identifiers.every(isResourceKey));
|
|
2210
2206
|
// treat as collection
|
|
2211
2207
|
// check for unloaded records
|
|
2212
2208
|
return identifiers.every(identifier => instanceCache.recordIsLoaded(identifier));
|
|
@@ -2214,11 +2210,11 @@ function areAllInverseRecordsLoaded(store, resource) {
|
|
|
2214
2210
|
|
|
2215
2211
|
// treat as single resource
|
|
2216
2212
|
if (!identifiers) return true;
|
|
2217
|
-
|
|
2213
|
+
(test => {
|
|
2218
2214
|
if (!test) {
|
|
2219
2215
|
throw new Error(`Expected stable identifiers`);
|
|
2220
2216
|
}
|
|
2221
|
-
})(isResourceKey(identifiers))
|
|
2217
|
+
})(isResourceKey(identifiers));
|
|
2222
2218
|
return instanceCache.recordIsLoaded(identifiers);
|
|
2223
2219
|
}
|
|
2224
2220
|
function isBelongsTo(relationship) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { setOwner, getOwner } from '@ember/application';
|
|
2
2
|
import { assertPrivateStore, setRecordIdentifier, StoreMap } from '@warp-drive/core/store/-private';
|
|
3
|
-
import { g as getModelFactory } from "./schema-provider-
|
|
4
|
-
import { n as normalizeModelName } from "./util-
|
|
5
|
-
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
3
|
+
import { g as getModelFactory } from "./schema-provider-B8jiJOYC.js";
|
|
4
|
+
import { n as normalizeModelName } from "./util-DvanW33H.js";
|
|
6
5
|
function instantiateRecord(identifier, createRecordArgs) {
|
|
7
6
|
const type = identifier.type;
|
|
8
7
|
|
|
@@ -20,38 +19,38 @@ function instantiateRecord(identifier, createRecordArgs) {
|
|
|
20
19
|
// ensure that `getOwner(this)` works inside a model instance
|
|
21
20
|
setOwner(createOptions, getOwner(this));
|
|
22
21
|
const factory = getModelFactory(this, type);
|
|
23
|
-
|
|
22
|
+
(test => {
|
|
24
23
|
if (!test) {
|
|
25
24
|
throw new Error(`No model was found for '${type}'`);
|
|
26
25
|
}
|
|
27
|
-
})(factory)
|
|
26
|
+
})(factory);
|
|
28
27
|
return factory.class.create(createOptions);
|
|
29
28
|
}
|
|
30
29
|
function teardownRecord(record) {
|
|
31
|
-
|
|
30
|
+
(test => {
|
|
32
31
|
if (!test) {
|
|
33
32
|
throw new Error(`expected to receive an instance of Model from @ember-data/model. If using a custom model make sure you implement teardownRecord`);
|
|
34
33
|
}
|
|
35
|
-
})('destroy' in record)
|
|
34
|
+
})('destroy' in record);
|
|
36
35
|
record.destroy();
|
|
37
36
|
}
|
|
38
37
|
function modelFor(modelName) {
|
|
39
38
|
assertPrivateStore(this);
|
|
40
|
-
|
|
39
|
+
(test => {
|
|
41
40
|
if (!test) {
|
|
42
41
|
throw new Error(`Attempted to call store.modelFor(), but the store instance has already been destroyed.`);
|
|
43
42
|
}
|
|
44
|
-
})(!this.isDestroyed && !this.isDestroying)
|
|
45
|
-
|
|
43
|
+
})(!this.isDestroyed && !this.isDestroying);
|
|
44
|
+
(test => {
|
|
46
45
|
if (!test) {
|
|
47
46
|
throw new Error(`You need to pass a model name to the store's modelFor method`);
|
|
48
47
|
}
|
|
49
|
-
})(modelName)
|
|
50
|
-
|
|
48
|
+
})(modelName);
|
|
49
|
+
(test => {
|
|
51
50
|
if (!test) {
|
|
52
51
|
throw new Error(`Please pass a proper model name to the store's modelFor method`);
|
|
53
52
|
}
|
|
54
|
-
})(typeof modelName === 'string' && modelName.length)
|
|
53
|
+
})(typeof modelName === 'string' && modelName.length);
|
|
55
54
|
const type = normalizeModelName(modelName);
|
|
56
55
|
const maybeFactory = getModelFactory(this, type);
|
|
57
56
|
const klass = maybeFactory && maybeFactory.class ? maybeFactory.class : null;
|
|
@@ -59,13 +58,13 @@ function modelFor(modelName) {
|
|
|
59
58
|
if (!ignoreType) {
|
|
60
59
|
return klass;
|
|
61
60
|
}
|
|
62
|
-
|
|
61
|
+
(test => {
|
|
63
62
|
if (!test) {
|
|
64
63
|
throw new Error(`No model was found for '${type}' and no schema handles the type`);
|
|
65
64
|
}
|
|
66
65
|
})(this.schema.hasResource({
|
|
67
66
|
type
|
|
68
|
-
}))
|
|
67
|
+
}));
|
|
69
68
|
}
|
|
70
69
|
function secretInit(record, identifier, store) {
|
|
71
70
|
setRecordIdentifier(record, identifier);
|