@gitpod/gitpod-protocol 0.1.5-private-repos-after-cancellation.0 → 0.1.5-protected-secrets.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (407) hide show
  1. package/data/gitpod-schema.json +145 -7
  2. package/lib/accounting-protocol.d.ts +18 -12
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +43 -42
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +28 -4
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +2 -13
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +12 -2
  11. package/lib/analytics.d.ts.map +1 -1
  12. package/lib/analytics.js.map +1 -1
  13. package/lib/attribution.d.ts +23 -0
  14. package/lib/attribution.d.ts.map +1 -0
  15. package/lib/attribution.js +50 -0
  16. package/lib/attribution.js.map +1 -0
  17. package/lib/auth.d.ts.map +1 -1
  18. package/lib/billing-mode.d.ts +43 -0
  19. package/lib/billing-mode.d.ts.map +1 -0
  20. package/lib/billing-mode.js +44 -0
  21. package/lib/billing-mode.js.map +1 -0
  22. package/lib/blocked-repositories-protocol.d.ts +13 -0
  23. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  24. package/lib/blocked-repositories-protocol.js +8 -0
  25. package/lib/blocked-repositories-protocol.js.map +1 -0
  26. package/lib/context-url.d.ts +18 -5
  27. package/lib/context-url.d.ts.map +1 -1
  28. package/lib/context-url.js +63 -10
  29. package/lib/context-url.js.map +1 -1
  30. package/lib/context-url.spec.d.ts +2 -0
  31. package/lib/context-url.spec.d.ts.map +1 -1
  32. package/lib/context-url.spec.js +81 -48
  33. package/lib/context-url.spec.js.map +1 -1
  34. package/lib/encryption/container-module.d.ts.map +1 -1
  35. package/lib/encryption/container-module.js +4 -4
  36. package/lib/encryption/container-module.js.map +1 -1
  37. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  38. package/lib/encryption/encryption-engine.js +25 -26
  39. package/lib/encryption/encryption-engine.js.map +1 -1
  40. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  41. package/lib/encryption/encryption-engine.spec.js +29 -37
  42. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  43. package/lib/encryption/encryption-service.d.ts.map +1 -1
  44. package/lib/encryption/encryption-service.js +30 -44
  45. package/lib/encryption/encryption-service.js.map +1 -1
  46. package/lib/encryption/key-provider.d.ts.map +1 -1
  47. package/lib/encryption/key-provider.js +31 -38
  48. package/lib/encryption/key-provider.js.map +1 -1
  49. package/lib/env.d.ts +0 -6
  50. package/lib/env.d.ts.map +1 -1
  51. package/lib/env.js +7 -27
  52. package/lib/env.js.map +1 -1
  53. package/lib/experiments/always-default.d.ts +8 -0
  54. package/lib/experiments/always-default.d.ts.map +1 -0
  55. package/lib/experiments/always-default.js +20 -0
  56. package/lib/experiments/always-default.js.map +1 -0
  57. package/lib/experiments/configcat-server.d.ts +10 -0
  58. package/lib/experiments/configcat-server.d.ts.map +1 -0
  59. package/lib/experiments/configcat-server.js +36 -0
  60. package/lib/experiments/configcat-server.js.map +1 -0
  61. package/lib/experiments/configcat.d.ts +21 -0
  62. package/lib/experiments/configcat.d.ts.map +1 -0
  63. package/lib/experiments/configcat.js +51 -0
  64. package/lib/experiments/configcat.js.map +1 -0
  65. package/lib/experiments/types.d.ts +22 -0
  66. package/lib/experiments/types.d.ts.map +1 -0
  67. package/lib/experiments/types.js +10 -0
  68. package/lib/experiments/types.js.map +1 -0
  69. package/lib/gitpod-file-parser.d.ts.map +1 -1
  70. package/lib/gitpod-file-parser.js +26 -42
  71. package/lib/gitpod-file-parser.js.map +1 -1
  72. package/lib/gitpod-file-parser.spec.js +145 -142
  73. package/lib/gitpod-file-parser.spec.js.map +1 -1
  74. package/lib/gitpod-service.d.ts +127 -52
  75. package/lib/gitpod-service.d.ts.map +1 -1
  76. package/lib/gitpod-service.js +190 -315
  77. package/lib/gitpod-service.js.map +1 -1
  78. package/lib/headless-workspace-log.d.ts +3 -13
  79. package/lib/headless-workspace-log.d.ts.map +1 -1
  80. package/lib/headless-workspace-log.js +3 -8
  81. package/lib/headless-workspace-log.js.map +1 -1
  82. package/lib/ide-frontend-service.d.ts +1 -1
  83. package/lib/ide-protocol.d.ts +113 -0
  84. package/lib/ide-protocol.d.ts.map +1 -0
  85. package/lib/{util/without.js → ide-protocol.js} +2 -2
  86. package/lib/ide-protocol.js.map +1 -0
  87. package/lib/index.d.ts +16 -12
  88. package/lib/index.d.ts.map +1 -1
  89. package/lib/index.js +5 -1
  90. package/lib/index.js.map +1 -1
  91. package/lib/installation-admin-protocol.d.ts +30 -0
  92. package/lib/installation-admin-protocol.d.ts.map +1 -0
  93. package/lib/installation-admin-protocol.js +31 -0
  94. package/lib/installation-admin-protocol.js.map +1 -0
  95. package/lib/license-protocol.d.ts +7 -0
  96. package/lib/license-protocol.d.ts.map +1 -1
  97. package/lib/license-protocol.js.map +1 -1
  98. package/lib/messaging/browser/connection.d.ts +3 -3
  99. package/lib/messaging/browser/connection.d.ts.map +1 -1
  100. package/lib/messaging/browser/connection.js +173 -36
  101. package/lib/messaging/browser/connection.js.map +1 -1
  102. package/lib/messaging/browser/window-connection.d.ts +4 -4
  103. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  104. package/lib/messaging/browser/window-connection.js +42 -59
  105. package/lib/messaging/browser/window-connection.js.map +1 -1
  106. package/lib/messaging/client-call-metrics.d.ts +19 -0
  107. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  108. package/lib/messaging/client-call-metrics.js +82 -0
  109. package/lib/messaging/client-call-metrics.js.map +1 -0
  110. package/lib/messaging/error.d.ts +10 -2
  111. package/lib/messaging/error.d.ts.map +1 -1
  112. package/lib/messaging/error.js +20 -4
  113. package/lib/messaging/error.js.map +1 -1
  114. package/lib/messaging/handler.d.ts +10 -0
  115. package/lib/messaging/handler.d.ts.map +1 -1
  116. package/lib/messaging/handler.js +1 -1
  117. package/lib/messaging/node/connection.d.ts +1 -17
  118. package/lib/messaging/node/connection.d.ts.map +1 -1
  119. package/lib/messaging/node/connection.js +24 -60
  120. package/lib/messaging/node/connection.js.map +1 -1
  121. package/lib/messaging/proxy-factory.d.ts +3 -1
  122. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  123. package/lib/messaging/proxy-factory.js +75 -162
  124. package/lib/messaging/proxy-factory.js.map +1 -1
  125. package/lib/oss-allowlist.d.ts +14 -0
  126. package/lib/oss-allowlist.d.ts.map +1 -0
  127. package/lib/oss-allowlist.js +8 -0
  128. package/lib/oss-allowlist.js.map +1 -0
  129. package/lib/payment-protocol.d.ts.map +1 -1
  130. package/lib/payment-protocol.js +1 -1
  131. package/lib/payment-protocol.js.map +1 -1
  132. package/lib/permission.d.ts +9 -4
  133. package/lib/permission.d.ts.map +1 -1
  134. package/lib/permission.js +39 -31
  135. package/lib/permission.js.map +1 -1
  136. package/lib/plans.d.ts +5 -4
  137. package/lib/plans.d.ts.map +1 -1
  138. package/lib/plans.js +229 -209
  139. package/lib/plans.js.map +1 -1
  140. package/lib/protocol.d.ts +234 -143
  141. package/lib/protocol.d.ts.map +1 -1
  142. package/lib/protocol.js +339 -193
  143. package/lib/protocol.js.map +1 -1
  144. package/{src/util/without.ts → lib/protocol.spec.d.ts} +2 -3
  145. package/lib/protocol.spec.d.ts.map +1 -0
  146. package/lib/protocol.spec.js +127 -0
  147. package/lib/protocol.spec.js.map +1 -0
  148. package/lib/snapshot-url.d.ts +14 -0
  149. package/lib/snapshot-url.d.ts.map +1 -0
  150. package/lib/snapshot-url.js +26 -0
  151. package/lib/snapshot-url.js.map +1 -0
  152. package/{src/theia-plugins.ts → lib/snapshot-url.spec.d.ts} +2 -6
  153. package/lib/snapshot-url.spec.d.ts.map +1 -0
  154. package/lib/snapshot-url.spec.js +41 -0
  155. package/lib/snapshot-url.spec.js.map +1 -0
  156. package/lib/team-subscription-protocol.d.ts +22 -4
  157. package/lib/team-subscription-protocol.d.ts.map +1 -1
  158. package/lib/team-subscription-protocol.js +33 -18
  159. package/lib/team-subscription-protocol.js.map +1 -1
  160. package/lib/teams-projects-protocol.d.ts +130 -0
  161. package/lib/teams-projects-protocol.d.ts.map +1 -0
  162. package/lib/teams-projects-protocol.js +30 -0
  163. package/lib/teams-projects-protocol.js.map +1 -0
  164. package/lib/typings/globals.d.ts +2 -2
  165. package/lib/typings/globals.d.ts.map +1 -1
  166. package/lib/usage.d.ts +61 -0
  167. package/lib/usage.d.ts.map +1 -0
  168. package/lib/usage.js +14 -0
  169. package/lib/usage.js.map +1 -0
  170. package/lib/util/analytics.d.ts.map +1 -1
  171. package/lib/util/analytics.js +44 -26
  172. package/lib/util/analytics.js.map +1 -1
  173. package/lib/util/async-iterator.d.ts.map +1 -1
  174. package/lib/util/async-iterator.js +57 -135
  175. package/lib/util/async-iterator.js.map +1 -1
  176. package/lib/util/cancelable.js +17 -59
  177. package/lib/util/cancelable.js.map +1 -1
  178. package/lib/util/date-time.js +11 -11
  179. package/lib/util/date-time.js.map +1 -1
  180. package/lib/util/debug-app.d.ts +25 -0
  181. package/lib/util/debug-app.d.ts.map +1 -0
  182. package/lib/util/debug-app.js +100 -0
  183. package/lib/util/debug-app.js.map +1 -0
  184. package/lib/util/deferred.js +10 -12
  185. package/lib/util/deferred.js.map +1 -1
  186. package/lib/util/disposable.d.ts.map +1 -1
  187. package/lib/util/disposable.js +27 -40
  188. package/lib/util/disposable.js.map +1 -1
  189. package/lib/util/event.d.ts.map +1 -1
  190. package/lib/util/event.js +63 -77
  191. package/lib/util/event.js.map +1 -1
  192. package/lib/util/garbage-collected-cache.d.ts +1 -0
  193. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  194. package/lib/util/garbage-collected-cache.js +32 -47
  195. package/lib/util/garbage-collected-cache.js.map +1 -1
  196. package/lib/util/generate-workspace-id.d.ts +6 -1
  197. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  198. package/lib/util/generate-workspace-id.js +469 -504
  199. package/lib/util/generate-workspace-id.js.map +1 -1
  200. package/lib/util/generate-workspace-id.spec.js +68 -78
  201. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  202. package/lib/util/gitpod-cookie.d.ts +20 -0
  203. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  204. package/lib/util/gitpod-cookie.js +41 -0
  205. package/lib/util/gitpod-cookie.js.map +1 -0
  206. package/lib/util/gitpod-host-url.d.ts +4 -1
  207. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  208. package/lib/util/gitpod-host-url.js +124 -114
  209. package/lib/util/gitpod-host-url.js.map +1 -1
  210. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  211. package/lib/util/gitpod-host-url.spec.js +97 -135
  212. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  213. package/lib/util/grpc.d.ts +34 -0
  214. package/lib/util/grpc.d.ts.map +1 -0
  215. package/lib/util/grpc.js +90 -0
  216. package/lib/util/grpc.js.map +1 -0
  217. package/lib/util/jaeger-client-types.d.ts +68 -0
  218. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  219. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
  220. package/lib/util/jaeger-client-types.js.map +1 -0
  221. package/lib/util/logging.d.ts +49 -33
  222. package/lib/util/logging.d.ts.map +1 -1
  223. package/lib/util/logging.js +132 -129
  224. package/lib/util/logging.js.map +1 -1
  225. package/lib/util/logging.spec.d.ts +7 -0
  226. package/lib/util/logging.spec.d.ts.map +1 -0
  227. package/lib/util/logging.spec.js +52 -0
  228. package/lib/util/logging.spec.js.map +1 -0
  229. package/lib/util/make-link.js +5 -5
  230. package/lib/util/make-link.js.map +1 -1
  231. package/lib/util/nice-grpc.d.ts +9 -0
  232. package/lib/util/nice-grpc.d.ts.map +1 -0
  233. package/lib/util/nice-grpc.js +119 -0
  234. package/lib/util/nice-grpc.js.map +1 -0
  235. package/lib/util/parse-workspace-id.d.ts +10 -0
  236. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  237. package/lib/util/parse-workspace-id.js +30 -7
  238. package/lib/util/parse-workspace-id.js.map +1 -1
  239. package/lib/util/parse-workspace-id.spec.d.ts +4 -0
  240. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  241. package/lib/util/parse-workspace-id.spec.js +123 -84
  242. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  243. package/lib/util/queue.js +16 -55
  244. package/lib/util/queue.js.map +1 -1
  245. package/lib/util/queue.spec.js +147 -288
  246. package/lib/util/queue.spec.js.map +1 -1
  247. package/lib/util/repeat.d.ts +15 -0
  248. package/lib/util/repeat.d.ts.map +1 -0
  249. package/lib/util/repeat.js +55 -0
  250. package/lib/util/repeat.js.map +1 -0
  251. package/lib/util/semaphore.d.ts.map +1 -1
  252. package/lib/util/semaphore.js +15 -46
  253. package/lib/util/semaphore.js.map +1 -1
  254. package/lib/util/skip-if.d.ts.map +1 -1
  255. package/lib/util/skip-if.js +6 -6
  256. package/lib/util/skip-if.js.map +1 -1
  257. package/lib/util/timeutil.d.ts +2 -0
  258. package/lib/util/timeutil.d.ts.map +1 -1
  259. package/lib/util/timeutil.js +29 -17
  260. package/lib/util/timeutil.js.map +1 -1
  261. package/lib/util/timeutil.spec.d.ts +2 -0
  262. package/lib/util/timeutil.spec.d.ts.map +1 -1
  263. package/lib/util/timeutil.spec.js +54 -23
  264. package/lib/util/timeutil.spec.js.map +1 -1
  265. package/lib/util/tracing.d.ts +52 -6
  266. package/lib/util/tracing.d.ts.map +1 -1
  267. package/lib/util/tracing.js +197 -64
  268. package/lib/util/tracing.js.map +1 -1
  269. package/lib/util/tracing.spec.d.ts +7 -0
  270. package/lib/util/tracing.spec.d.ts.map +1 -0
  271. package/lib/util/tracing.spec.js +121 -0
  272. package/lib/util/tracing.spec.js.map +1 -0
  273. package/lib/util/workspace-port-authentication.d.ts +7 -7
  274. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  275. package/lib/util/workspace-port-authentication.js +9 -12
  276. package/lib/util/workspace-port-authentication.js.map +1 -1
  277. package/lib/webhook-event.d.ts +44 -0
  278. package/lib/webhook-event.d.ts.map +1 -0
  279. package/lib/webhook-event.js +8 -0
  280. package/lib/webhook-event.js.map +1 -0
  281. package/lib/workspace-class.d.ts +14 -0
  282. package/lib/workspace-class.d.ts.map +1 -0
  283. package/lib/workspace-class.js +8 -0
  284. package/lib/workspace-class.js.map +1 -0
  285. package/lib/workspace-cluster.d.ts +15 -5
  286. package/lib/workspace-cluster.d.ts.map +1 -1
  287. package/lib/workspace-cluster.js +19 -4
  288. package/lib/workspace-cluster.js.map +1 -1
  289. package/lib/workspace-instance.d.ts +44 -5
  290. package/lib/workspace-instance.d.ts.map +1 -1
  291. package/lib/wsready.d.ts +1 -1
  292. package/lib/wsready.d.ts.map +1 -1
  293. package/lib/wsready.js +2 -2
  294. package/package.json +34 -15
  295. package/pkg-yarn.lock +21 -9
  296. package/provenance-bundle.jsonl +2 -0
  297. package/src/accounting-protocol.ts +66 -54
  298. package/src/admin-protocol.ts +53 -21
  299. package/src/analytics.ts +28 -16
  300. package/src/attribution.ts +59 -0
  301. package/src/auth.ts +2 -2
  302. package/src/billing-mode.ts +81 -0
  303. package/src/blocked-repositories-protocol.ts +13 -0
  304. package/src/context-url.spec.ts +37 -9
  305. package/src/context-url.ts +94 -36
  306. package/src/encryption/container-module.ts +2 -3
  307. package/src/encryption/encryption-engine.spec.ts +9 -8
  308. package/src/encryption/encryption-engine.ts +20 -16
  309. package/src/encryption/encryption-service.ts +4 -5
  310. package/src/encryption/key-provider.ts +16 -19
  311. package/src/env.ts +0 -22
  312. package/src/experiments/always-default.ts +24 -0
  313. package/src/experiments/configcat-server.ts +41 -0
  314. package/src/experiments/configcat.ts +56 -0
  315. package/src/experiments/types.ts +34 -0
  316. package/src/gitpod-file-parser.spec.ts +55 -61
  317. package/src/gitpod-file-parser.ts +16 -17
  318. package/src/gitpod-service.ts +286 -143
  319. package/src/headless-workspace-log.ts +8 -19
  320. package/src/ide-frontend-service.ts +2 -2
  321. package/src/ide-protocol.ts +129 -0
  322. package/src/index.ts +16 -12
  323. package/src/installation-admin-protocol.ts +45 -0
  324. package/src/license-protocol.ts +12 -6
  325. package/src/messaging/browser/connection.ts +185 -21
  326. package/src/messaging/browser/window-connection.ts +39 -29
  327. package/src/messaging/client-call-metrics.ts +77 -0
  328. package/src/messaging/error.ts +29 -7
  329. package/src/messaging/handler.ts +13 -1
  330. package/src/messaging/node/connection.ts +23 -70
  331. package/src/messaging/proxy-factory.ts +35 -34
  332. package/src/oss-allowlist.ts +15 -0
  333. package/src/payment-protocol.ts +2 -2
  334. package/src/permission.ts +40 -33
  335. package/src/plans.ts +240 -189
  336. package/src/protocol.spec.ts +97 -0
  337. package/src/protocol.ts +612 -340
  338. package/src/snapshot-url.spec.ts +27 -0
  339. package/src/snapshot-url.ts +27 -0
  340. package/src/team-subscription-protocol.ts +59 -23
  341. package/src/teams-projects-protocol.ts +166 -0
  342. package/src/typings/globals.ts +4 -4
  343. package/src/usage.ts +71 -0
  344. package/src/util/analytics.ts +56 -18
  345. package/src/util/async-iterator.ts +4 -5
  346. package/src/util/cancelable.ts +3 -3
  347. package/src/util/date-time.ts +8 -8
  348. package/src/util/debug-app.ts +81 -0
  349. package/src/util/deferred.ts +6 -6
  350. package/src/util/disposable.ts +3 -6
  351. package/src/util/event.ts +9 -11
  352. package/src/util/garbage-collected-cache.ts +14 -6
  353. package/src/util/generate-workspace-id.spec.ts +34 -7
  354. package/src/util/generate-workspace-id.ts +464 -440
  355. package/src/util/gitpod-cookie.ts +38 -0
  356. package/src/util/gitpod-host-url.spec.ts +40 -13
  357. package/src/util/gitpod-host-url.ts +61 -37
  358. package/src/util/grpc.ts +104 -0
  359. package/src/util/jaeger-client-types.ts +102 -0
  360. package/src/util/logging.spec.ts +23 -0
  361. package/src/util/logging.ts +156 -74
  362. package/src/util/make-link.ts +6 -7
  363. package/src/util/nice-grpc.ts +93 -0
  364. package/src/util/parse-workspace-id.spec.ts +37 -8
  365. package/src/util/parse-workspace-id.ts +32 -7
  366. package/src/util/queue.spec.ts +27 -25
  367. package/src/util/repeat.ts +45 -0
  368. package/src/util/semaphore.ts +4 -6
  369. package/src/util/skip-if.ts +9 -6
  370. package/src/util/timeutil.spec.ts +40 -14
  371. package/src/util/timeutil.ts +27 -11
  372. package/src/util/tracing.spec.ts +88 -0
  373. package/src/util/tracing.ts +200 -31
  374. package/src/util/workspace-port-authentication.ts +10 -13
  375. package/src/webhook-event.ts +55 -0
  376. package/src/workspace-class.ts +14 -0
  377. package/src/workspace-cluster.ts +29 -10
  378. package/src/workspace-instance.ts +89 -24
  379. package/src/wsready.ts +3 -3
  380. package/data/builtin-theia-plugins.json +0 -372
  381. package/lib/email-protocol.d.ts +0 -50
  382. package/lib/email-protocol.d.ts.map +0 -1
  383. package/lib/email-protocol.js +0 -28
  384. package/lib/email-protocol.js.map +0 -1
  385. package/lib/messaging/connection-error-handler.d.ts +0 -27
  386. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  387. package/lib/messaging/connection-error-handler.js +0 -46
  388. package/lib/messaging/connection-error-handler.js.map +0 -1
  389. package/lib/theia-plugins.d.ts +0 -11
  390. package/lib/theia-plugins.d.ts.map +0 -1
  391. package/lib/theia-plugins.js.map +0 -1
  392. package/lib/util/repeater.d.ts +0 -22
  393. package/lib/util/repeater.d.ts.map +0 -1
  394. package/lib/util/repeater.js +0 -118
  395. package/lib/util/repeater.js.map +0 -1
  396. package/lib/util/safe-promise.d.ts +0 -11
  397. package/lib/util/safe-promise.d.ts.map +0 -1
  398. package/lib/util/safe-promise.js +0 -34
  399. package/lib/util/safe-promise.js.map +0 -1
  400. package/lib/util/without.d.ts +0 -7
  401. package/lib/util/without.d.ts.map +0 -1
  402. package/lib/util/without.js.map +0 -1
  403. package/src/email-protocol.ts +0 -67
  404. package/src/messaging/connection-error-handler.ts +0 -62
  405. package/src/util/jaeger-client.d.ts +0 -105
  406. package/src/util/repeater.ts +0 -49
  407. package/src/util/safe-promise.ts +0 -26
