@dxos/echo 0.8.4-main.c85a9c8dae → 0.8.4-main.d05673bc65
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/lib/neutral/Annotation.mjs +3 -3
- package/dist/lib/neutral/Database.mjs +4 -4
- package/dist/lib/neutral/Entity.mjs +10 -7
- package/dist/lib/neutral/Err.mjs +1 -1
- package/dist/lib/neutral/Feed.mjs +13 -10
- package/dist/lib/neutral/Filter.mjs +11 -8
- package/dist/lib/neutral/Format.mjs +3 -3
- package/dist/lib/neutral/JsonSchema.mjs +8 -7
- package/dist/lib/neutral/Obj.mjs +11 -8
- package/dist/lib/neutral/Order.mjs +1 -1
- package/dist/lib/neutral/Query.mjs +16 -13
- package/dist/lib/neutral/Ref.mjs +7 -7
- package/dist/lib/neutral/Relation.mjs +12 -9
- package/dist/lib/neutral/SchemaRegistry.mjs +1 -1
- package/dist/lib/neutral/Tag.mjs +13 -10
- package/dist/lib/neutral/Type.mjs +10 -7
- package/dist/lib/neutral/chunk-43Y5DOS6.mjs +396 -0
- package/dist/lib/neutral/chunk-43Y5DOS6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GAWKQ5DZ.mjs → chunk-724GQYEN.mjs} +5 -5
- package/dist/lib/neutral/chunk-724GQYEN.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-M2KVTHZM.mjs → chunk-B5OXLWZL.mjs} +10 -10
- package/dist/lib/neutral/chunk-B5OXLWZL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-T6JEFNP6.mjs → chunk-BNCCGLJN.mjs} +1 -1
- package/dist/lib/neutral/{chunk-T6JEFNP6.mjs.map → chunk-BNCCGLJN.mjs.map} +1 -1
- package/dist/lib/neutral/chunk-BOZZPUXE.mjs +787 -0
- package/dist/lib/neutral/chunk-BOZZPUXE.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZWKJ4LZJ.mjs → chunk-CIRHIEMW.mjs} +16 -16
- package/dist/lib/neutral/chunk-CIRHIEMW.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GFNCSK7F.mjs → chunk-DYDJBZEG.mjs} +10 -9
- package/dist/lib/neutral/chunk-DYDJBZEG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-QXF3LGN2.mjs → chunk-FXEG7EOK.mjs} +5 -3
- package/dist/lib/neutral/chunk-FXEG7EOK.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-DZQSL6RW.mjs → chunk-FZO7LQO7.mjs} +2 -2
- package/dist/lib/neutral/{chunk-DZQSL6RW.mjs.map → chunk-FZO7LQO7.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-AQP4QKYP.mjs → chunk-KTAWP7GI.mjs} +8 -8
- package/dist/lib/neutral/chunk-KTAWP7GI.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-5ELDDYWE.mjs → chunk-NEGC54NE.mjs} +4 -4
- package/dist/lib/neutral/chunk-NEGC54NE.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-KGV3QIRX.mjs → chunk-NQRLRYJM.mjs} +11 -11
- package/dist/lib/neutral/chunk-NQRLRYJM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ALOGSVBP.mjs → chunk-NXMFBIT5.mjs} +3 -3
- package/dist/lib/neutral/chunk-NXMFBIT5.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-OVUBTQLT.mjs → chunk-OENWMTE6.mjs} +2 -2
- package/dist/lib/neutral/chunk-OENWMTE6.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-T4MPQJ7X.mjs → chunk-RMLF7JOZ.mjs} +6 -6
- package/dist/lib/neutral/chunk-RMLF7JOZ.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-F7KMHDPJ.mjs → chunk-SEMVAGBM.mjs} +41 -13
- package/dist/lib/neutral/chunk-SEMVAGBM.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-PP4DNUZU.mjs → chunk-TQQZLKB7.mjs} +1541 -2748
- package/dist/lib/neutral/chunk-TQQZLKB7.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-MXQJZCPY.mjs → chunk-UBEZSGXY.mjs} +1 -1
- package/dist/lib/neutral/chunk-UBEZSGXY.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-W7OP5HGZ.mjs → chunk-UFDK26FO.mjs} +6 -6
- package/dist/lib/neutral/chunk-UFDK26FO.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZTUBYOGB.mjs → chunk-UI6MWK5W.mjs} +1 -1
- package/dist/lib/neutral/chunk-UI6MWK5W.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-O3TZFQCT.mjs → chunk-UTBRYVQC.mjs} +2 -2
- package/dist/lib/neutral/chunk-UTBRYVQC.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-BRJSLACP.mjs → chunk-VA2F47ZC.mjs} +12 -12
- package/dist/lib/neutral/chunk-VA2F47ZC.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-4KG6IGL4.mjs → chunk-WYOKA6AE.mjs} +4 -4
- package/dist/lib/neutral/{chunk-4KG6IGL4.mjs.map → chunk-WYOKA6AE.mjs.map} +2 -2
- package/dist/lib/neutral/chunk-YWXWXIE5.mjs +34 -0
- package/dist/lib/neutral/chunk-YWXWXIE5.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +24 -21
- package/dist/lib/neutral/internal/index.mjs +44 -38
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/testing/index.mjs +35 -31
- package/dist/lib/neutral/testing/index.mjs.map +2 -2
- package/dist/types/src/Annotation.d.ts +3 -3
- package/dist/types/src/Annotation.d.ts.map +1 -1
- package/dist/types/src/Collection.d.ts.map +1 -1
- package/dist/types/src/Database.d.ts +3 -3
- package/dist/types/src/Database.d.ts.map +1 -1
- package/dist/types/src/Dataset.d.ts.map +1 -1
- package/dist/types/src/Entity.d.ts.map +1 -1
- package/dist/types/src/Err.d.ts.map +1 -1
- package/dist/types/src/Feed.d.ts +4 -4
- package/dist/types/src/Feed.d.ts.map +1 -1
- package/dist/types/src/Filter.d.ts.map +1 -1
- package/dist/types/src/Format.d.ts +1 -1
- package/dist/types/src/Format.d.ts.map +1 -1
- package/dist/types/src/Hypergraph.d.ts +6 -1
- package/dist/types/src/Hypergraph.d.ts.map +1 -1
- package/dist/types/src/JsonSchema.d.ts +5 -5
- package/dist/types/src/JsonSchema.d.ts.map +1 -1
- package/dist/types/src/Obj.d.ts +4 -2
- package/dist/types/src/Obj.d.ts.map +1 -1
- package/dist/types/src/Order.d.ts.map +1 -1
- package/dist/types/src/Query.d.ts.map +1 -1
- package/dist/types/src/Ref.d.ts +11 -11
- package/dist/types/src/Ref.d.ts.map +1 -1
- package/dist/types/src/Relation.d.ts +2 -1
- package/dist/types/src/Relation.d.ts.map +1 -1
- package/dist/types/src/SchemaRegistry.d.ts +1 -1
- package/dist/types/src/Tag.d.ts.map +1 -1
- package/dist/types/src/Type.d.ts +12 -11
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/View.d.ts.map +1 -1
- package/dist/types/src/internal/{annotations → Annotation}/annotations.d.ts +23 -2
- package/dist/types/src/internal/Annotation/annotations.d.ts.map +1 -0
- package/dist/types/src/internal/Annotation/annotations.test.d.ts.map +1 -0
- package/dist/types/src/internal/Annotation/index.d.ts +4 -0
- package/dist/types/src/internal/Annotation/index.d.ts.map +1 -0
- package/dist/types/src/internal/{api → Annotation}/sorting.d.ts +1 -1
- package/dist/types/src/internal/Annotation/sorting.d.ts.map +1 -0
- package/dist/types/src/internal/{annotations → Annotation}/util.d.ts +1 -1
- package/dist/types/src/internal/Annotation/util.d.ts.map +1 -0
- package/dist/types/src/internal/{api/entity.d.ts → Entity/api.d.ts} +2 -2
- package/dist/types/src/internal/Entity/api.d.ts.map +1 -0
- package/dist/types/src/internal/{entities → Entity}/entity.d.ts +2 -2
- package/dist/types/src/internal/Entity/entity.d.ts.map +1 -0
- package/dist/types/src/internal/{entities → Entity}/index.d.ts +2 -0
- package/dist/types/src/internal/Entity/index.d.ts.map +1 -0
- package/dist/types/src/internal/{entities → Entity}/model.d.ts +2 -26
- package/dist/types/src/internal/Entity/model.d.ts.map +1 -0
- package/dist/types/src/internal/{entities → Entity}/object.d.ts +2 -2
- package/dist/types/src/internal/Entity/object.d.ts.map +1 -0
- package/dist/types/src/internal/{entities → Entity}/relation.d.ts +3 -30
- package/dist/types/src/internal/Entity/relation.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/util.d.ts.map +1 -0
- package/dist/types/src/internal/{api → Entity}/version.d.ts +1 -1
- package/dist/types/src/internal/Entity/version.d.ts.map +1 -0
- package/dist/types/src/internal/Format/date.d.ts.map +1 -0
- package/dist/types/src/internal/Format/date.test.d.ts.map +1 -0
- package/dist/types/src/internal/Format/format.d.ts.map +1 -0
- package/dist/types/src/internal/Format/format.test.d.ts.map +1 -0
- package/dist/types/src/internal/Format/index.d.ts.map +1 -0
- package/dist/types/src/internal/Format/number.d.ts.map +1 -0
- package/dist/types/src/internal/Format/object.d.ts.map +1 -0
- package/dist/types/src/internal/Format/select.d.ts.map +1 -0
- package/dist/types/src/internal/Format/string.d.ts.map +1 -0
- package/dist/types/src/internal/{formats → Format}/types.d.ts +1 -1
- package/dist/types/src/internal/Format/types.d.ts.map +1 -0
- package/dist/types/src/internal/{json-schema → JsonSchema}/annotations.d.ts +1 -1
- package/dist/types/src/internal/JsonSchema/annotations.d.ts.map +1 -0
- package/dist/types/src/internal/JsonSchema/effect-schema.test.d.ts.map +1 -0
- package/dist/types/src/internal/JsonSchema/index.d.ts.map +1 -0
- package/dist/types/src/internal/JsonSchema/json-schema-normalize.d.ts.map +1 -0
- package/dist/types/src/internal/{json-schema → JsonSchema}/json-schema-type.d.ts +23 -23
- package/dist/types/src/internal/JsonSchema/json-schema-type.d.ts.map +1 -0
- package/dist/types/src/internal/JsonSchema/json-schema.d.ts.map +1 -0
- package/dist/types/src/internal/JsonSchema/json-schema.test.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/clone.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/common.d.ts.map +1 -0
- package/dist/types/src/internal/{object → Obj}/create-object.d.ts +2 -2
- package/dist/types/src/internal/Obj/create-object.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/create-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/{object → Obj}/deleted.d.ts +1 -1
- package/dist/types/src/internal/Obj/deleted.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/ids.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/index.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/inspect.d.ts.map +1 -0
- package/dist/types/src/internal/{object → Obj}/json-serializer.d.ts +12 -5
- package/dist/types/src/internal/Obj/json-serializer.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/json-serializer.test.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/schema-validator.d.ts +2 -0
- package/dist/types/src/internal/Obj/schema-validator.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/schema-validator.test.d.ts.map +1 -0
- package/dist/types/src/internal/{object → Obj}/set-value.d.ts +1 -1
- package/dist/types/src/internal/Obj/set-value.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/set-value.test.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/snapshot.d.ts.map +1 -0
- package/dist/types/src/internal/{object → Obj}/typed-object.d.ts +2 -2
- package/dist/types/src/internal/Obj/typed-object.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/typed-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/Ref/index.d.ts.map +1 -0
- package/dist/types/src/internal/{ref → Ref}/ref-array.d.ts +1 -1
- package/dist/types/src/internal/Ref/ref-array.d.ts.map +1 -0
- package/dist/types/src/internal/{ref → Ref}/ref.d.ts +2 -2
- package/dist/types/src/internal/{ref → Ref}/ref.d.ts.map +1 -1
- package/dist/types/src/internal/Ref/ref.test.d.ts.map +1 -0
- package/dist/types/src/internal/{schema → Type}/compose.d.ts +1 -1
- package/dist/types/src/internal/Type/compose.d.ts.map +1 -0
- package/dist/types/src/internal/Type/compose.test.d.ts.map +1 -0
- package/dist/types/src/internal/{schema → Type}/echo-schema.d.ts +5 -5
- package/dist/types/src/internal/Type/echo-schema.d.ts.map +1 -0
- package/dist/types/src/internal/Type/index.d.ts.map +1 -0
- package/dist/types/src/internal/Type/manipulation.d.ts.map +1 -0
- package/dist/types/src/internal/{schema → Type}/persistent-schema.d.ts +2 -2
- package/dist/types/src/internal/Type/persistent-schema.d.ts.map +1 -0
- package/dist/types/src/internal/{api → common/api}/index.d.ts +0 -4
- package/dist/types/src/internal/common/api/index.d.ts.map +1 -0
- package/dist/types/src/internal/common/api/meta.d.ts.map +1 -0
- package/dist/types/src/internal/common/index.d.ts +4 -0
- package/dist/types/src/internal/common/index.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/change-context.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/change.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/define-hidden-property.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/errors.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/event-batch.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/handler.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/index.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/json-serializer.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/make-object.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/ownership.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/proxy-types.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/proxy-utils.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/reactive-array.d.ts.map +1 -0
- package/dist/types/src/internal/{proxy → common/proxy}/reactive.d.ts +1 -1
- package/dist/types/src/internal/common/proxy/reactive.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/schema-validator.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/schema.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/symbols.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/typed-handler.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/typed-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/base.d.ts.map +1 -0
- package/dist/types/src/internal/{types → common/types}/entity.d.ts +1 -1
- package/dist/types/src/internal/common/types/entity.d.ts.map +1 -0
- package/dist/types/src/internal/{types → common/types}/index.d.ts +1 -0
- package/dist/types/src/internal/common/types/index.d.ts.map +1 -0
- package/dist/types/src/internal/{types → common/types}/meta.d.ts +3 -3
- package/dist/types/src/internal/common/types/meta.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/model-symbols.d.ts +54 -0
- package/dist/types/src/internal/common/types/model-symbols.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/typename.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/version.d.ts.map +1 -0
- package/dist/types/src/internal/index.d.ts +8 -10
- package/dist/types/src/internal/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-schema.d.ts +7 -7
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/Annotation.ts +5 -3
- package/src/Collection.ts +3 -1
- package/src/Database.ts +6 -4
- package/src/Dataset.ts +2 -0
- package/src/Entity.ts +3 -0
- package/src/Err.ts +2 -0
- package/src/Feed.ts +8 -5
- package/src/Filter.ts +2 -0
- package/src/Format.ts +1 -1
- package/src/Hypergraph.ts +7 -2
- package/src/JsonSchema.ts +7 -5
- package/src/Obj.test.ts +2 -2
- package/src/Obj.ts +15 -9
- package/src/Order.ts +2 -0
- package/src/Query.test.ts +23 -23
- package/src/Query.ts +4 -2
- package/src/Ref.ts +14 -12
- package/src/Relation.test.ts +2 -2
- package/src/Relation.ts +6 -3
- package/src/SchemaRegistry.ts +1 -1
- package/src/Tag.ts +3 -1
- package/src/Type.ts +14 -11
- package/src/View.ts +4 -2
- package/src/internal/{annotations → Annotation}/annotations.test.ts +6 -6
- package/src/internal/{annotations → Annotation}/annotations.ts +56 -11
- package/src/internal/{annotations → Annotation}/index.ts +1 -0
- package/src/internal/{api → Annotation}/sorting.ts +2 -3
- package/src/internal/{annotations → Annotation}/util.ts +1 -1
- package/src/internal/{api/entity.ts → Entity/api.ts} +4 -2
- package/src/internal/{entities → Entity}/entity.ts +2 -2
- package/src/internal/{entities → Entity}/index.ts +2 -0
- package/src/internal/{entities → Entity}/model.ts +13 -42
- package/src/internal/{entities → Entity}/object.ts +2 -2
- package/src/internal/{entities → Entity}/relation.ts +19 -36
- package/src/internal/{api → Entity}/version.ts +3 -2
- package/src/internal/{formats → Format}/date.test.ts +1 -1
- package/src/internal/{formats → Format}/format.test.ts +1 -1
- package/src/internal/{formats → Format}/types.ts +2 -2
- package/src/internal/{json-schema → JsonSchema}/annotations.ts +3 -3
- package/src/internal/{json-schema → JsonSchema}/json-schema-type.ts +4 -4
- package/src/internal/{json-schema → JsonSchema}/json-schema.test.ts +48 -48
- package/src/internal/{json-schema → JsonSchema}/json-schema.ts +3 -3
- package/src/internal/{object → Obj}/clone.ts +3 -3
- package/src/internal/{object → Obj}/common.ts +2 -2
- package/src/internal/{object → Obj}/create-object.test.ts +4 -4
- package/src/internal/{object → Obj}/create-object.ts +5 -5
- package/src/internal/{object → Obj}/deleted.ts +2 -2
- package/src/internal/{object → Obj}/inspect.ts +2 -2
- package/src/internal/{object → Obj}/json-serializer.test.ts +6 -6
- package/src/internal/{object → Obj}/json-serializer.ts +17 -6
- package/src/internal/{object → Obj}/schema-validator.ts +1 -1
- package/src/internal/{object → Obj}/set-value.ts +2 -2
- package/src/internal/{object → Obj}/snapshot.ts +14 -5
- package/src/internal/{object → Obj}/typed-object.test.ts +3 -3
- package/src/internal/{object → Obj}/typed-object.ts +2 -2
- package/src/internal/{ref → Ref}/ref-array.ts +1 -1
- package/src/internal/{ref → Ref}/ref.test.ts +4 -4
- package/src/internal/{ref → Ref}/ref.ts +3 -3
- package/src/internal/{schema → Type}/compose.test.ts +5 -5
- package/src/internal/{schema → Type}/compose.ts +1 -1
- package/src/internal/{schema → Type}/echo-schema.ts +6 -6
- package/src/internal/{schema → Type}/manipulation.ts +1 -1
- package/src/internal/{schema → Type}/persistent-schema.ts +5 -5
- package/src/internal/{api → common/api}/index.ts +0 -4
- package/src/internal/common/index.ts +7 -0
- package/src/internal/{proxy → common/proxy}/change.test.ts +3 -3
- package/src/internal/{proxy → common/proxy}/handler.test.ts +2 -2
- package/src/internal/{proxy → common/proxy}/json-serializer.ts +6 -3
- package/src/internal/{proxy → common/proxy}/make-object.ts +1 -1
- package/src/internal/{proxy → common/proxy}/reactive.ts +1 -1
- package/src/internal/{proxy → common/proxy}/schema.test.ts +10 -10
- package/src/internal/{proxy → common/proxy}/typed-handler.test.ts +6 -6
- package/src/internal/{proxy → common/proxy}/typed-handler.ts +2 -3
- package/src/internal/{proxy → common/proxy}/typed-object.test.ts +4 -4
- package/src/internal/{types → common/types}/entity.ts +1 -1
- package/src/internal/{types → common/types}/index.ts +1 -0
- package/src/internal/{types → common/types}/meta.ts +1 -1
- package/src/internal/common/types/model-symbols.ts +69 -0
- package/src/internal/index.ts +8 -31
- package/src/testing/api.test.ts +2 -2
- package/src/testing/test-schema.ts +9 -9
- package/dist/lib/neutral/chunk-5ELDDYWE.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ALOGSVBP.mjs.map +0 -7
- package/dist/lib/neutral/chunk-AQP4QKYP.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BRJSLACP.mjs.map +0 -7
- package/dist/lib/neutral/chunk-F7KMHDPJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GAWKQ5DZ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GFNCSK7F.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KGV3QIRX.mjs.map +0 -7
- package/dist/lib/neutral/chunk-M2KVTHZM.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MXQJZCPY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-O3TZFQCT.mjs.map +0 -7
- package/dist/lib/neutral/chunk-OVUBTQLT.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PP4DNUZU.mjs.map +0 -7
- package/dist/lib/neutral/chunk-QXF3LGN2.mjs.map +0 -7
- package/dist/lib/neutral/chunk-T4MPQJ7X.mjs.map +0 -7
- package/dist/lib/neutral/chunk-W7OP5HGZ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZTUBYOGB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZWKJ4LZJ.mjs.map +0 -7
- package/dist/types/src/internal/annotations/annotations.d.ts.map +0 -1
- package/dist/types/src/internal/annotations/annotations.test.d.ts.map +0 -1
- package/dist/types/src/internal/annotations/index.d.ts +0 -3
- package/dist/types/src/internal/annotations/index.d.ts.map +0 -1
- package/dist/types/src/internal/annotations/util.d.ts.map +0 -1
- package/dist/types/src/internal/api/annotations.d.ts +0 -23
- package/dist/types/src/internal/api/annotations.d.ts.map +0 -1
- package/dist/types/src/internal/api/entity.d.ts.map +0 -1
- package/dist/types/src/internal/api/index.d.ts.map +0 -1
- package/dist/types/src/internal/api/meta.d.ts.map +0 -1
- package/dist/types/src/internal/api/sorting.d.ts.map +0 -1
- package/dist/types/src/internal/api/version.d.ts.map +0 -1
- package/dist/types/src/internal/entities/entity.d.ts.map +0 -1
- package/dist/types/src/internal/entities/index.d.ts.map +0 -1
- package/dist/types/src/internal/entities/model.d.ts.map +0 -1
- package/dist/types/src/internal/entities/object.d.ts.map +0 -1
- package/dist/types/src/internal/entities/relation.d.ts.map +0 -1
- package/dist/types/src/internal/entities/util.d.ts.map +0 -1
- package/dist/types/src/internal/formats/date.d.ts.map +0 -1
- package/dist/types/src/internal/formats/date.test.d.ts.map +0 -1
- package/dist/types/src/internal/formats/format.d.ts.map +0 -1
- package/dist/types/src/internal/formats/format.test.d.ts.map +0 -1
- package/dist/types/src/internal/formats/index.d.ts.map +0 -1
- package/dist/types/src/internal/formats/number.d.ts.map +0 -1
- package/dist/types/src/internal/formats/object.d.ts.map +0 -1
- package/dist/types/src/internal/formats/select.d.ts.map +0 -1
- package/dist/types/src/internal/formats/string.d.ts.map +0 -1
- package/dist/types/src/internal/formats/types.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/annotations.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/effect-schema.test.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/index.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/json-schema-normalize.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/json-schema-type.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/json-schema.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/json-schema.test.d.ts.map +0 -1
- package/dist/types/src/internal/object/clone.d.ts.map +0 -1
- package/dist/types/src/internal/object/common.d.ts.map +0 -1
- package/dist/types/src/internal/object/create-object.d.ts.map +0 -1
- package/dist/types/src/internal/object/create-object.test.d.ts.map +0 -1
- package/dist/types/src/internal/object/deleted.d.ts.map +0 -1
- package/dist/types/src/internal/object/ids.d.ts.map +0 -1
- package/dist/types/src/internal/object/index.d.ts.map +0 -1
- package/dist/types/src/internal/object/inspect.d.ts.map +0 -1
- package/dist/types/src/internal/object/json-serializer.d.ts.map +0 -1
- package/dist/types/src/internal/object/json-serializer.test.d.ts.map +0 -1
- package/dist/types/src/internal/object/schema-validator.d.ts +0 -2
- package/dist/types/src/internal/object/schema-validator.d.ts.map +0 -1
- package/dist/types/src/internal/object/schema-validator.test.d.ts.map +0 -1
- package/dist/types/src/internal/object/set-value.d.ts.map +0 -1
- package/dist/types/src/internal/object/set-value.test.d.ts.map +0 -1
- package/dist/types/src/internal/object/snapshot.d.ts.map +0 -1
- package/dist/types/src/internal/object/typed-object.d.ts.map +0 -1
- package/dist/types/src/internal/object/typed-object.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/change-context.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/change.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/define-hidden-property.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/errors.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/event-batch.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/handler.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/index.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/json-serializer.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/make-object.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/ownership.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/proxy-types.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/proxy-utils.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/reactive-array.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/reactive.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/schema-validator.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/schema.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/symbols.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/typed-handler.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/typed-handler.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/typed-object.test.d.ts.map +0 -1
- package/dist/types/src/internal/ref/index.d.ts.map +0 -1
- package/dist/types/src/internal/ref/ref-array.d.ts.map +0 -1
- package/dist/types/src/internal/ref/ref.test.d.ts.map +0 -1
- package/dist/types/src/internal/schema/compose.d.ts.map +0 -1
- package/dist/types/src/internal/schema/compose.test.d.ts.map +0 -1
- package/dist/types/src/internal/schema/echo-schema.d.ts.map +0 -1
- package/dist/types/src/internal/schema/index.d.ts.map +0 -1
- package/dist/types/src/internal/schema/manipulation.d.ts.map +0 -1
- package/dist/types/src/internal/schema/persistent-schema.d.ts.map +0 -1
- package/dist/types/src/internal/types/base.d.ts.map +0 -1
- package/dist/types/src/internal/types/entity.d.ts.map +0 -1
- package/dist/types/src/internal/types/index.d.ts.map +0 -1
- package/dist/types/src/internal/types/meta.d.ts.map +0 -1
- package/dist/types/src/internal/types/typename.d.ts.map +0 -1
- package/dist/types/src/internal/types/version.d.ts.map +0 -1
- package/src/internal/api/annotations.ts +0 -60
- /package/dist/types/src/internal/{annotations → Annotation}/annotations.test.d.ts +0 -0
- /package/dist/types/src/internal/{entities → Entity}/util.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/date.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/date.test.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/format.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/format.test.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/index.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/number.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/object.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/select.d.ts +0 -0
- /package/dist/types/src/internal/{formats → Format}/string.d.ts +0 -0
- /package/dist/types/src/internal/{json-schema → JsonSchema}/effect-schema.test.d.ts +0 -0
- /package/dist/types/src/internal/{json-schema → JsonSchema}/index.d.ts +0 -0
- /package/dist/types/src/internal/{json-schema → JsonSchema}/json-schema-normalize.d.ts +0 -0
- /package/dist/types/src/internal/{json-schema → JsonSchema}/json-schema.d.ts +0 -0
- /package/dist/types/src/internal/{json-schema → JsonSchema}/json-schema.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/clone.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/common.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/create-object.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/ids.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/index.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/inspect.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/json-serializer.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/schema-validator.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/set-value.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/snapshot.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/typed-object.test.d.ts +0 -0
- /package/dist/types/src/internal/{ref → Ref}/index.d.ts +0 -0
- /package/dist/types/src/internal/{ref → Ref}/ref.test.d.ts +0 -0
- /package/dist/types/src/internal/{schema → Type}/compose.test.d.ts +0 -0
- /package/dist/types/src/internal/{schema → Type}/index.d.ts +0 -0
- /package/dist/types/src/internal/{schema → Type}/manipulation.d.ts +0 -0
- /package/dist/types/src/internal/{api → common/api}/meta.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/change-context.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/change.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/define-hidden-property.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/errors.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/event-batch.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/handler.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/index.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/json-serializer.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/make-object.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/ownership.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/proxy-types.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/proxy-utils.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/reactive-array.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/schema-validator.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/schema.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/symbols.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/typed-handler.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/typed-handler.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/typed-object.test.d.ts +0 -0
- /package/dist/types/src/internal/{types → common/types}/base.d.ts +0 -0
- /package/dist/types/src/internal/{types → common/types}/typename.d.ts +0 -0
- /package/dist/types/src/internal/{types → common/types}/version.d.ts +0 -0
- /package/src/internal/{entities → Entity}/util.ts +0 -0
- /package/src/internal/{formats → Format}/date.ts +0 -0
- /package/src/internal/{formats → Format}/format.ts +0 -0
- /package/src/internal/{formats → Format}/index.ts +0 -0
- /package/src/internal/{formats → Format}/number.ts +0 -0
- /package/src/internal/{formats → Format}/object.ts +0 -0
- /package/src/internal/{formats → Format}/select.ts +0 -0
- /package/src/internal/{formats → Format}/string.ts +0 -0
- /package/src/internal/{json-schema → JsonSchema}/effect-schema.test.ts +0 -0
- /package/src/internal/{json-schema → JsonSchema}/index.ts +0 -0
- /package/src/internal/{json-schema → JsonSchema}/json-schema-normalize.ts +0 -0
- /package/src/internal/{object → Obj}/ids.ts +0 -0
- /package/src/internal/{object → Obj}/index.ts +0 -0
- /package/src/internal/{object → Obj}/schema-validator.test.ts +0 -0
- /package/src/internal/{object → Obj}/set-value.test.ts +0 -0
- /package/src/internal/{ref → Ref}/index.ts +0 -0
- /package/src/internal/{schema → Type}/index.ts +0 -0
- /package/src/internal/{README.md → common/README.md} +0 -0
- /package/src/internal/{api → common/api}/meta.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/change-context.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/define-hidden-property.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/errors.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/event-batch.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/index.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/ownership.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/proxy-types.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/proxy-utils.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/reactive-array.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/schema-validator.ts +0 -0
- /package/src/internal/{proxy → common/proxy}/symbols.ts +0 -0
- /package/src/internal/{types → common/types}/base.ts +0 -0
- /package/src/internal/{types → common/types}/typename.ts +0 -0
- /package/src/internal/{types → common/types}/version.ts +0 -0
package/src/Ref.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Option from 'effect/Option';
|
|
6
8
|
import type * as Schema from 'effect/Schema';
|
|
7
9
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
8
10
|
|
|
9
11
|
import type * as Entity from './Entity';
|
|
10
|
-
import * as
|
|
12
|
+
import * as refInternal from './internal/Ref';
|
|
11
13
|
import type * as JsonSchema from './JsonSchema';
|
|
12
14
|
import type * as Obj from './Obj';
|
|
13
15
|
|
|
@@ -29,8 +31,8 @@ import type * as Obj from './Obj';
|
|
|
29
31
|
* database.makeRef(dxn); // Create a ref from a DXN.
|
|
30
32
|
* ```
|
|
31
33
|
*/
|
|
32
|
-
export type Ref<T> =
|
|
33
|
-
export type Unknown =
|
|
34
|
+
export type Ref<T> = refInternal.Ref<T>;
|
|
35
|
+
export type Unknown = refInternal.Ref<Obj.Unknown>;
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* Factory function to create a Ref schema for the given target schema.
|
|
@@ -43,9 +45,9 @@ export type Unknown = internal.Ref<Obj.Unknown>;
|
|
|
43
45
|
* }).pipe(Type.object({ typename: 'Task', version: '0.1.0' }));
|
|
44
46
|
* ```
|
|
45
47
|
*/
|
|
46
|
-
export const Ref: <S extends Schema.Schema.Any>(schema: S) => RefSchema<Schema.Schema.Type<S>> =
|
|
48
|
+
export const Ref: <S extends Schema.Schema.Any>(schema: S) => RefSchema<Schema.Schema.Type<S>> = refInternal.Ref;
|
|
47
49
|
|
|
48
|
-
export const Array =
|
|
50
|
+
export const Array = refInternal.RefArray;
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
53
|
* TypeScript type for a Ref schema.
|
|
@@ -64,31 +66,31 @@ export const Array = internal.RefArray;
|
|
|
64
66
|
// TODO(dmaretskyi): Investigate if we can remove this type.
|
|
65
67
|
// Post DX-836 it will become just `Schema.Schema<Ref.Ref<T>>`.
|
|
66
68
|
// NOTE: This could be Type.Ref<T> instead, but since it going to be removed, it's better to keep it here, self-contained.
|
|
67
|
-
export interface RefSchema<T extends Entity.Unknown> extends
|
|
69
|
+
export interface RefSchema<T extends Entity.Unknown> extends refInternal.RefSchema<T> {}
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
* Extract reference target.
|
|
71
73
|
*/
|
|
72
|
-
export type Target<R extends Unknown> = R extends
|
|
74
|
+
export type Target<R extends Unknown> = R extends refInternal.Ref<infer T> ? T : never;
|
|
73
75
|
|
|
74
76
|
/**
|
|
75
77
|
* Reference resolver.
|
|
76
78
|
*/
|
|
77
|
-
export type Resolver =
|
|
79
|
+
export type Resolver = refInternal.RefResolver;
|
|
78
80
|
|
|
79
|
-
export const isRef: (value: unknown) => value is Unknown =
|
|
81
|
+
export const isRef: (value: unknown) => value is Unknown = refInternal.Ref.isRef;
|
|
80
82
|
|
|
81
|
-
export const make =
|
|
83
|
+
export const make = refInternal.Ref.make;
|
|
82
84
|
|
|
83
85
|
// TODO(dmaretskyi): Consider just allowing `make` to accept DXN.
|
|
84
|
-
export const fromDXN =
|
|
86
|
+
export const fromDXN = refInternal.Ref.fromDXN;
|
|
85
87
|
|
|
86
88
|
// TODO(wittjosiah): Factor out?
|
|
87
89
|
export const isRefType = (ast: SchemaAST.AST): boolean => {
|
|
88
90
|
return SchemaAST.getAnnotation<JsonSchema.JsonSchema>(ast, SchemaAST.JSONSchemaAnnotationId).pipe(
|
|
89
91
|
Option.flatMap((jsonSchema) => ('$id' in jsonSchema ? Option.some(jsonSchema) : Option.none())),
|
|
90
92
|
Option.flatMap((jsonSchema) => {
|
|
91
|
-
const { typename } =
|
|
93
|
+
const { typename } = refInternal.getSchemaReference(jsonSchema) ?? {};
|
|
92
94
|
return typename ? Option.some(true) : Option.some(false);
|
|
93
95
|
}),
|
|
94
96
|
Option.getOrElse(() => false),
|
package/src/Relation.test.ts
CHANGED
|
@@ -65,8 +65,8 @@ describe('Relation', () => {
|
|
|
65
65
|
expect(Relation.getDXN(snapshot)).toBeDefined();
|
|
66
66
|
|
|
67
67
|
// getTypename - works with both.
|
|
68
|
-
expect(Relation.getTypename(rel)).toBe('example.
|
|
69
|
-
expect(Relation.getTypename(snapshot)).toBe('example.
|
|
68
|
+
expect(Relation.getTypename(rel)).toBe('com.example.type.has-manager');
|
|
69
|
+
expect(Relation.getTypename(snapshot)).toBe('com.example.type.has-manager');
|
|
70
70
|
|
|
71
71
|
// getMeta - works with both.
|
|
72
72
|
expect(Relation.getMeta(rel)).toBeDefined();
|
package/src/Relation.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
9
|
import { raise } from '@dxos/debug';
|
|
@@ -13,6 +15,7 @@ import { assumeType } from '@dxos/util';
|
|
|
13
15
|
|
|
14
16
|
import type * as Database from './Database';
|
|
15
17
|
import * as Entity from './Entity';
|
|
18
|
+
import * as entityInternal from './internal/Entity';
|
|
16
19
|
import * as internal from './internal';
|
|
17
20
|
import * as Obj from './Obj';
|
|
18
21
|
import type * as Type from './Type';
|
|
@@ -64,7 +67,7 @@ export const Unknown: Type.Relation<Unknown, Obj.Any, Obj.Any> = Schema.Struct({
|
|
|
64
67
|
// NOTE: The EchoRelationSchema annotation is required for Ref.Ref(Relation.Unknown) to work.
|
|
65
68
|
// The typename/version/source/target only satisfy ECHO schema machinery for reference targets.
|
|
66
69
|
internal.EchoRelationSchema({
|
|
67
|
-
typename: 'dxos.
|
|
70
|
+
typename: 'org.dxos.schema.any-relation',
|
|
68
71
|
version: '0.0.0',
|
|
69
72
|
source: Obj.Unknown,
|
|
70
73
|
target: Obj.Unknown,
|
|
@@ -107,10 +110,10 @@ export interface BaseRelationJson {
|
|
|
107
110
|
export type Snapshot<T extends Unknown = Unknown> = Omit<T, Entity.KindId> &
|
|
108
111
|
BaseRelationSnapshot<Obj.Unknown, Obj.Unknown>;
|
|
109
112
|
|
|
110
|
-
export const Source: unique symbol =
|
|
113
|
+
export const Source: unique symbol = entityInternal.RelationSourceId as any;
|
|
111
114
|
export type Source = typeof Source;
|
|
112
115
|
|
|
113
|
-
export const Target: unique symbol =
|
|
116
|
+
export const Target: unique symbol = entityInternal.RelationTargetId as any;
|
|
114
117
|
export type Target = typeof Target;
|
|
115
118
|
|
|
116
119
|
/**
|
package/src/SchemaRegistry.ts
CHANGED
package/src/Tag.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
9
|
import * as internal from './internal';
|
|
@@ -13,7 +15,7 @@ export const Tag = Schema.Struct({
|
|
|
13
15
|
hue: Schema.optional(Schema.String), // TODO(burdon): Color name?
|
|
14
16
|
}).pipe(
|
|
15
17
|
Type.object({
|
|
16
|
-
typename: 'dxos.
|
|
18
|
+
typename: 'org.dxos.type.tag',
|
|
17
19
|
version: '0.1.0',
|
|
18
20
|
}),
|
|
19
21
|
internal.LabelAnnotation.set(['label']),
|
package/src/Type.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import type * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
9
|
import { type EncodedReference } from '@dxos/echo-protocol';
|
|
@@ -9,7 +11,8 @@ import { invariant } from '@dxos/invariant';
|
|
|
9
11
|
import { type DXN } from '@dxos/keys';
|
|
10
12
|
import { type ToMutable } from '@dxos/util';
|
|
11
13
|
|
|
12
|
-
import type * as
|
|
14
|
+
import type * as Entity from './Entity';
|
|
15
|
+
import * as typeInternal from './internal/Type';
|
|
13
16
|
import * as internal from './internal';
|
|
14
17
|
import type * as ObjModule from './Obj';
|
|
15
18
|
import type * as RelationModule from './Relation';
|
|
@@ -17,12 +20,12 @@ import type * as RelationModule from './Relation';
|
|
|
17
20
|
/**
|
|
18
21
|
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
19
22
|
*/
|
|
20
|
-
export const RuntimeType =
|
|
23
|
+
export const RuntimeType = typeInternal.EchoSchema;
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
24
27
|
*/
|
|
25
|
-
export type RuntimeType =
|
|
28
|
+
export type RuntimeType = typeInternal.EchoSchema;
|
|
26
29
|
|
|
27
30
|
//
|
|
28
31
|
// Internal types (not exported)
|
|
@@ -61,7 +64,7 @@ export interface Obj<T, Fields extends Schema.Struct.Fields = Schema.Struct.Fiel
|
|
|
61
64
|
EchoSchemaKind<internal.EntityKind.Object>,
|
|
62
65
|
Schema.AnnotableClass<
|
|
63
66
|
Obj<T, Fields>,
|
|
64
|
-
|
|
67
|
+
Entity.OfKind<typeof Entity.Kind.Object> & T,
|
|
65
68
|
Schema.Simplify<ObjModule.BaseObjJson & ToMutable<T>>,
|
|
66
69
|
never
|
|
67
70
|
> {
|
|
@@ -97,7 +100,7 @@ export type AnyObj = ObjectSchemaBase;
|
|
|
97
100
|
* ```ts
|
|
98
101
|
* const Person = Schema.Struct({
|
|
99
102
|
* name: Schema.String,
|
|
100
|
-
* }).pipe(Type.object({ typename: 'example.
|
|
103
|
+
* }).pipe(Type.object({ typename: 'com.example.type.person', version: '0.1.0' }));
|
|
101
104
|
* ```
|
|
102
105
|
*/
|
|
103
106
|
export const object: {
|
|
@@ -108,7 +111,7 @@ export const object: {
|
|
|
108
111
|
// PersistentType (Schema stored in database)
|
|
109
112
|
//
|
|
110
113
|
|
|
111
|
-
export const PersistentType: Obj<
|
|
114
|
+
export const PersistentType: Obj<typeInternal.PersistentSchema> = typeInternal.PersistentSchema as any;
|
|
112
115
|
|
|
113
116
|
export interface PersistentType extends Schema.Schema.Type<typeof PersistentType> {}
|
|
114
117
|
|
|
@@ -124,7 +127,7 @@ export interface Relation<T, Source, Target, Fields extends Schema.Struct.Fields
|
|
|
124
127
|
EchoSchemaKind<internal.EntityKind.Relation>,
|
|
125
128
|
Schema.AnnotableClass<
|
|
126
129
|
Relation<T, Source, Target, Fields>,
|
|
127
|
-
|
|
130
|
+
Entity.OfKind<typeof Entity.Kind.Relation> & RelationModule.Endpoints<Source, Target> & T,
|
|
128
131
|
Schema.Simplify<RelationModule.BaseRelationJson & ToMutable<T>>,
|
|
129
132
|
never
|
|
130
133
|
> {
|
|
@@ -161,7 +164,7 @@ export type AnyRelation = RelationSchemaBase;
|
|
|
161
164
|
* const WorksFor = Schema.Struct({
|
|
162
165
|
* role: Schema.String,
|
|
163
166
|
* }).pipe(Type.relation({
|
|
164
|
-
* typename: 'example.
|
|
167
|
+
* typename: 'com.example.type.works-for',
|
|
165
168
|
* version: '0.1.0',
|
|
166
169
|
* source: Person,
|
|
167
170
|
* target: Company,
|
|
@@ -211,7 +214,7 @@ export type AnyRef = Schema.Schema<internal.Ref<any>, EncodedReference>;
|
|
|
211
214
|
/**
|
|
212
215
|
* Gets the full DXN of the schema.
|
|
213
216
|
* Will include the version if it's a `type` DXN.
|
|
214
|
-
* @example "dxn:example.
|
|
217
|
+
* @example "dxn:com.example.type.person:0.1.0"
|
|
215
218
|
* @example "dxn:echo:SSSSSSSSSS:XXXXXXXXXXXXX"
|
|
216
219
|
*/
|
|
217
220
|
export const getDXN = (schema: AnyEntity): DXN | undefined => {
|
|
@@ -220,7 +223,7 @@ export const getDXN = (schema: AnyEntity): DXN | undefined => {
|
|
|
220
223
|
|
|
221
224
|
/**
|
|
222
225
|
* @param schema - Schema to get the typename from.
|
|
223
|
-
* @returns The typename of the schema. Example: `example.
|
|
226
|
+
* @returns The typename of the schema. Example: `com.example.type.person`.
|
|
224
227
|
*/
|
|
225
228
|
export const getTypename = (schema: AnyEntity): string => {
|
|
226
229
|
const typename = internal.getSchemaTypename(schema);
|
|
@@ -241,7 +244,7 @@ export const getVersion = (schema: AnyEntity): string => {
|
|
|
241
244
|
/**
|
|
242
245
|
* @returns True if the schema is mutable.
|
|
243
246
|
*/
|
|
244
|
-
export const isMutable =
|
|
247
|
+
export const isMutable = typeInternal.isMutable;
|
|
245
248
|
|
|
246
249
|
/**
|
|
247
250
|
* ECHO type metadata.
|
package/src/View.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
9
|
import { QueryAST } from '@dxos/echo-protocol';
|
|
@@ -73,8 +75,8 @@ const ViewSchema = Schema.Struct({
|
|
|
73
75
|
projection: Projection,
|
|
74
76
|
}).pipe(
|
|
75
77
|
Type.object({
|
|
76
|
-
typename: 'dxos.
|
|
77
|
-
version: '0.
|
|
78
|
+
typename: 'org.dxos.type.view',
|
|
79
|
+
version: '0.1.0',
|
|
78
80
|
}),
|
|
79
81
|
internal.SystemTypeAnnotation.set(true),
|
|
80
82
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import { describe, test } from 'vitest';
|
|
7
7
|
|
|
8
|
-
import { EchoObjectSchema } from '../
|
|
8
|
+
import { EchoObjectSchema } from '../Entity';
|
|
9
9
|
|
|
10
10
|
import { LabelAnnotation, TypenameSchema, VersionSchema, getLabelWithSchema } from './annotations';
|
|
11
11
|
|
|
@@ -20,7 +20,7 @@ type TestObject = Schema.Schema.Type<typeof TestObject>;
|
|
|
20
20
|
|
|
21
21
|
const TestEchoSchema = TestObject.pipe(
|
|
22
22
|
EchoObjectSchema({
|
|
23
|
-
typename: 'dxos.
|
|
23
|
+
typename: 'org.dxos.type.test',
|
|
24
24
|
version: '0.1.0',
|
|
25
25
|
}),
|
|
26
26
|
);
|
|
@@ -30,10 +30,10 @@ type TestEchoSchema = Schema.Schema.Type<typeof TestEchoSchema>;
|
|
|
30
30
|
describe('annotations', () => {
|
|
31
31
|
describe('Typename', () => {
|
|
32
32
|
test('should validate typename', ({ expect }) => {
|
|
33
|
-
// Valid.
|
|
34
|
-
expect(TypenameSchema.make('dxos.
|
|
35
|
-
expect(TypenameSchema.make('dxos.
|
|
36
|
-
expect(TypenameSchema.make('dxos.
|
|
33
|
+
// Valid (reverse-DNS format).
|
|
34
|
+
expect(TypenameSchema.make('org.dxos.type.foo')).to.exist;
|
|
35
|
+
expect(TypenameSchema.make('org.dxos.type.foo-bar')).to.exist;
|
|
36
|
+
expect(TypenameSchema.make('org.dxos.type.foobar')).to.exist;
|
|
37
37
|
|
|
38
38
|
// Invalid.
|
|
39
39
|
expect(() => TypenameSchema.make('dxn:dxos.org')).to.throw();
|
|
@@ -13,7 +13,8 @@ import { assertArgument, invariant } from '@dxos/invariant';
|
|
|
13
13
|
import { DXN } from '@dxos/keys';
|
|
14
14
|
import { type Primitive } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { type
|
|
16
|
+
import { type Mutable } from '../common/proxy';
|
|
17
|
+
import { type AnyProperties, EntityKind, TypeId, getSchema } from '../common/types';
|
|
17
18
|
|
|
18
19
|
import { type AnnotationHelper, createAnnotationHelper } from './util';
|
|
19
20
|
|
|
@@ -87,14 +88,14 @@ export const getTypeDXNFromSpecifier = (input: Schema.Schema.All | string): DXN
|
|
|
87
88
|
|
|
88
89
|
/**
|
|
89
90
|
* Fully qualified globally unique typename.
|
|
90
|
-
* Example: `dxos.
|
|
91
|
+
* Example: `org.dxos.type.message`
|
|
91
92
|
*/
|
|
92
93
|
// TODO(burdon): Reconcile with short DXN format.
|
|
93
|
-
// TODO(burdon): Change "
|
|
94
|
-
export const TypenameSchema = Schema.String.pipe(Schema.pattern(/^[a-
|
|
94
|
+
// TODO(burdon): Change "type" => "schema" throughout.
|
|
95
|
+
export const TypenameSchema = Schema.String.pipe(Schema.pattern(/^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*){2,}$/)).annotations(
|
|
95
96
|
{
|
|
96
|
-
description: 'Fully qualified globally unique typename',
|
|
97
|
-
example: 'dxos.
|
|
97
|
+
description: 'Fully qualified globally unique typename in lowercase reverse-DNS form.',
|
|
98
|
+
example: 'org.dxos.type.message',
|
|
98
99
|
},
|
|
99
100
|
);
|
|
100
101
|
|
|
@@ -175,7 +176,7 @@ export const getSchemaVersion = (schema: Schema.Schema.All): string | undefined
|
|
|
175
176
|
/**
|
|
176
177
|
* Gets the typename of the object without the version.
|
|
177
178
|
* Returns only the name portion, not the DXN.
|
|
178
|
-
* @example "example.
|
|
179
|
+
* @example "org.example.type.contact"
|
|
179
180
|
*
|
|
180
181
|
* @internal (use Obj.getTypename)
|
|
181
182
|
*/
|
|
@@ -207,7 +208,7 @@ export const setTypename = (obj: any, typename: DXN): void => {
|
|
|
207
208
|
/**
|
|
208
209
|
* @returns Object type as {@link DXN}.
|
|
209
210
|
* @returns undefined if the object doesn't have a type.
|
|
210
|
-
* @example `dxn:example.
|
|
211
|
+
* @example `dxn:com.example.type.person:1.0.0`
|
|
211
212
|
*
|
|
212
213
|
* @internal (use Obj.getTypeDXN)
|
|
213
214
|
*/
|
|
@@ -467,9 +468,9 @@ interface MakeAnnoationsProps<T> {
|
|
|
467
468
|
// TODO(wittjosiah): Comment.
|
|
468
469
|
export const makeUserAnnotation = <T>(props: MakeAnnoationsProps<T>): AnnotationHelper<T> => {
|
|
469
470
|
assertArgument(
|
|
470
|
-
|
|
471
|
+
/^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*){2,}$/.test(props.id),
|
|
471
472
|
'id',
|
|
472
|
-
'Annotation id must be in the FQN format (dxos.
|
|
473
|
+
'Annotation id must be in the FQN format (org.dxos.annotation.example).',
|
|
473
474
|
);
|
|
474
475
|
|
|
475
476
|
const getFromAst = (ast: SchemaAST.AST) =>
|
|
@@ -521,6 +522,50 @@ export interface IconAnnotation extends Schema.Schema.Type<typeof IconAnnotation
|
|
|
521
522
|
* Icon to render in the UI.
|
|
522
523
|
*/
|
|
523
524
|
export const IconAnnotation = makeUserAnnotation<IconAnnotation>({
|
|
524
|
-
id: 'dxos.
|
|
525
|
+
id: 'org.dxos.annotation.icon',
|
|
525
526
|
schema: IconAnnotationSchema,
|
|
526
527
|
});
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Get the label of an entity.
|
|
531
|
+
* Accepts both reactive entities and snapshots.
|
|
532
|
+
*/
|
|
533
|
+
export const getLabel = (entity: AnyProperties): string | undefined => {
|
|
534
|
+
const schema = getSchema(entity);
|
|
535
|
+
if (schema != null) {
|
|
536
|
+
return getLabelWithSchema(schema, entity);
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Set the label of an entity.
|
|
542
|
+
* Must be called within an Obj.change or Relation.change callback.
|
|
543
|
+
*/
|
|
544
|
+
export const setLabel = (entity: Mutable<AnyProperties>, label: string) => {
|
|
545
|
+
const schema = getSchema(entity);
|
|
546
|
+
if (schema != null) {
|
|
547
|
+
setLabelWithSchema(schema, entity, label);
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Get the description of an entity.
|
|
553
|
+
* Accepts both reactive entities and snapshots.
|
|
554
|
+
*/
|
|
555
|
+
export const getDescription = (entity: AnyProperties): string | undefined => {
|
|
556
|
+
const schema = getSchema(entity);
|
|
557
|
+
if (schema != null) {
|
|
558
|
+
return getDescriptionWithSchema(schema, entity);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Set the description of an entity.
|
|
564
|
+
* Must be called within an Obj.change or Relation.change callback.
|
|
565
|
+
*/
|
|
566
|
+
export const setDescription = (entity: Mutable<AnyProperties>, description: string) => {
|
|
567
|
+
const schema = getSchema(entity);
|
|
568
|
+
if (schema != null) {
|
|
569
|
+
setDescriptionWithSchema(schema, entity, description);
|
|
570
|
+
}
|
|
571
|
+
};
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import type { AnyEntity } from '../types';
|
|
5
|
+
import type { AnyEntity } from '../common/types';
|
|
7
6
|
|
|
8
|
-
import { getLabel } from './annotations';
|
|
7
|
+
import { getLabel, getTypename } from './annotations';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* String comparison helper for sorting.
|
|
@@ -9,7 +9,7 @@ import * as SchemaAST from 'effect/SchemaAST';
|
|
|
9
9
|
import { assertArgument } from '@dxos/invariant';
|
|
10
10
|
import { DXN } from '@dxos/keys';
|
|
11
11
|
|
|
12
|
-
import { EntityKind } from '../types';
|
|
12
|
+
import { EntityKind } from '../common/types';
|
|
13
13
|
|
|
14
14
|
export interface AnnotationHelper<T> {
|
|
15
15
|
/**
|
|
@@ -6,8 +6,10 @@ import { invariant } from '@dxos/invariant';
|
|
|
6
6
|
import { type DXN } from '@dxos/keys';
|
|
7
7
|
import { assumeType } from '@dxos/util';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import type { AnyEntity } from '../common/types';
|
|
10
|
+
|
|
11
|
+
import { type InternalObjectProps, ObjectDatabaseId } from './model';
|
|
12
|
+
import { getObjectDXN } from './util';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Get the DXN of an entity.
|
|
@@ -8,8 +8,8 @@ import type * as Types from 'effect/Types';
|
|
|
8
8
|
|
|
9
9
|
import { type ToMutable } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import { type TypeMeta } from '../
|
|
12
|
-
import { type AnyEntity, type EntityKind, SchemaKindId } from '../types';
|
|
11
|
+
import { type TypeMeta } from '../Annotation';
|
|
12
|
+
import { type AnyEntity, type EntityKind, SchemaKindId } from '../common/types';
|
|
13
13
|
|
|
14
14
|
// TODO(burdon): Define Schema type for `typename` and use consistently for all DXN-like properties.
|
|
15
15
|
|
|
@@ -14,58 +14,29 @@ import {
|
|
|
14
14
|
type ATTR_META,
|
|
15
15
|
type ATTR_PARENT,
|
|
16
16
|
type ATTR_TYPE,
|
|
17
|
+
ATTR_DELETED,
|
|
18
|
+
ATTR_RELATION_SOURCE,
|
|
19
|
+
ATTR_RELATION_TARGET,
|
|
20
|
+
ATTR_SELF_DXN,
|
|
17
21
|
EntityKind,
|
|
18
22
|
KindId,
|
|
19
23
|
type MetaId,
|
|
24
|
+
ObjectDatabaseId,
|
|
25
|
+
ObjectDeletedId,
|
|
20
26
|
type ObjectMeta,
|
|
27
|
+
ObjectVersionId,
|
|
21
28
|
type ParentId,
|
|
22
|
-
type SchemaId,
|
|
23
|
-
TypeId,
|
|
24
|
-
type Version,
|
|
25
|
-
} from '../types';
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
type ATTR_RELATION_SOURCE,
|
|
29
|
-
type ATTR_RELATION_TARGET,
|
|
30
29
|
RelationSourceDXNId,
|
|
31
30
|
RelationSourceId,
|
|
32
31
|
RelationTargetDXNId,
|
|
33
32
|
RelationTargetId,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Property name for self DXN when object is serialized to JSON.
|
|
42
|
-
*/
|
|
43
|
-
export const ATTR_SELF_DXN = '@dxn';
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* DXN to the object itself.
|
|
47
|
-
*/
|
|
48
|
-
export const SelfDXNId = Symbol.for('@dxos/echo/DXN');
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Property name for deleted when object is serialized to JSON.
|
|
52
|
-
*/
|
|
53
|
-
export const ATTR_DELETED = '@deleted';
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Deletion marker.
|
|
57
|
-
*/
|
|
58
|
-
export const ObjectDeletedId = Symbol.for('@dxos/echo/Deleted');
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Object version accessor symbol.
|
|
62
|
-
*/
|
|
63
|
-
export const ObjectVersionId: unique symbol = Symbol.for('@dxos/echo/Version');
|
|
33
|
+
type SchemaId,
|
|
34
|
+
SelfDXNId,
|
|
35
|
+
TypeId,
|
|
36
|
+
type Version,
|
|
37
|
+
} from '../common/types';
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
* Object database accessor symbol.
|
|
67
|
-
*/
|
|
68
|
-
export const ObjectDatabaseId = Symbol.for('@dxos/echo/Database');
|
|
39
|
+
export { ATTR_DELETED, ATTR_SELF_DXN, ObjectDatabaseId, ObjectDeletedId, ObjectVersionId, SelfDXNId };
|
|
69
40
|
|
|
70
41
|
/**
|
|
71
42
|
* Internal runtime representation of an object.
|
|
@@ -7,8 +7,8 @@ import * as SchemaAST from 'effect/SchemaAST';
|
|
|
7
7
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
|
|
10
|
-
import { type TypeAnnotation, TypeAnnotationId, type TypeMeta, makeTypeJsonSchemaAnnotation } from '../
|
|
11
|
-
import { EntityKind } from '../types';
|
|
10
|
+
import { type TypeAnnotation, TypeAnnotationId, type TypeMeta, makeTypeJsonSchemaAnnotation } from '../Annotation';
|
|
11
|
+
import { EntityKind } from '../common/types';
|
|
12
12
|
|
|
13
13
|
import { type EchoTypeSchema, makeEchoTypeSchema } from './entity';
|
|
14
14
|
|
|
@@ -17,45 +17,28 @@ import {
|
|
|
17
17
|
getSchemaTypename,
|
|
18
18
|
getTypeIdentifierAnnotation,
|
|
19
19
|
makeTypeJsonSchemaAnnotation,
|
|
20
|
-
} from '../
|
|
21
|
-
import {
|
|
20
|
+
} from '../Annotation';
|
|
21
|
+
import {
|
|
22
|
+
ATTR_RELATION_SOURCE,
|
|
23
|
+
ATTR_RELATION_TARGET,
|
|
24
|
+
EntityKind,
|
|
25
|
+
RelationSourceDXNId,
|
|
26
|
+
RelationSourceId,
|
|
27
|
+
RelationTargetDXNId,
|
|
28
|
+
RelationTargetId,
|
|
29
|
+
} from '../common/types';
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
ATTR_RELATION_SOURCE,
|
|
33
|
+
ATTR_RELATION_TARGET,
|
|
34
|
+
RelationSourceDXNId,
|
|
35
|
+
RelationSourceId,
|
|
36
|
+
RelationTargetDXNId,
|
|
37
|
+
RelationTargetId,
|
|
38
|
+
};
|
|
22
39
|
|
|
23
40
|
import { type EchoTypeSchema, makeEchoTypeSchema } from './entity';
|
|
24
41
|
|
|
25
|
-
/**
|
|
26
|
-
* Property name for relation source when object is serialized to JSON.
|
|
27
|
-
*/
|
|
28
|
-
export const ATTR_RELATION_SOURCE = '@relationSource';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Used to access relation source ref on live ECHO objects.
|
|
32
|
-
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
33
|
-
*/
|
|
34
|
-
export const RelationSourceId: unique symbol = Symbol.for('@dxos/echo/RelationSource');
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Used to access relation source ref on live ECHO objects.
|
|
38
|
-
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
39
|
-
*/
|
|
40
|
-
export const RelationSourceDXNId: unique symbol = Symbol.for('@dxos/echo/RelationSourceDXN');
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Property name for relation target when object is serialized to JSON.
|
|
44
|
-
*/
|
|
45
|
-
export const ATTR_RELATION_TARGET = '@relationTarget';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Used to access relation target ref on live ECHO objects.
|
|
49
|
-
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
50
|
-
*/
|
|
51
|
-
export const RelationTargetId: unique symbol = Symbol.for('@dxos/echo/RelationTarget');
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Used to access relation target ref on live ECHO objects.
|
|
55
|
-
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
56
|
-
*/
|
|
57
|
-
export const RelationTargetDXNId: unique symbol = Symbol.for('@dxos/echo/RelationTargetDXN');
|
|
58
|
-
|
|
59
42
|
/**
|
|
60
43
|
* Source and target props on relations.
|
|
61
44
|
*/
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { assertArgument } from '@dxos/invariant';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { type AnyEntity, VersionTypeId } from '../common/types';
|
|
8
|
+
|
|
9
|
+
import { ObjectVersionId } from './model';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Represent entity version.
|