@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
@@ -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, ListUsageRequest, ListUsageResponse } 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,62 @@ 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
+ listUsage(req: ListUsageRequest): Promise<ListUsageResponse>;
302
+
303
+ setUsageAttribution(usageAttribution: string): Promise<void>;
304
+
305
+ getBillingModeForUser(): Promise<BillingMode>;
306
+ getBillingModeForTeam(teamId: string): Promise<BillingMode>;
307
+
249
308
  /**
250
309
  * Analytics
251
310
  */
252
311
  trackEvent(event: RemoteTrackMessage): Promise<void>;
253
312
  trackLocation(event: RemotePageMessage): Promise<void>;
254
313
  identifyUser(event: RemoteIdentifyMessage): Promise<void>;
314
+
315
+ /**
316
+ * Frontend notifications
317
+ */
318
+ getNotifications(): Promise<string[]>;
319
+
320
+ getSupportedWorkspaceClasses(): Promise<SupportedWorkspaceClass[]>;
255
321
  }
256
322
 
257
323
  export interface RateLimiterError {
258
- method?: string,
324
+ method?: string;
259
325
 
260
326
  /**
261
327
  * Retry after this many seconds, earliest.
262
328
  * cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
263
329
  */
264
- retryAfter: number,
330
+ retryAfter: number;
265
331
  }
266
332
 
267
333
  export interface CreateProjectParams {
@@ -292,7 +358,7 @@ export interface ProviderRepository {
292
358
  account: string;
293
359
  accountAvatarUrl: string;
294
360
  cloneUrl: string;
295
- updatedAt: string;
361
+ updatedAt?: string;
296
362
  installationId?: number;
297
363
  installationUpdatedAt?: string;
298
364
 
@@ -306,42 +372,56 @@ export interface ClientHeaderFields {
306
372
  clientRegion?: string;
307
373
  }
308
374
 
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> {
375
+ export const WORKSPACE_TIMEOUT_DEFAULT_SHORT = "short";
376
+ export const WORKSPACE_TIMEOUT_DEFAULT_LONG = "long";
377
+ export const WORKSPACE_TIMEOUT_EXTENDED = "extended";
378
+ export const WORKSPACE_TIMEOUT_EXTENDED_ALT = "180m"; // for backwards compatibility since the IDE uses this
379
+ export const WorkspaceTimeoutValues = [
380
+ WORKSPACE_TIMEOUT_DEFAULT_SHORT,
381
+ WORKSPACE_TIMEOUT_DEFAULT_LONG,
382
+ WORKSPACE_TIMEOUT_EXTENDED,
383
+ WORKSPACE_TIMEOUT_EXTENDED_ALT,
384
+ ] as const;
385
+
386
+ export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(
387
+ methods: Partial<JsonRpcProxy<S>>,
388
+ ): GitpodServiceImpl<C, S> {
312
389
  return new GitpodServiceImpl<C, S>(createServerMock(methods));
313
- }
390
+ };
314
391
 
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 || (() => { });
392
+ export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
393
+ methods: Partial<JsonRpcProxy<S>>,
394
+ ): JsonRpcProxy<S> {
395
+ methods.setClient = methods.setClient || (() => {});
396
+ methods.dispose = methods.dispose || (() => {});
318
397
  return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
319
398
  // @ts-ignore
320
399
  get: (target: S, property: keyof S) => {
321
400
  const result = target[property];
322
401
  if (!result) {
323
- throw new Error(`Method ${property} not implemented`);
402
+ throw new Error(`Method ${String(property)} not implemented`);
324
403
  }
325
404
  return result;
326
- }
405
+ },
327
406
  });
328
- }
407
+ };
329
408
 
330
409
  type WorkspaceTimeoutDurationTuple = typeof WorkspaceTimeoutValues;
331
410
  export type WorkspaceTimeoutDuration = WorkspaceTimeoutDurationTuple[number];
332
411
 
333
412
  export interface SetWorkspaceTimeoutResult {
334
- resetTimeoutOnWorkspaces: string[]
413
+ resetTimeoutOnWorkspaces: string[];
335
414
  }
336
415
 
337
416
  export interface GetWorkspaceTimeoutResult {
338
- duration: WorkspaceTimeoutDuration
339
- canChange: boolean
417
+ duration: WorkspaceTimeoutDuration;
418
+ durationRaw: string;
419
+ canChange: boolean;
340
420
  }
341
421
 
342
422
  export interface StartWorkspaceResult {
343
- instanceID: string
344
- workspaceURL?: string
423
+ instanceID: string;
424
+ workspaceURL?: string;
345
425
  }
346
426
 
347
427
  export namespace GitpodServer {
@@ -385,23 +465,23 @@ export namespace GitpodServer {
385
465
  readonly roundTripTime?: number;
386
466
  }
387
467
  export interface UpdateOwnAuthProviderParams {
388
- readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry
468
+ readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry;
389
469
  }
390
470
  export interface DeleteOwnAuthProviderParams {
391
- readonly id: string
471
+ readonly id: string;
392
472
  }
393
473
  export type AdmissionLevel = "owner" | "everyone";
394
474
  export type PinAction = "pin" | "unpin" | "toggle";
395
475
  export interface GenerateNewGitpodTokenOptions {
396
- name?: string
397
- type: GitpodTokenType
398
- scopes?: string[]
476
+ name?: string;
477
+ type: GitpodTokenType;
478
+ scopes?: string[];
399
479
  }
400
480
  }
