@gitpod/gitpod-protocol 0.1.5-main.648 → 0.1.5-main.6480

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 (455) hide show
  1. package/data/gitpod-schema.json +157 -29
  2. package/lib/accounting-protocol.d.ts +19 -14
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +44 -48
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +44 -5
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +16 -1
  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/attribution.d.ts +24 -0
  15. package/lib/attribution.d.ts.map +1 -0
  16. package/lib/attribution.js +54 -0
  17. package/lib/attribution.js.map +1 -0
  18. package/lib/auth.d.ts +1 -1
  19. package/lib/auth.d.ts.map +1 -1
  20. package/lib/auth.js +1 -1
  21. package/lib/billing-mode.d.ts +45 -0
  22. package/lib/billing-mode.d.ts.map +1 -0
  23. package/lib/billing-mode.js +44 -0
  24. package/lib/billing-mode.js.map +1 -0
  25. package/lib/blocked-repositories-protocol.d.ts +13 -0
  26. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  27. package/lib/blocked-repositories-protocol.js +8 -0
  28. package/lib/blocked-repositories-protocol.js.map +1 -0
  29. package/lib/context-url.d.ts +30 -0
  30. package/lib/context-url.d.ts.map +1 -0
  31. package/lib/context-url.js +100 -0
  32. package/lib/context-url.js.map +1 -0
  33. package/lib/context-url.spec.d.ts +12 -0
  34. package/lib/context-url.spec.d.ts.map +1 -0
  35. package/lib/context-url.spec.js +81 -0
  36. package/lib/context-url.spec.js.map +1 -0
  37. package/lib/encryption/container-module.d.ts +1 -1
  38. package/lib/encryption/container-module.d.ts.map +1 -1
  39. package/lib/encryption/container-module.js +5 -5
  40. package/lib/encryption/container-module.js.map +1 -1
  41. package/lib/encryption/encryption-engine.d.ts +1 -1
  42. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  43. package/lib/encryption/encryption-engine.js +26 -27
  44. package/lib/encryption/encryption-engine.js.map +1 -1
  45. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  46. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  47. package/lib/encryption/encryption-engine.spec.js +30 -38
  48. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  49. package/lib/encryption/encryption-service.d.ts +1 -1
  50. package/lib/encryption/encryption-service.d.ts.map +1 -1
  51. package/lib/encryption/encryption-service.js +31 -45
  52. package/lib/encryption/encryption-service.js.map +1 -1
  53. package/lib/encryption/key-provider.d.ts +1 -1
  54. package/lib/encryption/key-provider.d.ts.map +1 -1
  55. package/lib/encryption/key-provider.js +32 -39
  56. package/lib/encryption/key-provider.js.map +1 -1
  57. package/lib/env.d.ts +1 -7
  58. package/lib/env.d.ts.map +1 -1
  59. package/lib/env.js +8 -28
  60. package/lib/env.js.map +1 -1
  61. package/lib/experiments/always-default.d.ts +8 -0
  62. package/lib/experiments/always-default.d.ts.map +1 -0
  63. package/lib/experiments/always-default.js +20 -0
  64. package/lib/experiments/always-default.js.map +1 -0
  65. package/lib/experiments/configcat-server.d.ts +10 -0
  66. package/lib/experiments/configcat-server.d.ts.map +1 -0
  67. package/lib/experiments/configcat-server.js +37 -0
  68. package/lib/experiments/configcat-server.js.map +1 -0
  69. package/lib/experiments/configcat.d.ts +21 -0
  70. package/lib/experiments/configcat.d.ts.map +1 -0
  71. package/lib/experiments/configcat.js +51 -0
  72. package/lib/experiments/configcat.js.map +1 -0
  73. package/lib/experiments/types.d.ts +22 -0
  74. package/lib/experiments/types.d.ts.map +1 -0
  75. package/lib/experiments/types.js +10 -0
  76. package/lib/experiments/types.js.map +1 -0
  77. package/lib/frontend-dashboard-service.d.ts +90 -0
  78. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  79. package/lib/frontend-dashboard-service.js +49 -0
  80. package/lib/frontend-dashboard-service.js.map +1 -0
  81. package/lib/gitpod-file-parser.d.ts +1 -1
  82. package/lib/gitpod-file-parser.d.ts.map +1 -1
  83. package/lib/gitpod-file-parser.js +27 -43
  84. package/lib/gitpod-file-parser.js.map +1 -1
  85. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  86. package/lib/gitpod-file-parser.spec.js +146 -143
  87. package/lib/gitpod-file-parser.spec.js.map +1 -1
  88. package/lib/gitpod-service.d.ts +191 -55
  89. package/lib/gitpod-service.d.ts.map +1 -1
  90. package/lib/gitpod-service.js +204 -298
  91. package/lib/gitpod-service.js.map +1 -1
  92. package/lib/headless-workspace-log.d.ts +10 -12
  93. package/lib/headless-workspace-log.d.ts.map +1 -1
  94. package/lib/headless-workspace-log.js +7 -9
  95. package/lib/headless-workspace-log.js.map +1 -1
  96. package/lib/ide-frontend-service.d.ts +2 -2
  97. package/lib/ide-frontend-service.js +1 -1
  98. package/lib/ide-protocol.d.ts +126 -0
  99. package/lib/ide-protocol.d.ts.map +1 -0
  100. package/lib/ide-protocol.js +18 -0
  101. package/lib/ide-protocol.js.map +1 -0
  102. package/lib/index.d.ts +17 -11
  103. package/lib/index.d.ts.map +1 -1
  104. package/lib/index.js +8 -2
  105. package/lib/index.js.map +1 -1
  106. package/lib/installation-admin-protocol.d.ts +30 -0
  107. package/lib/installation-admin-protocol.d.ts.map +1 -0
  108. package/lib/installation-admin-protocol.js +31 -0
  109. package/lib/installation-admin-protocol.js.map +1 -0
  110. package/lib/license-protocol.d.ts +8 -1
  111. package/lib/license-protocol.d.ts.map +1 -1
  112. package/lib/license-protocol.js +1 -1
  113. package/lib/license-protocol.js.map +1 -1
  114. package/lib/messaging/browser/connection.d.ts +4 -6
  115. package/lib/messaging/browser/connection.d.ts.map +1 -1
  116. package/lib/messaging/browser/connection.js +176 -45
  117. package/lib/messaging/browser/connection.js.map +1 -1
  118. package/lib/messaging/browser/window-connection.d.ts +5 -5
  119. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  120. package/lib/messaging/browser/window-connection.js +43 -60
  121. package/lib/messaging/browser/window-connection.js.map +1 -1
  122. package/lib/messaging/client-call-metrics.d.ts +21 -0
  123. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  124. package/lib/messaging/client-call-metrics.js +95 -0
  125. package/lib/messaging/client-call-metrics.js.map +1 -0
  126. package/lib/messaging/error.d.ts +13 -3
  127. package/lib/messaging/error.d.ts.map +1 -1
  128. package/lib/messaging/error.js +25 -5
  129. package/lib/messaging/error.js.map +1 -1
  130. package/lib/messaging/handler.d.ts +10 -0
  131. package/lib/messaging/handler.d.ts.map +1 -1
  132. package/lib/messaging/handler.js +1 -1
  133. package/lib/messaging/node/connection.d.ts +1 -17
  134. package/lib/messaging/node/connection.d.ts.map +1 -1
  135. package/lib/messaging/node/connection.js +24 -60
  136. package/lib/messaging/node/connection.js.map +1 -1
  137. package/lib/messaging/proxy-factory.d.ts +3 -1
  138. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  139. package/lib/messaging/proxy-factory.js +75 -162
  140. package/lib/messaging/proxy-factory.js.map +1 -1
  141. package/lib/oss-allowlist.d.ts +14 -0
  142. package/lib/oss-allowlist.d.ts.map +1 -0
  143. package/lib/oss-allowlist.js +8 -0
  144. package/lib/oss-allowlist.js.map +1 -0
  145. package/lib/payment-protocol.d.ts +1 -1
  146. package/lib/payment-protocol.d.ts.map +1 -1
  147. package/lib/payment-protocol.js +2 -2
  148. package/lib/payment-protocol.js.map +1 -1
  149. package/lib/permission.d.ts +14 -4
  150. package/lib/permission.d.ts.map +1 -1
  151. package/lib/permission.js +45 -32
  152. package/lib/permission.js.map +1 -1
  153. package/lib/plans.d.ts +6 -5
  154. package/lib/plans.d.ts.map +1 -1
  155. package/lib/plans.js +230 -210
  156. package/lib/plans.js.map +1 -1
  157. package/lib/protocol.d.ts +261 -105
  158. package/lib/protocol.d.ts.map +1 -1
  159. package/lib/protocol.js +346 -205
  160. package/lib/protocol.js.map +1 -1
  161. package/{src/util/without.ts → lib/protocol.spec.d.ts} +3 -4
  162. package/lib/protocol.spec.d.ts.map +1 -0
  163. package/lib/protocol.spec.js +127 -0
  164. package/lib/protocol.spec.js.map +1 -0
  165. package/lib/snapshot-url.d.ts +14 -0
  166. package/lib/snapshot-url.d.ts.map +1 -0
  167. package/lib/snapshot-url.js +26 -0
  168. package/lib/snapshot-url.js.map +1 -0
  169. package/lib/snapshot-url.spec.d.ts +7 -0
  170. package/lib/snapshot-url.spec.d.ts.map +1 -0
  171. package/lib/snapshot-url.spec.js +41 -0
  172. package/lib/snapshot-url.spec.js.map +1 -0
  173. package/lib/team-subscription-protocol.d.ts +24 -5
  174. package/lib/team-subscription-protocol.d.ts.map +1 -1
  175. package/lib/team-subscription-protocol.js +36 -18
  176. package/lib/team-subscription-protocol.js.map +1 -1
  177. package/lib/teams-projects-protocol.d.ts +137 -0
  178. package/lib/teams-projects-protocol.d.ts.map +1 -0
  179. package/lib/teams-projects-protocol.js +41 -0
  180. package/lib/teams-projects-protocol.js.map +1 -0
  181. package/lib/typings/globals.d.ts +3 -3
  182. package/lib/typings/globals.d.ts.map +1 -1
  183. package/lib/typings/globals.js +1 -1
  184. package/lib/usage.d.ts +73 -0
  185. package/lib/usage.d.ts.map +1 -0
  186. package/lib/usage.js +20 -0
  187. package/lib/usage.js.map +1 -0
  188. package/lib/util/analytics.d.ts +8 -0
  189. package/lib/util/analytics.d.ts.map +1 -0
  190. package/lib/util/analytics.js +88 -0
  191. package/lib/util/analytics.js.map +1 -0
  192. package/lib/util/async-iterator.d.ts +1 -1
  193. package/lib/util/async-iterator.d.ts.map +1 -1
  194. package/lib/util/async-iterator.js +58 -136
  195. package/lib/util/async-iterator.js.map +1 -1
  196. package/lib/util/cancelable.d.ts +1 -1
  197. package/lib/util/cancelable.js +18 -60
  198. package/lib/util/cancelable.js.map +1 -1
  199. package/lib/util/date-time.d.ts +1 -1
  200. package/lib/util/date-time.js +12 -12
  201. package/lib/util/date-time.js.map +1 -1
  202. package/lib/util/debug-app.d.ts +25 -0
  203. package/lib/util/debug-app.d.ts.map +1 -0
  204. package/lib/util/debug-app.js +100 -0
  205. package/lib/util/debug-app.js.map +1 -0
  206. package/lib/util/deep-partial.d.ts +1 -1
  207. package/lib/util/deep-partial.js +1 -1
  208. package/lib/util/deferred.d.ts +1 -1
  209. package/lib/util/deferred.js +11 -13
  210. package/lib/util/deferred.js.map +1 -1
  211. package/lib/util/disposable.d.ts.map +1 -1
  212. package/lib/util/disposable.js +27 -40
  213. package/lib/util/disposable.js.map +1 -1
  214. package/lib/util/event.d.ts.map +1 -1
  215. package/lib/util/event.js +63 -77
  216. package/lib/util/event.js.map +1 -1
  217. package/lib/util/garbage-collected-cache.d.ts +2 -1
  218. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  219. package/lib/util/garbage-collected-cache.js +33 -48
  220. package/lib/util/garbage-collected-cache.js.map +1 -1
  221. package/lib/util/generate-workspace-id.d.ts +6 -1
  222. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  223. package/lib/util/generate-workspace-id.js +469 -502
  224. package/lib/util/generate-workspace-id.js.map +1 -1
  225. package/lib/util/generate-workspace-id.spec.d.ts +1 -1
  226. package/lib/util/generate-workspace-id.spec.js +69 -79
  227. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  228. package/lib/util/gitpod-cookie.d.ts +20 -0
  229. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  230. package/lib/util/gitpod-cookie.js +41 -0
  231. package/lib/util/gitpod-cookie.js.map +1 -0
  232. package/lib/util/gitpod-host-url.d.ts +12 -7
  233. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  234. package/lib/util/gitpod-host-url.js +132 -110
  235. package/lib/util/gitpod-host-url.js.map +1 -1
  236. package/lib/util/gitpod-host-url.spec.d.ts +7 -1
  237. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  238. package/lib/util/gitpod-host-url.spec.js +113 -31
  239. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  240. package/lib/util/grpc.d.ts +35 -0
  241. package/lib/util/grpc.d.ts.map +1 -0
  242. package/lib/util/grpc.js +90 -0
  243. package/lib/util/grpc.js.map +1 -0
  244. package/lib/util/jaeger-client-types.d.ts +68 -0
  245. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  246. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +2 -2
  247. package/lib/util/jaeger-client-types.js.map +1 -0
  248. package/lib/util/logging.d.ts +50 -34
  249. package/lib/util/logging.d.ts.map +1 -1
  250. package/lib/util/logging.js +133 -130
  251. package/lib/util/logging.js.map +1 -1
  252. package/lib/util/logging.spec.d.ts +7 -0
  253. package/lib/util/logging.spec.d.ts.map +1 -0
  254. package/lib/util/logging.spec.js +52 -0
  255. package/lib/util/logging.spec.js.map +1 -0
  256. package/lib/util/make-link.d.ts +1 -1
  257. package/lib/util/make-link.js +6 -6
  258. package/lib/util/make-link.js.map +1 -1
  259. package/lib/util/nice-grpc.d.ts +9 -0
  260. package/lib/util/nice-grpc.d.ts.map +1 -0
  261. package/lib/util/nice-grpc.js +121 -0
  262. package/lib/util/nice-grpc.js.map +1 -0
  263. package/lib/util/parse-workspace-id.d.ts +11 -1
  264. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  265. package/lib/util/parse-workspace-id.js +31 -8
  266. package/lib/util/parse-workspace-id.js.map +1 -1
  267. package/lib/util/parse-workspace-id.spec.d.ts +5 -1
  268. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  269. package/lib/util/parse-workspace-id.spec.js +124 -85
  270. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  271. package/lib/util/queue.d.ts +1 -1
  272. package/lib/util/queue.js +17 -56
  273. package/lib/util/queue.js.map +1 -1
  274. package/lib/util/queue.spec.d.ts +1 -1
  275. package/lib/util/queue.spec.js +148 -289
  276. package/lib/util/queue.spec.js.map +1 -1
  277. package/lib/util/repeat.d.ts +15 -0
  278. package/lib/util/repeat.d.ts.map +1 -0
  279. package/lib/util/repeat.js +55 -0
  280. package/lib/util/repeat.js.map +1 -0
  281. package/lib/util/semaphore.d.ts +1 -1
  282. package/lib/util/semaphore.d.ts.map +1 -1
  283. package/lib/util/semaphore.js +16 -47
  284. package/lib/util/semaphore.js.map +1 -1
  285. package/lib/util/skip-if.d.ts +1 -1
  286. package/lib/util/skip-if.d.ts.map +1 -1
  287. package/lib/util/skip-if.js +7 -7
  288. package/lib/util/skip-if.js.map +1 -1
  289. package/lib/util/timeutil.d.ts +3 -1
  290. package/lib/util/timeutil.d.ts.map +1 -1
  291. package/lib/util/timeutil.js +30 -18
  292. package/lib/util/timeutil.js.map +1 -1
  293. package/lib/util/timeutil.spec.d.ts +3 -1
  294. package/lib/util/timeutil.spec.d.ts.map +1 -1
  295. package/lib/util/timeutil.spec.js +55 -24
  296. package/lib/util/timeutil.spec.js.map +1 -1
  297. package/lib/util/tracing.d.ts +53 -7
  298. package/lib/util/tracing.d.ts.map +1 -1
  299. package/lib/util/tracing.js +198 -65
  300. package/lib/util/tracing.js.map +1 -1
  301. package/lib/util/tracing.spec.d.ts +7 -0
  302. package/lib/util/tracing.spec.d.ts.map +1 -0
  303. package/lib/util/tracing.spec.js +121 -0
  304. package/lib/util/tracing.spec.js.map +1 -0
  305. package/lib/util/workspace-port-authentication.d.ts +8 -8
  306. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  307. package/lib/util/workspace-port-authentication.js +10 -13
  308. package/lib/util/workspace-port-authentication.js.map +1 -1
  309. package/lib/webhook-event.d.ts +44 -0
  310. package/lib/webhook-event.d.ts.map +1 -0
  311. package/lib/webhook-event.js +8 -0
  312. package/lib/webhook-event.js.map +1 -0
  313. package/lib/workspace-class.d.ts +14 -0
  314. package/lib/workspace-class.d.ts.map +1 -0
  315. package/lib/workspace-class.js +8 -0
  316. package/lib/workspace-class.js.map +1 -0
  317. package/lib/workspace-cluster.d.ts +28 -8
  318. package/lib/workspace-cluster.d.ts.map +1 -1
  319. package/lib/workspace-cluster.js +20 -5
  320. package/lib/workspace-cluster.js.map +1 -1
  321. package/lib/workspace-instance.d.ts +46 -6
  322. package/lib/workspace-instance.d.ts.map +1 -1
  323. package/lib/workspace-instance.js +1 -1
  324. package/lib/wsready.d.ts +8 -2
  325. package/lib/wsready.d.ts.map +1 -1
  326. package/lib/wsready.js +3 -3
  327. package/package.json +40 -18
  328. package/pkg-yarn.lock +23 -10
  329. package/provenance-bundle.jsonl +2 -0
  330. package/src/accounting-protocol.ts +67 -58
  331. package/src/admin-protocol.ts +88 -20
  332. package/src/analytics.ts +52 -0
  333. package/src/attribution.ts +63 -0
  334. package/src/auth.ts +3 -3
  335. package/src/billing-mode.ts +84 -0
  336. package/src/blocked-repositories-protocol.ts +13 -0
  337. package/src/context-url.spec.ts +49 -0
  338. package/src/context-url.ts +107 -0
  339. package/src/encryption/container-module.ts +3 -4
  340. package/src/encryption/encryption-engine.spec.ts +10 -9
  341. package/src/encryption/encryption-engine.ts +21 -17
  342. package/src/encryption/encryption-service.ts +5 -6
  343. package/src/encryption/key-provider.ts +17 -20
  344. package/src/env.ts +2 -25
  345. package/src/experiments/always-default.ts +24 -0
  346. package/src/experiments/configcat-server.ts +42 -0
  347. package/src/experiments/configcat.ts +56 -0
  348. package/src/experiments/types.ts +34 -0
  349. package/src/frontend-dashboard-service.ts +125 -0
  350. package/src/gitpod-file-parser.spec.ts +56 -62
  351. package/src/gitpod-file-parser.ts +17 -18
  352. package/src/gitpod-service.ts +369 -146
  353. package/src/headless-workspace-log.ts +13 -15
  354. package/src/ide-frontend-service.ts +3 -3
  355. package/src/ide-protocol.ts +147 -0
  356. package/src/index.ts +17 -11
  357. package/src/installation-admin-protocol.ts +45 -0
  358. package/src/license-protocol.ts +13 -7
  359. package/src/messaging/browser/connection.ts +187 -28
  360. package/src/messaging/browser/window-connection.ts +40 -30
  361. package/src/messaging/client-call-metrics.ts +94 -0
  362. package/src/messaging/error.ts +36 -8
  363. package/src/messaging/handler.ts +13 -1
  364. package/src/messaging/node/connection.ts +23 -70
  365. package/src/messaging/proxy-factory.ts +35 -34
  366. package/src/oss-allowlist.ts +15 -0
  367. package/src/payment-protocol.ts +3 -3
  368. package/src/permission.ts +47 -34
  369. package/src/plans.ts +250 -199
  370. package/src/protocol.spec.ts +97 -0
  371. package/src/protocol.ts +636 -293
  372. package/src/snapshot-url.spec.ts +27 -0
  373. package/src/snapshot-url.ts +27 -0
  374. package/src/team-subscription-protocol.ts +62 -23
  375. package/src/teams-projects-protocol.ts +181 -0
  376. package/src/typings/globals.ts +6 -5
  377. package/src/usage.ts +85 -0
  378. package/src/util/analytics.ts +109 -0
  379. package/src/util/async-iterator.ts +5 -6
  380. package/src/util/cancelable.ts +4 -4
  381. package/src/util/date-time.ts +9 -9
  382. package/src/util/debug-app.ts +81 -0
  383. package/src/util/deep-partial.ts +1 -1
  384. package/src/util/deferred.ts +7 -7
  385. package/src/util/disposable.ts +3 -6
  386. package/src/util/event.ts +9 -11
  387. package/src/util/garbage-collected-cache.ts +17 -9
  388. package/src/util/generate-workspace-id.spec.ts +38 -11
  389. package/src/util/generate-workspace-id.ts +465 -439
  390. package/src/util/gitpod-cookie.ts +38 -0
  391. package/src/util/gitpod-host-url.spec.ts +59 -8
  392. package/src/util/gitpod-host-url.ts +88 -48
  393. package/src/util/grpc.ts +107 -0
  394. package/src/util/jaeger-client-types.ts +102 -0
  395. package/src/util/logging.spec.ts +23 -0
  396. package/src/util/logging.ts +157 -75
  397. package/src/util/make-link.ts +7 -8
  398. package/src/util/nice-grpc.ts +96 -0
  399. package/src/util/parse-workspace-id.spec.ts +38 -9
  400. package/src/util/parse-workspace-id.ts +33 -8
  401. package/src/util/queue.spec.ts +28 -26
  402. package/src/util/queue.ts +1 -1
  403. package/src/util/repeat.ts +45 -0
  404. package/src/util/semaphore.ts +7 -9
  405. package/src/util/skip-if.ts +11 -8
  406. package/src/util/timeutil.spec.ts +41 -15
  407. package/src/util/timeutil.ts +32 -16
  408. package/src/util/tracing.spec.ts +88 -0
  409. package/src/util/tracing.ts +201 -32
  410. package/src/util/workspace-port-authentication.ts +11 -14
  411. package/src/webhook-event.ts +55 -0
  412. package/src/workspace-class.ts +14 -0
  413. package/src/workspace-cluster.ts +47 -17
  414. package/src/workspace-instance.ts +106 -32
  415. package/src/wsready.ts +11 -4
  416. package/data/builtin-theia-plugins.json +0 -372
  417. package/lib/email-protocol.d.ts +0 -50
  418. package/lib/email-protocol.d.ts.map +0 -1
  419. package/lib/email-protocol.js +0 -28
  420. package/lib/email-protocol.js.map +0 -1
  421. package/lib/messaging/connection-error-handler.d.ts +0 -27
  422. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  423. package/lib/messaging/connection-error-handler.js +0 -46
  424. package/lib/messaging/connection-error-handler.js.map +0 -1
  425. package/lib/theia-plugins.d.ts +0 -11
  426. package/lib/theia-plugins.d.ts.map +0 -1
  427. package/lib/theia-plugins.js.map +0 -1
  428. package/lib/util/context-url.d.ts +0 -13
  429. package/lib/util/context-url.d.ts.map +0 -1
  430. package/lib/util/context-url.js +0 -26
  431. package/lib/util/context-url.js.map +0 -1
  432. package/lib/util/context-url.spec.d.ts +0 -10
  433. package/lib/util/context-url.spec.d.ts.map +0 -1
  434. package/lib/util/context-url.spec.js +0 -52
  435. package/lib/util/context-url.spec.js.map +0 -1
  436. package/lib/util/repeater.d.ts +0 -22
  437. package/lib/util/repeater.d.ts.map +0 -1
  438. package/lib/util/repeater.js +0 -118
  439. package/lib/util/repeater.js.map +0 -1
  440. package/lib/util/safe-promise.d.ts +0 -11
  441. package/lib/util/safe-promise.d.ts.map +0 -1
  442. package/lib/util/safe-promise.js +0 -34
  443. package/lib/util/safe-promise.js.map +0 -1
  444. package/lib/util/without.d.ts +0 -7
  445. package/lib/util/without.d.ts.map +0 -1
  446. package/lib/util/without.js +0 -8
  447. package/lib/util/without.js.map +0 -1
  448. package/src/email-protocol.ts +0 -67
  449. package/src/messaging/connection-error-handler.ts +0 -62
  450. package/src/theia-plugins.ts +0 -11
  451. package/src/util/context-url.spec.ts +0 -25
  452. package/src/util/context-url.ts +0 -23
  453. package/src/util/jaeger-client.d.ts +0 -105
  454. package/src/util/repeater.ts +0 -49
  455. 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,113 @@
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
+ "$ref": "#/definitions/jetbrainsProduct",
265
+ "description": "Configure IntelliJ integration"
266
+ },
267
+ "goland": {
268
+ "$ref": "#/definitions/jetbrainsProduct",
269
+ "description": "Configure GoLand integration"
270
+ },
271
+ "pycharm": {
272
+ "$ref": "#/definitions/jetbrainsProduct",
273
+ "description": "Configure PyCharm integration"
274
+ },
275
+ "phpstorm": {
276
+ "$ref": "#/definitions/jetbrainsProduct",
277
+ "description": "Configure PhpStorm integration"
278
+ },
279
+ "rubymine": {
280
+ "$ref": "#/definitions/jetbrainsProduct",
281
+ "description": "Configure RubyMine integration"
282
+ },
283
+ "webstorm": {
284
+ "$ref": "#/definitions/jetbrainsProduct",
285
+ "description": "Configure WebStorm integration"
286
+ },
287
+ "rider": {
288
+ "$ref": "#/definitions/jetbrainsProduct",
289
+ "description": "Configure Rider integration"
290
+ },
291
+ "clion": {
292
+ "$ref": "#/definitions/jetbrainsProduct",
293
+ "description": "Configure CLion integration"
294
+ }
295
+ }
296
+ },
297
+ "experimentalNetwork": {
298
+ "type": "boolean",
299
+ "deprecationMessage": "The 'experimentalNetwork' property is deprecated.",
300
+ "description": "Experimental network configuration in workspaces (deprecated). Enabled by default"
301
+ },
302
+ "coreDump": {
303
+ "type": "object",
304
+ "description": "Configure the default action of certain signals is to cause a process to terminate and produce a core dump file, a file containing an image of the process's memory at the time of termination. Disabled by default.",
305
+ "deprecationMessage": "The 'coreDump' property is experimental.",
306
+ "additionalProperties": false,
307
+ "properties": {
308
+ "enabled": {
309
+ "type": "boolean"
310
+ },
311
+ "softLimit": {
312
+ "type": "number",
313
+ "description": "upper limit on the size of the core dump file that will be produced if it receives a core dump signal"
314
+ },
315
+ "hardLimit": {
316
+ "type": "number",
317
+ "description": "the hard limit acts as a ceiling for the soft limit. For more details please check https://man7.org/linux/man-pages/man2/getrlimit.2.html"
318
+ }
319
+ }
227
320
  }
