@dxos/client-services 0.1.2 → 0.1.4

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 (287) hide show
  1. package/dist/src/index.d.ts +3 -1
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +3 -1
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/packlets/deprecated/index.d.ts +5 -0
  6. package/dist/src/packlets/deprecated/index.d.ts.map +1 -0
  7. package/dist/src/packlets/{services/impl → deprecated}/index.js +1 -3
  8. package/dist/src/packlets/deprecated/index.js.map +1 -0
  9. package/dist/src/packlets/{invitations/common.d.ts → deprecated/invitations.d.ts} +14 -2
  10. package/dist/src/packlets/deprecated/invitations.d.ts.map +1 -0
  11. package/dist/src/packlets/{invitations/common.js → deprecated/invitations.js} +1 -1
  12. package/dist/src/packlets/deprecated/invitations.js.map +1 -0
  13. package/dist/src/packlets/{services/impl → deprecated}/profile.d.ts +5 -5
  14. package/dist/src/packlets/deprecated/profile.d.ts.map +1 -0
  15. package/dist/src/packlets/{services/impl → deprecated}/profile.js +10 -10
  16. package/dist/src/packlets/deprecated/profile.js.map +1 -0
  17. package/dist/src/packlets/deprecated/space.d.ts +23 -0
  18. package/dist/src/packlets/deprecated/space.d.ts.map +1 -0
  19. package/dist/src/packlets/deprecated/space.js +206 -0
  20. package/dist/src/packlets/deprecated/space.js.map +1 -0
  21. package/dist/src/packlets/{services/impl → deprecated}/system.d.ts +2 -2
  22. package/dist/src/packlets/deprecated/system.d.ts.map +1 -0
  23. package/dist/src/packlets/{services/impl → deprecated}/system.js +3 -3
  24. package/dist/src/packlets/deprecated/system.js.map +1 -0
  25. package/dist/src/packlets/deprecated/tracing.d.ts +12 -0
  26. package/dist/src/packlets/deprecated/tracing.d.ts.map +1 -0
  27. package/dist/src/packlets/{services/impl → deprecated}/tracing.js +3 -3
  28. package/dist/src/packlets/deprecated/tracing.js.map +1 -0
  29. package/dist/src/packlets/{services/impl → devtools}/devtools.d.ts +11 -7
  30. package/dist/src/packlets/devtools/devtools.d.ts.map +1 -0
  31. package/dist/src/packlets/devtools/devtools.js +86 -0
  32. package/dist/src/packlets/devtools/devtools.js.map +1 -0
  33. package/dist/src/packlets/devtools/feeds.d.ts.map +1 -1
  34. package/dist/src/packlets/devtools/feeds.js +28 -26
  35. package/dist/src/packlets/devtools/feeds.js.map +1 -1
  36. package/dist/src/packlets/devtools/index.d.ts +1 -1
  37. package/dist/src/packlets/devtools/index.d.ts.map +1 -1
  38. package/dist/src/packlets/devtools/index.js +1 -1
  39. package/dist/src/packlets/devtools/index.js.map +1 -1
  40. package/dist/src/packlets/devtools/spaces.d.ts +2 -2
  41. package/dist/src/packlets/devtools/spaces.d.ts.map +1 -1
  42. package/dist/src/packlets/devtools/spaces.js +13 -13
  43. package/dist/src/packlets/devtools/spaces.js.map +1 -1
  44. package/dist/src/packlets/identity/devices-service-impl.d.ts +10 -0
  45. package/dist/src/packlets/identity/devices-service-impl.d.ts.map +1 -0
  46. package/dist/src/packlets/identity/devices-service-impl.js +47 -0
  47. package/dist/src/packlets/identity/devices-service-impl.js.map +1 -0
  48. package/dist/src/packlets/identity/identity-manager.test.js +7 -11
  49. package/dist/src/packlets/identity/identity-manager.test.js.map +1 -1
  50. package/dist/src/packlets/identity/identity.d.ts +2 -0
  51. package/dist/src/packlets/identity/identity.d.ts.map +1 -1
  52. package/dist/src/packlets/identity/identity.js +4 -1
  53. package/dist/src/packlets/identity/identity.js.map +1 -1
  54. package/dist/src/packlets/identity/identity.test.js +2 -3
  55. package/dist/src/packlets/identity/identity.test.js.map +1 -1
  56. package/dist/src/packlets/invitations/encoder.d.ts +9 -0
  57. package/dist/src/packlets/invitations/encoder.d.ts.map +1 -0
  58. package/dist/src/packlets/invitations/encoder.js +27 -0
  59. package/dist/src/packlets/invitations/encoder.js.map +1 -0
  60. package/dist/src/packlets/invitations/encoder.test.d.ts +2 -0
  61. package/dist/src/packlets/invitations/encoder.test.d.ts.map +1 -0
  62. package/dist/src/packlets/invitations/encoder.test.js +19 -0
  63. package/dist/src/packlets/invitations/encoder.test.js.map +1 -0
  64. package/dist/src/packlets/invitations/halo-invitations.d.ts +3 -3
  65. package/dist/src/packlets/invitations/halo-invitations.d.ts.map +1 -1
  66. package/dist/src/packlets/invitations/halo-invitations.js +14 -10
  67. package/dist/src/packlets/invitations/halo-invitations.js.map +1 -1
  68. package/dist/src/packlets/invitations/halo-invitations.test.d.ts +2 -0
  69. package/dist/src/packlets/invitations/halo-invitations.test.d.ts.map +1 -0
  70. package/dist/src/packlets/{services/testing/halo.test.js → invitations/halo-invitations.test.js} +6 -6
  71. package/dist/src/packlets/invitations/halo-invitations.test.js.map +1 -0
  72. package/dist/src/packlets/invitations/index.d.ts +6 -3
  73. package/dist/src/packlets/invitations/index.d.ts.map +1 -1
  74. package/dist/src/packlets/invitations/index.js +6 -3
  75. package/dist/src/packlets/invitations/index.js.map +1 -1
  76. package/dist/src/packlets/invitations/invitations-proxy.d.ts +14 -0
  77. package/dist/src/packlets/invitations/invitations-proxy.d.ts.map +1 -0
  78. package/dist/src/packlets/invitations/invitations-proxy.js +126 -0
  79. package/dist/src/packlets/invitations/invitations-proxy.js.map +1 -0
  80. package/dist/src/packlets/invitations/invitations.d.ts +90 -0
  81. package/dist/src/packlets/invitations/invitations.d.ts.map +1 -0
  82. package/dist/src/packlets/invitations/invitations.js +55 -0
  83. package/dist/src/packlets/invitations/invitations.js.map +1 -0
  84. package/dist/src/packlets/invitations/space-invitations-handler.d.ts +24 -0
  85. package/dist/src/packlets/invitations/space-invitations-handler.d.ts.map +1 -0
  86. package/dist/src/packlets/invitations/space-invitations-handler.js +232 -0
  87. package/dist/src/packlets/invitations/space-invitations-handler.js.map +1 -0
  88. package/dist/src/packlets/invitations/space-invitations-handler.test.d.ts +2 -0
  89. package/dist/src/packlets/invitations/space-invitations-handler.test.d.ts.map +1 -0
  90. package/dist/src/packlets/invitations/space-invitations-handler.test.js +131 -0
  91. package/dist/src/packlets/invitations/space-invitations-handler.test.js.map +1 -0
  92. package/dist/src/packlets/invitations/space-invitations-proxy.d.ts +11 -0
  93. package/dist/src/packlets/invitations/space-invitations-proxy.d.ts.map +1 -0
  94. package/dist/src/packlets/invitations/space-invitations-proxy.js +17 -0
  95. package/dist/src/packlets/invitations/space-invitations-proxy.js.map +1 -0
  96. package/dist/src/packlets/invitations/space-invitations-service.d.ts +22 -0
  97. package/dist/src/packlets/invitations/space-invitations-service.d.ts.map +1 -0
  98. package/dist/src/packlets/invitations/space-invitations-service.js +189 -0
  99. package/dist/src/packlets/invitations/space-invitations-service.js.map +1 -0
  100. package/dist/src/packlets/invitations/space-invitations-service.test.d.ts +2 -0
  101. package/dist/src/packlets/invitations/space-invitations-service.test.d.ts.map +1 -0
  102. package/dist/src/packlets/invitations/space-invitations-service.test.js +100 -0
  103. package/dist/src/packlets/invitations/space-invitations-service.test.js.map +1 -0
  104. package/dist/src/packlets/services/iframe-service-proxy.d.ts +23 -0
  105. package/dist/src/packlets/services/iframe-service-proxy.d.ts.map +1 -0
  106. package/dist/src/packlets/services/iframe-service-proxy.js +53 -0
  107. package/dist/src/packlets/services/iframe-service-proxy.js.map +1 -0
  108. package/dist/src/packlets/services/index.d.ts +3 -2
  109. package/dist/src/packlets/services/index.d.ts.map +1 -1
  110. package/dist/src/packlets/services/index.js +3 -2
  111. package/dist/src/packlets/services/index.js.map +1 -1
  112. package/dist/src/packlets/services/service-context.d.ts +4 -7
  113. package/dist/src/packlets/services/service-context.d.ts.map +1 -1
  114. package/dist/src/packlets/services/service-context.js +9 -25
  115. package/dist/src/packlets/services/service-context.js.map +1 -1
  116. package/dist/src/packlets/services/service-definitions.d.ts +30 -0
  117. package/dist/src/packlets/services/service-definitions.d.ts.map +1 -0
  118. package/dist/src/packlets/services/{services.js → service-definitions.js} +9 -5
  119. package/dist/src/packlets/services/service-definitions.js.map +1 -0
  120. package/dist/src/packlets/services/service-host.d.ts +9 -12
  121. package/dist/src/packlets/services/service-host.d.ts.map +1 -1
  122. package/dist/src/packlets/services/service-host.js +55 -54
  123. package/dist/src/packlets/services/service-host.js.map +1 -1
  124. package/dist/src/packlets/services/service-host.test.js +7 -17
  125. package/dist/src/packlets/services/service-host.test.js.map +1 -1
  126. package/dist/src/packlets/services/service-proxy.d.ts +17 -0
  127. package/dist/src/packlets/services/service-proxy.d.ts.map +1 -0
  128. package/dist/src/packlets/services/service-proxy.js +48 -0
  129. package/dist/src/packlets/services/service-proxy.js.map +1 -0
  130. package/dist/src/packlets/services/service-registry.d.ts +12 -0
  131. package/dist/src/packlets/services/service-registry.d.ts.map +1 -0
  132. package/dist/src/packlets/services/service-registry.js +24 -0
  133. package/dist/src/packlets/services/service-registry.js.map +1 -0
  134. package/dist/src/packlets/services/service-registry.test.d.ts +2 -0
  135. package/dist/src/packlets/services/service-registry.test.d.ts.map +1 -0
  136. package/dist/src/packlets/services/service-registry.test.js +75 -0
  137. package/dist/src/packlets/services/service-registry.test.js.map +1 -0
  138. package/dist/src/packlets/services/signer.d.ts +0 -3
  139. package/dist/src/packlets/services/signer.d.ts.map +1 -1
  140. package/dist/src/packlets/spaces/index.d.ts +2 -0
  141. package/dist/src/packlets/spaces/index.d.ts.map +1 -0
  142. package/dist/src/packlets/spaces/index.js +21 -0
  143. package/dist/src/packlets/spaces/index.js.map +1 -0
  144. package/dist/src/packlets/spaces/spaces-service.d.ts +11 -0
  145. package/dist/src/packlets/spaces/spaces-service.d.ts.map +1 -0
  146. package/dist/src/packlets/spaces/spaces-service.js +22 -0
  147. package/dist/src/packlets/spaces/spaces-service.js.map +1 -0
  148. package/dist/src/packlets/storage/storage.js +1 -1
  149. package/dist/src/packlets/storage/storage.js.map +1 -1
  150. package/dist/src/packlets/testing/index.d.ts +2 -0
  151. package/dist/src/packlets/testing/index.d.ts.map +1 -0
  152. package/dist/src/packlets/testing/index.js +21 -0
  153. package/dist/src/packlets/testing/index.js.map +1 -0
  154. package/dist/src/packlets/testing/test-builder.d.ts +14 -0
  155. package/dist/src/packlets/testing/test-builder.d.ts.map +1 -0
  156. package/dist/src/packlets/testing/test-builder.js +66 -0
  157. package/dist/src/packlets/testing/test-builder.js.map +1 -0
  158. package/dist/src/packlets/vault/iframe-runtime.d.ts +19 -0
  159. package/dist/src/packlets/vault/iframe-runtime.d.ts.map +1 -0
  160. package/dist/src/packlets/vault/iframe-runtime.js +54 -0
  161. package/dist/src/packlets/vault/iframe-runtime.js.map +1 -0
  162. package/dist/src/packlets/vault/index.d.ts +4 -0
  163. package/dist/src/packlets/vault/index.d.ts.map +1 -0
  164. package/dist/src/packlets/vault/index.js +23 -0
  165. package/dist/src/packlets/vault/index.js.map +1 -0
  166. package/dist/src/packlets/vault/services.d.ts +13 -0
  167. package/dist/src/packlets/vault/services.d.ts.map +1 -0
  168. package/dist/src/packlets/vault/services.js +15 -0
  169. package/dist/src/packlets/vault/services.js.map +1 -0
  170. package/dist/src/packlets/vault/worker-runtime.d.ts +32 -0
  171. package/dist/src/packlets/vault/worker-runtime.d.ts.map +1 -0
  172. package/dist/src/packlets/vault/worker-runtime.js +94 -0
  173. package/dist/src/packlets/vault/worker-runtime.js.map +1 -0
  174. package/dist/src/packlets/vault/worker-session.d.ts +29 -0
  175. package/dist/src/packlets/vault/worker-session.d.ts.map +1 -0
  176. package/dist/src/packlets/vault/worker-session.js +84 -0
  177. package/dist/src/packlets/vault/worker-session.js.map +1 -0
  178. package/package.json +26 -26
  179. package/src/index.ts +4 -2
  180. package/src/packlets/{services/impl → deprecated}/index.ts +1 -4
  181. package/src/packlets/{invitations/common.ts → deprecated/invitations.ts} +18 -3
  182. package/src/packlets/{services/impl → deprecated}/profile.ts +13 -13
  183. package/src/packlets/deprecated/space.ts +245 -0
  184. package/src/packlets/{services/impl → deprecated}/system.ts +2 -2
  185. package/src/packlets/{services/impl → deprecated}/tracing.ts +2 -2
  186. package/src/packlets/{services/impl → devtools}/devtools.ts +33 -34
  187. package/src/packlets/devtools/feeds.ts +31 -27
  188. package/src/packlets/devtools/index.ts +1 -1
  189. package/src/packlets/devtools/spaces.ts +19 -18
  190. package/src/packlets/identity/devices-service-impl.ts +54 -0
  191. package/src/packlets/identity/identity-manager.test.ts +7 -8
  192. package/src/packlets/identity/identity.test.ts +2 -3
  193. package/src/packlets/identity/identity.ts +5 -1
  194. package/src/packlets/invitations/encoder.test.ts +22 -0
  195. package/src/packlets/invitations/encoder.ts +26 -0
  196. package/src/packlets/{services/testing/halo.test.ts → invitations/halo-invitations.test.ts} +5 -5
  197. package/src/packlets/invitations/halo-invitations.ts +12 -10
  198. package/src/packlets/invitations/index.ts +6 -3
  199. package/src/packlets/invitations/invitations-proxy.ts +157 -0
  200. package/src/packlets/invitations/invitations.ts +149 -0
  201. package/src/packlets/invitations/space-invitations-handler.test.ts +154 -0
  202. package/src/packlets/invitations/space-invitations-handler.ts +266 -0
  203. package/src/packlets/invitations/space-invitations-proxy.ts +16 -0
  204. package/src/packlets/invitations/space-invitations-service.test.ts +129 -0
  205. package/src/packlets/invitations/space-invitations-service.ts +196 -0
  206. package/src/packlets/services/iframe-service-proxy.ts +71 -0
  207. package/src/packlets/services/index.ts +3 -2
  208. package/src/packlets/services/service-context.ts +9 -31
  209. package/src/packlets/services/service-definitions.ts +54 -0
  210. package/src/packlets/services/service-host.test.ts +12 -24
  211. package/src/packlets/services/service-host.ts +64 -64
  212. package/src/packlets/services/service-proxy.ts +54 -0
  213. package/src/packlets/services/service-registry.test.ts +95 -0
  214. package/src/packlets/services/service-registry.ts +24 -0
  215. package/src/packlets/services/signer.ts +1 -3
  216. package/src/packlets/spaces/index.ts +5 -0
  217. package/src/packlets/spaces/spaces-service.ts +28 -0
  218. package/src/packlets/storage/storage.ts +1 -1
  219. package/src/packlets/testing/index.ts +5 -0
  220. package/src/packlets/testing/test-builder.ts +80 -0
  221. package/src/packlets/vault/iframe-runtime.ts +68 -0
  222. package/src/packlets/vault/index.ts +7 -0
  223. package/src/packlets/vault/services.ts +26 -0
  224. package/src/packlets/vault/worker-runtime.ts +111 -0
  225. package/src/packlets/vault/worker-session.ts +113 -0
  226. package/dist/src/packlets/devtools/devtools-host-events.d.ts +0 -5
  227. package/dist/src/packlets/devtools/devtools-host-events.d.ts.map +0 -1
  228. package/dist/src/packlets/devtools/devtools-host-events.js +0 -14
  229. package/dist/src/packlets/devtools/devtools-host-events.js.map +0 -1
  230. package/dist/src/packlets/invitations/common.d.ts.map +0 -1
  231. package/dist/src/packlets/invitations/common.js.map +0 -1
  232. package/dist/src/packlets/invitations/invitation-wrapper.d.ts +0 -36
  233. package/dist/src/packlets/invitations/invitation-wrapper.d.ts.map +0 -1
  234. package/dist/src/packlets/invitations/invitation-wrapper.js +0 -104
  235. package/dist/src/packlets/invitations/invitation-wrapper.js.map +0 -1
  236. package/dist/src/packlets/invitations/space-invitations.d.ts +0 -25
  237. package/dist/src/packlets/invitations/space-invitations.d.ts.map +0 -1
  238. package/dist/src/packlets/invitations/space-invitations.js +0 -136
  239. package/dist/src/packlets/invitations/space-invitations.js.map +0 -1
  240. package/dist/src/packlets/services/impl/devtools.d.ts.map +0 -1
  241. package/dist/src/packlets/services/impl/devtools.js +0 -77
  242. package/dist/src/packlets/services/impl/devtools.js.map +0 -1
  243. package/dist/src/packlets/services/impl/halo.d.ts +0 -20
  244. package/dist/src/packlets/services/impl/halo.d.ts.map +0 -1
  245. package/dist/src/packlets/services/impl/halo.js +0 -93
  246. package/dist/src/packlets/services/impl/halo.js.map +0 -1
  247. package/dist/src/packlets/services/impl/index.d.ts +0 -6
  248. package/dist/src/packlets/services/impl/index.d.ts.map +0 -1
  249. package/dist/src/packlets/services/impl/index.js.map +0 -1
  250. package/dist/src/packlets/services/impl/party.d.ts +0 -25
  251. package/dist/src/packlets/services/impl/party.d.ts.map +0 -1
  252. package/dist/src/packlets/services/impl/party.js +0 -265
  253. package/dist/src/packlets/services/impl/party.js.map +0 -1
  254. package/dist/src/packlets/services/impl/profile.d.ts.map +0 -1
  255. package/dist/src/packlets/services/impl/profile.js.map +0 -1
  256. package/dist/src/packlets/services/impl/system.d.ts.map +0 -1
  257. package/dist/src/packlets/services/impl/system.js.map +0 -1
  258. package/dist/src/packlets/services/impl/tracing.d.ts +0 -12
  259. package/dist/src/packlets/services/impl/tracing.d.ts.map +0 -1
  260. package/dist/src/packlets/services/impl/tracing.js.map +0 -1
  261. package/dist/src/packlets/services/service-factory.d.ts +0 -15
  262. package/dist/src/packlets/services/service-factory.d.ts.map +0 -1
  263. package/dist/src/packlets/services/service-factory.js +0 -25
  264. package/dist/src/packlets/services/service-factory.js.map +0 -1
  265. package/dist/src/packlets/services/services.d.ts +0 -19
  266. package/dist/src/packlets/services/services.d.ts.map +0 -1
  267. package/dist/src/packlets/services/services.js.map +0 -1
  268. package/dist/src/packlets/services/testing/halo.test.d.ts +0 -2
  269. package/dist/src/packlets/services/testing/halo.test.d.ts.map +0 -1
  270. package/dist/src/packlets/services/testing/halo.test.js.map +0 -1
  271. package/dist/src/packlets/services/testing/spaces.test.d.ts +0 -2
  272. package/dist/src/packlets/services/testing/spaces.test.d.ts.map +0 -1
  273. package/dist/src/packlets/services/testing/spaces.test.js +0 -68
  274. package/dist/src/packlets/services/testing/spaces.test.js.map +0 -1
  275. package/dist/src/packlets/services/testing/testing.d.ts +0 -8
  276. package/dist/src/packlets/services/testing/testing.d.ts.map +0 -1
  277. package/dist/src/packlets/services/testing/testing.js +0 -23
  278. package/dist/src/packlets/services/testing/testing.js.map +0 -1
  279. package/src/packlets/devtools/devtools-host-events.ts +0 -8
  280. package/src/packlets/invitations/invitation-wrapper.ts +0 -140
  281. package/src/packlets/invitations/space-invitations.ts +0 -159
  282. package/src/packlets/services/impl/halo.ts +0 -107
  283. package/src/packlets/services/impl/party.ts +0 -305
  284. package/src/packlets/services/service-factory.ts +0 -35
  285. package/src/packlets/services/services.ts +0 -39
  286. package/src/packlets/services/testing/spaces.test.ts +0 -87
  287. package/src/packlets/services/testing/testing.ts +0 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/client-services",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "homepage": "https://dxos.org",
