@gitpod/gitpod-protocol 0.1.5-vn-integrate-gitpod-yml-tasks-into-jetbrainsa.5 → 0.1.5-vn-6525.77

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 (267) hide show
  1. package/data/gitpod-schema.json +28 -2
  2. package/lib/accounting-protocol.d.ts +10 -10
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +22 -31
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +4 -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/auth.d.ts.map +1 -1
  13. package/lib/context-url.d.ts.map +1 -1
  14. package/lib/context-url.js +3 -3
  15. package/lib/context-url.js.map +1 -1
  16. package/lib/context-url.spec.d.ts.map +1 -1
  17. package/lib/context-url.spec.js +20 -5
  18. package/lib/context-url.spec.js.map +1 -1
  19. package/lib/email-protocol.d.ts +1 -1
  20. package/lib/email-protocol.d.ts.map +1 -1
  21. package/lib/email-protocol.js.map +1 -1
  22. package/lib/encryption/container-module.d.ts.map +1 -1
  23. package/lib/encryption/container-module.js +1 -1
  24. package/lib/encryption/container-module.js.map +1 -1
  25. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  26. package/lib/encryption/encryption-engine.js +7 -7
  27. package/lib/encryption/encryption-engine.js.map +1 -1
  28. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  29. package/lib/encryption/encryption-engine.spec.js +2 -3
  30. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  31. package/lib/encryption/encryption-service.d.ts.map +1 -1
  32. package/lib/encryption/encryption-service.js +1 -1
  33. package/lib/encryption/encryption-service.js.map +1 -1
  34. package/lib/encryption/key-provider.d.ts.map +1 -1
  35. package/lib/encryption/key-provider.js +7 -9
  36. package/lib/encryption/key-provider.js.map +1 -1
  37. package/lib/env.d.ts +1 -1
  38. package/lib/env.d.ts.map +1 -1
  39. package/lib/env.js +5 -5
  40. package/lib/env.js.map +1 -1
  41. package/lib/gitpod-file-parser.d.ts.map +1 -1
  42. package/lib/gitpod-file-parser.js +6 -6
  43. package/lib/gitpod-file-parser.js.map +1 -1
  44. package/lib/gitpod-file-parser.spec.js +42 -39
  45. package/lib/gitpod-file-parser.spec.js.map +1 -1
  46. package/lib/gitpod-service.d.ts +23 -26
  47. package/lib/gitpod-service.d.ts.map +1 -1
  48. package/lib/gitpod-service.js +32 -26
  49. package/lib/gitpod-service.js.map +1 -1
  50. package/lib/headless-workspace-log.d.ts +1 -0
  51. package/lib/headless-workspace-log.d.ts.map +1 -1
  52. package/lib/headless-workspace-log.js +2 -1
  53. package/lib/headless-workspace-log.js.map +1 -1
  54. package/lib/ide-frontend-service.d.ts +1 -1
  55. package/lib/ide-protocol.d.ts +6 -6
  56. package/lib/ide-protocol.d.ts.map +1 -1
  57. package/lib/index.d.ts +16 -16
  58. package/lib/installation-admin-protocol.d.ts +1 -1
  59. package/lib/installation-admin-protocol.d.ts.map +1 -1
  60. package/lib/installation-admin-protocol.js +2 -2
  61. package/lib/installation-admin-protocol.js.map +1 -1
  62. package/lib/license-protocol.d.ts.map +1 -1
  63. package/lib/license-protocol.js.map +1 -1
  64. package/lib/messaging/browser/connection.d.ts +1 -1
  65. package/lib/messaging/browser/connection.d.ts.map +1 -1
  66. package/lib/messaging/browser/connection.js +19 -19
  67. package/lib/messaging/browser/connection.js.map +1 -1
  68. package/lib/messaging/browser/window-connection.d.ts +4 -4
  69. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  70. package/lib/messaging/browser/window-connection.js +9 -6
  71. package/lib/messaging/browser/window-connection.js.map +1 -1
  72. package/lib/messaging/client-call-metrics.d.ts +2 -2
  73. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  74. package/lib/messaging/client-call-metrics.js +20 -20
  75. package/lib/messaging/client-call-metrics.js.map +1 -1
  76. package/lib/messaging/error.d.ts.map +1 -1
  77. package/lib/messaging/error.js.map +1 -1
  78. package/lib/messaging/handler.d.ts.map +1 -1
  79. package/lib/messaging/handler.js +1 -1
  80. package/lib/messaging/node/connection.js +8 -8
  81. package/lib/messaging/node/connection.js.map +1 -1
  82. package/lib/messaging/proxy-factory.d.ts +1 -1
  83. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  84. package/lib/messaging/proxy-factory.js +7 -9
  85. package/lib/messaging/proxy-factory.js.map +1 -1
  86. package/lib/payment-protocol.d.ts.map +1 -1
  87. package/lib/payment-protocol.js +1 -1
  88. package/lib/payment-protocol.js.map +1 -1
  89. package/lib/permission.d.ts +2 -2
  90. package/lib/permission.d.ts.map +1 -1
  91. package/lib/permission.js +12 -23
  92. package/lib/permission.js.map +1 -1
  93. package/lib/plans.d.ts +3 -3
  94. package/lib/plans.d.ts.map +1 -1
  95. package/lib/plans.js +206 -171
  96. package/lib/plans.js.map +1 -1
  97. package/lib/protocol.d.ts +53 -37
  98. package/lib/protocol.d.ts.map +1 -1
  99. package/lib/protocol.js +85 -86
  100. package/lib/protocol.js.map +1 -1
  101. package/lib/snapshot-url.spec.js.map +1 -1
  102. package/lib/team-subscription-protocol.d.ts +5 -3
  103. package/lib/team-subscription-protocol.d.ts.map +1 -1
  104. package/lib/team-subscription-protocol.js +4 -4
  105. package/lib/team-subscription-protocol.js.map +1 -1
  106. package/lib/teams-projects-protocol.d.ts +3 -3
  107. package/lib/teams-projects-protocol.d.ts.map +1 -1
  108. package/lib/teams-projects-protocol.js +1 -1
  109. package/lib/teams-projects-protocol.js.map +1 -1
  110. package/lib/typings/globals.d.ts +2 -2
  111. package/lib/typings/globals.d.ts.map +1 -1
  112. package/lib/util/analytics.d.ts.map +1 -1
  113. package/lib/util/analytics.js +12 -3
  114. package/lib/util/analytics.js.map +1 -1
  115. package/lib/util/async-iterator.d.ts.map +1 -1
  116. package/lib/util/async-iterator.js +3 -3
  117. package/lib/util/async-iterator.js.map +1 -1
  118. package/lib/util/cancelable.js.map +1 -1
  119. package/lib/util/date-time.js +6 -6
  120. package/lib/util/date-time.js.map +1 -1
  121. package/lib/util/deferred.js.map +1 -1
  122. package/lib/util/disposable.d.ts.map +1 -1
  123. package/lib/util/disposable.js +2 -2
  124. package/lib/util/disposable.js.map +1 -1
  125. package/lib/util/event.d.ts.map +1 -1
  126. package/lib/util/event.js +5 -3
  127. package/lib/util/event.js.map +1 -1
  128. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  129. package/lib/util/garbage-collected-cache.js +1 -1
  130. package/lib/util/garbage-collected-cache.js.map +1 -1
  131. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  132. package/lib/util/generate-workspace-id.js +435 -435
  133. package/lib/util/generate-workspace-id.js.map +1 -1
  134. package/lib/util/generate-workspace-id.spec.js +10 -6
  135. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  136. package/lib/util/gitpod-cookie.d.ts +1 -1
  137. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  138. package/lib/util/gitpod-cookie.js +0 -3
  139. package/lib/util/gitpod-cookie.js.map +1 -1
  140. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  141. package/lib/util/gitpod-host-url.js +31 -29
  142. package/lib/util/gitpod-host-url.js.map +1 -1
  143. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  144. package/lib/util/gitpod-host-url.spec.js +15 -5
  145. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  146. package/lib/util/grpc.d.ts.map +1 -1
  147. package/lib/util/grpc.js.map +1 -1
  148. package/lib/util/jaeger-client-types.d.ts.map +1 -1
  149. package/lib/util/logging.d.ts +1 -1
  150. package/lib/util/logging.d.ts.map +1 -1
  151. package/lib/util/logging.js +22 -23
  152. package/lib/util/logging.js.map +1 -1
  153. package/lib/util/make-link.js +5 -5
  154. package/lib/util/make-link.js.map +1 -1
  155. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  156. package/lib/util/parse-workspace-id.js +1 -2
  157. package/lib/util/parse-workspace-id.js.map +1 -1
  158. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  159. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  160. package/lib/util/queue.spec.js +9 -6
  161. package/lib/util/queue.spec.js.map +1 -1
  162. package/lib/util/semaphore.d.ts.map +1 -1
  163. package/lib/util/semaphore.js.map +1 -1
  164. package/lib/util/skip-if.d.ts.map +1 -1
  165. package/lib/util/skip-if.js.map +1 -1
  166. package/lib/util/timeutil.d.ts.map +1 -1
  167. package/lib/util/timeutil.js +2 -2
  168. package/lib/util/timeutil.js.map +1 -1
  169. package/lib/util/timeutil.spec.d.ts.map +1 -1
  170. package/lib/util/timeutil.spec.js.map +1 -1
  171. package/lib/util/tracing.d.ts +6 -6
  172. package/lib/util/tracing.d.ts.map +1 -1
  173. package/lib/util/tracing.js +6 -6
  174. package/lib/util/tracing.js.map +1 -1
  175. package/lib/util/tracing.spec.js +3 -3
  176. package/lib/util/tracing.spec.js.map +1 -1
  177. package/lib/util/workspace-port-authentication.d.ts +7 -7
  178. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  179. package/lib/util/workspace-port-authentication.js +8 -11
  180. package/lib/util/workspace-port-authentication.js.map +1 -1
  181. package/lib/workspace-cluster.d.ts +1 -1
  182. package/lib/workspace-cluster.d.ts.map +1 -1
  183. package/lib/workspace-cluster.js +2 -4
  184. package/lib/workspace-cluster.js.map +1 -1
  185. package/lib/workspace-instance.d.ts +2 -2
  186. package/lib/workspace-instance.d.ts.map +1 -1
  187. package/lib/wsready.d.ts +1 -1
  188. package/lib/wsready.d.ts.map +1 -1
  189. package/lib/wsready.js +2 -2
  190. package/package.json +2 -2
  191. package/pkg-yarn.lock +2 -2
  192. package/provenance-bundle.jsonl +1 -1
  193. package/src/accounting-protocol.ts +53 -51
  194. package/src/admin-protocol.ts +25 -21
  195. package/src/analytics.ts +26 -28
  196. package/src/auth.ts +2 -2
  197. package/src/context-url.spec.ts +25 -11
  198. package/src/context-url.ts +80 -78
  199. package/src/email-protocol.ts +5 -6
  200. package/src/encryption/container-module.ts +2 -3
  201. package/src/encryption/encryption-engine.spec.ts +9 -8
  202. package/src/encryption/encryption-engine.ts +14 -14
  203. package/src/encryption/encryption-service.ts +4 -5
  204. package/src/encryption/key-provider.ts +16 -19
  205. package/src/env.ts +9 -9
  206. package/src/gitpod-file-parser.spec.ts +55 -61
  207. package/src/gitpod-file-parser.ts +16 -17
  208. package/src/gitpod-service.ts +130 -104
  209. package/src/headless-workspace-log.ts +6 -4
  210. package/src/ide-frontend-service.ts +2 -2
  211. package/src/ide-protocol.ts +8 -8
  212. package/src/index.ts +16 -16
  213. package/src/installation-admin-protocol.ts +9 -9
  214. package/src/license-protocol.ts +5 -6
  215. package/src/messaging/browser/connection.ts +45 -47
  216. package/src/messaging/browser/window-connection.ts +39 -29
  217. package/src/messaging/client-call-metrics.ts +70 -71
  218. package/src/messaging/error.ts +1 -3
  219. package/src/messaging/handler.ts +6 -6
  220. package/src/messaging/node/connection.ts +8 -8
  221. package/src/messaging/proxy-factory.ts +23 -30
  222. package/src/oss-allowlist.ts +3 -3
  223. package/src/payment-protocol.ts +2 -2
  224. package/src/permission.ts +20 -31
  225. package/src/plans.ts +236 -189
  226. package/src/protocol.ts +239 -239
  227. package/src/snapshot-url.spec.ts +9 -7
  228. package/src/team-subscription-protocol.ts +33 -23
  229. package/src/teams-projects-protocol.ts +8 -8
  230. package/src/typings/globals.ts +4 -4
  231. package/src/util/analytics.ts +46 -24
  232. package/src/util/async-iterator.ts +4 -5
  233. package/src/util/cancelable.ts +3 -3
  234. package/src/util/date-time.ts +8 -8
  235. package/src/util/deferred.ts +6 -6
  236. package/src/util/disposable.ts +3 -6
  237. package/src/util/event.ts +9 -11
  238. package/src/util/garbage-collected-cache.ts +3 -6
  239. package/src/util/generate-workspace-id.spec.ts +18 -15
  240. package/src/util/generate-workspace-id.ts +453 -453
  241. package/src/util/gitpod-cookie.ts +8 -9
  242. package/src/util/gitpod-host-url.spec.ts +40 -13
  243. package/src/util/gitpod-host-url.ts +37 -34
  244. package/src/util/grpc.ts +1 -1
  245. package/src/util/jaeger-client-types.ts +2 -2
  246. package/src/util/logging.ts +49 -39
  247. package/src/util/make-link.ts +6 -7
  248. package/src/util/parse-workspace-id.spec.ts +17 -8
  249. package/src/util/parse-workspace-id.ts +5 -6
  250. package/src/util/queue.spec.ts +27 -25
  251. package/src/util/repeat.ts +1 -1
  252. package/src/util/semaphore.ts +4 -6
  253. package/src/util/skip-if.ts +9 -6
  254. package/src/util/timeutil.spec.ts +14 -15
  255. package/src/util/timeutil.ts +15 -11
  256. package/src/util/tracing.spec.ts +28 -23
  257. package/src/util/tracing.ts +46 -41
  258. package/src/util/workspace-port-authentication.ts +10 -13
  259. package/src/workspace-cluster.ts +15 -12
  260. package/src/workspace-instance.ts +27 -23
  261. package/src/wsready.ts +3 -3
  262. package/data/builtin-theia-plugins.json +0 -372
  263. package/lib/theia-plugins.d.ts +0 -11
  264. package/lib/theia-plugins.d.ts.map +0 -1
  265. package/lib/theia-plugins.js +0 -8
  266. package/lib/theia-plugins.js.map +0 -1
  267. package/src/theia-plugins.ts +0 -11
