@dxos/echo 0.8.4-main.67995b8 → 0.8.4-main.69d29f4
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 -3
- package/dist/lib/browser/Annotation.mjs +33 -0
- package/dist/lib/browser/Annotation.mjs.map +7 -0
- package/dist/lib/browser/Database.mjs +18 -0
- package/dist/lib/browser/Database.mjs.map +7 -0
- package/dist/lib/browser/Entity.mjs +52 -0
- package/dist/lib/browser/Entity.mjs.map +7 -0
- package/dist/lib/browser/Err.mjs +11 -0
- package/dist/lib/browser/Err.mjs.map +7 -0
- package/dist/lib/browser/Filter.mjs +62 -0
- package/dist/lib/browser/Filter.mjs.map +7 -0
- package/dist/lib/browser/Format.mjs +67 -0
- package/dist/lib/browser/Format.mjs.map +7 -0
- package/dist/lib/browser/JsonSchema.mjs +20 -0
- package/dist/lib/browser/JsonSchema.mjs.map +7 -0
- package/dist/lib/browser/Key.mjs +13 -0
- package/dist/lib/browser/Key.mjs.map +7 -0
- package/dist/lib/browser/Obj.mjs +91 -0
- package/dist/lib/browser/Obj.mjs.map +7 -0
- package/dist/lib/browser/Order.mjs +13 -0
- package/dist/lib/browser/Order.mjs.map +7 -0
- package/dist/lib/browser/Query.mjs +27 -0
- package/dist/lib/browser/Query.mjs.map +7 -0
- package/dist/lib/browser/QueryResult.mjs +3 -0
- package/dist/lib/browser/QueryResult.mjs.map +7 -0
- package/dist/lib/browser/Ref.mjs +23 -0
- package/dist/lib/browser/Ref.mjs.map +7 -0
- package/dist/lib/browser/Relation.mjs +85 -0
- package/dist/lib/browser/Relation.mjs.map +7 -0
- package/dist/lib/browser/SchemaRegistry.mjs +3 -0
- package/dist/lib/browser/SchemaRegistry.mjs.map +7 -0
- package/dist/lib/browser/Tag.mjs +26 -0
- package/dist/lib/browser/Tag.mjs.map +7 -0
- package/dist/lib/browser/Type.mjs +48 -0
- package/dist/lib/browser/Type.mjs.map +7 -0
- package/dist/lib/browser/chunk-2RMVRVOB.mjs +250 -0
- package/dist/lib/browser/chunk-2RMVRVOB.mjs.map +7 -0
- package/dist/lib/browser/chunk-5RDNDPMX.mjs +74 -0
- package/dist/lib/browser/chunk-5RDNDPMX.mjs.map +7 -0
- package/dist/lib/browser/chunk-73M2G455.mjs +98 -0
- package/dist/lib/browser/chunk-73M2G455.mjs.map +7 -0
- package/dist/lib/browser/chunk-7STIBCP7.mjs +133 -0
- package/dist/lib/browser/chunk-7STIBCP7.mjs.map +7 -0
- package/dist/lib/browser/chunk-AFGYYVVQ.mjs +57 -0
- package/dist/lib/browser/chunk-AFGYYVVQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-BC6R4CAF.mjs +24 -0
- package/dist/lib/browser/chunk-BC6R4CAF.mjs.map +7 -0
- package/dist/lib/browser/chunk-BPYFLHWO.mjs +158 -0
- package/dist/lib/browser/chunk-BPYFLHWO.mjs.map +7 -0
- package/dist/lib/browser/chunk-CBPFF3ZO.mjs +204 -0
- package/dist/lib/browser/chunk-CBPFF3ZO.mjs.map +7 -0
- package/dist/lib/browser/chunk-CGS2ULMK.mjs +11 -0
- package/dist/lib/browser/chunk-CGS2ULMK.mjs.map +7 -0
- package/dist/lib/browser/chunk-CJ5YELTO.mjs +39 -0
- package/dist/lib/browser/chunk-CJ5YELTO.mjs.map +7 -0
- package/dist/lib/browser/chunk-FPOISFQK.mjs +40 -0
- package/dist/lib/browser/chunk-FPOISFQK.mjs.map +7 -0
- package/dist/lib/browser/chunk-INHXFXY5.mjs +22 -0
- package/dist/lib/browser/chunk-INHXFXY5.mjs.map +7 -0
- package/dist/lib/browser/chunk-IXVWLTG7.mjs +9 -0
- package/dist/lib/browser/chunk-IXVWLTG7.mjs.map +7 -0
- package/dist/lib/browser/chunk-JMKVF2YQ.mjs +43 -0
- package/dist/lib/browser/chunk-JMKVF2YQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-L4RXUJHJ.mjs +143 -0
- package/dist/lib/browser/chunk-L4RXUJHJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-MYCCGG2T.mjs +15 -0
- package/dist/lib/browser/chunk-MYCCGG2T.mjs.map +7 -0
- package/dist/lib/browser/chunk-PAM4KEXE.mjs +3847 -0
- package/dist/lib/browser/chunk-PAM4KEXE.mjs.map +7 -0
- package/dist/lib/browser/chunk-QIWDIPLR.mjs +41 -0
- package/dist/lib/browser/chunk-QIWDIPLR.mjs.map +7 -0
- package/dist/lib/browser/chunk-R3S54KRI.mjs +403 -0
- package/dist/lib/browser/chunk-R3S54KRI.mjs.map +7 -0
- package/dist/lib/browser/chunk-RK4Z4JUZ.mjs +283 -0
- package/dist/lib/browser/chunk-RK4Z4JUZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-TPIL3G6Y.mjs +288 -0
- package/dist/lib/browser/chunk-TPIL3G6Y.mjs.map +7 -0
- package/dist/lib/browser/chunk-YKTSSMDS.mjs +69 -0
- package/dist/lib/browser/chunk-YKTSSMDS.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZHXZGIXD.mjs +9 -0
- package/dist/lib/browser/chunk-ZHXZGIXD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +72 -9
- package/dist/lib/browser/internal/index.mjs +457 -0
- package/dist/lib/browser/internal/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +332 -35
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/Annotation.mjs +33 -0
- package/dist/lib/node-esm/Annotation.mjs.map +7 -0
- package/dist/lib/node-esm/Database.mjs +18 -0
- package/dist/lib/node-esm/Database.mjs.map +7 -0
- package/dist/lib/node-esm/Entity.mjs +52 -0
- package/dist/lib/node-esm/Entity.mjs.map +7 -0
- package/dist/lib/node-esm/Err.mjs +11 -0
- package/dist/lib/node-esm/Err.mjs.map +7 -0
- package/dist/lib/node-esm/Filter.mjs +62 -0
- package/dist/lib/node-esm/Filter.mjs.map +7 -0
- package/dist/lib/node-esm/Format.mjs +67 -0
- package/dist/lib/node-esm/Format.mjs.map +7 -0
- package/dist/lib/node-esm/JsonSchema.mjs +20 -0
- package/dist/lib/node-esm/JsonSchema.mjs.map +7 -0
- package/dist/lib/node-esm/Key.mjs +13 -0
- package/dist/lib/node-esm/Key.mjs.map +7 -0
- package/dist/lib/node-esm/Obj.mjs +91 -0
- package/dist/lib/node-esm/Obj.mjs.map +7 -0
- package/dist/lib/node-esm/Order.mjs +13 -0
- package/dist/lib/node-esm/Order.mjs.map +7 -0
- package/dist/lib/node-esm/Query.mjs +27 -0
- package/dist/lib/node-esm/Query.mjs.map +7 -0
- package/dist/lib/node-esm/QueryResult.mjs +3 -0
- package/dist/lib/node-esm/QueryResult.mjs.map +7 -0
- package/dist/lib/node-esm/Ref.mjs +23 -0
- package/dist/lib/node-esm/Ref.mjs.map +7 -0
- package/dist/lib/node-esm/Relation.mjs +85 -0
- package/dist/lib/node-esm/Relation.mjs.map +7 -0
- package/dist/lib/node-esm/SchemaRegistry.mjs +3 -0
- package/dist/lib/node-esm/SchemaRegistry.mjs.map +7 -0
- package/dist/lib/node-esm/Tag.mjs +26 -0
- package/dist/lib/node-esm/Tag.mjs.map +7 -0
- package/dist/lib/node-esm/Type.mjs +48 -0
- package/dist/lib/node-esm/Type.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2RIFBW3A.mjs +250 -0
- package/dist/lib/node-esm/chunk-2RIFBW3A.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5CB2ZW74.mjs +57 -0
- package/dist/lib/node-esm/chunk-5CB2ZW74.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5U5F4AWK.mjs +3847 -0
- package/dist/lib/node-esm/chunk-5U5F4AWK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-AJEMYSIR.mjs +22 -0
- package/dist/lib/node-esm/chunk-AJEMYSIR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BKYE5IW6.mjs +158 -0
- package/dist/lib/node-esm/chunk-BKYE5IW6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BYOD7EVP.mjs +98 -0
- package/dist/lib/node-esm/chunk-BYOD7EVP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FWTSPIFF.mjs +133 -0
- package/dist/lib/node-esm/chunk-FWTSPIFF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-K37NA7PO.mjs +43 -0
- package/dist/lib/node-esm/chunk-K37NA7PO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LIXUCQJM.mjs +41 -0
- package/dist/lib/node-esm/chunk-LIXUCQJM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MOLNWFNL.mjs +9 -0
- package/dist/lib/node-esm/chunk-MOLNWFNL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MOWUEW5P.mjs +15 -0
- package/dist/lib/node-esm/chunk-MOWUEW5P.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NBWL7UCZ.mjs +40 -0
- package/dist/lib/node-esm/chunk-NBWL7UCZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OZEDKT4R.mjs +204 -0
- package/dist/lib/node-esm/chunk-OZEDKT4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PW3VCWL5.mjs +24 -0
- package/dist/lib/node-esm/chunk-PW3VCWL5.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TSTKBFST.mjs +403 -0
- package/dist/lib/node-esm/chunk-TSTKBFST.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UKGVOINP.mjs +9 -0
- package/dist/lib/node-esm/chunk-UKGVOINP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UV63HEHQ.mjs +143 -0
- package/dist/lib/node-esm/chunk-UV63HEHQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WXLVPCRJ.mjs +288 -0
- package/dist/lib/node-esm/chunk-WXLVPCRJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WZ6YBELW.mjs +74 -0
- package/dist/lib/node-esm/chunk-WZ6YBELW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XHJRMQZD.mjs +69 -0
- package/dist/lib/node-esm/chunk-XHJRMQZD.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YOLH5KS4.mjs +283 -0
- package/dist/lib/node-esm/chunk-YOLH5KS4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YQ2NWGL5.mjs +39 -0
- package/dist/lib/node-esm/chunk-YQ2NWGL5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +72 -9
- package/dist/lib/node-esm/internal/index.mjs +457 -0
- package/dist/lib/node-esm/internal/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +332 -35
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/Annotation.d.ts +2 -0
- package/dist/types/src/Annotation.d.ts.map +1 -0
- package/dist/types/src/Database.d.ts +194 -0
- package/dist/types/src/Database.d.ts.map +1 -0
- package/dist/types/src/Entity.d.ts +142 -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 +64 -0
- package/dist/types/src/Err.d.ts.map +1 -0
- package/dist/types/src/Filter.d.ts +120 -0
- package/dist/types/src/Filter.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 +60 -0
- package/dist/types/src/Hypergraph.d.ts.map +1 -0
- package/dist/types/src/JsonSchema.d.ts +9 -0
- package/dist/types/src/JsonSchema.d.ts.map +1 -0
- package/dist/types/src/Key.d.ts +1 -0
- package/dist/types/src/Key.d.ts.map +1 -1
- package/dist/types/src/Obj.d.ts +344 -35
- 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 +115 -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 +13 -11
- package/dist/types/src/Ref.d.ts.map +1 -1
- package/dist/types/src/Relation.d.ts +242 -19
- 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 +84 -0
- package/dist/types/src/SchemaRegistry.d.ts.map +1 -0
- package/dist/types/src/Tag.d.ts +17 -0
- package/dist/types/src/Tag.d.ts.map +1 -0
- package/dist/types/src/Type.d.ts +225 -73
- 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/index.d.ts +15 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/internal/annotations/annotations.d.ts +170 -0
- package/dist/types/src/internal/annotations/annotations.d.ts.map +1 -0
- package/dist/types/src/internal/annotations/annotations.test.d.ts +2 -0
- package/dist/types/src/internal/annotations/annotations.test.d.ts.map +1 -0
- package/dist/types/src/internal/annotations/index.d.ts +3 -0
- package/dist/types/src/internal/annotations/index.d.ts.map +1 -0
- package/dist/types/src/internal/annotations/util.d.ts +27 -0
- package/dist/types/src/internal/annotations/util.d.ts.map +1 -0
- package/dist/types/src/internal/api/annotations.d.ts +23 -0
- package/dist/types/src/internal/api/annotations.d.ts.map +1 -0
- package/dist/types/src/internal/api/entity.d.ts +13 -0
- package/dist/types/src/internal/api/entity.d.ts.map +1 -0
- package/dist/types/src/internal/api/index.d.ts +15 -0
- package/dist/types/src/internal/api/index.d.ts.map +1 -0
- package/dist/types/src/internal/api/meta.d.ts +42 -0
- package/dist/types/src/internal/api/meta.d.ts.map +1 -0
- package/dist/types/src/internal/api/sorting.d.ts +24 -0
- package/dist/types/src/internal/api/sorting.d.ts.map +1 -0
- package/dist/types/src/internal/api/version.d.ts +42 -0
- package/dist/types/src/internal/api/version.d.ts.map +1 -0
- package/dist/types/src/internal/entities/entity.d.ts +20 -0
- package/dist/types/src/internal/entities/entity.d.ts.map +1 -0
- package/dist/types/src/internal/entities/index.d.ts +6 -0
- package/dist/types/src/internal/entities/index.d.ts.map +1 -0
- package/dist/types/src/internal/entities/model.d.ts +77 -0
- package/dist/types/src/internal/entities/model.d.ts.map +1 -0
- package/dist/types/src/internal/entities/object.d.ts +18 -0
- package/dist/types/src/internal/entities/object.d.ts.map +1 -0
- package/dist/types/src/internal/entities/relation.d.ts +62 -0
- package/dist/types/src/internal/entities/relation.d.ts.map +1 -0
- package/dist/types/src/internal/entities/util.d.ts +2 -0
- package/dist/types/src/internal/entities/util.d.ts.map +1 -0
- package/dist/types/src/internal/formats/date.d.ts +63 -0
- package/dist/types/src/internal/formats/date.d.ts.map +1 -0
- package/dist/types/src/internal/formats/date.test.d.ts +2 -0
- package/dist/types/src/internal/formats/date.test.d.ts.map +1 -0
- package/dist/types/src/internal/formats/format.d.ts +32 -0
- package/dist/types/src/internal/formats/format.d.ts.map +1 -0
- package/dist/types/src/internal/formats/format.test.d.ts +2 -0
- package/dist/types/src/internal/formats/format.test.d.ts.map +1 -0
- package/dist/types/src/internal/formats/index.d.ts +8 -0
- package/dist/types/src/internal/formats/index.d.ts.map +1 -0
- package/dist/types/src/internal/formats/number.d.ts +31 -0
- package/dist/types/src/internal/formats/number.d.ts.map +1 -0
- package/dist/types/src/internal/formats/object.d.ts +35 -0
- package/dist/types/src/internal/formats/object.d.ts.map +1 -0
- package/dist/types/src/internal/formats/select.d.ts +13 -0
- package/dist/types/src/internal/formats/select.d.ts.map +1 -0
- package/dist/types/src/internal/formats/string.d.ts +42 -0
- package/dist/types/src/internal/formats/string.d.ts.map +1 -0
- package/dist/types/src/internal/formats/types.d.ts +72 -0
- package/dist/types/src/internal/formats/types.d.ts.map +1 -0
- package/dist/types/src/internal/index.d.ts +12 -0
- package/dist/types/src/internal/index.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/annotations.d.ts +19 -0
- package/dist/types/src/internal/json-schema/annotations.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/effect-schema.test.d.ts +2 -0
- package/dist/types/src/internal/json-schema/effect-schema.test.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/index.d.ts +5 -0
- package/dist/types/src/internal/json-schema/index.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/json-schema-normalize.d.ts +7 -0
- package/dist/types/src/internal/json-schema/json-schema-normalize.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/json-schema-type.d.ts +351 -0
- package/dist/types/src/internal/json-schema/json-schema-type.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/json-schema.d.ts +30 -0
- package/dist/types/src/internal/json-schema/json-schema.d.ts.map +1 -0
- package/dist/types/src/internal/json-schema/json-schema.test.d.ts +2 -0
- package/dist/types/src/internal/json-schema/json-schema.test.d.ts.map +1 -0
- package/dist/types/src/internal/object/clone.d.ts +8 -0
- package/dist/types/src/internal/object/clone.d.ts.map +1 -0
- package/dist/types/src/internal/object/common.d.ts +18 -0
- package/dist/types/src/internal/object/common.d.ts.map +1 -0
- package/dist/types/src/internal/object/create-object.d.ts +39 -0
- package/dist/types/src/internal/object/create-object.d.ts.map +1 -0
- package/dist/types/src/internal/object/create-object.test.d.ts +2 -0
- package/dist/types/src/internal/object/create-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/object/deleted.d.ts +6 -0
- package/dist/types/src/internal/object/deleted.d.ts.map +1 -0
- package/dist/types/src/internal/object/ids.d.ts +6 -0
- package/dist/types/src/internal/object/ids.d.ts.map +1 -0
- package/dist/types/src/internal/object/index.d.ts +11 -0
- package/dist/types/src/internal/object/index.d.ts.map +1 -0
- package/dist/types/src/internal/object/inspect.d.ts +2 -0
- package/dist/types/src/internal/object/inspect.d.ts.map +1 -0
- package/dist/types/src/internal/object/json-serializer.d.ts +37 -0
- package/dist/types/src/internal/object/json-serializer.d.ts.map +1 -0
- package/dist/types/src/internal/object/json-serializer.test.d.ts +2 -0
- package/dist/types/src/internal/object/json-serializer.test.d.ts.map +1 -0
- package/dist/types/src/internal/object/schema-validator.d.ts +2 -0
- package/dist/types/src/internal/object/schema-validator.d.ts.map +1 -0
- package/dist/types/src/internal/object/schema-validator.test.d.ts +2 -0
- package/dist/types/src/internal/object/schema-validator.test.d.ts.map +1 -0
- package/dist/types/src/internal/object/set-value.d.ts +7 -0
- package/dist/types/src/internal/object/set-value.d.ts.map +1 -0
- package/dist/types/src/internal/object/set-value.test.d.ts +2 -0
- package/dist/types/src/internal/object/set-value.test.d.ts.map +1 -0
- package/dist/types/src/internal/object/snapshot.d.ts +6 -0
- package/dist/types/src/internal/object/snapshot.d.ts.map +1 -0
- package/dist/types/src/internal/object/typed-object.d.ts +25 -0
- package/dist/types/src/internal/object/typed-object.d.ts.map +1 -0
- package/dist/types/src/internal/object/typed-object.test.d.ts +2 -0
- package/dist/types/src/internal/object/typed-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/change-context.d.ts +55 -0
- package/dist/types/src/internal/proxy/change-context.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/change.test.d.ts +2 -0
- package/dist/types/src/internal/proxy/change.test.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/define-hidden-property.d.ts +5 -0
- package/dist/types/src/internal/proxy/define-hidden-property.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/errors.d.ts +19 -0
- package/dist/types/src/internal/proxy/errors.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/event-batch.d.ts +10 -0
- package/dist/types/src/internal/proxy/event-batch.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/handler.test.d.ts +2 -0
- package/dist/types/src/internal/proxy/handler.test.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/index.d.ts +14 -0
- package/dist/types/src/internal/proxy/index.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/json-serializer.d.ts +6 -0
- package/dist/types/src/internal/proxy/json-serializer.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/make-object.d.ts +14 -0
- package/dist/types/src/internal/proxy/make-object.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/ownership.d.ts +57 -0
- package/dist/types/src/internal/proxy/ownership.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/proxy-types.d.ts +18 -0
- package/dist/types/src/internal/proxy/proxy-types.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/proxy-utils.d.ts +47 -0
- package/dist/types/src/internal/proxy/proxy-utils.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/reactive-array.d.ts +8 -0
- package/dist/types/src/internal/proxy/reactive-array.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/reactive.d.ts +39 -0
- package/dist/types/src/internal/proxy/reactive.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/schema-validator.d.ts +15 -0
- package/dist/types/src/internal/proxy/schema-validator.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/schema.test.d.ts +2 -0
- package/dist/types/src/internal/proxy/schema.test.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/symbols.d.ts +3 -0
- package/dist/types/src/internal/proxy/symbols.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/typed-handler.d.ts +47 -0
- package/dist/types/src/internal/proxy/typed-handler.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/typed-handler.test.d.ts +2 -0
- package/dist/types/src/internal/proxy/typed-handler.test.d.ts.map +1 -0
- package/dist/types/src/internal/proxy/typed-object.test.d.ts +2 -0
- package/dist/types/src/internal/proxy/typed-object.test.d.ts.map +1 -0
- package/dist/types/src/internal/ref/index.d.ts +3 -0
- package/dist/types/src/internal/ref/index.d.ts.map +1 -0
- package/dist/types/src/internal/ref/ref-array.d.ts +21 -0
- package/dist/types/src/internal/ref/ref-array.d.ts.map +1 -0
- package/dist/types/src/internal/ref/ref.d.ts +218 -0
- package/dist/types/src/internal/ref/ref.d.ts.map +1 -0
- package/dist/types/src/internal/ref/ref.test.d.ts +2 -0
- package/dist/types/src/internal/ref/ref.test.d.ts.map +1 -0
- package/dist/types/src/internal/schema/compose.d.ts +7 -0
- package/dist/types/src/internal/schema/compose.d.ts.map +1 -0
- package/dist/types/src/internal/schema/compose.test.d.ts +2 -0
- package/dist/types/src/internal/schema/compose.test.d.ts.map +1 -0
- package/dist/types/src/internal/schema/echo-schema.d.ts +180 -0
- package/dist/types/src/internal/schema/echo-schema.d.ts.map +1 -0
- package/dist/types/src/internal/schema/index.d.ts +4 -0
- package/dist/types/src/internal/schema/index.d.ts.map +1 -0
- package/dist/types/src/internal/schema/manipulation.d.ts +10 -0
- package/dist/types/src/internal/schema/manipulation.d.ts.map +1 -0
- package/dist/types/src/internal/schema/persistent-schema.d.ts +20 -0
- package/dist/types/src/internal/schema/persistent-schema.d.ts.map +1 -0
- package/dist/types/src/internal/types/base.d.ts +26 -0
- package/dist/types/src/internal/types/base.d.ts.map +1 -0
- package/dist/types/src/internal/types/entity.d.ts +37 -0
- package/dist/types/src/internal/types/entity.d.ts.map +1 -0
- package/dist/types/src/internal/types/index.d.ts +6 -0
- package/dist/types/src/internal/types/index.d.ts.map +1 -0
- package/dist/types/src/internal/types/meta.d.ts +32 -0
- package/dist/types/src/internal/types/meta.d.ts.map +1 -0
- package/dist/types/src/internal/types/typename.d.ts +13 -0
- package/dist/types/src/internal/types/typename.d.ts.map +1 -0
- package/dist/types/src/internal/types/version.d.ts +15 -0
- package/dist/types/src/internal/types/version.d.ts.map +1 -0
- package/dist/types/src/{test → testing}/api.test.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +3 -1
- 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 +303 -0
- package/dist/types/src/testing/test-schema.d.ts.map +1 -0
- package/dist/types/src/testing/util.d.ts +21 -0
- package/dist/types/src/testing/util.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +169 -42
- package/src/Annotation.ts +18 -0
- package/src/Database.ts +336 -0
- package/src/Entity.test.ts +22 -0
- package/src/Entity.ts +217 -0
- package/src/Err.ts +18 -0
- package/src/Filter.ts +376 -0
- package/src/Format.ts +9 -0
- package/src/Hypergraph.ts +74 -0
- package/src/JsonSchema.ts +16 -0
- package/src/Key.ts +3 -0
- package/src/Obj.test.ts +386 -0
- package/src/Obj.ts +508 -84
- package/src/Order.ts +44 -0
- package/src/Query.test.ts +465 -0
- package/src/Query.ts +296 -0
- package/src/QueryResult.ts +106 -0
- package/src/Ref.ts +25 -9
- package/src/Relation.test.ts +82 -0
- package/src/Relation.ts +414 -51
- package/src/SchemaRegistry.ts +105 -0
- package/src/Tag.ts +40 -0
- package/src/Type.test.ts +52 -0
- package/src/Type.ts +360 -112
- package/src/index.ts +17 -4
- package/src/internal/README.md +102 -0
- package/src/internal/annotations/annotations.test.ts +96 -0
- package/src/internal/annotations/annotations.ts +460 -0
- package/src/internal/annotations/index.ts +6 -0
- package/src/internal/annotations/util.ts +72 -0
- package/src/internal/api/annotations.ts +60 -0
- package/src/internal/api/entity.ts +29 -0
- package/src/internal/api/index.ts +19 -0
- package/src/internal/api/meta.ts +88 -0
- package/src/internal/api/sorting.ts +53 -0
- package/src/internal/api/version.ts +96 -0
- package/src/internal/entities/entity.ts +126 -0
- package/src/internal/entities/index.ts +9 -0
- package/src/internal/entities/model.ts +134 -0
- package/src/internal/entities/object.ts +58 -0
- package/src/internal/entities/relation.ts +171 -0
- package/src/internal/entities/util.ts +33 -0
- package/src/internal/formats/date.test.ts +56 -0
- package/src/internal/formats/date.ts +217 -0
- package/src/internal/formats/format.test.ts +77 -0
- package/src/internal/formats/format.ts +54 -0
- package/src/internal/formats/index.ts +12 -0
- package/src/internal/formats/number.ts +89 -0
- package/src/internal/formats/object.ts +80 -0
- package/src/internal/formats/select.ts +18 -0
- package/src/internal/formats/string.ts +81 -0
- package/src/internal/formats/types.ts +186 -0
- package/src/internal/index.ts +39 -0
- package/src/internal/json-schema/annotations.ts +50 -0
- package/src/internal/json-schema/effect-schema.test.ts +143 -0
- package/src/internal/json-schema/index.ts +8 -0
- package/src/internal/json-schema/json-schema-normalize.ts +111 -0
- package/src/internal/json-schema/json-schema-type.ts +403 -0
- package/src/internal/json-schema/json-schema.test.ts +861 -0
- package/src/internal/json-schema/json-schema.ts +532 -0
- package/src/internal/object/clone.ts +48 -0
- package/src/internal/object/common.ts +75 -0
- package/src/internal/object/create-object.test.ts +116 -0
- package/src/internal/object/create-object.ts +95 -0
- package/src/internal/object/deleted.ts +19 -0
- package/src/internal/object/ids.ts +12 -0
- package/src/internal/object/index.ts +14 -0
- package/src/internal/object/inspect.ts +46 -0
- package/src/internal/object/json-serializer.test.ts +98 -0
- package/src/internal/object/json-serializer.ts +188 -0
- package/src/internal/object/schema-validator.test.ts +182 -0
- package/src/internal/object/schema-validator.ts +6 -0
- package/src/internal/object/set-value.test.ts +281 -0
- package/src/internal/object/set-value.ts +165 -0
- package/src/internal/object/snapshot.ts +70 -0
- package/src/internal/object/typed-object.test.ts +34 -0
- package/src/internal/object/typed-object.ts +30 -0
- package/src/internal/proxy/change-context.ts +138 -0
- package/src/internal/proxy/change.test.ts +519 -0
- package/src/internal/proxy/define-hidden-property.ts +14 -0
- package/src/internal/proxy/errors.ts +42 -0
- package/src/internal/proxy/event-batch.ts +44 -0
- package/src/internal/proxy/handler.test.ts +123 -0
- package/src/internal/proxy/index.ts +17 -0
- package/src/internal/proxy/json-serializer.ts +87 -0
- package/src/internal/proxy/make-object.ts +96 -0
- package/src/internal/proxy/ownership.ts +253 -0
- package/src/internal/proxy/proxy-types.ts +23 -0
- package/src/internal/proxy/proxy-utils.ts +150 -0
- package/src/internal/proxy/reactive-array.ts +71 -0
- package/src/internal/proxy/reactive.ts +69 -0
- package/src/internal/proxy/schema-validator.ts +244 -0
- package/src/internal/proxy/schema.test.ts +145 -0
- package/src/internal/proxy/symbols.ts +7 -0
- package/src/internal/proxy/typed-handler.test.ts +314 -0
- package/src/internal/proxy/typed-handler.ts +442 -0
- package/src/internal/proxy/typed-object.test.ts +116 -0
- package/src/internal/ref/index.ts +6 -0
- package/src/internal/ref/ref-array.ts +39 -0
- package/src/internal/ref/ref.test.ts +101 -0
- package/src/internal/ref/ref.ts +549 -0
- package/src/internal/schema/compose.test.ts +42 -0
- package/src/internal/schema/compose.ts +41 -0
- package/src/internal/schema/echo-schema.ts +423 -0
- package/src/internal/schema/index.ts +7 -0
- package/src/internal/schema/manipulation.ts +92 -0
- package/src/internal/schema/persistent-schema.ts +27 -0
- package/src/internal/types/base.ts +43 -0
- package/src/internal/types/entity.ts +54 -0
- package/src/internal/types/index.ts +9 -0
- package/src/internal/types/meta.ts +65 -0
- package/src/internal/types/typename.ts +45 -0
- package/src/internal/types/version.ts +20 -0
- package/src/testing/api.test.ts +126 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +130 -0
- package/src/testing/test-schema.ts +238 -0
- package/src/testing/util.ts +85 -0
- package/dist/lib/browser/chunk-EUA7CM23.mjs +0 -619
- package/dist/lib/browser/chunk-EUA7CM23.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IV6BWGHK.mjs +0 -619
- package/dist/lib/node-esm/chunk-IV6BWGHK.mjs.map +0 -7
- package/dist/types/src/experimental/database.d.ts +0 -8
- package/dist/types/src/experimental/database.d.ts.map +0 -1
- package/dist/types/src/experimental/index.d.ts +0 -1
- package/dist/types/src/experimental/index.d.ts.map +0 -1
- package/dist/types/src/experimental/queue.d.ts +0 -8
- package/dist/types/src/experimental/queue.d.ts.map +0 -1
- package/dist/types/src/experimental/space.d.ts +0 -8
- package/dist/types/src/experimental/space.d.ts.map +0 -1
- package/dist/types/src/query/dsl.d.ts +0 -218
- package/dist/types/src/query/dsl.d.ts.map +0 -1
- package/dist/types/src/query/dsl.test.d.ts +0 -2
- package/dist/types/src/query/dsl.test.d.ts.map +0 -1
- package/dist/types/src/query/index.d.ts +0 -2
- package/dist/types/src/query/index.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/experimental/database.ts +0 -11
- package/src/experimental/index.ts +0 -7
- package/src/experimental/queue.ts +0 -11
- package/src/experimental/space.ts +0 -11
- package/src/query/dsl.test.ts +0 -323
- package/src/query/dsl.ts +0 -646
- package/src/query/index.ts +0 -5
- package/src/test/api.test.ts +0 -173
- package/src/testing/types.ts +0 -91
- /package/dist/types/src/{test → testing}/api.test.d.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
7
|
+
|
|
8
|
+
import { invariant } from '@dxos/invariant';
|
|
9
|
+
|
|
10
|
+
import { type TypeAnnotation, TypeAnnotationId, type TypeMeta, makeTypeJsonSchemaAnnotation } from '../annotations';
|
|
11
|
+
import { EntityKind } from '../types';
|
|
12
|
+
|
|
13
|
+
import { type EchoTypeSchema, makeEchoTypeSchema } from './entity';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Object schema type with kind marker.
|
|
17
|
+
*/
|
|
18
|
+
export type EchoObjectSchema<
|
|
19
|
+
Self extends Schema.Schema.Any,
|
|
20
|
+
Fields extends Schema.Struct.Fields = Schema.Struct.Fields,
|
|
21
|
+
> = EchoTypeSchema<Self, {}, EntityKind.Object, Fields>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Schema for Obj entity types.
|
|
25
|
+
* Pipeable function to add ECHO object annotations to a schema.
|
|
26
|
+
*/
|
|
27
|
+
export const EchoObjectSchema: {
|
|
28
|
+
(
|
|
29
|
+
meta: TypeMeta,
|
|
30
|
+
): <Self extends Schema.Schema.Any, Fields extends Schema.Struct.Fields = Schema.Struct.Fields>(
|
|
31
|
+
self: Self & { fields?: Fields },
|
|
32
|
+
) => EchoObjectSchema<Self, Fields>;
|
|
33
|
+
} = ({ typename, version }) => {
|
|
34
|
+
return <Self extends Schema.Schema.Any, Fields extends Schema.Struct.Fields = Schema.Struct.Fields>(
|
|
35
|
+
self: Self & { fields?: Fields },
|
|
36
|
+
): EchoObjectSchema<Self, Fields> => {
|
|
37
|
+
invariant(typeof TypeAnnotationId === 'symbol', 'Sanity.');
|
|
38
|
+
invariant(SchemaAST.isTypeLiteral(self.ast), 'Schema must be a TypeLiteral.');
|
|
39
|
+
|
|
40
|
+
// Extract fields from the schema if available (Struct schemas have .fields).
|
|
41
|
+
const fields = ((self as any).fields ?? {}) as Fields;
|
|
42
|
+
|
|
43
|
+
const schemaWithId = Schema.extend(self, Schema.Struct({ id: Schema.String }));
|
|
44
|
+
const ast = SchemaAST.annotations(schemaWithId.ast, {
|
|
45
|
+
// TODO(dmaretskyi): `extend` kills the annotations.
|
|
46
|
+
...self.ast.annotations,
|
|
47
|
+
[TypeAnnotationId]: { kind: EntityKind.Object, typename, version } satisfies TypeAnnotation,
|
|
48
|
+
// TODO(dmaretskyi): TypeIdentifierAnnotationId?
|
|
49
|
+
[SchemaAST.JSONSchemaAnnotationId]: makeTypeJsonSchemaAnnotation({
|
|
50
|
+
kind: EntityKind.Object,
|
|
51
|
+
typename,
|
|
52
|
+
version,
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return makeEchoTypeSchema<Self, EntityKind.Object, Fields>(fields, ast, typename, version, EntityKind.Object);
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
7
|
+
|
|
8
|
+
import { raise } from '@dxos/debug';
|
|
9
|
+
import { assertArgument, invariant } from '@dxos/invariant';
|
|
10
|
+
import { DXN } from '@dxos/keys';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
type TypeAnnotation,
|
|
14
|
+
TypeAnnotationId,
|
|
15
|
+
type TypeMeta,
|
|
16
|
+
getEntityKind,
|
|
17
|
+
getSchemaTypename,
|
|
18
|
+
getTypeIdentifierAnnotation,
|
|
19
|
+
makeTypeJsonSchemaAnnotation,
|
|
20
|
+
} from '../annotations';
|
|
21
|
+
import { EntityKind } from '../types';
|
|
22
|
+
|
|
23
|
+
import { type EchoTypeSchema, makeEchoTypeSchema } from './entity';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Property name for relation source when object is serialized to JSON.
|
|
27
|
+
*/
|
|
28
|
+
export const ATTR_RELATION_SOURCE = '@relationSource';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Used to access relation source ref on live ECHO objects.
|
|
32
|
+
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
33
|
+
*/
|
|
34
|
+
export const RelationSourceId: unique symbol = Symbol.for('@dxos/echo/RelationSource');
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Used to access relation source ref on live ECHO objects.
|
|
38
|
+
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
39
|
+
*/
|
|
40
|
+
export const RelationSourceDXNId: unique symbol = Symbol.for('@dxos/echo/RelationSourceDXN');
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Property name for relation target when object is serialized to JSON.
|
|
44
|
+
*/
|
|
45
|
+
export const ATTR_RELATION_TARGET = '@relationTarget';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Used to access relation target ref on live ECHO objects.
|
|
49
|
+
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
50
|
+
*/
|
|
51
|
+
export const RelationTargetId: unique symbol = Symbol.for('@dxos/echo/RelationTarget');
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Used to access relation target ref on live ECHO objects.
|
|
55
|
+
* Reading this symbol must return `Live<EchoObjectSchema<any>>` or a DXN.
|
|
56
|
+
*/
|
|
57
|
+
export const RelationTargetDXNId: unique symbol = Symbol.for('@dxos/echo/RelationTargetDXN');
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Source and target props on relations.
|
|
61
|
+
*/
|
|
62
|
+
// TODO(burdon): any?
|
|
63
|
+
export type RelationSourceTargetRefs<Source = any, Target = any> = {
|
|
64
|
+
/**
|
|
65
|
+
* Source ECHO live object.
|
|
66
|
+
*/
|
|
67
|
+
[RelationSourceId]: Source;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Target ECHO live object.
|
|
71
|
+
*/
|
|
72
|
+
[RelationTargetId]: Target;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type RelationSource<R> = R extends RelationSourceTargetRefs<infer Source, infer _Target> ? Source : never;
|
|
76
|
+
export type RelationTarget<R> = R extends RelationSourceTargetRefs<infer _Source, infer Target> ? Target : never;
|
|
77
|
+
|
|
78
|
+
export type EchoRelationSchemaOptions<
|
|
79
|
+
TSource extends Schema.Schema.AnyNoContext,
|
|
80
|
+
TTarget extends Schema.Schema.AnyNoContext,
|
|
81
|
+
> = TypeMeta & {
|
|
82
|
+
source: TSource;
|
|
83
|
+
target: TTarget;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Relation schema type with kind marker.
|
|
88
|
+
*/
|
|
89
|
+
export type EchoRelationSchema<
|
|
90
|
+
Self extends Schema.Schema.Any,
|
|
91
|
+
Source extends Schema.Schema.AnyNoContext,
|
|
92
|
+
Target extends Schema.Schema.AnyNoContext,
|
|
93
|
+
Fields extends Schema.Struct.Fields = Schema.Struct.Fields,
|
|
94
|
+
> = EchoTypeSchema<
|
|
95
|
+
Self,
|
|
96
|
+
RelationSourceTargetRefs<Schema.Schema.Type<Source>, Schema.Schema.Type<Target>>,
|
|
97
|
+
EntityKind.Relation,
|
|
98
|
+
Fields
|
|
99
|
+
>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Schema for Relation entity types.
|
|
103
|
+
*/
|
|
104
|
+
export const EchoRelationSchema = <
|
|
105
|
+
Source extends Schema.Schema.AnyNoContext,
|
|
106
|
+
Target extends Schema.Schema.AnyNoContext,
|
|
107
|
+
>({
|
|
108
|
+
source,
|
|
109
|
+
target,
|
|
110
|
+
typename,
|
|
111
|
+
version,
|
|
112
|
+
}: EchoRelationSchemaOptions<Source, Target>) => {
|
|
113
|
+
assertArgument(Schema.isSchema(source), 'source');
|
|
114
|
+
assertArgument(Schema.isSchema(target), 'target');
|
|
115
|
+
const sourceDXN = getDXNForRelationSchemaRef(source);
|
|
116
|
+
const targetDXN = getDXNForRelationSchemaRef(target);
|
|
117
|
+
if (getEntityKind(source) !== EntityKind.Object) {
|
|
118
|
+
raise(new Error('Source schema must be an echo object schema.'));
|
|
119
|
+
}
|
|
120
|
+
if (getEntityKind(target) !== EntityKind.Object) {
|
|
121
|
+
raise(new Error('Target schema must be an echo object schema.'));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return <Self extends Schema.Schema.Any, Fields extends Schema.Struct.Fields = Schema.Struct.Fields>(
|
|
125
|
+
self: Self & { fields?: Fields },
|
|
126
|
+
): EchoRelationSchema<Self, Source, Target, Fields> => {
|
|
127
|
+
invariant(SchemaAST.isTypeLiteral(self.ast), 'Schema must be a TypeLiteral.');
|
|
128
|
+
|
|
129
|
+
// Extract fields from the schema if available (Struct schemas have .fields).
|
|
130
|
+
const fields = ((self as any).fields ?? {}) as Fields;
|
|
131
|
+
|
|
132
|
+
const schemaWithId = Schema.extend(self, Schema.Struct({ id: Schema.String }));
|
|
133
|
+
const ast = SchemaAST.annotations(schemaWithId.ast, {
|
|
134
|
+
// TODO(dmaretskyi): `extend` kills the annotations.
|
|
135
|
+
...self.ast.annotations,
|
|
136
|
+
[TypeAnnotationId]: {
|
|
137
|
+
kind: EntityKind.Relation,
|
|
138
|
+
typename,
|
|
139
|
+
version,
|
|
140
|
+
sourceSchema: sourceDXN,
|
|
141
|
+
targetSchema: targetDXN,
|
|
142
|
+
} satisfies TypeAnnotation,
|
|
143
|
+
// TODO(dmaretskyi): TypeIdentifierAnnotationId?
|
|
144
|
+
|
|
145
|
+
[SchemaAST.JSONSchemaAnnotationId]: makeTypeJsonSchemaAnnotation({
|
|
146
|
+
kind: EntityKind.Relation,
|
|
147
|
+
typename,
|
|
148
|
+
version,
|
|
149
|
+
relationSource: sourceDXN,
|
|
150
|
+
relationTarget: targetDXN,
|
|
151
|
+
}),
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
return makeEchoTypeSchema<Self, EntityKind.Relation, Fields>(fields, ast, typename, version, EntityKind.Relation);
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const getDXNForRelationSchemaRef = (schema: Schema.Schema.Any): string => {
|
|
159
|
+
assertArgument(Schema.isSchema(schema), 'schema');
|
|
160
|
+
const identifier = getTypeIdentifierAnnotation(schema);
|
|
161
|
+
if (identifier) {
|
|
162
|
+
return identifier;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const typename = getSchemaTypename(schema);
|
|
166
|
+
if (!typename) {
|
|
167
|
+
throw new Error('Schema must have a typename');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return DXN.fromTypename(typename).toString();
|
|
171
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import { assertArgument, invariant } from '@dxos/invariant';
|
|
8
|
+
import { DXN, ObjectId } from '@dxos/keys';
|
|
9
|
+
import { assumeType } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
import { type InternalObjectProps, SelfDXNId } from './model';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns a DXN for an object or schema.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export const getObjectDXN = (object: any): DXN | undefined => {
|
|
19
|
+
invariant(!Schema.isSchema(object), 'schema not allowed in this function');
|
|
20
|
+
assertArgument(typeof object === 'object' && object != null, 'object', 'expected object');
|
|
21
|
+
assumeType<InternalObjectProps>(object);
|
|
22
|
+
|
|
23
|
+
if (object[SelfDXNId]) {
|
|
24
|
+
invariant(object[SelfDXNId] instanceof DXN, 'Invalid object model: invalid self dxn');
|
|
25
|
+
return object[SelfDXNId];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!ObjectId.isValid(object.id)) {
|
|
29
|
+
throw new TypeError('Object id is not valid.');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return DXN.fromLocalObjectId(object.id);
|
|
33
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import { describe, expect, test } from 'vitest';
|
|
7
|
+
|
|
8
|
+
import { log } from '@dxos/log';
|
|
9
|
+
|
|
10
|
+
import { toJsonSchema } from '../json-schema';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
DateOnly,
|
|
14
|
+
DateTime,
|
|
15
|
+
type SimpleDate,
|
|
16
|
+
type SimpleDateTime,
|
|
17
|
+
type SimpleTime,
|
|
18
|
+
TimeOnly,
|
|
19
|
+
toSimpleDate,
|
|
20
|
+
toSimpleTime,
|
|
21
|
+
} from './date';
|
|
22
|
+
|
|
23
|
+
describe.skip('date', () => {
|
|
24
|
+
test('basic', () => {
|
|
25
|
+
const date = new Date('2024-12-31T23:59:59Z');
|
|
26
|
+
expect(toSimpleDate(date)).to.deep.eq({ year: 2024, month: 12, day: 31 });
|
|
27
|
+
expect(toSimpleTime(date)).to.deep.eq({ hours: 23, minutes: 59, seconds: 59 });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('Date', ({ expect }) => {
|
|
31
|
+
const jsonSchema = toJsonSchema(DateOnly);
|
|
32
|
+
log('schema', { jsonSchema });
|
|
33
|
+
const v1: SimpleDate = { year: 1999, month: 12, day: 31 };
|
|
34
|
+
const str = Schema.encodeUnknownSync(DateOnly)(v1);
|
|
35
|
+
const v2 = Schema.decodeUnknownSync(DateOnly)(str);
|
|
36
|
+
expect(v1).to.deep.eq(v2);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('Time', ({ expect }) => {
|
|
40
|
+
const jsonSchema = toJsonSchema(TimeOnly);
|
|
41
|
+
log('schema', { jsonSchema });
|
|
42
|
+
const v1: SimpleTime = { hours: 23, minutes: 59, seconds: 59 };
|
|
43
|
+
const str = Schema.encodeUnknownSync(TimeOnly)(v1);
|
|
44
|
+
const v2 = Schema.decodeUnknownSync(TimeOnly)(str);
|
|
45
|
+
expect(v1).to.deep.eq(v2);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('DateTime', ({ expect }) => {
|
|
49
|
+
const jsonSchema = toJsonSchema(DateTime);
|
|
50
|
+
log('schema', { jsonSchema });
|
|
51
|
+
const v1: SimpleDateTime = { year: 1999, month: 12, day: 31, hours: 23, minutes: 59, seconds: 59 };
|
|
52
|
+
const str = Schema.encodeUnknownSync(DateTime)(v1);
|
|
53
|
+
const v2 = Schema.decodeUnknownSync(DateTime)(str);
|
|
54
|
+
expect(v1).to.deep.eq(v2);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
7
|
+
|
|
8
|
+
import { FormatAnnotation, TypeFormat } from './types';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Datetime values should be stored as ISO strings or unix numbers (ms) in UTC.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: HyperFormula uses Excel's time format (null date 1900/01/01)
|
|
14
|
+
* It can be configured to use a different parser via `parseDateTime`.
|
|
15
|
+
* https://hyperformula.handsontable.com/guide/date-and-time-handling.html#date-and-time-handling
|
|
16
|
+
* https://github.com/handsontable/hyperformula/blob/master/src/DateTimeHelper.ts
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// TODO(burdon): Annotations not present in JSON.
|
|
20
|
+
// TODO(burdon): Timezone.
|
|
21
|
+
// TODO(burdon): Format for timestamp (Unix UTC or ISO 8601)?
|
|
22
|
+
// TODO(burdon): Refs
|
|
23
|
+
// - https://www.npmjs.com/package/numfmt
|
|
24
|
+
// - https://date-fns.org/docs/Getting-Started
|
|
25
|
+
// - https://github.com/date-fns/tz
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Simple date compatible with HF.
|
|
29
|
+
*/
|
|
30
|
+
export const SimpleDate = Schema.Struct({
|
|
31
|
+
year: Schema.Number.pipe(Schema.between(1900, 9999)),
|
|
32
|
+
month: Schema.Number.pipe(Schema.between(1, 12)),
|
|
33
|
+
day: Schema.Number.pipe(Schema.between(1, 31)),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type SimpleDate = Schema.Schema.Type<typeof SimpleDate>;
|
|
37
|
+
|
|
38
|
+
export const toSimpleDate = (date: Date): SimpleDate => ({
|
|
39
|
+
year: date.getUTCFullYear(),
|
|
40
|
+
month: date.getUTCMonth() + 1,
|
|
41
|
+
day: date.getUTCDate(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Simple time compatible with HF.
|
|
46
|
+
*/
|
|
47
|
+
export const SimpleTime = Schema.Struct({
|
|
48
|
+
hours: Schema.Number.pipe(Schema.between(0, 23)),
|
|
49
|
+
minutes: Schema.Number.pipe(Schema.between(0, 59)),
|
|
50
|
+
seconds: Schema.Number.pipe(Schema.between(0, 59)),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export type SimpleTime = Schema.Schema.Type<typeof SimpleTime>;
|
|
54
|
+
|
|
55
|
+
export const toSimpleTime = (date: Date): SimpleTime => ({
|
|
56
|
+
hours: date.getUTCHours(),
|
|
57
|
+
minutes: date.getUTCSeconds(),
|
|
58
|
+
seconds: date.getUTCSeconds(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Simple date-time compatible with HF.
|
|
63
|
+
*/
|
|
64
|
+
export const SimpleDateTime = Schema.extend(SimpleDate, SimpleTime);
|
|
65
|
+
|
|
66
|
+
export type SimpleDateTime = Schema.Schema.Type<typeof SimpleDateTime>;
|
|
67
|
+
|
|
68
|
+
export const toSimpleDateTime = (date: Date): SimpleDateTime => ({
|
|
69
|
+
...toSimpleDate(date),
|
|
70
|
+
...toSimpleTime(date),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* https://effect.website/docs/guides/schema/transformations#date-transformations
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
// TODO(burdon): Consider if transformations should be supported with Automerge.
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Format: 2018-11-13
|
|
81
|
+
*/
|
|
82
|
+
export const DateOnly = /* Schema.transformOrFail(Schema.String, SimpleDate, {
|
|
83
|
+
strict: true,
|
|
84
|
+
decode: (str, _, ast) => {
|
|
85
|
+
if (!isValidDateFormat(str)) {
|
|
86
|
+
return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected YYYY-MM-DD format'));
|
|
87
|
+
}
|
|
88
|
+
if (!isValidDate(str)) {
|
|
89
|
+
return ParseResult.fail(new ParseResult.Type(ast, str, 'Invalid date'));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const [year, month, day] = str.split('-').map(Number);
|
|
93
|
+
return ParseResult.succeed({ year, month, day });
|
|
94
|
+
},
|
|
95
|
+
encode: (date) => {
|
|
96
|
+
return ParseResult.succeed(
|
|
97
|
+
[
|
|
98
|
+
date.year.toString().padStart(4, '0'),
|
|
99
|
+
date.month.toString().padStart(2, '0'),
|
|
100
|
+
date.day.toString().padStart(2, '0'),
|
|
101
|
+
].join('-'),
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
}) */ Schema.String.pipe(
|
|
105
|
+
FormatAnnotation.set(TypeFormat.Date),
|
|
106
|
+
Schema.annotations({
|
|
107
|
+
title: 'Date',
|
|
108
|
+
description: 'Valid date in ISO format',
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Format: 20:20:39+00:00
|
|
114
|
+
*/
|
|
115
|
+
export const TimeOnly = /* Schema.transformOrFail(Schema.String, SimpleTime, {
|
|
116
|
+
strict: true,
|
|
117
|
+
decode: (str, _, ast) => {
|
|
118
|
+
if (!isValidTimeFormat(str)) {
|
|
119
|
+
return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const [hours, minutes, seconds] = str.split(':').map(Number);
|
|
123
|
+
return ParseResult.succeed({ hours, minutes, seconds });
|
|
124
|
+
},
|
|
125
|
+
encode: (time) => {
|
|
126
|
+
return ParseResult.succeed(
|
|
127
|
+
[
|
|
128
|
+
time.hours.toString().padStart(2, '0'),
|
|
129
|
+
time.minutes.toString().padStart(2, '0'),
|
|
130
|
+
time.seconds.toString().padStart(2, '0'),
|
|
131
|
+
].join(':'),
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
}) */ Schema.String.pipe(
|
|
135
|
+
FormatAnnotation.set(TypeFormat.Time),
|
|
136
|
+
Schema.annotations({
|
|
137
|
+
title: 'Time',
|
|
138
|
+
description: 'Valid time in ISO format',
|
|
139
|
+
}),
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Format: 2018-11-13T20:20:39+00:00
|
|
144
|
+
*/
|
|
145
|
+
export const DateTime = /* Schema.transformOrFail(Schema.String, SimpleDateTime, {
|
|
146
|
+
strict: false,
|
|
147
|
+
decode: (str, _, ast) => {
|
|
148
|
+
const [date, time] = str.split('T');
|
|
149
|
+
if (!isValidDateFormat(date)) {
|
|
150
|
+
return ParseResult.fail(new ParseResult.Type(ast, date, 'Expected YYYY-MM-DD format'));
|
|
151
|
+
}
|
|
152
|
+
if (!isValidDate(date)) {
|
|
153
|
+
return ParseResult.fail(new ParseResult.Type(ast, date, 'Invalid date'));
|
|
154
|
+
}
|
|
155
|
+
if (!isValidTimeFormat(time)) {
|
|
156
|
+
return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const [year, month, day] = date.split('-').map(Number);
|
|
160
|
+
const [hours, minutes, seconds] = time.split(':').map(Number);
|
|
161
|
+
return ParseResult.succeed({ year, month, day, hours, minutes, seconds });
|
|
162
|
+
},
|
|
163
|
+
encode: (datetime) => {
|
|
164
|
+
return ParseResult.succeed(
|
|
165
|
+
[
|
|
166
|
+
[
|
|
167
|
+
datetime.year.toString().padStart(4, '0'),
|
|
168
|
+
datetime.month.toString().padStart(2, '0'),
|
|
169
|
+
datetime.day.toString().padStart(2, '0'),
|
|
170
|
+
].join('-'),
|
|
171
|
+
[
|
|
172
|
+
datetime.hours.toString().padStart(2, '0'),
|
|
173
|
+
datetime.minutes.toString().padStart(2, '0'),
|
|
174
|
+
datetime.seconds.toString().padStart(2, '0'),
|
|
175
|
+
].join(':'),
|
|
176
|
+
].join('T'),
|
|
177
|
+
);
|
|
178
|
+
},
|
|
179
|
+
}) */ Schema.String.pipe(
|
|
180
|
+
FormatAnnotation.set(TypeFormat.DateTime),
|
|
181
|
+
Schema.annotations({
|
|
182
|
+
title: 'DateTime',
|
|
183
|
+
description: 'Valid date and time in ISO format',
|
|
184
|
+
}),
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* https://datatracker.ietf.org/doc/html/rfc3339#appendix-A
|
|
189
|
+
*/
|
|
190
|
+
// TODO(burdon): Define duration type.
|
|
191
|
+
export const Duration = Schema.String.pipe(
|
|
192
|
+
FormatAnnotation.set(TypeFormat.Duration),
|
|
193
|
+
Schema.annotations({
|
|
194
|
+
title: 'Duration',
|
|
195
|
+
description: 'Duration in ISO 8601 format',
|
|
196
|
+
[SchemaAST.ExamplesAnnotationId]: ['1h', '3D'],
|
|
197
|
+
}),
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
//
|
|
201
|
+
// Utils
|
|
202
|
+
//
|
|
203
|
+
|
|
204
|
+
// YYYY-MM-DD
|
|
205
|
+
const DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
206
|
+
|
|
207
|
+
const _isValidDateFormat = (str: string) => DATE_REGEX.test(str);
|
|
208
|
+
|
|
209
|
+
const _isValidDate = (str: string) => {
|
|
210
|
+
const date = new Date(str);
|
|
211
|
+
return !isNaN(date.getTime()) && date.toISOString().startsWith(str);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// HH:mm:ss
|
|
215
|
+
const TIME_REGEX = /^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/;
|
|
216
|
+
|
|
217
|
+
const _isValidTimeFormat = (str: string) => TIME_REGEX.test(str);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import { describe, test } from 'vitest';
|
|
7
|
+
|
|
8
|
+
import { toJsonSchema } from '../json-schema';
|
|
9
|
+
|
|
10
|
+
import { Format } from './format';
|
|
11
|
+
import { TypeEnum, TypeFormat, getTypeEnum } from './types';
|
|
12
|
+
|
|
13
|
+
describe('formats', () => {
|
|
14
|
+
test('annotations', ({ expect }) => {
|
|
15
|
+
const TestSchema = Schema.Struct({
|
|
16
|
+
name: Schema.String,
|
|
17
|
+
email: Schema.optional(Format.Email),
|
|
18
|
+
salary: Schema.optional(Format.Currency({ decimals: 2, code: 'usd' })),
|
|
19
|
+
website: Schema.optional(Format.URL),
|
|
20
|
+
birthday: Schema.optional(Format.Date),
|
|
21
|
+
started: Schema.optional(Format.DateTime),
|
|
22
|
+
active: Schema.optional(Schema.Boolean),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
type TestType = Schema.Schema.Type<typeof TestSchema>;
|
|
26
|
+
|
|
27
|
+
const jsonSchema = toJsonSchema(TestSchema);
|
|
28
|
+
|
|
29
|
+
const data: TestType = {
|
|
30
|
+
name: 'Alice',
|
|
31
|
+
email: 'alice@example.com',
|
|
32
|
+
birthday: '1999-06-11',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const validate = Schema.validateSync(TestSchema);
|
|
36
|
+
validate(data);
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
const prop = jsonSchema.properties!['active' as const];
|
|
40
|
+
expect(getTypeEnum(prop)).to.eq(TypeEnum.Boolean);
|
|
41
|
+
expect(prop).includes({
|
|
42
|
+
type: TypeEnum.Boolean,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
{
|
|
47
|
+
const prop = jsonSchema.properties!['email' as const];
|
|
48
|
+
expect(getTypeEnum(prop)).to.eq(TypeEnum.String);
|
|
49
|
+
expect(prop).includes({
|
|
50
|
+
type: TypeEnum.String,
|
|
51
|
+
format: TypeFormat.Email,
|
|
52
|
+
title: 'Email',
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
{
|
|
57
|
+
const prop = jsonSchema.properties!['salary' as const];
|
|
58
|
+
expect(getTypeEnum(prop)).to.eq(TypeEnum.Number);
|
|
59
|
+
expect(prop).includes({
|
|
60
|
+
type: TypeEnum.Number,
|
|
61
|
+
format: TypeFormat.Currency,
|
|
62
|
+
title: 'Currency',
|
|
63
|
+
multipleOf: 0.01,
|
|
64
|
+
currency: 'USD',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
{
|
|
69
|
+
const prop = jsonSchema.properties!['birthday' as const];
|
|
70
|
+
expect(getTypeEnum(prop)).to.eq(TypeEnum.String);
|
|
71
|
+
expect(prop).includes({
|
|
72
|
+
type: TypeEnum.String,
|
|
73
|
+
format: TypeFormat.Date,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
import * as Keys from '@dxos/keys';
|
|
8
|
+
|
|
9
|
+
import * as DateUtil from './date';
|
|
10
|
+
import * as NumberUtil from './number';
|
|
11
|
+
import * as ObjectUtil from './object';
|
|
12
|
+
import * as StringUtil from './string';
|
|
13
|
+
import { TypeFormat as TypeFormat$ } from './types';
|
|
14
|
+
|
|
15
|
+
// TODO(burdon): Media encoding.
|
|
16
|
+
// - https://json-schema.org/understanding-json-schema/reference/non_json_data
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Formats.
|
|
20
|
+
* https://json-schema.org/understanding-json-schema/reference/string#built-in-formats
|
|
21
|
+
* NOTE: A JSON Schema validator will ignore any format type that it does not understand.
|
|
22
|
+
*/
|
|
23
|
+
// TODO(burdon): Add fields for `examples`, `message`, etc.
|
|
24
|
+
export namespace Format {
|
|
25
|
+
export import TypeFormat = TypeFormat$;
|
|
26
|
+
|
|
27
|
+
// String
|
|
28
|
+
export const DXN = Keys.DXN.Schema;
|
|
29
|
+
export const Email = StringUtil.Email;
|
|
30
|
+
export const Formula = StringUtil.Formula;
|
|
31
|
+
export const Hostname = StringUtil.Hostname;
|
|
32
|
+
export const JSON = StringUtil.JSON;
|
|
33
|
+
export const Markdown = StringUtil.Markdown;
|
|
34
|
+
export const Regex = StringUtil.Regex;
|
|
35
|
+
export const URL = StringUtil.URL;
|
|
36
|
+
export const UUID = Schema.UUID;
|
|
37
|
+
|
|
38
|
+
// Numbers
|
|
39
|
+
// TODO(burdon): BigInt.
|
|
40
|
+
export const Currency = NumberUtil.Currency;
|
|
41
|
+
export const Integer = NumberUtil.Integer;
|
|
42
|
+
export const Percent = NumberUtil.Percent;
|
|
43
|
+
export const Timestamp = NumberUtil.Timestamp;
|
|
44
|
+
|
|
45
|
+
// Dates and times
|
|
46
|
+
export const Date = DateUtil.DateOnly;
|
|
47
|
+
export const DateTime = DateUtil.DateTime;
|
|
48
|
+
export const Duration = DateUtil.Duration;
|
|
49
|
+
export const Time = DateUtil.TimeOnly;
|
|
50
|
+
|
|
51
|
+
// Objects
|
|
52
|
+
export const GeoPoint = ObjectUtil.GeoPoint;
|
|
53
|
+
export type GeoPoint = ObjectUtil.GeoPoint; // TODO(burdon): Export types.
|
|
54
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export type { SimpleDate, SimpleDateTime, SimpleTime } from './date';
|
|
6
|
+
export { CurrencyAnnotationId, DecimalPrecision, Currency } from './number';
|
|
7
|
+
export { GeoPoint, GeoLocation } from './object';
|
|
8
|
+
|
|
9
|
+
export * from './format';
|
|
10
|
+
export * from './select';
|
|
11
|
+
export * from './string';
|
|
12
|
+
export * from './types';
|