@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta4 → 0.1.5-vn-6525.75

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