@dxos/echo 0.8.4-main.e098934 → 0.8.4-main.ead640a

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 (308) hide show
  1. package/dist/lib/browser/chunk-HKFCK2GL.mjs +175 -0
  2. package/dist/lib/browser/chunk-HKFCK2GL.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-EIXXFUN5.mjs → chunk-MAAYELT7.mjs} +477 -486
  4. package/dist/lib/browser/chunk-MAAYELT7.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-MB6MMNFP.mjs +3857 -0
  6. package/dist/lib/browser/chunk-MB6MMNFP.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +12 -7
  8. package/dist/lib/browser/internal/index.mjs +332 -0
  9. package/dist/lib/browser/internal/index.mjs.map +7 -0
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/query/index.mjs +15 -0
  12. package/dist/lib/browser/query/index.mjs.map +7 -0
  13. package/dist/lib/browser/testing/index.mjs +260 -32
  14. package/dist/lib/browser/testing/index.mjs.map +4 -4
  15. package/dist/lib/node-esm/{chunk-TCY7IVTS.mjs → chunk-5NWDGIBT.mjs} +477 -486
  16. package/dist/lib/node-esm/chunk-5NWDGIBT.mjs.map +7 -0
  17. package/dist/lib/node-esm/chunk-AUAH4E2J.mjs +175 -0
  18. package/dist/lib/node-esm/chunk-AUAH4E2J.mjs.map +7 -0
  19. package/dist/lib/node-esm/chunk-BQRA4VLX.mjs +3857 -0
  20. package/dist/lib/node-esm/chunk-BQRA4VLX.mjs.map +7 -0
  21. package/dist/lib/node-esm/index.mjs +12 -7
  22. package/dist/lib/node-esm/internal/index.mjs +332 -0
  23. package/dist/lib/node-esm/internal/index.mjs.map +7 -0
  24. package/dist/lib/node-esm/meta.json +1 -1
  25. package/dist/lib/node-esm/query/index.mjs +15 -0
  26. package/dist/lib/node-esm/query/index.mjs.map +7 -0
  27. package/dist/lib/node-esm/testing/index.mjs +260 -32
  28. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  29. package/dist/types/src/Obj.d.ts +22 -5
  30. package/dist/types/src/Obj.d.ts.map +1 -1
  31. package/dist/types/src/Ref.d.ts +1 -1
  32. package/dist/types/src/Ref.d.ts.map +1 -1
  33. package/dist/types/src/Relation.d.ts +5 -4
  34. package/dist/types/src/Relation.d.ts.map +1 -1
  35. package/dist/types/src/Type.d.ts +16 -17
  36. package/dist/types/src/Type.d.ts.map +1 -1
  37. package/dist/types/src/errors.d.ts +8 -8
  38. package/dist/types/src/index.d.ts +2 -2
  39. package/dist/types/src/index.d.ts.map +1 -1
  40. package/dist/types/src/internal/ast/annotation-helper.d.ts +8 -0
  41. package/dist/types/src/internal/ast/annotation-helper.d.ts.map +1 -0
  42. package/dist/types/src/internal/ast/annotations.d.ts +125 -0
  43. package/dist/types/src/internal/ast/annotations.d.ts.map +1 -0
  44. package/dist/types/src/internal/ast/annotations.test.d.ts +2 -0
  45. package/dist/types/src/internal/ast/annotations.test.d.ts.map +1 -0
  46. package/dist/types/src/internal/ast/entity-kind.d.ts +10 -0
  47. package/dist/types/src/internal/ast/entity-kind.d.ts.map +1 -0
  48. package/dist/types/src/internal/ast/index.d.ts +5 -0
  49. package/dist/types/src/internal/ast/index.d.ts.map +1 -0
  50. package/dist/types/src/internal/ast/types.d.ts +6 -0
  51. package/dist/types/src/internal/ast/types.d.ts.map +1 -0
  52. package/dist/types/src/internal/formats/date.d.ts +63 -0
  53. package/dist/types/src/internal/formats/date.d.ts.map +1 -0
  54. package/dist/types/src/internal/formats/date.test.d.ts +2 -0
  55. package/dist/types/src/internal/formats/date.test.d.ts.map +1 -0
  56. package/dist/types/src/internal/formats/format.d.ts +30 -0
  57. package/dist/types/src/internal/formats/format.d.ts.map +1 -0
  58. package/dist/types/src/internal/formats/format.test.d.ts +2 -0
  59. package/dist/types/src/internal/formats/format.test.d.ts.map +1 -0
  60. package/dist/types/src/internal/formats/index.d.ts +8 -0
  61. package/dist/types/src/internal/formats/index.d.ts.map +1 -0
  62. package/dist/types/src/internal/formats/number.d.ts +31 -0
  63. package/dist/types/src/internal/formats/number.d.ts.map +1 -0
  64. package/dist/types/src/internal/formats/object.d.ts +35 -0
  65. package/dist/types/src/internal/formats/object.d.ts.map +1 -0
  66. package/dist/types/src/internal/formats/select.d.ts +11 -0
  67. package/dist/types/src/internal/formats/select.d.ts.map +1 -0
  68. package/dist/types/src/internal/formats/string.d.ts +38 -0
  69. package/dist/types/src/internal/formats/string.d.ts.map +1 -0
  70. package/dist/types/src/internal/formats/types.d.ts +68 -0
  71. package/dist/types/src/internal/formats/types.d.ts.map +1 -0
  72. package/dist/types/src/internal/index.d.ts +15 -0
  73. package/dist/types/src/internal/index.d.ts.map +1 -0
  74. package/dist/types/src/internal/json/annotations.d.ts +19 -0
  75. package/dist/types/src/internal/json/annotations.d.ts.map +1 -0
  76. package/dist/types/src/internal/json/effect-schema.test.d.ts +2 -0
  77. package/dist/types/src/internal/json/effect-schema.test.d.ts.map +1 -0
  78. package/dist/types/src/internal/json/index.d.ts +2 -0
  79. package/dist/types/src/internal/json/index.d.ts.map +1 -0
  80. package/dist/types/src/internal/json/json-schema.d.ts +28 -0
  81. package/dist/types/src/internal/json/json-schema.d.ts.map +1 -0
  82. package/dist/types/src/internal/json/json-schema.test.d.ts +2 -0
  83. package/dist/types/src/internal/json/json-schema.test.d.ts.map +1 -0
  84. package/dist/types/src/internal/json-schema/index.d.ts +3 -0
  85. package/dist/types/src/internal/json-schema/index.d.ts.map +1 -0
  86. package/dist/types/src/internal/json-schema/json-schema-normalize.d.ts +7 -0
  87. package/dist/types/src/internal/json-schema/json-schema-normalize.d.ts.map +1 -0
  88. package/dist/types/src/internal/json-schema/json-schema-type.d.ts +250 -0
  89. package/dist/types/src/internal/json-schema/json-schema-type.d.ts.map +1 -0
  90. package/dist/types/src/internal/object/accessors.d.ts +37 -0
  91. package/dist/types/src/internal/object/accessors.d.ts.map +1 -0
  92. package/dist/types/src/internal/object/common.d.ts +18 -0
  93. package/dist/types/src/internal/object/common.d.ts.map +1 -0
  94. package/dist/types/src/internal/object/create.d.ts +40 -0
  95. package/dist/types/src/internal/object/create.d.ts.map +1 -0
  96. package/dist/types/src/internal/object/create.test.d.ts +2 -0
  97. package/dist/types/src/internal/object/create.test.d.ts.map +1 -0
  98. package/dist/types/src/internal/object/deleted.d.ts +6 -0
  99. package/dist/types/src/internal/object/deleted.d.ts.map +1 -0
  100. package/dist/types/src/internal/object/entity.d.ts +33 -0
  101. package/dist/types/src/internal/object/entity.d.ts.map +1 -0
  102. package/dist/types/src/internal/object/expando.d.ts +14 -0
  103. package/dist/types/src/internal/object/expando.d.ts.map +1 -0
  104. package/dist/types/src/internal/object/ids.d.ts +6 -0
  105. package/dist/types/src/internal/object/ids.d.ts.map +1 -0
  106. package/dist/types/src/internal/object/index.d.ts +16 -0
  107. package/dist/types/src/internal/object/index.d.ts.map +1 -0
  108. package/dist/types/src/internal/object/inspect.d.ts +2 -0
  109. package/dist/types/src/internal/object/inspect.d.ts.map +1 -0
  110. package/dist/types/src/internal/object/json-serializer.d.ts +32 -0
  111. package/dist/types/src/internal/object/json-serializer.d.ts.map +1 -0
  112. package/dist/types/src/internal/object/json-serializer.test.d.ts +2 -0
  113. package/dist/types/src/internal/object/json-serializer.test.d.ts.map +1 -0
  114. package/dist/types/src/internal/object/meta.d.ts +31 -0
  115. package/dist/types/src/internal/object/meta.d.ts.map +1 -0
  116. package/dist/types/src/internal/object/model.d.ts +117 -0
  117. package/dist/types/src/internal/object/model.d.ts.map +1 -0
  118. package/dist/types/src/internal/object/relation.d.ts +17 -0
  119. package/dist/types/src/internal/object/relation.d.ts.map +1 -0
  120. package/dist/types/src/internal/object/schema-validator.d.ts +15 -0
  121. package/dist/types/src/internal/object/schema-validator.d.ts.map +1 -0
  122. package/dist/types/src/internal/object/schema-validator.test.d.ts +2 -0
  123. package/dist/types/src/internal/object/schema-validator.test.d.ts.map +1 -0
  124. package/dist/types/src/internal/object/typed-object.d.ts +31 -0
  125. package/dist/types/src/internal/object/typed-object.d.ts.map +1 -0
  126. package/dist/types/src/internal/object/typed-object.test.d.ts +2 -0
  127. package/dist/types/src/internal/object/typed-object.test.d.ts.map +1 -0
  128. package/dist/types/src/internal/object/typename.d.ts +15 -0
  129. package/dist/types/src/internal/object/typename.d.ts.map +1 -0
  130. package/dist/types/src/internal/object/version.d.ts +14 -0
  131. package/dist/types/src/internal/object/version.d.ts.map +1 -0
  132. package/dist/types/src/internal/projection/compose.d.ts +6 -0
  133. package/dist/types/src/internal/projection/compose.d.ts.map +1 -0
  134. package/dist/types/src/internal/projection/compose.test.d.ts +2 -0
  135. package/dist/types/src/internal/projection/compose.test.d.ts.map +1 -0
  136. package/dist/types/src/internal/projection/index.d.ts +2 -0
  137. package/dist/types/src/internal/projection/index.d.ts.map +1 -0
  138. package/dist/types/src/internal/proxy/handler.test.d.ts +2 -0
  139. package/dist/types/src/internal/proxy/handler.test.d.ts.map +1 -0
  140. package/dist/types/src/internal/proxy/reactive-object.d.ts +15 -0
  141. package/dist/types/src/internal/proxy/reactive-object.d.ts.map +1 -0
  142. package/dist/types/src/internal/proxy/schema.test.d.ts +2 -0
  143. package/dist/types/src/internal/proxy/schema.test.d.ts.map +1 -0
  144. package/dist/types/src/internal/proxy/typed-handler.d.ts +44 -0
  145. package/dist/types/src/internal/proxy/typed-handler.d.ts.map +1 -0
  146. package/dist/types/src/internal/proxy/typed-handler.test.d.ts +2 -0
  147. package/dist/types/src/internal/proxy/typed-handler.test.d.ts.map +1 -0
  148. package/dist/types/src/internal/proxy/typed-object.test.d.ts +2 -0
  149. package/dist/types/src/internal/proxy/typed-object.test.d.ts.map +1 -0
  150. package/dist/types/src/internal/query/index.d.ts +2 -0
  151. package/dist/types/src/internal/query/index.d.ts.map +1 -0
  152. package/dist/types/src/internal/query/query.d.ts +17 -0
  153. package/dist/types/src/internal/query/query.d.ts.map +1 -0
  154. package/dist/types/src/internal/ref/index.d.ts +3 -0
  155. package/dist/types/src/internal/ref/index.d.ts.map +1 -0
  156. package/dist/types/src/internal/ref/ref-array.d.ts +21 -0
  157. package/dist/types/src/internal/ref/ref-array.d.ts.map +1 -0
  158. package/dist/types/src/internal/ref/ref.d.ts +206 -0
  159. package/dist/types/src/internal/ref/ref.d.ts.map +1 -0
  160. package/dist/types/src/internal/ref/ref.test.d.ts +2 -0
  161. package/dist/types/src/internal/ref/ref.test.d.ts.map +1 -0
  162. package/dist/types/src/internal/schema/echo-schema.d.ts +168 -0
  163. package/dist/types/src/internal/schema/echo-schema.d.ts.map +1 -0
  164. package/dist/types/src/internal/schema/index.d.ts +7 -0
  165. package/dist/types/src/internal/schema/index.d.ts.map +1 -0
  166. package/dist/types/src/internal/schema/manipulation.d.ts +10 -0
  167. package/dist/types/src/internal/schema/manipulation.d.ts.map +1 -0
  168. package/dist/types/src/internal/schema/runtime-schema-registry.d.ts +18 -0
  169. package/dist/types/src/internal/schema/runtime-schema-registry.d.ts.map +1 -0
  170. package/dist/types/src/internal/schema/snapshot.d.ts +6 -0
  171. package/dist/types/src/internal/schema/snapshot.d.ts.map +1 -0
  172. package/dist/types/src/internal/schema/stored-schema.d.ts +13 -0
  173. package/dist/types/src/internal/schema/stored-schema.d.ts.map +1 -0
  174. package/dist/types/src/internal/testing/index.d.ts +3 -0
  175. package/dist/types/src/internal/testing/index.d.ts.map +1 -0
  176. package/dist/types/src/internal/testing/types.d.ts +455 -0
  177. package/dist/types/src/internal/testing/types.d.ts.map +1 -0
  178. package/dist/types/src/internal/testing/utils.d.ts +10 -0
  179. package/dist/types/src/internal/testing/utils.d.ts.map +1 -0
  180. package/dist/types/src/internal/types/index.d.ts +3 -0
  181. package/dist/types/src/internal/types/index.d.ts.map +1 -0
  182. package/dist/types/src/internal/types/types.d.ts +79 -0
  183. package/dist/types/src/internal/types/types.d.ts.map +1 -0
  184. package/dist/types/src/internal/types/types.test.d.ts +2 -0
  185. package/dist/types/src/internal/types/types.test.d.ts.map +1 -0
  186. package/dist/types/src/internal/types/util.d.ts +5 -0
  187. package/dist/types/src/internal/types/util.d.ts.map +1 -0
  188. package/dist/types/src/query/index.d.ts +2 -1
  189. package/dist/types/src/query/index.d.ts.map +1 -1
  190. package/dist/types/src/query/{dsl.d.ts → query.d.ts} +28 -23
  191. package/dist/types/src/query/query.d.ts.map +1 -0
  192. package/dist/types/src/query/query.test.d.ts +2 -0
  193. package/dist/types/src/query/query.test.d.ts.map +1 -0
  194. package/dist/types/src/query/tag.d.ts +17 -0
  195. package/dist/types/src/query/tag.d.ts.map +1 -0
  196. package/dist/types/src/testing/echo-schema.d.ts +7 -0
  197. package/dist/types/src/testing/echo-schema.d.ts.map +1 -0
  198. package/dist/types/src/testing/index.d.ts +2 -0
  199. package/dist/types/src/testing/index.d.ts.map +1 -1
  200. package/dist/types/src/testing/types.d.ts +18 -18
  201. package/dist/types/src/testing/types.d.ts.map +1 -1
  202. package/dist/types/tsconfig.tsbuildinfo +1 -1
  203. package/package.json +29 -18
  204. package/src/Obj.ts +77 -12
  205. package/src/Ref.ts +1 -2
  206. package/src/Relation.ts +15 -5
  207. package/src/Type.ts +29 -30
  208. package/src/index.ts +2 -2
  209. package/src/internal/ast/annotation-helper.ts +22 -0
  210. package/src/internal/ast/annotations.test.ts +98 -0
  211. package/src/internal/ast/annotations.ts +219 -0
  212. package/src/internal/ast/entity-kind.ts +15 -0
  213. package/src/internal/ast/index.ts +8 -0
  214. package/src/internal/ast/types.ts +17 -0
  215. package/src/internal/formats/date.test.ts +56 -0
  216. package/src/internal/formats/date.ts +217 -0
  217. package/src/internal/formats/format.test.ts +77 -0
  218. package/src/internal/formats/format.ts +52 -0
  219. package/src/internal/formats/index.ts +12 -0
  220. package/src/internal/formats/number.ts +89 -0
  221. package/src/internal/formats/object.ts +80 -0
  222. package/src/internal/formats/select.ts +16 -0
  223. package/src/internal/formats/string.ts +76 -0
  224. package/src/internal/formats/types.ts +175 -0
  225. package/src/internal/index.ts +22 -0
  226. package/src/internal/json/annotations.ts +50 -0
  227. package/src/internal/json/effect-schema.test.ts +143 -0
  228. package/src/internal/json/index.ts +5 -0
  229. package/src/internal/json/json-schema.test.ts +857 -0
  230. package/src/internal/json/json-schema.ts +519 -0
  231. package/src/internal/json-schema/index.ts +6 -0
  232. package/src/internal/json-schema/json-schema-normalize.ts +109 -0
  233. package/src/internal/json-schema/json-schema-type.ts +403 -0
  234. package/src/internal/object/accessors.ts +153 -0
  235. package/src/internal/object/common.ts +76 -0
  236. package/src/internal/object/create.test.ts +118 -0
  237. package/src/internal/object/create.ts +96 -0
  238. package/src/internal/object/deleted.ts +19 -0
  239. package/src/internal/object/entity.ts +248 -0
  240. package/src/internal/object/expando.ts +21 -0
  241. package/src/internal/object/ids.ts +12 -0
  242. package/src/internal/object/index.ts +19 -0
  243. package/src/internal/object/inspect.ts +48 -0
  244. package/src/internal/object/json-serializer.test.ts +99 -0
  245. package/src/internal/object/json-serializer.ts +225 -0
  246. package/src/internal/object/meta.ts +61 -0
  247. package/src/internal/object/model.ts +170 -0
  248. package/src/internal/object/relation.ts +24 -0
  249. package/src/internal/object/schema-validator.test.ts +186 -0
  250. package/src/internal/object/schema-validator.ts +241 -0
  251. package/src/internal/object/typed-object.test.ts +34 -0
  252. package/src/internal/object/typed-object.ts +88 -0
  253. package/src/internal/object/typename.ts +61 -0
  254. package/src/internal/object/version.ts +22 -0
  255. package/src/internal/projection/compose.test.ts +43 -0
  256. package/src/internal/projection/compose.ts +36 -0
  257. package/src/internal/projection/index.ts +5 -0
  258. package/src/internal/proxy/handler.test.ts +163 -0
  259. package/src/internal/proxy/reactive-object.ts +108 -0
  260. package/src/internal/proxy/schema.test.ts +136 -0
  261. package/src/internal/proxy/typed-handler.test.ts +102 -0
  262. package/src/internal/proxy/typed-handler.ts +228 -0
  263. package/src/internal/proxy/typed-object.test.ts +100 -0
  264. package/src/internal/query/index.ts +5 -0
  265. package/src/internal/query/query.ts +23 -0
  266. package/src/internal/ref/index.ts +6 -0
  267. package/src/internal/ref/ref-array.ts +39 -0
  268. package/src/internal/ref/ref.test.ts +100 -0
  269. package/src/internal/ref/ref.ts +521 -0
  270. package/src/internal/schema/echo-schema.ts +383 -0
  271. package/src/internal/schema/index.ts +10 -0
  272. package/src/internal/schema/manipulation.ts +92 -0
  273. package/src/internal/schema/runtime-schema-registry.ts +78 -0
  274. package/src/internal/schema/snapshot.ts +25 -0
  275. package/src/internal/schema/stored-schema.ts +26 -0
  276. package/src/internal/testing/index.ts +6 -0
  277. package/src/internal/testing/types.ts +211 -0
  278. package/src/internal/testing/utils.ts +54 -0
  279. package/src/internal/types/index.ts +6 -0
  280. package/src/internal/types/types.test.ts +48 -0
  281. package/src/internal/types/types.ts +176 -0
  282. package/src/internal/types/util.ts +9 -0
  283. package/src/query/index.ts +2 -1
  284. package/src/query/query.test.ts +401 -0
  285. package/src/query/{dsl.ts → query.ts} +82 -45
  286. package/src/query/tag.ts +37 -0
  287. package/src/test/api.test.ts +9 -9
  288. package/src/testing/echo-schema.ts +39 -0
  289. package/src/testing/index.ts +2 -0
  290. package/src/testing/types.ts +1 -1
  291. package/dist/lib/browser/chunk-EIXXFUN5.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-TCY7IVTS.mjs.map +0 -7
  293. package/dist/types/src/experimental/database.d.ts +0 -8
  294. package/dist/types/src/experimental/database.d.ts.map +0 -1
  295. package/dist/types/src/experimental/index.d.ts +0 -1
  296. package/dist/types/src/experimental/index.d.ts.map +0 -1
  297. package/dist/types/src/experimental/queue.d.ts +0 -8
  298. package/dist/types/src/experimental/queue.d.ts.map +0 -1
  299. package/dist/types/src/experimental/space.d.ts +0 -8
  300. package/dist/types/src/experimental/space.d.ts.map +0 -1
  301. package/dist/types/src/query/dsl.d.ts.map +0 -1
  302. package/dist/types/src/query/dsl.test.d.ts +0 -2
  303. package/dist/types/src/query/dsl.test.d.ts.map +0 -1
  304. package/src/experimental/database.ts +0 -11
  305. package/src/experimental/index.ts +0 -7
  306. package/src/experimental/queue.ts +0 -11
  307. package/src/experimental/space.ts +0 -11
  308. package/src/query/dsl.test.ts +0 -362
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dxos/echo",
3
- "version": "0.8.4-main.e098934",
3
+ "version": "0.8.4-main.ead640a",
4
4
  "description": "ECHO API",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "info@dxos.org",
