@gitpod/gitpod-protocol 0.1.5-tar-telemetry-settings-data.3 → 0.1.5-tar-sh-active-users.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 (344) hide show
  1. package/data/gitpod-schema.json +97 -5
  2. package/lib/accounting-protocol.d.ts +18 -10
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +34 -32
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +9 -2
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js.map +1 -1
  9. package/lib/analytics.d.ts +4 -5
  10. package/lib/analytics.d.ts.map +1 -1
  11. package/lib/analytics.js.map +1 -1
  12. package/lib/attribution.d.ts +20 -0
  13. package/lib/attribution.d.ts.map +1 -0
  14. package/lib/attribution.js +40 -0
  15. package/lib/attribution.js.map +1 -0
  16. package/lib/auth.d.ts.map +1 -1
  17. package/lib/billing-mode.d.ts +40 -0
  18. package/lib/billing-mode.d.ts.map +1 -0
  19. package/lib/billing-mode.js +36 -0
  20. package/lib/billing-mode.js.map +1 -0
  21. package/lib/blocked-repositories-protocol.d.ts +13 -0
  22. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  23. package/lib/blocked-repositories-protocol.js +8 -0
  24. package/lib/blocked-repositories-protocol.js.map +1 -0
  25. package/lib/context-url.d.ts.map +1 -1
  26. package/lib/context-url.js +4 -4
  27. package/lib/context-url.js.map +1 -1
  28. package/lib/context-url.spec.d.ts.map +1 -1
  29. package/lib/context-url.spec.js +20 -5
  30. package/lib/context-url.spec.js.map +1 -1
  31. package/lib/email-protocol.d.ts +1 -1
  32. package/lib/email-protocol.d.ts.map +1 -1
  33. package/lib/email-protocol.js.map +1 -1
  34. package/lib/encryption/container-module.d.ts.map +1 -1
  35. package/lib/encryption/container-module.js +1 -1
  36. package/lib/encryption/container-module.js.map +1 -1
  37. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  38. package/lib/encryption/encryption-engine.js +7 -7
  39. package/lib/encryption/encryption-engine.js.map +1 -1
  40. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  41. package/lib/encryption/encryption-engine.spec.js +2 -3
  42. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  43. package/lib/encryption/encryption-service.d.ts.map +1 -1
  44. package/lib/encryption/encryption-service.js +1 -1
  45. package/lib/encryption/encryption-service.js.map +1 -1
  46. package/lib/encryption/key-provider.d.ts.map +1 -1
  47. package/lib/encryption/key-provider.js +7 -9
  48. package/lib/encryption/key-provider.js.map +1 -1
  49. package/lib/env.d.ts +0 -5
  50. package/lib/env.d.ts.map +1 -1
  51. package/lib/env.js +1 -20
  52. package/lib/env.js.map +1 -1
  53. package/lib/experiments/always-default.d.ts +8 -0
  54. package/lib/experiments/always-default.d.ts.map +1 -0
  55. package/lib/experiments/always-default.js +20 -0
  56. package/lib/experiments/always-default.js.map +1 -0
  57. package/lib/experiments/configcat-server.d.ts +10 -0
  58. package/lib/experiments/configcat-server.d.ts.map +1 -0
  59. package/lib/experiments/configcat-server.js +36 -0
  60. package/lib/experiments/configcat-server.js.map +1 -0
  61. package/lib/experiments/configcat.d.ts +22 -0
  62. package/lib/experiments/configcat.d.ts.map +1 -0
  63. package/lib/experiments/configcat.js +53 -0
  64. package/lib/experiments/configcat.js.map +1 -0
  65. package/lib/experiments/types.d.ts +23 -0
  66. package/lib/experiments/types.d.ts.map +1 -0
  67. package/lib/experiments/types.js +10 -0
  68. package/lib/experiments/types.js.map +1 -0
  69. package/lib/gitpod-file-parser.d.ts.map +1 -1
  70. package/lib/gitpod-file-parser.js +6 -6
  71. package/lib/gitpod-file-parser.js.map +1 -1
  72. package/lib/gitpod-file-parser.spec.js +42 -39
  73. package/lib/gitpod-file-parser.spec.js.map +1 -1
  74. package/lib/gitpod-service.d.ts +56 -26
  75. package/lib/gitpod-service.d.ts.map +1 -1
  76. package/lib/gitpod-service.js +40 -33
  77. package/lib/gitpod-service.js.map +1 -1
  78. package/lib/headless-workspace-log.d.ts +1 -0
  79. package/lib/headless-workspace-log.d.ts.map +1 -1
  80. package/lib/headless-workspace-log.js +2 -1
  81. package/lib/headless-workspace-log.js.map +1 -1
  82. package/lib/ide-frontend-service.d.ts +1 -1
  83. package/lib/ide-protocol.d.ts +14 -6
  84. package/lib/ide-protocol.d.ts.map +1 -1
  85. package/lib/index.d.ts +17 -16
  86. package/lib/index.d.ts.map +1 -1
  87. package/lib/index.js +1 -0
  88. package/lib/index.js.map +1 -1
  89. package/lib/installation-admin-protocol.d.ts +4 -0
  90. package/lib/installation-admin-protocol.d.ts.map +1 -1
  91. package/lib/installation-admin-protocol.js +3 -2
  92. package/lib/installation-admin-protocol.js.map +1 -1
  93. package/lib/license-protocol.d.ts +7 -0
  94. package/lib/license-protocol.d.ts.map +1 -1
  95. package/lib/license-protocol.js.map +1 -1
  96. package/lib/messaging/browser/connection.d.ts +1 -1
  97. package/lib/messaging/browser/connection.d.ts.map +1 -1
  98. package/lib/messaging/browser/connection.js +19 -19
  99. package/lib/messaging/browser/connection.js.map +1 -1
  100. package/lib/messaging/browser/window-connection.d.ts +4 -4
  101. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  102. package/lib/messaging/browser/window-connection.js +9 -6
  103. package/lib/messaging/browser/window-connection.js.map +1 -1
  104. package/lib/messaging/client-call-metrics.d.ts +2 -18
  105. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  106. package/lib/messaging/client-call-metrics.js +21 -22
  107. package/lib/messaging/client-call-metrics.js.map +1 -1
  108. package/lib/messaging/error.d.ts +6 -1
  109. package/lib/messaging/error.d.ts.map +1 -1
  110. package/lib/messaging/error.js +13 -3
  111. package/lib/messaging/error.js.map +1 -1
  112. package/lib/messaging/handler.d.ts.map +1 -1
  113. package/lib/messaging/handler.js +1 -1
  114. package/lib/messaging/node/connection.js +8 -8
  115. package/lib/messaging/node/connection.js.map +1 -1
  116. package/lib/messaging/proxy-factory.d.ts +1 -1
  117. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  118. package/lib/messaging/proxy-factory.js +7 -9
  119. package/lib/messaging/proxy-factory.js.map +1 -1
  120. package/lib/payment-protocol.d.ts.map +1 -1
  121. package/lib/payment-protocol.js +1 -1
  122. package/lib/payment-protocol.js.map +1 -1
  123. package/lib/permission.d.ts +2 -2
  124. package/lib/permission.d.ts.map +1 -1
  125. package/lib/permission.js +12 -23
  126. package/lib/permission.js.map +1 -1
  127. package/lib/plans.d.ts +4 -3
  128. package/lib/plans.d.ts.map +1 -1
  129. package/lib/plans.js +210 -171
  130. package/lib/plans.js.map +1 -1
  131. package/lib/protocol.d.ts +146 -39
  132. package/lib/protocol.d.ts.map +1 -1
  133. package/lib/protocol.js +267 -88
  134. package/lib/protocol.js.map +1 -1
  135. package/{src/theia-plugins.ts → lib/protocol.spec.d.ts} +2 -6
  136. package/lib/protocol.spec.d.ts.map +1 -0
  137. package/lib/protocol.spec.js +127 -0
  138. package/lib/protocol.spec.js.map +1 -0
  139. package/lib/snapshot-url.spec.js.map +1 -1
  140. package/lib/team-subscription-protocol.d.ts +22 -3
  141. package/lib/team-subscription-protocol.d.ts.map +1 -1
  142. package/lib/team-subscription-protocol.js +20 -5
  143. package/lib/team-subscription-protocol.js.map +1 -1
  144. package/lib/teams-projects-protocol.d.ts +21 -3
  145. package/lib/teams-projects-protocol.d.ts.map +1 -1
  146. package/lib/teams-projects-protocol.js +1 -1
  147. package/lib/teams-projects-protocol.js.map +1 -1
  148. package/lib/typings/globals.d.ts +2 -2
  149. package/lib/typings/globals.d.ts.map +1 -1
  150. package/lib/usage.d.ts +43 -0
  151. package/lib/usage.d.ts.map +1 -0
  152. package/lib/{theia-plugins.js → usage.js} +2 -2
  153. package/lib/usage.js.map +1 -0
  154. package/lib/util/analytics.d.ts.map +1 -1
  155. package/lib/util/analytics.js +12 -3
  156. package/lib/util/analytics.js.map +1 -1
  157. package/lib/util/async-iterator.d.ts.map +1 -1
  158. package/lib/util/async-iterator.js +3 -3
  159. package/lib/util/async-iterator.js.map +1 -1
  160. package/lib/util/cancelable.js.map +1 -1
  161. package/lib/util/date-time.js +6 -6
  162. package/lib/util/date-time.js.map +1 -1
  163. package/lib/util/debug-app.d.ts +25 -0
  164. package/lib/util/debug-app.d.ts.map +1 -0
  165. package/lib/util/debug-app.js +100 -0
  166. package/lib/util/debug-app.js.map +1 -0
  167. package/lib/util/deferred.js.map +1 -1
  168. package/lib/util/disposable.d.ts.map +1 -1
  169. package/lib/util/disposable.js +2 -2
  170. package/lib/util/disposable.js.map +1 -1
  171. package/lib/util/event.d.ts.map +1 -1
  172. package/lib/util/event.js +5 -3
  173. package/lib/util/event.js.map +1 -1
  174. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  175. package/lib/util/garbage-collected-cache.js +6 -1
  176. package/lib/util/garbage-collected-cache.js.map +1 -1
  177. package/lib/util/generate-workspace-id.d.ts +5 -0
  178. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  179. package/lib/util/generate-workspace-id.js +446 -442
  180. package/lib/util/generate-workspace-id.js.map +1 -1
  181. package/lib/util/generate-workspace-id.spec.js +18 -7
  182. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  183. package/lib/util/gitpod-cookie.d.ts +1 -1
  184. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  185. package/lib/util/gitpod-cookie.js +0 -3
  186. package/lib/util/gitpod-cookie.js.map +1 -1
  187. package/lib/util/gitpod-host-url.d.ts +3 -0
  188. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  189. package/lib/util/gitpod-host-url.js +49 -29
  190. package/lib/util/gitpod-host-url.js.map +1 -1
  191. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  192. package/lib/util/gitpod-host-url.spec.js +15 -5
  193. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  194. package/lib/util/grpc.d.ts +19 -0
  195. package/lib/util/grpc.d.ts.map +1 -1
  196. package/lib/util/grpc.js +73 -1
  197. package/lib/util/grpc.js.map +1 -1
  198. package/lib/util/jaeger-client-types.d.ts.map +1 -1
  199. package/lib/util/logging.d.ts +1 -1
  200. package/lib/util/logging.d.ts.map +1 -1
  201. package/lib/util/logging.js +31 -25
  202. package/lib/util/logging.js.map +1 -1
  203. package/lib/util/logging.spec.d.ts +7 -0
  204. package/lib/util/logging.spec.d.ts.map +1 -0
  205. package/lib/util/logging.spec.js +52 -0
  206. package/lib/util/logging.spec.js.map +1 -0
  207. package/lib/util/make-link.js +5 -5
  208. package/lib/util/make-link.js.map +1 -1
  209. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  210. package/lib/util/parse-workspace-id.js +1 -2
  211. package/lib/util/parse-workspace-id.js.map +1 -1
  212. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  213. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  214. package/lib/util/queue.spec.js +9 -6
  215. package/lib/util/queue.spec.js.map +1 -1
  216. package/lib/util/semaphore.d.ts.map +1 -1
  217. package/lib/util/semaphore.js.map +1 -1
  218. package/lib/util/skip-if.d.ts.map +1 -1
  219. package/lib/util/skip-if.js.map +1 -1
  220. package/lib/util/timeutil.d.ts +2 -0
  221. package/lib/util/timeutil.d.ts.map +1 -1
  222. package/lib/util/timeutil.js +15 -3
  223. package/lib/util/timeutil.js.map +1 -1
  224. package/lib/util/timeutil.spec.d.ts +1 -0
  225. package/lib/util/timeutil.spec.d.ts.map +1 -1
  226. package/lib/util/timeutil.spec.js +10 -0
  227. package/lib/util/timeutil.spec.js.map +1 -1
  228. package/lib/util/tracing.d.ts +6 -6
  229. package/lib/util/tracing.d.ts.map +1 -1
  230. package/lib/util/tracing.js +14 -16
  231. package/lib/util/tracing.js.map +1 -1
  232. package/lib/util/tracing.spec.js +3 -3
  233. package/lib/util/tracing.spec.js.map +1 -1
  234. package/lib/util/workspace-port-authentication.d.ts +7 -7
  235. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  236. package/lib/util/workspace-port-authentication.js +8 -11
  237. package/lib/util/workspace-port-authentication.js.map +1 -1
  238. package/lib/webhook-event.d.ts +44 -0
  239. package/lib/webhook-event.d.ts.map +1 -0
  240. package/lib/webhook-event.js +8 -0
  241. package/lib/webhook-event.js.map +1 -0
  242. package/lib/workspace-class.d.ts +14 -0
  243. package/lib/workspace-class.d.ts.map +1 -0
  244. package/lib/workspace-class.js +8 -0
  245. package/lib/workspace-class.js.map +1 -0
  246. package/lib/workspace-cluster.d.ts +6 -8
  247. package/lib/workspace-cluster.d.ts.map +1 -1
  248. package/lib/workspace-cluster.js +2 -4
  249. package/lib/workspace-cluster.js.map +1 -1
  250. package/lib/workspace-instance.d.ts +20 -3
  251. package/lib/workspace-instance.d.ts.map +1 -1
  252. package/lib/wsready.d.ts +4 -4
  253. package/lib/wsready.d.ts.map +1 -1
  254. package/lib/wsready.js +1 -3
  255. package/lib/wsready.js.map +1 -1
  256. package/package.json +13 -7
  257. package/pkg-yarn.lock +9 -6
  258. package/provenance-bundle.jsonl +1 -1
  259. package/src/accounting-protocol.ts +66 -51
  260. package/src/admin-protocol.ts +33 -21
  261. package/src/analytics.ts +26 -28
  262. package/src/attribution.ts +48 -0
  263. package/src/auth.ts +2 -2
  264. package/src/billing-mode.ts +67 -0
  265. package/src/blocked-repositories-protocol.ts +13 -0
  266. package/src/context-url.spec.ts +25 -11
  267. package/src/context-url.ts +80 -78
  268. package/src/email-protocol.ts +5 -6
  269. package/src/encryption/container-module.ts +2 -3
  270. package/src/encryption/encryption-engine.spec.ts +9 -8
  271. package/src/encryption/encryption-engine.ts +14 -14
  272. package/src/encryption/encryption-service.ts +4 -5
  273. package/src/encryption/key-provider.ts +16 -19
  274. package/src/env.ts +0 -22
  275. package/src/experiments/always-default.ts +24 -0
  276. package/src/experiments/configcat-server.ts +41 -0
  277. package/src/experiments/configcat.ts +58 -0
  278. package/src/experiments/types.ts +35 -0
  279. package/src/gitpod-file-parser.spec.ts +55 -61
  280. package/src/gitpod-file-parser.ts +16 -17
  281. package/src/gitpod-service.ts +188 -111
  282. package/src/headless-workspace-log.ts +6 -4
  283. package/src/ide-frontend-service.ts +2 -2
  284. package/src/ide-protocol.ts +18 -8
  285. package/src/index.ts +17 -16
  286. package/src/installation-admin-protocol.ts +12 -8
  287. package/src/license-protocol.ts +12 -6
  288. package/src/messaging/browser/connection.ts +45 -47
  289. package/src/messaging/browser/window-connection.ts +39 -29
  290. package/src/messaging/client-call-metrics.ts +62 -82
  291. package/src/messaging/error.ts +20 -7
  292. package/src/messaging/handler.ts +6 -6
  293. package/src/messaging/node/connection.ts +8 -8
  294. package/src/messaging/proxy-factory.ts +23 -30
  295. package/src/oss-allowlist.ts +3 -3
  296. package/src/payment-protocol.ts +2 -2
  297. package/src/permission.ts +20 -31
  298. package/src/plans.ts +240 -189
  299. package/src/protocol.spec.ts +97 -0
  300. package/src/protocol.ts +509 -242
  301. package/src/snapshot-url.spec.ts +9 -7
  302. package/src/team-subscription-protocol.ts +59 -22
  303. package/src/teams-projects-protocol.ts +28 -8
  304. package/src/typings/globals.ts +4 -4
  305. package/src/usage.ts +63 -0
  306. package/src/util/analytics.ts +46 -24
  307. package/src/util/async-iterator.ts +4 -5
  308. package/src/util/cancelable.ts +3 -3
  309. package/src/util/date-time.ts +8 -8
  310. package/src/util/debug-app.ts +81 -0
  311. package/src/util/deferred.ts +6 -6
  312. package/src/util/disposable.ts +3 -6
  313. package/src/util/event.ts +9 -11
  314. package/src/util/garbage-collected-cache.ts +8 -6
  315. package/src/util/generate-workspace-id.spec.ts +26 -16
  316. package/src/util/generate-workspace-id.ts +460 -454
  317. package/src/util/gitpod-cookie.ts +8 -9
  318. package/src/util/gitpod-host-url.spec.ts +40 -13
  319. package/src/util/gitpod-host-url.ts +57 -33
  320. package/src/util/grpc.ts +90 -1
  321. package/src/util/jaeger-client-types.ts +2 -2
  322. package/src/util/logging.spec.ts +23 -0
  323. package/src/util/logging.ts +60 -42
  324. package/src/util/make-link.ts +6 -7
  325. package/src/util/parse-workspace-id.spec.ts +17 -8
  326. package/src/util/parse-workspace-id.ts +5 -6
  327. package/src/util/queue.spec.ts +27 -25
  328. package/src/util/repeat.ts +1 -1
  329. package/src/util/semaphore.ts +4 -6
  330. package/src/util/skip-if.ts +9 -6
  331. package/src/util/timeutil.spec.ts +19 -14
  332. package/src/util/timeutil.ts +27 -11
  333. package/src/util/tracing.spec.ts +28 -23
  334. package/src/util/tracing.ts +54 -51
  335. package/src/util/workspace-port-authentication.ts +10 -13
  336. package/src/webhook-event.ts +55 -0
  337. package/src/workspace-class.ts +14 -0
  338. package/src/workspace-cluster.ts +14 -13
  339. package/src/workspace-instance.ts +60 -24
  340. package/src/wsready.ts +6 -5
  341. package/data/builtin-theia-plugins.json +0 -372
  342. package/lib/theia-plugins.d.ts +0 -11
  343. package/lib/theia-plugins.d.ts.map +0 -1
  344. package/lib/theia-plugins.js.map +0 -1