5
5
  "bugs": "https://github.com/dxos/dxos/issues",
6
6
  "license": "MIT",
@@ -15,39 +15,39 @@
15
15
  "src"
16
16
  ],
17
17
  "dependencies": {
18
- "@dxos/async": "0.1.2",
19
- "@dxos/codec-protobuf": "0.1.2",
20
- "@dxos/config": "0.1.2",
21
- "@dxos/credentials": "0.1.2",
22
- "@dxos/crypto": "0.1.2",
23
- "@dxos/debug": "0.1.2",
24
- "@dxos/echo-db": "0.1.2",
25
- "@dxos/feed-store": "0.1.2",
26
- "@dxos/keyring": "0.1.2",
27
- "@dxos/keys": "0.1.2",
28
- "@dxos/log": "0.1.2",
29
- "@dxos/messaging": "0.1.2",
30
- "@dxos/model-factory": "0.1.2",
31
- "@dxos/network-manager": "0.1.2",
32
- "@dxos/object-model": "0.1.2",
33
- "@dxos/protocol-plugin-rpc": "0.1.2",
34
- "@dxos/protocols": "0.1.2",
35
- "@dxos/random-access-storage": "0.1.2",
36
- "@dxos/rpc": "0.1.2",
37
- "@dxos/testutils": "0.1.2",
38
- "@dxos/timeframe": "0.1.2",
39
- "@dxos/util": "0.1.2",
18
+ "@dxos/async": "0.1.4",
19
+ "@dxos/codec-protobuf": "0.1.4",
20
+ "@dxos/config": "0.1.4",
21
+ "@dxos/credentials": "0.1.4",
22
+ "@dxos/crypto": "0.1.4",
23
+ "@dxos/debug": "0.1.4",
24
+ "@dxos/echo-db": "0.1.4",
25
+ "@dxos/feed-store": "0.1.4",
26
+ "@dxos/keyring": "0.1.4",
27
+ "@dxos/keys": "0.1.4",
28
+ "@dxos/log": "0.1.4",
29
+ "@dxos/messaging": "0.1.4",
30
+ "@dxos/model-factory": "0.1.4",
31
+ "@dxos/network-manager": "0.1.4",
32
+ "@dxos/object-model": "0.1.4",
33
+ "@dxos/protocol-plugin-rpc": "0.1.4",
34
+ "@dxos/protocols": "0.1.4",
35
+ "@dxos/random-access-storage": "0.1.4",
36
+ "@dxos/rpc": "0.1.4",
37
+ "@dxos/rpc-tunnel": "0.1.4",
38
+ "@dxos/text-model": "0.1.4",
39
+ "@dxos/timeframe": "0.1.4",
40
+ "@dxos/util": "0.1.4",
40
41
  "abstract-leveldown": "~7.0.0",
41
42
  "assert": "^2.0.0",
42
43
  "base-x": "~3.0.9",
43
- "json-stable-stringify": "^1.0.1",
44
44
  "jsondown": "dxos/jsondown#main",
45
45
  "level-js": "^5.0.2",
46
46
  "memdown": "^5.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@dxos/signal": "0.1.2",
50
- "@types/json-stable-stringify": "^1.0.32",
49
+ "@dxos/signal": "0.1.4",
50
+ "@dxos/testutils": "0.1.4",
51
51
  "@types/level-js": "~4.0.1",
52
52
  "@types/memdown": "^3.0.0",
53
53
  "@types/readable-stream": "^2.3.9"
package/src/index.ts CHANGED
@@ -2,10 +2,12 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
+ export * from './errors';
6
+
7
+ export * from './packlets/deprecated';
5
8
  export * from './packlets/devtools';
6
9
  export * from './packlets/identity';
7
10
  export * from './packlets/invitations';
8
11
  export * from './packlets/services';
9
12
  export * from './packlets/storage';
10
-
11
- export * from './errors';
13
+ export * from './packlets/vault';
@@ -2,10 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- // TODO(burdon): Add data service here.
6
-
7
- export * from './halo';
8
- export * from './party';
5
+ export * from './space';
9
6
  export * from './profile';
10
7
  export * from './system';
11
8
  export * from './tracing';
@@ -4,6 +4,10 @@
4
4
 
5
5
  import { defaultSecretProvider, defaultSecretValidator, SecretProvider, SecretValidator } from '@dxos/credentials';
6
6
 
7
+ //
8
+ // TODO(burdon): Deprecated pending new invitations.
9
+ //
10
+
7
11
  /**
8
12
  * Defines a way for peers to authenticate each other through a side channel.
9
13
  */
@@ -18,7 +22,7 @@ export const defaultInvitationAuthenticator: Required<InvitationAuthenticator> =
18
22
  };