9
- "sideEffects": true,
9
+ "sideEffects": false,
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
@@ -39,9 +39,21 @@
39
39
  "browser": "./dist/lib/browser/Ref.mjs",
40
40
  "node": "./dist/lib/node-esm/Ref.mjs"
41
41
  },
42
+ "./internal": {
43
+ "source": "./src/internal/index.ts",
44
+ "types": "./dist/types/src/internal/index.d.ts",
45
+ "browser": "./dist/lib/browser/internal/index.mjs",
46
+ "node": "./dist/lib/node-esm/internal/index.mjs"
47
+ },
48
+ "./query": {
49
+ "source": "./src/query/index.ts",
50
+ "types": "./dist/types/src/query/index.d.ts",
51
+ "browser": "./dist/lib/browser/query/index.mjs",
52
+ "node": "./dist/lib/node-esm/query/index.mjs"
53
+ },
42
54
  "./testing": {
43
- "source": "./src/testing/types.ts",
44
- "types": "./dist/types/src/testing/types.d.ts",
55
+ "source": "./src/testing/index.ts",
56
+ "types": "./dist/types/src/testing/index.d.ts",
45
57
  "browser": "./dist/lib/browser/testing/index.mjs",
46
58
  "node": "./dist/lib/node-esm/testing/index.mjs"
47
59
  }