@@ -5,32 +5,64 @@
5
5
  */
6
6
 
7
7
  import {
8
- User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser,
9
- WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, CreateWorkspaceMode,
10
- Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms,
11
- ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType,
12
- GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes, ProjectEnvVar
13
- } from './protocol';
8
+ User,
9
+ WorkspaceInfo,
10
+ WorkspaceCreationResult,
11
+ WorkspaceInstanceUser,
12
+ WhitelistedRepository,
13
+ WorkspaceImageBuild,
14
+ AuthProviderInfo,
15
+ CreateWorkspaceMode,
16
+ Token,
17
+ UserEnvVarValue,
18
+ Terms,
19
+ Configuration,
20
+ UserInfo,
21
+ GitpodTokenType,
22
+ GitpodToken,
23
+ AuthProviderEntry,
24
+ GuessGitTokenScopesParams,
25
+ GuessedGitTokenScopes,
26
+ ProjectEnvVar,
27
+ PrebuiltWorkspace,
28
+ UserSSHPublicKeyValue,
29
+ SSHPublicKeyValue,
30
+ } from "./protocol";
14
31
  import {
15
- Team, TeamMemberInfo,
16
- TeamMembershipInvite, Project, TeamMemberRole, PrebuildWithStatus, StartPrebuildResult, PartialProject
17
- } from './teams-projects-protocol';
18
- import { JsonRpcProxy, JsonRpcServer } from './messaging/proxy-factory';
19
- import { Disposable, CancellationTokenSource } from 'vscode-jsonrpc';
20
- import { HeadlessLogUrls } from './headless-workspace-log';
21
- import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from './workspace-instance';
22
- import { AdminServer } from './admin-protocol';
23
- import { GitpodHostUrl } from './util/gitpod-host-url';
24
- import { WebSocketConnectionProvider } from './messaging/browser/connection';
25
- import { PermissionName } from './permission';
26
- import { LicenseService } from './license-protocol';
27
- import { Emitter } from './util/event';
28
- import { AccountStatement, CreditAlert } from './accounting-protocol';
29
- import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
30
- import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
31
- import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
32
- import { IDEServer } from './ide-protocol';
33
- import { InstallationAdminSettings, TelemetryData } from './installation-admin-protocol';
32
+ Team,
33
+ TeamMemberInfo,
34
+ TeamMembershipInvite,
35
+ Project,
36
+ TeamMemberRole,
37
+ PrebuildWithStatus,
38
+ StartPrebuildResult,
39
+ PartialProject,
40
+ PrebuildEvent,
41
+ } from "./teams-projects-protocol";
42
+ import { JsonRpcProxy, JsonRpcServer } from "./messaging/proxy-factory";
43
+ import { Disposable, CancellationTokenSource } from "vscode-jsonrpc";
44
+ import { HeadlessLogUrls } from "./headless-workspace-log";
45
+ import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from "./workspace-instance";
46
+ import { AdminServer } from "./admin-protocol";
47
+ import { GitpodHostUrl } from "./util/gitpod-host-url";
48
+ import { WebSocketConnectionProvider } from "./messaging/browser/connection";
49
+ import { PermissionName } from "./permission";
50
+ import { LicenseService } from "./license-protocol";
51
+ import { Emitter } from "./util/event";
52
+ import { AccountStatement, CreditAlert } from "./accounting-protocol";
53
+ import { GithubUpgradeURL, PlanCoupon } from "./payment-protocol";
54
+ import {
55
+ TeamSubscription,
56
+ TeamSubscription2,
57
+ TeamSubscriptionSlot,
58
+ TeamSubscriptionSlotResolved,
59
+ } from "./team-subscription-protocol";
60
+ import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
61
+ import { IDEServer } from "./ide-protocol";
62
+ import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
63
+ import { ListBilledUsageResponse, ListBilledUsageRequest } from "./usage";
64
+ import { SupportedWorkspaceClass } from "./workspace-class";
65
+ import { BillingMode } from "./billing-mode";
34
66
 
