@gitpod/gitpod-protocol 0.1.5-vn-jetbrains-backend-plugin-223.6 → 0.1.5-wk-inte-test-20230117000019.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 (290) hide show
  1. package/data/gitpod-schema.json +16 -0
  2. package/lib/accounting-protocol.d.ts +1 -1
  3. package/lib/accounting-protocol.js +1 -1
  4. package/lib/admin-protocol.d.ts +11 -2
  5. package/lib/admin-protocol.d.ts.map +1 -1
  6. package/lib/admin-protocol.js +1 -1
  7. package/lib/admin-protocol.js.map +1 -1
  8. package/lib/analytics.d.ts +1 -1
  9. package/lib/analytics.js +1 -1
  10. package/lib/attribution.d.ts +5 -1
  11. package/lib/attribution.d.ts.map +1 -1
  12. package/lib/attribution.js +15 -1
  13. package/lib/attribution.js.map +1 -1
  14. package/lib/auth.d.ts +1 -1
  15. package/lib/auth.js +1 -1
  16. package/lib/billing-mode.d.ts +5 -1
  17. package/lib/billing-mode.d.ts.map +1 -1
  18. package/lib/billing-mode.js +1 -1
  19. package/lib/blocked-repositories-protocol.d.ts +1 -1
  20. package/lib/blocked-repositories-protocol.js +1 -1
  21. package/lib/context-url.d.ts +1 -2
  22. package/lib/context-url.d.ts.map +1 -1
  23. package/lib/context-url.js +1 -3
  24. package/lib/context-url.js.map +1 -1
  25. package/lib/context-url.spec.d.ts +1 -3
  26. package/lib/context-url.spec.d.ts.map +1 -1
  27. package/lib/context-url.spec.js +1 -29
  28. package/lib/context-url.spec.js.map +1 -1
  29. package/lib/encryption/container-module.d.ts +1 -1
  30. package/lib/encryption/container-module.js +1 -1
  31. package/lib/encryption/encryption-engine.d.ts +1 -1
  32. package/lib/encryption/encryption-engine.js +1 -1
  33. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  34. package/lib/encryption/encryption-engine.spec.js +1 -1
  35. package/lib/encryption/encryption-service.d.ts +1 -1
  36. package/lib/encryption/encryption-service.js +1 -1
  37. package/lib/encryption/key-provider.d.ts +1 -1
  38. package/lib/encryption/key-provider.js +1 -1
  39. package/lib/env.d.ts +1 -1
  40. package/lib/env.d.ts.map +1 -1
  41. package/lib/env.js +1 -1
  42. package/lib/env.js.map +1 -1
  43. package/lib/experiments/always-default.d.ts +1 -1
  44. package/lib/experiments/configcat-server.d.ts +1 -1
  45. package/lib/experiments/configcat-server.d.ts.map +1 -1
  46. package/lib/experiments/configcat-server.js +2 -1
  47. package/lib/experiments/configcat-server.js.map +1 -1
  48. package/lib/experiments/configcat.d.ts +1 -3
  49. package/lib/experiments/configcat.d.ts.map +1 -1
  50. package/lib/experiments/configcat.js +2 -8
  51. package/lib/experiments/configcat.js.map +1 -1
  52. package/lib/experiments/types.d.ts +1 -3
  53. package/lib/experiments/types.d.ts.map +1 -1
  54. package/lib/experiments/types.js +1 -1
  55. package/lib/experiments/types.js.map +1 -1
  56. package/lib/frontend-dashboard-service.d.ts +85 -0
  57. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  58. package/lib/frontend-dashboard-service.js +32 -0
  59. package/lib/frontend-dashboard-service.js.map +1 -0
  60. package/lib/gitpod-file-parser.d.ts +1 -1
  61. package/lib/gitpod-file-parser.js +1 -1
  62. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  63. package/lib/gitpod-file-parser.spec.js +1 -1
  64. package/lib/gitpod-service.d.ts +17 -22
  65. package/lib/gitpod-service.d.ts.map +1 -1
  66. package/lib/gitpod-service.js +1 -1
  67. package/lib/gitpod-service.js.map +1 -1
  68. package/lib/headless-workspace-log.d.ts +1 -1
  69. package/lib/headless-workspace-log.js +1 -1
  70. package/lib/ide-frontend-service.d.ts +1 -1
  71. package/lib/ide-frontend-service.js +1 -1
  72. package/lib/ide-protocol.d.ts +15 -2
  73. package/lib/ide-protocol.d.ts.map +1 -1
  74. package/lib/ide-protocol.js +11 -1
  75. package/lib/ide-protocol.js.map +1 -1
  76. package/lib/index.d.ts +1 -1
  77. package/lib/index.js +1 -1
  78. package/lib/installation-admin-protocol.d.ts +1 -1
  79. package/lib/installation-admin-protocol.js +1 -1
  80. package/lib/license-protocol.d.ts +1 -1
  81. package/lib/license-protocol.js +1 -1
  82. package/lib/messaging/browser/window-connection.d.ts +1 -1
  83. package/lib/messaging/browser/window-connection.js +1 -1
  84. package/lib/messaging/client-call-metrics.d.ts +3 -1
  85. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  86. package/lib/messaging/client-call-metrics.js +14 -1
  87. package/lib/messaging/client-call-metrics.js.map +1 -1
  88. package/lib/messaging/error.d.ts +3 -1
  89. package/lib/messaging/error.d.ts.map +1 -1
  90. package/lib/messaging/error.js +5 -1
  91. package/lib/messaging/error.js.map +1 -1
  92. package/lib/oss-allowlist.d.ts +1 -1
  93. package/lib/oss-allowlist.js +1 -1
  94. package/lib/payment-protocol.d.ts +1 -1
  95. package/lib/payment-protocol.js +1 -1
  96. package/lib/permission.d.ts +1 -1
  97. package/lib/permission.js +1 -1
  98. package/lib/plans.d.ts +1 -1
  99. package/lib/plans.js +3 -3
  100. package/lib/plans.js.map +1 -1
  101. package/lib/protocol.d.ts +22 -37
  102. package/lib/protocol.d.ts.map +1 -1
  103. package/lib/protocol.js +11 -19
  104. package/lib/protocol.js.map +1 -1
  105. package/lib/protocol.spec.d.ts +1 -1
  106. package/lib/protocol.spec.js +1 -1
  107. package/lib/snapshot-url.d.ts +1 -1
  108. package/lib/snapshot-url.js +1 -1
  109. package/lib/snapshot-url.spec.d.ts +1 -1
  110. package/lib/snapshot-url.spec.js +1 -1
  111. package/lib/team-subscription-protocol.d.ts +1 -1
  112. package/lib/team-subscription-protocol.js +1 -1
  113. package/lib/teams-projects-protocol.d.ts +9 -3
  114. package/lib/teams-projects-protocol.d.ts.map +1 -1
  115. package/lib/teams-projects-protocol.js +9 -2
  116. package/lib/teams-projects-protocol.js.map +1 -1
  117. package/lib/typings/globals.d.ts +2 -1
  118. package/lib/typings/globals.d.ts.map +1 -1
  119. package/lib/typings/globals.js +1 -1
  120. package/lib/usage.d.ts +13 -1
  121. package/lib/usage.d.ts.map +1 -1
  122. package/lib/usage.js +8 -2
  123. package/lib/usage.js.map +1 -1
  124. package/lib/util/analytics.d.ts +1 -1
  125. package/lib/util/analytics.js +1 -1
  126. package/lib/util/async-iterator.d.ts +1 -1
  127. package/lib/util/async-iterator.js +1 -1
  128. package/lib/util/cancelable.d.ts +1 -1
  129. package/lib/util/cancelable.js +1 -1
  130. package/lib/util/date-time.d.ts +1 -1
  131. package/lib/util/date-time.js +1 -1
  132. package/lib/util/debug-app.d.ts +1 -1
  133. package/lib/util/debug-app.js +1 -1
  134. package/lib/util/deep-partial.d.ts +1 -1
  135. package/lib/util/deep-partial.js +1 -1
  136. package/lib/util/deferred.d.ts +1 -1
  137. package/lib/util/deferred.js +1 -1
  138. package/lib/util/garbage-collected-cache.d.ts +1 -1
  139. package/lib/util/garbage-collected-cache.js +1 -1
  140. package/lib/util/generate-workspace-id.d.ts +1 -1
  141. package/lib/util/generate-workspace-id.js +1 -1
  142. package/lib/util/generate-workspace-id.spec.d.ts +1 -1
  143. package/lib/util/generate-workspace-id.spec.js +1 -1
  144. package/lib/util/gitpod-cookie.d.ts +1 -1
  145. package/lib/util/gitpod-cookie.js +1 -1
  146. package/lib/util/gitpod-host-url.d.ts +9 -3
  147. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  148. package/lib/util/gitpod-host-url.js +22 -8
  149. package/lib/util/gitpod-host-url.js.map +1 -1
  150. package/lib/util/gitpod-host-url.spec.d.ts +1 -1
  151. package/lib/util/gitpod-host-url.spec.js +1 -1
  152. package/lib/util/grpc.d.ts +2 -1
  153. package/lib/util/grpc.d.ts.map +1 -1
  154. package/lib/util/grpc.js +1 -1
  155. package/lib/util/grpc.js.map +1 -1
  156. package/lib/util/jaeger-client-types.d.ts +1 -1
  157. package/lib/util/jaeger-client-types.js +1 -1
  158. package/lib/util/logging.d.ts +1 -1
  159. package/lib/util/logging.js +1 -1
  160. package/lib/util/logging.spec.d.ts +1 -1
  161. package/lib/util/logging.spec.js +1 -1
  162. package/lib/util/make-link.d.ts +1 -1
  163. package/lib/util/make-link.js +1 -1
  164. package/lib/util/nice-grpc.d.ts +9 -0
  165. package/lib/util/nice-grpc.d.ts.map +1 -0
  166. package/lib/util/nice-grpc.js +121 -0
  167. package/lib/util/nice-grpc.js.map +1 -0
  168. package/lib/util/parse-workspace-id.d.ts +1 -1
  169. package/lib/util/parse-workspace-id.js +1 -1
  170. package/lib/util/parse-workspace-id.spec.d.ts +1 -1
  171. package/lib/util/parse-workspace-id.spec.js +1 -1
  172. package/lib/util/queue.d.ts +1 -1
  173. package/lib/util/queue.js +1 -1
  174. package/lib/util/queue.spec.d.ts +1 -1
  175. package/lib/util/queue.spec.js +1 -1
  176. package/lib/util/repeat.d.ts +1 -1
  177. package/lib/util/repeat.js +1 -1
  178. package/lib/util/semaphore.d.ts +1 -1
  179. package/lib/util/semaphore.js +1 -1
  180. package/lib/util/skip-if.d.ts +1 -1
  181. package/lib/util/skip-if.js +1 -1
  182. package/lib/util/timeutil.d.ts +1 -1
  183. package/lib/util/timeutil.js +1 -1
  184. package/lib/util/timeutil.spec.d.ts +1 -1
  185. package/lib/util/timeutil.spec.js +1 -1
  186. package/lib/util/tracing.d.ts +1 -1
  187. package/lib/util/tracing.js +1 -1
  188. package/lib/util/tracing.spec.d.ts +1 -1
  189. package/lib/util/tracing.spec.js +1 -1
  190. package/lib/util/workspace-port-authentication.d.ts +1 -1
  191. package/lib/util/workspace-port-authentication.js +1 -1
  192. package/lib/webhook-event.d.ts +1 -1
  193. package/lib/webhook-event.js +1 -1
  194. package/lib/workspace-class.d.ts +2 -2
  195. package/lib/workspace-class.d.ts.map +1 -1
  196. package/lib/workspace-class.js +1 -1
  197. package/lib/workspace-cluster.d.ts +7 -6
  198. package/lib/workspace-cluster.d.ts.map +1 -1
  199. package/lib/workspace-cluster.js +1 -1
  200. package/lib/workspace-cluster.js.map +1 -1
  201. package/lib/workspace-instance.d.ts +2 -1
  202. package/lib/workspace-instance.d.ts.map +1 -1
  203. package/lib/workspace-instance.js +1 -1
  204. package/lib/wsready.d.ts +10 -4
  205. package/lib/wsready.d.ts.map +1 -1
  206. package/lib/wsready.js +3 -1
  207. package/lib/wsready.js.map +1 -1
  208. package/package.json +3 -1
  209. package/pkg-yarn.lock +3 -1
  210. package/provenance-bundle.jsonl +1 -1
  211. package/src/accounting-protocol.ts +1 -1
  212. package/src/admin-protocol.ts +15 -2
  213. package/src/analytics.ts +1 -1
  214. package/src/attribution.ts +16 -1
  215. package/src/auth.ts +1 -1
  216. package/src/billing-mode.ts +8 -1
  217. package/src/blocked-repositories-protocol.ts +1 -1
  218. package/src/context-url.spec.ts +1 -19
  219. package/src/context-url.ts +1 -3
  220. package/src/encryption/container-module.ts +1 -1
  221. package/src/encryption/encryption-engine.spec.ts +1 -1
  222. package/src/encryption/encryption-engine.ts +1 -1
  223. package/src/encryption/encryption-service.ts +1 -1
  224. package/src/encryption/key-provider.ts +1 -1
  225. package/src/env.ts +2 -3
  226. package/src/experiments/always-default.ts +1 -1
  227. package/src/experiments/configcat-server.ts +2 -1
  228. package/src/experiments/configcat.ts +1 -7
  229. package/src/experiments/types.ts +1 -5
  230. package/src/frontend-dashboard-service.ts +109 -0
  231. package/src/gitpod-file-parser.spec.ts +1 -1
  232. package/src/gitpod-file-parser.ts +1 -1
  233. package/src/gitpod-service.ts +20 -26
  234. package/src/headless-workspace-log.ts +1 -1
  235. package/src/ide-frontend-service.ts +1 -1
  236. package/src/ide-protocol.ts +20 -2
  237. package/src/index.ts +1 -1
  238. package/src/installation-admin-protocol.ts +1 -1
  239. package/src/license-protocol.ts +1 -1
  240. package/src/messaging/browser/window-connection.ts +1 -1
  241. package/src/messaging/client-call-metrics.ts +18 -1
  242. package/src/messaging/error.ts +7 -1
  243. package/src/oss-allowlist.ts +1 -1
  244. package/src/payment-protocol.ts +1 -1
  245. package/src/permission.ts +1 -1
  246. package/src/plans.ts +3 -3
  247. package/src/protocol.spec.ts +1 -1
  248. package/src/protocol.ts +30 -49
  249. package/src/snapshot-url.spec.ts +1 -1
  250. package/src/snapshot-url.ts +1 -1
  251. package/src/team-subscription-protocol.ts +1 -1
  252. package/src/teams-projects-protocol.ts +15 -4
  253. package/src/typings/globals.ts +3 -1
  254. package/src/usage.ts +15 -1
  255. package/src/util/analytics.ts +1 -1
  256. package/src/util/async-iterator.ts +1 -1
  257. package/src/util/cancelable.ts +1 -1
  258. package/src/util/date-time.ts +1 -1
  259. package/src/util/debug-app.ts +1 -1
  260. package/src/util/deep-partial.ts +1 -1
  261. package/src/util/deferred.ts +1 -1
  262. package/src/util/garbage-collected-cache.ts +1 -1
  263. package/src/util/generate-workspace-id.spec.ts +1 -1
  264. package/src/util/generate-workspace-id.ts +1 -1
  265. package/src/util/gitpod-cookie.ts +1 -1
  266. package/src/util/gitpod-host-url.spec.ts +1 -1
  267. package/src/util/gitpod-host-url.ts +27 -8
  268. package/src/util/grpc.ts +4 -1
  269. package/src/util/jaeger-client-types.ts +1 -1
  270. package/src/util/logging.spec.ts +1 -1
  271. package/src/util/logging.ts +1 -1
  272. package/src/util/make-link.ts +1 -1
  273. package/src/util/nice-grpc.ts +96 -0
  274. package/src/util/parse-workspace-id.spec.ts +1 -1
  275. package/src/util/parse-workspace-id.ts +1 -1
  276. package/src/util/queue.spec.ts +1 -1
  277. package/src/util/queue.ts +1 -1
  278. package/src/util/repeat.ts +1 -1
  279. package/src/util/semaphore.ts +1 -1
  280. package/src/util/skip-if.ts +1 -1
  281. package/src/util/timeutil.spec.ts +1 -1
  282. package/src/util/timeutil.ts +1 -1
  283. package/src/util/tracing.spec.ts +1 -1
  284. package/src/util/tracing.ts +1 -1
  285. package/src/util/workspace-port-authentication.ts +1 -1
  286. package/src/webhook-event.ts +1 -1
  287. package/src/workspace-class.ts +2 -2
  288. package/src/workspace-cluster.ts +12 -7
  289. package/src/workspace-instance.ts +7 -1
  290. package/src/wsready.ts +12 -6
