@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,33 @@
|
|
|
1
|
+
import Mixin from "@ember/object/mixin";
|
|
2
|
+
import type { Snapshot, SnapshotRecordArray } from "../../compat/-private.js";
|
|
3
|
+
export interface BuildURLMixin {
|
|
4
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: "findRecord"): string;
|
|
5
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: null, snapshot: SnapshotRecordArray, requestType: "findAll"): string;
|
|
6
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: null, snapshot: null, requestType: "query", query: Record<string, unknown>): string;
|
|
7
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: null, snapshot: null, requestType: "queryRecord", query: Record<string, unknown>): string;
|
|
8
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string[], snapshot: Snapshot[], requestType: "findMany"): string;
|
|
9
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: "findHasMany"): string;
|
|
10
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: "findBelongsTo"): string;
|
|
11
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string | null, snapshot: Snapshot, requestType: "createRecord"): string;
|
|
12
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: "updateRecord"): string;
|
|
13
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot, requestType: "deleteRecord"): string;
|
|
14
|
+
buildURL(this: MixtBuildURLMixin, modelName: string, id: string, snapshot: Snapshot): string;
|
|
15
|
+
_buildURL(this: MixtBuildURLMixin, modelName: string | null | undefined, id?: string | null): string;
|
|
16
|
+
urlForFindRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
|
|
17
|
+
urlForFindAll(this: MixtBuildURLMixin, modelName: string, snapshots: SnapshotRecordArray): string;
|
|
18
|
+
urlForQueryRecord(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string;
|
|
19
|
+
urlForQuery(this: MixtBuildURLMixin, query: Record<string, unknown>, modelName: string): string;
|
|
20
|
+
urlForFindMany(this: MixtBuildURLMixin, ids: string[], modelName: string, snapshots: Snapshot[]): string;
|
|
21
|
+
urlForFindHasMany(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
|
|
22
|
+
urlForFindBelongsTo(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
|
|
23
|
+
urlForCreateRecord(this: MixtBuildURLMixin, modelName: string, snapshot: Snapshot): string;
|
|
24
|
+
urlForUpdateRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
|
|
25
|
+
urlForDeleteRecord(this: MixtBuildURLMixin, id: string, modelName: string, snapshot: Snapshot): string;
|
|
26
|
+
urlPrefix(this: MixtBuildURLMixin, path?: string | null, parentURL?: string): string;
|
|
27
|
+
pathForType(this: MixtBuildURLMixin, modelName: string): string;
|
|
28
|
+
}
|
|
29
|
+
export interface MixtBuildURLMixin extends BuildURLMixin {
|
|
30
|
+
host: string | null;
|
|
31
|
+
namespace: string | null;
|
|
32
|
+
}
|
|
33
|
+
export declare const BuildURLMixin: Mixin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type FetchFunction = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
type MockRequest = {
|
|
3
|
+
protocol?: string;
|
|
4
|
+
get(key: string): string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare function getFetchFunction(): FetchFunction;
|
|
7
|
+
export declare function setupFastboot(fastBootRequest: MockRequest): void;
|
|
8
|
+
export {};
|
package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/parse-response-headers.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseResponseHeaders(headersString: string): Record<string, string>;
|
package/dist/unpkg/dev-deprecated/declarations/adapter/-private/utils/serialize-into-hash.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Store } from "@warp-drive/core";
|
|
2
|
+
import type { ModelSchema } from "@warp-drive/core/types";
|
|
3
|
+
import { type Snapshot } from "../../../compat/-private.js";
|
|
4
|
+
export declare function serializeIntoHash(store: Store, modelClass: ModelSchema, snapshot: Snapshot, options?: {
|
|
5
|
+
includeId?: boolean;
|
|
6
|
+
}): object;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { parseResponseHeaders } from "./-private/utils/parse-response-headers.js";
|
|
2
|
+
export { determineBodyPromise } from "./-private/utils/determine-body-promise.js";
|
|
3
|
+
export { serializeQueryParams } from "./-private/utils/serialize-query-params.js";
|
|
4
|
+
export { getFetchFunction as fetch, setupFastboot } from "./-private/utils/fetch.js";
|
|
5
|
+
export { serializeIntoHash } from "./-private/utils/serialize-into-hash.js";
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { ApiError } from "@warp-drive/core/types/spec/error";
|
|
2
|
+
export interface AdapterRequestError<T extends string = string> extends Error {
|
|
3
|
+
isAdapterError: true;
|
|
4
|
+
code: T;
|
|
5
|
+
errors: ApiError[];
|
|
6
|
+
}
|
|
7
|
+
export interface AdapterRequestErrorConstructor<Instance extends AdapterRequestError = AdapterRequestError> {
|
|
8
|
+
new (errors?: unknown[], message?: string): Instance;
|
|
9
|
+
extend(options: {
|
|
10
|
+
message: string;
|
|
11
|
+
}): AdapterRequestErrorConstructor;
|
|
12
|
+
}
|
|
13
|
+
export type AdapterError = AdapterRequestError<"AdapterError">;
|
|
14
|
+
export declare const AdapterError: AdapterRequestErrorConstructor<AdapterError>;
|
|
15
|
+
/**
|
|
16
|
+
A `InvalidError` is used by an adapter to signal the external API
|
|
17
|
+
was unable to process a request because the content was not
|
|
18
|
+
semantically correct or meaningful per the API. Usually, this means a
|
|
19
|
+
record failed some form of server-side validation. When a promise
|
|
20
|
+
from an adapter is rejected with a `InvalidError` the record will
|
|
21
|
+
transition to the `invalid` state and the errors will be set to the
|
|
22
|
+
`errors` property on the record.
|
|
23
|
+
|
|
24
|
+
For Ember Data to correctly map errors to their corresponding
|
|
25
|
+
properties on the model, Ember Data expects each error to be
|
|
26
|
+
a valid JSON-API error object with a `source/pointer` that matches
|
|
27
|
+
the property name. For example, if you had a Post model that
|
|
28
|
+
looked like this.
|
|
29
|
+
|
|
30
|
+
```js [app/models/post.js]
|
|
31
|
+
import { Model, attr } from '@warp-drive/legacy/model';
|
|
32
|
+
|
|
33
|
+
export default class PostModel extends Model {
|
|
34
|
+
@attr('string') title;
|
|
35
|
+
@attr('string') content;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
To show an error from the server related to the `title` and
|
|
40
|
+
`content` properties your adapter could return a promise that
|
|
41
|
+
rejects with a `InvalidError` object that looks like this:
|
|
42
|
+
|
|
43
|
+
```js [app/adapters/post.js]
|
|
44
|
+
import RSVP from 'RSVP';
|
|
45
|
+
import RESTAdapter from '@warp-drive/legacy/adapter/rest';
|
|
46
|
+
import { InvalidError } from '@warp-drive/legacy/adapter/error';
|
|
47
|
+
|
|
48
|
+
export default class ApplicationAdapter extends RESTAdapter {
|
|
49
|
+
updateRecord() {
|
|
50
|
+
// Fictional adapter that always rejects
|
|
51
|
+
return RSVP.reject(new InvalidError([
|
|
52
|
+
{
|
|
53
|
+
detail: 'Must be unique',
|
|
54
|
+
source: { pointer: '/data/attributes/title' }
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
detail: 'Must not be blank',
|
|
58
|
+
source: { pointer: '/data/attributes/content'}
|
|
59
|
+
}
|
|
60
|
+
]));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Your backend may use different property names for your records the
|
|
66
|
+
store will attempt to extract and normalize the errors using the
|
|
67
|
+
serializer's `extractErrors` method before the errors get added to
|
|
68
|
+
the model. As a result, it is safe for the `InvalidError` to
|
|
69
|
+
wrap the error payload unaltered.
|
|
70
|
+
|
|
71
|
+
@class InvalidError
|
|
72
|
+
@public
|
|
73
|
+
*/
|
|
74
|
+
export type InvalidError = AdapterRequestError<"InvalidError">;
|
|
75
|
+
export declare const InvalidError: AdapterRequestErrorConstructor<InvalidError>;
|
|
76
|
+
/**
|
|
77
|
+
A `TimeoutError` is used by an adapter to signal that a request
|
|
78
|
+
to the external API has timed out. I.e. no response was received from
|
|
79
|
+
the external API within an allowed time period.
|
|
80
|
+
|
|
81
|
+
An example use case would be to warn the user to check their internet
|
|
82
|
+
connection if an adapter operation has timed out:
|
|
83
|
+
|
|
84
|
+
```js [app/routes/application.js]
|
|
85
|
+
import { TimeoutError } from '@warp-drive/legacy/adapter/error';
|
|
86
|
+
|
|
87
|
+
export default class ApplicationRoute extends Route {
|
|
88
|
+
@action
|
|
89
|
+
error(error, transition) {
|
|
90
|
+
if (error instanceof TimeoutError) {
|
|
91
|
+
// alert the user
|
|
92
|
+
alert('Are you still connected to the Internet?');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ...other error handling logic
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
@class TimeoutError
|
|
102
|
+
@public
|
|
103
|
+
*/
|
|
104
|
+
export type TimeoutError = AdapterRequestError<"TimeoutError">;
|
|
105
|
+
export declare const TimeoutError: AdapterRequestErrorConstructor<TimeoutError>;
|
|
106
|
+
/**
|
|
107
|
+
A `AbortError` is used by an adapter to signal that a request to
|
|
108
|
+
the external API was aborted. For example, this can occur if the user
|
|
109
|
+
navigates away from the current page after a request to the external API
|
|
110
|
+
has been initiated but before a response has been received.
|
|
111
|
+
|
|
112
|
+
@class AbortError
|
|
113
|
+
@public
|
|
114
|
+
*/
|
|
115
|
+
export type AbortError = AdapterRequestError<"AbortError">;
|
|
116
|
+
export declare const AbortError: AdapterRequestErrorConstructor<AbortError>;
|
|
117
|
+
/**
|
|
118
|
+
A `UnauthorizedError` equates to a HTTP `401 Unauthorized` response
|
|
119
|
+
status. It is used by an adapter to signal that a request to the external
|
|
120
|
+
API was rejected because authorization is required and has failed or has not
|
|
121
|
+
yet been provided.
|
|
122
|
+
|
|
123
|
+
An example use case would be to redirect the user to a login route if a
|
|
124
|
+
request is unauthorized:
|
|
125
|
+
|
|
126
|
+
```js [app/routes/application.js]
|
|
127
|
+
import { UnauthorizedError } from '@warp-drive/legacy/adapter/error';
|
|
128
|
+
|
|
129
|
+
export default class ApplicationRoute extends Route {
|
|
130
|
+
@action
|
|
131
|
+
error(error, transition) {
|
|
132
|
+
if (error instanceof UnauthorizedError) {
|
|
133
|
+
// go to the login route
|
|
134
|
+
this.transitionTo('login');
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ...other error handling logic
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
@class UnauthorizedError
|
|
144
|
+
@public
|
|
145
|
+
*/
|
|
146
|
+
export type UnauthorizedError = AdapterRequestError<"UnauthorizedError">;
|
|
147
|
+
export declare const UnauthorizedError: AdapterRequestErrorConstructor<UnauthorizedError>;
|
|
148
|
+
/**
|
|
149
|
+
A `ForbiddenError` equates to a HTTP `403 Forbidden` response status.
|
|
150
|
+
It is used by an adapter to signal that a request to the external API was
|
|
151
|
+
valid but the server is refusing to respond to it. If authorization was
|
|
152
|
+
provided and is valid, then the authenticated user does not have the
|
|
153
|
+
necessary permissions for the request.
|
|
154
|
+
|
|
155
|
+
@class ForbiddenError
|
|
156
|
+
@public
|
|
157
|
+
*/
|
|
158
|
+
export type ForbiddenError = AdapterRequestError<"ForbiddenError">;
|
|
159
|
+
export declare const ForbiddenError: AdapterRequestErrorConstructor<ForbiddenError>;
|
|
160
|
+
/**
|
|
161
|
+
A `NotFoundError` equates to a HTTP `404 Not Found` response status.
|
|
162
|
+
It is used by an adapter to signal that a request to the external API
|
|
163
|
+
was rejected because the resource could not be found on the API.
|
|
164
|
+
|
|
165
|
+
An example use case would be to detect if the user has entered a route
|
|
166
|
+
for a specific model that does not exist. For example:
|
|
167
|
+
|
|
168
|
+
```js [app/routes/post.js]
|
|
169
|
+
import { NotFoundError } from '@warp-drive/legacy/adapter/error';
|
|
170
|
+
|
|
171
|
+
export default class PostRoute extends Route {
|
|
172
|
+
@service store;
|
|
173
|
+
model(params) {
|
|
174
|
+
return this.store.findRecord('post', params.post_id);
|
|
175
|
+
}
|
|
176
|
+
@action
|
|
177
|
+
error(error, transition) {
|
|
178
|
+
if (error instanceof NotFoundError) {
|
|
179
|
+
// redirect to a list of all posts instead
|
|
180
|
+
this.transitionTo('posts');
|
|
181
|
+
} else {
|
|
182
|
+
// otherwise let the error bubble
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
@class NotFoundError
|
|
190
|
+
@public
|
|
191
|
+
*/
|
|
192
|
+
export type NotFoundError = AdapterRequestError<"NotFoundError">;
|
|
193
|
+
export declare const NotFoundError: AdapterRequestErrorConstructor<NotFoundError>;
|
|
194
|
+
/**
|
|
195
|
+
A `ConflictError` equates to a HTTP `409 Conflict` response status.
|
|
196
|
+
It is used by an adapter to indicate that the request could not be processed
|
|
197
|
+
because of a conflict in the request. An example scenario would be when
|
|
198
|
+
creating a record with a client-generated ID but that ID is already known
|
|
199
|
+
to the external API.
|
|
200
|
+
|
|
201
|
+
@class ConflictError
|
|
202
|
+
@public
|
|
203
|
+
*/
|
|
204
|
+
export type ConflictError = AdapterRequestError<"ConflictError">;
|
|
205
|
+
export declare const ConflictError: AdapterRequestErrorConstructor<ConflictError>;
|
|
206
|
+
/**
|
|
207
|
+
A `ServerError` equates to a HTTP `500 Internal Server Error` response
|
|
208
|
+
status. It is used by the adapter to indicate that a request has failed
|
|
209
|
+
because of an error in the external API.
|
|
210
|
+
|
|
211
|
+
@class ServerError
|
|
212
|
+
@public
|
|
213
|
+
*/
|
|
214
|
+
export type ServerError = AdapterRequestError<"ServerError">;
|
|
215
|
+
export declare const ServerError: AdapterRequestErrorConstructor<ServerError>;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import type { Store } from "@warp-drive/core";
|
|
2
|
+
import type { ModelSchema } from "@warp-drive/core/types";
|
|
3
|
+
import type { HTTPMethod } from "@warp-drive/core/types/request";
|
|
4
|
+
import type { AdapterPayload } from "../compat.js";
|
|
5
|
+
import type { Snapshot, SnapshotRecordArray } from "../compat/-private.js";
|
|
6
|
+
import type { FetchRequestInit, JQueryRequestInit, QueryState } from "./rest.js";
|
|
7
|
+
import { RESTAdapter } from "./rest.js";
|
|
8
|
+
/**
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
:::danger
|
|
12
|
+
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
13
|
+
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
14
|
+
{@link Handler} instead to be used with the {@link RequestManager}
|
|
15
|
+
:::
|
|
16
|
+
|
|
17
|
+
The `JSONAPIAdapter` is an adapter whichtransforms the store's
|
|
18
|
+
requests into HTTP requests that follow the [JSON API format](http://jsonapi.org/format/).
|
|
19
|
+
|
|
20
|
+
## JSON API Conventions
|
|
21
|
+
|
|
22
|
+
The JSONAPIAdapter uses JSON API conventions for building the URL
|
|
23
|
+
for a record and selecting the HTTP verb to use with a request. The
|
|
24
|
+
actions you can take on a record map onto the following URLs in the
|
|
25
|
+
JSON API adapter:
|
|
26
|
+
|
|
27
|
+
<table>
|
|
28
|
+
<tr>
|
|
29
|
+
<th>
|
|
30
|
+
Action
|
|
31
|
+
</th>
|
|
32
|
+
<th>
|
|
33
|
+
HTTP Verb
|
|
34
|
+
</th>
|
|
35
|
+
<th>
|
|
36
|
+
URL
|
|
37
|
+
</th>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<th>
|
|
41
|
+
`store.findRecord('post', 123)`
|
|
42
|
+
</th>
|
|
43
|
+
<td>
|
|
44
|
+
GET
|
|
45
|
+
</td>
|
|
46
|
+
<td>
|
|
47
|
+
/posts/123
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<th>
|
|
52
|
+
`store.findAll('post')`
|
|
53
|
+
</th>
|
|
54
|
+
<td>
|
|
55
|
+
GET
|
|
56
|
+
</td>
|
|
57
|
+
<td>
|
|
58
|
+
/posts
|
|
59
|
+
</td>
|
|
60
|
+
</tr>
|
|
61
|
+
<tr>
|
|
62
|
+
<th>
|
|
63
|
+
Update `postRecord.save()`
|
|
64
|
+
</th>
|
|
65
|
+
<td>
|
|
66
|
+
PATCH
|
|
67
|
+
</td>
|
|
68
|
+
<td>
|
|
69
|
+
/posts/123
|
|
70
|
+
</td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<th>
|
|
74
|
+
Create `store.createRecord('post').save()`
|
|
75
|
+
</th>
|
|
76
|
+
<td>
|
|
77
|
+
POST
|
|
78
|
+
</td>
|
|
79
|
+
<td>
|
|
80
|
+
/posts
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
<tr>
|
|
84
|
+
<th>
|
|
85
|
+
Delete `postRecord.destroyRecord()`
|
|
86
|
+
</th>
|
|
87
|
+
<td>
|
|
88
|
+
DELETE
|
|
89
|
+
</td>
|
|
90
|
+
<td>
|
|
91
|
+
/posts/123
|
|
92
|
+
</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</table>
|
|
95
|
+
|
|
96
|
+
## Success and failure
|
|
97
|
+
|
|
98
|
+
The JSONAPIAdapter will consider a success any response with a
|
|
99
|
+
status code of the 2xx family ("Success"), as well as 304 ("Not
|
|
100
|
+
Modified"). Any other status code will be considered a failure.
|
|
101
|
+
|
|
102
|
+
On success, the request promise will be resolved with the full
|
|
103
|
+
response payload.
|
|
104
|
+
|
|
105
|
+
Failed responses with status code 422 ("Unprocessable Entity") will
|
|
106
|
+
be considered "invalid". The response will be discarded, except for
|
|
107
|
+
the `errors` key. The request promise will be rejected with a
|
|
108
|
+
`InvalidError`. This error object will encapsulate the saved
|
|
109
|
+
`errors` value.
|
|
110
|
+
|
|
111
|
+
Any other status codes will be treated as an adapter error. The
|
|
112
|
+
request promise will be rejected, similarly to the invalid case,
|
|
113
|
+
but with an instance of `AdapterError` instead.
|
|
114
|
+
|
|
115
|
+
### Endpoint path customization
|
|
116
|
+
|
|
117
|
+
Endpoint paths can be prefixed with a `namespace` by setting the
|
|
118
|
+
namespace property on the adapter:
|
|
119
|
+
|
|
120
|
+
```js [app/adapters/application.js]
|
|
121
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
122
|
+
|
|
123
|
+
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
124
|
+
namespace = 'api/1';
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
Requests for the `person` model would now target `/api/1/people/1`.
|
|
128
|
+
|
|
129
|
+
### Host customization
|
|
130
|
+
|
|
131
|
+
An adapter can target other hosts by setting the `host` property.
|
|
132
|
+
|
|
133
|
+
```js [app/adapters/application.js]
|
|
134
|
+
import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
|
|
135
|
+
|
|
136
|
+
export default class ApplicationAdapter extends JSONAPIAdapter {
|
|
137
|
+
host = 'https://api.example.com';
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Requests for the `person` model would now target
|
|
142
|
+
`https://api.example.com/people/1`.
|
|
143
|
+
|
|
144
|
+
@since 1.13.0
|
|
145
|
+
@class JSONAPIAdapter
|
|
146
|
+
@public
|
|
147
|
+
@constructor
|
|
148
|
+
*/
|
|
149
|
+
declare class JSONAPIAdapter extends RESTAdapter {
|
|
150
|
+
_defaultContentType: string;
|
|
151
|
+
/**
|
|
152
|
+
@private
|
|
153
|
+
@param {String} url
|
|
154
|
+
@param {String} type The request type GET, POST, PUT, DELETE etc.
|
|
155
|
+
@param {Object} options
|
|
156
|
+
@return {Object}
|
|
157
|
+
*/
|
|
158
|
+
ajaxOptions(url: string, type: HTTPMethod, options?: JQueryAjaxSettings | RequestInit): JQueryRequestInit | FetchRequestInit;
|
|
159
|
+
/**
|
|
160
|
+
By default the JSONAPIAdapter will send each find request coming from a `store.find`
|
|
161
|
+
or from accessing a relationship separately to the server. If your server supports passing
|
|
162
|
+
ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests
|
|
163
|
+
within a single runloop.
|
|
164
|
+
|
|
165
|
+
For example, if you have an initial payload of:
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
{
|
|
169
|
+
data: {
|
|
170
|
+
id: 1,
|
|
171
|
+
type: 'post',
|
|
172
|
+
relationship: {
|
|
173
|
+
comments: {
|
|
174
|
+
data: [
|
|
175
|
+
{ id: 1, type: 'comment' },
|
|
176
|
+
{ id: 2, type: 'comment' }
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
By default calling `post.comments` will trigger the following requests(assuming the
|
|
185
|
+
comments haven't been loaded before):
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
GET /comments/1
|
|
189
|
+
GET /comments/2
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
If you set coalesceFindRequests to `true` it will instead trigger the following request:
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
GET /comments?filter[id]=1,2
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`
|
|
199
|
+
relationships accessed within the same runloop. If you set `coalesceFindRequests: true`
|
|
200
|
+
|
|
201
|
+
```javascript
|
|
202
|
+
store.findRecord('comment', 1);
|
|
203
|
+
store.findRecord('comment', 2);
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
will also send a request to: `GET /comments?filter[id]=1,2`
|
|
207
|
+
|
|
208
|
+
Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app
|
|
209
|
+
`groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.
|
|
210
|
+
|
|
211
|
+
@property coalesceFindRequests
|
|
212
|
+
@public
|
|
213
|
+
@type {Boolean}
|
|
214
|
+
*/
|
|
215
|
+
get coalesceFindRequests(): boolean;
|
|
216
|
+
set coalesceFindRequests(value: boolean);
|
|
217
|
+
findMany(store: Store, type: ModelSchema, ids: string[], snapshots: Snapshot[]): Promise<AdapterPayload>;
|
|
218
|
+
pathForType(modelName: string): string;
|
|
219
|
+
updateRecord(store: Store, schema: ModelSchema, snapshot: Snapshot): Promise<AdapterPayload>;
|
|
220
|
+
/**
|
|
221
|
+
Used by `findAll` and `findRecord` to build the query's `data` hash
|
|
222
|
+
supplied to the ajax method.
|
|
223
|
+
|
|
224
|
+
@since 2.5.0
|
|
225
|
+
@public
|
|
226
|
+
@param {Snapshot} snapshot
|
|
227
|
+
@return {Object}
|
|
228
|
+
*/
|
|
229
|
+
buildQuery(snapshot: Snapshot | SnapshotRecordArray): QueryState;
|
|
230
|
+
}
|
|
231
|
+
export { JSONAPIAdapter };
|