35
67
  export interface GitpodClient {
36
68
  onInstanceUpdate(instance: WorkspaceInstance): void;
@@ -46,12 +78,14 @@ export interface GitpodClient {
46
78
  //#endregion
47
79
  }
48
80
 
49
- export const GitpodServer = Symbol('GitpodServer');
81
+ export const GitpodServer = Symbol("GitpodServer");
50
82
  export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
51
83
  // User related API
52
84
  getLoggedInUser(): Promise<User>;
53
85
  getTerms(): Promise<Terms>;
54
86
  updateLoggedInUser(user: Partial<User>): Promise<User>;
87
+ sendPhoneNumberVerificationToken(phoneNumber: string): Promise<void>;
88
+ verifyPhoneNumberVerificationToken(phoneNumber: string, token: string): Promise<boolean>;
55
89
  getAuthProviders(): Promise<AuthProviderInfo[]>;
56
90
  getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
57
91
  updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
@@ -122,6 +156,12 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
122
156
  setEnvVar(variable: UserEnvVarValue): Promise<void>;
123
157
  deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
124
158
 
159
+ // User SSH Keys
160
+ hasSSHPublicKey(): Promise<boolean>;
161
+ getSSHPublicKeys(): Promise<UserSSHPublicKeyValue[]>;
162
+ addSSHPublicKey(value: SSHPublicKeyValue): Promise<UserSSHPublicKeyValue>;
163
+ deleteSSHPublicKey(id: string): Promise<void>;
164
+
125
165
  // Teams
126
166
  getTeams(): Promise<Team[]>;
127
167
  getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
@@ -145,7 +185,10 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
145
185
  getTeamProjects(teamId: string): Promise<Project[]>;
146
186
  getUserProjects(): Promise<Project[]>;
147
187
  getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
188
+ getPrebuildEvents(projectId: string): Promise<PrebuildEvent[]>;
148
189
  findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
190
+ findPrebuildByWorkspaceID(workspaceId: string): Promise<PrebuiltWorkspace | undefined>;
191
+ getPrebuild(prebuildId: string): Promise<PrebuildWithStatus | undefined>;
149
192
  triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
150
193
  cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
151
194
  fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
@@ -159,8 +202,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
159
202
  deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
160
203
 
161
204
  // content service
162
- getContentBlobUploadUrl(name: string): Promise<string>
163
- getContentBlobDownloadUrl(name: string): Promise<string>
205
+ getContentBlobUploadUrl(name: string): Promise<string>;
206
+ getContentBlobDownloadUrl(name: string): Promise<string>;
164
207
 
165
208
  // Gitpod token
166
209
  getGitpodTokens(): Promise<GitpodToken[]>;
@@ -169,6 +212,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
169
212
 
170
213
  // misc
171
214
  sendFeedback(feedback: string): Promise<string | undefined>;
215
+ isGitHubAppEnabled(): Promise<boolean>;
172
216
  registerGithubApp(installationId: string): Promise<void>;
173
217
 
174
218
  /**
@@ -197,15 +241,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
197
241
  */
198
242
  getLayout(workspaceId: string): Promise<string | undefined>;
199
243
 
200
- /**
201
- * @param params
202
- * @returns promise resolves to an URL to be used for the upload
203
- */
204
- preparePluginUpload(params: PreparePluginUploadParams): Promise<string>
205
- resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
206
- installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
207
- uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
208
-
209
244
  guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
210
245
 
211
246
  /**
@@ -223,7 +258,9 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
223
258
  */
224
259
  getChargebeeSiteId(): Promise<string>;
225
260
  createPortalSession(): Promise<{}>;
261
+ createTeamPortalSession(teamId: string): Promise<{}>;
226
262
  checkout(planId: string, planQuantity?: number): Promise<{}>;
263
+ teamCheckout(teamId: string, planId: string): Promise<{}>;
227
264
  getAvailableCoupons(): Promise<PlanCoupon[]>;
228
265
  getAppliedCoupons(): Promise<PlanCoupon[]>;
229
266
 
@@ -235,33 +272,61 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
235
272
  subscriptionCancel(subscriptionId: string): Promise<void>;
236
273
  subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
237
274
 
275
+ getTeamSubscription(teamId: string): Promise<TeamSubscription2 | undefined>;
238
276
  tsGet(): Promise<TeamSubscription[]>;
239
277
  tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
240
- tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>
278
+ tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
241
279
  tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
242
- tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string | undefined): Promise<void>
280
+ tsAssignSlot(
281
+ teamSubscriptionId: string,
282
+ teamSubscriptionSlotId: string,
283
+ identityStr: string | undefined,
284
+ ): Promise<void>;
243
285
  tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
