@gitpod/gitpod-protocol 0.1.5-ps-commit-email-fork.0 → 0.1.5-release-2022.6.1.0

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 (375) hide show
  1. package/data/gitpod-schema.json +206 -28
  2. package/lib/accounting-protocol.d.ts +17 -13
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +39 -47
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +21 -4
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +2 -13
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +44 -0
  11. package/lib/analytics.d.ts.map +1 -0
  12. package/lib/analytics.js +10 -0
  13. package/lib/analytics.js.map +1 -0
  14. package/lib/auth.d.ts.map +1 -1
  15. package/lib/context-url.d.ts +31 -0
  16. package/lib/context-url.d.ts.map +1 -0
  17. package/lib/context-url.js +102 -0
  18. package/lib/context-url.js.map +1 -0
  19. package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +4 -0
  20. package/lib/context-url.spec.d.ts.map +1 -0
  21. package/lib/context-url.spec.js +109 -0
  22. package/lib/context-url.spec.js.map +1 -0
  23. package/lib/email-protocol.d.ts +1 -2
  24. package/lib/email-protocol.d.ts.map +1 -1
  25. package/lib/email-protocol.js +4 -4
  26. package/lib/email-protocol.js.map +1 -1
  27. package/lib/encryption/container-module.d.ts.map +1 -1
  28. package/lib/encryption/container-module.js +4 -4
  29. package/lib/encryption/container-module.js.map +1 -1
  30. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  31. package/lib/encryption/encryption-engine.js +25 -26
  32. package/lib/encryption/encryption-engine.js.map +1 -1
  33. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  34. package/lib/encryption/encryption-engine.spec.js +29 -37
  35. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  36. package/lib/encryption/encryption-service.d.ts.map +1 -1
  37. package/lib/encryption/encryption-service.js +30 -44
  38. package/lib/encryption/encryption-service.js.map +1 -1
  39. package/lib/encryption/key-provider.d.ts.map +1 -1
  40. package/lib/encryption/key-provider.js +31 -38
  41. package/lib/encryption/key-provider.js.map +1 -1
  42. package/lib/env.d.ts +0 -6
  43. package/lib/env.d.ts.map +1 -1
  44. package/lib/env.js +7 -27
  45. package/lib/env.js.map +1 -1
  46. package/lib/experiments/always-default.d.ts +8 -0
  47. package/lib/experiments/always-default.d.ts.map +1 -0
  48. package/lib/experiments/always-default.js +20 -0
  49. package/lib/experiments/always-default.js.map +1 -0
  50. package/lib/experiments/configcat-server.d.ts +8 -0
  51. package/lib/experiments/configcat-server.d.ts.map +1 -0
  52. package/lib/experiments/configcat-server.js +34 -0
  53. package/lib/experiments/configcat-server.js.map +1 -0
  54. package/lib/experiments/configcat.d.ts +21 -0
  55. package/lib/experiments/configcat.d.ts.map +1 -0
  56. package/lib/experiments/configcat.js +47 -0
  57. package/lib/experiments/configcat.js.map +1 -0
  58. package/lib/experiments/types.d.ts +19 -0
  59. package/lib/experiments/types.d.ts.map +1 -0
  60. package/lib/{util/without.js → experiments/types.js} +2 -2
  61. package/lib/experiments/types.js.map +1 -0
  62. package/lib/gitpod-file-parser.d.ts.map +1 -1
  63. package/lib/gitpod-file-parser.js +26 -42
  64. package/lib/gitpod-file-parser.js.map +1 -1
  65. package/lib/gitpod-file-parser.spec.js +145 -142
  66. package/lib/gitpod-file-parser.spec.js.map +1 -1
  67. package/lib/gitpod-service.d.ts +140 -38
  68. package/lib/gitpod-service.d.ts.map +1 -1
  69. package/lib/gitpod-service.js +181 -317
  70. package/lib/gitpod-service.js.map +1 -1
  71. package/lib/headless-workspace-log.d.ts +9 -11
  72. package/lib/headless-workspace-log.d.ts.map +1 -1
  73. package/lib/headless-workspace-log.js +6 -8
  74. package/lib/headless-workspace-log.js.map +1 -1
  75. package/lib/ide-frontend-service.d.ts +1 -1
  76. package/lib/ide-protocol.d.ts +105 -0
  77. package/lib/ide-protocol.d.ts.map +1 -0
  78. package/lib/ide-protocol.js +8 -0
  79. package/lib/ide-protocol.js.map +1 -0
  80. package/lib/index.d.ts +16 -10
  81. package/lib/index.d.ts.map +1 -1
  82. package/lib/index.js +6 -0
  83. package/lib/index.js.map +1 -1
  84. package/lib/installation-admin-protocol.d.ts +30 -0
  85. package/lib/installation-admin-protocol.d.ts.map +1 -0
  86. package/lib/installation-admin-protocol.js +31 -0
  87. package/lib/installation-admin-protocol.js.map +1 -0
  88. package/lib/license-protocol.d.ts +7 -0
  89. package/lib/license-protocol.d.ts.map +1 -1
  90. package/lib/license-protocol.js.map +1 -1
  91. package/lib/messaging/browser/connection.d.ts +3 -3
  92. package/lib/messaging/browser/connection.d.ts.map +1 -1
  93. package/lib/messaging/browser/connection.js +173 -36
  94. package/lib/messaging/browser/connection.js.map +1 -1
  95. package/lib/messaging/browser/window-connection.d.ts +4 -4
  96. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  97. package/lib/messaging/browser/window-connection.js +42 -59
  98. package/lib/messaging/browser/window-connection.js.map +1 -1
  99. package/lib/messaging/client-call-metrics.d.ts +35 -0
  100. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  101. package/lib/messaging/client-call-metrics.js +83 -0
  102. package/lib/messaging/client-call-metrics.js.map +1 -0
  103. package/lib/messaging/error.d.ts +5 -1
  104. package/lib/messaging/error.d.ts.map +1 -1
  105. package/lib/messaging/error.js +10 -2
  106. package/lib/messaging/error.js.map +1 -1
  107. package/lib/messaging/handler.d.ts +10 -0
  108. package/lib/messaging/handler.d.ts.map +1 -1
  109. package/lib/messaging/handler.js +1 -1
  110. package/lib/messaging/node/connection.d.ts +1 -17
  111. package/lib/messaging/node/connection.d.ts.map +1 -1
  112. package/lib/messaging/node/connection.js +24 -60
  113. package/lib/messaging/node/connection.js.map +1 -1
  114. package/lib/messaging/proxy-factory.d.ts +3 -1
  115. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  116. package/lib/messaging/proxy-factory.js +75 -162
  117. package/lib/messaging/proxy-factory.js.map +1 -1
  118. package/lib/oss-allowlist.d.ts +14 -0
  119. package/lib/oss-allowlist.d.ts.map +1 -0
  120. package/lib/oss-allowlist.js +8 -0
  121. package/lib/oss-allowlist.js.map +1 -0
  122. package/lib/payment-protocol.d.ts.map +1 -1
  123. package/lib/payment-protocol.js +1 -1
  124. package/lib/payment-protocol.js.map +1 -1
  125. package/lib/permission.d.ts +10 -3
  126. package/lib/permission.d.ts.map +1 -1
  127. package/lib/permission.js +41 -31
  128. package/lib/permission.js.map +1 -1
  129. package/lib/plans.d.ts +4 -4
  130. package/lib/plans.d.ts.map +1 -1
  131. package/lib/plans.js +225 -209
  132. package/lib/plans.js.map +1 -1
  133. package/lib/protocol.d.ts +172 -85
  134. package/lib/protocol.d.ts.map +1 -1
  135. package/lib/protocol.js +230 -187
  136. package/lib/protocol.js.map +1 -1
  137. package/lib/snapshot-url.d.ts +14 -0
  138. package/lib/snapshot-url.d.ts.map +1 -0
  139. package/lib/snapshot-url.js +26 -0
  140. package/lib/snapshot-url.js.map +1 -0
  141. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  142. package/lib/snapshot-url.spec.d.ts.map +1 -0
  143. package/lib/snapshot-url.spec.js +41 -0
  144. package/lib/snapshot-url.spec.js.map +1 -0
  145. package/lib/team-subscription-protocol.d.ts +22 -4
  146. package/lib/team-subscription-protocol.d.ts.map +1 -1
  147. package/lib/team-subscription-protocol.js +31 -17
  148. package/lib/team-subscription-protocol.js.map +1 -1
  149. package/lib/teams-projects-protocol.d.ts +118 -0
  150. package/lib/teams-projects-protocol.d.ts.map +1 -0
  151. package/lib/teams-projects-protocol.js +30 -0
  152. package/lib/teams-projects-protocol.js.map +1 -0
  153. package/lib/typings/globals.d.ts +2 -2
  154. package/lib/typings/globals.d.ts.map +1 -1
  155. package/lib/util/analytics.d.ts +8 -0
  156. package/lib/util/analytics.d.ts.map +1 -0
  157. package/lib/util/analytics.js +88 -0
  158. package/lib/util/analytics.js.map +1 -0
  159. package/lib/util/async-iterator.d.ts.map +1 -1
  160. package/lib/util/async-iterator.js +57 -135
  161. package/lib/util/async-iterator.js.map +1 -1
  162. package/lib/util/cancelable.js +17 -59
  163. package/lib/util/cancelable.js.map +1 -1
  164. package/lib/util/date-time.js +11 -11
  165. package/lib/util/date-time.js.map +1 -1
  166. package/lib/util/debug-app.d.ts +25 -0
  167. package/lib/util/debug-app.d.ts.map +1 -0
  168. package/lib/util/debug-app.js +100 -0
  169. package/lib/util/debug-app.js.map +1 -0
  170. package/lib/util/deferred.js +10 -12
  171. package/lib/util/deferred.js.map +1 -1
  172. package/lib/util/disposable.d.ts.map +1 -1
  173. package/lib/util/disposable.js +27 -40
  174. package/lib/util/disposable.js.map +1 -1
  175. package/lib/util/event.d.ts.map +1 -1
  176. package/lib/util/event.js +63 -77
  177. package/lib/util/event.js.map +1 -1
  178. package/lib/util/garbage-collected-cache.d.ts +1 -0
  179. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  180. package/lib/util/garbage-collected-cache.js +27 -47
  181. package/lib/util/garbage-collected-cache.js.map +1 -1
  182. package/lib/util/generate-workspace-id.d.ts +6 -1
  183. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  184. package/lib/util/generate-workspace-id.js +469 -502
  185. package/lib/util/generate-workspace-id.js.map +1 -1
  186. package/lib/util/generate-workspace-id.spec.js +68 -78
  187. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  188. package/lib/util/gitpod-cookie.d.ts +20 -0
  189. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  190. package/lib/util/gitpod-cookie.js +41 -0
  191. package/lib/util/gitpod-cookie.js.map +1 -0
  192. package/lib/util/gitpod-host-url.d.ts +1 -2
  193. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  194. package/lib/util/gitpod-host-url.js +108 -109
  195. package/lib/util/gitpod-host-url.js.map +1 -1
  196. package/lib/util/gitpod-host-url.spec.d.ts +6 -0
  197. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  198. package/lib/util/gitpod-host-url.spec.js +112 -30
  199. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  200. package/lib/util/grpc.d.ts +15 -0
  201. package/lib/util/grpc.d.ts.map +1 -0
  202. package/lib/util/grpc.js +18 -0
  203. package/lib/util/grpc.js.map +1 -0
  204. package/lib/util/jaeger-client-types.d.ts +68 -0
  205. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  206. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
  207. package/lib/util/jaeger-client-types.js.map +1 -0
  208. package/lib/util/logging.d.ts +49 -33
  209. package/lib/util/logging.d.ts.map +1 -1
  210. package/lib/util/logging.js +125 -129
  211. package/lib/util/logging.js.map +1 -1
  212. package/lib/util/make-link.js +5 -5
  213. package/lib/util/make-link.js.map +1 -1
  214. package/lib/util/parse-workspace-id.d.ts +10 -0
  215. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  216. package/lib/util/parse-workspace-id.js +30 -7
  217. package/lib/util/parse-workspace-id.js.map +1 -1
  218. package/lib/util/parse-workspace-id.spec.d.ts +4 -0
  219. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  220. package/lib/util/parse-workspace-id.spec.js +123 -84
  221. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  222. package/lib/util/queue.js +16 -55
  223. package/lib/util/queue.js.map +1 -1
  224. package/lib/util/queue.spec.js +147 -288
  225. package/lib/util/queue.spec.js.map +1 -1
  226. package/lib/util/repeat.d.ts +15 -0
  227. package/lib/util/repeat.d.ts.map +1 -0
  228. package/lib/util/repeat.js +55 -0
  229. package/lib/util/repeat.js.map +1 -0
  230. package/lib/util/semaphore.d.ts.map +1 -1
  231. package/lib/util/semaphore.js +15 -46
  232. package/lib/util/semaphore.js.map +1 -1
  233. package/lib/util/skip-if.d.ts.map +1 -1
  234. package/lib/util/skip-if.js +6 -6
  235. package/lib/util/skip-if.js.map +1 -1
  236. package/lib/util/timeutil.d.ts +1 -0
  237. package/lib/util/timeutil.d.ts.map +1 -1
  238. package/lib/util/timeutil.js +23 -17
  239. package/lib/util/timeutil.js.map +1 -1
  240. package/lib/util/timeutil.spec.d.ts.map +1 -1
  241. package/lib/util/timeutil.spec.js +21 -24
  242. package/lib/util/timeutil.spec.js.map +1 -1
  243. package/lib/util/tracing.d.ts +52 -6
  244. package/lib/util/tracing.d.ts.map +1 -1
  245. package/lib/util/tracing.js +197 -64
  246. package/lib/util/tracing.js.map +1 -1
  247. package/lib/util/tracing.spec.d.ts +7 -0
  248. package/lib/util/tracing.spec.d.ts.map +1 -0
  249. package/lib/util/tracing.spec.js +121 -0
  250. package/lib/util/tracing.spec.js.map +1 -0
  251. package/lib/util/workspace-port-authentication.d.ts +7 -7
  252. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  253. package/lib/util/workspace-port-authentication.js +9 -12
  254. package/lib/util/workspace-port-authentication.js.map +1 -1
  255. package/lib/workspace-cluster.d.ts +24 -3
  256. package/lib/workspace-cluster.d.ts.map +1 -1
  257. package/lib/workspace-cluster.js +19 -4
  258. package/lib/workspace-cluster.js.map +1 -1
  259. package/lib/workspace-instance.d.ts +42 -5
  260. package/lib/workspace-instance.d.ts.map +1 -1
  261. package/lib/wsready.d.ts +1 -1
  262. package/lib/wsready.d.ts.map +1 -1
  263. package/lib/wsready.js +2 -2
  264. package/lib/wsready.js.map +1 -1
  265. package/package.json +35 -18
  266. package/pkg-yarn.lock +20 -10
  267. package/provenance-bundle.jsonl +2 -0
  268. package/src/accounting-protocol.ts +63 -57
  269. package/src/admin-protocol.ts +43 -21
  270. package/src/analytics.ts +52 -0
  271. package/src/auth.ts +2 -2
  272. package/src/context-url.spec.ts +67 -0
  273. package/src/context-url.ts +109 -0
  274. package/src/email-protocol.ts +5 -7
  275. package/src/encryption/container-module.ts +2 -3
  276. package/src/encryption/encryption-engine.spec.ts +9 -8
  277. package/src/encryption/encryption-engine.ts +14 -14
  278. package/src/encryption/encryption-service.ts +4 -5
  279. package/src/encryption/key-provider.ts +16 -19
  280. package/src/env.ts +0 -22
  281. package/src/experiments/always-default.ts +24 -0
  282. package/src/experiments/configcat-server.ts +37 -0
  283. package/src/experiments/configcat.ts +53 -0
  284. package/src/experiments/types.ts +32 -0
  285. package/src/gitpod-file-parser.spec.ts +55 -61
  286. package/src/gitpod-file-parser.ts +16 -17
  287. package/src/gitpod-service.ts +278 -127
  288. package/src/headless-workspace-log.ts +12 -14
  289. package/src/ide-frontend-service.ts +2 -2
  290. package/src/ide-protocol.ts +119 -0
  291. package/src/index.ts +16 -10
  292. package/src/installation-admin-protocol.ts +45 -0
  293. package/src/license-protocol.ts +12 -6
  294. package/src/messaging/browser/connection.ts +185 -21
  295. package/src/messaging/browser/window-connection.ts +39 -29
  296. package/src/messaging/client-call-metrics.ts +96 -0
  297. package/src/messaging/error.ts +15 -5
  298. package/src/messaging/handler.ts +13 -1
  299. package/src/messaging/node/connection.ts +23 -70
  300. package/src/messaging/proxy-factory.ts +35 -34
  301. package/src/oss-allowlist.ts +15 -0
  302. package/src/payment-protocol.ts +2 -2
  303. package/src/permission.ts +42 -33
  304. package/src/plans.ts +236 -189
  305. package/src/protocol.ts +454 -276
  306. package/src/snapshot-url.spec.ts +27 -0
  307. package/src/snapshot-url.ts +27 -0
  308. package/src/team-subscription-protocol.ts +59 -23
  309. package/src/teams-projects-protocol.ts +153 -0
  310. package/src/typings/globals.ts +4 -4
  311. package/src/util/analytics.ts +109 -0
  312. package/src/util/async-iterator.ts +4 -5
  313. package/src/util/cancelable.ts +3 -3
  314. package/src/util/date-time.ts +8 -8
  315. package/src/util/debug-app.ts +81 -0
  316. package/src/util/deferred.ts +6 -6
  317. package/src/util/disposable.ts +3 -6
  318. package/src/util/event.ts +9 -11
  319. package/src/util/garbage-collected-cache.ts +9 -6
  320. package/src/util/generate-workspace-id.spec.ts +37 -10
  321. package/src/util/generate-workspace-id.ts +464 -438
  322. package/src/util/gitpod-cookie.ts +38 -0
  323. package/src/util/gitpod-host-url.spec.ts +58 -7
  324. package/src/util/gitpod-host-url.ts +52 -40
  325. package/src/util/grpc.ts +15 -0
  326. package/src/util/jaeger-client-types.ts +102 -0
  327. package/src/util/logging.ts +145 -72
  328. package/src/util/make-link.ts +6 -7
  329. package/src/util/parse-workspace-id.spec.ts +37 -8
  330. package/src/util/parse-workspace-id.ts +32 -7
  331. package/src/util/queue.spec.ts +27 -25
  332. package/src/util/repeat.ts +45 -0
  333. package/src/util/semaphore.ts +4 -6
  334. package/src/util/skip-if.ts +9 -6
  335. package/src/util/timeutil.spec.ts +14 -15
  336. package/src/util/timeutil.ts +21 -11
  337. package/src/util/tracing.spec.ts +88 -0
  338. package/src/util/tracing.ts +200 -31
  339. package/src/util/workspace-port-authentication.ts +10 -13
  340. package/src/workspace-cluster.ts +34 -7
  341. package/src/workspace-instance.ts +91 -31
  342. package/src/wsready.ts +3 -3
  343. package/data/builtin-theia-plugins.json +0 -372
  344. package/lib/messaging/connection-error-handler.d.ts +0 -27
  345. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  346. package/lib/messaging/connection-error-handler.js +0 -46
  347. package/lib/messaging/connection-error-handler.js.map +0 -1
  348. package/lib/theia-plugins.d.ts +0 -11
  349. package/lib/theia-plugins.d.ts.map +0 -1
  350. package/lib/theia-plugins.js.map +0 -1
  351. package/lib/util/context-url.d.ts +0 -13
  352. package/lib/util/context-url.d.ts.map +0 -1
  353. package/lib/util/context-url.js +0 -26
  354. package/lib/util/context-url.js.map +0 -1
  355. package/lib/util/context-url.spec.d.ts.map +0 -1
  356. package/lib/util/context-url.spec.js +0 -52
  357. package/lib/util/context-url.spec.js.map +0 -1
  358. package/lib/util/repeater.d.ts +0 -22
  359. package/lib/util/repeater.d.ts.map +0 -1
  360. package/lib/util/repeater.js +0 -118
  361. package/lib/util/repeater.js.map +0 -1
  362. package/lib/util/safe-promise.d.ts +0 -11
  363. package/lib/util/safe-promise.d.ts.map +0 -1
  364. package/lib/util/safe-promise.js +0 -34
  365. package/lib/util/safe-promise.js.map +0 -1
  366. package/lib/util/without.d.ts +0 -7
  367. package/lib/util/without.d.ts.map +0 -1
  368. package/lib/util/without.js.map +0 -1
  369. package/src/messaging/connection-error-handler.ts +0 -62
  370. package/src/theia-plugins.ts +0 -11
  371. package/src/util/context-url.spec.ts +0 -25
  372. package/src/util/context-url.ts +0 -23
  373. package/src/util/jaeger-client.d.ts +0 -105
  374. package/src/util/repeater.ts +0 -49
  375. package/src/util/safe-promise.ts +0 -26