228
321
  },
229
- "additionalProperties": false
230
- }
322
+ "additionalProperties": false,
323
+ "definitions": {
324
+ "jetbrainsProduct": {
325
+ "type": "object",
326
+ "additionalProperties": false,
327
+ "properties": {
328
+ "plugins": {
329
+ "type": "array",
330
+ "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.",
331
+ "items": {
332
+ "type": "string"
333
+ }
334
+ },
335
+ "prebuilds": {
336
+ "type": "object",
337
+ "description": "Enable warming up of JetBrains backend in prebuilds.",
338
+ "additionalProperties": false,
339
+ "properties": {
340
+ "version": {
341
+ "type": "string",
342
+ "enum": [
343
+ "stable",
344
+ "latest",
345
+ "both"
346
+ ],
347
+ "description": "Whether only stable, latest or both versions should be warmed up. Default is stable only."
348
+ }
349
+ }
350
+ },
351
+ "vmoptions": {
352
+ "type": "string",
353
+ "description": "Configure JVM options, for instance '-Xmx=4096m'."
354
+ }
355
+ }
356
+ }
357
+ }
358
+ }
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
- import { Without } from "./util/without";
7
- import { User } from './protocol';
6
+ import { User } from "./protocol";
8
7
  export interface AccountEntry {
9
8
  uid: string;
10
9
  userId: string;
@@ -32,20 +31,20 @@ export interface AccountEntry {
32
31
  description?: object;
33
32
  }
34
33
  export declare namespace AccountEntry {
35
- function create<T extends AccountEntry>(entry: Without<T, 'uid'>): T;
34
+ function create<T extends AccountEntry>(entry: Omit<T, "uid">): T;
36
35
  }
37
- export declare type DebitAccountEntryKind = 'session' | 'expiry' | 'loss';
38
- export declare type AccountEntryKind = 'credit' | DebitAccountEntryKind | 'carry' | 'open';
36
+ export declare type DebitAccountEntryKind = "session" | "expiry" | "loss";
37
+ export declare type AccountEntryKind = "credit" | DebitAccountEntryKind | "carry" | "open";
39
38
  export interface Credit extends AccountEntry {
40
- kind: 'credit';
39
+ kind: "credit";
41
40
  expiryDate: string;
42
41
  }
43
42
  export declare type Debit = LossDebit | ExpiryDebit | SessionDebit;
44
43
  export interface LossDebit extends AccountEntry {
45
- kind: 'loss';
44
+ kind: "loss";
46
45
  }
47
46
  export interface ExpiryDebit extends AccountEntry {
48
- kind: 'expiry';
47
+ kind: "expiry";
49
48
  creditId: undefined;
50
49
  }
51
50
  export interface SessionDebit extends AccountEntry {
@@ -65,7 +64,6 @@ export interface SessionDescription {
65
64
  contextUrl: string;
66
65
  workspaceId: string;
67
66
  workspaceInstanceId: string;
68
- private: boolean;
69
67
  }
70
68
  export declare namespace SessionDescription {
71
69
  function is(obj: any): obj is SessionDescription;
@@ -93,6 +91,7 @@ export interface Subscription {
93
91
  paymentReference?: string;
94
92
  paymentData?: PaymentData;
95
93
  teamSubscriptionSlotId?: string;
94
+ teamMembershipId?: string;
96
95
  /** marks the subscription as deleted */
97
96
  deleted?: boolean;
98
97
  }
@@ -118,13 +117,19 @@ export interface AssignedTeamSubscription extends Subscription {
118
117
  export declare namespace AssignedTeamSubscription {
119
118
  function is(data: any): data is AssignedTeamSubscription;
120
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
+ }
121
126
  export declare namespace Subscription {
122
- function create(newSubscription: Without<Subscription, 'uid'>): Subscription;
127
+ function create(newSubscription: Omit<Subscription, "uid">): Subscription;
123
128
  function cancelSubscription(s: Subscription, cancellationDate: string, endDate?: string): void;
124
129
  function isSame(s1: Subscription | undefined, s2: Subscription | undefined): boolean;
125
130
  function isActive(s: Subscription, date: string): boolean;
131
+ function isCancelled(s: Subscription, date: string): boolean;
126
132
  function isDowngraded(s: Subscription): string | undefined;
127
- function isCancelled(s: Subscription): boolean;
128
133
  function calculateCurrentPeriod(startDate: string, now: Date): {
129
134
  startDate: string;
130
135
  endDate: string;
@@ -136,7 +141,7 @@ export interface Period {
136
141
  endDate: string;
137
142
  }
138
143
  export declare type MaybePeriod = Period | undefined;
139
- export declare type AccountEntryFixedPeriod = Without<AccountEntry, 'uid'> & {
144
+ export declare type AccountEntryFixedPeriod = Omit<AccountEntry, "uid"> & {
140
145
  expiryDate: string;
141
146
  };
142
147
  export interface AccountStatement extends Period {
@@ -150,7 +155,7 @@ export interface AccountStatement extends Period {
150
155
  /** Remaining valid hours (accumulated from credits) */
151
156
  remainingHours: RemainingHours;
152
157
  }
153
- export declare type RemainingHours = number | 'unlimited';
158
+ export declare type RemainingHours = number | "unlimited";
154
159
  export interface CreditAlert {
155
160
  userId: string;
156
161
  remainingUsageHours: number;
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-protocol.d.ts","sourceRoot":"","sources":["../src/accounting-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMlC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ACf,mBAAmB,EAAE,MAAM,CAAC;CAC/B"}
@@ -2,114 +2,110 @@
2
2
  /**
3
3
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Subscription = exports.AssignedTeamSubscription = exports.UserPaidSubscription = exports.SessionDescription = exports.CreditDescription = exports.AccountEntry = void 0;
9
- var uuidv4 = require("uuid/v4");
10
- var timeutil_1 = require("./util/timeutil");
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
11
  var AccountEntry;
12
12
  (function (AccountEntry) {
13
13
  function create(entry) {
14
- var result = entry;
15
- result.uid = uuidv4();
14
+ const result = entry;
15
+ result.uid = (0, uuid_1.v4)();
16
16
  return result;
17
17
  }
18
18
  AccountEntry.create = create;
19
- ;
20
19
  })(AccountEntry = exports.AccountEntry || (exports.AccountEntry = {}));
21
20
  var CreditDescription;
22
21
  (function (CreditDescription) {
23
22
  function is(obj) {
24
- return !!obj
25
- && obj.hasOwnProperty('subscriptionId')
26
- && obj.hasOwnProperty('planId');
23
+ return !!obj && obj.hasOwnProperty("subscriptionId") && obj.hasOwnProperty("planId");
27
24
  }
28
25
  CreditDescription.is = is;
29
26
  })(CreditDescription = exports.CreditDescription || (exports.CreditDescription = {}));
30
27
  var SessionDescription;
31
28
  (function (SessionDescription) {
32
29
  function is(obj) {
33
- return !!obj
34
- && obj.hasOwnProperty('contextTitle')
35
- && obj.hasOwnProperty('contextUrl')
36
- && obj.hasOwnProperty('workspaceId')
37
- && obj.hasOwnProperty('workspaceInstanceId')
38
- && obj.hasOwnProperty('private');
30
+ return (!!obj &&
31
+ obj.hasOwnProperty("contextTitle") &&
32
+ obj.hasOwnProperty("contextUrl") &&
33
+ obj.hasOwnProperty("workspaceId") &&
34
+ obj.hasOwnProperty("workspaceInstanceId"));
39
35
  }
40
36
  SessionDescription.is = is;
41
37
  })(SessionDescription = exports.SessionDescription || (exports.SessionDescription = {}));
42
38
  var UserPaidSubscription;
43
39
  (function (UserPaidSubscription) {
44
40
  function is(data) {
45
- return !!data
46
- && data.hasOwnProperty('paymentReference');
41
+ return !!data && data.hasOwnProperty("paymentReference");
47
42
  }
48
43
  UserPaidSubscription.is = is;
49
44
  })(UserPaidSubscription = exports.UserPaidSubscription || (exports.UserPaidSubscription = {}));
50
45
  var AssignedTeamSubscription;
51
46
  (function (AssignedTeamSubscription) {
52
47
  function is(data) {
53
- return !!data
54
- && data.hasOwnProperty('teamSubscriptionSlotId');
48
+ return !!data && data.hasOwnProperty("teamSubscriptionSlotId");
55
49
  }
56
50
  AssignedTeamSubscription.is = is;
57
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 = {}));
58
59
  var Subscription;
59
60
  (function (Subscription) {
60
61
  function create(newSubscription) {
61
- var subscription = newSubscription;
62
- subscription.uid = uuidv4();
62
+ const subscription = newSubscription;
63
+ subscription.uid = (0, uuid_1.v4)();
63
64
  return subscription;
64
65
  }
65
66
  Subscription.create = create;
66
- ;
67
67
  function cancelSubscription(s, cancellationDate, endDate) {
68
68
  s.endDate = endDate || cancellationDate;
69
69
  s.cancellationDate = cancellationDate;
70
70
  }
71
71
  Subscription.cancelSubscription = cancelSubscription;
72
- ;
73
72
  function isSame(s1, s2) {
74
- return !!s1 && !!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 && !!s2.paymentData
84
- && s1.paymentData.downgradeDate === s2.paymentData.downgradeDate
85
- && s1.paymentData.newPlan === s2.paymentData.newPlan));
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)));
86
87
  }
87
88
  Subscription.isSame = isSame;
88
- ;
89
89
  function isActive(s, date) {
90
90
  return s.startDate <= date && (s.endDate === undefined || date < s.endDate);
91
91
  }
92
92
  Subscription.isActive = isActive;
93
- ;
93
+ function isCancelled(s, date) {
94
+ return (!!s.cancellationDate && s.cancellationDate < date) || (!!s.endDate && s.endDate < date); // This edge case is meant to handle bad data: If for whatever reason cancellationDate has not been set: treat endDate as such
95
+ }
96
+ Subscription.isCancelled = isCancelled;
94
97
  function isDowngraded(s) {
95
98
  return s.paymentData && s.paymentData.downgradeDate;
96
99
  }
97
100
  Subscription.isDowngraded = isDowngraded;
98
- ;
99
- function isCancelled(s) {
100
- return !!s.cancellationDate;
101
- }
102
- Subscription.isCancelled = isCancelled;
103
- ;
104
101
  function calculateCurrentPeriod(startDate, now) {
105
- var nextStartDate = startDate;
102
+ let nextStartDate = startDate;
106
103
  do {
107
104
  startDate = nextStartDate;
108
- nextStartDate = timeutil_1.oneMonthLater(startDate, new Date(startDate).getDate());
105
+ nextStartDate = (0, timeutil_1.oneMonthLater)(startDate, new Date(startDate).getDate());
109
106
  } while (nextStartDate < now.toISOString());
110
- return { startDate: startDate, endDate: nextStartDate };
107
+ return { startDate, endDate: nextStartDate };
111
108
  }
112
109
  Subscription.calculateCurrentPeriod = calculateCurrentPeriod;
113
- ;
114
110
  })(Subscription = exports.Subscription || (exports.Subscription = {}));
115
111
  //# sourceMappingURL=accounting-protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-protocol.js","sourceRoot":"","sources":["../src/accounting-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEF,gCAAkC;AAGnC,4CAAgD;AAuChD,IAAiB,YAAY,CAM5B;AAND,WAAiB,YAAY;IACzB,SAAgB,MAAM,CAAyB,KAAwB;QACnE,IAAM,MAAM,GAAG,KAAU,CAAC;QAC1B,MAAM,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAClB,CAAC;IAJe,mBAAM,SAIrB,CAAA;IAAA,CAAC;AACN,CAAC,EANgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAM5B;AA2BD,IAAiB,iBAAiB,CAMjC;AAND,WAAiB,iBAAiB;IAC9B,SAAgB,EAAE,CAAC,GAAQ;QACvB,OAAO,CAAC,CAAC,GAAG;eACL,GAAG,CAAC,cAAc,CAAC,gBAAgB,CAAC;eACpC,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAJe,oBAAE,KAIjB,CAAA;AACL,CAAC,EANgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAMjC;AAQD,IAAiB,kBAAkB,CASlC;AATD,WAAiB,kBAAkB;IAC/B,SAAgB,EAAE,CAAC,GAAQ;QACvB,OAAO,CAAC,CAAC,GAAG;eACL,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC;eAClC,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 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  import { User, Workspace, NamedWorkspaceFeatureFlag } from "./protocol";
7
- import { Without } from "./util/without";
7
+ import { BlockedRepository } from "./blocked-repositories-protocol";
8
+ import { FindPrebuildsParams } from "./gitpod-service";
9
+ import { Project, Team, PrebuildWithStatus, TeamMemberInfo, TeamMemberRole } from "./teams-projects-protocol";
8
10
  import { WorkspaceInstance, WorkspaceInstancePhase } from "./workspace-instance";
9
11
  import { RoleOrPermission } from "./permission";
10
12
  import { AccountStatement } from "./accounting-protocol";
13
+ import { BillingMode } from "./billing-mode";
14
+ import { CostCenterJSON, ListUsageRequest, ListUsageResponse } from "./usage";
15
+ import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
11
16
  export interface AdminServer {
12
17
  adminGetUsers(req: AdminGetListRequest<User>): Promise<AdminGetListResult<User>>;
13
18
  adminGetUser(id: string): Promise<User>;
14
19
  adminBlockUser(req: AdminBlockUserRequest): Promise<User>;
15
20
  adminDeleteUser(id: string): Promise<void>;
21
+ adminVerifyUser(id: string): Promise<User>;
16
22
  adminModifyRoleOrPermission(req: AdminModifyRoleOrPermissionRequest): Promise<User>;
17
23
  adminModifyPermanentWorkspaceFeatureFlag(req: AdminModifyPermanentWorkspaceFeatureFlagRequest): Promise<User>;
24
+ adminCreateBlockedRepository(urlRegexp: string, blockUser: boolean): Promise<BlockedRepository>;
25
+ adminDeleteBlockedRepository(id: number): Promise<void>;
26
+ adminGetBlockedRepositories(req: AdminGetListRequest<BlockedRepository>): Promise<AdminGetListResult<BlockedRepository>>;
27
+ adminGetTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
28
+ adminGetTeams(req: AdminGetListRequest<Team>): Promise<AdminGetListResult<Team>>;
29
+ adminGetTeamById(id: string): Promise<Team | undefined>;
30
+ adminSetTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
18
31
  adminGetWorkspaces(req: AdminGetWorkspacesRequest): Promise<AdminGetListResult<WorkspaceAndInstance>>;
19
32
  adminGetWorkspace(id: string): Promise<WorkspaceAndInstance>;
20
33
  adminForceStopWorkspace(id: string): Promise<void>;
34
+ adminRestoreSoftDeletedWorkspace(id: string): Promise<void>;
35
+ adminGetProjectsBySearchTerm(req: AdminGetListRequest<Project>): Promise<AdminGetListResult<Project>>;
36
+ adminGetProjectById(id: string): Promise<Project | undefined>;
37
+ adminFindPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
21
38
  adminSetLicense(key: string): Promise<void>;
22
39
  adminGetAccountStatement(userId: string): Promise<AccountStatement>;
23
40
  adminSetProfessionalOpenSource(userId: string, shouldGetProfOSS: boolean): Promise<void>;
24
41
  adminIsStudent(userId: string): Promise<boolean>;
25
42
  adminAddStudentEmailDomain(userId: string, domain: string): Promise<void>;
43
+ adminGrantExtraHours(userId: string, extraHours: number): Promise<void>;
44
+ adminGetBillingMode(attributionId: string): Promise<BillingMode>;
45
+ adminGetSettings(): Promise<InstallationAdminSettings>;
46
+ adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
47
+ adminGetCostCenter(attributionId: string): Promise<CostCenterJSON | undefined>;
48
+ adminSetUsageLimit(attributionId: string, usageLimit: number): Promise<void>;
49
+ adminListUsage(req: ListUsageRequest): Promise<ListUsageResponse>;
50
+ adminAddUsageCreditNote(attributionId: string, credits: number, note: string): Promise<void>;
51
+ adminGetUsageBalance(attributionId: string): Promise<number>;
52
+ adminGetSettings(): Promise<InstallationAdminSettings>;
53
+ adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
54
+ adminGetTelemetryData(): Promise<TelemetryData>;
26
55
  }
27
56
  export interface AdminGetListRequest<T> {
28
57
  offset: number;
@@ -53,14 +82,24 @@ export interface AdminModifyPermanentWorkspaceFeatureFlagRequest {
53
82
  add: boolean;
54
83
  }[];
55
84
  }
56
- export interface WorkspaceAndInstance extends Without<Workspace, "id" | "creationTime">, Without<WorkspaceInstance, "id" | "creationTime"> {
85
+ export interface WorkspaceAndInstance extends Omit<Workspace, "id" | "creationTime">, Omit<WorkspaceInstance, "id" | "creationTime"> {
57
86
  workspaceId: string;
58
87
  workspaceCreationTime: string;
59
88
  instanceId: string;
60
89
  instanceCreationTime: string;
61
90
  phase: WorkspaceInstancePhase;
62
91
  }
63
- export interface AdminGetWorkspacesRequest extends AdminGetListRequest<WorkspaceAndInstance> {
64
- ownerId?: string;
92
+ export declare namespace WorkspaceAndInstance {
93
+ function toWorkspace(wai: WorkspaceAndInstance): Workspace;
94
+ function toInstance(wai: WorkspaceAndInstance): WorkspaceInstance | undefined;
65
95
  }
96
+ export declare type AdminGetWorkspacesRequest = AdminGetListRequest<WorkspaceAndInstance> & AdminGetWorkspacesQuery;
97
+ /** The fields are meant to be used either OR (not combined) */
98
+ export declare type AdminGetWorkspacesQuery = {
99
+ /** we use this field in case we have a UUIDv4 and don't know whether it's an (old) workspace or instance id */
100
+ instanceIdOrWorkspaceId?: string;
101
+ instanceId?: string;
102
+ workspaceId?: string;
103
+ ownerId?: string;
104
+ };
66
105
  //# sourceMappingURL=admin-protocol.d.ts.map