244
286
  tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
245
287
  tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
246
288
 
247
289
  getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
248
290
 
291
+ getStripePublishableKey(): Promise<string>;
292
+ getStripeSetupIntentClientSecret(): Promise<string>;
293
+ findStripeSubscriptionIdForTeam(teamId: string): Promise<string | undefined>;
294
+ createOrUpdateStripeCustomerForTeam(teamId: string, currency: string): Promise<void>;
295
+ subscribeTeamToStripe(teamId: string, setupIntentId: string): Promise<void>;
296
+ getStripePortalUrlForTeam(teamId: string): Promise<string>;
297
+ getSpendingLimitForTeam(teamId: string): Promise<number | undefined>;
298
+ setSpendingLimitForTeam(teamId: string, spendingLimit: number): Promise<void>;
299
+
300
+ listBilledUsage(req: ListBilledUsageRequest): Promise<ListBilledUsageResponse>;
301
+
302
+ setUsageAttribution(usageAttribution: string): Promise<void>;
303
+
304
+ getBillingModeForUser(): Promise<BillingMode>;
305
+ getBillingModeForTeam(teamId: string): Promise<BillingMode>;
306
+
249
307
  /**
250
308
  * Analytics
251
309
  */
252
310
  trackEvent(event: RemoteTrackMessage): Promise<void>;
