@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-yh-vmoptions-fork.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 (352) hide show
  1. package/data/gitpod-schema.json +206 -28
  2. package/lib/accounting-protocol.d.ts +162 -0
  3. package/lib/accounting-protocol.d.ts.map +1 -0
  4. package/lib/accounting-protocol.js +107 -0
  5. package/lib/accounting-protocol.js.map +1 -0
  6. package/lib/admin-protocol.d.ts +32 -4
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +15 -0
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +44 -0
  11. package/lib/analytics.d.ts.map +1 -0
  12. package/lib/analytics.js +10 -0
  13. package/lib/analytics.js.map +1 -0
  14. package/lib/auth.d.ts.map +1 -1
  15. package/lib/context-url.d.ts +31 -0
  16. package/lib/context-url.d.ts.map +1 -0
  17. package/lib/context-url.js +102 -0
  18. package/lib/context-url.js.map +1 -0
  19. package/lib/context-url.spec.d.ts +14 -0
  20. package/lib/context-url.spec.d.ts.map +1 -0
  21. package/lib/context-url.spec.js +109 -0
  22. package/lib/context-url.spec.js.map +1 -0
  23. package/lib/email-protocol.d.ts +1 -2
  24. package/lib/email-protocol.d.ts.map +1 -1
  25. package/lib/email-protocol.js +4 -4
  26. package/lib/email-protocol.js.map +1 -1
  27. package/lib/encryption/container-module.d.ts.map +1 -1
  28. package/lib/encryption/container-module.js +5 -4
  29. package/lib/encryption/container-module.js.map +1 -1
  30. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  31. package/lib/encryption/encryption-engine.js +25 -26
  32. package/lib/encryption/encryption-engine.js.map +1 -1
  33. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  34. package/lib/encryption/encryption-engine.spec.js +29 -37
  35. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  36. package/lib/encryption/encryption-service.d.ts.map +1 -1
  37. package/lib/encryption/encryption-service.js +30 -44
  38. package/lib/encryption/encryption-service.js.map +1 -1
  39. package/lib/encryption/key-provider.d.ts.map +1 -1
  40. package/lib/encryption/key-provider.js +31 -38
  41. package/lib/encryption/key-provider.js.map +1 -1
  42. package/lib/env.d.ts +0 -6
  43. package/lib/env.d.ts.map +1 -1
  44. package/lib/env.js +7 -27
  45. package/lib/env.js.map +1 -1
  46. package/lib/gitpod-file-parser.d.ts.map +1 -1
  47. package/lib/gitpod-file-parser.js +26 -42
  48. package/lib/gitpod-file-parser.js.map +1 -1
  49. package/lib/gitpod-file-parser.spec.js +145 -142
  50. package/lib/gitpod-file-parser.spec.js.map +1 -1
  51. package/lib/gitpod-service.d.ts +180 -33
  52. package/lib/gitpod-service.d.ts.map +1 -1
  53. package/lib/gitpod-service.js +194 -273
  54. package/lib/gitpod-service.js.map +1 -1
  55. package/lib/headless-workspace-log.d.ts +9 -11
  56. package/lib/headless-workspace-log.d.ts.map +1 -1
  57. package/lib/headless-workspace-log.js +6 -8
  58. package/lib/headless-workspace-log.js.map +1 -1
  59. package/lib/ide-frontend-service.d.ts +5 -1
  60. package/lib/ide-frontend-service.d.ts.map +1 -1
  61. package/lib/ide-protocol.d.ts +105 -0
  62. package/lib/ide-protocol.d.ts.map +1 -0
  63. package/lib/{util/without.js → ide-protocol.js} +2 -2
  64. package/lib/ide-protocol.js.map +1 -0
  65. package/lib/index.d.ts +16 -10
  66. package/lib/index.d.ts.map +1 -1
  67. package/lib/index.js +7 -1
  68. package/lib/index.js.map +1 -1
  69. package/lib/installation-admin-protocol.d.ts +27 -0
  70. package/lib/installation-admin-protocol.d.ts.map +1 -0
  71. package/lib/installation-admin-protocol.js +30 -0
  72. package/lib/installation-admin-protocol.js.map +1 -0
  73. package/lib/license-protocol.d.ts +7 -0
  74. package/lib/license-protocol.d.ts.map +1 -1
  75. package/lib/license-protocol.js.map +1 -1
  76. package/lib/messaging/browser/connection.d.ts +5 -3
  77. package/lib/messaging/browser/connection.d.ts.map +1 -1
  78. package/lib/messaging/browser/connection.js +184 -34
  79. package/lib/messaging/browser/connection.js.map +1 -1
  80. package/lib/messaging/browser/window-connection.d.ts +4 -4
  81. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  82. package/lib/messaging/browser/window-connection.js +42 -59
  83. package/lib/messaging/browser/window-connection.js.map +1 -1
  84. package/lib/messaging/client-call-metrics.d.ts +35 -0
  85. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  86. package/lib/messaging/client-call-metrics.js +83 -0
  87. package/lib/messaging/client-call-metrics.js.map +1 -0
  88. package/lib/messaging/error.d.ts +6 -1
  89. package/lib/messaging/error.d.ts.map +1 -1
  90. package/lib/messaging/error.js +12 -2
  91. package/lib/messaging/error.js.map +1 -1
  92. package/lib/messaging/handler.d.ts +10 -0
  93. package/lib/messaging/handler.d.ts.map +1 -1
  94. package/lib/messaging/handler.js +1 -1
  95. package/lib/messaging/node/connection.d.ts +1 -17
  96. package/lib/messaging/node/connection.d.ts.map +1 -1
  97. package/lib/messaging/node/connection.js +24 -60
  98. package/lib/messaging/node/connection.js.map +1 -1
  99. package/lib/messaging/proxy-factory.d.ts +3 -1
  100. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  101. package/lib/messaging/proxy-factory.js +75 -162
  102. package/lib/messaging/proxy-factory.js.map +1 -1
  103. package/lib/oss-allowlist.d.ts +14 -0
  104. package/lib/oss-allowlist.d.ts.map +1 -0
  105. package/lib/oss-allowlist.js +8 -0
  106. package/lib/oss-allowlist.js.map +1 -0
  107. package/lib/payment-protocol.d.ts +18 -0
  108. package/lib/payment-protocol.d.ts.map +1 -0
  109. package/lib/payment-protocol.js +13 -0
  110. package/lib/payment-protocol.js.map +1 -0
  111. package/lib/permission.d.ts +10 -3
  112. package/lib/permission.d.ts.map +1 -1
  113. package/lib/permission.js +41 -31
  114. package/lib/permission.js.map +1 -1
  115. package/lib/plans.d.ts +210 -0
  116. package/lib/plans.d.ts.map +1 -0
  117. package/lib/plans.js +605 -0
  118. package/lib/plans.js.map +1 -0
  119. package/lib/protocol.d.ts +196 -83
  120. package/lib/protocol.d.ts.map +1 -1
  121. package/lib/protocol.js +264 -200
  122. package/lib/protocol.js.map +1 -1
  123. package/lib/snapshot-url.d.ts +14 -0
  124. package/lib/snapshot-url.d.ts.map +1 -0
  125. package/lib/snapshot-url.js +26 -0
  126. package/lib/snapshot-url.js.map +1 -0
  127. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  128. package/lib/snapshot-url.spec.d.ts.map +1 -0
  129. package/lib/snapshot-url.spec.js +41 -0
  130. package/lib/snapshot-url.spec.js.map +1 -0
  131. package/lib/team-subscription-protocol.d.ts +91 -0
  132. package/lib/team-subscription-protocol.d.ts.map +1 -0
  133. package/lib/team-subscription-protocol.js +74 -0
  134. package/lib/team-subscription-protocol.js.map +1 -0
  135. package/lib/teams-projects-protocol.d.ts +118 -0
  136. package/lib/teams-projects-protocol.d.ts.map +1 -0
  137. package/lib/teams-projects-protocol.js +30 -0
  138. package/lib/teams-projects-protocol.js.map +1 -0
  139. package/lib/typings/globals.d.ts +2 -2
  140. package/lib/typings/globals.d.ts.map +1 -1
  141. package/lib/util/analytics.d.ts +8 -0
  142. package/lib/util/analytics.d.ts.map +1 -0
  143. package/lib/util/analytics.js +88 -0
  144. package/lib/util/analytics.js.map +1 -0
  145. package/lib/util/async-iterator.d.ts.map +1 -1
  146. package/lib/util/async-iterator.js +57 -135
  147. package/lib/util/async-iterator.js.map +1 -1
  148. package/lib/util/cancelable.js +17 -59
  149. package/lib/util/cancelable.js.map +1 -1
  150. package/lib/util/date-time.js +11 -11
  151. package/lib/util/date-time.js.map +1 -1
  152. package/lib/util/deferred.js +10 -12
  153. package/lib/util/deferred.js.map +1 -1
  154. package/lib/util/disposable.d.ts.map +1 -1
  155. package/lib/util/disposable.js +27 -40
  156. package/lib/util/disposable.js.map +1 -1
  157. package/lib/util/event.d.ts.map +1 -1
  158. package/lib/util/event.js +63 -77
  159. package/lib/util/event.js.map +1 -1
  160. package/lib/util/garbage-collected-cache.d.ts +1 -0
  161. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  162. package/lib/util/garbage-collected-cache.js +27 -47
  163. package/lib/util/garbage-collected-cache.js.map +1 -1
  164. package/lib/util/generate-workspace-id.d.ts +6 -1
  165. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  166. package/lib/util/generate-workspace-id.js +469 -502
  167. package/lib/util/generate-workspace-id.js.map +1 -1
  168. package/lib/util/generate-workspace-id.spec.js +68 -78
  169. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  170. package/lib/util/gitpod-cookie.d.ts +20 -0
  171. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  172. package/lib/util/gitpod-cookie.js +41 -0
  173. package/lib/util/gitpod-cookie.js.map +1 -0
  174. package/lib/util/gitpod-host-url.d.ts +1 -2
  175. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  176. package/lib/util/gitpod-host-url.js +108 -109
  177. package/lib/util/gitpod-host-url.js.map +1 -1
  178. package/lib/util/gitpod-host-url.spec.d.ts +7 -1
  179. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  180. package/lib/util/gitpod-host-url.spec.js +113 -31
  181. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  182. package/lib/util/grpc.d.ts +15 -0
  183. package/lib/util/grpc.d.ts.map +1 -0
  184. package/lib/util/grpc.js +18 -0
  185. package/lib/util/grpc.js.map +1 -0
  186. package/lib/util/jaeger-client-types.d.ts +68 -0
  187. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  188. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
  189. package/lib/util/jaeger-client-types.js.map +1 -0
  190. package/lib/util/logging.d.ts +49 -33
  191. package/lib/util/logging.d.ts.map +1 -1
  192. package/lib/util/logging.js +125 -129
  193. package/lib/util/logging.js.map +1 -1
  194. package/lib/util/make-link.js +5 -5
  195. package/lib/util/make-link.js.map +1 -1
  196. package/lib/util/parse-workspace-id.d.ts +10 -0
  197. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  198. package/lib/util/parse-workspace-id.js +31 -7
  199. package/lib/util/parse-workspace-id.js.map +1 -1
  200. package/lib/util/parse-workspace-id.spec.d.ts +4 -0
  201. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  202. package/lib/util/parse-workspace-id.spec.js +123 -84
  203. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  204. package/lib/util/queue.js +16 -55
  205. package/lib/util/queue.js.map +1 -1
  206. package/lib/util/queue.spec.js +147 -288
  207. package/lib/util/queue.spec.js.map +1 -1
  208. package/lib/util/repeat.d.ts +15 -0
  209. package/lib/util/repeat.d.ts.map +1 -0
  210. package/lib/util/repeat.js +55 -0
  211. package/lib/util/repeat.js.map +1 -0
  212. package/lib/util/semaphore.d.ts.map +1 -1
  213. package/lib/util/semaphore.js +15 -46
  214. package/lib/util/semaphore.js.map +1 -1
  215. package/lib/util/skip-if.d.ts.map +1 -1
  216. package/lib/util/skip-if.js +6 -6
  217. package/lib/util/skip-if.js.map +1 -1
  218. package/lib/util/timeutil.d.ts +1 -0
  219. package/lib/util/timeutil.d.ts.map +1 -1
  220. package/lib/util/timeutil.js +35 -17
  221. package/lib/util/timeutil.js.map +1 -1
  222. package/lib/util/timeutil.spec.d.ts.map +1 -1
  223. package/lib/util/timeutil.spec.js +21 -24
  224. package/lib/util/timeutil.spec.js.map +1 -1
  225. package/lib/util/tracing.d.ts +52 -6
  226. package/lib/util/tracing.d.ts.map +1 -1
  227. package/lib/util/tracing.js +197 -64
  228. package/lib/util/tracing.js.map +1 -1
  229. package/lib/util/tracing.spec.d.ts +7 -0
  230. package/lib/util/tracing.spec.d.ts.map +1 -0
  231. package/lib/util/tracing.spec.js +121 -0
  232. package/lib/util/tracing.spec.js.map +1 -0
  233. package/lib/util/workspace-port-authentication.d.ts +7 -7
  234. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  235. package/lib/util/workspace-port-authentication.js +10 -12
  236. package/lib/util/workspace-port-authentication.js.map +1 -1
  237. package/lib/workspace-cluster.d.ts +76 -0
  238. package/lib/workspace-cluster.d.ts.map +1 -0
  239. package/lib/workspace-cluster.js +31 -0
  240. package/lib/workspace-cluster.js.map +1 -0
  241. package/lib/workspace-instance.d.ts +45 -5
  242. package/lib/workspace-instance.d.ts.map +1 -1
  243. package/lib/wsready.d.ts +1 -1
  244. package/lib/wsready.d.ts.map +1 -1
  245. package/lib/wsready.js +2 -2
  246. package/package.json +32 -18
  247. package/pkg-yarn.lock +18 -10
  248. package/provenance-bundle.jsonl +2 -0
  249. package/src/accounting-protocol.ts +241 -0
  250. package/src/admin-protocol.ts +70 -19
  251. package/src/analytics.ts +52 -0
  252. package/src/auth.ts +2 -2
  253. package/src/context-url.spec.ts +67 -0
  254. package/src/context-url.ts +109 -0
  255. package/src/email-protocol.ts +5 -7
  256. package/src/encryption/container-module.ts +2 -3
  257. package/src/encryption/encryption-engine.spec.ts +9 -8
  258. package/src/encryption/encryption-engine.ts +14 -14
  259. package/src/encryption/encryption-service.ts +4 -5
  260. package/src/encryption/key-provider.ts +16 -19
  261. package/src/env.ts +0 -22
  262. package/src/gitpod-file-parser.spec.ts +55 -61
  263. package/src/gitpod-file-parser.ts +16 -17
  264. package/src/gitpod-service.ts +348 -110
  265. package/src/headless-workspace-log.ts +12 -14
  266. package/src/ide-frontend-service.ts +6 -2
  267. package/src/ide-protocol.ts +119 -0
  268. package/src/index.ts +16 -10
  269. package/src/installation-admin-protocol.ts +42 -0
  270. package/src/license-protocol.ts +12 -6
  271. package/src/messaging/browser/connection.ts +197 -18
  272. package/src/messaging/browser/window-connection.ts +39 -29
  273. package/src/messaging/client-call-metrics.ts +96 -0
  274. package/src/messaging/error.ts +18 -5
  275. package/src/messaging/handler.ts +13 -1
  276. package/src/messaging/node/connection.ts +23 -70
  277. package/src/messaging/proxy-factory.ts +35 -34
  278. package/src/oss-allowlist.ts +15 -0
  279. package/src/payment-protocol.ts +20 -0
  280. package/src/permission.ts +42 -33
  281. package/src/plans.ts +679 -0
  282. package/src/protocol.ts +493 -275
  283. package/src/snapshot-url.spec.ts +27 -0
  284. package/src/snapshot-url.ts +27 -0
  285. package/src/team-subscription-protocol.ts +147 -0
  286. package/src/teams-projects-protocol.ts +153 -0
  287. package/src/typings/globals.ts +4 -4
  288. package/src/util/analytics.ts +109 -0
  289. package/src/util/async-iterator.ts +4 -5
  290. package/src/util/cancelable.ts +3 -3
  291. package/src/util/date-time.ts +8 -8
  292. package/src/util/deferred.ts +6 -6
  293. package/src/util/disposable.ts +3 -6
  294. package/src/util/event.ts +9 -11
  295. package/src/util/garbage-collected-cache.ts +11 -8
  296. package/src/util/generate-workspace-id.spec.ts +37 -10
  297. package/src/util/generate-workspace-id.ts +464 -438
  298. package/src/util/gitpod-cookie.ts +38 -0
  299. package/src/util/gitpod-host-url.spec.ts +59 -8
  300. package/src/util/gitpod-host-url.ts +52 -40
  301. package/src/util/grpc.ts +15 -0
  302. package/src/util/jaeger-client-types.ts +102 -0
  303. package/src/util/logging.ts +145 -72
  304. package/src/util/make-link.ts +6 -7
  305. package/src/util/parse-workspace-id.spec.ts +37 -8
  306. package/src/util/parse-workspace-id.ts +32 -7
  307. package/src/util/queue.spec.ts +28 -26
  308. package/src/util/repeat.ts +45 -0
  309. package/src/util/semaphore.ts +6 -8
  310. package/src/util/skip-if.ts +10 -7
  311. package/src/util/timeutil.spec.ts +14 -15
  312. package/src/util/timeutil.ts +25 -15
  313. package/src/util/tracing.spec.ts +88 -0
  314. package/src/util/tracing.ts +200 -31
  315. package/src/util/workspace-port-authentication.ts +10 -13
  316. package/src/workspace-cluster.ts +107 -0
  317. package/src/workspace-instance.ts +98 -31
  318. package/src/wsready.ts +3 -3
  319. package/data/builtin-theia-plugins.json +0 -372
  320. package/lib/messaging/connection-error-handler.d.ts +0 -27
  321. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  322. package/lib/messaging/connection-error-handler.js +0 -46
  323. package/lib/messaging/connection-error-handler.js.map +0 -1
  324. package/lib/theia-plugins.d.ts +0 -11
  325. package/lib/theia-plugins.d.ts.map +0 -1
  326. package/lib/theia-plugins.js.map +0 -1
  327. package/lib/util/context-url.d.ts +0 -13
  328. package/lib/util/context-url.d.ts.map +0 -1
  329. package/lib/util/context-url.js +0 -26
  330. package/lib/util/context-url.js.map +0 -1
  331. package/lib/util/context-url.spec.d.ts +0 -10
  332. package/lib/util/context-url.spec.d.ts.map +0 -1
  333. package/lib/util/context-url.spec.js +0 -52
  334. package/lib/util/context-url.spec.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/theia-plugins.ts +0 -11
  348. package/src/util/context-url.spec.ts +0 -25
  349. package/src/util/context-url.ts +0 -23
  350. package/src/util/jaeger-client.d.ts +0 -105
  351. package/src/util/repeater.ts +0 -49
  352. package/src/util/safe-promise.ts +0 -26
