@gitpod/gitpod-protocol 0.1.5-to-code-reading.1 → 0.1.5-to-monitor-delete.18

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 (361) hide show
  1. package/data/gitpod-schema.json +124 -5
  2. package/lib/accounting-protocol.d.ts +18 -10
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +34 -32
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +19 -0
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js.map +1 -1
  9. package/lib/analytics.d.ts +4 -5
  10. package/lib/analytics.d.ts.map +1 -1
  11. package/lib/analytics.js.map +1 -1
  12. package/lib/attribution.d.ts +24 -0
  13. package/lib/attribution.d.ts.map +1 -0
  14. package/lib/attribution.js +54 -0
  15. package/lib/attribution.js.map +1 -0
  16. package/lib/auth.d.ts.map +1 -1
  17. package/lib/billing-mode.d.ts +45 -0
  18. package/lib/billing-mode.d.ts.map +1 -0
  19. package/lib/billing-mode.js +44 -0
  20. package/lib/billing-mode.js.map +1 -0
  21. package/lib/blocked-repositories-protocol.d.ts +13 -0
  22. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  23. package/lib/blocked-repositories-protocol.js +8 -0
  24. package/lib/blocked-repositories-protocol.js.map +1 -0
  25. package/lib/context-url.d.ts +18 -5
  26. package/lib/context-url.d.ts.map +1 -1
  27. package/lib/context-url.js +59 -6
  28. package/lib/context-url.js.map +1 -1
  29. package/lib/context-url.spec.d.ts +2 -0
  30. package/lib/context-url.spec.d.ts.map +1 -1
  31. package/lib/context-url.spec.js +40 -4
  32. package/lib/context-url.spec.js.map +1 -1
  33. package/lib/encryption/container-module.d.ts.map +1 -1
  34. package/lib/encryption/container-module.js +1 -1
  35. package/lib/encryption/container-module.js.map +1 -1
  36. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  37. package/lib/encryption/encryption-engine.js +9 -9
  38. package/lib/encryption/encryption-engine.js.map +1 -1
  39. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  40. package/lib/encryption/encryption-engine.spec.js +2 -3
  41. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  42. package/lib/encryption/encryption-service.d.ts.map +1 -1
  43. package/lib/encryption/encryption-service.js +1 -1
  44. package/lib/encryption/encryption-service.js.map +1 -1
  45. package/lib/encryption/key-provider.d.ts.map +1 -1
  46. package/lib/encryption/key-provider.js +7 -9
  47. package/lib/encryption/key-provider.js.map +1 -1
  48. package/lib/env.d.ts +0 -5
  49. package/lib/env.d.ts.map +1 -1
  50. package/lib/env.js +1 -20
  51. package/lib/env.js.map +1 -1
  52. package/lib/experiments/always-default.d.ts +8 -0
  53. package/lib/experiments/always-default.d.ts.map +1 -0
  54. package/lib/experiments/always-default.js +20 -0
  55. package/lib/experiments/always-default.js.map +1 -0
  56. package/lib/experiments/configcat-server.d.ts +10 -0
  57. package/lib/experiments/configcat-server.d.ts.map +1 -0
  58. package/lib/experiments/configcat-server.js +36 -0
  59. package/lib/experiments/configcat-server.js.map +1 -0
  60. package/lib/experiments/configcat.d.ts +21 -0
  61. package/lib/experiments/configcat.d.ts.map +1 -0
  62. package/lib/experiments/configcat.js +51 -0
  63. package/lib/experiments/configcat.js.map +1 -0
  64. package/lib/experiments/types.d.ts +22 -0
  65. package/lib/experiments/types.d.ts.map +1 -0
  66. package/lib/experiments/types.js +10 -0
  67. package/lib/experiments/types.js.map +1 -0
  68. package/lib/gitpod-file-parser.d.ts.map +1 -1
  69. package/lib/gitpod-file-parser.js +6 -6
  70. package/lib/gitpod-file-parser.js.map +1 -1
  71. package/lib/gitpod-file-parser.spec.js +42 -39
  72. package/lib/gitpod-file-parser.spec.js.map +1 -1
  73. package/lib/gitpod-service.d.ts +83 -45
  74. package/lib/gitpod-service.d.ts.map +1 -1
  75. package/lib/gitpod-service.js +52 -33
  76. package/lib/gitpod-service.js.map +1 -1
  77. package/lib/headless-workspace-log.d.ts +1 -0
  78. package/lib/headless-workspace-log.d.ts.map +1 -1
  79. package/lib/headless-workspace-log.js +2 -1
  80. package/lib/headless-workspace-log.js.map +1 -1
  81. package/lib/ide-frontend-service.d.ts +1 -1
  82. package/lib/ide-protocol.d.ts +38 -6
  83. package/lib/ide-protocol.d.ts.map +1 -1
  84. package/lib/index.d.ts +16 -15
  85. package/lib/index.d.ts.map +1 -1
  86. package/lib/index.js +2 -1
  87. package/lib/index.js.map +1 -1
  88. package/lib/installation-admin-protocol.d.ts +30 -0
  89. package/lib/installation-admin-protocol.d.ts.map +1 -0
  90. package/lib/installation-admin-protocol.js +31 -0
  91. package/lib/installation-admin-protocol.js.map +1 -0
  92. package/lib/license-protocol.d.ts +7 -0
  93. package/lib/license-protocol.d.ts.map +1 -1
  94. package/lib/license-protocol.js.map +1 -1
  95. package/lib/messaging/browser/connection.d.ts +1 -1
  96. package/lib/messaging/browser/connection.d.ts.map +1 -1
  97. package/lib/messaging/browser/connection.js +19 -19
  98. package/lib/messaging/browser/connection.js.map +1 -1
  99. package/lib/messaging/browser/window-connection.d.ts +4 -4
  100. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  101. package/lib/messaging/browser/window-connection.js +9 -6
  102. package/lib/messaging/browser/window-connection.js.map +1 -1
  103. package/lib/messaging/client-call-metrics.d.ts +2 -18
  104. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  105. package/lib/messaging/client-call-metrics.js +21 -22
  106. package/lib/messaging/client-call-metrics.js.map +1 -1
  107. package/lib/messaging/error.d.ts +8 -1
  108. package/lib/messaging/error.d.ts.map +1 -1
  109. package/lib/messaging/error.js +17 -3
  110. package/lib/messaging/error.js.map +1 -1
  111. package/lib/messaging/handler.d.ts.map +1 -1
  112. package/lib/messaging/handler.js +1 -1
  113. package/lib/messaging/node/connection.js +8 -8
  114. package/lib/messaging/node/connection.js.map +1 -1
  115. package/lib/messaging/proxy-factory.d.ts +1 -1
  116. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  117. package/lib/messaging/proxy-factory.js +7 -9
  118. package/lib/messaging/proxy-factory.js.map +1 -1
  119. package/lib/payment-protocol.d.ts.map +1 -1
  120. package/lib/payment-protocol.js +1 -1
  121. package/lib/payment-protocol.js.map +1 -1
  122. package/lib/permission.d.ts +9 -3
  123. package/lib/permission.d.ts.map +1 -1
  124. package/lib/permission.js +34 -25
  125. package/lib/permission.js.map +1 -1
  126. package/lib/plans.d.ts +4 -3
  127. package/lib/plans.d.ts.map +1 -1
  128. package/lib/plans.js +210 -171
  129. package/lib/plans.js.map +1 -1
  130. package/lib/protocol.d.ts +192 -59
  131. package/lib/protocol.d.ts.map +1 -1
  132. package/lib/protocol.js +292 -104
  133. package/lib/protocol.js.map +1 -1
  134. package/{src/theia-plugins.ts → lib/protocol.spec.d.ts} +2 -6
  135. package/lib/protocol.spec.d.ts.map +1 -0
  136. package/lib/protocol.spec.js +127 -0
  137. package/lib/protocol.spec.js.map +1 -0
  138. package/lib/snapshot-url.spec.js.map +1 -1
  139. package/lib/team-subscription-protocol.d.ts +22 -3
  140. package/lib/team-subscription-protocol.d.ts.map +1 -1
  141. package/lib/team-subscription-protocol.js +20 -5
  142. package/lib/team-subscription-protocol.js.map +1 -1
  143. package/lib/teams-projects-protocol.d.ts +29 -5
  144. package/lib/teams-projects-protocol.d.ts.map +1 -1
  145. package/lib/teams-projects-protocol.js +8 -1
  146. package/lib/teams-projects-protocol.js.map +1 -1
  147. package/lib/typings/globals.d.ts +2 -2
  148. package/lib/typings/globals.d.ts.map +1 -1
  149. package/lib/usage.d.ts +61 -0
  150. package/lib/usage.d.ts.map +1 -0
  151. package/lib/usage.js +14 -0
  152. package/lib/usage.js.map +1 -0
  153. package/lib/util/analytics.d.ts.map +1 -1
  154. package/lib/util/analytics.js +12 -3
  155. package/lib/util/analytics.js.map +1 -1
  156. package/lib/util/async-iterator.d.ts.map +1 -1
  157. package/lib/util/async-iterator.js +3 -3
  158. package/lib/util/async-iterator.js.map +1 -1
  159. package/lib/util/cancelable.js.map +1 -1
  160. package/lib/util/date-time.js +6 -6
  161. package/lib/util/date-time.js.map +1 -1
  162. package/lib/util/debug-app.d.ts +25 -0
  163. package/lib/util/debug-app.d.ts.map +1 -0
  164. package/lib/util/debug-app.js +100 -0
  165. package/lib/util/debug-app.js.map +1 -0
  166. package/lib/util/deferred.js.map +1 -1
  167. package/lib/util/disposable.d.ts.map +1 -1
  168. package/lib/util/disposable.js +2 -2
  169. package/lib/util/disposable.js.map +1 -1
  170. package/lib/util/event.d.ts.map +1 -1
  171. package/lib/util/event.js +5 -3
  172. package/lib/util/event.js.map +1 -1
  173. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  174. package/lib/util/garbage-collected-cache.js +6 -1
  175. package/lib/util/garbage-collected-cache.js.map +1 -1
  176. package/lib/util/generate-workspace-id.d.ts +5 -0
  177. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  178. package/lib/util/generate-workspace-id.js +446 -442
  179. package/lib/util/generate-workspace-id.js.map +1 -1
  180. package/lib/util/generate-workspace-id.spec.js +18 -7
  181. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  182. package/lib/util/gitpod-cookie.d.ts +1 -1
  183. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  184. package/lib/util/gitpod-cookie.js +0 -3
  185. package/lib/util/gitpod-cookie.js.map +1 -1
  186. package/lib/util/gitpod-host-url.d.ts +3 -0
  187. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  188. package/lib/util/gitpod-host-url.js +49 -29
  189. package/lib/util/gitpod-host-url.js.map +1 -1
  190. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  191. package/lib/util/gitpod-host-url.spec.js +15 -5
  192. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  193. package/lib/util/grpc.d.ts +19 -0
  194. package/lib/util/grpc.d.ts.map +1 -1
  195. package/lib/util/grpc.js +73 -1
  196. package/lib/util/grpc.js.map +1 -1
  197. package/lib/util/jaeger-client-types.d.ts.map +1 -1
  198. package/lib/util/logging.d.ts +1 -1
  199. package/lib/util/logging.d.ts.map +1 -1
  200. package/lib/util/logging.js +31 -25
  201. package/lib/util/logging.js.map +1 -1
  202. package/lib/util/logging.spec.d.ts +7 -0
  203. package/lib/util/logging.spec.d.ts.map +1 -0
  204. package/lib/util/logging.spec.js +52 -0
  205. package/lib/util/logging.spec.js.map +1 -0
  206. package/lib/util/make-link.js +5 -5
  207. package/lib/util/make-link.js.map +1 -1
  208. package/lib/util/nice-grpc.d.ts +9 -0
  209. package/lib/util/nice-grpc.d.ts.map +1 -0
  210. package/lib/util/nice-grpc.js +119 -0
  211. package/lib/util/nice-grpc.js.map +1 -0
  212. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  213. package/lib/util/parse-workspace-id.js +1 -2
  214. package/lib/util/parse-workspace-id.js.map +1 -1
  215. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  216. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  217. package/lib/util/queue.spec.js +9 -6
  218. package/lib/util/queue.spec.js.map +1 -1
  219. package/lib/util/semaphore.d.ts.map +1 -1
  220. package/lib/util/semaphore.js.map +1 -1
  221. package/lib/util/skip-if.d.ts.map +1 -1
  222. package/lib/util/skip-if.js.map +1 -1
  223. package/lib/util/timeutil.d.ts +2 -0
  224. package/lib/util/timeutil.d.ts.map +1 -1
  225. package/lib/util/timeutil.js +15 -3
  226. package/lib/util/timeutil.js.map +1 -1
  227. package/lib/util/timeutil.spec.d.ts +2 -0
  228. package/lib/util/timeutil.spec.d.ts.map +1 -1
  229. package/lib/util/timeutil.spec.js +34 -0
  230. package/lib/util/timeutil.spec.js.map +1 -1
  231. package/lib/util/tracing.d.ts +8 -8
  232. package/lib/util/tracing.d.ts.map +1 -1
  233. package/lib/util/tracing.js +19 -20
  234. package/lib/util/tracing.js.map +1 -1
  235. package/lib/util/tracing.spec.js +3 -3
  236. package/lib/util/tracing.spec.js.map +1 -1
  237. package/lib/util/workspace-port-authentication.d.ts +7 -7
  238. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  239. package/lib/util/workspace-port-authentication.js +8 -11
  240. package/lib/util/workspace-port-authentication.js.map +1 -1
  241. package/lib/webhook-event.d.ts +44 -0
  242. package/lib/webhook-event.d.ts.map +1 -0
  243. package/lib/{theia-plugins.js → webhook-event.js} +2 -2
  244. package/lib/webhook-event.js.map +1 -0
  245. package/lib/workspace-class.d.ts +14 -0
  246. package/lib/workspace-class.d.ts.map +1 -0
  247. package/lib/workspace-class.js +8 -0
  248. package/lib/workspace-class.js.map +1 -0
  249. package/lib/workspace-cluster.d.ts +18 -17
  250. package/lib/workspace-cluster.d.ts.map +1 -1
  251. package/lib/workspace-cluster.js +16 -1
  252. package/lib/workspace-cluster.js.map +1 -1
  253. package/lib/workspace-instance.d.ts +39 -3
  254. package/lib/workspace-instance.d.ts.map +1 -1
  255. package/lib/wsready.d.ts +1 -1
  256. package/lib/wsready.d.ts.map +1 -1
  257. package/lib/wsready.js +2 -2
  258. package/package.json +15 -7
  259. package/pkg-yarn.lock +11 -6
  260. package/provenance-bundle.jsonl +3 -1
  261. package/src/accounting-protocol.ts +66 -51
  262. package/src/admin-protocol.ts +45 -18
  263. package/src/analytics.ts +26 -28
  264. package/src/attribution.ts +63 -0
  265. package/src/auth.ts +2 -2
  266. package/src/billing-mode.ts +84 -0
  267. package/src/blocked-repositories-protocol.ts +13 -0
  268. package/src/context-url.spec.ts +37 -9
  269. package/src/context-url.ts +94 -36
  270. package/src/encryption/container-module.ts +2 -3
  271. package/src/encryption/encryption-engine.spec.ts +9 -8
  272. package/src/encryption/encryption-engine.ts +20 -16
  273. package/src/encryption/encryption-service.ts +4 -5
  274. package/src/encryption/key-provider.ts +16 -19
  275. package/src/env.ts +0 -22
  276. package/src/experiments/always-default.ts +24 -0
  277. package/src/experiments/configcat-server.ts +41 -0
  278. package/src/experiments/configcat.ts +56 -0
  279. package/src/experiments/types.ts +34 -0
  280. package/src/gitpod-file-parser.spec.ts +55 -61
  281. package/src/gitpod-file-parser.ts +16 -17
  282. package/src/gitpod-service.ts +228 -129
  283. package/src/headless-workspace-log.ts +6 -4
  284. package/src/ide-frontend-service.ts +2 -2
  285. package/src/ide-protocol.ts +43 -6
  286. package/src/index.ts +16 -15
  287. package/src/installation-admin-protocol.ts +45 -0
  288. package/src/license-protocol.ts +12 -6
  289. package/src/messaging/browser/connection.ts +45 -47
  290. package/src/messaging/browser/window-connection.ts +39 -29
  291. package/src/messaging/client-call-metrics.ts +62 -82
  292. package/src/messaging/error.ts +26 -7
  293. package/src/messaging/handler.ts +6 -6
  294. package/src/messaging/node/connection.ts +8 -8
  295. package/src/messaging/proxy-factory.ts +23 -30
  296. package/src/oss-allowlist.ts +3 -3
  297. package/src/payment-protocol.ts +2 -2
  298. package/src/permission.ts +40 -32
  299. package/src/plans.ts +240 -189
  300. package/src/protocol.spec.ts +97 -0
  301. package/src/protocol.ts +556 -258
  302. package/src/snapshot-url.spec.ts +9 -7
  303. package/src/team-subscription-protocol.ts +59 -22
  304. package/src/teams-projects-protocol.ts +43 -12
  305. package/src/typings/globals.ts +4 -4
  306. package/src/usage.ts +71 -0
  307. package/src/util/analytics.ts +46 -24
  308. package/src/util/async-iterator.ts +4 -5
  309. package/src/util/cancelable.ts +3 -3
  310. package/src/util/date-time.ts +8 -8
  311. package/src/util/debug-app.ts +81 -0
  312. package/src/util/deferred.ts +6 -6
  313. package/src/util/disposable.ts +3 -6
  314. package/src/util/event.ts +9 -11
  315. package/src/util/garbage-collected-cache.ts +8 -6
  316. package/src/util/generate-workspace-id.spec.ts +26 -16
  317. package/src/util/generate-workspace-id.ts +460 -454
  318. package/src/util/gitpod-cookie.ts +8 -9
  319. package/src/util/gitpod-host-url.spec.ts +40 -13
  320. package/src/util/gitpod-host-url.ts +57 -33
  321. package/src/util/grpc.ts +90 -1
  322. package/src/util/jaeger-client-types.ts +2 -2
  323. package/src/util/logging.spec.ts +23 -0
  324. package/src/util/logging.ts +60 -42
  325. package/src/util/make-link.ts +6 -7
  326. package/src/util/nice-grpc.ts +93 -0
  327. package/src/util/parse-workspace-id.spec.ts +17 -8
  328. package/src/util/parse-workspace-id.ts +5 -6
  329. package/src/util/queue.spec.ts +27 -25
  330. package/src/util/repeat.ts +1 -1
  331. package/src/util/semaphore.ts +4 -6
  332. package/src/util/skip-if.ts +9 -6
  333. package/src/util/timeutil.spec.ts +40 -14
  334. package/src/util/timeutil.ts +27 -11
  335. package/src/util/tracing.spec.ts +28 -23
  336. package/src/util/tracing.ts +58 -54
  337. package/src/util/workspace-port-authentication.ts +10 -13
  338. package/src/webhook-event.ts +55 -0
  339. package/src/workspace-class.ts +14 -0
  340. package/src/workspace-cluster.ts +34 -20
  341. package/src/workspace-instance.ts +76 -20
  342. package/src/wsready.ts +3 -3
  343. package/data/builtin-theia-plugins.json +0 -372
  344. package/lib/email-protocol.d.ts +0 -49
  345. package/lib/email-protocol.d.ts.map +0 -1
  346. package/lib/email-protocol.js +0 -28
  347. package/lib/email-protocol.js.map +0 -1
  348. package/lib/messaging/connection-error-handler.d.ts +0 -27
  349. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  350. package/lib/messaging/connection-error-handler.js +0 -34
  351. package/lib/messaging/connection-error-handler.js.map +0 -1
  352. package/lib/theia-plugins.d.ts +0 -11
  353. package/lib/theia-plugins.d.ts.map +0 -1
  354. package/lib/theia-plugins.js.map +0 -1
  355. package/lib/util/safe-promise.d.ts +0 -11
  356. package/lib/util/safe-promise.d.ts.map +0 -1
  357. package/lib/util/safe-promise.js +0 -31
  358. package/lib/util/safe-promise.js.map +0 -1
  359. package/src/email-protocol.ts +0 -66
  360. package/src/messaging/connection-error-handler.ts +0 -62
  361. package/src/util/safe-promise.ts +0 -26