253
311
  trackLocation(event: RemotePageMessage): Promise<void>;
254
312
  identifyUser(event: RemoteIdentifyMessage): Promise<void>;
313
+
314
+ /**
315
+ * Frontend notifications
316
+ */
317
+ getNotifications(): Promise<string[]>;
318
+
319
+ getSupportedWorkspaceClasses(): Promise<SupportedWorkspaceClass[]>;
255
320
  }
256
321
 
257
322
  export interface RateLimiterError {
258
- method?: string,
323
+ method?: string;
259
324
 
260
325
  /**
261
326
  * Retry after this many seconds, earliest.
262
327
  * cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
263
328
  */
264
- retryAfter: number,
329
+ retryAfter: number;
265
330
  }
266
331
 
267
332
  export interface CreateProjectParams {
@@ -292,7 +357,7 @@ export interface ProviderRepository {
292
357
  account: string;
293
358
  accountAvatarUrl: string;
294
359
  cloneUrl: string;
295
- updatedAt: string;
360
+ updatedAt?: string;
296
361
  installationId?: number;
297
362
  installationUpdatedAt?: string;
298
363
 
@@ -306,42 +371,56 @@ export interface ClientHeaderFields {
306
371
  clientRegion?: string;
307
372
  }
308
373
 
309
- export const WorkspaceTimeoutValues = ["30m", "60m", "180m"] as const;
310
-
311
- export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(methods: Partial<JsonRpcProxy<S>>): GitpodServiceImpl<C, S> {
374
+ export const WORKSPACE_TIMEOUT_DEFAULT_SHORT = "short";
375
+ export const WORKSPACE_TIMEOUT_DEFAULT_LONG = "long";
376
+ export const WORKSPACE_TIMEOUT_EXTENDED = "extended";
377
+ export const WORKSPACE_TIMEOUT_EXTENDED_ALT = "180m"; // for backwards compatibility since the IDE uses this
378
+ export const WorkspaceTimeoutValues = [
379
+ WORKSPACE_TIMEOUT_DEFAULT_SHORT,
380
+ WORKSPACE_TIMEOUT_DEFAULT_LONG,
381
+ WORKSPACE_TIMEOUT_EXTENDED,
382
+ WORKSPACE_TIMEOUT_EXTENDED_ALT,
383
+ ] as const;
384
+
385
+ export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(
386
+ methods: Partial<JsonRpcProxy<S>>,
387
+ ): GitpodServiceImpl<C, S> {
312
388
  return new GitpodServiceImpl<C, S>(createServerMock(methods));
313
- }
389
+ };
314
390
 
315
- export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(methods: Partial<JsonRpcProxy<S>>): JsonRpcProxy<S> {
316
- methods.setClient = methods.setClient || (() => { });
317
- methods.dispose = methods.dispose || (() => { });
391
+ export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
392
+ methods: Partial<JsonRpcProxy<S>>,
393
+ ): JsonRpcProxy<S> {
394
+ methods.setClient = methods.setClient || (() => {});
395
+ methods.dispose = methods.dispose || (() => {});
318
396
  return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
319
397
  // @ts-ignore
320
398
  get: (target: S, property: keyof S) => {
321
399
  const result = target[property];
322
400
  if (!result) {
323
- throw new Error(`Method ${property} not implemented`);
401
+ throw new Error(`Method ${String(property)} not implemented`);
324
402
  }
325
403
  return result;
326
- }
404
+ },
327
405
  });
