@warp-drive/legacy 5.9.0-alpha.21 → 5.9.0-alpha.23
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/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 +422 -453
- package/dist/adapter/error.js.map +1 -0
- package/{declarations → dist}/adapter/json-api.d.ts +30 -29
- package/dist/adapter/json-api.d.ts.map +1 -0
- package/dist/adapter/json-api.js +265 -143
- package/dist/adapter/json-api.js.map +1 -0
- package/dist/adapter/rest.d.ts +2 -0
- package/dist/adapter/rest.js +937 -1136
- 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-DFVAuivO.js +1130 -0
- package/dist/adapter-DFVAuivO.js.map +1 -0
- package/dist/adapter.d.ts +2 -0
- package/dist/adapter.js +1 -1248
- 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 -245
- package/dist/compat/builders.js.map +1 -0
- package/dist/compat/extensions.d.ts +2 -0
- package/dist/compat/extensions.js +265 -304
- 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 +187 -206
- 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-g__Pfy2S.js +734 -0
- package/dist/compat-g__Pfy2S.js.map +1 -0
- package/dist/compat.d.ts +2 -0
- package/dist/compat.js +1 -1036
- package/dist/error-CzkyXr1Q.d.ts +435 -0
- package/dist/error-CzkyXr1Q.d.ts.map +1 -0
- package/dist/errors-BbCo7Tut.js +2134 -0
- package/dist/errors-BbCo7Tut.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 +267 -339
- 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 +504 -575
- 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-C7-ZIbd5.js +683 -0
- package/dist/model-C7-ZIbd5.js.map +1 -0
- package/dist/model-fragments-tlMYPSd_.js +334 -0
- package/dist/model-fragments-tlMYPSd_.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 -94
- package/dist/model.d.ts +404 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +3 -670
- package/{declarations/adapter/rest.d.ts → dist/rest-0NhtexIq.d.ts} +183 -173
- package/dist/rest-0NhtexIq.d.ts.map +1 -0
- package/dist/runtime-BPCpkOf1-CVHWB0MF.js +53 -0
- package/dist/runtime-BPCpkOf1-CVHWB0MF.js.map +1 -0
- package/dist/schema-provider-7RHVFTdb.js +1929 -0
- package/dist/schema-provider-7RHVFTdb.js.map +1 -0
- package/{declarations → dist}/serializer/json-api.d.ts +3 -0
- package/dist/serializer/json-api.d.ts.map +1 -0
- package/dist/serializer/json-api.js +527 -519
- 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 -1199
- 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 -308
- 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 -205
- 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 -641
- 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 +421 -452
- package/dist/unpkg/dev/adapter/error.js.map +1 -0
- package/dist/unpkg/dev/adapter/json-api.js +239 -257
- package/dist/unpkg/dev/adapter/json-api.js.map +1 -0
- package/dist/unpkg/dev/adapter/rest.js +935 -1134
- package/dist/unpkg/dev/adapter/rest.js.map +1 -0
- package/dist/unpkg/dev/adapter-RlAbN461.js +1129 -0
- package/dist/unpkg/dev/adapter-RlAbN461.js.map +1 -0
- package/dist/unpkg/dev/adapter.js +1 -1247
- package/dist/unpkg/dev/compat/-private.js +3 -1
- package/dist/unpkg/dev/compat/builders.js +204 -247
- package/dist/unpkg/dev/compat/builders.js.map +1 -0
- package/dist/unpkg/dev/compat/extensions.js +264 -303
- package/dist/unpkg/dev/compat/extensions.js.map +1 -0
- package/dist/unpkg/dev/compat/utils.js +186 -205
- package/dist/unpkg/dev/compat/utils.js.map +1 -0
- package/dist/unpkg/dev/compat-B2O7jZLN.js +825 -0
- package/dist/unpkg/dev/compat-B2O7jZLN.js.map +1 -0
- package/dist/unpkg/dev/compat.js +1 -1178
- package/dist/unpkg/dev/errors-DiBJX1gq.js +2127 -0
- package/dist/unpkg/dev/errors-DiBJX1gq.js.map +1 -0
- package/dist/unpkg/dev/index.js +266 -344
- 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 +481 -549
- package/dist/unpkg/dev/model/migration-support.js.map +1 -0
- package/dist/unpkg/dev/model-BrJ3pFM-.js +655 -0
- package/dist/unpkg/dev/model-BrJ3pFM-.js.map +1 -0
- package/dist/unpkg/dev/model-fragments-tlMYPSd_.js +334 -0
- package/dist/unpkg/dev/model-fragments-tlMYPSd_.js.map +1 -0
- package/dist/unpkg/dev/model-fragments.js +2 -94
- package/dist/unpkg/dev/model.js +3 -681
- package/dist/unpkg/dev/runtime-BPCpkOf1-CVHWB0MF.js +53 -0
- package/dist/unpkg/dev/runtime-BPCpkOf1-CVHWB0MF.js.map +1 -0
- package/dist/unpkg/dev/schema-provider-Z5GzOhu-.js +1834 -0
- package/dist/unpkg/dev/schema-provider-Z5GzOhu-.js.map +1 -0
- package/dist/unpkg/dev/serializer/json-api.js +514 -634
- 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 -1196
- package/dist/unpkg/dev/serializer/rest.js.map +1 -0
- package/dist/unpkg/dev/serializer/transform.js +283 -308
- package/dist/unpkg/dev/serializer/transform.js.map +1 -0
- package/dist/unpkg/dev/serializer.js +205 -205
- 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 -649
- 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 +421 -452
- package/dist/unpkg/dev-deprecated/adapter/error.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter/json-api.js +239 -257
- package/dist/unpkg/dev-deprecated/adapter/json-api.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter/rest.js +935 -1134
- package/dist/unpkg/dev-deprecated/adapter/rest.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter-RlAbN461.js +1129 -0
- package/dist/unpkg/dev-deprecated/adapter-RlAbN461.js.map +1 -0
- package/dist/unpkg/dev-deprecated/adapter.js +1 -1247
- package/dist/unpkg/dev-deprecated/compat/-private.js +3 -1
- package/dist/unpkg/dev-deprecated/compat/builders.js +204 -247
- package/dist/unpkg/dev-deprecated/compat/builders.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat/extensions.js +264 -303
- package/dist/unpkg/dev-deprecated/compat/extensions.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat/utils.js +186 -205
- package/dist/unpkg/dev-deprecated/compat/utils.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat-CgUa-VIF.js +825 -0
- package/dist/unpkg/dev-deprecated/compat-CgUa-VIF.js.map +1 -0
- package/dist/unpkg/dev-deprecated/compat.js +1 -1178
- package/dist/unpkg/dev-deprecated/errors-Cba2PDIB.js +2128 -0
- package/dist/unpkg/dev-deprecated/errors-Cba2PDIB.js.map +1 -0
- package/dist/unpkg/dev-deprecated/index.js +266 -343
- 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 +492 -566
- package/dist/unpkg/dev-deprecated/model/migration-support.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model-D-JSD2Bx.js +660 -0
- package/dist/unpkg/dev-deprecated/model-D-JSD2Bx.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model-fragments-tlMYPSd_.js +334 -0
- package/dist/unpkg/dev-deprecated/model-fragments-tlMYPSd_.js.map +1 -0
- package/dist/unpkg/dev-deprecated/model-fragments.js +2 -94
- package/dist/unpkg/dev-deprecated/model.js +3 -685
- package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-CVHWB0MF.js +53 -0
- package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-CVHWB0MF.js.map +1 -0
- package/dist/unpkg/dev-deprecated/schema-provider-n96uVRhl.js +1835 -0
- package/dist/unpkg/dev-deprecated/schema-provider-n96uVRhl.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer/json-api.js +514 -634
- 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 -1196
- package/dist/unpkg/dev-deprecated/serializer/rest.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer/transform.js +283 -308
- package/dist/unpkg/dev-deprecated/serializer/transform.js.map +1 -0
- package/dist/unpkg/dev-deprecated/serializer.js +205 -205
- 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 -649
- 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 +418 -447
- package/dist/unpkg/prod/adapter/error.js.map +1 -0
- package/dist/unpkg/prod/adapter/json-api.js +236 -252
- package/dist/unpkg/prod/adapter/json-api.js.map +1 -0
- package/dist/unpkg/prod/adapter/rest.js +911 -1097
- package/dist/unpkg/prod/adapter/rest.js.map +1 -0
- package/dist/unpkg/prod/adapter-DAx_reer.js +1111 -0
- package/dist/unpkg/prod/adapter-DAx_reer.js.map +1 -0
- package/dist/unpkg/prod/adapter.js +1 -1214
- package/dist/unpkg/prod/compat/-private.js +3 -1
- package/dist/unpkg/prod/compat/builders.js +165 -182
- package/dist/unpkg/prod/compat/builders.js.map +1 -0
- package/dist/unpkg/prod/compat/extensions.js +252 -283
- package/dist/unpkg/prod/compat/extensions.js.map +1 -0
- package/dist/unpkg/prod/compat/utils.js +183 -200
- package/dist/unpkg/prod/compat/utils.js.map +1 -0
- package/dist/unpkg/prod/compat-CJ87MzDn.js +547 -0
- package/dist/unpkg/prod/compat-CJ87MzDn.js.map +1 -0
- package/dist/unpkg/prod/compat.js +1 -742
- package/dist/unpkg/prod/errors-CoKAYQJi.js +1977 -0
- package/dist/unpkg/prod/errors-CoKAYQJi.js.map +1 -0
- package/dist/unpkg/prod/index.js +245 -308
- 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 +477 -542
- package/dist/unpkg/prod/model/migration-support.js.map +1 -0
- package/dist/unpkg/prod/model-D2zzdmP8.js +603 -0
- package/dist/unpkg/prod/model-D2zzdmP8.js.map +1 -0
- package/dist/unpkg/prod/model-fragments-tlMYPSd_.js +334 -0
- package/dist/unpkg/prod/model-fragments-tlMYPSd_.js.map +1 -0
- package/dist/unpkg/prod/model-fragments.js +2 -94
- package/dist/unpkg/prod/model.js +3 -596
- package/dist/unpkg/prod/runtime-BPCpkOf1-CVHWB0MF.js +53 -0
- package/dist/unpkg/prod/runtime-BPCpkOf1-CVHWB0MF.js.map +1 -0
- package/dist/unpkg/prod/schema-provider-BUXipKQV.js +1622 -0
- package/dist/unpkg/prod/schema-provider-BUXipKQV.js.map +1 -0
- package/dist/unpkg/prod/serializer/json-api.js +497 -592
- 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 -1166
- package/dist/unpkg/prod/serializer/rest.js.map +1 -0
- package/dist/unpkg/prod/serializer/transform.js +283 -308
- package/dist/unpkg/prod/serializer/transform.js.map +1 -0
- package/dist/unpkg/prod/serializer.js +205 -205
- 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 -517
- 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 +418 -447
- package/dist/unpkg/prod-deprecated/adapter/error.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter/json-api.js +236 -252
- package/dist/unpkg/prod-deprecated/adapter/json-api.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter/rest.js +911 -1097
- package/dist/unpkg/prod-deprecated/adapter/rest.js.map +1 -0
- package/{declarations/adapter.d.ts → dist/unpkg/prod-deprecated/adapter-DAx_reer.js} +445 -110
- package/dist/unpkg/prod-deprecated/adapter-DAx_reer.js.map +1 -0
- package/dist/unpkg/prod-deprecated/adapter.js +1 -1214
- package/dist/unpkg/prod-deprecated/compat/-private.js +3 -1
- package/dist/unpkg/prod-deprecated/compat/builders.js +165 -182
- package/dist/unpkg/prod-deprecated/compat/builders.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat/extensions.js +252 -283
- package/dist/unpkg/prod-deprecated/compat/extensions.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat/utils.js +183 -200
- package/dist/unpkg/prod-deprecated/compat/utils.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat-CJ87MzDn.js +547 -0
- package/dist/unpkg/prod-deprecated/compat-CJ87MzDn.js.map +1 -0
- package/dist/unpkg/prod-deprecated/compat.js +1 -742
- package/dist/unpkg/prod-deprecated/errors-BUVJ3jcW.js +1978 -0
- package/dist/unpkg/prod-deprecated/errors-BUVJ3jcW.js.map +1 -0
- package/dist/unpkg/prod-deprecated/index.js +245 -307
- 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 +488 -559
- package/dist/unpkg/prod-deprecated/model/migration-support.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model-66Pl5niO.js +604 -0
- package/dist/unpkg/prod-deprecated/model-66Pl5niO.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model-fragments-tlMYPSd_.js +334 -0
- package/dist/unpkg/prod-deprecated/model-fragments-tlMYPSd_.js.map +1 -0
- package/dist/unpkg/prod-deprecated/model-fragments.js +2 -94
- package/dist/unpkg/prod-deprecated/model.js +3 -599
- package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-CVHWB0MF.js +53 -0
- package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-CVHWB0MF.js.map +1 -0
- package/dist/unpkg/prod-deprecated/schema-provider-DtyBaLoG.js +1635 -0
- package/dist/unpkg/prod-deprecated/schema-provider-DtyBaLoG.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer/json-api.js +497 -592
- 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 -1166
- package/dist/unpkg/prod-deprecated/serializer/rest.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer/transform.js +283 -308
- package/dist/unpkg/prod-deprecated/serializer/transform.js.map +1 -0
- package/dist/unpkg/prod-deprecated/serializer.js +205 -205
- 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 -517
- 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 +16 -16
- package/declarations/adapter/-private/build-url-mixin.d.ts +0 -189
- 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 -431
- package/declarations/compat/-private.d.ts +0 -13
- package/declarations/compat/builders/find-all.d.ts +0 -34
- 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 -99
- 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 -9
- package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +0 -528
- package/declarations/compat/legacy-network-handler/minimum-serializer-interface.d.ts +0 -220
- 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 -148
- package/declarations/compat.d.ts +0 -189
- package/declarations/index.d.ts +0 -244
- package/declarations/model/-private/attr.d.ts +0 -191
- package/declarations/model/-private/belongs-to.d.ts +0 -195
- 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 -36
- 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 -1279
- 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 -130
- 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 -66
- 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 -306
- package/declarations/model-fragments/extensions/fragment-array.d.ts +0 -54
- package/declarations/model-fragments/extensions/fragment.d.ts +0 -50
- package/declarations/model-fragments/hooks/model-for.d.ts +0 -27
- package/declarations/model-fragments/index.d.ts +0 -13
- package/declarations/model-fragments/instance-initializers/fragment-extensions.d.ts +0 -15
- package/declarations/model-fragments/utilities/with-array-defaults.d.ts +0 -56
- package/declarations/model-fragments/utilities/with-fragment-array-defaults.d.ts +0 -38
- package/declarations/model-fragments/utilities/with-fragment-defaults.d.ts +0 -34
- package/declarations/model-fragments/utilities/with-legacy.d.ts +0 -11
- package/declarations/model-fragments.d.ts +0 -9
- package/declarations/model.d.ts +0 -49
- package/declarations/serializer/-private/transforms/boolean.d.ts +0 -60
- package/declarations/serializer/-private/transforms/date.d.ts +0 -42
- package/declarations/serializer/-private/transforms/number.d.ts +0 -42
- package/declarations/serializer/-private/transforms/string.d.ts +0 -42
- package/declarations/serializer/-private/transforms/transform.d.ts +0 -118
- package/declarations/serializer/-private/utils.d.ts +0 -27
- package/declarations/serializer/rest.d.ts +0 -51
- package/declarations/serializer/transform.d.ts +0 -5
- package/declarations/serializer.d.ts +0 -252
- package/declarations/store/-private.d.ts +0 -223
- package/declarations/store.d.ts +0 -10
- package/dist/-private-BG3bMiKp.js +0 -1211
- package/dist/errors-DZKA206g.js +0 -2589
- package/dist/hooks-BvOqJBei.js +0 -105
- package/dist/json-DU8m1pGf.js +0 -1336
- package/dist/model-for-CXkJw59V.js +0 -297
- package/dist/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/schema-provider-DtPOp0d7.js +0 -2382
- package/dist/serialize-into-hash-DPZYoF-i.js +0 -261
- package/dist/unpkg/dev/-private-DtjBbEgy.js +0 -1206
- package/dist/unpkg/dev/errors-DngRU-If.js +0 -2585
- package/dist/unpkg/dev/hooks-UuiLxWxS.js +0 -104
- package/dist/unpkg/dev/json-K2Y9z6MN.js +0 -1333
- package/dist/unpkg/dev/model-for-CXkJw59V.js +0 -297
- package/dist/unpkg/dev/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/dev/schema-provider-0D7f-QOn.js +0 -2272
- 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-Bzidntpi.js +0 -2588
- package/dist/unpkg/dev-deprecated/hooks-DVXhMW14.js +0 -104
- package/dist/unpkg/dev-deprecated/json-K2Y9z6MN.js +0 -1333
- package/dist/unpkg/dev-deprecated/model-for-CXkJw59V.js +0 -297
- package/dist/unpkg/dev-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/dev-deprecated/schema-provider-ZwO5_fZw.js +0 -2292
- 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-B-PWeYlW.js +0 -2337
- package/dist/unpkg/prod/hooks-Bx-zBziU.js +0 -72
- package/dist/unpkg/prod/json-Qewu-UN9.js +0 -1300
- package/dist/unpkg/prod/model-for-CXkJw59V.js +0 -297
- package/dist/unpkg/prod/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/prod/schema-provider-BgRqk8i9.js +0 -1951
- 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-Dl2J9d1D.js +0 -2340
- package/dist/unpkg/prod-deprecated/hooks-Cm60wWTf.js +0 -72
- package/dist/unpkg/prod-deprecated/json-Qewu-UN9.js +0 -1300
- package/dist/unpkg/prod-deprecated/model-for-CXkJw59V.js +0 -297
- package/dist/unpkg/prod-deprecated/runtime-BPCpkOf1-BKOwiRJp.js +0 -65
- package/dist/unpkg/prod-deprecated/schema-provider-Dh6tRqVI.js +0 -1980
- 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
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
import { n as normalizeModelName } from "./util-dSKEgQDp.js";
|
|
2
|
+
import { t as isMaybeIdentifier } from "./utils-DYC9utVJ.js";
|
|
3
|
+
import { assertPrivateStore, constructResource, ensureStringId, recordIdentifierFor, storeFor } from "@warp-drive/core/store/-private";
|
|
4
|
+
import { defineSignal } from "@warp-drive/core/signals/-leaked";
|
|
5
|
+
import { getOrSetGlobal } from "@warp-drive/core/types/-private";
|
|
6
|
+
import { SkipCache } from "@warp-drive/core/types/request";
|
|
7
|
+
|
|
8
|
+
//#region src/store/-private.ts
|
|
9
|
+
function preloadData(store, identifier, preload) {
|
|
10
|
+
const jsonPayload = {};
|
|
11
|
+
const fields = store.schema.fields(identifier);
|
|
12
|
+
Object.keys(preload).forEach((key) => {
|
|
13
|
+
const preloadValue = preload[key];
|
|
14
|
+
const field = fields.get(key);
|
|
15
|
+
if (field && (field.kind === "hasMany" || field.kind === "belongsTo")) {
|
|
16
|
+
if (!jsonPayload.relationships) jsonPayload.relationships = {};
|
|
17
|
+
jsonPayload.relationships[key] = preloadRelationship(field, preloadValue);
|
|
18
|
+
} else {
|
|
19
|
+
if (!jsonPayload.attributes) jsonPayload.attributes = {};
|
|
20
|
+
jsonPayload.attributes[key] = preloadValue;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const cache = store.cache;
|
|
24
|
+
assertPrivateStore(store);
|
|
25
|
+
const hasRecord = Boolean(store._instanceCache.peek(identifier));
|
|
26
|
+
cache.upsert(identifier, jsonPayload, hasRecord);
|
|
27
|
+
}
|
|
28
|
+
function preloadRelationship(schema, preloadValue) {
|
|
29
|
+
const relatedType = schema.type;
|
|
30
|
+
if (schema.kind === "hasMany") {
|
|
31
|
+
((test) => {
|
|
32
|
+
if (!test) throw new Error("You need to pass in an array to set a hasMany property on a record");
|
|
33
|
+
})(Array.isArray(preloadValue));
|
|
34
|
+
return { data: preloadValue.map((value) => _convertPreloadRelationshipToJSON(value, relatedType)) };
|
|
35
|
+
}
|
|
36
|
+
((test) => {
|
|
37
|
+
if (!test) throw new Error("You should not pass in an array to set a belongsTo property on a record");
|
|
38
|
+
})(!Array.isArray(preloadValue));
|
|
39
|
+
return { data: preloadValue ? _convertPreloadRelationshipToJSON(preloadValue, relatedType) : null };
|
|
40
|
+
}
|
|
41
|
+
function _convertPreloadRelationshipToJSON(value, type) {
|
|
42
|
+
if (typeof value === "string" || typeof value === "number") return {
|
|
43
|
+
type,
|
|
44
|
+
id: ensureStringId(value)
|
|
45
|
+
};
|
|
46
|
+
return recordIdentifierFor(value);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Minimum subset of static schema methods and properties on the
|
|
50
|
+
* "model" class.
|
|
51
|
+
*
|
|
52
|
+
* Only used when using the legacy schema-service implementation
|
|
53
|
+
* for @ember-data/model or when wrapping schema for legacy
|
|
54
|
+
* Adapters/Serializers.
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
function _resourceIsFullDeleted(identifier, cache) {
|
|
58
|
+
return cache.isDeletionCommitted(identifier) || cache.isNew(identifier) && cache.isDeleted(identifier);
|
|
59
|
+
}
|
|
60
|
+
function resourceIsFullyDeleted(instanceCache, identifier) {
|
|
61
|
+
const cache = instanceCache.cache;
|
|
62
|
+
return !cache || _resourceIsFullDeleted(identifier, cache);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
A `RecordReference` is a low-level API that allows users and
|
|
66
|
+
addon authors to perform meta-operations on a record.
|
|
67
|
+
|
|
68
|
+
@hideconstructor
|
|
69
|
+
@public
|
|
70
|
+
*/
|
|
71
|
+
var RecordReference = class {
|
|
72
|
+
/** @internal */
|
|
73
|
+
/** @internal */
|
|
74
|
+
___token;
|
|
75
|
+
/** @internal */
|
|
76
|
+
___identifier;
|
|
77
|
+
/** @internal */
|
|
78
|
+
constructor(store, identifier) {
|
|
79
|
+
this.store = store;
|
|
80
|
+
this.___identifier = identifier;
|
|
81
|
+
this.___token = store.notifications.subscribe(identifier, (_, bucket, notifiedKey) => {
|
|
82
|
+
if (bucket === "identity" || bucket === "attributes" && notifiedKey === "id") this._ref++;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/** @internal */
|
|
86
|
+
destroy() {
|
|
87
|
+
this.store.notifications.unsubscribe(this.___token);
|
|
88
|
+
}
|
|
89
|
+
get type() {
|
|
90
|
+
return this.identifier().type;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
The `id` of the record that this reference refers to.
|
|
94
|
+
Together, the `type` and `id` properties form a composite key for
|
|
95
|
+
the identity map.
|
|
96
|
+
Example
|
|
97
|
+
```javascript
|
|
98
|
+
let userRef = store.getReference('user', 1);
|
|
99
|
+
userRef.id(); // '1'
|
|
100
|
+
```
|
|
101
|
+
@public
|
|
102
|
+
@return The id of the record.
|
|
103
|
+
*/
|
|
104
|
+
id() {
|
|
105
|
+
this._ref;
|
|
106
|
+
return this.___identifier.id;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
The `identifier` of the record that this reference refers to.
|
|
110
|
+
Together, the `type` and `id` properties form a composite key for
|
|
111
|
+
the identity map.
|
|
112
|
+
Example
|
|
113
|
+
```javascript
|
|
114
|
+
let userRef = store.getReference('user', 1);
|
|
115
|
+
userRef.identifier(); // '1'
|
|
116
|
+
```
|
|
117
|
+
@public
|
|
118
|
+
@return The identifier of the record.
|
|
119
|
+
*/
|
|
120
|
+
identifier() {
|
|
121
|
+
return this.___identifier;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
How the reference will be looked up when it is loaded. Currently
|
|
125
|
+
this always returns `identity` to signify that a record will be
|
|
126
|
+
loaded by its `type` and `id`.
|
|
127
|
+
Example
|
|
128
|
+
```javascript
|
|
129
|
+
const userRef = store.getReference('user', 1);
|
|
130
|
+
userRef.remoteType(); // 'identity'
|
|
131
|
+
```
|
|
132
|
+
@public
|
|
133
|
+
*/
|
|
134
|
+
remoteType() {
|
|
135
|
+
return "identity";
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
This API allows you to provide a reference with new data. The
|
|
139
|
+
simplest usage of this API is similar to `store.push`: you provide a
|
|
140
|
+
normalized hash of data and the object represented by the reference
|
|
141
|
+
will update.
|
|
142
|
+
If you pass a promise to `push`, WarpDrive will not ask the adapter
|
|
143
|
+
for the data if another attempt to fetch it is made in the
|
|
144
|
+
interim. When the promise resolves, the underlying object is updated
|
|
145
|
+
with the new data, and the promise returned by *this function* is resolved
|
|
146
|
+
with that object.
|
|
147
|
+
For example, `recordReference.push(promise)` will be resolved with a
|
|
148
|
+
record.
|
|
149
|
+
Example
|
|
150
|
+
```javascript
|
|
151
|
+
let userRef = store.getReference('user', 1);
|
|
152
|
+
// provide data for reference
|
|
153
|
+
userRef.push({
|
|
154
|
+
data: {
|
|
155
|
+
id: "1",
|
|
156
|
+
type: "user",
|
|
157
|
+
attributes: {
|
|
158
|
+
username: "@user"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}).then(function(user) {
|
|
162
|
+
userRef.value() === user;
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
@public
|
|
166
|
+
@param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
|
|
167
|
+
@return a promise for the value (record or relationship)
|
|
168
|
+
*/
|
|
169
|
+
push(objectOrPromise) {
|
|
170
|
+
return Promise.resolve(objectOrPromise).then((data) => {
|
|
171
|
+
return this.store.push(data);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
If the entity referred to by the reference is already loaded, it is
|
|
176
|
+
present as `reference.value`. Otherwise the value returned by this function
|
|
177
|
+
is `null`.
|
|
178
|
+
Example
|
|
179
|
+
```javascript
|
|
180
|
+
let userRef = store.getReference('user', 1);
|
|
181
|
+
userRef.value(); // user
|
|
182
|
+
```
|
|
183
|
+
@public
|
|
184
|
+
@return the record for this RecordReference
|
|
185
|
+
*/
|
|
186
|
+
value() {
|
|
187
|
+
return this.store.peekRecord(this.___identifier);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
Triggers a fetch for the backing entity based on its `remoteType`
|
|
191
|
+
(see `remoteType` definitions per reference type).
|
|
192
|
+
Example
|
|
193
|
+
```javascript
|
|
194
|
+
let userRef = store.getReference('user', 1);
|
|
195
|
+
// load user (via store.find)
|
|
196
|
+
userRef.load().then(...)
|
|
197
|
+
```
|
|
198
|
+
@public
|
|
199
|
+
@return the record for this RecordReference
|
|
200
|
+
*/
|
|
201
|
+
load() {
|
|
202
|
+
const id = this.id();
|
|
203
|
+
if (id !== null) return this.store.findRecord(this.type, id);
|
|
204
|
+
((test) => {
|
|
205
|
+
if (!test) throw new Error(`Unable to fetch record of type ${this.type} without an id`);
|
|
206
|
+
})(false);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
Reloads the record if it is already loaded. If the record is not
|
|
210
|
+
loaded it will load the record via `store.findRecord`
|
|
211
|
+
Example
|
|
212
|
+
```javascript
|
|
213
|
+
let userRef = store.getReference('user', 1);
|
|
214
|
+
// or trigger a reload
|
|
215
|
+
userRef.reload().then(...)
|
|
216
|
+
```
|
|
217
|
+
@public
|
|
218
|
+
@return the record for this RecordReference
|
|
219
|
+
*/
|
|
220
|
+
reload() {
|
|
221
|
+
const id = this.id();
|
|
222
|
+
if (id !== null) return this.store.findRecord(this.type, id, { reload: true });
|
|
223
|
+
((test) => {
|
|
224
|
+
if (!test) throw new Error(`Unable to fetch record of type ${this.type} without an id`);
|
|
225
|
+
})(false);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
defineSignal(RecordReference.prototype, "_ref");
|
|
229
|
+
const AvailableShims = getOrSetGlobal("AvailableShims", /* @__PURE__ */ new WeakMap());
|
|
230
|
+
function getShimClass(store, modelName) {
|
|
231
|
+
let shims = AvailableShims.get(store);
|
|
232
|
+
if (!shims) {
|
|
233
|
+
shims = Object.create(null);
|
|
234
|
+
AvailableShims.set(store, shims);
|
|
235
|
+
}
|
|
236
|
+
let shim = shims[modelName];
|
|
237
|
+
if (shim === void 0) shim = shims[modelName] = new ShimModelClass(store, modelName);
|
|
238
|
+
return shim;
|
|
239
|
+
}
|
|
240
|
+
var ShimModelClass = class {
|
|
241
|
+
constructor(store, modelName) {
|
|
242
|
+
this.__store = store;
|
|
243
|
+
this.modelName = modelName;
|
|
244
|
+
}
|
|
245
|
+
get fields() {
|
|
246
|
+
const fields = /* @__PURE__ */ new Map();
|
|
247
|
+
this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {
|
|
248
|
+
if (schema.kind === "attribute" || schema.kind === "belongsTo" || schema.kind === "hasMany") fields.set(key, schema.kind);
|
|
249
|
+
});
|
|
250
|
+
return fields;
|
|
251
|
+
}
|
|
252
|
+
get attributes() {
|
|
253
|
+
const attrs = /* @__PURE__ */ new Map();
|
|
254
|
+
this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {
|
|
255
|
+
if (schema.kind === "attribute") attrs.set(key, schema);
|
|
256
|
+
});
|
|
257
|
+
return attrs;
|
|
258
|
+
}
|
|
259
|
+
get relationshipsByName() {
|
|
260
|
+
const rels = /* @__PURE__ */ new Map();
|
|
261
|
+
this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {
|
|
262
|
+
if (schema.kind === "belongsTo" || schema.kind === "hasMany") rels.set(key, schema);
|
|
263
|
+
});
|
|
264
|
+
return rels;
|
|
265
|
+
}
|
|
266
|
+
eachAttribute(callback, binding) {
|
|
267
|
+
this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {
|
|
268
|
+
if (schema.kind === "attribute") callback.call(binding, key, schema);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
eachRelationship(callback, binding) {
|
|
272
|
+
this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {
|
|
273
|
+
if (schema.kind === "belongsTo" || schema.kind === "hasMany") callback.call(binding, key, schema);
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
eachTransformedAttribute(callback, binding) {
|
|
277
|
+
this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {
|
|
278
|
+
if (schema.kind === "attribute") {
|
|
279
|
+
const type = schema.type;
|
|
280
|
+
if (type) callback.call(binding, key, type);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/store.ts
|
|
288
|
+
/**
|
|
289
|
+
* Restores the deprecated `findRecord`/`findAll`/`query`/`queryRecord`/
|
|
290
|
+
* `findBelongsTo`/`findHasMany`/`createRecord`/`deleteRecord`/`saveRecord`
|
|
291
|
+
* legacy-network-layer implementations of these methods onto the given
|
|
292
|
+
* `Store` subclass, for apps that have not yet migrated to the
|
|
293
|
+
* `RequestManager`-based equivalents.
|
|
294
|
+
*/
|
|
295
|
+
function restoreDeprecatedStoreBehaviors(StoreKlass) {
|
|
296
|
+
StoreKlass.prototype.findRecord = function(resource, id, options) {
|
|
297
|
+
((test) => {
|
|
298
|
+
if (!test) throw new Error(`Attempted to call store.findRecord(), but the store instance has already been destroyed.`);
|
|
299
|
+
})(!(this.isDestroying || this.isDestroyed));
|
|
300
|
+
((test) => {
|
|
301
|
+
if (!test) throw new Error(`You need to pass a modelName or resource identifier as the first argument to the store's findRecord method`);
|
|
302
|
+
})(resource);
|
|
303
|
+
if (isMaybeIdentifier(resource)) options = id;
|
|
304
|
+
else {
|
|
305
|
+
((test) => {
|
|
306
|
+
if (!test) throw new Error(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${resource}`);
|
|
307
|
+
})(typeof resource === "string");
|
|
308
|
+
const type = normalizeModelName(resource);
|
|
309
|
+
const normalizedId = ensureStringId(id);
|
|
310
|
+
resource = constructResource(type, normalizedId);
|
|
311
|
+
}
|
|
312
|
+
const identifier = this.cacheKeyManager.getOrCreateRecordIdentifier(resource);
|
|
313
|
+
options = options || {};
|
|
314
|
+
assertPrivateStore(this);
|
|
315
|
+
if (options.preload) {
|
|
316
|
+
if (!this._instanceCache.recordIsLoaded(identifier)) options.reload = true;
|
|
317
|
+
this._join(() => {
|
|
318
|
+
preloadData(this, identifier, options.preload);
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
return this.request({
|
|
322
|
+
op: "findRecord",
|
|
323
|
+
data: {
|
|
324
|
+
record: identifier,
|
|
325
|
+
options
|
|
326
|
+
},
|
|
327
|
+
cacheOptions: { [SkipCache]: true }
|
|
328
|
+
}).then((document) => {
|
|
329
|
+
return document.content;
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
StoreKlass.prototype.findAll = function(type, options = {}) {
|
|
333
|
+
((test) => {
|
|
334
|
+
if (!test) throw new Error(`Attempted to call store.findAll(), but the store instance has already been destroyed.`);
|
|
335
|
+
})(!(this.isDestroying || this.isDestroyed));
|
|
336
|
+
((test) => {
|
|
337
|
+
if (!test) throw new Error(`You need to pass a model name to the store's findAll method`);
|
|
338
|
+
})(type);
|
|
339
|
+
((test) => {
|
|
340
|
+
if (!test) throw new Error(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`);
|
|
341
|
+
})(typeof type === "string");
|
|
342
|
+
return this.request({
|
|
343
|
+
op: "findAll",
|
|
344
|
+
data: {
|
|
345
|
+
type: normalizeModelName(type),
|
|
346
|
+
options: options || {}
|
|
347
|
+
},
|
|
348
|
+
cacheOptions: { [SkipCache]: true }
|
|
349
|
+
}).then((document) => document.content);
|
|
350
|
+
};
|
|
351
|
+
StoreKlass.prototype.query = function(type, query, options = {}) {
|
|
352
|
+
((test) => {
|
|
353
|
+
if (!test) throw new Error(`Attempted to call store.query(), but the store instance has already been destroyed.`);
|
|
354
|
+
})(!(this.isDestroying || this.isDestroyed));
|
|
355
|
+
((test) => {
|
|
356
|
+
if (!test) throw new Error(`You need to pass a model name to the store's query method`);
|
|
357
|
+
})(type);
|
|
358
|
+
((test) => {
|
|
359
|
+
if (!test) throw new Error(`You need to pass a query hash to the store's query method`);
|
|
360
|
+
})(query);
|
|
361
|
+
((test) => {
|
|
362
|
+
if (!test) throw new Error(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`);
|
|
363
|
+
})(typeof type === "string");
|
|
364
|
+
return this.request({
|
|
365
|
+
op: "query",
|
|
366
|
+
data: {
|
|
367
|
+
type: normalizeModelName(type),
|
|
368
|
+
query,
|
|
369
|
+
options
|
|
370
|
+
},
|
|
371
|
+
cacheOptions: { [SkipCache]: true }
|
|
372
|
+
}).then((document) => document.content);
|
|
373
|
+
};
|
|
374
|
+
StoreKlass.prototype.queryRecord = function(type, query, options) {
|
|
375
|
+
((test) => {
|
|
376
|
+
if (!test) throw new Error(`Attempted to call store.queryRecord(), but the store instance has already been destroyed.`);
|
|
377
|
+
})(!(this.isDestroying || this.isDestroyed));
|
|
378
|
+
((test) => {
|
|
379
|
+
if (!test) throw new Error(`You need to pass a model name to the store's queryRecord method`);
|
|
380
|
+
})(type);
|
|
381
|
+
((test) => {
|
|
382
|
+
if (!test) throw new Error(`You need to pass a query hash to the store's queryRecord method`);
|
|
383
|
+
})(query);
|
|
384
|
+
((test) => {
|
|
385
|
+
if (!test) throw new Error(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`);
|
|
386
|
+
})(typeof type === "string");
|
|
387
|
+
return this.request({
|
|
388
|
+
op: "queryRecord",
|
|
389
|
+
data: {
|
|
390
|
+
type: normalizeModelName(type),
|
|
391
|
+
query,
|
|
392
|
+
options: options || {}
|
|
393
|
+
},
|
|
394
|
+
cacheOptions: { [SkipCache]: true }
|
|
395
|
+
}).then((document) => document.content);
|
|
396
|
+
};
|
|
397
|
+
StoreKlass.prototype.getReference = function(resource, id) {
|
|
398
|
+
((test) => {
|
|
399
|
+
if (!test) throw new Error(`Attempted to call store.getReference(), but the store instance has already been destroyed.`);
|
|
400
|
+
})(!(this.isDestroying || this.isDestroyed));
|
|
401
|
+
let resourceIdentifier;
|
|
402
|
+
if (arguments.length === 1 && isMaybeIdentifier(resource)) resourceIdentifier = resource;
|
|
403
|
+
else {
|
|
404
|
+
const type = normalizeModelName(resource);
|
|
405
|
+
const normalizedId = ensureStringId(id);
|
|
406
|
+
resourceIdentifier = constructResource(type, normalizedId);
|
|
407
|
+
}
|
|
408
|
+
((test) => {
|
|
409
|
+
if (!test) throw new Error("getReference expected to receive either a resource identifier or type and id as arguments");
|
|
410
|
+
})(isMaybeIdentifier(resourceIdentifier));
|
|
411
|
+
const identifier = this.cacheKeyManager.getOrCreateRecordIdentifier(resourceIdentifier);
|
|
412
|
+
assertPrivateStore(this);
|
|
413
|
+
const cache = upgradeInstanceCaches(this._instanceCache.__instances).reference;
|
|
414
|
+
let reference = cache.get(identifier);
|
|
415
|
+
if (!reference) {
|
|
416
|
+
reference = new RecordReference(this, identifier);
|
|
417
|
+
cache.set(identifier, reference);
|
|
418
|
+
}
|
|
419
|
+
return reference;
|
|
420
|
+
};
|
|
421
|
+
StoreKlass.prototype.modelFor = function(type) {
|
|
422
|
+
((test) => {
|
|
423
|
+
if (!test) throw new Error(`Attempted to call store.modelFor(), but the store instance has already been destroyed.`);
|
|
424
|
+
})(!this.isDestroyed);
|
|
425
|
+
((test) => {
|
|
426
|
+
if (!test) throw new Error(`You need to pass <type> to the store's modelFor method`);
|
|
427
|
+
})(typeof type === "string" && type.length);
|
|
428
|
+
((test) => {
|
|
429
|
+
if (!test) throw new Error(`No model was found for '${type}' and no schema handles the type`);
|
|
430
|
+
})(this.schema.hasResource({ type }));
|
|
431
|
+
return getShimClass(this, type);
|
|
432
|
+
};
|
|
433
|
+
StoreKlass.prototype.saveRecord = function(record, options = {}) {
|
|
434
|
+
((test) => {
|
|
435
|
+
if (!test) throw new Error(`Attempted to call store.saveRecord(), but the store instance has already been destroyed.`);
|
|
436
|
+
})(!(this.isDestroying || this.isDestroyed));
|
|
437
|
+
((test) => {
|
|
438
|
+
if (!test) throw new Error(`Unable to initiate save for a record in a disconnected state`);
|
|
439
|
+
})(storeFor(record, true));
|
|
440
|
+
const identifier = recordIdentifierFor(record);
|
|
441
|
+
const cache = this.cache;
|
|
442
|
+
if (!identifier) return Promise.reject(/* @__PURE__ */ new Error(`Record Is Disconnected`));
|
|
443
|
+
assertPrivateStore(this);
|
|
444
|
+
((test) => {
|
|
445
|
+
if (!test) throw new Error(`Cannot initiate a save request for an unloaded record: ${identifier.lid}`);
|
|
446
|
+
})(this._instanceCache.recordIsLoaded(identifier));
|
|
447
|
+
if (resourceIsFullyDeleted(this._instanceCache, identifier)) return Promise.resolve(record);
|
|
448
|
+
if (!options) options = {};
|
|
449
|
+
let operation = "updateRecord";
|
|
450
|
+
if (cache.isNew(identifier)) operation = "createRecord";
|
|
451
|
+
else if (cache.isDeleted(identifier)) operation = "deleteRecord";
|
|
452
|
+
const request = {
|
|
453
|
+
op: operation,
|
|
454
|
+
data: {
|
|
455
|
+
options,
|
|
456
|
+
record: identifier
|
|
457
|
+
},
|
|
458
|
+
records: [identifier],
|
|
459
|
+
cacheOptions: { [SkipCache]: true }
|
|
460
|
+
};
|
|
461
|
+
return this.request(request).then((document) => document.content);
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
function upgradeInstanceCaches(cache) {
|
|
465
|
+
const withReferences = cache;
|
|
466
|
+
if (!withReferences.reference) withReferences.reference = /* @__PURE__ */ new WeakMap();
|
|
467
|
+
return withReferences;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
//#endregion
|
|
471
|
+
export { restoreDeprecatedStoreBehaviors as t };
|
|
472
|
+
//# sourceMappingURL=store-D_V8-HQl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-D_V8-HQl.js","names":["defineSignal","assertPrivateStore","ensureStringId","recordIdentifierFor","getOrSetGlobal","preloadData","store","identifier","preload","jsonPayload","schemas","schema","fields","Object","keys","forEach","key","preloadValue","field","get","kind","relationships","preloadRelationship","attributes","cache","hasRecord","Boolean","_instanceCache","peek","upsert","relatedType","type","test","Error","Array","isArray","data","map","value","_convertPreloadRelationshipToJSON","id","_resourceIsFullDeleted","isDeletionCommitted","isNew","isDeleted","resourceIsFullyDeleted","instanceCache","RecordReference","___token","___identifier","constructor","notifications","subscribe","_","bucket","notifiedKey","_ref","destroy","unsubscribe","remoteType","push","objectOrPromise","Promise","resolve","then","peekRecord","load","findRecord","reload","prototype","AvailableShims","WeakMap","getShimClass","modelName","shims","create","set","shim","undefined","ShimModelClass","__store","Map","fieldSchemas","attrs","relationshipsByName","rels","eachAttribute","callback","binding","call","eachRelationship","eachTransformedAttribute","assertPrivateStore","constructResource","ensureStringId","recordIdentifierFor","storeFor","SkipCache","isMaybeIdentifier","normalizeModelName","getShimClass","preloadData","RecordReference","resourceIsFullyDeleted","restoreDeprecatedStoreBehaviors","StoreKlass","prototype","findRecord","resource","id","options","test","Error","isDestroying","isDestroyed","type","normalizedId","identifier","cacheKeyManager","getOrCreateRecordIdentifier","preload","_instanceCache","recordIsLoaded","reload","_join","promise","request","op","data","record","cacheOptions","then","document","content","findAll","query","queryRecord","getReference","resourceIdentifier","arguments","length","cache","upgradeInstanceCaches","__instances","reference","get","set","modelFor","schema","hasResource","saveRecord","Promise","reject","lid","resolve","operation","isNew","isDeleted","records","withReferences","WeakMap"],"sources":["../../../src/store/-private.ts","../../../src/store.ts"],"sourcesContent":["import type { NotificationType } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport { defineSignal } from '@warp-drive/core/signals/-leaked';\nimport {\n assertPrivateStore,\n ensureStringId,\n type InstanceCache,\n recordIdentifierFor,\n} from '@warp-drive/core/store/-private';\nimport { getOrSetGlobal } from '@warp-drive/core/types/-private';\nimport type { Cache } from '@warp-drive/core/types/cache';\nimport type { NewResourceKey, ResourceKey } from '@warp-drive/core/types/identifier';\nimport type { Value } from '@warp-drive/core/types/json/raw';\nimport type { OpaqueRecordInstance, TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport type {\n LegacyAttributeField,\n LegacyRelationshipField,\n LegacyRelationshipField as RelationshipSchema,\n} from '@warp-drive/core/types/schema/fields';\nimport type {\n ExistingResourceIdentifierObject,\n ExistingResourceObject,\n InnerRelationshipDocument,\n SingleResourceDocument,\n} from '@warp-drive/core/types/spec/json-api-raw';\n\nimport type { Store } from '../store.ts';\n\n/*\n When a find request is triggered on the store, the user can optionally pass in\n attributes and relationships to be preloaded. These are meant to behave as if they\n came back from the server, except the user obtained them out of band and is informing\n the store of their existence. The most common use case is for supporting client side\n nested URLs, such as `/posts/1/comments/2` so the user can do\n `store.findRecord('comment', 2, { preload: { post: 1 } })` without having to fetch the post.\n\n Preloaded data can be attributes and relationships passed in either as IDs or as actual\n models.\n */\ntype PreloadRelationshipValue = OpaqueRecordInstance | string;\nexport function preloadData(store: Store, identifier: NewResourceKey, preload: Record<string, Value>): void {\n const jsonPayload: Partial<ExistingResourceObject> = {};\n //TODO(Igor) consider the polymorphic case\n const schemas = store.schema;\n const fields = schemas.fields(identifier);\n Object.keys(preload).forEach((key) => {\n const preloadValue = preload[key];\n\n const field = fields.get(key);\n if (field && (field.kind === 'hasMany' || field.kind === 'belongsTo')) {\n if (!jsonPayload.relationships) {\n jsonPayload.relationships = {};\n }\n jsonPayload.relationships[key] = preloadRelationship(field, preloadValue);\n } else {\n if (!jsonPayload.attributes) {\n jsonPayload.attributes = {};\n }\n jsonPayload.attributes[key] = preloadValue;\n }\n });\n const cache = store.cache;\n assertPrivateStore(store);\n const hasRecord = Boolean(store._instanceCache.peek(identifier));\n cache.upsert(identifier, jsonPayload, hasRecord);\n}\n\nfunction preloadRelationship(\n schema: RelationshipSchema,\n preloadValue: PreloadRelationshipValue | null | Array<PreloadRelationshipValue>\n): InnerRelationshipDocument<ExistingResourceIdentifierObject> {\n const relatedType = schema.type;\n\n if (schema.kind === 'hasMany') {\n assert('You need to pass in an array to set a hasMany property on a record', Array.isArray(preloadValue));\n return { data: preloadValue.map((value) => _convertPreloadRelationshipToJSON(value, relatedType)) };\n }\n\n assert('You should not pass in an array to set a belongsTo property on a record', !Array.isArray(preloadValue));\n return { data: preloadValue ? _convertPreloadRelationshipToJSON(preloadValue, relatedType) : null };\n}\n\n/*\n findRecord('user', '1', { preload: { friends: ['1'] }});\n findRecord('user', '1', { preload: { friends: [record] }});\n*/\nfunction _convertPreloadRelationshipToJSON(\n value: OpaqueRecordInstance | string,\n type: string\n): ExistingResourceIdentifierObject {\n if (typeof value === 'string' || typeof value === 'number') {\n return { type, id: ensureStringId(value) };\n }\n // TODO if not a record instance assert it's an identifier\n // and allow identifiers to be used\n return recordIdentifierFor(value) as ExistingResourceIdentifierObject;\n}\n\nexport interface BaseFinderOptions {\n reload?: boolean;\n backgroundReload?: boolean;\n include?: string | string[];\n adapterOptions?: Record<string, unknown>;\n}\nexport interface FindRecordOptions extends BaseFinderOptions {\n /**\n * Data to preload into the store before the request is made.\n * This feature is *highly* discouraged and has no corresponding\n * feature when using builders and handlers.\n *\n * Excepting relationships: the data should be in the form of a\n * JSON object where the keys are fields on the record and the value\n * is the raw value to be added to the cache.\n *\n * Relationships can either be provided as string IDs from which\n * an identifier will be built base upon the relationship's expected\n * resource type, or be record instances from which the identifier\n * will be extracted.\n *\n */\n preload?: Record<string, Value>;\n}\n\nexport type QueryOptions = {\n [K in string | 'adapterOptions']?: K extends 'adapterOptions' ? Record<string, unknown> : unknown;\n};\n\nexport type FindAllOptions = BaseFinderOptions;\nexport type LegacyResourceQuery = {\n include?: string | string[];\n [key: string]: Value | undefined;\n};\n\nexport type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;\n\n/**\n * Minimum subset of static schema methods and properties on the\n * \"model\" class.\n *\n * Only used when using the legacy schema-service implementation\n * for @ember-data/model or when wrapping schema for legacy\n * Adapters/Serializers.\n *\n */\nexport interface ModelSchema<T = unknown> {\n modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;\n fields: Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>;\n attributes: Map<KeyOrString<T>, LegacyAttributeField>;\n relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;\n eachAttribute<K extends KeyOrString<T>>(\n callback: (this: ModelSchema<T>, key: K, attribute: LegacyAttributeField) => void,\n binding?: T\n ): void;\n eachRelationship<K extends KeyOrString<T>>(\n callback: (this: ModelSchema<T>, key: K, relationship: LegacyRelationshipField) => void,\n binding?: T\n ): void;\n eachTransformedAttribute<K extends KeyOrString<T>>(\n callback: (this: ModelSchema<T>, key: K, type: string | null) => void,\n binding?: T\n ): void;\n}\n\nfunction _resourceIsFullDeleted(identifier: ResourceKey, cache: Cache): boolean {\n return cache.isDeletionCommitted(identifier) || (cache.isNew(identifier) && cache.isDeleted(identifier));\n}\n\nexport function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: ResourceKey): boolean {\n const cache = instanceCache.cache;\n return !cache || _resourceIsFullDeleted(identifier, cache);\n}\n\n/**\n A `RecordReference` is a low-level API that allows users and\n addon authors to perform meta-operations on a record.\n\n @hideconstructor\n @public\n*/\nexport class RecordReference {\n /** @internal */\n declare private store: Store;\n // unsubscribe token given to us by the notification manager\n /** @internal */\n private ___token!: object;\n /** @internal */\n private ___identifier: ResourceKey;\n /** @internal */\n declare private _ref: number;\n\n constructor(store: Store, identifier: ResourceKey) {\n this.store = store;\n this.___identifier = identifier;\n this.___token = store.notifications.subscribe(\n identifier,\n (_: ResourceKey, bucket: NotificationType, notifiedKey?: string) => {\n if (bucket === 'identity' || (bucket === 'attributes' && notifiedKey === 'id')) {\n this._ref++;\n }\n }\n );\n }\n\n /** @internal */\n destroy(): void {\n this.store.notifications.unsubscribe(this.___token);\n }\n\n get type(): string {\n return this.identifier().type;\n }\n\n /**\n The `id` of the record that this reference refers to.\n\n Together, the `type` and `id` properties form a composite key for\n the identity map.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.id(); // '1'\n ```\n\n @public\n @return The id of the record.\n */\n id(): string | null {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n this._ref; // consume the tracked prop\n return this.___identifier.id;\n }\n\n /**\n The `identifier` of the record that this reference refers to.\n\n Together, the `type` and `id` properties form a composite key for\n the identity map.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.identifier(); // '1'\n ```\n\n @public\n @return The identifier of the record.\n */\n identifier(): ResourceKey {\n return this.___identifier;\n }\n\n /**\n How the reference will be looked up when it is loaded. Currently\n this always returns `identity` to signify that a record will be\n loaded by its `type` and `id`.\n\n Example\n\n ```javascript\n const userRef = store.getReference('user', 1);\n\n userRef.remoteType(); // 'identity'\n ```\n\n @public\n */\n remoteType(): 'identity' {\n return 'identity';\n }\n\n /**\n This API allows you to provide a reference with new data. The\n simplest usage of this API is similar to `store.push`: you provide a\n normalized hash of data and the object represented by the reference\n will update.\n\n If you pass a promise to `push`, WarpDrive will not ask the adapter\n for the data if another attempt to fetch it is made in the\n interim. When the promise resolves, the underlying object is updated\n with the new data, and the promise returned by *this function* is resolved\n with that object.\n\n For example, `recordReference.push(promise)` will be resolved with a\n record.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // provide data for reference\n userRef.push({\n data: {\n id: \"1\",\n type: \"user\",\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```\n\n @public\n @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one\n @return a promise for the value (record or relationship)\n */\n push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance> {\n // TODO @deprecate pushing unresolved payloads\n return Promise.resolve(objectOrPromise).then((data) => {\n return this.store.push(data);\n });\n }\n\n /**\n If the entity referred to by the reference is already loaded, it is\n present as `reference.value`. Otherwise the value returned by this function\n is `null`.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.value(); // user\n ```\n\n @public\n @return the record for this RecordReference\n */\n value(): OpaqueRecordInstance | null {\n return this.store.peekRecord(this.___identifier);\n }\n\n /**\n Triggers a fetch for the backing entity based on its `remoteType`\n (see `remoteType` definitions per reference type).\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // load user (via store.find)\n userRef.load().then(...)\n ```\n\n @public\n @return the record for this RecordReference\n */\n load(): Promise<unknown> {\n const id = this.id();\n if (id !== null) {\n return this.store.findRecord(this.type, id);\n }\n assert(`Unable to fetch record of type ${this.type} without an id`);\n }\n\n /**\n Reloads the record if it is already loaded. If the record is not\n loaded it will load the record via `store.findRecord`\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // or trigger a reload\n userRef.reload().then(...)\n ```\n\n @public\n @return the record for this RecordReference\n */\n reload(): Promise<unknown> {\n const id = this.id();\n if (id !== null) {\n return this.store.findRecord(this.type, id, { reload: true });\n }\n assert(`Unable to fetch record of type ${this.type} without an id`);\n }\n}\n\ndefineSignal(RecordReference.prototype, '_ref');\n\n// if modelFor turns out to be a bottleneck we should replace with a Map\n// and clear it during store teardown.\nconst AvailableShims = getOrSetGlobal('AvailableShims', new WeakMap<Store, Record<string, ShimModelClass>>());\n\nexport function getShimClass<T>(\n store: Store,\n modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string\n): ShimModelClass<T> {\n let shims = AvailableShims.get(store);\n\n if (!shims) {\n shims = Object.create(null) as Record<string, ShimModelClass>;\n AvailableShims.set(store, shims);\n }\n\n let shim = shims[modelName];\n if (shim === undefined) {\n shim = shims[modelName] = new ShimModelClass<unknown>(store, modelName);\n }\n\n return shim;\n}\n\n// Mimics the static apis of @ember-data/model\nexport class ShimModelClass<T = unknown> implements ModelSchema<T> {\n declare __store: Store;\n declare modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;\n constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string) {\n this.__store = store;\n this.modelName = modelName;\n }\n\n get fields(): Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'> {\n const fields = new Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>();\n const fieldSchemas = this.__store.schema.fields({ type: this.modelName });\n\n fieldSchemas.forEach((schema, key) => {\n if (schema.kind === 'attribute' || schema.kind === 'belongsTo' || schema.kind === 'hasMany') {\n fields.set(key as KeyOrString<T>, schema.kind);\n }\n });\n\n return fields;\n }\n\n get attributes(): Map<KeyOrString<T>, LegacyAttributeField> {\n const attrs = new Map<KeyOrString<T>, LegacyAttributeField>();\n const fields = this.__store.schema.fields({ type: this.modelName });\n\n fields.forEach((schema, key) => {\n if (schema.kind === 'attribute') {\n attrs.set(key as KeyOrString<T>, schema);\n }\n });\n\n return attrs;\n }\n\n get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField> {\n const rels = new Map<KeyOrString<T>, LegacyRelationshipField>();\n const fields = this.__store.schema.fields({ type: this.modelName });\n\n fields.forEach((schema, key) => {\n if (schema.kind === 'belongsTo' || schema.kind === 'hasMany') {\n rels.set(key as KeyOrString<T>, schema);\n }\n });\n\n return rels;\n }\n\n eachAttribute<K extends KeyOrString<T>>(\n callback: (key: K, attribute: LegacyAttributeField) => void,\n binding?: T\n ): void {\n this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {\n if (schema.kind === 'attribute') {\n callback.call(binding, key as K, schema);\n }\n });\n }\n\n eachRelationship<K extends KeyOrString<T>>(\n callback: (key: K, relationship: LegacyRelationshipField) => void,\n binding?: T\n ): void {\n this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {\n if (schema.kind === 'belongsTo' || schema.kind === 'hasMany') {\n callback.call(binding, key as K, schema);\n }\n });\n }\n\n eachTransformedAttribute<K extends KeyOrString<T>>(\n callback: (key: K, type: string | null) => void,\n binding?: T\n ): void {\n this.__store.schema.fields({ type: this.modelName }).forEach((schema, key) => {\n if (schema.kind === 'attribute') {\n const type = schema.type;\n if (type) callback.call(binding, key as K, type);\n }\n });\n }\n}\n","import type { Store } from '@warp-drive/core';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { LegacyLiveArray, LegacyQueryArray, PrivateStore } from '@warp-drive/core/store/-private';\nimport {\n assertPrivateStore,\n constructResource,\n ensureStringId,\n recordIdentifierFor,\n storeFor,\n} from '@warp-drive/core/store/-private';\nimport type { ResourceKey } from '@warp-drive/core/types/identifier';\nimport type { OpaqueRecordInstance, TypedRecordInstance, TypeFromInstance } from '@warp-drive/core/types/record';\nimport { SkipCache } from '@warp-drive/core/types/request';\nimport type { ResourceIdentifierObject } from '@warp-drive/core/types/spec/json-api-raw';\n\nimport { isMaybeIdentifier } from './compat/builders/utils.ts';\nimport { normalizeModelName } from './model/-private/util.ts';\nimport type {\n FindAllOptions,\n FindRecordOptions,\n LegacyResourceQuery,\n ModelSchema,\n QueryOptions,\n} from './store/-private.ts';\nimport { getShimClass, preloadData, RecordReference, resourceIsFullyDeleted } from './store/-private.ts';\n\n/**\n * Restores the deprecated `findRecord`/`findAll`/`query`/`queryRecord`/\n * `findBelongsTo`/`findHasMany`/`createRecord`/`deleteRecord`/`saveRecord`\n * legacy-network-layer implementations of these methods onto the given\n * `Store` subclass, for apps that have not yet migrated to the\n * `RequestManager`-based equivalents.\n */\nexport function restoreDeprecatedStoreBehaviors(StoreKlass: typeof Store): void {\n StoreKlass.prototype.findRecord = function (\n resource: string | ResourceIdentifierObject,\n id?: string | number | FindRecordOptions,\n options?: FindRecordOptions\n ): Promise<unknown> {\n assert(\n `Attempted to call store.findRecord(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the store's findRecord method`,\n resource\n );\n if (isMaybeIdentifier(resource)) {\n options = id as FindRecordOptions;\n } else {\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${resource}`,\n typeof resource === 'string'\n );\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(id as string | number);\n resource = constructResource(type, normalizedId);\n }\n\n const identifier = this.cacheKeyManager.getOrCreateRecordIdentifier(resource);\n options = options || {};\n assertPrivateStore(this);\n\n if (options.preload) {\n // force reload if we preload to ensure we don't resolve the promise\n // until we are complete, else we will end up background-reloading\n // even for initial load.\n if (!this._instanceCache.recordIsLoaded(identifier)) {\n options.reload = true;\n }\n this._join(() => {\n preloadData(this, identifier, options.preload!);\n });\n }\n\n const promise = this.request<OpaqueRecordInstance>({\n op: 'findRecord',\n data: {\n record: identifier,\n options,\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => {\n return document.content;\n });\n };\n\n StoreKlass.prototype.findAll = function <T>(\n type: TypeFromInstance<T> | string,\n options: FindAllOptions = {}\n ): Promise<LegacyLiveArray<T>> {\n assert(\n `Attempted to call store.findAll(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`You need to pass a model name to the store's findAll method`, type);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n const promise = this.request<LegacyLiveArray<T>>({\n op: 'findAll',\n data: {\n type: normalizeModelName(type),\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => document.content);\n };\n\n StoreKlass.prototype.query = function (\n type: string,\n query: LegacyResourceQuery,\n options: QueryOptions = {}\n ): Promise<LegacyQueryArray> {\n assert(\n `Attempted to call store.query(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`You need to pass a model name to the store's query method`, type);\n assert(`You need to pass a query hash to the store's query method`, query);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n const promise = this.request<LegacyQueryArray>({\n op: 'query',\n data: {\n type: normalizeModelName(type),\n query,\n options: options,\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => document.content);\n };\n\n StoreKlass.prototype.queryRecord = function (\n type: string,\n query: Record<string, unknown>,\n options?: QueryOptions\n ): Promise<OpaqueRecordInstance | null> {\n assert(\n `Attempted to call store.queryRecord(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`You need to pass a model name to the store's queryRecord method`, type);\n assert(`You need to pass a query hash to the store's queryRecord method`, query);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n const promise = this.request<OpaqueRecordInstance | null>({\n op: 'queryRecord',\n data: {\n type: normalizeModelName(type),\n query,\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n });\n\n return promise.then((document) => document.content);\n };\n\n // do not put a ts-expect-error here, because typedoc will fail to\n // build due to this error only occurring when references are in use in the editor.\n // The return statement below casts to `PrivateStore['getReference']`'s return\n // type rather than annotating this function `: RecordReference` directly,\n // since this package's `RecordReference` and core's `deprecated/-private.ts`\n // copy are structurally identical but nominally distinct classes (TS treats\n // their private fields as separate brands); casting only the return value\n // (instead of the whole function) keeps `this` contextually typed from the\n // assignment target below.\n StoreKlass.prototype.getReference = function (resource: string | ResourceIdentifierObject, id: string | number) {\n assert(\n `Attempted to call store.getReference(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n\n let resourceIdentifier: ResourceIdentifierObject;\n if (arguments.length === 1 && isMaybeIdentifier(resource)) {\n resourceIdentifier = resource;\n } else {\n const type = normalizeModelName(resource as string);\n const normalizedId = ensureStringId(id);\n resourceIdentifier = constructResource(type, normalizedId);\n }\n\n assert(\n 'getReference expected to receive either a resource identifier or type and id as arguments',\n isMaybeIdentifier(resourceIdentifier)\n );\n\n const identifier: ResourceKey = this.cacheKeyManager.getOrCreateRecordIdentifier(resourceIdentifier);\n assertPrivateStore(this);\n\n const cache = upgradeInstanceCaches(this._instanceCache.__instances).reference;\n let reference = cache.get(identifier);\n\n if (!reference) {\n reference = new RecordReference(this, identifier);\n cache.set(identifier, reference);\n }\n return reference as unknown as ReturnType<PrivateStore['getReference']>;\n };\n\n StoreKlass.prototype.modelFor = function <T>(\n type: T extends TypedRecordInstance ? TypeFromInstance<T> : string\n ): ModelSchema<T> {\n assert(`Attempted to call store.modelFor(), but the store instance has already been destroyed.`, !this.isDestroyed);\n assert(`You need to pass <type> to the store's modelFor method`, typeof type === 'string' && type.length);\n assert(`No model was found for '${type}' and no schema handles the type`, this.schema.hasResource({ type }));\n\n return getShimClass<T>(this, type);\n };\n\n StoreKlass.prototype.saveRecord = function <T>(record: T, options: Record<string, unknown> = {}): Promise<T> {\n assert(\n `Attempted to call store.saveRecord(), but the store instance has already been destroyed.`,\n !(this.isDestroying || this.isDestroyed)\n );\n assert(`Unable to initiate save for a record in a disconnected state`, storeFor(record, true));\n const identifier = recordIdentifierFor(record);\n const cache = this.cache;\n\n if (!identifier) {\n // this commonly means we're disconnected\n // but just in case we reject here to prevent bad things.\n return Promise.reject(new Error(`Record Is Disconnected`));\n }\n assertPrivateStore(this);\n assert(\n `Cannot initiate a save request for an unloaded record: ${identifier.lid}`,\n this._instanceCache.recordIsLoaded(identifier)\n );\n if (resourceIsFullyDeleted(this._instanceCache, identifier)) {\n return Promise.resolve(record);\n }\n\n if (!options) {\n options = {};\n }\n let operation: 'createRecord' | 'deleteRecord' | 'updateRecord' = 'updateRecord';\n\n if (cache.isNew(identifier)) {\n operation = 'createRecord';\n } else if (cache.isDeleted(identifier)) {\n operation = 'deleteRecord';\n }\n\n const request = {\n op: operation,\n data: {\n options,\n record: identifier,\n },\n records: [identifier],\n cacheOptions: { [SkipCache]: true },\n };\n\n return this.request<T>(request).then((document) => document.content);\n };\n}\n\nexport { Store };\n\ntype Caches = PrivateStore['_instanceCache']['__instances'];\nfunction upgradeInstanceCaches(cache: Caches): Caches & { reference: WeakMap<ResourceKey, RecordReference> } {\n const withReferences = cache as Caches & { reference: WeakMap<ResourceKey, RecordReference> };\n if (!withReferences.reference) {\n withReferences.reference = new WeakMap();\n }\n\n return withReferences;\n}\n"],"mappings":";;;;;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