@@ -4,10 +4,10 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import * as fs from 'fs';
8
- import { filePathTelepresenceAware } from './env';
7
+ import * as fs from "fs";
8
+ import { filePathTelepresenceAware } from "./env";
9
9
  import { DeepPartial } from "./util/deep-partial";
10
- import { Without } from './util/without';
10
+ import { PermissionName } from "./permission";
11
11
 
12
12
  export interface WorkspaceCluster {
13
13
  // Name of the workspace cluster.
@@ -32,7 +32,11 @@ export interface WorkspaceCluster {
32
32
 
33
33
  // True if this bridge should control this cluster
34
34
  govern: boolean;
35
+
36
+ // An optional set of constraints that limit who can start workspaces on the cluster
37
+ admissionConstraints?: AdmissionConstraint[];
35
38
  }
39
+
36
40
  export type WorkspaceClusterState = "available" | "cordoned" | "draining";
37
41
  export interface TLSConfig {
38
42
  // the CA shared between client and server (base64 encoded)
@@ -43,11 +47,34 @@ export interface TLSConfig {
43
47
  crt: string;
44
48
  }
45
49
  export namespace TLSConfig {
46
- export const loadFromBase64File = (path: string): string => fs.readFileSync(filePathTelepresenceAware(path)).toString("base64");
50
+ export const loadFromBase64File = (path: string): string =>
51
+ fs.readFileSync(filePathTelepresenceAware(path)).toString("base64");
47
52
  }
48
- export type WorkspaceClusterWoTls = Without<WorkspaceCluster, "tls">;
53
+ export type WorkspaceClusterWoTLS = Omit<WorkspaceCluster, "tls">;
49
54
  export type WorkspaceManagerConnectionInfo = Pick<WorkspaceCluster, "name" | "url" | "tls">;
50
55
 
56
+ export type AdmissionConstraint =
57
+ | AdmissionConstraintFeaturePreview
58
+ | AdmissionConstraintHasPermission
59
+ | AdmissionConstraintHasUserLevel
60
+ | AdmissionConstraintHasMoreResources;
61
+ export type AdmissionConstraintFeaturePreview = { type: "has-feature-preview" };
62
+ export type AdmissionConstraintHasPermission = { type: "has-permission"; permission: PermissionName };
63
+ export type AdmissionConstraintHasUserLevel = { type: "has-user-level"; level: string };
64
+ export type AdmissionConstraintHasMoreResources = { type: "has-more-resources" };
65
+
66
+ export namespace AdmissionConstraint {
67
+ export function is(o: any): o is AdmissionConstraint {
68
+ return !!o && "type" in o;
69
+ }
70
+ export function isHasPermissionConstraint(o: any): o is AdmissionConstraintHasPermission {
71
+ return is(o) && o.type === "has-permission";
72
+ }
73
+ export function hasPermission(ac: AdmissionConstraint, permission: PermissionName): boolean {
74
+ return isHasPermissionConstraint(ac) && ac.permission === permission;
75
+ }
76
+ }
77
+
51
78
  export const WorkspaceClusterDB = Symbol("WorkspaceClusterDB");
52
79
  export interface WorkspaceClusterDB {
53
80
  /**
@@ -73,8 +100,8 @@ export interface WorkspaceClusterDB {
73
100
  * Lists all WorkspaceClusterWoTls for which the given predicate is true (does not return TLS for size/speed concerns)
74
101
  * @param predicate
75
102
  */
76
- findFiltered(predicate: DeepPartial<WorkspaceClusterFilter>): Promise<WorkspaceClusterWoTls[]>;
103
+ findFiltered(predicate: DeepPartial<WorkspaceClusterFilter>): Promise<WorkspaceClusterWoTLS[]>;
77
104
  }
78
105
  export interface WorkspaceClusterFilter extends Pick<WorkspaceCluster, "state" | "govern" | "url"> {
79
106
  minScore: number;
80
- }
107
+ }
@@ -23,16 +23,22 @@ export interface WorkspaceInstance {
23
23
  // The time an instance has switched phase to 'Running'
24
24
  startedTime?: string;
25
25
 
26
+ // The time an instance has switched phase to 'Stopping' */
27
+ stoppingTime?: string;
28
+
26
29
  // The time an instance has switched phase to 'Stopped' */
27
30
  stoppedTime?: string;
28
31
 
29
32
  // ideUrl is the URL at which the workspace is available on the internet
33
+ // Note: this is nitially empty, filled during starting process!
30
34
  ideUrl: string;
31
35
 
32
36
  // region is the name of the workspace cluster this instance runs in
37
+ // Note: this is nitially empty, filled during starting process!
33
38
  region: string;
34
39
 
35
40
  // workspaceImage is the name of the Docker image this instance runs
41
+ // Note: this is nitially empty, filled during starting process!
36
42
  workspaceImage: string;
37
43
 
38
44
  // status is the latest status of the instance that we're aware of
@@ -45,6 +51,23 @@ export interface WorkspaceInstance {
45
51
 
46
52
  // instance is hard-deleted on the database and about to be collected by db-sync
47
53
  readonly deleted?: boolean;
54
+
55
+ /**
56
+ * Contains information about the image build, if there was any
57
+ */
58
+ imageBuildInfo?: ImageBuildInfo;
59
+
60
+ /**
61
+ * workspace class, also known as workspace size, determines the type of
62
+ * resources that are provided to the workspace.
63
+ */
64
+ workspaceClass?: string;
65
+
66
+ /**
67
+ * Identifies the team or user to which this instance's runtime should be attributed to
68
+ * (e.g. for usage analytics or billing purposes).
69
+ */
70
+ usageAttributionId?: string;
48
71
  }
49
72
 
50
73
  // WorkspaceInstanceStatus describes the current state of a workspace instance
@@ -83,53 +106,55 @@ export interface WorkspaceInstanceStatus {
83
106
  // WorkspaceInstancePhase describes a high-level state of a workspace instance
84
107
  export type WorkspaceInstancePhase =
85
108
  // unknown indicates an issue within the system in that it cannot determine the actual phase of
86
- // a workspace. This phase is usually accompanied by an error.
87
- "unknown" |
109
+ // a workspace. This phase is usually accompanied by an error.
110
+ | "unknown"
88
111
 
89
112
  // Preparing means that we haven't actually started the workspace instance just yet, but rather
90
- // are still preparing for launch. This means we're building the Docker image for the workspace.
91
- "preparing" |
113
+ // are still preparing for launch.
114
+ | "preparing"
115
+
116
+ // Building means that we are building the Docker image for the workspace. A workspace will enter this phase only
117
+ // if an image build is required for that workspace.
118
+ | "building"
92
119
 
93
120
  // Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
94
- // some space within the cluster. If for example the cluster needs to scale up to accomodate the
95
- // workspace, the workspace will be in Pending state until that happened.
96
- "pending" |
121
+ // some space within the cluster. If for example the cluster needs to scale up to accomodate the
122
+ // workspace, the workspace will be in Pending state until that happened.
123
+ | "pending"
97
124
 
98
125
  // Creating means the workspace is currently being created. Thati includes downloading the images required
99
- // to run the workspace over the network. The time spent in this phase varies widely and depends on the current
100
- // network speed, image size and cache states.
101
- "creating" |
126
+ // to run the workspace over the network. The time spent in this phase varies widely and depends on the current
127
+ // network speed, image size and cache states.
128
+ | "creating"
102
129
 
103
130
  // Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
104
- // clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
105
- "initializing" |
131
+ // clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
132
+ | "initializing"
106
133
 
107
134
  // Running means the workspace is able to actively perform work, either by serving a user through Theia,
108
- // or as a headless workspace.
109
- "running" |
135
+ // or as a headless workspace.
136
+ | "running"
110
137
 
111
138
  // Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
112
139
  // When in this state, we expect it to become running or stopping anytime soon.
113
- "interrupted" |
140
+ | "interrupted"
114
141
 
115
142
  // Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
116
- "stopping" |
143
+ | "stopping"
117
144
 
118
145
  // Stopped means the workspace ended regularly because it was shut down.
119
- "stopped";
146
+ | "stopped";
120
147
 
121
148
  export interface WorkspaceInstanceConditions {
122
149
  // Failed contains the reason the workspace failed to operate. If this field is empty, the workspace has not failed.
123
- failed?: string
150
+ // failed contains technical details for the failure of the workspace.
151
+ failed?: string;
124
152
 
125
153
  // timeout contains the reason the workspace has timed out. If this field is empty, the workspace has not timed out.
126
- timeout?: string
154
+ timeout?: string;
127
155
 
128
156
  // PullingImages marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating
129
- pullingImages?: boolean
130
-
131
- // ServiceExists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist.
132
- serviceExists?: boolean
157
+ pullingImages?: boolean;
133
158
 
134
159
  // deployed marks that a workspace instance was sent/deployed at a workspace manager
135
160
  deployed?: boolean;
@@ -139,22 +164,28 @@ export interface WorkspaceInstanceConditions {
139
164
 
140
165
  // ISO8601 timestamp when the first user activity was registered in the frontend. Only set if the workspace is running.
141
166
  firstUserActivity?: string;
167
+
168
+ // headlessTaskFailed indicates that a headless workspace task failed
169
+ // headlessTaskFailed is only set if:
170
+ // * this workspace is headless
171
+ // * the task being run returned a non 0 exit status code
172
+ headlessTaskFailed?: string;
173
+
174
+ // stopped_by_request is true if the workspace was stopped using a StopWorkspace call
175
+ stoppedByRequest?: boolean;
142
176
  }
143
177
 
144
178
  // AdmissionLevel describes who can access a workspace instance and its ports.
145
- export type AdmissionLevel = 'owner_only' | 'everyone';
179
+ export type AdmissionLevel = "owner_only" | "everyone";
146
180
 
147
181
  // PortVisibility describes how a port can be accessed
148
- export type PortVisibility = 'public' | 'private';
182
+ export type PortVisibility = "public" | "private";
149
183
 
150
184
  // WorkspaceInstancePort describes a port exposed on a workspace instance
151
185
  export interface WorkspaceInstancePort {
152
186
  // The outward-facing port number
153
187
  port: number;
154
188
 
155
- // An optional inward-facing port number. If not present we'll use port.
156
- targetPort?: number;
157
-
158
189
  // The visiblity of this port. Optional for backwards compatibility.
159
190
  visibility?: PortVisibility;
160
191
 
@@ -174,19 +205,25 @@ export interface WorkspaceInstanceRepoStatus {
174
205
  uncommitedFiles?: string[];
175
206
 
176
207
  // the total number of uncommited files
177
- totalUncommitedFiles?: number
208
+ totalUncommitedFiles?: number;
178
209
 
179
210
  // untrackedFiles is the list of untracked files in the workspace, possibly truncated
180
211
  untrackedFiles?: string[];
181
212
 
182
213
  // the total number of untracked files
183
- totalUntrackedFiles?: number
214
+ totalUntrackedFiles?: number;
184
215
 
185
216
  // unpushedCommits is the list of unpushed changes in the workspace, possibly truncated
186
217
  unpushedCommits?: string[];
187
218
 
188
219
  // the total number of unpushed changes
189
- totalUnpushedCommits?: number
220
+ totalUnpushedCommits?: number;
221
+ }
222
+
223
+ // ConfigurationIdeConfig ide config of WorkspaceInstanceConfiguration
224
+ export interface ConfigurationIdeConfig {
225
+ useLatest?: boolean;
226
+ desktopIdeAlias?: string;
190
227
  }
191
228
 
192
229
  // WorkspaceInstanceConfiguration contains all per-instance configuration
@@ -200,4 +237,27 @@ export interface WorkspaceInstanceConfiguration {
200
237
 
201
238
  // ideImage is the ref of the IDE image this instance uses.
202
239
  ideImage: string;
240
+
241
+ // desktopIdeImage is the ref of the desktop IDE image this instance uses.
242
+ desktopIdeImage?: string;
243
+
244
+ // supervisorImage is the ref of the supervisor image this instance uses.
245
+ supervisorImage?: string;
246
+
247
+ ideConfig?: ConfigurationIdeConfig;
248
+ }
249
+
250
+ /**
251
+ * Holds information about the image build (if there was one) for this WorkspaceInstance
252
+ */
253
+ export interface ImageBuildInfo {
254
+ log?: ImageBuildLogInfo;
255
+ }
256
+
257
+ /**
258
+ * Holds information about how to access logs for this an image build
259
+ */
260
+ export interface ImageBuildLogInfo {
261
+ url: string;
262
+ headers: { [key: string]: string };
203
263
  }
package/src/wsready.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- // generated using github.com/32leaves/bel on 2021-04-20 10:08:58.0197329 +0000 UTC m=+0.008313436
7
+ // generated using github.com/32leaves/bel on 2022-05-18 18:19:49.011672619 +0000 UTC m=+0.006607361
8
8
  // DO NOT MODIFY
9
9
 
10
10
  export enum WorkspaceInitSource {
@@ -13,5 +13,5 @@ export enum WorkspaceInitSource {
13
13
  WorkspaceInitFromOther = "from-other",
14
14
  }
15
15
  export interface WorkspaceReadyMessage {
16
- source: WorkspaceInitSource
16
+ source: WorkspaceInitSource;
17
17
  }