328
- }
406
+ };
329
407
 
330
408
  type WorkspaceTimeoutDurationTuple = typeof WorkspaceTimeoutValues;
331
409
  export type WorkspaceTimeoutDuration = WorkspaceTimeoutDurationTuple[number];
332
410
 
333
411
  export interface SetWorkspaceTimeoutResult {
334
- resetTimeoutOnWorkspaces: string[]
412
+ resetTimeoutOnWorkspaces: string[];
335
413
  }
336
414
 
337
415
  export interface GetWorkspaceTimeoutResult {
338
- duration: WorkspaceTimeoutDuration
339
- canChange: boolean
416
+ duration: WorkspaceTimeoutDuration;
417
+ durationRaw: string;
418
+ canChange: boolean;
340
419
  }
341
420
 
342
421
  export interface StartWorkspaceResult {
343
- instanceID: string
344
- workspaceURL?: string
422
+ instanceID: string;
423
+ workspaceURL?: string;
345
424
  }
346
425
 
347
426
  export namespace GitpodServer {
@@ -385,23 +464,23 @@ export namespace GitpodServer {
385
464
  readonly roundTripTime?: number;
386
465
  }
387
466
  export interface UpdateOwnAuthProviderParams {
388
- readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry
467
+ readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry;
389
468
  }
390
469
  export interface DeleteOwnAuthProviderParams {
391
- readonly id: string
470
+ readonly id: string;
392
471
  }
393
472
  export type AdmissionLevel = "owner" | "everyone";
394
473
  export type PinAction = "pin" | "unpin" | "toggle";
395
474
  export interface GenerateNewGitpodTokenOptions {
396
- name?: string
397
- type: GitpodTokenType
398
- scopes?: string[]
475
+ name?: string;
476
+ type: GitpodTokenType;
477
+ scopes?: string[];
399
478
  }
400
479
  }
