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