@warp-drive/legacy 5.8.0-alpha.30 → 5.8.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/adapter/error.d.ts +5 -5
- package/declarations/adapter/json-api.d.ts +2 -2
- package/declarations/compat/builders/find-all.d.ts +6 -6
- package/declarations/compat/builders/find-record.d.ts +8 -8
- package/declarations/compat/builders/query.d.ts +12 -12
- package/declarations/compat.d.ts +3 -3
- package/declarations/model/-private/references/belongs-to.d.ts +4 -4
- package/declarations/model/-private/references/has-many.d.ts +2 -2
- package/declarations/model/migration-support.d.ts +34 -18
- package/declarations/model.d.ts +2 -2
- package/declarations/serializer/-private/embedded-records-mixin.d.ts +1 -1
- package/declarations/serializer/json-api.d.ts +3 -3
- package/declarations/serializer/json.d.ts +1 -1
- package/declarations/serializer.d.ts +1 -1
- package/dist/adapter/error.js +7 -7
- package/dist/compat/builders.js +26 -26
- package/dist/compat/utils.js +0 -1
- package/dist/compat.js +3 -3
- package/dist/{errors-B9CDPh3R.js → errors-CIGPcDvd.js} +12 -12
- package/dist/{hooks-CQXyievu.js → hooks-QqRnX108.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/{json-BHxlccxF.js → json-BNrV8EYG.js} +4 -4
- package/dist/model/-private.js +1 -1
- package/dist/model/migration-support.js +41 -24
- package/dist/{model-for-B0TSd9HU.js → model-for-CqXsIKws.js} +1 -1
- package/dist/model-fragments.js +2 -2
- package/dist/model.js +3 -3
- package/dist/{schema-provider-BnVr_CnJ.js → schema-provider-g5MfTj8n.js} +11 -11
- package/dist/serializer/json-api.js +7 -7
- package/dist/serializer/json.js +1 -1
- package/dist/serializer/rest.js +10 -10
- package/dist/serializer.js +1 -1
- package/dist/unpkg/dev/-private-B1pSSN52.js +1210 -0
- package/dist/unpkg/dev/adapter/-private.js +1 -0
- package/dist/unpkg/dev/adapter/error.js +336 -0
- package/dist/unpkg/dev/adapter/json-api.js +132 -0
- package/dist/unpkg/dev/adapter/rest.js +1257 -0
- package/dist/unpkg/dev/adapter.js +1253 -0
- package/dist/unpkg/dev/compat/-private.js +1 -0
- package/dist/unpkg/dev/compat/builders.js +273 -0
- package/dist/unpkg/dev/compat/extensions.js +243 -0
- package/dist/unpkg/dev/compat/utils.js +224 -0
- package/dist/unpkg/dev/compat.js +1020 -0
- package/dist/unpkg/dev/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
- package/dist/unpkg/dev/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
- package/dist/unpkg/dev/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
- package/dist/unpkg/dev/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
- package/dist/unpkg/dev/declarations/adapter/-private/utils/fetch.d.ts +8 -0
- package/dist/unpkg/dev/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
- package/dist/unpkg/dev/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
- package/dist/unpkg/dev/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
- package/dist/unpkg/dev/declarations/adapter/-private.d.ts +5 -0
- package/dist/unpkg/dev/declarations/adapter/error.d.ts +215 -0
- package/dist/unpkg/dev/declarations/adapter/json-api.d.ts +231 -0
- package/dist/unpkg/dev/declarations/adapter/rest.d.ts +815 -0
- package/dist/unpkg/dev/declarations/adapter.d.ts +770 -0
- package/dist/unpkg/dev/declarations/compat/-private.d.ts +13 -0
- package/dist/unpkg/dev/declarations/compat/builders/find-all.d.ts +35 -0
- package/dist/unpkg/dev/declarations/compat/builders/find-record.d.ts +56 -0
- package/dist/unpkg/dev/declarations/compat/builders/query.d.ts +66 -0
- package/dist/unpkg/dev/declarations/compat/builders/save-record.d.ts +34 -0
- package/dist/unpkg/dev/declarations/compat/builders/utils.d.ts +3 -0
- package/dist/unpkg/dev/declarations/compat/builders.d.ts +14 -0
- package/dist/unpkg/dev/declarations/compat/extensions.d.ts +59 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
- package/dist/unpkg/dev/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
- package/dist/unpkg/dev/declarations/compat/utils.d.ts +137 -0
- package/dist/unpkg/dev/declarations/compat.d.ts +157 -0
- package/dist/unpkg/dev/declarations/index.d.ts +70 -0
- package/dist/unpkg/dev/declarations/model/-private/attr.d.ts +170 -0
- package/dist/unpkg/dev/declarations/model/-private/belongs-to.d.ts +174 -0
- package/dist/unpkg/dev/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
- package/dist/unpkg/dev/declarations/model/-private/errors.d.ts +289 -0
- package/dist/unpkg/dev/declarations/model/-private/has-many.d.ts +162 -0
- package/dist/unpkg/dev/declarations/model/-private/hooks.d.ts +10 -0
- package/dist/unpkg/dev/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
- package/dist/unpkg/dev/declarations/model/-private/model-for-mixin.d.ts +3 -0
- package/dist/unpkg/dev/declarations/model/-private/model-methods.d.ts +39 -0
- package/dist/unpkg/dev/declarations/model/-private/model.d.ts +1269 -0
- package/dist/unpkg/dev/declarations/model/-private/notify-changes.d.ts +4 -0
- package/dist/unpkg/dev/declarations/model/-private/promise-belongs-to.d.ts +40 -0
- package/dist/unpkg/dev/declarations/model/-private/promise-many-array.d.ts +124 -0
- package/dist/unpkg/dev/declarations/model/-private/record-state.d.ts +58 -0
- package/dist/unpkg/dev/declarations/model/-private/references/belongs-to.d.ts +498 -0
- package/dist/unpkg/dev/declarations/model/-private/references/has-many.d.ts +500 -0
- package/dist/unpkg/dev/declarations/model/-private/schema-provider.d.ts +56 -0
- package/dist/unpkg/dev/declarations/model/-private/type-utils.d.ts +57 -0
- package/dist/unpkg/dev/declarations/model/-private/util.d.ts +5 -0
- package/dist/unpkg/dev/declarations/model/-private.d.ts +8 -0
- package/dist/unpkg/dev/declarations/model/migration-support.d.ts +280 -0
- package/dist/unpkg/dev/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
- package/dist/unpkg/dev/declarations/model-fragments/extensions/fragment.d.ts +15 -0
- package/dist/unpkg/dev/declarations/model-fragments/hooks/model-for.d.ts +20 -0
- package/dist/unpkg/dev/declarations/model-fragments/index.d.ts +5 -0
- package/dist/unpkg/dev/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
- package/dist/unpkg/dev/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
- package/dist/unpkg/dev/declarations/model-fragments.d.ts +9 -0
- package/dist/unpkg/dev/declarations/model.d.ts +49 -0
- package/dist/unpkg/dev/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/date.d.ts +28 -0
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/number.d.ts +29 -0
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/string.d.ts +29 -0
- package/dist/unpkg/dev/declarations/serializer/-private/transforms/transform.d.ts +118 -0
- package/dist/unpkg/dev/declarations/serializer/-private/utils.d.ts +3 -0
- package/dist/unpkg/dev/declarations/serializer/json-api.d.ts +123 -0
- package/dist/unpkg/dev/declarations/serializer/json.d.ts +75 -0
- package/dist/unpkg/dev/declarations/serializer/rest.d.ts +51 -0
- package/dist/unpkg/dev/declarations/serializer/transform.d.ts +5 -0
- package/dist/unpkg/dev/declarations/serializer.d.ts +254 -0
- package/dist/unpkg/dev/declarations/store/-private.d.ts +223 -0
- package/dist/unpkg/dev/declarations/store.d.ts +3 -0
- package/dist/unpkg/dev/errors-CIGPcDvd.js +2595 -0
- package/dist/unpkg/dev/hooks-QqRnX108.js +74 -0
- package/dist/unpkg/dev/index.js +195 -0
- package/dist/unpkg/dev/json-BNrV8EYG.js +1272 -0
- package/dist/unpkg/dev/model/-private.js +1 -0
- package/dist/unpkg/dev/model/migration-support.js +579 -0
- package/dist/unpkg/dev/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/dev/model-fragments.js +76 -0
- package/dist/unpkg/dev/model.js +667 -0
- package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/dev/schema-provider-g5MfTj8n.js +2338 -0
- package/dist/unpkg/dev/serialize-into-hash-BnYvPex3.js +261 -0
- package/dist/unpkg/dev/serializer/json-api.js +527 -0
- package/dist/unpkg/dev/serializer/json.js +6 -0
- package/dist/unpkg/dev/serializer/rest.js +1243 -0
- package/dist/unpkg/dev/serializer/transform.js +278 -0
- package/dist/unpkg/dev/serializer.js +248 -0
- package/dist/unpkg/dev/store.js +636 -0
- package/dist/unpkg/dev/util-Dul6TZts.js +35 -0
- package/dist/unpkg/dev/utils-Cqw9eRj5.js +23 -0
- package/dist/unpkg/dev-deprecated/-private-B1pSSN52.js +1210 -0
- package/dist/unpkg/dev-deprecated/adapter/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/adapter/error.js +336 -0
- package/dist/unpkg/dev-deprecated/adapter/json-api.js +132 -0
- package/dist/unpkg/dev-deprecated/adapter/rest.js +1257 -0
- package/dist/unpkg/dev-deprecated/adapter.js +1253 -0
- package/dist/unpkg/dev-deprecated/compat/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/compat/builders.js +273 -0
- package/dist/unpkg/dev-deprecated/compat/extensions.js +243 -0
- package/dist/unpkg/dev-deprecated/compat/utils.js +224 -0
- package/dist/unpkg/dev-deprecated/compat.js +1020 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/fetch.d.ts +8 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/-private.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/error.d.ts +215 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/json-api.d.ts +231 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter/rest.d.ts +815 -0
- package/dist/unpkg/dev-deprecated/declarations/adapter.d.ts +770 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/-private.d.ts +13 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/find-all.d.ts +35 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/find-record.d.ts +56 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/query.d.ts +66 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/save-record.d.ts +34 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/builders/utils.d.ts +3 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/builders.d.ts +14 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/extensions.d.ts +59 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
- package/dist/unpkg/dev-deprecated/declarations/compat/utils.d.ts +137 -0
- package/dist/unpkg/dev-deprecated/declarations/compat.d.ts +157 -0
- package/dist/unpkg/dev-deprecated/declarations/index.d.ts +70 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/attr.d.ts +170 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/belongs-to.d.ts +174 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/errors.d.ts +289 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/has-many.d.ts +162 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/hooks.d.ts +10 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/model-for-mixin.d.ts +3 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/model-methods.d.ts +39 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/model.d.ts +1269 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/notify-changes.d.ts +4 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/promise-belongs-to.d.ts +40 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/promise-many-array.d.ts +124 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/record-state.d.ts +58 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/references/belongs-to.d.ts +498 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/references/has-many.d.ts +500 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/schema-provider.d.ts +56 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/type-utils.d.ts +57 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private/util.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/model/-private.d.ts +8 -0
- package/dist/unpkg/dev-deprecated/declarations/model/migration-support.d.ts +280 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/extensions/fragment.d.ts +15 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/hooks/model-for.d.ts +20 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/index.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
- package/dist/unpkg/dev-deprecated/declarations/model-fragments.d.ts +9 -0
- package/dist/unpkg/dev-deprecated/declarations/model.d.ts +49 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/date.d.ts +28 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/number.d.ts +29 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/string.d.ts +29 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/transforms/transform.d.ts +118 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/-private/utils.d.ts +3 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/json-api.d.ts +123 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/json.d.ts +75 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/rest.d.ts +51 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer/transform.d.ts +5 -0
- package/dist/unpkg/dev-deprecated/declarations/serializer.d.ts +254 -0
- package/dist/unpkg/dev-deprecated/declarations/store/-private.d.ts +223 -0
- package/dist/unpkg/dev-deprecated/declarations/store.d.ts +3 -0
- package/dist/unpkg/dev-deprecated/errors-CIGPcDvd.js +2595 -0
- package/dist/unpkg/dev-deprecated/hooks-QqRnX108.js +74 -0
- package/dist/unpkg/dev-deprecated/index.js +195 -0
- package/dist/unpkg/dev-deprecated/json-BNrV8EYG.js +1272 -0
- package/dist/unpkg/dev-deprecated/model/-private.js +1 -0
- package/dist/unpkg/dev-deprecated/model/migration-support.js +579 -0
- package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/dev-deprecated/model-fragments.js +76 -0
- package/dist/unpkg/dev-deprecated/model.js +667 -0
- package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/dev-deprecated/schema-provider-g5MfTj8n.js +2338 -0
- package/dist/unpkg/dev-deprecated/serialize-into-hash-BnYvPex3.js +261 -0
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +527 -0
- package/dist/unpkg/dev-deprecated/serializer/json.js +6 -0
- package/dist/unpkg/dev-deprecated/serializer/rest.js +1243 -0
- package/dist/unpkg/dev-deprecated/serializer/transform.js +278 -0
- package/dist/unpkg/dev-deprecated/serializer.js +248 -0
- package/dist/unpkg/dev-deprecated/store.js +636 -0
- package/dist/unpkg/dev-deprecated/util-Dul6TZts.js +35 -0
- package/dist/unpkg/dev-deprecated/utils-Cqw9eRj5.js +23 -0
- package/dist/unpkg/prod/-private-B1pSSN52.js +1210 -0
- package/dist/unpkg/prod/adapter/-private.js +1 -0
- package/dist/unpkg/prod/adapter/error.js +336 -0
- package/dist/unpkg/prod/adapter/json-api.js +132 -0
- package/dist/unpkg/prod/adapter/rest.js +1257 -0
- package/dist/unpkg/prod/adapter.js +1253 -0
- package/dist/unpkg/prod/compat/-private.js +1 -0
- package/dist/unpkg/prod/compat/builders.js +273 -0
- package/dist/unpkg/prod/compat/extensions.js +243 -0
- package/dist/unpkg/prod/compat/utils.js +224 -0
- package/dist/unpkg/prod/compat.js +1020 -0
- package/dist/unpkg/prod/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
- package/dist/unpkg/prod/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
- package/dist/unpkg/prod/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
- package/dist/unpkg/prod/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
- package/dist/unpkg/prod/declarations/adapter/-private/utils/fetch.d.ts +8 -0
- package/dist/unpkg/prod/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
- package/dist/unpkg/prod/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
- package/dist/unpkg/prod/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
- package/dist/unpkg/prod/declarations/adapter/-private.d.ts +5 -0
- package/dist/unpkg/prod/declarations/adapter/error.d.ts +215 -0
- package/dist/unpkg/prod/declarations/adapter/json-api.d.ts +231 -0
- package/dist/unpkg/prod/declarations/adapter/rest.d.ts +815 -0
- package/dist/unpkg/prod/declarations/adapter.d.ts +770 -0
- package/dist/unpkg/prod/declarations/compat/-private.d.ts +13 -0
- package/dist/unpkg/prod/declarations/compat/builders/find-all.d.ts +35 -0
- package/dist/unpkg/prod/declarations/compat/builders/find-record.d.ts +56 -0
- package/dist/unpkg/prod/declarations/compat/builders/query.d.ts +66 -0
- package/dist/unpkg/prod/declarations/compat/builders/save-record.d.ts +34 -0
- package/dist/unpkg/prod/declarations/compat/builders/utils.d.ts +3 -0
- package/dist/unpkg/prod/declarations/compat/builders.d.ts +14 -0
- package/dist/unpkg/prod/declarations/compat/extensions.d.ts +59 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
- package/dist/unpkg/prod/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
- package/dist/unpkg/prod/declarations/compat/utils.d.ts +137 -0
- package/dist/unpkg/prod/declarations/compat.d.ts +157 -0
- package/dist/unpkg/prod/declarations/index.d.ts +70 -0
- package/dist/unpkg/prod/declarations/model/-private/attr.d.ts +170 -0
- package/dist/unpkg/prod/declarations/model/-private/belongs-to.d.ts +174 -0
- package/dist/unpkg/prod/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
- package/dist/unpkg/prod/declarations/model/-private/errors.d.ts +289 -0
- package/dist/unpkg/prod/declarations/model/-private/has-many.d.ts +162 -0
- package/dist/unpkg/prod/declarations/model/-private/hooks.d.ts +10 -0
- package/dist/unpkg/prod/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
- package/dist/unpkg/prod/declarations/model/-private/model-for-mixin.d.ts +3 -0
- package/dist/unpkg/prod/declarations/model/-private/model-methods.d.ts +39 -0
- package/dist/unpkg/prod/declarations/model/-private/model.d.ts +1269 -0
- package/dist/unpkg/prod/declarations/model/-private/notify-changes.d.ts +4 -0
- package/dist/unpkg/prod/declarations/model/-private/promise-belongs-to.d.ts +40 -0
- package/dist/unpkg/prod/declarations/model/-private/promise-many-array.d.ts +124 -0
- package/dist/unpkg/prod/declarations/model/-private/record-state.d.ts +58 -0
- package/dist/unpkg/prod/declarations/model/-private/references/belongs-to.d.ts +498 -0
- package/dist/unpkg/prod/declarations/model/-private/references/has-many.d.ts +500 -0
- package/dist/unpkg/prod/declarations/model/-private/schema-provider.d.ts +56 -0
- package/dist/unpkg/prod/declarations/model/-private/type-utils.d.ts +57 -0
- package/dist/unpkg/prod/declarations/model/-private/util.d.ts +5 -0
- package/dist/unpkg/prod/declarations/model/-private.d.ts +8 -0
- package/dist/unpkg/prod/declarations/model/migration-support.d.ts +280 -0
- package/dist/unpkg/prod/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
- package/dist/unpkg/prod/declarations/model-fragments/extensions/fragment.d.ts +15 -0
- package/dist/unpkg/prod/declarations/model-fragments/hooks/model-for.d.ts +20 -0
- package/dist/unpkg/prod/declarations/model-fragments/index.d.ts +5 -0
- package/dist/unpkg/prod/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
- package/dist/unpkg/prod/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
- package/dist/unpkg/prod/declarations/model-fragments.d.ts +9 -0
- package/dist/unpkg/prod/declarations/model.d.ts +49 -0
- package/dist/unpkg/prod/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/date.d.ts +28 -0
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/number.d.ts +29 -0
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/string.d.ts +29 -0
- package/dist/unpkg/prod/declarations/serializer/-private/transforms/transform.d.ts +118 -0
- package/dist/unpkg/prod/declarations/serializer/-private/utils.d.ts +3 -0
- package/dist/unpkg/prod/declarations/serializer/json-api.d.ts +123 -0
- package/dist/unpkg/prod/declarations/serializer/json.d.ts +75 -0
- package/dist/unpkg/prod/declarations/serializer/rest.d.ts +51 -0
- package/dist/unpkg/prod/declarations/serializer/transform.d.ts +5 -0
- package/dist/unpkg/prod/declarations/serializer.d.ts +254 -0
- package/dist/unpkg/prod/declarations/store/-private.d.ts +223 -0
- package/dist/unpkg/prod/declarations/store.d.ts +3 -0
- package/dist/unpkg/prod/errors-CIGPcDvd.js +2595 -0
- package/dist/unpkg/prod/hooks-QqRnX108.js +74 -0
- package/dist/unpkg/prod/index.js +195 -0
- package/dist/unpkg/prod/json-BNrV8EYG.js +1272 -0
- package/dist/unpkg/prod/model/-private.js +1 -0
- package/dist/unpkg/prod/model/migration-support.js +579 -0
- package/dist/unpkg/prod/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/prod/model-fragments.js +76 -0
- package/dist/unpkg/prod/model.js +667 -0
- package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/prod/schema-provider-g5MfTj8n.js +2338 -0
- package/dist/unpkg/prod/serialize-into-hash-BnYvPex3.js +261 -0
- package/dist/unpkg/prod/serializer/json-api.js +527 -0
- package/dist/unpkg/prod/serializer/json.js +6 -0
- package/dist/unpkg/prod/serializer/rest.js +1243 -0
- package/dist/unpkg/prod/serializer/transform.js +278 -0
- package/dist/unpkg/prod/serializer.js +248 -0
- package/dist/unpkg/prod/store.js +636 -0
- package/dist/unpkg/prod/util-Dul6TZts.js +35 -0
- package/dist/unpkg/prod/utils-Cqw9eRj5.js +23 -0
- package/dist/unpkg/prod-deprecated/-private-B1pSSN52.js +1210 -0
- package/dist/unpkg/prod-deprecated/adapter/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/adapter/error.js +336 -0
- package/dist/unpkg/prod-deprecated/adapter/json-api.js +132 -0
- package/dist/unpkg/prod-deprecated/adapter/rest.js +1257 -0
- package/dist/unpkg/prod-deprecated/adapter.js +1253 -0
- package/dist/unpkg/prod-deprecated/compat/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/compat/builders.js +273 -0
- package/dist/unpkg/prod-deprecated/compat/extensions.js +243 -0
- package/dist/unpkg/prod-deprecated/compat/utils.js +224 -0
- package/dist/unpkg/prod-deprecated/compat.js +1020 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/build-url-mixin.d.ts +33 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/fastboot-interface.d.ts +8 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/determine-body-promise.d.ts +4 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/fetch.d.ts +8 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts +1 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts +6 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private/utils/serialize-query-params.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/-private.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/error.d.ts +215 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/json-api.d.ts +231 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter/rest.d.ts +815 -0
- package/dist/unpkg/prod-deprecated/declarations/adapter.d.ts +770 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/-private.d.ts +13 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/find-all.d.ts +35 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/find-record.d.ts +56 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/query.d.ts +66 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/save-record.d.ts +34 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/builders/utils.d.ts +3 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/builders.d.ts +14 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/extensions.d.ts +59 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/fetch-manager.d.ts +55 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +11 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +2 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +524 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +213 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/serializer-response.d.ts +6 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +110 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/legacy-network-handler/snapshot.d.ts +255 -0
- package/dist/unpkg/prod-deprecated/declarations/compat/utils.d.ts +137 -0
- package/dist/unpkg/prod-deprecated/declarations/compat.d.ts +157 -0
- package/dist/unpkg/prod-deprecated/declarations/index.d.ts +70 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/attr.d.ts +170 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/belongs-to.d.ts +174 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/debug/assert-polymorphic-type.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/errors.d.ts +289 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/has-many.d.ts +162 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/hooks.d.ts +10 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/legacy-relationships-support.d.ts +47 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/model-for-mixin.d.ts +3 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/model-methods.d.ts +39 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/model.d.ts +1269 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/notify-changes.d.ts +4 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/promise-belongs-to.d.ts +40 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/promise-many-array.d.ts +124 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/record-state.d.ts +58 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/references/belongs-to.d.ts +498 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/references/has-many.d.ts +500 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/schema-provider.d.ts +56 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/type-utils.d.ts +57 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private/util.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/model/-private.d.ts +8 -0
- package/dist/unpkg/prod-deprecated/declarations/model/migration-support.d.ts +280 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/extensions/fragment-array.d.ts +16 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/extensions/fragment.d.ts +15 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/hooks/model-for.d.ts +20 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/index.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +9 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-array-defaults.d.ts +15 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +20 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +19 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments/utilities/with-legacy.d.ts +3 -0
- package/dist/unpkg/prod-deprecated/declarations/model-fragments.d.ts +9 -0
- package/dist/unpkg/prod-deprecated/declarations/model.d.ts +49 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/embedded-records-mixin.d.ts +91 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/boolean.d.ts +47 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/date.d.ts +28 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/number.d.ts +29 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/string.d.ts +29 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/transforms/transform.d.ts +118 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/-private/utils.d.ts +3 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/json-api.d.ts +123 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/json.d.ts +75 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/rest.d.ts +51 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer/transform.d.ts +5 -0
- package/dist/unpkg/prod-deprecated/declarations/serializer.d.ts +254 -0
- package/dist/unpkg/prod-deprecated/declarations/store/-private.d.ts +223 -0
- package/dist/unpkg/prod-deprecated/declarations/store.d.ts +3 -0
- package/dist/unpkg/prod-deprecated/errors-CIGPcDvd.js +2595 -0
- package/dist/unpkg/prod-deprecated/hooks-QqRnX108.js +74 -0
- package/dist/unpkg/prod-deprecated/index.js +195 -0
- package/dist/unpkg/prod-deprecated/json-BNrV8EYG.js +1272 -0
- package/dist/unpkg/prod-deprecated/model/-private.js +1 -0
- package/dist/unpkg/prod-deprecated/model/migration-support.js +579 -0
- package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +221 -0
- package/dist/unpkg/prod-deprecated/model-fragments.js +76 -0
- package/dist/unpkg/prod-deprecated/model.js +667 -0
- package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +65 -0
- package/dist/unpkg/prod-deprecated/schema-provider-g5MfTj8n.js +2338 -0
- package/dist/unpkg/prod-deprecated/serialize-into-hash-BnYvPex3.js +261 -0
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +527 -0
- package/dist/unpkg/prod-deprecated/serializer/json.js +6 -0
- package/dist/unpkg/prod-deprecated/serializer/rest.js +1243 -0
- package/dist/unpkg/prod-deprecated/serializer/transform.js +278 -0
- package/dist/unpkg/prod-deprecated/serializer.js +248 -0
- package/dist/unpkg/prod-deprecated/store.js +636 -0
- package/dist/unpkg/prod-deprecated/util-Dul6TZts.js +35 -0
- package/dist/unpkg/prod-deprecated/utils-Cqw9eRj5.js +23 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { E as Errors, L as LEGACY_SUPPORT, P as PromiseBelongsTo, a as PromiseManyArray, l as lookupLegacySupport } from "../errors-CIGPcDvd.js";
|
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { deprecate } from '@ember/debug';
|
|
2
|
+
import { recordIdentifierFor } from '@warp-drive/core';
|
|
3
|
+
import { Context } from '@warp-drive/core/reactive/-private';
|
|
4
|
+
import { notifyInternalSignal, assertPrivateStore } from '@warp-drive/core/store/-private';
|
|
5
|
+
import { getOrSetGlobal } from '@warp-drive/core/types/-private';
|
|
6
|
+
import { Type } from '@warp-drive/core/types/symbols';
|
|
7
|
+
import { l as lookupLegacySupport, E as Errors } from "../errors-CIGPcDvd.js";
|
|
8
|
+
import { b as buildSchema, u as unloadRecord, s as serialize, _ as _save, a as save, r as rollbackAttributes, c as _reload, d as reload, h as hasMany, e as _destroyRecord, f as destroyRecord, i as deleteRecord, R as RecordState, j as changedAttributes, k as belongsTo, l as createSnapshot } from "../schema-provider-g5MfTj8n.js";
|
|
9
|
+
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This module provides support for migrating away from @warp-drive/legacy/model
|
|
13
|
+
* to ReactiveResource from @warp-drive/core/reactive.
|
|
14
|
+
*
|
|
15
|
+
* It includes:
|
|
16
|
+
*
|
|
17
|
+
* - A `withDefaults` function to assist in creating a schema in LegacyMode
|
|
18
|
+
* - A `registerDerivations` function to register the derivations necessary to support LegacyMode
|
|
19
|
+
* - A `DelegatingSchemaService` that can be used to provide a schema service that works with both
|
|
20
|
+
* @warp-drive/legacy/model and @warp-drive/core/reactive simultaneously for migration purposes.
|
|
21
|
+
* - A `WithLegacy` type util that can be used to create a type that includes the legacy
|
|
22
|
+
* properties and methods of a record.
|
|
23
|
+
*
|
|
24
|
+
* Using LegacyMode features on a ReactiveResource *requires* the use of these derivations and schema
|
|
25
|
+
* additions. LegacyMode is not intended to be a long-term solution, but rather a stepping stone
|
|
26
|
+
* to assist in more rapidly adopting modern WarpDrive features.
|
|
27
|
+
*
|
|
28
|
+
* @module
|
|
29
|
+
*/
|
|
30
|
+
// 'isDestroying', 'isDestroyed'
|
|
31
|
+
const LegacyFields = ['_createSnapshot', 'adapterError', 'belongsTo', 'changedAttributes', 'constructor', 'currentState', 'deleteRecord', 'destroyRecord', 'dirtyType', 'errors', 'hasDirtyAttributes', 'hasMany', 'isDeleted', 'isEmpty', 'isError', 'isLoaded', 'isLoading', 'isNew', 'isSaving', 'isValid', 'reload', 'rollbackAttributes', 'save', 'serialize', 'unloadRecord'];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A Type utility that enables quickly adding type information for the fields
|
|
35
|
+
* defined by `import { withDefaults } from '@warp-drive/legacy/model/migration-support'`.
|
|
36
|
+
*
|
|
37
|
+
* Example:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { withDefaults, WithLegacy } from '@warp-drive/legacy/model/migration-support';
|
|
41
|
+
* import { Type } from '@warp-drive/core/types/symbols';
|
|
42
|
+
* import type { HasMany } from '@@warp-drive/legacy/model';
|
|
43
|
+
*
|
|
44
|
+
* export const UserSchema = withDefaults({
|
|
45
|
+
* type: 'user',
|
|
46
|
+
* fields: [
|
|
47
|
+
* { name: 'firstName', kind: 'attribute' },
|
|
48
|
+
* { name: 'lastName', kind: 'attribute' },
|
|
49
|
+
* { name: 'age', kind: 'attribute' },
|
|
50
|
+
* { name: 'friends',
|
|
51
|
+
* kind: 'hasMany',
|
|
52
|
+
* type: 'user',
|
|
53
|
+
* options: { inverse: 'friends', async: false }
|
|
54
|
+
* },
|
|
55
|
+
* { name: 'bestFriend',
|
|
56
|
+
* kind: 'belongsTo',
|
|
57
|
+
* type: 'user',
|
|
58
|
+
* options: { inverse: null, async: false }
|
|
59
|
+
* },
|
|
60
|
+
* ],
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* export type User = WithLegacy<{
|
|
64
|
+
* firstName: string;
|
|
65
|
+
* lastName: string;
|
|
66
|
+
* age: number;
|
|
67
|
+
* friends: HasMany<User>;
|
|
68
|
+
* bestFriend: User | null;
|
|
69
|
+
* [Type]: 'user';
|
|
70
|
+
* }>
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
const LegacySupport = getOrSetGlobal('LegacySupport', new WeakMap());
|
|
76
|
+
function legacySupport(record, options, prop) {
|
|
77
|
+
let state = LegacySupport.get(record);
|
|
78
|
+
if (!state) {
|
|
79
|
+
state = {};
|
|
80
|
+
LegacySupport.set(record, state);
|
|
81
|
+
}
|
|
82
|
+
const suppressDeprecation = Boolean(options && options.suppressDeprecation);
|
|
83
|
+
switch (prop) {
|
|
84
|
+
case '_createSnapshot':
|
|
85
|
+
// FIXME should be deprecated too?
|
|
86
|
+
return createSnapshot;
|
|
87
|
+
case 'adapterError':
|
|
88
|
+
// FIXME should be deprecated too?
|
|
89
|
+
return record.currentState.adapterError;
|
|
90
|
+
case 'belongsTo':
|
|
91
|
+
return belongsTo;
|
|
92
|
+
case 'changedAttributes':
|
|
93
|
+
return changedAttributes;
|
|
94
|
+
case 'constructor':
|
|
95
|
+
return state._constructor = state._constructor || {
|
|
96
|
+
isModel: true,
|
|
97
|
+
name: `Record<${recordIdentifierFor(record).type}>`,
|
|
98
|
+
modelName: recordIdentifierFor(record).type
|
|
99
|
+
};
|
|
100
|
+
case 'currentState':
|
|
101
|
+
return state.recordState = state.recordState || new RecordState(record);
|
|
102
|
+
case 'deleteRecord':
|
|
103
|
+
return deleteRecord;
|
|
104
|
+
case 'destroyRecord':
|
|
105
|
+
return suppressDeprecation ? _destroyRecord : destroyRecord;
|
|
106
|
+
case 'dirtyType':
|
|
107
|
+
return record.currentState.dirtyType;
|
|
108
|
+
case 'errors':
|
|
109
|
+
// FIXME should be deprecated too?
|
|
110
|
+
// @ts-expect-error
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
112
|
+
return state.errors = state.errors || Errors.create({
|
|
113
|
+
__record: record
|
|
114
|
+
});
|
|
115
|
+
case 'hasDirtyAttributes':
|
|
116
|
+
return record.currentState.isDirty;
|
|
117
|
+
case 'hasMany':
|
|
118
|
+
return hasMany;
|
|
119
|
+
case 'isDeleted':
|
|
120
|
+
return record.currentState.isDeleted;
|
|
121
|
+
case 'isEmpty':
|
|
122
|
+
return record.currentState.isEmpty;
|
|
123
|
+
case 'isError':
|
|
124
|
+
return record.currentState.isError;
|
|
125
|
+
case 'isLoaded':
|
|
126
|
+
return record.currentState.isLoaded;
|
|
127
|
+
case 'isLoading':
|
|
128
|
+
return record.currentState.isLoading;
|
|
129
|
+
case 'isNew':
|
|
130
|
+
return record.currentState.isNew;
|
|
131
|
+
case 'isSaving':
|
|
132
|
+
return record.currentState.isSaving;
|
|
133
|
+
case 'isValid':
|
|
134
|
+
return record.currentState.isValid;
|
|
135
|
+
case 'reload':
|
|
136
|
+
return suppressDeprecation ? _reload : reload;
|
|
137
|
+
case 'rollbackAttributes':
|
|
138
|
+
return rollbackAttributes;
|
|
139
|
+
case 'save':
|
|
140
|
+
return suppressDeprecation ? _save : save;
|
|
141
|
+
case 'serialize':
|
|
142
|
+
// FIXME should be deprecated too? (is somewhat deprecated via store.serializeRecord)
|
|
143
|
+
return serialize;
|
|
144
|
+
case 'unloadRecord':
|
|
145
|
+
return unloadRecord;
|
|
146
|
+
default:
|
|
147
|
+
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
148
|
+
{
|
|
149
|
+
throw new Error(`${prop} is not a supported legacy field`);
|
|
150
|
+
}
|
|
151
|
+
})() : {};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
legacySupport[Type] = '@legacy';
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* A function which adds the necessary fields to a schema and marks it as
|
|
158
|
+
* being in LegacyMode. This is used to support the legacy features of
|
|
159
|
+
* @warp-drive/legacy/model while migrating to WarpDrive.
|
|
160
|
+
*
|
|
161
|
+
* Example:
|
|
162
|
+
*
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { withDefaults, WithLegacy } from '@warp-drive/legacy/model/migration-support';
|
|
165
|
+
* import { Type } from '@warp-drive/core/types/symbols';
|
|
166
|
+
* import type { HasMany } from '@warp-drive/legacy/model';
|
|
167
|
+
*
|
|
168
|
+
* export const UserSchema = withDefaults({
|
|
169
|
+
* type: 'user',
|
|
170
|
+
* fields: [
|
|
171
|
+
* { name: 'firstName', kind: 'attribute' },
|
|
172
|
+
* { name: 'lastName', kind: 'attribute' },
|
|
173
|
+
* { name: 'age', kind: 'attribute' },
|
|
174
|
+
* { name: 'friends',
|
|
175
|
+
* kind: 'hasMany',
|
|
176
|
+
* type: 'user',
|
|
177
|
+
* options: { inverse: 'friends', async: false }
|
|
178
|
+
* },
|
|
179
|
+
* { name: 'bestFriend',
|
|
180
|
+
* kind: 'belongsTo',
|
|
181
|
+
* type: 'user',
|
|
182
|
+
* options: { inverse: null, async: false }
|
|
183
|
+
* },
|
|
184
|
+
* ],
|
|
185
|
+
* });
|
|
186
|
+
*
|
|
187
|
+
* export type User = WithLegacy<{
|
|
188
|
+
* firstName: string;
|
|
189
|
+
* lastName: string;
|
|
190
|
+
* age: number;
|
|
191
|
+
* friends: HasMany<User>;
|
|
192
|
+
* bestFriend: User | null;
|
|
193
|
+
* [Type]: 'user';
|
|
194
|
+
* }>
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* Using this function require registering the derivations
|
|
198
|
+
* it requires with the schema service.
|
|
199
|
+
*
|
|
200
|
+
* ```ts
|
|
201
|
+
* import { registerDerivations } from '@warp-drive/legacy/model/migration-support';
|
|
202
|
+
*
|
|
203
|
+
* registerDerivations(schema);
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* @param schema The schema to add legacy support to.
|
|
207
|
+
* @return The schema with legacy support added.
|
|
208
|
+
* @public
|
|
209
|
+
*/
|
|
210
|
+
function withDefaults(schema) {
|
|
211
|
+
schema.legacy = true;
|
|
212
|
+
schema.identity = {
|
|
213
|
+
kind: '@id',
|
|
214
|
+
name: 'id'
|
|
215
|
+
};
|
|
216
|
+
LegacyFields.forEach(field => {
|
|
217
|
+
schema.fields.push({
|
|
218
|
+
type: '@legacy',
|
|
219
|
+
name: field,
|
|
220
|
+
kind: 'derived'
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
schema.fields.push({
|
|
224
|
+
name: '_isReloading',
|
|
225
|
+
kind: '@local',
|
|
226
|
+
type: 'boolean',
|
|
227
|
+
options: {
|
|
228
|
+
defaultValue: false
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
schema.fields.push({
|
|
232
|
+
name: 'isDestroying',
|
|
233
|
+
kind: '@local',
|
|
234
|
+
type: 'boolean',
|
|
235
|
+
options: {
|
|
236
|
+
defaultValue: false
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
schema.fields.push({
|
|
240
|
+
name: 'isDestroyed',
|
|
241
|
+
kind: '@local',
|
|
242
|
+
type: 'boolean',
|
|
243
|
+
options: {
|
|
244
|
+
defaultValue: false
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
schema.objectExtensions = schema.objectExtensions || [];
|
|
248
|
+
schema.objectExtensions.push('deprecated-model-behaviors');
|
|
249
|
+
return schema;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Adds the necessasary fields to the schema for supporting
|
|
254
|
+
* the deprecated request methods on LegacyMode schemas.
|
|
255
|
+
*
|
|
256
|
+
* Use this instead of `withDefaults` to add the fields
|
|
257
|
+
* and behaviors necessary to support Model-Like capabilities.
|
|
258
|
+
*
|
|
259
|
+
* ```ts
|
|
260
|
+
* import { withRestoredDeprecatedModelRequestBehaviors } from '@warp-drive/legacy/model/migration-support';
|
|
261
|
+
*
|
|
262
|
+
* export const UserSchema = withRestoredDeprecatedModelRequestBehaviors({
|
|
263
|
+
* type: 'user',
|
|
264
|
+
* fields: [
|
|
265
|
+
* { name: 'firstName', kind: 'attribute' },
|
|
266
|
+
* { name: 'lastName', kind: 'attribute' },
|
|
267
|
+
* ]
|
|
268
|
+
* });
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
function withRestoredDeprecatedModelRequestBehaviors(schema) {
|
|
272
|
+
schema.legacy = true;
|
|
273
|
+
schema.identity = {
|
|
274
|
+
kind: '@id',
|
|
275
|
+
name: 'id'
|
|
276
|
+
};
|
|
277
|
+
LegacyFields.forEach(field => {
|
|
278
|
+
schema.fields.push({
|
|
279
|
+
type: '@legacy',
|
|
280
|
+
name: field,
|
|
281
|
+
kind: 'derived',
|
|
282
|
+
options: {
|
|
283
|
+
suppressDeprecation: true
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
schema.fields.push({
|
|
288
|
+
name: 'isReloading',
|
|
289
|
+
kind: '@local',
|
|
290
|
+
type: 'boolean',
|
|
291
|
+
options: {
|
|
292
|
+
defaultValue: false
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
schema.fields.push({
|
|
296
|
+
name: 'isDestroying',
|
|
297
|
+
kind: '@local',
|
|
298
|
+
type: 'boolean',
|
|
299
|
+
options: {
|
|
300
|
+
defaultValue: false
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
schema.fields.push({
|
|
304
|
+
name: 'isDestroyed',
|
|
305
|
+
kind: '@local',
|
|
306
|
+
type: 'boolean',
|
|
307
|
+
options: {
|
|
308
|
+
defaultValue: false
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
return schema;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* A function which registers the necessary derivations to support
|
|
316
|
+
* the LegacyMode features of @warp-drive/legacy/model while migrating to WarpDrive.
|
|
317
|
+
*
|
|
318
|
+
* This must be called in order to use the fields added by {@link withDefaults} or
|
|
319
|
+
* {@link withRestoredDeprecatedModelRequestBehaviors}.
|
|
320
|
+
*
|
|
321
|
+
* @param schema The schema service to register the derivations with.
|
|
322
|
+
* @public
|
|
323
|
+
*/
|
|
324
|
+
function registerDerivations(schema) {
|
|
325
|
+
schema.registerDerivation(legacySupport);
|
|
326
|
+
// @ts-expect-error
|
|
327
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
328
|
+
schema._registerMode('@legacy', {
|
|
329
|
+
belongsTo: {
|
|
330
|
+
get(store, record, cacheKey, field) {
|
|
331
|
+
// FIXME field.name here should likely be field.sourceKey || field.name
|
|
332
|
+
return lookupLegacySupport(record).getBelongsTo(field.name);
|
|
333
|
+
},
|
|
334
|
+
set(store, record, cacheKey, field, value) {
|
|
335
|
+
assertPrivateStore(store);
|
|
336
|
+
store._join(() => {
|
|
337
|
+
// FIXME field.name here should likely be field.sourceKey || field.name
|
|
338
|
+
lookupLegacySupport(record).setDirtyBelongsTo(field.name, value);
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
hasMany: {
|
|
343
|
+
get(store, record, cacheKey, field) {
|
|
344
|
+
// FIXME field.name here should likely be field.sourceKey || field.name
|
|
345
|
+
return lookupLegacySupport(record).getHasMany(field.name);
|
|
346
|
+
},
|
|
347
|
+
set(store, record, cacheKey, field, value) {
|
|
348
|
+
assertPrivateStore(store);
|
|
349
|
+
store._join(() => {
|
|
350
|
+
const support = lookupLegacySupport(record);
|
|
351
|
+
// FIXME field.name here should likely be field.sourceKey || field.name
|
|
352
|
+
const manyArray = support.getManyArray(field.name);
|
|
353
|
+
manyArray.splice(0, manyArray.length, ...value);
|
|
354
|
+
});
|
|
355
|
+
},
|
|
356
|
+
notify(store, record, cacheKey, field) {
|
|
357
|
+
const support = lookupLegacySupport(record);
|
|
358
|
+
// FIXME field.name here should likely be field.sourceKey || field.name
|
|
359
|
+
const manyArray = support && support._manyArrayCache[field.name];
|
|
360
|
+
const hasPromise = support && support._relationshipPromisesCache[field.name];
|
|
361
|
+
if (manyArray && hasPromise) {
|
|
362
|
+
// do nothing, we will notify the ManyArray directly
|
|
363
|
+
// once the fetch has completed.
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
if (manyArray) {
|
|
367
|
+
notifyInternalSignal(manyArray[Context].signal);
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
return false;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
schema.CAUTION_MEGA_DANGER_ZONE_registerExtension({
|
|
375
|
+
name: 'deprecated-model-behaviors',
|
|
376
|
+
kind: 'object',
|
|
377
|
+
features: {
|
|
378
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
379
|
+
get isReloading() {
|
|
380
|
+
deprecate(`record.isReloading is deprecated, please use store.request and either <Request> or getRequuestState to keep track of the request state instead.`, false, {
|
|
381
|
+
id: 'warp-drive:deprecate-legacy-request-methods',
|
|
382
|
+
until: '6.0',
|
|
383
|
+
for: '@warp-drive/core',
|
|
384
|
+
url: 'https://docs.warp-drive.io/api/@warp-drive/core/build-config/deprecations/variables/ENABLE_LEGACY_REQUEST_METHODS',
|
|
385
|
+
since: {
|
|
386
|
+
enabled: '5.7',
|
|
387
|
+
available: '5.7'
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
// @ts-expect-error
|
|
391
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
392
|
+
return this._isReloading;
|
|
393
|
+
},
|
|
394
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
395
|
+
set isReloading(v) {
|
|
396
|
+
// @ts-expect-error
|
|
397
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
398
|
+
this._isReloading = v;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* A class which provides a schema service that delegates between
|
|
406
|
+
* a primary schema service and one that supports legacy model
|
|
407
|
+
* classes as its schema source.
|
|
408
|
+
*
|
|
409
|
+
* When the primary schema service has a schema for the given
|
|
410
|
+
* resource, it will be used. Otherwise, the fallback schema
|
|
411
|
+
* service will be used.
|
|
412
|
+
*
|
|
413
|
+
* This can be used when incrementally migrating from Models to
|
|
414
|
+
* ReactiveResources by enabling unmigrated Models to continue to
|
|
415
|
+
* provide their own schema information to the application.
|
|
416
|
+
*
|
|
417
|
+
* ```ts
|
|
418
|
+
* import { DelegatingSchemaService } from '@warp-drive/legacy/model/migration-support';
|
|
419
|
+
* import { SchemaService } from '@warp-drive/core/reactive';
|
|
420
|
+
*
|
|
421
|
+
* class AppStore extends Store {
|
|
422
|
+
* createSchemaService() {
|
|
423
|
+
* const schema = new SchemaService();
|
|
424
|
+
* return new DelegatingSchemaService(this, schema);
|
|
425
|
+
* }
|
|
426
|
+
* }
|
|
427
|
+
* ```
|
|
428
|
+
*
|
|
429
|
+
* All calls to register resources, derivations, transformations, hash functions
|
|
430
|
+
* etc. will be delegated to the primary schema service.
|
|
431
|
+
*
|
|
432
|
+
* @class DelegatingSchemaService
|
|
433
|
+
* @public
|
|
434
|
+
*/
|
|
435
|
+
|
|
436
|
+
class DelegatingSchemaService {
|
|
437
|
+
/** @internal */
|
|
438
|
+
_preferred;
|
|
439
|
+
/** @internal */
|
|
440
|
+
_secondary;
|
|
441
|
+
constructor(store, schema) {
|
|
442
|
+
this._preferred = schema;
|
|
443
|
+
this._secondary = buildSchema(store);
|
|
444
|
+
}
|
|
445
|
+
isDelegated(resource) {
|
|
446
|
+
return !this._preferred.hasResource(resource) && this._secondary.hasResource(resource);
|
|
447
|
+
}
|
|
448
|
+
resourceTypes() {
|
|
449
|
+
return Array.from(new Set(this._preferred.resourceTypes().concat(this._secondary.resourceTypes())));
|
|
450
|
+
}
|
|
451
|
+
hasResource(resource) {
|
|
452
|
+
return this._preferred.hasResource(resource) || this._secondary.hasResource(resource);
|
|
453
|
+
}
|
|
454
|
+
hasTrait(type) {
|
|
455
|
+
if (this._preferred.hasResource({
|
|
456
|
+
type
|
|
457
|
+
})) {
|
|
458
|
+
return this._preferred.hasTrait(type);
|
|
459
|
+
}
|
|
460
|
+
return this._secondary.hasTrait(type);
|
|
461
|
+
}
|
|
462
|
+
resourceHasTrait(resource, trait) {
|
|
463
|
+
if (this._preferred.hasResource(resource)) {
|
|
464
|
+
return this._preferred.resourceHasTrait(resource, trait);
|
|
465
|
+
}
|
|
466
|
+
return this._secondary.resourceHasTrait(resource, trait);
|
|
467
|
+
}
|
|
468
|
+
fields(resource) {
|
|
469
|
+
if (this._preferred.hasResource(resource)) {
|
|
470
|
+
return this._preferred.fields(resource);
|
|
471
|
+
}
|
|
472
|
+
return this._secondary.fields(resource);
|
|
473
|
+
}
|
|
474
|
+
cacheFields(resource) {
|
|
475
|
+
if (this._preferred.cacheFields?.(resource)) {
|
|
476
|
+
return this._preferred.cacheFields(resource);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// @ts-expect-error
|
|
480
|
+
return this._secondary.cacheFields?.(resource);
|
|
481
|
+
}
|
|
482
|
+
transformation(field) {
|
|
483
|
+
return this._preferred.transformation(field);
|
|
484
|
+
}
|
|
485
|
+
hashFn(field) {
|
|
486
|
+
return this._preferred.hashFn(field);
|
|
487
|
+
}
|
|
488
|
+
derivation(field) {
|
|
489
|
+
return this._preferred.derivation(field);
|
|
490
|
+
}
|
|
491
|
+
resource(resource) {
|
|
492
|
+
if (this._preferred.hasResource(resource)) {
|
|
493
|
+
return this._preferred.resource(resource);
|
|
494
|
+
}
|
|
495
|
+
return this._secondary.resource(resource);
|
|
496
|
+
}
|
|
497
|
+
registerResources(schemas) {
|
|
498
|
+
this._preferred.registerResources(schemas);
|
|
499
|
+
}
|
|
500
|
+
registerResource(schema) {
|
|
501
|
+
this._preferred.registerResource(schema);
|
|
502
|
+
}
|
|
503
|
+
registerTransformation(transform) {
|
|
504
|
+
this._preferred.registerTransformation(transform);
|
|
505
|
+
}
|
|
506
|
+
registerDerivation(derivation) {
|
|
507
|
+
this._preferred.registerDerivation(derivation);
|
|
508
|
+
}
|
|
509
|
+
registerHashFn(hashFn) {
|
|
510
|
+
this._preferred.registerHashFn(hashFn);
|
|
511
|
+
}
|
|
512
|
+
CAUTION_MEGA_DANGER_ZONE_hasExtension(ext) {
|
|
513
|
+
return this._preferred.CAUTION_MEGA_DANGER_ZONE_hasExtension(ext);
|
|
514
|
+
}
|
|
515
|
+
CAUTION_MEGA_DANGER_ZONE_registerExtension(extension) {
|
|
516
|
+
this._preferred.CAUTION_MEGA_DANGER_ZONE_registerExtension(extension);
|
|
517
|
+
}
|
|
518
|
+
CAUTION_MEGA_DANGER_ZONE_resourceExtensions(resource) {
|
|
519
|
+
return this._preferred.CAUTION_MEGA_DANGER_ZONE_resourceExtensions(resource);
|
|
520
|
+
}
|
|
521
|
+
CAUTION_MEGA_DANGER_ZONE_objectExtensions(field, resolvedType) {
|
|
522
|
+
return this._preferred.CAUTION_MEGA_DANGER_ZONE_objectExtensions(field, resolvedType);
|
|
523
|
+
}
|
|
524
|
+
CAUTION_MEGA_DANGER_ZONE_arrayExtensions(field) {
|
|
525
|
+
return this._preferred.CAUTION_MEGA_DANGER_ZONE_arrayExtensions(field);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* This is an internal method used to register behaviors for legacy mode.
|
|
530
|
+
* It is not intended for public use.
|
|
531
|
+
*
|
|
532
|
+
* We do think a generalized `kind` registration system would be useful,
|
|
533
|
+
* but we have not yet designed it.
|
|
534
|
+
*
|
|
535
|
+
* See https://github.com/warp-drive-data/warp-drive/issues/9534
|
|
536
|
+
*
|
|
537
|
+
* @internal
|
|
538
|
+
*/
|
|
539
|
+
_registerMode(mode, kinds) {
|
|
540
|
+
// @ts-expect-error
|
|
541
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
542
|
+
this._preferred._registerMode(mode, kinds);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* This is an internal method used to enable legacy behaviors for legacy mode.
|
|
547
|
+
* It is not intended for public use.
|
|
548
|
+
*
|
|
549
|
+
* We do think a generalized `kind` registration system would be useful,
|
|
550
|
+
* but we have not yet designed it.
|
|
551
|
+
*
|
|
552
|
+
* See https://github.com/warp-drive-data/warp-drive/issues/9534
|
|
553
|
+
*
|
|
554
|
+
* @internal
|
|
555
|
+
*/
|
|
556
|
+
_kind(mode, kind) {
|
|
557
|
+
// @ts-expect-error
|
|
558
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
559
|
+
return this._preferred._kind(mode, kind);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (macroCondition(getGlobalConfig().WarpDrive.deprecations.ENABLE_LEGACY_SCHEMA_SERVICE)) {
|
|
563
|
+
DelegatingSchemaService.prototype.attributesDefinitionFor = function (resource) {
|
|
564
|
+
if (this._preferred.hasResource(resource)) {
|
|
565
|
+
return this._preferred.attributesDefinitionFor(resource);
|
|
566
|
+
}
|
|
567
|
+
return this._secondary.attributesDefinitionFor(resource);
|
|
568
|
+
};
|
|
569
|
+
DelegatingSchemaService.prototype.relationshipsDefinitionFor = function (resource) {
|
|
570
|
+
if (this._preferred.hasResource(resource)) {
|
|
571
|
+
return this._preferred.relationshipsDefinitionFor(resource);
|
|
572
|
+
}
|
|
573
|
+
return this._secondary.relationshipsDefinitionFor(resource);
|
|
574
|
+
};
|
|
575
|
+
DelegatingSchemaService.prototype.doesTypeExist = function (type) {
|
|
576
|
+
return this._preferred.doesTypeExist?.(type) || this._secondary.doesTypeExist?.(type) || false;
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
export { DelegatingSchemaService, registerDerivations, withDefaults, withRestoredDeprecatedModelRequestBehaviors };
|