401
480
 
402
- export const GitpodServerPath = '/gitpod';
481
+ export const GitpodServerPath = "/gitpod";
403
482
 
404
- export const GitpodServerProxy = Symbol('GitpodServerProxy');
483
+ export const GitpodServerProxy = Symbol("GitpodServerProxy");
405
484
  export type GitpodServerProxy<S extends GitpodServer> = JsonRpcProxy<S>;
406
485
 
407
486
  export class GitpodCompositeClient<Client extends GitpodClient> implements GitpodClient {
@@ -415,8 +494,8 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
415
494
  if (index > -1) {
416
495
  this.clients.splice(index, 1);
417
496
  }
418
- }
419
- }
497
+ },
498
+ };
420
499
  }
421
500
 
422
501
  onInstanceUpdate(instance: WorkspaceInstance): void {
@@ -425,7 +504,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
425
504
  try {
426
505
  client.onInstanceUpdate(instance);
427
506
  } catch (error) {
428
- console.error(error)
507
+ console.error(error);
429
508
  }
430
509
  }
431
510
  }
@@ -437,19 +516,22 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
437
516
  try {
438
517
  client.onPrebuildUpdate(update);
439
518
  } catch (error) {
440
- console.error(error)
519
+ console.error(error);
441
520
  }
442
521
  }
443
522
  }
444
523
  }
445
524
 
446
- onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
525
+ onWorkspaceImageBuildLogs(
526
+ info: WorkspaceImageBuild.StateInfo,
527
+ content: WorkspaceImageBuild.LogContent | undefined,
528
+ ): void {
447
529
  for (const client of this.clients) {
448
530
  if (client.onWorkspaceImageBuildLogs) {
449
531
  try {
450
532
  client.onWorkspaceImageBuildLogs(info, content);
451
533
  } catch (error) {
452
- console.error(error)
534
+ console.error(error);
453
535
  }
454
536
  }
455
537
  }
@@ -461,7 +543,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
461
543
  try {
462
544
  client.notifyDidOpenConnection();
463
545
  } catch (error) {
464
- console.error(error)
546
+ console.error(error);
465
547
  }
466
548
  }
467
549
  }
@@ -473,7 +555,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
473
555
  try {
474
556
  client.notifyDidCloseConnection();
475
557
  } catch (error) {
476
- console.error(error)
558
+ console.error(error);
477
559
  }
478
560
  }
479
561
  }
@@ -485,64 +567,61 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
485
567
  try {
486
568
  client.onCreditAlert(creditAlert);
487
569
  } catch (error) {
488
- console.error(error)
570
+ console.error(error);
489
571
  }
490
572
  }
491
573
  }
492
574
  }
493
-
494
575
  }
495
576
 
496
577
  export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
497
578
 
498
- const hasWindow = (typeof window !== 'undefined');
579
+ const hasWindow = typeof window !== "undefined";
499
580
  const phasesOrder: Record<WorkspaceInstancePhase, number> = {
500
581
  unknown: 0,
501
582
  preparing: 1,
502
- pending: 2,
503
- creating: 3,
504
- initializing: 4,
505
- running: 5,
506
- interrupted: 6,
507
- stopping: 7,
508
- stopped: 8
583
+ building: 2,
584
+ pending: 3,
585
+ creating: 4,
586
+ initializing: 5,
587
+ running: 6,
588
+ interrupted: 7,
589
+ stopping: 8,
590
+ stopped: 9,
509
591
  };