@@ -5,32 +5,52 @@
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
+ } from "./protocol";
14
28
  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 } from './installation-admin-protocol';
29
+ Team,
30
+ TeamMemberInfo,
31
+ TeamMembershipInvite,
32
+ Project,
33
+ TeamMemberRole,
34
+ PrebuildWithStatus,
35
+ StartPrebuildResult,
36
+ PartialProject,
37
+ } from "./teams-projects-protocol";
38
+ import { JsonRpcProxy, JsonRpcServer } from "./messaging/proxy-factory";
39
+ import { Disposable, CancellationTokenSource } from "vscode-jsonrpc";
40
+ import { HeadlessLogUrls } from "./headless-workspace-log";
41
+ import { WorkspaceInstance, WorkspaceInstancePort, WorkspaceInstancePhase } from "./workspace-instance";
42
+ import { AdminServer } from "./admin-protocol";
43
+ import { GitpodHostUrl } from "./util/gitpod-host-url";
44
+ import { WebSocketConnectionProvider } from "./messaging/browser/connection";
45
+ import { PermissionName } from "./permission";
46
+ import { LicenseService } from "./license-protocol";
47
+ import { Emitter } from "./util/event";
48
+ import { AccountStatement, CreditAlert } from "./accounting-protocol";
49
+ import { GithubUpgradeURL, PlanCoupon } from "./payment-protocol";
50
+ import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from "./team-subscription-protocol";
51
+ import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
52
+ import { IDEServer } from "./ide-protocol";
53
+ import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
34
54
 
