@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
@@ -1 +1 @@
1
- {"version":3,"file":"admin-protocol.d.ts","sourceRoot":"","sources":["../src/admin-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,WAAW;IACxB,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IACjF,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,cAAc,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,2BAA2B,CAAC,GAAG,EAAE,kCAAkC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,wCAAwC,CAAC,GAAG,EAAE,+CAA+C,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9G,kBAAkB,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACtG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7D,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD,eAAe,CAAC,GAAG,EA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U,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,sBAAsB,CAAC;CACjC;AAED,yBAAiB,oBAAoB,CAAC;IAClC,SAAgB,WAAW,CAAC,GAAG,EAAE,oBAAoB,GAAG,SAAS,CAMhE;IAED,SAAgB,UAAU,CAAC,GAAG,EAAE,oBAAoB,GAAG,iBAAiB,GAAG,SAAS,CASnF;CACJ;AAED,oBAAY,yBAAyB,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,GAAG,uBAAuB,CAAC;AAC5G,+DAA+D;AAC/D,oBAAY,uBAAuB,GAAG;IAClC,+GAA+G;IAC/G,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1,8 +1,23 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * 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.WorkspaceAndInstance = void 0;
9
+ var WorkspaceAndInstance;
10
+ (function (WorkspaceAndInstance) {
11
+ function toWorkspace(wai) {
12
+ return Object.assign({ id: wai.workspaceId, creationTime: wai.workspaceCreationTime }, wai);
13
+ }
14
+ WorkspaceAndInstance.toWorkspace = toWorkspace;
15
+ function toInstance(wai) {
16
+ if (!wai.instanceId) {
17
+ return undefined;
18
+ }
19
+ return Object.assign({ id: wai.instanceId, creationTime: wai.instanceCreationTime }, wai);
20
+ }
21
+ WorkspaceAndInstance.toInstance = toInstance;
22
+ })(WorkspaceAndInstance = exports.WorkspaceAndInstance || (exports.WorkspaceAndInstance = {}));
8
23
  //# sourceMappingURL=admin-protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin-protocol.js","sourceRoot":"","sources":["../src/admin-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
1
+ {"version":3,"file":"admin-protocol.js","sourceRoot":"","sources":["../src/admin-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA+GH,IAAiB,oBAAoB,CAmBpC;AAnBD,WAAiB,oBAAoB;IACjC,SAAgB,WAAW,CAAC,GAAyB;QACjD,uBACI,EAAE,EAAE,GAAG,CAAC,WAAW,EACnB,YAAY,EAAE,GAAG,CAAC,qBAAqB,IACpC,GAAG,EACR;IACN,CAAC;IANe,gCAAW,cAM1B,CAAA;IAED,SAAgB,UAAU,CAAC,GAAyB;QAChD,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE;YACjB,OAAO,SAAS,CAAC;SACpB;QACD,uBACI,EAAE,EAAE,GAAG,CAAC,UAAU,EAClB,YAAY,EAAE,GAAG,CAAC,oBAAoB,IACnC,GAAG,EACR;IACN,CAAC;IATe,+BAAU,aASzB,CAAA;AACL,CAAC,EAnBgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAmBpC"}
@@ -0,0 +1,44 @@
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
+ export declare const IAnalyticsWriter: unique symbol;
7
+ declare type Identity = {
8
+ userId: string | number;
9
+ anonymousId?: string | number;
10
+ } | {
11
+ userId?: string | number;
12
+ anonymousId: string | number;
13
+ };
14
+ interface Message {
15
+ messageId?: string;
16
+ }
17
+ export declare type IdentifyMessage = Message & Identity & {
18
+ traits?: any;
19
+ timestamp?: Date;
20
+ context?: any;
21
+ };
22
+ export declare type TrackMessage = Message & Identity & {
23
+ event: string;
24
+ properties?: any;
25
+ timestamp?: Date;
26
+ context?: any;
27
+ };
28
+ export declare type PageMessage = Message & Identity & {
29
+ properties?: any;
30
+ timestamp?: Date;
31
+ context?: any;
32
+ };
33
+ export declare type RemoteTrackMessage = Omit<TrackMessage, "timestamp" | "userId">;
34
+ export declare type RemotePageMessage = Omit<PageMessage, "timestamp" | "userId"> & {
35
+ includePII?: boolean;
36
+ };
37
+ export declare type RemoteIdentifyMessage = Omit<IdentifyMessage, "timestamp" | "userId">;
38
+ export interface IAnalyticsWriter {
39
+ identify(msg: IdentifyMessage): void;
40
+ track(msg: TrackMessage): void;
41
+ page(msg: PageMessage): void;
42
+ }
43
+ export {};
44
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAE3D,aAAK,QAAQ,GACP;IAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC1D;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEjE,UAAU,OAAO;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,oBAAY,eAAe,GAAG,OAAO,GACjC,QAAQ,GAAG;IACP,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AAEN,oBAAY,YAAY,GAAG,OAAO,GAC9B,QAAQ,GAAG;IACP,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AAEN,oBAAY,WAAW,GAAG,OAAO,GAC7B,QAAQ,GAAG;IACP,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AAEN,oBAAY,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,QAAQ,CAAC,CAAC;AAC5E,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,QAAQ,CAAC,GAAG;IACxE,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,oBAAY,qBAAqB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,QAAQ,CAAC,CAAC;AAElF,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;IAErC,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IAE/B,IAAI,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;CAChC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License.AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.IAnalyticsWriter = void 0;
9
+ exports.IAnalyticsWriter = Symbol("IAnalyticsWriter");
10
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEU,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License.AGPL.txt in the project root for license information.
5
+ */
6
+ import { User } from "./protocol";
7
+ import { Team } from "./teams-projects-protocol";
8
+ export declare type AttributionId = UserAttributionId | TeamAttributionId;
9
+ export declare type AttributionTarget = "user" | "team";
10
+ export interface UserAttributionId {
11
+ kind: "user";
12
+ userId: string;
13
+ }
14
+ export interface TeamAttributionId {
15
+ kind: "team";
16
+ teamId: string;
17
+ }
18
+ export declare namespace AttributionId {
19
+ function createFromOrganizationId(organizationId?: string): AttributionId | undefined;
20
+ function create(userOrTeam: User | Team): AttributionId;
21
+ function parse(s: string): UserAttributionId | TeamAttributionId | undefined;
22
+ function render(id: AttributionId): string;
23
+ function equals(a: AttributionId, b: AttributionId): boolean;
24
+ }
25
+ //# sourceMappingURL=attribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEjD,oBAAY,aAAa,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAClE,oBAAY,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,yBAAiB,aAAa,CAAC;IAG3B,SAAgB,wBAAwB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE3F;IAED,SAAgB,MAAM,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,GAAG,aAAa,CAM7D;IAED,SAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,SAAS,CAgBlF;IAED,SAAgB,MAAM,CAAC,EAAE,EAAE,aAAa,GAAG,MAAM,CAOhD;IAED,SAAgB,MAAM,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAElE;CACJ"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2022 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.AttributionId = void 0;
9
+ const protocol_1 = require("./protocol");
10
+ var AttributionId;
11
+ (function (AttributionId) {
12
+ const SEPARATOR = ":";
13
+ function createFromOrganizationId(organizationId) {
14
+ return organizationId ? { kind: "team", teamId: organizationId } : undefined;
15
+ }
16
+ AttributionId.createFromOrganizationId = createFromOrganizationId;
17
+ function create(userOrTeam) {
18
+ if (protocol_1.User.is(userOrTeam)) {
19
+ return { kind: "user", userId: userOrTeam.id };
20
+ }
21
+ else {
22
+ return { kind: "team", teamId: userOrTeam.id };
23
+ }
24
+ }
25
+ AttributionId.create = create;
26
+ function parse(s) {
27
+ if (!s) {
28
+ return undefined;
29
+ }
30
+ const parts = s.split(":");
31
+ if (parts.length !== 2) {
32
+ return undefined;
33
+ }
34
+ switch (parts[0]) {
35
+ case "user":
36
+ return { kind: "user", userId: parts[1] };
37
+ case "team":
38
+ return { kind: "team", teamId: parts[1] };
39
+ default:
40
+ return undefined;
41
+ }
42
+ }
43
+ AttributionId.parse = parse;
44
+ function render(id) {
45
+ switch (id.kind) {
46
+ case "user":
47
+ return `user${SEPARATOR}${id.userId}`;
48
+ case "team":
49
+ return `team${SEPARATOR}${id.teamId}`;
50
+ }
51
+ }
52
+ AttributionId.render = render;
53
+ function equals(a, b) {
54
+ return render(a) === render(b);
55
+ }
56
+ AttributionId.equals = equals;
57
+ })(AttributionId = exports.AttributionId || (exports.AttributionId = {}));
58
+ //# sourceMappingURL=attribution.js.map
@@ -0,0 +1 @@
1
+ {"version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mBAAK,QAgBpB,CAAA;IAED,SAAgB,MAAM,CAAC,EAAiB;QACpC,QAAQ,EAAE,CAAC,IAAI,EAAE;YACb,KAAK,MAAM;gBACP,OAAO,OAAO,SAAS,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;YAC1C,KAAK,MAAM;gBACP,OAAO,OAAO,SAAS,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;SAC7C;IACL,CAAC;IAPe,oBAAM,SAOrB,CAAA;IAED,SAAgB,MAAM,CAAC,CAAgB,EAAE,CAAgB;QACrD,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAFe,oBAAM,SAErB,CAAA;AACL,CAAC,EA7CgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA6C7B"}
package/lib/auth.d.ts ADDED
@@ -0,0 +1,25 @@
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
+ export interface SelectAccountPayload {
7
+ currentUser: {
8
+ name: string;
9
+ avatarUrl: string;
10
+ authHost: string;
11
+ authName: string;
12
+ authProviderType: string;
13
+ };
14
+ otherUser: {
15
+ name: string;
16
+ avatarUrl: string;
17
+ authHost: string;
18
+ authName: string;
19
+ authProviderType: string;
20
+ };
21
+ }
22
+ export declare namespace SelectAccountPayload {
23
+ function is(data: any): data is SelectAccountPayload;
24
+ }
25
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACL;AACD,yBAAiB,oBAAoB,CAAC;IAClC,SAAgB,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,oBAAoB,CAE1D;CACJ"}
package/lib/auth.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License.AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SelectAccountPayload = void 0;
9
+ var SelectAccountPayload;
10
+ (function (SelectAccountPayload) {
11
+ function is(data) {
12
+ return typeof data === "object" && "currentUser" in data && "otherUser" in data;
13
+ }
14
+ SelectAccountPayload.is = is;
15
+ })(SelectAccountPayload = exports.SelectAccountPayload || (exports.SelectAccountPayload = {}));
16
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAkBH,IAAiB,oBAAoB,CAIpC;AAJD,WAAiB,oBAAoB;IACjC,SAAgB,EAAE,CAAC,IAAS;QACxB,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,aAAa,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC;IACpF,CAAC;IAFe,uBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAIpC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright (c) 2022 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
+ * BillingMode is used to answer the following questions:
8
+ * - Should UI piece x be displayed for this user/team? (getBillingModeForUser/Team)
9
+ * - What model should be used to limit this workspace's capabilities (mayStartWorkspace, setTimeout, workspace class, etc...) (getBillingMode(workspaceInstance.attributionId))
10
+ * - How is a workspace session charged for? (getBillingMode(workspaceInstance.attributionId))
11
+ */
12
+ export declare type BillingMode = None | Chargebee | UsageBased;
13
+ export declare namespace BillingMode {
14
+ const NONE: None;
15
+ /** Incl. upgrade and status */
16
+ function showUsageBasedBilling(billingMode?: BillingMode): boolean;
17
+ function showTeamSubscriptionUI(billingMode?: BillingMode): boolean;
18
+ function canSetWorkspaceClass(billingMode?: BillingMode): boolean;
19
+ function canSetCostCenter(billingMode: BillingMode): boolean;
20
+ }
21
+ /** Payment is disabled */
22
+ interface None {
23
+ mode: "none";
24
+ }
25
+ /** Sessions is handled with old subscription logic based on Chargebee */
26
+ interface Chargebee {
27
+ mode: "chargebee";
28
+ /** True iff this is a team, and is based on a paid plan. Currently only set for teams! */
29
+ paid?: boolean;
30
+ canUpgradeToUBB?: boolean;
31
+ /** Name of team(s) that block switching to usage-based */
32
+ teamNames?: string[];
33
+ }
34
+ /** Session is handld with new usage-based logic */
35
+ interface UsageBased {
36
+ mode: "usage-based";
37
+ /** True iff this is a team, and is based on a paid plan. Currently only set for teams! */
38
+ paid?: boolean;
39
+ /** User is already converted, but is member with at least one Chargebee-based "Team Plan" */
40
+ hasChargebeeTeamPlan?: boolean;
41
+ /** User is already converted, but is member or owner in at least one Chargebee-based "Team Subscription" */
42
+ hasChargebeeTeamSubscription?: boolean;
43
+ }
44
+ export {};
45
+ //# sourceMappingURL=billing-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-mode.d.ts","sourceRoot":"","sources":["../src/billing-mode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,oBAAY,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;AACxD,yBAAiB,WAAW,CAAC;IAClB,MAAM,IAAI,EAAE,IAElB,CAAC;IAEF,+BAA+B;IAC/B,SAAgB,qBAAqB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAOxE;IAED,SAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAQzE;IAED,SAAgB,oBAAoB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAOvE;IAED,SAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGlE;CACJ;AAED,0BAA0B;AAC1B,UAAU,IAAI;IACV,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,yEAAyE;AACzE,UAAU,SAAS;IACf,IAAI,EAAE,WAAW,CAAC;IAElB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,mDAAmD;AACnD,UAAU,UAAU;IAChB,IAAI,EAAE,aAAa,CAAC;IAEpB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,4GAA4G;IAC5G,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2022 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.BillingMode = void 0;
9
+ var BillingMode;
10
+ (function (BillingMode) {
11
+ BillingMode.NONE = {
12
+ mode: "none",
13
+ };
14
+ /** Incl. upgrade and status */
15
+ function showUsageBasedBilling(billingMode) {
16
+ if (!billingMode) {
17
+ return false;
18
+ }
19
+ return (billingMode.mode === "usage-based" || (billingMode.mode === "chargebee" && !!billingMode.canUpgradeToUBB));
20
+ }
21
+ BillingMode.showUsageBasedBilling = showUsageBasedBilling;
22
+ function showTeamSubscriptionUI(billingMode) {
23
+ if (!billingMode) {
24
+ return false;
25
+ }
26
+ return (billingMode.mode === "chargebee" ||
27
+ (billingMode.mode === "usage-based" && !!billingMode.hasChargebeeTeamSubscription));
28
+ }
29
+ BillingMode.showTeamSubscriptionUI = showTeamSubscriptionUI;
30
+ function canSetWorkspaceClass(billingMode) {
31
+ if (!billingMode) {
32
+ return false;
33
+ }
34
+ // if has any Stripe subscription, either directly or per team, OR we're running on a license
35
+ return billingMode.mode === "usage-based" || billingMode.mode === "none";
36
+ }
37
+ BillingMode.canSetWorkspaceClass = canSetWorkspaceClass;
38
+ function canSetCostCenter(billingMode) {
39
+ // if has any Stripe Subscription, either directly or per team
40
+ return billingMode.mode === "usage-based";
41
+ }
42
+ BillingMode.canSetCostCenter = canSetCostCenter;
43
+ })(BillingMode = exports.BillingMode || (exports.BillingMode = {}));
44
+ //# sourceMappingURL=billing-mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-mode.js","sourceRoot":"","sources":["../src/billing-mode.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AASH,IAAiB,WAAW,CAsC3B;AAtCD,WAAiB,WAAW;IACX,gBAAI,GAAS;QACtB,IAAI,EAAE,MAAM;KACf,CAAC;IAEF,+BAA+B;IAC/B,SAAgB,qBAAqB,CAAC,WAAyB;QAC3D,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,CACH,WAAW,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAC5G,CAAC;IACN,CAAC;IAPe,iCAAqB,wBAOpC,CAAA;IAED,SAAgB,sBAAsB,CAAC,WAAyB;QAC5D,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,CACH,WAAW,CAAC,IAAI,KAAK,WAAW;YAChC,CAAC,WAAW,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,WAAW,CAAC,4BAA4B,CAAC,CACrF,CAAC;IACN,CAAC;IARe,kCAAsB,yBAQrC,CAAA;IAED,SAAgB,oBAAoB,CAAC,WAAyB;QAC1D,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QAED,6FAA6F;QAC7F,OAAO,WAAW,CAAC,IAAI,KAAK,aAAa,IAAI,WAAW,CAAC,IAAI,KAAK,MAAM,CAAC;IAC7E,CAAC;IAPe,gCAAoB,uBAOnC,CAAA;IAED,SAAgB,gBAAgB,CAAC,WAAwB;QACrD,8DAA8D;QAC9D,OAAO,WAAW,CAAC,IAAI,KAAK,aAAa,CAAC;IAC9C,CAAC;IAHe,4BAAgB,mBAG/B,CAAA;AACL,CAAC,EAtCgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAsC3B"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2022 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 interface BlockedRepository {
7
+ id: number;
8
+ urlRegexp: string;
9
+ blockUser: boolean;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ //# sourceMappingURL=blocked-repositories-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocked-repositories-protocol.d.ts","sourceRoot":"","sources":["../src/blocked-repositories-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2022 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
+ //# sourceMappingURL=blocked-repositories-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocked-repositories-protocol.js","sourceRoot":"","sources":["../src/blocked-repositories-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,30 @@
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 { Workspace } from ".";
7
+ /**
8
+ * The whole point of these methods is to overcome inconsistencies in our data model.
9
+ * Ideally we remove it at some point once we fixed our model, as it:
10
+ * - duplicates logic
11
+ * - but additional burden on clients (using this, copying this to other languages!)
12
+ *
13
+ * TODO(gpl) See if we can get this into `server` code to remove the burden from clients
14
+ */
15
+ export declare namespace ContextURL {
16
+ const PREBUILD_PREFIX = "prebuild";
17
+ const IMAGEBUILD_PREFIX = "imagebuild";
18
+ const SNAPSHOT_PREFIX = "snapshot";
19
+ const REFERRER_PREFIX = "referrer:";
20
+ /**
21
+ * This function will (try to) return the HTTP(S) URL of the context the user originally created this workspace on.
22
+ * Especially it will not contain any modifiers or be of different scheme than HTTP(S).
23
+ *
24
+ * Use this function if you need to provided a _working_ URL to the original context.
25
+ * @param ws
26
+ * @returns
27
+ */
28
+ function getNormalizedURL(ws: Pick<Workspace, "context" | "contextURL"> | undefined): URL | undefined;
29
+ }
30
+ //# sourceMappingURL=context-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-url.d.ts","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE9B;;;;;;;GAOG;AACH,yBAAiB,UAAU,CAAC;IACjB,MAAM,eAAe,aAAa,CAAC;IACnC,MAAM,iBAAiB,eAAe,CAAC;IACvC,MAAM,eAAe,aAAa,CAAC;IACnC,MAAM,eAAe,cAAc,CAAC;IAE3C;;;;;;;OAOG;IACH,SAAgB,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,CAY3G;CAgEJ"}
@@ -0,0 +1,100 @@
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.ContextURL = void 0;
9
+ /**
10
+ * The whole point of these methods is to overcome inconsistencies in our data model.
11
+ * Ideally we remove it at some point once we fixed our model, as it:
12
+ * - duplicates logic
13
+ * - but additional burden on clients (using this, copying this to other languages!)
14
+ *
15
+ * TODO(gpl) See if we can get this into `server` code to remove the burden from clients
16
+ */
17
+ var ContextURL;
18
+ (function (ContextURL) {
19
+ ContextURL.PREBUILD_PREFIX = "prebuild";
20
+ ContextURL.IMAGEBUILD_PREFIX = "imagebuild";
21
+ ContextURL.SNAPSHOT_PREFIX = "snapshot";
22
+ ContextURL.REFERRER_PREFIX = "referrer:";
23
+ /**
24
+ * This function will (try to) return the HTTP(S) URL of the context the user originally created this workspace on.
25
+ * Especially it will not contain any modifiers or be of different scheme than HTTP(S).
26
+ *
27
+ * Use this function if you need to provided a _working_ URL to the original context.
28
+ * @param ws
29
+ * @returns
30
+ */
31
+ function getNormalizedURL(ws) {
32
+ const normalized = normalize(ws);
33
+ if (!normalized) {
34
+ return undefined;
35
+ }
36
+ try {
37
+ return new URL(normalized);
38
+ }
39
+ catch (err) {
40
+ console.debug(`unable to parse URL from normalized contextURL: '${normalized}'`);
41
+ }
42
+ return undefined;
43
+ }
44
+ ContextURL.getNormalizedURL = getNormalizedURL;
45
+ function normalize(ws) {
46
+ if (!ws) {
47
+ return undefined;
48
+ }
49
+ if (ws.context.normalizedContextURL) {
50
+ return ws.context.normalizedContextURL;
51
+ }
52
+ // fallback: we do not yet set normalizedContextURL on all workspaces, yet, let alone older existing workspaces
53
+ let fallback = undefined;
54
+ try {
55
+ fallback = removePrefixes(ws.contextURL);
56
+ }
57
+ catch (err) {
58
+ console.error(`unable to remove prefixes from contextURL: '${ws.contextURL}'`, err);
59
+ }
60
+ return fallback;
61
+ }
62
+ /**
63
+ * The field "contextUrl" might contain prefixes like:
64
+ * - envvar1=value1/...
65
+ * - prebuild/...
66
+ * This is the analogon to the (Prefix)ContextParser structure in "server".
67
+ */
68
+ function removePrefixes(contextUrl) {
69
+ if (contextUrl === undefined) {
70
+ return undefined;
71
+ }
72
+ const segments = contextUrl.split("/");
73
+ if (segments.length === 1) {
74
+ return segments[0]; // this might be something, we just try
75
+ }
76
+ const segmentsToURL = (offset) => {
77
+ let rest = segments.slice(offset).join("/");
78
+ if (/^git@[^:\/]+:/.test(rest)) {
79
+ rest = rest.replace(/^git@([^:\/]+):/, "https://$1/");
80
+ }
81
+ if (!rest.startsWith("http")) {
82
+ rest = "https://" + rest;
83
+ }
84
+ return rest;
85
+ };
86
+ const firstSegment = segments[0];
87
+ if (firstSegment === ContextURL.PREBUILD_PREFIX ||
88
+ firstSegment === ContextURL.IMAGEBUILD_PREFIX ||
89
+ firstSegment === ContextURL.SNAPSHOT_PREFIX ||
90
+ firstSegment.startsWith(ContextURL.REFERRER_PREFIX)) {
91
+ return segmentsToURL(1);
92
+ }
93
+ // check for env vars
94
+ if (firstSegment.indexOf("=") !== -1) {
95
+ return segmentsToURL(1);
96
+ }
97
+ return segmentsToURL(0);
98
+ }
99
+ })(ContextURL = exports.ContextURL || (exports.ContextURL = {}));
100
+ //# sourceMappingURL=context-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-url.js","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH;;;;;;;GAOG;AACH,IAAiB,UAAU,CA0F1B;AA1FD,WAAiB,UAAU;IACV,0BAAe,GAAG,UAAU,CAAC;IAC7B,4BAAiB,GAAG,YAAY,CAAC;IACjC,0BAAe,GAAG,UAAU,CAAC;IAC7B,0BAAe,GAAG,WAAW,CAAC;IAE3C;;;;;;;OAOG;IACH,SAAgB,gBAAgB,CAAC,EAAyD;QACtF,MAAM,UAAU,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,SAAS,CAAC;SACpB;QAED,IAAI;YACA,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;SAC9B;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,oDAAoD,UAAU,GAAG,CAAC,CAAC;SACpF;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAZe,2BAAgB,mBAY/B,CAAA;IAED,SAAS,SAAS,CAAC,EAAyD;QACxE,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,SAAS,CAAC;SACpB;QACD,IAAI,EAAE,CAAC,OAAO,CAAC,oBAAoB,EAAE;YACjC,OAAO,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC;SAC1C;QAED,+GAA+G;QAC/G,IAAI,QAAQ,GAAuB,SAAS,CAAC;QAC7C,IAAI;YACA,QAAQ,GAAG,cAAc,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;SAC5C;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,CAAC,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC;SACvF;QACD,OAAO,QAAQ,CAAC;IACpB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,QA0F1B"}
@@ -0,0 +1,12 @@
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 class ContextUrlTest {
7
+ parseContextUrl_withEnvVar(): void;
8
+ parseContextUrl_withEnvVar_withoutSchema(): void;
9
+ parseContextUrl_withEnvVar_sshUrl(): void;
10
+ parseContextUrl_badUrl(): void;
11
+ }
12
+ //# sourceMappingURL=context-url.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-url.spec.d.ts","sourceRoot":"","sources":["../src/context-url.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,qBACa,cAAc;IACV,0BAA0B;IAS1B,wCAAwC;IASxC,iCAAiC;IASjC,sBAAsB;CAItC"}
@@ -0,0 +1,81 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ContextUrlTest = void 0;
18
+ const chai = require("chai");
19
+ const mocha_typescript_1 = require("mocha-typescript");
20
+ const context_url_1 = require("./context-url");
21
+ const expect = chai.expect;
22
+ let ContextUrlTest = class ContextUrlTest {
23
+ parseContextUrl_withEnvVar() {
24
+ const actual = context_url_1.ContextURL.getNormalizedURL({
25
+ contextURL: "passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo",
26
+ context: {},
27
+ });
28
+ expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
29
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
30
+ }
31
+ parseContextUrl_withEnvVar_withoutSchema() {
32
+ const actual = context_url_1.ContextURL.getNormalizedURL({
33
+ contextURL: "passedin=test%20value/github.com/gitpod-io/gitpod-test-repo",
34
+ context: {},
35
+ });
36
+ expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
37
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
38
+ }
39
+ parseContextUrl_withEnvVar_sshUrl() {
40
+ const actual = context_url_1.ContextURL.getNormalizedURL({
41
+ contextURL: "passedin=test%20value/git@github.com:gitpod-io/gitpod-test-repo.git",
42
+ context: {},
43
+ });
44
+ expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
45
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo.git");
46
+ }
47
+ parseContextUrl_badUrl() {
48
+ const actual = context_url_1.ContextURL.getNormalizedURL({ contextURL: "[Object object]", context: {} });
49
+ expect(actual).to.be.undefined;
50
+ }
51
+ };
52
+ __decorate([
53
+ mocha_typescript_1.test,
54
+ __metadata("design:type", Function),
55
+ __metadata("design:paramtypes", []),
56
+ __metadata("design:returntype", void 0)
57
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar", null);
58
+ __decorate([
59
+ mocha_typescript_1.test,
60
+ __metadata("design:type", Function),
61
+ __metadata("design:paramtypes", []),
62
+ __metadata("design:returntype", void 0)
63
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar_withoutSchema", null);
64
+ __decorate([
65
+ mocha_typescript_1.test,
66
+ __metadata("design:type", Function),
67
+ __metadata("design:paramtypes", []),
68
+ __metadata("design:returntype", void 0)
69
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar_sshUrl", null);
70
+ __decorate([
71
+ mocha_typescript_1.test,
72
+ __metadata("design:type", Function),
73
+ __metadata("design:paramtypes", []),
74
+ __metadata("design:returntype", void 0)
75
+ ], ContextUrlTest.prototype, "parseContextUrl_badUrl", null);
76
+ ContextUrlTest = __decorate([
77
+ mocha_typescript_1.suite
78
+ ], ContextUrlTest);
79
+ exports.ContextUrlTest = ContextUrlTest;
80
+ module.exports = new ContextUrlTest();
81
+ //# sourceMappingURL=context-url.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-url.spec.js","sourceRoot":"","sources":["../src/context-url.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,6BAA6B;AAC7B,uDAA+C;AAE/C,+CAA2C;AAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAK3B,IAAa,cAAc,GAA3B,MAAa,cAAc;IACV,0BAA0B;QACnC,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC;YACvC,UAAU,EAAE,qEAAqE;YACjF,OAAO,EAAE,EAAE;SACE,CAAC,CAAC;QACnB,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACrE,CAAC;IAEY,wCAAwC;QACjD,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC;YACvC,UAAU,EAAE,6DAA6D;YACzE,OAAO,EAAE,EAAE;SACE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