@gitpod/gitpod-protocol 0.1.5-wth-test.41 → 0.1.5-wv-add-image-builds-to-dashboard.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 (431) hide show
  1. package/data/gitpod-schema.json +150 -8
  2. package/lib/accounting-protocol.d.ts +19 -11
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +35 -33
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +29 -1
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +1 -1
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +5 -6
  11. package/lib/analytics.d.ts.map +1 -1
  12. package/lib/analytics.js +1 -1
  13. package/lib/analytics.js.map +1 -1
  14. package/lib/attribution.d.ts +24 -0
  15. package/lib/attribution.d.ts.map +1 -0
  16. package/lib/attribution.js +54 -0
  17. package/lib/attribution.js.map +1 -0
  18. package/lib/auth.d.ts +1 -1
  19. package/lib/auth.d.ts.map +1 -1
  20. package/lib/auth.js +1 -1
  21. package/lib/billing-mode.d.ts +45 -0
  22. package/lib/billing-mode.d.ts.map +1 -0
  23. package/lib/billing-mode.js +44 -0
  24. package/lib/billing-mode.js.map +1 -0
  25. package/lib/blocked-repositories-protocol.d.ts +13 -0
  26. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  27. package/lib/blocked-repositories-protocol.js +8 -0
  28. package/lib/blocked-repositories-protocol.js.map +1 -0
  29. package/lib/context-url.d.ts +19 -7
  30. package/lib/context-url.d.ts.map +1 -1
  31. package/lib/context-url.js +60 -9
  32. package/lib/context-url.js.map +1 -1
  33. package/lib/context-url.spec.d.ts +3 -3
  34. package/lib/context-url.spec.d.ts.map +1 -1
  35. package/lib/context-url.spec.js +20 -12
  36. package/lib/context-url.spec.js.map +1 -1
  37. package/lib/encryption/container-module.d.ts +1 -1
  38. package/lib/encryption/container-module.d.ts.map +1 -1
  39. package/lib/encryption/container-module.js +2 -2
  40. package/lib/encryption/container-module.js.map +1 -1
  41. package/lib/encryption/encryption-engine.d.ts +1 -1
  42. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  43. package/lib/encryption/encryption-engine.js +10 -10
  44. package/lib/encryption/encryption-engine.js.map +1 -1
  45. package/lib/encryption/encryption-engine.spec.d.ts +1 -1
  46. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  47. package/lib/encryption/encryption-engine.spec.js +3 -4
  48. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  49. package/lib/encryption/encryption-service.d.ts +1 -1
  50. package/lib/encryption/encryption-service.d.ts.map +1 -1
  51. package/lib/encryption/encryption-service.js +2 -2
  52. package/lib/encryption/encryption-service.js.map +1 -1
  53. package/lib/encryption/key-provider.d.ts +1 -1
  54. package/lib/encryption/key-provider.d.ts.map +1 -1
  55. package/lib/encryption/key-provider.js +8 -10
  56. package/lib/encryption/key-provider.js.map +1 -1
  57. package/lib/env.d.ts +1 -6
  58. package/lib/env.d.ts.map +1 -1
  59. package/lib/env.js +2 -21
  60. package/lib/env.js.map +1 -1
  61. package/lib/experiments/always-default.d.ts +8 -0
  62. package/lib/experiments/always-default.d.ts.map +1 -0
  63. package/lib/experiments/always-default.js +20 -0
  64. package/lib/experiments/always-default.js.map +1 -0
  65. package/lib/experiments/configcat-server.d.ts +10 -0
  66. package/lib/experiments/configcat-server.d.ts.map +1 -0
  67. package/lib/experiments/configcat-server.js +37 -0
  68. package/lib/experiments/configcat-server.js.map +1 -0
  69. package/lib/experiments/configcat.d.ts +21 -0
  70. package/lib/experiments/configcat.d.ts.map +1 -0
  71. package/lib/experiments/configcat.js +51 -0
  72. package/lib/experiments/configcat.js.map +1 -0
  73. package/lib/experiments/types.d.ts +22 -0
  74. package/lib/experiments/types.d.ts.map +1 -0
  75. package/lib/experiments/types.js +10 -0
  76. package/lib/experiments/types.js.map +1 -0
  77. package/lib/gitpod-file-parser.d.ts +1 -1
  78. package/lib/gitpod-file-parser.d.ts.map +1 -1
  79. package/lib/gitpod-file-parser.js +7 -7
  80. package/lib/gitpod-file-parser.js.map +1 -1
  81. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  82. package/lib/gitpod-file-parser.spec.js +43 -40
  83. package/lib/gitpod-file-parser.spec.js.map +1 -1
  84. package/lib/gitpod-service.d.ts +93 -48
  85. package/lib/gitpod-service.d.ts.map +1 -1
  86. package/lib/gitpod-service.js +57 -36
  87. package/lib/gitpod-service.js.map +1 -1
  88. package/lib/headless-workspace-log.d.ts +2 -1
  89. package/lib/headless-workspace-log.d.ts.map +1 -1
  90. package/lib/headless-workspace-log.js +3 -2
  91. package/lib/headless-workspace-log.js.map +1 -1
  92. package/lib/ide-frontend-service.d.ts +2 -2
  93. package/lib/ide-frontend-service.js +1 -1
  94. package/lib/ide-protocol.d.ts +126 -0
  95. package/lib/ide-protocol.d.ts.map +1 -0
  96. package/lib/ide-protocol.js +18 -0
  97. package/lib/ide-protocol.js.map +1 -0
  98. package/lib/index.d.ts +17 -15
  99. package/lib/index.d.ts.map +1 -1
  100. package/lib/index.js +4 -2
  101. package/lib/index.js.map +1 -1
  102. package/lib/installation-admin-protocol.d.ts +30 -0
  103. package/lib/installation-admin-protocol.d.ts.map +1 -0
  104. package/lib/installation-admin-protocol.js +31 -0
  105. package/lib/installation-admin-protocol.js.map +1 -0
  106. package/lib/license-protocol.d.ts +8 -1
  107. package/lib/license-protocol.d.ts.map +1 -1
  108. package/lib/license-protocol.js +1 -1
  109. package/lib/license-protocol.js.map +1 -1
  110. package/lib/messaging/browser/connection.d.ts +1 -1
  111. package/lib/messaging/browser/connection.d.ts.map +1 -1
  112. package/lib/messaging/browser/connection.js +19 -19
  113. package/lib/messaging/browser/connection.js.map +1 -1
  114. package/lib/messaging/browser/window-connection.d.ts +5 -5
  115. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  116. package/lib/messaging/browser/window-connection.js +10 -7
  117. package/lib/messaging/browser/window-connection.js.map +1 -1
  118. package/lib/messaging/client-call-metrics.d.ts +5 -19
  119. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  120. package/lib/messaging/client-call-metrics.js +35 -23
  121. package/lib/messaging/client-call-metrics.js.map +1 -1
  122. package/lib/messaging/error.d.ts +11 -2
  123. package/lib/messaging/error.d.ts.map +1 -1
  124. package/lib/messaging/error.js +22 -4
  125. package/lib/messaging/error.js.map +1 -1
  126. package/lib/messaging/handler.d.ts.map +1 -1
  127. package/lib/messaging/handler.js +1 -1
  128. package/lib/messaging/node/connection.d.ts +1 -17
  129. package/lib/messaging/node/connection.d.ts.map +1 -1
  130. package/lib/messaging/node/connection.js +23 -59
  131. package/lib/messaging/node/connection.js.map +1 -1
  132. package/lib/messaging/proxy-factory.d.ts +1 -1
  133. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  134. package/lib/messaging/proxy-factory.js +7 -9
  135. package/lib/messaging/proxy-factory.js.map +1 -1
  136. package/lib/oss-allowlist.d.ts +14 -0
  137. package/lib/oss-allowlist.d.ts.map +1 -0
  138. package/lib/oss-allowlist.js +8 -0
  139. package/lib/oss-allowlist.js.map +1 -0
  140. package/lib/payment-protocol.d.ts +1 -1
  141. package/lib/payment-protocol.d.ts.map +1 -1
  142. package/lib/payment-protocol.js +2 -2
  143. package/lib/payment-protocol.js.map +1 -1
  144. package/lib/permission.d.ts +10 -4
  145. package/lib/permission.d.ts.map +1 -1
  146. package/lib/permission.js +35 -26
  147. package/lib/permission.js.map +1 -1
  148. package/lib/plans.d.ts +5 -4
  149. package/lib/plans.d.ts.map +1 -1
  150. package/lib/plans.js +211 -172
  151. package/lib/plans.js.map +1 -1
  152. package/lib/protocol.d.ts +192 -99
  153. package/lib/protocol.d.ts.map +1 -1
  154. package/lib/protocol.js +293 -105
  155. package/lib/protocol.js.map +1 -1
  156. package/lib/protocol.spec.d.ts +7 -0
  157. package/lib/protocol.spec.d.ts.map +1 -0
  158. package/lib/protocol.spec.js +127 -0
  159. package/lib/protocol.spec.js.map +1 -0
  160. package/lib/snapshot-url.d.ts +1 -1
  161. package/lib/snapshot-url.js +1 -1
  162. package/lib/snapshot-url.spec.d.ts +1 -1
  163. package/lib/snapshot-url.spec.js +1 -1
  164. package/lib/snapshot-url.spec.js.map +1 -1
  165. package/lib/team-subscription-protocol.d.ts +23 -4
  166. package/lib/team-subscription-protocol.d.ts.map +1 -1
  167. package/lib/team-subscription-protocol.js +21 -6
  168. package/lib/team-subscription-protocol.js.map +1 -1
  169. package/lib/teams-projects-protocol.d.ts +35 -5
  170. package/lib/teams-projects-protocol.d.ts.map +1 -1
  171. package/lib/teams-projects-protocol.js +9 -2
  172. package/lib/teams-projects-protocol.js.map +1 -1
  173. package/lib/typings/globals.d.ts +3 -3
  174. package/lib/typings/globals.d.ts.map +1 -1
  175. package/lib/typings/globals.js +1 -1
  176. package/lib/usage.d.ts +73 -0
  177. package/lib/usage.d.ts.map +1 -0
  178. package/lib/usage.js +20 -0
  179. package/lib/usage.js.map +1 -0
  180. package/lib/util/analytics.d.ts +1 -1
  181. package/lib/util/analytics.d.ts.map +1 -1
  182. package/lib/util/analytics.js +13 -4
  183. package/lib/util/analytics.js.map +1 -1
  184. package/lib/util/async-iterator.d.ts +1 -1
  185. package/lib/util/async-iterator.d.ts.map +1 -1
  186. package/lib/util/async-iterator.js +4 -4
  187. package/lib/util/async-iterator.js.map +1 -1
  188. package/lib/util/cancelable.d.ts +1 -1
  189. package/lib/util/cancelable.js +1 -1
  190. package/lib/util/cancelable.js.map +1 -1
  191. package/lib/util/date-time.d.ts +1 -1
  192. package/lib/util/date-time.js +7 -7
  193. package/lib/util/date-time.js.map +1 -1
  194. package/lib/util/debug-app.d.ts +25 -0
  195. package/lib/util/debug-app.d.ts.map +1 -0
  196. package/lib/util/debug-app.js +100 -0
  197. package/lib/util/debug-app.js.map +1 -0
  198. package/lib/util/deep-partial.d.ts +1 -1
  199. package/lib/util/deep-partial.js +1 -1
  200. package/lib/util/deferred.d.ts +1 -1
  201. package/lib/util/deferred.js +1 -1
  202. package/lib/util/deferred.js.map +1 -1
  203. package/lib/util/disposable.d.ts.map +1 -1
  204. package/lib/util/disposable.js +2 -2
  205. package/lib/util/disposable.js.map +1 -1
  206. package/lib/util/event.d.ts.map +1 -1
  207. package/lib/util/event.js +5 -3
  208. package/lib/util/event.js.map +1 -1
  209. package/lib/util/garbage-collected-cache.d.ts +2 -1
  210. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  211. package/lib/util/garbage-collected-cache.js +12 -3
  212. package/lib/util/garbage-collected-cache.js.map +1 -1
  213. package/lib/util/generate-workspace-id.d.ts +6 -1
  214. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  215. package/lib/util/generate-workspace-id.js +461 -440
  216. package/lib/util/generate-workspace-id.js.map +1 -1
  217. package/lib/util/generate-workspace-id.spec.d.ts +1 -1
  218. package/lib/util/generate-workspace-id.spec.js +37 -2
  219. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  220. package/lib/util/gitpod-cookie.d.ts +2 -2
  221. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  222. package/lib/util/gitpod-cookie.js +1 -4
  223. package/lib/util/gitpod-cookie.js.map +1 -1
  224. package/lib/util/gitpod-host-url.d.ts +6 -2
  225. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  226. package/lib/util/gitpod-host-url.js +61 -37
  227. package/lib/util/gitpod-host-url.js.map +1 -1
  228. package/lib/util/gitpod-host-url.spec.d.ts +1 -1
  229. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  230. package/lib/util/gitpod-host-url.spec.js +16 -6
  231. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  232. package/lib/util/grpc.d.ts +21 -1
  233. package/lib/util/grpc.d.ts.map +1 -1
  234. package/lib/util/grpc.js +74 -2
  235. package/lib/util/grpc.js.map +1 -1
  236. package/lib/util/jaeger-client-types.d.ts +68 -0
  237. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  238. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +2 -2
  239. package/lib/util/jaeger-client-types.js.map +1 -0
  240. package/lib/util/logging.d.ts +2 -2
  241. package/lib/util/logging.d.ts.map +1 -1
  242. package/lib/util/logging.js +32 -26
  243. package/lib/util/logging.js.map +1 -1
  244. package/lib/util/logging.spec.d.ts +7 -0
  245. package/lib/util/logging.spec.d.ts.map +1 -0
  246. package/lib/util/logging.spec.js +52 -0
  247. package/lib/util/logging.spec.js.map +1 -0
  248. package/lib/util/make-link.d.ts +1 -1
  249. package/lib/util/make-link.js +6 -6
  250. package/lib/util/make-link.js.map +1 -1
  251. package/lib/util/nice-grpc.d.ts +9 -0
  252. package/lib/util/nice-grpc.d.ts.map +1 -0
  253. package/lib/util/nice-grpc.js +121 -0
  254. package/lib/util/nice-grpc.js.map +1 -0
  255. package/lib/util/parse-workspace-id.d.ts +1 -1
  256. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  257. package/lib/util/parse-workspace-id.js +3 -4
  258. package/lib/util/parse-workspace-id.js.map +1 -1
  259. package/lib/util/parse-workspace-id.spec.d.ts +1 -1
  260. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  261. package/lib/util/parse-workspace-id.spec.js +1 -1
  262. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  263. package/lib/util/queue.d.ts +1 -1
  264. package/lib/util/queue.js +1 -1
  265. package/lib/util/queue.spec.d.ts +1 -1
  266. package/lib/util/queue.spec.js +10 -7
  267. package/lib/util/queue.spec.js.map +1 -1
  268. package/lib/util/repeat.d.ts +15 -0
  269. package/lib/util/repeat.d.ts.map +1 -0
  270. package/lib/util/repeat.js +55 -0
  271. package/lib/util/repeat.js.map +1 -0
  272. package/lib/util/semaphore.d.ts +1 -1
  273. package/lib/util/semaphore.d.ts.map +1 -1
  274. package/lib/util/semaphore.js +1 -1
  275. package/lib/util/semaphore.js.map +1 -1
  276. package/lib/util/skip-if.d.ts +1 -1
  277. package/lib/util/skip-if.d.ts.map +1 -1
  278. package/lib/util/skip-if.js +1 -1
  279. package/lib/util/skip-if.js.map +1 -1
  280. package/lib/util/timeutil.d.ts +3 -1
  281. package/lib/util/timeutil.d.ts.map +1 -1
  282. package/lib/util/timeutil.js +16 -4
  283. package/lib/util/timeutil.js.map +1 -1
  284. package/lib/util/timeutil.spec.d.ts +3 -1
  285. package/lib/util/timeutil.spec.d.ts.map +1 -1
  286. package/lib/util/timeutil.spec.js +35 -1
  287. package/lib/util/timeutil.spec.js.map +1 -1
  288. package/lib/util/tracing.d.ts +53 -7
  289. package/lib/util/tracing.d.ts.map +1 -1
  290. package/lib/util/tracing.js +157 -20
  291. package/lib/util/tracing.js.map +1 -1
  292. package/lib/util/tracing.spec.d.ts +7 -0
  293. package/lib/util/tracing.spec.d.ts.map +1 -0
  294. package/lib/util/tracing.spec.js +121 -0
  295. package/lib/util/tracing.spec.js.map +1 -0
  296. package/lib/util/workspace-port-authentication.d.ts +8 -8
  297. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  298. package/lib/util/workspace-port-authentication.js +9 -12
  299. package/lib/util/workspace-port-authentication.js.map +1 -1
  300. package/lib/webhook-event.d.ts +44 -0
  301. package/lib/webhook-event.d.ts.map +1 -0
  302. package/lib/webhook-event.js +8 -0
  303. package/lib/webhook-event.js.map +1 -0
  304. package/lib/workspace-class.d.ts +14 -0
  305. package/lib/workspace-class.d.ts.map +1 -0
  306. package/lib/workspace-class.js +8 -0
  307. package/lib/workspace-class.js.map +1 -0
  308. package/lib/workspace-cluster.d.ts +19 -18
  309. package/lib/workspace-cluster.d.ts.map +1 -1
  310. package/lib/workspace-cluster.js +17 -2
  311. package/lib/workspace-cluster.js.map +1 -1
  312. package/lib/workspace-instance.d.ts +41 -4
  313. package/lib/workspace-instance.d.ts.map +1 -1
  314. package/lib/workspace-instance.js +1 -1
  315. package/lib/wsready.d.ts +8 -2
  316. package/lib/wsready.d.ts.map +1 -1
  317. package/lib/wsready.js +3 -3
  318. package/package.json +18 -8
  319. package/pkg-yarn.lock +11 -6
  320. package/provenance-bundle.jsonl +2 -0
  321. package/src/accounting-protocol.ts +67 -52
  322. package/src/admin-protocol.ts +59 -19
  323. package/src/analytics.ts +27 -29
  324. package/src/attribution.ts +63 -0
  325. package/src/auth.ts +3 -3
  326. package/src/billing-mode.ts +84 -0
  327. package/src/blocked-repositories-protocol.ts +13 -0
  328. package/src/context-url.spec.ts +25 -15
  329. package/src/context-url.ts +93 -37
  330. package/src/encryption/container-module.ts +3 -4
  331. package/src/encryption/encryption-engine.spec.ts +10 -9
  332. package/src/encryption/encryption-engine.ts +21 -17
  333. package/src/encryption/encryption-service.ts +5 -6
  334. package/src/encryption/key-provider.ts +17 -20
  335. package/src/env.ts +2 -25
  336. package/src/experiments/always-default.ts +24 -0
  337. package/src/experiments/configcat-server.ts +42 -0
  338. package/src/experiments/configcat.ts +56 -0
  339. package/src/experiments/types.ts +34 -0
  340. package/src/gitpod-file-parser.spec.ts +56 -62
  341. package/src/gitpod-file-parser.ts +17 -18
  342. package/src/gitpod-service.ts +241 -134
  343. package/src/headless-workspace-log.ts +7 -5
  344. package/src/ide-frontend-service.ts +3 -3
  345. package/src/ide-protocol.ts +147 -0
  346. package/src/index.ts +17 -15
  347. package/src/installation-admin-protocol.ts +45 -0
  348. package/src/license-protocol.ts +13 -7
  349. package/src/messaging/browser/connection.ts +45 -47
  350. package/src/messaging/browser/window-connection.ts +40 -30
  351. package/src/messaging/client-call-metrics.ts +79 -82
  352. package/src/messaging/error.ts +33 -8
  353. package/src/messaging/handler.ts +6 -6
  354. package/src/messaging/node/connection.ts +23 -70
  355. package/src/messaging/proxy-factory.ts +23 -30
  356. package/src/oss-allowlist.ts +15 -0
  357. package/src/payment-protocol.ts +3 -3
  358. package/src/permission.ts +41 -33
  359. package/src/plans.ts +241 -190
  360. package/src/protocol.spec.ts +97 -0
  361. package/src/protocol.ts +557 -297
  362. package/src/snapshot-url.spec.ts +10 -8
  363. package/src/snapshot-url.ts +1 -1
  364. package/src/team-subscription-protocol.ts +60 -23
  365. package/src/teams-projects-protocol.ts +51 -12
  366. package/src/typings/globals.ts +5 -5
  367. package/src/usage.ts +85 -0
  368. package/src/util/analytics.ts +47 -25
  369. package/src/util/async-iterator.ts +5 -6
  370. package/src/util/cancelable.ts +4 -4
  371. package/src/util/date-time.ts +9 -9
  372. package/src/util/debug-app.ts +81 -0
  373. package/src/util/deep-partial.ts +1 -1
  374. package/src/util/deferred.ts +7 -7
  375. package/src/util/disposable.ts +3 -6
  376. package/src/util/event.ts +9 -11
  377. package/src/util/garbage-collected-cache.ts +15 -7
  378. package/src/util/generate-workspace-id.spec.ts +35 -8
  379. package/src/util/generate-workspace-id.ts +465 -441
  380. package/src/util/gitpod-cookie.ts +9 -10
  381. package/src/util/gitpod-host-url.spec.ts +41 -14
  382. package/src/util/gitpod-host-url.ts +70 -42
  383. package/src/util/grpc.ts +94 -2
  384. package/src/util/jaeger-client-types.ts +102 -0
  385. package/src/util/logging.spec.ts +23 -0
  386. package/src/util/logging.ts +61 -43
  387. package/src/util/make-link.ts +7 -8
  388. package/src/util/nice-grpc.ts +96 -0
  389. package/src/util/parse-workspace-id.spec.ts +18 -9
  390. package/src/util/parse-workspace-id.ts +7 -8
  391. package/src/util/queue.spec.ts +28 -26
  392. package/src/util/queue.ts +1 -1
  393. package/src/util/repeat.ts +45 -0
  394. package/src/util/semaphore.ts +5 -7
  395. package/src/util/skip-if.ts +10 -7
  396. package/src/util/timeutil.spec.ts +41 -15
  397. package/src/util/timeutil.ts +28 -12
  398. package/src/util/tracing.spec.ts +88 -0
  399. package/src/util/tracing.ts +201 -32
  400. package/src/util/workspace-port-authentication.ts +11 -14
  401. package/src/webhook-event.ts +55 -0
  402. package/src/workspace-class.ts +14 -0
  403. package/src/workspace-cluster.ts +35 -21
  404. package/src/workspace-instance.ts +83 -21
  405. package/src/wsready.ts +11 -4
  406. package/data/builtin-theia-plugins.json +0 -372
  407. package/lib/email-protocol.d.ts +0 -49
  408. package/lib/email-protocol.d.ts.map +0 -1
  409. package/lib/email-protocol.js +0 -28
  410. package/lib/email-protocol.js.map +0 -1
  411. package/lib/messaging/connection-error-handler.d.ts +0 -27
  412. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  413. package/lib/messaging/connection-error-handler.js +0 -34
  414. package/lib/messaging/connection-error-handler.js.map +0 -1
  415. package/lib/theia-plugins.d.ts +0 -11
  416. package/lib/theia-plugins.d.ts.map +0 -1
  417. package/lib/theia-plugins.js.map +0 -1
  418. package/lib/util/repeater.d.ts +0 -22
  419. package/lib/util/repeater.d.ts.map +0 -1
  420. package/lib/util/repeater.js +0 -65
  421. package/lib/util/repeater.js.map +0 -1
  422. package/lib/util/safe-promise.d.ts +0 -11
  423. package/lib/util/safe-promise.d.ts.map +0 -1
  424. package/lib/util/safe-promise.js +0 -31
  425. package/lib/util/safe-promise.js.map +0 -1
  426. package/src/email-protocol.ts +0 -66
  427. package/src/messaging/connection-error-handler.ts +0 -62
  428. package/src/theia-plugins.ts +0 -11
  429. package/src/util/jaeger-client.d.ts +0 -105
  430. package/src/util/repeater.ts +0 -49
  431. package/src/util/safe-promise.ts +0 -26
