@gitpod/gitpod-protocol 0.1.5-sje-installer-proxy-config-backup.0 → 0.1.5-sje-licensor-deprecation.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 (298) hide show
  1. package/data/gitpod-schema.json +35 -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 +7 -2
  17. package/lib/billing-mode.d.ts.map +1 -1
  18. package/lib/billing-mode.js +9 -1
  19. package/lib/billing-mode.js.map +1 -1
  20. package/lib/blocked-repositories-protocol.d.ts +1 -1
  21. package/lib/blocked-repositories-protocol.js +1 -1
  22. package/lib/context-url.d.ts +1 -2
  23. package/lib/context-url.d.ts.map +1 -1
  24. package/lib/context-url.js +1 -3
  25. package/lib/context-url.js.map +1 -1
  26. package/lib/context-url.spec.d.ts +1 -3
  27. package/lib/context-url.spec.d.ts.map +1 -1
  28. package/lib/context-url.spec.js +1 -29
  29. package/lib/context-url.spec.js.map +1 -1
  30. package/lib/encryption/container-module.d.ts +1 -1
  31. package/lib/encryption/container-module.js +1 -1
  32. package/lib/encryption/encryption-engine.d.ts +1 -1
  33. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  34. package/lib/encryption/encryption-engine.js +4 -4
  35. package/lib/encryption/encryption-engine.js.map +1 -1
  36. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  37. package/lib/encryption/encryption-engine.spec.js +2 -2
  38. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  39. package/lib/encryption/encryption-service.d.ts +1 -1
  40. package/lib/encryption/encryption-service.js +1 -1
  41. package/lib/encryption/key-provider.d.ts +1 -1
  42. package/lib/encryption/key-provider.js +2 -2
  43. package/lib/encryption/key-provider.js.map +1 -1
  44. package/lib/env.d.ts +1 -1
  45. package/lib/env.d.ts.map +1 -1
  46. package/lib/env.js +1 -1
  47. package/lib/env.js.map +1 -1
  48. package/lib/experiments/always-default.d.ts +1 -1
  49. package/lib/experiments/configcat-server.d.ts +1 -1
  50. package/lib/experiments/configcat-server.d.ts.map +1 -1
  51. package/lib/experiments/configcat-server.js +2 -1
  52. package/lib/experiments/configcat-server.js.map +1 -1
  53. package/lib/experiments/configcat.d.ts +2 -3
  54. package/lib/experiments/configcat.d.ts.map +1 -1
  55. package/lib/experiments/configcat.js +5 -7
  56. package/lib/experiments/configcat.js.map +1 -1
  57. package/lib/experiments/types.d.ts +3 -4
  58. package/lib/experiments/types.d.ts.map +1 -1
  59. package/lib/experiments/types.js +1 -1
  60. package/lib/experiments/types.js.map +1 -1
  61. package/lib/gitpod-file-parser.d.ts +1 -1
  62. package/lib/gitpod-file-parser.js +1 -1
  63. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  64. package/lib/gitpod-file-parser.spec.js +1 -1
  65. package/lib/gitpod-service.d.ts +23 -36
  66. package/lib/gitpod-service.d.ts.map +1 -1
  67. package/lib/gitpod-service.js +13 -1
  68. package/lib/gitpod-service.js.map +1 -1
  69. package/lib/headless-workspace-log.d.ts +1 -1
  70. package/lib/headless-workspace-log.js +1 -1
  71. package/lib/ide-frontend-service.d.ts +1 -1
  72. package/lib/ide-frontend-service.js +1 -1
  73. package/lib/ide-protocol.d.ts +15 -2
  74. package/lib/ide-protocol.d.ts.map +1 -1
  75. package/lib/ide-protocol.js +11 -1
  76. package/lib/ide-protocol.js.map +1 -1
  77. package/lib/index.d.ts +1 -2
  78. package/lib/index.d.ts.map +1 -1
  79. package/lib/index.js +1 -2
  80. package/lib/index.js.map +1 -1
  81. package/lib/installation-admin-protocol.d.ts +1 -1
  82. package/lib/installation-admin-protocol.js +1 -1
  83. package/lib/license-protocol.d.ts +1 -1
  84. package/lib/license-protocol.js +1 -1
  85. package/lib/messaging/browser/window-connection.d.ts +1 -1
  86. package/lib/messaging/browser/window-connection.js +1 -1
  87. package/lib/messaging/client-call-metrics.d.ts +3 -1
  88. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  89. package/lib/messaging/client-call-metrics.js +14 -1
  90. package/lib/messaging/client-call-metrics.js.map +1 -1
  91. package/lib/messaging/error.d.ts +4 -1
  92. package/lib/messaging/error.d.ts.map +1 -1
  93. package/lib/messaging/error.js +7 -1
  94. package/lib/messaging/error.js.map +1 -1
  95. package/lib/oss-allowlist.d.ts +1 -1
  96. package/lib/oss-allowlist.js +1 -1
  97. package/lib/payment-protocol.d.ts +1 -1
  98. package/lib/payment-protocol.js +1 -1
  99. package/lib/permission.d.ts +1 -1
  100. package/lib/permission.js +1 -1
  101. package/lib/plans.d.ts +1 -1
  102. package/lib/plans.js +3 -3
  103. package/lib/plans.js.map +1 -1
  104. package/lib/protocol.d.ts +42 -46
  105. package/lib/protocol.d.ts.map +1 -1
  106. package/lib/protocol.js +19 -22
  107. package/lib/protocol.js.map +1 -1
  108. package/lib/protocol.spec.d.ts +1 -1
  109. package/lib/protocol.spec.js +1 -1
  110. package/lib/snapshot-url.d.ts +1 -1
  111. package/lib/snapshot-url.js +1 -1
  112. package/lib/snapshot-url.spec.d.ts +1 -1
  113. package/lib/snapshot-url.spec.js +1 -1
  114. package/lib/team-subscription-protocol.d.ts +1 -1
  115. package/lib/team-subscription-protocol.js +1 -1
  116. package/lib/teams-projects-protocol.d.ts +6 -4
  117. package/lib/teams-projects-protocol.d.ts.map +1 -1
  118. package/lib/teams-projects-protocol.js +1 -1
  119. package/lib/teams-projects-protocol.js.map +1 -1
  120. package/lib/typings/globals.d.ts +1 -1
  121. package/lib/typings/globals.js +1 -1
  122. package/lib/usage.d.ts +14 -3
  123. package/lib/usage.d.ts.map +1 -1
  124. package/lib/usage.js +8 -2
  125. package/lib/usage.js.map +1 -1
  126. package/lib/util/analytics.d.ts +1 -1
  127. package/lib/util/analytics.js +1 -1
  128. package/lib/util/async-iterator.d.ts +1 -1
  129. package/lib/util/async-iterator.js +1 -1
  130. package/lib/util/cancelable.d.ts +1 -1
  131. package/lib/util/cancelable.js +1 -1
  132. package/lib/util/date-time.d.ts +1 -1
  133. package/lib/util/date-time.js +1 -1
  134. package/lib/util/debug-app.d.ts +1 -1
  135. package/lib/util/debug-app.js +1 -1
  136. package/lib/util/deep-partial.d.ts +1 -1
  137. package/lib/util/deep-partial.js +1 -1
  138. package/lib/util/deferred.d.ts +1 -1
  139. package/lib/util/deferred.js +1 -1
  140. package/lib/util/garbage-collected-cache.d.ts +1 -1
  141. package/lib/util/garbage-collected-cache.js +1 -1
  142. package/lib/util/generate-workspace-id.d.ts +1 -1
  143. package/lib/util/generate-workspace-id.js +1 -1
  144. package/lib/util/generate-workspace-id.spec.d.ts +1 -1
  145. package/lib/util/generate-workspace-id.spec.js +1 -1
  146. package/lib/util/gitpod-cookie.d.ts +1 -1
  147. package/lib/util/gitpod-cookie.js +1 -1
  148. package/lib/util/gitpod-host-url.d.ts +3 -1
  149. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  150. package/lib/util/gitpod-host-url.js +11 -4
  151. package/lib/util/gitpod-host-url.js.map +1 -1
  152. package/lib/util/gitpod-host-url.spec.d.ts +1 -1
  153. package/lib/util/gitpod-host-url.spec.js +1 -1
  154. package/lib/util/grpc.d.ts +2 -1
  155. package/lib/util/grpc.d.ts.map +1 -1
  156. package/lib/util/grpc.js +1 -1
  157. package/lib/util/grpc.js.map +1 -1
  158. package/lib/util/jaeger-client-types.d.ts +1 -1
  159. package/lib/util/jaeger-client-types.js +1 -1
  160. package/lib/util/logging.d.ts +1 -1
  161. package/lib/util/logging.js +1 -1
  162. package/lib/util/logging.spec.d.ts +1 -1
  163. package/lib/util/logging.spec.js +1 -1
  164. package/lib/util/make-link.d.ts +1 -1
  165. package/lib/util/make-link.js +1 -1
  166. package/lib/util/nice-grpc.d.ts +9 -0
  167. package/lib/util/nice-grpc.d.ts.map +1 -0
  168. package/lib/util/nice-grpc.js +121 -0
  169. package/lib/util/nice-grpc.js.map +1 -0
  170. package/lib/util/parse-workspace-id.d.ts +1 -1
  171. package/lib/util/parse-workspace-id.js +1 -1
  172. package/lib/util/parse-workspace-id.spec.d.ts +1 -1
  173. package/lib/util/parse-workspace-id.spec.js +1 -1
  174. package/lib/util/queue.d.ts +1 -1
  175. package/lib/util/queue.js +1 -1
  176. package/lib/util/queue.spec.d.ts +1 -1
  177. package/lib/util/queue.spec.js +1 -1
  178. package/lib/util/repeat.d.ts +1 -1
  179. package/lib/util/repeat.js +1 -1
  180. package/lib/util/semaphore.d.ts +1 -1
  181. package/lib/util/semaphore.js +1 -1
  182. package/lib/util/skip-if.d.ts +1 -1
  183. package/lib/util/skip-if.js +1 -1
  184. package/lib/util/timeutil.d.ts +1 -1
  185. package/lib/util/timeutil.js +1 -1
  186. package/lib/util/timeutil.spec.d.ts +2 -1
  187. package/lib/util/timeutil.spec.d.ts.map +1 -1
  188. package/lib/util/timeutil.spec.js +25 -1
  189. package/lib/util/timeutil.spec.js.map +1 -1
  190. package/lib/util/tracing.d.ts +1 -1
  191. package/lib/util/tracing.js +1 -1
  192. package/lib/util/tracing.spec.d.ts +1 -1
  193. package/lib/util/tracing.spec.js +1 -1
  194. package/lib/util/workspace-port-authentication.d.ts +1 -1
  195. package/lib/util/workspace-port-authentication.js +1 -1
  196. package/lib/webhook-event.d.ts +1 -1
  197. package/lib/webhook-event.js +1 -1
  198. package/lib/workspace-class.d.ts +2 -2
  199. package/lib/workspace-class.d.ts.map +1 -1
  200. package/lib/workspace-class.js +1 -1
  201. package/lib/workspace-cluster.d.ts +7 -6
  202. package/lib/workspace-cluster.d.ts.map +1 -1
  203. package/lib/workspace-cluster.js +1 -1
  204. package/lib/workspace-cluster.js.map +1 -1
  205. package/lib/workspace-instance.d.ts +2 -1
  206. package/lib/workspace-instance.d.ts.map +1 -1
  207. package/lib/workspace-instance.js +1 -1
  208. package/lib/wsready.d.ts +10 -4
  209. package/lib/wsready.d.ts.map +1 -1
  210. package/lib/wsready.js +3 -1
  211. package/lib/wsready.js.map +1 -1
  212. package/package.json +3 -1
  213. package/pkg-yarn.lock +3 -1
  214. package/provenance-bundle.jsonl +1 -1
  215. package/src/accounting-protocol.ts +1 -1
  216. package/src/admin-protocol.ts +15 -2
  217. package/src/analytics.ts +1 -1
  218. package/src/attribution.ts +16 -1
  219. package/src/auth.ts +1 -1
  220. package/src/billing-mode.ts +19 -2
  221. package/src/blocked-repositories-protocol.ts +1 -1
  222. package/src/context-url.spec.ts +1 -19
  223. package/src/context-url.ts +1 -3
  224. package/src/encryption/container-module.ts +1 -1
  225. package/src/encryption/encryption-engine.spec.ts +2 -2
  226. package/src/encryption/encryption-engine.ts +8 -4
  227. package/src/encryption/encryption-service.ts +1 -1
  228. package/src/encryption/key-provider.ts +2 -2
  229. package/src/env.ts +2 -3
  230. package/src/experiments/always-default.ts +1 -1
  231. package/src/experiments/configcat-server.ts +2 -1
  232. package/src/experiments/configcat.ts +4 -6
  233. package/src/experiments/types.ts +5 -6
  234. package/src/gitpod-file-parser.spec.ts +1 -1
  235. package/src/gitpod-file-parser.ts +1 -1
  236. package/src/gitpod-service.ts +38 -40
  237. package/src/headless-workspace-log.ts +1 -1
  238. package/src/ide-frontend-service.ts +1 -1
  239. package/src/ide-protocol.ts +20 -2
  240. package/src/index.ts +1 -2
  241. package/src/installation-admin-protocol.ts +1 -1
  242. package/src/license-protocol.ts +1 -1
  243. package/src/messaging/browser/window-connection.ts +1 -1
  244. package/src/messaging/client-call-metrics.ts +18 -1
  245. package/src/messaging/error.ts +10 -1
  246. package/src/oss-allowlist.ts +1 -1
  247. package/src/payment-protocol.ts +1 -1
  248. package/src/permission.ts +1 -1
  249. package/src/plans.ts +3 -3
  250. package/src/protocol.spec.ts +1 -1
  251. package/src/protocol.ts +47 -57
  252. package/src/snapshot-url.spec.ts +1 -1
  253. package/src/snapshot-url.ts +1 -1
  254. package/src/team-subscription-protocol.ts +1 -1
  255. package/src/teams-projects-protocol.ts +9 -5
  256. package/src/typings/globals.ts +1 -1
  257. package/src/usage.ts +16 -3
  258. package/src/util/analytics.ts +1 -1
  259. package/src/util/async-iterator.ts +1 -1
  260. package/src/util/cancelable.ts +1 -1
  261. package/src/util/date-time.ts +1 -1
  262. package/src/util/debug-app.ts +1 -1
  263. package/src/util/deep-partial.ts +1 -1
  264. package/src/util/deferred.ts +1 -1
  265. package/src/util/garbage-collected-cache.ts +1 -1
  266. package/src/util/generate-workspace-id.spec.ts +1 -1
  267. package/src/util/generate-workspace-id.ts +1 -1
  268. package/src/util/gitpod-cookie.ts +1 -1
  269. package/src/util/gitpod-host-url.spec.ts +1 -1
  270. package/src/util/gitpod-host-url.ts +12 -4
  271. package/src/util/grpc.ts +4 -1
  272. package/src/util/jaeger-client-types.ts +1 -1
  273. package/src/util/logging.spec.ts +1 -1
  274. package/src/util/logging.ts +1 -1
  275. package/src/util/make-link.ts +1 -1
  276. package/src/util/nice-grpc.ts +96 -0
  277. package/src/util/parse-workspace-id.spec.ts +1 -1
  278. package/src/util/parse-workspace-id.ts +1 -1
  279. package/src/util/queue.spec.ts +1 -1
  280. package/src/util/queue.ts +1 -1
  281. package/src/util/repeat.ts +1 -1
  282. package/src/util/semaphore.ts +1 -1
  283. package/src/util/skip-if.ts +1 -1
  284. package/src/util/timeutil.spec.ts +22 -1
  285. package/src/util/timeutil.ts +1 -1
  286. package/src/util/tracing.spec.ts +1 -1
  287. package/src/util/tracing.ts +1 -1
  288. package/src/util/workspace-port-authentication.ts +1 -1
  289. package/src/webhook-event.ts +1 -1
  290. package/src/workspace-class.ts +2 -2
  291. package/src/workspace-cluster.ts +12 -7
  292. package/src/workspace-instance.ts +7 -1
  293. package/src/wsready.ts +12 -6
  294. package/lib/email-protocol.d.ts +0 -49
  295. package/lib/email-protocol.d.ts.map +0 -1
  296. package/lib/email-protocol.js +0 -28
  297. package/lib/email-protocol.js.map +0 -1
  298. package/src/email-protocol.ts +0 -65
