@gitpod/gitpod-protocol 0.1.5-minor-updates.3 → 0.1.5-mp-fmt-protocol.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 (348) hide show
  1. package/data/gitpod-schema.json +53 -26
  2. package/lib/accounting-protocol.d.ts +10 -13
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +31 -46
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +27 -4
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +15 -0
  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/context-url.spec.d.ts +14 -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 +2 -3
  43. package/lib/env.d.ts.map +1 -1
  44. package/lib/env.js +24 -25
  45. package/lib/env.js.map +1 -1
  46. package/lib/gitpod-file-parser.d.ts.map +1 -1
  47. package/lib/gitpod-file-parser.js +26 -42
  48. package/lib/gitpod-file-parser.js.map +1 -1
  49. package/lib/gitpod-file-parser.spec.js +145 -142
  50. package/lib/gitpod-file-parser.spec.js.map +1 -1
  51. package/lib/gitpod-service.d.ts +133 -39
  52. package/lib/gitpod-service.d.ts.map +1 -1
  53. package/lib/gitpod-service.js +173 -287
  54. package/lib/gitpod-service.js.map +1 -1
  55. package/lib/headless-workspace-log.d.ts +9 -11
  56. package/lib/headless-workspace-log.d.ts.map +1 -1
  57. package/lib/headless-workspace-log.js +6 -8
  58. package/lib/headless-workspace-log.js.map +1 -1
  59. package/lib/ide-frontend-service.d.ts +1 -1
  60. package/lib/ide-protocol.d.ts +105 -0
  61. package/lib/ide-protocol.d.ts.map +1 -0
  62. package/lib/{util/without.js → ide-protocol.js} +2 -2
  63. package/lib/ide-protocol.js.map +1 -0
  64. package/lib/index.d.ts +16 -10
  65. package/lib/index.d.ts.map +1 -1
  66. package/lib/index.js +6 -0
  67. package/lib/index.js.map +1 -1
  68. package/lib/installation-admin-protocol.d.ts +27 -0
  69. package/lib/installation-admin-protocol.d.ts.map +1 -0
  70. package/lib/installation-admin-protocol.js +30 -0
  71. package/lib/installation-admin-protocol.js.map +1 -0
  72. package/lib/license-protocol.d.ts.map +1 -1
  73. package/lib/license-protocol.js.map +1 -1
  74. package/lib/messaging/browser/connection.d.ts +5 -3
  75. package/lib/messaging/browser/connection.d.ts.map +1 -1
  76. package/lib/messaging/browser/connection.js +184 -34
  77. package/lib/messaging/browser/connection.js.map +1 -1
  78. package/lib/messaging/browser/window-connection.d.ts +4 -4
  79. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  80. package/lib/messaging/browser/window-connection.js +42 -59
  81. package/lib/messaging/browser/window-connection.js.map +1 -1
  82. package/lib/messaging/client-call-metrics.d.ts +35 -0
  83. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  84. package/lib/messaging/client-call-metrics.js +83 -0
  85. package/lib/messaging/client-call-metrics.js.map +1 -0
  86. package/lib/messaging/error.d.ts +3 -1
  87. package/lib/messaging/error.d.ts.map +1 -1
  88. package/lib/messaging/error.js +6 -2
  89. package/lib/messaging/error.js.map +1 -1
  90. package/lib/messaging/handler.d.ts +10 -0
  91. package/lib/messaging/handler.d.ts.map +1 -1
  92. package/lib/messaging/handler.js +1 -1
  93. package/lib/messaging/node/connection.d.ts +1 -17
  94. package/lib/messaging/node/connection.d.ts.map +1 -1
  95. package/lib/messaging/node/connection.js +24 -60
  96. package/lib/messaging/node/connection.js.map +1 -1
  97. package/lib/messaging/proxy-factory.d.ts +3 -1
  98. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  99. package/lib/messaging/proxy-factory.js +75 -162
  100. package/lib/messaging/proxy-factory.js.map +1 -1
  101. package/lib/oss-allowlist.d.ts +14 -0
  102. package/lib/oss-allowlist.d.ts.map +1 -0
  103. package/lib/oss-allowlist.js +8 -0
  104. package/lib/oss-allowlist.js.map +1 -0
  105. package/lib/payment-protocol.d.ts.map +1 -1
  106. package/lib/payment-protocol.js +1 -1
  107. package/lib/payment-protocol.js.map +1 -1
  108. package/lib/permission.d.ts +10 -3
  109. package/lib/permission.d.ts.map +1 -1
  110. package/lib/permission.js +41 -31
  111. package/lib/permission.js.map +1 -1
  112. package/lib/plans.d.ts +210 -0
  113. package/lib/plans.d.ts.map +1 -0
  114. package/lib/plans.js +605 -0
  115. package/lib/plans.js.map +1 -0
  116. package/lib/protocol.d.ts +158 -82
  117. package/lib/protocol.d.ts.map +1 -1
  118. package/lib/protocol.js +173 -199
  119. package/lib/protocol.js.map +1 -1
  120. package/lib/snapshot-url.d.ts +14 -0
  121. package/lib/snapshot-url.d.ts.map +1 -0
  122. package/lib/snapshot-url.js +26 -0
  123. package/lib/snapshot-url.js.map +1 -0
  124. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  125. package/lib/snapshot-url.spec.d.ts.map +1 -0
  126. package/lib/snapshot-url.spec.js +41 -0
  127. package/lib/snapshot-url.spec.js.map +1 -0
  128. package/lib/team-subscription-protocol.d.ts +7 -5
  129. package/lib/team-subscription-protocol.d.ts.map +1 -1
  130. package/lib/team-subscription-protocol.js +19 -16
  131. package/lib/team-subscription-protocol.js.map +1 -1
  132. package/lib/teams-projects-protocol.d.ts +113 -0
  133. package/lib/teams-projects-protocol.d.ts.map +1 -0
  134. package/lib/teams-projects-protocol.js +30 -0
  135. package/lib/teams-projects-protocol.js.map +1 -0
  136. package/lib/typings/globals.d.ts +2 -2
  137. package/lib/typings/globals.d.ts.map +1 -1
  138. package/lib/util/analytics.d.ts +8 -0
  139. package/lib/util/analytics.d.ts.map +1 -0
  140. package/lib/util/analytics.js +88 -0
  141. package/lib/util/analytics.js.map +1 -0
  142. package/lib/util/async-iterator.d.ts.map +1 -1
  143. package/lib/util/async-iterator.js +57 -135
  144. package/lib/util/async-iterator.js.map +1 -1
  145. package/lib/util/cancelable.js +17 -59
  146. package/lib/util/cancelable.js.map +1 -1
  147. package/lib/util/date-time.js +11 -11
  148. package/lib/util/date-time.js.map +1 -1
  149. package/lib/util/deferred.js +10 -12
  150. package/lib/util/deferred.js.map +1 -1
  151. package/lib/util/disposable.d.ts.map +1 -1
  152. package/lib/util/disposable.js +27 -40
  153. package/lib/util/disposable.js.map +1 -1
  154. package/lib/util/event.d.ts.map +1 -1
  155. package/lib/util/event.js +63 -77
  156. package/lib/util/event.js.map +1 -1
  157. package/lib/util/garbage-collected-cache.d.ts +1 -0
  158. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  159. package/lib/util/garbage-collected-cache.js +27 -47
  160. package/lib/util/garbage-collected-cache.js.map +1 -1
  161. package/lib/util/generate-workspace-id.d.ts +1 -1
  162. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  163. package/lib/util/generate-workspace-id.js +460 -497
  164. package/lib/util/generate-workspace-id.js.map +1 -1
  165. package/lib/util/generate-workspace-id.spec.js +61 -78
  166. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  167. package/lib/util/gitpod-cookie.d.ts +20 -0
  168. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  169. package/lib/util/gitpod-cookie.js +41 -0
  170. package/lib/util/gitpod-cookie.js.map +1 -0
  171. package/lib/util/gitpod-host-url.d.ts +1 -2
  172. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  173. package/lib/util/gitpod-host-url.js +108 -109
  174. package/lib/util/gitpod-host-url.js.map +1 -1
  175. package/lib/util/gitpod-host-url.spec.d.ts +7 -1
  176. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  177. package/lib/util/gitpod-host-url.spec.js +113 -31
  178. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  179. package/lib/util/grpc.d.ts +15 -0
  180. package/lib/util/grpc.d.ts.map +1 -0
  181. package/lib/util/grpc.js +18 -0
  182. package/lib/util/grpc.js.map +1 -0
  183. package/lib/util/jaeger-client-types.d.ts +68 -0
  184. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  185. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
  186. package/lib/util/jaeger-client-types.js.map +1 -0
  187. package/lib/util/logging.d.ts +49 -33
  188. package/lib/util/logging.d.ts.map +1 -1
  189. package/lib/util/logging.js +125 -129
  190. package/lib/util/logging.js.map +1 -1
  191. package/lib/util/make-link.js +5 -5
  192. package/lib/util/make-link.js.map +1 -1
  193. package/lib/util/parse-workspace-id.d.ts +10 -0
  194. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  195. package/lib/util/parse-workspace-id.js +30 -7
  196. package/lib/util/parse-workspace-id.js.map +1 -1
  197. package/lib/util/parse-workspace-id.spec.d.ts +4 -0
  198. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  199. package/lib/util/parse-workspace-id.spec.js +123 -84
  200. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  201. package/lib/util/queue.js +16 -55
  202. package/lib/util/queue.js.map +1 -1
  203. package/lib/util/queue.spec.js +147 -288
  204. package/lib/util/queue.spec.js.map +1 -1
  205. package/lib/util/repeat.d.ts +15 -0
  206. package/lib/util/repeat.d.ts.map +1 -0
  207. package/lib/util/repeat.js +55 -0
  208. package/lib/util/repeat.js.map +1 -0
  209. package/lib/util/semaphore.d.ts.map +1 -1
  210. package/lib/util/semaphore.js +15 -46
  211. package/lib/util/semaphore.js.map +1 -1
  212. package/lib/util/skip-if.d.ts.map +1 -1
  213. package/lib/util/skip-if.js +6 -6
  214. package/lib/util/skip-if.js.map +1 -1
  215. package/lib/util/timeutil.d.ts.map +1 -1
  216. package/lib/util/timeutil.js +16 -16
  217. package/lib/util/timeutil.js.map +1 -1
  218. package/lib/util/timeutil.spec.d.ts.map +1 -1
  219. package/lib/util/timeutil.spec.js +21 -24
  220. package/lib/util/timeutil.spec.js.map +1 -1
  221. package/lib/util/tracing.d.ts +52 -6
  222. package/lib/util/tracing.d.ts.map +1 -1
  223. package/lib/util/tracing.js +199 -64
  224. package/lib/util/tracing.js.map +1 -1
  225. package/lib/util/tracing.spec.d.ts +7 -0
  226. package/lib/util/tracing.spec.d.ts.map +1 -0
  227. package/lib/util/tracing.spec.js +121 -0
  228. package/lib/util/tracing.spec.js.map +1 -0
  229. package/lib/util/workspace-port-authentication.d.ts +7 -7
  230. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  231. package/lib/util/workspace-port-authentication.js +9 -12
  232. package/lib/util/workspace-port-authentication.js.map +1 -1
  233. package/lib/workspace-cluster.d.ts +76 -0
  234. package/lib/workspace-cluster.d.ts.map +1 -0
  235. package/lib/workspace-cluster.js +31 -0
  236. package/lib/workspace-cluster.js.map +1 -0
  237. package/lib/workspace-instance.d.ts +26 -4
  238. package/lib/workspace-instance.d.ts.map +1 -1
  239. package/lib/wsready.d.ts +1 -1
  240. package/lib/wsready.d.ts.map +1 -1
  241. package/lib/wsready.js +2 -2
  242. package/package.json +31 -17
  243. package/pkg-yarn.lock +17 -9
  244. package/provenance-bundle.jsonl +2 -0
  245. package/src/accounting-protocol.ts +53 -57
  246. package/src/admin-protocol.ts +64 -19
  247. package/src/analytics.ts +52 -0
  248. package/src/auth.ts +2 -2
  249. package/src/context-url.spec.ts +67 -0
  250. package/src/context-url.ts +109 -0
  251. package/src/email-protocol.ts +5 -7
  252. package/src/encryption/container-module.ts +2 -3
  253. package/src/encryption/encryption-engine.spec.ts +9 -8
  254. package/src/encryption/encryption-engine.ts +14 -14
  255. package/src/encryption/encryption-service.ts +4 -5
  256. package/src/encryption/key-provider.ts +16 -19
  257. package/src/env.ts +18 -18
  258. package/src/gitpod-file-parser.spec.ts +55 -61
  259. package/src/gitpod-file-parser.ts +16 -17
  260. package/src/gitpod-service.ts +270 -117
  261. package/src/headless-workspace-log.ts +12 -14
  262. package/src/ide-frontend-service.ts +2 -2
  263. package/src/ide-protocol.ts +119 -0
  264. package/src/index.ts +16 -10
  265. package/src/installation-admin-protocol.ts +42 -0
  266. package/src/license-protocol.ts +5 -6
  267. package/src/messaging/browser/connection.ts +197 -18
  268. package/src/messaging/browser/window-connection.ts +39 -29
  269. package/src/messaging/client-call-metrics.ts +96 -0
  270. package/src/messaging/error.ts +9 -5
  271. package/src/messaging/handler.ts +13 -1
  272. package/src/messaging/node/connection.ts +23 -70
  273. package/src/messaging/proxy-factory.ts +35 -34
  274. package/src/oss-allowlist.ts +15 -0
  275. package/src/payment-protocol.ts +2 -2
  276. package/src/permission.ts +42 -33
  277. package/src/plans.ts +679 -0
  278. package/src/protocol.ts +371 -274
  279. package/src/snapshot-url.spec.ts +27 -0
  280. package/src/snapshot-url.ts +27 -0
  281. package/src/team-subscription-protocol.ts +36 -24
  282. package/src/teams-projects-protocol.ts +147 -0
  283. package/src/typings/globals.ts +4 -4
  284. package/src/util/analytics.ts +109 -0
  285. package/src/util/async-iterator.ts +4 -5
  286. package/src/util/cancelable.ts +3 -3
  287. package/src/util/date-time.ts +8 -8
  288. package/src/util/deferred.ts +6 -6
  289. package/src/util/disposable.ts +3 -6
  290. package/src/util/event.ts +9 -11
  291. package/src/util/garbage-collected-cache.ts +11 -8
  292. package/src/util/generate-workspace-id.spec.ts +29 -9
  293. package/src/util/generate-workspace-id.ts +458 -438
  294. package/src/util/gitpod-cookie.ts +38 -0
  295. package/src/util/gitpod-host-url.spec.ts +59 -8
  296. package/src/util/gitpod-host-url.ts +52 -40
  297. package/src/util/grpc.ts +15 -0
  298. package/src/util/jaeger-client-types.ts +102 -0
  299. package/src/util/logging.ts +145 -71
  300. package/src/util/make-link.ts +6 -7
  301. package/src/util/parse-workspace-id.spec.ts +37 -8
  302. package/src/util/parse-workspace-id.ts +32 -7
  303. package/src/util/queue.spec.ts +27 -25
  304. package/src/util/repeat.ts +45 -0
  305. package/src/util/semaphore.ts +6 -8
  306. package/src/util/skip-if.ts +10 -7
  307. package/src/util/timeutil.spec.ts +14 -15
  308. package/src/util/timeutil.ts +19 -15
  309. package/src/util/tracing.spec.ts +88 -0
  310. package/src/util/tracing.ts +202 -31
  311. package/src/util/workspace-port-authentication.ts +10 -13
  312. package/src/workspace-cluster.ts +107 -0
  313. package/src/workspace-instance.ts +66 -30
  314. package/src/wsready.ts +3 -3
  315. package/data/builtin-theia-plugins.json +0 -372
  316. package/lib/messaging/connection-error-handler.d.ts +0 -27
  317. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  318. package/lib/messaging/connection-error-handler.js +0 -46
  319. package/lib/messaging/connection-error-handler.js.map +0 -1
  320. package/lib/theia-plugins.d.ts +0 -11
  321. package/lib/theia-plugins.d.ts.map +0 -1
  322. package/lib/theia-plugins.js.map +0 -1
  323. package/lib/util/context-url.d.ts +0 -13
  324. package/lib/util/context-url.d.ts.map +0 -1
  325. package/lib/util/context-url.js +0 -26
  326. package/lib/util/context-url.js.map +0 -1
  327. package/lib/util/context-url.spec.d.ts +0 -10
  328. package/lib/util/context-url.spec.d.ts.map +0 -1
  329. package/lib/util/context-url.spec.js +0 -52
  330. package/lib/util/context-url.spec.js.map +0 -1
  331. package/lib/util/repeater.d.ts +0 -22
  332. package/lib/util/repeater.d.ts.map +0 -1
  333. package/lib/util/repeater.js +0 -118
  334. package/lib/util/repeater.js.map +0 -1
  335. package/lib/util/safe-promise.d.ts +0 -11
  336. package/lib/util/safe-promise.d.ts.map +0 -1
  337. package/lib/util/safe-promise.js +0 -34
  338. package/lib/util/safe-promise.js.map +0 -1
  339. package/lib/util/without.d.ts +0 -7
  340. package/lib/util/without.d.ts.map +0 -1
  341. package/lib/util/without.js.map +0 -1
  342. package/src/messaging/connection-error-handler.ts +0 -62
  343. package/src/theia-plugins.ts +0 -11
  344. package/src/util/context-url.spec.ts +0 -25
  345. package/src/util/context-url.ts +0 -23
  346. package/src/util/jaeger-client.d.ts +0 -105
  347. package/src/util/repeater.ts +0 -49
  348. package/src/util/safe-promise.ts +0 -26
