@dxos/echo 0.8.4-staging.ac66bdf99f → 0.9.0
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/LICENSE +102 -5
- package/README.md +7 -7
- package/dist/lib/neutral/Annotation.mjs +37 -6
- package/dist/lib/neutral/Database.mjs +6 -17
- package/dist/lib/neutral/Entity.mjs +31 -20
- package/dist/lib/neutral/Err.mjs +3 -3
- package/dist/lib/neutral/Feed.mjs +23 -19
- package/dist/lib/neutral/Filter.mjs +13 -15
- package/dist/lib/neutral/Format.mjs +23 -3
- package/dist/lib/neutral/JsonSchema.mjs +7 -8
- package/dist/lib/neutral/Key.mjs +9 -5
- package/dist/lib/neutral/Migration.mjs +11 -10
- package/dist/lib/neutral/Obj.mjs +29 -20
- package/dist/lib/neutral/Order.mjs +7 -3
- package/dist/lib/neutral/Query.mjs +17 -17
- package/dist/lib/neutral/QueryResult.mjs +1 -1
- package/dist/lib/neutral/Ref.mjs +10 -9
- package/dist/lib/neutral/Registry.mjs +14 -0
- package/dist/lib/neutral/Relation.mjs +28 -25
- package/dist/lib/neutral/Scope.mjs +12 -0
- package/dist/lib/neutral/Tag.mjs +17 -14
- package/dist/lib/neutral/Type.mjs +54 -26
- package/dist/lib/neutral/{chunk-OMUPQMLR.mjs → chunk-35INCYOE.mjs} +1 -1
- package/dist/lib/neutral/chunk-35INCYOE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-3PBP4V4O.mjs +101 -0
- package/dist/lib/neutral/chunk-3PBP4V4O.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4ZUHOTCG.mjs +184 -0
- package/dist/lib/neutral/chunk-4ZUHOTCG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5SMDBFVB.mjs +108 -0
- package/dist/lib/neutral/chunk-5SMDBFVB.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-OS35K56T.mjs → chunk-5SUJPHAE.mjs} +3 -3
- package/dist/lib/neutral/{chunk-OS35K56T.mjs.map → chunk-5SUJPHAE.mjs.map} +2 -2
- package/dist/lib/neutral/{chunk-GZQTCRJB.mjs → chunk-6M2Z6WBH.mjs} +22 -2
- package/dist/lib/neutral/chunk-6M2Z6WBH.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-V36VO5SS.mjs → chunk-6YDI3J37.mjs} +32 -40
- package/dist/lib/neutral/chunk-6YDI3J37.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-MOR5ERFM.mjs → chunk-7FPIAJIV.mjs} +701 -1256
- package/dist/lib/neutral/chunk-7FPIAJIV.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ANHVGJI4.mjs → chunk-7LOUAPYZ.mjs} +9 -5
- package/dist/lib/neutral/chunk-7LOUAPYZ.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-JUXPFOEI.mjs → chunk-7PI7C4EF.mjs} +48 -88
- package/dist/lib/neutral/chunk-7PI7C4EF.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-UBEZSGXY.mjs → chunk-BBFJWWAV.mjs} +6 -6
- package/dist/lib/neutral/chunk-BBFJWWAV.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-UI6MWK5W.mjs → chunk-EVK6XBXO.mjs} +16 -2
- package/dist/lib/neutral/chunk-EVK6XBXO.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-7RO7CPBZ.mjs → chunk-IGK6FN65.mjs} +2 -2
- package/dist/lib/neutral/{chunk-HBUZJNZO.mjs → chunk-LWXVKPPW.mjs} +94 -99
- package/dist/lib/neutral/chunk-LWXVKPPW.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-BVOFLCVF.mjs → chunk-MZ7K3MLL.mjs} +9 -6
- package/dist/lib/neutral/chunk-MZ7K3MLL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-TBKX6JQO.mjs → chunk-O6BH7EPN.mjs} +30 -3
- package/dist/lib/neutral/chunk-O6BH7EPN.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-EAMSSLZC.mjs → chunk-QQIYS74I.mjs} +83 -46
- package/dist/lib/neutral/chunk-QQIYS74I.mjs.map +7 -0
- package/dist/lib/neutral/chunk-R5W6DXR4.mjs +678 -0
- package/dist/lib/neutral/chunk-R5W6DXR4.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-WAK4DMFV.mjs → chunk-RIVWNMSF.mjs} +12 -7
- package/dist/lib/neutral/chunk-RIVWNMSF.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-T6W2LEZU.mjs → chunk-SBVFRTST.mjs} +73 -38
- package/dist/lib/neutral/chunk-SBVFRTST.mjs.map +7 -0
- package/dist/lib/neutral/chunk-T6E37YIP.mjs +251 -0
- package/dist/lib/neutral/chunk-T6E37YIP.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-DQYLD2RB.mjs → chunk-TFEWTY5A.mjs} +155 -129
- package/dist/lib/neutral/chunk-TFEWTY5A.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-B4BASU6W.mjs → chunk-TYGKCRMK.mjs} +85 -76
- package/dist/lib/neutral/chunk-TYGKCRMK.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-4OIBYSXE.mjs → chunk-UUP46KUQ.mjs} +78 -32
- package/dist/lib/neutral/chunk-UUP46KUQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WISOH2XH.mjs +36 -0
- package/dist/lib/neutral/chunk-WISOH2XH.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-G3IQMKF7.mjs → chunk-WTQJHC75.mjs} +111 -112
- package/dist/lib/neutral/chunk-WTQJHC75.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WU3GIANS.mjs +31 -0
- package/dist/lib/neutral/chunk-WU3GIANS.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-TU3GW67D.mjs → chunk-ZGNNFYHS.mjs} +40 -40
- package/dist/lib/neutral/chunk-ZGNNFYHS.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +47 -41
- package/dist/lib/neutral/internal/index.mjs +137 -72
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/testing/index.mjs +261 -178
- package/dist/lib/neutral/testing/index.mjs.map +4 -4
- package/dist/types/src/Annotation.d.ts +108 -4
- package/dist/types/src/Annotation.d.ts.map +1 -1
- package/dist/types/src/Annotation.test.d.ts +2 -0
- package/dist/types/src/Annotation.test.d.ts.map +1 -0
- package/dist/types/src/Collection.d.ts +2 -3
- package/dist/types/src/Collection.d.ts.map +1 -1
- package/dist/types/src/Database.d.ts +56 -49
- package/dist/types/src/Database.d.ts.map +1 -1
- package/dist/types/src/Dataset.d.ts +16 -6
- package/dist/types/src/Dataset.d.ts.map +1 -1
- package/dist/types/src/Entity.d.ts +101 -28
- package/dist/types/src/Entity.d.ts.map +1 -1
- package/dist/types/src/Err.d.ts +27 -27
- package/dist/types/src/Err.d.ts.map +1 -1
- package/dist/types/src/Feed.d.ts +66 -19
- package/dist/types/src/Feed.d.ts.map +1 -1
- package/dist/types/src/Filter.d.ts +38 -12
- package/dist/types/src/Filter.d.ts.map +1 -1
- package/dist/types/src/Format.d.ts +0 -2
- package/dist/types/src/Format.d.ts.map +1 -1
- package/dist/types/src/Hypergraph.d.ts +14 -9
- package/dist/types/src/Hypergraph.d.ts.map +1 -1
- package/dist/types/src/Json.d.ts +33 -0
- package/dist/types/src/Json.d.ts.map +1 -0
- package/dist/types/src/Json.test.d.ts +2 -0
- package/dist/types/src/Json.test.d.ts.map +1 -0
- package/dist/types/src/JsonSchema.d.ts +2 -2
- package/dist/types/src/JsonSchema.d.ts.map +1 -1
- package/dist/types/src/Key.d.ts +1 -1
- package/dist/types/src/Key.d.ts.map +1 -1
- package/dist/types/src/Migration.d.ts +26 -11
- package/dist/types/src/Migration.d.ts.map +1 -1
- package/dist/types/src/Obj.d.ts +104 -61
- package/dist/types/src/Obj.d.ts.map +1 -1
- package/dist/types/src/Order.d.ts +10 -0
- package/dist/types/src/Order.d.ts.map +1 -1
- package/dist/types/src/Query.d.ts +34 -12
- package/dist/types/src/Query.d.ts.map +1 -1
- package/dist/types/src/QueryResult.d.ts +21 -0
- package/dist/types/src/QueryResult.d.ts.map +1 -1
- package/dist/types/src/Ref.d.ts +15 -7
- package/dist/types/src/Ref.d.ts.map +1 -1
- package/dist/types/src/Registry.d.ts +131 -0
- package/dist/types/src/Registry.d.ts.map +1 -0
- package/dist/types/src/Relation.d.ts +73 -41
- package/dist/types/src/Relation.d.ts.map +1 -1
- package/dist/types/src/Scope.d.ts +35 -0
- package/dist/types/src/Scope.d.ts.map +1 -0
- package/dist/types/src/Tag.d.ts +21 -5
- package/dist/types/src/Tag.d.ts.map +1 -1
- package/dist/types/src/Type.d.ts +362 -95
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/View.d.ts +9 -12
- package/dist/types/src/View.d.ts.map +1 -1
- package/dist/types/src/exemplars.test.d.ts +2 -0
- package/dist/types/src/exemplars.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/annotations.d.ts +79 -38
- package/dist/types/src/internal/Annotation/annotations.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/dictionary.d.ts +24 -0
- package/dist/types/src/internal/Annotation/dictionary.d.ts.map +1 -0
- package/dist/types/src/internal/Annotation/entity-dictionary.d.ts +14 -0
- package/dist/types/src/internal/Annotation/entity-dictionary.d.ts.map +1 -0
- package/dist/types/src/internal/Annotation/index.d.ts +4 -2
- package/dist/types/src/internal/Annotation/index.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/sorting.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/util.d.ts +14 -5
- package/dist/types/src/internal/Annotation/util.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/api.d.ts +17 -3
- package/dist/types/src/internal/Entity/api.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/entity.d.ts +72 -8
- package/dist/types/src/internal/Entity/entity.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/guard.d.ts +10 -0
- package/dist/types/src/internal/Entity/guard.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/index.d.ts +2 -0
- package/dist/types/src/internal/Entity/index.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/model.d.ts +21 -17
- package/dist/types/src/internal/Entity/model.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/object.d.ts +3 -3
- package/dist/types/src/internal/Entity/object.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/relation.d.ts +30 -7
- package/dist/types/src/internal/Entity/relation.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/type-kind.d.ts +24 -0
- package/dist/types/src/internal/Entity/type-kind.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/type-uri.d.ts +24 -0
- package/dist/types/src/internal/Entity/type-uri.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/version.d.ts.map +1 -1
- package/dist/types/src/internal/Format/date.d.ts.map +1 -1
- package/dist/types/src/internal/Format/format.d.ts +3 -2
- package/dist/types/src/internal/Format/format.d.ts.map +1 -1
- package/dist/types/src/internal/Format/index.d.ts +2 -2
- package/dist/types/src/internal/Format/index.d.ts.map +1 -1
- package/dist/types/src/internal/Format/number.d.ts.map +1 -1
- package/dist/types/src/internal/Format/object.d.ts +3 -1
- package/dist/types/src/internal/Format/object.d.ts.map +1 -1
- package/dist/types/src/internal/Format/types.d.ts.map +1 -1
- package/dist/types/src/internal/JsonSchema/json-schema-normalize.d.ts.map +1 -1
- package/dist/types/src/internal/JsonSchema/json-schema-type.d.ts +34 -34
- package/dist/types/src/internal/JsonSchema/json-schema-type.d.ts.map +1 -1
- package/dist/types/src/internal/JsonSchema/json-schema.d.ts +3 -2
- package/dist/types/src/internal/JsonSchema/json-schema.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/atoms.d.ts +38 -0
- package/dist/types/src/internal/Obj/atoms.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/clone.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/common.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/create-object.d.ts +12 -12
- package/dist/types/src/internal/Obj/create-object.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/deleted.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/index.d.ts +1 -1
- package/dist/types/src/internal/Obj/index.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/json-serializer.d.ts +8 -8
- package/dist/types/src/internal/Obj/json-serializer.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/set-value.d.ts +1 -1
- package/dist/types/src/internal/Obj/set-value.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/snapshot.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/typed-object.d.ts +1 -1
- package/dist/types/src/internal/Query/index.d.ts +2 -0
- package/dist/types/src/internal/Query/index.d.ts.map +1 -0
- package/dist/types/src/internal/{Query.d.ts → Query/pretty.d.ts} +1 -1
- package/dist/types/src/internal/Query/pretty.d.ts.map +1 -0
- package/dist/types/src/internal/Ref/atoms.d.ts +10 -0
- package/dist/types/src/internal/Ref/atoms.d.ts.map +1 -0
- package/dist/types/src/internal/Ref/ref-array.d.ts +2 -2
- package/dist/types/src/internal/Ref/ref.d.ts +50 -19
- package/dist/types/src/internal/Ref/ref.d.ts.map +1 -1
- package/dist/types/src/internal/Ref/utils.d.ts +8 -0
- package/dist/types/src/internal/Ref/utils.d.ts.map +1 -0
- package/dist/types/src/internal/Type/compose.d.ts.map +1 -1
- package/dist/types/src/internal/Type/index.d.ts +1 -2
- package/dist/types/src/internal/Type/index.d.ts.map +1 -1
- package/dist/types/src/internal/Type/manipulation.d.ts +0 -1
- package/dist/types/src/internal/Type/manipulation.d.ts.map +1 -1
- package/dist/types/src/internal/Type/type-schema.d.ts +52 -0
- package/dist/types/src/internal/Type/type-schema.d.ts.map +1 -0
- package/dist/types/src/internal/common/api/meta.d.ts +14 -11
- package/dist/types/src/internal/common/api/meta.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/change-context.d.ts +1 -1
- package/dist/types/src/internal/common/proxy/change-context.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/define-hidden-property.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/errors.d.ts +1 -1
- package/dist/types/src/internal/common/proxy/errors.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/event-batch.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/json-serializer.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/make-object.d.ts +11 -5
- package/dist/types/src/internal/common/proxy/make-object.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/ownership.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/proxy-utils.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/reactive-array.d.ts +1 -1
- package/dist/types/src/internal/common/proxy/reactive.d.ts +1 -1
- package/dist/types/src/internal/common/proxy/reactive.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/reactive.test.d.ts +2 -0
- package/dist/types/src/internal/common/proxy/reactive.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/schema-validator.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts +18 -2
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/base.d.ts +4 -4
- package/dist/types/src/internal/common/types/base.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/entity.d.ts +62 -5
- package/dist/types/src/internal/common/types/entity.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/index.d.ts +1 -1
- package/dist/types/src/internal/common/types/index.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/meta.d.ts +33 -12
- package/dist/types/src/internal/common/types/meta.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/model-symbols.d.ts +15 -4
- package/dist/types/src/internal/common/types/model-symbols.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/typename.d.ts +7 -0
- package/dist/types/src/internal/common/types/typename.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/version.d.ts +1 -1
- package/dist/types/src/internal/common/types/well-known-types.d.ts +11 -0
- package/dist/types/src/internal/common/types/well-known-types.d.ts.map +1 -0
- package/dist/types/src/internal/index.d.ts +2 -2
- package/dist/types/src/internal/index.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/registry.d.ts +9 -0
- package/dist/types/src/testing/registry.d.ts.map +1 -0
- package/dist/types/src/testing/test-data.d.ts +8 -8
- package/dist/types/src/testing/test-data.d.ts.map +1 -1
- package/dist/types/src/testing/test-schema.d.ts +83 -89
- package/dist/types/src/testing/test-schema.d.ts.map +1 -1
- package/dist/types/src/testing/util.d.ts +5 -3
- package/dist/types/src/testing/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -24
- package/src/Annotation.test.ts +439 -0
- package/src/Annotation.ts +158 -4
- package/src/Collection.ts +5 -9
- package/src/Database.ts +93 -100
- package/src/Dataset.ts +10 -2
- package/src/Entity.test.ts +116 -6
- package/src/Entity.ts +134 -32
- package/src/Err.ts +4 -4
- package/src/Feed.ts +92 -44
- package/src/Filter.ts +70 -40
- package/src/Format.ts +0 -4
- package/src/Hypergraph.ts +14 -9
- package/src/Json.test.ts +175 -0
- package/src/Json.ts +103 -0
- package/src/Key.ts +1 -1
- package/src/Migration.ts +39 -19
- package/src/Obj.test.ts +122 -20
- package/src/Obj.ts +168 -91
- package/src/Order.ts +22 -0
- package/src/Query.test.ts +183 -154
- package/src/Query.ts +172 -85
- package/src/QueryResult.ts +26 -0
- package/src/Ref.ts +22 -4
- package/src/Registry.ts +155 -0
- package/src/Relation.test.ts +10 -10
- package/src/Relation.ts +116 -69
- package/src/Scope.ts +50 -0
- package/src/Tag.md +88 -0
- package/src/Tag.ts +49 -6
- package/src/Type.test.ts +223 -18
- package/src/Type.ts +609 -131
- package/src/View.ts +14 -23
- package/src/exemplars.test.ts +21 -0
- package/src/index.ts +4 -4
- package/src/internal/Annotation/annotations.test.ts +31 -11
- package/src/internal/Annotation/annotations.ts +143 -111
- package/src/internal/Annotation/dictionary.ts +47 -0
- package/src/internal/Annotation/entity-dictionary.ts +74 -0
- package/src/internal/Annotation/index.ts +4 -2
- package/src/internal/Annotation/util.ts +17 -8
- package/src/internal/Entity/api.ts +54 -7
- package/src/internal/Entity/entity.ts +196 -47
- package/src/internal/Entity/guard.ts +26 -0
- package/src/internal/Entity/index.ts +2 -0
- package/src/internal/Entity/model.ts +38 -28
- package/src/internal/Entity/object.ts +21 -5
- package/src/internal/Entity/relation.ts +68 -34
- package/src/internal/Entity/type-kind.ts +75 -0
- package/src/internal/Entity/type-uri.ts +92 -0
- package/src/internal/Entity/util.ts +9 -9
- package/src/internal/Format/date.ts +0 -4
- package/src/internal/Format/format.test.ts +21 -0
- package/src/internal/Format/index.ts +2 -3
- package/src/internal/Format/object.ts +21 -4
- package/src/internal/Format/types.ts +1 -1
- package/src/internal/JsonSchema/annotations.ts +1 -1
- package/src/internal/JsonSchema/json-schema-type.ts +4 -4
- package/src/internal/JsonSchema/json-schema.test.ts +71 -145
- package/src/internal/JsonSchema/json-schema.ts +49 -35
- package/src/internal/Obj/atoms.ts +244 -0
- package/src/internal/Obj/clone.ts +9 -4
- package/src/internal/Obj/create-object.test.ts +12 -10
- package/src/internal/Obj/create-object.ts +68 -22
- package/src/internal/Obj/index.ts +1 -1
- package/src/internal/Obj/inspect.ts +5 -3
- package/src/internal/Obj/json-serializer.test.ts +101 -22
- package/src/internal/Obj/json-serializer.ts +89 -33
- package/src/internal/Obj/set-value.test.ts +22 -45
- package/src/internal/Obj/set-value.ts +12 -19
- package/src/internal/Obj/snapshot.ts +13 -4
- package/src/internal/Obj/typed-object.test.ts +9 -11
- package/src/internal/Obj/typed-object.ts +1 -1
- package/src/internal/Query/index.ts +5 -0
- package/src/internal/{Query.ts → Query/pretty.ts} +40 -12
- package/src/internal/Ref/atoms.ts +20 -0
- package/src/internal/Ref/ref-array.ts +3 -3
- package/src/internal/Ref/ref.test.ts +18 -27
- package/src/internal/Ref/ref.ts +137 -59
- package/src/internal/Ref/utils.ts +45 -0
- package/src/internal/Type/compose.test.ts +3 -1
- package/src/internal/Type/index.ts +1 -2
- package/src/internal/Type/manipulation.ts +0 -25
- package/src/internal/Type/type-schema.ts +60 -0
- package/src/internal/common/README.md +2 -2
- package/src/internal/common/api/meta.ts +19 -17
- package/src/internal/common/proxy/change-context.ts +1 -1
- package/src/internal/common/proxy/change.test.ts +91 -83
- package/src/internal/common/proxy/errors.ts +2 -2
- package/src/internal/common/proxy/handler.test.ts +1 -1
- package/src/internal/common/proxy/json-serializer.ts +27 -16
- package/src/internal/common/proxy/make-object.ts +44 -20
- package/src/internal/common/proxy/ownership.ts +2 -2
- package/src/internal/common/proxy/reactive-array.ts +1 -1
- package/src/internal/common/proxy/reactive.test.ts +54 -0
- package/src/internal/common/proxy/reactive.ts +11 -2
- package/src/internal/common/proxy/schema.test.ts +48 -86
- package/src/internal/common/proxy/typed-handler.test.ts +12 -11
- package/src/internal/common/proxy/typed-handler.ts +78 -16
- package/src/internal/common/proxy/typed-object.test.ts +16 -28
- package/src/internal/common/types/base.ts +4 -4
- package/src/internal/common/types/entity.ts +80 -1
- package/src/internal/common/types/index.ts +6 -1
- package/src/internal/common/types/meta.ts +62 -20
- package/src/internal/common/types/model-symbols.ts +24 -4
- package/src/internal/common/types/typename.ts +39 -3
- package/src/internal/common/types/well-known-types.ts +15 -0
- package/src/internal/index.ts +6 -4
- package/src/testing/api.test.ts +15 -9
- package/src/testing/index.ts +1 -0
- package/src/testing/registry.ts +44 -0
- package/src/testing/test-data.ts +159 -99
- package/src/testing/test-schema.ts +22 -58
- package/src/testing/util.ts +14 -11
- package/dist/lib/neutral/Extension.mjs +0 -18
- package/dist/lib/neutral/SchemaRegistry.mjs +0 -2
- package/dist/lib/neutral/chunk-2KHZ36F5.mjs +0 -361
- package/dist/lib/neutral/chunk-2KHZ36F5.mjs.map +0 -7
- package/dist/lib/neutral/chunk-4OIBYSXE.mjs.map +0 -7
- package/dist/lib/neutral/chunk-4P3IXBLT.mjs +0 -45
- package/dist/lib/neutral/chunk-4P3IXBLT.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ANHVGJI4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-B4BASU6W.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BNCCGLJN.mjs +0 -7
- package/dist/lib/neutral/chunk-BNCCGLJN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BVOFLCVF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-DQYLD2RB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-EAMSSLZC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-G3IQMKF7.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GZQTCRJB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-HBUZJNZO.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JUXPFOEI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MOR5ERFM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-OMUPQMLR.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PHU22NLC.mjs +0 -136
- package/dist/lib/neutral/chunk-PHU22NLC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ROG4RXXL.mjs +0 -97
- package/dist/lib/neutral/chunk-ROG4RXXL.mjs.map +0 -7
- package/dist/lib/neutral/chunk-T6W2LEZU.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TBKX6JQO.mjs.map +0 -7
- package/dist/lib/neutral/chunk-TU3GW67D.mjs.map +0 -7
- package/dist/lib/neutral/chunk-UBEZSGXY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-UI6MWK5W.mjs.map +0 -7
- package/dist/lib/neutral/chunk-V36VO5SS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-WAK4DMFV.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YAHXAYOW.mjs +0 -56
- package/dist/lib/neutral/chunk-YAHXAYOW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YS6Q3XAD.mjs +0 -50
- package/dist/lib/neutral/chunk-YS6Q3XAD.mjs.map +0 -7
- package/dist/types/src/Extension.d.ts +0 -80
- package/dist/types/src/Extension.d.ts.map +0 -1
- package/dist/types/src/Extension.test.d.ts +0 -2
- package/dist/types/src/Extension.test.d.ts.map +0 -1
- package/dist/types/src/SchemaRegistry.d.ts +0 -84
- package/dist/types/src/SchemaRegistry.d.ts.map +0 -1
- package/dist/types/src/internal/Obj/ids.d.ts +0 -6
- package/dist/types/src/internal/Obj/ids.d.ts.map +0 -1
- package/dist/types/src/internal/Query.d.ts.map +0 -1
- package/dist/types/src/internal/Type/echo-schema.d.ts +0 -181
- package/dist/types/src/internal/Type/echo-schema.d.ts.map +0 -1
- package/dist/types/src/internal/Type/persistent-schema.d.ts +0 -20
- package/dist/types/src/internal/Type/persistent-schema.d.ts.map +0 -1
- package/src/Extension.test.ts +0 -235
- package/src/Extension.ts +0 -122
- package/src/SchemaRegistry.ts +0 -106
- package/src/internal/Obj/ids.ts +0 -12
- package/src/internal/Type/echo-schema.ts +0 -423
- package/src/internal/Type/persistent-schema.ts +0 -33
- /package/dist/lib/neutral/{Extension.mjs.map → Registry.mjs.map} +0 -0
- /package/dist/lib/neutral/{SchemaRegistry.mjs.map → Scope.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-7RO7CPBZ.mjs.map → chunk-IGK6FN65.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../src/View.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAC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G,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D;;;GAGG;AACH,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;wBAkBf,CAAC;AAOF,MAAM,WAAW,IAAK,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,UAAU,CAAC;CAAG;AAErE,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAqB,CAAC;AAEtD,eAAO,MAAM,IAAI,UAAW,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC,KAAG,IAMjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exemplars.test.d.ts","sourceRoot":"","sources":["../../../src/exemplars.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { QueryAST } from '@dxos/echo-protocol';
|
|
2
|
-
export { DXN } from '@dxos/keys';
|
|
2
|
+
export { DXN, EID, URI } from '@dxos/keys';
|
|
3
3
|
export * as Annotation from './Annotation';
|
|
4
4
|
export * as Database from './Database';
|
|
5
5
|
export * as Entity from './Entity';
|
|
@@ -8,6 +8,7 @@ export * as Feed from './Feed';
|
|
|
8
8
|
export * as Filter from './Filter';
|
|
9
9
|
export * as Format from './Format';
|
|
10
10
|
export * as Hypergraph from './Hypergraph';
|
|
11
|
+
export * as Json from './Json';
|
|
11
12
|
export * as JsonSchema from './JsonSchema';
|
|
12
13
|
export * as Key from './Key';
|
|
13
14
|
export * as Migration from './Migration';
|
|
@@ -16,12 +17,12 @@ export * as Order from './Order';
|
|
|
16
17
|
export * as Query from './Query';
|
|
17
18
|
export * as QueryResult from './QueryResult';
|
|
18
19
|
export * as Ref from './Ref';
|
|
20
|
+
export * as Registry from './Registry';
|
|
19
21
|
export * as Relation from './Relation';
|
|
20
|
-
export * as
|
|
22
|
+
export * as Scope from './Scope';
|
|
21
23
|
export * as Tag from './Tag';
|
|
22
24
|
export * as Type from './Type';
|
|
23
25
|
export * as Collection from './Collection';
|
|
24
26
|
export * as View from './View';
|
|
25
27
|
export * as Dataset from './Dataset';
|
|
26
|
-
export * as Extension from './Extension';
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import * as Option from 'effect/Option';
|
|
1
2
|
import * as Schema from 'effect/Schema';
|
|
2
3
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
3
|
-
import { DXN } from '@dxos/keys';
|
|
4
|
+
import { DXN, URI } from '@dxos/keys';
|
|
4
5
|
import { type Primitive } from '@dxos/util';
|
|
6
|
+
import type * as Annotation from '../../Annotation';
|
|
5
7
|
import { type Mutable } from '../common/proxy';
|
|
6
8
|
import { type AnyProperties, EntityKind } from '../common/types';
|
|
7
|
-
import { type AnnotationHelper } from './util';
|
|
8
9
|
/**
|
|
9
10
|
* Sets the path for the field.
|
|
10
11
|
* @param path Data source path in the json path format. This is the field path in the source object.
|
|
@@ -12,22 +13,22 @@ import { type AnnotationHelper } from './util';
|
|
|
12
13
|
export declare const FieldPath: (path: string) => <A, I, R>(self: Schema.Schema<A, I, R>) => Schema.Schema<A, I, R>;
|
|
13
14
|
/**
|
|
14
15
|
* ECHO identifier (for a stored schema).
|
|
15
|
-
* Must be
|
|
16
|
+
* Must be an `echo:` URI.
|
|
16
17
|
*/
|
|
17
18
|
export declare const TypeIdentifierAnnotationId: unique symbol;
|
|
18
19
|
export declare const getTypeIdentifierAnnotation: (schema: Schema.Schema.All) => string | undefined;
|
|
19
20
|
/**
|
|
20
|
-
* @returns
|
|
21
|
+
* @returns The schema's type identifier URI — whichever URI fits.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
*
|
|
23
|
+
* - Stored (dynamic) schemas: the schema-as-object's EID, so loaded objects ride
|
|
24
|
+
* along with their schema as a strong dependency.
|
|
25
|
+
* - Non-stored (static) schemas: the typename DXN built from `TypeAnnotation`.
|
|
26
|
+
*
|
|
27
|
+
* This URI is what gets written to an object's `system.type`; queries that filter by
|
|
28
|
+
* type also use it (see `Filter.type` / `getTypeURIFromSpecifier`), so both sides
|
|
29
|
+
* stay symmetric without per-schema branching.
|
|
29
30
|
*/
|
|
30
|
-
export declare const
|
|
31
|
+
export declare const getSchemaURI: (schema: Schema.Schema.All) => URI.URI | undefined;
|
|
31
32
|
/**
|
|
32
33
|
* Fully qualified globally unique typename.
|
|
33
34
|
* Example: `org.dxos.type.message`
|
|
@@ -60,12 +61,12 @@ export declare const TypeAnnotation: Schema.extend<Schema.Struct<{
|
|
|
60
61
|
* If this is a relation, the schema of the source object.
|
|
61
62
|
* Must be present if entity kind is {@link EntityKind.Relation}.
|
|
62
63
|
*/
|
|
63
|
-
sourceSchema: Schema.optional<Schema.
|
|
64
|
+
sourceSchema: Schema.optional<Schema.Schema<DXN.DXN, DXN.DXN, never>>;
|
|
64
65
|
/**
|
|
65
66
|
* If this is a relation, the schema of the target object.
|
|
66
67
|
* Must be present if entity kind is {@link EntityKind.Relation}.
|
|
67
68
|
*/
|
|
68
|
-
targetSchema: Schema.optional<Schema.
|
|
69
|
+
targetSchema: Schema.optional<Schema.Schema<DXN.DXN, DXN.DXN, never>>;
|
|
69
70
|
}>>;
|
|
70
71
|
export interface TypeAnnotation extends Schema.Schema.Type<typeof TypeAnnotation> {
|
|
71
72
|
}
|
|
@@ -78,16 +79,6 @@ export declare const getTypeAnnotation: (schema: Schema.Schema.All) => TypeAnnot
|
|
|
78
79
|
* @returns {@link EntityKind} from a schema.
|
|
79
80
|
*/
|
|
80
81
|
export declare const getEntityKind: (schema: Schema.Schema.All) => EntityKind | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* Checks if the object is an instance of the schema.
|
|
83
|
-
* Only typename is compared, the schema version is ignored.
|
|
84
|
-
*
|
|
85
|
-
* The following cases are considered to mean that the object is an instance of the schema:
|
|
86
|
-
* - Object was created with this exact schema.
|
|
87
|
-
* - Object was created with a different version of this schema.
|
|
88
|
-
* - Object was created with a different schema (maybe dynamic) that has the same typename.
|
|
89
|
-
*/
|
|
90
|
-
export declare const isInstanceOf: <Schema extends Schema.Schema.AnyNoContext>(schema: Schema, object: any) => object is Schema.Schema.Type<Schema>;
|
|
91
82
|
/**
|
|
92
83
|
* PropertyMeta (metadata for dynamic schema properties).
|
|
93
84
|
* For user-defined annotations.
|
|
@@ -97,6 +88,12 @@ export type PropertyMetaValue = Primitive | Record<string, Primitive> | Primitiv
|
|
|
97
88
|
export type PropertyMetaAnnotation = {
|
|
98
89
|
[name: string]: PropertyMetaValue;
|
|
99
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Apply property-level metadata to an Effect schema. Only accepts
|
|
93
|
+
* `Schema.Schema.Any` — apply BEFORE wrapping the schema with
|
|
94
|
+
* `Type.makeObject` / `Type.makeRelation`. To read property meta off a
|
|
95
|
+
* `Type.Type` entity, unwrap it first with `Type.getSchema(entity)`.
|
|
96
|
+
*/
|
|
100
97
|
export declare const PropertyMeta: (name: string, value: PropertyMetaValue) => <A, I, R>(self: Schema.Schema<A, I, R>) => Schema.Schema<A, I, R>;
|
|
101
98
|
export declare const getPropertyMetaAnnotation: <T>(prop: SchemaAST.PropertySignature, name: string) => T | undefined;
|
|
102
99
|
/**
|
|
@@ -104,7 +101,7 @@ export declare const getPropertyMetaAnnotation: <T>(prop: SchemaAST.PropertySign
|
|
|
104
101
|
*/
|
|
105
102
|
export declare const ReferenceAnnotationId: unique symbol;
|
|
106
103
|
export type ReferenceAnnotationValue = TypeAnnotation;
|
|
107
|
-
export declare const ReferenceAnnotation: AnnotationHelper<TypeAnnotation>;
|
|
104
|
+
export declare const ReferenceAnnotation: import("./util").AnnotationHelper<TypeAnnotation>;
|
|
108
105
|
/**
|
|
109
106
|
* SchemaMeta.
|
|
110
107
|
*/
|
|
@@ -113,16 +110,16 @@ export type SchemaMeta = TypeMeta & {
|
|
|
113
110
|
id: string;
|
|
114
111
|
};
|
|
115
112
|
/**
|
|
116
|
-
* Identifies a schema as
|
|
113
|
+
* Identifies a schema as hidden from user-facing surfaces (like dotfiles — visible only via an advanced setting).
|
|
117
114
|
*/
|
|
118
|
-
export declare const
|
|
119
|
-
export declare const
|
|
115
|
+
export declare const HiddenAnnotationId: unique symbol;
|
|
116
|
+
export declare const HiddenAnnotation: import("./util").AnnotationHelper<boolean>;
|
|
120
117
|
/**
|
|
121
118
|
* Identifies label property or JSON path expression.
|
|
122
119
|
* Either a string or an array of strings representing field accessors each matched in priority order.
|
|
123
120
|
*/
|
|
124
121
|
export declare const LabelAnnotationId: unique symbol;
|
|
125
|
-
export declare const LabelAnnotation: AnnotationHelper<string[]>;
|
|
122
|
+
export declare const LabelAnnotation: import("./util").AnnotationHelper<string[]>;
|
|
126
123
|
/**
|
|
127
124
|
* Returns the label for a given object based on {@link LabelAnnotationId}.
|
|
128
125
|
* Lower-level version that requires explicit schema parameter.
|
|
@@ -139,7 +136,7 @@ export declare const setLabelWithSchema: <S extends Schema.Schema.Any>(schema: S
|
|
|
139
136
|
* A string representing field accessor.
|
|
140
137
|
*/
|
|
141
138
|
export declare const DescriptionAnnotationId: unique symbol;
|
|
142
|
-
export declare const DescriptionAnnotation: AnnotationHelper<string>;
|
|
139
|
+
export declare const DescriptionAnnotation: import("./util").AnnotationHelper<string>;
|
|
143
140
|
/**
|
|
144
141
|
* Returns the description for a given object based on {@link DescriptionAnnotationId}.
|
|
145
142
|
* Lower-level version that requires explicit schema parameter.
|
|
@@ -155,7 +152,13 @@ export declare const setDescriptionWithSchema: <S extends Schema.Schema.Any>(sch
|
|
|
155
152
|
* By default, all properties are included in forms, so this is opt-out.
|
|
156
153
|
*/
|
|
157
154
|
export declare const FormInputAnnotationId: unique symbol;
|
|
158
|
-
export declare const FormInputAnnotation: AnnotationHelper<boolean>;
|
|
155
|
+
export declare const FormInputAnnotation: import("./util").AnnotationHelper<boolean>;
|
|
156
|
+
/**
|
|
157
|
+
* When set on a `Ref` property, the form renders the referenced object's own
|
|
158
|
+
* fields inline (a nested form bound to the target) instead of a picker.
|
|
159
|
+
*/
|
|
160
|
+
export declare const FormInlineAnnotationId: unique symbol;
|
|
161
|
+
export declare const FormInlineAnnotation: import("./util").AnnotationHelper<boolean>;
|
|
159
162
|
/**
|
|
160
163
|
* Default field to be used on referenced schema to lookup the value.
|
|
161
164
|
*/
|
|
@@ -169,12 +172,12 @@ export type GeneratorAnnotationValue = string | {
|
|
|
169
172
|
args?: any[];
|
|
170
173
|
probability?: number;
|
|
171
174
|
};
|
|
172
|
-
export declare const GeneratorAnnotation: AnnotationHelper<GeneratorAnnotationValue>;
|
|
175
|
+
export declare const GeneratorAnnotation: import("./util").AnnotationHelper<GeneratorAnnotationValue>;
|
|
173
176
|
interface MakeAnnoationsProps<T> {
|
|
174
177
|
id: string;
|
|
175
178
|
schema: Schema.Schema<T, any, never>;
|
|
176
179
|
}
|
|
177
|
-
export declare const makeUserAnnotation: <T>(props: MakeAnnoationsProps<T>) =>
|
|
180
|
+
export declare const makeUserAnnotation: <T>(props: MakeAnnoationsProps<T>) => Annotation.Annotation<T>;
|
|
178
181
|
declare const IconAnnotationSchema: Schema.Struct<{
|
|
179
182
|
/**
|
|
180
183
|
* Phosphor icon name (e.g., 'ph--user--regular', 'ph--cube--regular', 'ph--link--regular ', etc.)
|
|
@@ -206,15 +209,39 @@ export interface IconAnnotation extends Schema.Schema.Type<typeof IconAnnotation
|
|
|
206
209
|
/**
|
|
207
210
|
* Icon to render in the UI.
|
|
208
211
|
*/
|
|
209
|
-
export declare const IconAnnotation:
|
|
212
|
+
export declare const IconAnnotation: Annotation.Annotation<IconAnnotation>;
|
|
213
|
+
/**
|
|
214
|
+
* Indicates that this entity's icon should be resolved from a property whose value is a `Ref`
|
|
215
|
+
* to another entity. Consumers (e.g. graph node builders) resolve the ref target and use that
|
|
216
|
+
* target's schema `IconAnnotation` in place of the static one declared on this schema.
|
|
217
|
+
*
|
|
218
|
+
* Useful for wrapper schemas that delegate their visual identity to a referenced sub-entity
|
|
219
|
+
* (e.g. a generic `Game` whose icon should come from its `variant` ref's typed state).
|
|
220
|
+
*/
|
|
221
|
+
export declare const IconFromRefAnnotation: Annotation.Annotation<string>;
|
|
222
|
+
/**
|
|
223
|
+
* Options for {@link getLabel}.
|
|
224
|
+
*/
|
|
225
|
+
export type GetLabelOptions = {
|
|
226
|
+
/**
|
|
227
|
+
* Strategy for deriving a label when the entity has no `LabelAnnotation` value.
|
|
228
|
+
* - `'typename'`: use the entity's typename (e.g. `org.dxos.type.table`).
|
|
229
|
+
* Useful for Card.Title chrome that must always display something, even
|
|
230
|
+
* for unlabeled objects.
|
|
231
|
+
*/
|
|
232
|
+
fallback?: 'typename';
|
|
233
|
+
};
|
|
210
234
|
/**
|
|
211
235
|
* Get the label of an entity.
|
|
212
236
|
* Accepts both reactive entities and snapshots.
|
|
237
|
+
*
|
|
238
|
+
* If `options.fallback === 'typename'` and no label is set, returns the
|
|
239
|
+
* entity's typename instead.
|
|
213
240
|
*/
|
|
214
|
-
export declare const getLabel: (entity: AnyProperties) => string | undefined;
|
|
241
|
+
export declare const getLabel: (entity: AnyProperties, options?: GetLabelOptions) => string | undefined;
|
|
215
242
|
/**
|
|
216
243
|
* Set the label of an entity.
|
|
217
|
-
* Must be called within an Obj.
|
|
244
|
+
* Must be called within an Obj.update or Relation.update callback.
|
|
218
245
|
*/
|
|
219
246
|
export declare const setLabel: (entity: Mutable<AnyProperties>, label: string) => void;
|
|
220
247
|
/**
|
|
@@ -222,10 +249,24 @@ export declare const setLabel: (entity: Mutable<AnyProperties>, label: string) =
|
|
|
222
249
|
* Accepts both reactive entities and snapshots.
|
|
223
250
|
*/
|
|
224
251
|
export declare const getDescription: (entity: AnyProperties) => string | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* Get the icon annotation for an entity, resolved via its type-level `IconAnnotation`.
|
|
254
|
+
* Accepts both reactive entities and snapshots.
|
|
255
|
+
*
|
|
256
|
+
* Returns the full `{ icon, hue }` annotation so callers can use both the phosphor icon
|
|
257
|
+
* name and the suggested colour. Callers wanting just the icon name typically write
|
|
258
|
+
* `Obj.getIcon(obj)?.icon ?? 'ph--cube--regular'`.
|
|
259
|
+
*
|
|
260
|
+
* Note: this is the "static" icon from the object's own schema. It does not follow
|
|
261
|
+
* `IconFromRefAnnotation` delegation — call sites needing that (e.g. app-graph node
|
|
262
|
+
* builders) should resolve the ref themselves.
|
|
263
|
+
*/
|
|
264
|
+
export declare const getIcon: (entity: AnyProperties) => IconAnnotation | undefined;
|
|
225
265
|
/**
|
|
226
266
|
* Set the description of an entity.
|
|
227
|
-
* Must be called within an Obj.
|
|
267
|
+
* Must be called within an Obj.update or Relation.update callback.
|
|
228
268
|
*/
|
|
229
269
|
export declare const setDescription: (entity: Mutable<AnyProperties>, description: string) => void;
|
|
230
|
-
export {};
|
|
270
|
+
export { Dictionary, Key, getDictionary, setDictionary } from './dictionary';
|
|
271
|
+
export declare const getFromAst: <T>(ast: SchemaAST.AST, annotation: Annotation.Annotation<T>) => Option.Option<T>;
|
|
231
272
|
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/annotations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/annotations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,SAAS,M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,eAAO,MAAM,cAAc,WAAY,OAAO,CAAC,aAAa,CAAC,eAAe,MAAM,SAKjF,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7E,eAAO,MAAM,UAAU,GAAI,CAAC,OAAO,SAAS,CAAC,GAAG,cAAc,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAKvG,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Option from 'effect/Option';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import * as Types from 'effect/Types';
|
|
4
|
+
import type * as Annotation from '../../Annotation';
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for an annotation.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Key: Schema.brand<typeof Schema.String, "~@dxos/echo/AnnotationKey">;
|
|
9
|
+
export type Key = Schema.Schema.Type<typeof Key>;
|
|
10
|
+
/**
|
|
11
|
+
* Set of annotation values stored on entity meta or nested in schemas.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Dictionary: Schema.Record$<Schema.brand<typeof Schema.String, "~@dxos/echo/AnnotationKey">, typeof Schema.Unknown>;
|
|
14
|
+
export interface Dictionary extends Schema.Schema.Type<typeof Dictionary> {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get the value of an annotation from a dictionary.
|
|
18
|
+
*/
|
|
19
|
+
export declare const getDictionary: <T>(values: Annotation.Dictionary, annotation: Annotation.Annotation<T>) => Option.Option<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Set the value of an annotation in a dictionary.
|
|
22
|
+
*/
|
|
23
|
+
export declare const setDictionary: <T>(values: Types.Mutable<Annotation.Dictionary>, annotation: Annotation.Annotation<T>, value: T) => void;
|
|
24
|
+
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/dictionary.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,GAAG,iEAAgE,CAAC;AACjF,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,UAAU,wGAAqD,CAAC;AAC7E,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC;CAAG;AAE5E;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,UACrB,UAAU,CAAC,UAAU,cACjB,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,KACnC,MAAM,CAAC,MAAM,CAAC,CAAC,CAMjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,UACrB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,cAChC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,SAC7B,CAAC,KACP,IAEF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Option from 'effect/Option';
|
|
2
|
+
import type * as Annotation from '../../Annotation';
|
|
3
|
+
import type * as Entity from '../../Entity';
|
|
4
|
+
import { type Mutable } from '../common/proxy/reactive';
|
|
5
|
+
/**
|
|
6
|
+
* Get the value of an annotation from an entity instance or snapshot.
|
|
7
|
+
*/
|
|
8
|
+
export declare const get: <T>(target: Entity.Unknown | Entity.Snapshot, annotation: Annotation.Annotation<T>) => Option.Option<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Set the value of an annotation on an entity instance.
|
|
11
|
+
* Must be called with a mutable entity — i.e. inside an `Obj.update` callback.
|
|
12
|
+
*/
|
|
13
|
+
export declare const set: <T>(target: Mutable<Entity.Unknown>, annotation: Annotation.Annotation<T>, value: T) => void;
|
|
14
|
+
//# sourceMappingURL=entity-dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-dictionary.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/entity-dictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,KAAK,KAAK,UAAU,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAMxD;;GAEG;AACH,eAAO,MAAM,GAAG,GAAI,CAAC,UACX,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,cAC5B,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,KACnC,MAAM,CAAC,MAAM,CAAC,CAAC,CAOjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,GAAG,GAAI,CAAC,UAAU,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,KAAG,IAcxG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/sorting.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;GAEG;AACH,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/sorting.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;GAEG;AACH,eAAO,MAAM,OAAO,OAAQ,MAAM,MAAM,MAAM,KAAG,MAQhD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,UAA8E,CAAC;AAEzG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,UAAoF,CAAC;AAElH;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,SAAS,kBAAkB,UAAU,CAAC,CAAC,CAAC,EAAE,KAAG,UAAU,CAAC,CAAC,CAUvF,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Option from 'effect/Option';
|
|
2
2
|
import type * as Schema from 'effect/Schema';
|
|
3
3
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
4
4
|
import { EntityKind } from '../common/types';
|
|
5
5
|
export interface AnnotationHelper<T> {
|
|
6
6
|
/**
|
|
7
|
-
* Get the annotation value from
|
|
7
|
+
* Get the annotation value from an Effect schema.
|
|
8
|
+
*
|
|
9
|
+
* Only accepts `Schema.Schema.Any` — to read an annotation off a `Type.Type`
|
|
10
|
+
* entity, unwrap it first with `Type.getSchema(entity)`. This keeps the
|
|
11
|
+
* annotation pipeline single-shaped and forces annotations to live on the
|
|
12
|
+
* source schema, not on the post-construction Type entity.
|
|
8
13
|
*/
|
|
9
14
|
get: (schema: Schema.Schema.Any) => Option.Option<T>;
|
|
10
15
|
/**
|
|
@@ -12,7 +17,11 @@ export interface AnnotationHelper<T> {
|
|
|
12
17
|
*/
|
|
13
18
|
getFromAst: (ast: SchemaAST.AST) => Option.Option<T>;
|
|
14
19
|
/**
|
|
15
|
-
* Set the annotation
|
|
20
|
+
* Set the annotation on an Effect schema.
|
|
21
|
+
*
|
|
22
|
+
* Only accepts `Schema.Schema.Any` — annotations must be applied to the
|
|
23
|
+
* source schema BEFORE wrapping it with `Type.makeObject` / `Type.makeRelation`.
|
|
24
|
+
* In a pipe, place every `Annotation.X.set(...)` before the `Type.make...` step.
|
|
16
25
|
*/
|
|
17
26
|
set: (value: T) => <S extends Schema.Schema.Any>(schema: S) => S;
|
|
18
27
|
}
|
|
@@ -23,7 +32,7 @@ export declare const createAnnotationHelper: <T>(id: symbol) => AnnotationHelper
|
|
|
23
32
|
/**
|
|
24
33
|
* If property is optional returns the nested property, otherwise returns the property.
|
|
25
34
|
*/
|
|
26
|
-
export declare const unwrapOptional: (property: SchemaAST.PropertySignature) => SchemaAST.
|
|
35
|
+
export declare const unwrapOptional: (property: SchemaAST.PropertySignature) => SchemaAST.PropertySignature | SchemaAST.AST;
|
|
27
36
|
/**
|
|
28
37
|
* @see JSONSchemaAnnotationId
|
|
29
38
|
* @returns JSON-schema annotation so that the schema can be serialized with correct parameters.
|
|
@@ -35,5 +44,5 @@ export declare const makeTypeJsonSchemaAnnotation: (options: {
|
|
|
35
44
|
version: string;
|
|
36
45
|
relationSource?: string;
|
|
37
46
|
relationTarget?: string;
|
|
38
|
-
}) =>
|
|
47
|
+
}) => Record<string, unknown>;
|
|
39
48
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/util.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Annotation/util.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAK9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC;;;;;;;OAOG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrD;;OAEG;IACH,UAAU,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrD;;;;;;OAMG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;CAClE;AAED;;GAEG;AAGH,eAAO,MAAM,sBAAsB,GAAI,CAAC,MAAM,MAAM,KAAG,gBAAgB,CAAC,CAAC,CASxE,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,cAAc,aAAc,SAAS,CAAC,iBAAiB,gDAMnE,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,4BAA4B,YAAa;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,4BAgBA,CAAC"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { URI } from '@dxos/keys';
|
|
2
2
|
import type { AnyEntity } from '../common/types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Controls the URI form returned by `getUri` and the public `*.getURI` helpers.
|
|
5
|
+
*
|
|
6
|
+
* - `'named'` — Registry key URI (`dxn:<meta.key>`) when the entity has a key in its meta;
|
|
7
|
+
* falls back to the default EID.
|
|
8
|
+
* - `'absolute'` — Fully-qualified EID with space id (`echo://<spaceId>/<entityId>`);
|
|
9
|
+
* falls back when no space is available.
|
|
10
|
+
* - `'relative'` — Local EID without space id (`echo:/<entityId>`).
|
|
11
|
+
*
|
|
12
|
+
* Omitting `prefer` preserves the existing behaviour.
|
|
13
|
+
*/
|
|
14
|
+
export type GetURIOptions = {
|
|
15
|
+
prefer?: 'named' | 'absolute' | 'relative';
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Get the URI of an entity.
|
|
5
19
|
* Accepts both reactive entities and snapshots.
|
|
6
20
|
*/
|
|
7
|
-
export declare const
|
|
21
|
+
export declare const getUri: (entity: AnyEntity, options?: GetURIOptions) => URI.URI;
|
|
8
22
|
/**
|
|
9
23
|
* Get the database the entity belongs to.
|
|
10
24
|
* Accepts both reactive entities and snapshots.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Entity/api.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Entity/api.ts"],"names":[],"mappings":"AAKA,OAAO,EAAY,GAAG,EAAgB,MAAM,YAAY,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,WAAY,SAAS,YAAY,aAAa,KAAG,GAAG,CAAC,GAmCvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,WAAY,SAAS,KAAG,GAAG,GAAG,SAGrD,CAAC"}
|
|
@@ -1,20 +1,84 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
2
|
import type * as Types from 'effect/Types';
|
|
3
|
+
import { DXN, EntityId } from '@dxos/keys';
|
|
3
4
|
import { type ToMutable } from '@dxos/util';
|
|
4
|
-
import { type
|
|
5
|
-
import {
|
|
5
|
+
import { type AnyEntity, EntityKind, InstancePhantomId, KindId, SchemaKindId, StaticTypeSchemaSlot } from '../common/types';
|
|
6
|
+
import { JsonSchemaType } from '../JsonSchema/json-schema-type';
|
|
6
7
|
export type EchoTypeSchemaProps<T, ExtraFields = {}> = Types.Simplify<AnyEntity & ToMutable<T> & ExtraFields>;
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Options accepted by every `Type.makeObject` / `Type.makeRelation` / type-kind
|
|
10
|
+
* factory. Defaults are derived from `(typename, version)` so callers normally
|
|
11
|
+
* pass nothing.
|
|
12
|
+
*/
|
|
13
|
+
export type EchoTypeOptions = {
|
|
8
14
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
15
|
+
* Override the entity id stamped on the in-memory `Type.Type` value.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to `EntityId.deterministic(typename, version)` — stable across processes
|
|
18
|
+
* and workerd-safe (no `crypto.getRandomValues()` at module-evaluation time).
|
|
19
|
+
* Pass an explicit id (typically `EntityId.random()`) to opt out of the
|
|
20
|
+
* deterministic default.
|
|
11
21
|
*/
|
|
22
|
+
id?: EntityId;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* In-memory `Type.Type` entity shape produced by `Type.makeObject(dxn)` /
|
|
26
|
+
* `Type.makeRelation({...})`. A live reactive `TypeSchema` instance —
|
|
27
|
+
* identical to a persisted `Type.Type` except for database attachment.
|
|
28
|
+
*
|
|
29
|
+
* NOT a `Schema.Schema`. The underlying Effect Schema is cached on the hidden
|
|
30
|
+
* `StaticTypeSchemaSlot` slot — retrieve it via `Type.getSchema(...)`.
|
|
31
|
+
*/
|
|
32
|
+
export interface EchoTypeSchema<Self extends Schema.Schema.Any, ExtraFields = {}, K extends EntityKind = EntityKind, Fields extends Schema.Struct.Fields = Schema.Struct.Fields> {
|
|
33
|
+
/**
|
|
34
|
+
* Entity-kind brand. Type entities are their own kind (`Type`) regardless of
|
|
35
|
+
* the kind of instance they describe — `[SchemaKindId]` carries the latter.
|
|
36
|
+
* This lets predicates like `Obj.isObject` / `Relation.isRelation` cleanly
|
|
37
|
+
* reject type entities without also having to inspect `[SchemaKindId]`.
|
|
38
|
+
*/
|
|
39
|
+
readonly [KindId]: EntityKind.Type;
|
|
40
|
+
/** Schema-kind brand indicating what kind of instance this type describes. */
|
|
12
41
|
readonly [SchemaKindId]: K;
|
|
13
42
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
43
|
+
* Entity id. Always present — stamped at construction — but NOT the type's
|
|
44
|
+
* identity while in-memory: an unattached type resolves its URI to the typename
|
|
45
|
+
* DXN, switching to `echo:/<id>` only once attached to a database (see
|
|
46
|
+
* `getTypeURIFromSpecifier`, which discriminates by database attachment).
|
|
16
47
|
*/
|
|
48
|
+
readonly id: EntityId;
|
|
49
|
+
/** Source Effect Schema (kept on a hidden slot for `Type.getSchema`). */
|
|
50
|
+
readonly [StaticTypeSchemaSlot]: Schema.Schema.AnyNoContext;
|
|
51
|
+
readonly jsonSchema: JsonSchemaType;
|
|
52
|
+
/** Struct fields for introspection. */
|
|
17
53
|
readonly fields: Fields;
|
|
18
|
-
|
|
54
|
+
/** Phantom — instance type produced by `Obj.make(self, ...)`. */
|
|
55
|
+
readonly _instance?: EchoTypeSchemaProps<Schema.Schema.Type<Self>, ExtraFields>;
|
|
56
|
+
/**
|
|
57
|
+
* Phantom slot mirroring `Type<A>` so internal helpers (`makeObject`,
|
|
58
|
+
* `createObject`, `Ref.make`) infer the instance type uniformly whether
|
|
59
|
+
* the caller passes an `EchoTypeSchema` or a top-level `Type.Type` entity.
|
|
60
|
+
*
|
|
61
|
+
* Includes the instance-kind brand (`[KindId]`) so the phantom is assignable
|
|
62
|
+
* to the matching public-side interface in `Type.ts` (`Type.Obj` /
|
|
63
|
+
* `Type.Relation` / `Type.Type`). Each kind projects identity: instances of
|
|
64
|
+
* an object-kind schema are object-kind entities, type-kind schemas produce
|
|
65
|
+
* type-kind (persisted Type.Type) entities — the latter additionally carry
|
|
66
|
+
* the `[SchemaKindId]` / `[StaticTypeSchemaSlot]` brands the echo-handler
|
|
67
|
+
* proxy exposes on persisted Type entities.
|
|
68
|
+
*/
|
|
69
|
+
readonly [InstancePhantomId]?: EchoTypeSchemaProps<Schema.Schema.Type<Self>, ExtraFields> & {
|
|
70
|
+
readonly [KindId]: K;
|
|
71
|
+
} & (K extends EntityKind.Type ? {
|
|
72
|
+
readonly [SchemaKindId]: EntityKind.Type;
|
|
73
|
+
readonly [StaticTypeSchemaSlot]: Schema.Schema.AnyNoContext;
|
|
74
|
+
} : {});
|
|
19
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Identity (typename + version) of the type meta-schema — the `Type.Type` that
|
|
78
|
+
* every ECHO type entity is itself an instance of. Shared by the materialisation
|
|
79
|
+
* vehicle ({@link persistentEntitySchema}) and `TypeSchema` so the two cannot
|
|
80
|
+
* drift on identity.
|
|
81
|
+
*/
|
|
82
|
+
export declare const TypeMetaSchemaDXN: DXN.DXN;
|
|
83
|
+
export { isEntity } from './guard';
|
|
20
84
|
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Entity/entity.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC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E,EAAE,QAAQ,CAAC;IAEtB,yEAAyE;IACzE,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAK5D,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IAEpC,uCAAuC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;IAEhF;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,GAAG;QAC1F,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;KACtB,GAAG,CAAC,CAAC,SAAS,UAAU,CAAC,IAAI,GACxB;QACE,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;QACzC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;KAC7D,GACD,EAAE,CAAC,CAAC;CACX;AAiCD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,SAA4C,CAAC;AAuH3E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Entity from '../../Entity';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the value is an ECHO entity instance (object or relation).
|
|
4
|
+
*/
|
|
5
|
+
export declare const isEntity: (value: unknown) => value is Entity.Unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Returns true if the value is an ECHO entity snapshot.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isSnapshot: (value: unknown) => value is Entity.Snapshot;
|
|
10
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Entity/guard.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAG5C;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,OAKzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,QAK3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Entity/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/Entity/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|