@dxos/echo 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/lib/{browser → neutral}/Annotation.mjs +9 -5
- package/dist/lib/neutral/Database.mjs +45 -0
- package/dist/lib/{browser → neutral}/Entity.mjs +19 -12
- package/dist/lib/{browser → neutral}/Err.mjs +4 -3
- package/dist/lib/neutral/Feed.mjs +46 -0
- package/dist/lib/{node-esm → neutral}/Filter.mjs +12 -10
- package/dist/lib/{browser → neutral}/Format.mjs +4 -5
- package/dist/lib/neutral/JsonSchema.mjs +19 -0
- package/dist/lib/{browser → neutral}/Key.mjs +2 -3
- package/dist/lib/{browser → neutral}/Obj.mjs +36 -17
- package/dist/lib/{browser → neutral}/Order.mjs +2 -3
- package/dist/lib/neutral/Query.mjs +35 -0
- package/dist/lib/neutral/QueryResult.mjs +2 -0
- package/dist/lib/neutral/Ref.mjs +24 -0
- package/dist/lib/{browser → neutral}/Relation.mjs +21 -13
- package/dist/lib/neutral/SchemaRegistry.mjs +2 -0
- package/dist/lib/neutral/Tag.mjs +28 -0
- package/dist/lib/neutral/Type.mjs +37 -0
- package/dist/lib/{browser/chunk-AFGYYVVQ.mjs → neutral/chunk-2FK7XCDV.mjs} +6 -7
- package/dist/lib/neutral/chunk-2FK7XCDV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2Z72D23W.mjs +787 -0
- package/dist/lib/neutral/chunk-2Z72D23W.mjs.map +7 -0
- package/dist/lib/neutral/chunk-35FDO7WH.mjs +396 -0
- package/dist/lib/neutral/chunk-35FDO7WH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4HWWKURH.mjs +34 -0
- package/dist/lib/neutral/chunk-4HWWKURH.mjs.map +7 -0
- package/dist/lib/{browser/chunk-73M2G455.mjs → neutral/chunk-7VLKWC6T.mjs} +33 -10
- package/dist/lib/neutral/chunk-7VLKWC6T.mjs.map +7 -0
- package/dist/lib/{browser/chunk-INHXFXY5.mjs → neutral/chunk-ANHVGJI4.mjs} +2 -3
- package/dist/lib/{node-esm/chunk-AJEMYSIR.mjs.map → neutral/chunk-ANHVGJI4.mjs.map} +1 -1
- package/dist/lib/{browser/chunk-R3S54KRI.mjs → neutral/chunk-B5OXLWZL.mjs} +14 -15
- package/dist/lib/neutral/chunk-B5OXLWZL.mjs.map +7 -0
- package/dist/lib/{browser/chunk-TPIL3G6Y.mjs → neutral/chunk-BESZGRPL.mjs} +17 -6
- package/dist/lib/neutral/chunk-BESZGRPL.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ZHXZGIXD.mjs → neutral/chunk-BNCCGLJN.mjs} +1 -3
- package/dist/lib/{browser/chunk-ZHXZGIXD.mjs.map → neutral/chunk-BNCCGLJN.mjs.map} +2 -2
- package/dist/lib/{browser/chunk-QIWDIPLR.mjs → neutral/chunk-EK7UOJ3R.mjs} +9 -5
- package/dist/lib/neutral/chunk-EK7UOJ3R.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ETOQXZHC.mjs +130 -0
- package/dist/lib/neutral/chunk-ETOQXZHC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EV3A23AS.mjs +283 -0
- package/dist/lib/neutral/chunk-EV3A23AS.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-OZEDKT4R.mjs → neutral/chunk-FUGL645K.mjs} +135 -26
- package/dist/lib/neutral/chunk-FUGL645K.mjs.map +7 -0
- package/dist/lib/{browser/chunk-5RDNDPMX.mjs → neutral/chunk-FZO7LQO7.mjs} +3 -4
- package/dist/lib/neutral/chunk-FZO7LQO7.mjs.map +7 -0
- package/dist/lib/{browser/chunk-CGS2ULMK.mjs → neutral/chunk-J5LGTIGS.mjs} +1 -2
- package/dist/lib/neutral/chunk-LDHKQDXR.mjs +27 -0
- package/dist/lib/neutral/chunk-LDHKQDXR.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-5U5F4AWK.mjs → neutral/chunk-MFJPOZDU.mjs} +1579 -2717
- package/dist/lib/neutral/chunk-MFJPOZDU.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-NBWL7UCZ.mjs → neutral/chunk-OENWMTE6.mjs} +9 -4
- package/dist/lib/neutral/chunk-OENWMTE6.mjs.map +7 -0
- package/dist/lib/{browser/chunk-IXVWLTG7.mjs → neutral/chunk-OMUPQMLR.mjs} +1 -3
- package/dist/lib/{node-esm/chunk-UKGVOINP.mjs.map → neutral/chunk-OMUPQMLR.mjs.map} +1 -1
- package/dist/lib/{browser/chunk-2RMVRVOB.mjs → neutral/chunk-PH5RST5U.mjs} +73 -25
- package/dist/lib/neutral/chunk-PH5RST5U.mjs.map +7 -0
- package/dist/lib/neutral/chunk-PKD2L7XO.mjs +152 -0
- package/dist/lib/neutral/chunk-PKD2L7XO.mjs.map +7 -0
- package/dist/lib/{browser/chunk-L4RXUJHJ.mjs → neutral/chunk-QLALBCSA.mjs} +12 -58
- package/dist/lib/neutral/chunk-QLALBCSA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QTUBE4DR.mjs +102 -0
- package/dist/lib/neutral/chunk-QTUBE4DR.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-YOLH5KS4.mjs → neutral/chunk-SEMVAGBM.mjs} +97 -25
- package/dist/lib/neutral/chunk-SEMVAGBM.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-YQ2NWGL5.mjs → neutral/chunk-UBEZSGXY.mjs} +15 -3
- package/dist/lib/neutral/chunk-UBEZSGXY.mjs.map +7 -0
- package/dist/lib/{browser/chunk-JMKVF2YQ.mjs → neutral/chunk-UI6MWK5W.mjs} +3 -4
- package/dist/lib/neutral/chunk-UI6MWK5W.mjs.map +7 -0
- package/dist/lib/{browser/chunk-YKTSSMDS.mjs → neutral/chunk-WYOKA6AE.mjs} +4 -6
- package/dist/lib/neutral/chunk-WYOKA6AE.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +97 -0
- package/dist/lib/{node-esm → neutral}/internal/index.mjs +53 -40
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{node-esm → neutral}/testing/index.mjs +43 -37
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/types/src/Annotation.d.ts +23 -1
- package/dist/types/src/Annotation.d.ts.map +1 -1
- package/dist/types/src/Collection.d.ts +16 -0
- package/dist/types/src/Collection.d.ts.map +1 -0
- package/dist/types/src/Database.d.ts +78 -83
- package/dist/types/src/Database.d.ts.map +1 -1
- package/dist/types/src/Dataset.d.ts +18 -0
- package/dist/types/src/Dataset.d.ts.map +1 -0
- package/dist/types/src/Entity.d.ts +38 -12
- package/dist/types/src/Entity.d.ts.map +1 -1
- package/dist/types/src/Err.d.ts +43 -0
- package/dist/types/src/Err.d.ts.map +1 -1
- package/dist/types/src/Feed.d.ts +165 -0
- package/dist/types/src/Feed.d.ts.map +1 -0
- package/dist/types/src/Filter.d.ts +1 -1
- package/dist/types/src/Filter.d.ts.map +1 -1
- package/dist/types/src/Format.d.ts +3 -3
- package/dist/types/src/Format.d.ts.map +1 -1
- package/dist/types/src/Hypergraph.d.ts +2 -2
- package/dist/types/src/Hypergraph.d.ts.map +1 -1
- package/dist/types/src/JsonSchema.d.ts +11 -4
- package/dist/types/src/JsonSchema.d.ts.map +1 -1
- package/dist/types/src/Obj.d.ts +149 -36
- 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 +101 -14
- package/dist/types/src/Query.d.ts.map +1 -1
- package/dist/types/src/Ref.d.ts +58 -10
- package/dist/types/src/Ref.d.ts.map +1 -1
- package/dist/types/src/Relation.d.ts +73 -26
- package/dist/types/src/Relation.d.ts.map +1 -1
- package/dist/types/src/SchemaRegistry.d.ts +4 -4
- package/dist/types/src/SchemaRegistry.d.ts.map +1 -1
- package/dist/types/src/Tag.d.ts +4 -3
- package/dist/types/src/Tag.d.ts.map +1 -1
- package/dist/types/src/Type.d.ts +51 -180
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/View.d.ts +68 -0
- package/dist/types/src/View.d.ts.map +1 -0
- package/dist/types/src/hierarchy.test.d.ts +2 -0
- package/dist/types/src/hierarchy.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/internal/{annotations → Annotation}/annotations.d.ts +68 -8
- 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 +13 -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 +3 -3
- 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 +4 -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 +19 -19
- 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 +4 -4
- 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 +4 -4
- 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 +16 -3
- package/dist/types/src/internal/Ref/ref.d.ts.map +1 -0
- 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 +8 -7
- 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/{proxy → common/proxy}/typed-handler.d.ts +2 -1
- 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/{types → common/types}/base.d.ts +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 +2 -2
- 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 +2 -1
- 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/{types → common/types}/typename.d.ts +8 -0
- package/dist/types/src/internal/common/types/typename.d.ts.map +1 -0
- package/dist/types/src/internal/{types → common/types}/version.d.ts +2 -2
- 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 +19 -18
- package/dist/types/src/testing/test-schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -113
- package/src/Annotation.ts +31 -1
- package/src/Collection.ts +32 -0
- package/src/Database.ts +153 -172
- package/src/Dataset.ts +26 -0
- package/src/Entity.ts +71 -51
- package/src/Err.ts +22 -0
- package/src/Feed.ts +257 -0
- package/src/Filter.ts +19 -4
- package/src/Format.ts +3 -3
- package/src/Hypergraph.ts +2 -2
- package/src/JsonSchema.ts +14 -4
- package/src/Obj.test.ts +63 -2
- package/src/Obj.ts +274 -132
- package/src/Order.ts +3 -1
- package/src/Query.test.ts +181 -14
- package/src/Query.ts +249 -23
- package/src/Ref.ts +64 -11
- package/src/Relation.test.ts +8 -2
- package/src/Relation.ts +163 -129
- package/src/SchemaRegistry.ts +5 -4
- package/src/Tag.ts +6 -5
- package/src/Type.test.ts +10 -10
- package/src/Type.ts +70 -303
- package/src/View.ts +102 -0
- package/src/hierarchy.test.ts +33 -0
- package/src/index.ts +4 -0
- package/src/internal/{annotations → Annotation}/annotations.test.ts +6 -6
- package/src/internal/{annotations → Annotation}/annotations.ts +120 -9
- 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 +14 -1
- package/src/internal/{api/entity.ts → Entity/api.ts} +4 -2
- package/src/internal/{entities → Entity}/entity.ts +6 -4
- package/src/internal/{entities → Entity}/index.ts +2 -0
- package/src/internal/{entities → Entity}/model.ts +17 -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 +3 -3
- 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 +6 -4
- 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 +29 -6
- package/src/internal/{object → Obj}/json-serializer.ts +30 -14
- package/src/internal/{object → Obj}/schema-validator.ts +1 -1
- package/src/internal/{object → Obj}/set-value.ts +2 -2
- package/src/internal/Obj/snapshot.ts +105 -0
- package/src/internal/{object → Obj}/typed-object.test.ts +3 -3
- package/src/internal/{object → Obj}/typed-object.ts +4 -4
- 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 +27 -4
- 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 +11 -10
- package/src/internal/{schema → Type}/manipulation.ts +1 -1
- package/src/internal/{schema → Type}/persistent-schema.ts +10 -4
- package/src/internal/{README.md → common/README.md} +1 -1
- 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 +13 -3
- 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 +10 -3
- package/src/internal/{proxy → common/proxy}/typed-object.test.ts +4 -4
- package/src/internal/{types → common/types}/base.ts +1 -1
- package/src/internal/{types → common/types}/entity.ts +2 -2
- package/src/internal/{types → common/types}/index.ts +1 -0
- package/src/internal/{types → common/types}/meta.ts +4 -1
- package/src/internal/common/types/model-symbols.ts +69 -0
- package/src/internal/{types → common/types}/typename.ts +10 -0
- package/src/internal/{types → common/types}/version.ts +2 -3
- package/src/internal/index.ts +8 -31
- package/src/testing/api.test.ts +4 -4
- package/src/testing/test-schema.ts +20 -18
- package/dist/lib/browser/Database.mjs +0 -18
- package/dist/lib/browser/Filter.mjs +0 -62
- package/dist/lib/browser/JsonSchema.mjs +0 -20
- package/dist/lib/browser/Query.mjs +0 -27
- package/dist/lib/browser/QueryResult.mjs +0 -3
- package/dist/lib/browser/Ref.mjs +0 -23
- package/dist/lib/browser/SchemaRegistry.mjs +0 -3
- package/dist/lib/browser/Tag.mjs +0 -26
- package/dist/lib/browser/Type.mjs +0 -48
- package/dist/lib/browser/chunk-2RMVRVOB.mjs.map +0 -7
- package/dist/lib/browser/chunk-5RDNDPMX.mjs.map +0 -7
- package/dist/lib/browser/chunk-73M2G455.mjs.map +0 -7
- package/dist/lib/browser/chunk-7STIBCP7.mjs +0 -133
- package/dist/lib/browser/chunk-7STIBCP7.mjs.map +0 -7
- package/dist/lib/browser/chunk-AFGYYVVQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-BC6R4CAF.mjs +0 -24
- package/dist/lib/browser/chunk-BC6R4CAF.mjs.map +0 -7
- package/dist/lib/browser/chunk-BPYFLHWO.mjs +0 -158
- package/dist/lib/browser/chunk-BPYFLHWO.mjs.map +0 -7
- package/dist/lib/browser/chunk-CBPFF3ZO.mjs +0 -204
- package/dist/lib/browser/chunk-CBPFF3ZO.mjs.map +0 -7
- package/dist/lib/browser/chunk-CJ5YELTO.mjs +0 -39
- package/dist/lib/browser/chunk-CJ5YELTO.mjs.map +0 -7
- package/dist/lib/browser/chunk-FPOISFQK.mjs +0 -40
- package/dist/lib/browser/chunk-FPOISFQK.mjs.map +0 -7
- package/dist/lib/browser/chunk-INHXFXY5.mjs.map +0 -7
- package/dist/lib/browser/chunk-IXVWLTG7.mjs.map +0 -7
- package/dist/lib/browser/chunk-JMKVF2YQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L4RXUJHJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-MYCCGG2T.mjs +0 -15
- package/dist/lib/browser/chunk-MYCCGG2T.mjs.map +0 -7
- package/dist/lib/browser/chunk-PAM4KEXE.mjs +0 -3847
- package/dist/lib/browser/chunk-PAM4KEXE.mjs.map +0 -7
- package/dist/lib/browser/chunk-QIWDIPLR.mjs.map +0 -7
- package/dist/lib/browser/chunk-R3S54KRI.mjs.map +0 -7
- package/dist/lib/browser/chunk-RK4Z4JUZ.mjs +0 -283
- package/dist/lib/browser/chunk-RK4Z4JUZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-TPIL3G6Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-YKTSSMDS.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -85
- package/dist/lib/browser/internal/index.mjs +0 -457
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -367
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/Annotation.mjs +0 -33
- package/dist/lib/node-esm/Annotation.mjs.map +0 -7
- package/dist/lib/node-esm/Database.mjs +0 -18
- package/dist/lib/node-esm/Database.mjs.map +0 -7
- package/dist/lib/node-esm/Entity.mjs +0 -52
- package/dist/lib/node-esm/Entity.mjs.map +0 -7
- package/dist/lib/node-esm/Err.mjs +0 -11
- package/dist/lib/node-esm/Err.mjs.map +0 -7
- package/dist/lib/node-esm/Format.mjs +0 -67
- package/dist/lib/node-esm/Format.mjs.map +0 -7
- package/dist/lib/node-esm/JsonSchema.mjs +0 -20
- package/dist/lib/node-esm/JsonSchema.mjs.map +0 -7
- package/dist/lib/node-esm/Key.mjs +0 -13
- package/dist/lib/node-esm/Key.mjs.map +0 -7
- package/dist/lib/node-esm/Obj.mjs +0 -91
- package/dist/lib/node-esm/Obj.mjs.map +0 -7
- package/dist/lib/node-esm/Order.mjs +0 -13
- package/dist/lib/node-esm/Order.mjs.map +0 -7
- package/dist/lib/node-esm/Query.mjs +0 -27
- package/dist/lib/node-esm/Query.mjs.map +0 -7
- package/dist/lib/node-esm/QueryResult.mjs +0 -3
- package/dist/lib/node-esm/QueryResult.mjs.map +0 -7
- package/dist/lib/node-esm/Ref.mjs +0 -23
- package/dist/lib/node-esm/Ref.mjs.map +0 -7
- package/dist/lib/node-esm/Relation.mjs +0 -85
- package/dist/lib/node-esm/Relation.mjs.map +0 -7
- package/dist/lib/node-esm/SchemaRegistry.mjs +0 -3
- package/dist/lib/node-esm/SchemaRegistry.mjs.map +0 -7
- package/dist/lib/node-esm/Tag.mjs +0 -26
- package/dist/lib/node-esm/Tag.mjs.map +0 -7
- package/dist/lib/node-esm/Type.mjs +0 -48
- package/dist/lib/node-esm/Type.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2RIFBW3A.mjs +0 -250
- package/dist/lib/node-esm/chunk-2RIFBW3A.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5CB2ZW74.mjs +0 -57
- package/dist/lib/node-esm/chunk-5CB2ZW74.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5U5F4AWK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AJEMYSIR.mjs +0 -22
- package/dist/lib/node-esm/chunk-BKYE5IW6.mjs +0 -158
- package/dist/lib/node-esm/chunk-BKYE5IW6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BYOD7EVP.mjs +0 -98
- package/dist/lib/node-esm/chunk-BYOD7EVP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FWTSPIFF.mjs +0 -133
- package/dist/lib/node-esm/chunk-FWTSPIFF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K37NA7PO.mjs +0 -43
- package/dist/lib/node-esm/chunk-K37NA7PO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LIXUCQJM.mjs +0 -41
- package/dist/lib/node-esm/chunk-LIXUCQJM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MOLNWFNL.mjs +0 -9
- package/dist/lib/node-esm/chunk-MOLNWFNL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MOWUEW5P.mjs +0 -15
- package/dist/lib/node-esm/chunk-MOWUEW5P.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NBWL7UCZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OZEDKT4R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PW3VCWL5.mjs +0 -24
- package/dist/lib/node-esm/chunk-PW3VCWL5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TSTKBFST.mjs +0 -403
- package/dist/lib/node-esm/chunk-TSTKBFST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UKGVOINP.mjs +0 -9
- package/dist/lib/node-esm/chunk-UV63HEHQ.mjs +0 -143
- package/dist/lib/node-esm/chunk-UV63HEHQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WXLVPCRJ.mjs +0 -288
- package/dist/lib/node-esm/chunk-WXLVPCRJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WZ6YBELW.mjs +0 -74
- package/dist/lib/node-esm/chunk-WZ6YBELW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XHJRMQZD.mjs +0 -69
- package/dist/lib/node-esm/chunk-XHJRMQZD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YOLH5KS4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YQ2NWGL5.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -85
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/internal/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.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.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/src/internal/object/snapshot.ts +0 -70
- /package/dist/lib/{browser → neutral}/Annotation.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Database.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Entity.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Err.mjs.map +0 -0
- /package/dist/lib/{browser/Filter.mjs.map → neutral/Feed.mjs.map} +0 -0
- /package/dist/lib/{node-esm → neutral}/Filter.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Format.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/JsonSchema.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Key.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Obj.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Order.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Query.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/QueryResult.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Ref.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Relation.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/SchemaRegistry.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Tag.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/Type.mjs.map +0 -0
- /package/dist/lib/{browser/chunk-CGS2ULMK.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/internal/index.mjs.map +0 -0
- /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.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/typed-object.test.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/{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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import * as Obj from './Obj';
|
|
8
|
+
import { TestSchema } from './testing';
|
|
9
|
+
|
|
10
|
+
describe('Hierarchy', () => {
|
|
11
|
+
test('setParent and getParent', async () => {
|
|
12
|
+
const parent = Obj.make(TestSchema.Organization, { name: 'parent' });
|
|
13
|
+
const child = Obj.make(TestSchema.Person, { name: 'child' });
|
|
14
|
+
expect(Obj.getParent(child)).toBeUndefined();
|
|
15
|
+
|
|
16
|
+
Obj.setParent(child, parent);
|
|
17
|
+
expect(Obj.getParent(child)).toBe(parent);
|
|
18
|
+
|
|
19
|
+
Obj.setParent(child, undefined);
|
|
20
|
+
expect(Obj.getParent(child)).toBeUndefined();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('create object with Obj.Parent in props', () => {
|
|
24
|
+
const parent = Obj.make(TestSchema.Organization, { name: 'DXOS' });
|
|
25
|
+
const child = Obj.make(TestSchema.Person, {
|
|
26
|
+
[Obj.Parent]: parent,
|
|
27
|
+
name: 'John',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
expect(child.name).toBe('John');
|
|
31
|
+
expect(Obj.getParent(child)).toBe(parent);
|
|
32
|
+
});
|
|
33
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * as Annotation from './Annotation';
|
|
|
10
10
|
export * as Database from './Database';
|
|
11
11
|
export * as Entity from './Entity';
|
|
12
12
|
export * as Err from './Err';
|
|
13
|
+
export * as Feed from './Feed';
|
|
13
14
|
export * as Filter from './Filter';
|
|
14
15
|
export * as Format from './Format';
|
|
15
16
|
export * as Hypergraph from './Hypergraph';
|
|
@@ -24,3 +25,6 @@ export * as Relation from './Relation';
|
|
|
24
25
|
export * as SchemaRegistry from './SchemaRegistry';
|
|
25
26
|
export * as Tag from './Tag';
|
|
26
27
|
export * as Type from './Type';
|
|
28
|
+
export * as Collection from './Collection';
|
|
29
|
+
export * as View from './View';
|
|
30
|
+
export * as Dataset from './Dataset';
|
|
@@ -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,9 +13,10 @@ 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
|
-
import { createAnnotationHelper } from './util';
|
|
19
|
+
import { type AnnotationHelper, createAnnotationHelper } from './util';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @internal
|
|
@@ -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
|
*/
|
|
@@ -458,3 +459,113 @@ export type GeneratorAnnotationValue =
|
|
|
458
459
|
};
|
|
459
460
|
|
|
460
461
|
export const GeneratorAnnotation = createAnnotationHelper<GeneratorAnnotationValue>(GeneratorAnnotationId);
|
|
462
|
+
|
|
463
|
+
interface MakeAnnoationsProps<T> {
|
|
464
|
+
id: string;
|
|
465
|
+
schema: Schema.Schema<T, any, never>;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// TODO(wittjosiah): Comment.
|
|
469
|
+
export const makeUserAnnotation = <T>(props: MakeAnnoationsProps<T>): AnnotationHelper<T> => {
|
|
470
|
+
assertArgument(
|
|
471
|
+
/^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*){2,}$/.test(props.id),
|
|
472
|
+
'id',
|
|
473
|
+
'Annotation id must be in the FQN format (org.dxos.annotation.example).',
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
const getFromAst = (ast: SchemaAST.AST) =>
|
|
477
|
+
SchemaAST.getAnnotation<PropertyMetaAnnotation>(PropertyMetaAnnotationId)(ast).pipe(
|
|
478
|
+
Option.map((meta) => meta[props.id] as unknown),
|
|
479
|
+
Option.map(Schema.decodeUnknownSync(props.schema)),
|
|
480
|
+
);
|
|
481
|
+
|
|
482
|
+
return {
|
|
483
|
+
get: (schema) => getFromAst(schema.ast),
|
|
484
|
+
getFromAst: (ast) => getFromAst(ast),
|
|
485
|
+
set: (value) =>
|
|
486
|
+
PropertyMeta(props.id, Schema.encodeSync(props.schema)(value)) as <S extends Schema.Schema.Any>(schema: S) => S,
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
const IconAnnotationSchema = Schema.Struct({
|
|
491
|
+
/**
|
|
492
|
+
* Phosphor icon name (e.g., 'ph--user--regular', 'ph--cube--regular', 'ph--link--regular ', etc.)
|
|
493
|
+
*/
|
|
494
|
+
icon: Schema.String.pipe(Schema.pattern(/^ph--[a-z-]+--[a-z]+$/)),
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Color name.
|
|
498
|
+
*
|
|
499
|
+
* List of colors:
|
|
500
|
+
* - 'red'
|
|
501
|
+
* - 'orange'
|
|
502
|
+
* - 'amber'
|
|
503
|
+
* - 'yellow'
|
|
504
|
+
* - 'lime'
|
|
505
|
+
* - 'green'
|
|
506
|
+
* - 'emerald'
|
|
507
|
+
* - 'teal'
|
|
508
|
+
* - 'cyan'
|
|
509
|
+
* - 'violet'
|
|
510
|
+
* - 'purple'
|
|
511
|
+
* - 'fuchsia'
|
|
512
|
+
* - 'pink'
|
|
513
|
+
* - 'rose'
|
|
514
|
+
*/
|
|
515
|
+
|
|
516
|
+
hue: Schema.optional(Schema.String),
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
export interface IconAnnotation extends Schema.Schema.Type<typeof IconAnnotationSchema> {}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Icon to render in the UI.
|
|
523
|
+
*/
|
|
524
|
+
export const IconAnnotation = makeUserAnnotation<IconAnnotation>({
|
|
525
|
+
id: 'org.dxos.annotation.icon',
|
|
526
|
+
schema: IconAnnotationSchema,
|
|
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,14 +9,27 @@ 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
|
+
/**
|
|
16
|
+
* Get the annotation value from the schema.
|
|
17
|
+
*/
|
|
15
18
|
get: (schema: Schema.Schema.Any) => Option.Option<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the annotation value from the AST.
|
|
21
|
+
*/
|
|
16
22
|
getFromAst: (ast: SchemaAST.AST) => Option.Option<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Set the annotation value on the schema.
|
|
25
|
+
*/
|
|
17
26
|
set: (value: T) => <S extends Schema.Schema.Any>(schema: S) => S;
|
|
18
27
|
}
|
|
19
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Note: only for system annotations.
|
|
31
|
+
*/
|
|
32
|
+
// TODO(dmaretskyi): Rename to createSystemAnnotationHelper.
|
|
20
33
|
export const createAnnotationHelper = <T>(id: symbol): AnnotationHelper<T> => {
|
|
21
34
|
return {
|
|
22
35
|
get: (schema) => SchemaAST.getAnnotation(schema.ast, id),
|
|
@@ -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
|
|
|
@@ -22,7 +22,9 @@ export interface EchoTypeSchema<
|
|
|
22
22
|
ExtraFields = {},
|
|
23
23
|
K extends EntityKind = EntityKind,
|
|
24
24
|
Fields extends Schema.Struct.Fields = Schema.Struct.Fields,
|
|
25
|
-
>
|
|
25
|
+
>
|
|
26
|
+
extends
|
|
27
|
+
TypeMeta,
|
|
26
28
|
Schema.AnnotableClass<
|
|
27
29
|
EchoTypeSchema<Self, ExtraFields, K, Fields>,
|
|
28
30
|
EchoTypeSchemaProps<Schema.Schema.Type<Self>, ExtraFields>,
|
|
@@ -31,7 +33,7 @@ export interface EchoTypeSchema<
|
|
|
31
33
|
> {
|
|
32
34
|
/**
|
|
33
35
|
* Schema kind key that marks this as an ECHO schema and indicates its kind.
|
|
34
|
-
* Makes EchoTypeSchema satisfy the Type.
|
|
36
|
+
* Makes EchoTypeSchema satisfy the Type.AnyObj or Type.Relation.Any type.
|
|
35
37
|
*/
|
|
36
38
|
readonly [SchemaKindId]: K;
|
|
37
39
|
|
|
@@ -12,58 +12,31 @@ import { assumeType } from '@dxos/util';
|
|
|
12
12
|
import type * as Database from '../../Database';
|
|
13
13
|
import {
|
|
14
14
|
type ATTR_META,
|
|
15
|
+
type ATTR_PARENT,
|
|
15
16
|
type ATTR_TYPE,
|
|
17
|
+
ATTR_DELETED,
|
|
18
|
+
ATTR_RELATION_SOURCE,
|
|
19
|
+
ATTR_RELATION_TARGET,
|
|
20
|
+
ATTR_SELF_DXN,
|
|
16
21
|
EntityKind,
|
|
17
22
|
KindId,
|
|
18
23
|
type MetaId,
|
|
24
|
+
ObjectDatabaseId,
|
|
25
|
+
ObjectDeletedId,
|
|
19
26
|
type ObjectMeta,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type Version,
|
|
23
|
-
} from '../types';
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
type ATTR_RELATION_SOURCE,
|
|
27
|
-
type ATTR_RELATION_TARGET,
|
|
27
|
+
ObjectVersionId,
|
|
28
|
+
type ParentId,
|
|
28
29
|
RelationSourceDXNId,
|
|
29
30
|
RelationSourceId,
|
|
30
31
|
RelationTargetDXNId,
|
|
31
32
|
RelationTargetId,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Property name for self DXN when object is serialized to JSON.
|
|
40
|
-
*/
|
|
41
|
-
export const ATTR_SELF_DXN = '@dxn';
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* DXN to the object itself.
|
|
45
|
-
*/
|
|
46
|
-
export const SelfDXNId = Symbol.for('@dxos/echo/DXN');
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Property name for deleted when object is serialized to JSON.
|
|
50
|
-
*/
|
|
51
|
-
export const ATTR_DELETED = '@deleted';
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Deletion marker.
|
|
55
|
-
*/
|
|
56
|
-
export const ObjectDeletedId = Symbol.for('@dxos/echo/Deleted');
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Object version accessor symbol.
|
|
60
|
-
*/
|
|
61
|
-
export const ObjectVersionId: unique symbol = Symbol.for('@dxos/echo/Version');
|
|
33
|
+
type SchemaId,
|
|
34
|
+
SelfDXNId,
|
|
35
|
+
TypeId,
|
|
36
|
+
type Version,
|
|
37
|
+
} from '../common/types';
|
|
62
38
|
|
|
63
|
-
|
|
64
|
-
* Object database accessor symbol.
|
|
65
|
-
*/
|
|
66
|
-
export const ObjectDatabaseId = Symbol.for('@dxos/echo/Database');
|
|
39
|
+
export { ATTR_DELETED, ATTR_SELF_DXN, ObjectDatabaseId, ObjectDeletedId, ObjectVersionId, SelfDXNId };
|
|
67
40
|
|
|
68
41
|
/**
|
|
69
42
|
* Internal runtime representation of an object.
|
|
@@ -77,6 +50,7 @@ export interface InternalObjectProps {
|
|
|
77
50
|
readonly [SchemaId]: Schema.Schema.AnyNoContext;
|
|
78
51
|
readonly [TypeId]: DXN;
|
|
79
52
|
readonly [MetaId]?: ObjectMeta;
|
|
53
|
+
[ParentId]?: InternalObjectProps;
|
|
80
54
|
readonly [ObjectDatabaseId]?: Database.Database;
|
|
81
55
|
readonly [ObjectDeletedId]?: boolean;
|
|
82
56
|
readonly [ObjectVersionId]?: Version;
|
|
@@ -101,6 +75,7 @@ export interface ObjectJSON {
|
|
|
101
75
|
id: string;
|
|
102
76
|
[ATTR_TYPE]: DXN.String;
|
|
103
77
|
[ATTR_SELF_DXN]?: DXN.String;
|
|
78
|
+
[ATTR_PARENT]?: string; // Encoded reference
|
|
104
79
|
[ATTR_DELETED]?: boolean;
|
|
105
80
|
[ATTR_META]?: ObjectMetaJSON;
|
|
106
81
|
[ATTR_RELATION_SOURCE]?: DXN.String;
|
|
@@ -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.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import { describe, test } from 'vitest';
|
|
7
7
|
|
|
8
|
-
import { toJsonSchema } from '../
|
|
8
|
+
import { toJsonSchema } from '../JsonSchema';
|
|
9
9
|
|
|
10
10
|
import { Format } from './format';
|
|
11
11
|
import { TypeEnum, TypeFormat, getTypeEnum } from './types';
|
|
@@ -7,8 +7,8 @@ import type * as JSONSchema from 'effect/JSONSchema';
|
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
8
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
9
9
|
|
|
10
|
-
import { createAnnotationHelper } from '../
|
|
11
|
-
import { type JsonSchemaType } from '../
|
|
10
|
+
import { createAnnotationHelper } from '../Annotation';
|
|
11
|
+
import { type JsonSchemaType } from '../JsonSchema';
|
|
12
12
|
|
|
13
13
|
// TODO(burdon): Rename PropertyType.
|
|
14
14
|
export type ScalarType =
|
|
@@ -135,7 +135,7 @@ export const typeToFormat: Partial<Record<TypeEnum, TypeFormat>> = {
|
|
|
135
135
|
* Map of format to type.
|
|
136
136
|
*/
|
|
137
137
|
export const formatToType: Record<TypeFormat, TypeEnum> = {
|
|
138
|
-
[TypeFormat.None]:
|
|
138
|
+
[TypeFormat.None]: TypeEnum.String,
|
|
139
139
|
[TypeFormat.String]: TypeEnum.String,
|
|
140
140
|
[TypeFormat.Number]: TypeEnum.Number,
|
|
141
141
|
[TypeFormat.Boolean]: TypeEnum.Boolean,
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
6
6
|
|
|
7
|
-
import { GeneratorAnnotationId, LabelAnnotationId, PropertyMetaAnnotationId } from '../
|
|
8
|
-
import { CurrencyAnnotationId, FormatAnnotationId } from '../
|
|
9
|
-
import { type JsonSchemaEchoAnnotations, type JsonSchemaType } from '../
|
|
7
|
+
import { GeneratorAnnotationId, LabelAnnotationId, PropertyMetaAnnotationId } from '../Annotation';
|
|
8
|
+
import { CurrencyAnnotationId, FormatAnnotationId } from '../Format';
|
|
9
|
+
import { type JsonSchemaEchoAnnotations, type JsonSchemaType } from '../JsonSchema';
|
|
10
10
|
|
|
11
11
|
//
|
|
12
12
|
// This file configures annotations for JSON encoding/decoding.
|
|
@@ -6,9 +6,9 @@ import * as Schema from 'effect/Schema';
|
|
|
6
6
|
|
|
7
7
|
import { JsonPath, type JsonProp } from '@dxos/effect';
|
|
8
8
|
|
|
9
|
-
import { FormatAnnotation, TypeFormat } from '../
|
|
10
|
-
import { type Mutable } from '../proxy';
|
|
11
|
-
import { EntityKindSchema } from '../types';
|
|
9
|
+
import { FormatAnnotation, TypeFormat } from '../Format';
|
|
10
|
+
import { type Mutable } from '../common/proxy';
|
|
11
|
+
import { EntityKindSchema } from '../common/types';
|
|
12
12
|
|
|
13
13
|
//
|
|
14
14
|
// JSON Schema
|
|
@@ -119,7 +119,7 @@ const _JsonSchemaType = Schema.Struct({
|
|
|
119
119
|
* Typename of this schema.
|
|
120
120
|
* Only on schema representing an ECHO object.
|
|
121
121
|
*
|
|
122
|
-
* @example 'example.
|
|
122
|
+
* @example 'com.example.type.my-type'
|
|
123
123
|
*/
|
|
124
124
|
typename: Schema.optional(Schema.String),
|
|
125
125
|
|