35
55
  export interface GitpodClient {
36
56
  onInstanceUpdate(instance: WorkspaceInstance): void;
@@ -46,7 +66,7 @@ export interface GitpodClient {
46
66
  //#endregion
47
67
  }
48
68
 
49
- export const GitpodServer = Symbol('GitpodServer');
69
+ export const GitpodServer = Symbol("GitpodServer");
50
70
  export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
51
71
  // User related API
52
72
  getLoggedInUser(): Promise<User>;
@@ -136,6 +156,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
136
156
  // Admin Settings
137
157
  adminGetSettings(): Promise<InstallationAdminSettings>;
138
158
  adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
159
+ adminGetTelemetryData(): Promise<TelemetryData>;
139
160
 
140
161
  // Projects
141
162
  getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
@@ -158,8 +179,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
158
179
  deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
159
180
 
160
181
  // content service
161
- getContentBlobUploadUrl(name: string): Promise<string>
162
- getContentBlobDownloadUrl(name: string): Promise<string>
182
+ getContentBlobUploadUrl(name: string): Promise<string>;
183
+ getContentBlobDownloadUrl(name: string): Promise<string>;
163
184
 
164
185
  // Gitpod token
165
186
  getGitpodTokens(): Promise<GitpodToken[]>;
@@ -196,15 +217,6 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
196
217
  */
197
218
  getLayout(workspaceId: string): Promise<string | undefined>;
198
219
 
199
- /**
200
- * @param params
201
- * @returns promise resolves to an URL to be used for the upload
202
- */
203
- preparePluginUpload(params: PreparePluginUploadParams): Promise<string>
204
- resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
205
- installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
206
- uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
207
-
208
220
  guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
209
221
 
210
222
  /**
@@ -236,9 +248,13 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
236
248
 
237
249
  tsGet(): Promise<TeamSubscription[]>;
238
250
  tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
239
- tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>
251
+ tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
240
252
  tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
241
- tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string | undefined): Promise<void>
253
+ tsAssignSlot(
254
+ teamSubscriptionId: string,
255
+ teamSubscriptionSlotId: string,
256
+ identityStr: string | undefined,
257
+ ): Promise<void>;
242
258
  tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
243
259
  tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
244
260
  tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
@@ -254,13 +270,13 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
254
270
  }
255
271
 
256
272
  export interface RateLimiterError {
257
- method?: string,
273
+ method?: string;
258
274
 
259
275
  /**
260
276
  * Retry after this many seconds, earliest.
261
277
  * cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
262
278
  */
263
- retryAfter: number,
279
+ retryAfter: number;
264
280
  }
