@gitpod/gitpod-protocol 0.1.5-prs-test-dazzle-rewrite.94 → 0.1.5-prs-prebuilds.16

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