@@ -4,21 +4,23 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
-
8
7
  export enum HeadlessWorkspaceEventType {
9
8
  LogOutput = "log-output",
10
9
  FinishedSuccessfully = "finish-success",
11
10
  FinishedButFailed = "finish-fail",
12
11
  AbortedTimedOut = "aborted-timeout",
13
12
  Aborted = "aborted",
14
- Started = "started"
13
+ Failed = "failed",
14
+ Started = "started",
15
15
  }
16
16
  export namespace HeadlessWorkspaceEventType {
17
17
  export function isRunning(t: HeadlessWorkspaceEventType) {
18
18
  return t === HeadlessWorkspaceEventType.LogOutput;
19
19
  }
20
20
  export function didFinish(t: HeadlessWorkspaceEventType) {
21
- return t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully;
21
+ return (
22
+ t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully
23
+ );
22
24
  }
23
25
  }
24
26
 
@@ -35,4 +37,4 @@ export interface HeadlessLogUrls {
35
37
 
36
38
  /** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
37
39
  export const HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
38
- export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
40
+ export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
@@ -7,7 +7,7 @@
7
7
  import { Event } from "./util/event";
8
8
  import { Disposable } from "./util/disposable";
9
9
 
10
- export type IDEFrontendState = 'init' | 'ready' | 'terminated';
10
+ export type IDEFrontendState = "init" | "ready" | "terminated";
11
11
 
12
12
  export interface IDEFrontendService {
13
13
  readonly state: IDEFrontendState;
@@ -25,4 +25,4 @@ export interface IDEFrontendService {
25
25
  * confirmation dialogs for stopped workspaces.
26
26
  */
27
27
  start(): Disposable;
28
- }
28
+ }
@@ -29,6 +29,28 @@ export interface IDEOptions {
29
29
  * The default desktop IDE when the user has not specified one.
30
30
  */
31
31
  defaultDesktopIde: string;
32
+
33
+ /**
34
+ * Client specific IDE options.
35
+ */
36
+ clients?: { [id: string]: IDEClient };
37
+ }
38
+
39
+ export interface IDEClient {
40
+ /**
41
+ * The default desktop IDE when the user has not specified one.
42
+ */
43
+ defaultDesktopIDE?: string;
44
+
45
+ /**
46
+ * Desktop IDEs supported by the client.
47
+ */
48
+ desktopIDEs?: string[];
49
+
50
+ /**
51
+ * Steps to install the client on user machine.
52
+ */
53
+ installationSteps?: string[];
32
54
  }