265
281
 
266
282
  export interface CreateProjectParams {
@@ -291,7 +307,7 @@ export interface ProviderRepository {
291
307
  account: string;
292
308
  accountAvatarUrl: string;
293
309
  cloneUrl: string;
294
- updatedAt: string;
310
+ updatedAt?: string;
295
311
  installationId?: number;
296
312
  installationUpdatedAt?: string;
297
313
 
@@ -305,15 +321,28 @@ export interface ClientHeaderFields {
305
321
  clientRegion?: string;
306
322
  }
307
323
 
308
- export const WorkspaceTimeoutValues = ["30m", "60m", "180m"] as const;
309
-
310
- export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(methods: Partial<JsonRpcProxy<S>>): GitpodServiceImpl<C, S> {
324
+ export const WORKSPACE_TIMEOUT_DEFAULT_SHORT = "short";
325
+ export const WORKSPACE_TIMEOUT_DEFAULT_LONG = "long";
326
+ export const WORKSPACE_TIMEOUT_EXTENDED = "extended";
327
+ export const WORKSPACE_TIMEOUT_EXTENDED_ALT = "180m"; // for backwards compatibility since the IDE uses this
328
+ export const WorkspaceTimeoutValues = [
329
+ WORKSPACE_TIMEOUT_DEFAULT_SHORT,
330
+ WORKSPACE_TIMEOUT_DEFAULT_LONG,
331
+ WORKSPACE_TIMEOUT_EXTENDED,
332
+ WORKSPACE_TIMEOUT_EXTENDED_ALT,
333
+ ] as const;
334
+
335
+ export const createServiceMock = function <C extends GitpodClient, S extends GitpodServer>(
336
+ methods: Partial<JsonRpcProxy<S>>,
337
+ ): GitpodServiceImpl<C, S> {
311
338
  return new GitpodServiceImpl<C, S>(createServerMock(methods));
312
- }
339
+ };
313
340
 
314
- export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(methods: Partial<JsonRpcProxy<S>>): JsonRpcProxy<S> {
315
- methods.setClient = methods.setClient || (() => { });
316
- methods.dispose = methods.dispose || (() => { });
341
+ export const createServerMock = function <C extends GitpodClient, S extends GitpodServer>(
342
+ methods: Partial<JsonRpcProxy<S>>,
343
+ ): JsonRpcProxy<S> {
344
+ methods.setClient = methods.setClient || (() => {});
345
+ methods.dispose = methods.dispose || (() => {});
317
346
  return new Proxy<JsonRpcProxy<S>>(methods as any as JsonRpcProxy<S>, {
318
347
  // @ts-ignore
319
348
  get: (target: S, property: keyof S) => {
@@ -322,25 +351,25 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
322
351
  throw new Error(`Method ${property} not implemented`);
323
352
  }
324
353
  return result;
325
- }
354
+ },
326
355
  });
327
- }
356
+ };
328
357
 