@@ -1,26 +1,9 @@
1
1
  {
2
- "$id": "https://gitpod.io/gitpod.schema.json",
2
+ "$id": "https://gitpod.io/schemas/gitpod-schema.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Gitpod Config",
5
5
  "type": "object",
6
6
  "properties": {
7
- "ide": {
8
- "anyOf": [
9
- {
10
- "type": "string"
11
- },
12
- {
13
- "type": "string",
14
- "enum": [
15
- "theia",
16
- "code"
17
- ]
18
- }
19
- ],
20
- "default": "theia",
21
- "description": "Controls what ide should be used for a workspace.",
22
- "deprecationMessage": "The 'ide' property is an experimental feature and enabled only for some users."
23
- },
24
7
  "ports": {
25
8
  "type": "array",
26
9
  "description": "List of exposed ports.",
@@ -51,13 +34,12 @@
51
34
  "private",
52
35
  "public"
53
36
  ],
54
- "default": "public",
55
- "description": "Whether the port visibility should be private or public. 'public' (default) will allow everyone with the port URL to access the port. 'private' will only allow users with workspace access to access the port."
37
+ "default": "private",
38
+ "description": "Whether the port visibility should be private or public. 'private' (default) will only allow users with workspace access to access the port. 'public' will allow everyone with the port URL to access the port."
56
39
  },
57
40
  "name": {
58
41
  "type": "string",
59
- "deprecationMessage": "The 'name' property is deprecated.",
60
- "description": "Port name (deprecated)."
42
+ "description": "Port name."
61
43
  },
62
44
  "protocol": {
63
45
  "type": "string",
@@ -68,6 +50,10 @@
68
50
  ],
69
51
  "deprecationMessage": "The 'protocol' property is deprecated.",
70
52
  "description": "The protocol to be used. (deprecated)"
53
+ },
54
+ "description": {
55
+ "type": "string",
56
+ "description": "A description to identify what is this port used for."
71
57
  }
