@gitpod/gitpod-protocol 0.1.5-update-ovsx.0 → 0.1.5-update-yarnlock.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 (455) hide show
  1. package/data/gitpod-schema.json +159 -25
  2. package/lib/accounting-protocol.d.ts +165 -0
  3. package/lib/accounting-protocol.d.ts.map +1 -0
  4. package/lib/accounting-protocol.js +120 -0
  5. package/lib/accounting-protocol.js.map +1 -0
  6. package/lib/admin-protocol.d.ts +51 -6
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +17 -2
  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 +25 -0
  15. package/lib/attribution.d.ts.map +1 -0
  16. package/lib/attribution.js +58 -0
  17. package/lib/attribution.js.map +1 -0
  18. package/lib/auth.d.ts +25 -0
  19. package/lib/auth.d.ts.map +1 -0
  20. package/lib/auth.js +16 -0
  21. package/lib/auth.js.map +1 -0
  22. package/lib/billing-mode.d.ts +45 -0
  23. package/lib/billing-mode.d.ts.map +1 -0
  24. package/lib/billing-mode.js +44 -0
  25. package/lib/billing-mode.js.map +1 -0
  26. package/lib/blocked-repositories-protocol.d.ts +13 -0
  27. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  28. package/lib/blocked-repositories-protocol.js +8 -0
  29. package/lib/blocked-repositories-protocol.js.map +1 -0
  30. package/lib/context-url.d.ts +30 -0
  31. package/lib/context-url.d.ts.map +1 -0
  32. package/lib/context-url.js +100 -0
  33. package/lib/context-url.js.map +1 -0
  34. package/lib/context-url.spec.d.ts +12 -0
  35. package/lib/context-url.spec.d.ts.map +1 -0
  36. package/lib/context-url.spec.js +81 -0
  37. package/lib/context-url.spec.js.map +1 -0
  38. package/lib/encryption/container-module.d.ts +2 -2
  39. package/lib/encryption/container-module.d.ts.map +1 -1
  40. package/lib/encryption/container-module.js +8 -6
  41. package/lib/encryption/container-module.js.map +1 -1
  42. package/lib/encryption/encryption-engine.d.ts +2 -2
  43. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  44. package/lib/encryption/encryption-engine.js +28 -28
  45. package/lib/encryption/encryption-engine.js.map +1 -1
  46. package/lib/encryption/encryption-engine.spec.d.ts +3 -3
  47. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  48. package/lib/encryption/encryption-engine.spec.js +32 -39
  49. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  50. package/lib/encryption/encryption-service.d.ts +2 -2
  51. package/lib/encryption/encryption-service.d.ts.map +1 -1
  52. package/lib/encryption/encryption-service.js +33 -46
  53. package/lib/encryption/encryption-service.js.map +1 -1
  54. package/lib/encryption/key-provider.d.ts +3 -3
  55. package/lib/encryption/key-provider.d.ts.map +1 -1
  56. package/lib/encryption/key-provider.js +34 -40
  57. package/lib/encryption/key-provider.js.map +1 -1
  58. package/lib/env.d.ts +2 -8
  59. package/lib/env.d.ts.map +1 -1
  60. package/lib/env.js +10 -29
  61. package/lib/env.js.map +1 -1
  62. package/lib/experiments/always-default.d.ts +8 -0
  63. package/lib/experiments/always-default.d.ts.map +1 -0
  64. package/lib/experiments/always-default.js +20 -0
  65. package/lib/experiments/always-default.js.map +1 -0
  66. package/lib/experiments/configcat-server.d.ts +10 -0
  67. package/lib/experiments/configcat-server.d.ts.map +1 -0
  68. package/lib/experiments/configcat-server.js +37 -0
  69. package/lib/experiments/configcat-server.js.map +1 -0
  70. package/lib/experiments/configcat.d.ts +21 -0
  71. package/lib/experiments/configcat.d.ts.map +1 -0
  72. package/lib/experiments/configcat.js +51 -0
  73. package/lib/experiments/configcat.js.map +1 -0
  74. package/lib/experiments/types.d.ts +22 -0
  75. package/lib/experiments/types.d.ts.map +1 -0
  76. package/lib/experiments/types.js +10 -0
  77. package/lib/experiments/types.js.map +1 -0
  78. package/lib/frontend-dashboard-service.d.ts +99 -0
  79. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  80. package/lib/frontend-dashboard-service.js +55 -0
  81. package/lib/frontend-dashboard-service.js.map +1 -0
  82. package/lib/gitpod-file-parser.d.ts +2 -2
  83. package/lib/gitpod-file-parser.d.ts.map +1 -1
  84. package/lib/gitpod-file-parser.js +29 -44
  85. package/lib/gitpod-file-parser.js.map +1 -1
  86. package/lib/gitpod-file-parser.spec.d.ts +2 -2
  87. package/lib/gitpod-file-parser.spec.js +147 -144
  88. package/lib/gitpod-file-parser.spec.js.map +1 -1
  89. package/lib/gitpod-service.d.ts +290 -50
  90. package/lib/gitpod-service.d.ts.map +1 -1
  91. package/lib/gitpod-service.js +288 -123
  92. package/lib/gitpod-service.js.map +1 -1
  93. package/lib/headless-workspace-log.d.ts +11 -13
  94. package/lib/headless-workspace-log.d.ts.map +1 -1
  95. package/lib/headless-workspace-log.js +8 -9
  96. package/lib/headless-workspace-log.js.map +1 -1
  97. package/lib/ide-frontend-service.d.ts +26 -0
  98. package/lib/ide-frontend-service.d.ts.map +1 -0
  99. package/lib/ide-frontend-service.js +8 -0
  100. package/lib/ide-frontend-service.js.map +1 -0
  101. package/lib/ide-protocol.d.ts +126 -0
  102. package/lib/ide-protocol.d.ts.map +1 -0
  103. package/lib/ide-protocol.js +18 -0
  104. package/lib/ide-protocol.js.map +1 -0
  105. package/lib/index.d.ts +18 -12
  106. package/lib/index.d.ts.map +1 -1
  107. package/lib/index.js +28 -13
  108. package/lib/index.js.map +1 -1
  109. package/lib/installation-admin-protocol.d.ts +30 -0
  110. package/lib/installation-admin-protocol.d.ts.map +1 -0
  111. package/lib/installation-admin-protocol.js +31 -0
  112. package/lib/installation-admin-protocol.js.map +1 -0
  113. package/lib/license-protocol.d.ts +9 -2
  114. package/lib/license-protocol.d.ts.map +1 -1
  115. package/lib/license-protocol.js +3 -2
  116. package/lib/license-protocol.js.map +1 -1
  117. package/lib/messaging/browser/connection.d.ts +6 -4
  118. package/lib/messaging/browser/connection.d.ts.map +1 -1
  119. package/lib/messaging/browser/connection.js +188 -48
  120. package/lib/messaging/browser/connection.js.map +1 -1
  121. package/lib/messaging/browser/window-connection.d.ts +9 -4
  122. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  123. package/lib/messaging/browser/window-connection.js +48 -59
  124. package/lib/messaging/browser/window-connection.js.map +1 -1
  125. package/lib/messaging/client-call-metrics.d.ts +21 -0
  126. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  127. package/lib/messaging/client-call-metrics.js +95 -0
  128. package/lib/messaging/client-call-metrics.js.map +1 -0
  129. package/lib/messaging/error.d.ts +18 -4
  130. package/lib/messaging/error.d.ts.map +1 -1
  131. package/lib/messaging/error.js +38 -7
  132. package/lib/messaging/error.js.map +1 -1
  133. package/lib/messaging/handler.d.ts +10 -0
  134. package/lib/messaging/handler.d.ts.map +1 -1
  135. package/lib/messaging/handler.js +2 -1
  136. package/lib/messaging/handler.js.map +1 -1
  137. package/lib/messaging/node/connection.d.ts +1 -17
  138. package/lib/messaging/node/connection.d.ts.map +1 -1
  139. package/lib/messaging/node/connection.js +24 -59
  140. package/lib/messaging/node/connection.js.map +1 -1
  141. package/lib/messaging/proxy-factory.d.ts +3 -1
  142. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  143. package/lib/messaging/proxy-factory.js +76 -162
  144. package/lib/messaging/proxy-factory.js.map +1 -1
  145. package/lib/oss-allowlist.d.ts +14 -0
  146. package/lib/oss-allowlist.d.ts.map +1 -0
  147. package/lib/oss-allowlist.js +8 -0
  148. package/lib/oss-allowlist.js.map +1 -0
  149. package/lib/payment-protocol.d.ts +18 -0
  150. package/lib/payment-protocol.d.ts.map +1 -0
  151. package/lib/payment-protocol.js +13 -0
  152. package/lib/payment-protocol.js.map +1 -0
  153. package/lib/permission.d.ts +26 -15
  154. package/lib/permission.d.ts.map +1 -1
  155. package/lib/permission.js +50 -36
  156. package/lib/permission.js.map +1 -1
  157. package/lib/plans.d.ts +213 -0
  158. package/lib/plans.d.ts.map +1 -0
  159. package/lib/plans.js +625 -0
  160. package/lib/plans.js.map +1 -0
  161. package/lib/protocol.d.ts +338 -111
  162. package/lib/protocol.d.ts.map +1 -1
  163. package/lib/protocol.js +422 -201
  164. package/lib/protocol.js.map +1 -1
  165. package/lib/protocol.spec.d.ts +7 -0
  166. package/lib/protocol.spec.d.ts.map +1 -0
  167. package/lib/protocol.spec.js +127 -0
  168. package/lib/protocol.spec.js.map +1 -0
  169. package/lib/snapshot-url.d.ts +14 -0
  170. package/lib/snapshot-url.d.ts.map +1 -0
  171. package/lib/snapshot-url.js +26 -0
  172. package/lib/snapshot-url.js.map +1 -0
  173. package/lib/snapshot-url.spec.d.ts +7 -0
  174. package/lib/snapshot-url.spec.d.ts.map +1 -0
  175. package/lib/snapshot-url.spec.js +41 -0
  176. package/lib/snapshot-url.spec.js.map +1 -0
  177. package/lib/team-subscription-protocol.d.ts +93 -0
  178. package/lib/team-subscription-protocol.d.ts.map +1 -0
  179. package/lib/team-subscription-protocol.js +82 -0
  180. package/lib/team-subscription-protocol.js.map +1 -0
  181. package/lib/teams-projects-protocol.d.ts +136 -0
  182. package/lib/teams-projects-protocol.d.ts.map +1 -0
  183. package/lib/teams-projects-protocol.js +41 -0
  184. package/lib/teams-projects-protocol.js.map +1 -0
  185. package/lib/typings/globals.d.ts +8 -3
  186. package/lib/typings/globals.d.ts.map +1 -1
  187. package/lib/typings/globals.js +2 -2
  188. package/lib/usage.d.ts +73 -0
  189. package/lib/usage.d.ts.map +1 -0
  190. package/lib/usage.js +20 -0
  191. package/lib/usage.js.map +1 -0
  192. package/lib/util/analytics.d.ts +8 -0
  193. package/lib/util/analytics.d.ts.map +1 -0
  194. package/lib/util/analytics.js +88 -0
  195. package/lib/util/analytics.js.map +1 -0
  196. package/lib/util/async-iterator.d.ts +2 -2
  197. package/lib/util/async-iterator.d.ts.map +1 -1
  198. package/lib/util/async-iterator.js +60 -137
  199. package/lib/util/async-iterator.js.map +1 -1
  200. package/lib/util/cancelable.d.ts +2 -2
  201. package/lib/util/cancelable.js +20 -61
  202. package/lib/util/cancelable.js.map +1 -1
  203. package/lib/util/date-time.d.ts +2 -2
  204. package/lib/util/date-time.js +14 -13
  205. package/lib/util/date-time.js.map +1 -1
  206. package/lib/util/debug-app.d.ts +25 -0
  207. package/lib/util/debug-app.d.ts.map +1 -0
  208. package/lib/util/debug-app.js +100 -0
  209. package/lib/util/debug-app.js.map +1 -0
  210. package/lib/util/deep-partial.d.ts +2 -2
  211. package/lib/util/deep-partial.js +2 -2
  212. package/lib/util/deferred.d.ts +2 -2
  213. package/lib/util/deferred.js +13 -14
  214. package/lib/util/deferred.js.map +1 -1
  215. package/lib/util/disposable.d.ts +2 -2
  216. package/lib/util/disposable.d.ts.map +1 -1
  217. package/lib/util/disposable.js +28 -40
  218. package/lib/util/disposable.js.map +1 -1
  219. package/lib/util/event.d.ts +1 -1
  220. package/lib/util/event.d.ts.map +1 -1
  221. package/lib/util/event.js +64 -77
  222. package/lib/util/event.js.map +1 -1
  223. package/lib/util/garbage-collected-cache.d.ts +3 -2
  224. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  225. package/lib/util/garbage-collected-cache.js +35 -49
  226. package/lib/util/garbage-collected-cache.js.map +1 -1
  227. package/lib/util/generate-workspace-id.d.ts +9 -0
  228. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  229. package/lib/util/generate-workspace-id.js +491 -0
  230. package/lib/util/generate-workspace-id.js.map +1 -0
  231. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  232. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  233. package/lib/util/generate-workspace-id.spec.js +98 -0
  234. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  235. package/lib/util/gitpod-cookie.d.ts +20 -0
  236. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  237. package/lib/util/gitpod-cookie.js +41 -0
  238. package/lib/util/gitpod-cookie.js.map +1 -0
  239. package/lib/util/gitpod-host-url.d.ts +20 -8
  240. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  241. package/lib/util/gitpod-host-url.js +143 -85
  242. package/lib/util/gitpod-host-url.js.map +1 -1
  243. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  244. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  245. package/lib/util/gitpod-host-url.spec.js +134 -0
  246. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  247. package/lib/util/grpc.d.ts +35 -0
  248. package/lib/util/grpc.d.ts.map +1 -0
  249. package/lib/util/grpc.js +90 -0
  250. package/lib/util/grpc.js.map +1 -0
  251. package/lib/util/jaeger-client-types.d.ts +68 -0
  252. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  253. package/lib/util/jaeger-client-types.js +8 -0
  254. package/lib/util/jaeger-client-types.js.map +1 -0
  255. package/lib/util/logging.d.ts +58 -35
  256. package/lib/util/logging.d.ts.map +1 -1
  257. package/lib/util/logging.js +144 -129
  258. package/lib/util/logging.js.map +1 -1
  259. package/lib/util/logging.spec.d.ts +7 -0
  260. package/lib/util/logging.spec.d.ts.map +1 -0
  261. package/lib/util/logging.spec.js +52 -0
  262. package/lib/util/logging.spec.js.map +1 -0
  263. package/lib/util/make-link.d.ts +2 -2
  264. package/lib/util/make-link.js +8 -7
  265. package/lib/util/make-link.js.map +1 -1
  266. package/lib/util/nice-grpc.d.ts +9 -0
  267. package/lib/util/nice-grpc.d.ts.map +1 -0
  268. package/lib/util/nice-grpc.js +121 -0
  269. package/lib/util/nice-grpc.js.map +1 -0
  270. package/lib/util/parse-workspace-id.d.ts +15 -5
  271. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  272. package/lib/util/parse-workspace-id.js +39 -9
  273. package/lib/util/parse-workspace-id.js.map +1 -1
  274. package/lib/util/parse-workspace-id.spec.d.ts +10 -2
  275. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  276. package/lib/util/parse-workspace-id.spec.js +130 -49
  277. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  278. package/lib/util/queue.d.ts +2 -2
  279. package/lib/util/queue.js +19 -57
  280. package/lib/util/queue.js.map +1 -1
  281. package/lib/util/queue.spec.d.ts +2 -2
  282. package/lib/util/queue.spec.js +149 -288
  283. package/lib/util/queue.spec.js.map +1 -1
  284. package/lib/util/repeat.d.ts +15 -0
  285. package/lib/util/repeat.d.ts.map +1 -0
  286. package/lib/util/repeat.js +55 -0
  287. package/lib/util/repeat.js.map +1 -0
  288. package/lib/util/semaphore.d.ts +2 -2
  289. package/lib/util/semaphore.d.ts.map +1 -1
  290. package/lib/util/semaphore.js +18 -48
  291. package/lib/util/semaphore.js.map +1 -1
  292. package/lib/util/skip-if.d.ts +2 -2
  293. package/lib/util/skip-if.d.ts.map +1 -1
  294. package/lib/util/skip-if.js +9 -8
  295. package/lib/util/skip-if.js.map +1 -1
  296. package/lib/util/timeutil.d.ts +4 -2
  297. package/lib/util/timeutil.d.ts.map +1 -1
  298. package/lib/util/timeutil.js +43 -18
  299. package/lib/util/timeutil.js.map +1 -1
  300. package/lib/util/timeutil.spec.d.ts +4 -2
  301. package/lib/util/timeutil.spec.d.ts.map +1 -1
  302. package/lib/util/timeutil.spec.js +57 -25
  303. package/lib/util/timeutil.spec.js.map +1 -1
  304. package/lib/util/tracing.d.ts +55 -8
  305. package/lib/util/tracing.d.ts.map +1 -1
  306. package/lib/util/tracing.js +210 -66
  307. package/lib/util/tracing.js.map +1 -1
  308. package/lib/util/tracing.spec.d.ts +7 -0
  309. package/lib/util/tracing.spec.d.ts.map +1 -0
  310. package/lib/util/tracing.spec.js +121 -0
  311. package/lib/util/tracing.spec.js.map +1 -0
  312. package/lib/util/workspace-port-authentication.d.ts +9 -9
  313. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  314. package/lib/util/workspace-port-authentication.js +13 -14
  315. package/lib/util/workspace-port-authentication.js.map +1 -1
  316. package/lib/webhook-event.d.ts +44 -0
  317. package/lib/webhook-event.d.ts.map +1 -0
  318. package/lib/webhook-event.js +8 -0
  319. package/lib/webhook-event.js.map +1 -0
  320. package/lib/workspace-class.d.ts +14 -0
  321. package/lib/workspace-class.d.ts.map +1 -0
  322. package/lib/workspace-class.js +8 -0
  323. package/lib/workspace-class.js.map +1 -0
  324. package/lib/workspace-cluster.d.ts +80 -0
  325. package/lib/workspace-cluster.d.ts.map +1 -0
  326. package/lib/workspace-cluster.js +36 -0
  327. package/lib/workspace-cluster.js.map +1 -0
  328. package/lib/workspace-instance.d.ts +51 -8
  329. package/lib/workspace-instance.d.ts.map +1 -1
  330. package/lib/workspace-instance.js +2 -2
  331. package/lib/wsready.d.ts +8 -2
  332. package/lib/wsready.d.ts.map +1 -1
  333. package/lib/wsready.js +4 -3
  334. package/lib/wsready.js.map +1 -1
  335. package/package.json +42 -18
  336. package/pkg-yarn.lock +24 -10
  337. package/provenance-bundle.jsonl +2 -0
  338. package/src/accounting-protocol.ts +253 -0
  339. package/src/admin-protocol.ts +96 -21
  340. package/src/analytics.ts +52 -0
  341. package/src/attribution.ts +67 -0
  342. package/src/auth.ts +27 -0
  343. package/src/billing-mode.ts +84 -0
  344. package/src/blocked-repositories-protocol.ts +13 -0
  345. package/src/context-url.spec.ts +49 -0
  346. package/src/context-url.ts +107 -0
  347. package/src/encryption/container-module.ts +4 -5
  348. package/src/encryption/encryption-engine.spec.ts +11 -10
  349. package/src/encryption/encryption-engine.ts +22 -18
  350. package/src/encryption/encryption-service.ts +6 -7
  351. package/src/encryption/key-provider.ts +18 -21
  352. package/src/env.ts +3 -26
  353. package/src/experiments/always-default.ts +24 -0
  354. package/src/experiments/configcat-server.ts +42 -0
  355. package/src/experiments/configcat.ts +56 -0
  356. package/src/experiments/types.ts +34 -0
  357. package/src/frontend-dashboard-service.ts +148 -0
  358. package/src/gitpod-file-parser.spec.ts +57 -63
  359. package/src/gitpod-file-parser.ts +18 -19
  360. package/src/gitpod-service.ts +602 -99
  361. package/src/headless-workspace-log.ts +14 -16
  362. package/src/ide-frontend-service.ts +28 -0
  363. package/src/ide-protocol.ts +147 -0
  364. package/src/index.ts +18 -12
  365. package/src/installation-admin-protocol.ts +45 -0
  366. package/src/license-protocol.ts +14 -8
  367. package/src/messaging/browser/connection.ts +202 -26
  368. package/src/messaging/browser/window-connection.ts +45 -29
  369. package/src/messaging/client-call-metrics.ts +94 -0
  370. package/src/messaging/error.ts +51 -10
  371. package/src/messaging/handler.ts +13 -1
  372. package/src/messaging/node/connection.ts +23 -70
  373. package/src/messaging/proxy-factory.ts +35 -34
  374. package/src/oss-allowlist.ts +15 -0
  375. package/src/payment-protocol.ts +20 -0
  376. package/src/permission.ts +53 -40
  377. package/src/plans.ts +699 -0
  378. package/src/protocol.spec.ts +97 -0
  379. package/src/protocol.ts +790 -302
  380. package/src/snapshot-url.spec.ts +27 -0
  381. package/src/snapshot-url.ts +27 -0
  382. package/src/team-subscription-protocol.ts +153 -0
  383. package/src/teams-projects-protocol.ts +180 -0
  384. package/src/typings/globals.ts +13 -5
  385. package/src/usage.ts +85 -0
  386. package/src/util/analytics.ts +109 -0
  387. package/src/util/async-iterator.ts +6 -7
  388. package/src/util/cancelable.ts +5 -5
  389. package/src/util/date-time.ts +10 -10
  390. package/src/util/debug-app.ts +81 -0
  391. package/src/util/deep-partial.ts +2 -2
  392. package/src/util/deferred.ts +8 -8
  393. package/src/util/disposable.ts +3 -6
  394. package/src/util/event.ts +9 -11
  395. package/src/util/garbage-collected-cache.ts +18 -10
  396. package/src/util/generate-workspace-id.spec.ts +58 -0
  397. package/src/util/generate-workspace-id.ts +481 -0
  398. package/src/util/gitpod-cookie.ts +38 -0
  399. package/src/util/gitpod-host-url.spec.ts +76 -0
  400. package/src/util/gitpod-host-url.ts +119 -40
  401. package/src/util/grpc.ts +107 -0
  402. package/src/util/jaeger-client-types.ts +102 -0
  403. package/src/util/logging.spec.ts +23 -0
  404. package/src/util/logging.ts +163 -73
  405. package/src/util/make-link.ts +8 -9
  406. package/src/util/nice-grpc.ts +96 -0
  407. package/src/util/parse-workspace-id.spec.ts +62 -12
  408. package/src/util/parse-workspace-id.ts +40 -10
  409. package/src/util/queue.spec.ts +30 -28
  410. package/src/util/queue.ts +2 -2
  411. package/src/util/repeat.ts +45 -0
  412. package/src/util/semaphore.ts +8 -10
  413. package/src/util/skip-if.ts +12 -9
  414. package/src/util/timeutil.spec.ts +42 -16
  415. package/src/util/timeutil.ts +33 -17
  416. package/src/util/tracing.spec.ts +88 -0
  417. package/src/util/tracing.ts +211 -33
  418. package/src/util/workspace-port-authentication.ts +12 -15
  419. package/src/webhook-event.ts +55 -0
  420. package/src/workspace-class.ts +14 -0
  421. package/src/workspace-cluster.ts +121 -0
  422. package/src/workspace-instance.ts +120 -36
  423. package/src/wsready.ts +11 -4
  424. package/data/builtin-theia-plugins.json +0 -362
  425. package/lib/email-protocol.d.ts +0 -49
  426. package/lib/email-protocol.d.ts.map +0 -1
  427. package/lib/email-protocol.js +0 -27
  428. package/lib/email-protocol.js.map +0 -1
  429. package/lib/messaging/connection-error-handler.d.ts +0 -27
  430. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  431. package/lib/messaging/connection-error-handler.js +0 -45
  432. package/lib/messaging/connection-error-handler.js.map +0 -1
  433. package/lib/theia-plugins.d.ts +0 -11
  434. package/lib/theia-plugins.d.ts.map +0 -1
  435. package/lib/theia-plugins.js +0 -8
  436. package/lib/theia-plugins.js.map +0 -1
  437. package/lib/util/repeater.d.ts +0 -22
  438. package/lib/util/repeater.d.ts.map +0 -1
  439. package/lib/util/repeater.js +0 -117
  440. package/lib/util/repeater.js.map +0 -1
  441. package/lib/util/safe-promise.d.ts +0 -11
  442. package/lib/util/safe-promise.d.ts.map +0 -1
  443. package/lib/util/safe-promise.js +0 -33
  444. package/lib/util/safe-promise.js.map +0 -1
  445. package/lib/util/without.d.ts +0 -7
  446. package/lib/util/without.d.ts.map +0 -1
  447. package/lib/util/without.js +0 -8
  448. package/lib/util/without.js.map +0 -1
  449. package/src/email-protocol.ts +0 -67
  450. package/src/messaging/connection-error-handler.ts +0 -62
  451. package/src/theia-plugins.ts +0 -11
  452. package/src/util/jaeger-client.d.ts +0 -105
  453. package/src/util/repeater.ts +0 -49
  454. package/src/util/safe-promise.ts +0 -26
  455. package/src/util/without.ts +0 -8