33
55
 
34
56
  export interface IDEOption {
@@ -45,12 +67,12 @@ export interface IDEOption {
45
67
  /**
46
68
  * The type of the IDE, currently 'browser' or 'desktop'.
47
69
  */
48
- type: 'browser' | 'desktop';
70
+ type: "browser" | "desktop";
49
71
 
50
72
  /**
51
- * The logo for the IDE. That could be a key in (see
52
- * components/dashboard/src/images/ideLogos.ts) or a URL.
53
- */
73
+ * The logo for the IDE. That could be a key in (see
74
+ * components/dashboard/src/images/ideLogos.ts) or a URL.
75
+ */
54
76
  logo: string;
55
77
 
56
78
  /**
@@ -71,8 +93,8 @@ export interface IDEOption {
71
93
  notes?: string[];
72
94
 
73
95
  /**
74
- * If `true` this IDE option is not visible in the IDE preferences.
75
- */
96
+ * If `true` this IDE option is not visible in the IDE preferences.
97
+ */
76
98
  hidden?: boolean;
77
99
 
78
100
  /**
@@ -80,6 +102,11 @@ export interface IDEOption {
80
102
  */
81
103
  image: string;
82
104
 
105
+ /**
106
+ * The latest image ref to the IDE image, this image ref always resolve to digest.
107
+ */
108
+ latestImage?: string;
109
+
83
110
  /**
84
111
  * When this is `true`, the tag of this image is resolved to the latest
85
112
  * image digest regularly.
@@ -89,4 +116,14 @@ export interface IDEOption {
89
116
  * we resolve the tag regularly to the most recent image version.
90
117
  */
91
118
  resolveImageDigest?: boolean;
119
+
120
+ /**
121
+ * The plugin image ref for the IDE image, this image ref always resolve to digest.
122
+ */
123
+ pluginImage?: string;
124
+
125
+ /**
126
+ * The latest plugin image ref for the latest IDE image, this image ref always resolve to digest.
127
+ */
128
+ pluginLatestImage?: string;
92
129
  }
package/src/index.ts CHANGED
@@ -4,18 +4,19 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- export * from './protocol';
8
- export * from './gitpod-service';
9
- export * from './util/disposable';
10
- export * from './util/event';
11
- export * from './util/queue';
12
- export * from './license-protocol';
13
- export * from './workspace-instance';
14
- export * from './permission';
15
- export * from './admin-protocol';
16
- export * from './email-protocol';
17
- export * from './headless-workspace-log';
18
- export * from './context-url';
19
- export * from './teams-projects-protocol';
20
- export * from './snapshot-url';
21
- export * from './oss-allowlist';
7
+ export * from "./protocol";
8
+ export * from "./gitpod-service";
9
+ export * from "./util/disposable";
10
+ export * from "./util/event";
11
+ export * from "./util/queue";
12
+ export * from "./license-protocol";
13
+ export * from "./workspace-instance";
14
+ export * from "./permission";
15
+ export * from "./admin-protocol";
16
+ export * from "./headless-workspace-log";
17
+ export * from "./context-url";
18
+ export * from "./teams-projects-protocol";
19
+ export * from "./snapshot-url";
20
+ export * from "./oss-allowlist";
21
+ export * from "./installation-admin-protocol";
22
+ export * from "./webhook-event";
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+
7
+ import { v4 as uuidv4 } from "uuid";
8
+
9
+ const InstallationAdminSettingsPrototype = {
10
+ sendTelemetry: true,
11
+ sendCustomerID: true,
12
+ };
13
+
14
+ export type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
15
+
16
+ export namespace InstallationAdminSettings {
17
+ export function fields(): (keyof InstallationAdminSettings)[] {
18
+ return Object.keys(InstallationAdminSettingsPrototype) as (keyof InstallationAdminSettings)[];
19
+ }
20
+ }
21
+
22
+ export interface InstallationAdmin {
23
+ id: string;
24
+ settings: InstallationAdminSettings;
25
+ }
26
+
27
+ export interface TelemetryData {
28
+ installationAdmin: InstallationAdmin;
29
+ totalUsers: number;
30
+ totalWorkspaces: number;
31
+ totalInstances: number;
32
+ licenseType: string;
33
+ customerID?: string;
34
+ }
35
+
36
+ export namespace InstallationAdmin {
37
+ export function createDefault(): InstallationAdmin {
38
+ return {
39
+ id: uuidv4(),
40
+ settings: {
41
+ ...InstallationAdminSettingsPrototype,
42
+ },
43
+ };
44
+ }
45
+ }
@@ -4,11 +4,10 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
-
8
7
  export interface LicenseValidationResult {
9
- valid: boolean
10
- msg?: string
11
- issue?: LicenseIssue
8
+ valid: boolean;
9
+ msg?: string;
10
+ issue?: LicenseIssue;
12
11
  }
13
12
 
14
13
  export type LicenseIssue = "seats-exhausted";
@@ -16,9 +15,15 @@ export type LicenseIssue = "seats-exhausted";
16
15
  export interface LicenseInfo {
17
16
  key: string;
18
17
  seats: number;
18
+ userCount?: number;
19
19
  valid: boolean;
20
20
  validUntil: string;
21
21
  plan?: string;
22
+ features?: string[];
23
+ enabledFeatures?: string[];
24
+ type?: string;
25
+ errorMsg?: string;
26
+ fallbackAllowed: boolean;
22
27
  }
23
28
 
24
29
  export interface GetLicenseInfoResult {
@@ -34,5 +39,6 @@ export enum LicenseFeature {
34
39
  export interface LicenseService {
35
40
  validateLicense(): Promise<LicenseValidationResult>;
36
41
  getLicenseInfo(): Promise<GetLicenseInfoResult>;
37
- licenseIncludesFeature(feature: LicenseFeature): Promise<boolean>
38
- }
42
+ adminGetLicense(): Promise<LicenseInfo>;
43
+ licenseIncludesFeature(feature: LicenseFeature): Promise<boolean>;
44
+ }
@@ -11,7 +11,7 @@ import { AbstractMessageWriter } from "vscode-jsonrpc/lib/messageWriter";
11
11
  import { AbstractMessageReader } from "vscode-jsonrpc/lib/messageReader";
12
12
  import { JsonRpcProxyFactory, JsonRpcProxy } from "../proxy-factory";
13
13
  import { ConnectionEventHandler, ConnectionHandler } from "../handler";
14
- import ReconnectingWebSocket, { Event } from 'reconnecting-websocket';
14
+ import ReconnectingWebSocket, { Event } from "reconnecting-websocket";
15
15
 
16
16
  export interface WebSocketOptions {
17
17
  onerror?: (event: Event) => void;
@@ -19,7 +19,6 @@ export interface WebSocketOptions {
19
19
  }
20
20
 
21
21
  export class WebSocketConnectionProvider {
22
-
23
22
  /**
24
23
  * Create a proxy object to remote interface of T type
25
24
  * over a web socket connection for the given path.
@@ -27,27 +26,33 @@ export class WebSocketConnectionProvider {
27
26
  * An optional target can be provided to handle
28
27
  * notifications and requests from a remote side.
29
28
  */
30
- createProxy<T extends object>(path: string | Promise<string>, target?: object, options?: WebSocketOptions): JsonRpcProxy<T> {
29
+ createProxy<T extends object>(
30
+ path: string | Promise<string>,
31
+ target?: object,
32
+ options?: WebSocketOptions,
33
+ ): JsonRpcProxy<T> {
31
34
  const factory = new JsonRpcProxyFactory<T>(target);
32
35
  const startListening = (path: string) => {
33
- const socket = this.listen({
34
- path,
35
- onConnection: c => factory.listen(c),
36
- }, {
37
- onTransportDidClose: () => factory.fireConnectionClosed(),
38
- onTransportDidOpen: () => factory.fireConnectionOpened(),
39
- },
40
- options
36
+ const socket = this.listen(
37
+ {
38
+ path,
39
+ onConnection: (c) => factory.listen(c),
40
+ },
41
+ {
42
+ onTransportDidClose: () => factory.fireConnectionClosed(),
43
+ onTransportDidOpen: () => factory.fireConnectionOpened(),
44
+ },
45
+ options,
41
46
  );
42
47
  if (options?.onListening) {
43
- options.onListening(socket as any as ReconnectingWebSocket)
48
+ options.onListening(socket as any as ReconnectingWebSocket);
44
49
  }
45
50
  };
46
51
 
47
52
  if (typeof path === "string") {
48
53
  startListening(path);
49
54
  } else {
50
- path.then(path => startListening(path));
55
+ path.then((path) => startListening(path));
51
56
  }
52
57
  return factory.createProxy();
53
58
  }
@@ -62,20 +67,15 @@ export class WebSocketConnectionProvider {
62
67
  const logger = this.createLogger();
63
68
  if (options && options.onerror) {
64
69
  const onerror = options.onerror;
65
- webSocket.addEventListener('error', (event) => {
70
+ webSocket.addEventListener("error", (event) => {
66
71
  onerror(event);
67
72
  });
68
73
  } else {
69
- webSocket.addEventListener('error', (error: Event) => {
74
+ webSocket.addEventListener("error", (error: Event) => {
70
75
  logger.error(JSON.stringify(error));
71
76
  });
72
77
  }
73
- doListen(
74
- webSocket as any as ReconnectingWebSocket,
75
- handler,
76
- eventHandler,
77
- logger,
78
- );
78
+ doListen(webSocket as any as ReconnectingWebSocket, handler, eventHandler, logger);
79
79
  return webSocket;
80
80
  }
81
81
 
@@ -93,10 +93,9 @@ export class WebSocketConnectionProvider {
93
93
  reconnectionDelayGrowFactor: 1.3,
94
94
  maxRetries: Infinity,
95
95
  debug: false,
96
- WebSocket: WebSocket
96
+ WebSocket: WebSocket,
97
97
  }) as any;
98
98
  }
99
-
100
99
  }
101
100
 
102
101
  // The following was extracted from vscode-ws-jsonrpc to make these changes:
@@ -104,7 +103,12 @@ export class WebSocketConnectionProvider {
104
103
  // - webSocket.onopen: making sure it's only ever called once so we're re-using MessageConnection
105
104
  // - WebSocketMessageWriter: buffer and re-try messages instead of throwing an error immidiately
106
105
  // - WebSocketMessageReader: don't close MessageConnection on 'socket.onclose'
107
- function doListen(resocket: ReconnectingWebSocket, handler: ConnectionHandler, eventHandler: ConnectionEventHandler, logger: Logger) {
106
+ function doListen(
107
+ resocket: ReconnectingWebSocket,
108
+ handler: ConnectionHandler,
109
+ eventHandler: ConnectionEventHandler,
110
+ logger: Logger,
111
+ ) {
108
112
  resocket.addEventListener("close", () => eventHandler.onTransportDidClose());
109
113
 
110
114
  let alreadyOpened = false;
@@ -169,7 +173,7 @@ class BufferingWebSocketMessageWriter extends AbstractMessageWriter {
169
173
 
170
174
  protected flushBuffer() {
171
175
  if (this.buffer.length === 0) {
172
- return
176
+ return;
173
177
  }
174
178
 
175
179
  const buffer = [...this.buffer];
@@ -186,26 +190,25 @@ class BufferingWebSocketMessageWriter extends AbstractMessageWriter {
186
190
  }
187
191
  }
188
192
 
189
-
190
193
  /**
191
194
  * This takes vscode-ws-jsonrpc/lib/socket/reader/WebSocketMessageReader and removes the "onClose -> fireClose" connection
192
195
  */
193
196
  class NonClosingWebSocketMessageReader extends AbstractMessageReader {
194
197
  protected readonly socket: IWebSocket;
195
198
  protected readonly events: any[] = [];
196
- protected state: 'initial' | 'listening' | 'closed' = 'initial';
199
+ protected state: "initial" | "listening" | "closed" = "initial";
197
200
  protected callback: (message: any) => void = () => {};
198
201
 
199
202
  constructor(socket: IWebSocket) {
200
203
  super();
201
204
  this.socket = socket;
202
- this.socket.onMessage(message => this.readMessage(message));
203
- this.socket.onError(error => this.fireError(error));
205
+ this.socket.onMessage((message) => this.readMessage(message));
206
+ this.socket.onError((error) => this.fireError(error));
204
207
  this.socket.onClose((code, reason) => {
205
208
  if (code !== 1000) {
206
209
  const error = {
207
- name: '' + code,
208
- message: `Error during socket reconnect: code = ${code}, reason = ${reason}`
210
+ name: "" + code,
211
+ message: `Error during socket reconnect: code = ${code}, reason = ${reason}`,
209
212
  };
210
213
  this.fireError(error);
211
214
  }
@@ -213,47 +216,42 @@ class NonClosingWebSocketMessageReader extends AbstractMessageReader {
213
216
  });
214
217
  }
215
218
  listen(callback: (message: any) => void) {
216
- if (this.state === 'initial') {
217
- this.state = 'listening';
219
+ if (this.state === "initial") {
220
+ this.state = "listening";
218
221
  this.callback = callback;
219
222
  while (this.events.length !== 0) {
220
223
  const event = this.events.pop();
221
224
  if (event.message) {
222
225
  this.readMessage(event.message);
223
- }
224
- else if (event.error) {
226
+ } else if (event.error) {
225
227
  this.fireError(event.error);
226
- }
227
- else {
228
+ } else {
228
229
  this.fireClose();
229
230
  }
230
231
  }
231
232
  }
232
233
  }
233
234
  readMessage(message: any) {
234
- if (this.state === 'initial') {
235
+ if (this.state === "initial") {
235
236
  this.events.splice(0, 0, { message });
236
- }
237
- else if (this.state === 'listening') {
237
+ } else if (this.state === "listening") {
238
238
  const data = JSON.parse(message);
239
239
  this.callback(data);
240
240
  }
241
241
  }
242
242
  fireError(error: any) {
243
- if (this.state === 'initial') {
243
+ if (this.state === "initial") {
244
244
  this.events.splice(0, 0, { error });
245
- }
246
- else if (this.state === 'listening') {
245
+ } else if (this.state === "listening") {
247
246
  super.fireError(error);
248
247
  }
249
248
  }
250
249
  fireClose() {
251
- if (this.state === 'initial') {
250
+ if (this.state === "initial") {
252
251
  this.events.splice(0, 0, {});
253
- }
254
- else if (this.state === 'listening') {
252
+ } else if (this.state === "listening") {
255
253
  super.fireClose();
256
254
  }
257
- this.state = 'closed';
255
+ this.state = "closed";
258
256
  }
259
257
  }
@@ -4,23 +4,27 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import { Message } from 'vscode-jsonrpc/lib/messages';
8
- import { AbstractMessageWriter, MessageWriter } from 'vscode-jsonrpc/lib/messageWriter';
9
- import { AbstractMessageReader, MessageReader, DataCallback } from 'vscode-jsonrpc/lib/messageReader';
10
- import { MessageConnection, createMessageConnection } from 'vscode-jsonrpc/lib/main';
11
- import { ConsoleLogger } from 'vscode-ws-jsonrpc';
7
+ import { Message } from "vscode-jsonrpc/lib/messages";
8
+ import { AbstractMessageWriter, MessageWriter } from "vscode-jsonrpc/lib/messageWriter";
9
+ import { AbstractMessageReader, MessageReader, DataCallback } from "vscode-jsonrpc/lib/messageReader";
10
+ import { MessageConnection, createMessageConnection } from "vscode-jsonrpc/lib/main";
11
+ import { ConsoleLogger } from "vscode-ws-jsonrpc";
12
12
 
13
13
  interface WindowMessage extends Message {
14
- serviceId: string
14
+ serviceId: string;
15
15
  }
16
16
  function isWindowMessage(value: any): value is WindowMessage {
17
- return !!value && typeof value === 'object' &&
18
- ('jsonrpc' in value && typeof value['jsonrpc'] === 'string') &&
19
- ('serviceId' in value && typeof value['serviceId'] === 'string');
17
+ return (
18
+ !!value &&
19
+ typeof value === "object" &&
20
+ "jsonrpc" in value &&
21
+ typeof value["jsonrpc"] === "string" &&
22
+ "serviceId" in value &&
23
+ typeof value["serviceId"] === "string"
24
+ );
20
25
  }
21
26
 
22
27
  export class WindowMessageWriter extends AbstractMessageWriter implements MessageWriter {
23
-
24
28
  constructor(readonly serviceId: string, readonly window: Window, readonly targetOrigin: string) {
25
29
  super();
26
30
  }
@@ -29,44 +33,50 @@ export class WindowMessageWriter extends AbstractMessageWriter implements Messag
29
33
  const { serviceId } = this;
30
34
  this.window.postMessage(Object.assign(msg, { serviceId }), this.targetOrigin);
31
35
  }
32
-
33
36
  }
34
37
 
35
38
  export class WindowMessageReader extends AbstractMessageReader implements MessageReader {
36
-
37
39
  protected callback?: DataCallback;
38
40
  protected readonly buffer: Message[] = [];
39
41
 
40
42
  constructor(readonly serviceId: string, readonly sourceOrigin: string) {
41
43
  super();
42
- window.addEventListener('message', event => {
43
- if (this.sourceOrigin !== '*' && event.origin !== this.sourceOrigin) {
44
- return;
45
- }
46
- if (!isWindowMessage(event.data) || event.data.serviceId !== this.serviceId) {
47
- return;
48
- }
49
- if (this.callback) {
50
- this.callback(event.data);
51
- } else {
52
- this.buffer.push(event.data);
53
- }
54
- }, false);
44
+ window.addEventListener(
45
+ "message",
46
+ (event) => {
47
+ if (this.sourceOrigin !== "*" && event.origin !== this.sourceOrigin) {
48
+ return;
49
+ }
50
+ if (!isWindowMessage(event.data) || event.data.serviceId !== this.serviceId) {
51
+ return;
52
+ }
53
+ if (this.callback) {
54
+ this.callback(event.data);
55
+ } else {
56
+ this.buffer.push(event.data);
57
+ }
58
+ },
59
+ false,
60
+ );
55
61
  }
56
62
 
57
63
  listen(callback: DataCallback): void {
58
64
  let message;
59
- while (message = this.buffer.pop()) {
65
+ while ((message = this.buffer.pop())) {
60
66
  callback(message);
61
67
  }
62
68
  Object.freeze(this.buffer);
63
69
  this.callback = callback;
64
70
  }
65
-
66
71
  }
67
72
 
68
- export function createWindowMessageConnection(serviceId: string, window: Window, sourceOrigin: string, targetOrigin = sourceOrigin): MessageConnection {
73
+ export function createWindowMessageConnection(
74
+ serviceId: string,
75
+ window: Window,
76
+ sourceOrigin: string,
77
+ targetOrigin = sourceOrigin,
78
+ ): MessageConnection {
69
79
  const reader = new WindowMessageReader(serviceId, sourceOrigin);
70
80
  const writer = new WindowMessageWriter(serviceId, window, targetOrigin);
71
81
  return createMessageConnection(reader, writer, new ConsoleLogger());
72
- }
82
+ }