72
58
  },
73
59
  "additionalProperties": false
@@ -93,7 +79,8 @@
93
79
  },
94
80
  "prebuild": {
95
81
  "type": "string",
96
- "description": "A shell command to run after `before`. This command is executed only on during workspace prebuilds. This command is expected to terminate. If it fails, the workspace build fails."
82
+ "description": "A shell command to run after `before`. This command is executed only on during workspace prebuilds. This command is expected to terminate. If it fails, the workspace build fails.",
83
+ "deprecationMessage": "Deprecated. Please use `init` task instead. See https://www.gitpod.io/docs/config-start-tasks."
97
84
  },
98
85
  "command": {
99
86
  "type": "string",
@@ -116,10 +103,8 @@
116
103
  "openMode": {
117
104
  "type": "string",
118
105
  "enum": [
119
- "split-top",
120
106
  "split-left",
121
107
  "split-right",
122
- "split-bottom",
123
108
  "tab-before",
124
109
  "tab-after"
125
110
  ],
@@ -151,13 +136,38 @@
151
136
  },
152
137
  "additionalProperties": false
153
138
  },
139
+ "additionalRepositories": {
140
+ "type": "array",
141
+ "description": "List of additional repositories that are part of this project.",
142
+ "items": {
143
+ "type": "object",
144
+ "required": [
145
+ "url"
146
+ ],
147
+ "properties": {
148
+ "url": {
149
+ "type": ["string"],
150
+ "description": "The url of the git repository to clone. Supports any context URLs."
151
+ },
152
+ "checkoutLocation": {
153
+ "type": "string",
154
+ "description": "Path to where the repository should be checked out relative to `/workspace`. Defaults to the simple repository name."
155
+ }
156
+ },
157
+ "additionalProperties": false
158
+ }
159
+ },
160
+ "mainConfiguration": {
161
+ "type": "string",
162
+ "description": "The main repository, containing the dev environment configuration."
163
+ },
154
164
  "checkoutLocation": {
155
165
  "type": "string",
156
- "description": "Path to where the repository should be checked out."
166
+ "description": "Path to where the repository should be checked out relative to `/workspace`. Defaults to the simple repository name."
157
167
  },