package/src/protocol.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { WorkspaceInstance, PortVisibility } from "./workspace-instance";
8
8
  import { RoleOrPermission } from "./permission";
9
9
  import { Project } from "./teams-projects-protocol";
10
10
  import { createHash } from "crypto";
11
- import { AttributionId } from "./attribution";
12
11
 
13
12
  export interface UserInfo {
14
13
  name?: string;
@@ -213,6 +212,9 @@ export interface AdditionalUserData {
213
212
  workspaceClasses?: WorkspaceClasses;
214
213
  // additional user profile data
215
214
  profile?: ProfileDetails;
215
+ // whether the user has been migrated to team attribution.
216
+ // a corresponding feature flag (team_only_attribution) triggers the migration.
217
+ isMigratedToTeamOnlyAttribution?: boolean;
216
218
  }
217
219
  export namespace AdditionalUserData {
218
220
  export function set(user: User, partialData: Partial<AdditionalUserData>): User {
@@ -256,8 +258,8 @@ export type IDESettings = {
256
258
  };
257
259
 
258
260
  export interface WorkspaceClasses {
259
- regular: string;
260
- prebuild: string;
261
+ regular?: string;
262
+ prebuild?: string;
261
263
  }
262
264
 
263
265
  export interface UserPlatform {
@@ -294,17 +296,13 @@ export type BillingTier = "paid" | "free";
294
296
  */
295
297
  export const WorkspaceFeatureFlags = {
296
298
  full_workspace_backup: undefined,
297
- persistent_volume_claim: undefined,
298
- protected_secrets: undefined,
299
299
  workspace_class_limiting: undefined,
300
300
  workspace_connection_limiting: undefined,
301
+ workspace_psi: undefined,
301
302
  };
302
303
  export type NamedWorkspaceFeatureFlag = keyof typeof WorkspaceFeatureFlags;
303
304
  export namespace NamedWorkspaceFeatureFlag {
304
- export const WORKSPACE_PERSISTED_FEATTURE_FLAGS: NamedWorkspaceFeatureFlag[] = [
305
- "full_workspace_backup",
306
- "persistent_volume_claim",
307
- ];
305
+ export const WORKSPACE_PERSISTED_FEATTURE_FLAGS: NamedWorkspaceFeatureFlag[] = ["full_workspace_backup"];
308
306
  export function isWorkspacePersisted(ff: NamedWorkspaceFeatureFlag): boolean {
309
307
  return WORKSPACE_PERSISTED_FEATTURE_FLAGS.includes(ff);
310
308
  }
@@ -471,7 +469,7 @@ export interface UserSSHPublicKey extends SSHPublicKeyValue {
471
469
  lastUsedTime?: string;
472
470
  }
473
471
 
474
- export type UserSSHPublicKeyValue = Omit<UserSSHPublicKey, "key" | "userId">;
472
+ export type UserSSHPublicKeyValue = Omit<UserSSHPublicKey, "userId">;
475
473
 
476
474
  export namespace SSHPublicKeyValue {
477
475
  export function validate(value: SSHPublicKeyValue): string | undefined {
@@ -639,6 +637,7 @@ export interface PendingGithubEvent {
639
637
  creationDate: Date;
640
638
  type: string;
641
639
  event: string;
640
+ deleted: boolean;
642
641
  }
643
642
 
644
643
  export interface Snapshot {
@@ -647,26 +646,12 @@ export interface Snapshot {
647
646
  availableTime?: string;
648
647
  originalWorkspaceId: string;
649
648
  bucketId: string;
650
- layoutData?: string;
651
649
  state: SnapshotState;
652
650
  message?: string;
653
651
  }
654
652
 
655
- export interface VolumeSnapshot {
656
- id: string;
657
- workspaceId: string;
658
- creationTime: string;
659
- volumeHandle: string;
660
- }
661
-
662
653
  export type SnapshotState = "pending" | "available" | "error";
663
654
 
664
- export interface LayoutData {
665
- workspaceId: string;
666
- lastUpdatedTime: string;
667
- layoutData: string;
668
- }
669
-
670
655
  export interface Workspace {
671
656
  id: string;
672
657
  creationTime: string;
@@ -801,6 +786,10 @@ export interface JetBrainsConfig {
801
786
  goland?: JetBrainsProductConfig;
802
787
  pycharm?: JetBrainsProductConfig;
803
788
  phpstorm?: JetBrainsProductConfig;
789
+ rubymine?: JetBrainsProductConfig;
790
+ webstorm?: JetBrainsProductConfig;
791
+ rider?: JetBrainsProductConfig;
792
+ clion?: JetBrainsProductConfig;
804
793
  }
805
794
  export interface JetBrainsProductConfig {
806
795
  prebuilds?: JetBrainsPrebuilds;
@@ -1115,14 +1104,17 @@ export namespace SnapshotContext {
1115
1104
  }
1116
1105
  }
1117
1106
 
1118
- export interface StartPrebuildContext extends WorkspaceContext {
1119
- actual: WorkspaceContext;
1107
+ export interface WithCommitHistory {
1120
1108
  commitHistory?: string[];
1121
1109
  additionalRepositoryCommitHistories?: {
1122
1110
  cloneUrl: string;
1123
1111
  commitHistory: string[];
1124
1112
  }[];
1125
- project?: Project;
1113
+ }
1114
+
1115
+ export interface StartPrebuildContext extends WorkspaceContext, WithCommitHistory {
1116
+ actual: WorkspaceContext;
1117
+ project: Project;
1126
1118
  branch?: string;
1127
1119
  }
1128
1120
 
@@ -1204,6 +1196,16 @@ export namespace AdditionalContentContext {
1204
1196
  }
1205
1197
  }
1206
1198
 
1199
+ export interface OpenPrebuildContext extends WorkspaceContext {
1200
+ openPrebuildID: string;
1201
+ }
1202
+
1203
+ export namespace OpenPrebuildContext {
1204
+ export function is(ctx: any): ctx is OpenPrebuildContext {
1205
+ return "openPrebuildID" in ctx;
1206
+ }
1207
+ }
1208
+
1207
1209
  export interface CommitContext extends WorkspaceContext, GitCheckoutInfo {
1208
1210
  /** @deprecated Moved to .repository.cloneUrl, left here for backwards-compatibility for old workspace contextes in the DB */
1209
1211
  cloneUrl?: string;
@@ -1367,17 +1369,6 @@ export interface WorkspaceCreationResult {
1367
1369
  }
1368
1370
  export type RunningWorkspacePrebuildStarting = "queued" | "starting" | "running";
1369
1371
 
1370
- export enum CreateWorkspaceMode {
1371
- // Default returns a running prebuild if there is any, otherwise creates a new workspace (using a prebuild if one is available)
1372
- Default = "default",
1373
- // ForceNew creates a new workspace irrespective of any running prebuilds. This mode is guaranteed to actually create a workspace - but may degrade user experience as currently runnig prebuilds are ignored.
1374
- ForceNew = "force-new",
1375
- // UsePrebuild polls the database waiting for a currently running prebuild to become available. This mode exists to handle the db-sync delay.
1376
- UsePrebuild = "use-prebuild",
1377
- // SelectIfRunning returns a list of currently running workspaces for the context URL if there are any, otherwise falls back to Default mode
1378
- SelectIfRunning = "select-if-running",
1379
- }
1380
-
1381
1372
  export namespace WorkspaceCreationResult {
1382
1373
  export function is(data: any): data is WorkspaceCreationResult {
1383
1374
  return (
@@ -1515,13 +1506,3 @@ export interface StripeConfig {
1515
1506
  individualUsagePriceIds: { [currency: string]: string };
1516
1507
  teamUsagePriceIds: { [currency: string]: string };
1517
1508
  }
1518
-
1519
- export type BillingStrategy = "other" | "stripe";
1520
- export interface CostCenter {
1521
- readonly id: AttributionId;
1522
- /**
1523
- * Unit: credits
1524
- */
1525
- spendingLimit: number;
1526
- billingStrategy: BillingStrategy;
1527
- }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { suite, test } from "mocha-typescript";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  export interface SnapshotUrl {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { v4 as uuidv4 } from "uuid";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import { PrebuiltWorkspaceState } from "./protocol";
7
+ import { PrebuiltWorkspaceState, WorkspaceClasses } from "./protocol";
8
8
  import { v4 as uuidv4 } from "uuid";
9
9
  import { DeepPartial } from "./util/deep-partial";
10
10
  import { WebhookEvent } from "./webhook-event";
@@ -15,8 +15,13 @@ export interface ProjectConfig {
15
15
 
16
16
  export interface ProjectSettings {
17
17
  useIncrementalPrebuilds?: boolean;
18
- usePersistentVolumeClaim?: boolean;
19
18
  keepOutdatedPrebuildsRunning?: boolean;
19
+ // whether new workspaces can start on older prebuilds and incrementally update
20
+ allowUsingPreviousPrebuilds?: boolean;
21
+ // how many commits in the commit history a prebuild is good (undefined and 0 means every commit is prebuilt)
22
+ prebuildEveryNthCommit?: number;
23
+ // preferred workspace classes
24
+ workspaceClasses?: WorkspaceClasses;
20
25
  }
21
26
 
22
27
  export interface Project {
@@ -45,6 +50,7 @@ export namespace Project {
45
50
 
46
51
  export interface Overview {
47
52
  branches: BranchDetails[];
53
+ isConsideredInactive?: boolean;
48
54
  }
49
55
 
50
56
  export namespace Overview {
@@ -119,7 +125,6 @@ export interface StartPrebuildResult {
119
125
  wsid: string;
120
126
  done: boolean;
121
127
  }
122
-
123
128
  export interface Team {
124
129
  id: string;
125
130
  name: string;
@@ -132,6 +137,12 @@ export interface Team {
132
137
 
133
138
  export type TeamMemberRole = "owner" | "member";
134
139
 
140
+ export namespace TeamMemberRole {
141
+ export function isValid(role: any): role is TeamMemberRole {
142
+ return role === "owner" || role === "member";
143
+ }
144
+ }
145
+
135
146
  export interface TeamMemberInfo {
136
147
  userId: string;
137
148
  fullName?: string;
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  interface Window {
8
+ // gitpod is used by supervisor/frontend and vscode browser https://github.com/gitpod-io/openvscode-server/blob/dadd40deda5959c0efdaa0c7d02ab64b6f8b5ad0/src/vs/gitpod/browser/workbench/workbench.ts#L7
8
9
  gitpod: {
9
10
  service: import("../gitpod-service").GitpodService;
10
11
  ideService?: import("../ide-frontend-service").IDEFrontendService;
12
+ loggedUserID?: string;
11
13
  };
12
14
  }
package/src/usage.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { WorkspaceType } from "./protocol";
@@ -69,3 +69,17 @@ export interface InvoiceUsageData {
69
69
  startDate: string;
70
70
  endDate: string;
71
71
  }
72
+
73
+ export interface CostCenterJSON {
74
+ attributionId: string;
75
+ spendingLimit: number;
76
+ billingStrategy: CostCenter_BillingStrategy;
77
+ nextBillingTime?: string;
78
+ billingCycleStart?: string;
79
+ }
80
+
81
+ export enum CostCenter_BillingStrategy {
82
+ BILLING_STRATEGY_STRIPE = "BILLING_STRATEGY_STRIPE",
83
+ BILLING_STRATEGY_OTHER = "BILLING_STRATEGY_OTHER",
84
+ UNRECOGNIZED = "UNRECOGNIZED",
85
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import Analytics = require("analytics-node");
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  // Use asyncIterators with es2015
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { Disposable } from "./disposable";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  export function formatDate(date?: string) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import * as http from "http";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  export class Deferred<T> {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { repeat } from "./repeat";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { suite, test } from "mocha-typescript";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import randomNumber = require("random-number-csprng");
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  import * as cookie from "cookie";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import * as chai from "chai";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  const URL = require("url").URL || window.URL;
@@ -16,10 +16,10 @@ const baseWorkspaceIDRegex =
16
16
  "(([a-f][0-9a-f]{7}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|([0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}))";
17
17
 
18
18
  // this pattern matches v4 UUIDs as well as the new generated workspace ids (e.g. pink-panda-ns35kd21)
19
- const workspaceIDRegex = RegExp(`^${baseWorkspaceIDRegex}$`);
19
+ const workspaceIDRegex = RegExp(`^(?:debug-)?${baseWorkspaceIDRegex}$`);
20
20
 
21
21
  // this pattern matches URL prefixes of workspaces
22
- const workspaceUrlPrefixRegex = RegExp(`^([0-9]{4,6}-)?${baseWorkspaceIDRegex}\\.`);
22
+ const workspaceUrlPrefixRegex = RegExp(`^(([0-9]{4,6}|debug)-)?${baseWorkspaceIDRegex}\\.`);
23
23
 
24
24
  export class GitpodHostUrl {
25
25
  readonly url: URL;
@@ -77,8 +77,15 @@ export class GitpodHostUrl {
77
77
  return updated.with((url) => ({ pathname: `/api${url.pathname}` }));
78
78
  }
79
79
 
80
- withContext(contextUrl: string) {
81
- return this.with((url) => ({ hash: contextUrl }));
80
+ withContext(
81
+ contextUrl: string,
82
+ startOptions?: { showOptions?: boolean; editor?: string; workspaceClass?: string },
83
+ ) {
84
+ const searchParams = new URLSearchParams();
85
+ if (startOptions?.showOptions) {
86
+ searchParams.append("showOptions", "true");
87
+ }
88
+ return this.with((url) => ({ hash: contextUrl, search: searchParams.toString() }));
82
89
  }
83
90
 
84
91
  asWebsocket(): GitpodHostUrl {
@@ -93,6 +100,10 @@ export class GitpodHostUrl {
93
100
  return this.with((url) => ({ pathname: "/" }));
94
101
  }
95
102
 
103
+ asBilling(): GitpodHostUrl {
104
+ return this.with((url) => ({ pathname: "/billing" }));
105
+ }
106
+
96
107
  asLogin(): GitpodHostUrl {
97
108
  return this.with((url) => ({ pathname: "/login" }));
98
109
  }
@@ -120,10 +131,9 @@ export class GitpodHostUrl {
120
131
  });
121
132
  }
122
133
 
123
- asWorkspaceAuth(instanceID: string, redirect?: boolean): GitpodHostUrl {
134
+ asWorkspaceAuth(instanceID: string): GitpodHostUrl {
124
135
  return this.with((url) => ({
125
136
  pathname: `/api/auth/workspace-cookie/${instanceID}`,
126
- search: redirect ? "redirect" : "",
127
137
  }));
128
138
  }
129
139
 
@@ -139,6 +149,10 @@ export class GitpodHostUrl {
139
149
  return result;
140
150
  }
141
151
 
152
+ get debugWorkspace(): boolean {
153
+ return this.url.host.match(workspaceUrlPrefixRegex)?.[2] === "debug";
154
+ }
155
+
142
156
  get workspaceId(): string | undefined {
143
157
  const hostSegs = this.url.host.split(".");
144
158
  if (hostSegs.length > 1) {
@@ -146,7 +160,7 @@ export class GitpodHostUrl {
146
160
  if (matchResults) {
147
161
  // URL has a workspace prefix
148
162
  // port prefixes are excluded
149
- return matchResults[0];
163
+ return matchResults[1];
150
164
  }
151
165
  }
152
166
 
@@ -155,6 +169,11 @@ export class GitpodHostUrl {
155
169
  return pathSegs[2];
156
170
  }
157
171
 
172
+ const cleanHash = this.url.hash.replace(/^#/, "");
173
+ if (this.url.pathname == "/start/" && cleanHash.match(workspaceIDRegex)) {
174
+ return cleanHash;
175
+ }
176
+
158
177
  return undefined;
159
178
  }
160
179
 
package/src/util/grpc.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import * as grpc from "@grpc/grpc-js";
@@ -36,6 +36,9 @@ export interface IClientCallMetrics {
36
36
  sent(labels: IGrpcCallMetricsLabels): void;
37
37
  received(labels: IGrpcCallMetricsLabels): void;
38
38
  handled(labels: IGrpcCallMetricsLabelsWithCode): void;
39
+ startHandleTimer(
40
+ labels: IGrpcCallMetricsLabels,
41
+ ): (labels?: Partial<Record<string, string | number>> | undefined) => number;
39
42
  }
40
43
 
41
44
  export function getGrpcMethodType(requestStream: boolean, responseStream: boolean): GrpcMethodType {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { opentracing } from "jaeger-client";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  import { suite, test } from "mocha-typescript";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  const inspect: (object: any) => string = require("util").inspect; // undefined in frontend
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
7
  function isOpenNewTab(event: MouseEvent): boolean {