@gitpod/gitpod-protocol 0.1.5-se-multi-repo.39 → 0.1.5-se-usage-view.1

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 (342) hide show
  1. package/data/gitpod-schema.json +69 -3
  2. package/lib/accounting-protocol.d.ts +18 -10
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +34 -32
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +5 -0
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js.map +1 -1
  9. package/lib/analytics.d.ts.map +1 -1
  10. package/lib/analytics.js.map +1 -1
  11. package/lib/attribution.d.ts +20 -0
  12. package/lib/attribution.d.ts.map +1 -0
  13. package/lib/attribution.js +40 -0
  14. package/lib/attribution.js.map +1 -0
  15. package/lib/auth.d.ts.map +1 -1
  16. package/lib/billing-mode.d.ts +40 -0
  17. package/lib/billing-mode.d.ts.map +1 -0
  18. package/lib/billing-mode.js +36 -0
  19. package/lib/billing-mode.js.map +1 -0
  20. package/lib/blocked-repositories-protocol.d.ts +13 -0
  21. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  22. package/lib/blocked-repositories-protocol.js +8 -0
  23. package/lib/blocked-repositories-protocol.js.map +1 -0
  24. package/lib/context-url.d.ts.map +1 -1
  25. package/lib/context-url.js +4 -4
  26. package/lib/context-url.js.map +1 -1
  27. package/lib/context-url.spec.d.ts.map +1 -1
  28. package/lib/context-url.spec.js +20 -5
  29. package/lib/context-url.spec.js.map +1 -1
  30. package/lib/email-protocol.d.ts +1 -1
  31. package/lib/email-protocol.d.ts.map +1 -1
  32. package/lib/email-protocol.js.map +1 -1
  33. package/lib/encryption/container-module.d.ts.map +1 -1
  34. package/lib/encryption/container-module.js +1 -1
  35. package/lib/encryption/container-module.js.map +1 -1
  36. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  37. package/lib/encryption/encryption-engine.js +7 -7
  38. package/lib/encryption/encryption-engine.js.map +1 -1
  39. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  40. package/lib/encryption/encryption-engine.spec.js +2 -3
  41. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  42. package/lib/encryption/encryption-service.d.ts.map +1 -1
  43. package/lib/encryption/encryption-service.js +1 -1
  44. package/lib/encryption/encryption-service.js.map +1 -1
  45. package/lib/encryption/key-provider.d.ts.map +1 -1
  46. package/lib/encryption/key-provider.js +7 -9
  47. package/lib/encryption/key-provider.js.map +1 -1
  48. package/lib/env.d.ts +0 -5
  49. package/lib/env.d.ts.map +1 -1
  50. package/lib/env.js +1 -20
  51. package/lib/env.js.map +1 -1
  52. package/lib/experiments/always-default.d.ts +8 -0
  53. package/lib/experiments/always-default.d.ts.map +1 -0
  54. package/lib/experiments/always-default.js +20 -0
  55. package/lib/experiments/always-default.js.map +1 -0
  56. package/lib/experiments/configcat-server.d.ts +10 -0
  57. package/lib/experiments/configcat-server.d.ts.map +1 -0
  58. package/lib/experiments/configcat-server.js +36 -0
  59. package/lib/experiments/configcat-server.js.map +1 -0
  60. package/lib/experiments/configcat.d.ts +22 -0
  61. package/lib/experiments/configcat.d.ts.map +1 -0
  62. package/lib/experiments/configcat.js +53 -0
  63. package/lib/experiments/configcat.js.map +1 -0
  64. package/lib/experiments/types.d.ts +23 -0
  65. package/lib/experiments/types.d.ts.map +1 -0
  66. package/lib/experiments/types.js +10 -0
  67. package/lib/experiments/types.js.map +1 -0
  68. package/lib/gitpod-file-parser.d.ts.map +1 -1
  69. package/lib/gitpod-file-parser.js +6 -6
  70. package/lib/gitpod-file-parser.js.map +1 -1
  71. package/lib/gitpod-file-parser.spec.js +42 -39
  72. package/lib/gitpod-file-parser.spec.js.map +1 -1
  73. package/lib/gitpod-service.d.ts +57 -26
  74. package/lib/gitpod-service.d.ts.map +1 -1
  75. package/lib/gitpod-service.js +40 -33
  76. package/lib/gitpod-service.js.map +1 -1
  77. package/lib/headless-workspace-log.d.ts.map +1 -1
  78. package/lib/headless-workspace-log.js +1 -1
  79. package/lib/headless-workspace-log.js.map +1 -1
  80. package/lib/ide-frontend-service.d.ts +1 -1
  81. package/lib/ide-protocol.d.ts +14 -6
  82. package/lib/ide-protocol.d.ts.map +1 -1
  83. package/lib/index.d.ts +17 -16
  84. package/lib/index.d.ts.map +1 -1
  85. package/lib/index.js +1 -0
  86. package/lib/index.js.map +1 -1
  87. package/lib/installation-admin-protocol.d.ts +3 -0
  88. package/lib/installation-admin-protocol.d.ts.map +1 -1
  89. package/lib/installation-admin-protocol.js +3 -2
  90. package/lib/installation-admin-protocol.js.map +1 -1
  91. package/lib/license-protocol.d.ts +7 -0
  92. package/lib/license-protocol.d.ts.map +1 -1
  93. package/lib/license-protocol.js.map +1 -1
  94. package/lib/messaging/browser/connection.d.ts +1 -1
  95. package/lib/messaging/browser/connection.d.ts.map +1 -1
  96. package/lib/messaging/browser/connection.js +19 -19
  97. package/lib/messaging/browser/connection.js.map +1 -1
  98. package/lib/messaging/browser/window-connection.d.ts +4 -4
  99. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  100. package/lib/messaging/browser/window-connection.js +9 -6
  101. package/lib/messaging/browser/window-connection.js.map +1 -1
  102. package/lib/messaging/client-call-metrics.d.ts +2 -18
  103. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  104. package/lib/messaging/client-call-metrics.js +21 -22
  105. package/lib/messaging/client-call-metrics.js.map +1 -1
  106. package/lib/messaging/error.d.ts +6 -1
  107. package/lib/messaging/error.d.ts.map +1 -1
  108. package/lib/messaging/error.js +13 -3
  109. package/lib/messaging/error.js.map +1 -1
  110. package/lib/messaging/handler.d.ts.map +1 -1
  111. package/lib/messaging/handler.js +1 -1
  112. package/lib/messaging/node/connection.js +8 -8
  113. package/lib/messaging/node/connection.js.map +1 -1
  114. package/lib/messaging/proxy-factory.d.ts +1 -1
  115. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  116. package/lib/messaging/proxy-factory.js +7 -9
  117. package/lib/messaging/proxy-factory.js.map +1 -1
  118. package/lib/payment-protocol.d.ts.map +1 -1
  119. package/lib/payment-protocol.js +1 -1
  120. package/lib/payment-protocol.js.map +1 -1
  121. package/lib/permission.d.ts +2 -2
  122. package/lib/permission.d.ts.map +1 -1
  123. package/lib/permission.js +12 -23
  124. package/lib/permission.js.map +1 -1
  125. package/lib/plans.d.ts +4 -3
  126. package/lib/plans.d.ts.map +1 -1
  127. package/lib/plans.js +210 -171
  128. package/lib/plans.js.map +1 -1
  129. package/lib/protocol.d.ts +109 -35
  130. package/lib/protocol.d.ts.map +1 -1
  131. package/lib/protocol.js +248 -91
  132. package/lib/protocol.js.map +1 -1
  133. package/{src/theia-plugins.ts → lib/protocol.spec.d.ts} +2 -6
  134. package/lib/protocol.spec.d.ts.map +1 -0
  135. package/lib/protocol.spec.js +127 -0
  136. package/lib/protocol.spec.js.map +1 -0
  137. package/lib/snapshot-url.spec.js.map +1 -1
  138. package/lib/team-subscription-protocol.d.ts +20 -3
  139. package/lib/team-subscription-protocol.d.ts.map +1 -1
  140. package/lib/team-subscription-protocol.js +20 -5
  141. package/lib/team-subscription-protocol.js.map +1 -1
  142. package/lib/teams-projects-protocol.d.ts +21 -3
  143. package/lib/teams-projects-protocol.d.ts.map +1 -1
  144. package/lib/teams-projects-protocol.js +1 -1
  145. package/lib/teams-projects-protocol.js.map +1 -1
  146. package/lib/typings/globals.d.ts +2 -2
  147. package/lib/typings/globals.d.ts.map +1 -1
  148. package/lib/usage.d.ts +97 -0
  149. package/lib/usage.d.ts.map +1 -0
  150. package/lib/usage.js +14 -0
  151. package/lib/usage.js.map +1 -0
  152. package/lib/util/analytics.d.ts.map +1 -1
  153. package/lib/util/analytics.js +6 -6
  154. package/lib/util/analytics.js.map +1 -1
  155. package/lib/util/async-iterator.d.ts.map +1 -1
  156. package/lib/util/async-iterator.js +3 -3
  157. package/lib/util/async-iterator.js.map +1 -1
  158. package/lib/util/cancelable.js.map +1 -1
  159. package/lib/util/date-time.js +6 -6
  160. package/lib/util/date-time.js.map +1 -1
  161. package/lib/util/debug-app.d.ts +25 -0
  162. package/lib/util/debug-app.d.ts.map +1 -0
  163. package/lib/util/debug-app.js +100 -0
  164. package/lib/util/debug-app.js.map +1 -0
  165. package/lib/util/deferred.js.map +1 -1
  166. package/lib/util/disposable.d.ts.map +1 -1
  167. package/lib/util/disposable.js +2 -2
  168. package/lib/util/disposable.js.map +1 -1
  169. package/lib/util/event.d.ts.map +1 -1
  170. package/lib/util/event.js +5 -3
  171. package/lib/util/event.js.map +1 -1
  172. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  173. package/lib/util/garbage-collected-cache.js +6 -1
  174. package/lib/util/garbage-collected-cache.js.map +1 -1
  175. package/lib/util/generate-workspace-id.d.ts +5 -0
  176. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  177. package/lib/util/generate-workspace-id.js +446 -442
  178. package/lib/util/generate-workspace-id.js.map +1 -1
  179. package/lib/util/generate-workspace-id.spec.js +18 -7
  180. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  181. package/lib/util/gitpod-cookie.d.ts +1 -1
  182. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  183. package/lib/util/gitpod-cookie.js +0 -3
  184. package/lib/util/gitpod-cookie.js.map +1 -1
  185. package/lib/util/gitpod-host-url.d.ts +3 -0
  186. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  187. package/lib/util/gitpod-host-url.js +49 -29
  188. package/lib/util/gitpod-host-url.js.map +1 -1
  189. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  190. package/lib/util/gitpod-host-url.spec.js +15 -5
  191. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  192. package/lib/util/grpc.d.ts +19 -0
  193. package/lib/util/grpc.d.ts.map +1 -1
  194. package/lib/util/grpc.js +73 -1
  195. package/lib/util/grpc.js.map +1 -1
  196. package/lib/util/jaeger-client-types.d.ts.map +1 -1
  197. package/lib/util/logging.d.ts +1 -1
  198. package/lib/util/logging.d.ts.map +1 -1
  199. package/lib/util/logging.js +31 -25
  200. package/lib/util/logging.js.map +1 -1
  201. package/lib/util/logging.spec.d.ts +7 -0
  202. package/lib/util/logging.spec.d.ts.map +1 -0
  203. package/lib/util/logging.spec.js +52 -0
  204. package/lib/util/logging.spec.js.map +1 -0
  205. package/lib/util/make-link.js +5 -5
  206. package/lib/util/make-link.js.map +1 -1
  207. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  208. package/lib/util/parse-workspace-id.js +1 -2
  209. package/lib/util/parse-workspace-id.js.map +1 -1
  210. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  211. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  212. package/lib/util/queue.spec.js +9 -6
  213. package/lib/util/queue.spec.js.map +1 -1
  214. package/lib/util/semaphore.d.ts.map +1 -1
  215. package/lib/util/semaphore.js.map +1 -1
  216. package/lib/util/skip-if.d.ts.map +1 -1
  217. package/lib/util/skip-if.js.map +1 -1
  218. package/lib/util/timeutil.d.ts +2 -0
  219. package/lib/util/timeutil.d.ts.map +1 -1
  220. package/lib/util/timeutil.js +15 -3
  221. package/lib/util/timeutil.js.map +1 -1
  222. package/lib/util/timeutil.spec.d.ts +1 -0
  223. package/lib/util/timeutil.spec.d.ts.map +1 -1
  224. package/lib/util/timeutil.spec.js +10 -0
  225. package/lib/util/timeutil.spec.js.map +1 -1
  226. package/lib/util/tracing.d.ts +6 -6
  227. package/lib/util/tracing.d.ts.map +1 -1
  228. package/lib/util/tracing.js +14 -16
  229. package/lib/util/tracing.js.map +1 -1
  230. package/lib/util/tracing.spec.js +3 -3
  231. package/lib/util/tracing.spec.js.map +1 -1
  232. package/lib/util/workspace-port-authentication.d.ts +7 -7
  233. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  234. package/lib/util/workspace-port-authentication.js +8 -11
  235. package/lib/util/workspace-port-authentication.js.map +1 -1
  236. package/lib/webhook-event.d.ts +44 -0
  237. package/lib/webhook-event.d.ts.map +1 -0
  238. package/lib/{theia-plugins.js → webhook-event.js} +2 -2
  239. package/lib/webhook-event.js.map +1 -0
  240. package/lib/workspace-class.d.ts +14 -0
  241. package/lib/workspace-class.d.ts.map +1 -0
  242. package/lib/workspace-class.js +8 -0
  243. package/lib/workspace-class.js.map +1 -0
  244. package/lib/workspace-cluster.d.ts +6 -8
  245. package/lib/workspace-cluster.d.ts.map +1 -1
  246. package/lib/workspace-cluster.js +2 -4
  247. package/lib/workspace-cluster.js.map +1 -1
  248. package/lib/workspace-instance.d.ts +20 -3
  249. package/lib/workspace-instance.d.ts.map +1 -1
  250. package/lib/wsready.d.ts +3 -3
  251. package/lib/wsready.d.ts.map +1 -1
  252. package/lib/wsready.js +0 -2
  253. package/lib/wsready.js.map +1 -1
  254. package/package.json +12 -6
  255. package/pkg-yarn.lock +8 -5
  256. package/provenance-bundle.jsonl +1 -1
  257. package/src/accounting-protocol.ts +66 -51
  258. package/src/admin-protocol.ts +30 -20
  259. package/src/analytics.ts +21 -21
  260. package/src/attribution.ts +48 -0
  261. package/src/auth.ts +2 -2
  262. package/src/billing-mode.ts +67 -0
  263. package/src/blocked-repositories-protocol.ts +13 -0
  264. package/src/context-url.spec.ts +25 -11
  265. package/src/context-url.ts +80 -78
  266. package/src/email-protocol.ts +5 -6
  267. package/src/encryption/container-module.ts +2 -3
  268. package/src/encryption/encryption-engine.spec.ts +9 -8
  269. package/src/encryption/encryption-engine.ts +14 -14
  270. package/src/encryption/encryption-service.ts +4 -5
  271. package/src/encryption/key-provider.ts +16 -19
  272. package/src/env.ts +0 -22
  273. package/src/experiments/always-default.ts +24 -0
  274. package/src/experiments/configcat-server.ts +41 -0
  275. package/src/experiments/configcat.ts +58 -0
  276. package/src/experiments/types.ts +35 -0
  277. package/src/gitpod-file-parser.spec.ts +55 -61
  278. package/src/gitpod-file-parser.ts +16 -17
  279. package/src/gitpod-service.ts +189 -111
  280. package/src/headless-workspace-log.ts +5 -4
  281. package/src/ide-frontend-service.ts +2 -2
  282. package/src/ide-protocol.ts +18 -8
  283. package/src/index.ts +17 -16
  284. package/src/installation-admin-protocol.ts +11 -8
  285. package/src/license-protocol.ts +12 -6
  286. package/src/messaging/browser/connection.ts +45 -47
  287. package/src/messaging/browser/window-connection.ts +39 -29
  288. package/src/messaging/client-call-metrics.ts +62 -82
  289. package/src/messaging/error.ts +20 -7
  290. package/src/messaging/handler.ts +6 -6
  291. package/src/messaging/node/connection.ts +8 -8
  292. package/src/messaging/proxy-factory.ts +23 -30
  293. package/src/oss-allowlist.ts +3 -3
  294. package/src/payment-protocol.ts +2 -2
  295. package/src/permission.ts +20 -31
  296. package/src/plans.ts +240 -189
  297. package/src/protocol.spec.ts +97 -0
  298. package/src/protocol.ts +456 -242
  299. package/src/snapshot-url.spec.ts +9 -7
  300. package/src/team-subscription-protocol.ts +57 -22
  301. package/src/teams-projects-protocol.ts +28 -8
  302. package/src/typings/globals.ts +4 -4
  303. package/src/usage.ts +128 -0
  304. package/src/util/analytics.ts +46 -42
  305. package/src/util/async-iterator.ts +4 -5
  306. package/src/util/cancelable.ts +3 -3
  307. package/src/util/date-time.ts +8 -8
  308. package/src/util/debug-app.ts +81 -0
  309. package/src/util/deferred.ts +6 -6
  310. package/src/util/disposable.ts +3 -6
  311. package/src/util/event.ts +9 -11
  312. package/src/util/garbage-collected-cache.ts +8 -6
  313. package/src/util/generate-workspace-id.spec.ts +26 -16
  314. package/src/util/generate-workspace-id.ts +460 -454
  315. package/src/util/gitpod-cookie.ts +8 -9
  316. package/src/util/gitpod-host-url.spec.ts +40 -13
  317. package/src/util/gitpod-host-url.ts +57 -33
  318. package/src/util/grpc.ts +90 -1
  319. package/src/util/jaeger-client-types.ts +2 -2
  320. package/src/util/logging.spec.ts +23 -0
  321. package/src/util/logging.ts +60 -42
  322. package/src/util/make-link.ts +6 -7
  323. package/src/util/parse-workspace-id.spec.ts +17 -8
  324. package/src/util/parse-workspace-id.ts +5 -6
  325. package/src/util/queue.spec.ts +27 -25
  326. package/src/util/repeat.ts +1 -1
  327. package/src/util/semaphore.ts +4 -6
  328. package/src/util/skip-if.ts +9 -6
  329. package/src/util/timeutil.spec.ts +19 -14
  330. package/src/util/timeutil.ts +27 -11
  331. package/src/util/tracing.spec.ts +28 -23
  332. package/src/util/tracing.ts +54 -51
  333. package/src/util/workspace-port-authentication.ts +10 -13
  334. package/src/webhook-event.ts +55 -0
  335. package/src/workspace-class.ts +14 -0
  336. package/src/workspace-cluster.ts +14 -13
  337. package/src/workspace-instance.ts +60 -24
  338. package/src/wsready.ts +5 -4
  339. package/data/builtin-theia-plugins.json +0 -372
  340. package/lib/theia-plugins.d.ts +0 -11
  341. package/lib/theia-plugins.d.ts.map +0 -1
  342. package/lib/theia-plugins.js.map +0 -1
