@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
|
@@ -42,8 +42,8 @@ rejects with a `InvalidError` object that looks like this:
|
|
|
42
42
|
|
|
43
43
|
```js [app/adapters/post.js]
|
|
44
44
|
import RSVP from 'RSVP';
|
|
45
|
-
import RESTAdapter from '@
|
|
46
|
-
import { InvalidError } from '@
|
|
45
|
+
import RESTAdapter from '@warp-drive/legacy/adapter/rest';
|
|
46
|
+
import { InvalidError } from '@warp-drive/legacy/adapter/error';
|
|
47
47
|
|
|
48
48
|
export default class ApplicationAdapter extends RESTAdapter {
|
|
49
49
|
updateRecord() {
|
|
@@ -82,7 +82,7 @@ An example use case would be to warn the user to check their internet
|
|
|
82
82
|
connection if an adapter operation has timed out:
|
|
83
83
|
|
|
84
84
|
```js [app/routes/application.js]
|
|
85
|
-
import { TimeoutError } from '@
|
|
85
|
+
import { TimeoutError } from '@warp-drive/legacy/adapter/error';
|
|
86
86
|
|
|
87
87
|
export default class ApplicationRoute extends Route {
|
|
88
88
|
@action
|
|
@@ -124,7 +124,7 @@ An example use case would be to redirect the user to a login route if a
|
|
|
124
124
|
request is unauthorized:
|
|
125
125
|
|
|
126
126
|
```js [app/routes/application.js]
|
|
127
|
-
import { UnauthorizedError } from '@
|
|
127
|
+
import { UnauthorizedError } from '@warp-drive/legacy/adapter/error';
|
|
128
128
|
|
|
129
129
|
export default class ApplicationRoute extends Route {
|
|
130
130
|
@action
|
|
@@ -166,7 +166,7 @@ An example use case would be to detect if the user has entered a route
|
|
|
166
166
|
for a specific model that does not exist. For example:
|
|
167
167
|
|
|
168
168
|
```js [app/routes/post.js]
|
|
169
|
-
import { NotFoundError } from '@
|
|
169
|
+
import { NotFoundError } from '@warp-drive/legacy/adapter/error';
|
|
170
170
|
|
|
171
171
|
export default class PostRoute extends Route {
|
|
172
172
|
@service store;
|
|
@@ -118,7 +118,7 @@ Endpoint paths can be prefixed with a `namespace` by setting the
|
|
|
118
118
|
namespace property on the adapter:
|
|
119
119
|
|
|
120
120
|
```js [app/adapters/application.js]
|
|
121
|
-
import JSONAPIAdapter from '@
|
|
121
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
122
122
|
|
|
123
123
|
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
124
124
|
namespace = 'api/1';
|
|
@@ -131,7 +131,7 @@ Requests for the `person` model would now target `/api/1/people/1`.
|
|
|
131
131
|
An adapter can target other hosts by setting the `host` property.
|
|
132
132
|
|
|
133
133
|
```js [app/adapters/application.js]
|
|
134
|
-
import JSONAPIAdapter from '@
|
|
134
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
135
135
|
|
|
136
136
|
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
137
137
|
host = 'https://api.example.com';
|
|
@@ -19,16 +19,16 @@ This function builds a request config to perform a `findAll` request for the giv
|
|
|
19
19
|
When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.
|
|
20
20
|
Additionally, it takes the same options as `store.findAll`.
|
|
21
21
|
|
|
22
|
-
All `@
|
|
22
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
23
23
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
24
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
24
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
25
25
|
|
|
26
26
|
@deprecated
|
|
27
27
|
@public
|
|
28
|
-
@param
|
|
29
|
-
@param
|
|
30
|
-
@param
|
|
31
|
-
@return
|
|
28
|
+
@param type the name of the resource
|
|
29
|
+
@param query a query to be used by the adapter
|
|
30
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.findAll
|
|
31
|
+
@return request config
|
|
32
32
|
*/
|
|
33
33
|
export declare function findAllBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, options?: FindAllBuilderOptions): FindAllRequestInput<TypeFromInstance<T>, T[]>;
|
|
34
34
|
export declare function findAllBuilder(type: string, options?: FindAllBuilderOptions): FindAllRequestInput;
|
|
@@ -23,7 +23,7 @@ Additionally, it takes the same options as `store.findRecord`, with the exceptio
|
|
|
23
23
|
**Example 1**
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
import { findRecord } from '@
|
|
26
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
27
27
|
const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -34,20 +34,20 @@ of `type` (modelName) and `id` as separate arguments. You may recognize this com
|
|
|
34
34
|
the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
|
-
import { findRecord } from '@
|
|
37
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
38
38
|
const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
All `@
|
|
41
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
42
42
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
43
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
43
|
+
To that end, these builders are deprecated and will be removed in a future version of Warp Drive.
|
|
44
44
|
|
|
45
45
|
@deprecated
|
|
46
46
|
@public
|
|
47
|
-
@param
|
|
48
|
-
@param
|
|
49
|
-
@param
|
|
50
|
-
@return
|
|
47
|
+
@param resource - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record
|
|
48
|
+
@param id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved
|
|
49
|
+
@param options - if the first param is a string this will be the optional options for the request. See examples for available options.
|
|
50
|
+
@return request config
|
|
51
51
|
*/
|
|
52
52
|
export declare function findRecordBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, id: string, options?: FindRecordBuilderOptions): FindRecordRequestInput<TypeFromInstance<T>, T>;
|
|
53
53
|
export declare function findRecordBuilder(type: string, id: string, options?: FindRecordBuilderOptions): FindRecordRequestInput;
|
|
@@ -20,16 +20,16 @@ This function builds a request config for a given type and query object.
|
|
|
20
20
|
When passed to `store.request`, this config will result in the same behavior as a `store.query` request.
|
|
21
21
|
Additionally, it takes the same options as `store.query`.
|
|
22
22
|
|
|
23
|
-
All `@
|
|
23
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
24
24
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
25
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
25
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
26
26
|
|
|
27
27
|
@deprecated
|
|
28
28
|
@public
|
|
29
|
-
@param
|
|
30
|
-
@param
|
|
31
|
-
@param
|
|
32
|
-
@return
|
|
29
|
+
@param type the name of the resource
|
|
30
|
+
@param query a query to be used by the adapter
|
|
31
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
32
|
+
@return request config
|
|
33
33
|
*/
|
|
34
34
|
export declare function queryBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRequestInput<TypeFromInstance<T>, T[]>;
|
|
35
35
|
export declare function queryBuilder(type: string, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRequestInput;
|
|
@@ -50,16 +50,16 @@ This function builds a request config for a given type and query object.
|
|
|
50
50
|
When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.
|
|
51
51
|
Additionally, it takes the same options as `store.queryRecord`.
|
|
52
52
|
|
|
53
|
-
All `@
|
|
53
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
54
54
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
55
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
55
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
56
56
|
|
|
57
57
|
@deprecated
|
|
58
58
|
@public
|
|
59
|
-
@param
|
|
60
|
-
@param
|
|
61
|
-
@param
|
|
62
|
-
@return
|
|
59
|
+
@param type the name of the resource
|
|
60
|
+
@param query a query to be used by the adapter
|
|
61
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
62
|
+
@return request config
|
|
63
63
|
*/
|
|
64
64
|
export declare function queryRecordBuilder<T extends TypedRecordInstance>(type: TypeFromInstance<T>, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRecordRequestInput<TypeFromInstance<T>, T | null>;
|
|
65
65
|
export declare function queryRecordBuilder(type: string, query: LegacyResourceQuery, options?: QueryBuilderOptions): QueryRecordRequestInput;
|
package/declarations/compat.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ All objects should be in the format expected by the
|
|
|
107
107
|
serializer.
|
|
108
108
|
|
|
109
109
|
```js [app/serializers/application.js]
|
|
110
|
-
import RESTSerializer from '@
|
|
110
|
+
import RESTSerializer from '@warp-drive/legacy/serializer/rest';
|
|
111
111
|
|
|
112
112
|
export default class ApplicationSerializer extends RESTSerializer;
|
|
113
113
|
```
|
|
@@ -132,13 +132,13 @@ Alternatively, `pushPayload` will accept a model type which
|
|
|
132
132
|
will determine which serializer will process the payload.
|
|
133
133
|
|
|
134
134
|
```js [app/serializers/application.js]
|
|
135
|
-
import RESTSerializer from '@
|
|
135
|
+
import RESTSerializer from '@warp-drive/legacy/serializer/rest';
|
|
136
136
|
|
|
137
137
|
export default class ApplicationSerializer extends RESTSerializer;
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
```js [app/serializers/post.js]
|
|
141
|
-
import JSONSerializer from '@
|
|
141
|
+
import JSONSerializer from '@warp-drive/legacy/serializer/json';
|
|
142
142
|
|
|
143
143
|
export default JSONSerializer;
|
|
144
144
|
```
|
|
@@ -10,11 +10,11 @@ A `BelongsToReference` is a low-level API that allows access
|
|
|
10
10
|
and manipulation of a belongsTo relationship.
|
|
11
11
|
|
|
12
12
|
It is especially useful when you're dealing with `async` relationships
|
|
13
|
-
from `@
|
|
13
|
+
from `@warp-drive/legacy/model` as it allows synchronous access to
|
|
14
14
|
the relationship data if loaded, as well as APIs for loading, reloading
|
|
15
15
|
the data or accessing available information without triggering a load.
|
|
16
16
|
|
|
17
|
-
It may also be useful when using `sync` relationships with `@
|
|
17
|
+
It may also be useful when using `sync` relationships with `@warp-drive/legacy/model`
|
|
18
18
|
that need to be loaded/reloaded with more precise timing than marking the
|
|
19
19
|
relationship as `async` and relying on autofetch would have allowed.
|
|
20
20
|
|
|
@@ -206,7 +206,7 @@ export default class BelongsToReference<
|
|
|
206
206
|
Example
|
|
207
207
|
|
|
208
208
|
```js [app/models/post.js]
|
|
209
|
-
import Model, { hasMany } from '@
|
|
209
|
+
import Model, { hasMany } from '@warp-drive/legacy/model';
|
|
210
210
|
|
|
211
211
|
export default class PostModel extends Model {
|
|
212
212
|
@hasMany('comment', { async: true, inverse: null }) comments;
|
|
@@ -430,7 +430,7 @@ export default class BelongsToReference<
|
|
|
430
430
|
});
|
|
431
431
|
```
|
|
432
432
|
```js [app/adapters/user.js]
|
|
433
|
-
import Adapter from '@
|
|
433
|
+
import Adapter from '@warp-drive/legacy/adapter';
|
|
434
434
|
|
|
435
435
|
export default class UserAdapter extends Adapter {
|
|
436
436
|
findRecord(store, type, id, snapshot) {
|
|
@@ -19,11 +19,11 @@ A `HasManyReference` is a low-level API that allows access
|
|
|
19
19
|
and manipulation of a hasMany relationship.
|
|
20
20
|
|
|
21
21
|
It is especially useful when you're dealing with `async` relationships
|
|
22
|
-
from `@
|
|
22
|
+
from `@warp-drive/legacy/model` as it allows synchronous access to
|
|
23
23
|
the relationship data if loaded, as well as APIs for loading, reloading
|
|
24
24
|
the data or accessing available information without triggering a load.
|
|
25
25
|
|
|
26
|
-
It may also be useful when using `sync` relationships with `@
|
|
26
|
+
It may also be useful when using `sync` relationships with `@warp-drive/legacy/model`
|
|
27
27
|
that need to be loaded/reloaded with more precise timing than marking the
|
|
28
28
|
relationship as `async` and relying on autofetch would have allowed.
|
|
29
29
|
|
|
@@ -56,14 +56,14 @@ interface LegacyModeRecord<T extends TypedRecordInstance> {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* A Type utility that enables quickly adding type information for the fields
|
|
59
|
-
* defined by `import { withDefaults } from '@
|
|
59
|
+
* defined by `import { withDefaults } from '@warp-drive/legacy/model/migration-support'`.
|
|
60
60
|
*
|
|
61
61
|
* Example:
|
|
62
62
|
*
|
|
63
63
|
* ```ts
|
|
64
|
-
* import { withDefaults, WithLegacy } from '@
|
|
65
|
-
* import { Type } from '@warp-drive/core
|
|
66
|
-
* import type { HasMany } from '
|
|
64
|
+
* import { withDefaults, WithLegacy } from '@warp-drive/legacy/model/migration-support';
|
|
65
|
+
* import { Type } from '@warp-drive/core/types/symbols';
|
|
66
|
+
* import type { HasMany } from '@@warp-drive/legacy/model';
|
|
67
67
|
*
|
|
68
68
|
* export const UserSchema = withDefaults({
|
|
69
69
|
* type: 'user',
|
|
@@ -99,14 +99,14 @@ export type WithLegacy<T extends TypedRecordInstance> = T & LegacyModeRecord<T>;
|
|
|
99
99
|
/**
|
|
100
100
|
* A function which adds the necessary fields to a schema and marks it as
|
|
101
101
|
* being in LegacyMode. This is used to support the legacy features of
|
|
102
|
-
* @
|
|
102
|
+
* @warp-drive/legacy/model while migrating to WarpDrive.
|
|
103
103
|
*
|
|
104
104
|
* Example:
|
|
105
105
|
*
|
|
106
106
|
* ```ts
|
|
107
|
-
* import { withDefaults, WithLegacy } from '@
|
|
108
|
-
* import { Type } from '@warp-drive/core
|
|
109
|
-
* import type { HasMany } from '@
|
|
107
|
+
* import { withDefaults, WithLegacy } from '@warp-drive/legacy/model/migration-support';
|
|
108
|
+
* import { Type } from '@warp-drive/core/types/symbols';
|
|
109
|
+
* import type { HasMany } from '@warp-drive/legacy/model';
|
|
110
110
|
*
|
|
111
111
|
* export const UserSchema = withDefaults({
|
|
112
112
|
* type: 'user',
|
|
@@ -141,26 +141,42 @@ export type WithLegacy<T extends TypedRecordInstance> = T & LegacyModeRecord<T>;
|
|
|
141
141
|
* it requires with the schema service.
|
|
142
142
|
*
|
|
143
143
|
* ```ts
|
|
144
|
-
* import { registerDerivations } from '@
|
|
144
|
+
* import { registerDerivations } from '@warp-drive/legacy/model/migration-support';
|
|
145
145
|
*
|
|
146
146
|
* registerDerivations(schema);
|
|
147
147
|
* ```
|
|
148
148
|
*
|
|
149
|
-
* @param
|
|
150
|
-
* @return
|
|
149
|
+
* @param schema The schema to add legacy support to.
|
|
150
|
+
* @return The schema with legacy support added.
|
|
151
151
|
* @public
|
|
152
152
|
*/
|
|
153
153
|
export declare function withDefaults(schema: WithPartial<LegacyResourceSchema, "legacy" | "identity">): LegacyResourceSchema;
|
|
154
|
-
export declare function withRestoredDeprecatedModelRequestBehaviors(schema: WithPartial<LegacyResourceSchema, "legacy" | "identity">): LegacyResourceSchema;
|
|
155
154
|
/**
|
|
156
|
-
*
|
|
157
|
-
* the
|
|
155
|
+
* Adds the necessasary fields to the schema for supporting
|
|
156
|
+
* the deprecated request methods on LegacyMode schemas.
|
|
158
157
|
*
|
|
159
|
-
*
|
|
158
|
+
* Use this instead of `withDefaults` to add the fields
|
|
159
|
+
* and behaviors necessary to support Model-Like capabilities.
|
|
160
160
|
*
|
|
161
161
|
* ```ts
|
|
162
|
-
* import {
|
|
162
|
+
* import { withRestoredDeprecatedModelRequestBehaviors } from '@warp-drive/legacy/model/migration-support';
|
|
163
|
+
*
|
|
164
|
+
* export const UserSchema = withRestoredDeprecatedModelRequestBehaviors({
|
|
165
|
+
* type: 'user',
|
|
166
|
+
* fields: [
|
|
167
|
+
* { name: 'firstName', kind: 'attribute' },
|
|
168
|
+
* { name: 'lastName', kind: 'attribute' },
|
|
169
|
+
* ]
|
|
170
|
+
* });
|
|
163
171
|
* ```
|
|
172
|
+
*/
|
|
173
|
+
export declare function withRestoredDeprecatedModelRequestBehaviors(schema: WithPartial<LegacyResourceSchema, "legacy" | "identity">): LegacyResourceSchema;
|
|
174
|
+
/**
|
|
175
|
+
* A function which registers the necessary derivations to support
|
|
176
|
+
* the LegacyMode features of @warp-drive/legacy/model while migrating to WarpDrive.
|
|
177
|
+
*
|
|
178
|
+
* This must be called in order to use the fields added by {@link withDefaults} or
|
|
179
|
+
* {@link withRestoredDeprecatedModelRequestBehaviors}.
|
|
164
180
|
*
|
|
165
181
|
* @param schema The schema service to register the derivations with.
|
|
166
182
|
* @public
|
|
@@ -180,8 +196,8 @@ export declare function registerDerivations(schema: SchemaService): void;
|
|
|
180
196
|
* provide their own schema information to the application.
|
|
181
197
|
*
|
|
182
198
|
* ```ts
|
|
183
|
-
* import { DelegatingSchemaService } from '@
|
|
184
|
-
* import { SchemaService } from '@warp-drive/
|
|
199
|
+
* import { DelegatingSchemaService } from '@warp-drive/legacy/model/migration-support';
|
|
200
|
+
* import { SchemaService } from '@warp-drive/core/reactive';
|
|
185
201
|
*
|
|
186
202
|
* class AppStore extends Store {
|
|
187
203
|
* createSchemaService() {
|
package/declarations/model.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This package provides a Presentation Model for resource data in an WarpDrive Cache.
|
|
3
3
|
*
|
|
4
|
-
* Models are defined as classes extending from `import Model from '@
|
|
4
|
+
* Models are defined as classes extending from `import Model from '@warp-drive/legacy/model';` and the
|
|
5
5
|
* attributes and relationships on these classes are parsed at runtime to supply static "schema"
|
|
6
6
|
* to WarpDrive's SchemaService.
|
|
7
7
|
*
|
|
@@ -17,7 +17,7 @@ the resource data for a given `type` and `id`.
|
|
|
17
17
|
### Defining a Model
|
|
18
18
|
|
|
19
19
|
```js [app/models/person.js]
|
|
20
|
-
import Model, { attr, belongsTo, hasMany } from '@
|
|
20
|
+
import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
|
|
21
21
|
|
|
22
22
|
export default class PersonModel extends Model {
|
|
23
23
|
@attr name;
|
|
@@ -14,7 +14,7 @@ Note also that this mixin does not work with JSONAPISerializer because the JSON:
|
|
|
14
14
|
Below is an example of a per-type serializer (`post` type).
|
|
15
15
|
|
|
16
16
|
```js [app/serializers/post.js]
|
|
17
|
-
import RESTSerializer, { EmbeddedRecordsMixin } from '@
|
|
17
|
+
import RESTSerializer, { EmbeddedRecordsMixin } from '@warp-drive/legacy/serializer/rest';
|
|
18
18
|
|
|
19
19
|
export default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {
|
|
20
20
|
attrs = {
|
|
@@ -16,7 +16,7 @@ serializer recommended by Ember Data.
|
|
|
16
16
|
This serializer normalizes a JSON API payload that looks like:
|
|
17
17
|
|
|
18
18
|
```js [app/models/player.js]
|
|
19
|
-
import Model, { attr, belongsTo } from '@
|
|
19
|
+
import Model, { attr, belongsTo } from '@warp-drive/legacy/model';
|
|
20
20
|
|
|
21
21
|
export default class Player extends Model {
|
|
22
22
|
@attr('string') name;
|
|
@@ -27,7 +27,7 @@ export default class Player extends Model {
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
```js [app/models/club.js]
|
|
30
|
-
import Model, { attr, hasMany } from '@
|
|
30
|
+
import Model, { attr, hasMany } from '@warp-drive/legacy/model';
|
|
31
31
|
|
|
32
32
|
export default class Club extends Model {
|
|
33
33
|
@attr('string') name;
|
|
@@ -92,7 +92,7 @@ below shows how this could be done using `normalizeArrayResponse` and
|
|
|
92
92
|
`extractRelationship`.
|
|
93
93
|
|
|
94
94
|
```js [app/serializers/application.js]
|
|
95
|
-
import JSONAPISerializer from '@
|
|
95
|
+
import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
|
|
96
96
|
|
|
97
97
|
export default class ApplicationSerializer extends JSONAPISerializer {
|
|
98
98
|
normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
|
|
@@ -18,7 +18,7 @@ not support the http://jsonapi.org/ spec.
|
|
|
18
18
|
For example, given the following `User` model and JSON payload:
|
|
19
19
|
|
|
20
20
|
```js [app/models/user.js]
|
|
21
|
-
import Model, { attr, belongsTo, hasMany } from '@
|
|
21
|
+
import Model, { attr, belongsTo, hasMany } from '@warp-drive/legacy/model';
|
|
22
22
|
|
|
23
23
|
export default class UserModel extends Model {
|
|
24
24
|
@hasMany('user') friends;
|
|
@@ -91,7 +91,7 @@ Any serializer in `app/serializers/` can be looked up by `name` using `store.ser
|
|
|
91
91
|
### Default Serializers
|
|
92
92
|
|
|
93
93
|
For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**
|
|
94
|
-
format the `@
|
|
94
|
+
format the `@warp-drive/legacy/serializer` package contains implementations these applications can
|
|
95
95
|
extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.
|
|
96
96
|
|
|
97
97
|
Many applications will find writing their own serializer to be more performant and less
|
package/dist/adapter/error.js
CHANGED
|
@@ -24,7 +24,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
|
24
24
|
it was closed for maintenance:
|
|
25
25
|
|
|
26
26
|
```js [app/adapters/maintenance-error.js]
|
|
27
|
-
import AdapterError from '@
|
|
27
|
+
import AdapterError from '@warp-drive/legacy/adapter/error';
|
|
28
28
|
|
|
29
29
|
export default AdapterError.extend({ message: "Down for maintenance." });
|
|
30
30
|
```
|
|
@@ -32,7 +32,7 @@ import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
|
32
32
|
This error would then be returned by an adapter's `handleResponse` method:
|
|
33
33
|
|
|
34
34
|
```js [app/adapters/application.js]
|
|
35
|
-
import JSONAPIAdapter from '@
|
|
35
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
36
36
|
import MaintenanceError from './maintenance-error';
|
|
37
37
|
|
|
38
38
|
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
@@ -146,8 +146,8 @@ function extend(ParentErrorClass, defaultMessage) {
|
|
|
146
146
|
|
|
147
147
|
```js [app/adapters/post.js]
|
|
148
148
|
import RSVP from 'RSVP';
|
|
149
|
-
import RESTAdapter from '@
|
|
150
|
-
import { InvalidError } from '@
|
|
149
|
+
import RESTAdapter from '@warp-drive/legacy/adapter/rest';
|
|
150
|
+
import { InvalidError } from '@warp-drive/legacy/adapter/error';
|
|
151
151
|
|
|
152
152
|
export default class ApplicationAdapter extends RESTAdapter {
|
|
153
153
|
updateRecord() {
|
|
@@ -189,7 +189,7 @@ InvalidError.prototype.code = 'InvalidError';
|
|
|
189
189
|
connection if an adapter operation has timed out:
|
|
190
190
|
|
|
191
191
|
```js [app/routes/application.js]
|
|
192
|
-
import { TimeoutError } from '@
|
|
192
|
+
import { TimeoutError } from '@warp-drive/legacy/adapter/error';
|
|
193
193
|
|
|
194
194
|
export default class ApplicationRoute extends Route {
|
|
195
195
|
@action
|
|
@@ -235,7 +235,7 @@ AbortError.prototype.code = 'AbortError';
|
|
|
235
235
|
request is unauthorized:
|
|
236
236
|
|
|
237
237
|
```js [app/routes/application.js]
|
|
238
|
-
import { UnauthorizedError } from '@
|
|
238
|
+
import { UnauthorizedError } from '@warp-drive/legacy/adapter/error';
|
|
239
239
|
|
|
240
240
|
export default class ApplicationRoute extends Route {
|
|
241
241
|
@action
|
|
@@ -281,7 +281,7 @@ ForbiddenError.prototype.code = 'ForbiddenError';
|
|
|
281
281
|
for a specific model that does not exist. For example:
|
|
282
282
|
|
|
283
283
|
```js [app/routes/post.js]
|
|
284
|
-
import { NotFoundError } from '@
|
|
284
|
+
import { NotFoundError } from '@warp-drive/legacy/adapter/error';
|
|
285
285
|
|
|
286
286
|
export default class PostRoute extends Route {
|
|
287
287
|
@service store;
|
package/dist/compat/builders.js
CHANGED
|
@@ -9,16 +9,16 @@ import { storeFor, recordIdentifierFor } from '@warp-drive/core';
|
|
|
9
9
|
When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.
|
|
10
10
|
Additionally, it takes the same options as `store.findAll`.
|
|
11
11
|
|
|
12
|
-
All `@
|
|
12
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
13
13
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
14
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
14
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
15
15
|
|
|
16
16
|
@deprecated
|
|
17
17
|
@public
|
|
18
|
-
@param
|
|
19
|
-
@param
|
|
20
|
-
@param
|
|
21
|
-
@return
|
|
18
|
+
@param type the name of the resource
|
|
19
|
+
@param query a query to be used by the adapter
|
|
20
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.findAll
|
|
21
|
+
@return request config
|
|
22
22
|
*/
|
|
23
23
|
function findAllBuilder(type, options = {}) {
|
|
24
24
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -51,7 +51,7 @@ function findAllBuilder(type, options = {}) {
|
|
|
51
51
|
**Example 1**
|
|
52
52
|
|
|
53
53
|
```ts
|
|
54
|
-
import { findRecord } from '@
|
|
54
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
55
55
|
const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -62,20 +62,20 @@ function findAllBuilder(type, options = {}) {
|
|
|
62
62
|
the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)
|
|
63
63
|
|
|
64
64
|
```ts
|
|
65
|
-
import { findRecord } from '@
|
|
65
|
+
import { findRecord } from '@warp-drive/legacy/compat/builders';
|
|
66
66
|
const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
All `@
|
|
69
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
70
70
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
71
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
71
|
+
To that end, these builders are deprecated and will be removed in a future version of Warp Drive.
|
|
72
72
|
|
|
73
73
|
@deprecated
|
|
74
74
|
@public
|
|
75
|
-
@param
|
|
76
|
-
@param
|
|
77
|
-
@param
|
|
78
|
-
@return
|
|
75
|
+
@param resource - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record
|
|
76
|
+
@param id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved
|
|
77
|
+
@param options - if the first param is a string this will be the optional options for the request. See examples for available options.
|
|
78
|
+
@return request config
|
|
79
79
|
*/
|
|
80
80
|
function findRecordBuilder(resource, idOrOptions, options) {
|
|
81
81
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -118,16 +118,16 @@ function findRecordBuilder(resource, idOrOptions, options) {
|
|
|
118
118
|
When passed to `store.request`, this config will result in the same behavior as a `store.query` request.
|
|
119
119
|
Additionally, it takes the same options as `store.query`.
|
|
120
120
|
|
|
121
|
-
All `@
|
|
121
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
122
122
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
123
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
123
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
124
124
|
|
|
125
125
|
@deprecated
|
|
126
126
|
@public
|
|
127
|
-
@param
|
|
128
|
-
@param
|
|
129
|
-
@param
|
|
130
|
-
@return
|
|
127
|
+
@param type the name of the resource
|
|
128
|
+
@param query a query to be used by the adapter
|
|
129
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
130
|
+
@return request config
|
|
131
131
|
*/
|
|
132
132
|
function queryBuilder(type, query, options = {}) {
|
|
133
133
|
macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) ? (test => {
|
|
@@ -163,16 +163,16 @@ function queryBuilder(type, query, options = {}) {
|
|
|
163
163
|
When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.
|
|
164
164
|
Additionally, it takes the same options as `store.queryRecord`.
|
|
165
165
|
|
|
166
|
-
All `@
|
|
166
|
+
All `@warp-drive/legacy/compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.
|
|
167
167
|
This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.
|
|
168
|
-
To that end, these builders are deprecated and will be removed in a future version of
|
|
168
|
+
To that end, these builders are deprecated and will be removed in a future version of WarpDrive.
|
|
169
169
|
|
|
170
170
|
@deprecated
|
|
171
171
|
@public
|
|
172
|
-
@param
|
|
173
|
-
@param
|
|
174
|
-
@param
|
|
175
|
-
@return
|
|
172
|
+
@param type the name of the resource
|
|
173
|
+
@param query a query to be used by the adapter
|
|
174
|
+
@param options optional, may include `adapterOptions` hash which will be passed to adapter.query
|
|
175
|
+
@return request config
|
|
176
176
|
*/
|
|
177
177
|
|
|
178
178
|
function queryRecordBuilder(type, query, options) {
|
package/dist/compat/utils.js
CHANGED
package/dist/compat.js
CHANGED
|
@@ -931,7 +931,7 @@ function normalize(modelName, payload) {
|
|
|
931
931
|
serializer.
|
|
932
932
|
|
|
933
933
|
```js [app/serializers/application.js]
|
|
934
|
-
import RESTSerializer from '@
|
|
934
|
+
import RESTSerializer from '@warp-drive/legacy/serializer/rest';
|
|
935
935
|
|
|
936
936
|
export default class ApplicationSerializer extends RESTSerializer;
|
|
937
937
|
```
|
|
@@ -956,13 +956,13 @@ function normalize(modelName, payload) {
|
|
|
956
956
|
will determine which serializer will process the payload.
|
|
957
957
|
|
|
958
958
|
```js [app/serializers/application.js]
|
|
959
|
-
import RESTSerializer from '@
|
|
959
|
+
import RESTSerializer from '@warp-drive/legacy/serializer/rest';
|
|
960
960
|
|
|
961
961
|
export default class ApplicationSerializer extends RESTSerializer;
|
|
962
962
|
```
|
|
963
963
|
|
|
964
964
|
```js [app/serializers/post.js]
|
|
965
|
-
import JSONSerializer from '@
|
|
965
|
+
import JSONSerializer from '@warp-drive/legacy/serializer/json';
|
|
966
966
|
|
|
967
967
|
export default JSONSerializer;
|
|
968
968
|
```
|