@@ -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 { injectable } from "inversify";
@@ -14,6 +14,7 @@ export class PrometheusClientCallMetrics implements IClientCallMetrics {
14
14
  readonly sentCounter: prometheusClient.Counter<string>;
15
15
  readonly receivedCounter: prometheusClient.Counter<string>;
16
16
  readonly handledCounter: prometheusClient.Counter<string>;
17
+ readonly handledSecondsHistogram: prometheusClient.Histogram<string>;
17
18
 
18
19
  constructor() {
19
20
  this.startedCounter = new prometheusClient.Counter({
@@ -40,6 +41,12 @@ export class PrometheusClientCallMetrics implements IClientCallMetrics {
40
41
  labelNames: ["grpc_service", "grpc_method", "grpc_type", "grpc_code"],
41
42
  registers: [prometheusClient.register],
42
43
  });
44
+ this.handledSecondsHistogram = new prometheusClient.Histogram({
45
+ name: "grpc_client_handling_seconds",
46
+ help: "Histogram of response latency (seconds) of the gRPC until it is finished by the application.",
47
+ labelNames: ["grpc_service", "grpc_method", "grpc_type", "grpc_code"],
48
+ registers: [prometheusClient.register],
49
+ });
43
50
  }
44
51
 
45
52
  started(labels: IGrpcCallMetricsLabels): void {
@@ -74,4 +81,14 @@ export class PrometheusClientCallMetrics implements IClientCallMetrics {
74
81
  grpc_code: labels.code,
75
82
  });
76
83
  }
84
+
85
+ startHandleTimer(
86
+ labels: IGrpcCallMetricsLabelsWithCode,
87
+ ): (labels?: Partial<Record<string, string | number>> | undefined) => number {
88
+ return this.handledSecondsHistogram.startTimer({
89
+ grpc_service: labels.service,
90
+ grpc_method: labels.method,
91
+ grpc_type: labels.type,
92
+ });
93
+ }
77
94
  }