158
168
  "workspaceLocation": {
159
169
  "type": "string",
160
- "description": "Path to where the IDE's workspace should be opened."
170
+ "description": "Path to where the IDE's workspace should be opened. Supports vscode's `*.code-workspace` files."
161
171
  },
162
172
  "gitConfig": {
163
173
  "type": [
@@ -199,6 +209,18 @@
199
209
  "type": "boolean",
200
210
  "description": "Add a Review in Gitpod badge to pull requests. Defaults to true."
201
211
  },
212
+ "addCheck": {
213
+ "type": [
214
+ "boolean",
215
+ "string"
216
+ ],
217
+ "enum": [
218
+ true,
219
+ false,
220
+ "prevent-merge-on-error"
221
+ ],
222
+ "description": "Add a commit check to pull requests. Set to 'fail-on-error' if you want broken prebuilds to block merging. Defaults to true."
223
+ },
202
224
  "addLabel": {
203
225
  "type": [
204
226
  "boolean",
@@ -224,7 +246,163 @@
224
246
  }
225
247
  }
226
248
  }
249
+ },
250
+ "jetbrains": {
251
+ "type": "object",
252
+ "description": "Configure JetBrains integration",
253
+ "deprecationMessage": "The 'jetbrains' property is experimental.",
254
+ "additionalProperties": false,
255
+ "properties": {
256
+ "plugins": {
257
+ "type": "array",
258
+ "description": "List of plugins which should be installed for all JetBrains product for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
259
+ "items": {
260
+ "type": "string"
261
+ }
262
+ },
263
+ "intellij": {
264
+ "type": "object",
265
+ "description": "Configure IntelliJ integration",
266
+ "additionalProperties": false,
267
+ "properties": {
268
+ "plugins": {
269
+ "type": "array",
270
+ "description": "List of plugins which should be installed for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
271
+ "items": {
272
+ "type": "string"
273
+ }
274
+ },
275
+ "prebuilds": {
276
+ "type": "object",
277
+ "description": "Enable warming up of IntelliJ in prebuilds.",
278
+ "additionalProperties": false,
279
+ "properties": {
280
+ "version": {
281
+ "type": "string",
282
+ "enum": [
283
+ "stable",
284
+ "latest",
285
+ "both"
286
+ ],
287
+ "description": "Whether only stable, latest or both versions should be warmed up. Default is stable only."
288
+ }
289
+ }
290
+ },
291
+ "vmoptions": {
292
+ "type": "string",
293
+ "description": "Configure VM options, for instance '-Xmx=4096m'."
294
+ }
295
+ }
296
+ },
297
+ "goland": {
298
+ "type": "object",
299
+ "description": "Configure GoLand integration",
300
+ "additionalProperties": false,
301
+ "properties": {
302
+ "plugins": {
303
+ "type": "array",
304
+ "description": "List of plugins which should be installed for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
305
+ "items": {
306
+ "type": "string"
307
+ }
308
+ },
309
+ "prebuilds": {
310
+ "type": "object",
311
+ "description": "Enable warming up of GoLand in prebuilds.",
312
+ "additionalProperties": false,
313
+ "properties": {
314
+ "version": {
315
+ "type": "string",
316
+ "enum": [
317
+ "stable",
318
+ "latest",
319
+ "both"
320
+ ],
321
+ "description": "Whether only stable, latest or both versions should be warmed up. Default is stable only."
322
+ }
323
+ }
324
+ },
325
+ "vmoptions": {
326
+ "type": "string",
327
+ "description": "Configure VM options, for instance '-Xmx=4096m'."
328
+ }
329
+ }
330
+ },
331
+ "pycharm": {
332
+ "type": "object",
333
+ "description": "Configure PyCharm integration",
334
+ "additionalProperties": false,
335
+ "properties": {
336
+ "plugins": {
337
+ "type": "array",
338
+ "description": "List of plugins which should be installed for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
339
+ "items": {
340
+ "type": "string"
341
+ }
342
+ },
343
+ "prebuilds": {
344
+ "type": "object",
345
+ "description": "Enable warming up of PyCharm in prebuilds.",
346
+ "additionalProperties": false,
347
+ "properties": {
348
+ "version": {
349
+ "type": "string",
350
+ "enum": [
351
+ "stable",
352
+ "latest",
353
+ "both"
354
+ ],
355
+ "description": "Whether only stable, latest or both versions should be warmed up. Default is stable only."
356
+ }
357
+ }
358
+ },
359
+ "vmoptions": {
360
+ "type": "string",
361
+ "description": "Configure VM options, for instance '-Xmx=4096m'."
362
+ }
363
+ }
364
+ },
365
+ "phpstorm": {
366
+ "type": "object",
367
+ "description": "Configure PhpStorm integration",
368
+ "additionalProperties": false,
369
+ "properties": {
370
+ "plugins": {
371
+ "type": "array",
372
+ "description": "List of plugins which should be installed for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
373
+ "items": {
374
+ "type": "string"
375
+ }
376
+ },
377
+ "prebuilds": {
378
+ "type": "object",
379
+ "description": "Enable warming up of PhpStorm in prebuilds.",
380
+ "additionalProperties": false,
381
+ "properties": {
382
+ "version": {
383
+ "type": "string",
384
+ "enum": [
385
+ "stable",
386
+ "latest",
387
+ "both"
388
+ ],
389
+ "description": "Whether only stable, latest or both versions should be warmed up. Default is stable only."
390
+ }
391
+ }
392
+ },
393
+ "vmoptions": {
394
+ "type": "string",
395
+ "description": "Configure VM options, for instance '-Xmx=4096m'."
396
+ }
397
+ }
398
+ }
399
+ }
400
+ },
401
+ "experimentalNetwork": {
402
+ "type": "boolean",
403
+ "deprecationMessage": "The 'experimentalNetwork' property is deprecated.",
404
+ "description": "Experimental network configuration in workspaces (deprecated). Enabled by default"
227
405
  }
