@dxos/cli 0.8.4-main.fd6878d → 0.8.4-staging.ac66bdf99f

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 (323) hide show
  1. package/LICENSE +3 -3
  2. package/bin/dx.js +29 -12
  3. package/package.json +14 -129
  4. package/README.md +0 -145
  5. package/bin/agent_entrypoint +0 -22
  6. package/bin/dev.cmd +0 -3
  7. package/bin/dev.js +0 -26
  8. package/bin/handle_invitation +0 -18
  9. package/bin/run.cmd +0 -3
  10. package/dist/src/base.d.ts +0 -18
  11. package/dist/src/base.d.ts.map +0 -1
  12. package/dist/src/base.js +0 -76
  13. package/dist/src/base.js.map +0 -1
  14. package/dist/src/commands/agent/agent.node.test.d.ts +0 -2
  15. package/dist/src/commands/agent/agent.node.test.d.ts.map +0 -1
  16. package/dist/src/commands/agent/agent.node.test.js +0 -178
  17. package/dist/src/commands/agent/agent.node.test.js.map +0 -1
  18. package/dist/src/commands/agent/invitations.d.ts +0 -20
  19. package/dist/src/commands/agent/invitations.d.ts.map +0 -1
  20. package/dist/src/commands/agent/invitations.js +0 -88
  21. package/dist/src/commands/agent/invitations.js.map +0 -1
  22. package/dist/src/commands/agent/list.d.ts +0 -22
  23. package/dist/src/commands/agent/list.d.ts.map +0 -1
  24. package/dist/src/commands/agent/list.js +0 -45
  25. package/dist/src/commands/agent/list.js.map +0 -1
  26. package/dist/src/commands/agent/restart.d.ts +0 -21
  27. package/dist/src/commands/agent/restart.d.ts.map +0 -1
  28. package/dist/src/commands/agent/restart.js +0 -26
  29. package/dist/src/commands/agent/restart.js.map +0 -1
  30. package/dist/src/commands/agent/start.d.ts +0 -33
  31. package/dist/src/commands/agent/start.d.ts.map +0 -1
  32. package/dist/src/commands/agent/start.js +0 -204
  33. package/dist/src/commands/agent/start.js.map +0 -1
  34. package/dist/src/commands/agent/status.d.ts +0 -19
  35. package/dist/src/commands/agent/status.d.ts.map +0 -1
  36. package/dist/src/commands/agent/status.js +0 -30
  37. package/dist/src/commands/agent/status.js.map +0 -1
  38. package/dist/src/commands/agent/stop.d.ts +0 -22
  39. package/dist/src/commands/agent/stop.d.ts.map +0 -1
  40. package/dist/src/commands/agent/stop.js +0 -49
  41. package/dist/src/commands/agent/stop.js.map +0 -1
  42. package/dist/src/commands/config/index.d.ts +0 -7
  43. package/dist/src/commands/config/index.d.ts.map +0 -1
  44. package/dist/src/commands/config/index.js +0 -16
  45. package/dist/src/commands/config/index.js.map +0 -1
  46. package/dist/src/commands/config/index.node.test.d.ts +0 -2
  47. package/dist/src/commands/config/index.node.test.d.ts.map +0 -1
  48. package/dist/src/commands/config/index.node.test.js +0 -25
  49. package/dist/src/commands/config/index.node.test.js.map +0 -1
  50. package/dist/src/commands/debug/diagnostics.d.ts +0 -25
  51. package/dist/src/commands/debug/diagnostics.d.ts.map +0 -1
  52. package/dist/src/commands/debug/diagnostics.js +0 -53
  53. package/dist/src/commands/debug/diagnostics.js.map +0 -1
  54. package/dist/src/commands/debug/error.d.ts +0 -6
  55. package/dist/src/commands/debug/error.d.ts.map +0 -1
  56. package/dist/src/commands/debug/error.js +0 -23
  57. package/dist/src/commands/debug/error.js.map +0 -1
  58. package/dist/src/commands/debug/generate.d.ts +0 -27
  59. package/dist/src/commands/debug/generate.d.ts.map +0 -1
  60. package/dist/src/commands/debug/generate.js +0 -71
  61. package/dist/src/commands/debug/generate.js.map +0 -1
  62. package/dist/src/commands/debug/metrics.d.ts +0 -10
  63. package/dist/src/commands/debug/metrics.d.ts.map +0 -1
  64. package/dist/src/commands/debug/metrics.js +0 -39
  65. package/dist/src/commands/debug/metrics.js.map +0 -1
  66. package/dist/src/commands/debug/status.d.ts +0 -20
  67. package/dist/src/commands/debug/status.d.ts.map +0 -1
  68. package/dist/src/commands/debug/status.js +0 -28
  69. package/dist/src/commands/debug/status.js.map +0 -1
  70. package/dist/src/commands/device/info.d.ts +0 -7
  71. package/dist/src/commands/device/info.d.ts.map +0 -1
  72. package/dist/src/commands/device/info.js +0 -30
  73. package/dist/src/commands/device/info.js.map +0 -1
  74. package/dist/src/commands/device/list.d.ts +0 -20
  75. package/dist/src/commands/device/list.d.ts.map +0 -1
  76. package/dist/src/commands/device/list.js +0 -23
  77. package/dist/src/commands/device/list.js.map +0 -1
  78. package/dist/src/commands/device/update.d.ts +0 -19
  79. package/dist/src/commands/device/update.d.ts.map +0 -1
  80. package/dist/src/commands/device/update.js +0 -32
  81. package/dist/src/commands/device/update.js.map +0 -1
  82. package/dist/src/commands/edge/status.d.ts +0 -19
  83. package/dist/src/commands/edge/status.d.ts.map +0 -1
  84. package/dist/src/commands/edge/status.js +0 -24
  85. package/dist/src/commands/edge/status.js.map +0 -1
  86. package/dist/src/commands/function/list.d.ts +0 -7
  87. package/dist/src/commands/function/list.d.ts.map +0 -1
  88. package/dist/src/commands/function/list.js +0 -19
  89. package/dist/src/commands/function/list.js.map +0 -1
  90. package/dist/src/commands/function/logs.d.ts +0 -14
  91. package/dist/src/commands/function/logs.d.ts.map +0 -1
  92. package/dist/src/commands/function/logs.js +0 -38
  93. package/dist/src/commands/function/logs.js.map +0 -1
  94. package/dist/src/commands/function/trigger/list.d.ts +0 -26
  95. package/dist/src/commands/function/trigger/list.d.ts.map +0 -1
  96. package/dist/src/commands/function/trigger/list.js +0 -51
  97. package/dist/src/commands/function/trigger/list.js.map +0 -1
  98. package/dist/src/commands/function/upload.d.ts +0 -34
  99. package/dist/src/commands/function/upload.d.ts.map +0 -1
  100. package/dist/src/commands/function/upload.js +0 -148
  101. package/dist/src/commands/function/upload.js.map +0 -1
  102. package/dist/src/commands/function/watch.d.ts +0 -29
  103. package/dist/src/commands/function/watch.d.ts.map +0 -1
  104. package/dist/src/commands/function/watch.js +0 -127
  105. package/dist/src/commands/function/watch.js.map +0 -1
  106. package/dist/src/commands/halo/create.d.ts +0 -24
  107. package/dist/src/commands/halo/create.d.ts.map +0 -1
  108. package/dist/src/commands/halo/create.js +0 -36
  109. package/dist/src/commands/halo/create.js.map +0 -1
  110. package/dist/src/commands/halo/credential/add.d.ts +0 -9
  111. package/dist/src/commands/halo/credential/add.d.ts.map +0 -1
  112. package/dist/src/commands/halo/credential/add.js +0 -42
  113. package/dist/src/commands/halo/credential/add.js.map +0 -1
  114. package/dist/src/commands/halo/credential/list.d.ts +0 -23
  115. package/dist/src/commands/halo/credential/list.d.ts.map +0 -1
  116. package/dist/src/commands/halo/credential/list.js +0 -62
  117. package/dist/src/commands/halo/credential/list.js.map +0 -1
  118. package/dist/src/commands/halo/identity.d.ts +0 -8
  119. package/dist/src/commands/halo/identity.d.ts.map +0 -1
  120. package/dist/src/commands/halo/identity.js +0 -31
  121. package/dist/src/commands/halo/identity.js.map +0 -1
  122. package/dist/src/commands/halo/join.d.ts +0 -23
  123. package/dist/src/commands/halo/join.d.ts.map +0 -1
  124. package/dist/src/commands/halo/join.js +0 -94
  125. package/dist/src/commands/halo/join.js.map +0 -1
  126. package/dist/src/commands/halo/keys.d.ts +0 -7
  127. package/dist/src/commands/halo/keys.d.ts.map +0 -1
  128. package/dist/src/commands/halo/keys.js +0 -14
  129. package/dist/src/commands/halo/keys.js.map +0 -1
  130. package/dist/src/commands/halo/recovery/generate.d.ts +0 -7
  131. package/dist/src/commands/halo/recovery/generate.d.ts.map +0 -1
  132. package/dist/src/commands/halo/recovery/generate.js +0 -16
  133. package/dist/src/commands/halo/recovery/generate.js.map +0 -1
  134. package/dist/src/commands/halo/recovery/use.d.ts +0 -20
  135. package/dist/src/commands/halo/recovery/use.d.ts.map +0 -1
  136. package/dist/src/commands/halo/recovery/use.js +0 -21
  137. package/dist/src/commands/halo/recovery/use.js.map +0 -1
  138. package/dist/src/commands/halo/share.d.ts +0 -24
  139. package/dist/src/commands/halo/share.d.ts.map +0 -1
  140. package/dist/src/commands/halo/share.js +0 -73
  141. package/dist/src/commands/halo/share.js.map +0 -1
  142. package/dist/src/commands/halo/update.d.ts +0 -19
  143. package/dist/src/commands/halo/update.d.ts.map +0 -1
  144. package/dist/src/commands/halo/update.js +0 -34
  145. package/dist/src/commands/halo/update.js.map +0 -1
  146. package/dist/src/commands/info.d.ts +0 -19
  147. package/dist/src/commands/info.d.ts.map +0 -1
  148. package/dist/src/commands/info.js +0 -23
  149. package/dist/src/commands/info.js.map +0 -1
  150. package/dist/src/commands/profile/import.d.ts +0 -20
  151. package/dist/src/commands/profile/import.d.ts.map +0 -1
  152. package/dist/src/commands/profile/import.js +0 -66
  153. package/dist/src/commands/profile/import.js.map +0 -1
  154. package/dist/src/commands/profile/inspect.d.ts +0 -20
  155. package/dist/src/commands/profile/inspect.d.ts.map +0 -1
  156. package/dist/src/commands/profile/inspect.js +0 -37
  157. package/dist/src/commands/profile/inspect.js.map +0 -1
  158. package/dist/src/commands/reset/index.d.ts +0 -20
  159. package/dist/src/commands/reset/index.d.ts.map +0 -1
  160. package/dist/src/commands/reset/index.js +0 -74
  161. package/dist/src/commands/reset/index.js.map +0 -1
  162. package/dist/src/commands/shell/index.d.ts +0 -6
  163. package/dist/src/commands/shell/index.d.ts.map +0 -1
  164. package/dist/src/commands/shell/index.js +0 -25
  165. package/dist/src/commands/shell/index.js.map +0 -1
  166. package/dist/src/commands/space/close.d.ts +0 -9
  167. package/dist/src/commands/space/close.d.ts.map +0 -1
  168. package/dist/src/commands/space/close.js +0 -17
  169. package/dist/src/commands/space/close.js.map +0 -1
  170. package/dist/src/commands/space/create.d.ts +0 -10
  171. package/dist/src/commands/space/create.d.ts.map +0 -1
  172. package/dist/src/commands/space/create.js +0 -25
  173. package/dist/src/commands/space/create.js.map +0 -1
  174. package/dist/src/commands/space/epoch.d.ts +0 -10
  175. package/dist/src/commands/space/epoch.d.ts.map +0 -1
  176. package/dist/src/commands/space/epoch.js +0 -18
  177. package/dist/src/commands/space/epoch.js.map +0 -1
  178. package/dist/src/commands/space/info.d.ts +0 -10
  179. package/dist/src/commands/space/info.d.ts.map +0 -1
  180. package/dist/src/commands/space/info.js +0 -26
  181. package/dist/src/commands/space/info.js.map +0 -1
  182. package/dist/src/commands/space/join.d.ts +0 -21
  183. package/dist/src/commands/space/join.d.ts.map +0 -1
  184. package/dist/src/commands/space/join.js +0 -71
  185. package/dist/src/commands/space/join.js.map +0 -1
  186. package/dist/src/commands/space/list.d.ts +0 -24
  187. package/dist/src/commands/space/list.d.ts.map +0 -1
  188. package/dist/src/commands/space/list.js +0 -90
  189. package/dist/src/commands/space/list.js.map +0 -1
  190. package/dist/src/commands/space/members.d.ts +0 -23
  191. package/dist/src/commands/space/members.d.ts.map +0 -1
  192. package/dist/src/commands/space/members.js +0 -27
  193. package/dist/src/commands/space/members.js.map +0 -1
  194. package/dist/src/commands/space/open.d.ts +0 -9
  195. package/dist/src/commands/space/open.d.ts.map +0 -1
  196. package/dist/src/commands/space/open.js +0 -17
  197. package/dist/src/commands/space/open.js.map +0 -1
  198. package/dist/src/commands/space/query.d.ts +0 -25
  199. package/dist/src/commands/space/query.d.ts.map +0 -1
  200. package/dist/src/commands/space/query.js +0 -44
  201. package/dist/src/commands/space/query.js.map +0 -1
  202. package/dist/src/commands/space/schema/list.d.ts +0 -21
  203. package/dist/src/commands/space/schema/list.d.ts.map +0 -1
  204. package/dist/src/commands/space/schema/list.js +0 -57
  205. package/dist/src/commands/space/schema/list.js.map +0 -1
  206. package/dist/src/commands/space/share.d.ts +0 -27
  207. package/dist/src/commands/space/share.d.ts.map +0 -1
  208. package/dist/src/commands/space/share.js +0 -80
  209. package/dist/src/commands/space/share.js.map +0 -1
  210. package/dist/src/commands/tunnel/index.d.ts +0 -22
  211. package/dist/src/commands/tunnel/index.d.ts.map +0 -1
  212. package/dist/src/commands/tunnel/index.js +0 -43
  213. package/dist/src/commands/tunnel/index.js.map +0 -1
  214. package/dist/src/commands/tunnel/list.d.ts +0 -21
  215. package/dist/src/commands/tunnel/list.d.ts.map +0 -1
  216. package/dist/src/commands/tunnel/list.js +0 -29
  217. package/dist/src/commands/tunnel/list.js.map +0 -1
  218. package/dist/src/components/App.d.ts +0 -10
  219. package/dist/src/components/App.d.ts.map +0 -1
  220. package/dist/src/components/App.js +0 -31
  221. package/dist/src/components/App.js.map +0 -1
  222. package/dist/src/components/SpaceTable.d.ts +0 -10
  223. package/dist/src/components/SpaceTable.d.ts.map +0 -1
  224. package/dist/src/components/SpaceTable.js +0 -33
  225. package/dist/src/components/SpaceTable.js.map +0 -1
  226. package/dist/src/components/SystemTable.d.ts +0 -8
  227. package/dist/src/components/SystemTable.d.ts.map +0 -1
  228. package/dist/src/components/SystemTable.js +0 -51
  229. package/dist/src/components/SystemTable.js.map +0 -1
  230. package/dist/src/components/index.d.ts +0 -4
  231. package/dist/src/components/index.d.ts.map +0 -1
  232. package/dist/src/components/index.js +0 -7
  233. package/dist/src/components/index.js.map +0 -1
  234. package/dist/src/help.d.ts +0 -6
  235. package/dist/src/help.d.ts.map +0 -1
  236. package/dist/src/help.js +0 -37
  237. package/dist/src/help.js.map +0 -1
  238. package/dist/src/hooks/command-not-found.d.ts +0 -4
  239. package/dist/src/hooks/command-not-found.d.ts.map +0 -1
  240. package/dist/src/hooks/command-not-found.js +0 -16
  241. package/dist/src/hooks/command-not-found.js.map +0 -1
  242. package/dist/src/index.d.ts +0 -3
  243. package/dist/src/index.d.ts.map +0 -1
  244. package/dist/src/index.js +0 -6
  245. package/dist/src/index.js.map +0 -1
  246. package/dist/src/util/function/bundle.d.ts +0 -5
  247. package/dist/src/util/function/bundle.d.ts.map +0 -1
  248. package/dist/src/util/function/bundle.js +0 -13
  249. package/dist/src/util/function/bundle.js.map +0 -1
  250. package/dist/src/util/function/index.d.ts +0 -3
  251. package/dist/src/util/function/index.d.ts.map +0 -1
  252. package/dist/src/util/function/index.js +0 -6
  253. package/dist/src/util/function/index.js.map +0 -1
  254. package/dist/src/util/function/lookup.d.ts +0 -18
  255. package/dist/src/util/function/lookup.d.ts.map +0 -1
  256. package/dist/src/util/function/lookup.js +0 -14
  257. package/dist/src/util/function/lookup.js.map +0 -1
  258. package/dist/src/util/index.d.ts +0 -6
  259. package/dist/src/util/index.d.ts.map +0 -1
  260. package/dist/src/util/index.js +0 -9
  261. package/dist/src/util/index.js.map +0 -1
  262. package/dist/src/util/provider/digital-ocean.d.ts +0 -14
  263. package/dist/src/util/provider/digital-ocean.d.ts.map +0 -1
  264. package/dist/src/util/provider/digital-ocean.js +0 -123
  265. package/dist/src/util/provider/digital-ocean.js.map +0 -1
  266. package/dist/src/util/provider/index.d.ts +0 -3
  267. package/dist/src/util/provider/index.d.ts.map +0 -1
  268. package/dist/src/util/provider/index.js +0 -6
  269. package/dist/src/util/provider/index.js.map +0 -1
  270. package/dist/src/util/provider/provider.d.ts +0 -27
  271. package/dist/src/util/provider/provider.d.ts.map +0 -1
  272. package/dist/src/util/provider/provider.js +0 -24
  273. package/dist/src/util/provider/provider.js.map +0 -1
  274. package/dist/src/util/publish/build.d.ts +0 -11
  275. package/dist/src/util/publish/build.d.ts.map +0 -1
  276. package/dist/src/util/publish/build.js +0 -24
  277. package/dist/src/util/publish/build.js.map +0 -1
  278. package/dist/src/util/publish/common.d.ts +0 -11
  279. package/dist/src/util/publish/common.d.ts.map +0 -1
  280. package/dist/src/util/publish/common.js +0 -23
  281. package/dist/src/util/publish/common.js.map +0 -1
  282. package/dist/src/util/publish/config.d.ts +0 -3
  283. package/dist/src/util/publish/config.d.ts.map +0 -1
  284. package/dist/src/util/publish/config.js +0 -27
  285. package/dist/src/util/publish/config.js.map +0 -1
  286. package/dist/src/util/publish/index.d.ts +0 -7
  287. package/dist/src/util/publish/index.d.ts.map +0 -1
  288. package/dist/src/util/publish/index.js +0 -10
  289. package/dist/src/util/publish/index.js.map +0 -1
  290. package/dist/src/util/publish/ipfs-upload.d.ts +0 -8
  291. package/dist/src/util/publish/ipfs-upload.d.ts.map +0 -1
  292. package/dist/src/util/publish/ipfs-upload.js +0 -50
  293. package/dist/src/util/publish/ipfs-upload.js.map +0 -1
  294. package/dist/src/util/publish/publish.d.ts +0 -14
  295. package/dist/src/util/publish/publish.d.ts.map +0 -1
  296. package/dist/src/util/publish/publish.js +0 -51
  297. package/dist/src/util/publish/publish.js.map +0 -1
  298. package/dist/src/util/publish/publisher-rpc-peer.d.ts +0 -15
  299. package/dist/src/util/publish/publisher-rpc-peer.d.ts.map +0 -1
  300. package/dist/src/util/publish/publisher-rpc-peer.js +0 -82
  301. package/dist/src/util/publish/publisher-rpc-peer.js.map +0 -1
  302. package/dist/src/util/supervisor/index.d.ts +0 -2
  303. package/dist/src/util/supervisor/index.d.ts.map +0 -1
  304. package/dist/src/util/supervisor/index.js +0 -5
  305. package/dist/src/util/supervisor/index.js.map +0 -1
  306. package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts +0 -15
  307. package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts.map +0 -1
  308. package/dist/src/util/supervisor/supervisor-rpc-peer.js +0 -83
  309. package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +0 -1
  310. package/dist/src/util/tunnel/common.d.ts +0 -9
  311. package/dist/src/util/tunnel/common.d.ts.map +0 -1
  312. package/dist/src/util/tunnel/common.js +0 -26
  313. package/dist/src/util/tunnel/common.js.map +0 -1
  314. package/dist/src/util/tunnel/index.d.ts +0 -3
  315. package/dist/src/util/tunnel/index.d.ts.map +0 -1
  316. package/dist/src/util/tunnel/index.js +0 -6
  317. package/dist/src/util/tunnel/index.js.map +0 -1
  318. package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts +0 -15
  319. package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts.map +0 -1
  320. package/dist/src/util/tunnel/tunnel-rpc-peer.js +0 -83
  321. package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +0 -1
  322. package/dist/tsconfig.tsbuildinfo +0 -1
  323. package/oclif.manifest.json +0 -5824