@@ -71,20 +83,19 @@
71
83
  "src"
72
84
  ],
73
85
  "dependencies": {
74
- "@preact/signals-core": "^1.9.0",
75
- "effect": "3.17.7",
76
- "@dxos/debug": "0.8.4-main.e098934",
77
- "@dxos/echo-protocol": "0.8.4-main.e098934",
78
- "@dxos/echo-schema": "0.8.4-main.e098934",
79
- "@dxos/echo-signals": "0.8.4-main.e098934",
80
- "@dxos/errors": "0.8.4-main.e098934",
81
- "@dxos/effect": "0.8.4-main.e098934",
82
- "@dxos/keys": "0.8.4-main.e098934",
83
- "@dxos/live-object": "0.8.4-main.e098934",
84
- "@dxos/log": "0.8.4-main.e098934",
85
- "@dxos/node-std": "0.8.4-main.e098934",
86
- "@dxos/util": "0.8.4-main.e098934",
87
- "@dxos/invariant": "0.8.4-main.e098934"
86
+ "@preact/signals-core": "^1.12.1",
87
+ "effect": "3.18.3",
88
+ "@dxos/debug": "0.8.4-main.ead640a",
89
+ "@dxos/echo-protocol": "0.8.4-main.ead640a",
90
+ "@dxos/echo-signals": "0.8.4-main.ead640a",
91
+ "@dxos/effect": "0.8.4-main.ead640a",
92
+ "@dxos/errors": "0.8.4-main.ead640a",
93
+ "@dxos/invariant": "0.8.4-main.ead640a",
94
+ "@dxos/live-object": "0.8.4-main.ead640a",
95
+ "@dxos/log": "0.8.4-main.ead640a",
96
+ "@dxos/keys": "0.8.4-main.ead640a",
97
+ "@dxos/node-std": "0.8.4-main.ead640a",
98
+ "@dxos/util": "0.8.4-main.ead640a"
88
99
  },
