@dxos/echo 0.8.4-main.ead640a → 0.8.4-main.effb148878
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/README.md +10 -11
- package/dist/lib/neutral/Annotation.mjs +39 -0
- package/dist/lib/neutral/Database.mjs +49 -0
- package/dist/lib/neutral/Entity.mjs +68 -0
- package/dist/lib/neutral/Err.mjs +12 -0
- package/dist/lib/neutral/Extension.mjs +18 -0
- package/dist/lib/neutral/Feed.mjs +54 -0
- package/dist/lib/neutral/Filter.mjs +74 -0
- package/dist/lib/neutral/Filter.mjs.map +7 -0
- package/dist/lib/neutral/Format.mjs +86 -0
- package/dist/lib/neutral/Format.mjs.map +7 -0
- package/dist/lib/neutral/JsonSchema.mjs +19 -0
- package/dist/lib/neutral/JsonSchema.mjs.map +7 -0
- package/dist/lib/neutral/Key.mjs +16 -0
- package/dist/lib/neutral/Key.mjs.map +7 -0
- package/dist/lib/neutral/Migration.mjs +18 -0
- package/dist/lib/neutral/Migration.mjs.map +7 -0
- package/dist/lib/neutral/Obj.mjs +114 -0
- package/dist/lib/neutral/Obj.mjs.map +7 -0
- package/dist/lib/neutral/Order.mjs +12 -0
- package/dist/lib/neutral/Order.mjs.map +7 -0
- package/dist/lib/neutral/Query.mjs +38 -0
- package/dist/lib/neutral/Query.mjs.map +7 -0
- package/dist/lib/neutral/QueryResult.mjs +2 -0
- package/dist/lib/neutral/QueryResult.mjs.map +7 -0
- package/dist/lib/neutral/Ref.mjs +26 -0
- package/dist/lib/neutral/Ref.mjs.map +7 -0
- package/dist/lib/neutral/Relation.mjs +95 -0
- package/dist/lib/neutral/Relation.mjs.map +7 -0
- package/dist/lib/neutral/SchemaRegistry.mjs +2 -0
- package/dist/lib/neutral/SchemaRegistry.mjs.map +7 -0
- package/dist/lib/neutral/Tag.mjs +29 -0
- package/dist/lib/neutral/Tag.mjs.map +7 -0
- package/dist/lib/neutral/Type.mjs +63 -0
- package/dist/lib/neutral/Type.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4SYHDOQA.mjs +48 -0
- package/dist/lib/neutral/chunk-4SYHDOQA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4U7OD55H.mjs +47 -0
- package/dist/lib/neutral/chunk-4U7OD55H.mjs.map +7 -0
- package/dist/lib/neutral/chunk-52NG2XEE.mjs +34 -0
- package/dist/lib/neutral/chunk-52NG2XEE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-A5HDDVKS.mjs +94 -0
- package/dist/lib/neutral/chunk-A5HDDVKS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EZ4XJFHJ.mjs +54 -0
- package/dist/lib/neutral/chunk-EZ4XJFHJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-F625JEZB.mjs +365 -0
- package/dist/lib/neutral/chunk-F625JEZB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FFCN66OF.mjs +420 -0
- package/dist/lib/neutral/chunk-FFCN66OF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GOHDOJE3.mjs +51 -0
- package/dist/lib/neutral/chunk-GOHDOJE3.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GWFFC34K.mjs +50 -0
- package/dist/lib/neutral/chunk-GWFFC34K.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J7QWJQQV.mjs +318 -0
- package/dist/lib/neutral/chunk-J7QWJQQV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JTHNDGAR.mjs +27 -0
- package/dist/lib/neutral/chunk-JTHNDGAR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-K5RH2PBH.mjs +361 -0
- package/dist/lib/neutral/chunk-K5RH2PBH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KHRAQDYX.mjs +343 -0
- package/dist/lib/neutral/chunk-KHRAQDYX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-L65CW5EI.mjs +156 -0
- package/dist/lib/neutral/chunk-L65CW5EI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-LNZIPZX6.mjs +2186 -0
- package/dist/lib/neutral/chunk-LNZIPZX6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MPXUNTME.mjs +41 -0
- package/dist/lib/neutral/chunk-MPXUNTME.mjs.map +7 -0
- package/dist/lib/neutral/chunk-O2EOH7XQ.mjs +420 -0
- package/dist/lib/neutral/chunk-O2EOH7XQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Q7ID37KF.mjs +278 -0
- package/dist/lib/neutral/chunk-Q7ID37KF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QLYEQ5VA.mjs +205 -0
- package/dist/lib/neutral/chunk-QLYEQ5VA.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SSDGRJ3A.mjs +747 -0
- package/dist/lib/neutral/chunk-SSDGRJ3A.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TTCSATUD.mjs +42 -0
- package/dist/lib/neutral/chunk-TTCSATUD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UEFRFUYC.mjs +25 -0
- package/dist/lib/neutral/chunk-UEFRFUYC.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UN7K472Q.mjs +132 -0
- package/dist/lib/neutral/chunk-UN7K472Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UQAMAXDU.mjs +243 -0
- package/dist/lib/neutral/chunk-UQAMAXDU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-V5NE2X7Y.mjs +7 -0
- package/dist/lib/neutral/chunk-V5NE2X7Y.mjs.map +7 -0
- package/dist/lib/neutral/chunk-V72DY6LU.mjs +7 -0
- package/dist/lib/neutral/chunk-V72DY6LU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZII2BGPM.mjs +269 -0
- package/dist/lib/neutral/chunk-ZII2BGPM.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZM7VFIS2.mjs +93 -0
- package/dist/lib/neutral/chunk-ZM7VFIS2.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +111 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/internal/index.mjs +513 -0
- package/dist/lib/neutral/internal/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/testing/index.mjs +418 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/types/src/Annotation.d.ts +24 -0
- package/dist/types/src/Annotation.d.ts.map +1 -0
- package/dist/types/src/Collection.d.ts +15 -0
- package/dist/types/src/Collection.d.ts.map +1 -0
- package/dist/types/src/Database.d.ts +201 -0
- package/dist/types/src/Database.d.ts.map +1 -0
- package/dist/types/src/Dataset.d.ts +29 -0
- package/dist/types/src/Dataset.d.ts.map +1 -0
- package/dist/types/src/Entity.d.ts +236 -0
- package/dist/types/src/Entity.d.ts.map +1 -0
- package/dist/types/src/Entity.test.d.ts +2 -0
- package/dist/types/src/Entity.test.d.ts.map +1 -0
- package/dist/types/src/Err.d.ts +107 -0
- package/dist/types/src/Err.d.ts.map +1 -0
- 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 +229 -0
- package/dist/types/src/Feed.d.ts.map +1 -0
- package/dist/types/src/Filter.d.ts +183 -0
- package/dist/types/src/Filter.d.ts.map +1 -0
- 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 +4 -0
- package/dist/types/src/Format.d.ts.map +1 -0
- package/dist/types/src/Hypergraph.d.ts +65 -0
- package/dist/types/src/Hypergraph.d.ts.map +1 -0
- package/dist/types/src/Json.d.ts +33 -0
- package/dist/types/src/Json.d.ts.map +1 -0
- package/dist/types/src/Json.test.d.ts +2 -0
- package/dist/types/src/Json.test.d.ts.map +1 -0
- package/dist/types/src/JsonSchema.d.ts +16 -0
- package/dist/types/src/JsonSchema.d.ts.map +1 -0
- package/dist/types/src/Key.d.ts +2 -1
- package/dist/types/src/Key.d.ts.map +1 -1
- package/dist/types/src/Migration.d.ts +72 -0
- package/dist/types/src/Migration.d.ts.map +1 -0
- package/dist/types/src/Obj.d.ts +459 -107
- package/dist/types/src/Obj.d.ts.map +1 -1
- package/dist/types/src/Obj.test.d.ts +2 -0
- package/dist/types/src/Obj.test.d.ts.map +1 -0
- package/dist/types/src/Order.d.ts +16 -0
- package/dist/types/src/Order.d.ts.map +1 -0
- package/dist/types/src/Query.d.ts +225 -0
- package/dist/types/src/Query.d.ts.map +1 -0
- package/dist/types/src/Query.test.d.ts +2 -0
- package/dist/types/src/Query.test.d.ts.map +1 -0
- package/dist/types/src/QueryResult.d.ts +80 -0
- package/dist/types/src/QueryResult.d.ts.map +1 -0
- package/dist/types/src/Ref.d.ts +69 -11
- package/dist/types/src/Ref.d.ts.map +1 -1
- package/dist/types/src/Relation.d.ts +316 -23
- package/dist/types/src/Relation.d.ts.map +1 -1
- package/dist/types/src/Relation.test.d.ts +2 -0
- package/dist/types/src/Relation.test.d.ts.map +1 -0
- package/dist/types/src/SchemaRegistry.d.ts +83 -0
- package/dist/types/src/SchemaRegistry.d.ts.map +1 -0
- package/dist/types/src/Tag.d.ts +18 -0
- package/dist/types/src/Tag.d.ts.map +1 -0
- package/dist/types/src/Type.d.ts +378 -106
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/Type.test.d.ts +2 -0
- package/dist/types/src/Type.test.d.ts.map +1 -0
- package/dist/types/src/View.d.ts +65 -0
- package/dist/types/src/View.d.ts.map +1 -0
- package/dist/types/src/exemplars.test.d.ts +2 -0
- package/dist/types/src/exemplars.test.d.ts.map +1 -0
- package/dist/types/src/hierarchy.test.d.ts +2 -0
- package/dist/types/src/hierarchy.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +22 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/annotations.d.ts +251 -0
- 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/Annotation/sorting.d.ts +24 -0
- package/dist/types/src/internal/Annotation/sorting.d.ts.map +1 -0
- package/dist/types/src/internal/Annotation/util.d.ts +48 -0
- package/dist/types/src/internal/Annotation/util.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/api.d.ts +13 -0
- package/dist/types/src/internal/Entity/api.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/entity.d.ts +67 -0
- package/dist/types/src/internal/Entity/entity.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/index.d.ts +10 -0
- package/dist/types/src/internal/Entity/index.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/model.d.ts +57 -0
- package/dist/types/src/internal/Entity/model.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/object.d.ts +18 -0
- package/dist/types/src/internal/Entity/object.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/relation.d.ts +51 -0
- package/dist/types/src/internal/Entity/relation.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/type-kind.d.ts +24 -0
- package/dist/types/src/internal/Entity/type-kind.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/type-uri.d.ts +25 -0
- package/dist/types/src/internal/Entity/type-uri.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/util.d.ts +2 -0
- package/dist/types/src/internal/Entity/util.d.ts.map +1 -0
- package/dist/types/src/internal/Entity/version.d.ts +42 -0
- 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/{formats → Format}/format.d.ts +6 -3
- 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/{formats → Format}/index.d.ts +2 -2
- 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/{formats → Format}/select.d.ts +6 -4
- package/dist/types/src/internal/Format/select.d.ts.map +1 -0
- package/dist/types/src/internal/{formats → Format}/string.d.ts +4 -0
- package/dist/types/src/internal/Format/string.d.ts.map +1 -0
- package/dist/types/src/internal/{formats → Format}/types.d.ts +14 -10
- package/dist/types/src/internal/Format/types.d.ts.map +1 -0
- package/dist/types/src/internal/{json → 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 +5 -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 +131 -30
- package/dist/types/src/internal/JsonSchema/json-schema-type.d.ts.map +1 -0
- package/dist/types/src/internal/{json → JsonSchema}/json-schema.d.ts +6 -3
- 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 +8 -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/create.d.ts → Obj/create-object.d.ts} +13 -16
- package/dist/types/src/internal/Obj/create-object.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/create-object.test.d.ts +2 -0
- package/dist/types/src/internal/Obj/create-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/deleted.d.ts +6 -0
- package/dist/types/src/internal/Obj/deleted.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/index.d.ts +10 -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/Obj/json-serializer.d.ts +45 -0
- 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/Obj/set-value.d.ts +7 -0
- package/dist/types/src/internal/Obj/set-value.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/set-value.test.d.ts +2 -0
- package/dist/types/src/internal/Obj/set-value.test.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/snapshot.d.ts +6 -0
- package/dist/types/src/internal/Obj/snapshot.d.ts.map +1 -0
- package/dist/types/src/internal/Obj/typed-object.d.ts +25 -0
- 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/Query.d.ts +10 -0
- package/dist/types/src/internal/Query.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 +4 -4
- package/dist/types/src/internal/Ref/ref-array.d.ts.map +1 -0
- package/dist/types/src/internal/{ref → Ref}/ref.d.ts +79 -31
- 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/Type/compose.d.ts +7 -0
- 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/Type/index.d.ts +3 -0
- package/dist/types/src/internal/Type/index.d.ts.map +1 -0
- package/dist/types/src/internal/{schema → Type}/manipulation.d.ts +0 -1
- package/dist/types/src/internal/Type/manipulation.d.ts.map +1 -0
- package/dist/types/src/internal/Type/type-schema.d.ts +52 -0
- package/dist/types/src/internal/Type/type-schema.d.ts.map +1 -0
- package/dist/types/src/internal/common/api/index.d.ts +11 -0
- package/dist/types/src/internal/common/api/index.d.ts.map +1 -0
- package/dist/types/src/internal/common/api/meta.d.ts +42 -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 +55 -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 +2 -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 +5 -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 +19 -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 +10 -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 +14 -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 +6 -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 +19 -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 +57 -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 +18 -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 +47 -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 +8 -0
- package/dist/types/src/internal/common/proxy/reactive-array.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/reactive.d.ts +39 -0
- package/dist/types/src/internal/common/proxy/reactive.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/reactive.test.d.ts +2 -0
- package/dist/types/src/internal/common/proxy/reactive.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/schema-validator.d.ts.map +1 -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 +3 -0
- package/dist/types/src/internal/common/proxy/symbols.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts +64 -0
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/typed-handler.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/proxy/typed-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/base.d.ts +27 -0
- package/dist/types/src/internal/common/types/base.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/entity.d.ts +94 -0
- package/dist/types/src/internal/common/types/entity.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/index.d.ts +7 -0
- package/dist/types/src/internal/common/types/index.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/meta.d.ts +43 -0
- package/dist/types/src/internal/common/types/meta.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/model-symbols.d.ts +58 -0
- package/dist/types/src/internal/common/types/model-symbols.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/typename.d.ts +28 -0
- package/dist/types/src/internal/common/types/typename.d.ts.map +1 -0
- package/dist/types/src/internal/common/types/version.d.ts +15 -0
- package/dist/types/src/internal/common/types/version.d.ts.map +1 -0
- package/dist/types/src/internal/index.d.ts +10 -14
- package/dist/types/src/internal/index.d.ts.map +1 -1
- package/dist/types/src/{test → testing}/api.test.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +3 -3
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +18 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-schema.d.ts +298 -0
- package/dist/types/src/testing/test-schema.d.ts.map +1 -0
- package/dist/types/src/testing/util.d.ts +23 -0
- package/dist/types/src/testing/util.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +117 -66
- package/src/Annotation.ts +49 -0
- package/src/Collection.ts +36 -0
- package/src/Database.ts +356 -0
- package/src/Dataset.ts +34 -0
- package/src/Entity.test.ts +132 -0
- package/src/Entity.ts +332 -0
- package/src/Err.ts +40 -0
- package/src/Extension.test.ts +235 -0
- package/src/Extension.ts +122 -0
- package/src/Feed.ts +356 -0
- package/src/Filter.test.ts +90 -0
- package/src/Filter.ts +507 -0
- package/src/Format.ts +9 -0
- package/src/Hypergraph.ts +79 -0
- package/src/Json.test.ts +175 -0
- package/src/Json.ts +103 -0
- package/src/JsonSchema.ts +26 -0
- package/src/Key.ts +4 -1
- package/src/Migration.ts +114 -0
- package/src/Obj.test.ts +550 -0
- package/src/Obj.ts +754 -267
- package/src/Order.ts +46 -0
- package/src/Query.test.ts +822 -0
- package/src/Query.ts +589 -0
- package/src/QueryResult.ts +106 -0
- package/src/Ref.ts +98 -10
- package/src/Relation.test.ts +88 -0
- package/src/Relation.ts +491 -67
- package/src/SchemaRegistry.ts +101 -0
- package/src/{query/tag.ts → Tag.ts} +15 -12
- package/src/Type.test.ts +197 -0
- package/src/Type.ts +605 -151
- package/src/View.ts +101 -0
- package/src/exemplars.test.ts +21 -0
- package/src/hierarchy.test.ts +33 -0
- package/src/index.ts +23 -6
- package/src/internal/Annotation/annotations.test.ts +165 -0
- package/src/internal/Annotation/annotations.ts +567 -0
- package/src/internal/Annotation/index.ts +7 -0
- package/src/internal/Annotation/sorting.ts +51 -0
- package/src/internal/Annotation/util.ts +93 -0
- package/src/internal/Entity/api.ts +30 -0
- package/src/internal/Entity/entity.ts +246 -0
- package/src/internal/Entity/index.ts +13 -0
- package/src/internal/Entity/model.ts +120 -0
- package/src/internal/Entity/object.ts +65 -0
- package/src/internal/Entity/relation.ts +179 -0
- package/src/internal/Entity/type-kind.ts +67 -0
- package/src/internal/Entity/type-uri.ts +87 -0
- package/src/internal/Entity/util.ts +34 -0
- package/src/internal/Entity/version.ts +96 -0
- package/src/internal/{formats → Format}/date.test.ts +1 -2
- package/src/internal/{formats → Format}/date.ts +5 -9
- package/src/internal/{formats → Format}/format.test.ts +6 -7
- package/src/internal/{formats → Format}/format.ts +8 -6
- package/src/internal/{formats → Format}/index.ts +2 -3
- package/src/internal/{formats → Format}/number.ts +5 -5
- package/src/internal/{formats → Format}/object.ts +4 -4
- package/src/internal/{formats → Format}/select.ts +6 -4
- package/src/internal/{formats → Format}/string.ts +14 -9
- package/src/internal/{formats → Format}/types.ts +54 -43
- package/src/internal/{json → JsonSchema}/annotations.ts +3 -3
- package/src/internal/{json-schema → JsonSchema}/index.ts +2 -0
- package/src/internal/{json-schema → JsonSchema}/json-schema-normalize.ts +4 -2
- package/src/internal/{json-schema → JsonSchema}/json-schema-type.ts +36 -36
- package/src/internal/{json → JsonSchema}/json-schema.test.ts +92 -175
- package/src/internal/{json → JsonSchema}/json-schema.ts +69 -37
- package/src/internal/Obj/clone.ts +52 -0
- package/src/internal/{object → Obj}/common.ts +3 -4
- package/src/internal/{object/create.test.ts → Obj/create-object.test.ts} +34 -37
- package/src/internal/Obj/create-object.ts +135 -0
- package/src/internal/Obj/deleted.ts +19 -0
- package/src/internal/Obj/index.ts +13 -0
- package/src/internal/{object → Obj}/inspect.ts +5 -7
- package/src/internal/Obj/json-serializer.test.ts +185 -0
- package/src/internal/Obj/json-serializer.ts +260 -0
- package/src/internal/{object → Obj}/schema-validator.test.ts +3 -7
- package/src/internal/Obj/schema-validator.ts +6 -0
- package/src/internal/Obj/set-value.test.ts +258 -0
- package/src/internal/Obj/set-value.ts +165 -0
- package/src/internal/Obj/snapshot.ts +111 -0
- package/src/internal/Obj/typed-object.test.ts +32 -0
- package/src/internal/Obj/typed-object.ts +30 -0
- package/src/internal/Query.ts +156 -0
- package/src/internal/{ref → Ref}/ref-array.ts +4 -5
- package/src/internal/{ref → Ref}/ref.test.ts +21 -30
- package/src/internal/{ref → Ref}/ref.ts +209 -98
- package/src/internal/{projection → Type}/compose.test.ts +9 -9
- package/src/internal/{projection → Type}/compose.ts +14 -9
- package/src/internal/Type/index.ts +6 -0
- package/src/internal/{schema → Type}/manipulation.ts +0 -25
- package/src/internal/Type/type-schema.ts +60 -0
- package/src/internal/common/README.md +102 -0
- package/src/internal/common/api/index.ts +15 -0
- package/src/internal/common/api/meta.ts +88 -0
- package/src/internal/{testing → common}/index.ts +2 -1
- package/src/internal/common/proxy/change-context.ts +138 -0
- package/src/internal/common/proxy/change.test.ts +519 -0
- package/src/internal/common/proxy/define-hidden-property.ts +14 -0
- package/src/internal/common/proxy/errors.ts +42 -0
- package/src/internal/common/proxy/event-batch.ts +44 -0
- package/src/internal/common/proxy/handler.test.ts +121 -0
- package/src/internal/common/proxy/index.ts +17 -0
- package/src/internal/common/proxy/json-serializer.ts +93 -0
- package/src/internal/common/proxy/make-object.ts +128 -0
- package/src/internal/common/proxy/ownership.ts +252 -0
- package/src/internal/common/proxy/proxy-types.ts +23 -0
- package/src/internal/common/proxy/proxy-utils.ts +150 -0
- package/src/internal/common/proxy/reactive-array.ts +71 -0
- package/src/internal/common/proxy/reactive.test.ts +54 -0
- package/src/internal/common/proxy/reactive.ts +77 -0
- package/src/internal/{object → common/proxy}/schema-validator.ts +6 -3
- package/src/internal/common/proxy/schema.test.ts +107 -0
- package/src/internal/common/proxy/symbols.ts +7 -0
- package/src/internal/common/proxy/typed-handler.test.ts +314 -0
- package/src/internal/common/proxy/typed-handler.ts +507 -0
- package/src/internal/common/proxy/typed-object.test.ts +103 -0
- package/src/internal/common/types/base.ts +43 -0
- package/src/internal/common/types/entity.ts +133 -0
- package/src/internal/common/types/index.ts +10 -0
- package/src/internal/common/types/meta.ts +79 -0
- package/src/internal/common/types/model-symbols.ts +74 -0
- package/src/internal/common/types/typename.ts +91 -0
- package/src/internal/common/types/version.ts +19 -0
- package/src/internal/index.ts +12 -17
- package/src/testing/api.test.ts +129 -0
- package/src/testing/index.ts +3 -3
- package/src/testing/test-data.ts +189 -0
- package/src/testing/test-schema.ts +204 -0
- package/src/testing/util.ts +88 -0
- package/dist/lib/browser/chunk-HKFCK2GL.mjs +0 -175
- package/dist/lib/browser/chunk-HKFCK2GL.mjs.map +0 -7
- package/dist/lib/browser/chunk-MAAYELT7.mjs +0 -830
- package/dist/lib/browser/chunk-MAAYELT7.mjs.map +0 -7
- package/dist/lib/browser/chunk-MB6MMNFP.mjs +0 -3857
- package/dist/lib/browser/chunk-MB6MMNFP.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -35
- package/dist/lib/browser/internal/index.mjs +0 -332
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/query/index.mjs +0 -15
- package/dist/lib/browser/testing/index.mjs +0 -298
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5NWDGIBT.mjs +0 -830
- package/dist/lib/node-esm/chunk-5NWDGIBT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AUAH4E2J.mjs +0 -175
- package/dist/lib/node-esm/chunk-AUAH4E2J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BQRA4VLX.mjs +0 -3857
- package/dist/lib/node-esm/chunk-BQRA4VLX.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -35
- package/dist/lib/node-esm/internal/index.mjs +0 -332
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/query/index.mjs +0 -15
- package/dist/lib/node-esm/testing/index.mjs +0 -298
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/errors.d.ts +0 -72
- package/dist/types/src/errors.d.ts.map +0 -1
- package/dist/types/src/internal/ast/annotation-helper.d.ts +0 -8
- package/dist/types/src/internal/ast/annotation-helper.d.ts.map +0 -1
- package/dist/types/src/internal/ast/annotations.d.ts +0 -125
- package/dist/types/src/internal/ast/annotations.d.ts.map +0 -1
- package/dist/types/src/internal/ast/annotations.test.d.ts.map +0 -1
- package/dist/types/src/internal/ast/entity-kind.d.ts +0 -10
- package/dist/types/src/internal/ast/entity-kind.d.ts.map +0 -1
- package/dist/types/src/internal/ast/index.d.ts +0 -5
- package/dist/types/src/internal/ast/index.d.ts.map +0 -1
- package/dist/types/src/internal/ast/types.d.ts +0 -6
- package/dist/types/src/internal/ast/types.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/annotations.d.ts.map +0 -1
- package/dist/types/src/internal/json/effect-schema.test.d.ts.map +0 -1
- package/dist/types/src/internal/json/index.d.ts +0 -2
- package/dist/types/src/internal/json/index.d.ts.map +0 -1
- package/dist/types/src/internal/json/json-schema.d.ts.map +0 -1
- package/dist/types/src/internal/json/json-schema.test.d.ts.map +0 -1
- package/dist/types/src/internal/json-schema/index.d.ts +0 -3
- 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/object/accessors.d.ts +0 -37
- package/dist/types/src/internal/object/accessors.d.ts.map +0 -1
- package/dist/types/src/internal/object/common.d.ts.map +0 -1
- package/dist/types/src/internal/object/create.d.ts.map +0 -1
- package/dist/types/src/internal/object/create.test.d.ts +0 -2
- package/dist/types/src/internal/object/create.test.d.ts.map +0 -1
- package/dist/types/src/internal/object/deleted.d.ts +0 -6
- package/dist/types/src/internal/object/deleted.d.ts.map +0 -1
- package/dist/types/src/internal/object/entity.d.ts +0 -33
- package/dist/types/src/internal/object/entity.d.ts.map +0 -1
- package/dist/types/src/internal/object/expando.d.ts +0 -14
- package/dist/types/src/internal/object/expando.d.ts.map +0 -1
- package/dist/types/src/internal/object/ids.d.ts +0 -6
- package/dist/types/src/internal/object/ids.d.ts.map +0 -1
- package/dist/types/src/internal/object/index.d.ts +0 -16
- 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 +0 -32
- 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/meta.d.ts +0 -31
- package/dist/types/src/internal/object/meta.d.ts.map +0 -1
- package/dist/types/src/internal/object/model.d.ts +0 -117
- package/dist/types/src/internal/object/model.d.ts.map +0 -1
- package/dist/types/src/internal/object/relation.d.ts +0 -17
- package/dist/types/src/internal/object/relation.d.ts.map +0 -1
- 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/typed-object.d.ts +0 -31
- 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/object/typename.d.ts +0 -15
- package/dist/types/src/internal/object/typename.d.ts.map +0 -1
- package/dist/types/src/internal/object/version.d.ts +0 -14
- package/dist/types/src/internal/object/version.d.ts.map +0 -1
- package/dist/types/src/internal/projection/compose.d.ts +0 -6
- package/dist/types/src/internal/projection/compose.d.ts.map +0 -1
- package/dist/types/src/internal/projection/compose.test.d.ts.map +0 -1
- package/dist/types/src/internal/projection/index.d.ts +0 -2
- package/dist/types/src/internal/projection/index.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/handler.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/reactive-object.d.ts +0 -15
- package/dist/types/src/internal/proxy/reactive-object.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/schema.test.d.ts.map +0 -1
- package/dist/types/src/internal/proxy/typed-handler.d.ts +0 -44
- 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/query/index.d.ts +0 -2
- package/dist/types/src/internal/query/index.d.ts.map +0 -1
- package/dist/types/src/internal/query/query.d.ts +0 -17
- package/dist/types/src/internal/query/query.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/echo-schema.d.ts +0 -168
- package/dist/types/src/internal/schema/echo-schema.d.ts.map +0 -1
- package/dist/types/src/internal/schema/index.d.ts +0 -7
- 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/runtime-schema-registry.d.ts +0 -18
- package/dist/types/src/internal/schema/runtime-schema-registry.d.ts.map +0 -1
- package/dist/types/src/internal/schema/snapshot.d.ts +0 -6
- package/dist/types/src/internal/schema/snapshot.d.ts.map +0 -1
- package/dist/types/src/internal/schema/stored-schema.d.ts +0 -13
- package/dist/types/src/internal/schema/stored-schema.d.ts.map +0 -1
- package/dist/types/src/internal/testing/index.d.ts +0 -3
- package/dist/types/src/internal/testing/index.d.ts.map +0 -1
- package/dist/types/src/internal/testing/types.d.ts +0 -455
- package/dist/types/src/internal/testing/types.d.ts.map +0 -1
- package/dist/types/src/internal/testing/utils.d.ts +0 -10
- package/dist/types/src/internal/testing/utils.d.ts.map +0 -1
- package/dist/types/src/internal/types/index.d.ts +0 -3
- package/dist/types/src/internal/types/index.d.ts.map +0 -1
- package/dist/types/src/internal/types/types.d.ts +0 -79
- package/dist/types/src/internal/types/types.d.ts.map +0 -1
- package/dist/types/src/internal/types/types.test.d.ts +0 -2
- package/dist/types/src/internal/types/types.test.d.ts.map +0 -1
- package/dist/types/src/internal/types/util.d.ts +0 -5
- package/dist/types/src/internal/types/util.d.ts.map +0 -1
- package/dist/types/src/query/index.d.ts +0 -3
- package/dist/types/src/query/index.d.ts.map +0 -1
- package/dist/types/src/query/query.d.ts +0 -248
- package/dist/types/src/query/query.d.ts.map +0 -1
- package/dist/types/src/query/query.test.d.ts +0 -2
- package/dist/types/src/query/query.test.d.ts.map +0 -1
- package/dist/types/src/query/tag.d.ts +0 -17
- package/dist/types/src/query/tag.d.ts.map +0 -1
- package/dist/types/src/testing/echo-schema.d.ts +0 -7
- package/dist/types/src/testing/echo-schema.d.ts.map +0 -1
- package/dist/types/src/testing/types.d.ts +0 -113
- package/dist/types/src/testing/types.d.ts.map +0 -1
- package/src/errors.ts +0 -18
- package/src/internal/ast/annotation-helper.ts +0 -22
- package/src/internal/ast/annotations.test.ts +0 -98
- package/src/internal/ast/annotations.ts +0 -219
- package/src/internal/ast/entity-kind.ts +0 -15
- package/src/internal/ast/index.ts +0 -8
- package/src/internal/ast/types.ts +0 -17
- package/src/internal/json/index.ts +0 -5
- package/src/internal/object/accessors.ts +0 -153
- package/src/internal/object/create.ts +0 -96
- package/src/internal/object/deleted.ts +0 -19
- package/src/internal/object/entity.ts +0 -248
- package/src/internal/object/expando.ts +0 -21
- package/src/internal/object/ids.ts +0 -12
- package/src/internal/object/index.ts +0 -19
- package/src/internal/object/json-serializer.test.ts +0 -99
- package/src/internal/object/json-serializer.ts +0 -225
- package/src/internal/object/meta.ts +0 -61
- package/src/internal/object/model.ts +0 -170
- package/src/internal/object/relation.ts +0 -24
- package/src/internal/object/typed-object.test.ts +0 -34
- package/src/internal/object/typed-object.ts +0 -88
- package/src/internal/object/typename.ts +0 -61
- package/src/internal/object/version.ts +0 -22
- package/src/internal/projection/index.ts +0 -5
- package/src/internal/proxy/handler.test.ts +0 -163
- package/src/internal/proxy/reactive-object.ts +0 -108
- package/src/internal/proxy/schema.test.ts +0 -136
- package/src/internal/proxy/typed-handler.test.ts +0 -102
- package/src/internal/proxy/typed-handler.ts +0 -228
- package/src/internal/proxy/typed-object.test.ts +0 -100
- package/src/internal/query/index.ts +0 -5
- package/src/internal/query/query.ts +0 -23
- package/src/internal/schema/echo-schema.ts +0 -383
- package/src/internal/schema/index.ts +0 -10
- package/src/internal/schema/runtime-schema-registry.ts +0 -78
- package/src/internal/schema/snapshot.ts +0 -25
- package/src/internal/schema/stored-schema.ts +0 -26
- package/src/internal/testing/types.ts +0 -211
- package/src/internal/testing/utils.ts +0 -54
- package/src/internal/types/index.ts +0 -6
- package/src/internal/types/types.test.ts +0 -48
- package/src/internal/types/types.ts +0 -176
- package/src/internal/types/util.ts +0 -9
- package/src/query/index.ts +0 -6
- package/src/query/query.test.ts +0 -401
- package/src/query/query.ts +0 -789
- package/src/test/api.test.ts +0 -180
- package/src/testing/echo-schema.ts +0 -39
- package/src/testing/types.ts +0 -91
- /package/dist/lib/{browser/index.mjs.map → neutral/Annotation.mjs.map} +0 -0
- /package/dist/lib/{browser/internal/index.mjs.map → neutral/Database.mjs.map} +0 -0
- /package/dist/lib/{browser/query/index.mjs.map → neutral/Entity.mjs.map} +0 -0
- /package/dist/lib/{node-esm/index.mjs.map → neutral/Err.mjs.map} +0 -0
- /package/dist/lib/{node-esm/internal/index.mjs.map → neutral/Extension.mjs.map} +0 -0
- /package/dist/lib/{node-esm/query/index.mjs.map → neutral/Feed.mjs.map} +0 -0
- /package/dist/types/src/internal/{ast → Annotation}/annotations.test.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.test.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/{json → JsonSchema}/effect-schema.test.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 → JsonSchema}/json-schema.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → Obj}/common.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}/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/{projection → Type}/compose.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/handler.test.d.ts +0 -0
- /package/dist/types/src/internal/{object → 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}/typed-handler.test.d.ts +0 -0
- /package/dist/types/src/internal/{proxy → common/proxy}/typed-object.test.d.ts +0 -0
- /package/dist/types/src/{test → testing}/api.test.d.ts +0 -0
- /package/src/internal/{json → JsonSchema}/effect-schema.test.ts +0 -0
- /package/src/internal/{ref → Ref}/index.ts +0 -0
|
@@ -8,26 +8,25 @@ import * as SchemaAST from 'effect/SchemaAST';
|
|
|
8
8
|
import { describe, expect, test } from 'vitest';
|
|
9
9
|
|
|
10
10
|
import { type JsonProp, findAnnotation } from '@dxos/effect';
|
|
11
|
-
import { ObjectId } from '@dxos/keys';
|
|
11
|
+
import { DXN, ObjectId } from '@dxos/keys';
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { TestSchema, prepareAstForCompare } from '../../testing';
|
|
15
|
+
import * as Type from '../../Type';
|
|
15
16
|
import {
|
|
16
|
-
EntityKind,
|
|
17
17
|
FieldLookupAnnotationId,
|
|
18
18
|
GeneratorAnnotation,
|
|
19
19
|
LabelAnnotation,
|
|
20
20
|
PropertyMeta,
|
|
21
21
|
getTypeAnnotation,
|
|
22
22
|
getTypeIdentifierAnnotation,
|
|
23
|
-
} from '../
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
23
|
+
} from '../Annotation';
|
|
24
|
+
import { EntityKind } from '../common/types';
|
|
25
|
+
import { EchoObjectSchema } from '../Entity';
|
|
26
|
+
import { Email, FormatAnnotation, TypeFormat } from '../Format';
|
|
27
|
+
import { JsonSchemaType, getNormalizedEchoAnnotations, getSchemaProperty, setSchemaProperty } from '../JsonSchema';
|
|
28
|
+
import { Ref, createSchemaReference, getReferenceAst, getSchemaReference } from '../Ref';
|
|
29
|
+
import { TypeSchema } from '../Type';
|
|
31
30
|
import { toEffectSchema, toJsonSchema } from './json-schema';
|
|
32
31
|
|
|
33
32
|
const EXAMPLE_NAMESPACE = '@example';
|
|
@@ -35,26 +34,18 @@ const EXAMPLE_NAMESPACE = '@example';
|
|
|
35
34
|
describe('effect-to-json', () => {
|
|
36
35
|
test('type annotation', () => {
|
|
37
36
|
const Test = Schema.Struct({ name: Schema.String }).pipe(
|
|
38
|
-
Type.
|
|
39
|
-
typename: 'example.com/type/Test',
|
|
40
|
-
version: '0.1.0',
|
|
41
|
-
}),
|
|
37
|
+
Type.makeObject(DXN.make('com.example.type.test', '0.1.0')),
|
|
42
38
|
);
|
|
43
39
|
const jsonSchema = toJsonSchema(Test);
|
|
44
|
-
expect(
|
|
45
|
-
expect(
|
|
40
|
+
expect(jsonSchema.$id).toEqual('dxn:com.example.type.test:0.1.0');
|
|
41
|
+
expect(jsonSchema.version).toEqual('0.1.0');
|
|
46
42
|
});
|
|
47
43
|
|
|
48
44
|
test('property meta annotation', () => {
|
|
49
45
|
const meta = { maxLength: 0 };
|
|
50
46
|
const Test = Schema.Struct({
|
|
51
47
|
name: Schema.String.pipe(PropertyMeta(EXAMPLE_NAMESPACE, meta)),
|
|
52
|
-
}).pipe(
|
|
53
|
-
Type.Obj({
|
|
54
|
-
typename: 'example.com/type/Test',
|
|
55
|
-
version: '0.1.0',
|
|
56
|
-
}),
|
|
57
|
-
);
|
|
48
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.test', '0.1.0')));
|
|
58
49
|
const jsonSchema = toJsonSchema(Test);
|
|
59
50
|
expect(getNormalizedEchoAnnotations(jsonSchema.properties!.name!)!.meta![EXAMPLE_NAMESPACE]).to.deep.eq(meta);
|
|
60
51
|
});
|
|
@@ -62,20 +53,10 @@ describe('effect-to-json', () => {
|
|
|
62
53
|
test('reference annotation', () => {
|
|
63
54
|
const Nested = Schema.Struct({
|
|
64
55
|
name: Schema.String,
|
|
65
|
-
}).pipe(
|
|
66
|
-
Type.Obj({
|
|
67
|
-
typename: 'example.com/type/TestNested',
|
|
68
|
-
version: '0.1.0',
|
|
69
|
-
}),
|
|
70
|
-
);
|
|
56
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.testNested', '0.1.0')));
|
|
71
57
|
const Test = Schema.Struct({
|
|
72
58
|
name: Ref(Nested),
|
|
73
|
-
}).pipe(
|
|
74
|
-
Type.Obj({
|
|
75
|
-
typename: 'example.com/type/Test',
|
|
76
|
-
version: '0.1.0',
|
|
77
|
-
}),
|
|
78
|
-
);
|
|
59
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.test', '0.1.0')));
|
|
79
60
|
const jsonSchema = toJsonSchema(Test);
|
|
80
61
|
// log.info('schema', { jsonSchema });
|
|
81
62
|
const nested = jsonSchema.properties!.name;
|
|
@@ -87,20 +68,10 @@ describe('effect-to-json', () => {
|
|
|
87
68
|
test.skip('reference annotation with lookup property', () => {
|
|
88
69
|
const Nested = Schema.Struct({
|
|
89
70
|
name: Schema.String,
|
|
90
|
-
}).pipe(
|
|
91
|
-
Type.Obj({
|
|
92
|
-
typename: 'example.com/type/TestNested',
|
|
93
|
-
version: '0.1.0',
|
|
94
|
-
}),
|
|
95
|
-
);
|
|
71
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.testNested', '0.1.0')));
|
|
96
72
|
const Test = Schema.Struct({
|
|
97
73
|
name: Ref(Nested).annotations({ [FieldLookupAnnotationId]: 'name' }),
|
|
98
|
-
}).pipe(
|
|
99
|
-
Type.Obj({
|
|
100
|
-
typename: 'example.com/type/Test',
|
|
101
|
-
version: '0.1.0',
|
|
102
|
-
}),
|
|
103
|
-
);
|
|
74
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.test', '0.1.0')));
|
|
104
75
|
const jsonSchema = toJsonSchema(Test);
|
|
105
76
|
const effectSchema = toEffectSchema(jsonSchema);
|
|
106
77
|
|
|
@@ -111,20 +82,10 @@ describe('effect-to-json', () => {
|
|
|
111
82
|
test('array of references', () => {
|
|
112
83
|
const Nested = Schema.Struct({
|
|
113
84
|
name: Schema.String,
|
|
114
|
-
}).pipe(
|
|
115
|
-
Type.Obj({
|
|
116
|
-
typename: 'example.com/type/TestNested',
|
|
117
|
-
version: '0.1.0',
|
|
118
|
-
}),
|
|
119
|
-
);
|
|
85
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.testNested', '0.1.0')));
|
|
120
86
|
const Test = Schema.Struct({
|
|
121
87
|
name: Schema.Array(Ref(Nested)),
|
|
122
|
-
}).pipe(
|
|
123
|
-
Type.Obj({
|
|
124
|
-
typename: 'example.com/type/Test',
|
|
125
|
-
version: '0.1.0',
|
|
126
|
-
}),
|
|
127
|
-
);
|
|
88
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.test', '0.1.0')));
|
|
128
89
|
|
|
129
90
|
const jsonSchema = toJsonSchema(Test);
|
|
130
91
|
expectReferenceAnnotation((jsonSchema.properties!.name as any).items);
|
|
@@ -133,20 +94,10 @@ describe('effect-to-json', () => {
|
|
|
133
94
|
test('optional references', () => {
|
|
134
95
|
const Nested = Schema.Struct({
|
|
135
96
|
name: Schema.String,
|
|
136
|
-
}).pipe(
|
|
137
|
-
Type.Obj({
|
|
138
|
-
typename: 'example.com/type/TestNested',
|
|
139
|
-
version: '0.1.0',
|
|
140
|
-
}),
|
|
141
|
-
);
|
|
97
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.testNested', '0.1.0')));
|
|
142
98
|
const Test = Schema.Struct({
|
|
143
99
|
name: Schema.optional(Ref(Nested)),
|
|
144
|
-
}).pipe(
|
|
145
|
-
Type.Obj({
|
|
146
|
-
typename: 'example.com/type/Test',
|
|
147
|
-
version: '0.1.0',
|
|
148
|
-
}),
|
|
149
|
-
);
|
|
100
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.test', '0.1.0')));
|
|
150
101
|
const jsonSchema = toJsonSchema(Test);
|
|
151
102
|
expectReferenceAnnotation(jsonSchema.properties!.name);
|
|
152
103
|
});
|
|
@@ -159,24 +110,20 @@ describe('effect-to-json', () => {
|
|
|
159
110
|
});
|
|
160
111
|
|
|
161
112
|
test('annotations', () => {
|
|
162
|
-
const
|
|
113
|
+
const TempSchema = Schema.Struct({
|
|
163
114
|
name: Schema.String.annotations({ description: 'Person name', title: 'Name' }),
|
|
164
|
-
email: Schema.String.pipe(FormatAnnotation.set(
|
|
115
|
+
email: Schema.String.pipe(FormatAnnotation.set(TypeFormat.Email)).annotations({
|
|
165
116
|
description: 'Email address',
|
|
166
117
|
}),
|
|
167
|
-
}).pipe(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
version: '0.1.0',
|
|
171
|
-
}),
|
|
172
|
-
);
|
|
173
|
-
const jsonSchema = toJsonSchema(TestSchema);
|
|
118
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.person', '0.1.0')));
|
|
119
|
+
|
|
120
|
+
const jsonSchema = toJsonSchema(TempSchema);
|
|
174
121
|
expect(jsonSchema).to.deep.eq({
|
|
175
122
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
176
|
-
$id: 'dxn:type:
|
|
123
|
+
$id: 'dxn:com.example.type.person:0.1.0',
|
|
177
124
|
|
|
178
125
|
entityKind: EntityKind.Object,
|
|
179
|
-
typename: 'example.
|
|
126
|
+
typename: 'com.example.type.person',
|
|
180
127
|
version: '0.1.0',
|
|
181
128
|
|
|
182
129
|
type: 'object',
|
|
@@ -197,47 +144,39 @@ describe('effect-to-json', () => {
|
|
|
197
144
|
});
|
|
198
145
|
|
|
199
146
|
test('handles suspend -- Contact schema serialization', () => {
|
|
200
|
-
const schema = toJsonSchema(
|
|
147
|
+
const schema = toJsonSchema(TestSchema.Person);
|
|
201
148
|
expect(Object.keys(schema.properties!)).toEqual([
|
|
202
149
|
'id',
|
|
203
150
|
'name',
|
|
204
151
|
'username',
|
|
205
152
|
'email',
|
|
206
|
-
'
|
|
153
|
+
'age',
|
|
207
154
|
'tasks',
|
|
155
|
+
'employer',
|
|
208
156
|
'address',
|
|
157
|
+
'fields',
|
|
209
158
|
]);
|
|
210
159
|
});
|
|
211
160
|
|
|
212
161
|
test('reference property by ref', () => {
|
|
213
162
|
const Organization = Schema.Struct({
|
|
214
163
|
field: Schema.String,
|
|
215
|
-
}).pipe(
|
|
216
|
-
Type.Obj({
|
|
217
|
-
typename: 'example.com/type/Organization',
|
|
218
|
-
version: '0.1.0',
|
|
219
|
-
}),
|
|
220
|
-
);
|
|
164
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.organization', '0.1.0')));
|
|
221
165
|
|
|
222
166
|
const Contact = Schema.Struct({
|
|
223
167
|
name: Schema.String,
|
|
224
168
|
organization: Ref(Organization).annotations({ description: 'Contact organization' }),
|
|
225
|
-
}).pipe(
|
|
226
|
-
Type.Obj({
|
|
227
|
-
typename: 'example.com/type/Contact',
|
|
228
|
-
version: '0.1.0',
|
|
229
|
-
}),
|
|
230
|
-
);
|
|
169
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.person', '0.1.0')));
|
|
231
170
|
|
|
232
171
|
// log.info('Contact', { ast: Contact.ast });
|
|
233
172
|
|
|
234
173
|
const jsonSchema = toJsonSchema(Contact);
|
|
235
174
|
expect(jsonSchema).toEqual({
|
|
236
175
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
237
|
-
$id: 'dxn:type:
|
|
176
|
+
$id: 'dxn:com.example.type.person:0.1.0',
|
|
238
177
|
|
|
239
178
|
entityKind: EntityKind.Object,
|
|
240
|
-
typename: 'example.
|
|
179
|
+
typename: 'com.example.type.person',
|
|
241
180
|
version: '0.1.0',
|
|
242
181
|
|
|
243
182
|
type: 'object',
|
|
@@ -257,7 +196,7 @@ describe('effect-to-json', () => {
|
|
|
257
196
|
$ref: '/schemas/echo/ref',
|
|
258
197
|
reference: {
|
|
259
198
|
schema: {
|
|
260
|
-
$ref: 'dxn:
|
|
199
|
+
$ref: 'dxn:com.example.type.organization',
|
|
261
200
|
},
|
|
262
201
|
schemaVersion: '0.1.0',
|
|
263
202
|
},
|
|
@@ -274,31 +213,21 @@ describe('effect-to-json', () => {
|
|
|
274
213
|
test('add reference property', () => {
|
|
275
214
|
const Organization = Schema.Struct({
|
|
276
215
|
field: Schema.String,
|
|
277
|
-
}).pipe(
|
|
278
|
-
Type.Obj({
|
|
279
|
-
typename: 'example.com/type/Organization',
|
|
280
|
-
version: '0.1.0',
|
|
281
|
-
}),
|
|
282
|
-
);
|
|
216
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.organization', '0.1.0')));
|
|
283
217
|
|
|
284
218
|
const Contact = Schema.Struct({
|
|
285
219
|
name: Schema.String,
|
|
286
220
|
organization: Ref(Organization).annotations({ description: 'Contact organization' }),
|
|
287
|
-
}).pipe(
|
|
288
|
-
Type.Obj({
|
|
289
|
-
typename: 'example.com/type/Contact',
|
|
290
|
-
version: '0.1.0',
|
|
291
|
-
}),
|
|
292
|
-
);
|
|
221
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.person', '0.1.0')));
|
|
293
222
|
|
|
294
223
|
const jsonSchema = toJsonSchema(Contact);
|
|
295
|
-
setSchemaProperty(jsonSchema, 'organization' as JsonProp, createSchemaReference(Organization
|
|
224
|
+
setSchemaProperty(jsonSchema, 'organization' as JsonProp, createSchemaReference(Type.getTypename(Organization)));
|
|
296
225
|
const { typename } = getSchemaReference(getSchemaProperty(jsonSchema, 'organization' as JsonProp) ?? {}) ?? {};
|
|
297
|
-
expect(typename).to.eq(Organization
|
|
226
|
+
expect(typename).to.eq(Type.getTypename(Organization));
|
|
298
227
|
});
|
|
299
228
|
|
|
300
|
-
test('serialize circular schema (
|
|
301
|
-
const jsonSchema = toJsonSchema(
|
|
229
|
+
test('serialize circular schema (TypeSchema)', () => {
|
|
230
|
+
const jsonSchema = toJsonSchema(TypeSchema);
|
|
302
231
|
expect(Object.keys(jsonSchema.properties!).length).toBeGreaterThan(0);
|
|
303
232
|
|
|
304
233
|
// TODO(dmaretskyi): Currently unable to deserialize.
|
|
@@ -321,7 +250,7 @@ describe('effect-to-json', () => {
|
|
|
321
250
|
|
|
322
251
|
test('reference with title annotation', () => {
|
|
323
252
|
const schema = Schema.Struct({
|
|
324
|
-
contact: Ref(
|
|
253
|
+
contact: Ref(TestSchema.Person).annotations({ title: 'Custom Title' }),
|
|
325
254
|
});
|
|
326
255
|
|
|
327
256
|
// log.info('schema before', { ast: schema.ast });
|
|
@@ -344,33 +273,36 @@ describe('effect-to-json', () => {
|
|
|
344
273
|
});
|
|
345
274
|
|
|
346
275
|
test('relation schema', () => {
|
|
347
|
-
const schema =
|
|
276
|
+
const schema = TestSchema.EmployedBy;
|
|
348
277
|
const jsonSchema = toJsonSchema(schema);
|
|
349
278
|
expect(jsonSchema).toEqual({
|
|
350
|
-
$id: 'dxn:type:
|
|
279
|
+
$id: 'dxn:com.example.type.employedBy:0.1.0',
|
|
351
280
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
352
281
|
entityKind: 'relation',
|
|
353
|
-
typename: 'example.
|
|
282
|
+
typename: 'com.example.type.employedBy',
|
|
354
283
|
version: '0.1.0',
|
|
355
284
|
relationSource: {
|
|
356
285
|
// TODO(dmaretskyi): Should those point to specific schema version?
|
|
357
|
-
$ref: 'dxn:
|
|
286
|
+
$ref: 'dxn:com.example.type.person',
|
|
358
287
|
},
|
|
359
288
|
relationTarget: {
|
|
360
289
|
// TODO(dmaretskyi): Should those point to specific schema version?
|
|
361
|
-
$ref: 'dxn:
|
|
290
|
+
$ref: 'dxn:com.example.type.organization',
|
|
362
291
|
},
|
|
363
292
|
type: 'object',
|
|
364
293
|
properties: {
|
|
365
294
|
id: {
|
|
366
295
|
type: 'string',
|
|
367
296
|
},
|
|
297
|
+
role: {
|
|
298
|
+
type: 'string',
|
|
299
|
+
},
|
|
368
300
|
since: {
|
|
369
301
|
type: 'string',
|
|
370
302
|
},
|
|
371
303
|
},
|
|
372
|
-
propertyOrder: ['since', 'id'],
|
|
373
|
-
required: ['id'],
|
|
304
|
+
propertyOrder: ['role', 'since', 'id'],
|
|
305
|
+
required: ['role', 'id'],
|
|
374
306
|
additionalProperties: false,
|
|
375
307
|
});
|
|
376
308
|
});
|
|
@@ -379,19 +311,13 @@ describe('effect-to-json', () => {
|
|
|
379
311
|
const Organization = Schema.Struct({
|
|
380
312
|
id: ObjectId,
|
|
381
313
|
name: Schema.String,
|
|
382
|
-
}).pipe(
|
|
383
|
-
EchoObject({
|
|
384
|
-
typename: 'example.com/type/Organization',
|
|
385
|
-
version: '0.1.0',
|
|
386
|
-
}),
|
|
387
|
-
LabelAnnotation.set(['name']),
|
|
388
|
-
);
|
|
314
|
+
}).pipe(LabelAnnotation.set(['name']), EchoObjectSchema(DXN.make('com.example.type.organization', '0.1.0')));
|
|
389
315
|
|
|
390
316
|
const jsonSchema = toJsonSchema(Organization);
|
|
391
317
|
expect(jsonSchema).toEqual({
|
|
392
|
-
$id: 'dxn:type:
|
|
318
|
+
$id: 'dxn:com.example.type.organization:0.1.0',
|
|
393
319
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
394
|
-
typename: 'example.
|
|
320
|
+
typename: 'com.example.type.organization',
|
|
395
321
|
version: '0.1.0',
|
|
396
322
|
entityKind: 'object',
|
|
397
323
|
type: 'object',
|
|
@@ -462,7 +388,7 @@ describe('effect-to-json', () => {
|
|
|
462
388
|
const expectReferenceAnnotation = (object: JsonSchemaType) => {
|
|
463
389
|
expect(object.reference).to.deep.eq({
|
|
464
390
|
schema: {
|
|
465
|
-
$ref: 'dxn:
|
|
391
|
+
$ref: 'dxn:com.example.type.testNested',
|
|
466
392
|
},
|
|
467
393
|
schemaVersion: '0.1.0',
|
|
468
394
|
});
|
|
@@ -489,12 +415,7 @@ describe('json-to-effect', () => {
|
|
|
489
415
|
test(`deserialized equals original ${partial ? 'with partial' : ''}`, () => {
|
|
490
416
|
const Organization = Schema.Struct({
|
|
491
417
|
field: Schema.String,
|
|
492
|
-
}).pipe(
|
|
493
|
-
Type.Obj({
|
|
494
|
-
typename: 'example.com/type/Organization',
|
|
495
|
-
version: '0.1.0',
|
|
496
|
-
}),
|
|
497
|
-
);
|
|
418
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.organization', '0.1.0')));
|
|
498
419
|
|
|
499
420
|
const fields = {
|
|
500
421
|
string: Schema.String,
|
|
@@ -506,15 +427,12 @@ describe('json-to-effect', () => {
|
|
|
506
427
|
object: Schema.Struct({ id: Schema.String, field: Ref(Organization) }),
|
|
507
428
|
echoObject: Ref(Organization),
|
|
508
429
|
echoObjectArray: Schema.Array(Ref(Organization)),
|
|
509
|
-
email: Schema.String.pipe(FormatAnnotation.set(
|
|
430
|
+
email: Schema.String.pipe(FormatAnnotation.set(TypeFormat.Email)),
|
|
510
431
|
null: Schema.Null,
|
|
511
432
|
} as const;
|
|
512
433
|
|
|
513
434
|
const Test = (partial ? Schema.partial(Schema.Struct(fields)) : Schema.Struct(fields)).pipe(
|
|
514
|
-
Type.
|
|
515
|
-
typename: 'example.com/type/Test',
|
|
516
|
-
version: '0.1.0',
|
|
517
|
-
}),
|
|
435
|
+
Type.makeObject(DXN.make('com.example.type.test', '0.1.0')),
|
|
518
436
|
);
|
|
519
437
|
|
|
520
438
|
const jsonSchema = toJsonSchema(Test);
|
|
@@ -522,11 +440,12 @@ describe('json-to-effect', () => {
|
|
|
522
440
|
|
|
523
441
|
const schema = toEffectSchema(jsonSchema);
|
|
524
442
|
|
|
525
|
-
|
|
526
|
-
expect(() => expect(
|
|
527
|
-
expect(() => expect(
|
|
443
|
+
const testAst = Type.getSchema(Test).ast;
|
|
444
|
+
expect(() => expect(schema.ast).to.deep.eq(testAst)).to.throw();
|
|
445
|
+
expect(() => expect(prepareAstForCompare(testAst)).to.deep.eq(testAst)).to.throw();
|
|
446
|
+
expect(() => expect(schema.ast).to.deep.eq(prepareAstForCompare(testAst))).to.throw();
|
|
528
447
|
// log.info('', { original: prepareAstForCompare(Schema.ast), deserialized: prepareAstForCompare(schema.ast) });
|
|
529
|
-
expect(prepareAstForCompare(schema.ast)).to.deep.eq(prepareAstForCompare(
|
|
448
|
+
expect(prepareAstForCompare(schema.ast)).to.deep.eq(prepareAstForCompare(testAst));
|
|
530
449
|
|
|
531
450
|
// TODO(dmaretskyi): Fix.
|
|
532
451
|
// expect(
|
|
@@ -539,13 +458,13 @@ describe('json-to-effect', () => {
|
|
|
539
458
|
|
|
540
459
|
test('legacy schema with dxn:type $id gets decoded', () => {
|
|
541
460
|
const jsonSchema: JsonSchemaType = {
|
|
542
|
-
$id: 'dxn:type:example.
|
|
461
|
+
$id: 'dxn:type:com.example.type.project',
|
|
543
462
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
544
463
|
additionalProperties: false,
|
|
545
464
|
echo: {
|
|
546
465
|
type: {
|
|
547
466
|
schemaId: '01JERV1HQCQZDQ4NVCJ42QB38F',
|
|
548
|
-
typename: 'example.
|
|
467
|
+
typename: 'com.example.type.project',
|
|
549
468
|
version: '0.1.0',
|
|
550
469
|
},
|
|
551
470
|
},
|
|
@@ -571,15 +490,15 @@ describe('json-to-effect', () => {
|
|
|
571
490
|
const schema = toEffectSchema(jsonSchema);
|
|
572
491
|
expect(getTypeAnnotation(schema)).to.deep.eq({
|
|
573
492
|
kind: EntityKind.Object,
|
|
574
|
-
typename: 'example.
|
|
493
|
+
typename: 'com.example.type.project',
|
|
575
494
|
version: '0.1.0',
|
|
576
495
|
});
|
|
577
|
-
expect(getTypeIdentifierAnnotation(schema)).to.deep.eq('
|
|
496
|
+
expect(getTypeIdentifierAnnotation(schema)).to.deep.eq('echo:/01JERV1HQCQZDQ4NVCJ42QB38F');
|
|
578
497
|
});
|
|
579
498
|
|
|
580
499
|
test('symbol annotations get compared', () => {
|
|
581
|
-
const schema1 = Schema.String.pipe(FormatAnnotation.set(
|
|
582
|
-
const schema2 = Schema.String.pipe(FormatAnnotation.set(
|
|
500
|
+
const schema1 = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Email));
|
|
501
|
+
const schema2 = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Currency));
|
|
583
502
|
expect(prepareAstForCompare(schema1.ast)).not.to.deep.eq(prepareAstForCompare(schema2.ast));
|
|
584
503
|
});
|
|
585
504
|
|
|
@@ -594,10 +513,10 @@ describe('json-to-effect', () => {
|
|
|
594
513
|
});
|
|
595
514
|
|
|
596
515
|
test('relation schema roundtrip', () => {
|
|
597
|
-
const schema =
|
|
516
|
+
const schema = TestSchema.HasManager;
|
|
598
517
|
const jsonSchema = toJsonSchema(schema);
|
|
599
518
|
const effectSchema = toEffectSchema(jsonSchema);
|
|
600
|
-
expect(prepareAstForCompare(effectSchema.ast)).to.deep.eq(prepareAstForCompare(schema.ast));
|
|
519
|
+
expect(prepareAstForCompare(effectSchema.ast)).to.deep.eq(prepareAstForCompare(Type.getSchema(schema).ast));
|
|
601
520
|
});
|
|
602
521
|
|
|
603
522
|
test('generator annotation', () => {
|
|
@@ -697,10 +616,8 @@ describe('json-to-effect', () => {
|
|
|
697
616
|
});
|
|
698
617
|
|
|
699
618
|
test('schema with optional referece', () => {
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
});
|
|
703
|
-
const jsonSchema = toJsonSchema(TestSchema);
|
|
619
|
+
const TempSchema = Schema.Struct({ contact: Schema.optional(Ref(TestSchema.Person)) });
|
|
620
|
+
const jsonSchema = toJsonSchema(TempSchema);
|
|
704
621
|
expect(jsonSchema).toMatchInlineSnapshot(`
|
|
705
622
|
{
|
|
706
623
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -711,7 +628,7 @@ describe('json-to-effect', () => {
|
|
|
711
628
|
"$ref": "/schemas/echo/ref",
|
|
712
629
|
"reference": {
|
|
713
630
|
"schema": {
|
|
714
|
-
"$ref": "dxn:
|
|
631
|
+
"$ref": "dxn:com.example.type.person",
|
|
715
632
|
},
|
|
716
633
|
"schemaVersion": "0.1.0",
|
|
717
634
|
},
|
|
@@ -726,15 +643,15 @@ describe('json-to-effect', () => {
|
|
|
726
643
|
`);
|
|
727
644
|
|
|
728
645
|
const effectSchema = toEffectSchema(jsonSchema);
|
|
729
|
-
expect(prepareAstForCompare(effectSchema.ast)).to.deep.eq(prepareAstForCompare(
|
|
646
|
+
expect(prepareAstForCompare(effectSchema.ast)).to.deep.eq(prepareAstForCompare(TempSchema.ast));
|
|
730
647
|
});
|
|
731
648
|
|
|
732
649
|
test('object nested inside another struct', () => {
|
|
733
650
|
const Contact = Schema.Struct({
|
|
734
651
|
name: Schema.String,
|
|
735
|
-
}).pipe(
|
|
652
|
+
}).pipe(EchoObjectSchema(DXN.make('com.example.type.person', '0.1.0')));
|
|
736
653
|
const input = Schema.Struct({
|
|
737
|
-
contact: Contact,
|
|
654
|
+
contact: Type.getSchema(Contact),
|
|
738
655
|
});
|
|
739
656
|
const jsonSchema = toJsonSchema(input);
|
|
740
657
|
expect(jsonSchema).toMatchInlineSnapshot(`
|
|
@@ -743,7 +660,7 @@ describe('json-to-effect', () => {
|
|
|
743
660
|
"additionalProperties": false,
|
|
744
661
|
"properties": {
|
|
745
662
|
"contact": {
|
|
746
|
-
"$id": "dxn:type:
|
|
663
|
+
"$id": "dxn:com.example.type.person:0.1.0",
|
|
747
664
|
"additionalProperties": false,
|
|
748
665
|
"entityKind": "object",
|
|
749
666
|
"properties": {
|
|
@@ -763,7 +680,7 @@ describe('json-to-effect', () => {
|
|
|
763
680
|
"id",
|
|
764
681
|
],
|
|
765
682
|
"type": "object",
|
|
766
|
-
"typename": "example.
|
|
683
|
+
"typename": "com.example.type.person",
|
|
767
684
|
"version": "0.1.0",
|
|
768
685
|
},
|
|
769
686
|
},
|
|
@@ -784,7 +701,7 @@ describe('json-to-effect', () => {
|
|
|
784
701
|
|
|
785
702
|
describe('reference', () => {
|
|
786
703
|
test('reference annotation', () => {
|
|
787
|
-
const schema = Ref(
|
|
704
|
+
const schema = Ref(TestSchema.Person);
|
|
788
705
|
const jsonSchema = toJsonSchema(schema);
|
|
789
706
|
expect(jsonSchema).toEqual({
|
|
790
707
|
$id: '/schemas/echo/ref',
|
|
@@ -792,7 +709,7 @@ describe('reference', () => {
|
|
|
792
709
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
793
710
|
reference: {
|
|
794
711
|
schema: {
|
|
795
|
-
$ref: 'dxn:
|
|
712
|
+
$ref: 'dxn:com.example.type.person',
|
|
796
713
|
},
|
|
797
714
|
schemaVersion: '0.1.0',
|
|
798
715
|
},
|
|
@@ -800,7 +717,7 @@ describe('reference', () => {
|
|
|
800
717
|
});
|
|
801
718
|
|
|
802
719
|
test('title annotation', () => {
|
|
803
|
-
const schema = Ref(
|
|
720
|
+
const schema = Ref(TestSchema.Person).annotations({ title: 'My custom title' });
|
|
804
721
|
const jsonSchema = toJsonSchema(schema);
|
|
805
722
|
expect(jsonSchema).toEqual({
|
|
806
723
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
@@ -810,7 +727,7 @@ describe('reference', () => {
|
|
|
810
727
|
$ref: '/schemas/echo/ref',
|
|
811
728
|
reference: {
|
|
812
729
|
schema: {
|
|
813
|
-
$ref: 'dxn:
|
|
730
|
+
$ref: 'dxn:com.example.type.person',
|
|
814
731
|
},
|
|
815
732
|
schemaVersion: '0.1.0',
|
|
816
733
|
},
|
|
@@ -821,7 +738,7 @@ describe('reference', () => {
|
|
|
821
738
|
});
|
|
822
739
|
|
|
823
740
|
test('description annotation', () => {
|
|
824
|
-
const schema = Ref(
|
|
741
|
+
const schema = Ref(TestSchema.Person).annotations({ description: 'My custom description' });
|
|
825
742
|
const jsonSchema = toJsonSchema(schema);
|
|
826
743
|
expect(jsonSchema).toEqual({
|
|
827
744
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
@@ -831,7 +748,7 @@ describe('reference', () => {
|
|
|
831
748
|
$ref: '/schemas/echo/ref',
|
|
832
749
|
reference: {
|
|
833
750
|
schema: {
|
|
834
|
-
$ref: 'dxn:
|
|
751
|
+
$ref: 'dxn:com.example.type.person',
|
|
835
752
|
},
|
|
836
753
|
schemaVersion: '0.1.0',
|
|
837
754
|
},
|
|
@@ -845,13 +762,13 @@ describe('reference', () => {
|
|
|
845
762
|
});
|
|
846
763
|
|
|
847
764
|
test('serialize and deserialize', () => {
|
|
848
|
-
const schema = Ref(
|
|
765
|
+
const schema = Ref(TestSchema.Person);
|
|
849
766
|
const jsonSchema = toJsonSchema(schema);
|
|
850
767
|
const deserializedSchema = toEffectSchema(jsonSchema);
|
|
851
768
|
const refAst = getReferenceAst(deserializedSchema.ast);
|
|
852
769
|
expect(refAst).toEqual({
|
|
853
|
-
typename:
|
|
854
|
-
version:
|
|
770
|
+
typename: Type.getTypename(TestSchema.Person),
|
|
771
|
+
version: Type.getVersion(TestSchema.Person),
|
|
855
772
|
});
|
|
856
773
|
});
|
|
857
774
|
});
|