package/lib/protocol.js CHANGED
@@ -5,40 +5,47 @@
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
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;
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.SSHPublicKeyValue = exports.UserEnvVar = exports.WorkspaceFeatureFlags = exports.AdditionalUserData = exports.User = void 0;
9
9
  const crypto_1 = require("crypto");
10
10
  var User;
11
11
  (function (User) {
12
12
  function is(data) {
13
- return data
14
- && data.hasOwnProperty('id')
15
- && data.hasOwnProperty('identities');
13
+ return data && data.hasOwnProperty("id") && data.hasOwnProperty("identities");
16
14
  }
17
15
  User.is = is;
18
16
  function getIdentity(user, authProviderId) {
19
- return user.identities.find(id => id.authProviderId === authProviderId);
17
+ return user.identities.find((id) => id.authProviderId === authProviderId);
20
18
  }
21
19
  User.getIdentity = getIdentity;
22
20
  function censor(user) {
23
21
  const res = Object.assign({}, user);
24
- delete (res.additionalData);
25
- res.identities = res.identities.map(i => {
26
- delete (i.tokens);
22
+ delete res.additionalData;
23
+ res.identities = res.identities.map((i) => {
24
+ delete i.tokens;
27
25
  // The user field is not in the Identity shape, but actually exists on DBIdentity.
28
26
  // Trying to push this object out via JSON RPC will fail because of the cyclic nature
29
27
  // of this field.
30
- delete (i.user);
28
+ delete i.user;
31
29
  return i;
32
30
  });
33
31
  return res;
34
32
  }
35
33
  User.censor = censor;
34
+ /**
35
+ * Returns the stored email or if it doesn't exist returns the primaryEmail of the first identity this user signed up with.
36
+ * @param user
37
+ * @returns A primaryEmail, or undefined if there is none.
38
+ */
36
39
  function getPrimaryEmail(user) {
37
- const identities = user.identities.filter(i => !!i.primaryEmail);
40
+ var _a, _b, _c, _d;
41
+ if ((_b = (_a = user.additionalData) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.emailAddress) {
42
+ return (_d = (_c = user.additionalData) === null || _c === void 0 ? void 0 : _c.profile) === null || _d === void 0 ? void 0 : _d.emailAddress;
43
+ }
44
+ const identities = user.identities.filter((i) => !!i.primaryEmail);
38
45
  if (identities.length <= 0) {
39
- throw new Error(`No identity with primary email for user: ${user.id}!`);
46
+ return undefined;
40
47
  }
41
- return identities[0].primaryEmail;
48
+ return identities[0].primaryEmail || undefined;
42
49
  }
43
50
  User.getPrimaryEmail = getPrimaryEmail;
44
51
  function getName(user) {
@@ -54,14 +61,148 @@ var User;
54
61
  return undefined;
55
62
  }
56
63
  User.getName = getName;
64
+ function hasPreferredIde(user) {
65
+ var _a, _b, _c, _d;
66
+ return (typeof ((_b = (_a = user === null || user === void 0 ? void 0 : user.additionalData) === null || _a === void 0 ? void 0 : _a.ideSettings) === null || _b === void 0 ? void 0 : _b.defaultIde) !== "undefined" ||
67
+ typeof ((_d = (_c = user === null || user === void 0 ? void 0 : user.additionalData) === null || _c === void 0 ? void 0 : _c.ideSettings) === null || _d === void 0 ? void 0 : _d.useLatestVersion) !== "undefined");
68
+ }
69
+ User.hasPreferredIde = hasPreferredIde;
70
+ function isOnboardingUser(user) {
71
+ return !hasPreferredIde(user);
72
+ }
73
+ User.isOnboardingUser = isOnboardingUser;
74
+ function migrationIDESettings(user) {
75
+ var _a;
76
+ if (!((_a = user === null || user === void 0 ? void 0 : user.additionalData) === null || _a === void 0 ? void 0 : _a.ideSettings) ||
77
+ Object.keys(user.additionalData.ideSettings).length === 0 ||
78
+ user.additionalData.ideSettings.settingVersion === "2.0") {
79
+ return;
80
+ }
81
+ const newIDESettings = {
82
+ settingVersion: "2.0",
83
+ };
84
+ const ideSettings = user.additionalData.ideSettings;
85
+ if (ideSettings.useDesktopIde) {
86
+ if (ideSettings.defaultDesktopIde === "code-desktop") {
87
+ newIDESettings.defaultIde = "code-desktop";
88
+ }
89
+ else if (ideSettings.defaultDesktopIde === "code-desktop-insiders") {
90
+ newIDESettings.defaultIde = "code-desktop";
91
+ newIDESettings.useLatestVersion = true;
92
+ }
93
+ else {
94
+ newIDESettings.defaultIde = ideSettings.defaultDesktopIde;
95
+ newIDESettings.useLatestVersion = ideSettings.useLatestVersion;
96
+ }
97
+ }
98
+ else {
99
+ const useLatest = ideSettings.defaultIde === "code-latest";
100
+ newIDESettings.defaultIde = "code";
101
+ newIDESettings.useLatestVersion = useLatest;
102
+ }
103
+ user.additionalData.ideSettings = newIDESettings;
104
+ }
105
+ User.migrationIDESettings = migrationIDESettings;
106
+ function getProfile(user) {
107
+ var _a, _b;
108
+ return {
109
+ name: User.getName(user) || "",
110
+ email: User.getPrimaryEmail(user) || "",
111
+ company: (_b = (_a = user === null || user === void 0 ? void 0 : user.additionalData) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.companyName,
112
+ avatarURL: user === null || user === void 0 ? void 0 : user.avatarUrl,
113
+ };
114
+ }
115
+ User.getProfile = getProfile;
116
+ function setProfile(user, profile) {
117
+ user.fullName = profile.name;
118
+ user.avatarUrl = profile.avatarURL;
119
+ if (!user.additionalData) {
120
+ user.additionalData = {};
121
+ }
122
+ if (!user.additionalData.profile) {
123
+ user.additionalData.profile = {};
124
+ }
125
+ user.additionalData.profile.emailAddress = profile.email;
126
+ user.additionalData.profile.companyName = profile.company;
127
+ user.additionalData.profile.lastUpdatedDetailsNudge = new Date().toISOString();
128
+ return user;
129
+ }
130
+ User.setProfile = setProfile;
131
+ let Profile;
132
+ (function (Profile) {
133
+ function hasChanges(before, after) {
134
+ return (before.name !== after.name ||
135
+ before.email !== after.email ||
136
+ before.company !== after.company ||
137
+ before.avatarURL !== after.avatarURL);
138
+ }
139
+ Profile.hasChanges = hasChanges;
140
+ })(Profile = User.Profile || (User.Profile = {}));
57
141
  })(User = exports.User || (exports.User = {}));
142
+ var AdditionalUserData;
143
+ (function (AdditionalUserData) {
144
+ function set(user, partialData) {
145
+ if (!user.additionalData) {
146
+ user.additionalData = Object.assign({}, partialData);
147
+ }
148
+ else {
149
+ user.additionalData = Object.assign(Object.assign({}, user.additionalData), partialData);
150
+ }
151
+ return user;
152
+ }
153
+ AdditionalUserData.set = set;
154
+ })(AdditionalUserData = exports.AdditionalUserData || (exports.AdditionalUserData = {}));
58
155
  /**
59
156
  * The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
60
157
  * If they don't we'll break things during workspace startup.
61
158
  */
62
- exports.WorkspaceFeatureFlags = { "full_workspace_backup": undefined, "fixed_resources": undefined };
159
+ exports.WorkspaceFeatureFlags = {
160
+ full_workspace_backup: undefined,
161
+ persistent_volume_claim: undefined,
162
+ protected_secrets: undefined,
163
+ workspace_class_limiting: undefined,
164
+ };
63
165
  var UserEnvVar;
64
166
  (function (UserEnvVar) {
167
+ /**
168
+ * @param variable
169
+ * @returns Either a string containing an error message or undefined.
170
+ */
171
+ function validate(variable) {
172
+ const name = variable.name;
173
+ const pattern = variable.repositoryPattern;
174
+ if (name.trim() === "") {
175
+ return "Name must not be empty.";
176
+ }
177
+ if (name.length > 255) {
178
+ return "Name too long. Maximum name length is 255 characters.";
179
+ }
180
+ if (!/^[a-zA-Z_]+[a-zA-Z0-9_]*$/.test(name)) {
181
+ return "Name must match /^[a-zA-Z_]+[a-zA-Z0-9_]*$/.";
182
+ }
183
+ if (variable.value.trim() === "") {
184
+ return "Value must not be empty.";
185
+ }
186
+ if (variable.value.length > 32767) {
187
+ return "Value too long. Maximum value length is 32767 characters.";
188
+ }
189
+ if (pattern.trim() === "") {
190
+ return "Scope must not be empty.";
191
+ }
192
+ const split = pattern.split("/");
193
+ if (split.length < 2) {
194
+ return "A scope must use the form 'organization/repo'.";
195
+ }
196
+ for (const name of split) {
197
+ if (name !== "*") {
198
+ if (!/^[a-zA-Z0-9_\-.\*]+$/.test(name)) {
199
+ return "Invalid scope segment. Only ASCII characters, numbers, -, _, . or * are allowed.";
200
+ }
201
+ }
202
+ }
203
+ return undefined;
204
+ }
205
+ UserEnvVar.validate = validate;
65
206
  // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
66
207
  function normalizeRepoPattern(pattern) {
67
208
  return pattern.toLocaleLowerCase();
@@ -81,7 +222,7 @@ var UserEnvVar;
81
222
  if (repoPattern == "*") {
82
223
  score += 1;
83
224
  }
84
- if (ownerPattern == '*') {
225
+ if (ownerPattern == "*") {
85
226
  score += 2;
86
227
  }
87
228
  if (ownerPattern == "#" || repoPattern == "#") {
@@ -92,19 +233,19 @@ var UserEnvVar;
92
233
  UserEnvVar.score = score;
93
234
  // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
94
235
  function filter(vars, owner, repo) {
95
- let result = vars.filter(e => {
236
+ let result = vars.filter((e) => {
96
237
  const [ownerPattern, repoPattern] = splitRepositoryPattern(e.repositoryPattern);
97
- if (ownerPattern !== '*' && ownerPattern !== '#' && (!!owner && ownerPattern !== owner.toLocaleLowerCase())) {
238
+ if (ownerPattern !== "*" && ownerPattern !== "#" && !!owner && ownerPattern !== owner.toLocaleLowerCase()) {
98
239
  return false;
99
240
  }
100
- if (repoPattern !== '*' && repoPattern !== '#' && (!!repo && repoPattern !== repo.toLocaleLowerCase())) {
241
+ if (repoPattern !== "*" && repoPattern !== "#" && !!repo && repoPattern !== repo.toLocaleLowerCase()) {
101
242
  return false;
102
243
  }
103
244
  return true;
104
245
  });
105
246
  const resmap = new Map();
106
- result.forEach(e => {
107
- const l = (resmap.get(e.name) || []);
247
+ result.forEach((e) => {
248
+ const l = resmap.get(e.name) || [];
108
249
  l.push(e);
109
250
  resmap.set(e.name, l);
110
251
  });
@@ -135,13 +276,61 @@ var UserEnvVar;
135
276
  UserEnvVar.filter = filter;
136
277
  // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
137
278
  function splitRepositoryPattern(repositoryPattern) {
138
- const patterns = repositoryPattern.split('/');
139
- const repoPattern = patterns.slice(1).join('/');
279
+ const patterns = repositoryPattern.split("/");
280
+ const repoPattern = patterns.slice(1).join("/");
140
281
  const ownerPattern = patterns[0];
141
282
  return [ownerPattern, repoPattern];
142
283
  }
143
284
  UserEnvVar.splitRepositoryPattern = splitRepositoryPattern;
144
285
  })(UserEnvVar = exports.UserEnvVar || (exports.UserEnvVar = {}));
286
+ var SSHPublicKeyValue;
287
+ (function (SSHPublicKeyValue) {
288
+ function validate(value) {
289
+ if (value.name.length === 0) {
290
+ return "Title must not be empty.";
291
+ }
292
+ if (value.name.length > 255) {
293
+ return "Title too long. Maximum value length is 255 characters.";
294
+ }
295
+ if (value.key.length === 0) {
296
+ return "Key must not be empty.";
297
+ }
298
+ try {
299
+ getData(value);
300
+ }
301
+ catch (e) {
302
+ return "Key is invalid. You must supply a key in OpenSSH public key format.";
303
+ }
304
+ return;
305
+ }
306
+ SSHPublicKeyValue.validate = validate;
307
+ function getData(value) {
308
+ var _a, _b, _c;
309
+ // Begins with 'ssh-rsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'ssh-ed25519', 'sk-ecdsa-sha2-nistp256@openssh.com', or 'sk-ssh-ed25519@openssh.com'.
310
+ const regex = /^(?<type>ssh-rsa|ecdsa-sha2-nistp256|ecdsa-sha2-nistp384|ecdsa-sha2-nistp521|ssh-ed25519|sk-ecdsa-sha2-nistp256@openssh\.com|sk-ssh-ed25519@openssh\.com) (?<key>.*?)( (?<email>.*?))?$/;
311
+ const resultGroup = regex.exec(value.key.trim());
312
+ if (!resultGroup) {
313
+ throw new Error("Key is invalid.");
314
+ }
315
+ return {
316
+ type: (_a = resultGroup.groups) === null || _a === void 0 ? void 0 : _a["type"],
317
+ key: (_b = resultGroup.groups) === null || _b === void 0 ? void 0 : _b["key"],
318
+ email: ((_c = resultGroup.groups) === null || _c === void 0 ? void 0 : _c["email"]) || undefined,
319
+ };
320
+ }
321
+ SSHPublicKeyValue.getData = getData;
322
+ function getFingerprint(value) {
323
+ const data = getData(value);
324
+ let buf = Buffer.from(data.key, "base64");
325
+ // gitlab style
326
+ // const hash = createHash("md5").update(buf).digest("hex");
327
+ // github style
328
+ const hash = (0, crypto_1.createHash)("sha256").update(buf).digest("base64");
329
+ return hash;
330
+ }
331
+ SSHPublicKeyValue.getFingerprint = getFingerprint;
332
+ SSHPublicKeyValue.MAXIMUM_KEY_LENGTH = 5;
333
+ })(SSHPublicKeyValue = exports.SSHPublicKeyValue || (exports.SSHPublicKeyValue = {}));
145
334
  var GitpodTokenType;
146
335
  (function (GitpodTokenType) {
147
336
  GitpodTokenType[GitpodTokenType["API_AUTH_TOKEN"] = 0] = "API_AUTH_TOKEN";
@@ -150,14 +339,11 @@ var GitpodTokenType;
150
339
  var Identity;
151
340
  (function (Identity) {
152
341
  function is(data) {
153
- return data.hasOwnProperty('authProviderId')
154
- && data.hasOwnProperty('authId')
155
- && data.hasOwnProperty('authName');
342
+ return (data.hasOwnProperty("authProviderId") && data.hasOwnProperty("authId") && data.hasOwnProperty("authName"));
156
343
  }
157
344
  Identity.is = is;
158
345
  function equals(id1, id2) {
159
- return id1.authProviderId === id2.authProviderId
160
- && id1.authId === id2.authId;
346
+ return id1.authProviderId === id2.authProviderId && id1.authId === id2.authId;
161
347
  }
162
348
  Identity.equals = equals;
163
349
  })(Identity = exports.Identity || (exports.Identity = {}));
@@ -165,7 +351,7 @@ var Workspace;
165
351
  (function (Workspace) {
166
352
  function getFullRepositoryName(ws) {
167
353
  if (CommitContext.is(ws.context)) {
168
- return ws.context.repository.owner + '/' + ws.context.repository.name;
354
+ return ws.context.repository.owner + "/" + ws.context.repository.name;
169
355
  }
170
356
  return undefined;
171
357
  }
@@ -209,29 +395,28 @@ var Workspace;
209
395
  var GithubAppPrebuildConfig;
210
396
  (function (GithubAppPrebuildConfig) {
211
397
  function is(obj) {
212
- return !(typeof obj === 'boolean');
398
+ return !(typeof obj === "boolean");
213
399
  }
214
400
  GithubAppPrebuildConfig.is = is;
215
401
  })(GithubAppPrebuildConfig = exports.GithubAppPrebuildConfig || (exports.GithubAppPrebuildConfig = {}));
216
402
  var WorkspaceImageSourceDocker;
217
403
  (function (WorkspaceImageSourceDocker) {
218
404
  function is(obj) {
219
- return 'dockerFileHash' in obj
220
- && 'dockerFilePath' in obj;
405
+ return "dockerFileHash" in obj && "dockerFilePath" in obj;
221
406
  }
222
407
  WorkspaceImageSourceDocker.is = is;
223
408
  })(WorkspaceImageSourceDocker = exports.WorkspaceImageSourceDocker || (exports.WorkspaceImageSourceDocker = {}));
224
409
  var WorkspaceImageSourceReference;
225
410
  (function (WorkspaceImageSourceReference) {
226
411
  function is(obj) {
227
- return 'baseImageResolved' in obj;
412
+ return "baseImageResolved" in obj;
228
413
  }
229
414
  WorkspaceImageSourceReference.is = is;
230
415
  })(WorkspaceImageSourceReference = exports.WorkspaceImageSourceReference || (exports.WorkspaceImageSourceReference = {}));
231
416
  var PrebuiltWorkspace;
232
417
  (function (PrebuiltWorkspace) {
233
418
  function isDone(pws) {
234
- return pws.state === "available" || pws.state === "timeout" || pws.state === 'aborted';
419
+ return (pws.state === "available" || pws.state === "timeout" || pws.state === "aborted" || pws.state === "failed");
235
420
  }
236
421
  PrebuiltWorkspace.isDone = isDone;
237
422
  function isAvailable(pws) {
@@ -246,22 +431,21 @@ var PrebuiltWorkspace;
246
431
  var PortConfig;
247
432
  (function (PortConfig) {
248
433
  function is(config) {
249
- return config && ('port' in config) && (typeof config.port === 'number');
434
+ return config && "port" in config && typeof config.port === "number";
250
435
  }
251
436
  PortConfig.is = is;
252
437
  })(PortConfig = exports.PortConfig || (exports.PortConfig = {}));
253
438
  var PortRangeConfig;
254
439
  (function (PortRangeConfig) {
255
440
  function is(config) {
256
- return config && ('port' in config) && (typeof config.port === 'string' || config.port instanceof String);
441
+ return config && "port" in config && (typeof config.port === "string" || config.port instanceof String);
257
442
  }
258
443
  PortRangeConfig.is = is;
259
444
  })(PortRangeConfig = exports.PortRangeConfig || (exports.PortRangeConfig = {}));
260
445
  var TaskConfig;
261
446
  (function (TaskConfig) {
262
447
  function is(config) {
263
- return config
264
- && ('command' in config || 'init' in config || 'before' in config);
448
+ return config && ("command" in config || "init" in config || "before" in config);
265
449
  }
266
450
  TaskConfig.is = is;
267
451
  })(TaskConfig = exports.TaskConfig || (exports.TaskConfig = {}));
@@ -269,66 +453,56 @@ var WorkspaceImageBuild;
269
453
  (function (WorkspaceImageBuild) {
270
454
  let LogLine;
271
455
  (function (LogLine) {
272
- LogLine.DELIMITER = '\r\n';
456
+ LogLine.DELIMITER = "\r\n";
273
457
  LogLine.DELIMITER_REGEX = /\r?\n/;
274
458
  })(LogLine = WorkspaceImageBuild.LogLine || (WorkspaceImageBuild.LogLine = {}));
275
459
  })(WorkspaceImageBuild = exports.WorkspaceImageBuild || (exports.WorkspaceImageBuild = {}));
276
460
  var ImageConfigString;
277
461
  (function (ImageConfigString) {
278
462
  function is(config) {
279
- return typeof config === 'string';
463
+ return typeof config === "string";
280
464
  }
281
465
  ImageConfigString.is = is;
282
466
  })(ImageConfigString = exports.ImageConfigString || (exports.ImageConfigString = {}));
283
467
  var ImageConfigFile;
284
468
  (function (ImageConfigFile) {
285
469
  function is(config) {
286
- return typeof config === 'object'
287
- && 'file' in config;
470
+ return typeof config === "object" && "file" in config;
288
471
  }
289
472
  ImageConfigFile.is = is;
290
473
  })(ImageConfigFile = exports.ImageConfigFile || (exports.ImageConfigFile = {}));
291
474
  var ExternalImageConfigFile;
292
475
  (function (ExternalImageConfigFile) {
293
476
  function is(config) {
294
- return typeof config === 'object'
295
- && 'file' in config
296
- && 'externalSource' in config;
477
+ return typeof config === "object" && "file" in config && "externalSource" in config;
297
478
  }
298
479
  ExternalImageConfigFile.is = is;
299
480
  })(ExternalImageConfigFile = exports.ExternalImageConfigFile || (exports.ExternalImageConfigFile = {}));
300
481
  var WorkspaceContext;
301
482
  (function (WorkspaceContext) {
302
483
  function is(context) {
303
- return context
304
- && 'title' in context;
484
+ return context && "title" in context;
305
485
  }
306
486
  WorkspaceContext.is = is;
307
487
  })(WorkspaceContext = exports.WorkspaceContext || (exports.WorkspaceContext = {}));
308
488
  var WithSnapshot;
309
489
  (function (WithSnapshot) {
310
490
  function is(context) {
311
- return context
312
- && 'snapshotBucketId' in context;
491
+ return context && "snapshotBucketId" in context;
313
492
  }
314
493
  WithSnapshot.is = is;
315
494
  })(WithSnapshot = exports.WithSnapshot || (exports.WithSnapshot = {}));
316
495
  var WithPrebuild;
317
496
  (function (WithPrebuild) {
318
497
  function is(context) {
319
- return context
320
- && WithSnapshot.is(context)
321
- && 'prebuildWorkspaceId' in context
322
- && 'wasPrebuilt' in context;
498
+ return context && WithSnapshot.is(context) && "prebuildWorkspaceId" in context && "wasPrebuilt" in context;
323
499
  }
324
500
  WithPrebuild.is = is;
325
501
  })(WithPrebuild = exports.WithPrebuild || (exports.WithPrebuild = {}));
326
502
  var WithDefaultConfig;
327
503
  (function (WithDefaultConfig) {
328
504
  function is(context) {
329
- return context
330
- && 'withDefaultConfig' in context
331
- && context.withDefaultConfig;
505
+ return context && "withDefaultConfig" in context && context.withDefaultConfig;
332
506
  }
333
507
  WithDefaultConfig.is = is;
334
508
  function mark(ctx) {
@@ -339,51 +513,42 @@ var WithDefaultConfig;
339
513
  var SnapshotContext;
340
514
  (function (SnapshotContext) {
341
515
  function is(context) {
342
- return context
343
- && WithSnapshot.is(context)
344
- && 'snapshotId' in context;
516
+ return context && WithSnapshot.is(context) && "snapshotId" in context;
345
517
  }
346
518
  SnapshotContext.is = is;
347
519
  })(SnapshotContext = exports.SnapshotContext || (exports.SnapshotContext = {}));
348
520
  var StartPrebuildContext;
349
521
  (function (StartPrebuildContext) {
350
522
  function is(context) {
351
- return context
352
- && 'actual' in context;
523
+ return context && "actual" in context;
353
524
  }
354
525
  StartPrebuildContext.is = is;
355
526
  })(StartPrebuildContext = exports.StartPrebuildContext || (exports.StartPrebuildContext = {}));
356
527
  var PrebuiltWorkspaceContext;
357
528
  (function (PrebuiltWorkspaceContext) {
358
529
  function is(context) {
359
- return context
360
- && 'originalContext' in context
361
- && 'prebuiltWorkspace' in context;
530
+ return context && "originalContext" in context && "prebuiltWorkspace" in context;
362
531
  }
363
532
  PrebuiltWorkspaceContext.is = is;
364
533
  })(PrebuiltWorkspaceContext = exports.PrebuiltWorkspaceContext || (exports.PrebuiltWorkspaceContext = {}));
365
534
  var WithReferrerContext;
366
535
  (function (WithReferrerContext) {
367
536
  function is(context) {
368
- return context
369
- && 'referrer' in context;
537
+ return context && "referrer" in context;
370
538
  }
371
539
  WithReferrerContext.is = is;
372
540
  })(WithReferrerContext = exports.WithReferrerContext || (exports.WithReferrerContext = {}));
373
541
  var WithEnvvarsContext;
374
542
  (function (WithEnvvarsContext) {
375
543
  function is(context) {
376
- return context
377
- && 'envvars' in context;
544
+ return context && "envvars" in context;
378
545
  }
379
546
  WithEnvvarsContext.is = is;
380
547
  })(WithEnvvarsContext = exports.WithEnvvarsContext || (exports.WithEnvvarsContext = {}));
381
548
  var WorkspaceProbeContext;
382
549
  (function (WorkspaceProbeContext) {
383
550
  function is(context) {
384
- return context
385
- && 'responseURL' in context
386
- && 'responseToken' in context;
551
+ return context && "responseURL" in context && "responseToken" in context;
387
552
  }
388
553
  WorkspaceProbeContext.is = is;
389
554
  })(WorkspaceProbeContext = exports.WorkspaceProbeContext || (exports.WorkspaceProbeContext = {}));
@@ -400,7 +565,7 @@ var RefType;
400
565
  var AdditionalContentContext;
401
566
  (function (AdditionalContentContext) {
402
567
  function is(ctx) {
403
- return 'additionalFiles' in ctx;
568
+ return "additionalFiles" in ctx;
404
569
  }
405
570
  AdditionalContentContext.is = is;
406
571
  function hasDockerConfig(ctx, config) {
@@ -418,52 +583,43 @@ var CommitContext;
418
583
  */
419
584
  function computeHash(commitContext) {
420
585
  // for single commits we use the revision to be backward compatible.
421
- if (!commitContext.additionalRepositoryCheckoutInfo || commitContext.additionalRepositoryCheckoutInfo.length === 0) {
586
+ if (!commitContext.additionalRepositoryCheckoutInfo ||
587
+ commitContext.additionalRepositoryCheckoutInfo.length === 0) {
422
588
  return commitContext.revision;
423
589
  }
424
- const hasher = (0, crypto_1.createHash)('sha256');
590
+ const hasher = (0, crypto_1.createHash)("sha256");
425
591
  hasher.update(commitContext.revision);
426
592
  for (const info of commitContext.additionalRepositoryCheckoutInfo) {
427
593
  hasher.update(info.revision);
428
594
  }
429
- return hasher.digest('hex');
595
+ return hasher.digest("hex");
430
596
  }
431
597
  CommitContext.computeHash = computeHash;
432
598
  })(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
433
599
  (function (CommitContext) {
434
600
  function is(commit) {
435
- return WorkspaceContext.is(commit)
436
- && 'repository' in commit
437
- && 'revision' in commit;
601
+ return WorkspaceContext.is(commit) && "repository" in commit && "revision" in commit;
438
602
  }
439
603
  CommitContext.is = is;
440
604
  })(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
441
605
  var PullRequestContext;
442
606
  (function (PullRequestContext) {
443
607
  function is(ctx) {
444
- return CommitContext.is(ctx)
445
- && 'nr' in ctx
446
- && 'ref' in ctx
447
- && 'base' in ctx;
608
+ return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "base" in ctx;
448
609
  }
449
610
  PullRequestContext.is = is;
450
611
  })(PullRequestContext = exports.PullRequestContext || (exports.PullRequestContext = {}));
451
612
  var IssueContext;
452
613
  (function (IssueContext) {
453
614
  function is(ctx) {
454
- return CommitContext.is(ctx)
455
- && 'nr' in ctx
456
- && 'ref' in ctx
457
- && 'localBranch' in ctx;
615
+ return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "localBranch" in ctx;
458
616
  }
459
617
  IssueContext.is = is;
460
618
  })(IssueContext = exports.IssueContext || (exports.IssueContext = {}));
461
619
  var NavigatorContext;
462
620
  (function (NavigatorContext) {
463
621
  function is(ctx) {
464
- return CommitContext.is(ctx)
465
- && 'path' in ctx
466
- && 'isFile' in ctx;
622
+ return CommitContext.is(ctx) && "path" in ctx && "isFile" in ctx;
467
623
  }
468
624
  NavigatorContext.is = is;
469
625
  })(NavigatorContext = exports.NavigatorContext || (exports.NavigatorContext = {}));
@@ -503,10 +659,11 @@ var CreateWorkspaceMode;
503
659
  var WorkspaceCreationResult;
504
660
  (function (WorkspaceCreationResult) {
505
661
  function is(data) {
506
- return data && ('createdWorkspaceId' in data
507
- || 'existingWorkspaces' in data
508
- || 'runningWorkspacePrebuild' in data
509
- || 'runningPrebuildWorkspaceID' in data);
662
+ return (data &&
663
+ ("createdWorkspaceId" in data ||
664
+ "existingWorkspaces" in data ||
665
+ "runningWorkspacePrebuild" in data ||
666
+ "runningPrebuildWorkspaceID" in data));
510
667
  }
511
668
  WorkspaceCreationResult.is = is;
512
669
  })(WorkspaceCreationResult = exports.WorkspaceCreationResult || (exports.WorkspaceCreationResult = {}));