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