@dxos/echo 0.8.4-main.bc674ce → 0.8.4-main.bd9b33e6c8
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/neutral/Annotation.mjs +8 -3
- package/dist/lib/neutral/Database.mjs +34 -6
- package/dist/lib/neutral/Entity.mjs +18 -10
- package/dist/lib/neutral/Err.mjs +3 -1
- package/dist/lib/neutral/Extension.mjs +18 -0
- package/dist/lib/neutral/Extension.mjs.map +7 -0
- package/dist/lib/neutral/Feed.mjs +45 -0
- package/dist/lib/neutral/Feed.mjs.map +7 -0
- package/dist/lib/neutral/Filter.mjs +17 -10
- package/dist/lib/neutral/Format.mjs +3 -3
- package/dist/lib/neutral/JsonSchema.mjs +9 -9
- package/dist/lib/neutral/Obj.mjs +35 -15
- package/dist/lib/neutral/Order.mjs +1 -1
- package/dist/lib/neutral/Query.mjs +19 -9
- package/dist/lib/neutral/Ref.mjs +9 -7
- package/dist/lib/neutral/Relation.mjs +20 -11
- package/dist/lib/neutral/SchemaRegistry.mjs +1 -1
- package/dist/lib/neutral/Tag.mjs +13 -10
- package/dist/lib/neutral/Type.mjs +13 -23
- package/dist/lib/neutral/{chunk-HMOXCO27.mjs → chunk-35O3JYTV.mjs} +8 -3
- package/dist/lib/neutral/chunk-35O3JYTV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4BT7QVIT.mjs +34 -0
- package/dist/lib/neutral/chunk-4BT7QVIT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4O4AV6CL.mjs +787 -0
- package/dist/lib/neutral/chunk-4O4AV6CL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-62DWJ6CE.mjs → chunk-B5OXLWZL.mjs} +14 -14
- package/dist/lib/neutral/chunk-B5OXLWZL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-NWUO5FKZ.mjs → chunk-B7HTUIZA.mjs} +8 -2
- package/dist/lib/neutral/chunk-B7HTUIZA.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-4L6DOFXP.mjs → chunk-BNCCGLJN.mjs} +1 -1
- package/dist/lib/neutral/{chunk-4L6DOFXP.mjs.map → chunk-BNCCGLJN.mjs.map} +1 -1
- package/dist/lib/neutral/{chunk-3ZEAZF7T.mjs → chunk-EIX4KLES.mjs} +8 -4
- package/dist/lib/neutral/chunk-EIX4KLES.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FLSFS6UB.mjs +117 -0
- package/dist/lib/neutral/chunk-FLSFS6UB.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-VR4A4WGG.mjs → chunk-FXQ52LDX.mjs} +72 -23
- package/dist/lib/neutral/chunk-FXQ52LDX.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-4TT624YA.mjs → chunk-FZO7LQO7.mjs} +2 -2
- package/dist/lib/neutral/{chunk-4TT624YA.mjs.map → chunk-FZO7LQO7.mjs.map} +1 -1
- package/dist/lib/neutral/chunk-HIMJ3MXL.mjs +283 -0
- package/dist/lib/neutral/chunk-HIMJ3MXL.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-VB5HVDCA.mjs → chunk-HITCYIP2.mjs} +47 -5
- package/dist/lib/neutral/chunk-HITCYIP2.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-SU2LVM7J.mjs → chunk-JJTRVYRD.mjs} +1596 -2730
- package/dist/lib/neutral/chunk-JJTRVYRD.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-6QPSGMEF.mjs → chunk-JX5K6AY3.mjs} +32 -8
- package/dist/lib/neutral/chunk-JX5K6AY3.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-IP2GHXWA.mjs → chunk-PRQVBGFG.mjs} +5 -5
- package/dist/lib/neutral/chunk-PRQVBGFG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-RUYH5REG.mjs +130 -0
- package/dist/lib/neutral/chunk-RUYH5REG.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-2MTHJ5UW.mjs → chunk-T74ABBRN.mjs} +134 -24
- package/dist/lib/neutral/chunk-T74ABBRN.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-XMIDBDE6.mjs → chunk-TJRQTGXR.mjs} +11 -56
- package/dist/lib/neutral/chunk-TJRQTGXR.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-RPB6V4BE.mjs → chunk-UBEZSGXY.mjs} +14 -1
- package/dist/lib/neutral/chunk-UBEZSGXY.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ROKO4RKJ.mjs → chunk-UI6MWK5W.mjs} +2 -2
- package/dist/lib/neutral/chunk-UI6MWK5W.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VF2IHN6I.mjs +396 -0
- package/dist/lib/neutral/chunk-VF2IHN6I.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-YQYMWZAD.mjs → chunk-WYOKA6AE.mjs} +4 -4
- package/dist/lib/neutral/chunk-WYOKA6AE.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-CUDIBUM4.mjs → chunk-XEBKJROJ.mjs} +104 -25
- package/dist/lib/neutral/chunk-XEBKJROJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-YS6Q3XAD.mjs +50 -0
- package/dist/lib/neutral/chunk-YS6Q3XAD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZZEIMPNC.mjs +159 -0
- package/dist/lib/neutral/chunk-ZZEIMPNC.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +42 -25
- package/dist/lib/neutral/internal/index.mjs +52 -38
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/testing/index.mjs +42 -34
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- 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 +79 -84
- package/dist/types/src/Database.d.ts.map +1 -1
- package/dist/types/src/Dataset.d.ts +19 -0
- package/dist/types/src/Dataset.d.ts.map +1 -0
- package/dist/types/src/Entity.d.ts +41 -15
- 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/Extension.d.ts +80 -0
- package/dist/types/src/Extension.d.ts.map +1 -0
- package/dist/types/src/Extension.test.d.ts +2 -0
- package/dist/types/src/Extension.test.d.ts.map +1 -0
- package/dist/types/src/Feed.d.ts +163 -0
- package/dist/types/src/Feed.d.ts.map +1 -0
- package/dist/types/src/Filter.d.ts +13 -1
- package/dist/types/src/Filter.d.ts.map +1 -1
- package/dist/types/src/Filter.test.d.ts +2 -0
- package/dist/types/src/Filter.test.d.ts.map +1 -0
- 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 +8 -3
- 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 +158 -43
- 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 +75 -28
- 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 +5 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/internal/{annotations → Annotation}/annotations.d.ts +69 -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 +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 +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 +24 -14
- package/src/Annotation.ts +31 -1
- package/src/Collection.ts +37 -0
- package/src/Database.ts +154 -173
- package/src/Dataset.ts +26 -0
- package/src/Entity.ts +73 -54
- package/src/Err.ts +22 -0
- package/src/Extension.test.ts +235 -0
- package/src/Extension.ts +122 -0
- package/src/Feed.ts +267 -0
- package/src/Filter.test.ts +90 -0
- package/src/Filter.ts +47 -4
- package/src/Format.ts +3 -3
- package/src/Hypergraph.ts +9 -4
- package/src/JsonSchema.ts +14 -4
- package/src/Obj.test.ts +69 -8
- package/src/Obj.ts +285 -140
- package/src/Order.ts +3 -1
- package/src/Query.test.ts +190 -15
- package/src/Query.ts +249 -23
- package/src/Ref.ts +64 -11
- package/src/Relation.test.ts +8 -2
- package/src/Relation.ts +165 -131
- 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 +107 -0
- package/src/hierarchy.test.ts +33 -0
- package/src/index.ts +5 -0
- package/src/internal/{annotations → Annotation}/annotations.test.ts +56 -6
- package/src/internal/{annotations → Annotation}/annotations.ts +128 -10
- 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 +31 -8
- package/src/internal/{object → Obj}/json-serializer.ts +42 -15
- package/src/internal/{object → Obj}/schema-validator.ts +1 -1
- package/src/internal/{object → Obj}/set-value.test.ts +24 -24
- 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 +58 -58
- 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/neutral/chunk-2MTHJ5UW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-3ZEAZF7T.mjs.map +0 -7
- package/dist/lib/neutral/chunk-62DWJ6CE.mjs.map +0 -7
- package/dist/lib/neutral/chunk-6QPSGMEF.mjs.map +0 -7
- package/dist/lib/neutral/chunk-CUDIBUM4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-HMOXCO27.mjs.map +0 -7
- package/dist/lib/neutral/chunk-IP2GHXWA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-KRHDMXSU.mjs +0 -132
- package/dist/lib/neutral/chunk-KRHDMXSU.mjs.map +0 -7
- package/dist/lib/neutral/chunk-NWUO5FKZ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ROKO4RKJ.mjs.map +0 -7
- package/dist/lib/neutral/chunk-RPB6V4BE.mjs.map +0 -7
- package/dist/lib/neutral/chunk-SU2LVM7J.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VB5HVDCA.mjs.map +0 -7
- package/dist/lib/neutral/chunk-VR4A4WGG.mjs.map +0 -7
- package/dist/lib/neutral/chunk-X2MPMYYN.mjs +0 -13
- package/dist/lib/neutral/chunk-X2MPMYYN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XK5OUUBY.mjs +0 -157
- package/dist/lib/neutral/chunk-XK5OUUBY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-XMIDBDE6.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YQYMWZAD.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/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/{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
|
@@ -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
|
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
PropertyMeta,
|
|
21
21
|
getTypeAnnotation,
|
|
22
22
|
getTypeIdentifierAnnotation,
|
|
23
|
-
} from '../
|
|
24
|
-
import { EchoObjectSchema } from '../
|
|
25
|
-
import { Email, FormatAnnotation, TypeFormat } from '../
|
|
26
|
-
import { JsonSchemaType, getNormalizedEchoAnnotations, getSchemaProperty, setSchemaProperty } from '../
|
|
27
|
-
import { Ref, createSchemaReference, getReferenceAst, getSchemaReference } from '../
|
|
28
|
-
import { PersistentSchema } from '../
|
|
29
|
-
import { EntityKind } from '../types';
|
|
23
|
+
} from '../Annotation';
|
|
24
|
+
import { EchoObjectSchema } from '../Entity';
|
|
25
|
+
import { Email, FormatAnnotation, TypeFormat } from '../Format';
|
|
26
|
+
import { JsonSchemaType, getNormalizedEchoAnnotations, getSchemaProperty, setSchemaProperty } from '../JsonSchema';
|
|
27
|
+
import { Ref, createSchemaReference, getReferenceAst, getSchemaReference } from '../Ref';
|
|
28
|
+
import { PersistentSchema } from '../Type';
|
|
29
|
+
import { EntityKind } from '../common/types';
|
|
30
30
|
|
|
31
31
|
import { toEffectSchema, toJsonSchema } from './json-schema';
|
|
32
32
|
|
|
@@ -36,12 +36,12 @@ describe('effect-to-json', () => {
|
|
|
36
36
|
test('type annotation', () => {
|
|
37
37
|
const Test = Schema.Struct({ name: Schema.String }).pipe(
|
|
38
38
|
Type.object({
|
|
39
|
-
typename: 'example.
|
|
39
|
+
typename: 'com.example.type.test',
|
|
40
40
|
version: '0.1.0',
|
|
41
41
|
}),
|
|
42
42
|
);
|
|
43
43
|
const jsonSchema = toJsonSchema(Test);
|
|
44
|
-
expect((jsonSchema as any).$id).toEqual('dxn:type:example.
|
|
44
|
+
expect((jsonSchema as any).$id).toEqual('dxn:type:com.example.type.test');
|
|
45
45
|
expect((jsonSchema as any).version).toEqual('0.1.0');
|
|
46
46
|
});
|
|
47
47
|
|
|
@@ -51,7 +51,7 @@ describe('effect-to-json', () => {
|
|
|
51
51
|
name: Schema.String.pipe(PropertyMeta(EXAMPLE_NAMESPACE, meta)),
|
|
52
52
|
}).pipe(
|
|
53
53
|
Type.object({
|
|
54
|
-
typename: 'example.
|
|
54
|
+
typename: 'com.example.type.test',
|
|
55
55
|
version: '0.1.0',
|
|
56
56
|
}),
|
|
57
57
|
);
|
|
@@ -64,7 +64,7 @@ describe('effect-to-json', () => {
|
|
|
64
64
|
name: Schema.String,
|
|
65
65
|
}).pipe(
|
|
66
66
|
Type.object({
|
|
67
|
-
typename: 'example.
|
|
67
|
+
typename: 'com.example.type.testNested',
|
|
68
68
|
version: '0.1.0',
|
|
69
69
|
}),
|
|
70
70
|
);
|
|
@@ -72,7 +72,7 @@ describe('effect-to-json', () => {
|
|
|
72
72
|
name: Ref(Nested),
|
|
73
73
|
}).pipe(
|
|
74
74
|
Type.object({
|
|
75
|
-
typename: 'example.
|
|
75
|
+
typename: 'com.example.type.test',
|
|
76
76
|
version: '0.1.0',
|
|
77
77
|
}),
|
|
78
78
|
);
|
|
@@ -89,7 +89,7 @@ describe('effect-to-json', () => {
|
|
|
89
89
|
name: Schema.String,
|
|
90
90
|
}).pipe(
|
|
91
91
|
Type.object({
|
|
92
|
-
typename: 'example.
|
|
92
|
+
typename: 'com.example.type.testNested',
|
|
93
93
|
version: '0.1.0',
|
|
94
94
|
}),
|
|
95
95
|
);
|
|
@@ -97,7 +97,7 @@ describe('effect-to-json', () => {
|
|
|
97
97
|
name: Ref(Nested).annotations({ [FieldLookupAnnotationId]: 'name' }),
|
|
98
98
|
}).pipe(
|
|
99
99
|
Type.object({
|
|
100
|
-
typename: 'example.
|
|
100
|
+
typename: 'com.example.type.test',
|
|
101
101
|
version: '0.1.0',
|
|
102
102
|
}),
|
|
103
103
|
);
|
|
@@ -113,7 +113,7 @@ describe('effect-to-json', () => {
|
|
|
113
113
|
name: Schema.String,
|
|
114
114
|
}).pipe(
|
|
115
115
|
Type.object({
|
|
116
|
-
typename: 'example.
|
|
116
|
+
typename: 'com.example.type.testNested',
|
|
117
117
|
version: '0.1.0',
|
|
118
118
|
}),
|
|
119
119
|
);
|
|
@@ -121,7 +121,7 @@ describe('effect-to-json', () => {
|
|
|
121
121
|
name: Schema.Array(Ref(Nested)),
|
|
122
122
|
}).pipe(
|
|
123
123
|
Type.object({
|
|
124
|
-
typename: 'example.
|
|
124
|
+
typename: 'com.example.type.test',
|
|
125
125
|
version: '0.1.0',
|
|
126
126
|
}),
|
|
127
127
|
);
|
|
@@ -135,7 +135,7 @@ describe('effect-to-json', () => {
|
|
|
135
135
|
name: Schema.String,
|
|
136
136
|
}).pipe(
|
|
137
137
|
Type.object({
|
|
138
|
-
typename: 'example.
|
|
138
|
+
typename: 'com.example.type.testNested',
|
|
139
139
|
version: '0.1.0',
|
|
140
140
|
}),
|
|
141
141
|
);
|
|
@@ -143,7 +143,7 @@ describe('effect-to-json', () => {
|
|
|
143
143
|
name: Schema.optional(Ref(Nested)),
|
|
144
144
|
}).pipe(
|
|
145
145
|
Type.object({
|
|
146
|
-
typename: 'example.
|
|
146
|
+
typename: 'com.example.type.test',
|
|
147
147
|
version: '0.1.0',
|
|
148
148
|
}),
|
|
149
149
|
);
|
|
@@ -166,7 +166,7 @@ describe('effect-to-json', () => {
|
|
|
166
166
|
}),
|
|
167
167
|
}).pipe(
|
|
168
168
|
Type.object({
|
|
169
|
-
typename: 'example.
|
|
169
|
+
typename: 'com.example.type.person',
|
|
170
170
|
version: '0.1.0',
|
|
171
171
|
}),
|
|
172
172
|
);
|
|
@@ -174,10 +174,10 @@ describe('effect-to-json', () => {
|
|
|
174
174
|
const jsonSchema = toJsonSchema(TempSchema);
|
|
175
175
|
expect(jsonSchema).to.deep.eq({
|
|
176
176
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
177
|
-
$id: 'dxn:type:example.
|
|
177
|
+
$id: 'dxn:type:com.example.type.person',
|
|
178
178
|
|
|
179
179
|
entityKind: EntityKind.Object,
|
|
180
|
-
typename: 'example.
|
|
180
|
+
typename: 'com.example.type.person',
|
|
181
181
|
version: '0.1.0',
|
|
182
182
|
|
|
183
183
|
type: 'object',
|
|
@@ -217,7 +217,7 @@ describe('effect-to-json', () => {
|
|
|
217
217
|
field: Schema.String,
|
|
218
218
|
}).pipe(
|
|
219
219
|
Type.object({
|
|
220
|
-
typename: 'example.
|
|
220
|
+
typename: 'com.example.type.organization',
|
|
221
221
|
version: '0.1.0',
|
|
222
222
|
}),
|
|
223
223
|
);
|
|
@@ -227,7 +227,7 @@ describe('effect-to-json', () => {
|
|
|
227
227
|
organization: Ref(Organization).annotations({ description: 'Contact organization' }),
|
|
228
228
|
}).pipe(
|
|
229
229
|
Type.object({
|
|
230
|
-
typename: 'example.
|
|
230
|
+
typename: 'com.example.type.person',
|
|
231
231
|
version: '0.1.0',
|
|
232
232
|
}),
|
|
233
233
|
);
|
|
@@ -237,10 +237,10 @@ describe('effect-to-json', () => {
|
|
|
237
237
|
const jsonSchema = toJsonSchema(Contact);
|
|
238
238
|
expect(jsonSchema).toEqual({
|
|
239
239
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
240
|
-
$id: 'dxn:type:example.
|
|
240
|
+
$id: 'dxn:type:com.example.type.person',
|
|
241
241
|
|
|
242
242
|
entityKind: EntityKind.Object,
|
|
243
|
-
typename: 'example.
|
|
243
|
+
typename: 'com.example.type.person',
|
|
244
244
|
version: '0.1.0',
|
|
245
245
|
|
|
246
246
|
type: 'object',
|
|
@@ -260,7 +260,7 @@ describe('effect-to-json', () => {
|
|
|
260
260
|
$ref: '/schemas/echo/ref',
|
|
261
261
|
reference: {
|
|
262
262
|
schema: {
|
|
263
|
-
$ref: 'dxn:type:example.
|
|
263
|
+
$ref: 'dxn:type:com.example.type.organization',
|
|
264
264
|
},
|
|
265
265
|
schemaVersion: '0.1.0',
|
|
266
266
|
},
|
|
@@ -279,7 +279,7 @@ describe('effect-to-json', () => {
|
|
|
279
279
|
field: Schema.String,
|
|
280
280
|
}).pipe(
|
|
281
281
|
Type.object({
|
|
282
|
-
typename: 'example.
|
|
282
|
+
typename: 'com.example.type.organization',
|
|
283
283
|
version: '0.1.0',
|
|
284
284
|
}),
|
|
285
285
|
);
|
|
@@ -289,7 +289,7 @@ describe('effect-to-json', () => {
|
|
|
289
289
|
organization: Ref(Organization).annotations({ description: 'Contact organization' }),
|
|
290
290
|
}).pipe(
|
|
291
291
|
Type.object({
|
|
292
|
-
typename: 'example.
|
|
292
|
+
typename: 'com.example.type.person',
|
|
293
293
|
version: '0.1.0',
|
|
294
294
|
}),
|
|
295
295
|
);
|
|
@@ -350,18 +350,18 @@ describe('effect-to-json', () => {
|
|
|
350
350
|
const schema = TestSchema.EmployedBy;
|
|
351
351
|
const jsonSchema = toJsonSchema(schema);
|
|
352
352
|
expect(jsonSchema).toEqual({
|
|
353
|
-
$id: 'dxn:type:example.
|
|
353
|
+
$id: 'dxn:type:com.example.type.employed-by',
|
|
354
354
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
355
355
|
entityKind: 'relation',
|
|
356
|
-
typename: 'example.
|
|
356
|
+
typename: 'com.example.type.employed-by',
|
|
357
357
|
version: '0.1.0',
|
|
358
358
|
relationSource: {
|
|
359
359
|
// TODO(dmaretskyi): Should those point to specific schema version?
|
|
360
|
-
$ref: 'dxn:type:example.
|
|
360
|
+
$ref: 'dxn:type:com.example.type.person',
|
|
361
361
|
},
|
|
362
362
|
relationTarget: {
|
|
363
363
|
// TODO(dmaretskyi): Should those point to specific schema version?
|
|
364
|
-
$ref: 'dxn:type:example.
|
|
364
|
+
$ref: 'dxn:type:com.example.type.organization',
|
|
365
365
|
},
|
|
366
366
|
type: 'object',
|
|
367
367
|
properties: {
|
|
@@ -387,7 +387,7 @@ describe('effect-to-json', () => {
|
|
|
387
387
|
name: Schema.String,
|
|
388
388
|
}).pipe(
|
|
389
389
|
EchoObjectSchema({
|
|
390
|
-
typename: 'example.
|
|
390
|
+
typename: 'com.example.type.organization',
|
|
391
391
|
version: '0.1.0',
|
|
392
392
|
}),
|
|
393
393
|
LabelAnnotation.set(['name']),
|
|
@@ -395,9 +395,9 @@ describe('effect-to-json', () => {
|
|
|
395
395
|
|
|
396
396
|
const jsonSchema = toJsonSchema(Organization);
|
|
397
397
|
expect(jsonSchema).toEqual({
|
|
398
|
-
$id: 'dxn:type:example.
|
|
398
|
+
$id: 'dxn:type:com.example.type.organization',
|
|
399
399
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
400
|
-
typename: 'example.
|
|
400
|
+
typename: 'com.example.type.organization',
|
|
401
401
|
version: '0.1.0',
|
|
402
402
|
entityKind: 'object',
|
|
403
403
|
type: 'object',
|
|
@@ -468,7 +468,7 @@ describe('effect-to-json', () => {
|
|
|
468
468
|
const expectReferenceAnnotation = (object: JsonSchemaType) => {
|
|
469
469
|
expect(object.reference).to.deep.eq({
|
|
470
470
|
schema: {
|
|
471
|
-
$ref: 'dxn:type:example.
|
|
471
|
+
$ref: 'dxn:type:com.example.type.testNested',
|
|
472
472
|
},
|
|
473
473
|
schemaVersion: '0.1.0',
|
|
474
474
|
});
|
|
@@ -497,7 +497,7 @@ describe('json-to-effect', () => {
|
|
|
497
497
|
field: Schema.String,
|
|
498
498
|
}).pipe(
|
|
499
499
|
Type.object({
|
|
500
|
-
typename: 'example.
|
|
500
|
+
typename: 'com.example.type.organization',
|
|
501
501
|
version: '0.1.0',
|
|
502
502
|
}),
|
|
503
503
|
);
|
|
@@ -518,7 +518,7 @@ describe('json-to-effect', () => {
|
|
|
518
518
|
|
|
519
519
|
const Test = (partial ? Schema.partial(Schema.Struct(fields)) : Schema.Struct(fields)).pipe(
|
|
520
520
|
Type.object({
|
|
521
|
-
typename: 'example.
|
|
521
|
+
typename: 'com.example.type.test',
|
|
522
522
|
version: '0.1.0',
|
|
523
523
|
}),
|
|
524
524
|
);
|
|
@@ -545,13 +545,13 @@ describe('json-to-effect', () => {
|
|
|
545
545
|
|
|
546
546
|
test('legacy schema with dxn:type $id gets decoded', () => {
|
|
547
547
|
const jsonSchema: JsonSchemaType = {
|
|
548
|
-
$id: 'dxn:type:example.
|
|
548
|
+
$id: 'dxn:type:com.example.type.project',
|
|
549
549
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
550
550
|
additionalProperties: false,
|
|
551
551
|
echo: {
|
|
552
552
|
type: {
|
|
553
553
|
schemaId: '01JERV1HQCQZDQ4NVCJ42QB38F',
|
|
554
|
-
typename: 'example.
|
|
554
|
+
typename: 'com.example.type.project',
|
|
555
555
|
version: '0.1.0',
|
|
556
556
|
},
|
|
557
557
|
},
|
|
@@ -577,7 +577,7 @@ describe('json-to-effect', () => {
|
|
|
577
577
|
const schema = toEffectSchema(jsonSchema);
|
|
578
578
|
expect(getTypeAnnotation(schema)).to.deep.eq({
|
|
579
579
|
kind: EntityKind.Object,
|
|
580
|
-
typename: 'example.
|
|
580
|
+
typename: 'com.example.type.project',
|
|
581
581
|
version: '0.1.0',
|
|
582
582
|
});
|
|
583
583
|
expect(getTypeIdentifierAnnotation(schema)).to.deep.eq('dxn:echo:@:01JERV1HQCQZDQ4NVCJ42QB38F');
|
|
@@ -715,7 +715,7 @@ describe('json-to-effect', () => {
|
|
|
715
715
|
"$ref": "/schemas/echo/ref",
|
|
716
716
|
"reference": {
|
|
717
717
|
"schema": {
|
|
718
|
-
"$ref": "dxn:type:example.
|
|
718
|
+
"$ref": "dxn:type:com.example.type.person",
|
|
719
719
|
},
|
|
720
720
|
"schemaVersion": "0.1.0",
|
|
721
721
|
},
|
|
@@ -736,7 +736,7 @@ describe('json-to-effect', () => {
|
|
|
736
736
|
test('object nested inside another struct', () => {
|
|
737
737
|
const Contact = Schema.Struct({
|
|
738
738
|
name: Schema.String,
|
|
739
|
-
}).pipe(EchoObjectSchema({ typename: 'example.
|
|
739
|
+
}).pipe(EchoObjectSchema({ typename: 'com.example.type.person', version: '0.1.0' }));
|
|
740
740
|
const input = Schema.Struct({
|
|
741
741
|
contact: Contact,
|
|
742
742
|
});
|
|
@@ -747,7 +747,7 @@ describe('json-to-effect', () => {
|
|
|
747
747
|
"additionalProperties": false,
|
|
748
748
|
"properties": {
|
|
749
749
|
"contact": {
|
|
750
|
-
"$id": "dxn:type:example.
|
|
750
|
+
"$id": "dxn:type:com.example.type.person",
|
|
751
751
|
"additionalProperties": false,
|
|
752
752
|
"entityKind": "object",
|
|
753
753
|
"properties": {
|
|
@@ -767,7 +767,7 @@ describe('json-to-effect', () => {
|
|
|
767
767
|
"id",
|
|
768
768
|
],
|
|
769
769
|
"type": "object",
|
|
770
|
-
"typename": "example.
|
|
770
|
+
"typename": "com.example.type.person",
|
|
771
771
|
"version": "0.1.0",
|
|
772
772
|
},
|
|
773
773
|
},
|
|
@@ -796,7 +796,7 @@ describe('reference', () => {
|
|
|
796
796
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
797
797
|
reference: {
|
|
798
798
|
schema: {
|
|
799
|
-
$ref: 'dxn:type:example.
|
|
799
|
+
$ref: 'dxn:type:com.example.type.person',
|
|
800
800
|
},
|
|
801
801
|
schemaVersion: '0.1.0',
|
|
802
802
|
},
|
|
@@ -814,7 +814,7 @@ describe('reference', () => {
|
|
|
814
814
|
$ref: '/schemas/echo/ref',
|
|
815
815
|
reference: {
|
|
816
816
|
schema: {
|
|
817
|
-
$ref: 'dxn:type:example.
|
|
817
|
+
$ref: 'dxn:type:com.example.type.person',
|
|
818
818
|
},
|
|
819
819
|
schemaVersion: '0.1.0',
|
|
820
820
|
},
|
|
@@ -835,7 +835,7 @@ describe('reference', () => {
|
|
|
835
835
|
$ref: '/schemas/echo/ref',
|
|
836
836
|
reference: {
|
|
837
837
|
schema: {
|
|
838
|
-
$ref: 'dxn:type:example.
|
|
838
|
+
$ref: 'dxn:type:com.example.type.person',
|
|
839
839
|
},
|
|
840
840
|
schemaVersion: '0.1.0',
|
|
841
841
|
},
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
TypeAnnotationId,
|
|
23
23
|
TypeIdentifierAnnotationId,
|
|
24
24
|
makeTypeJsonSchemaAnnotation,
|
|
25
|
-
} from '../
|
|
26
|
-
import { type JsonSchemaReferenceInfo, createEchoReferenceSchema } from '../
|
|
27
|
-
import { ANY_OBJECT_TYPENAME, ANY_OBJECT_VERSION, EntityKind, EntityKindSchema } from '../types';
|
|
25
|
+
} from '../Annotation';
|
|
26
|
+
import { type JsonSchemaReferenceInfo, createEchoReferenceSchema } from '../Ref';
|
|
27
|
+
import { ANY_OBJECT_TYPENAME, ANY_OBJECT_VERSION, EntityKind, EntityKindSchema } from '../common/types';
|
|
28
28
|
|
|
29
29
|
import { CustomAnnotations, DecodedAnnotations, EchoAnnotations } from './annotations';
|
|
30
30
|
import {
|
|
@@ -465,11 +465,13 @@ const jsonSchemaFieldsToAnnotations = (schema: JsonSchemaType): SchemaAST.Annota
|
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
|
|
468
|
-
|
|
468
|
+
const typeIdentifier = decodeTypeIdentifierAnnotation(schema);
|
|
469
|
+
annotations[TypeIdentifierAnnotationId] = typeIdentifier;
|
|
469
470
|
const typeAnnotation = decodeTypeAnnotation(schema);
|
|
470
471
|
if (typeAnnotation) {
|
|
471
472
|
annotations[TypeAnnotationId] = typeAnnotation;
|
|
472
473
|
annotations[SchemaAST.JSONSchemaAnnotationId] = makeTypeJsonSchemaAnnotation({
|
|
474
|
+
identifier: typeIdentifier,
|
|
473
475
|
kind: typeAnnotation.kind,
|
|
474
476
|
typename: typeAnnotation.typename,
|
|
475
477
|
version: typeAnnotation.version,
|
|
@@ -6,9 +6,9 @@ import { invariant } from '@dxos/invariant';
|
|
|
6
6
|
import { deepMapValues } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import type * as Obj from '../../Obj';
|
|
9
|
-
import { makeObject } from '../proxy';
|
|
10
|
-
import { Ref } from '../
|
|
11
|
-
import { getMeta, getSchema } from '../types';
|
|
9
|
+
import { makeObject } from '../common/proxy';
|
|
10
|
+
import { Ref } from '../Ref';
|
|
11
|
+
import { getMeta, getSchema } from '../common/types';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Clones an object or relation.
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { getTypename } from '../
|
|
8
|
-
import { type AnyProperties } from '../types';
|
|
7
|
+
import { getTypename } from '../Annotation';
|
|
8
|
+
import { type AnyProperties } from '../common/types';
|
|
9
9
|
|
|
10
10
|
// TODO(dmaretskyi): Rename to represent commonality between objects and relations (e.g. `entity`).
|
|
11
11
|
export type TypedObjectOptions = {
|
|
@@ -11,9 +11,9 @@ import { DXN } from '@dxos/keys';
|
|
|
11
11
|
|
|
12
12
|
import { Relation } from '../../index';
|
|
13
13
|
import { TestSchema } from '../../testing';
|
|
14
|
-
import { getSchemaDXN, getTypeDXN, isInstanceOf } from '../
|
|
15
|
-
import { ATTR_RELATION_SOURCE, ATTR_RELATION_TARGET } from '../
|
|
16
|
-
import { ATTR_META, ATTR_TYPE, getSchema } from '../types';
|
|
14
|
+
import { getSchemaDXN, getTypeDXN, isInstanceOf } from '../Annotation';
|
|
15
|
+
import { ATTR_RELATION_SOURCE, ATTR_RELATION_TARGET } from '../Entity';
|
|
16
|
+
import { ATTR_META, ATTR_TYPE, getSchema } from '../common/types';
|
|
17
17
|
|
|
18
18
|
import { createObject } from './create-object';
|
|
19
19
|
import { objectToJSON } from './json-serializer';
|
|
@@ -110,7 +110,7 @@ describe('create (static version)', () => {
|
|
|
110
110
|
const text = inspect(contact);
|
|
111
111
|
expect(text).toContain('Bot');
|
|
112
112
|
expect(text).toContain('bot@example.com');
|
|
113
|
-
expect(text).toContain('example.
|
|
113
|
+
expect(text).toContain('com.example.type.person');
|
|
114
114
|
expect(text).toContain('0.1.0');
|
|
115
115
|
});
|
|
116
116
|
});
|
|
@@ -8,7 +8,7 @@ import { raise } from '@dxos/debug';
|
|
|
8
8
|
import { assertArgument, failedInvariant } from '@dxos/invariant';
|
|
9
9
|
import { ObjectId } from '@dxos/keys';
|
|
10
10
|
|
|
11
|
-
import { getSchemaDXN, getTypeAnnotation, setTypename } from '../
|
|
11
|
+
import { getSchemaDXN, getTypeAnnotation, setTypename } from '../Annotation';
|
|
12
12
|
import {
|
|
13
13
|
RelationSourceDXNId,
|
|
14
14
|
RelationSourceId,
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
RelationTargetId,
|
|
17
17
|
assertObjectModel,
|
|
18
18
|
getObjectDXN,
|
|
19
|
-
} from '../
|
|
20
|
-
import { defineHiddenProperty } from '../proxy';
|
|
21
|
-
import { EntityKind, KindId, MetaId, setSchema } from '../types';
|
|
19
|
+
} from '../Entity';
|
|
20
|
+
import { defineHiddenProperty } from '../common/proxy';
|
|
21
|
+
import { EntityKind, KindId, MetaId, setSchema } from '../common/types';
|
|
22
22
|
|
|
23
23
|
import { attachedTypedObjectInspector } from './inspect';
|
|
24
24
|
import { attachTypedJsonSerializer } from './json-serializer';
|
|
@@ -42,7 +42,7 @@ export type CreateObjectProps<T> = T extends { id: string } ? Omit<T, 'id' | Kin
|
|
|
42
42
|
* name: Schema.String,
|
|
43
43
|
* email: Schema.String,
|
|
44
44
|
* }).pipe(Type.object({
|
|
45
|
-
* typename: 'example.
|
|
45
|
+
* typename: 'com.example.type.person',
|
|
46
46
|
* version: '0.1.0',
|
|
47
47
|
* }))
|
|
48
48
|
*
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ObjectDeletedId } from '../
|
|
6
|
-
import { type AnyProperties } from '../types';
|
|
5
|
+
import { ObjectDeletedId } from '../Entity';
|
|
6
|
+
import { type AnyProperties } from '../common/types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @returns `true` if the object has been marked as deleted.
|
|
@@ -6,8 +6,8 @@ import type { InspectOptionsStylized, inspect as inspectFn } from 'node:util';
|
|
|
6
6
|
|
|
7
7
|
import { type CustomInspectFunction, inspectCustom } from '@dxos/debug';
|
|
8
8
|
|
|
9
|
-
import { getTypeDXN } from '../
|
|
10
|
-
import { ATTR_META, ATTR_TYPE, type AnyEntity, MetaId } from '../types';
|
|
9
|
+
import { getTypeDXN } from '../Annotation';
|
|
10
|
+
import { ATTR_META, ATTR_TYPE, type AnyEntity, MetaId } from '../common/types';
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* @internal
|
|
@@ -8,12 +8,12 @@ import { DXN } from '@dxos/keys';
|
|
|
8
8
|
|
|
9
9
|
import * as Obj from '../../Obj';
|
|
10
10
|
import { TestSchema } from '../../testing';
|
|
11
|
-
import { getSchemaDXN, getSchemaTypename, getTypeDXN, getTypename } from '../
|
|
12
|
-
import { getMetaChecked } from '../api';
|
|
13
|
-
import { RelationSourceId, RelationTargetId, getObjectDXN } from '../
|
|
14
|
-
import { makeObject } from '../proxy';
|
|
15
|
-
import { Ref, StaticRefResolver } from '../
|
|
16
|
-
import { ATTR_TYPE, EntityKind, KindId, MetaId, TypeId, getSchema } from '../types';
|
|
11
|
+
import { getSchemaDXN, getSchemaTypename, getTypeDXN, getTypename } from '../Annotation';
|
|
12
|
+
import { getMetaChecked } from '../common/api';
|
|
13
|
+
import { RelationSourceId, RelationTargetId, getObjectDXN } from '../Entity';
|
|
14
|
+
import { makeObject } from '../common/proxy';
|
|
15
|
+
import { Ref, StaticRefResolver } from '../Ref';
|
|
16
|
+
import { ATTR_TYPE, EntityKind, KindId, MetaId, TypeId, getSchema } from '../common/types';
|
|
17
17
|
|
|
18
18
|
import { createObject } from './create-object';
|
|
19
19
|
import { objectFromJSON, objectToJSON } from './json-serializer';
|
|
@@ -21,8 +21,8 @@ import { objectFromJSON, objectToJSON } from './json-serializer';
|
|
|
21
21
|
describe('Object JSON serializer', () => {
|
|
22
22
|
test('should serialize and deserialize object', async () => {
|
|
23
23
|
const contact = makeObject(TestSchema.Person, { name: 'Alice' });
|
|
24
|
-
Obj.change(contact, (
|
|
25
|
-
getMetaChecked(
|
|
24
|
+
Obj.change(contact, (obj) => {
|
|
25
|
+
getMetaChecked(obj).keys.push({ id: '12345', source: 'example.com' });
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const task = createObject(TestSchema.Task, {
|
|
@@ -95,4 +95,27 @@ describe('Object JSON serializer', () => {
|
|
|
95
95
|
expect(getObjectDXN(contactFromJson)).toEqual(getObjectDXN(contact));
|
|
96
96
|
expect(getTypeDXN(contactFromJson)).toEqual(getSchemaDXN(TestSchema.Person));
|
|
97
97
|
});
|
|
98
|
+
|
|
99
|
+
test('deserializes expando without leaking internal json keys', async () => {
|
|
100
|
+
const expando = Obj.make(TestSchema.Expando, { message: 'local-only' });
|
|
101
|
+
const expandoJson = objectToJSON(expando);
|
|
102
|
+
|
|
103
|
+
const refResolver = new StaticRefResolver().addSchema(TestSchema.Expando);
|
|
104
|
+
const expandoFromJson = (await objectFromJSON(expandoJson, { refResolver })) as TestSchema.Expando;
|
|
105
|
+
|
|
106
|
+
expect(expandoFromJson.id).toBe(expando.id);
|
|
107
|
+
expect(expandoFromJson.message).toBe('local-only');
|
|
108
|
+
expect((expandoFromJson as any)[ATTR_TYPE]).toBeUndefined();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('deserializes expando without schema resolver and without leaking internal json keys', async () => {
|
|
112
|
+
const expando = Obj.make(TestSchema.Expando, { message: 'local-only' });
|
|
113
|
+
const expandoJson = objectToJSON(expando);
|
|
114
|
+
|
|
115
|
+
const expandoFromJson = (await objectFromJSON(expandoJson)) as TestSchema.Expando;
|
|
116
|
+
|
|
117
|
+
expect(expandoFromJson.id).toBe(expando.id);
|
|
118
|
+
expect(expandoFromJson.message).toBe('local-only');
|
|
119
|
+
expect((expandoFromJson as any)[ATTR_TYPE]).toBeUndefined();
|
|
120
|
+
});
|
|
98
121
|
});
|