329
358
  type WorkspaceTimeoutDurationTuple = typeof WorkspaceTimeoutValues;
330
359
  export type WorkspaceTimeoutDuration = WorkspaceTimeoutDurationTuple[number];
331
360
 
332
361
  export interface SetWorkspaceTimeoutResult {
333
- resetTimeoutOnWorkspaces: string[]
362
+ resetTimeoutOnWorkspaces: string[];
334
363
  }
335
364
 
336
365
  export interface GetWorkspaceTimeoutResult {
337
- duration: WorkspaceTimeoutDuration
338
- canChange: boolean
366
+ duration: WorkspaceTimeoutDuration;
367
+ canChange: boolean;
339
368
  }
340
369
 
341
370
  export interface StartWorkspaceResult {
342
- instanceID: string
343
- workspaceURL?: string
371
+ instanceID: string;
372
+ workspaceURL?: string;
344
373
  }
345
374
 
346
375
  export namespace GitpodServer {
@@ -384,23 +413,23 @@ export namespace GitpodServer {
384
413
  readonly roundTripTime?: number;
385
414
  }
386
415
  export interface UpdateOwnAuthProviderParams {
387
- readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry
416
+ readonly entry: AuthProviderEntry.UpdateEntry | AuthProviderEntry.NewEntry;
388
417
  }
389
418
  export interface DeleteOwnAuthProviderParams {
390
- readonly id: string
419
+ readonly id: string;
391
420
  }
392
421
  export type AdmissionLevel = "owner" | "everyone";
393
422
  export type PinAction = "pin" | "unpin" | "toggle";
394
423
  export interface GenerateNewGitpodTokenOptions {
395
- name?: string
396
- type: GitpodTokenType
397
- scopes?: string[]
424
+ name?: string;
425
+ type: GitpodTokenType;
426
+ scopes?: string[];
398
427
  }
399
428
  }
