@gitpod/gitpod-protocol 0.1.5-svenefftinge-dashboard-invalid-2274.5 → 0.1.5-tar-telemetry-settings-data.0

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 (349) hide show
  1. package/data/builtin-theia-plugins.json +28 -18
  2. package/data/gitpod-schema.json +25 -24
  3. package/lib/accounting-protocol.d.ts +155 -0
  4. package/lib/accounting-protocol.d.ts.map +1 -0
  5. package/lib/accounting-protocol.js +109 -0
  6. package/lib/accounting-protocol.js.map +1 -0
  7. package/lib/admin-protocol.d.ts +32 -5
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +16 -1
  10. package/lib/admin-protocol.js.map +1 -1
  11. package/lib/analytics.d.ts +45 -0
  12. package/lib/analytics.d.ts.map +1 -0
  13. package/lib/analytics.js +10 -0
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/auth.d.ts +25 -0
  16. package/lib/auth.d.ts.map +1 -0
  17. package/lib/auth.js +16 -0
  18. package/lib/auth.js.map +1 -0
  19. package/lib/context-url.d.ts +31 -0
  20. package/lib/context-url.d.ts.map +1 -0
  21. package/lib/context-url.js +102 -0
  22. package/lib/context-url.js.map +1 -0
  23. package/lib/context-url.spec.d.ts +14 -0
  24. package/lib/context-url.spec.d.ts.map +1 -0
  25. package/lib/context-url.spec.js +94 -0
  26. package/lib/context-url.spec.js.map +1 -0
  27. package/lib/email-protocol.d.ts +2 -3
  28. package/lib/email-protocol.d.ts.map +1 -1
  29. package/lib/email-protocol.js +5 -5
  30. package/lib/email-protocol.js.map +1 -1
  31. package/lib/encryption/container-module.d.ts +1 -1
  32. package/lib/encryption/container-module.js +6 -5
  33. package/lib/encryption/container-module.js.map +1 -1
  34. package/lib/encryption/encryption-engine.d.ts +1 -1
  35. package/lib/encryption/encryption-engine.js +20 -21
  36. package/lib/encryption/encryption-engine.js.map +1 -1
  37. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  38. package/lib/encryption/encryption-engine.spec.js +30 -37
  39. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  40. package/lib/encryption/encryption-service.d.ts +1 -1
  41. package/lib/encryption/encryption-service.js +30 -44
  42. package/lib/encryption/encryption-service.js.map +1 -1
  43. package/lib/encryption/key-provider.d.ts +1 -1
  44. package/lib/encryption/key-provider.js +26 -31
  45. package/lib/encryption/key-provider.js.map +1 -1
  46. package/lib/env.d.ts +2 -3
  47. package/lib/env.d.ts.map +1 -1
  48. package/lib/env.js +21 -22
  49. package/lib/env.js.map +1 -1
  50. package/lib/gitpod-file-parser.d.ts +1 -1
  51. package/lib/gitpod-file-parser.js +26 -42
  52. package/lib/gitpod-file-parser.js.map +1 -1
  53. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  54. package/lib/gitpod-file-parser.spec.js +117 -117
  55. package/lib/gitpod-file-parser.spec.js.map +1 -1
  56. package/lib/gitpod-service.d.ts +165 -21
  57. package/lib/gitpod-service.d.ts.map +1 -1
  58. package/lib/gitpod-service.js +171 -257
  59. package/lib/gitpod-service.js.map +1 -1
  60. package/lib/headless-workspace-log.d.ts +9 -12
  61. package/lib/headless-workspace-log.d.ts.map +1 -1
  62. package/lib/headless-workspace-log.js +5 -8
  63. package/lib/headless-workspace-log.js.map +1 -1
  64. package/lib/ide-frontend-service.d.ts +5 -1
  65. package/lib/ide-frontend-service.d.ts.map +1 -1
  66. package/lib/ide-frontend-service.js +1 -1
  67. package/lib/ide-protocol.d.ts +105 -0
  68. package/lib/ide-protocol.d.ts.map +1 -0
  69. package/lib/{util/without.js → ide-protocol.js} +2 -2
  70. package/lib/ide-protocol.js.map +1 -0
  71. package/lib/index.d.ts +7 -1
  72. package/lib/index.d.ts.map +1 -1
  73. package/lib/index.js +8 -2
  74. package/lib/index.js.map +1 -1
  75. package/lib/installation-admin-protocol.d.ts +27 -0
  76. package/lib/installation-admin-protocol.d.ts.map +1 -0
  77. package/lib/installation-admin-protocol.js +30 -0
  78. package/lib/installation-admin-protocol.js.map +1 -0
  79. package/lib/license-protocol.d.ts +1 -1
  80. package/lib/license-protocol.js +1 -1
  81. package/lib/messaging/browser/connection.d.ts +5 -3
  82. package/lib/messaging/browser/connection.d.ts.map +1 -1
  83. package/lib/messaging/browser/connection.js +183 -33
  84. package/lib/messaging/browser/connection.js.map +1 -1
  85. package/lib/messaging/browser/window-connection.d.ts +1 -1
  86. package/lib/messaging/browser/window-connection.js +36 -56
  87. package/lib/messaging/browser/window-connection.js.map +1 -1
  88. package/lib/messaging/client-call-metrics.d.ts +35 -0
  89. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  90. package/lib/messaging/client-call-metrics.js +83 -0
  91. package/lib/messaging/client-call-metrics.js.map +1 -0
  92. package/lib/messaging/error.d.ts +7 -2
  93. package/lib/messaging/error.d.ts.map +1 -1
  94. package/lib/messaging/error.js +14 -4
  95. package/lib/messaging/error.js.map +1 -1
  96. package/lib/messaging/handler.d.ts +10 -0
  97. package/lib/messaging/handler.d.ts.map +1 -1
  98. package/lib/messaging/node/connection.d.ts +1 -17
  99. package/lib/messaging/node/connection.d.ts.map +1 -1
  100. package/lib/messaging/node/connection.js +23 -59
  101. package/lib/messaging/node/connection.js.map +1 -1
  102. package/lib/messaging/proxy-factory.d.ts +2 -0
  103. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  104. package/lib/messaging/proxy-factory.js +74 -159
  105. package/lib/messaging/proxy-factory.js.map +1 -1
  106. package/lib/oss-allowlist.d.ts +14 -0
  107. package/lib/oss-allowlist.d.ts.map +1 -0
  108. package/lib/oss-allowlist.js +8 -0
  109. package/lib/oss-allowlist.js.map +1 -0
  110. package/lib/payment-protocol.d.ts +18 -0
  111. package/lib/payment-protocol.d.ts.map +1 -0
  112. package/lib/payment-protocol.js +13 -0
  113. package/lib/payment-protocol.js.map +1 -0
  114. package/lib/permission.d.ts +10 -5
  115. package/lib/permission.d.ts.map +1 -1
  116. package/lib/permission.js +38 -21
  117. package/lib/permission.js.map +1 -1
  118. package/lib/plans.d.ts +210 -0
  119. package/lib/plans.d.ts.map +1 -0
  120. package/lib/plans.js +570 -0
  121. package/lib/plans.js.map +1 -0
  122. package/lib/protocol.d.ts +134 -59
  123. package/lib/protocol.d.ts.map +1 -1
  124. package/lib/protocol.js +129 -118
  125. package/lib/protocol.js.map +1 -1
  126. package/lib/snapshot-url.d.ts +14 -0
  127. package/lib/snapshot-url.d.ts.map +1 -0
  128. package/lib/snapshot-url.js +26 -0
  129. package/lib/snapshot-url.js.map +1 -0
  130. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +3 -4
  131. package/lib/snapshot-url.spec.d.ts.map +1 -0
  132. package/lib/snapshot-url.spec.js +41 -0
  133. package/lib/snapshot-url.spec.js.map +1 -0
  134. package/lib/team-subscription-protocol.d.ts +73 -0
  135. package/lib/team-subscription-protocol.d.ts.map +1 -0
  136. package/lib/team-subscription-protocol.js +63 -0
  137. package/lib/team-subscription-protocol.js.map +1 -0
  138. package/lib/teams-projects-protocol.d.ts +113 -0
  139. package/lib/teams-projects-protocol.d.ts.map +1 -0
  140. package/lib/teams-projects-protocol.js +30 -0
  141. package/lib/teams-projects-protocol.js.map +1 -0
  142. package/lib/theia-plugins.d.ts +1 -1
  143. package/lib/theia-plugins.js +1 -1
  144. package/lib/typings/globals.d.ts +1 -1
  145. package/lib/typings/globals.js +1 -1
  146. package/lib/util/analytics.d.ts +8 -0
  147. package/lib/util/analytics.d.ts.map +1 -0
  148. package/lib/util/analytics.js +79 -0
  149. package/lib/util/analytics.js.map +1 -0
  150. package/lib/util/async-iterator.d.ts +1 -1
  151. package/lib/util/async-iterator.js +56 -134
  152. package/lib/util/async-iterator.js.map +1 -1
  153. package/lib/util/cancelable.d.ts +1 -1
  154. package/lib/util/cancelable.js +18 -60
  155. package/lib/util/cancelable.js.map +1 -1
  156. package/lib/util/date-time.d.ts +1 -1
  157. package/lib/util/date-time.js +9 -9
  158. package/lib/util/date-time.js.map +1 -1
  159. package/lib/util/deep-partial.d.ts +1 -1
  160. package/lib/util/deep-partial.js +1 -1
  161. package/lib/util/deferred.d.ts +1 -1
  162. package/lib/util/deferred.js +11 -13
  163. package/lib/util/deferred.js.map +1 -1
  164. package/lib/util/disposable.js +26 -39
  165. package/lib/util/disposable.js.map +1 -1
  166. package/lib/util/event.js +58 -74
  167. package/lib/util/event.js.map +1 -1
  168. package/lib/util/garbage-collected-cache.d.ts +2 -1
  169. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  170. package/lib/util/garbage-collected-cache.js +27 -47
  171. package/lib/util/garbage-collected-cache.js.map +1 -1
  172. package/lib/util/generate-workspace-id.d.ts +4 -0
  173. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  174. package/lib/util/generate-workspace-id.js +487 -0
  175. package/lib/util/generate-workspace-id.js.map +1 -0
  176. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  177. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  178. package/lib/util/generate-workspace-id.spec.js +87 -0
  179. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  180. package/lib/util/gitpod-cookie.d.ts +20 -0
  181. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  182. package/lib/util/gitpod-cookie.js +44 -0
  183. package/lib/util/gitpod-cookie.js.map +1 -0
  184. package/lib/util/gitpod-host-url.d.ts +5 -3
  185. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  186. package/lib/util/gitpod-host-url.js +99 -92
  187. package/lib/util/gitpod-host-url.js.map +1 -1
  188. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  189. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  190. package/lib/util/gitpod-host-url.spec.js +124 -0
  191. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  192. package/lib/util/grpc.d.ts +15 -0
  193. package/lib/util/grpc.d.ts.map +1 -0
  194. package/lib/util/grpc.js +18 -0
  195. package/lib/util/grpc.js.map +1 -0
  196. package/lib/util/jaeger-client-types.d.ts +68 -0
  197. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  198. package/lib/util/jaeger-client-types.js +8 -0
  199. package/lib/util/jaeger-client-types.js.map +1 -0
  200. package/lib/util/logging.d.ts +57 -34
  201. package/lib/util/logging.d.ts.map +1 -1
  202. package/lib/util/logging.js +119 -111
  203. package/lib/util/logging.js.map +1 -1
  204. package/lib/util/make-link.d.ts +1 -1
  205. package/lib/util/make-link.js +3 -3
  206. package/lib/util/make-link.js.map +1 -1
  207. package/lib/util/parse-workspace-id.d.ts +14 -4
  208. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  209. package/lib/util/parse-workspace-id.js +39 -9
  210. package/lib/util/parse-workspace-id.js.map +1 -1
  211. package/lib/util/parse-workspace-id.spec.d.ts +9 -1
  212. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  213. package/lib/util/parse-workspace-id.spec.js +128 -48
  214. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  215. package/lib/util/queue.d.ts +1 -1
  216. package/lib/util/queue.js +17 -56
  217. package/lib/util/queue.js.map +1 -1
  218. package/lib/util/queue.spec.d.ts +1 -1
  219. package/lib/util/queue.spec.js +145 -289
  220. package/lib/util/queue.spec.js.map +1 -1
  221. package/lib/util/repeat.d.ts +15 -0
  222. package/lib/util/repeat.d.ts.map +1 -0
  223. package/lib/util/repeat.js +55 -0
  224. package/lib/util/repeat.js.map +1 -0
  225. package/lib/util/semaphore.d.ts +1 -1
  226. package/lib/util/semaphore.js +16 -47
  227. package/lib/util/semaphore.js.map +1 -1
  228. package/lib/util/skip-if.d.ts +1 -1
  229. package/lib/util/skip-if.js +7 -7
  230. package/lib/util/skip-if.js.map +1 -1
  231. package/lib/util/timeutil.d.ts +1 -1
  232. package/lib/util/timeutil.js +29 -17
  233. package/lib/util/timeutil.js.map +1 -1
  234. package/lib/util/timeutil.spec.d.ts +1 -1
  235. package/lib/util/timeutil.spec.js +22 -25
  236. package/lib/util/timeutil.spec.js.map +1 -1
  237. package/lib/util/tracing.d.ts +52 -6
  238. package/lib/util/tracing.d.ts.map +1 -1
  239. package/lib/util/tracing.js +198 -63
  240. package/lib/util/tracing.js.map +1 -1
  241. package/lib/util/tracing.spec.d.ts +7 -0
  242. package/lib/util/tracing.spec.d.ts.map +1 -0
  243. package/lib/util/tracing.spec.js +121 -0
  244. package/lib/util/tracing.spec.js.map +1 -0
  245. package/lib/util/workspace-port-authentication.d.ts +1 -1
  246. package/lib/util/workspace-port-authentication.js +4 -3
  247. package/lib/util/workspace-port-authentication.js.map +1 -1
  248. package/lib/workspace-cluster.d.ts +76 -0
  249. package/lib/workspace-cluster.d.ts.map +1 -0
  250. package/lib/workspace-cluster.js +33 -0
  251. package/lib/workspace-cluster.js.map +1 -0
  252. package/lib/workspace-instance.d.ts +27 -3
  253. package/lib/workspace-instance.d.ts.map +1 -1
  254. package/lib/workspace-instance.js +1 -1
  255. package/lib/wsready.d.ts +1 -1
  256. package/lib/wsready.js +2 -2
  257. package/package.json +33 -17
  258. package/pkg-yarn.lock +18 -9
  259. package/provenance-bundle.jsonl +2 -0
  260. package/src/accounting-protocol.ts +229 -0
  261. package/src/admin-protocol.ts +54 -6
  262. package/src/analytics.ts +54 -0
  263. package/src/auth.ts +27 -0
  264. package/src/context-url.spec.ts +53 -0
  265. package/src/context-url.ts +107 -0
  266. package/src/email-protocol.ts +3 -4
  267. package/src/encryption/container-module.ts +1 -1
  268. package/src/encryption/encryption-engine.spec.ts +1 -1
  269. package/src/encryption/encryption-engine.ts +1 -1
  270. package/src/encryption/encryption-service.ts +1 -1
  271. package/src/encryption/key-provider.ts +1 -1
  272. package/src/env.ts +11 -11
  273. package/src/gitpod-file-parser.spec.ts +1 -1
  274. package/src/gitpod-file-parser.ts +1 -1
  275. package/src/gitpod-service.ts +241 -40
  276. package/src/headless-workspace-log.ts +8 -12
  277. package/src/ide-frontend-service.ts +6 -2
  278. package/src/ide-protocol.ts +119 -0
  279. package/src/index.ts +8 -2
  280. package/src/installation-admin-protocol.ts +42 -0
  281. package/src/license-protocol.ts +1 -1
  282. package/src/messaging/browser/connection.ts +195 -14
  283. package/src/messaging/browser/window-connection.ts +1 -1
  284. package/src/messaging/client-call-metrics.ts +97 -0
  285. package/src/messaging/error.ts +19 -4
  286. package/src/messaging/handler.ts +12 -0
  287. package/src/messaging/node/connection.ts +21 -68
  288. package/src/messaging/proxy-factory.ts +14 -6
  289. package/src/oss-allowlist.ts +15 -0
  290. package/src/payment-protocol.ts +20 -0
  291. package/src/permission.ts +26 -11
  292. package/src/plans.ts +632 -0
  293. package/src/protocol.ts +223 -88
  294. package/src/snapshot-url.spec.ts +25 -0
  295. package/src/snapshot-url.ts +27 -0
  296. package/src/team-subscription-protocol.ts +113 -0
  297. package/src/teams-projects-protocol.ts +147 -0
  298. package/src/theia-plugins.ts +1 -1
  299. package/src/typings/globals.ts +1 -1
  300. package/src/util/analytics.ts +87 -0
  301. package/src/util/async-iterator.ts +1 -1
  302. package/src/util/cancelable.ts +1 -1
  303. package/src/util/date-time.ts +1 -1
  304. package/src/util/deep-partial.ts +1 -1
  305. package/src/util/deferred.ts +2 -2
  306. package/src/util/garbage-collected-cache.ts +10 -4
  307. package/src/util/generate-workspace-id.spec.ts +48 -0
  308. package/src/util/generate-workspace-id.ts +475 -0
  309. package/src/util/gitpod-cookie.ts +39 -0
  310. package/src/util/gitpod-host-url.spec.ts +49 -0
  311. package/src/util/gitpod-host-url.ts +36 -14
  312. package/src/util/grpc.ts +15 -0
  313. package/src/util/jaeger-client-types.ts +102 -0
  314. package/src/util/logging.ts +111 -39
  315. package/src/util/make-link.ts +1 -1
  316. package/src/util/parse-workspace-id.spec.ts +46 -5
  317. package/src/util/parse-workspace-id.ts +39 -8
  318. package/src/util/queue.spec.ts +2 -2
  319. package/src/util/queue.ts +1 -1
  320. package/src/util/repeat.ts +45 -0
  321. package/src/util/semaphore.ts +3 -3
  322. package/src/util/skip-if.ts +2 -2
  323. package/src/util/timeutil.spec.ts +1 -1
  324. package/src/util/timeutil.ts +5 -5
  325. package/src/util/tracing.spec.ts +83 -0
  326. package/src/util/tracing.ts +184 -18
  327. package/src/util/workspace-port-authentication.ts +1 -1
  328. package/src/workspace-cluster.ts +104 -0
  329. package/src/workspace-instance.ts +52 -14
  330. package/src/wsready.ts +2 -2
  331. package/lib/messaging/connection-error-handler.d.ts +0 -27
  332. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  333. package/lib/messaging/connection-error-handler.js +0 -46
  334. package/lib/messaging/connection-error-handler.js.map +0 -1
  335. package/lib/util/repeater.d.ts +0 -22
  336. package/lib/util/repeater.d.ts.map +0 -1
  337. package/lib/util/repeater.js +0 -118
  338. package/lib/util/repeater.js.map +0 -1
  339. package/lib/util/safe-promise.d.ts +0 -11
  340. package/lib/util/safe-promise.d.ts.map +0 -1
  341. package/lib/util/safe-promise.js +0 -34
  342. package/lib/util/safe-promise.js.map +0 -1
  343. package/lib/util/without.d.ts +0 -7
  344. package/lib/util/without.d.ts.map +0 -1
  345. package/lib/util/without.js.map +0 -1
  346. package/src/messaging/connection-error-handler.ts +0 -62
  347. package/src/util/jaeger-client.d.ts +0 -105
  348. package/src/util/repeater.ts +0 -49
  349. package/src/util/safe-promise.ts +0 -26
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
@@ -14,46 +14,44 @@ var __metadata = (this && this.__metadata) || function (k, v) {
14
14
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var mocha_typescript_1 = require("mocha-typescript");
18
- var chai = require("chai");
19
- var gitpod_file_parser_1 = require("./gitpod-file-parser");
20
- var expect = chai.expect;
21
- var DEFAULT_IMAGE = "default-image";
22
- var DEFAULT_CONFIG = { image: DEFAULT_IMAGE };
23
- var TestGitpodFileParser = /** @class */ (function () {
24
- function TestGitpodFileParser() {
25
- }
26
- TestGitpodFileParser.prototype.before = function () {
17
+ const mocha_typescript_1 = require("mocha-typescript");
18
+ const chai = require("chai");
19
+ const gitpod_file_parser_1 = require("./gitpod-file-parser");
20
+ const expect = chai.expect;
21
+ const DEFAULT_IMAGE = "default-image";
22
+ const DEFAULT_CONFIG = { image: DEFAULT_IMAGE };
23
+ let TestGitpodFileParser = class TestGitpodFileParser {
24
+ before() {
27
25
  this.parser = new gitpod_file_parser_1.GitpodFileParser();
28
- };
29
- TestGitpodFileParser.prototype.testOnlyOnePort = function () {
30
- var content = "ports:\n" +
31
- " - port: 5555";
32
- var result = this.parser.parse(content, {}, DEFAULT_CONFIG);
26
+ }
27
+ testOnlyOnePort() {
28
+ const content = `ports:\n` +
29
+ ` - port: 5555`;
30
+ const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
33
31
  expect(result.config).to.deep.equal({
34
32
  ports: [{
35
33
  port: 5555
36
34
  }],
37
35
  image: DEFAULT_IMAGE
38
36
  });
39
- };
40
- TestGitpodFileParser.prototype.testPortRange = function () {
41
- var content = "ports:\n" +
42
- " - port: 5555\n" +
43
- " - port: 3000-3999"; // should be filtered out by default
44
- var result = this.parser.parse(content, {}, DEFAULT_CONFIG);
37
+ }
38
+ testPortRange() {
39
+ const content = `ports:\n` +
40
+ ` - port: 5555\n` +
41
+ ` - port: 3000-3999`; // should be filtered out by default
42
+ const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
45
43
  expect(result.config).to.deep.equal({
46
44
  ports: [{
47
45
  port: 5555
48
46
  }],
49
47
  image: DEFAULT_IMAGE
50
48
  });
51
- };
52
- TestGitpodFileParser.prototype.testPortRangeAccepted = function () {
53
- var content = "ports:\n" +
54
- " - port: 5555\n" +
55
- " - port: 3000-3999"; // should be included if explicitly supported
56
- var result = this.parser.parse(content, { acceptPortRanges: true }, DEFAULT_CONFIG);
49
+ }
50
+ testPortRangeAccepted() {
51
+ const content = `ports:\n` +
52
+ ` - port: 5555\n` +
53
+ ` - port: 3000-3999`; // should be included if explicitly supported
54
+ const result = this.parser.parse(content, { acceptPortRanges: true }, DEFAULT_CONFIG);
57
55
  expect(result.config).to.deep.equal({
58
56
  ports: [{
59
57
  port: 5555
@@ -62,123 +60,125 @@ var TestGitpodFileParser = /** @class */ (function () {
62
60
  }],
63
61
  image: DEFAULT_IMAGE
64
62
  });
65
- };
66
- TestGitpodFileParser.prototype.testSimpleTask = function () {
67
- var content = "tasks:\n" +
68
- " - command: yarn";
69
- var result = this.parser.parse(content, {}, DEFAULT_CONFIG);
63
+ }
64
+ testSimpleTask() {
65
+ const content = `tasks:\n` +
66
+ ` - command: yarn`;
67
+ const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
70
68
  expect(result.config).to.deep.equal({
71
69
  tasks: [{
72
70
  command: "yarn"
73
71
  }],
74
72
  image: DEFAULT_IMAGE
75
73
  });
76
- };
77
- TestGitpodFileParser.prototype.testSimpleImage = function () {
78
- var imageName = "my-test-org/my-test-image:some-tag";
79
- var content = "image: \"" + imageName + "\"\n";
80
- var result = this.parser.parse(content);
74
+ }
75
+ testSimpleImage() {
76
+ const imageName = "my-test-org/my-test-image:some-tag";
77
+ const content = `image: "${imageName}"\n`;
78
+ const result = this.parser.parse(content);
81
79
  expect(result.config).to.deep.equal({
82
80
  image: imageName
83
81
  });
84
- };
85
- TestGitpodFileParser.prototype.testComplexImageWithoutContext = function () {
86
- var dockerFileName = 'Dockerfile';
87
- var content = "image:\n file: " + dockerFileName + "\n";
88
- var result = this.parser.parse(content);
82
+ }
83
+ testComplexImageWithoutContext() {
84
+ const dockerFileName = 'Dockerfile';
85
+ const content = `image:\n file: ${dockerFileName}\n`;
86
+ const result = this.parser.parse(content);
89
87
  expect(result.config).to.deep.equal({
90
88
  image: {
91
89
  file: dockerFileName
92
90
  }
93
91
  });
94
- };
95
- TestGitpodFileParser.prototype.testComplexImageWithContext = function () {
96
- var dockerFileName = 'Dockerfile';
97
- var dockerContext = 'docker';
98
- var content = "image:\n file: " + dockerFileName + "\n context: " + dockerContext + "\n";
99
- var result = this.parser.parse(content);
92
+ }
93
+ testComplexImageWithContext() {
94
+ const dockerFileName = 'Dockerfile';
95
+ const dockerContext = 'docker';
96
+ const content = `image:\n file: ${dockerFileName}\n context: ${dockerContext}\n`;
97
+ const result = this.parser.parse(content);
100
98
  expect(result.config).to.deep.equal({
101
99
  image: {
102
100
  file: dockerFileName,
103
101
  context: dockerContext
104
102
  }
105
103
  });
106
- };
107
- TestGitpodFileParser.prototype.testGitconfig = function () {
108
- var content = "\ngitConfig:\n core.autocrlf: input\n";
109
- var result = this.parser.parse(content, {}, DEFAULT_CONFIG);
104
+ }
105
+ testGitconfig() {
106
+ const content = `
107
+ gitConfig:
108
+ core.autocrlf: input
109
+ `;
110
+ const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
110
111
  expect(result.config).to.deep.equal({
111
112
  gitConfig: {
112
113
  "core.autocrlf": "input"
113
114
  },
114
115
  image: DEFAULT_IMAGE
115
116
  });
116
- };
117
- TestGitpodFileParser.prototype.testBrokenConfig = function () {
118
- var content = "image: 42\n";
119
- var result = this.parser.parse(content, {}, DEFAULT_CONFIG);
117
+ }
118
+ testBrokenConfig() {
119
+ const content = `image: 42\n`;
120
+ const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
120
121
  expect(result.config).to.deep.equal({
121
122
  image: DEFAULT_IMAGE
122
123
  });
123
- };
124
- __decorate([
125
- mocha_typescript_1.test,
126
- __metadata("design:type", Function),
127
- __metadata("design:paramtypes", []),
128
- __metadata("design:returntype", void 0)
129
- ], TestGitpodFileParser.prototype, "testOnlyOnePort", null);
130
- __decorate([
131
- mocha_typescript_1.test,
132
- __metadata("design:type", Function),
133
- __metadata("design:paramtypes", []),
134
- __metadata("design:returntype", void 0)
135
- ], TestGitpodFileParser.prototype, "testPortRange", null);
136
- __decorate([
137
- mocha_typescript_1.test,
138
- __metadata("design:type", Function),
139
- __metadata("design:paramtypes", []),
140
- __metadata("design:returntype", void 0)
141
- ], TestGitpodFileParser.prototype, "testPortRangeAccepted", null);
142
- __decorate([
143
- mocha_typescript_1.test,
144
- __metadata("design:type", Function),
145
- __metadata("design:paramtypes", []),
146
- __metadata("design:returntype", void 0)
147
- ], TestGitpodFileParser.prototype, "testSimpleTask", null);
148
- __decorate([
149
- mocha_typescript_1.test,
150
- __metadata("design:type", Function),
151
- __metadata("design:paramtypes", []),
152
- __metadata("design:returntype", void 0)
153
- ], TestGitpodFileParser.prototype, "testSimpleImage", null);
154
- __decorate([
155
- mocha_typescript_1.test,
156
- __metadata("design:type", Function),
157
- __metadata("design:paramtypes", []),
158
- __metadata("design:returntype", void 0)
159
- ], TestGitpodFileParser.prototype, "testComplexImageWithoutContext", null);
160
- __decorate([
161
- mocha_typescript_1.test,
162
- __metadata("design:type", Function),
163
- __metadata("design:paramtypes", []),
164
- __metadata("design:returntype", void 0)
165
- ], TestGitpodFileParser.prototype, "testComplexImageWithContext", null);
166
- __decorate([
167
- mocha_typescript_1.test,
168
- __metadata("design:type", Function),
169
- __metadata("design:paramtypes", []),
170
- __metadata("design:returntype", void 0)
171
- ], TestGitpodFileParser.prototype, "testGitconfig", null);
172
- __decorate([
173
- mocha_typescript_1.test,
174
- __metadata("design:type", Function),
175
- __metadata("design:paramtypes", []),
176
- __metadata("design:returntype", void 0)
177
- ], TestGitpodFileParser.prototype, "testBrokenConfig", null);
178
- TestGitpodFileParser = __decorate([
179
- mocha_typescript_1.suite
180
- ], TestGitpodFileParser);
181
- return TestGitpodFileParser;
182
- }());
124
+ }
125
+ };
126
+ __decorate([
127
+ mocha_typescript_1.test,
128
+ __metadata("design:type", Function),
129
+ __metadata("design:paramtypes", []),
130
+ __metadata("design:returntype", void 0)
131
+ ], TestGitpodFileParser.prototype, "testOnlyOnePort", null);
132
+ __decorate([
133
+ mocha_typescript_1.test,
134
+ __metadata("design:type", Function),
135
+ __metadata("design:paramtypes", []),
136
+ __metadata("design:returntype", void 0)
137
+ ], TestGitpodFileParser.prototype, "testPortRange", null);
138
+ __decorate([
139
+ mocha_typescript_1.test,
140
+ __metadata("design:type", Function),
141
+ __metadata("design:paramtypes", []),
142
+ __metadata("design:returntype", void 0)
143
+ ], TestGitpodFileParser.prototype, "testPortRangeAccepted", null);
144
+ __decorate([
145
+ mocha_typescript_1.test,
146
+ __metadata("design:type", Function),
147
+ __metadata("design:paramtypes", []),
148
+ __metadata("design:returntype", void 0)
149
+ ], TestGitpodFileParser.prototype, "testSimpleTask", null);
150
+ __decorate([
151
+ mocha_typescript_1.test,
152
+ __metadata("design:type", Function),
153
+ __metadata("design:paramtypes", []),
154
+ __metadata("design:returntype", void 0)
155
+ ], TestGitpodFileParser.prototype, "testSimpleImage", null);
156
+ __decorate([
157
+ mocha_typescript_1.test,
158
+ __metadata("design:type", Function),
159
+ __metadata("design:paramtypes", []),
160
+ __metadata("design:returntype", void 0)
161
+ ], TestGitpodFileParser.prototype, "testComplexImageWithoutContext", null);
162
+ __decorate([
163
+ mocha_typescript_1.test,
164
+ __metadata("design:type", Function),
165
+ __metadata("design:paramtypes", []),
166
+ __metadata("design:returntype", void 0)
167
+ ], TestGitpodFileParser.prototype, "testComplexImageWithContext", null);
168
+ __decorate([
169
+ mocha_typescript_1.test,
170
+ __metadata("design:type", Function),
171
+ __metadata("design:paramtypes", []),
172
+ __metadata("design:returntype", void 0)
173
+ ], TestGitpodFileParser.prototype, "testGitconfig", null);
174
+ __decorate([
175
+ mocha_typescript_1.test,
176
+ __metadata("design:type", Function),
177
+ __metadata("design:paramtypes", []),
178
+ __metadata("design:returntype", void 0)
179
+ ], TestGitpodFileParser.prototype, "testBrokenConfig", null);
180
+ TestGitpodFileParser = __decorate([
181
+ mocha_typescript_1.suite
182
+ ], TestGitpodFileParser);
183
183
  module.exports = new TestGitpodFileParser(); // Only to circumvent no usage warning :-/
184
184
  //# sourceMappingURL=gitpod-file-parser.spec.js.map
@@ -1 +1 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E,EAAE,EAAE,cAAc,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAChC,SAAS,EAAE;gBACP,eAAe,EAAE,OAAO;aAC3B;YACD,KAAK,EAAE,aAAa;SACvB,CAAC,CAAC;IACP,CAAC;IAEY,gBAAgB;QACzB,MAAM,OAAO,GACT,aAAa,CAAC;QAElB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAChC,KAAK,EAAE,aAAa;SACvB,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA5HS;IAAL,uBAAI;;;;2DAYJ;AAEK;IAAL,uBAAI;;;;yDAaJ;AAEK;IAAL,uBAAI;;;;iEAeJ;AAEK;IAAL,uBAAI;;;;0DAYJ;AAEK;IAAL,uBAAI;;;;2DASJ;AAEK;IAAL,uBAAI;;;;0EAWJ;AAEK;IAAL,uBAAI;;;;uEAaJ;AAEK;IAAL,uBAAI;;;;yDAcJ;AAEK;IAAL,uBAAI;;;;4DAQJ;AAnIQ,oBAAoB;IAAhC,wBAAK;GAAO,oBAAoB,CAoIhC;AACD,MAAM,CAAC,OAAO,GAAG,IAAI,oBAAoB,EAAE,CAAA,CAAG,0CAA0C"}
@@ -1,34 +1,43 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
- import { User, WorkspaceInfo, WorkspaceCreationResult, UserMessage, WorkspaceInstanceUser, WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, Branding, CreateWorkspaceMode, Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType, GitpodToken, AuthProviderEntry } from './protocol';
6
+ import { User, WorkspaceInfo, WorkspaceCreationResult, WorkspaceInstanceUser, WhitelistedRepository, WorkspaceImageBuild, AuthProviderInfo, CreateWorkspaceMode, Token, UserEnvVarValue, ResolvePluginsParams, PreparePluginUploadParams, Terms, ResolvedPlugins, Configuration, InstallPluginsParams, UninstallPluginParams, UserInfo, GitpodTokenType, GitpodToken, AuthProviderEntry, GuessGitTokenScopesParams, GuessedGitTokenScopes, ProjectEnvVar } from './protocol';
7
+ import { Team, TeamMemberInfo, TeamMembershipInvite, Project, TeamMemberRole, PrebuildWithStatus, StartPrebuildResult, PartialProject } from './teams-projects-protocol';
7
8
  import { JsonRpcProxy, JsonRpcServer } from './messaging/proxy-factory';
8
9
  import { Disposable } from 'vscode-jsonrpc';
9
- import { HeadlessLogEvent } from './headless-workspace-log';
10
+ import { HeadlessLogUrls } from './headless-workspace-log';
10
11
  import { WorkspaceInstance, WorkspaceInstancePort } from './workspace-instance';
11
12
  import { AdminServer } from './admin-protocol';
12
13
  import { PermissionName } from './permission';
13
14
  import { LicenseService } from './license-protocol';
15
+ import { AccountStatement, CreditAlert } from './accounting-protocol';
16
+ import { GithubUpgradeURL, PlanCoupon } from './payment-protocol';
17
+ import { TeamSubscription, TeamSubscriptionSlot, TeamSubscriptionSlotResolved } from './team-subscription-protocol';
18
+ import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from './analytics';
19
+ import { IDEServer } from './ide-protocol';
20
+ import { InstallationAdminSettings, Data } from './installation-admin-protocol';
14
21
  export interface GitpodClient {
15
22
  onInstanceUpdate(instance: WorkspaceInstance): void;
16
23
  onWorkspaceImageBuildLogs: WorkspaceImageBuild.LogCallback;
17
- onHeadlessWorkspaceLogs(evt: HeadlessLogEvent): void;
24
+ onPrebuildUpdate(update: PrebuildWithStatus): void;
25
+ onCreditAlert(creditAlert: CreditAlert): void;
18
26
  notifyDidOpenConnection(): void;
19
27
  notifyDidCloseConnection(): void;
20
28
  }
21
29
  export declare const GitpodServer: unique symbol;
22
- export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService {
30
+ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
23
31
  getLoggedInUser(): Promise<User>;
32
+ getTerms(): Promise<Terms>;
24
33
  updateLoggedInUser(user: Partial<User>): Promise<User>;
25
34
  getAuthProviders(): Promise<AuthProviderInfo[]>;
26
35
  getOwnAuthProviders(): Promise<AuthProviderEntry[]>;
27
- updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<void>;
36
+ updateOwnAuthProvider(params: GitpodServer.UpdateOwnAuthProviderParams): Promise<AuthProviderEntry>;
28
37
  deleteOwnAuthProvider(params: GitpodServer.DeleteOwnAuthProviderParams): Promise<void>;
29
- getBranding(): Promise<Branding>;
30
38
  getConfiguration(): Promise<Configuration>;
31
39
  getToken(query: GitpodServer.GetTokenSearchOptions): Promise<Token | undefined>;
40
+ getGitpodTokenScopes(tokenHash: string): Promise<string[]>;
32
41
  /**
33
42
  * @deprecated
34
43
  */
@@ -40,8 +49,15 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
40
49
  getWorkspaceOwner(workspaceId: string): Promise<UserInfo | undefined>;
41
50
  getWorkspaceUsers(workspaceId: string): Promise<WorkspaceInstanceUser[]>;
42
51
  getFeaturedRepositories(): Promise<WhitelistedRepository[]>;
52
+ getSuggestedContextURLs(): Promise<string[]>;
53
+ /**
54
+ * **Security:**
55
+ * Sensitive information like an owner token is erased, since it allows access for all team members.
56
+ * If you need to access an owner token use `getOwnerToken` instead.
57
+ */
43
58
  getWorkspace(id: string): Promise<WorkspaceInfo>;
44
59
  isWorkspaceOwner(workspaceId: string): Promise<boolean>;
60
+ getOwnerToken(workspaceId: string): Promise<string>;
45
61
  /**
46
62
  * Creates and starts a workspace for the given context URL.
47
63
  * @param options GitpodServer.CreateWorkspaceOptions
@@ -56,8 +72,8 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
56
72
  updateWorkspaceUserPin(id: string, action: GitpodServer.PinAction): Promise<void>;
57
73
  sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
58
74
  watchWorkspaceImageBuildLogs(workspaceId: string): Promise<void>;
59
- watchHeadlessWorkspaceLogs(workspaceId: string): Promise<void>;
60
75
  isPrebuildDone(pwsid: string): Promise<boolean>;
76
+ getHeadlessLog(instanceId: string): Promise<HeadlessLogUrls>;
61
77
  setWorkspaceTimeout(workspaceId: string, duration: WorkspaceTimeoutDuration): Promise<SetWorkspaceTimeoutResult>;
62
78
  getWorkspaceTimeout(workspaceId: string): Promise<GetWorkspaceTimeoutResult>;
63
79
  sendHeartBeat(options: GitpodServer.SendHeartBeatOptions): Promise<void>;
@@ -65,23 +81,59 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
65
81
  getOpenPorts(workspaceId: string): Promise<WorkspaceInstancePort[]>;
66
82
  openPort(workspaceId: string, port: WorkspaceInstancePort): Promise<WorkspaceInstancePort | undefined>;
67
83
  closePort(workspaceId: string, port: number): Promise<void>;
68
- getUserMessages(options: GitpodServer.GetUserMessagesOptions): Promise<UserMessage[]>;
69
- updateUserMessages(options: GitpodServer.UpdateUserMessagesOptions): Promise<void>;
70
84
  getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
71
85
  updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
72
86
  getEnvVars(): Promise<UserEnvVarValue[]>;
87
+ getAllEnvVars(): Promise<UserEnvVarValue[]>;
73
88
  setEnvVar(variable: UserEnvVarValue): Promise<void>;
74
89
  deleteEnvVar(variable: UserEnvVarValue): Promise<void>;
90
+ getTeams(): Promise<Team[]>;
91
+ getTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
92
+ createTeam(name: string): Promise<Team>;
93
+ joinTeam(inviteId: string): Promise<Team>;
94
+ setTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
95
+ removeTeamMember(teamId: string, userId: string): Promise<void>;
96
+ getGenericInvite(teamId: string): Promise<TeamMembershipInvite>;
97
+ resetGenericInvite(inviteId: string): Promise<TeamMembershipInvite>;
98
+ deleteTeam(teamId: string, userId: string): Promise<void>;
99
+ adminGetSettings(): Promise<InstallationAdminSettings>;
100
+ adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
101
+ adminGetTelemetryData(): Promise<Data>;
102
+ getProviderRepositoriesForUser(params: GetProviderRepositoriesParams): Promise<ProviderRepository[]>;
103
+ createProject(params: CreateProjectParams): Promise<Project>;
104
+ deleteProject(projectId: string): Promise<void>;
105
+ getTeamProjects(teamId: string): Promise<Project[]>;
106
+ getUserProjects(): Promise<Project[]>;
107
+ getProjectOverview(projectId: string): Promise<Project.Overview | undefined>;
108
+ findPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
109
+ triggerPrebuild(projectId: string, branchName: string | null): Promise<StartPrebuildResult>;
110
+ cancelPrebuild(projectId: string, prebuildId: string): Promise<void>;
111
+ fetchProjectRepositoryConfiguration(projectId: string): Promise<string | undefined>;
112
+ guessProjectConfiguration(projectId: string): Promise<string | undefined>;
113
+ fetchRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
114
+ guessRepositoryConfiguration(cloneUrl: string): Promise<string | undefined>;
115
+ setProjectConfiguration(projectId: string, configString: string): Promise<void>;
116
+ updateProjectPartial(partialProject: PartialProject): Promise<void>;
117
+ setProjectEnvironmentVariable(projectId: string, name: string, value: string, censored: boolean): Promise<void>;
118
+ getProjectEnvironmentVariables(projectId: string): Promise<ProjectEnvVar[]>;
119
+ deleteProjectEnvironmentVariable(variableId: string): Promise<void>;
120
+ getContentBlobUploadUrl(name: string): Promise<string>;
121
+ getContentBlobDownloadUrl(name: string): Promise<string>;
75
122
  getGitpodTokens(): Promise<GitpodToken[]>;
76
123
  generateNewGitpodToken(options: GitpodServer.GenerateNewGitpodTokenOptions): Promise<string>;
77
124
  deleteGitpodToken(tokenHash: string): Promise<void>;
78
125
  sendFeedback(feedback: string): Promise<string | undefined>;
79
126
  registerGithubApp(installationId: string): Promise<void>;
80
127
  /**
81
- * Stores a new snapshot for the given workspace and bucketId
128
+ * Stores a new snapshot for the given workspace and bucketId. Returns _before_ the actual snapshot is done. To wait for that, use `waitForSnapshot`.
82
129
  * @return the snapshot id
83
130
  */
84
131
  takeSnapshot(options: GitpodServer.TakeSnapshotOptions): Promise<string>;
132
+ /**
133
+ *
134
+ * @param snapshotId
135
+ */
136
+ waitForSnapshot(snapshotId: string): Promise<void>;
85
137
  /**
86
138
  * Returns the list of snapshots that exist for a workspace.
87
139
  */
@@ -102,6 +154,95 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
102
154
  resolvePlugins(workspaceId: string, params: ResolvePluginsParams): Promise<ResolvedPlugins>;
103
155
  installUserPlugins(params: InstallPluginsParams): Promise<boolean>;
104
156
  uninstallUserPlugin(params: UninstallPluginParams): Promise<boolean>;
157
+ guessGitTokenScopes(params: GuessGitTokenScopesParams): Promise<GuessedGitTokenScopes>;
158
+ /**
159
+ * gitpod.io concerns
160
+ */
161
+ isStudent(): Promise<boolean>;
162
+ /**
163
+ *
164
+ */
165
+ getAccountStatement(options: GitpodServer.GetAccountStatementOptions): Promise<AccountStatement | undefined>;
166
+ getRemainingUsageHours(): Promise<number>;
167
+ /**
168
+ *
169
+ */
170
+ getChargebeeSiteId(): Promise<string>;
171
+ createPortalSession(): Promise<{}>;
172
+ checkout(planId: string, planQuantity?: number): Promise<{}>;
173
+ getAvailableCoupons(): Promise<PlanCoupon[]>;
174
+ getAppliedCoupons(): Promise<PlanCoupon[]>;
175
+ getShowPaymentUI(): Promise<boolean>;
176
+ isChargebeeCustomer(): Promise<boolean>;
177
+ subscriptionUpgradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
178
+ subscriptionDowngradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
179
+ subscriptionCancel(subscriptionId: string): Promise<void>;
180
+ subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
181
+ tsGet(): Promise<TeamSubscription[]>;
182
+ tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
183
+ tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
184
+ tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
185
+ tsAssignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, identityStr: string | undefined): Promise<void>;
186
+ tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
187
+ tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
188
+ tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
189
+ getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
190
+ /**
191
+ * Analytics
192
+ */
193
+ trackEvent(event: RemoteTrackMessage): Promise<void>;
194
+ trackLocation(event: RemotePageMessage): Promise<void>;
195
+ identifyUser(event: RemoteIdentifyMessage): Promise<void>;
196
+ }
197
+ export interface RateLimiterError {
198
+ method?: string;
199
+ /**
200
+ * Retry after this many seconds, earliest.
201
+ * cmp.: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
202
+ */
203
+ retryAfter: number;
204
+ }
205
+ export interface CreateProjectParams {
206
+ name: string;
207
+ slug?: string;
208
+ account: string;
209
+ provider: string;
210
+ cloneUrl: string;
211
+ teamId?: string;
212
+ userId?: string;
213
+ appInstallationId: string;
214
+ }
215
+ export interface FindPrebuildsParams {
216
+ projectId: string;
217
+ branch?: string;
218
+ latest?: boolean;
219
+ prebuildId?: string;
220
+ limit?: number;
221
+ }
222
+ export interface GetProviderRepositoriesParams {
223
+ provider: string;
224
+ hints?: {
225
+ installationId: string;
226
+ } | object;
227
+ }
228
+ export interface ProviderRepository {
229
+ name: string;
230
+ path?: string;
231
+ account: string;
232
+ accountAvatarUrl: string;
233
+ cloneUrl: string;
234
+ updatedAt: string;
235
+ installationId?: number;
236
+ installationUpdatedAt?: string;
237
+ inUse?: {
238
+ userName: string;
239
+ };
240
+ }
241
+ export interface ClientHeaderFields {
242
+ ip?: string;
243
+ userAgent?: string;
244
+ dnt?: string;
245
+ clientRegion?: string;
105
246
  }
106
247
  export declare const WorkspaceTimeoutValues: readonly ["30m", "60m", "180m"];
107
248
  export declare const createServiceMock: <C extends GitpodClient, S extends GitpodServer>(methods: Partial<JsonRpcProxy<S>>) => GitpodServiceImpl<C, S>;
@@ -124,6 +265,8 @@ export declare namespace GitpodServer {
124
265
  limit?: number;
125
266
  searchString?: string;
126
267
  pinnedOnly?: boolean;
268
+ projectId?: string | string[];
269
+ includeWithoutProject?: boolean;
127
270
  }
128
271
  interface GetAccountStatementOptions {
129
272
  date?: string;
@@ -131,6 +274,7 @@ export declare namespace GitpodServer {
131
274
  interface CreateWorkspaceOptions {
132
275
  contextUrl: string;
133
276
  mode?: CreateWorkspaceMode;
277
+ forceDefaultConfig?: boolean;
134
278
  }
135
279
  interface StartWorkspaceOptions {
136
280
  forceDefaultImage: boolean;
@@ -138,13 +282,7 @@ export declare namespace GitpodServer {
138
282
  interface TakeSnapshotOptions {
139
283
  workspaceId: string;
140
284
  layoutData?: string;
141
- }
142
- interface GetUserMessagesOptions {
143
- readonly releaseNotes?: boolean;
144
- readonly workspaceInstanceId: string;
145
- }
146
- interface UpdateUserMessagesOptions {
147
- readonly messageIds: string[];
285
+ dontWait?: boolean;
148
286
  }
149
287
  interface GetUserStorageResourceOptions {
150
288
  readonly uri: string;
@@ -182,10 +320,11 @@ export declare class GitpodCompositeClient<Client extends GitpodClient> implemen
182
320
  protected clients: Partial<Client>[];
183
321
  registerClient(client: Partial<Client>): Disposable;
184
322
  onInstanceUpdate(instance: WorkspaceInstance): void;
323
+ onPrebuildUpdate(update: PrebuildWithStatus): void;
185
324
  onWorkspaceImageBuildLogs(info: WorkspaceImageBuild.StateInfo, content: WorkspaceImageBuild.LogContent | undefined): void;
186
- onHeadlessWorkspaceLogs(evt: HeadlessLogEvent): void;
187
325
  notifyDidOpenConnection(): void;
188
326
  notifyDidCloseConnection(): void;
327
+ onCreditAlert(creditAlert: CreditAlert): void;
189
328
  }
190
329
  export declare type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;
191
330
  export declare class WorkspaceInstanceUpdateListener {
@@ -210,14 +349,19 @@ export declare class WorkspaceInstanceUpdateListener {
210
349
  */
211
350
  private isOutOfOrder;
212
351
  }
352
+ export interface GitpodServiceOptions {
353
+ onReconnect?: () => (void | Promise<void>);
354
+ }
213
355
  export declare class GitpodServiceImpl<Client extends GitpodClient, Server extends GitpodServer> {
214
356
  readonly server: JsonRpcProxy<Server>;
357
+ private options?;
215
358
  private readonly compositeClient;
216
- constructor(server: JsonRpcProxy<Server>);
359
+ constructor(server: JsonRpcProxy<Server>, options?: GitpodServiceOptions | undefined);
217
360
  registerClient(client: Partial<Client>): Disposable;
218
361
  private readonly instanceListeners;
219
362
  listenToInstance(workspaceId: string): Promise<WorkspaceInstanceUpdateListener>;
363
+ reconnect(): Promise<void>;
220
364
  }
221
- export declare function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string): GitpodServiceImpl<C, S>;
365
+ export declare function createGitpodService<C extends GitpodClient, S extends GitpodServer>(serverUrl: string | Promise<string>): GitpodServiceImpl<C, S>;
222
366
  export {};
223
367
  //# sourceMappingURL=gitpod-service.d.ts.map