@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta4 → 0.1.5-vn-6525.75

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