@@ -0,0 +1,491 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.animals = exports.colors = exports.generateWorkspaceID = void 0;
18
+ const randomNumber = require("random-number-csprng");
19
+ function generateWorkspaceID(firstSegment, secondSegment) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const firstSeg = clean(firstSegment) || (yield random(exports.colors));
22
+ const secSeg = clean(secondSegment) || (yield random(exports.animals));
23
+ function fit(makeFit, otherSeg) {
24
+ return makeFit.substring(0, Math.max(segLength, 2 * segLength - otherSeg.length));
25
+ }
26
+ return fit(firstSeg, secSeg) + "-" + fit(secSeg, firstSeg) + "-" + (yield random(characters, segLength));
27
+ });
28
+ }
29
+ exports.generateWorkspaceID = generateWorkspaceID;
30
+ function clean(segment, maxChars = 16) {
31
+ if (!segment) {
32
+ return undefined;
33
+ }
34
+ segment = segment.toLowerCase();
35
+ let result = "";
36
+ for (let i = 0; i < segment.length; i++) {
37
+ if (characters.indexOf(segment[i]) !== -1) {
38
+ result += segment[i];
39
+ }
40
+ }
41
+ if (result.length >= 2) {
42
+ return result.substring(0, maxChars);
43
+ }
44
+ }
45
+ function random(array, length = 1) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ var result = "";
48
+ for (var i = 0; i < length; i++) {
49
+ result += array[yield randomNumber(0, array.length - 1)];
50
+ }
51
+ return result;
52
+ });
53
+ }
54
+ const segLength = 11;
55
+ const characters = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
56
+ exports.colors = [
57
+ "amaranth",
58
+ "amber",
59
+ "amethyst",
60
+ "apricot",
61
+ "aqua",
62
+ "aquamarine",
63
+ "azure",
64
+ "beige",
65
+ "black",
66
+ "blue",
67
+ "blush",
68
+ "bronze",
69
+ "brown",
70
+ "chocolate",
71
+ "coffee",
72
+ "copper",
73
+ "coral",
74
+ "crimson",
75
+ "cyan",
76
+ "emerald",
77
+ "fuchsia",
78
+ "gold",
79
+ "gray",
80
+ "green",
81
+ "harlequin",
82
+ "indigo",
83
+ "ivory",
84
+ "jade",
85
+ "kumquat",
86
+ "lavender",
87
+ "lime",
88
+ "magenta",
89
+ "maroon",
90
+ "moccasin",
91
+ "olive",
92
+ "orange",
93
+ "peach",
94
+ "pink",
95
+ "plum",
96
+ "purple",
97
+ "red",
98
+ "rose",
99
+ "salmon",
100
+ "sapphire",
101
+ "scarlet",
102
+ "silver",
103
+ "tan",
104
+ "teal",
105
+ "tomato",
106
+ "turquoise",
107
+ "violet",
108
+ "white",
109
+ "yellow",
110
+ ];
111
+ exports.animals = [
112
+ "canidae",
113
+ "felidae",
114
+ "cat",
115
+ "cattle",
116
+ "dog",
117
+ "donkey",
118
+ "goat",
119
+ "horse",
120
+ "pig",
121
+ "rabbit",
122
+ "aardvark",
123
+ "aardwolf",
124
+ "albatross",
125
+ "alligator",
126
+ "alpaca",
127
+ "amphibian",
128
+ "anaconda",
129
+ "angelfish",
130
+ "anglerfish",
131
+ "ant",
132
+ "anteater",
133
+ "antelope",
134
+ "antlion",
135
+ "ape",
136
+ "aphid",
137
+ "armadillo",
138
+ "asp",
139
+ "baboon",
140
+ "badger",
141
+ "bandicoot",
142
+ "barnacle",
143
+ "barracuda",
144
+ "basilisk",
145
+ "bass",
146
+ "bat",
147
+ "bear",
148
+ "beaver",
149
+ "bedbug",
150
+ "bee",
151
+ "beetle",
152
+ "bird",
153
+ "bison",
154
+ "blackbird",
155
+ "boa",
156
+ "boar",
157
+ "bobcat",
158
+ "bobolink",
159
+ "bonobo",
160
+ "booby",
161
+ "bovid",
162
+ "bug",
163
+ "butterfly",
164
+ "buzzard",
165
+ "camel",
166
+ "canid",
167
+ "capybara",
168
+ "cardinal",
169
+ "caribou",
170
+ "carp",
171
+ "cat",
172
+ "catshark",
173
+ "caterpillar",
174
+ "catfish",
175
+ "cattle",
176
+ "centipede",
177
+ "cephalopod",
178
+ "chameleon",
179
+ "cheetah",
180
+ "chickadee",
181
+ "chicken",
182
+ "chimpanzee",
183
+ "chinchilla",
184
+ "chipmunk",
185
+ "clam",
186
+ "clownfish",
187
+ "cobra",
188
+ "cockroach",
189
+ "cod",
190
+ "condor",
191
+ "constrictor",
192
+ "coral",
193
+ "cougar",
194
+ "cow",
195
+ "coyote",
196
+ "crab",
197
+ "crane",
198
+ "crawdad",
199
+ "crayfish",
200
+ "cricket",
201
+ "crocodile",
202
+ "crow",
203
+ "cuckoo",
204
+ "cicada",
205
+ "damselfly",
206
+ "deer",
207
+ "dingo",
208
+ "dinosaur",
209
+ "dodo",
210
+ "dog",
211
+ "dolphin",
212
+ "donkey",
213
+ "dormouse",
214
+ "dove",
215
+ "dragonfly",
216
+ "dragon",
217
+ "duck",
218
+ "eagle",
219
+ "earthworm",
220
+ "earwig",
221
+ "echidna",
222
+ "eel",
223
+ "egret",
224
+ "elephant",
225
+ "elk",
226
+ "emu",
227
+ "ermine",
228
+ "falcon",
229
+ "ferret",
230
+ "finch",
231
+ "firefly",
232
+ "fish",
233
+ "flamingo",
234
+ "flea",
235
+ "fly",
236
+ "flyingfish",
237
+ "fowl",
238
+ "fox",
239
+ "frog",
240
+ "gamefowl",
241
+ "galliform",
242
+ "gazelle",
243
+ "gecko",
244
+ "gerbil",
245
+ "gibbon",
246
+ "giraffe",
247
+ "goat",
248
+ "goldfish",
249
+ "goose",
250
+ "gopher",
251
+ "gorilla",
252
+ "grasshopper",
253
+ "grouse",
254
+ "guan",
255
+ "guanaco",
256
+ "guineafowl",
257
+ "gull",
258
+ "guppy",
259
+ "haddock",
260
+ "halibut",
261
+ "hamster",
262
+ "hare",
263
+ "harrier",
264
+ "hawk",
265
+ "hedgehog",
266
+ "heron",
267
+ "herring",
268
+ "hippopotamus",
269
+ "hookworm",
270
+ "hornet",
271
+ "horse",
272
+ "hoverfly",
273
+ "hummingbird",
274
+ "hyena",
275
+ "iguana",
276
+ "impala",
277
+ "jackal",
278
+ "jaguar",
279
+ "jay",
280
+ "jellyfish",
281
+ "junglefowl",
282
+ "kangaroo",
283
+ "kingfisher",
284
+ "kite",
285
+ "kiwi",
286
+ "koala",
287
+ "koi",
288
+ "krill",
289
+ "ladybug",
290
+ "lamprey",
291
+ "landfowl",
292
+ "lark",
293
+ "leech",
294
+ "lemming",
295
+ "lemur",
296
+ "leopard",
297
+ "leopon",
298
+ "limpet",
299
+ "lion",
300
+ "lizard",
301
+ "llama",
302
+ "lobster",
303
+ "locust",
304
+ "loon",
305
+ "louse",
306
+ "lungfish",
307
+ "lynx",
308
+ "macaw",
309
+ "mackerel",
310
+ "magpie",
311
+ "mammal",
312
+ "manatee",
313
+ "mandrill",
314
+ "marlin",
315
+ "marmoset",
316
+ "marmot",
317
+ "marsupial",
318
+ "marten",
319
+ "mastodon",
320
+ "meadowlark",
321
+ "meerkat",
322
+ "mink",
323
+ "minnow",
324
+ "mite",
325
+ "mockingbird",
326
+ "mole",
327
+ "mollusk",
328
+ "mongoose",
329
+ "monkey",
330
+ "moose",
331
+ "mosquito",
332
+ "moth",
333
+ "mouse",
334
+ "mule",
335
+ "muskox",
336
+ "narwhal",
337
+ "newt",
338
+ "nightingale",
339
+ "ocelot",
340
+ "octopus",
341
+ "opossum",
342
+ "orangutan",
343
+ "orca",
344
+ "ostrich",
345
+ "otter",
346
+ "owl",
347
+ "ox",
348
+ "panda",
349
+ "panther",
350
+ "parakeet",
351
+ "parrot",
352
+ "parrotfish",
353
+ "partridge",
354
+ "peacock",
355
+ "peafowl",
356
+ "pelican",
357
+ "penguin",
358
+ "perch",
359
+ "pheasant",
360
+ "pig",
361
+ "pigeon",
362
+ "pike",
363
+ "pinniped",
364
+ "piranha",
365
+ "planarian",
366
+ "platypus",
367
+ "pony",
368
+ "porcupine",
369
+ "porpoise",
370
+ "possum",
371
+ "prawn",
372
+ "primate",
373
+ "ptarmigan",
374
+ "puffin",
375
+ "puma",
376
+ "python",
377
+ "quail",
378
+ "quelea",
379
+ "quokka",
380
+ "rabbit",
381
+ "raccoon",
382
+ "rat",
383
+ "rattlesnake",
384
+ "raven",
385
+ "reindeer",
386
+ "reptile",
387
+ "rhinoceros",
388
+ "roadrunner",
389
+ "rodent",
390
+ "rook",
391
+ "rooster",
392
+ "roundworm",
393
+ "sailfish",
394
+ "salamander",
395
+ "salmon",
396
+ "sawfish",
397
+ "scallop",
398
+ "scorpion",
399
+ "seahorse",
400
+ "shark",
401
+ "sheep",
402
+ "shrew",
403
+ "shrimp",
404
+ "silkworm",
405
+ "silverfish",
406
+ "skink",
407
+ "skunk",
408
+ "sloth",
409
+ "slug",
410
+ "smelt",
411
+ "snail",
412
+ "snake",
413
+ "snipe",
414
+ "sole",
415
+ "sparrow",
416
+ "spider",
417
+ "spoonbill",
418
+ "squid",
419
+ "squirrel",
420
+ "starfish",
421
+ "stingray",
422
+ "stoat",
423
+ "stork",
424
+ "sturgeon",
425
+ "swallow",
426
+ "swan",
427
+ "swift",
428
+ "swordfish",
429
+ "swordtail",
430
+ "tahr",
431
+ "takin",
432
+ "tapir",
433
+ "tarantula",
434
+ "tarsier",
435
+ "termite",
436
+ "tern",
437
+ "thrush",
438
+ "tick",
439
+ "tiger",
440
+ "tiglon",
441
+ "toad",
442
+ "tortoise",
443
+ "toucan",
444
+ "trout",
445
+ "tuna",
446
+ "turkey",
447
+ "turtle",
448
+ "tyrannosaurus",
449
+ "urial",
450
+ "vicuna",
451
+ "viper",
452
+ "vole",
453
+ "vulture",
454
+ "wallaby",
455
+ "walrus",
456
+ "wasp",
457
+ "warbler",
458
+ "weasel",
459
+ "whale",
460
+ "whippet",
461
+ "whitefish",
462
+ "wildcat",
463
+ "wildebeest",
464
+ "wildfowl",
465
+ "wolf",
466
+ "wolverine",
467
+ "wombat",
468
+ "woodpecker",
469
+ "worm",
470
+ "wren",
471
+ "xerinae",
472
+ "yak",
473
+ "zebra",
474
+ "alpaca",
475
+ "cat",
476
+ "cattle",
477
+ "chicken",
478
+ "dog",
479
+ "donkey",
480
+ "ferret",
481
+ "gayal",
482
+ "goldfish",
483
+ "guppy",
484
+ "horse",
485
+ "koi",
486
+ "llama",
487
+ "sheep",
488
+ "yak",
489
+ "unicorn",
490
+ ];
491
+ //# sourceMappingURL=generate-workspace-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-workspace-id.js","sourceRoot":"","sources":["../../src/util/generate-workspace-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,qDAAsD;AAEtD,SAAsB,mBAAmB,CAAC,YAAqB,EAAE,aAAsB;;QACnF,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,cAAM,CAAC,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,eAAO,CAAC,CAAC,CAAC;QAC/D,SAAS,GAAG,CAAC,OAAe,EAAE,QAAgB;YAC1C,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAG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
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 {};
7
+ //# sourceMappingURL=generate-workspace-id.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/generate-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,98 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
13
+ var __metadata = (this && this.__metadata) || function (k, v) {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const mocha_typescript_1 = require("mocha-typescript");
27
+ const chai = require("chai");
28
+ const generate_workspace_id_1 = require("./generate-workspace-id");
29
+ const gitpod_host_url_1 = require("./gitpod-host-url");
30
+ const expect = chai.expect;
31
+ let TestGenerateWorkspaceId = class TestGenerateWorkspaceId {
32
+ testGenerateWorkspaceId() {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ for (let i = 0; i < 10; i++) {
35
+ const id = yield (0, generate_workspace_id_1.generateWorkspaceID)();
36
+ expect(new gitpod_host_url_1.GitpodHostUrl().withWorkspacePrefix(id, "eu").workspaceId).to.equal(id);
37
+ }
38
+ });
39
+ }
40
+ testLongestName() {
41
+ const longestColor = generate_workspace_id_1.colors.sort((a, b) => b.length - a.length)[0];
42
+ const longestAnimal = generate_workspace_id_1.animals.sort((a, b) => b.length - a.length)[0];
43
+ const longestName = `${longestColor}-${longestAnimal}-12345678`;
44
+ expect(longestName.length <= 36, `"${longestName}" is longer than 36 chars (${longestName.length})`).to.be.true;
45
+ }
46
+ testCustomName() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const data = [
49
+ ["foo", "bar", "foo-bar-"],
50
+ ["f", "bar", ".{2,16}-bar-"],
51
+ ["gitpod-io", "gitpod", "gitpodio-gitpod-"],
52
+ ["breatheco-de", "python-flask-api-tutorial", "breathecode-pythonflask-"],
53
+ ["short", "muchlongerthaneleven", "short-muchlongerthanel-"],
54
+ ["muchlongerthaneleven", "short", "muchlongerthanel-short-"],
55
+ [
56
+ 'this is rather long and has some "§$"% special chars',
57
+ "also here pretty long and needs abbreviation",
58
+ "thisisrathe-alsoherepre-",
59
+ ],
60
+ ["UPPER", "CaSe", "upper-case-"],
61
+ [
62
+ "superlongfirstsegment",
63
+ "---------",
64
+ "superlong" /* we don't mantch for the whole first segment, because it has different length depending on the animal that is used to replace the -------*/,
65
+ ],
66
+ ];
67
+ for (const d of data) {
68
+ const id = yield (0, generate_workspace_id_1.generateWorkspaceID)(d[0], d[1]);
69
+ expect(id).match(new RegExp("^" + d[2]));
70
+ expect(new gitpod_host_url_1.GitpodHostUrl().withWorkspacePrefix(id, "eu").workspaceId).to.equal(id);
71
+ expect(id.length <= 36, `"${id}" is longer than 36 chars (${id.length})`).to.be.true;
72
+ }
73
+ });
74
+ }
75
+ };
76
+ __decorate([
77
+ mocha_typescript_1.test,
78
+ __metadata("design:type", Function),
79
+ __metadata("design:paramtypes", []),
80
+ __metadata("design:returntype", Promise)
81
+ ], TestGenerateWorkspaceId.prototype, "testGenerateWorkspaceId", null);
82
+ __decorate([
83
+ mocha_typescript_1.test,
84
+ __metadata("design:type", Function),
85
+ __metadata("design:paramtypes", []),
86
+ __metadata("design:returntype", void 0)
87
+ ], TestGenerateWorkspaceId.prototype, "testLongestName", null);
88
+ __decorate([
89
+ mocha_typescript_1.test,
90
+ __metadata("design:type", Function),
91
+ __metadata("design:paramtypes", []),
92
+ __metadata("design:returntype", Promise)
93
+ ], TestGenerateWorkspaceId.prototype, "testCustomName", null);
94
+ TestGenerateWorkspaceId = __decorate([
95
+ mocha_typescript_1.suite
96
+ ], TestGenerateWorkspaceId);
97
+ module.exports = new TestGenerateWorkspaceId();
98
+ //# sourceMappingURL=generate-workspace-id.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-workspace-id.spec.js","sourceRoot":"","sources":["../../src/util/generate-workspace-id.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;AAEH,uDAA+C;AAC/C,6BAA6B;AAC7B,mEAA+E;AAC/E,uDAAkD;AAElD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACN,uBAAuB;;YACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;gBACzB,MAAM,EAAE,GAAG,MAAM,IAAA,2CAAmB,GAAE,CAAC;gBAC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BACX,WAAW,CAAC,6IAA6I;iBAC5J;aACJ,CAAC;YACF,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;gBAClB,MAAM,EAAE,GAAG,MAAM,IAAA,2CAAmB,EAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjD,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzC,MAAM,CAAC,IAAI,+BAAa,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACnF,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;aACxF;QACL,CAAC;KAAA;CACJ,CAAA;AAzCS;IAAL,uBAAI;;;;sEAKJ;AAEK;IAAL,uBAAI;;;;8DAKJ;AAEK;IAAL,uBAAI;;;;6DA0BJ;AAzCC,uBAAuB;IAD5B,wBAAK;GACA,uBAAuB,CA0C5B;AACD,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,20 @@
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 * as cookie from "cookie";
7
+ /**
8
+ * This cookie indicates whether the connected client is a Gitpod user (= "has logged in within the last year") or not.
9
+ * This is used by "gitpod.io" and "www.gitpod.io" to display different content/buttons.
10
+ */
11
+ export declare const NAME = "gitpod-user";
12
+ export declare const VALUE = "true";
13
+ /**
14
+ * @param domain The domain the Gitpod installation is installed onto
15
+ * @returns
16
+ */
17
+ export declare function options(domain: string): cookie.CookieSerializeOptions;
18
+ export declare function generateCookie(domain: string): string;
19
+ export declare function isPresent(cookies: string): boolean;
20
+ //# sourceMappingURL=gitpod-cookie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitpod-cookie.d.ts","sourceRoot":"","sources":["../../src/util/gitpod-cookie.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAClC,eAAO,MAAM,KAAK,SAAS,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAUrE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGlD"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPresent = exports.generateCookie = exports.options = exports.VALUE = exports.NAME = void 0;
4
+ /**
5
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
6
+ * Licensed under the GNU Affero General Public License (AGPL).
7
+ * See License.AGPL.txt in the project root for license information.
8
+ */
9
+ const cookie = require("cookie");
10
+ /**
11
+ * This cookie indicates whether the connected client is a Gitpod user (= "has logged in within the last year") or not.
12
+ * This is used by "gitpod.io" and "www.gitpod.io" to display different content/buttons.
13
+ */
14
+ exports.NAME = "gitpod-user";
15
+ exports.VALUE = "true";
16
+ /**
17
+ * @param domain The domain the Gitpod installation is installed onto
18
+ * @returns
19
+ */
20
+ function options(domain) {
21
+ // Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
22
+ return {
23
+ path: "/",
24
+ httpOnly: false,
25
+ secure: false,
26
+ maxAge: 60 * 60 * 24 * 365,
27
+ sameSite: "lax",
28
+ domain: `.${domain}`, // explicilty include subdomains to not only cover "gitpod.io", but also "www.gitpod.io" or workspaces
29
+ };
30
+ }
31
+ exports.options = options;
32
+ function generateCookie(domain) {
33
+ return cookie.serialize(exports.NAME, exports.VALUE, options(domain));
34
+ }
35
+ exports.generateCookie = generateCookie;
36
+ function isPresent(cookies) {
37
+ // needs to match the old (gitpod-user=loggedIn) and new (gitpod-user=true) values to ensure a smooth transition during rollout.
38
+ return !!cookies.match(`${exports.NAME}=`);
39
+ }
40
+ exports.isPresent = isPresent;
41
+ //# sourceMappingURL=gitpod-cookie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitpod-cookie.js","sourceRoot":"","sources":["../../src/util/gitpod-cookie.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,iCAAiC;AAEjC;;;GAGG;AACU,QAAA,IAAI,GAAG,aAAa,CAAC;AACrB,QAAA,KAAK,GAAG,MAAM,CAAC;AAE5B;;;GAGG;AACH,SAAgB,OAAO,CAAC,MAAc;IAClC,uEAAuE;IACvE,OAAO;QACH,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;QAC1B,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,IAAI,MAAM,EAAE,EAAE,sGAAsG;KAC/H,CAAC;AACN,CAAC;AAVD,0BAUC;AAED,SAAgB,cAAc,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,SAAS,CAAC,YAAI,EAAE,aAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC;AAFD,wCAEC;AAED,SAAgB,SAAS,CAAC,OAAe;IACrC,gIAAgI;IAChI,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,YAAI,GAAG,CAAC,CAAC;AACvC,CAAC;AAHD,8BAGC"}