@warp-drive/legacy 5.8.0-alpha.30 → 5.8.0-alpha.34
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 +30 -6
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { type InstanceCache } from "@warp-drive/core/store/-private";
|
|
2
|
+
import type { NewResourceKey, ResourceKey } from "@warp-drive/core/types/identifier";
|
|
3
|
+
import type { Value } from "@warp-drive/core/types/json/raw";
|
|
4
|
+
import type { OpaqueRecordInstance, TypedRecordInstance, TypeFromInstance } from "@warp-drive/core/types/record";
|
|
5
|
+
import type { LegacyAttributeField, LegacyRelationshipField } from "@warp-drive/core/types/schema/fields";
|
|
6
|
+
import type { SingleResourceDocument } from "@warp-drive/core/types/spec/json-api-raw";
|
|
7
|
+
import type { Store } from "../store.js";
|
|
8
|
+
export declare function preloadData(store: Store, identifier: NewResourceKey, preload: Record<string, Value>): void;
|
|
9
|
+
export interface BaseFinderOptions {
|
|
10
|
+
reload?: boolean;
|
|
11
|
+
backgroundReload?: boolean;
|
|
12
|
+
include?: string | string[];
|
|
13
|
+
adapterOptions?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface FindRecordOptions extends BaseFinderOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Data to preload into the store before the request is made.
|
|
18
|
+
* This feature is *highly* discouraged and has no corresponding
|
|
19
|
+
* feature when using builders and handlers.
|
|
20
|
+
*
|
|
21
|
+
* Excepting relationships: the data should be in the form of a
|
|
22
|
+
* JSON object where the keys are fields on the record and the value
|
|
23
|
+
* is the raw value to be added to the cache.
|
|
24
|
+
*
|
|
25
|
+
* Relationships can either be provided as string IDs from which
|
|
26
|
+
* an identifier will be built base upon the relationship's expected
|
|
27
|
+
* resource type, or be record instances from which the identifier
|
|
28
|
+
* will be extracted.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
preload?: Record<string, Value>;
|
|
32
|
+
}
|
|
33
|
+
export type QueryOptions = { [K in string | "adapterOptions"]? : K extends "adapterOptions" ? Record<string, unknown> : unknown };
|
|
34
|
+
export type FindAllOptions = BaseFinderOptions;
|
|
35
|
+
export type LegacyResourceQuery = {
|
|
36
|
+
include?: string | string[];
|
|
37
|
+
[key: string]: Value | undefined;
|
|
38
|
+
};
|
|
39
|
+
export type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;
|
|
40
|
+
/**
|
|
41
|
+
* Minimum subset of static schema methods and properties on the
|
|
42
|
+
* "model" class.
|
|
43
|
+
*
|
|
44
|
+
* Only used when using the legacy schema-service implementation
|
|
45
|
+
* for @ember-data/model or when wrapping schema for legacy
|
|
46
|
+
* Adapters/Serializers.
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export interface ModelSchema<T = unknown> {
|
|
50
|
+
modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
51
|
+
fields: Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
|
|
52
|
+
attributes: Map<KeyOrString<T>, LegacyAttributeField>;
|
|
53
|
+
relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;
|
|
54
|
+
eachAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
|
|
55
|
+
eachRelationship<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
|
|
56
|
+
eachTransformedAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, type: string | null) => void, binding?: T): void;
|
|
57
|
+
}
|
|
58
|
+
export declare function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: ResourceKey): boolean;
|
|
59
|
+
/**
|
|
60
|
+
A `RecordReference` is a low-level API that allows users and
|
|
61
|
+
addon authors to perform meta-operations on a record.
|
|
62
|
+
|
|
63
|
+
@hideconstructor
|
|
64
|
+
@public
|
|
65
|
+
*/
|
|
66
|
+
export declare class RecordReference {
|
|
67
|
+
constructor(store: Store, identifier: ResourceKey);
|
|
68
|
+
get type(): string;
|
|
69
|
+
/**
|
|
70
|
+
The `id` of the record that this reference refers to.
|
|
71
|
+
|
|
72
|
+
Together, the `type` and `id` properties form a composite key for
|
|
73
|
+
the identity map.
|
|
74
|
+
|
|
75
|
+
Example
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
let userRef = store.getReference('user', 1);
|
|
79
|
+
|
|
80
|
+
userRef.id(); // '1'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
@public
|
|
84
|
+
@return The id of the record.
|
|
85
|
+
*/
|
|
86
|
+
id(): string | null;
|
|
87
|
+
/**
|
|
88
|
+
The `identifier` of the record that this reference refers to.
|
|
89
|
+
|
|
90
|
+
Together, the `type` and `id` properties form a composite key for
|
|
91
|
+
the identity map.
|
|
92
|
+
|
|
93
|
+
Example
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
let userRef = store.getReference('user', 1);
|
|
97
|
+
|
|
98
|
+
userRef.identifier(); // '1'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
@public
|
|
102
|
+
@return The identifier of the record.
|
|
103
|
+
*/
|
|
104
|
+
identifier(): ResourceKey;
|
|
105
|
+
/**
|
|
106
|
+
How the reference will be looked up when it is loaded. Currently
|
|
107
|
+
this always returns `identity` to signify that a record will be
|
|
108
|
+
loaded by its `type` and `id`.
|
|
109
|
+
|
|
110
|
+
Example
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
const userRef = store.getReference('user', 1);
|
|
114
|
+
|
|
115
|
+
userRef.remoteType(); // 'identity'
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
@public
|
|
119
|
+
*/
|
|
120
|
+
remoteType(): "identity";
|
|
121
|
+
/**
|
|
122
|
+
This API allows you to provide a reference with new data. The
|
|
123
|
+
simplest usage of this API is similar to `store.push`: you provide a
|
|
124
|
+
normalized hash of data and the object represented by the reference
|
|
125
|
+
will update.
|
|
126
|
+
|
|
127
|
+
If you pass a promise to `push`, Ember Data will not ask the adapter
|
|
128
|
+
for the data if another attempt to fetch it is made in the
|
|
129
|
+
interim. When the promise resolves, the underlying object is updated
|
|
130
|
+
with the new data, and the promise returned by *this function* is resolved
|
|
131
|
+
with that object.
|
|
132
|
+
|
|
133
|
+
For example, `recordReference.push(promise)` will be resolved with a
|
|
134
|
+
record.
|
|
135
|
+
|
|
136
|
+
Example
|
|
137
|
+
|
|
138
|
+
```javascript
|
|
139
|
+
let userRef = store.getReference('user', 1);
|
|
140
|
+
|
|
141
|
+
// provide data for reference
|
|
142
|
+
userRef.push({
|
|
143
|
+
data: {
|
|
144
|
+
id: "1",
|
|
145
|
+
type: "user",
|
|
146
|
+
attributes: {
|
|
147
|
+
username: "@user"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}).then(function(user) {
|
|
151
|
+
userRef.value() === user;
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
@public
|
|
156
|
+
@param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
|
|
157
|
+
@return a promise for the value (record or relationship)
|
|
158
|
+
*/
|
|
159
|
+
push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance>;
|
|
160
|
+
/**
|
|
161
|
+
If the entity referred to by the reference is already loaded, it is
|
|
162
|
+
present as `reference.value`. Otherwise the value returned by this function
|
|
163
|
+
is `null`.
|
|
164
|
+
|
|
165
|
+
Example
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
let userRef = store.getReference('user', 1);
|
|
169
|
+
|
|
170
|
+
userRef.value(); // user
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
@public
|
|
174
|
+
@return {Model} the record for this RecordReference
|
|
175
|
+
*/
|
|
176
|
+
value(): OpaqueRecordInstance | null;
|
|
177
|
+
/**
|
|
178
|
+
Triggers a fetch for the backing entity based on its `remoteType`
|
|
179
|
+
(see `remoteType` definitions per reference type).
|
|
180
|
+
|
|
181
|
+
Example
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
let userRef = store.getReference('user', 1);
|
|
185
|
+
|
|
186
|
+
// load user (via store.find)
|
|
187
|
+
userRef.load().then(...)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
@public
|
|
191
|
+
@return the record for this RecordReference
|
|
192
|
+
*/
|
|
193
|
+
load(): Promise<unknown>;
|
|
194
|
+
/**
|
|
195
|
+
Reloads the record if it is already loaded. If the record is not
|
|
196
|
+
loaded it will load the record via `store.findRecord`
|
|
197
|
+
|
|
198
|
+
Example
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
let userRef = store.getReference('user', 1);
|
|
202
|
+
|
|
203
|
+
// or trigger a reload
|
|
204
|
+
userRef.reload().then(...)
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
@public
|
|
208
|
+
@return the record for this RecordReference
|
|
209
|
+
*/
|
|
210
|
+
reload(): Promise<unknown>;
|
|
211
|
+
}
|
|
212
|
+
export declare function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
|
|
213
|
+
export declare class ShimModelClass<T = unknown> implements ModelSchema<T> {
|
|
214
|
+
__store: Store;
|
|
215
|
+
modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
216
|
+
constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string);
|
|
217
|
+
get fields(): Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
|
|
218
|
+
get attributes(): Map<KeyOrString<T>, LegacyAttributeField>;
|
|
219
|
+
get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField>;
|
|
220
|
+
eachAttribute<K extends KeyOrString<T>>(callback: (key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
|
|
221
|
+
eachRelationship<K extends KeyOrString<T>>(callback: (key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
|
|
222
|
+
eachTransformedAttribute<K extends KeyOrString<T>>(callback: (key: K, type: string | null) => void, binding?: T): void;
|
|
223
|
+
}
|