@@ -1,118 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) 2020 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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
8
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
13
- step((generator = generator.apply(thisArg, _arguments || [])).next());
14
- });
15
- };
16
- var __generator = (this && this.__generator) || function (thisArg, body) {
17
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
18
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19
- function verb(n) { return function (v) { return step([n, v]); }; }
20
- function step(op) {
21
- if (f) throw new TypeError("Generator is already executing.");
22
- while (_) try {
23
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
24
- if (y = 0, t) op = [op[0] & 2, t.value];
25
- switch (op[0]) {
26
- case 0: case 1: t = op; break;
27
- case 4: _.label++; return { value: op[1], done: false };
28
- case 5: _.label++; y = op[1]; op = [0]; continue;
29
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
30
- default:
31
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
34
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
35
- if (t[2]) _.ops.pop();
36
- _.trys.pop(); continue;
37
- }
38
- op = body.call(thisArg, _);
39
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
40
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
41
- }
42
- };
43
- Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.Repeater = void 0;
45
- var deferred_1 = require("./deferred");
46
- var logging_1 = require("./logging");
47
- /**
48
- * Repeats a given function until it is stopped
49
- */
50
- var Repeater = /** @class */ (function () {
51
- function Repeater(fn, timeout) {
52
- this.fn = fn;
53
- this.timeout = timeout;
54
- }
55
- Repeater.prototype.start = function () {
56
- return __awaiter(this, void 0, void 0, function () {
57
- return __generator(this, function (_a) {
58
- this.run();
59
- return [2 /*return*/];
60
- });
61
- });
62
- };
63
- Repeater.prototype.run = function () {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var err_1;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- this.shouldRun = true;
70
- this.finished = new deferred_1.Deferred();
71
- _a.label = 1;
72
- case 1:
73
- if (!this.shouldRun) return [3 /*break*/, 7];
74
- _a.label = 2;
75
- case 2:
76
- _a.trys.push([2, 4, , 5]);
77
- return [4 /*yield*/, this.fn()];
78
- case 3:
79
- _a.sent();
80
- return [3 /*break*/, 5];
81
- case 4:
82
- err_1 = _a.sent();
83
- logging_1.log.error(err_1);
84
- return [3 /*break*/, 5];
85
- case 5: return [4 /*yield*/, this.sleep(this.timeout)];
86
- case 6:
87
- _a.sent();
88
- return [3 /*break*/, 1];
89
- case 7:
90
- this.finished.resolve();
91
- return [2 /*return*/];
92
- }
93
- });
94
- });
95
- };
96
- Repeater.prototype.sleep = function (timeout) {
97
- return __awaiter(this, void 0, void 0, function () {
98
- var _this = this;
99
- return __generator(this, function (_a) {
100
- return [2 /*return*/, new Promise(function (resolve) { return _this.timer = setTimeout(resolve, timeout); })];
101
- });
102
- });
103
- };
104
- Repeater.prototype.stop = function () {
105
- return __awaiter(this, void 0, void 0, function () {
106
- return __generator(this, function (_a) {
107
- this.shouldRun = false;
108
- if (this.timer) {
109
- clearTimeout(this.timer);
110
- }
111
- return [2 /*return*/, this.finished.promise];
112
- });
113
- });
114
- };
115
- return Repeater;
116
- }());
117
- exports.Repeater = Repeater;
118
- //# sourceMappingURL=repeater.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"repeater.js","sourceRoot":"","sources":["../../src/util/repeater.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAsC;AACtC,qCAAgC;AAEhC;;GAEG;AACH;IAKI,kBAA+B,EAA8B,EAAqB,OAAe;QAAlE,OAAE,GAAF,EAAE,CAA4B;QAAqB,YAAO,GAAP,OAAO,CAAQ;IAAI,CAAC;IAEhG,wBAAK,GAAX;;;gBACI,IAAI,CAAC,GAAG,EAAE,CAAC;;;;KACd;IAEK,sBAAG,GAAT;;;;;;wBACI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;wBACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,EAAQ,CAAC;;;6BAC9B,IAAI,CAAC,SAAS;;;;wBAEb,qBAAM,IAAI,CAAC,EAAE,EAAE,EAAA;;wBAAf,SAAe,CAAC;;;;wBAEhB,aAAG,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;;4BAEnB,qBAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAA;;wBAA9B,SAA8B,CAAC;;;wBAEnC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;;;;;KAC3B;IAEe,wBAAK,GAArB,UAAsB,OAAe;;;;gBACjC,sBAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,KAAI,CAAC,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EAAzC,CAAyC,CAAC,EAAC;;;KAC5E;IAEK,uBAAI,GAAV;;;gBACI,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;gBACvB,IAAI,IAAI,CAAC,KAAK,EAAE;oBACZ,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC5B;gBACD,sBAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAC;;;KAChC;IACL,eAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,4BAAQ"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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 { LogContext } from './logging';
7
- export declare class SafePromise {
8
- static catchAndLog<T>(p: Promise<T>, logCtx?: LogContext): Promise<T>;
9
- static catch<T>(p: Promise<T>, handler: (err: any) => void): Promise<T>;
10
- }
11
- //# sourceMappingURL=safe-promise.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"safe-promise.d.ts","sourceRoot":"","sources":["../../src/util/safe-promise.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAO,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,WAAW;WACN,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU;WASjD,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;CAMjF"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) 2020 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.SafePromise = void 0;
9
- var logging_1 = require("./logging");
10
- var SafePromise = /** @class */ (function () {
11
- function SafePromise() {
12
- }
13
- SafePromise.catchAndLog = function (p, logCtx) {
14
- return SafePromise.catch(p, function (err) {
15
- if (logCtx) {
16
- logging_1.log.error(logCtx, err);
17
- }
18
- else {
19
- logging_1.log.error(err);
20
- }
21
- });
22
- };
23
- ;
24
- SafePromise.catch = function (p, handler) {
25
- return p.catch(function (err) {
26
- handler(err);
27
- return {}; // Nobody will ever see this value as the Promise already failed. It's just there to please the compiler
28
- });
29
- };
30
- ;
31
- return SafePromise;
32
- }());
33
- exports.SafePromise = SafePromise;
34
- //# sourceMappingURL=safe-promise.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"safe-promise.js","sourceRoot":"","sources":["../../src/util/safe-promise.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,qCAA4C;AAE5C;IAAA;IAgBA,CAAC;IAfiB,uBAAW,GAAzB,UAA6B,CAAa,EAAE,MAAmB;QAC3D,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,UAAC,GAAG;YAC5B,IAAI,MAAM,EAAE;gBACR,aAAG,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;aAC1B;iBAAM;gBACH,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAClB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAAA,CAAC;IACY,iBAAK,GAAnB,UAAuB,CAAa,EAAE,OAA2B;QAC7D,OAAO,CAAC,CAAC,KAAK,CAAC,UAAC,GAAG;YACf,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,EAAO,CAAC,CAAC,wGAAwG;QAC5H,CAAC,CAAC,CAAC;IACP,CAAC;IAAA,CAAC;IACN,kBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,kCAAW"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
- export declare type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
7
- //# sourceMappingURL=without.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"without.d.ts","sourceRoot":"","sources":["../../src/util/without.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,oBAAY,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"without.js","sourceRoot":"","sources":["../../src/util/without.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -1,67 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
-
7
- import { Without } from "./util/without";
8
- import uuidv4 = require("uuid/v4");
9
-
10
- export type EMailState = "scheduledInternal"
11
- | "scheduledSendgrid";
12
-
13
- export interface EMailStatus {
14
- /** The time the email entry was inserted into the DB */
15
- scheduledInternalTime: string;
16
- /** The time the email state transitioned to "scheduledSendgrid" */
17
- scheduledSendgridTime?: string;
18
- /** In case of any errors during sending with Sendgrid it gets noted here */
19
- error?: string;
20
- }
21
- export namespace EMailStatus {
22
- export function getState(status: EMailStatus): EMailState {
23
- if (status.scheduledSendgridTime) {
24
- return "scheduledSendgrid";
25
- }
26
- return "scheduledInternal";
27
- }
28
- }
29
-
30
- export interface EmailAddress {
31
- name?: string;
32
- email: string;
33
- }
34
-
35
- export interface EMailParameters {
36
- /** undefined means default from template */
37
- subject?: string;
38
- /** The sender address */
39
- senderAddress: string | EmailAddress;
40
- /** The replyTo address */
41
- replyToAddress?: string | EmailAddress;
42
- /** The SendGrid template id */
43
- templateId: string;
44
- /** The parameters for the SendGrid template */
45
- templateParams: {};
46
- }
47
-
48
- export type EMail = {
49
- /** The unique id of this email (uuid/v4 for now) */
50
- uid: string;
51
- /** The id of the user this email was sent to */
52
- userId: string;
53
- /** The address this email was sent to */
54
- recipientAddress: string;
55
- /** Which campaign scheduled this email */
56
- campaignId: string;
57
- /** The parameters this email was sent with (template id, template params, etc) */
58
- params: EMailParameters;
59
- } & EMailStatus;
60
-
61
- export namespace EMail {
62
- export const create = (ts: Without<EMail, 'uid'>): EMail => {
63
- const withId = ts as EMail;
64
- withId.uid = uuidv4();
65
- return withId;
66
- }
67
- }
@@ -1,62 +0,0 @@
1
- /*
2
- * Copyright (C) 2017 TypeFox and others.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- */
7
-
8
- import { Message } from "vscode-jsonrpc";
9
- import { log } from '../util/logging';
10
-
11
- export interface ResolvedConnectionErrorHandlerOptions {
12
- readonly serverName: string
13
- /**
14
- * The maximum amount of errors allowed before stopping the server.
15
- */
16
- readonly maxErrors: number
17
- /**
18
- * The maimum amount of restarts allowed in the restart interval.
19
- */
20
- readonly maxRestarts: number
21
- /**
22
- * In minutes.
23
- */
24
- readonly restartInterval: number
25
- }
26
-
27
- export type ConnectionErrorHandlerOptions = Partial<ResolvedConnectionErrorHandlerOptions> & {
28
- readonly serverName: string
29
- };
30
-
31
- export class ConnectionErrorHandler {
32
-
33
- protected readonly options: ResolvedConnectionErrorHandlerOptions;
34
- constructor(options: ConnectionErrorHandlerOptions) {
35
- this.options = {
36
- maxErrors: 3,
37
- maxRestarts: 5,
38
- restartInterval: 3,
39
- ...options
40
- };
41
- }
42
-
43
- shouldStop(error: Error, message?: Message, count?: number): boolean {
44
- return !count || count > this.options.maxErrors;
45
- }
46
-
47
- protected readonly restarts: number[] = [];
48
- shouldRestart(): boolean {
49
- this.restarts.push(Date.now());
50
- if (this.restarts.length <= this.options.maxRestarts) {
51
- return true;
52
- }
53
- const diff = this.restarts[this.restarts.length - 1] - this.restarts[0];
54
- if (diff <= this.options.restartInterval * 60 * 1000) {
55
- log.error(`Server ${this.options.serverName} crashed ${this.options.maxRestarts} times in the last ${this.options.restartInterval} minutes. Will not restart`);
56
- return false;
57
- }
58
- this.restarts.shift();
59
- return true;
60
- }
61
-
62
- }
@@ -1,105 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
-
7
- // Type definitions for jaeger-client
8
- // Project: https://github.com/uber/jaeger-client-node
9
- // Definitions by: Julian Steger <https://github.com/julianste>
10
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
11
-
12
- declare module 'jaeger-client' {
13
- import * as opentracing from "opentracing";
14
-
15
- export interface TracingConfig {
16
- serviceName?: string;
17
- disable?: boolean;
18
- sampler?: SamplerConfig;
19
- reporter?: ReporterConfig;
20
- }
21
-
22
- export interface TracingOptions {
23
- reporter?: Reporter;
24
- metrics?: MetricsFactory;
25
- logger?: Logger;
26
- tags?: any;
27
- }
28
-
29
- export interface ReporterConfig {
30
- logSpans?: boolean;
31
- agentHost?: string;
32
- agentPort?: number;
33
- flushIntervalMs?: number;
34
- }
35
-
36
- export interface SamplerConfig {
37
- type: string;
38
- param: number;
39
- host?: string;
40
- port?: number;
41
- refreshIntervalMs?: number;
42
- }
43
-
44
- export interface Logger {
45
- info(msg: string): void;
46
- error(msg: string): void;
47
- }
48
-
49
- export interface Reporter {
50
- report(span: opentracing.Span): void;
51
- close(callback?: () => void): void;
52
- setProcess(serviceName: string, tags: any): void;
53
- }
54
-
55
- export interface MetricsFactory {
56
- createCounter(name: string, tags: any): Counter;
57
- createTimer(name: string, tags: any): Timer;
58
- createGauge(name: string, tags: any): Gauge;
59
- }
60
-
61
- // Counter tracks the number of times an event has occurred
62
- export interface Counter {
63
- // Adds the given value to the counter.
64
- increment(delta: number): void;
65
- }
66
-
67
- // Timer tracks how long an operation took and also computes percentiles.
68
- export interface Timer {
69
- // Records the time passed in.
70
- record(value: number): void;
71
- }
72
-
73
- // Gauge returns instantaneous measurements of something as an int64 value
74
- export interface Gauge {
75
- // Update the gauge to the value passed in.
76
- update(value: number): void;
77
- }
78
-
79
- export function initTracer(
80
- tracingConfig: TracingConfig,
81
- tracingOptions: TracingOptions,
82
- ): opentracing.Tracer;
83
-
84
- export function initTracerFromEnv(
85
- tracingConfig: TracingConfig,
86
- tracingOptions: TracingOptions,
87
- ): opentracing.Tracer;
88
-
89
- export interface SamplingDecision {
90
- sample: boolean;
91
- retryable: boolean;
92
- tags: any;
93
- }
94
-
95
- // added by TypeFox
96
- export interface Sampler {
97
- name(): string
98
- isSampled(operation: string, tags: any): boolean;
99
- onCreateSpan(span: opentracing.Span): SamplingDecision;
100
- onSetOperationName(span: opentracing.Span, operationName: string): SamplingDecision;
101
- onSetTag(span: opentracing.Span, key: string, value: any): SamplingDecision;
102
- close(callback: () => void): void
103
- }
104
-
105
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
-
7
- import { Deferred } from "./deferred";
8
- import { log } from './logging';
9
-
10
- /**
11
- * Repeats a given function until it is stopped
12
- */
13
- export class Repeater {
14
- protected shouldRun: boolean;
15
- protected finished: Deferred<void>
16
- protected timer?: any;
17
-
18
- constructor(protected readonly fn: () => Promise<void> | void, protected readonly timeout: number) { }
19
-
20
- async start() {
21
- this.run();
22
- }
23
-
24
- async run() {
25
- this.shouldRun = true;
26
- this.finished = new Deferred<void>();
27
- while (this.shouldRun) {
28
- try {
29
- await this.fn();
30
- } catch (err) {
31
- log.error(err);
32
- }
33
- await this.sleep(this.timeout);
34
- }
35
- this.finished.resolve();
36
- }
37
-
38
- protected async sleep(timeout: number) {
39
- return new Promise(resolve => this.timer = setTimeout(resolve, timeout));
40
- }
41
-
42
- async stop() {
43
- this.shouldRun = false;
44
- if (this.timer) {
45
- clearTimeout(this.timer);
46
- }
47
- return this.finished.promise;
48
- }
49
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
-
7
-
8
- import { log, LogContext } from './logging';
9
-
10
- export class SafePromise {
11
- public static catchAndLog<T>(p: Promise<T>, logCtx?: LogContext) {
12
- return SafePromise.catch(p, (err) => {
13
- if (logCtx) {
14
- log.error(logCtx, err);
15
- } else {
16
- log.error(err);
17
- }
18
- });
19
- };
20
- public static catch<T>(p: Promise<T>, handler: (err: any) => void): Promise<T> {
21
- return p.catch((err) => {
22
- handler(err);
23
- return {} as T; // Nobody will ever see this value as the Promise already failed. It's just there to please the compiler
24
- });
25
- };
26
- }