19
23
 
20
24
  /**
21
- * Additional set of callbacks and options used in the invitation process.
25
+ * @deprecated
22
26
  */
23
27
  export interface InvitationOptions {
24
28
  /**
@@ -32,17 +36,28 @@ export interface InvitationOptions {
32
36
  expiration?: number;
33
37
  }
34
38
 
35
- // TODO(burdon): Remove/move to API.
39
+ /**
40
+ * @deprecated
41
+ */
36
42
  export type InviterInvitation = {
37
43
  invitationCode: string;
38
44
  secret: Uint8Array | undefined;
39
45
  };
40
46
 
41
- // TODO(burdon): Remove/move to API.
47
+ /**
48
+ * @deprecated
49
+ */
42
50
  export type InviteeInvitation = {
43
51
  secret?: Uint8Array | undefined; // Can be undefined initially, then set after receiving secret from the inviter.
44
52
  secretTrigger?: () => void; // Is triggered after supplying the secret.
45
53
  };
46
54
 
55
+ /**
56
+ * @deprecated
57
+ */
47
58
  export type InviterInvitations = InviterInvitation[];
59
+
60
+ /**
61
+ * @deprecated
62
+ */
48
63
  export type InviteeInvitations = Map<string, InviteeInvitation>;
@@ -15,20 +15,20 @@ import {
15
15
  InvitationRequest,
16
16
  InvitationState,
17
17
  Profile,
18
- ProfileService as ProfileServiceRpc,
18
+ ProfileService,
19
19
  RecoverProfileRequest,
20
20
  RedeemedInvitation,
21
21
  SubscribeProfileResponse
22
22
  } from '@dxos/protocols/proto/dxos/client';
23
- import { InvitationDescriptor } from '@dxos/protocols/proto/dxos/halo/invitations';
23
+ import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
24
24
 
25
- import { InviteeInvitation, InviteeInvitations } from '../../invitations';
26
- import { ServiceContext } from '../service-context';
25
+ import { ServiceContext } from '../services';
26
+ import { InviteeInvitation, InviteeInvitations } from './invitations';
27
27
 
28
28
  /**
29
29
  * Profile service implementation.
30
30
  */
31
- export class ProfileService implements ProfileServiceRpc {
31
+ export class ProfileServiceImpl implements ProfileService {
32
32
  private inviteeInvitations: InviteeInvitations = new Map();
33
33
 
34
34
  constructor(private readonly context: ServiceContext) {}
@@ -39,7 +39,7 @@ export class ProfileService implements ProfileServiceRpc {
39
39
  next({
40
40
  profile: this.context.identityManager.identity
41
41
  ? {
42
- publicKey: this.context.identityManager.identity.identityKey
42
+ identityKey: this.context.identityManager.identity.identityKey
43
43
  }
44
44
  : undefined
45
45
  });
@@ -51,7 +51,7 @@ export class ProfileService implements ProfileServiceRpc {
51
51
 
52
52
  async createProfile(request: CreateProfileRequest): Promise<Profile> {
53
53
  await this.context.createIdentity();
54
- return { publicKey: this.context.identityManager.identity!.identityKey };
54
+ return { identityKey: this.context.identityManager.identity!.identityKey };
55
55
  }
56
56
 
57
57
  async recoverProfile(request: RecoverProfileRequest): Promise<Profile> {
@@ -69,7 +69,7 @@ export class ProfileService implements ProfileServiceRpc {
69
69
  createInvitation(): Stream<InvitationRequest> {
70
70
  return new Stream(({ next, close }) => {
71
71
  setTimeout(async () => {
72
- const secret = Buffer.from(generatePasscode());
72
+ const authenticationCode = generatePasscode();
73
73
  // TODO(burdon): Not used.
74
74
  // const secretProvider = async () => {
75
75
  // next({ descriptor: invitation.toProto(), state: InvitationState.CONNECTED });
@@ -82,7 +82,7 @@ export class ProfileService implements ProfileServiceRpc {
82
82
  close();
83
83
  }
84
84
  });
85
- invitation.secret = secret;
85
+ invitation.authenticationCode = authenticationCode;
86
86
 
87
87
  next({
88
88
  state: InvitationState.WAITING_FOR_CONNECTION,
@@ -92,7 +92,7 @@ export class ProfileService implements ProfileServiceRpc {
92
92
  });
93
93
  }
94
94
 
95
- acceptInvitation(invitation: InvitationDescriptor): Stream<RedeemedInvitation> {
95
+ acceptInvitation(invitation: Invitation): Stream<RedeemedInvitation> {
96
96
  return new Stream(({ next, close }) => {
97
97
  const id = v4();
98
98
  const [, secretTrigger] = latch();
@@ -110,16 +110,16 @@ export class ProfileService implements ProfileServiceRpc {
110
110
  // };
111
111
 
112
112
  // Joining process is kicked off, and will await authentication with a secret.
113
- const haloPartyPromise = this.context.haloInvitations.acceptInvitation(invitation);
113
+ const haloSpacePromise = this.context.haloInvitations.acceptInvitation(invitation);
114
114
  this.inviteeInvitations.set(id, inviteeInvitation);
115
115
  next({ id, state: InvitationState.CONNECTED });
116
116
 
117
- haloPartyPromise
117
+ haloSpacePromise
118
118
  .then((identity) => {
119
119
  next({
120
120
  id,
121
121
  state: InvitationState.SUCCESS,
122
- partyKey: identity.identityKey
122
+ spaceKey: identity.identityKey
123
123
  });
124
124
  })
125
125
  .catch((err) => {
@@ -0,0 +1,245 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import assert from 'node:assert';
6
+
7
+ import { EventSubscriptions } from '@dxos/async';
8
+ import { Stream } from '@dxos/codec-protobuf';
9
+ import { todo } from '@dxos/debug';
10
+ import {
11
+ AuthenticateInvitationRequest,
12
+ CreateSnapshotRequest,
13
+ GetSpaceDetailsRequest,
14
+ Space,
15
+ SpaceDetails,
16
+ SpaceService,
17
+ SetSpaceStateRequest,
18
+ SubscribeMembersRequest,
19
+ SubscribeMembersResponse,
20
+ SubscribeSpacesResponse,
21
+ SubscribeSpaceRequest,
22
+ SubscribeSpaceResponse
23
+ } from '@dxos/protocols/proto/dxos/client';
24
+ import { SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';
25
+ import { humanize } from '@dxos/util';
26
+
27
+ import { ServiceContext } from '../services';
28
+ import { InviteeInvitations } from './invitations';
29
+
30
+ /**
31
+ * Space service implementation.
32
+ * @deprecated
33
+ */
34
+ export class SpaceServiceImpl implements SpaceService {
35
+ private inviteeInvitations: InviteeInvitations = new Map();
36
+
37
+ constructor(private readonly serviceContext: ServiceContext) {}
38
+
39
+ subscribeToSpace(request: SubscribeSpaceRequest): Stream<SubscribeSpaceResponse> {
40
+ return new Stream(({ next }) => {
41
+ next({
42
+ space: {
43
+ publicKey: request.spaceKey,
44
+ isOpen: true,
45
+ isActive: true,
46
+ members: []
47
+ }
48
+ });
49
+ });
50
+
51
+ // const update = (next: (message: SubscribeSpaceResponse) => void) => {
52
+ // try {
53
+ // const space = this.echo.getSpace(request.space_key);
54
+ // next({
55
+ // space: space && {
56
+ // public_key: space.key,
57
+ // is_open: space.is_open,
58
+ // is_active: space.is_active,
59
+ // members: space.queryMembers().value
60
+ // }
61
+ // });
62
+ // } catch (err) {
63
+ // if (err instanceof InvalidStateError) {
64
+ // // Do nothing.
65
+ // } else {
66
+ // throw err;
67
+ // }
68
+ // }
69
+ // };
70
+
71
+ // const space = this.serviceContext.brane.getSpace(request.space_key);
72
+ // if (space) {
73
+ // return new Stream(({ next }) => space.update.on(() => update(next)));
74
+ // } else {
75
+ // return new Stream(({ next }) => {
76
+ // let unsubscribeSpace: () => void;
77
+ // const unsubscribeSpaces = this.echo.querySpaces().subscribe((spaces) => {
78
+ // const space = spaces.find((space) => space.key.equals(request.space_key));
79
+ // if (space && !unsubscribeSpace) {
80
+ // unsubscribeSpace = space.update.on(() => update(next));
81
+ // }
82
+ // });
83
+
84
+ // update(next);
85
+
86
+ // return () => {
87
+ // unsubscribeSpaces();
88
+ // unsubscribeSpace?.();
89
+ // };
90
+ // });
91
+ // }
92
+ }
93
+
94
+ subscribeSpaces() {
95
+ return new Stream<SubscribeSpacesResponse>(({ next }) => {
96
+ const subscriptions = new EventSubscriptions();
97
+
98
+ const onUpdate = () => {
99
+ next({
100
+ spaces: Array.from(this.serviceContext.spaceManager!.spaces.values()).map(
101
+ (space): Space => ({
102
+ publicKey: space.key,
103
+ isOpen: true,
104
+ isActive: true,
105
+ members: Array.from(space.spaceState.members.values()).map((member) => ({
106
+ identityKey: member.key,
107
+ profile: {
108
+ identityKey: member.key,
109
+ displayName: humanize(member.key)
110
+ }
111
+ }))
112
+ })
113
+ )
114
+ });
115
+ };
116
+
117
+ setTimeout(async () => {
118
+ if (!this.serviceContext.spaceManager) {
119
+ next({ spaces: [] });
120
+ }
121
+
122
+ await this.serviceContext.initialized.wait();
123
+
124
+ subscriptions.add(
125
+ this.serviceContext.spaceManager!.updated.on(() => {
126
+ this.serviceContext.spaceManager!.spaces.forEach((space) => {
127
+ subscriptions.add(space.stateUpdate.on(onUpdate));
128
+ });
129
+ onUpdate();
130
+ })
131
+ );
132
+
133
+ onUpdate();
134
+ });
135
+
136
+ return () => subscriptions.clear();
137
+ });
138
+ }
139
+
140
+ async getSpaceDetails(request: GetSpaceDetailsRequest): Promise<SpaceDetails> {
141
+ return todo();
142
+ // const space = this.echo.getSpace(request.space_key) ?? raise(new SpaceNotFoundError(request.space_key));
143
+ // return {
144
+ // processedTimeframe: space.timeframe
145
+ // };
146
+ }
147
+
148
+ async createSpace(): Promise<Space> {
149
+ await this.serviceContext.initialized.wait();
150
+ const space = await this.serviceContext.spaceManager!.createSpace();
151
+ return {
152
+ publicKey: space.key,
153
+ isOpen: true,
154
+ isActive: true
155
+ };
156
+ }
157
+
158
+ async cloneSpace(snapshot: SpaceSnapshot): Promise<Space> {
159
+ return todo();
160
+ // const space = await this.echo.cloneSpace(snapshot);
161
+ // return {
162
+ // public_key: space.key,
163
+ // is_open: space.is_open,
164
+ // is_active: space.is_active
165
+ // };
166
+ }
167
+
168
+ async setSpaceState(request: SetSpaceStateRequest) {
169
+ return todo();
170
+ // const space = this.echo.getSpace(request.space_key);
171
+ // if (!space) {
172
+ // throw new Error('Space not found');
173
+ // }
174
+
175
+ // if (request.open === true) {
176
+ // await space.open();
177
+ // } else if (request.open === false) {
178
+ // await space.close();
179
+ // } // Undefined preserves previous state.
180
+
181
+ // if (request.active_global === true) {
182
+ // await space.activate({ global: true });
183
+ // } else if (request.active_global === false) {
184
+ // await space.deactivate({ global: true });
185
+ // } // Undefined preserves previous state.
186
+
187
+ // if (request.active_device === true) {
188
+ // await space.activate({ device: true });
189
+ // } else if (request.active_device === false) {
190
+ // await space.deactivate({ device: true });
191
+ // } // Undefined preserves previous state.
192
+ // return {
193
+ // public_key: space.key,
194
+ // is_open: space.is_open,
195
+ // is_active: space.is_active
196
+ // };
197
+ }
198
+
199
+ async authenticateInvitation(request: AuthenticateInvitationRequest) {
200
+ assert(request.processId, 'Process ID is missing.');
201
+ const invitation = this.inviteeInvitations.get(request.processId);
202
+ assert(invitation, 'Invitation not found.');
203
+ assert(request.secret, 'Secret not provided.');
204
+
205
+ // Supply the secret, and move the internal invitation process by triggering the secretTrigger.
206
+ invitation.secret = request.secret;
207
+ invitation.secretTrigger?.();
208
+ }
209
+
210
+ subscribeMembers(request: SubscribeMembersRequest): Stream<SubscribeMembersResponse> {
211
+ return new Stream(({ next }) => {
212
+ next({
213
+ members: []
214
+ });
215
+ });
216
+ // const space = this.echo.getSpace(request.space_key);
217
+ // if (space) {
218
+ // return resultSetToStream(space.queryMembers(), (members): SubscribeMembersResponse => ({ members }));
219
+ // } else {
220
+ // return new Stream(({ next }) => {
221
+ // let unsubscribeMembers: () => void;
222
+ // const unsubscribeSpaces = this.echo.querySpaces().subscribe((spaces) => {
223
+ // const space = spaces.find((space) => space.key.equals(request.space_key));
224
+ // if (!unsubscribeMembers && space) {
225
+ // const resultSet = space.queryMembers();
226
+ // next({ members: resultSet.value });
227
+ // unsubscribeMembers = resultSet.update.on(() => next({ members: resultSet.value }));
228
+ // }
229
+ // });
230
+
231
+ // return () => {
232
+ // unsubscribeSpaces();
233
+ // unsubscribeMembers();
234
+ // };
235
+ // });
236
+ // }
237
+ }
238
+
239
+ async createSnapshot(request: CreateSnapshotRequest): Promise<SpaceSnapshot> {
240
+ return todo();
241
+ // assert(request.space_key);
242
+ // const space = this.echo.getSpace(request.space_key) ?? raise(new SpaceNotFoundError(request.space_key));
243
+ // return space.createSnapshot();
244
+ }
245
+ }
@@ -4,9 +4,9 @@
4
4
 
5
5
  import { Config } from '@dxos/config';
6
6
  import { todo } from '@dxos/debug';
7
- import { SystemService as SystemServiceRpc } from '@dxos/protocols/proto/dxos/client';
7
+ import { SystemService } from '@dxos/protocols/proto/dxos/client';
8
8
 
9
- export class SystemService implements SystemServiceRpc {
9
+ export class SystemServiceImpl implements SystemService {
10
10
  constructor(private readonly _config: Config) {}
11
11
 
12
12
  async getConfig(request: void) {
@@ -3,12 +3,12 @@
3
3
  //
4
4
 
5
5
  import { Config } from '@dxos/config';
6
- import { TracingService as TracingServiceRpc } from '@dxos/protocols/proto/dxos/devtools/host';
6
+ import { TracingService } from '@dxos/protocols/proto/dxos/devtools/host';
7
7
 
8
8
  /**
9
9
  *
10
10
  */
11
- export class TracingService implements TracingServiceRpc {
11
+ export class TracingServiceImpl implements TracingService {
12
12
  constructor(private readonly _config: Config) {}
13
13
 
14
14
  async setTracingOptions() {
@@ -2,23 +2,23 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
+ import { Event as AsyncEvent } from '@dxos/async';
5
6
  import { Stream } from '@dxos/codec-protobuf';
6
7
  import { Config } from '@dxos/config';
7
- import { todo } from '@dxos/debug';
8
8
  import {
9
9
  ClearSnapshotsRequest,
10
- DevtoolsHost,
10
+ DevtoolsHost, // TODO(burdon): Rename DevtoolsService
11
11
  EnableDebugLoggingRequest,
12
12
  EnableDebugLoggingResponse,
13
13
  Event,
14
14
  GetConfigResponse,
15
15
  GetNetworkPeersRequest,
16
16
  GetNetworkPeersResponse,
17
- GetPartySnapshotRequest,
18
- GetPartySnapshotResponse,
17
+ GetSpaceSnapshotRequest,
18
+ GetSpaceSnapshotResponse,
19
19
  ResetStorageRequest,
20
- SavePartySnapshotRequest,
21
- SavePartySnapshotResponse,
20
+ SaveSpaceSnapshotRequest,
21
+ SaveSpaceSnapshotResponse,
22
22
  SubscribeToCredentialMessagesRequest,
23
23
  SubscribeToCredentialMessagesResponse,
24
24
  SubscribeToFeedBlocksRequest,
@@ -30,23 +30,22 @@ import {
30
30
  SubscribeToKeyringKeysRequest,
31
31
  SubscribeToKeyringKeysResponse,
32
32
  SubscribeToNetworkTopicsResponse,
33
- SubscribeToPartiesRequest,
34
- SubscribeToPartiesResponse,
33
+ SubscribeToSpacesRequest,
34
+ SubscribeToSpacesResponse,
35
35
  SubscribeToSignalStatusResponse,
36
36
  SubscribeToSignalTraceResponse,
37
37
  SubscribeToSwarmInfoResponse
38
38
  } from '@dxos/protocols/proto/dxos/devtools/host';
39
39
 
40
- import {
41
- DevtoolsHostEvents,
42
- subscribeToNetworkStatus,
43
- subscribeToSignalTrace,
44
- subscribeToSwarmInfo,
45
- subscribeToSpaces,
46
- subscribeToFeedBlocks,
47
- subscribeToFeeds
48
- } from '../../devtools';
49
- import { ServiceContext } from '../service-context';
40
+ import { ServiceContext } from '../services';
41
+ import { subscribeToFeedBlocks, subscribeToFeeds } from './feeds';
42
+ import { subscribeToNetworkStatus, subscribeToSignalTrace, subscribeToSwarmInfo } from './network';
43
+ import { subscribeToSpaces } from './spaces';
44
+
45
+ // TODO(burdon): Remove?
46
+ export class DevtoolsHostEvents {
47
+ readonly ready = new AsyncEvent();
48
+ }
50
49
 
51
50
  export type DevtoolsServiceParams = {
52
51
  events: DevtoolsHostEvents;
@@ -54,7 +53,7 @@ export type DevtoolsServiceParams = {
54
53
  context: ServiceContext;
55
54
  };
56
55
 
57
- export class DevtoolsService implements DevtoolsHost {
56
+ export class DevtoolsServiceImpl implements DevtoolsHost {
58
57
  constructor(private readonly params: DevtoolsServiceParams) {}
59
58
 
60
59
  events(request: void): Stream<Event> {
@@ -66,37 +65,37 @@ export class DevtoolsService implements DevtoolsHost {
66
65
  }
67
66
 
68
67
  getConfig(request: void): Promise<GetConfigResponse> {
69
- todo();
68
+ throw new Error();
70
69
  }
71
70
 
72
71
  resetStorage(request: ResetStorageRequest): Promise<void> {
73
- todo();
72
+ throw new Error();
74
73
  }
75
74
 
76
75
  enableDebugLogging(request: EnableDebugLoggingRequest): Promise<EnableDebugLoggingResponse> {
77
- todo();
76
+ throw new Error();
78
77
  }
79
78
 
80
79
  disableDebugLogging(request: EnableDebugLoggingRequest): Promise<EnableDebugLoggingResponse> {
81
- todo();
80
+ throw new Error();
82
81
  }
83
82
 
84
83
  subscribeToKeyringKeys(request: SubscribeToKeyringKeysRequest): Stream<SubscribeToKeyringKeysResponse> {
85
- todo();
84
+ throw new Error();
86
85
  }
87
86
 
88
87
  subscribeToCredentialMessages(
89
88
  request: SubscribeToCredentialMessagesRequest
90
89
  ): Stream<SubscribeToCredentialMessagesResponse> {
91
- todo();
90
+ throw new Error();
92
91
  }
93
92
 
94
- subscribeToParties(request: SubscribeToPartiesRequest): Stream<SubscribeToPartiesResponse> {
93
+ subscribeToSpaces(request: SubscribeToSpacesRequest): Stream<SubscribeToSpacesResponse> {
95
94
  return subscribeToSpaces(this.params.context, request);
96
95
  }
97
96
 
98
97
  subscribeToItems(request: SubscribeToItemsRequest): Stream<SubscribeToItemsResponse> {
99
- todo();
98
+ throw new Error();
100
99
  }
101
100
 
102
101
  subscribeToFeeds(request: SubscribeToFeedsRequest): Stream<SubscribeToFeedsResponse> {
@@ -107,24 +106,24 @@ export class DevtoolsService implements DevtoolsHost {
107
106
  return subscribeToFeedBlocks({ feedStore: this.params.context.feedStore }, request);
108
107
  }
109
108
 
110
- getPartySnapshot(request: GetPartySnapshotRequest): Promise<GetPartySnapshotResponse> {
111
- todo();
109
+ getSpaceSnapshot(request: GetSpaceSnapshotRequest): Promise<GetSpaceSnapshotResponse> {
110
+ throw new Error();
112
111
  }
113
112
 
114
- savePartySnapshot(request: SavePartySnapshotRequest): Promise<SavePartySnapshotResponse> {
115
- todo();
113
+ saveSpaceSnapshot(request: SaveSpaceSnapshotRequest): Promise<SaveSpaceSnapshotResponse> {
114
+ throw new Error();
116
115
  }
117
116
 
118
117
  clearSnapshots(request: ClearSnapshotsRequest): Promise<void> {
119
- todo();
118
+ throw new Error();
120
119
  }
121
120
 
122
121
  getNetworkPeers(request: GetNetworkPeersRequest): Promise<GetNetworkPeersResponse> {
123
- todo();
122
+ throw new Error();
124
123
  }
125
124
 
126
125
  subscribeToNetworkTopics(request: void): Stream<SubscribeToNetworkTopicsResponse> {
127
- todo();
126
+ throw new Error();
128
127
  }
129
128
 
130
129
  subscribeToSignalStatus(request: void): Stream<SubscribeToSignalStatusResponse> {