510
592
  export class WorkspaceInstanceUpdateListener {
511
593
  private readonly onDidChangeEmitter = new Emitter<void>();
512
594
  readonly onDidChange = this.onDidChangeEmitter.event;
513
595
 
514
- private source: 'sync' | 'update' = 'sync';
596
+ private source: "sync" | "update" = "sync";
515
597
 
516
598
  get info(): WorkspaceInfo {
517
599
  return this._info;
518
600
  }
519
601
 
520
- constructor(
521
- private readonly service: GitpodService,
522
- private _info: WorkspaceInfo
523
- ) {
602
+ constructor(private readonly service: GitpodService, private _info: WorkspaceInfo) {
524
603
  service.registerClient({
525
- onInstanceUpdate: instance => {
604
+ onInstanceUpdate: (instance) => {
526
605
  if (this.isOutOfOrder(instance)) {
527
606
  return;
528
607
  }
529
608
  this.cancelSync();
530
609
  this._info.latestInstance = instance;
531
- this.source = 'update';
610
+ this.source = "update";
532
611
  this.onDidChangeEmitter.fire(undefined);
533
612
  },
534
613
  notifyDidOpenConnection: () => {
535
614
  this.sync();
536
- }
615
+ },
537
616
  });
538
617
  if (hasWindow) {
539
618
  // learn about page lifecycle here: https://developers.google.com/web/updates/2018/07/page-lifecycle-api
540
- window.document.addEventListener('visibilitychange', async () => {
541
- if (window.document.visibilityState === 'visible') {
619
+ window.document.addEventListener("visibilitychange", async () => {
620
+ if (window.document.visibilityState === "visible") {
542
621
  this.sync();
543
622
  }
544
623
  });
545
- window.addEventListener('pageshow', e => {
624
+ window.addEventListener("pageshow", (e) => {
546
625
  if (e.persisted) {
547
626
  this.sync();
548
627
  }
@@ -570,12 +649,12 @@ export class WorkspaceInstanceUpdateListener {
570
649
  return;
571
650
  }
572
651
  this._info = info;
573
- this.source = 'sync';
652
+ this.source = "sync";
574
653
  this.onDidChangeEmitter.fire(undefined);
575
654
  } catch (e) {
576
- console.error('failed to sync workspace instance:', e)
655
+ console.error("failed to sync workspace instance:", e);
577
656
  }
578
- })
657
+ });
579
658
  }
580
659
  private cancelSync(): void {
581
660
  if (this.syncTokenSource) {
@@ -592,7 +671,7 @@ export class WorkspaceInstanceUpdateListener {
592
671
  if (instance.workspaceId !== this._info.workspace.id) {
593
672
  return true;
594
673
  }
595
- if (this.source === 'update') {
674
+ if (this.source === "update") {
596
675
  return false;
597
676
  }
598
677
  if (instance.id !== this.info.latestInstance?.id) {
@@ -600,15 +679,13 @@ export class WorkspaceInstanceUpdateListener {
600
679
  }
601
680
  return phasesOrder[instance.status.phase] < phasesOrder[this.info.latestInstance.status.phase];
602
681
  }
603
-
604
682
  }
605
683
 
606
684
  export interface GitpodServiceOptions {
607
- onReconnect?: () => (void | Promise<void>)
685
+ onReconnect?: () => void | Promise<void>;
608
686
  }
609
687
 
610
688
  export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
611
-
612
689
  private readonly compositeClient = new GitpodCompositeClient<Client>();
613
690
 
614
691
  constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
@@ -623,7 +700,8 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
623
700
 
624
701
  private readonly instanceListeners = new Map<string, Promise<WorkspaceInstanceUpdateListener>>();
625
702
  listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener> {
626
- const listener = this.instanceListeners.get(workspaceId) ||
703
+ const listener =
704
+ this.instanceListeners.get(workspaceId) ||
627
705
  (async () => {
628
706
  const info = await this.server.getWorkspace(workspaceId);
629
707
  return new WorkspaceInstanceUpdateListener(this, info);
@@ -639,26 +717,25 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
639
717
  }
640
718
  }
641
719
 
642
- export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>) {
720
+ export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
721
+ serverUrl: string | Promise<string>,
722
+ ) {
643
723
  const toWsUrl = (serverUrl: string) => {
644
- return new GitpodHostUrl(serverUrl)
645
- .asWebsocket()
646
- .withApi({ pathname: GitpodServerPath })
647
- .toString();
724
+ return new GitpodHostUrl(serverUrl).asWebsocket().withApi({ pathname: GitpodServerPath }).toString();
648
725
  };
649
726
  let url: string | Promise<string>;
650
727
  if (typeof serverUrl === "string") {
651
728
  url = toWsUrl(serverUrl);
652
729
  } else {
653
- url = serverUrl.then(url => toWsUrl(url));
730
+ url = serverUrl.then((url) => toWsUrl(url));
654
731
  }
655
732
 
656
733
  const connectionProvider = new WebSocketConnectionProvider();
657
- let onReconnect = () => { };
734
+ let onReconnect = () => {};
658
735
  const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
659
- onListening: socket => {
736
+ onListening: (socket) => {
660
737
  onReconnect = () => socket.reconnect();
661
- }
738
+ },
662
739
  });
663
740
  return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
664
- }
741
+ }
@@ -4,21 +4,23 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
-
8
7
  export enum HeadlessWorkspaceEventType {
9
8
  LogOutput = "log-output",
10
9
  FinishedSuccessfully = "finish-success",
11
10
  FinishedButFailed = "finish-fail",
12
11
  AbortedTimedOut = "aborted-timeout",
13
12
  Aborted = "aborted",
14
- Started = "started"
13
+ Failed = "failed",
14
+ Started = "started",
15
15
  }
16
16
  export namespace HeadlessWorkspaceEventType {
17
17
  export function isRunning(t: HeadlessWorkspaceEventType) {
18
18
  return t === HeadlessWorkspaceEventType.LogOutput;
19
19
  }
20
20
  export function didFinish(t: HeadlessWorkspaceEventType) {
21
- return t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully;
21
+ return (
22
+ t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully
23
+ );
22
24
  }
23
25
  }
24
26
 
@@ -35,4 +37,4 @@ export interface HeadlessLogUrls {
35
37
 
36
38
  /** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
37
39
  export const HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
38
- export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
40
+ export const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX = /X-LogStream-StatusCode: ([0-9]{3})/;
@@ -7,7 +7,7 @@
7
7
  import { Event } from "./util/event";
8
8
  import { Disposable } from "./util/disposable";
9
9
 
10
- export type IDEFrontendState = 'init' | 'ready' | 'terminated';
10
+ export type IDEFrontendState = "init" | "ready" | "terminated";
11
11
 
12
12
  export interface IDEFrontendService {
13
13
  readonly state: IDEFrontendState;
@@ -25,4 +25,4 @@ export interface IDEFrontendService {
25
25
  * confirmation dialogs for stopped workspaces.
26
26
  */
27
27
  start(): Disposable;
28
- }
28
+ }