401
481
 
402
- export const GitpodServerPath = '/gitpod';
482
+ export const GitpodServerPath = "/gitpod";
403
483
 
404
- export const GitpodServerProxy = Symbol('GitpodServerProxy');
484
+ export const GitpodServerProxy = Symbol("GitpodServerProxy");
405
485
  export type GitpodServerProxy<S extends GitpodServer> = JsonRpcProxy<S>;
406
486
 
407
487
  export class GitpodCompositeClient<Client extends GitpodClient> implements GitpodClient {
@@ -415,8 +495,8 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
415
495
  if (index > -1) {
416
496
  this.clients.splice(index, 1);
417
497
  }
418
- }
419
- }
498
+ },
499
+ };
420
500
  }
421
501
 
422
502
  onInstanceUpdate(instance: WorkspaceInstance): void {
@@ -425,7 +505,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
425
505
  try {
426
506
  client.onInstanceUpdate(instance);
427
507
  } catch (error) {
428
- console.error(error)
508
+ console.error(error);
429
509
  }
430
510
  }
431
511
  }
@@ -437,19 +517,22 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
437
517
  try {
438
518
  client.onPrebuildUpdate(update);
439
519
  } catch (error) {
440
- console.error(error)
520
+ console.error(error);
441
521
  }
442
522
  }
443
523
  }
444
524
  }
445
525
 
446
- onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
526
+ onWorkspaceImageBuildLogs(
527
+ info: WorkspaceImageBuild.StateInfo,
528
+ content: WorkspaceImageBuild.LogContent | undefined,
529
+ ): void {
447
530
  for (const client of this.clients) {
448
531
  if (client.onWorkspaceImageBuildLogs) {
449
532
  try {
450
533
  client.onWorkspaceImageBuildLogs(info, content);
451
534
  } catch (error) {
452
- console.error(error)
535
+ console.error(error);
453
536
  }
454
537
  }
455
538
  }
@@ -461,7 +544,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
461
544
  try {
462
545
  client.notifyDidOpenConnection();
463
546
  } catch (error) {
464
- console.error(error)
547
+ console.error(error);
465
548
  }
466
549
  }
467
550
  }
@@ -473,7 +556,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
473
556
  try {
474
557
  client.notifyDidCloseConnection();
475
558
  } catch (error) {
476
- console.error(error)
559
+ console.error(error);
477
560
  }
478
561
  }
479
562
  }
@@ -485,64 +568,61 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
485
568
  try {
486
569
  client.onCreditAlert(creditAlert);
487
570
  } catch (error) {
488
- console.error(error)
571
+ console.error(error);
489
572
  }
490
573
  }
491
574
  }
492
575
  }
493
-
494
576
  }
495
577
 
496
578
  export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
497
579
 
498
- const hasWindow = (typeof window !== 'undefined');
580
+ const hasWindow = typeof window !== "undefined";
499
581
  const phasesOrder: Record<WorkspaceInstancePhase, number> = {
500
582
  unknown: 0,
501
583
  preparing: 1,
502
- pending: 2,
503
- creating: 3,
504
- initializing: 4,
505
- running: 5,
506
- interrupted: 6,
507
- stopping: 7,
508
- stopped: 8
584
+ building: 2,
585
+ pending: 3,
586
+ creating: 4,
587
+ initializing: 5,
588
+ running: 6,
589
+ interrupted: 7,
590
+ stopping: 8,
591
+ stopped: 9,
509
592
  };
