@warp-drive/core 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/dist/-private-BYn1Vh-L.js +22 -0
- package/dist/-private-BYn1Vh-L.js.map +1 -0
- package/dist/-private-CyhhcK1a.js +120 -0
- package/dist/-private-CyhhcK1a.js.map +1 -0
- package/dist/-private-zrP4VGAf.js +3530 -0
- package/dist/-private-zrP4VGAf.js.map +1 -0
- package/dist/aliases-BWYW5EhX.d.ts +17 -0
- package/dist/aliases-BWYW5EhX.d.ts.map +1 -0
- package/dist/build-config/babel-macros.d.ts +2 -0
- package/dist/build-config/babel-macros.js +3 -1
- package/dist/build-config/canary-features.d.ts +1 -0
- package/dist/build-config/canary-features.js +1 -1
- package/dist/build-config/debugging.d.ts +1 -0
- package/dist/build-config/debugging.js +1 -1
- package/dist/build-config/deprecations.d.ts +1 -0
- package/dist/build-config/deprecations.js +1 -1
- package/dist/build-config/env.d.ts +2 -0
- package/dist/build-config/env.js +3 -1
- package/dist/build-config/macros.d.ts +2 -0
- package/dist/build-config/macros.js +3 -1
- package/dist/build-config.d.ts +2 -0
- package/dist/build-config.js +3 -1
- package/dist/change-C7kqv2kW.d.ts +41 -0
- package/dist/change-C7kqv2kW.d.ts.map +1 -0
- package/dist/concepts-DFldVwEM.d.ts +77 -0
- package/dist/concepts-DFldVwEM.d.ts.map +1 -0
- package/dist/configure-B_F639tN.d.ts +134 -0
- package/dist/configure-B_F639tN.d.ts.map +1 -0
- package/dist/configure.d.ts +2 -0
- package/dist/configure.js +3 -2
- package/dist/document-BEn91SwT.d.ts +129 -0
- package/dist/document-BEn91SwT.d.ts.map +1 -0
- package/dist/error-50OSEhsF.d.ts +77 -0
- package/dist/error-50OSEhsF.d.ts.map +1 -0
- package/dist/fields-FM7peCiM.d.ts +2327 -0
- package/dist/fields-FM7peCiM.d.ts.map +1 -0
- package/dist/graph/-private.d.ts +2 -0
- package/dist/graph/-private.js +2200 -3196
- package/dist/graph/-private.js.map +1 -0
- package/dist/graph-DLqYXP2z.d.ts +186 -0
- package/dist/graph-DLqYXP2z.d.ts.map +1 -0
- package/dist/identifier-DQnqOSJK.d.ts +112 -0
- package/dist/identifier-DQnqOSJK.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -8
- package/dist/internal-DtWOpxrR.d.ts +9182 -0
- package/dist/internal-DtWOpxrR.d.ts.map +1 -0
- package/dist/json-api-raw-C5APJHHB.d.ts +378 -0
- package/dist/json-api-raw-C5APJHHB.d.ts.map +1 -0
- package/dist/mutations-CqtoGB4t.d.ts +165 -0
- package/dist/mutations-CqtoGB4t.d.ts.map +1 -0
- package/dist/operations-D1qA6r0_.d.ts +244 -0
- package/dist/operations-D1qA6r0_.d.ts.map +1 -0
- package/dist/params-DrEx3bf8.d.ts +41 -0
- package/dist/params-DrEx3bf8.d.ts.map +1 -0
- package/dist/raw-D5hnjiq7.d.ts +31 -0
- package/dist/raw-D5hnjiq7.d.ts.map +1 -0
- package/dist/reactive/-private.d.ts +2 -0
- package/dist/reactive/-private.js +3 -1
- package/dist/reactive.d.ts +2 -0
- package/dist/reactive.js +5 -4
- package/dist/record-D3QQcaIR.d.ts +254 -0
- package/dist/record-D3QQcaIR.d.ts.map +1 -0
- package/dist/relationship-CmHzMPKf.d.ts +65 -0
- package/dist/relationship-CmHzMPKf.d.ts.map +1 -0
- package/dist/request-7BJFgSu_.js +766 -0
- package/dist/request-7BJFgSu_.js.map +1 -0
- package/dist/request.d.ts +2 -0
- package/dist/request.js +2 -48
- package/dist/signals/-leaked.d.ts +1060 -0
- package/dist/signals/-leaked.d.ts.map +1 -0
- package/dist/signals/-leaked.js +3 -1
- package/dist/src-BOAWJH_S.js +9227 -0
- package/dist/src-BOAWJH_S.js.map +1 -0
- package/dist/store/-private.d.ts +2 -0
- package/dist/store/-private.js +3 -1
- package/dist/store-DNF9Rgoh.js +462 -0
- package/dist/store-DNF9Rgoh.js.map +1 -0
- package/dist/store.d.ts +2 -0
- package/dist/store.js +3 -1
- package/dist/symbols-DjRDCeX0.d.ts +88 -0
- package/dist/symbols-DjRDCeX0.d.ts.map +1 -0
- package/dist/types/-private.d.ts +76 -0
- package/dist/types/-private.d.ts.map +1 -0
- package/dist/types/-private.js +1 -77
- package/dist/types/cache/aliases.d.ts +2 -0
- package/dist/types/cache/change.d.ts +2 -0
- package/dist/types/cache/mutations.d.ts +2 -0
- package/dist/types/cache/operations.d.ts +2 -0
- package/dist/types/cache/relationship.d.ts +2 -0
- package/dist/types/cache.d.ts +2 -0
- package/dist/types/graph.d.ts +2 -0
- package/dist/types/identifier.d.ts +2 -0
- package/dist/types/identifier.js +60 -52
- package/dist/types/identifier.js.map +1 -0
- package/dist/types/json/raw.d.ts +2 -0
- package/dist/types/params.d.ts +2 -0
- package/dist/types/record.d.ts +2 -0
- package/dist/types/record.js +211 -181
- package/dist/types/record.js.map +1 -0
- package/dist/types/request.d.ts +2 -0
- package/dist/types/request.js +138 -69
- package/dist/types/request.js.map +1 -0
- package/dist/types/runtime.d.ts +55 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/runtime.js +54 -26
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/schema/concepts.d.ts +2 -0
- package/dist/types/schema/fields.d.ts +2 -0
- package/dist/types/schema/fields.js +501 -495
- package/dist/types/schema/fields.js.map +1 -0
- package/dist/types/schema/fields.type-test.d.ts +1 -0
- package/dist/types/schema/fields.type-test.js +79 -0
- package/dist/types/schema/fields.type-test.js.map +1 -0
- package/dist/types/schema/schema-service.d.ts +2 -0
- package/dist/types/spec/document.d.ts +2 -0
- package/dist/types/spec/error.d.ts +2 -0
- package/dist/types/spec/json-api-raw.d.ts +2 -0
- package/dist/types/symbols.d.ts +2 -0
- package/dist/types/symbols.js +84 -77
- package/dist/types/symbols.js.map +1 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types.d.ts +3 -0
- package/dist/unpkg/dev/-private-BoSTJwp9.js +3519 -0
- package/dist/unpkg/dev/-private-BoSTJwp9.js.map +1 -0
- package/dist/unpkg/dev/-private-CUkeqUhO.js +22 -0
- package/dist/unpkg/dev/-private-CUkeqUhO.js.map +1 -0
- package/dist/unpkg/dev/-private-D6Tw25AD.js +111 -0
- package/dist/unpkg/dev/-private-D6Tw25AD.js.map +1 -0
- package/dist/unpkg/dev/build-config/babel-macros.js +3 -1
- package/dist/unpkg/dev/build-config/canary-features.js +1 -1
- package/dist/unpkg/dev/build-config/debugging.js +1 -1
- package/dist/unpkg/dev/build-config/deprecations.js +1 -1
- package/dist/unpkg/dev/build-config/env.js +3 -1
- package/dist/unpkg/dev/build-config/macros.js +3 -1
- package/dist/unpkg/dev/build-config.js +3 -1
- package/dist/unpkg/dev/configure.js +3 -1
- package/dist/unpkg/dev/graph/-private.js +1958 -2953
- package/dist/unpkg/dev/graph/-private.js.map +1 -0
- package/dist/unpkg/dev/index.js +3 -6
- package/dist/unpkg/dev/reactive/-private.js +3 -1
- package/dist/unpkg/dev/reactive.js +5 -3
- package/dist/unpkg/dev/request-CwjpJB3r.js +756 -0
- package/dist/unpkg/dev/request-CwjpJB3r.js.map +1 -0
- package/dist/unpkg/dev/request.js +2 -48
- package/dist/unpkg/dev/runtime-DoDtzXJb.js +110 -0
- package/dist/unpkg/dev/runtime-DoDtzXJb.js.map +1 -0
- package/dist/unpkg/dev/signals/-leaked.js +3 -1
- package/dist/unpkg/dev/src-CP6e_ozt.js +8331 -0
- package/dist/unpkg/dev/src-CP6e_ozt.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +3 -55
- package/dist/unpkg/dev/store-DamE3C4y.js +427 -0
- package/dist/unpkg/dev/store-DamE3C4y.js.map +1 -0
- package/dist/unpkg/dev/store.js +1 -556
- package/dist/unpkg/dev/types/-private.js +1 -67
- package/dist/unpkg/dev/types/identifier.js +63 -56
- package/dist/unpkg/dev/types/identifier.js.map +1 -0
- package/dist/unpkg/dev/types/record.js +211 -181
- package/dist/unpkg/dev/types/record.js.map +1 -0
- package/dist/unpkg/dev/types/request.js +138 -69
- package/dist/unpkg/dev/types/request.js.map +1 -0
- package/dist/unpkg/dev/types/runtime.js +54 -26
- package/dist/unpkg/dev/types/runtime.js.map +1 -0
- package/dist/unpkg/dev/types/schema/fields.js +501 -495
- package/dist/unpkg/dev/types/schema/fields.js.map +1 -0
- package/dist/unpkg/dev/types/schema/fields.type-test.js +79 -0
- package/dist/unpkg/dev/types/schema/fields.type-test.js.map +1 -0
- package/dist/unpkg/dev/types/symbols.js +84 -77
- package/dist/unpkg/dev/types/symbols.js.map +1 -0
- package/dist/unpkg/dev/utils/string.js +79 -85
- package/dist/unpkg/dev/utils/string.js.map +1 -0
- package/dist/unpkg/dev-deprecated/-private-BoSTJwp9.js +3519 -0
- package/dist/unpkg/dev-deprecated/-private-BoSTJwp9.js.map +1 -0
- package/dist/unpkg/dev-deprecated/-private-CUkeqUhO.js +22 -0
- package/dist/unpkg/dev-deprecated/-private-CUkeqUhO.js.map +1 -0
- package/dist/unpkg/dev-deprecated/-private-D6Tw25AD.js +111 -0
- package/dist/unpkg/dev-deprecated/-private-D6Tw25AD.js.map +1 -0
- package/dist/unpkg/dev-deprecated/build-config/babel-macros.js +3 -1
- package/dist/unpkg/dev-deprecated/build-config/canary-features.js +1 -1
- package/dist/unpkg/dev-deprecated/build-config/debugging.js +1 -1
- package/dist/unpkg/dev-deprecated/build-config/deprecations.js +1 -1
- package/dist/unpkg/dev-deprecated/build-config/env.js +3 -1
- package/dist/unpkg/dev-deprecated/build-config/macros.js +3 -1
- package/dist/unpkg/dev-deprecated/build-config.js +3 -1
- package/dist/unpkg/dev-deprecated/configure.js +3 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +2077 -3147
- package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -0
- package/dist/unpkg/dev-deprecated/index.js +3 -5
- package/dist/unpkg/dev-deprecated/reactive/-private.js +3 -1
- package/dist/unpkg/dev-deprecated/reactive.js +5 -3
- package/dist/unpkg/dev-deprecated/request-CwjpJB3r.js +756 -0
- package/dist/unpkg/dev-deprecated/request-CwjpJB3r.js.map +1 -0
- package/dist/unpkg/dev-deprecated/request.js +2 -48
- package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js +110 -0
- package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js.map +1 -0
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +3 -1
- package/dist/unpkg/dev-deprecated/src-De8OV58h.js +8884 -0
- package/dist/unpkg/dev-deprecated/src-De8OV58h.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +3 -1
- package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js +427 -0
- package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store.js +1 -556
- package/dist/unpkg/dev-deprecated/types/-private.js +1 -67
- package/dist/unpkg/dev-deprecated/types/identifier.js +63 -56
- package/dist/unpkg/dev-deprecated/types/identifier.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/record.js +211 -181
- package/dist/unpkg/dev-deprecated/types/record.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/request.js +138 -69
- package/dist/unpkg/dev-deprecated/types/request.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/runtime.js +54 -26
- package/dist/unpkg/dev-deprecated/types/runtime.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/schema/fields.js +501 -495
- package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js +79 -0
- package/dist/unpkg/dev-deprecated/types/schema/fields.type-test.js.map +1 -0
- package/dist/unpkg/dev-deprecated/types/symbols.js +84 -77
- package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -0
- package/dist/unpkg/dev-deprecated/utils/string.js +79 -85
- package/dist/unpkg/dev-deprecated/utils/string.js.map +1 -0
- package/dist/unpkg/prod/-private-B36B1ztP.js +22 -0
- package/dist/unpkg/prod/-private-B36B1ztP.js.map +1 -0
- package/dist/unpkg/prod/-private-DHco-h0q.js +3294 -0
- package/dist/unpkg/prod/-private-DHco-h0q.js.map +1 -0
- package/dist/unpkg/prod/-private-Dhl123OI.js +99 -0
- package/dist/unpkg/prod/-private-Dhl123OI.js.map +1 -0
- package/dist/unpkg/prod/build-config/babel-macros.js +3 -1
- package/dist/unpkg/prod/build-config/canary-features.js +1 -1
- package/dist/unpkg/prod/build-config/debugging.js +1 -1
- package/dist/unpkg/prod/build-config/deprecations.js +1 -1
- package/dist/unpkg/prod/build-config/env.js +3 -1
- package/dist/unpkg/prod/build-config/macros.js +3 -1
- package/dist/unpkg/prod/build-config.js +3 -1
- package/dist/unpkg/prod/configure.js +3 -2
- package/dist/unpkg/prod/graph/-private.js +1494 -2101
- package/dist/unpkg/prod/graph/-private.js.map +1 -0
- package/dist/unpkg/prod/index.js +2 -482
- package/dist/unpkg/prod/reactive/-private.js +3 -1
- package/dist/unpkg/prod/reactive.js +5 -30
- package/dist/unpkg/prod/request-BBdC1Sz7.js +480 -0
- package/dist/unpkg/prod/request-BBdC1Sz7.js.map +1 -0
- package/dist/unpkg/prod/request.js +3 -2
- package/dist/unpkg/prod/signals/-leaked.js +3 -1
- package/dist/unpkg/prod/src-nFHlZgKa.js +6942 -0
- package/dist/unpkg/prod/src-nFHlZgKa.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +3 -126
- package/dist/unpkg/prod/store-BWhmb7Ob.js +359 -0
- package/dist/unpkg/prod/store-BWhmb7Ob.js.map +1 -0
- package/dist/unpkg/prod/store.js +1 -435
- package/dist/unpkg/prod/types/-private.js +1 -47
- package/dist/unpkg/prod/types/identifier.js +63 -56
- package/dist/unpkg/prod/types/identifier.js.map +1 -0
- package/dist/unpkg/prod/types/record.js +211 -181
- package/dist/unpkg/prod/types/record.js.map +1 -0
- package/dist/unpkg/prod/types/request.js +138 -69
- package/dist/unpkg/prod/types/request.js.map +1 -0
- package/dist/unpkg/prod/types/runtime.js +54 -26
- package/dist/unpkg/prod/types/runtime.js.map +1 -0
- package/dist/unpkg/prod/types/schema/fields.js +501 -495
- package/dist/unpkg/prod/types/schema/fields.js.map +1 -0
- package/dist/unpkg/prod/types/schema/fields.type-test.js +79 -0
- package/dist/unpkg/prod/types/schema/fields.type-test.js.map +1 -0
- package/dist/unpkg/prod/types/symbols.js +84 -77
- package/dist/unpkg/prod/types/symbols.js.map +1 -0
- package/dist/unpkg/prod/utils/string.js +70 -66
- package/dist/unpkg/prod/utils/string.js.map +1 -0
- package/dist/unpkg/prod-deprecated/-private-B36B1ztP.js +22 -0
- package/dist/unpkg/prod-deprecated/-private-B36B1ztP.js.map +1 -0
- package/dist/unpkg/prod-deprecated/-private-DHco-h0q.js +3294 -0
- package/dist/unpkg/prod-deprecated/-private-DHco-h0q.js.map +1 -0
- package/dist/unpkg/prod-deprecated/-private-Dhl123OI.js +99 -0
- package/dist/unpkg/prod-deprecated/-private-Dhl123OI.js.map +1 -0
- package/dist/unpkg/prod-deprecated/build-config/babel-macros.js +3 -1
- package/dist/unpkg/prod-deprecated/build-config/canary-features.js +1 -1
- package/dist/unpkg/prod-deprecated/build-config/debugging.js +1 -1
- package/dist/unpkg/prod-deprecated/build-config/deprecations.js +1 -1
- package/dist/unpkg/prod-deprecated/build-config/env.js +3 -1
- package/dist/unpkg/prod-deprecated/build-config/macros.js +3 -1
- package/dist/unpkg/prod-deprecated/build-config.js +3 -1
- package/dist/unpkg/prod-deprecated/configure.js +3 -2
- package/dist/unpkg/prod-deprecated/graph/-private.js +1603 -2272
- package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -0
- package/dist/unpkg/prod-deprecated/index.js +2 -482
- package/dist/unpkg/prod-deprecated/reactive/-private.js +3 -1
- package/dist/unpkg/prod-deprecated/reactive.js +5 -5
- package/dist/unpkg/prod-deprecated/request-BBdC1Sz7.js +480 -0
- package/dist/unpkg/prod-deprecated/request-BBdC1Sz7.js.map +1 -0
- package/dist/unpkg/prod-deprecated/request.js +3 -2
- package/dist/unpkg/prod-deprecated/signals/-leaked.js +3 -1
- package/dist/unpkg/prod-deprecated/src-Cku5ymUJ.js +7375 -0
- package/dist/unpkg/prod-deprecated/src-Cku5ymUJ.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +3 -88
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js +359 -0
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store.js +1 -435
- package/dist/unpkg/prod-deprecated/types/-private.js +1 -47
- package/dist/unpkg/prod-deprecated/types/identifier.js +63 -56
- package/dist/unpkg/prod-deprecated/types/identifier.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/record.js +211 -181
- package/dist/unpkg/prod-deprecated/types/record.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/request.js +138 -69
- package/dist/unpkg/prod-deprecated/types/request.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/runtime.js +54 -26
- package/dist/unpkg/prod-deprecated/types/runtime.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/schema/fields.js +501 -495
- package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js +79 -0
- package/dist/unpkg/prod-deprecated/types/schema/fields.type-test.js.map +1 -0
- package/dist/unpkg/prod-deprecated/types/symbols.js +84 -77
- package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -0
- package/dist/unpkg/prod-deprecated/utils/string.js +70 -66
- package/dist/unpkg/prod-deprecated/utils/string.js.map +1 -0
- package/dist/utils/string.d.ts +54 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +84 -85
- package/dist/utils/string.js.map +1 -0
- package/dist/utils-BtURiy8l.d.ts +24 -0
- package/dist/utils-BtURiy8l.d.ts.map +1 -0
- package/package.json +17 -21
- package/declarations/build-config/babel-macros.d.ts +0 -1
- package/declarations/build-config/canary-features.d.ts +0 -1
- package/declarations/build-config/debugging.d.ts +0 -1
- package/declarations/build-config/deprecations.d.ts +0 -1
- package/declarations/build-config/env.d.ts +0 -1
- package/declarations/build-config/macros.d.ts +0 -1
- package/declarations/build-config.d.ts +0 -18
- package/declarations/configure.d.ts +0 -7
- package/declarations/graph/-private/-diff.d.ts +0 -19
- package/declarations/graph/-private/-edge-definition.d.ts +0 -149
- package/declarations/graph/-private/-state.d.ts +0 -9
- package/declarations/graph/-private/-utils.d.ts +0 -25
- package/declarations/graph/-private/coerce-id.d.ts +0 -4
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +0 -6
- package/declarations/graph/-private/edges/collection.d.ts +0 -39
- package/declarations/graph/-private/edges/implicit.d.ts +0 -43
- package/declarations/graph/-private/edges/resource.d.ts +0 -23
- package/declarations/graph/-private/graph.d.ts +0 -56
- package/declarations/graph/-private/normalize-link.d.ts +0 -2
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +0 -4
- package/declarations/graph/-private/operations/merge-identifier.d.ts +0 -3
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +0 -4
- package/declarations/graph/-private/operations/replace-related-record.d.ts +0 -3
- package/declarations/graph/-private/operations/replace-related-records.d.ts +0 -7
- package/declarations/graph/-private/operations/update-relationship.d.ts +0 -9
- package/declarations/graph/-private.d.ts +0 -13
- package/declarations/index.d.ts +0 -96
- package/declarations/reactive/-private/default-mode.d.ts +0 -73
- package/declarations/reactive/-private/document.d.ts +0 -142
- package/declarations/reactive/-private/fields/extension.d.ts +0 -8
- package/declarations/reactive/-private/fields/get-field-key.d.ts +0 -8
- package/declarations/reactive/-private/fields/managed-array.d.ts +0 -18
- package/declarations/reactive/-private/fields/managed-object.d.ts +0 -17
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +0 -19
- package/declarations/reactive/-private/hooks.d.ts +0 -5
- package/declarations/reactive/-private/kind/alias-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/array-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/attribute-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/belongs-to-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/collection-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/derived-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/generic-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/has-many-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/hash-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/identity-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/local-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/object-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/resource-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/schema-array-field.d.ts +0 -4
- package/declarations/reactive/-private/kind/schema-object-field.d.ts +0 -4
- package/declarations/reactive/-private/record.d.ts +0 -83
- package/declarations/reactive/-private/schema.d.ts +0 -326
- package/declarations/reactive/-private/symbols.d.ts +0 -5
- package/declarations/reactive/-private.d.ts +0 -2
- package/declarations/reactive.d.ts +0 -286
- package/declarations/request/-private/context.d.ts +0 -39
- package/declarations/request/-private/debug.d.ts +0 -4
- package/declarations/request/-private/fetch.d.ts +0 -33
- package/declarations/request/-private/future.d.ts +0 -7
- package/declarations/request/-private/manager.d.ts +0 -158
- package/declarations/request/-private/promise-cache.d.ts +0 -28
- package/declarations/request/-private/types.d.ts +0 -234
- package/declarations/request/-private/utils.d.ts +0 -57
- package/declarations/request.d.ts +0 -52
- package/declarations/signals/-leaked.d.ts +0 -2
- package/declarations/signals/-private.d.ts +0 -6
- package/declarations/signals/promise-state.d.ts +0 -264
- package/declarations/signals/reactivity/configure.d.ts +0 -138
- package/declarations/signals/reactivity/internal.d.ts +0 -154
- package/declarations/signals/reactivity/signal.d.ts +0 -56
- package/declarations/signals/request-state.d.ts +0 -372
- package/declarations/signals/request-subscription.d.ts +0 -177
- package/declarations/store/-private/cache-handler/handler.d.ts +0 -56
- package/declarations/store/-private/cache-handler/types.d.ts +0 -84
- package/declarations/store/-private/cache-handler/utils.d.ts +0 -31
- package/declarations/store/-private/caches/instance-cache.d.ts +0 -58
- package/declarations/store/-private/caches/resource-utils.d.ts +0 -9
- package/declarations/store/-private/debug/utils.d.ts +0 -7
- package/declarations/store/-private/default-cache-policy.d.ts +0 -387
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +0 -34
- package/declarations/store/-private/managers/cache-key-manager.d.ts +0 -304
- package/declarations/store/-private/managers/cache-manager.d.ts +0 -367
- package/declarations/store/-private/managers/notification-manager.d.ts +0 -83
- package/declarations/store/-private/managers/record-array-manager.d.ts +0 -100
- package/declarations/store/-private/network/request-cache.d.ts +0 -103
- package/declarations/store/-private/record-arrays/-utils.d.ts +0 -80
- package/declarations/store/-private/record-arrays/legacy-live-array.d.ts +0 -81
- package/declarations/store/-private/record-arrays/legacy-many-array.d.ts +0 -133
- package/declarations/store/-private/record-arrays/legacy-query.d.ts +0 -81
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +0 -3
- package/declarations/store/-private/record-arrays/resource-array.d.ts +0 -67
- package/declarations/store/-private/store-service.d.ts +0 -874
- package/declarations/store/-private/utils/coerce-id.d.ts +0 -4
- package/declarations/store/-private/utils/construct-resource.d.ts +0 -6
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/declarations/store/-private.d.ts +0 -24
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +0 -90
- package/declarations/store/-types/q/identifier.d.ts +0 -23
- package/declarations/store/-types/q/record-instance.d.ts +0 -22
- package/declarations/store/-types/q/store.d.ts +0 -31
- package/declarations/store/deprecated/-private.d.ts +0 -223
- package/declarations/store/deprecated/store.d.ts +0 -784
- package/declarations/store.d.ts +0 -2
- package/declarations/types/-private.d.ts +0 -22
- package/declarations/types/cache/aliases.d.ts +0 -1
- package/declarations/types/cache/change.d.ts +0 -6
- package/declarations/types/cache/mutations.d.ts +0 -38
- package/declarations/types/cache/operations.d.ts +0 -168
- package/declarations/types/cache/relationship.d.ts +0 -13
- package/declarations/types/cache.d.ts +0 -429
- package/declarations/types/graph.d.ts +0 -47
- package/declarations/types/identifier.d.ts +0 -86
- package/declarations/types/json/raw.d.ts +0 -6
- package/declarations/types/params.d.ts +0 -8
- package/declarations/types/record.d.ts +0 -269
- package/declarations/types/request.d.ts +0 -367
- package/declarations/types/runtime.d.ts +0 -14
- package/declarations/types/schema/concepts.d.ts +0 -23
- package/declarations/types/schema/fields.d.ts +0 -2200
- package/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/declarations/types/schema/schema-service.d.ts +0 -380
- package/declarations/types/spec/document.d.ts +0 -67
- package/declarations/types/spec/error.d.ts +0 -18
- package/declarations/types/spec/json-api-raw.d.ts +0 -139
- package/declarations/types/symbols.d.ts +0 -78
- package/declarations/types/utils.d.ts +0 -5
- package/declarations/types.d.ts +0 -11
- package/declarations/utils/string.d.ts +0 -47
- package/dist/configure-DPUFCemT.js +0 -1940
- package/dist/default-cache-policy-D7_u4YRH.js +0 -572
- package/dist/future-BKkJJkj7.js +0 -678
- package/dist/index-CQP2NSqg.js +0 -9982
- package/dist/symbols-3C1OkYtZ.js +0 -39
- package/dist/unpkg/dev/-leaked-Co0EI6Go.js +0 -1939
- package/dist/unpkg/dev/-private-sql1_mdx.js +0 -39
- package/dist/unpkg/dev/future-DFfOzSoe.js +0 -672
- package/dist/unpkg/dev/index-BzcBOnw9.js +0 -9392
- package/dist/unpkg/dev/runtime-E1M51_-O.js +0 -135
- package/dist/unpkg/dev-deprecated/-leaked-DjMeRqdU.js +0 -1939
- package/dist/unpkg/dev-deprecated/-private-3C1OkYtZ.js +0 -39
- package/dist/unpkg/dev-deprecated/future-DFfOzSoe.js +0 -672
- package/dist/unpkg/dev-deprecated/index-6TnTv-WG.js +0 -10007
- package/dist/unpkg/dev-deprecated/runtime-DAu5b0IR.js +0 -135
- package/dist/unpkg/prod/-leaked-DUONXQDB.js +0 -1676
- package/dist/unpkg/prod/-private-sql1_mdx.js +0 -39
- package/dist/unpkg/prod/handler-EU_8ncB2.js +0 -1619
- package/dist/unpkg/prod/promise-cache-DIT8Ypjq.js +0 -19
- package/dist/unpkg/prod/request-BrJSCG6r.js +0 -421
- package/dist/unpkg/prod/schema-BSkHyoWz.js +0 -5219
- package/dist/unpkg/prod-deprecated/-leaked-DRNv9VIX.js +0 -1676
- package/dist/unpkg/prod-deprecated/-private-3C1OkYtZ.js +0 -39
- package/dist/unpkg/prod-deprecated/handler-CCIu4sQ3.js +0 -334
- package/dist/unpkg/prod-deprecated/hooks-Dv4Np0MY.js +0 -26
- package/dist/unpkg/prod-deprecated/promise-cache-DIT8Ypjq.js +0 -19
- package/dist/unpkg/prod-deprecated/request-BrJSCG6r.js +0 -421
- package/dist/unpkg/prod-deprecated/schema-CJcjHv0E.js +0 -6939
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import { STRUCTURED, IS_FUTURE } from './types/request.js';
|
|
2
|
-
import { getOrSetGlobal } from './types/-private.js';
|
|
3
|
-
import { a as setRequestResult } from "./promise-cache-DIT8Ypjq.js";
|
|
4
|
-
function upgradeHeaders(headers) {
|
|
5
|
-
headers.clone = () => {
|
|
6
|
-
return new Headers(headers);
|
|
7
|
-
};
|
|
8
|
-
headers.toJSON = () => {
|
|
9
|
-
return Array.from(headers);
|
|
10
|
-
};
|
|
11
|
-
return headers;
|
|
12
|
-
}
|
|
13
|
-
function cloneResponseProperties(response) {
|
|
14
|
-
const {
|
|
15
|
-
headers,
|
|
16
|
-
ok,
|
|
17
|
-
redirected,
|
|
18
|
-
status,
|
|
19
|
-
statusText,
|
|
20
|
-
type,
|
|
21
|
-
url
|
|
22
|
-
} = response;
|
|
23
|
-
upgradeHeaders(headers);
|
|
24
|
-
return {
|
|
25
|
-
headers: headers,
|
|
26
|
-
ok,
|
|
27
|
-
redirected,
|
|
28
|
-
status,
|
|
29
|
-
statusText,
|
|
30
|
-
type,
|
|
31
|
-
url
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
class ContextOwner {
|
|
35
|
-
hasSetStream = false;
|
|
36
|
-
hasSetResponse = false;
|
|
37
|
-
hasSubscribers = false;
|
|
38
|
-
stream = createDeferred();
|
|
39
|
-
response = null;
|
|
40
|
-
nextCalled = 0;
|
|
41
|
-
constructor(request, god, isRoot = false) {
|
|
42
|
-
this.isRoot = isRoot;
|
|
43
|
-
this.requestId = god.id;
|
|
44
|
-
this.controller = request.controller || god.controller;
|
|
45
|
-
this.stream.promise.sizeHint = 0;
|
|
46
|
-
if (request.controller) {
|
|
47
|
-
if (request.controller !== god.controller) {
|
|
48
|
-
god.controller.signal.addEventListener('abort', () => {
|
|
49
|
-
this.controller.abort(god.controller.signal.reason);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
delete request.controller;
|
|
53
|
-
}
|
|
54
|
-
let enhancedRequest = Object.assign({
|
|
55
|
-
signal: this.controller.signal
|
|
56
|
-
}, request);
|
|
57
|
-
{
|
|
58
|
-
if (request.headers) {
|
|
59
|
-
upgradeHeaders(request.headers);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
this.enhancedRequest = enhancedRequest;
|
|
63
|
-
this.request = request;
|
|
64
|
-
this.god = god;
|
|
65
|
-
this.stream.promise = this.stream.promise.then(stream => {
|
|
66
|
-
if (this.god.stream === stream && this.hasSubscribers) {
|
|
67
|
-
this.god.stream = null;
|
|
68
|
-
}
|
|
69
|
-
return stream;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
get hasRequestedStream() {
|
|
73
|
-
return this.god.hasRequestedStream;
|
|
74
|
-
}
|
|
75
|
-
getResponse() {
|
|
76
|
-
if (this.hasSetResponse) {
|
|
77
|
-
return this.response;
|
|
78
|
-
}
|
|
79
|
-
if (this.nextCalled === 1) {
|
|
80
|
-
return this.god.response;
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
getStream() {
|
|
85
|
-
if (this.isRoot) {
|
|
86
|
-
this.god.hasRequestedStream = true;
|
|
87
|
-
}
|
|
88
|
-
if (!this.hasSetResponse) {
|
|
89
|
-
const hint = this.god.response?.headers?.get('content-length');
|
|
90
|
-
this.stream.promise.sizeHint = hint ? parseInt(hint, 10) : 0;
|
|
91
|
-
}
|
|
92
|
-
this.hasSubscribers = true;
|
|
93
|
-
return this.stream.promise;
|
|
94
|
-
}
|
|
95
|
-
abort(reason) {
|
|
96
|
-
this.controller.abort(reason);
|
|
97
|
-
}
|
|
98
|
-
setStream(stream) {
|
|
99
|
-
if (!this.hasSetStream) {
|
|
100
|
-
this.hasSetStream = true;
|
|
101
|
-
if (!(stream instanceof Promise)) {
|
|
102
|
-
this.god.stream = stream;
|
|
103
|
-
}
|
|
104
|
-
// @ts-expect-error
|
|
105
|
-
this.stream.resolve(stream);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
resolveStream() {
|
|
109
|
-
this.setStream(this.nextCalled === 1 ? this.god.stream : null);
|
|
110
|
-
}
|
|
111
|
-
setResponse(response) {
|
|
112
|
-
if (this.hasSetResponse) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
this.hasSetResponse = true;
|
|
116
|
-
if (response instanceof Response) {
|
|
117
|
-
// TODO potentially avoid cloning in prod
|
|
118
|
-
let responseData = cloneResponseProperties(response);
|
|
119
|
-
this.response = responseData;
|
|
120
|
-
this.god.response = responseData;
|
|
121
|
-
const sizeHint = response.headers?.get('content-length');
|
|
122
|
-
this.stream.promise.sizeHint = sizeHint ? parseInt(sizeHint, 10) : 0;
|
|
123
|
-
} else {
|
|
124
|
-
this.response = response;
|
|
125
|
-
this.god.response = response;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
class Context {
|
|
130
|
-
/** @internal */
|
|
131
|
-
|
|
132
|
-
/** @internal */
|
|
133
|
-
|
|
134
|
-
/** @internal */
|
|
135
|
-
|
|
136
|
-
constructor(owner, isCacheHandler) {
|
|
137
|
-
this.id = owner.requestId;
|
|
138
|
-
this.___owner = owner;
|
|
139
|
-
this.request = owner.enhancedRequest;
|
|
140
|
-
this._isCacheHandler = isCacheHandler;
|
|
141
|
-
this._finalized = false;
|
|
142
|
-
}
|
|
143
|
-
setStream(stream) {
|
|
144
|
-
this.___owner.setStream(stream);
|
|
145
|
-
}
|
|
146
|
-
setResponse(response) {
|
|
147
|
-
this.___owner.setResponse(response);
|
|
148
|
-
}
|
|
149
|
-
setIdentifier(identifier) {
|
|
150
|
-
this.___owner.god.identifier = identifier;
|
|
151
|
-
}
|
|
152
|
-
get hasRequestedStream() {
|
|
153
|
-
return this.___owner.hasRequestedStream;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** @private */
|
|
157
|
-
_finalize() {
|
|
158
|
-
this._finalized = true;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
const IS_CACHE_HANDLER = getOrSetGlobal('IS_CACHE_HANDLER', Symbol('IS_CACHE_HANDLER'));
|
|
162
|
-
function curryFuture(owner, inbound, outbound) {
|
|
163
|
-
owner.setStream(inbound.getStream());
|
|
164
|
-
inbound.then(doc => {
|
|
165
|
-
const document = {
|
|
166
|
-
[STRUCTURED]: true,
|
|
167
|
-
request: owner.request,
|
|
168
|
-
response: doc.response,
|
|
169
|
-
content: doc.content
|
|
170
|
-
};
|
|
171
|
-
outbound.resolve(document);
|
|
172
|
-
}, error => {
|
|
173
|
-
if (isDoc(error)) {
|
|
174
|
-
owner.setStream(owner.god.stream);
|
|
175
|
-
}
|
|
176
|
-
if (!error || !(error instanceof Error)) {
|
|
177
|
-
try {
|
|
178
|
-
throw new Error(error ? error : `Request Rejected with an Unknown Error`);
|
|
179
|
-
} catch (e) {
|
|
180
|
-
if (error && typeof error === 'object') {
|
|
181
|
-
Object.assign(e, error);
|
|
182
|
-
e.message = error.message || `Request Rejected with an Unknown Error`;
|
|
183
|
-
}
|
|
184
|
-
error = e;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
error[STRUCTURED] = true;
|
|
188
|
-
error.request = owner.request;
|
|
189
|
-
error.response = owner.getResponse();
|
|
190
|
-
error.error = error.error || error.message;
|
|
191
|
-
outbound.reject(error);
|
|
192
|
-
});
|
|
193
|
-
return outbound.promise;
|
|
194
|
-
}
|
|
195
|
-
function isDoc(doc) {
|
|
196
|
-
return doc && doc[STRUCTURED] === true;
|
|
197
|
-
}
|
|
198
|
-
function ensureDoc(owner, content, isError) {
|
|
199
|
-
if (isDoc(content)) {
|
|
200
|
-
return content;
|
|
201
|
-
}
|
|
202
|
-
if (isError) {
|
|
203
|
-
return {
|
|
204
|
-
[STRUCTURED]: true,
|
|
205
|
-
request: owner.request,
|
|
206
|
-
response: owner.getResponse(),
|
|
207
|
-
error: content
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
return {
|
|
211
|
-
[STRUCTURED]: true,
|
|
212
|
-
request: owner.request,
|
|
213
|
-
response: owner.getResponse(),
|
|
214
|
-
content: content
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Additional properties exposed on errors thrown by the
|
|
220
|
-
* {@link Fetch | Fetch Handler}.
|
|
221
|
-
*
|
|
222
|
-
* In the case of an Abort or system/browser level issue,
|
|
223
|
-
* this extends {@link DOMException}.
|
|
224
|
-
*
|
|
225
|
-
* Else it extends from {@link AggregateError} if the
|
|
226
|
-
* response includes an array of errors, falling back
|
|
227
|
-
* to {@link Error} as its base.
|
|
228
|
-
*/
|
|
229
|
-
|
|
230
|
-
function enhanceReason(reason) {
|
|
231
|
-
return new DOMException(reason || 'The user aborted a request.', 'AbortError');
|
|
232
|
-
}
|
|
233
|
-
function handleOutcome(owner, inbound, outbound) {
|
|
234
|
-
inbound.then(content => {
|
|
235
|
-
if (owner.controller.signal.aborted) {
|
|
236
|
-
// the next function did not respect the signal, we handle it here
|
|
237
|
-
outbound.reject(enhanceReason(owner.controller.signal.reason));
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
if (isDoc(content)) {
|
|
241
|
-
owner.setStream(owner.god.stream);
|
|
242
|
-
content = content.content;
|
|
243
|
-
}
|
|
244
|
-
const document = {
|
|
245
|
-
[STRUCTURED]: true,
|
|
246
|
-
request: owner.request,
|
|
247
|
-
response: owner.getResponse(),
|
|
248
|
-
content
|
|
249
|
-
};
|
|
250
|
-
outbound.resolve(document);
|
|
251
|
-
}, error => {
|
|
252
|
-
if (isDoc(error)) {
|
|
253
|
-
owner.setStream(owner.god.stream);
|
|
254
|
-
}
|
|
255
|
-
if (!error || !(error instanceof Error)) {
|
|
256
|
-
try {
|
|
257
|
-
throw new Error(error ? error : `Request Rejected with an Unknown Error`);
|
|
258
|
-
} catch (e) {
|
|
259
|
-
if (error && typeof error === 'object') {
|
|
260
|
-
Object.assign(e, error);
|
|
261
|
-
e.message = error.message || `Request Rejected with an Unknown Error`;
|
|
262
|
-
}
|
|
263
|
-
error = e;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
error[STRUCTURED] = true;
|
|
267
|
-
error.request = owner.request;
|
|
268
|
-
error.response = owner.getResponse();
|
|
269
|
-
error.error = error.error || error.message;
|
|
270
|
-
outbound.reject(error);
|
|
271
|
-
});
|
|
272
|
-
return outbound.promise;
|
|
273
|
-
}
|
|
274
|
-
function isCacheHandler(handler, index) {
|
|
275
|
-
return index === 0 && Boolean(handler[IS_CACHE_HANDLER]);
|
|
276
|
-
}
|
|
277
|
-
function executeNextHandler(wares, request, i, god) {
|
|
278
|
-
const owner = new ContextOwner(request, god, i === 0);
|
|
279
|
-
function next(r) {
|
|
280
|
-
owner.nextCalled++;
|
|
281
|
-
return executeNextHandler(wares, r, i + 1, god);
|
|
282
|
-
}
|
|
283
|
-
const _isCacheHandler = isCacheHandler(wares[i], i);
|
|
284
|
-
const context = new Context(owner, _isCacheHandler);
|
|
285
|
-
let outcome;
|
|
286
|
-
try {
|
|
287
|
-
outcome = wares[i].request(context, next);
|
|
288
|
-
if (_isCacheHandler) {
|
|
289
|
-
context._finalize();
|
|
290
|
-
}
|
|
291
|
-
if (!!outcome && _isCacheHandler) {
|
|
292
|
-
if (!(outcome instanceof Promise)) {
|
|
293
|
-
setRequestResult(owner.requestId, {
|
|
294
|
-
isError: false,
|
|
295
|
-
result: ensureDoc(owner, outcome, false)
|
|
296
|
-
});
|
|
297
|
-
outcome = Promise.resolve(outcome);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
} catch (e) {
|
|
301
|
-
if (_isCacheHandler) {
|
|
302
|
-
setRequestResult(owner.requestId, {
|
|
303
|
-
isError: true,
|
|
304
|
-
result: ensureDoc(owner, e, true)
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
308
|
-
outcome = Promise.reject(e);
|
|
309
|
-
}
|
|
310
|
-
const future = createFuture(owner);
|
|
311
|
-
if (isFuture(outcome)) {
|
|
312
|
-
return curryFuture(owner, outcome, future);
|
|
313
|
-
}
|
|
314
|
-
return handleOutcome(owner, outcome, future);
|
|
315
|
-
}
|
|
316
|
-
function isFuture(maybe) {
|
|
317
|
-
return Boolean(maybe && maybe instanceof Promise && maybe[IS_FUTURE] === true);
|
|
318
|
-
}
|
|
319
|
-
function createDeferred() {
|
|
320
|
-
let resolve;
|
|
321
|
-
let reject;
|
|
322
|
-
const promise = new Promise((res, rej) => {
|
|
323
|
-
resolve = res;
|
|
324
|
-
reject = rej;
|
|
325
|
-
});
|
|
326
|
-
return {
|
|
327
|
-
resolve,
|
|
328
|
-
reject,
|
|
329
|
-
promise
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
function upgradePromise(promise, future) {
|
|
333
|
-
promise[IS_FUTURE] = true;
|
|
334
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
335
|
-
promise.getStream = future.getStream;
|
|
336
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
337
|
-
promise.abort = future.abort;
|
|
338
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
339
|
-
promise.onFinalize = future.onFinalize;
|
|
340
|
-
promise.id = future.id;
|
|
341
|
-
promise.lid = future.lid;
|
|
342
|
-
promise.requester = future.requester;
|
|
343
|
-
return promise;
|
|
344
|
-
}
|
|
345
|
-
function createFuture(owner) {
|
|
346
|
-
const deferred = createDeferred();
|
|
347
|
-
let {
|
|
348
|
-
promise
|
|
349
|
-
} = deferred;
|
|
350
|
-
let cbs;
|
|
351
|
-
promise = promise.finally(() => {
|
|
352
|
-
owner.resolveStream();
|
|
353
|
-
if (cbs) {
|
|
354
|
-
cbs.forEach(cb => cb());
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
promise.onFinalize = fn => {
|
|
358
|
-
cbs = cbs || [];
|
|
359
|
-
cbs.push(fn);
|
|
360
|
-
};
|
|
361
|
-
promise[IS_FUTURE] = true;
|
|
362
|
-
promise.getStream = () => {
|
|
363
|
-
return owner.getStream();
|
|
364
|
-
};
|
|
365
|
-
promise.abort = reason => {
|
|
366
|
-
owner.abort(enhanceReason(reason));
|
|
367
|
-
};
|
|
368
|
-
promise.id = owner.requestId;
|
|
369
|
-
promise.lid = owner.god.identifier;
|
|
370
|
-
promise.requester = owner.god.requester;
|
|
371
|
-
deferred.promise = promise;
|
|
372
|
-
return deferred;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Brands the supplied object with the supplied response type.
|
|
377
|
-
*
|
|
378
|
-
* ```ts
|
|
379
|
-
* import type { ReactiveDataDocument } from '@warp-drive/core/reactive';
|
|
380
|
-
* import { withResponseType } from '@warp-drive/core/request';
|
|
381
|
-
* import type { User } from '#/data/user.ts'
|
|
382
|
-
*
|
|
383
|
-
* const result = await store.request(
|
|
384
|
-
* withResponseType<ReactiveDataDocument<User>>({ url: '/users/1' })
|
|
385
|
-
* );
|
|
386
|
-
*
|
|
387
|
-
* result.content.data; // will have type User
|
|
388
|
-
* ```
|
|
389
|
-
*
|
|
390
|
-
*/
|
|
391
|
-
function withResponseType(obj) {
|
|
392
|
-
return obj;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Brands the supplied object with the supplied response type
|
|
397
|
-
* wrapped in {@link ReactiveDataDocument}. This is a convenience for
|
|
398
|
-
* the common case of using {@link withResponseType} with `ReactiveDataDocument`.
|
|
399
|
-
*
|
|
400
|
-
* ```ts
|
|
401
|
-
* import { withReactiveResponse } from '@warp-drive/core/request';
|
|
402
|
-
* import type { User } from '#/data/user.ts'
|
|
403
|
-
*
|
|
404
|
-
* const result = await store.request(
|
|
405
|
-
* withReactiveResponse<User>({ url: '/users/1' })
|
|
406
|
-
* );
|
|
407
|
-
*
|
|
408
|
-
* result.content.data; // will have type User
|
|
409
|
-
* ```
|
|
410
|
-
*
|
|
411
|
-
* @public
|
|
412
|
-
*/
|
|
413
|
-
function withReactiveResponse(obj) {
|
|
414
|
-
return obj;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* @deprecated use {@link withResponseType} instead
|
|
419
|
-
*/
|
|
420
|
-
const withBrand = withResponseType;
|
|
421
|
-
export { IS_CACHE_HANDLER as I, withResponseType as a, withReactiveResponse as b, cloneResponseProperties as c, createDeferred as d, executeNextHandler as e, upgradePromise as u, withBrand as w };
|