package/lib/protocol.js CHANGED
@@ -4,100 +4,50 @@
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
- var __assign = (this && this.__assign) || function () {
8
- __assign = Object.assign || function(t) {
9
- for (var s, i = 1, n = arguments.length; i < n; i++) {
10
- s = arguments[i];
11
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12
- t[p] = s[p];
13
- }
14
- return t;
15
- };
16
- return __assign.apply(this, arguments);
17
- };
18
- var __values = (this && this.__values) || function(o) {
19
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
20
- if (m) return m.call(o);
21
- if (o && typeof o.length === "number") return {
22
- next: function () {
23
- if (o && i >= o.length) o = void 0;
24
- return { value: o && o[i++], done: !o };
25
- }
26
- };
27
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
28
- };
29
- var __read = (this && this.__read) || function (o, n) {
30
- var m = typeof Symbol === "function" && o[Symbol.iterator];
31
- if (!m) return o;
32
- var i = m.call(o), r, ar = [], e;
33
- try {
34
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
35
- }
36
- catch (error) { e = { error: error }; }
37
- finally {
38
- try {
39
- if (r && !r.done && (m = i["return"])) m.call(i);
40
- }
41
- finally { if (e) throw e.error; }
42
- }
43
- return ar;
44
- };
45
7
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.TheiaPlugin = exports.WorkspaceCreationResult = exports.CreateWorkspaceMode = exports.WorkspaceInstancePortsChangedEvent = exports.Repository = exports.NavigatorContext = exports.IssueContext = exports.PullRequestContext = exports.CommitContext = exports.RefType = exports.WorkspaceProbeContext = exports.WithEnvvarsContext = exports.PrebuiltWorkspaceContext = exports.StartPrebuildContext = exports.SnapshotContext = exports.WithPrebuild = exports.WithSnapshot = exports.WorkspaceContext = exports.ExternalImageConfigFile = exports.ImageConfigFile = exports.ImageConfigString = exports.WorkspaceImageBuild = exports.TaskConfig = exports.PortRangeConfig = exports.PortConfig = exports.PrebuiltWorkspace = exports.WorkspaceImageSourceReference = exports.WorkspaceImageSourceDocker = exports.GithubAppPrebuildConfig = exports.Workspace = exports.Identity = exports.GitpodTokenType = exports.UserEnvVar = exports.WorkspaceFeatureFlags = exports.User = void 0;
8
+ exports.TheiaPlugin = exports.AuthProviderEntry = exports.WorkspaceCreationResult = exports.CreateWorkspaceMode = exports.WorkspaceInfo = exports.WorkspaceInstancePortsChangedEvent = exports.Repository = exports.NavigatorContext = exports.IssueContext = exports.PullRequestContext = exports.CommitContext = exports.AdditionalContentContext = exports.RefType = exports.WorkspaceProbeContext = exports.WithEnvvarsContext = exports.WithReferrerContext = exports.PrebuiltWorkspaceContext = exports.StartPrebuildContext = exports.SnapshotContext = exports.WithDefaultConfig = exports.WithPrebuild = exports.WithSnapshot = exports.WorkspaceContext = exports.ExternalImageConfigFile = exports.ImageConfigFile = exports.ImageConfigString = exports.WorkspaceImageBuild = exports.TaskConfig = exports.PortRangeConfig = exports.PortConfig = exports.PrebuiltWorkspace = exports.WorkspaceImageSourceReference = exports.WorkspaceImageSourceDocker = exports.GithubAppPrebuildConfig = exports.Workspace = exports.Identity = exports.GitpodTokenType = exports.UserEnvVar = exports.WorkspaceFeatureFlags = exports.User = void 0;
9
+ const crypto_1 = require("crypto");
47
10
  var User;