400
429
 
401
- export const GitpodServerPath = '/gitpod';
430
+ export const GitpodServerPath = "/gitpod";
402
431
 
403
- export const GitpodServerProxy = Symbol('GitpodServerProxy');
432
+ export const GitpodServerProxy = Symbol("GitpodServerProxy");
404
433
  export type GitpodServerProxy<S extends GitpodServer> = JsonRpcProxy<S>;
405
434
 
406
435
  export class GitpodCompositeClient<Client extends GitpodClient> implements GitpodClient {
@@ -414,8 +443,8 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
414
443
  if (index > -1) {
415
444
  this.clients.splice(index, 1);
416
445
  }
417
- }
418
- }
446
+ },
447
+ };
419
448
  }
420
449
 
421
450
  onInstanceUpdate(instance: WorkspaceInstance): void {
@@ -424,7 +453,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
424
453
  try {
425
454
  client.onInstanceUpdate(instance);
426
455
  } catch (error) {
427
- console.error(error)
456
+ console.error(error);
428
457
  }
429
458
  }
430
459
  }
@@ -436,19 +465,22 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
436
465
  try {
437
466
  client.onPrebuildUpdate(update);
438
467
  } catch (error) {
439
- console.error(error)
468
+ console.error(error);
440
469
  }
441
470
  }
442
471
  }
443
472
  }
444
473
 
445
- onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void {
474
+ onWorkspaceImageBuildLogs(
475
+ info: WorkspaceImageBuild.StateInfo,
476
+ content: WorkspaceImageBuild.LogContent | undefined,
477
+ ): void {
446
478
  for (const client of this.clients) {
447
479
  if (client.onWorkspaceImageBuildLogs) {
448
480
  try {
449
481
  client.onWorkspaceImageBuildLogs(info, content);
450
482
  } catch (error) {
451
- console.error(error)
483
+ console.error(error);
452
484
  }
453
485
  }
454
486
  }
@@ -460,7 +492,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
460
492
  try {
461
493
  client.notifyDidOpenConnection();
462
494
  } catch (error) {
463
- console.error(error)
495
+ console.error(error);
464
496
  }
465
497
  }
466
498
  }
@@ -472,7 +504,7 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
472
504
  try {
473
505
  client.notifyDidCloseConnection();
474
506
  } catch (error) {
475
- console.error(error)
507
+ console.error(error);
476
508
  }
477
509
  }
478
510
  }
@@ -484,17 +516,16 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
484
516
  try {
485
517
  client.onCreditAlert(creditAlert);
486
518
  } catch (error) {
487
- console.error(error)
519
+ console.error(error);
488
520
  }
489
521
  }
490
522
  }
491
523
  }
492
-
493
524
  }
494
525
 
495
526
  export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
496
527
 