228
406
  },
229
407
  "additionalProperties": false
230
- }
408
+ }
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ import { User } from "./protocol";
7
+ export interface AccountEntry {
8
+ uid: string;
9
+ userId: string;
10
+ /** [hours] */
11
+ amount: number;
12
+ /**
13
+ * credit: start of validity,
14
+ * session: end of (split-) session
15
+ */
16
+ date: string;
17
+ /**
18
+ * debits (session, expiry, loss): relation to credit
19
+ */
20
+ creditId?: string;
21
+ /**
22
+ * credit: end of validity
23
+ */
24
+ expiryDate?: string;
25
+ kind: AccountEntryKind;
26
+ /**
27
+ * credit: amount - accounted debits
28
+ * [hours]
29
+ */
30
+ remainingAmount?: number;
31
+ description?: object;
32
+ }
33
+ export declare namespace AccountEntry {
34
+ function create<T extends AccountEntry>(entry: Omit<T, "uid">): T;
35
+ }
36
+ export declare type DebitAccountEntryKind = "session" | "expiry" | "loss";
37
+ export declare type AccountEntryKind = "credit" | DebitAccountEntryKind | "carry" | "open";
38
+ export interface Credit extends AccountEntry {
39
+ kind: "credit";
40
+ expiryDate: string;
41
+ }
42
+ export declare type Debit = LossDebit | ExpiryDebit | SessionDebit;
43
+ export interface LossDebit extends AccountEntry {
44
+ kind: "loss";
45
+ }
46
+ export interface ExpiryDebit extends AccountEntry {
47
+ kind: "expiry";
48
+ creditId: undefined;
49
+ }
50
+ export interface SessionDebit extends AccountEntry {
51
+ kind: DebitAccountEntryKind;
52
+ creditId: string;
53
+ }
54
+ export declare type AccountEntryDescription = SessionDescription | CreditDescription;
55
+ export interface CreditDescription {
56
+ subscriptionId: string;
57
+ planId: string;
58
+ }
59
+ export declare namespace CreditDescription {
60
+ function is(obj: any): obj is CreditDescription;
61
+ }
62
+ export interface SessionDescription {
63
+ contextTitle: string;
64
+ contextUrl: string;
65
+ workspaceId: string;
66
+ workspaceInstanceId: string;
67
+ }
68
+ export declare namespace SessionDescription {
69
+ function is(obj: any): obj is SessionDescription;
70
+ }
71
+ /**
72
+ * - The earliest subscription may start with User.creationDate
73
+ * - There may be multiple Gitpod subscriptions for a user at any given time
74
+ * - The dates form an interval of the form: [startDate, endDate)
75
+ * - Subscriptions that directly map to a Chargebee plan have their paymentReference set and MAY carry additional paymentData (UserPaidSubscription)
76
+ * - Subscriptions that are assigned to a user through a Team Subscription carry a teamSubscriptionSlotId (AssignedTeamSubscription)
77
+ */
78
+ export interface Subscription {
79
+ uid: string;
80
+ userId: string;
81
+ startDate: string;
82
+ /** When the subscription will end (must be >= cancellationDate!) */
83
+ endDate?: string;
84
+ /** When the subscription was cancelled */
85
+ cancellationDate?: string;
86
+ /** Number of granted hours */
87
+ amount: number;
88
+ /** Number of granted hours for the first month: If this is set, use this value for the first month */
89
+ firstMonthAmount?: number;
90
+ planId?: string;
91
+ paymentReference?: string;
92
+ paymentData?: PaymentData;
93
+ teamSubscriptionSlotId?: string;
94
+ teamMembershipId?: string;
95
+ /** marks the subscription as deleted */
96
+ deleted?: boolean;
97
+ }
98
+ export interface SubscriptionAndUser extends Subscription {
99
+ user: User;
100
+ }
101
+ export interface PaymentData {
102
+ /** Marks the date as of which the _switch_ is effective. */
103
+ downgradeDate?: string;
104
+ /** Determines the new plan the dowgrade is targeted against (optional for backwards compatibility) */
105
+ newPlan?: string;
106
+ }
107
+ export interface UserPaidSubscription extends Subscription {
108
+ paymentReference: string;
109
+ paymentData?: PaymentData;
110
+ }
111
+ export declare namespace UserPaidSubscription {
112
+ function is(data: any): data is UserPaidSubscription;
113
+ }
114
+ export interface AssignedTeamSubscription extends Subscription {
115
+ teamSubscriptionSlotId: string;
116
+ }
117
+ export declare namespace AssignedTeamSubscription {
118
+ function is(data: any): data is AssignedTeamSubscription;
119
+ }
120
+ export interface AssignedTeamSubscription2 extends Subscription {
121
+ teamMembershipId: string;
122
+ }
123
+ export declare namespace AssignedTeamSubscription2 {
124
+ function is(data: any): data is AssignedTeamSubscription2;
125
+ }
126
+ export declare namespace Subscription {
127
+ function create(newSubscription: Omit<Subscription, "uid">): Subscription;
128
+ function cancelSubscription(s: Subscription, cancellationDate: string, endDate?: string): void;
129
+ function isSame(s1: Subscription | undefined, s2: Subscription | undefined): boolean;
130
+ function isActive(s: Subscription, date: string): boolean;
131
+ function isDowngraded(s: Subscription): string | undefined;
132
+ function calculateCurrentPeriod(startDate: string, now: Date): {
133
+ startDate: string;
134
+ endDate: string;
135
+ };
136
+ }
137
+ export declare type MaybeSubscription = Subscription | undefined;
138
+ export interface Period {
139
+ startDate: string;
140
+ endDate: string;
141
+ }
142
+ export declare type MaybePeriod = Period | undefined;
143
+ export declare type AccountEntryFixedPeriod = Omit<AccountEntry, "uid"> & {
144
+ expiryDate: string;
145
+ };
146
+ export interface AccountStatement extends Period {
147
+ userId: string;
148
+ /**
149
+ * The subscriptions that have not been cancelled yet at the end of the period
150
+ */
151
+ subscriptions: Subscription[];
152
+ credits: Credit[];
153
+ debits: Debit[];
154
+ /** Remaining valid hours (accumulated from credits) */
155
+ remainingHours: RemainingHours;
156
+ }
157
+ export declare type RemainingHours = number | "unlimited";
158
+ export interface CreditAlert {
159
+ userId: string;
160
+ remainingUsageHours: number;
161
+ }
162
+ //# sourceMappingURL=accounting-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounting-protocol.d.ts","sourceRoot":"","sources":["../src/accounting-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMlC,MAAM,WAAW,YAAY;IACzB,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC;IAEf,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAEl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AM,WAAW,gBAAiB,SAAQ,MAAM;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,uDAAuD;IACvD,cAAc,EAAE,cAAc,CAAC;CAClC;AACD,oBAAY,cAAc,GAAG,MAAM,GAAG,WAAW,CAAC;AAElD,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC/B"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Subscription = exports.AssignedTeamSubscription2 = exports.AssignedTeamSubscription = exports.UserPaidSubscription = exports.SessionDescription = exports.CreditDescription = exports.AccountEntry = void 0;
9
+ const uuid_1 = require("uuid");
10
+ const timeutil_1 = require("./util/timeutil");
11
+ var AccountEntry;
12
+ (function (AccountEntry) {
13
+ function create(entry) {
14
+ const result = entry;
15
+ result.uid = (0, uuid_1.v4)();
16
+ return result;
17
+ }
18
+ AccountEntry.create = create;
19
+ })(AccountEntry = exports.AccountEntry || (exports.AccountEntry = {}));
20
+ var CreditDescription;
21
+ (function (CreditDescription) {
22
+ function is(obj) {
23
+ return !!obj && obj.hasOwnProperty("subscriptionId") && obj.hasOwnProperty("planId");
24
+ }
25
+ CreditDescription.is = is;
26
+ })(CreditDescription = exports.CreditDescription || (exports.CreditDescription = {}));
27
+ var SessionDescription;
28
+ (function (SessionDescription) {
29
+ function is(obj) {
30
+ return (!!obj &&
31
+ obj.hasOwnProperty("contextTitle") &&
32
+ obj.hasOwnProperty("contextUrl") &&
33
+ obj.hasOwnProperty("workspaceId") &&
34
+ obj.hasOwnProperty("workspaceInstanceId"));
35
+ }
36
+ SessionDescription.is = is;
37
+ })(SessionDescription = exports.SessionDescription || (exports.SessionDescription = {}));
38
+ var UserPaidSubscription;
39
+ (function (UserPaidSubscription) {
40
+ function is(data) {
41
+ return !!data && data.hasOwnProperty("paymentReference");
42
+ }
43
+ UserPaidSubscription.is = is;
44
+ })(UserPaidSubscription = exports.UserPaidSubscription || (exports.UserPaidSubscription = {}));
45
+ var AssignedTeamSubscription;
46
+ (function (AssignedTeamSubscription) {
47
+ function is(data) {
48
+ return !!data && data.hasOwnProperty("teamSubscriptionSlotId");
49
+ }
50
+ AssignedTeamSubscription.is = is;
51
+ })(AssignedTeamSubscription = exports.AssignedTeamSubscription || (exports.AssignedTeamSubscription = {}));
52
+ var AssignedTeamSubscription2;
53
+ (function (AssignedTeamSubscription2) {
54
+ function is(data) {
55
+ return typeof data === "object" && data.hasOwnProperty("teamMembershipId");
56
+ }
57
+ AssignedTeamSubscription2.is = is;
58
+ })(AssignedTeamSubscription2 = exports.AssignedTeamSubscription2 || (exports.AssignedTeamSubscription2 = {}));
59
+ var Subscription;
60
+ (function (Subscription) {
61
+ function create(newSubscription) {
62
+ const subscription = newSubscription;
63
+ subscription.uid = (0, uuid_1.v4)();
64
+ return subscription;
65
+ }
66
+ Subscription.create = create;
67
+ function cancelSubscription(s, cancellationDate, endDate) {
68
+ s.endDate = endDate || cancellationDate;
69
+ s.cancellationDate = cancellationDate;
70
+ }
71
+ Subscription.cancelSubscription = cancelSubscription;
72
+ function isSame(s1, s2) {
73
+ return (!!s1 &&
74
+ !!s2 &&
75
+ s1.userId === s2.userId &&
76
+ s1.planId === s2.planId &&
77
+ s1.startDate === s2.startDate &&
78
+ s1.endDate === s2.endDate &&
79
+ s1.amount === s2.amount &&
80
+ s1.cancellationDate === s2.cancellationDate &&
81
+ s1.deleted === s2.deleted &&
82
+ ((s1.paymentData === undefined && s2.paymentData === undefined) ||
83
+ (!!s1.paymentData &&
84
+ !!s2.paymentData &&
85
+ s1.paymentData.downgradeDate === s2.paymentData.downgradeDate &&
86
+ s1.paymentData.newPlan === s2.paymentData.newPlan)));
87
+ }
88
+ Subscription.isSame = isSame;
89
+ function isActive(s, date) {
90
+ return s.startDate <= date && (s.endDate === undefined || date < s.endDate);
91
+ }
92
+ Subscription.isActive = isActive;
93
+ function isDowngraded(s) {
94
+ return s.paymentData && s.paymentData.downgradeDate;
95
+ }
96
+ Subscription.isDowngraded = isDowngraded;
97
+ function calculateCurrentPeriod(startDate, now) {
98
+ let nextStartDate = startDate;
99
+ do {
100
+ startDate = nextStartDate;
101
+ nextStartDate = (0, timeutil_1.oneMonthLater)(startDate, new Date(startDate).getDate());
102
+ } while (nextStartDate < now.toISOString());
103
+ return { startDate, endDate: nextStartDate };
104
+ }
105
+ Subscription.calculateCurrentPeriod = calculateCurrentPeriod;
106
+ })(Subscription = exports.Subscription || (exports.Subscription = {}));
107
+ //# sourceMappingURL=accounting-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounting-protocol.js","sourceRoot":"","sources":["../src/accounting-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+BAAoC;AAEpC,8CAAgD;AAuChD,IAAiB,YAAY,CAM5B;AAND,WAAiB,YAAY;IACzB,SAAgB,MAAM,CAAyB,KAAqB;QAChE,MAAM,MAAM,GAAG,KAAU,CAAC;QAC1B,MAAM,CAAC,GAAG,GAAG,IAAA,SAAM,GAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAClB,CAAC;IAJe,mBAAM,SAIrB,CAAA;AACL,CAAC,EANgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAM5B;AA2BD,IAAiB,iBAAiB,CAIjC;AAJD,WAAiB,iBAAiB;IAC9B,SAAgB,EAAE,CAAC,GAAQ;QACvB,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,QAAQ,CA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D,EAAE,CAAC,WAAW,CAAC,OAAO,KAAK,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAC9D,CAAC;IACN,CAAC;IAjBe,mBAAM,SAiBrB,CAAA;IACD,SAAgB,QAAQ,CAAC,CAAe,EAAE,IAAY;QAClD,OAAO,CAAC,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC;IAFe,qBAAQ,WAEvB,CAAA;IACD,SAAgB,YAAY,CAAC,CAAe;QACxC,OAAO,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC;IACxD,CAAC;IAFe,yBAAY,eAE3B,CAAA;IACD,SAAgB,sBAAsB,CAAC,SAAiB,EAAE,GAAS;QAC/D,IAAI,aAAa,GAAG,SAAS,CAAC;QAC9B,GAAG;YACC,SAAS,GAAG,aAAa,CAAC;YAC1B,aAAa,GAAG,IAAA,wBAAa,EAAC,SAAS,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;SAC3E,QAAQ,aAAa,GAAG,GAAG,CAAC,WAAW,EAAE,EAAE;QAC5C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IACjD,CAAC;IAPe,mCAAsB,yBAOrC,CAAA;AACL,CAAC,EA1CgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA0C5B"}
@@ -4,9 +4,12 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
  import { User, Workspace, NamedWorkspaceFeatureFlag } from "./protocol";