@@ -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 namespace ErrorCodes {
@@ -35,12 +35,18 @@ export namespace ErrorCodes {
35
35
  // 430 Repository not whitelisted (custom status code)
36
36
  export const REPOSITORY_NOT_WHITELISTED = 430;
37
37
 
38
+ // 440 Prebuilds now always require a project (custom status code)
39
+ export const PROJECT_REQUIRED = 440;
40
+
38
41
  // 450 Payment error
39
42
  export const PAYMENT_ERROR = 450;
40
43
 
41
44
  // 451 Out of credits
42
45
  export const PAYMENT_SPENDING_LIMIT_REACHED = 451;
43
46
 
47
+ // 451 Error creating a subscription
48
+ export const SUBSCRIPTION_ERROR = 452;
49
+
44
50
  // 455 Invalid cost center (custom status code)
45
51
  export const INVALID_COST_CENTER = 455;
46
52
 
@@ -94,4 +100,7 @@ export namespace ErrorCodes {
94
100
 
95
101
  // 640 Headless logs are not available (yet)
96
102
  export const HEADLESS_LOG_NOT_YET_AVAILABLE = 640;
103
+
104
+ // 650 Invalid Value
105
+ export const INVALID_VALUE = 650;
97
106
  }
@@ -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 OssAllowList {
@@ -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 namespace PaymentProtocol {
package/src/permission.ts CHANGED
@@ -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
  // see below for explanation
package/src/plans.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
  export type Currency = "USD" | "EUR";
@@ -131,7 +131,7 @@ export namespace Plans {
131
131
  githubPlanNumber: 1,
132
132
 
133
133
  type: "free",
134
- name: "Open Source",
134
+ name: "Free",
135
135
  currency: "USD",
136
136
  pricePerMonth: 0,
137
137
  hoursPerMonth: 100,
@@ -146,7 +146,7 @@ export namespace Plans {
146
146
  githubPlanNumber: 5,
147
147
 
148
148
  type: "free-50",
149
- name: "Open Source",
149
+ name: "Free",
150
150
  currency: "USD",
151
151
  pricePerMonth: 0,
152
152
  hoursPerMonth: 50,
@@ -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";
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;
@@ -256,8 +255,8 @@ export type IDESettings = {
256
255
  };
257
256
 
258
257
  export interface WorkspaceClasses {
259
- regular: string;
260
- prebuild: string;
258
+ regular?: string;
259
+ prebuild?: string;
261
260
  }
262
261
 
263
262
  export interface UserPlatform {
@@ -286,17 +285,25 @@ export interface UserFeatureSettings {
286
285
  permanentWSFeatureFlags?: NamedWorkspaceFeatureFlag[];
287
286
  }
288
287
 
288
+ export type BillingTier = "paid" | "free";
289
+
289
290
  /**
290
291
  * The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
291
292
  * If they don't we'll break things during workspace startup.
292
293
  */
293
294
  export const WorkspaceFeatureFlags = {
294
295
  full_workspace_backup: undefined,
295
- persistent_volume_claim: undefined,
296
- protected_secrets: undefined,
297
296
  workspace_class_limiting: undefined,
297
+ workspace_connection_limiting: undefined,
298
+ workspace_psi: undefined,
298
299
  };
299
300
  export type NamedWorkspaceFeatureFlag = keyof typeof WorkspaceFeatureFlags;
301
+ export namespace NamedWorkspaceFeatureFlag {
302
+ export const WORKSPACE_PERSISTED_FEATTURE_FLAGS: NamedWorkspaceFeatureFlag[] = ["full_workspace_backup"];
303
+ export function isWorkspacePersisted(ff: NamedWorkspaceFeatureFlag): boolean {
304
+ return WORKSPACE_PERSISTED_FEATTURE_FLAGS.includes(ff);
305
+ }
306
+ }
300
307
 
301
308
  export interface EnvVarWithValue {
302
309
  name: string;
@@ -459,7 +466,7 @@ export interface UserSSHPublicKey extends SSHPublicKeyValue {
459
466
  lastUsedTime?: string;
460
467
  }
461
468
 
462
- export type UserSSHPublicKeyValue = Omit<UserSSHPublicKey, "key" | "userId">;
469
+ export type UserSSHPublicKeyValue = Omit<UserSSHPublicKey, "userId">;
463
470
 
464
471
  export namespace SSHPublicKeyValue {
465
472
  export function validate(value: SSHPublicKeyValue): string | undefined {
@@ -627,6 +634,7 @@ export interface PendingGithubEvent {
627
634
  creationDate: Date;
628
635
  type: string;
629
636
  event: string;
637
+ deleted: boolean;
630
638
  }
631
639
 
632
640
  export interface Snapshot {
@@ -635,26 +643,12 @@ export interface Snapshot {
635
643
  availableTime?: string;
636
644
  originalWorkspaceId: string;
637
645
  bucketId: string;
638
- layoutData?: string;
639
646
  state: SnapshotState;
640
647
  message?: string;
641
648
  }
642
649
 
643
- export interface VolumeSnapshot {
644
- id: string;
645
- workspaceId: string;
646
- creationTime: string;
647
- volumeHandle: string;
648
- }
649
-
650
650
  export type SnapshotState = "pending" | "available" | "error";
651
651
 
652
- export interface LayoutData {
653
- workspaceId: string;
654
- lastUpdatedTime: string;
655
- layoutData: string;
656
- }
657
-
658
652
  export interface Workspace {
659
653
  id: string;
660
654
  creationTime: string;
@@ -716,7 +710,7 @@ export interface Workspace {
716
710
 
717
711
  export type WorkspaceSoftDeletion = "user" | "gc";
718
712
 
719
- export type WorkspaceType = "regular" | "prebuild" | "probe"; // TODO(gpl) Removed prove here
713
+ export type WorkspaceType = "regular" | "prebuild";
720
714
 
721
715
  export namespace Workspace {
722
716
  export function getFullRepositoryName(ws: Workspace): string | undefined {
@@ -789,6 +783,10 @@ export interface JetBrainsConfig {
789
783
  goland?: JetBrainsProductConfig;
790
784
  pycharm?: JetBrainsProductConfig;
791
785
  phpstorm?: JetBrainsProductConfig;
786
+ rubymine?: JetBrainsProductConfig;
787
+ webstorm?: JetBrainsProductConfig;
788
+ rider?: JetBrainsProductConfig;
789
+ clion?: JetBrainsProductConfig;
792
790
  }
793
791
  export interface JetBrainsProductConfig {
794
792
  prebuilds?: JetBrainsPrebuilds;
@@ -803,6 +801,12 @@ export interface RepositoryCloneInformation {
803
801
  checkoutLocation?: string;
804
802
  }
805
803
 
804
+ export interface CoreDumpConfig {
805
+ enabled?: boolean;
806
+ softLimit?: number;
807
+ hardLimit?: number;
808
+ }
809
+
806
810
  export interface WorkspaceConfig {
807
811
  mainConfiguration?: string;
808
812
  additionalRepositories?: RepositoryCloneInformation[];
@@ -815,6 +819,7 @@ export interface WorkspaceConfig {
815
819
  github?: GithubAppConfig;
816
820
  vscode?: VSCodeConfig;
817
821
  jetbrains?: JetBrainsConfig;
822
+ coreDump?: CoreDumpConfig;
818
823
 
819
824
  /** deprecated. Enabled by default **/
820
825
  experimentalNetwork?: boolean;
@@ -823,13 +828,12 @@ export interface WorkspaceConfig {
823
828
  * Where the config object originates from.
824
829
  *
825
830
  * repo - from the repository
826
- * project-db - from the "Project" stored in the database
827
831
  * definitly-gp - from github.com/gitpod-io/definitely-gp
828
832
  * derived - computed based on analyzing the repository
829
833
  * additional-content - config comes from additional content, usually provided through the project's configuration
830
834
  * default - our static catch-all default config
831
835
  */
832
- _origin?: "repo" | "project-db" | "definitely-gp" | "derived" | "additional-content" | "default";
836
+ _origin?: "repo" | "definitely-gp" | "derived" | "additional-content" | "default";
833
837
 
834
838
  /**
835
839
  * Set of automatically infered feature flags. That's not something the user can set, but
@@ -1097,14 +1101,17 @@ export namespace SnapshotContext {
1097
1101
  }
1098
1102
  }
1099
1103
 
1100
- export interface StartPrebuildContext extends WorkspaceContext {
1101
- actual: WorkspaceContext;
1104
+ export interface WithCommitHistory {
1102
1105
  commitHistory?: string[];
1103
1106
  additionalRepositoryCommitHistories?: {
1104
1107
  cloneUrl: string;
1105
1108
  commitHistory: string[];
1106
1109
  }[];
1107
- project?: Project;
1110
+ }
1111
+
1112
+ export interface StartPrebuildContext extends WorkspaceContext, WithCommitHistory {
1113
+ actual: WorkspaceContext;
1114
+ project: Project;
1108
1115
  branch?: string;
1109
1116
  }
1110
1117
 
@@ -1147,17 +1154,6 @@ export namespace WithEnvvarsContext {
1147
1154
  }
1148
1155
  }
1149
1156
 
1150
- export interface WorkspaceProbeContext extends WorkspaceContext {
1151
- responseURL: string;
1152
- responseToken: string;
1153
- }
1154
-
1155
- export namespace WorkspaceProbeContext {
1156
- export function is(context: any): context is WorkspaceProbeContext {
1157
- return context && "responseURL" in context && "responseToken" in context;
1158
- }
1159
- }
1160
-
1161
1157
  export type RefType = "branch" | "tag" | "revision";
1162
1158
  export namespace RefType {
1163
1159
  export const getRefType = (commit: Commit): RefType => {
@@ -1197,6 +1193,16 @@ export namespace AdditionalContentContext {
1197
1193
  }
1198
1194
  }
1199
1195
 
1196
+ export interface OpenPrebuildContext extends WorkspaceContext {
1197
+ openPrebuildID: string;
1198
+ }
1199
+
1200
+ export namespace OpenPrebuildContext {
1201
+ export function is(ctx: any): ctx is OpenPrebuildContext {
1202
+ return "openPrebuildID" in ctx;
1203
+ }
1204
+ }
1205
+
1200
1206
  export interface CommitContext extends WorkspaceContext, GitCheckoutInfo {
1201
1207
  /** @deprecated Moved to .repository.cloneUrl, left here for backwards-compatibility for old workspace contextes in the DB */
1202
1208
  cloneUrl?: string;
@@ -1360,17 +1366,6 @@ export interface WorkspaceCreationResult {
1360
1366
  }
1361
1367
  export type RunningWorkspacePrebuildStarting = "queued" | "starting" | "running";
1362
1368
 
1363
- export enum CreateWorkspaceMode {
1364
- // Default returns a running prebuild if there is any, otherwise creates a new workspace (using a prebuild if one is available)
1365
- Default = "default",
1366
- // 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.
1367
- ForceNew = "force-new",
1368
- // UsePrebuild polls the database waiting for a currently running prebuild to become available. This mode exists to handle the db-sync delay.
1369
- UsePrebuild = "use-prebuild",
1370
- // SelectIfRunning returns a list of currently running workspaces for the context URL if there are any, otherwise falls back to Default mode
1371
- SelectIfRunning = "select-if-running",
1372
- }
1373
-
1374
1369
  export namespace WorkspaceCreationResult {
1375
1370
  export function is(data: any): data is WorkspaceCreationResult {
1376
1371
  return (
@@ -1504,12 +1499,7 @@ export interface Terms {
1504
1499
  readonly formElements?: object;
1505
1500
  }
1506
1501
 
1507
- export type BillingStrategy = "other" | "stripe";
1508
- export interface CostCenter {
1509
- readonly id: AttributionId;
1510
- /**
1511
- * Unit: credits
1512
- */
1513
- spendingLimit: number;
1514
- billingStrategy: BillingStrategy;
1502
+ export interface StripeConfig {
1503
+ individualUsagePriceIds: { [currency: string]: string };
1504
+ teamUsagePriceIds: { [currency: string]: string };
1515
1505
  }
@@ -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 {
@@ -27,7 +32,6 @@ export interface Project {
27
32
  teamId?: string;
28
33
  userId?: string;
29
34
  appInstallationId: string;
30
- config?: ProjectConfig;
31
35
  settings?: ProjectSettings;
32
36
  creationTime: string;
33
37
  /** This is a flag that triggers the HARD DELETION of this entity */
@@ -46,6 +50,7 @@ export namespace Project {
46
50
 
47
51
  export interface Overview {
48
52
  branches: BranchDetails[];
53
+ isConsideredInactive?: boolean;
49
54
  }
50
55
 
51
56
  export namespace Overview {
@@ -120,7 +125,6 @@ export interface StartPrebuildResult {
120
125
  wsid: string;
121
126
  done: boolean;
122
127
  }
123
-
124
128
  export interface Team {
125
129
  id: string;
126
130
  name: string;
@@ -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
  interface Window {
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";
@@ -28,8 +28,7 @@ export interface PaginationRequest {
28
28
  export interface ListUsageResponse {
29
29
  usageEntriesList: Usage[];
30
30
  pagination?: PaginationResponse;
31
- creditBalanceAtStart: number;
32
- creditBalanceAtEnd: number;
31
+ creditsUsed: number;
33
32
  }
34
33
 
35
34
  export interface PaginationResponse {
@@ -70,3 +69,17 @@ export interface InvoiceUsageData {
70
69
  startDate: string;
71
70
  endDate: string;
72
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";