510
593
  export class WorkspaceInstanceUpdateListener {
511
594
  private readonly onDidChangeEmitter = new Emitter<void>();
512
595
  readonly onDidChange = this.onDidChangeEmitter.event;
513
596
 
514
- private source: 'sync' | 'update' = 'sync';
597
+ private source: "sync" | "update" = "sync";
515
598
 
516
599
  get info(): WorkspaceInfo {
517
600
  return this._info;
518
601
  }
519
602
 
520
- constructor(
521
- private readonly service: GitpodService,
522
- private _info: WorkspaceInfo
523
- ) {
603
+ constructor(private readonly service: GitpodService, private _info: WorkspaceInfo) {
524
604
  service.registerClient({
525
- onInstanceUpdate: instance => {
605
+ onInstanceUpdate: (instance) => {
526
606
  if (this.isOutOfOrder(instance)) {
527
607
  return;
528
608
  }
529
609
  this.cancelSync();
530
610
  this._info.latestInstance = instance;
531
- this.source = 'update';
611
+ this.source = "update";
532
612
  this.onDidChangeEmitter.fire(undefined);
533
613
  },
534
614
  notifyDidOpenConnection: () => {
535
615
  this.sync();
536
- }
616
+ },
537
617
  });
538
618
  if (hasWindow) {
539
619
  // 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') {
620
+ window.document.addEventListener("visibilitychange", async () => {
621
+ if (window.document.visibilityState === "visible") {
542
622
  this.sync();
543
623
  }
544
624
  });
545
- window.addEventListener('pageshow', e => {
625
+ window.addEventListener("pageshow", (e) => {
546
626
  if (e.persisted) {
547
627
  this.sync();
548
628
  }
@@ -570,12 +650,12 @@ export class WorkspaceInstanceUpdateListener {
570
650
  return;
571
651
  }
572
652
  this._info = info;
573
- this.source = 'sync';
653
+ this.source = "sync";
574
654
  this.onDidChangeEmitter.fire(undefined);
575
655
  } catch (e) {
576
- console.error('failed to sync workspace instance:', e)
656
+ console.error("failed to sync workspace instance:", e);
577
657
  }
578
- })
658
+ });
579
659
  }
580
660
  private cancelSync(): void {
581
661
  if (this.syncTokenSource) {
@@ -592,7 +672,7 @@ export class WorkspaceInstanceUpdateListener {
592
672
  if (instance.workspaceId !== this._info.workspace.id) {
593
673
  return true;
594
674
  }
595
- if (this.source === 'update') {
675
+ if (this.source === "update") {
596
676
  return false;
597
677
  }
598
678
  if (instance.id !== this.info.latestInstance?.id) {
@@ -600,15 +680,13 @@ export class WorkspaceInstanceUpdateListener {
600
680
  }
601
681
  return phasesOrder[instance.status.phase] < phasesOrder[this.info.latestInstance.status.phase];
602
682
  }
603
-
604
683
  }
605
684
 
606
685
  export interface GitpodServiceOptions {
607
- onReconnect?: () => (void | Promise<void>)
686
+ onReconnect?: () => void | Promise<void>;
608
687
  }
609
688
 
610
689
  export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
611
-
612
690
  private readonly compositeClient = new GitpodCompositeClient<Client>();
613
691
 
614
692
  constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
@@ -623,7 +701,8 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
623
701
 
624
702
  private readonly instanceListeners = new Map<string, Promise<WorkspaceInstanceUpdateListener>>();
625
703
  listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener> {
626
- const listener = this.instanceListeners.get(workspaceId) ||
704
+ const listener =
705
+ this.instanceListeners.get(workspaceId) ||
627
706
  (async () => {
628
707
  const info = await this.server.getWorkspace(workspaceId);
629
708
  return new WorkspaceInstanceUpdateListener(this, info);
@@ -639,26 +718,25 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
639
718
  }
640
719
  }
641
720
 
642
- export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>) {
721
+ export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
722
+ serverUrl: string | Promise<string>,
723
+ ) {
643
724
  const toWsUrl = (serverUrl: string) => {
644
- return new GitpodHostUrl(serverUrl)
645
- .asWebsocket()
646
- .withApi({ pathname: GitpodServerPath })
647
- .toString();
725
+ return new GitpodHostUrl(serverUrl).asWebsocket().withApi({ pathname: GitpodServerPath }).toString();
648
726
  };
649
727
  let url: string | Promise<string>;
650
728
  if (typeof serverUrl === "string") {
651
729
  url = toWsUrl(serverUrl);
652
730
  } else {
653
- url = serverUrl.then(url => toWsUrl(url));
731
+ url = serverUrl.then((url) => toWsUrl(url));
654
732
  }
655
733
 
656
734
  const connectionProvider = new WebSocketConnectionProvider();
657
- let onReconnect = () => { };
735
+ let onReconnect = () => {};
658
736
  const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
659
- onListening: socket => {
737
+ onListening: (socket) => {
660
738
  onReconnect = () => socket.reconnect();
661
- }
739
+ },
662
740
  });
663
741
  return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
664
- }
742
+ }
@@ -4,7 +4,6 @@
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",
@@ -12,14 +11,16 @@ export enum HeadlessWorkspaceEventType {
12
11
  AbortedTimedOut = "aborted-timeout",
13
12
  Aborted = "aborted",
14
13
  Failed = "failed",
15
- Started = "started"
14
+ Started = "started",
16
15
  }
17
16
  export namespace HeadlessWorkspaceEventType {
18
17
  export function isRunning(t: HeadlessWorkspaceEventType) {
19
18
  return t === HeadlessWorkspaceEventType.LogOutput;
20
19
  }
21
20
  export function didFinish(t: HeadlessWorkspaceEventType) {
22
- return t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully;
21
+ return (
22
+ t === HeadlessWorkspaceEventType.FinishedButFailed || t === HeadlessWorkspaceEventType.FinishedSuccessfully
23
+ );
23
24
  }
24
25
  }
25
26
 
@@ -36,4 +37,4 @@ export interface HeadlessLogUrls {
36
37
 
37
38
  /** cmp. @const HEADLESS_LOG_STREAM_STATUS_CODE_REGEX */
38
39
  export const HEADLESS_LOG_STREAM_STATUS_CODE = "X-LogStream-StatusCode";
39
- 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
+ }