@@ -0,0 +1,24 @@
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 create(userOrTeam: User | Team): AttributionId;
20
+ function parse(s: string): UserAttributionId | TeamAttributionId | undefined;
21
+ function render(id: AttributionId): string;
22
+ function equals(a: AttributionId, b: AttributionId): boolean;
23
+ }
24
+ //# 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,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,54 @@
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 create(userOrTeam) {
14
+ if (protocol_1.User.is(userOrTeam)) {
15
+ return { kind: "user", userId: userOrTeam.id };
16
+ }
17
+ else {
18
+ return { kind: "team", teamId: userOrTeam.id };
19
+ }
20
+ }
21
+ AttributionId.create = create;
22
+ function parse(s) {
23
+ if (!s) {
24
+ return undefined;
25
+ }
26
+ const parts = s.split(":");
27
+ if (parts.length !== 2) {
28
+ return undefined;
29
+ }
30
+ switch (parts[0]) {
31
+ case "user":
32
+ return { kind: "user", userId: parts[1] };
33
+ case "team":
34
+ return { kind: "team", teamId: parts[1] };
35
+ default:
36
+ return undefined;
37
+ }
38
+ }
39
+ AttributionId.parse = parse;
40
+ function render(id) {
41
+ switch (id.kind) {
42
+ case "user":
43
+ return `user${SEPARATOR}${id.userId}`;
44
+ case "team":
45
+ return `team${SEPARATOR}${id.teamId}`;
46
+ }
47
+ }
48
+ AttributionId.render = render;
49
+ function equals(a, b) {
50
+ return render(a) === render(b);
51
+ }
52
+ AttributionId.equals = equals;
53
+ })(AttributionId = exports.AttributionId || (exports.AttributionId = {}));
54
+ //# sourceMappingURL=attribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution.js","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yCAAkC;AAelC,IAAiB,aAAa,CAyC7B;AAzCD,WAAiB,aAAa;IAC1B,MAAM,SAAS,GAAG,GAAG,CAAC;IAEtB,SAAgB,MAAM,CAAC,UAAuB;QAC1C,IAAI,eAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;SAClD;aAAM;YACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;SAClD;IACL,CAAC;IANe,oBAAM,SAMrB,CAAA;IAED,SAAgB,KAAK,CAAC,CAAS;QAC3B,IAAI,CAAC,CAAC,EAAE;YACJ,OAAO,SAAS,CAAC;SACpB;QACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,OAAO,SAAS,CAAC;SACpB;QACD,QAAQ,KAAK,CAAC,CAAC,CAAC,EAAE;YACd,KAAK,MAAM;gBACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,KAAK,MAAM;gBACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C;gBACI,OAAO,SAAS,CAAC;SACxB;IACL,CAAC;IAhBe,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,EAzCgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAyC7B"}
package/lib/auth.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  export interface SelectAccountPayload {
7
7
  currentUser: {
package/lib/auth.d.ts.map CHANGED
@@ -1 +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,CAAA;CACJ;AACD,yBAAiB,oBAAoB,CAAC;IAClC,SAAgB,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,oBAAoB,CAE1D;CACJ"}
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 CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.SelectAccountPayload = void 0;
@@ -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
35
+ return billingMode.mode === "usage-based";
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,8DAA8D;QAC9D,OAAO,WAAW,CAAC,IAAI,KAAK,aAAa,CAAC;IAC9C,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"}
@@ -1,18 +1,30 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
+ */
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
5
14
  */
6
15
  export declare namespace ContextURL {
7
- const INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild";
8
16
  const PREBUILD_PREFIX = "prebuild";
9
17
  const IMAGEBUILD_PREFIX = "imagebuild";
18
+ const SNAPSHOT_PREFIX = "snapshot";
19
+ const REFERRER_PREFIX = "referrer:";
10
20
  /**
11
- * The field "contextUrl" might contain prefixes like:
12
- * - envvar1=value1/...
13
- * - prebuild/...
14
- * This is the analogon to the (Prefix)ContextParser structure in "server".
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
15
27
  */
16
- function parseToURL(contextUrl: string | undefined): URL | undefined;
28
+ function getNormalizedURL(ws: Pick<Workspace, "context" | "contextURL"> | undefined): URL | undefined;
17
29
  }
18
30
  //# sourceMappingURL=context-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-url.d.ts","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yBAAiB,UAAU,CAAC;IACnB,MAAM,2BAA2B,yBAAyB,CAAC;IAC3D,MAAM,eAAe,aAAa,CAAC;IACnC,MAAM,iBAAiB,eAAe,CAAC;IAE9C;;;;;OAKG;IACH,SAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,CAgC1E;CACF"}
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"}
@@ -2,40 +2,92 @@
2
2
  /**
3
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
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
+ */
9
17
  var ContextURL;
10
18
  (function (ContextURL) {
11
- ContextURL.INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild";
12
19
  ContextURL.PREBUILD_PREFIX = "prebuild";
13
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
+ }
14
62
  /**
15
63
  * The field "contextUrl" might contain prefixes like:
16
64
  * - envvar1=value1/...
17
65
  * - prebuild/...
18
66
  * This is the analogon to the (Prefix)ContextParser structure in "server".
19
67
  */
20
- function parseToURL(contextUrl) {
68
+ function removePrefixes(contextUrl) {
21
69
  if (contextUrl === undefined) {
22
70
  return undefined;
23
71
  }
24
72
  const segments = contextUrl.split("/");
25
73
  if (segments.length === 1) {
26
- return new URL(segments[0]); // this might be something, we just try
74
+ return segments[0]; // this might be something, we just try
27
75
  }
28
76
  const segmentsToURL = (offset) => {
29
77
  let rest = segments.slice(offset).join("/");
78
+ if (/^git@[^:\/]+:/.test(rest)) {
79
+ rest = rest.replace(/^git@([^:\/]+):/, "https://$1/");
80
+ }
30
81
  if (!rest.startsWith("http")) {
31
- rest = 'https://' + rest;
82
+ rest = "https://" + rest;
32
83
  }
33
- return new URL(rest);
84
+ return rest;
34
85
  };
35
86
  const firstSegment = segments[0];
36
87
  if (firstSegment === ContextURL.PREBUILD_PREFIX ||
37
- firstSegment === ContextURL.INCREMENTAL_PREBUILD_PREFIX ||
38
- firstSegment === ContextURL.IMAGEBUILD_PREFIX) {
88
+ firstSegment === ContextURL.IMAGEBUILD_PREFIX ||
89
+ firstSegment === ContextURL.SNAPSHOT_PREFIX ||
90
+ firstSegment.startsWith(ContextURL.REFERRER_PREFIX)) {
39
91
  return segmentsToURL(1);
40
92
  }
41
93
  // check for env vars
@@ -44,6 +96,5 @@ var ContextURL;
44
96
  }
45
97
  return segmentsToURL(0);
46
98
  }
47
- ContextURL.parseToURL = parseToURL;
48
99
  })(ContextURL = exports.ContextURL || (exports.ContextURL = {}));
49
100
  //# sourceMappingURL=context-url.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-url.js","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,IAAiB,UAAU,CA4C1B;AA5CD,WAAiB,UA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
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  export declare class ContextUrlTest {
7
7
  parseContextUrl_withEnvVar(): void;
8
8
  parseContextUrl_withEnvVar_withoutSchema(): void;
9
- parseContextUrl_withPrebuild(): void;
10
- parseContextUrl_withPrebuild_withoutSchema(): void;
9
+ parseContextUrl_withEnvVar_sshUrl(): void;
10
+ parseContextUrl_badUrl(): void;
11
11
  }
12
12
  //# sourceMappingURL=context-url.spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-url.spec.d.ts","sourceRoot":"","sources":["../src/context-url.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,qBACa,cAAc;IAEV,0BAA0B;IAM1B,wCAAwC;IAMxC,4BAA4B;IAM5B,0CAA0C;CAK1D"}
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"}
@@ -2,7 +2,7 @@
2
2
  /**
3
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
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -21,24 +21,32 @@ const context_url_1 = require("./context-url");
21
21
  const expect = chai.expect;
22
22
  let ContextUrlTest = class ContextUrlTest {
23
23
  parseContextUrl_withEnvVar() {
24
- const actual = context_url_1.ContextURL.parseToURL("passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo");
24
+ const actual = context_url_1.ContextURL.getNormalizedURL({
25
+ contextURL: "passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo",
26
+ context: {},
27
+ });
25
28
  expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
26
29
  expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
27
30
  }
28
31
  parseContextUrl_withEnvVar_withoutSchema() {
29
- const actual = context_url_1.ContextURL.parseToURL("passedin=test%20value/github.com/gitpod-io/gitpod-test-repo");
32
+ const actual = context_url_1.ContextURL.getNormalizedURL({
33
+ contextURL: "passedin=test%20value/github.com/gitpod-io/gitpod-test-repo",
34
+ context: {},
35
+ });
30
36
  expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
31
37
  expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
32
38
  }
33
- parseContextUrl_withPrebuild() {
34
- const actual = context_url_1.ContextURL.parseToURL("prebuild/https://github.com/gitpod-io/gitpod-test-repo");
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
+ });
35
44
  expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
36
- expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
45
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo.git");
37
46
  }
38
- parseContextUrl_withPrebuild_withoutSchema() {
39
- const actual = context_url_1.ContextURL.parseToURL("prebuild/github.com/gitpod-io/gitpod-test-repo");
40
- expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
41
- expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
47
+ parseContextUrl_badUrl() {
48
+ const actual = context_url_1.ContextURL.getNormalizedURL({ contextURL: "[Object object]", context: {} });
49
+ expect(actual).to.be.undefined;
42
50
  }
43
51
  };
44
52
  __decorate([
@@ -58,13 +66,13 @@ __decorate([
58
66
  __metadata("design:type", Function),
59
67
  __metadata("design:paramtypes", []),
60
68
  __metadata("design:returntype", void 0)
61
- ], ContextUrlTest.prototype, "parseContextUrl_withPrebuild", null);
69
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar_sshUrl", null);
62
70
  __decorate([
63
71
  mocha_typescript_1.test,
64
72
  __metadata("design:type", Function),
65
73
  __metadata("design:paramtypes", []),
66
74
  __metadata("design:returntype", void 0)
67
- ], ContextUrlTest.prototype, "parseContextUrl_withPrebuild_withoutSchema", null);
75
+ ], ContextUrlTest.prototype, "parseContextUrl_badUrl", null);
68
76
  ContextUrlTest = __decorate([
69
77
  mocha_typescript_1.suite
70
78
  ], ContextUrlTest);
@@ -1 +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;AAC/C,+CAA2C;AAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAa,cAAc,GAA3B,MAAa,cAAc;IAEV,0BAA0B;QACnC,MAAM,MAAM,GAAG,wBAAU,CAAC,UAAU,CAAC,qEAAqE,CAAC,CAAC;QAC5G,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,UAAU,CAAC,6DAA6D,CAAC,CAAC;QACpG,MAAM,CAAC,MAAM,a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,CAAC,EAAE,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzE,CAAC;IAEY,sBAAsB;QAC/B,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAAE,EAAkB,CAAC,CAAC;QAC3G,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IACnC,CAAC;CACJ,CAAA;AA/BS;IAAL,uBAAI;;;;gEAOJ;AAEK;IAAL,uBAAI;;;;8EAOJ;AAEK;IAAL,uBAAI;;;;uEAOJ;AAEK;IAAL,uBAAI;;;;4DAGJ;AA/BQ,cAAc;IAD1B,wBAAK;GACO,cAAc,CAgC1B;AAhCY,wCAAc;AAiC3B,MAAM,CAAC,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  import { interfaces } from "inversify";
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKvC;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,uBAMzC,CAAC"}
1
+ {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKvC;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,uBAKzC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  /**
3
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
8
  exports.encryptionModule = void 0;
@@ -19,7 +19,7 @@ const encryption_service_1 = require("./encryption-service");
19
19
  * };
20
20
  * }).inSingletonScope();
21
21
  */
22
- const encryptionModule = bind => {
22
+ const encryptionModule = (bind) => {
23
23
  bind(key_provider_1.KeyProvider).to(key_provider_1.KeyProviderImpl).inSingletonScope();
24
24
  bind(encryption_engine_1.EncryptionEngine).to(encryption_engine_1.EncryptionEngineImpl).inSingletonScope();
25
25
  bind(encryption_service_1.EncryptionService).to(encryption_service_1.EncryptionServiceImpl).inSingletonScope();
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.js","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,iDAA8D;AAC9D,2DAA6E;AAC7E,6DAAgF;AAEhF;;;;;;;;;GASG;AACI,MAAM,gBAAgB,GAAuC,IAAI,CAAC,EAAE;IAEvE,IAAI,CAAC,0BAAW,CAAC,CAAC,EAAE,CAAC,8BAAe,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEzD,IAAI,CAAC,oCAAgB,CAAC,CAAC,EAAE,CAAC,wCAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnE,IAAI,CAAC,sCAAiB,CAAC,CAAC,EAAE,CAAC,0CAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACzE,CAAC,CAAC;AANW,QAAA,gBAAgB,oBAM3B"}
1
+ {"version":3,"file":"container-module.js","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,iDAA8D;AAC9D,2DAA6E;AAC7E,6DAAgF;AAEhF;;;;;;;;;GASG;AACI,MAAM,gBAAgB,GAAuC,CAAC,IAAI,EAAE,EAAE;IACzE,IAAI,CAAC,0BAAW,CAAC,CAAC,EAAE,CAAC,8BAAe,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEzD,IAAI,CAAC,oCAAgB,CAAC,CAAC,EAAE,CAAC,wCAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnE,IAAI,CAAC,sCAAiB,CAAC,CAAC,EAAE,CAAC,0CAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACzE,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  /// <reference types="node" />
7
7
  export interface KeyParams {
@@ -1 +1 @@
1
- {"version":3,"file":"encryption-engine.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAKH,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,aAAa;IAC1B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAA;CACvB;AAED,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;IAClD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9D;AAED;;;;;GAKG;AACF,qBACY,oBAAoB;IAC7B,QAAQ,CAAC,SAAS,iBAAiB;IACnC,QAAQ,CAAC,GAAG,YAAY;IAExB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAajD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;CAM7D"}
1
+ {"version":3,"file":"encryption-engine.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAKH,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC1B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;IAClD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9D;AAED;;;;;GAKG;AACH,qBACa,oBAAoB;IAC7B,QAAQ,CAAC,SAAS,iBAAiB;IACnC,QAAQ,CAAC,GAAG,YAAY;IAExB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAajD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;CAU7D"}
@@ -2,7 +2,7 @@
2
2
  /**
3
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
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.EncryptionEngineImpl = exports.EncryptionEngine = void 0;
15
15
  const crypto = require("crypto");
16
16
  const inversify_1 = require("inversify");
17
- exports.EncryptionEngine = Symbol('EncryptionEngine');
17
+ exports.EncryptionEngine = Symbol("EncryptionEngine");
18
18
  /**
19
19
  * For starters, let's use aes-cbc-256 with:
20
20
  * - 16 bytes/128 bits IV (the size of an aes-256-cbc block)
@@ -23,26 +23,26 @@ exports.EncryptionEngine = Symbol('EncryptionEngine');
23
23
  */
24
24
  let EncryptionEngineImpl = class EncryptionEngineImpl {
25
25
  constructor() {
26
- this.algorithm = 'aes-256-cbc';
27
- this.enc = 'base64';
26
+ this.algorithm = "aes-256-cbc";
27
+ this.enc = "base64";
28
28
  }
29
29
  encrypt(data, key) {
30
30
  const iv = crypto.randomBytes(16);
31
31
  const cipher = crypto.createCipheriv(this.algorithm, key, iv);
32
- const encrypted = cipher.update(new Buffer(data, 'utf8'));
32
+ const encrypted = cipher.update(Buffer.from(data, "utf8"));
33
33
  const finalEncrypted = Buffer.concat([encrypted, cipher.final()]);
34
34
  return {
35
35
  data: finalEncrypted.toString(this.enc),
36
36
  keyParams: {
37
- iv: iv.toString(this.enc)
38
- }
37
+ iv: iv.toString(this.enc),
38
+ },
39
39
  };
40
40
  }
41
41
  decrypt(encryptedData, key) {
42
- const decipher = crypto.createDecipheriv(this.algorithm, key, new Buffer(encryptedData.keyParams.iv, this.enc));
43
- let decrypted = decipher.update(new Buffer(encryptedData.data, this.enc));
42
+ const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(encryptedData.keyParams.iv, this.enc));
43
+ let decrypted = decipher.update(Buffer.from(encryptedData.data, this.enc));
44
44
  const finalDecrypted = Buffer.concat([decrypted, decipher.final()]);
45
- return finalDecrypted.toString('utf8');
45
+ return finalDecrypted.toString("utf8");
46
46
  }
47
47
  };
48
48
  EncryptionEngineImpl = __decorate([