497
- const hasWindow = (typeof window !== 'undefined');
528
+ const hasWindow = typeof window !== "undefined";
498
529
  const phasesOrder: Record<WorkspaceInstancePhase, number> = {
499
530
  unknown: 0,
500
531
  preparing: 1,
@@ -504,44 +535,41 @@ const phasesOrder: Record<WorkspaceInstancePhase, number> = {
504
535
  running: 5,
505
536
  interrupted: 6,
506
537
  stopping: 7,
507
- stopped: 8
538
+ stopped: 8,
508
539
  };
509
540
  export class WorkspaceInstanceUpdateListener {
510
541
  private readonly onDidChangeEmitter = new Emitter<void>();
511
542
  readonly onDidChange = this.onDidChangeEmitter.event;
512
543
 
513
- private source: 'sync' | 'update' = 'sync';
544
+ private source: "sync" | "update" = "sync";
514
545
 
515
546
  get info(): WorkspaceInfo {
516
547
  return this._info;
517
548
  }
518
549
 
519
- constructor(
520
- private readonly service: GitpodService,
521
- private _info: WorkspaceInfo
522
- ) {
550
+ constructor(private readonly service: GitpodService, private _info: WorkspaceInfo) {
523
551
  service.registerClient({
524
- onInstanceUpdate: instance => {
552
+ onInstanceUpdate: (instance) => {
525
553
  if (this.isOutOfOrder(instance)) {
526
554
  return;
527
555
  }
528
556
  this.cancelSync();
529
557
  this._info.latestInstance = instance;
530
- this.source = 'update';
558
+ this.source = "update";
531
559
  this.onDidChangeEmitter.fire(undefined);
532
560
  },
533
561
  notifyDidOpenConnection: () => {
534
562
  this.sync();
535
- }
563
+ },
536
564
  });
537
565
  if (hasWindow) {
538
566
  // learn about page lifecycle here: https://developers.google.com/web/updates/2018/07/page-lifecycle-api
539
- window.document.addEventListener('visibilitychange', async () => {
540
- if (window.document.visibilityState === 'visible') {
567
+ window.document.addEventListener("visibilitychange", async () => {
568
+ if (window.document.visibilityState === "visible") {
541
569
  this.sync();
542
570
  }
543
571
  });
544
- window.addEventListener('pageshow', e => {
572
+ window.addEventListener("pageshow", (e) => {
545
573
  if (e.persisted) {
546
574
  this.sync();
547
575
  }
@@ -569,12 +597,12 @@ export class WorkspaceInstanceUpdateListener {
569
597
  return;
570
598
  }
571
599
  this._info = info;
572
- this.source = 'sync';
600
+ this.source = "sync";
573
601
  this.onDidChangeEmitter.fire(undefined);
574
602
  } catch (e) {
575
- console.error('failed to sync workspace instance:', e)
603
+ console.error("failed to sync workspace instance:", e);
576
604
  }
577
- })
605
+ });
578
606
  }
579
607
  private cancelSync(): void {
580
608
  if (this.syncTokenSource) {
@@ -591,7 +619,7 @@ export class WorkspaceInstanceUpdateListener {
591
619
  if (instance.workspaceId !== this._info.workspace.id) {
592
620
  return true;
593
621
  }
594
- if (this.source === 'update') {
622
+ if (this.source === "update") {
595
623
  return false;
596
624
  }
597
625
  if (instance.id !== this.info.latestInstance?.id) {
@@ -599,15 +627,13 @@ export class WorkspaceInstanceUpdateListener {
599
627
  }
600
628
  return phasesOrder[instance.status.phase] < phasesOrder[this.info.latestInstance.status.phase];
601
629
  }
602
-
603
630
  }
604
631
 
605
632
  export interface GitpodServiceOptions {
606
- onReconnect?: () => (void | Promise<void>)
633
+ onReconnect?: () => void | Promise<void>;
607
634
  }
608
635
 
609
636
  export class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
610
-
611
637
  private readonly compositeClient = new GitpodCompositeClient<Client>();
612
638
 
613
639
  constructor(public readonly server: JsonRpcProxy<Server>, private options?: GitpodServiceOptions) {
@@ -622,7 +648,8 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
622
648
 
623
649
  private readonly instanceListeners = new Map<string, Promise<WorkspaceInstanceUpdateListener>>();
624
650
  listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener> {
625
- const listener = this.instanceListeners.get(workspaceId) ||
651
+ const listener =
652
+ this.instanceListeners.get(workspaceId) ||
626
653
  (async () => {
627
654
  const info = await this.server.getWorkspace(workspaceId);
628
655
  return new WorkspaceInstanceUpdateListener(this, info);
@@ -638,26 +665,25 @@ export class GitpodServiceImpl<Client extends GitpodClient, Server extends Gitpo
638
665
  }
639
666
  }
640
667
 
641
- export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>) {
668
+ export function createGitpodService<C extends GitpodClient, S extends GitpodServer>(
669
+ serverUrl: string | Promise<string>,
670
+ ) {
642
671
  const toWsUrl = (serverUrl: string) => {
643
- return new GitpodHostUrl(serverUrl)
644
- .asWebsocket()
645
- .withApi({ pathname: GitpodServerPath })
646
- .toString();
672
+ return new GitpodHostUrl(serverUrl).asWebsocket().withApi({ pathname: GitpodServerPath }).toString();
647
673
  };
648
674
  let url: string | Promise<string>;
649
675
  if (typeof serverUrl === "string") {
650
676
  url = toWsUrl(serverUrl);
651
677
  } else {
652
- url = serverUrl.then(url => toWsUrl(url));
678
+ url = serverUrl.then((url) => toWsUrl(url));
653
679
  }
654
680
 
655
681
  const connectionProvider = new WebSocketConnectionProvider();
656
- let onReconnect = () => { };
682
+ let onReconnect = () => {};
657
683
  const gitpodServer = connectionProvider.createProxy<S>(url, undefined, {
658
- onListening: socket => {
684
+ onListening: (socket) => {
659
685
  onReconnect = () => socket.reconnect();
660
- }
686
+ },
661
687
  });
662
688
  return new GitpodServiceImpl<C, S>(gitpodServer, { onReconnect });
663
- }
689
+ }
@@ -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
+ }
@@ -45,12 +45,12 @@ export interface IDEClient {
45
45
  /**
46
46
  * Desktop IDEs supported by the client.
47
47
  */
48
- desktopIDEs?: string[]
48
+ desktopIDEs?: string[];
49
49
 
50
50
  /**
51
51
  * Steps to install the client on user machine.
52
52
  */
53
- installationSteps?: string[]
53
+ installationSteps?: string[];
54
54
  }
55
55
 
56
56
  export interface IDEOption {
@@ -67,12 +67,12 @@ export interface IDEOption {
67
67
  /**
68
68
  * The type of the IDE, currently 'browser' or 'desktop'.
69
69
  */
70
- type: 'browser' | 'desktop';
70
+ type: "browser" | "desktop";
71
71
 
72
72
  /**
73
- * The logo for the IDE. That could be a key in (see
74
- * components/dashboard/src/images/ideLogos.ts) or a URL.
75
- */
73
+ * The logo for the IDE. That could be a key in (see
74
+ * components/dashboard/src/images/ideLogos.ts) or a URL.
75
+ */
76
76
  logo: string;
77
77
 
78
78
  /**
@@ -93,8 +93,8 @@ export interface IDEOption {
93
93
  notes?: string[];
94
94
 
95
95
  /**
96
- * If `true` this IDE option is not visible in the IDE preferences.
97
- */
96
+ * If `true` this IDE option is not visible in the IDE preferences.
97
+ */
98
98
  hidden?: boolean;
99
99
 
100
100
  /**
package/src/index.ts CHANGED
@@ -4,19 +4,19 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- export * from './protocol';
8
- export * from './gitpod-service';
9
- export * from './util/disposable';
10
- export * from './util/event';
11
- export * from './util/queue';
12
- export * from './license-protocol';
13
- export * from './workspace-instance';
14
- export * from './permission';
15
- export * from './admin-protocol';
16
- export * from './email-protocol';
17
- export * from './headless-workspace-log';
18
- export * from './context-url';
19
- export * from './teams-projects-protocol';
20
- export * from './snapshot-url';
21
- export * from './oss-allowlist';
22
- export * from './installation-admin-protocol';
7
+ export * from "./protocol";
8
+ export * from "./gitpod-service";
9
+ export * from "./util/disposable";
10
+ export * from "./util/event";
11
+ export * from "./util/queue";
12
+ export * from "./license-protocol";
13
+ export * from "./workspace-instance";
14
+ export * from "./permission";
15
+ export * from "./admin-protocol";
16
+ export * from "./email-protocol";
17
+ export * from "./headless-workspace-log";
18
+ export * from "./context-url";
19
+ export * from "./teams-projects-protocol";
20
+ export * from "./snapshot-url";
21
+ export * from "./oss-allowlist";
22
+ export * from "./installation-admin-protocol";
@@ -4,11 +4,11 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import { v4 as uuidv4 } from 'uuid';
7
+ import { v4 as uuidv4 } from "uuid";
8
8
 
9
9
  const InstallationAdminSettingsPrototype = {
10
- sendTelemetry: true
11
- }
10
+ sendTelemetry: true,
11
+ };
12
12
 
13
13
  export type InstallationAdminSettings = typeof InstallationAdminSettingsPrototype;
14
14
 
@@ -23,11 +23,11 @@ export interface InstallationAdmin {
23
23
  settings: InstallationAdminSettings;
24
24
  }
25
25
 
26
- export interface Data {
27
- installationAdmin: InstallationAdmin
28
- totalUsers: number
29
- totalWorkspaces: number
30
- totalInstances: number
26
+ export interface TelemetryData {
27
+ installationAdmin: InstallationAdmin;
28
+ totalUsers: number;
29
+ totalWorkspaces: number;
30
+ totalInstances: number;
31
31
  }
32
32
 
33
33
  export namespace InstallationAdmin {
@@ -36,7 +36,7 @@ export namespace InstallationAdmin {
36
36
  id: uuidv4(),
37
37
  settings: {
38
38
  ...InstallationAdminSettingsPrototype,
39
- }
39
+ },
40
40
  };
41
41
  }
42
42
  }