@warp-drive/legacy 5.9.0-beta.0 → 5.9.0-beta.2
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/README.md +6 -0
- package/dist/-private-DQ6Iap2t.js +193 -0
- package/dist/-private-DQ6Iap2t.js.map +1 -0
- package/dist/-private-DccRZQsm.js +904 -0
- package/dist/-private-DccRZQsm.js.map +1 -0
- package/dist/adapter/-private.d.ts +33 -0
- package/dist/adapter/-private.d.ts.map +1 -0
- package/dist/adapter/-private.js +3 -1
- package/dist/adapter/error.d.ts +2 -0
- package/dist/adapter/error.js +425 -311
- package/dist/adapter/error.js.map +1 -0
- package/{declarations → dist}/adapter/json-api.d.ts +31 -19
- package/dist/adapter/json-api.d.ts.map +1 -0
- package/dist/adapter/json-api.js +265 -131
- package/dist/adapter/json-api.js.map +1 -0
- package/dist/adapter/rest.d.ts +2 -0
- package/dist/adapter/rest.js +937 -1100
- package/dist/adapter/rest.js.map +1 -0
- package/dist/adapter-CARrK3-8.d.ts +784 -0
- package/dist/adapter-CARrK3-8.d.ts.map +1 -0
- package/dist/adapter-eYo2pIuM.js +1130 -0
- package/dist/adapter-eYo2pIuM.js.map +1 -0
- package/dist/adapter.d.ts +2 -0
- package/dist/adapter.js +1 -1251
- package/dist/compat/-private.d.ts +2 -0
- package/dist/compat/-private.js +3 -1
- package/dist/compat/builders.d.ts +169 -0
- package/dist/compat/builders.d.ts.map +1 -0
- package/dist/compat/builders.js +205 -246
- package/dist/compat/builders.js.map +1 -0
- package/dist/compat/extensions.d.ts +2 -0
- package/dist/compat/extensions.js +271 -233
- package/dist/compat/extensions.js.map +1 -0
- package/dist/compat/utils.d.ts +151 -0
- package/dist/compat/utils.d.ts.map +1 -0
- package/dist/compat/utils.js +189 -194
- package/dist/compat/utils.js.map +1 -0
- package/dist/compat-BbNNmTM-.d.ts +1386 -0
- package/dist/compat-BbNNmTM-.d.ts.map +1 -0
- package/dist/compat-DcHVxuuZ.js +734 -0
- package/dist/compat-DcHVxuuZ.js.map +1 -0
- package/dist/compat.d.ts +2 -0
- package/dist/compat.js +1 -1019
- package/dist/error-CzkyXr1Q.d.ts +435 -0
- package/dist/error-CzkyXr1Q.d.ts.map +1 -0
- package/dist/errors-BEEsrHbl.js +2134 -0
- package/dist/errors-BEEsrHbl.js.map +1 -0
- package/dist/extensions-DumNm4dA.d.ts +102 -0
- package/dist/extensions-DumNm4dA.d.ts.map +1 -0
- package/dist/index.d.ts +243 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +271 -188
- package/dist/index.js.map +1 -0
- package/dist/json-BXNPTlcH.js +1106 -0
- package/dist/json-BXNPTlcH.js.map +1 -0
- package/dist/model/-private.d.ts +3 -0
- package/dist/model/-private.js +3 -1
- package/dist/model/migration-support.d.ts +335 -0
- package/dist/model/migration-support.d.ts.map +1 -0
- package/dist/model/migration-support.js +506 -564
- package/dist/model/migration-support.js.map +1 -0
- package/dist/model-62hn5_PD.d.ts +3107 -0
- package/dist/model-62hn5_PD.d.ts.map +1 -0
- package/dist/model-DcXZdNMu.js +683 -0
- package/dist/model-DcXZdNMu.js.map +1 -0
- package/dist/model-fragments-DSqu0ptR.js +334 -0
- package/dist/model-fragments-DSqu0ptR.js.map +1 -0
- package/dist/model-fragments.d.ts +294 -0
- package/dist/model-fragments.d.ts.map +1 -0
- package/dist/model-fragments.js +2 -75
- package/dist/model.d.ts +404 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +3 -666
- package/{declarations/adapter/rest.d.ts → dist/rest-0NhtexIq.d.ts} +187 -103
- package/dist/rest-0NhtexIq.d.ts.map +1 -0
- package/dist/runtime--fcdnjmJ-DMTJ0Kb3.js +53 -0
- package/dist/runtime--fcdnjmJ-DMTJ0Kb3.js.map +1 -0
- package/dist/schema-provider-H4zNXtry.js +1929 -0
- package/dist/schema-provider-H4zNXtry.js.map +1 -0
- package/{declarations → dist}/serializer/json-api.d.ts +4 -1
- package/dist/serializer/json-api.d.ts.map +1 -0
- package/dist/serializer/json-api.js +527 -514
- package/dist/serializer/json-api.js.map +1 -0
- package/{declarations → dist}/serializer/json.d.ts +3 -0
- package/dist/serializer/json.d.ts.map +1 -0
- package/dist/serializer/json.js +3 -6
- package/{declarations/serializer/-private/embedded-records-mixin.d.ts → dist/serializer/rest.d.ts} +56 -1
- package/dist/serializer/rest.d.ts.map +1 -0
- package/dist/serializer/rest.js +958 -1200
- package/dist/serializer/rest.js.map +1 -0
- package/dist/serializer/transform.d.ts +313 -0
- package/dist/serializer/transform.d.ts.map +1 -0
- package/dist/serializer/transform.js +283 -260
- package/dist/serializer/transform.js.map +1 -0
- package/dist/serializer.d.ts +151 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/serializer.js +205 -208
- package/dist/serializer.js.map +1 -0
- package/dist/store-C4qYzXei.js +473 -0
- package/dist/store-C4qYzXei.js.map +1 -0
- package/dist/store.d.ts +13 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +1 -635
- package/dist/unpkg/dev/-private-CrEyBE-B.js +189 -0
- package/dist/unpkg/dev/-private-CrEyBE-B.js.map +1 -0
- package/dist/unpkg/dev/-private-vOhxVExH.js +896 -0
- package/dist/unpkg/dev/-private-vOhxVExH.js.map +1 -0
- package/dist/unpkg/dev/adapter/-private.js +3 -1
- package/dist/unpkg/dev/adapter/error.js +424 -310
- package/dist/unpkg/dev/adapter/error.js.map +1 -0
- package/dist/unpkg/dev/adapter/json-api.js +239 -245
- package/dist/unpkg/dev/adapter/json-api.js.map +1 -0
- package/dist/unpkg/dev/adapter/rest.js +935 -1098
- package/dist/unpkg/dev/adapter/rest.js.map +1 -0
- package/dist/unpkg/dev/adapter-oLwyr47q.js +1129 -0
- package/dist/unpkg/dev/adapter-oLwyr47q.js.map +1 -0
- package/dist/unpkg/dev/adapter.js +1 -1250
- package/dist/unpkg/dev/compat/-private.js +3 -1
- package/dist/unpkg/dev/compat/builders.js +204 -248
- package/dist/unpkg/dev/compat/builders.js.map +1 -0
- package/dist/unpkg/dev/compat/extensions.js +270 -232
- package/dist/unpkg/dev/compat/extensions.js.map +1 -0
- package/dist/unpkg/dev/compat/utils.js +188 -193
- package/dist/unpkg/dev/compat/utils.js.map +1 -0
- package/dist/unpkg/dev/compat-D48B8sXv.js +825 -0
- package/dist/unpkg/dev/compat-D48B8sXv.js.map +1 -0
- package/dist/unpkg/dev/compat.js +1 -1145
- package/dist/unpkg/dev/errors-8GnRWcxo.js +2127 -0
- package/dist/unpkg/dev/errors-8GnRWcxo.js.map +1 -0
- package/dist/unpkg/dev/index.js +270 -190
- package/dist/unpkg/dev/index.js.map +1 -0
- package/dist/unpkg/dev/json-DDJji3V3.js +1104 -0
- package/dist/unpkg/dev/json-DDJji3V3.js.map +1 -0
- package/dist/unpkg/dev/model/-private.js +3 -1
- package/dist/unpkg/dev/model/migration-support.js +483 -537
- package/dist/unpkg/dev/model/migration-support.js.map +1 -0
- package/dist/unpkg/dev/model-LK7ethC5.js +655 -0
- package/dist/unpkg/dev/model-LK7ethC5.js.map +1 -0
- package/dist/unpkg/dev/model-fragments-DSqu0ptR.js +334 -0
- package/dist/unpkg/dev/model-fragments-DSqu0ptR.js.map +1 -0
- package/dist/unpkg/dev/model-fragments.js +2 -75
- package/dist/unpkg/dev/model.js +3 -677
- package/dist/unpkg/dev/runtime--fcdnjmJ-DMTJ0Kb3.js +53 -0
- package/dist/unpkg/dev/runtime--fcdnjmJ-DMTJ0Kb3.js.map +1 -0
- package/dist/unpkg/dev/schema-provider-CRzoMoTO.js +1834 -0
- package/dist/unpkg/dev/schema-provider-CRzoMoTO.js.map +1 -0
- package/dist/unpkg/dev/serializer/json-api.js +514 -629
- package/dist/unpkg/dev/serializer/json-api.js.map +1 -0
- package/dist/unpkg/dev/serializer/json.js +3 -4
- package/dist/unpkg/dev/serializer/rest.js +954 -1197
- package/dist/unpkg/dev/serializer/rest.js.map +1 -0
- package/dist/unpkg/dev/serializer/transform.js +283 -260
- package/dist/unpkg/dev/serializer/transform.js.map +1 -0
- package/dist/unpkg/dev/serializer.js +205 -208
- package/dist/unpkg/dev/serializer.js.map +1 -0
- package/dist/unpkg/dev/store-D_V8-HQl.js +472 -0
- package/dist/unpkg/dev/store-D_V8-HQl.js.map +1 -0
- package/dist/unpkg/dev/store.js +1 -635
- package/dist/unpkg/dev/util-dSKEgQDp.js +12 -0
- package/dist/unpkg/dev/util-dSKEgQDp.js.map +1 -0
- package/dist/unpkg/dev/utils-DYC9utVJ.js +11 -0
- package/dist/unpkg/dev/utils-DYC9utVJ.js.map +1 -0
- package/dist/unpkg/dev-deprecated/-private-CrEyBE-B.js +189 -0
- package/dist/unpkg/dev-deprecated/-private-CrEyBE-B.js.map +1 -0
- package/dist/unpkg/dev-deprecated/-private-vOhxVExH.js +896 -0
- package/dist/unpkg/dev-deprecated/-private-vOhxVExH.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter/-private.js +3 -1
- package/dist/unpkg/dev-deprecated/adapter/error.js +424 -310
- package/dist/unpkg/dev-deprecated/adapter/error.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter/json-api.js +239 -245
- package/dist/unpkg/dev-deprecated/adapter/json-api.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter/rest.js +935 -1098
- package/dist/unpkg/dev-deprecated/adapter/rest.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter-oLwyr47q.js +1129 -0
- package/dist/unpkg/dev-deprecated/adapter-oLwyr47q.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter.js +1 -1250
- package/dist/unpkg/dev-deprecated/compat/-private.js +3 -1
- package/dist/unpkg/dev-deprecated/compat/builders.js +204 -248
- package/dist/unpkg/dev-deprecated/compat/builders.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat/extensions.js +270 -232
- package/dist/unpkg/dev-deprecated/compat/extensions.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat/utils.js +188 -193
- package/dist/unpkg/dev-deprecated/compat/utils.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat-DGSurLh7.js +825 -0
- package/dist/unpkg/dev-deprecated/compat-DGSurLh7.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat.js +1 -1145
- package/dist/unpkg/dev-deprecated/errors-0ydn94s0.js +2128 -0
- package/dist/unpkg/dev-deprecated/errors-0ydn94s0.js.map +1 -0
- package/dist/unpkg/dev-deprecated/index.js +270 -189
- package/dist/unpkg/dev-deprecated/index.js.map +1 -0
- package/dist/unpkg/dev-deprecated/json-DDJji3V3.js +1104 -0
- package/dist/unpkg/dev-deprecated/json-DDJji3V3.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model/-private.js +3 -1
- package/dist/unpkg/dev-deprecated/model/migration-support.js +494 -554
- package/dist/unpkg/dev-deprecated/model/migration-support.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model-C1ts6Mod.js +660 -0
- package/dist/unpkg/dev-deprecated/model-C1ts6Mod.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model-fragments-DSqu0ptR.js +334 -0
- package/dist/unpkg/dev-deprecated/model-fragments-DSqu0ptR.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model-fragments.js +2 -75
- package/dist/unpkg/dev-deprecated/model.js +3 -681
- package/dist/unpkg/dev-deprecated/runtime--fcdnjmJ-DMTJ0Kb3.js +53 -0
- package/dist/unpkg/dev-deprecated/runtime--fcdnjmJ-DMTJ0Kb3.js.map +1 -0
- package/dist/unpkg/dev-deprecated/schema-provider-D2ESMsA8.js +1835 -0
- package/dist/unpkg/dev-deprecated/schema-provider-D2ESMsA8.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +514 -629
- package/dist/unpkg/dev-deprecated/serializer/json-api.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer/json.js +3 -4
- package/dist/unpkg/dev-deprecated/serializer/rest.js +954 -1197
- package/dist/unpkg/dev-deprecated/serializer/rest.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer/transform.js +283 -260
- package/dist/unpkg/dev-deprecated/serializer/transform.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer.js +205 -208
- package/dist/unpkg/dev-deprecated/serializer.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store-BX7GvXC_.js +472 -0
- package/dist/unpkg/dev-deprecated/store-BX7GvXC_.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store.js +1 -635
- package/dist/unpkg/dev-deprecated/util-9mgEBJ3W.js +18 -0
- package/dist/unpkg/dev-deprecated/util-9mgEBJ3W.js.map +1 -0
- package/dist/unpkg/dev-deprecated/utils-Cl86-e7F.js +17 -0
- package/dist/unpkg/dev-deprecated/utils-Cl86-e7F.js.map +1 -0
- package/dist/unpkg/prod/-private-B4bxoTuK.js +160 -0
- package/dist/unpkg/prod/-private-B4bxoTuK.js.map +1 -0
- package/dist/unpkg/prod/-private-SfXkkHKd.js +745 -0
- package/dist/unpkg/prod/-private-SfXkkHKd.js.map +1 -0
- package/dist/unpkg/prod/adapter/-private.js +3 -1
- package/dist/unpkg/prod/adapter/error.js +421 -305
- package/dist/unpkg/prod/adapter/error.js.map +1 -0
- package/dist/unpkg/prod/adapter/json-api.js +236 -240
- package/dist/unpkg/prod/adapter/json-api.js.map +1 -0
- package/dist/unpkg/prod/adapter/rest.js +911 -1061
- package/dist/unpkg/prod/adapter/rest.js.map +1 -0
- package/dist/unpkg/prod/adapter-DQ9UA7FC.js +1111 -0
- package/dist/unpkg/prod/adapter-DQ9UA7FC.js.map +1 -0
- package/dist/unpkg/prod/adapter.js +1 -1217
- package/dist/unpkg/prod/compat/-private.js +3 -1
- package/dist/unpkg/prod/compat/builders.js +165 -183
- package/dist/unpkg/prod/compat/builders.js.map +1 -0
- package/dist/unpkg/prod/compat/extensions.js +258 -222
- package/dist/unpkg/prod/compat/extensions.js.map +1 -0
- package/dist/unpkg/prod/compat/utils.js +185 -188
- package/dist/unpkg/prod/compat/utils.js.map +1 -0
- package/dist/unpkg/prod/compat-DxiVkCUb.js +547 -0
- package/dist/unpkg/prod/compat-DxiVkCUb.js.map +1 -0
- package/dist/unpkg/prod/compat.js +1 -725
- package/dist/unpkg/prod/errors-CVXWrUjP.js +1977 -0
- package/dist/unpkg/prod/errors-CVXWrUjP.js.map +1 -0
- package/dist/unpkg/prod/index.js +249 -146
- package/dist/unpkg/prod/index.js.map +1 -0
- package/dist/unpkg/prod/json-BD1kRTfB.js +1080 -0
- package/dist/unpkg/prod/json-BD1kRTfB.js.map +1 -0
- package/dist/unpkg/prod/model/-private.js +3 -1
- package/dist/unpkg/prod/model/migration-support.js +479 -530
- package/dist/unpkg/prod/model/migration-support.js.map +1 -0
- package/dist/unpkg/prod/model-D3WMsNNE.js +603 -0
- package/dist/unpkg/prod/model-D3WMsNNE.js.map +1 -0
- package/dist/unpkg/prod/model-fragments-DSqu0ptR.js +334 -0
- package/dist/unpkg/prod/model-fragments-DSqu0ptR.js.map +1 -0
- package/dist/unpkg/prod/model-fragments.js +2 -75
- package/dist/unpkg/prod/model.js +3 -592
- package/dist/unpkg/prod/runtime--fcdnjmJ-DMTJ0Kb3.js +53 -0
- package/dist/unpkg/prod/runtime--fcdnjmJ-DMTJ0Kb3.js.map +1 -0
- package/dist/unpkg/prod/schema-provider-_pimTZ3P.js +1622 -0
- package/dist/unpkg/prod/schema-provider-_pimTZ3P.js.map +1 -0
- package/dist/unpkg/prod/serializer/json-api.js +497 -587
- package/dist/unpkg/prod/serializer/json-api.js.map +1 -0
- package/dist/unpkg/prod/serializer/json.js +3 -4
- package/dist/unpkg/prod/serializer/rest.js +938 -1167
- package/dist/unpkg/prod/serializer/rest.js.map +1 -0
- package/dist/unpkg/prod/serializer/transform.js +283 -260
- package/dist/unpkg/prod/serializer/transform.js.map +1 -0
- package/dist/unpkg/prod/serializer.js +205 -208
- package/dist/unpkg/prod/serializer.js.map +1 -0
- package/dist/unpkg/prod/store-RGGc1ilN.js +392 -0
- package/dist/unpkg/prod/store-RGGc1ilN.js.map +1 -0
- package/dist/unpkg/prod/store.js +1 -503
- package/dist/unpkg/prod/util-dSKEgQDp.js +12 -0
- package/dist/unpkg/prod/util-dSKEgQDp.js.map +1 -0
- package/dist/unpkg/prod/utils-DYC9utVJ.js +11 -0
- package/dist/unpkg/prod/utils-DYC9utVJ.js.map +1 -0
- package/dist/unpkg/prod-deprecated/-private-B4bxoTuK.js +160 -0
- package/dist/unpkg/prod-deprecated/-private-B4bxoTuK.js.map +1 -0
- package/dist/unpkg/prod-deprecated/-private-SfXkkHKd.js +745 -0
- package/dist/unpkg/prod-deprecated/-private-SfXkkHKd.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter/-private.js +3 -1
- package/dist/unpkg/prod-deprecated/adapter/error.js +421 -305
- package/dist/unpkg/prod-deprecated/adapter/error.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter/json-api.js +236 -240
- package/dist/unpkg/prod-deprecated/adapter/json-api.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter/rest.js +911 -1061
- package/dist/unpkg/prod-deprecated/adapter/rest.js.map +1 -0
- package/{declarations/adapter.d.ts → dist/unpkg/prod-deprecated/adapter-DQ9UA7FC.js} +451 -110
- package/dist/unpkg/prod-deprecated/adapter-DQ9UA7FC.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter.js +1 -1217
- package/dist/unpkg/prod-deprecated/compat/-private.js +3 -1
- package/dist/unpkg/prod-deprecated/compat/builders.js +165 -183
- package/dist/unpkg/prod-deprecated/compat/builders.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat/extensions.js +258 -222
- package/dist/unpkg/prod-deprecated/compat/extensions.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat/utils.js +185 -188
- package/dist/unpkg/prod-deprecated/compat/utils.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat-DxiVkCUb.js +547 -0
- package/dist/unpkg/prod-deprecated/compat-DxiVkCUb.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat.js +1 -725
- package/dist/unpkg/prod-deprecated/errors-9LXqpfRd.js +1978 -0
- package/dist/unpkg/prod-deprecated/errors-9LXqpfRd.js.map +1 -0
- package/dist/unpkg/prod-deprecated/index.js +249 -145
- package/dist/unpkg/prod-deprecated/index.js.map +1 -0
- package/dist/unpkg/prod-deprecated/json-BD1kRTfB.js +1080 -0
- package/dist/unpkg/prod-deprecated/json-BD1kRTfB.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model/-private.js +3 -1
- package/dist/unpkg/prod-deprecated/model/migration-support.js +490 -547
- package/dist/unpkg/prod-deprecated/model/migration-support.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model-aiVrr1fz.js +604 -0
- package/dist/unpkg/prod-deprecated/model-aiVrr1fz.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model-fragments-DSqu0ptR.js +334 -0
- package/dist/unpkg/prod-deprecated/model-fragments-DSqu0ptR.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model-fragments.js +2 -75
- package/dist/unpkg/prod-deprecated/model.js +3 -595
- package/dist/unpkg/prod-deprecated/runtime--fcdnjmJ-DMTJ0Kb3.js +53 -0
- package/dist/unpkg/prod-deprecated/runtime--fcdnjmJ-DMTJ0Kb3.js.map +1 -0
- package/dist/unpkg/prod-deprecated/schema-provider-DyfSd9Cv.js +1635 -0
- package/dist/unpkg/prod-deprecated/schema-provider-DyfSd9Cv.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +497 -587
- package/dist/unpkg/prod-deprecated/serializer/json-api.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer/json.js +3 -4
- package/dist/unpkg/prod-deprecated/serializer/rest.js +938 -1167
- package/dist/unpkg/prod-deprecated/serializer/rest.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer/transform.js +283 -260
- package/dist/unpkg/prod-deprecated/serializer/transform.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer.js +205 -208
- package/dist/unpkg/prod-deprecated/serializer.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store-0L2CkYzh.js +392 -0
- package/dist/unpkg/prod-deprecated/store-0L2CkYzh.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store.js +1 -503
- package/dist/unpkg/prod-deprecated/util-CQQdHX3n.js +14 -0
- package/dist/unpkg/prod-deprecated/util-CQQdHX3n.js.map +1 -0
- package/dist/unpkg/prod-deprecated/utils-BMI_JwFP.js +13 -0
- package/dist/unpkg/prod-deprecated/utils-BMI_JwFP.js.map +1 -0
- package/dist/util-Bnx8nm-D.js +29 -0
- package/dist/util-Bnx8nm-D.js.map +1 -0
- package/dist/utils-ZAytYep8.js +28 -0
- package/dist/utils-ZAytYep8.js.map +1 -0
- package/package.json +21 -25
- package/declarations/adapter/-private/build-url-mixin.d.ts +0 -33
- package/declarations/adapter/-private/fastboot-interface.d.ts +0 -8
- package/declarations/adapter/-private/utils/continue-on-reject.d.ts +0 -1
- package/declarations/adapter/-private/utils/determine-body-promise.d.ts +0 -4
- package/declarations/adapter/-private/utils/fetch.d.ts +0 -8
- package/declarations/adapter/-private/utils/parse-response-headers.d.ts +0 -1
- package/declarations/adapter/-private/utils/serialize-into-hash.d.ts +0 -6
- package/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -5
- package/declarations/adapter/-private.d.ts +0 -5
- package/declarations/adapter/error.d.ts +0 -215
- package/declarations/compat/-private.d.ts +0 -13
- package/declarations/compat/builders/find-all.d.ts +0 -35
- package/declarations/compat/builders/find-record.d.ts +0 -56
- package/declarations/compat/builders/query.d.ts +0 -66
- package/declarations/compat/builders/save-record.d.ts +0 -34
- package/declarations/compat/builders/utils.d.ts +0 -3
- package/declarations/compat/builders.d.ts +0 -14
- package/declarations/compat/extensions.d.ts +0 -59
- package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +0 -55
- package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +0 -2
- package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +0 -11
- package/declarations/compat/legacy-network-handler/legacy-data-utils.d.ts +0 -5
- package/declarations/compat/legacy-network-handler/legacy-network-handler.d.ts +0 -2
- package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -524
- package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -213
- package/declarations/compat/legacy-network-handler/serializer-response.d.ts +0 -6
- package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +0 -110
- package/declarations/compat/legacy-network-handler/snapshot.d.ts +0 -255
- package/declarations/compat/utils.d.ts +0 -137
- package/declarations/compat.d.ts +0 -157
- package/declarations/index.d.ts +0 -102
- package/declarations/model/-private/attr.d.ts +0 -170
- package/declarations/model/-private/belongs-to.d.ts +0 -174
- package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +0 -5
- package/declarations/model/-private/errors.d.ts +0 -289
- package/declarations/model/-private/has-many.d.ts +0 -162
- package/declarations/model/-private/hooks.d.ts +0 -10
- package/declarations/model/-private/legacy-relationships-support.d.ts +0 -47
- package/declarations/model/-private/model-for-mixin.d.ts +0 -3
- package/declarations/model/-private/model-methods.d.ts +0 -39
- package/declarations/model/-private/model.d.ts +0 -1228
- package/declarations/model/-private/notify-changes.d.ts +0 -4
- package/declarations/model/-private/promise-belongs-to.d.ts +0 -40
- package/declarations/model/-private/promise-many-array.d.ts +0 -106
- package/declarations/model/-private/record-state.d.ts +0 -58
- package/declarations/model/-private/references/belongs-to.d.ts +0 -488
- package/declarations/model/-private/references/has-many.d.ts +0 -498
- package/declarations/model/-private/schema-provider.d.ts +0 -56
- package/declarations/model/-private/type-utils.d.ts +0 -57
- package/declarations/model/-private/util.d.ts +0 -5
- package/declarations/model/-private.d.ts +0 -8
- package/declarations/model/migration-support.d.ts +0 -280
- package/declarations/model-fragments/extensions/fragment-array.d.ts +0 -16
- package/declarations/model-fragments/extensions/fragment.d.ts +0 -15
- package/declarations/model-fragments/hooks/model-for.d.ts +0 -20
- package/declarations/model-fragments/index.d.ts +0 -5
- package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -9
- package/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -15
- package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -20
- package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -19
- package/declarations/model-fragments/utilities/with-legacy.d.ts +0 -3
- package/declarations/model-fragments.d.ts +0 -9
- package/declarations/model.d.ts +0 -49
- package/declarations/serializer/-private/transforms/boolean.d.ts +0 -47
- package/declarations/serializer/-private/transforms/date.d.ts +0 -28
- package/declarations/serializer/-private/transforms/number.d.ts +0 -29
- package/declarations/serializer/-private/transforms/string.d.ts +0 -29
- package/declarations/serializer/-private/transforms/transform.d.ts +0 -118
- package/declarations/serializer/-private/utils.d.ts +0 -3
- package/declarations/serializer/rest.d.ts +0 -51
- package/declarations/serializer/transform.d.ts +0 -5
- package/declarations/serializer.d.ts +0 -254
- package/declarations/store/-private.d.ts +0 -223
- package/declarations/store.d.ts +0 -3
- package/dist/-private-BG3bMiKp.js +0 -1211
- package/dist/errors-Cz5KrzBk.js +0 -2566
- package/dist/hooks-D6diaM34.js +0 -74
- package/dist/json-ChdEfB0X.js +0 -1259
- package/dist/model-for-CqXsIKws.js +0 -221
- package/dist/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/schema-provider-DJCV_6AF.js +0 -2295
- package/dist/serialize-into-hash-DPZYoF-i.js +0 -261
- package/dist/unpkg/dev/-private-DtjBbEgy.js +0 -1206
- package/dist/unpkg/dev/errors-DmGGJr3T.js +0 -2562
- package/dist/unpkg/dev/hooks-CkYiE6Ud.js +0 -73
- package/dist/unpkg/dev/json-Cu1LNgmQ.js +0 -1256
- package/dist/unpkg/dev/model-for-CqXsIKws.js +0 -221
- package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/dev/schema-provider-DDVYxmUV.js +0 -2186
- package/dist/unpkg/dev/serialize-into-hash-B2xDbuo5.js +0 -259
- package/dist/unpkg/dev/util-DvanW33H.js +0 -20
- package/dist/unpkg/dev/utils-BhvS1iTS.js +0 -8
- package/dist/unpkg/dev-deprecated/-private-DtjBbEgy.js +0 -1206
- package/dist/unpkg/dev-deprecated/errors-Spt6ubMd.js +0 -2565
- package/dist/unpkg/dev-deprecated/hooks-DOXegvhL.js +0 -73
- package/dist/unpkg/dev-deprecated/json-Cu1LNgmQ.js +0 -1256
- package/dist/unpkg/dev-deprecated/model-for-CqXsIKws.js +0 -221
- package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/dev-deprecated/schema-provider-BP6_8N-V.js +0 -2211
- package/dist/unpkg/dev-deprecated/serialize-into-hash-B2xDbuo5.js +0 -259
- package/dist/unpkg/dev-deprecated/util-CWr5WQOT.js +0 -24
- package/dist/unpkg/dev-deprecated/utils-C9PJehtL.js +0 -12
- package/dist/unpkg/prod/-private-BdyZaGEh.js +0 -971
- package/dist/unpkg/prod/errors-BGVFCBmi.js +0 -2314
- package/dist/unpkg/prod/hooks-BztVA_x0.js +0 -41
- package/dist/unpkg/prod/json-BWrZ5546.js +0 -1243
- package/dist/unpkg/prod/model-for-CqXsIKws.js +0 -221
- package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/prod/schema-provider-DJtD_8jZ.js +0 -1861
- package/dist/unpkg/prod/serialize-into-hash-DGlzQteF.js +0 -215
- package/dist/unpkg/prod/util-DvanW33H.js +0 -20
- package/dist/unpkg/prod/utils-BhvS1iTS.js +0 -8
- package/dist/unpkg/prod-deprecated/-private-BdyZaGEh.js +0 -971
- package/dist/unpkg/prod-deprecated/errors-CdDaK81x.js +0 -2317
- package/dist/unpkg/prod-deprecated/hooks-yId87yyG.js +0 -41
- package/dist/unpkg/prod-deprecated/json-BWrZ5546.js +0 -1243
- package/dist/unpkg/prod-deprecated/model-for-CqXsIKws.js +0 -221
- package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/prod-deprecated/schema-provider-CjX55uSY.js +0 -1904
- package/dist/unpkg/prod-deprecated/serialize-into-hash-DGlzQteF.js +0 -215
- package/dist/unpkg/prod-deprecated/util-B6cn-i93.js +0 -23
- package/dist/unpkg/prod-deprecated/utils-BUWwQwCh.js +0 -11
- package/dist/util-Dul6TZts.js +0 -35
- package/dist/utils-Cqw9eRj5.js +0 -23
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import EmberObject from "@ember/object";
|
|
2
|
-
import type { LegacyAttributeField } from "@warp-drive/core/types/schema/fields";
|
|
3
|
-
export interface Transform {
|
|
4
|
-
/**
|
|
5
|
-
When given a deserialized value from a record attribute this
|
|
6
|
-
method must return the serialized value.
|
|
7
|
-
|
|
8
|
-
Example
|
|
9
|
-
|
|
10
|
-
```javascript
|
|
11
|
-
serialize(deserialized, options) {
|
|
12
|
-
return deserialized ? null : Number(deserialized);
|
|
13
|
-
}
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
@public
|
|
17
|
-
@param deserialized The deserialized value
|
|
18
|
-
@param options hash of options passed to `attr`
|
|
19
|
-
@return The serialized value
|
|
20
|
-
*/
|
|
21
|
-
serialize(value: unknown, options: LegacyAttributeField["options"]): unknown;
|
|
22
|
-
/**
|
|
23
|
-
When given a serialized value from a JSON object this method must
|
|
24
|
-
return the deserialized value for the record attribute.
|
|
25
|
-
|
|
26
|
-
Example
|
|
27
|
-
|
|
28
|
-
```javascript
|
|
29
|
-
deserialize(serialized, options) {
|
|
30
|
-
return empty(serialized) ? null : Number(serialized);
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
@public
|
|
35
|
-
@param serialized The serialized value
|
|
36
|
-
@param options hash of options passed to `attr`
|
|
37
|
-
@return The deserialized value
|
|
38
|
-
*/
|
|
39
|
-
deserialize(value: unknown, options: LegacyAttributeField["options"]): unknown;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
The `Transform` class is used to serialize and deserialize model
|
|
43
|
-
attributes when they are saved or loaded from an
|
|
44
|
-
adapter. Subclassing `Transform` is useful for creating custom
|
|
45
|
-
attributes. All subclasses of `Transform` must implement a
|
|
46
|
-
`serialize` and a `deserialize` method.
|
|
47
|
-
|
|
48
|
-
Example
|
|
49
|
-
|
|
50
|
-
```js [app/transforms/temperature.js]
|
|
51
|
-
|
|
52
|
-
// Converts centigrade in the JSON to fahrenheit in the app
|
|
53
|
-
export default class TemperatureTransform {
|
|
54
|
-
deserialize(serialized, options) {
|
|
55
|
-
return (serialized * 1.8) + 32;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
serialize(deserialized, options) {
|
|
59
|
-
return (deserialized - 32) / 1.8;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
static create() {
|
|
63
|
-
return new this();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Usage
|
|
69
|
-
|
|
70
|
-
```js [app/models/requirement.js]
|
|
71
|
-
import { Model, attr } from '@warp-drive/legacy/model';
|
|
72
|
-
|
|
73
|
-
export default class RequirementModel extends Model {
|
|
74
|
-
@attr('string') name;
|
|
75
|
-
@attr('temperature') temperature;
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
The options passed into the `attr` function when the attribute is
|
|
80
|
-
declared on the model is also available in the transform.
|
|
81
|
-
|
|
82
|
-
```js [app/models/post.js]
|
|
83
|
-
import { Model, attr } from '@warp-drive/legacy/model';
|
|
84
|
-
|
|
85
|
-
export default class PostModel extends Model {
|
|
86
|
-
@attr('string') title;
|
|
87
|
-
@attr('markdown', {
|
|
88
|
-
markdown: {
|
|
89
|
-
gfm: false,
|
|
90
|
-
sanitize: true
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
markdown;
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
```js [app/transforms/markdown.js]
|
|
98
|
-
export default class MarkdownTransform {
|
|
99
|
-
serialize(deserialized, options) {
|
|
100
|
-
return deserialized.raw;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
deserialize(serialized, options) {
|
|
104
|
-
let markdownOptions = options.markdown || {};
|
|
105
|
-
|
|
106
|
-
return marked(serialized, markdownOptions);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
static create() {
|
|
110
|
-
return new this();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
@class Transform
|
|
116
|
-
@public
|
|
117
|
-
*/
|
|
118
|
-
export declare const Transform: typeof EmberObject;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* :::danger
|
|
3
|
-
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
4
|
-
If starting a new app or thinking of implementing a new adapter, consider writing a
|
|
5
|
-
{@link Handler} instead to be used with the {@link RequestManager}
|
|
6
|
-
:::
|
|
7
|
-
|
|
8
|
-
Normally, applications will use the `RESTSerializer` by implementing
|
|
9
|
-
the `normalize` method.
|
|
10
|
-
|
|
11
|
-
This allows you to do whatever kind of munging you need and is
|
|
12
|
-
especially useful if your server is inconsistent and you need to
|
|
13
|
-
do munging differently for many different kinds of responses.
|
|
14
|
-
|
|
15
|
-
See the `normalize` documentation for more information.
|
|
16
|
-
|
|
17
|
-
## Across the Board Normalization
|
|
18
|
-
|
|
19
|
-
There are also a number of hooks that you might find useful to define
|
|
20
|
-
across-the-board rules for your payload. These rules will be useful
|
|
21
|
-
if your server is consistent, or if you're building an adapter for
|
|
22
|
-
an infrastructure service, like Firebase, and want to encode service
|
|
23
|
-
conventions.
|
|
24
|
-
|
|
25
|
-
For example, if all of your keys are underscored and all-caps, but
|
|
26
|
-
otherwise consistent with the names you use in your models, you
|
|
27
|
-
can implement across-the-board rules for how to convert an attribute
|
|
28
|
-
name in your model to a key in your JSON.
|
|
29
|
-
|
|
30
|
-
```js [app/serializers/application.js]
|
|
31
|
-
import { RESTSerializer } from '@warp-drive/legacy/serializer/rest';
|
|
32
|
-
import { underscore } from '<app-name>/utils/string-utils';
|
|
33
|
-
|
|
34
|
-
export default class ApplicationSerializer extends RESTSerializer {
|
|
35
|
-
keyForAttribute(attr, method) {
|
|
36
|
-
return underscore(attr).toUpperCase();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
You can also implement `keyForRelationship`, which takes the name
|
|
42
|
-
of the relationship as the first parameter, the kind of
|
|
43
|
-
relationship (`hasMany` or `belongsTo`) as the second parameter, and
|
|
44
|
-
the method (`serialize` or `deserialize`) as the third parameter.
|
|
45
|
-
|
|
46
|
-
@class RESTSerializer
|
|
47
|
-
@public
|
|
48
|
-
*/
|
|
49
|
-
declare const RESTSerializer: any;
|
|
50
|
-
export { EmbeddedRecordsMixin } from "./-private/embedded-records-mixin.js";
|
|
51
|
-
export { RESTSerializer };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { Transform } from "./-private/transforms/transform.js";
|
|
2
|
-
export { BooleanTransform } from "./-private/transforms/boolean.js";
|
|
3
|
-
export { DateTransform } from "./-private/transforms/date.js";
|
|
4
|
-
export { NumberTransform } from "./-private/transforms/number.js";
|
|
5
|
-
export { StringTransform } from "./-private/transforms/string.js";
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
## Overview
|
|
3
|
-
|
|
4
|
-
:::danger
|
|
5
|
-
⚠️ **This is LEGACY documentation** for a feature that is no longer encouraged to be used.
|
|
6
|
-
If starting a new app or thinking of implementing a new serializer, consider writing a
|
|
7
|
-
{@link Handler} instead to be used with the {@link RequestManager}
|
|
8
|
-
:::
|
|
9
|
-
|
|
10
|
-
In order to properly manage and present your data, WarpDrive
|
|
11
|
-
needs to understand the structure of data it receives.
|
|
12
|
-
|
|
13
|
-
`Serializers` convert data between the server's API format and
|
|
14
|
-
the format WarpDrive understands.
|
|
15
|
-
|
|
16
|
-
Data received from an API response is **normalized** into
|
|
17
|
-
[{json:api}](https://jsonapi.org/) (the format used internally
|
|
18
|
-
by WarpDrive), while data sent to an API is **serialized**
|
|
19
|
-
into the format the API expects.
|
|
20
|
-
|
|
21
|
-
### Implementing a Serializer
|
|
22
|
-
|
|
23
|
-
There are only two required serializer methods, one for
|
|
24
|
-
normalizing data from the server API format into {json:api}, and
|
|
25
|
-
another for serializing records via `Snapshots` into the expected
|
|
26
|
-
server API format.
|
|
27
|
-
|
|
28
|
-
To implement a serializer, export a class that conforms to the structure
|
|
29
|
-
described by {@link MinimumSerializerInterface}
|
|
30
|
-
from the `app/serializers/` directory. An example is below.
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
import EmberObject from '@ember/object';
|
|
34
|
-
|
|
35
|
-
export default class ApplicationSerializer extends EmberObject {
|
|
36
|
-
normalizeResponse(store, schema, rawPayload) {
|
|
37
|
-
return rawPayload;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
serialize(snapshot, options) {
|
|
41
|
-
const serializedResource = {
|
|
42
|
-
id: snapshot.id,
|
|
43
|
-
type: snapshot.modelName,
|
|
44
|
-
attributes: snapshot.attributes()
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return serializedResource;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Serializer Resolution
|
|
54
|
-
|
|
55
|
-
`store.serializerFor(name)` will lookup serializers defined in
|
|
56
|
-
`app/serializers/` and return an instance. If no serializer is found, an
|
|
57
|
-
error will be thrown.
|
|
58
|
-
|
|
59
|
-
`serializerFor` first attempts to find a serializer with an exact match on `name`,
|
|
60
|
-
then falls back to checking for the presence of a serializer named `application`.
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
store.serializerFor('author');
|
|
64
|
-
|
|
65
|
-
// lookup paths (in order) =>
|
|
66
|
-
// app/serializers/author.js
|
|
67
|
-
// app/serializers/application.js
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Most requests in `@warp-drive/legacy` are made with respect to a particular `type` (or `modelName`)
|
|
71
|
-
(e.g., "get me the full collection of **books**" or "get me the **employee** whose id is 37"). We
|
|
72
|
-
refer to this as the **primary** resource `type`.
|
|
73
|
-
|
|
74
|
-
Typically `serializerFor` will be used to find a serializer with a name matching that of the primary
|
|
75
|
-
resource `type` for the request, falling back to the `application` serializer for those types that
|
|
76
|
-
do not have a defined serializer. This is often described as a `per-model` or `per-type` strategy
|
|
77
|
-
for defining serializers. However, because APIs rarely format payloads per-type but rather
|
|
78
|
-
per-API-version, this may not be a desired strategy.
|
|
79
|
-
|
|
80
|
-
It is recommended that applications define only a single `application` adapter and serializer
|
|
81
|
-
where possible.
|
|
82
|
-
|
|
83
|
-
If you have multiple API formats and the per-type strategy is not viable, one strategy is to
|
|
84
|
-
write an `application` adapter and serializer that make use of `options` to specify the desired
|
|
85
|
-
format when making a request.
|
|
86
|
-
|
|
87
|
-
### Using a Serializer
|
|
88
|
-
|
|
89
|
-
Any serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.
|
|
90
|
-
|
|
91
|
-
### Default Serializers
|
|
92
|
-
|
|
93
|
-
For applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**
|
|
94
|
-
format the `@warp-drive/legacy/serializer` package contains implementations these applications can
|
|
95
|
-
extend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.
|
|
96
|
-
|
|
97
|
-
Many applications will find writing their own serializer to be more performant and less
|
|
98
|
-
complex than extending these classes even when their API format is very close to that expected
|
|
99
|
-
by these serializers.
|
|
100
|
-
|
|
101
|
-
It is recommended that apps write their own serializer to best suit the needs of their API and
|
|
102
|
-
application.
|
|
103
|
-
|
|
104
|
-
@module
|
|
105
|
-
*/
|
|
106
|
-
import EmberObject from "@ember/object";
|
|
107
|
-
import type { Store } from "@warp-drive/core";
|
|
108
|
-
import type { ModelSchema } from "@warp-drive/core/types";
|
|
109
|
-
import type { EmptyResourceDocument, SingleResourceDocument } from "@warp-drive/core/types/spec/json-api-raw";
|
|
110
|
-
/**
|
|
111
|
-
> ⚠️ CAUTION you likely want the docs for {@link MinimumSerializerInterface}
|
|
112
|
-
> as extending this abstract class is unnecessary.
|
|
113
|
-
|
|
114
|
-
`Serializer` is an abstract base class that you may override in your
|
|
115
|
-
application to customize it for your backend. The minimum set of methods
|
|
116
|
-
that you should implement is:
|
|
117
|
-
|
|
118
|
-
* `normalizeResponse()`
|
|
119
|
-
* `serialize()`
|
|
120
|
-
|
|
121
|
-
And you can optionally override the following methods:
|
|
122
|
-
|
|
123
|
-
* `normalize()`
|
|
124
|
-
|
|
125
|
-
For an example implementation, see the included {@link JSONSerializer}.
|
|
126
|
-
|
|
127
|
-
@class Serializer
|
|
128
|
-
@public
|
|
129
|
-
*/
|
|
130
|
-
export declare class Serializer extends EmberObject {
|
|
131
|
-
store: Store;
|
|
132
|
-
/**
|
|
133
|
-
The `store` property is the application's `store` that contains
|
|
134
|
-
all records. It can be used to look up serializers for other model
|
|
135
|
-
types that may be nested inside the payload response.
|
|
136
|
-
|
|
137
|
-
Example:
|
|
138
|
-
|
|
139
|
-
```js
|
|
140
|
-
Serializer.extend({
|
|
141
|
-
extractRelationship(relationshipModelName, relationshipHash) {
|
|
142
|
-
let modelClass = this.store.modelFor(relationshipModelName);
|
|
143
|
-
let relationshipSerializer = this.store.serializerFor(relationshipModelName);
|
|
144
|
-
return relationshipSerializer.normalize(modelClass, relationshipHash);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
@property store
|
|
150
|
-
@type {Store}
|
|
151
|
-
@public
|
|
152
|
-
*/
|
|
153
|
-
/**
|
|
154
|
-
The `normalizeResponse` method is used to normalize a payload from the
|
|
155
|
-
server to a JSON-API Document.
|
|
156
|
-
|
|
157
|
-
http://jsonapi.org/format/#document-structure
|
|
158
|
-
|
|
159
|
-
Example:
|
|
160
|
-
|
|
161
|
-
```js
|
|
162
|
-
Serializer.extend({
|
|
163
|
-
normalizeResponse(store, primaryModelClass, payload, id, requestType) {
|
|
164
|
-
if (requestType === 'findRecord') {
|
|
165
|
-
return this.normalize(primaryModelClass, payload);
|
|
166
|
-
} else {
|
|
167
|
-
return payload.reduce(function(documentHash, item) {
|
|
168
|
-
let { data, included } = this.normalize(primaryModelClass, item);
|
|
169
|
-
documentHash.included.push(...included);
|
|
170
|
-
documentHash.data.push(data);
|
|
171
|
-
return documentHash;
|
|
172
|
-
}, { data: [], included: [] })
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
@since 1.13.0
|
|
179
|
-
@public
|
|
180
|
-
@param {Store} store
|
|
181
|
-
@param {Model} primaryModelClass
|
|
182
|
-
@param {Object} payload
|
|
183
|
-
@param {String|Number} id
|
|
184
|
-
@param {String} requestType
|
|
185
|
-
@return {Object} JSON-API Document
|
|
186
|
-
*/
|
|
187
|
-
/**
|
|
188
|
-
The `serialize` method is used when a record is saved in order to convert
|
|
189
|
-
the record into the form that your external data source expects.
|
|
190
|
-
|
|
191
|
-
`serialize` takes an optional `options` hash with a single option:
|
|
192
|
-
|
|
193
|
-
- `includeId`: If this is `true`, `serialize` should include the ID
|
|
194
|
-
in the serialized object it builds.
|
|
195
|
-
|
|
196
|
-
Example:
|
|
197
|
-
|
|
198
|
-
```js
|
|
199
|
-
Serializer.extend({
|
|
200
|
-
serialize(snapshot, options) {
|
|
201
|
-
let json = {
|
|
202
|
-
id: snapshot.id
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
snapshot.eachAttribute((key, attribute) => {
|
|
206
|
-
json[key] = snapshot.attr(key);
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
snapshot.eachRelationship((key, relationship) => {
|
|
210
|
-
if (relationship.kind === 'belongsTo') {
|
|
211
|
-
json[key] = snapshot.belongsTo(key, { id: true });
|
|
212
|
-
} else if (relationship.kind === 'hasMany') {
|
|
213
|
-
json[key] = snapshot.hasMany(key, { ids: true });
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
return json;
|
|
218
|
-
},
|
|
219
|
-
});
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
@public
|
|
223
|
-
@param {Snapshot} snapshot
|
|
224
|
-
@param {Object} [options]
|
|
225
|
-
@return {Object}
|
|
226
|
-
*/
|
|
227
|
-
/**
|
|
228
|
-
The `normalize` method is used to convert a payload received from your
|
|
229
|
-
external data source into the normalized form `store.push()` expects. You
|
|
230
|
-
should override this method, munge the hash and return the normalized
|
|
231
|
-
payload.
|
|
232
|
-
|
|
233
|
-
Example:
|
|
234
|
-
|
|
235
|
-
```js
|
|
236
|
-
Serializer.extend({
|
|
237
|
-
normalize(modelClass, resourceHash) {
|
|
238
|
-
let data = {
|
|
239
|
-
id: resourceHash.id,
|
|
240
|
-
type: modelClass.modelName,
|
|
241
|
-
attributes: resourceHash
|
|
242
|
-
};
|
|
243
|
-
return { data: data };
|
|
244
|
-
}
|
|
245
|
-
})
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
@public
|
|
249
|
-
@param {Model} typeClass
|
|
250
|
-
@param {Object} hash
|
|
251
|
-
@return {Object}
|
|
252
|
-
*/
|
|
253
|
-
normalize(_typeClass: ModelSchema, hash: Record<string, unknown>): SingleResourceDocument | EmptyResourceDocument;
|
|
254
|
-
}
|
|
@@ -1,223 +0,0 @@
|
|
|
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
|
-
}
|
package/declarations/store.d.ts
DELETED