@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.
Files changed (703) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +10 -11
  3. package/dist/lib/neutral/Annotation.mjs +39 -0
  4. package/dist/lib/neutral/Database.mjs +49 -0
  5. package/dist/lib/neutral/Entity.mjs +68 -0
  6. package/dist/lib/neutral/Err.mjs +12 -0
  7. package/dist/lib/neutral/Extension.mjs +18 -0
  8. package/dist/lib/neutral/Feed.mjs +54 -0
  9. package/dist/lib/neutral/Filter.mjs +74 -0
  10. package/dist/lib/neutral/Filter.mjs.map +7 -0
  11. package/dist/lib/neutral/Format.mjs +86 -0
  12. package/dist/lib/neutral/Format.mjs.map +7 -0
  13. package/dist/lib/neutral/JsonSchema.mjs +19 -0
  14. package/dist/lib/neutral/JsonSchema.mjs.map +7 -0
  15. package/dist/lib/neutral/Key.mjs +16 -0
  16. package/dist/lib/neutral/Key.mjs.map +7 -0
  17. package/dist/lib/neutral/Migration.mjs +18 -0
  18. package/dist/lib/neutral/Migration.mjs.map +7 -0
  19. package/dist/lib/neutral/Obj.mjs +114 -0
  20. package/dist/lib/neutral/Obj.mjs.map +7 -0
  21. package/dist/lib/neutral/Order.mjs +12 -0
  22. package/dist/lib/neutral/Order.mjs.map +7 -0
  23. package/dist/lib/neutral/Query.mjs +38 -0
  24. package/dist/lib/neutral/Query.mjs.map +7 -0
  25. package/dist/lib/neutral/QueryResult.mjs +2 -0
  26. package/dist/lib/neutral/QueryResult.mjs.map +7 -0
  27. package/dist/lib/neutral/Ref.mjs +26 -0
  28. package/dist/lib/neutral/Ref.mjs.map +7 -0
  29. package/dist/lib/neutral/Relation.mjs +95 -0
  30. package/dist/lib/neutral/Relation.mjs.map +7 -0
  31. package/dist/lib/neutral/SchemaRegistry.mjs +2 -0
  32. package/dist/lib/neutral/SchemaRegistry.mjs.map +7 -0
  33. package/dist/lib/neutral/Tag.mjs +29 -0
  34. package/dist/lib/neutral/Tag.mjs.map +7 -0
  35. package/dist/lib/neutral/Type.mjs +63 -0
  36. package/dist/lib/neutral/Type.mjs.map +7 -0
  37. package/dist/lib/neutral/chunk-4SYHDOQA.mjs +48 -0
  38. package/dist/lib/neutral/chunk-4SYHDOQA.mjs.map +7 -0
  39. package/dist/lib/neutral/chunk-4U7OD55H.mjs +47 -0
  40. package/dist/lib/neutral/chunk-4U7OD55H.mjs.map +7 -0
  41. package/dist/lib/neutral/chunk-52NG2XEE.mjs +34 -0
  42. package/dist/lib/neutral/chunk-52NG2XEE.mjs.map +7 -0
  43. package/dist/lib/neutral/chunk-A5HDDVKS.mjs +94 -0
  44. package/dist/lib/neutral/chunk-A5HDDVKS.mjs.map +7 -0
  45. package/dist/lib/neutral/chunk-EZ4XJFHJ.mjs +54 -0
  46. package/dist/lib/neutral/chunk-EZ4XJFHJ.mjs.map +7 -0
  47. package/dist/lib/neutral/chunk-F625JEZB.mjs +365 -0
  48. package/dist/lib/neutral/chunk-F625JEZB.mjs.map +7 -0
  49. package/dist/lib/neutral/chunk-FFCN66OF.mjs +420 -0
  50. package/dist/lib/neutral/chunk-FFCN66OF.mjs.map +7 -0
  51. package/dist/lib/neutral/chunk-GOHDOJE3.mjs +51 -0
  52. package/dist/lib/neutral/chunk-GOHDOJE3.mjs.map +7 -0
  53. package/dist/lib/neutral/chunk-GWFFC34K.mjs +50 -0
  54. package/dist/lib/neutral/chunk-GWFFC34K.mjs.map +7 -0
  55. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  56. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  57. package/dist/lib/neutral/chunk-J7QWJQQV.mjs +318 -0
  58. package/dist/lib/neutral/chunk-J7QWJQQV.mjs.map +7 -0
  59. package/dist/lib/neutral/chunk-JTHNDGAR.mjs +27 -0
  60. package/dist/lib/neutral/chunk-JTHNDGAR.mjs.map +7 -0
  61. package/dist/lib/neutral/chunk-K5RH2PBH.mjs +361 -0
  62. package/dist/lib/neutral/chunk-K5RH2PBH.mjs.map +7 -0
  63. package/dist/lib/neutral/chunk-KHRAQDYX.mjs +343 -0
  64. package/dist/lib/neutral/chunk-KHRAQDYX.mjs.map +7 -0
  65. package/dist/lib/neutral/chunk-L65CW5EI.mjs +156 -0
  66. package/dist/lib/neutral/chunk-L65CW5EI.mjs.map +7 -0
  67. package/dist/lib/neutral/chunk-LNZIPZX6.mjs +2186 -0
  68. package/dist/lib/neutral/chunk-LNZIPZX6.mjs.map +7 -0
  69. package/dist/lib/neutral/chunk-MPXUNTME.mjs +41 -0
  70. package/dist/lib/neutral/chunk-MPXUNTME.mjs.map +7 -0
  71. package/dist/lib/neutral/chunk-O2EOH7XQ.mjs +420 -0
  72. package/dist/lib/neutral/chunk-O2EOH7XQ.mjs.map +7 -0
  73. package/dist/lib/neutral/chunk-Q7ID37KF.mjs +278 -0
  74. package/dist/lib/neutral/chunk-Q7ID37KF.mjs.map +7 -0
  75. package/dist/lib/neutral/chunk-QLYEQ5VA.mjs +205 -0
  76. package/dist/lib/neutral/chunk-QLYEQ5VA.mjs.map +7 -0
  77. package/dist/lib/neutral/chunk-SSDGRJ3A.mjs +747 -0
  78. package/dist/lib/neutral/chunk-SSDGRJ3A.mjs.map +7 -0
  79. package/dist/lib/neutral/chunk-TTCSATUD.mjs +42 -0
  80. package/dist/lib/neutral/chunk-TTCSATUD.mjs.map +7 -0
  81. package/dist/lib/neutral/chunk-UEFRFUYC.mjs +25 -0
  82. package/dist/lib/neutral/chunk-UEFRFUYC.mjs.map +7 -0
  83. package/dist/lib/neutral/chunk-UN7K472Q.mjs +132 -0
  84. package/dist/lib/neutral/chunk-UN7K472Q.mjs.map +7 -0
  85. package/dist/lib/neutral/chunk-UQAMAXDU.mjs +243 -0
  86. package/dist/lib/neutral/chunk-UQAMAXDU.mjs.map +7 -0
  87. package/dist/lib/neutral/chunk-V5NE2X7Y.mjs +7 -0
  88. package/dist/lib/neutral/chunk-V5NE2X7Y.mjs.map +7 -0
  89. package/dist/lib/neutral/chunk-V72DY6LU.mjs +7 -0
  90. package/dist/lib/neutral/chunk-V72DY6LU.mjs.map +7 -0
  91. package/dist/lib/neutral/chunk-ZII2BGPM.mjs +269 -0
  92. package/dist/lib/neutral/chunk-ZII2BGPM.mjs.map +7 -0
  93. package/dist/lib/neutral/chunk-ZM7VFIS2.mjs +93 -0
  94. package/dist/lib/neutral/chunk-ZM7VFIS2.mjs.map +7 -0
  95. package/dist/lib/neutral/index.mjs +111 -0
  96. package/dist/lib/neutral/index.mjs.map +7 -0
  97. package/dist/lib/neutral/internal/index.mjs +513 -0
  98. package/dist/lib/neutral/internal/index.mjs.map +7 -0
  99. package/dist/lib/neutral/meta.json +1 -0
  100. package/dist/lib/neutral/testing/index.mjs +418 -0
  101. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  102. package/dist/types/src/Annotation.d.ts +24 -0
  103. package/dist/types/src/Annotation.d.ts.map +1 -0
  104. package/dist/types/src/Collection.d.ts +15 -0
  105. package/dist/types/src/Collection.d.ts.map +1 -0
  106. package/dist/types/src/Database.d.ts +201 -0
  107. package/dist/types/src/Database.d.ts.map +1 -0
  108. package/dist/types/src/Dataset.d.ts +29 -0
  109. package/dist/types/src/Dataset.d.ts.map +1 -0
  110. package/dist/types/src/Entity.d.ts +236 -0
  111. package/dist/types/src/Entity.d.ts.map +1 -0
  112. package/dist/types/src/Entity.test.d.ts +2 -0
  113. package/dist/types/src/Entity.test.d.ts.map +1 -0
  114. package/dist/types/src/Err.d.ts +107 -0
  115. package/dist/types/src/Err.d.ts.map +1 -0
  116. package/dist/types/src/Extension.d.ts +80 -0
  117. package/dist/types/src/Extension.d.ts.map +1 -0
  118. package/dist/types/src/Extension.test.d.ts +2 -0
  119. package/dist/types/src/Extension.test.d.ts.map +1 -0
  120. package/dist/types/src/Feed.d.ts +229 -0
  121. package/dist/types/src/Feed.d.ts.map +1 -0
  122. package/dist/types/src/Filter.d.ts +183 -0
  123. package/dist/types/src/Filter.d.ts.map +1 -0
  124. package/dist/types/src/Filter.test.d.ts +2 -0
  125. package/dist/types/src/Filter.test.d.ts.map +1 -0
  126. package/dist/types/src/Format.d.ts +4 -0
  127. package/dist/types/src/Format.d.ts.map +1 -0
  128. package/dist/types/src/Hypergraph.d.ts +65 -0
  129. package/dist/types/src/Hypergraph.d.ts.map +1 -0
  130. package/dist/types/src/Json.d.ts +33 -0
  131. package/dist/types/src/Json.d.ts.map +1 -0
  132. package/dist/types/src/Json.test.d.ts +2 -0
  133. package/dist/types/src/Json.test.d.ts.map +1 -0
  134. package/dist/types/src/JsonSchema.d.ts +16 -0
  135. package/dist/types/src/JsonSchema.d.ts.map +1 -0
  136. package/dist/types/src/Key.d.ts +2 -1
  137. package/dist/types/src/Key.d.ts.map +1 -1
  138. package/dist/types/src/Migration.d.ts +72 -0
  139. package/dist/types/src/Migration.d.ts.map +1 -0
  140. package/dist/types/src/Obj.d.ts +459 -107
  141. package/dist/types/src/Obj.d.ts.map +1 -1
  142. package/dist/types/src/Obj.test.d.ts +2 -0
  143. package/dist/types/src/Obj.test.d.ts.map +1 -0
  144. package/dist/types/src/Order.d.ts +16 -0
  145. package/dist/types/src/Order.d.ts.map +1 -0
  146. package/dist/types/src/Query.d.ts +225 -0
  147. package/dist/types/src/Query.d.ts.map +1 -0
  148. package/dist/types/src/Query.test.d.ts +2 -0
  149. package/dist/types/src/Query.test.d.ts.map +1 -0
  150. package/dist/types/src/QueryResult.d.ts +80 -0
  151. package/dist/types/src/QueryResult.d.ts.map +1 -0
  152. package/dist/types/src/Ref.d.ts +69 -11
  153. package/dist/types/src/Ref.d.ts.map +1 -1
  154. package/dist/types/src/Relation.d.ts +316 -23
  155. package/dist/types/src/Relation.d.ts.map +1 -1
  156. package/dist/types/src/Relation.test.d.ts +2 -0
  157. package/dist/types/src/Relation.test.d.ts.map +1 -0
  158. package/dist/types/src/SchemaRegistry.d.ts +83 -0
  159. package/dist/types/src/SchemaRegistry.d.ts.map +1 -0
  160. package/dist/types/src/Tag.d.ts +18 -0
  161. package/dist/types/src/Tag.d.ts.map +1 -0
  162. package/dist/types/src/Type.d.ts +378 -106
  163. package/dist/types/src/Type.d.ts.map +1 -1
  164. package/dist/types/src/Type.test.d.ts +2 -0
  165. package/dist/types/src/Type.test.d.ts.map +1 -0
  166. package/dist/types/src/View.d.ts +65 -0
  167. package/dist/types/src/View.d.ts.map +1 -0
  168. package/dist/types/src/exemplars.test.d.ts +2 -0
  169. package/dist/types/src/exemplars.test.d.ts.map +1 -0
  170. package/dist/types/src/hierarchy.test.d.ts +2 -0
  171. package/dist/types/src/hierarchy.test.d.ts.map +1 -0
  172. package/dist/types/src/index.d.ts +22 -5
  173. package/dist/types/src/index.d.ts.map +1 -1
  174. package/dist/types/src/internal/Annotation/annotations.d.ts +251 -0
  175. package/dist/types/src/internal/Annotation/annotations.d.ts.map +1 -0
  176. package/dist/types/src/internal/Annotation/annotations.test.d.ts.map +1 -0
  177. package/dist/types/src/internal/Annotation/index.d.ts +4 -0
  178. package/dist/types/src/internal/Annotation/index.d.ts.map +1 -0
  179. package/dist/types/src/internal/Annotation/sorting.d.ts +24 -0
  180. package/dist/types/src/internal/Annotation/sorting.d.ts.map +1 -0
  181. package/dist/types/src/internal/Annotation/util.d.ts +48 -0
  182. package/dist/types/src/internal/Annotation/util.d.ts.map +1 -0
  183. package/dist/types/src/internal/Entity/api.d.ts +13 -0
  184. package/dist/types/src/internal/Entity/api.d.ts.map +1 -0
  185. package/dist/types/src/internal/Entity/entity.d.ts +67 -0
  186. package/dist/types/src/internal/Entity/entity.d.ts.map +1 -0
  187. package/dist/types/src/internal/Entity/index.d.ts +10 -0
  188. package/dist/types/src/internal/Entity/index.d.ts.map +1 -0
  189. package/dist/types/src/internal/Entity/model.d.ts +57 -0
  190. package/dist/types/src/internal/Entity/model.d.ts.map +1 -0
  191. package/dist/types/src/internal/Entity/object.d.ts +18 -0
  192. package/dist/types/src/internal/Entity/object.d.ts.map +1 -0
  193. package/dist/types/src/internal/Entity/relation.d.ts +51 -0
  194. package/dist/types/src/internal/Entity/relation.d.ts.map +1 -0
  195. package/dist/types/src/internal/Entity/type-kind.d.ts +24 -0
  196. package/dist/types/src/internal/Entity/type-kind.d.ts.map +1 -0
  197. package/dist/types/src/internal/Entity/type-uri.d.ts +25 -0
  198. package/dist/types/src/internal/Entity/type-uri.d.ts.map +1 -0
  199. package/dist/types/src/internal/Entity/util.d.ts +2 -0
  200. package/dist/types/src/internal/Entity/util.d.ts.map +1 -0
  201. package/dist/types/src/internal/Entity/version.d.ts +42 -0
  202. package/dist/types/src/internal/Entity/version.d.ts.map +1 -0
  203. package/dist/types/src/internal/Format/date.d.ts.map +1 -0
  204. package/dist/types/src/internal/Format/date.test.d.ts.map +1 -0
  205. package/dist/types/src/internal/{formats → Format}/format.d.ts +6 -3
  206. package/dist/types/src/internal/Format/format.d.ts.map +1 -0
  207. package/dist/types/src/internal/Format/format.test.d.ts.map +1 -0
  208. package/dist/types/src/internal/{formats → Format}/index.d.ts +2 -2
  209. package/dist/types/src/internal/Format/index.d.ts.map +1 -0
  210. package/dist/types/src/internal/Format/number.d.ts.map +1 -0
  211. package/dist/types/src/internal/Format/object.d.ts.map +1 -0
  212. package/dist/types/src/internal/{formats → Format}/select.d.ts +6 -4
  213. package/dist/types/src/internal/Format/select.d.ts.map +1 -0
  214. package/dist/types/src/internal/{formats → Format}/string.d.ts +4 -0
  215. package/dist/types/src/internal/Format/string.d.ts.map +1 -0
  216. package/dist/types/src/internal/{formats → Format}/types.d.ts +14 -10
  217. package/dist/types/src/internal/Format/types.d.ts.map +1 -0
  218. package/dist/types/src/internal/{json → JsonSchema}/annotations.d.ts +1 -1
  219. package/dist/types/src/internal/JsonSchema/annotations.d.ts.map +1 -0
  220. package/dist/types/src/internal/JsonSchema/effect-schema.test.d.ts.map +1 -0
  221. package/dist/types/src/internal/JsonSchema/index.d.ts +5 -0
  222. package/dist/types/src/internal/JsonSchema/index.d.ts.map +1 -0
  223. package/dist/types/src/internal/JsonSchema/json-schema-normalize.d.ts.map +1 -0
  224. package/dist/types/src/internal/{json-schema → JsonSchema}/json-schema-type.d.ts +131 -30
  225. package/dist/types/src/internal/JsonSchema/json-schema-type.d.ts.map +1 -0
  226. package/dist/types/src/internal/{json → JsonSchema}/json-schema.d.ts +6 -3
  227. package/dist/types/src/internal/JsonSchema/json-schema.d.ts.map +1 -0
  228. package/dist/types/src/internal/JsonSchema/json-schema.test.d.ts.map +1 -0
  229. package/dist/types/src/internal/Obj/clone.d.ts +8 -0
  230. package/dist/types/src/internal/Obj/clone.d.ts.map +1 -0
  231. package/dist/types/src/internal/Obj/common.d.ts.map +1 -0
  232. package/dist/types/src/internal/{object/create.d.ts → Obj/create-object.d.ts} +13 -16
  233. package/dist/types/src/internal/Obj/create-object.d.ts.map +1 -0
  234. package/dist/types/src/internal/Obj/create-object.test.d.ts +2 -0
  235. package/dist/types/src/internal/Obj/create-object.test.d.ts.map +1 -0
  236. package/dist/types/src/internal/Obj/deleted.d.ts +6 -0
  237. package/dist/types/src/internal/Obj/deleted.d.ts.map +1 -0
  238. package/dist/types/src/internal/Obj/index.d.ts +10 -0
  239. package/dist/types/src/internal/Obj/index.d.ts.map +1 -0
  240. package/dist/types/src/internal/Obj/inspect.d.ts.map +1 -0
  241. package/dist/types/src/internal/Obj/json-serializer.d.ts +45 -0
  242. package/dist/types/src/internal/Obj/json-serializer.d.ts.map +1 -0
  243. package/dist/types/src/internal/Obj/json-serializer.test.d.ts.map +1 -0
  244. package/dist/types/src/internal/Obj/schema-validator.d.ts +2 -0
  245. package/dist/types/src/internal/Obj/schema-validator.d.ts.map +1 -0
  246. package/dist/types/src/internal/Obj/schema-validator.test.d.ts.map +1 -0
  247. package/dist/types/src/internal/Obj/set-value.d.ts +7 -0
  248. package/dist/types/src/internal/Obj/set-value.d.ts.map +1 -0
  249. package/dist/types/src/internal/Obj/set-value.test.d.ts +2 -0
  250. package/dist/types/src/internal/Obj/set-value.test.d.ts.map +1 -0
  251. package/dist/types/src/internal/Obj/snapshot.d.ts +6 -0
  252. package/dist/types/src/internal/Obj/snapshot.d.ts.map +1 -0
  253. package/dist/types/src/internal/Obj/typed-object.d.ts +25 -0
  254. package/dist/types/src/internal/Obj/typed-object.d.ts.map +1 -0
  255. package/dist/types/src/internal/Obj/typed-object.test.d.ts.map +1 -0
  256. package/dist/types/src/internal/Query.d.ts +10 -0
  257. package/dist/types/src/internal/Query.d.ts.map +1 -0
  258. package/dist/types/src/internal/Ref/index.d.ts.map +1 -0
  259. package/dist/types/src/internal/{ref → Ref}/ref-array.d.ts +4 -4
  260. package/dist/types/src/internal/Ref/ref-array.d.ts.map +1 -0
  261. package/dist/types/src/internal/{ref → Ref}/ref.d.ts +79 -31
  262. package/dist/types/src/internal/Ref/ref.d.ts.map +1 -0
  263. package/dist/types/src/internal/Ref/ref.test.d.ts.map +1 -0
  264. package/dist/types/src/internal/Type/compose.d.ts +7 -0
  265. package/dist/types/src/internal/Type/compose.d.ts.map +1 -0
  266. package/dist/types/src/internal/Type/compose.test.d.ts.map +1 -0
  267. package/dist/types/src/internal/Type/index.d.ts +3 -0
  268. package/dist/types/src/internal/Type/index.d.ts.map +1 -0
  269. package/dist/types/src/internal/{schema → Type}/manipulation.d.ts +0 -1
  270. package/dist/types/src/internal/Type/manipulation.d.ts.map +1 -0
  271. package/dist/types/src/internal/Type/type-schema.d.ts +52 -0
  272. package/dist/types/src/internal/Type/type-schema.d.ts.map +1 -0
  273. package/dist/types/src/internal/common/api/index.d.ts +11 -0
  274. package/dist/types/src/internal/common/api/index.d.ts.map +1 -0
  275. package/dist/types/src/internal/common/api/meta.d.ts +42 -0
  276. package/dist/types/src/internal/common/api/meta.d.ts.map +1 -0
  277. package/dist/types/src/internal/common/index.d.ts +4 -0
  278. package/dist/types/src/internal/common/index.d.ts.map +1 -0
  279. package/dist/types/src/internal/common/proxy/change-context.d.ts +55 -0
  280. package/dist/types/src/internal/common/proxy/change-context.d.ts.map +1 -0
  281. package/dist/types/src/internal/common/proxy/change.test.d.ts +2 -0
  282. package/dist/types/src/internal/common/proxy/change.test.d.ts.map +1 -0
  283. package/dist/types/src/internal/common/proxy/define-hidden-property.d.ts +5 -0
  284. package/dist/types/src/internal/common/proxy/define-hidden-property.d.ts.map +1 -0
  285. package/dist/types/src/internal/common/proxy/errors.d.ts +19 -0
  286. package/dist/types/src/internal/common/proxy/errors.d.ts.map +1 -0
  287. package/dist/types/src/internal/common/proxy/event-batch.d.ts +10 -0
  288. package/dist/types/src/internal/common/proxy/event-batch.d.ts.map +1 -0
  289. package/dist/types/src/internal/common/proxy/handler.test.d.ts.map +1 -0
  290. package/dist/types/src/internal/common/proxy/index.d.ts +14 -0
  291. package/dist/types/src/internal/common/proxy/index.d.ts.map +1 -0
  292. package/dist/types/src/internal/common/proxy/json-serializer.d.ts +6 -0
  293. package/dist/types/src/internal/common/proxy/json-serializer.d.ts.map +1 -0
  294. package/dist/types/src/internal/common/proxy/make-object.d.ts +19 -0
  295. package/dist/types/src/internal/common/proxy/make-object.d.ts.map +1 -0
  296. package/dist/types/src/internal/common/proxy/ownership.d.ts +57 -0
  297. package/dist/types/src/internal/common/proxy/ownership.d.ts.map +1 -0
  298. package/dist/types/src/internal/common/proxy/proxy-types.d.ts +18 -0
  299. package/dist/types/src/internal/common/proxy/proxy-types.d.ts.map +1 -0
  300. package/dist/types/src/internal/common/proxy/proxy-utils.d.ts +47 -0
  301. package/dist/types/src/internal/common/proxy/proxy-utils.d.ts.map +1 -0
  302. package/dist/types/src/internal/common/proxy/reactive-array.d.ts +8 -0
  303. package/dist/types/src/internal/common/proxy/reactive-array.d.ts.map +1 -0
  304. package/dist/types/src/internal/common/proxy/reactive.d.ts +39 -0
  305. package/dist/types/src/internal/common/proxy/reactive.d.ts.map +1 -0
  306. package/dist/types/src/internal/common/proxy/reactive.test.d.ts +2 -0
  307. package/dist/types/src/internal/common/proxy/reactive.test.d.ts.map +1 -0
  308. package/dist/types/src/internal/common/proxy/schema-validator.d.ts.map +1 -0
  309. package/dist/types/src/internal/common/proxy/schema.test.d.ts.map +1 -0
  310. package/dist/types/src/internal/common/proxy/symbols.d.ts +3 -0
  311. package/dist/types/src/internal/common/proxy/symbols.d.ts.map +1 -0
  312. package/dist/types/src/internal/common/proxy/typed-handler.d.ts +64 -0
  313. package/dist/types/src/internal/common/proxy/typed-handler.d.ts.map +1 -0
  314. package/dist/types/src/internal/common/proxy/typed-handler.test.d.ts.map +1 -0
  315. package/dist/types/src/internal/common/proxy/typed-object.test.d.ts.map +1 -0
  316. package/dist/types/src/internal/common/types/base.d.ts +27 -0
  317. package/dist/types/src/internal/common/types/base.d.ts.map +1 -0
  318. package/dist/types/src/internal/common/types/entity.d.ts +94 -0
  319. package/dist/types/src/internal/common/types/entity.d.ts.map +1 -0
  320. package/dist/types/src/internal/common/types/index.d.ts +7 -0
  321. package/dist/types/src/internal/common/types/index.d.ts.map +1 -0
  322. package/dist/types/src/internal/common/types/meta.d.ts +43 -0
  323. package/dist/types/src/internal/common/types/meta.d.ts.map +1 -0
  324. package/dist/types/src/internal/common/types/model-symbols.d.ts +58 -0
  325. package/dist/types/src/internal/common/types/model-symbols.d.ts.map +1 -0
  326. package/dist/types/src/internal/common/types/typename.d.ts +28 -0
  327. package/dist/types/src/internal/common/types/typename.d.ts.map +1 -0
  328. package/dist/types/src/internal/common/types/version.d.ts +15 -0
  329. package/dist/types/src/internal/common/types/version.d.ts.map +1 -0
  330. package/dist/types/src/internal/index.d.ts +10 -14
  331. package/dist/types/src/internal/index.d.ts.map +1 -1
  332. package/dist/types/src/{test → testing}/api.test.d.ts.map +1 -1
  333. package/dist/types/src/testing/index.d.ts +3 -3
  334. package/dist/types/src/testing/index.d.ts.map +1 -1
  335. package/dist/types/src/testing/test-data.d.ts +18 -0
  336. package/dist/types/src/testing/test-data.d.ts.map +1 -0
  337. package/dist/types/src/testing/test-schema.d.ts +298 -0
  338. package/dist/types/src/testing/test-schema.d.ts.map +1 -0
  339. package/dist/types/src/testing/util.d.ts +23 -0
  340. package/dist/types/src/testing/util.d.ts.map +1 -0
  341. package/dist/types/tsconfig.tsbuildinfo +1 -1
  342. package/package.json +117 -66
  343. package/src/Annotation.ts +49 -0
  344. package/src/Collection.ts +36 -0
  345. package/src/Database.ts +356 -0
  346. package/src/Dataset.ts +34 -0
  347. package/src/Entity.test.ts +132 -0
  348. package/src/Entity.ts +332 -0
  349. package/src/Err.ts +40 -0
  350. package/src/Extension.test.ts +235 -0
  351. package/src/Extension.ts +122 -0
  352. package/src/Feed.ts +356 -0
  353. package/src/Filter.test.ts +90 -0
  354. package/src/Filter.ts +507 -0
  355. package/src/Format.ts +9 -0
  356. package/src/Hypergraph.ts +79 -0
  357. package/src/Json.test.ts +175 -0
  358. package/src/Json.ts +103 -0
  359. package/src/JsonSchema.ts +26 -0
  360. package/src/Key.ts +4 -1
  361. package/src/Migration.ts +114 -0
  362. package/src/Obj.test.ts +550 -0
  363. package/src/Obj.ts +754 -267
  364. package/src/Order.ts +46 -0
  365. package/src/Query.test.ts +822 -0
  366. package/src/Query.ts +589 -0
  367. package/src/QueryResult.ts +106 -0
  368. package/src/Ref.ts +98 -10
  369. package/src/Relation.test.ts +88 -0
  370. package/src/Relation.ts +491 -67
  371. package/src/SchemaRegistry.ts +101 -0
  372. package/src/{query/tag.ts → Tag.ts} +15 -12
  373. package/src/Type.test.ts +197 -0
  374. package/src/Type.ts +605 -151
  375. package/src/View.ts +101 -0
  376. package/src/exemplars.test.ts +21 -0
  377. package/src/hierarchy.test.ts +33 -0
  378. package/src/index.ts +23 -6
  379. package/src/internal/Annotation/annotations.test.ts +165 -0
  380. package/src/internal/Annotation/annotations.ts +567 -0
  381. package/src/internal/Annotation/index.ts +7 -0
  382. package/src/internal/Annotation/sorting.ts +51 -0
  383. package/src/internal/Annotation/util.ts +93 -0
  384. package/src/internal/Entity/api.ts +30 -0
  385. package/src/internal/Entity/entity.ts +246 -0
  386. package/src/internal/Entity/index.ts +13 -0
  387. package/src/internal/Entity/model.ts +120 -0
  388. package/src/internal/Entity/object.ts +65 -0
  389. package/src/internal/Entity/relation.ts +179 -0
  390. package/src/internal/Entity/type-kind.ts +67 -0
  391. package/src/internal/Entity/type-uri.ts +87 -0
  392. package/src/internal/Entity/util.ts +34 -0
  393. package/src/internal/Entity/version.ts +96 -0
  394. package/src/internal/{formats → Format}/date.test.ts +1 -2
  395. package/src/internal/{formats → Format}/date.ts +5 -9
  396. package/src/internal/{formats → Format}/format.test.ts +6 -7
  397. package/src/internal/{formats → Format}/format.ts +8 -6
  398. package/src/internal/{formats → Format}/index.ts +2 -3
  399. package/src/internal/{formats → Format}/number.ts +5 -5
  400. package/src/internal/{formats → Format}/object.ts +4 -4
  401. package/src/internal/{formats → Format}/select.ts +6 -4
  402. package/src/internal/{formats → Format}/string.ts +14 -9
  403. package/src/internal/{formats → Format}/types.ts +54 -43
  404. package/src/internal/{json → JsonSchema}/annotations.ts +3 -3
  405. package/src/internal/{json-schema → JsonSchema}/index.ts +2 -0
  406. package/src/internal/{json-schema → JsonSchema}/json-schema-normalize.ts +4 -2
  407. package/src/internal/{json-schema → JsonSchema}/json-schema-type.ts +36 -36
  408. package/src/internal/{json → JsonSchema}/json-schema.test.ts +92 -175
  409. package/src/internal/{json → JsonSchema}/json-schema.ts +69 -37
  410. package/src/internal/Obj/clone.ts +52 -0
  411. package/src/internal/{object → Obj}/common.ts +3 -4
  412. package/src/internal/{object/create.test.ts → Obj/create-object.test.ts} +34 -37
  413. package/src/internal/Obj/create-object.ts +135 -0
  414. package/src/internal/Obj/deleted.ts +19 -0
  415. package/src/internal/Obj/index.ts +13 -0
  416. package/src/internal/{object → Obj}/inspect.ts +5 -7
  417. package/src/internal/Obj/json-serializer.test.ts +185 -0
  418. package/src/internal/Obj/json-serializer.ts +260 -0
  419. package/src/internal/{object → Obj}/schema-validator.test.ts +3 -7
  420. package/src/internal/Obj/schema-validator.ts +6 -0
  421. package/src/internal/Obj/set-value.test.ts +258 -0
  422. package/src/internal/Obj/set-value.ts +165 -0
  423. package/src/internal/Obj/snapshot.ts +111 -0
  424. package/src/internal/Obj/typed-object.test.ts +32 -0
  425. package/src/internal/Obj/typed-object.ts +30 -0
  426. package/src/internal/Query.ts +156 -0
  427. package/src/internal/{ref → Ref}/ref-array.ts +4 -5
  428. package/src/internal/{ref → Ref}/ref.test.ts +21 -30
  429. package/src/internal/{ref → Ref}/ref.ts +209 -98
  430. package/src/internal/{projection → Type}/compose.test.ts +9 -9
  431. package/src/internal/{projection → Type}/compose.ts +14 -9
  432. package/src/internal/Type/index.ts +6 -0
  433. package/src/internal/{schema → Type}/manipulation.ts +0 -25
  434. package/src/internal/Type/type-schema.ts +60 -0
  435. package/src/internal/common/README.md +102 -0
  436. package/src/internal/common/api/index.ts +15 -0
  437. package/src/internal/common/api/meta.ts +88 -0
  438. package/src/internal/{testing → common}/index.ts +2 -1
  439. package/src/internal/common/proxy/change-context.ts +138 -0
  440. package/src/internal/common/proxy/change.test.ts +519 -0
  441. package/src/internal/common/proxy/define-hidden-property.ts +14 -0
  442. package/src/internal/common/proxy/errors.ts +42 -0
  443. package/src/internal/common/proxy/event-batch.ts +44 -0
  444. package/src/internal/common/proxy/handler.test.ts +121 -0
  445. package/src/internal/common/proxy/index.ts +17 -0
  446. package/src/internal/common/proxy/json-serializer.ts +93 -0
  447. package/src/internal/common/proxy/make-object.ts +128 -0
  448. package/src/internal/common/proxy/ownership.ts +252 -0
  449. package/src/internal/common/proxy/proxy-types.ts +23 -0
  450. package/src/internal/common/proxy/proxy-utils.ts +150 -0
  451. package/src/internal/common/proxy/reactive-array.ts +71 -0
  452. package/src/internal/common/proxy/reactive.test.ts +54 -0
  453. package/src/internal/common/proxy/reactive.ts +77 -0
  454. package/src/internal/{object → common/proxy}/schema-validator.ts +6 -3
  455. package/src/internal/common/proxy/schema.test.ts +107 -0
  456. package/src/internal/common/proxy/symbols.ts +7 -0
  457. package/src/internal/common/proxy/typed-handler.test.ts +314 -0
  458. package/src/internal/common/proxy/typed-handler.ts +507 -0
  459. package/src/internal/common/proxy/typed-object.test.ts +103 -0
  460. package/src/internal/common/types/base.ts +43 -0
  461. package/src/internal/common/types/entity.ts +133 -0
  462. package/src/internal/common/types/index.ts +10 -0
  463. package/src/internal/common/types/meta.ts +79 -0
  464. package/src/internal/common/types/model-symbols.ts +74 -0
  465. package/src/internal/common/types/typename.ts +91 -0
  466. package/src/internal/common/types/version.ts +19 -0
  467. package/src/internal/index.ts +12 -17
  468. package/src/testing/api.test.ts +129 -0
  469. package/src/testing/index.ts +3 -3
  470. package/src/testing/test-data.ts +189 -0
  471. package/src/testing/test-schema.ts +204 -0
  472. package/src/testing/util.ts +88 -0
  473. package/dist/lib/browser/chunk-HKFCK2GL.mjs +0 -175
  474. package/dist/lib/browser/chunk-HKFCK2GL.mjs.map +0 -7
  475. package/dist/lib/browser/chunk-MAAYELT7.mjs +0 -830
  476. package/dist/lib/browser/chunk-MAAYELT7.mjs.map +0 -7
  477. package/dist/lib/browser/chunk-MB6MMNFP.mjs +0 -3857
  478. package/dist/lib/browser/chunk-MB6MMNFP.mjs.map +0 -7
  479. package/dist/lib/browser/index.mjs +0 -35
  480. package/dist/lib/browser/internal/index.mjs +0 -332
  481. package/dist/lib/browser/meta.json +0 -1
  482. package/dist/lib/browser/query/index.mjs +0 -15
  483. package/dist/lib/browser/testing/index.mjs +0 -298
  484. package/dist/lib/browser/testing/index.mjs.map +0 -7
  485. package/dist/lib/node-esm/chunk-5NWDGIBT.mjs +0 -830
  486. package/dist/lib/node-esm/chunk-5NWDGIBT.mjs.map +0 -7
  487. package/dist/lib/node-esm/chunk-AUAH4E2J.mjs +0 -175
  488. package/dist/lib/node-esm/chunk-AUAH4E2J.mjs.map +0 -7
  489. package/dist/lib/node-esm/chunk-BQRA4VLX.mjs +0 -3857
  490. package/dist/lib/node-esm/chunk-BQRA4VLX.mjs.map +0 -7
  491. package/dist/lib/node-esm/index.mjs +0 -35
  492. package/dist/lib/node-esm/internal/index.mjs +0 -332
  493. package/dist/lib/node-esm/meta.json +0 -1
  494. package/dist/lib/node-esm/query/index.mjs +0 -15
  495. package/dist/lib/node-esm/testing/index.mjs +0 -298
  496. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  497. package/dist/types/src/errors.d.ts +0 -72
  498. package/dist/types/src/errors.d.ts.map +0 -1
  499. package/dist/types/src/internal/ast/annotation-helper.d.ts +0 -8
  500. package/dist/types/src/internal/ast/annotation-helper.d.ts.map +0 -1
  501. package/dist/types/src/internal/ast/annotations.d.ts +0 -125
  502. package/dist/types/src/internal/ast/annotations.d.ts.map +0 -1
  503. package/dist/types/src/internal/ast/annotations.test.d.ts.map +0 -1
  504. package/dist/types/src/internal/ast/entity-kind.d.ts +0 -10
  505. package/dist/types/src/internal/ast/entity-kind.d.ts.map +0 -1
  506. package/dist/types/src/internal/ast/index.d.ts +0 -5
  507. package/dist/types/src/internal/ast/index.d.ts.map +0 -1
  508. package/dist/types/src/internal/ast/types.d.ts +0 -6
  509. package/dist/types/src/internal/ast/types.d.ts.map +0 -1
  510. package/dist/types/src/internal/formats/date.d.ts.map +0 -1
  511. package/dist/types/src/internal/formats/date.test.d.ts.map +0 -1
  512. package/dist/types/src/internal/formats/format.d.ts.map +0 -1
  513. package/dist/types/src/internal/formats/format.test.d.ts.map +0 -1
  514. package/dist/types/src/internal/formats/index.d.ts.map +0 -1
  515. package/dist/types/src/internal/formats/number.d.ts.map +0 -1
  516. package/dist/types/src/internal/formats/object.d.ts.map +0 -1
  517. package/dist/types/src/internal/formats/select.d.ts.map +0 -1
  518. package/dist/types/src/internal/formats/string.d.ts.map +0 -1
  519. package/dist/types/src/internal/formats/types.d.ts.map +0 -1
  520. package/dist/types/src/internal/json/annotations.d.ts.map +0 -1
  521. package/dist/types/src/internal/json/effect-schema.test.d.ts.map +0 -1
  522. package/dist/types/src/internal/json/index.d.ts +0 -2
  523. package/dist/types/src/internal/json/index.d.ts.map +0 -1
  524. package/dist/types/src/internal/json/json-schema.d.ts.map +0 -1
  525. package/dist/types/src/internal/json/json-schema.test.d.ts.map +0 -1
  526. package/dist/types/src/internal/json-schema/index.d.ts +0 -3
  527. package/dist/types/src/internal/json-schema/index.d.ts.map +0 -1
  528. package/dist/types/src/internal/json-schema/json-schema-normalize.d.ts.map +0 -1
  529. package/dist/types/src/internal/json-schema/json-schema-type.d.ts.map +0 -1
  530. package/dist/types/src/internal/object/accessors.d.ts +0 -37
  531. package/dist/types/src/internal/object/accessors.d.ts.map +0 -1
  532. package/dist/types/src/internal/object/common.d.ts.map +0 -1
  533. package/dist/types/src/internal/object/create.d.ts.map +0 -1
  534. package/dist/types/src/internal/object/create.test.d.ts +0 -2
  535. package/dist/types/src/internal/object/create.test.d.ts.map +0 -1
  536. package/dist/types/src/internal/object/deleted.d.ts +0 -6
  537. package/dist/types/src/internal/object/deleted.d.ts.map +0 -1
  538. package/dist/types/src/internal/object/entity.d.ts +0 -33
  539. package/dist/types/src/internal/object/entity.d.ts.map +0 -1
  540. package/dist/types/src/internal/object/expando.d.ts +0 -14
  541. package/dist/types/src/internal/object/expando.d.ts.map +0 -1
  542. package/dist/types/src/internal/object/ids.d.ts +0 -6
  543. package/dist/types/src/internal/object/ids.d.ts.map +0 -1
  544. package/dist/types/src/internal/object/index.d.ts +0 -16
  545. package/dist/types/src/internal/object/index.d.ts.map +0 -1
  546. package/dist/types/src/internal/object/inspect.d.ts.map +0 -1
  547. package/dist/types/src/internal/object/json-serializer.d.ts +0 -32
  548. package/dist/types/src/internal/object/json-serializer.d.ts.map +0 -1
  549. package/dist/types/src/internal/object/json-serializer.test.d.ts.map +0 -1
  550. package/dist/types/src/internal/object/meta.d.ts +0 -31
  551. package/dist/types/src/internal/object/meta.d.ts.map +0 -1
  552. package/dist/types/src/internal/object/model.d.ts +0 -117
  553. package/dist/types/src/internal/object/model.d.ts.map +0 -1
  554. package/dist/types/src/internal/object/relation.d.ts +0 -17
  555. package/dist/types/src/internal/object/relation.d.ts.map +0 -1
  556. package/dist/types/src/internal/object/schema-validator.d.ts.map +0 -1
  557. package/dist/types/src/internal/object/schema-validator.test.d.ts.map +0 -1
  558. package/dist/types/src/internal/object/typed-object.d.ts +0 -31
  559. package/dist/types/src/internal/object/typed-object.d.ts.map +0 -1
  560. package/dist/types/src/internal/object/typed-object.test.d.ts.map +0 -1
  561. package/dist/types/src/internal/object/typename.d.ts +0 -15
  562. package/dist/types/src/internal/object/typename.d.ts.map +0 -1
  563. package/dist/types/src/internal/object/version.d.ts +0 -14
  564. package/dist/types/src/internal/object/version.d.ts.map +0 -1
  565. package/dist/types/src/internal/projection/compose.d.ts +0 -6
  566. package/dist/types/src/internal/projection/compose.d.ts.map +0 -1
  567. package/dist/types/src/internal/projection/compose.test.d.ts.map +0 -1
  568. package/dist/types/src/internal/projection/index.d.ts +0 -2
  569. package/dist/types/src/internal/projection/index.d.ts.map +0 -1
  570. package/dist/types/src/internal/proxy/handler.test.d.ts.map +0 -1
  571. package/dist/types/src/internal/proxy/reactive-object.d.ts +0 -15
  572. package/dist/types/src/internal/proxy/reactive-object.d.ts.map +0 -1
  573. package/dist/types/src/internal/proxy/schema.test.d.ts.map +0 -1
  574. package/dist/types/src/internal/proxy/typed-handler.d.ts +0 -44
  575. package/dist/types/src/internal/proxy/typed-handler.d.ts.map +0 -1
  576. package/dist/types/src/internal/proxy/typed-handler.test.d.ts.map +0 -1
  577. package/dist/types/src/internal/proxy/typed-object.test.d.ts.map +0 -1
  578. package/dist/types/src/internal/query/index.d.ts +0 -2
  579. package/dist/types/src/internal/query/index.d.ts.map +0 -1
  580. package/dist/types/src/internal/query/query.d.ts +0 -17
  581. package/dist/types/src/internal/query/query.d.ts.map +0 -1
  582. package/dist/types/src/internal/ref/index.d.ts.map +0 -1
  583. package/dist/types/src/internal/ref/ref-array.d.ts.map +0 -1
  584. package/dist/types/src/internal/ref/ref.d.ts.map +0 -1
  585. package/dist/types/src/internal/ref/ref.test.d.ts.map +0 -1
  586. package/dist/types/src/internal/schema/echo-schema.d.ts +0 -168
  587. package/dist/types/src/internal/schema/echo-schema.d.ts.map +0 -1
  588. package/dist/types/src/internal/schema/index.d.ts +0 -7
  589. package/dist/types/src/internal/schema/index.d.ts.map +0 -1
  590. package/dist/types/src/internal/schema/manipulation.d.ts.map +0 -1
  591. package/dist/types/src/internal/schema/runtime-schema-registry.d.ts +0 -18
  592. package/dist/types/src/internal/schema/runtime-schema-registry.d.ts.map +0 -1
  593. package/dist/types/src/internal/schema/snapshot.d.ts +0 -6
  594. package/dist/types/src/internal/schema/snapshot.d.ts.map +0 -1
  595. package/dist/types/src/internal/schema/stored-schema.d.ts +0 -13
  596. package/dist/types/src/internal/schema/stored-schema.d.ts.map +0 -1
  597. package/dist/types/src/internal/testing/index.d.ts +0 -3
  598. package/dist/types/src/internal/testing/index.d.ts.map +0 -1
  599. package/dist/types/src/internal/testing/types.d.ts +0 -455
  600. package/dist/types/src/internal/testing/types.d.ts.map +0 -1
  601. package/dist/types/src/internal/testing/utils.d.ts +0 -10
  602. package/dist/types/src/internal/testing/utils.d.ts.map +0 -1
  603. package/dist/types/src/internal/types/index.d.ts +0 -3
  604. package/dist/types/src/internal/types/index.d.ts.map +0 -1
  605. package/dist/types/src/internal/types/types.d.ts +0 -79
  606. package/dist/types/src/internal/types/types.d.ts.map +0 -1
  607. package/dist/types/src/internal/types/types.test.d.ts +0 -2
  608. package/dist/types/src/internal/types/types.test.d.ts.map +0 -1
  609. package/dist/types/src/internal/types/util.d.ts +0 -5
  610. package/dist/types/src/internal/types/util.d.ts.map +0 -1
  611. package/dist/types/src/query/index.d.ts +0 -3
  612. package/dist/types/src/query/index.d.ts.map +0 -1
  613. package/dist/types/src/query/query.d.ts +0 -248
  614. package/dist/types/src/query/query.d.ts.map +0 -1
  615. package/dist/types/src/query/query.test.d.ts +0 -2
  616. package/dist/types/src/query/query.test.d.ts.map +0 -1
  617. package/dist/types/src/query/tag.d.ts +0 -17
  618. package/dist/types/src/query/tag.d.ts.map +0 -1
  619. package/dist/types/src/testing/echo-schema.d.ts +0 -7
  620. package/dist/types/src/testing/echo-schema.d.ts.map +0 -1
  621. package/dist/types/src/testing/types.d.ts +0 -113
  622. package/dist/types/src/testing/types.d.ts.map +0 -1
  623. package/src/errors.ts +0 -18
  624. package/src/internal/ast/annotation-helper.ts +0 -22
  625. package/src/internal/ast/annotations.test.ts +0 -98
  626. package/src/internal/ast/annotations.ts +0 -219
  627. package/src/internal/ast/entity-kind.ts +0 -15
  628. package/src/internal/ast/index.ts +0 -8
  629. package/src/internal/ast/types.ts +0 -17
  630. package/src/internal/json/index.ts +0 -5
  631. package/src/internal/object/accessors.ts +0 -153
  632. package/src/internal/object/create.ts +0 -96
  633. package/src/internal/object/deleted.ts +0 -19
  634. package/src/internal/object/entity.ts +0 -248
  635. package/src/internal/object/expando.ts +0 -21
  636. package/src/internal/object/ids.ts +0 -12
  637. package/src/internal/object/index.ts +0 -19
  638. package/src/internal/object/json-serializer.test.ts +0 -99
  639. package/src/internal/object/json-serializer.ts +0 -225
  640. package/src/internal/object/meta.ts +0 -61
  641. package/src/internal/object/model.ts +0 -170
  642. package/src/internal/object/relation.ts +0 -24
  643. package/src/internal/object/typed-object.test.ts +0 -34
  644. package/src/internal/object/typed-object.ts +0 -88
  645. package/src/internal/object/typename.ts +0 -61
  646. package/src/internal/object/version.ts +0 -22
  647. package/src/internal/projection/index.ts +0 -5
  648. package/src/internal/proxy/handler.test.ts +0 -163
  649. package/src/internal/proxy/reactive-object.ts +0 -108
  650. package/src/internal/proxy/schema.test.ts +0 -136
  651. package/src/internal/proxy/typed-handler.test.ts +0 -102
  652. package/src/internal/proxy/typed-handler.ts +0 -228
  653. package/src/internal/proxy/typed-object.test.ts +0 -100
  654. package/src/internal/query/index.ts +0 -5
  655. package/src/internal/query/query.ts +0 -23
  656. package/src/internal/schema/echo-schema.ts +0 -383
  657. package/src/internal/schema/index.ts +0 -10
  658. package/src/internal/schema/runtime-schema-registry.ts +0 -78
  659. package/src/internal/schema/snapshot.ts +0 -25
  660. package/src/internal/schema/stored-schema.ts +0 -26
  661. package/src/internal/testing/types.ts +0 -211
  662. package/src/internal/testing/utils.ts +0 -54
  663. package/src/internal/types/index.ts +0 -6
  664. package/src/internal/types/types.test.ts +0 -48
  665. package/src/internal/types/types.ts +0 -176
  666. package/src/internal/types/util.ts +0 -9
  667. package/src/query/index.ts +0 -6
  668. package/src/query/query.test.ts +0 -401
  669. package/src/query/query.ts +0 -789
  670. package/src/test/api.test.ts +0 -180
  671. package/src/testing/echo-schema.ts +0 -39
  672. package/src/testing/types.ts +0 -91
  673. /package/dist/lib/{browser/index.mjs.map → neutral/Annotation.mjs.map} +0 -0
  674. /package/dist/lib/{browser/internal/index.mjs.map → neutral/Database.mjs.map} +0 -0
  675. /package/dist/lib/{browser/query/index.mjs.map → neutral/Entity.mjs.map} +0 -0
  676. /package/dist/lib/{node-esm/index.mjs.map → neutral/Err.mjs.map} +0 -0
  677. /package/dist/lib/{node-esm/internal/index.mjs.map → neutral/Extension.mjs.map} +0 -0
  678. /package/dist/lib/{node-esm/query/index.mjs.map → neutral/Feed.mjs.map} +0 -0
  679. /package/dist/types/src/internal/{ast → Annotation}/annotations.test.d.ts +0 -0
  680. /package/dist/types/src/internal/{formats → Format}/date.d.ts +0 -0
  681. /package/dist/types/src/internal/{formats → Format}/date.test.d.ts +0 -0
  682. /package/dist/types/src/internal/{formats → Format}/format.test.d.ts +0 -0
  683. /package/dist/types/src/internal/{formats → Format}/number.d.ts +0 -0
  684. /package/dist/types/src/internal/{formats → Format}/object.d.ts +0 -0
  685. /package/dist/types/src/internal/{json → JsonSchema}/effect-schema.test.d.ts +0 -0
  686. /package/dist/types/src/internal/{json-schema → JsonSchema}/json-schema-normalize.d.ts +0 -0
  687. /package/dist/types/src/internal/{json → JsonSchema}/json-schema.test.d.ts +0 -0
  688. /package/dist/types/src/internal/{object → Obj}/common.d.ts +0 -0
  689. /package/dist/types/src/internal/{object → Obj}/inspect.d.ts +0 -0
  690. /package/dist/types/src/internal/{object → Obj}/json-serializer.test.d.ts +0 -0
  691. /package/dist/types/src/internal/{object → Obj}/schema-validator.test.d.ts +0 -0
  692. /package/dist/types/src/internal/{object → Obj}/typed-object.test.d.ts +0 -0
  693. /package/dist/types/src/internal/{ref → Ref}/index.d.ts +0 -0
  694. /package/dist/types/src/internal/{ref → Ref}/ref.test.d.ts +0 -0
  695. /package/dist/types/src/internal/{projection → Type}/compose.test.d.ts +0 -0
  696. /package/dist/types/src/internal/{proxy → common/proxy}/handler.test.d.ts +0 -0
  697. /package/dist/types/src/internal/{object → common/proxy}/schema-validator.d.ts +0 -0
  698. /package/dist/types/src/internal/{proxy → common/proxy}/schema.test.d.ts +0 -0
  699. /package/dist/types/src/internal/{proxy → common/proxy}/typed-handler.test.d.ts +0 -0
  700. /package/dist/types/src/internal/{proxy → common/proxy}/typed-object.test.d.ts +0 -0
  701. /package/dist/types/src/{test → testing}/api.test.d.ts +0 -0
  702. /package/src/internal/{json → JsonSchema}/effect-schema.test.ts +0 -0
  703. /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 { Type } from '../..';
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 '../ast';
24
- import { Email, FormatAnnotation, FormatEnum } from '../formats';
25
- import { JsonSchemaType, getNormalizedEchoAnnotations, getSchemaProperty, setSchemaProperty } from '../json-schema';
26
- import { EchoObject } from '../object';
27
- import { Ref, createSchemaReference, getReferenceAst, getSchemaReference } from '../ref';
28
- import { StoredSchema } from '../schema';
29
- import { Testing, prepareAstForCompare } from '../testing';
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.Obj({
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((jsonSchema as any).$id).toEqual('dxn:type:example.com/type/Test');
45
- expect((jsonSchema as any).version).toEqual('0.1.0');
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 TestSchema = Schema.Struct({
113
+ const TempSchema = Schema.Struct({
163
114
  name: Schema.String.annotations({ description: 'Person name', title: 'Name' }),
164
- email: Schema.String.pipe(FormatAnnotation.set(FormatEnum.Email)).annotations({
115
+ email: Schema.String.pipe(FormatAnnotation.set(TypeFormat.Email)).annotations({
165
116
  description: 'Email address',
166
117
  }),
167
- }).pipe(
168
- Type.Obj({
169
- typename: 'example.com/type/Contact',
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:example.com/type/Contact',
123
+ $id: 'dxn:com.example.type.person:0.1.0',
177
124
 
178
125
  entityKind: EntityKind.Object,
179
- typename: 'example.com/type/Contact',
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(Testing.Contact);
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
- 'phoneNumbers',
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:example.com/type/Contact',
176
+ $id: 'dxn:com.example.type.person:0.1.0',
238
177
 
239
178
  entityKind: EntityKind.Object,
240
- typename: 'example.com/type/Contact',
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:type:example.com/type/Organization',
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.typename));
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.typename);
226
+ expect(typename).to.eq(Type.getTypename(Organization));
298
227
  });
299
228
 
300
- test('serialize circular schema (StoredSchema)', () => {
301
- const jsonSchema = toJsonSchema(StoredSchema);
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(Testing.Contact).annotations({ title: 'Custom Title' }),
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 = Testing.HasManager;
276
+ const schema = TestSchema.EmployedBy;
348
277
  const jsonSchema = toJsonSchema(schema);
349
278
  expect(jsonSchema).toEqual({
350
- $id: 'dxn:type:example.com/type/HasManager',
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.com/type/HasManager',
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:type:example.com/type/Contact',
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:type:example.com/type/Contact',
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:example.com/type/Organization',
318
+ $id: 'dxn:com.example.type.organization:0.1.0',
393
319
  $schema: 'http://json-schema.org/draft-07/schema#',
394
- typename: 'example.com/type/Organization',
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:type:example.com/type/TestNested',
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(FormatEnum.Email)),
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.Obj({
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
- expect(() => expect(schema.ast).to.deep.eq(Test.ast)).to.throw();
526
- expect(() => expect(prepareAstForCompare(Test.ast)).to.deep.eq(Test.ast)).to.throw();
527
- expect(() => expect(schema.ast).to.deep.eq(prepareAstForCompare(Test.ast))).to.throw();
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(Test.ast));
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.com/type/Project',
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.com/type/Project',
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.com/type/Project',
493
+ typename: 'com.example.type.project',
575
494
  version: '0.1.0',
576
495
  });
577
- expect(getTypeIdentifierAnnotation(schema)).to.deep.eq('dxn:echo:@:01JERV1HQCQZDQ4NVCJ42QB38F');
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(FormatEnum.Email));
582
- const schema2 = Schema.String.pipe(FormatAnnotation.set(FormatEnum.Currency));
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 = Testing.HasManager;
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 TestSchema = Schema.Struct({
701
- contact: Schema.optional(Ref(Testing.Contact)),
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:type:example.com/type/Contact",
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(TestSchema.ast));
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(EchoObject({ typename: 'example.com/type/Contact', version: '0.1.0' }));
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:example.com/type/Contact",
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.com/type/Contact",
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(Testing.Contact);
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:type:example.com/type/Contact',
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(Testing.Contact).annotations({ title: 'My custom title' });
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:type:example.com/type/Contact',
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(Testing.Contact).annotations({ description: 'My custom description' });
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:type:example.com/type/Contact',
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(Testing.Contact);
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: Testing.Contact.typename,
854
- version: Testing.Contact.version,
770
+ typename: Type.getTypename(TestSchema.Person),
771
+ version: Type.getVersion(TestSchema.Person),
855
772
  });
856
773
  });
857
774
  });