@@ -1,24 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import { spawnSync } from 'child_process';
5
- import chalk from 'chalk';
6
- export const build = ({ verbose }, { log, module }) => {
7
- log(`Building module ${chalk.bold(module.name)} ...`);
8
- const [command, ...args] = module.build.command.split(' ');
9
- // Build with configuration.
10
- const { status, error } = spawnSync(command, args, {
11
- env: {
12
- ...process.env,
13
- ...(module.build.env ?? {}),
14
- CONFIG_DYNAMIC: 'true',
15
- },
16
- stdio: verbose ? 'inherit' : undefined,
17
- });
18
- if (error || status !== 0) {
19
- log(`Module ${chalk.bold(module.name)} build failed${verbose ? ` with status: ${status}.${error ? '\n' + error : ''}` : '. Re-run with --verbose for more details.'}`);
20
- process.exit(status === null ? 1 : status);
21
- }
22
- log(`Module build ${chalk.bold(module.name)} succeeded.`);
23
- };
24
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../src/util/publish/build.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,OAAO,EAAa,EAAE,EAAE,GAAG,EAAE,MAAM,EAAe,EAAE,EAAE;IAC5E,GAAG,CAAC,mBAAmB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEtD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,KAAM,CAAC,OAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE7D,4BAA4B;IAC5B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE;QACjD,GAAG,EAAE;YACH,GAAG,OAAO,CAAC,GAAG;YACd,GAAG,CAAC,MAAM,CAAC,KAAM,CAAC,GAAG,IAAI,EAAE,CAAC;YAC5B,cAAc,EAAE,MAAM;SACvB;QACD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;KACvC,CAAC,CAAC;IAEH,IAAI,KAAK,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,GAAG,CACD,UAAU,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAC/B,OAAO,CAAC,CAAC,CAAC,iBAAiB,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,2CACrE,EAAE,CACH,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,GAAG,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC5D,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { type TableOptions } from '@dxos/cli-base';
2
- import type { ConfigProto } from '@dxos/config';
3
- export type PackageModule = NonNullable<NonNullable<ConfigProto['package']>['modules']>[0];
4
- export type PackageRepo = NonNullable<NonNullable<ConfigProto['package']>['repos']>[0];
5
- export type Logger = (message: string, ...args: any[]) => void;
6
- export declare const mapModules: (modules: PackageModule[]) => Promise<{
7
- key: string | undefined;
8
- bundle: string;
9
- }[]>;
10
- export declare const printModules: (modules: PackageModule[], flags?: TableOptions) => Promise<void>;
11
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/common.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3F,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAE/D,eAAO,MAAM,UAAU,GAAU,SAAS,aAAa,EAAE;;;IAMxD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,SAAS,aAAa,EAAE,EAAE,QAAO,YAAiB,kBAepF,CAAC"}
@@ -1,23 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import { ux } from '@oclif/core';
5
- import { table } from '@dxos/cli-base';
6
- export const mapModules = async (modules) => {
7
- const { CID } = await import('kubo-rpc-client');
8
- return modules.map((mod) => ({
9
- key: mod.name,
10
- bundle: CID.decode(mod.bundle).toString(),
11
- }));
12
- };
13
- export const printModules = async (modules, flags = {}) => {
14
- ux.stdout(table(await mapModules(modules), {
15
- key: {
16
- header: 'name',
17
- },
18
- bundle: {
19
- header: 'bundle',
20
- },
21
- }, flags));
22
- };
23
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/util/publish/common.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAqB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAQ1D,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,OAAwB,EAAE,EAAE;IAC3D,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAChD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3B,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAO,CAAC,CAAC,QAAQ,EAAE;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,OAAwB,EAAE,QAAsB,EAAE,EAAE,EAAE;IACvF,EAAE,CAAC,MAAM,CACP,KAAK,CACH,MAAM,UAAU,CAAC,OAAO,CAAC,EACzB;QACE,GAAG,EAAE;YACH,MAAM,EAAE,MAAM;SACf;QACD,MAAM,EAAE;YACN,MAAM,EAAE,QAAQ;SACjB;KACF,EACD,KAAK,CACN,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Config } from '@dxos/config';
2
- export declare const loadConfig: (configPath?: string) => Promise<Config>;
3
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAStC,eAAO,MAAM,UAAU,GAAU,aAAY,MAAkC,KAAG,OAAO,CAAC,MAAM,CAoB/F,CAAC"}
@@ -1,27 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import fs from 'fs';
5
- import path from 'path';
6
- import yaml from 'js-yaml';
7
- import defaultsDeep from 'lodash.defaultsdeep';
8
- import { Config } from '@dxos/config';
9
- import { invariant } from '@dxos/invariant';
10
- const DEFAULT_BUILD_COMMAND = 'npm run build';
11
- const EXTENSION_CONFIG_FILENAME = 'dx.yml';
12
- export const loadConfig = async (configPath = EXTENSION_CONFIG_FILENAME) => {
13
- const absolute = path.isAbsolute(configPath);
14
- configPath = absolute ? configPath : path.join(process.cwd(), configPath);
15
- invariant(fs.existsSync(configPath), `"${configPath}" not found.`);
16
- const dxConfig = yaml.load(String(fs.readFileSync(configPath)));
17
- invariant(dxConfig.package?.modules?.length, `No modules found in ${configPath}`);
18
- return new Config({
19
- version: 1,
20
- package: {
21
- modules: dxConfig.package.modules.map((module) => defaultsDeep(module, {
22
- build: { command: DEFAULT_BUILD_COMMAND },
23
- })),
24
- },
25
- });
26
- };
27
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/util/publish/config.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAC9C,MAAM,yBAAyB,GAAG,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,aAAqB,yBAAyB,EAAmB,EAAE;IAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC7C,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;IAE1E,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,IAAI,UAAU,cAAc,CAAC,CAAC;IAEnE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAgB,CAAC;IAE/E,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,UAAU,EAAE,CAAC,CAAC;IAElF,OAAO,IAAI,MAAM,CAAC;QAChB,OAAO,EAAE,CAAC;QACV,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAqB,EAAE,EAAE,CAC9D,YAAY,CAAC,MAAM,EAAE;gBACnB,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;aAC1C,CAAC,CACH;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- export * from './build';
2
- export * from './common';
3
- export * from './config';
4
- export * from './ipfs-upload';
5
- export * from './publish';
6
- export * from './publisher-rpc-peer';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC"}
@@ -1,10 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- export * from './build';
5
- export * from './common';
6
- export * from './config';
7
- export * from './ipfs-upload';
8
- export * from './publish';
9
- export * from './publisher-rpc-peer';
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/publish/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { type CID, type KuboRPCClient } from 'kubo-rpc-client';
2
- interface UploadOptions {
3
- progress?: (bytes: number, path?: string) => void;
4
- pin?: boolean;
5
- }
6
- export declare const uploadToIPFS: (ipfsClient: KuboRPCClient, path: string, options?: UploadOptions) => Promise<CID>;
7
- export {};
8
- //# sourceMappingURL=ipfs-upload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipfs-upload.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/ipfs-upload.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAI/D,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAGD,eAAO,MAAM,YAAY,GAAU,YAAY,aAAa,EAAE,MAAM,MAAM,EAAE,UAAU,aAAa,KAAG,OAAO,CAAC,GAAG,CA2ChH,CAAC"}
@@ -1,50 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import fs from 'fs';
5
- import { join } from 'path';
6
- import { importESM } from '@dxos/cli-base';
7
- // TODO(burdon): Generalize.
8
- export const uploadToIPFS = async (ipfsClient, path, options) => {
9
- const { globSource } = await importESM('kubo-rpc-client');
10
- if (!fs.existsSync(path)) {
11
- throw new Error(`File or directory does not exist: ${path}}`);
12
- }
13
- const { pin = true, progress } = options || {};
14
- if (fs.lstatSync(path).isDirectory()) {
15
- const files = [];
16
- for await (const file of ipfsClient.addAll(globSource(path, '**/*'), {
17
- progress,
18
- pin,
19
- wrapWithDirectory: true,
20
- })) {
21
- const fullPath = join(path, file.path);
22
- if (!fs.lstatSync(fullPath).isDirectory()) {
23
- const remoteChunks = [];
24
- for await (const chunk of ipfsClient.cat(file.cid)) {
25
- remoteChunks.push(chunk);
26
- }
27
- const remoteContent = Buffer.concat(remoteChunks);
28
- const localContent = fs.readFileSync(fullPath);
29
- if (!localContent.equals(remoteContent)) {
30
- throw new Error('file content mismatch', {
31
- cause: {
32
- path: fullPath,
33
- cid: file.cid.toString(),
34
- localSize: localContent.length,
35
- remoteSize: remoteContent.length,
36
- },
37
- });
38
- }
39
- }
40
- files.push(file);
41
- }
42
- return files[files.length - 1].cid; // last file is the root directory
43
- }
44
- else {
45
- const content = fs.readFileSync(path);
46
- const addResult = await ipfsClient.add(content, { pin });
47
- return addResult.cid;
48
- }
49
- };
50
- //# sourceMappingURL=ipfs-upload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipfs-upload.js","sourceRoot":"","sources":["../../../../src/util/publish/ipfs-upload.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO3C,4BAA4B;AAC5B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,UAAyB,EAAE,IAAY,EAAE,OAAuB,EAAgB,EAAE;IACnH,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,GAAG,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,EAAE,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAC/C,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;YACnE,QAAQ;YACR,GAAG;Y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OAAO,SAAS,CAAC,GAAG,CAAC;IACvB,CAAC;AACH,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { Config } from '@dxos/client';
2
- import { type Logger, type PackageModule } from './common';
3
- interface PublishOptions {
4
- config: Config;
5
- log: Logger;
6
- module: PackageModule;
7
- verbose?: boolean;
8
- timeout?: string | number;
9
- path?: string;
10
- pin?: boolean;
11
- }
12
- export declare const publish: ({ verbose, timeout, path, pin, log, config, module }: PublishOptions) => Promise<any>;
13
- export {};
14
- //# sourceMappingURL=publish.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/publish.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAa3D,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,OAAO,GAAU,sDAAsD,cAAc,KAAG,OAAO,CAAC,GAAG,CAiC/G,CAAC"}
@@ -1,51 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import fs from 'fs';
5
- import { join } from 'path';
6
- import { promisify } from 'util';
7
- import chalk from 'chalk';
8
- import cliProgress from 'cli-progress';
9
- import folderSize from 'get-folder-size';
10
- import { createIpfsClient } from '@dxos/cli-base';
11
- import { invariant } from '@dxos/invariant';
12
- import { uploadToIPFS } from './ipfs-upload';
13
- const DEFAULT_OUTDIR = 'out';
14
- const getFolderSize = promisify(folderSize);
15
- /**
16
- * Encodes DXN string to fs path.
17
- * Example: `example:app/braneframe` => `example/app/braneframe`
18
- */
19
- const encodeName = (name) => name.replaceAll(':', '/');
20
- export const publish = async ({ verbose, timeout, path, pin, log, config, module }) => {
21
- invariant(module.name, 'Module name is required to publish.');
22
- log(`Publishing module ${chalk.bold(module.name)} ...`);
23
- const moduleOut = `out/${encodeName(module.name)}`;
24
- const outdir = path ?? module.build?.outdir ?? (fs.existsSync(moduleOut) ? moduleOut : DEFAULT_OUTDIR);
25
- const publishFolder = join(process.cwd(), outdir);
26
- if (!fs.existsSync(publishFolder)) {
27
- throw new Error(`Publish failed. Build output folder does not exist: ${publishFolder}.`);
28
- }
29
- const total = await getFolderSize(publishFolder);
30
- const progress = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
31
- verbose && progress.start(total, 0);
32
- let cid;
33
- try {
34
- const ipfsClient = await createIpfsClient(config, timeout);
35
- log('Uploading...', { folder: publishFolder, server: ipfsClient.getEndpointConfig().host });
36
- cid = await uploadToIPFS(ipfsClient, publishFolder, {
37
- progress: verbose ? (bytes) => progress.update(bytes) : undefined,
38
- pin,
39
- });
40
- }
41
- catch (err) {
42
- // Avoid leaving user's terminal in a bad state.
43
- progress.stop();
44
- throw new Error(`Publish failed. ${err.message}` + (err.cause ? ` (${err.cause})` : ''));
45
- }
46
- verbose && progress.update(total);
47
- verbose && progress.stop();
48
- log(`Published module ${chalk.bold(module.name)}. IPFS cid: ${cid.toString()}`);
49
- return cid;
50
- };
51
- //# sourceMappingURL=publish.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../../src/util/publish/publish.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,KAAK,MAAM,O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,EAAE,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Event } from '@dxos/async';
2
- import { type Publisher } from '@dxos/protocols/proto/dxos/service/publisher';
3
- export declare class PublisherRpcPeer {
4
- private readonly _url;
5
- private readonly _socket;
6
- private readonly _rpc;
7
- private readonly _connectTrigger;
8
- readonly connected: Event<void>;
9
- readonly disconnected: Event<void>;
10
- readonly error: Event<Error>;
11
- constructor(_url: string);
12
- get rpc(): Publisher;
13
- close(): Promise<void>;
14
- }
15
- //# sourceMappingURL=publisher-rpc-peer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publisher-rpc-peer.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/publisher-rpc-peer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAW,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAG9E,qBAAa,gBAAgB;IASf,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyC;IAC9D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,QAAQ,CAAC,SAAS,cAAe;IACjC,QAAQ,CAAC,YAAY,cAAe;IACpC,QAAQ,CAAC,KAAK,eAAsB;gBAEP,IAAI,EAAE,MAAM;IAqDzC,IAAI,GAAG,IAAI,SAAS,CAEnB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}
@@ -1,82 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import WebSocket from 'isomorphic-ws';
5
- import { Event, Trigger } from '@dxos/async';
6
- import { log } from '@dxos/log';
7
- import { schema } from '@dxos/protocols/proto';
8
- import { createProtoRpcPeer } from '@dxos/rpc';
9
- export class PublisherRpcPeer {
10
- _url;
11
- _socket;
12
- _rpc;
13
- _connectTrigger = new Trigger();
14
- connected = new Event();
15
- disconnected = new Event();
16
- error = new Event();
17
- constructor(_url) {
18
- this._url = _url;
19
- this._socket = new WebSocket(this._url);
20
- this._socket.onopen = async () => {
21
- try {
22
- await this._rpc.open();
23
- log(`RPC open ${this._url}`);
24
- this.connected.emit();
25
- this._connectTrigger.wake();
26
- }
27
- catch (err) {
28
- this.error.emit(err);
29
- }
30
- };
31
- this._socket.onclose = async () => {
32
- log(`Disconnected ${this._url}`);
33
- this.disconnected.emit();
34
- try {
35
- await this._rpc.close();
36
- }
37
- catch (err) {
38
- this.error.emit(err);
39
- }
40
- };
41
- this._socket.onerror = (event) => {
42
- log(`Publisher socket error ${this._url} ${event.message}`);
43
- this.error.emit(event.error ?? new Error(event.message));
44
- };
45
- this._rpc = createProtoRpcPeer({
46
- requested: {
47
- Publisher: schema.getService('dxos.service.publisher.Publisher'),
48
- },
49
- exposed: {},
50
- handlers: {},
51
- noHandshake: true,
52
- timeout: 1_000_000,
53
- port: {
54
- send: (msg) => {
55
- this._socket.send(msg);
56
- },
57
- subscribe: (cb) => {
58
- this._socket.onmessage = async (msg) => {
59
- if (typeof Blob !== 'undefined' && msg.data instanceof Blob) {
60
- cb(Buffer.from(await msg.data.arrayBuffer()));
61
- }
62
- else {
63
- cb(msg.data);
64
- }
65
- };
66
- },
67
- },
68
- });
69
- }
70
- get rpc() {
71
- return this._rpc.rpc.Publisher;
72
- }
73
- async close() {
74
- try {
75
- await this._rpc.close();
76
- }
77
- finally {
78
- this._socket.close();
79
- }
80
- }
81
- }
82
- //# sourceMappingURL=publisher-rpc-peer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publisher-rpc-peer.js","sourceRoot":"","sources":["../../../../src/util/publish/publisher-rpc-peer.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,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ACL,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export * from './supervisor-rpc-peer';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/supervisor/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC"}
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- export * from './supervisor-rpc-peer';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/supervisor/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,uBAAuB,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Event } from '@dxos/async';
2
- import { type Supervisor } from '@dxos/protocols/proto/dxos/service/supervisor';
3
- export declare class SupervisorRpcPeer {
4
- private readonly _url;
5
- private readonly _socket;
6
- private readonly _rpc;
7
- private readonly _connectTrigger;
8
- readonly connected: Event<void>;
9
- readonly disconnected: Event<void>;
10
- readonly error: Event<Error>;
11
- constructor(_url: string);
12
- get rpc(): Supervisor;
13
- close(): Promise<void>;
14
- }
15
- //# sourceMappingURL=supervisor-rpc-peer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"supervisor-rpc-peer.d.ts","sourceRoot":"","sources":["../../../../src/util/supervisor/supervisor-rpc-peer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAW,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGhF,qBAAa,iBAAiB;IAShB,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2C;IAChE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,QAAQ,CAAC,SAAS,cAAe;IACjC,QAAQ,CAAC,YAAY,cAAe;IACpC,QAAQ,CAAC,KAAK,eAAsB;gBAEP,IAAI,EAAE,MAAM;IAqDzC,IAAI,GAAG,IAAI,UAAU,CAEpB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}
@@ -1,83 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- // TODO(egorgripasov): Factor out.
5
- import WebSocket from 'isomorphic-ws';
6
- import { Event, Trigger } from '@dxos/async';
7
- import { log } from '@dxos/log';
8
- import { schema } from '@dxos/protocols/proto';
9
- import { createProtoRpcPeer } from '@dxos/rpc';
10
- export class SupervisorRpcPeer {
11
- _url;
12
- _socket;
13
- _rpc;
14
- _connectTrigger = new Trigger();
15
- connected = new Event();
16
- disconnected = new Event();
17
- error = new Event();
18
- constructor(_url) {
19
- this._url = _url;
20
- this._socket = new WebSocket(this._url);
21
- this._socket.onopen = async () => {
22
- try {
23
- await this._rpc.open();
24
- log(`RPC open ${this._url}`);
25
- this.connected.emit();
26
- this._connectTrigger.wake();
27
- }
28
- catch (err) {
29
- this.error.emit(err);
30
- }
31
- };
32
- this._socket.onclose = async () => {
33
- log(`Disconnected ${this._url}`);
34
- this.disconnected.emit();
35
- try {
36
- await this._rpc.close();
37
- }
38
- catch (err) {
39
- this.error.emit(err);
40
- }
41
- };
42
- this._socket.onerror = (event) => {
43
- log(`Publisher socket error ${this._url} ${event.message}`);
44
- this.error.emit(event.error ?? new Error(event.message));
45
- };
46
- this._rpc = createProtoRpcPeer({
47
- requested: {
48
- Supervisor: schema.getService('dxos.service.supervisor.Supervisor'),
49
- },
50
- exposed: {},
51
- handlers: {},
52
- noHandshake: true,
53
- timeout: 1_000_000,
54
- port: {
55
- send: (msg) => {
56
- this._socket.send(msg);
57
- },
58
- subscribe: (cb) => {
59
- this._socket.onmessage = async (msg) => {
60
- if (typeof Blob !== 'undefined' && msg.data instanceof Blob) {
61
- cb(Buffer.from(await msg.data.arrayBuffer()));
62
- }
63
- else {
64
- cb(msg.data);
65
- }
66
- };
67
- },
68
- },
69
- });
70
- }
71
- get rpc() {
72
- return this._rpc.rpc.Supervisor;
73
- }
74
- async close() {
75
- try {
76
- await this._rpc.close();
77
- }
78
- finally {
79
- this._socket.close();
80
- }
81
- }
82
- }
83
- //# sourceMappingURL=supervisor-rpc-peer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"supervisor-rpc-peer.js","sourceRoot":"","sources":["../../../../src/util/supervisor/supervisor-rpc-peer.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,kCAAkC;AAClC,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAqB,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAElE,MAAM,OAAO,iBAAiB;IASC;IARZ,OAAO,CAAY;IACnB,IAAI,CAA2C;IAC/C,eAAe,GAAG,IAAI,OAAO,EAAE,CAAC;IAExC,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC;IACxB,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IAC3B,KAAK,GAAG,IAAI,KAAK,EAAS,CAAC;IAEpC,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QACvC,IAAI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;gBACT,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,oCAAoC,CAAC;aACpE;YACD,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,IAAI;YACjB,OAAO,EAAE,SAAS;YAClB,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBACZ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzB,CAAC;gBACD,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;oBAChB,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,GAA2B,EAAE,EAAE;wBAC7D,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;4BAC5D,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;wBAChD,CAAC;6BAAM,CAAC;4BACN,EAAE,CAAC,GAAG,CAAC,IAAW,CAAC,CAAC;wBACtB,CAAC;oBACH,CAAC,CAAC;gBACJ,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;CACF"}
@@ -1,9 +0,0 @@
1
- import { type TableFlags } from '@dxos/cli-base';
2
- import { type TunnelResponse } from '@dxos/protocols/proto/dxos/service/tunnel';
3
- export declare const mapTunnels: (tunnels: TunnelResponse[]) => {
4
- key: string;
5
- enabled: boolean;
6
- url: string;
7
- }[];
8
- export declare const printTunnels: (tunnels: TunnelResponse[], flags?: TableFlags) => void;
9
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/util/tunnel/common.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAS,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAEhF,eAAO,MAAM,UAAU,GAAI,SAAS,cAAc,EAAE;;;;GAMnD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,SAAS,cAAc,EAAE,EAAE,QAAO,UAAe,SAkB7E,CAAC"}
@@ -1,26 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import { ux } from '@oclif/core';
5
- import { table } from '@dxos/cli-base';
6
- export const mapTunnels = (tunnels) => {
7
- return tunnels.map((tunnel) => ({
8
- key: tunnel.name,
9
- enabled: tunnel.enabled,
10
- url: tunnel.url,
11
- }));
12
- };
13
- export const printTunnels = (tunnels, flags = {}) => {
14
- ux.stdout(table(mapTunnels(tunnels), {
15
- key: {
16
- header: 'app',
17
- },
18
- enabled: {
19
- header: 'enabled',
20
- },
21
- url: {
22
- header: 'url',
23
- },
24
- }, flags));
25
- };
26
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/util/tunnel/common.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAmB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAyB,EAAE,EAAE;IACtD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9B,GAAG,EAAE,MAAM,CAAC,IAAI;QAChB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAyB,EAAE,QAAoB,EAAE,EAAE,EAAE;IAChF,EAAE,CAAC,MAAM,CACP,KAAK,CACH,UAAU,CAAC,OAAO,CAAC,EACnB;QACE,GAAG,EAAE;YACH,MAAM,EAAE,KAAK;SACd;QACD,OAAO,EAAE;YACP,MAAM,EAAE,SAAS;SAClB;QACD,GAAG,EAAE;YACH,MAAM,EAAE,KAAK;SACd;KACF,EACD,KAAK,CACN,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './common';
2
- export * from './tunnel-rpc-peer';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/tunnel/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- export * from './common';
5
- export * from './tunnel-rpc-peer';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/tunnel/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Event } from '@dxos/async';
2
- import { type Tunnel } from '@dxos/protocols/proto/dxos/service/tunnel';
3
- export declare class TunnelRpcPeer {
4
- private readonly _url;
5
- private readonly _socket;
6
- private readonly _rpc;
7
- private readonly _connectTrigger;
8
- readonly connected: Event<void>;
9
- readonly disconnected: Event<void>;
10
- readonly error: Event<Error>;
11
- constructor(_url: string);
12
- get rpc(): Tunnel;
13
- close(): Promise<void>;
14
- }
15
- //# sourceMappingURL=tunnel-rpc-peer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tunnel-rpc-peer.d.ts","sourceRoot":"","sources":["../../../../src/util/tunnel/tunnel-rpc-peer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAW,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGxE,qBAAa,aAAa;IASZ,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmC;IACxD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,QAAQ,CAAC,SAAS,cAAe;IACjC,QAAQ,CAAC,YAAY,cAAe;IACpC,QAAQ,CAAC,KAAK,eAAsB;gBAEP,IAAI,EAAE,MAAM;IAqDzC,IAAI,GAAG,IAAI,MAAM,CAEhB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}