48
11
  (function (User) {
49
12
  function is(data) {
50
- return data
51
- && data.hasOwnProperty('id')
52
- && data.hasOwnProperty('identities');
13
+ return data && data.hasOwnProperty("id") && data.hasOwnProperty("identities");
53
14
  }
54
15
  User.is = is;
55
16
  function getIdentity(user, authProviderId) {
56
- return user.identities.find(function (id) { return id.authProviderId === authProviderId; });
17
+ return user.identities.find((id) => id.authProviderId === authProviderId);
57
18
  }
58
19
  User.getIdentity = getIdentity;
59
20
  function censor(user) {
60
- var res = __assign({}, user);
61
- delete (res.additionalData);
62
- res.identities = res.identities.map(function (i) {
63
- delete (i.tokens);
21
+ const res = Object.assign({}, user);
22
+ delete res.additionalData;
23
+ res.identities = res.identities.map((i) => {
24
+ delete i.tokens;
64
25
  // The user field is not in the Identity shape, but actually exists on DBIdentity.
65
26
  // Trying to push this object out via JSON RPC will fail because of the cyclic nature
66
27
  // of this field.
67
- delete (i.user);
28
+ delete i.user;
68
29
  return i;
69
30
  });
70
31
  return res;
71
32
  }
72
33
  User.censor = censor;
73
34
  function getPrimaryEmail(user) {
74
- var identities = user.identities.filter(function (i) { return !!i.primaryEmail; });
35
+ const identities = user.identities.filter((i) => !!i.primaryEmail);
75
36
  if (identities.length <= 0) {
76
- throw new Error("No identity with primary email for user: " + user.id + "!");
37
+ throw new Error(`No identity with primary email for user: ${user.id}!`);
77
38
  }
78
39
  return identities[0].primaryEmail;
79
40
  }
80
41
  User.getPrimaryEmail = getPrimaryEmail;
81
42
  function getName(user) {
82
- var e_1, _a;
83
- var name = user.fullName || user.name;
43
+ const name = user.fullName || user.name;
84
44
  if (name) {
85
45
  return name;
86
46
  }
87
- try {
88
- for (var _b = __values(user.identities), _c = _b.next(); !_c.done; _c = _b.next()) {
89
- var id = _c.value;
90
- if (id.authName !== "") {
91
- return id.authName;
92
- }
93
- }
94
- }
95
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
96
- finally {
97
- try {
98
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
47
+ for (const id of user.identities) {
48
+ if (id.authName !== "") {
49
+ return id.authName;
99
50
  }
100
- finally { if (e_1) throw e_1.error; }
101
51
  }
102
52
  return undefined;
103
53
  }
@@ -107,99 +57,88 @@ var User;
107
57
  * The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
108
58
  * If they don't we'll break things during workspace startup.
109
59
  */
110
- exports.WorkspaceFeatureFlags = { "full_workspace_backup": undefined, "fixed_resources": undefined, "user_namespace": undefined };
60
+ exports.WorkspaceFeatureFlags = { full_workspace_backup: undefined, fixed_resources: undefined };
111
61
  var UserEnvVar;
112
62
  (function (UserEnvVar) {
63
+ // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
113
64
  function normalizeRepoPattern(pattern) {
114
65
  return pattern.toLocaleLowerCase();
115
66
  }
116
67
  UserEnvVar.normalizeRepoPattern = normalizeRepoPattern;
68
+ // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
69
+ function score(value) {
70
+ // We use a score to enforce precedence:
71
+ // value/value = 0
72
+ // value/* = 1
73
+ // */value = 2
74
+ // */* = 3
75
+ // #/# = 4 (used for env vars passed through the URL)
76
+ // the lower the score, the higher the precedence.
77
+ const [ownerPattern, repoPattern] = splitRepositoryPattern(value.repositoryPattern);
78
+ let score = 0;
79
+ if (repoPattern == "*") {
80
+ score += 1;
81
+ }
82
+ if (ownerPattern == "*") {
83
+ score += 2;
84
+ }
85
+ if (ownerPattern == "#" || repoPattern == "#") {
86
+ score = 4;
87
+ }
88
+ return score;
89
+ }
90
+ UserEnvVar.score = score;
91
+ // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
117
92
  function filter(vars, owner, repo) {
118
- var e_2, _a, e_3, _b;
119
- var result = vars.filter(function (e) {
120
- var _a = __read(splitRepositoryPattern(e.repositoryPattern), 2), ownerPattern = _a[0], repoPattern = _a[1];
121
- if (ownerPattern !== '*' && ownerPattern !== '#' && (!!owner && ownerPattern !== owner.toLocaleLowerCase())) {
93
+ let result = vars.filter((e) => {
94
+ const [ownerPattern, repoPattern] = splitRepositoryPattern(e.repositoryPattern);
95
+ if (ownerPattern !== "*" && ownerPattern !== "#" && !!owner && ownerPattern !== owner.toLocaleLowerCase()) {
122
96
  return false;
123
97
  }
124
- if (repoPattern !== '*' && repoPattern !== '#' && (!!repo && repoPattern !== repo.toLocaleLowerCase())) {
98
+ if (repoPattern !== "*" && repoPattern !== "#" && !!repo && repoPattern !== repo.toLocaleLowerCase()) {
125
99
  return false;
126
100
  }
127
101
  return true;
128
102
  });
129
- var resmap = new Map();
130
- result.forEach(function (e) {
131
- var l = (resmap.get(e.name) || []);
103
+ const resmap = new Map();
104
+ result.forEach((e) => {
105
+ const l = resmap.get(e.name) || [];
132
106
  l.push(e);
133
107
  resmap.set(e.name, l);
134
108
  });
135
109
  result = [];
136
- try {
137
- for (var _c = __values(resmap.keys()), _d = _c.next(); !_d.done; _d = _c.next()) {
138
- var name_1 = _d.value;
139
- var candidates = resmap.get(name_1);
140
- if (!candidates) {
141
- // not sure how this can happen, but so be it
142
- continue;
143
- }
144
- if (candidates.length == 1) {
145
- result.push(candidates[0]);
146
- continue;
147
- }
148
- var minscore = 10;
149
- var bestCandidate = void 0;
150
- try {
151
- for (var candidates_1 = (e_3 = void 0, __values(candidates)), candidates_1_1 = candidates_1.next(); !candidates_1_1.done; candidates_1_1 = candidates_1.next()) {
152
- var e = candidates_1_1.value;
153
- // We use a score to enforce precedence:
154
- // value/value = 0
155
- // value/* = 1
156
- // */value = 2
157
- // */* = 3
158
- // #/# = 4 (used for env vars passed through the URL)
159
- // the lower the score, the higher the precedence.
160
- var _e = __read(splitRepositoryPattern(e.repositoryPattern), 2), ownerPattern = _e[0], repoPattern = _e[1];
161
- var score = 0;
162
- if (repoPattern == "*") {
163
- score += 1;
164
- }
165
- if (ownerPattern == '*') {
166
- score += 2;
167
- }
168
- if (ownerPattern == "#" || repoPattern == "#") {
169
- score = 4;
170
- }
171
- if (!bestCandidate || score < minscore) {
172
- minscore = score;
173
- bestCandidate = e;
174
- }
175
- }
176
- }
177
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
178
- finally {
179
- try {
180
- if (candidates_1_1 && !candidates_1_1.done && (_b = candidates_1.return)) _b.call(candidates_1);
181
- }
182
- finally { if (e_3) throw e_3.error; }
183
- }
184
- result.push(bestCandidate);
110
+ for (const name of resmap.keys()) {
111
+ const candidates = resmap.get(name);
112
+ if (!candidates) {
113
+ // not sure how this can happen, but so be it
114
+ continue;
185
115
  }
186
- }
187
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
188
- finally {
189
- try {
190
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
116
+ if (candidates.length == 1) {
117
+ result.push(candidates[0]);
118
+ continue;
119
+ }
120
+ let minscore = 10;
121
+ let bestCandidate;
122
+ for (const e of candidates) {
123
+ const score = UserEnvVar.score(e);
124
+ if (!bestCandidate || score < minscore) {
125
+ minscore = score;
126
+ bestCandidate = e;
127
+ }
191
128
  }
192
- finally { if (e_2) throw e_2.error; }
129
+ result.push(bestCandidate);
193
130
  }
194
131
  return result;
195
132
  }
196
133
  UserEnvVar.filter = filter;
134
+ // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
197
135
  function splitRepositoryPattern(repositoryPattern) {
198
- var patterns = repositoryPattern.split('/');
199
- var repoPattern = patterns.pop() || "";
200
- var ownerPattern = patterns.join('/');
136
+ const patterns = repositoryPattern.split("/");
137
+ const repoPattern = patterns.slice(1).join("/");
138
+ const ownerPattern = patterns[0];
201
139
  return [ownerPattern, repoPattern];
202
140
  }
141
+ UserEnvVar.splitRepositoryPattern = splitRepositoryPattern;
203
142
  })(UserEnvVar = exports.UserEnvVar || (exports.UserEnvVar = {}));
204
143
  var GitpodTokenType;
205
144
  (function (GitpodTokenType) {
@@ -209,14 +148,11 @@ var GitpodTokenType;
209
148
  var Identity;
210
149
  (function (Identity) {
211
150
  function is(data) {
212
- return data.hasOwnProperty('authProviderId')
213
- && data.hasOwnProperty('authId')
214
- && data.hasOwnProperty('authName');
151
+ return (data.hasOwnProperty("authProviderId") && data.hasOwnProperty("authId") && data.hasOwnProperty("authName"));
215
152
  }
216
153
  Identity.is = is;
217
154
  function equals(id1, id2) {
218
- return id1.authProviderId === id2.authProviderId
219
- && id1.authId === id2.authId;
155
+ return id1.authProviderId === id2.authProviderId && id1.authId === id2.authId;
220
156
  }
221
157
  Identity.equals = equals;
222
158
  })(Identity = exports.Identity || (exports.Identity = {}));
@@ -224,14 +160,14 @@ var Workspace;
224
160
  (function (Workspace) {
225
161
  function getFullRepositoryName(ws) {
226
162
  if (CommitContext.is(ws.context)) {
227
- return ws.context.repository.owner + '/' + ws.context.repository.name;
163
+ return ws.context.repository.owner + "/" + ws.context.repository.name;
228
164
  }
229
165
  return undefined;
230
166
  }
231
167
  Workspace.getFullRepositoryName = getFullRepositoryName;
232
168
  function getFullRepositoryUrl(ws) {
233
169
  if (CommitContext.is(ws.context)) {
234
- return "https://" + ws.context.repository.host + "/" + getFullRepositoryName(ws);
170
+ return `https://${ws.context.repository.host}/${getFullRepositoryName(ws)}`;
235
171
  }
236
172
  return undefined;
237
173
  }
@@ -268,30 +204,28 @@ var Workspace;
268
204
  var GithubAppPrebuildConfig;
269
205
  (function (GithubAppPrebuildConfig) {
270
206
  function is(obj) {
271
- return !(typeof obj === 'boolean');
207
+ return !(typeof obj === "boolean");
272
208
  }
273
209
  GithubAppPrebuildConfig.is = is;
274
210
  })(GithubAppPrebuildConfig = exports.GithubAppPrebuildConfig || (exports.GithubAppPrebuildConfig = {}));
275
211
  var WorkspaceImageSourceDocker;
276
212
  (function (WorkspaceImageSourceDocker) {
277
213
  function is(obj) {
278
- return 'dockerFileHash' in obj
279
- && 'dockerFileSource' in obj
280
- && 'dockerFilePath' in obj;
214
+ return "dockerFileHash" in obj && "dockerFilePath" in obj;
281
215
  }
282
216
  WorkspaceImageSourceDocker.is = is;
283
217
  })(WorkspaceImageSourceDocker = exports.WorkspaceImageSourceDocker || (exports.WorkspaceImageSourceDocker = {}));
284
218
  var WorkspaceImageSourceReference;
285
219
  (function (WorkspaceImageSourceReference) {
286
220
  function is(obj) {
287
- return 'baseImageResolved' in obj;
221
+ return "baseImageResolved" in obj;
288
222
  }
289
223
  WorkspaceImageSourceReference.is = is;
290
224
  })(WorkspaceImageSourceReference = exports.WorkspaceImageSourceReference || (exports.WorkspaceImageSourceReference = {}));
291
225
  var PrebuiltWorkspace;
292
226
  (function (PrebuiltWorkspace) {
293
227
  function isDone(pws) {
294
- return pws.state === "available" || pws.state === "timeout" || pws.state === 'aborted';
228
+ return pws.state === "available" || pws.state === "timeout" || pws.state === "aborted";
295
229
  }
296
230
  PrebuiltWorkspace.isDone = isDone;
297
231
  function isAvailable(pws) {
@@ -306,129 +240,130 @@ var PrebuiltWorkspace;
306
240
  var PortConfig;
307
241
  (function (PortConfig) {
308
242
  function is(config) {
309
- return config && ('port' in config) && (typeof config.port === 'number');
243
+ return config && "port" in config && typeof config.port === "number";
310
244
  }
311
245
  PortConfig.is = is;
312
246
  })(PortConfig = exports.PortConfig || (exports.PortConfig = {}));
313
247
  var PortRangeConfig;
314
248
  (function (PortRangeConfig) {
315
249
  function is(config) {
316
- return config && ('port' in config) && (typeof config.port === 'string' || config.port instanceof String);
250
+ return config && "port" in config && (typeof config.port === "string" || config.port instanceof String);
317
251
  }
318
252
  PortRangeConfig.is = is;
319
253
  })(PortRangeConfig = exports.PortRangeConfig || (exports.PortRangeConfig = {}));
320
254
  var TaskConfig;
321
255
  (function (TaskConfig) {
322
256
  function is(config) {
323
- return config
324
- && ('command' in config || 'init' in config || 'before' in config);
257
+ return config && ("command" in config || "init" in config || "before" in config);
325
258
  }
326
259
  TaskConfig.is = is;
327
260
  })(TaskConfig = exports.TaskConfig || (exports.TaskConfig = {}));
328
261
  var WorkspaceImageBuild;
329
262
  (function (WorkspaceImageBuild) {
330
- var LogLine;
263
+ let LogLine;
331
264
  (function (LogLine) {
332
- LogLine.DELIMITER = '\r\n';
265
+ LogLine.DELIMITER = "\r\n";
333
266
  LogLine.DELIMITER_REGEX = /\r?\n/;
334
267
  })(LogLine = WorkspaceImageBuild.LogLine || (WorkspaceImageBuild.LogLine = {}));
335
268
  })(WorkspaceImageBuild = exports.WorkspaceImageBuild || (exports.WorkspaceImageBuild = {}));
336
269
  var ImageConfigString;
337
270
  (function (ImageConfigString) {
338
271
  function is(config) {
339
- return typeof config === 'string';
272
+ return typeof config === "string";
340
273
  }
341
274
  ImageConfigString.is = is;
342
275
  })(ImageConfigString = exports.ImageConfigString || (exports.ImageConfigString = {}));
343
276
  var ImageConfigFile;
344
277
  (function (ImageConfigFile) {
345
278
  function is(config) {
346
- return typeof config === 'object'
347
- && 'file' in config;
279
+ return typeof config === "object" && "file" in config;
348
280
  }
349
281
  ImageConfigFile.is = is;
350
282
  })(ImageConfigFile = exports.ImageConfigFile || (exports.ImageConfigFile = {}));
351
283
  var ExternalImageConfigFile;
352
284
  (function (ExternalImageConfigFile) {
353
285
  function is(config) {
354
- return typeof config === 'object'
355
- && 'file' in config
356
- && 'externalSource' in config;
286
+ return typeof config === "object" && "file" in config && "externalSource" in config;
357
287
  }
358
288
  ExternalImageConfigFile.is = is;
359
289
  })(ExternalImageConfigFile = exports.ExternalImageConfigFile || (exports.ExternalImageConfigFile = {}));
360
290
  var WorkspaceContext;
361
291
  (function (WorkspaceContext) {
362
292
  function is(context) {
363
- return context
364
- && 'title' in context;
293
+ return context && "title" in context;
365
294
  }
366
295
  WorkspaceContext.is = is;
367
296
  })(WorkspaceContext = exports.WorkspaceContext || (exports.WorkspaceContext = {}));
368
297
  var WithSnapshot;
369
298
  (function (WithSnapshot) {
370
299
  function is(context) {
371
- return context
372
- && 'snapshotBucketId' in context;
300
+ return context && "snapshotBucketId" in context;
373
301
  }
374
302
  WithSnapshot.is = is;
375
303
  })(WithSnapshot = exports.WithSnapshot || (exports.WithSnapshot = {}));
376
304
  var WithPrebuild;
377
305
  (function (WithPrebuild) {
378
306
  function is(context) {
379
- return context
380
- && 'snapshotBucketId' in context
381
- && 'prebuildWorkspaceId' in context
382
- && 'wasPrebuilt' in context;
307
+ return context && WithSnapshot.is(context) && "prebuildWorkspaceId" in context && "wasPrebuilt" in context;
383
308
  }
384
309
  WithPrebuild.is = is;
385
310
  })(WithPrebuild = exports.WithPrebuild || (exports.WithPrebuild = {}));
311
+ var WithDefaultConfig;
312
+ (function (WithDefaultConfig) {
313
+ function is(context) {
314
+ return context && "withDefaultConfig" in context && context.withDefaultConfig;
315
+ }
316
+ WithDefaultConfig.is = is;
317
+ function mark(ctx) {
318
+ return Object.assign(Object.assign({}, ctx), { withDefaultConfig: true });
319
+ }
320
+ WithDefaultConfig.mark = mark;
321
+ })(WithDefaultConfig = exports.WithDefaultConfig || (exports.WithDefaultConfig = {}));
386
322
  var SnapshotContext;
387
323
  (function (SnapshotContext) {
388
324
  function is(context) {
389
- return context
390
- && WithSnapshot.is(context)
391
- && 'snapshotId' in context;
325
+ return context && WithSnapshot.is(context) && "snapshotId" in context;
392
326
  }
393
327
  SnapshotContext.is = is;
394
328
  })(SnapshotContext = exports.SnapshotContext || (exports.SnapshotContext = {}));
395
329
  var StartPrebuildContext;
396
330
  (function (StartPrebuildContext) {
397
331
  function is(context) {
398
- return context
399
- && 'actual' in context;
332
+ return context && "actual" in context;
400
333
  }
401
334
  StartPrebuildContext.is = is;
402
335
  })(StartPrebuildContext = exports.StartPrebuildContext || (exports.StartPrebuildContext = {}));
403
336
  var PrebuiltWorkspaceContext;
404
337
  (function (PrebuiltWorkspaceContext) {
405
338
  function is(context) {
406
- return context
407
- && 'originalContext' in context
408
- && 'prebuiltWorkspace' in context;
339
+ return context && "originalContext" in context && "prebuiltWorkspace" in context;
409
340
  }
410
341
  PrebuiltWorkspaceContext.is = is;
411
342
  })(PrebuiltWorkspaceContext = exports.PrebuiltWorkspaceContext || (exports.PrebuiltWorkspaceContext = {}));
343
+ var WithReferrerContext;
344
+ (function (WithReferrerContext) {
345
+ function is(context) {
346
+ return context && "referrer" in context;
347
+ }
348
+ WithReferrerContext.is = is;
349
+ })(WithReferrerContext = exports.WithReferrerContext || (exports.WithReferrerContext = {}));
412
350
  var WithEnvvarsContext;
413
351
  (function (WithEnvvarsContext) {
414
352
  function is(context) {
415
- return context
416
- && 'envvars' in context;
353
+ return context && "envvars" in context;
417
354
  }
418
355
  WithEnvvarsContext.is = is;
419
356
  })(WithEnvvarsContext = exports.WithEnvvarsContext || (exports.WithEnvvarsContext = {}));
420
357
  var WorkspaceProbeContext;
421
358
  (function (WorkspaceProbeContext) {
422
359
  function is(context) {
423
- return context
424
- && 'responseURL' in context
425
- && 'responseToken' in context;
360
+ return context && "responseURL" in context && "responseToken" in context;
426
361
  }
427
362
  WorkspaceProbeContext.is = is;
428
363
  })(WorkspaceProbeContext = exports.WorkspaceProbeContext || (exports.WorkspaceProbeContext = {}));
429
364
  var RefType;
430
365
  (function (RefType) {
431
- RefType.getRefType = function (commit) {
366
+ RefType.getRefType = (commit) => {
432
367
  if (!commit.ref) {
433
368
  return "revision";
434
369
  }
@@ -436,48 +371,71 @@ var RefType;
436
371
  return commit.refType || "branch";
437
372
  };
438
373
  })(RefType = exports.RefType || (exports.RefType = {}));
374
+ var AdditionalContentContext;
375
+ (function (AdditionalContentContext) {
376
+ function is(ctx) {
377
+ return "additionalFiles" in ctx;
378
+ }
379
+ AdditionalContentContext.is = is;
380
+ function hasDockerConfig(ctx, config) {
381
+ return is(ctx) && ImageConfigFile.is(config.image) && !!ctx.additionalFiles[config.image.file];
382
+ }
383
+ AdditionalContentContext.hasDockerConfig = hasDockerConfig;
384
+ })(AdditionalContentContext = exports.AdditionalContentContext || (exports.AdditionalContentContext = {}));
439
385
  var CommitContext;
386
+ (function (CommitContext) {
387
+ /**
388
+ * Creates a hash for all the commits of the CommitContext and all sub-repo commit infos.
389
+ * The hash is max 255 chars long.
390
+ * @param commitContext
391
+ * @returns hash for commitcontext
392
+ */
393
+ function computeHash(commitContext) {
394
+ // for single commits we use the revision to be backward compatible.
395
+ if (!commitContext.additionalRepositoryCheckoutInfo ||
396
+ commitContext.additionalRepositoryCheckoutInfo.length === 0) {
397
+ return commitContext.revision;
398
+ }
399
+ const hasher = (0, crypto_1.createHash)("sha256");
400
+ hasher.update(commitContext.revision);
401
+ for (const info of commitContext.additionalRepositoryCheckoutInfo) {
402
+ hasher.update(info.revision);
403
+ }
404
+ return hasher.digest("hex");
405
+ }
406
+ CommitContext.computeHash = computeHash;
407
+ })(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
440
408
  (function (CommitContext) {
441
409
  function is(commit) {
442
- return WorkspaceContext.is(commit)
443
- && 'repository' in commit
444
- && 'revision' in commit;
410
+ return WorkspaceContext.is(commit) && "repository" in commit && "revision" in commit;
445
411
  }
446
412
  CommitContext.is = is;
447
413
  })(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
448
414
  var PullRequestContext;
449
415
  (function (PullRequestContext) {
450
416
  function is(ctx) {
451
- return CommitContext.is(ctx)
452
- && 'nr' in ctx
453
- && 'ref' in ctx
454
- && 'base' in ctx;
417
+ return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "base" in ctx;
455
418
  }
456
419
  PullRequestContext.is = is;
457
420
  })(PullRequestContext = exports.PullRequestContext || (exports.PullRequestContext = {}));
458
421
  var IssueContext;
459
422
  (function (IssueContext) {
460
423
  function is(ctx) {
461
- return CommitContext.is(ctx)
462
- && 'nr' in ctx
463
- && 'ref' in ctx
464
- && 'localBranch' in ctx;
424
+ return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "localBranch" in ctx;
465
425
  }
466
426
  IssueContext.is = is;
467
427
  })(IssueContext = exports.IssueContext || (exports.IssueContext = {}));
468
428
  var NavigatorContext;
469
429
  (function (NavigatorContext) {
470
430
  function is(ctx) {
471
- return CommitContext.is(ctx)
472
- && 'path' in ctx
473
- && 'isFile' in ctx;
431
+ return CommitContext.is(ctx) && "path" in ctx && "isFile" in ctx;
474
432
  }
475
433
  NavigatorContext.is = is;
476
434
  })(NavigatorContext = exports.NavigatorContext || (exports.NavigatorContext = {}));
477
435
  var Repository;
478
436
  (function (Repository) {
479
437
  function fullRepoName(repo) {
480
- return repo.host + "/" + repo.owner + "/" + repo.name;
438
+ return `${repo.host}/${repo.owner}/${repo.name}`;
481
439
  }
482
440
  Repository.fullRepoName = fullRepoName;
483
441
  })(Repository = exports.Repository || (exports.Repository = {}));
@@ -488,6 +446,14 @@ var WorkspaceInstancePortsChangedEvent;
488
446
  }
489
447
  WorkspaceInstancePortsChangedEvent.is = is;
490
448
  })(WorkspaceInstancePortsChangedEvent = exports.WorkspaceInstancePortsChangedEvent || (exports.WorkspaceInstancePortsChangedEvent = {}));
449
+ var WorkspaceInfo;
450
+ (function (WorkspaceInfo) {
451
+ function lastActiveISODate(info) {
452
+ var _a;
453
+ return ((_a = info.latestInstance) === null || _a === void 0 ? void 0 : _a.creationTime) || info.workspace.creationTime;
454
+ }
455
+ WorkspaceInfo.lastActiveISODate = lastActiveISODate;
456
+ })(WorkspaceInfo = exports.WorkspaceInfo || (exports.WorkspaceInfo = {}));
491
457
  var CreateWorkspaceMode;
492
458
  (function (CreateWorkspaceMode) {
493
459
  // Default returns a running prebuild if there is any, otherwise creates a new workspace (using a prebuild if one is available)
@@ -502,16 +468,24 @@ var CreateWorkspaceMode;
502
468
  var WorkspaceCreationResult;
503
469
  (function (WorkspaceCreationResult) {
504
470
  function is(data) {
505
- return data && ('createdWorkspaceId' in data
506
- || 'existingWorkspaces' in data
507
- || 'runningWorkspacePrebuild' in data
508
- || 'runningPrebuildWorkspaceID' in data);
471
+ return (data &&
472
+ ("createdWorkspaceId" in data ||
473
+ "existingWorkspaces" in data ||
474
+ "runningWorkspacePrebuild" in data ||
475
+ "runningPrebuildWorkspaceID" in data));
509
476
  }
510
477
  WorkspaceCreationResult.is = is;
511
478
  })(WorkspaceCreationResult = exports.WorkspaceCreationResult || (exports.WorkspaceCreationResult = {}));
479
+ var AuthProviderEntry;
480
+ (function (AuthProviderEntry) {
481
+ function redact(entry) {
482
+ return Object.assign(Object.assign({}, entry), { oauth: Object.assign(Object.assign({}, entry.oauth), { clientSecret: "redacted" }) });
483
+ }
484
+ AuthProviderEntry.redact = redact;
485
+ })(AuthProviderEntry = exports.AuthProviderEntry || (exports.AuthProviderEntry = {}));
512
486
  var TheiaPlugin;
513
487
  (function (TheiaPlugin) {
514
- var State;
488
+ let State;
515
489
  (function (State) {
516
490
  State["Uploading"] = "uploading";
517
491
  State["Uploaded"] = "uploaded";