7
- import { Without } from "./util/without";
7
+ import { FindPrebuildsParams } from "./gitpod-service";
8
+ import { Project, Team, PrebuildWithStatus, TeamMemberInfo, TeamMemberRole } from "./teams-projects-protocol";
8
9
  import { WorkspaceInstance, WorkspaceInstancePhase } from "./workspace-instance";
9
10
  import { RoleOrPermission } from "./permission";
11
+ import { AccountStatement } from "./accounting-protocol";
12
+ import { InstallationAdminSettings } from "./installation-admin-protocol";
10
13
  export interface AdminServer {
11
14
  adminGetUsers(req: AdminGetListRequest<User>): Promise<AdminGetListResult<User>>;
12
15
  adminGetUser(id: string): Promise<User>;
@@ -14,10 +17,25 @@ export interface AdminServer {
14
17
  adminDeleteUser(id: string): Promise<void>;
15
18
  adminModifyRoleOrPermission(req: AdminModifyRoleOrPermissionRequest): Promise<User>;
16
19
  adminModifyPermanentWorkspaceFeatureFlag(req: AdminModifyPermanentWorkspaceFeatureFlagRequest): Promise<User>;
20
+ adminGetTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
21
+ adminGetTeams(req: AdminGetListRequest<Team>): Promise<AdminGetListResult<Team>>;
22
+ adminGetTeamById(id: string): Promise<Team | undefined>;
23
+ adminSetTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
17
24
  adminGetWorkspaces(req: AdminGetWorkspacesRequest): Promise<AdminGetListResult<WorkspaceAndInstance>>;
18
25
  adminGetWorkspace(id: string): Promise<WorkspaceAndInstance>;
19
26
  adminForceStopWorkspace(id: string): Promise<void>;
27
+ adminRestoreSoftDeletedWorkspace(id: string): Promise<void>;
28
+ adminGetProjectsBySearchTerm(req: AdminGetListRequest<Project>): Promise<AdminGetListResult<Project>>;
29
+ adminGetProjectById(id: string): Promise<Project | undefined>;
30
+ adminFindPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
20
31
  adminSetLicense(key: string): Promise<void>;
32
+ adminGetAccountStatement(userId: string): Promise<AccountStatement>;
33
+ adminSetProfessionalOpenSource(userId: string, shouldGetProfOSS: boolean): Promise<void>;
34
+ adminIsStudent(userId: string): Promise<boolean>;
35
+ adminAddStudentEmailDomain(userId: string, domain: string): Promise<void>;
36
+ adminGrantExtraHours(userId: string, extraHours: number): Promise<void>;
37
+ adminGetSettings(): Promise<InstallationAdminSettings>;
38
+ adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
21
39
  }
22
40
  export interface AdminGetListRequest<T> {
23
41
  offset: number;
@@ -48,14 +66,24 @@ export interface AdminModifyPermanentWorkspaceFeatureFlagRequest {
48
66
  add: boolean;
49
67
  }[];
50
68
  }
51
- export interface WorkspaceAndInstance extends Without<Workspace, "id" | "creationTime">, Without<WorkspaceInstance, "id" | "creationTime"> {
69
+ export interface WorkspaceAndInstance extends Omit<Workspace, "id" | "creationTime">, Omit<WorkspaceInstance, "id" | "creationTime"> {
52
70
  workspaceId: string;
53
71
  workspaceCreationTime: string;
54
72
  instanceId: string;
55
73
  instanceCreationTime: string;
56
74
  phase: WorkspaceInstancePhase;
57
75
  }
58
- export interface AdminGetWorkspacesRequest extends AdminGetListRequest<WorkspaceAndInstance> {
59
- ownerId?: string;
76
+ export declare namespace WorkspaceAndInstance {
77
+ function toWorkspace(wai: WorkspaceAndInstance): Workspace;
78
+ function toInstance(wai: WorkspaceAndInstance): WorkspaceInstance | undefined;
60
79
  }
80
+ export declare type AdminGetWorkspacesRequest = AdminGetListRequest<WorkspaceAndInstance> & AdminGetWorkspacesQuery;
81
+ /** The fields are meant to be used either OR (not combined) */
82
+ export declare type AdminGetWorkspacesQuery = {
83
+ /** we use this field in case we have a UUIDv4 and don't know whether it's an (old) workspace or instance id */
84
+ instanceIdOrWorkspaceId?: string;
85
+ instanceId?: string;
86
+ workspaceId?: string;
87
+ ownerId?: string;
88
+ };
61
89
  //# sourceMappingURL=admin-protocol.d.ts.map