89
100
  "publishConfig": {
90
101
  "access": "public"
package/src/Obj.ts CHANGED
@@ -2,19 +2,19 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
- import { dual } from 'effect/Function';
5
+ import * as Function from 'effect/Function';
6
+ import * as Schema from 'effect/Schema';
7
7
 
8
- import * as EchoSchema from '@dxos/echo-schema';
9
8
  import { assertArgument, invariant } from '@dxos/invariant';
10
9
  import { type DXN } from '@dxos/keys';
11
10
  import * as LiveObject from '@dxos/live-object';
12
- import { live } from '@dxos/live-object';
13
11
  import { assumeType, deepMapValues } from '@dxos/util';
14
12
 
13
+ import { live } from './internal';
14
+ import * as EchoSchema from './internal';
15
15
  import type * as Ref from './Ref';
16
16
  import type * as Relation from './Relation';
17
- import type * as Type from './Type';
17
+ import * as Type from './Type';
18
18
 
19
19
  /**
20
20
  * NOTE: Don't export: Obj.Any and Obj.Obj form the public API.
@@ -28,9 +28,27 @@ export type Obj<Props> = BaseObj & Props;
28
28
 
29
29
  /**
30
30
  * Base type for all ECHO objects.
31
+ * This type does not define any properties.
31
32
  */
32
33
  export interface Any extends BaseObj {}
33
34
 
35
+ /**
36
+ * Object with arbitrary properties.
37
+ *
38
+ * NOTE: Due to how typescript works, this type is not assignable to a specific schema type.
39
+ * In that case, use `Obj.instanceOf` to check if an object is of a specific type.
40
+ */
41
+ export interface AnyProps extends BaseObj {
42
+ [key: string]: any;
43
+ }
44
+
45
+ export const Any = Schema.Struct({}).pipe(
46
+ Type.Obj({
47
+ typename: 'dxos.org/types/Any',
48
+ version: '0.1.0',
49
+ }),
50
+ );
51
+
34
52
  type Props<T = any> = { id?: EchoSchema.ObjectId } & Type.Properties<T>;
35
53
 
36
54
  export type MakeProps<T extends Type.Obj.Any> = NoInfer<Props<Schema.Schema.Type<T>>> & {
@@ -39,7 +57,9 @@ export type MakeProps<T extends Type.Obj.Any> = NoInfer<Props<Schema.Schema.Type
39
57
 
40
58
  export const Meta: unique symbol = EchoSchema.MetaId as any;
41
59
 
42
- // TODO(dmaretskyi): Expose Meta = EchoSchema.MetaId.
60
+ const DEFAULT_META: EchoSchema.ObjectMeta = {
61
+ keys: [],
62
+ };
43
63
 
44
64
  /**
45
65
  * Creates new object.
@@ -57,7 +77,7 @@ export const Meta: unique symbol = EchoSchema.MetaId as any;
57
77
  export const make = <S extends Type.Obj.Any>(
58
78
  schema: S,
59
79
  props: MakeProps<S>,
60
- meta?: EchoSchema.ObjectMeta,
80
+ meta?: Partial<EchoSchema.ObjectMeta>,
61
81
  ): LiveObject.Live<Schema.Schema.Type<S>> => {
62
82
  assertArgument(
63
83
  EchoSchema.getTypeAnnotation(schema)?.kind === EchoSchema.EntityKind.Object,
@@ -66,11 +86,14 @@ export const make = <S extends Type.Obj.Any>(
66
86
  );
67
87
 
68
88
  if (props[EchoSchema.MetaId] != null) {
69
- meta = props[EchoSchema.MetaId] as any;
89
+ // Set default fields on meta on creation.
90
+ meta = { ...structuredClone(DEFAULT_META), ...props[EchoSchema.MetaId] };
70
91
  delete props[EchoSchema.MetaId];
71
92
  }
72
93
 
73
- return live<Schema.Schema.Type<S>>(schema, props as any, meta);
94
+ const filterUndefined = Object.fromEntries(Object.entries(props).filter(([_, v]) => v !== undefined));
95
+
96
+ return live<Schema.Schema.Type<S>>(schema, filterUndefined as any, { keys: [], ...meta });
74
97
  };
75
98
 
76
99
  export const isObject = (obj: unknown): obj is Any => {
@@ -86,7 +109,7 @@ export const isObject = (obj: unknown): obj is Any => {
86
109
  * const johnIsPerson = Obj.instanceOf(Person)(john);
87
110
  *
88
111
  * const isPerson = Obj.instanceOf(Person);
89
- * if(isPerson(john)) {
112
+ * if (isPerson(john)) {
90
113
  * // john is Person
91
114
  * }
92
115
  * ```
@@ -148,7 +171,7 @@ export const getMeta = (obj: Any | Relation.Any): EchoSchema.ObjectMeta => {
148
171
  export const getKeys: {
149
172
  (obj: Any | Relation.Any, source: string): EchoSchema.ForeignKey[];
150
173
  (source: string): (obj: Any | Relation.Any) => EchoSchema.ForeignKey[];
151
- } = dual(2, (obj: Any | Relation.Any, source?: string): EchoSchema.ForeignKey[] => {
174
+ } = Function.dual(2, (obj: Any | Relation.Any, source?: string): EchoSchema.ForeignKey[] => {
152
175
  const meta = EchoSchema.getMeta(obj);
153
176
  invariant(meta != null, 'Invalid object.');
154
177
  return meta.keys.filter((key) => key.source === source);
@@ -176,7 +199,6 @@ export const isDeleted = (obj: Any | Relation.Any): boolean => {
176
199
  return deleted;
177
200
  };
178
201
 
179
- // TODO(burdon): Rename "label"
180
202
  export const getLabel = (obj: Any | Relation.Any): string | undefined => {
181
203
  const schema = getSchema(obj);
182
204
  if (schema != null) {
@@ -191,6 +213,49 @@ export const setLabel = (obj: Any | Relation.Any, label: string) => {
191
213
  }
192
214
  };
193
215
 
216
+ export const getDescription = (obj: Any | Relation.Any): string | undefined => {
217
+ const schema = getSchema(obj);
218
+ if (schema != null) {
219
+ return EchoSchema.getDescription(schema, obj);
220
+ }
221
+ };
222
+
223
+ export const setDescription = (obj: Any | Relation.Any, description: string) => {
224
+ const schema = getSchema(obj);
225
+ if (schema != null) {
226
+ EchoSchema.setDescription(schema, obj, description);
227
+ }
228
+ };
229
+
230
+ const compare = (a?: string, b?: string) => {
231
+ if (a == null) {
232
+ return b == null ? 0 : 1;
233
+ }
234
+
235
+ if (b == null) {
236
+ return -1;
237
+ }
238
+
239
+ return a.localeCompare(b);
240
+ };
241
+
242
+ export type Comparator = (a: Any, b: Any) => number;
243
+
244
+ export const sortByLabel: Comparator = (a: Any, b: Any) => compare(getLabel(a), getLabel(b));
245
+ export const sortByTypename: Comparator = (a: Any, b: Any) => compare(getTypename(a), getTypename(b));
246
+ export const sort = (...comparators: Comparator[]): Comparator => {
247
+ return (a: Any, b: Any) => {
248
+ for (const comparator of comparators) {
249
+ const result = comparator(a, b);
250
+ if (result !== 0) {
251
+ return result;
252
+ }
253
+ }
254
+
255
+ return 0;
256
+ };
257
+ };
258
+
194
259
  /**
195
260
  * JSON representation of an object.
196
261
  */
package/src/Ref.ts CHANGED
@@ -2,8 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as EchoSchema from '@dxos/echo-schema';
6
-
5
+ import * as EchoSchema from './internal';
7
6
  import type * as Obj from './Obj';
8
7
 
9
8
  export type Ref<T> = EchoSchema.Ref<T>;
package/src/Relation.ts CHANGED
@@ -2,17 +2,18 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { raise } from '@dxos/debug';
8
- import * as EchoSchema from '@dxos/echo-schema';
9
8
  import { assertArgument, invariant } from '@dxos/invariant';
10
9
  import { DXN } from '@dxos/keys';
11
- import { type Live, live } from '@dxos/live-object';
10
+ import { type Live } from '@dxos/live-object';
12
11
  import { assumeType } from '@dxos/util';
13
12
 
14
- import type * as Obj from './Obj';
15
- import type * as Type from './Type';
13
+ import { live } from './internal';
14
+ import * as EchoSchema from './internal';
15
+ import * as Obj from './Obj';
16
+ import * as Type from './Type';
16
17
 
17
18
  /**
18
19
  * NOTE: Don't export: Relation.Relation and Relation.Any form the public API.
@@ -32,6 +33,15 @@ export type Relation<Source extends Obj.Any, Target extends Obj.Any, Props> = Ba
32
33
  */
33
34
  export interface Any extends BaseRelation<Obj.Any, Obj.Any> {}
34
35
 
36
+ export const Any = Schema.Struct({}).pipe(
37
+ Type.Relation({
38
+ typename: 'dxos.org/types/Any',
39
+ version: '0.1.0',
40
+ source: Obj.Any,
41
+ target: Obj.Any,
42
+ }),
43
+ );
44
+
35
45
  // TODO(dmaretskyi): Has to be `unique symbol`.
36
46
  export const Source: unique symbol = EchoSchema.RelationSourceId as any;
37
47
  export type Source = typeof Source;
package/src/Type.ts CHANGED
@@ -2,15 +2,14 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type Schema } from 'effect';
6
- import { type Simplify } from 'effect/Schema';
5
+ import type * as EffectSchema from 'effect/Schema';
7
6
 
8
7
  import { type EncodedReference } from '@dxos/echo-protocol';
9
- import * as EchoSchema from '@dxos/echo-schema';
10
- import { type ToMutable } from '@dxos/echo-schema';
11
8
  import { invariant } from '@dxos/invariant';
12
9
  import type * as Keys from '@dxos/keys';
13
10
 
11
+ import { type ToMutable } from './internal';
12
+ import * as EchoSchema from './internal';
14
13
  import type * as RelationModule from './Relation';
15
14
 
16
15
  //
@@ -55,33 +54,33 @@ interface ObjJsonProps {
55
54
  * This typedef avoids `TS4023` error (name from external module cannot be used named).
56
55
  * See Effect's note on interface types.
57
56
  */
58
- export interface obj<Self extends Schema.Schema.Any>
57
+ export interface obj<Self extends EffectSchema.Schema.Any>
59
58
  extends EchoSchema.TypeMeta,
60
- Schema.AnnotableClass<
59
+ EffectSchema.AnnotableClass<
61
60
  obj<Self>,
62
- OfKind<EchoSchema.EntityKind.Object> & ToMutable<Schema.Schema.Type<Self>>,
63
- Simplify<ObjJsonProps & ToMutable<Schema.Schema.Encoded<Self>>>,
64
- Schema.Schema.Context<Self>
61
+ OfKind<EchoSchema.EntityKind.Object> & ToMutable<EffectSchema.Schema.Type<Self>>,
62
+ EffectSchema.Simplify<ObjJsonProps & ToMutable<EffectSchema.Schema.Encoded<Self>>>,
63
+ EffectSchema.Schema.Context<Self>
65
64
  > {}
66
65
 
67
66
  /**
68
67
  * Object schema.
69
68
  */
70
69
  export const Obj: {
71
- (opts: EchoSchema.TypeMeta): <Self extends Schema.Schema.Any>(self: Self) => obj<Self>;
70
+ (opts: EchoSchema.TypeMeta): <Self extends EffectSchema.Schema.Any>(self: Self) => obj<Self>;
72
71
  } = EchoSchema.EchoObject as any;
73
72
 
74
73
  /**
75
74
  * Object schema type definitions.
76
75
  */
77
- export namespace Obj {
76
+ export declare namespace Obj {
78
77
  /**
79
78
  * Type that represents an arbitrary schema type of an object.
80
79
  * NOTE: This is not an instance type.
81
80
  */
82
81
  // TODO(dmaretskyi): If schema was covariant, we could specify props in here, like `id: ObjectId`.
83
82
  // TODO(burdon): This erases the ECHO type info (e.g., id, typename).
84
- export type Any = Schema.Schema.AnyNoContext;
83
+ export type Any = EffectSchema.Schema.AnyNoContext;
85
84
  }
86
85
 
87
86
  //
@@ -93,9 +92,9 @@ export interface Expando extends OfKind<EchoSchema.EntityKind.Object> {
93
92
  [key: string]: any;
94
93
  }
95
94
 
96
- type ExpandoEncoded = Simplify<ObjJsonProps & { [key: string]: any }>;
95
+ type ExpandoEncoded = EffectSchema.Simplify<ObjJsonProps & { [key: string]: any }>;
97
96
 
98
- export const Expando: Schema.Schema<Expando, ExpandoEncoded, never> = EchoSchema.Expando as any;
97
+ export const Expando: EffectSchema.Schema<Expando, ExpandoEncoded, never> = EchoSchema.Expando as any;
99
98
 
100
99
  //
101
100
  // Relation
@@ -114,17 +113,17 @@ interface RelationJsonProps {
114
113
  * See Effect's note on interface types.
115
114
  */
116
115
  export interface relation<
117
- Self extends Schema.Schema.Any,
118
- SourceSchema extends Schema.Schema.Any,
119
- TargetSchema extends Schema.Schema.Any,
116
+ Self extends EffectSchema.Schema.Any,
117
+ SourceSchema extends EffectSchema.Schema.Any,
118
+ TargetSchema extends EffectSchema.Schema.Any,
120
119
  > extends EchoSchema.TypeMeta,
121
- Schema.AnnotableClass<
120
+ EffectSchema.AnnotableClass<
122
121
  relation<Self, SourceSchema, TargetSchema>,
123
122
  OfKind<EchoSchema.EntityKind.Relation> &
124
- Relation.Endpoints<Schema.Schema.Type<SourceSchema>, Schema.Schema.Type<TargetSchema>> &
125
- ToMutable<Schema.Schema.Type<Self>>,
126
- Simplify<RelationJsonProps & ToMutable<Schema.Schema.Encoded<Self>>>,
127
- Schema.Schema.Context<Self>
123
+ Relation.Endpoints<EffectSchema.Schema.Type<SourceSchema>, EffectSchema.Schema.Type<TargetSchema>> &
124
+ ToMutable<EffectSchema.Schema.Type<Self>>,
125
+ EffectSchema.Simplify<RelationJsonProps & ToMutable<EffectSchema.Schema.Encoded<Self>>>,
126
+ EffectSchema.Schema.Context<Self>
128
127
  > {}
129
128
 
130
129
  /**
@@ -132,9 +131,9 @@ export interface relation<
132
131
  */
133
132
  // TODO(dmaretskyi): I have to redefine the type here so that the definition uses symbols from @dxos/echo/Relation.
134
133
  export const Relation: {
135
- <Source extends Schema.Schema.AnyNoContext, Target extends Schema.Schema.AnyNoContext>(
134
+ <Source extends EffectSchema.Schema.AnyNoContext, Target extends EffectSchema.Schema.AnyNoContext>(
136
135
  opts: EchoSchema.EchoRelationOptions<Source, Target>,
137
- ): <Self extends Schema.Schema.Any>(self: Self) => relation<Self, Source, Target>;
136
+ ): <Self extends EffectSchema.Schema.Any>(self: Self) => relation<Self, Source, Target>;
138
137
  } = EchoSchema.EchoRelation as any;
139
138
 
140
139
  /**
@@ -146,7 +145,7 @@ export namespace Relation {
146
145
  * NOTE: This is not an instance type.
147
146
  */
148
147
  // TODO(dmaretskyi): If schema was covariant, we could specify props in here, like `id: ObjectId`.
149
- export type Any = Schema.Schema.AnyNoContext;
148
+ export type Any = EffectSchema.Schema.AnyNoContext;
150
149
 
151
150
  /**
152
151
  * Get relation source type.
@@ -174,15 +173,15 @@ export namespace Relation {
174
173
  * This typedef avoids `TS4023` error (name from external module cannot be used named).
175
174
  * See Effect's note on interface types.
176
175
  */
177
- export interface ref<TargetSchema extends Schema.Schema.Any>
178
- extends EchoSchema.Ref$<Schema.Schema.Type<TargetSchema>> {}
176
+ export interface ref<TargetSchema extends EffectSchema.Schema.Any>
177
+ extends EchoSchema.Ref$<EffectSchema.Schema.Type<TargetSchema>> {}
179
178
 
180
179
  /**
181
180
  * Ref schema.
182
181
  */
183
182
  export const Ref: <S extends Obj.Any>(schema: S) => ref<S> = EchoSchema.Ref;
184
183
 
185
- export interface Ref<T> extends Schema.SchemaClass<EchoSchema.Ref<T>, EncodedReference> {}
184
+ export interface Ref<T> extends EffectSchema.SchemaClass<EchoSchema.Ref<T>, EncodedReference> {}
186
185
 
187
186
  // TODO(buurdon): Move to Ref?
188
187
  export namespace Ref {
@@ -190,7 +189,7 @@ export namespace Ref {
190
189
  * Type that represents an arbitrary schema type of a reference.
191
190
  * NOTE: This is not an instance type.
192
191
  */
193
- export type Any = Schema.Schema<EchoSchema.Ref<any>, EncodedReference>;
192
+ export type Any = EffectSchema.Schema<EchoSchema.Ref<any>, EncodedReference>;
194
193
  }
195
194
 
196
195
  /**
@@ -243,4 +242,4 @@ export const getMeta = (schema: Obj.Any | Relation.Any): Meta | undefined => {
243
242
  // TODO(dmaretskyi): Remove re-exports.
244
243
  export { SpaceId, ObjectId, DXN } from '@dxos/keys';
245
244
 
246
- export { Format, JsonSchemaType as JsonSchema, toEffectSchema, toJsonSchema } from '@dxos/echo-schema';
245
+ export { Format, JsonSchemaType as JsonSchema, toEffectSchema, toJsonSchema } from './internal';
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  //
4
4
 
5
5
  export * from './errors';
6
+ export * from './query';
6
7
 
7
8
  export * as Key from './Key';
8
9
  export * as Obj from './Obj';
@@ -10,7 +11,6 @@ export * as Ref from './Ref';
10
11
  export * as Relation from './Relation';
11
12
  export * as Type from './Type';
12
13
 
13
- export { DXN } from '@dxos/keys';
14
- export { Filter, Order, Query } from './query';
15
14
  export { QueryAST } from '@dxos/echo-protocol';
15
+ export { DXN } from '@dxos/keys';
16
16
  export { type Live } from '@dxos/live-object';
@@ -0,0 +1,22 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import type * as Option from 'effect/Option';
6
+ import type * as Schema from 'effect/Schema';
7
+ import * as SchemaAST from 'effect/SchemaAST';
8
+
9
+ export interface AnnotationHelper<T> {
10
+ get: (schema: Schema.Schema.Any) => Option.Option<T>;
11
+ set: (value: T) => <S extends Schema.Schema.Any>(schema: S) => S;
12
+ }
13
+
14
+ export const createAnnotationHelper = <T>(id: symbol): AnnotationHelper<T> => {
15
+ return {
16
+ get: (schema) => SchemaAST.getAnnotation(schema.ast, id),
17
+ set:
18
+ (value) =>
19
+ <S extends Schema.Schema.Any>(schema: S) =>
20
+ schema.annotations({ [id]: value }) as S,
21
+ };
22
+ };
@@ -0,0 +1,98 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+ import { describe, test } from 'vitest';
7
+
8
+ import { EchoObject, getLabel } from '../object';
9
+
10
+ import { LabelAnnotation, SchemaVersion, Typename } from './annotations';
11
+
12
+ // TODO(dmaretskyi): Use one of the testing schemas.
13
+ const TestObject = Schema.Struct({
14
+ name: Schema.optional(Schema.String),
15
+ fallbackName: Schema.optional(Schema.String),
16
+ other: Schema.String,
17
+ }).pipe(LabelAnnotation.set(['name', 'fallbackName']));
18
+
19
+ const a: Schema.Struct<typeof TestObject.fields> = TestObject;
20
+ console.log(a);
21
+
22
+ type TestObject = Schema.Schema.Type<typeof TestObject>;
23
+
24
+ const TestEchoSchema = TestObject.pipe(
25
+ EchoObject({
26
+ typename: 'dxos.org/type/Test',
27
+ version: '0.1.0',
28
+ }),
29
+ );
30
+ type TestEchoSchema = Schema.Schema.Type<typeof TestEchoSchema>;
31
+
32
+ describe('annotations', () => {
33
+ describe('Typename', () => {
34
+ test('should validate typename', ({ expect }) => {
35
+ // Valid.
36
+ expect(Typename.make('dxos.org/type/foo')).to.exist;
37
+ expect(Typename.make('dxos.org/type/foo-bar')).to.exist;
38
+ expect(Typename.make('dxos.org/type/foo_bar')).to.exist;
39
+
40
+ // Invalid.
41
+ expect(() => Typename.make('dxn:dxos.org')).to.throw();
42
+ expect(() => Typename.make('2dxos.org')).to.throw();
43
+ expect(() => Typename.make('dxos org')).to.throw();
44
+ });
45
+
46
+ test('should validate version', ({ expect }) => {
47
+ // Valid.
48
+ expect(SchemaVersion.make('0.1.0')).to.exist;
49
+
50
+ // Invalid.
51
+ expect(() => SchemaVersion.make('0.1.x')).to.throw();
52
+ expect(() => SchemaVersion.make('0.1.0-alpha')).to.throw();
53
+ });
54
+ });
55
+
56
+ describe('getLabel', () => {
57
+ test('should return first available label value', ({ expect }) => {
58
+ const obj: TestObject = {
59
+ name: 'Primary Name',
60
+ fallbackName: 'Fallback Name',
61
+ other: 'Other',
62
+ };
63
+
64
+ expect(getLabel(TestObject, obj)).toEqual('Primary Name');
65
+ });
66
+
67
+ test('should fallback to second path if first is undefined', ({ expect }) => {
68
+ const obj: TestObject = {
69
+ name: undefined,
70
+ fallbackName: 'Fallback Name',
71
+ other: 'Other',
72
+ };
73
+
74
+ expect(getLabel(TestObject, obj)).toEqual('Fallback Name');
75
+ });
76
+
77
+ test('should return undefined if no label paths resolve', ({ expect }) => {
78
+ const obj: TestObject = {
79
+ name: undefined,
80
+ fallbackName: undefined,
81
+ other: 'Other',
82
+ };
83
+
84
+ expect(getLabel(TestObject, obj)).toBeUndefined();
85
+ });
86
+
87
+ test('should return label from echo object', ({ expect }) => {
88
+ const obj: TestEchoSchema = {
89
+ id: 'test',
90
+ name: 'Primary Name',
91
+ fallbackName: 'Fallback Name',
92
+ other: 'Other',
93
+ };
94
+
95
+ expect(getLabel(TestEchoSchema, obj)).toEqual('Primary Name');
96
+ });
97
+ });
98
+ });