@gitpod/gitpod-protocol 0.1.5-test.6 → 0.1.5-tweak-workspaceconfig-origin-docs-fork.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 (331) hide show
  1. package/data/builtin-theia-plugins.json +28 -18
  2. package/data/gitpod-schema.json +17 -17
  3. package/lib/accounting-protocol.d.ts +155 -0
  4. package/lib/accounting-protocol.d.ts.map +1 -0
  5. package/lib/accounting-protocol.js +109 -0
  6. package/lib/accounting-protocol.js.map +1 -0
  7. package/lib/admin-protocol.d.ts +22 -5
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +16 -1
  10. package/lib/admin-protocol.js.map +1 -1
  11. package/lib/analytics.d.ts +45 -0
  12. package/lib/analytics.d.ts.map +1 -0
  13. package/lib/analytics.js +10 -0
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/auth.d.ts +25 -0
  16. package/lib/auth.d.ts.map +1 -0
  17. package/lib/auth.js +16 -0
  18. package/lib/auth.js.map +1 -0
  19. package/lib/context-url.d.ts +18 -0
  20. package/lib/context-url.d.ts.map +1 -0
  21. package/lib/context-url.js +49 -0
  22. package/lib/context-url.js.map +1 -0
  23. package/lib/context-url.spec.d.ts +12 -0
  24. package/lib/context-url.spec.d.ts.map +1 -0
  25. package/lib/context-url.spec.js +73 -0
  26. package/lib/context-url.spec.js.map +1 -0
  27. package/lib/email-protocol.d.ts +2 -2
  28. package/lib/email-protocol.d.ts.map +1 -1
  29. package/lib/email-protocol.js +6 -5
  30. package/lib/email-protocol.js.map +1 -1
  31. package/lib/encryption/container-module.d.ts +1 -1
  32. package/lib/encryption/container-module.js +7 -5
  33. package/lib/encryption/container-module.js.map +1 -1
  34. package/lib/encryption/encryption-engine.d.ts +1 -1
  35. package/lib/encryption/encryption-engine.js +21 -21
  36. package/lib/encryption/encryption-engine.js.map +1 -1
  37. package/lib/encryption/encryption-engine.spec.d.ts +2 -2
  38. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  39. package/lib/encryption/encryption-engine.spec.js +31 -37
  40. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  41. package/lib/encryption/encryption-service.d.ts +1 -1
  42. package/lib/encryption/encryption-service.js +31 -44
  43. package/lib/encryption/encryption-service.js.map +1 -1
  44. package/lib/encryption/key-provider.d.ts +2 -2
  45. package/lib/encryption/key-provider.d.ts.map +1 -1
  46. package/lib/encryption/key-provider.js +27 -31
  47. package/lib/encryption/key-provider.js.map +1 -1
  48. package/lib/env.d.ts +2 -3
  49. package/lib/env.d.ts.map +1 -1
  50. package/lib/env.js +21 -21
  51. package/lib/env.js.map +1 -1
  52. package/lib/gitpod-file-parser.d.ts +1 -1
  53. package/lib/gitpod-file-parser.js +27 -42
  54. package/lib/gitpod-file-parser.js.map +1 -1
  55. package/lib/gitpod-file-parser.spec.d.ts +1 -1
  56. package/lib/gitpod-file-parser.spec.js +117 -117
  57. package/lib/gitpod-file-parser.spec.js.map +1 -1
  58. package/lib/gitpod-service.d.ts +186 -34
  59. package/lib/gitpod-service.d.ts.map +1 -1
  60. package/lib/gitpod-service.js +239 -116
  61. package/lib/gitpod-service.js.map +1 -1
  62. package/lib/headless-workspace-log.d.ts +9 -12
  63. package/lib/headless-workspace-log.d.ts.map +1 -1
  64. package/lib/headless-workspace-log.js +5 -7
  65. package/lib/headless-workspace-log.js.map +1 -1
  66. package/lib/ide-frontend-service.d.ts +26 -0
  67. package/lib/ide-frontend-service.d.ts.map +1 -0
  68. package/lib/ide-frontend-service.js +8 -0
  69. package/lib/ide-frontend-service.js.map +1 -0
  70. package/lib/ide-protocol.d.ts +81 -0
  71. package/lib/ide-protocol.d.ts.map +1 -0
  72. package/lib/{util/without.js → ide-protocol.js} +2 -2
  73. package/lib/ide-protocol.js.map +1 -0
  74. package/lib/index.d.ts +5 -1
  75. package/lib/index.d.ts.map +1 -1
  76. package/lib/index.js +25 -12
  77. package/lib/index.js.map +1 -1
  78. package/lib/license-protocol.d.ts +1 -1
  79. package/lib/license-protocol.js +2 -1
  80. package/lib/license-protocol.js.map +1 -1
  81. package/lib/messaging/browser/connection.d.ts +6 -4
  82. package/lib/messaging/browser/connection.d.ts.map +1 -1
  83. package/lib/messaging/browser/connection.js +188 -48
  84. package/lib/messaging/browser/connection.js.map +1 -1
  85. package/lib/messaging/browser/window-connection.d.ts +26 -0
  86. package/lib/messaging/browser/window-connection.d.ts.map +1 -0
  87. package/lib/messaging/browser/window-connection.js +68 -0
  88. package/lib/messaging/browser/window-connection.js.map +1 -0
  89. package/lib/messaging/client-call-metrics.d.ts +35 -0
  90. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  91. package/lib/messaging/client-call-metrics.js +83 -0
  92. package/lib/messaging/client-call-metrics.js.map +1 -0
  93. package/lib/messaging/connection-error-handler.js +12 -23
  94. package/lib/messaging/connection-error-handler.js.map +1 -1
  95. package/lib/messaging/error.d.ts +6 -2
  96. package/lib/messaging/error.d.ts.map +1 -1
  97. package/lib/messaging/error.js +13 -4
  98. package/lib/messaging/error.js.map +1 -1
  99. package/lib/messaging/handler.d.ts +10 -0
  100. package/lib/messaging/handler.d.ts.map +1 -1
  101. package/lib/messaging/handler.js +1 -0
  102. package/lib/messaging/handler.js.map +1 -1
  103. package/lib/messaging/node/connection.js +23 -22
  104. package/lib/messaging/node/connection.js.map +1 -1
  105. package/lib/messaging/proxy-factory.d.ts +2 -0
  106. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  107. package/lib/messaging/proxy-factory.js +75 -169
  108. package/lib/messaging/proxy-factory.js.map +1 -1
  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 +14 -12
  114. package/lib/permission.d.ts.map +1 -1
  115. package/lib/permission.js +21 -19
  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 +570 -0
  120. package/lib/plans.js.map +1 -0
  121. package/lib/protocol.d.ts +123 -30
  122. package/lib/protocol.d.ts.map +1 -1
  123. package/lib/protocol.js +121 -117
  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} +3 -4
  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 +73 -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 +103 -0
  138. package/lib/teams-projects-protocol.d.ts.map +1 -0
  139. package/lib/teams-projects-protocol.js +23 -0
  140. package/lib/teams-projects-protocol.js.map +1 -0
  141. package/lib/theia-plugins.d.ts +1 -1
  142. package/lib/theia-plugins.js +1 -1
  143. package/lib/typings/globals.d.ts +12 -0
  144. package/lib/typings/globals.d.ts.map +1 -0
  145. package/lib/typings/globals.js +7 -0
  146. package/lib/typings/globals.js.map +1 -0
  147. package/lib/util/analytics.d.ts +8 -0
  148. package/lib/util/analytics.d.ts.map +1 -0
  149. package/lib/util/analytics.js +79 -0
  150. package/lib/util/analytics.js.map +1 -0
  151. package/lib/util/async-iterator.d.ts +1 -1
  152. package/lib/util/async-iterator.js +57 -134
  153. package/lib/util/async-iterator.js.map +1 -1
  154. package/lib/util/cancelable.d.ts +1 -1
  155. package/lib/util/cancelable.js +19 -60
  156. package/lib/util/cancelable.js.map +1 -1
  157. package/lib/util/date-time.d.ts +1 -1
  158. package/lib/util/date-time.js +10 -9
  159. package/lib/util/date-time.js.map +1 -1
  160. package/lib/util/deep-partial.d.ts +1 -1
  161. package/lib/util/deep-partial.js +1 -1
  162. package/lib/util/deferred.d.ts +1 -1
  163. package/lib/util/deferred.js +12 -13
  164. package/lib/util/deferred.js.map +1 -1
  165. package/lib/util/disposable.d.ts +2 -2
  166. package/lib/util/disposable.d.ts.map +1 -1
  167. package/lib/util/disposable.js +27 -39
  168. package/lib/util/disposable.js.map +1 -1
  169. package/lib/util/event.d.ts +1 -1
  170. package/lib/util/event.d.ts.map +1 -1
  171. package/lib/util/event.js +59 -74
  172. package/lib/util/event.js.map +1 -1
  173. package/lib/util/garbage-collected-cache.d.ts +1 -1
  174. package/lib/util/garbage-collected-cache.js +24 -47
  175. package/lib/util/garbage-collected-cache.js.map +1 -1
  176. package/lib/util/generate-workspace-id.d.ts +4 -0
  177. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  178. package/lib/util/generate-workspace-id.js +470 -0
  179. package/lib/util/generate-workspace-id.js.map +1 -0
  180. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  181. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  182. package/lib/util/generate-workspace-id.spec.js +63 -0
  183. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  184. package/lib/util/gitpod-cookie.d.ts +20 -0
  185. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  186. package/lib/util/gitpod-cookie.js +44 -0
  187. package/lib/util/gitpod-cookie.js.map +1 -0
  188. package/lib/util/gitpod-host-url.d.ts +8 -3
  189. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  190. package/lib/util/gitpod-host-url.js +106 -76
  191. package/lib/util/gitpod-host-url.js.map +1 -1
  192. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  193. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  194. package/lib/util/gitpod-host-url.spec.js +124 -0
  195. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  196. package/lib/util/grpc.d.ts +15 -0
  197. package/lib/util/grpc.d.ts.map +1 -0
  198. package/lib/util/grpc.js +18 -0
  199. package/lib/util/grpc.js.map +1 -0
  200. package/lib/util/logging.d.ts +57 -34
  201. package/lib/util/logging.d.ts.map +1 -1
  202. package/lib/util/logging.js +119 -110
  203. package/lib/util/logging.js.map +1 -1
  204. package/lib/util/make-link.d.ts +1 -1
  205. package/lib/util/make-link.js +4 -3
  206. package/lib/util/make-link.js.map +1 -1
  207. package/lib/util/parse-workspace-id.d.ts +14 -4
  208. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  209. package/lib/util/parse-workspace-id.js +39 -8
  210. package/lib/util/parse-workspace-id.js.map +1 -1
  211. package/lib/util/parse-workspace-id.spec.d.ts +9 -1
  212. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  213. package/lib/util/parse-workspace-id.spec.js +129 -48
  214. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  215. package/lib/util/queue.d.ts +1 -1
  216. package/lib/util/queue.js +18 -56
  217. package/lib/util/queue.js.map +1 -1
  218. package/lib/util/queue.spec.d.ts +1 -1
  219. package/lib/util/queue.spec.js +145 -287
  220. package/lib/util/queue.spec.js.map +1 -1
  221. package/lib/util/repeater.d.ts +1 -1
  222. package/lib/util/repeater.js +37 -89
  223. package/lib/util/repeater.js.map +1 -1
  224. package/lib/util/safe-promise.d.ts +1 -1
  225. package/lib/util/safe-promise.js +11 -13
  226. package/lib/util/safe-promise.js.map +1 -1
  227. package/lib/util/semaphore.d.ts +1 -1
  228. package/lib/util/semaphore.js +17 -47
  229. package/lib/util/semaphore.js.map +1 -1
  230. package/lib/util/skip-if.d.ts +1 -1
  231. package/lib/util/skip-if.js +8 -7
  232. package/lib/util/skip-if.js.map +1 -1
  233. package/lib/util/timeutil.d.ts +1 -1
  234. package/lib/util/timeutil.d.ts.map +1 -1
  235. package/lib/util/timeutil.js +30 -17
  236. package/lib/util/timeutil.js.map +1 -1
  237. package/lib/util/timeutil.spec.d.ts +1 -1
  238. package/lib/util/timeutil.spec.js +23 -25
  239. package/lib/util/timeutil.spec.js.map +1 -1
  240. package/lib/util/tracing.d.ts +15 -2
  241. package/lib/util/tracing.d.ts.map +1 -1
  242. package/lib/util/tracing.js +86 -51
  243. package/lib/util/tracing.js.map +1 -1
  244. package/lib/util/workspace-port-authentication.d.ts +1 -1
  245. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  246. package/lib/util/workspace-port-authentication.js +5 -3
  247. package/lib/util/workspace-port-authentication.js.map +1 -1
  248. package/lib/workspace-cluster.d.ts +74 -0
  249. package/lib/workspace-cluster.d.ts.map +1 -0
  250. package/lib/workspace-cluster.js +16 -0
  251. package/lib/workspace-cluster.js.map +1 -0
  252. package/lib/workspace-instance.d.ts +10 -4
  253. package/lib/workspace-instance.d.ts.map +1 -1
  254. package/lib/workspace-instance.js +1 -1
  255. package/lib/wsready.d.ts +1 -1
  256. package/lib/wsready.js +3 -2
  257. package/lib/wsready.js.map +1 -1
  258. package/package.json +32 -16
  259. package/pkg-yarn.lock +18 -9
  260. package/src/accounting-protocol.ts +229 -0
  261. package/src/admin-protocol.ts +41 -6
  262. package/src/analytics.ts +54 -0
  263. package/src/auth.ts +27 -0
  264. package/src/context-url.spec.ts +39 -0
  265. package/src/context-url.ts +51 -0
  266. package/src/email-protocol.ts +3 -4
  267. package/src/encryption/container-module.ts +1 -1
  268. package/src/encryption/encryption-engine.spec.ts +1 -1
  269. package/src/encryption/encryption-engine.ts +1 -1
  270. package/src/encryption/encryption-service.ts +1 -1
  271. package/src/encryption/key-provider.ts +1 -1
  272. package/src/env.ts +11 -11
  273. package/src/gitpod-file-parser.spec.ts +1 -1
  274. package/src/gitpod-file-parser.ts +1 -1
  275. package/src/gitpod-service.ts +386 -52
  276. package/src/headless-workspace-log.ts +8 -12
  277. package/src/ide-frontend-service.ts +28 -0
  278. package/src/ide-protocol.ts +92 -0
  279. package/src/index.ts +6 -2
  280. package/src/license-protocol.ts +1 -1
  281. package/src/messaging/browser/connection.ts +201 -23
  282. package/src/messaging/browser/window-connection.ts +72 -0
  283. package/src/messaging/client-call-metrics.ts +97 -0
  284. package/src/messaging/error.ts +16 -4
  285. package/src/messaging/handler.ts +12 -0
  286. package/src/messaging/node/connection.ts +2 -2
  287. package/src/messaging/proxy-factory.ts +16 -14
  288. package/src/payment-protocol.ts +20 -0
  289. package/src/permission.ts +9 -8
  290. package/src/plans.ts +632 -0
  291. package/src/protocol.ts +204 -61
  292. package/src/snapshot-url.spec.ts +25 -0
  293. package/src/snapshot-url.ts +27 -0
  294. package/src/team-subscription-protocol.ts +113 -0
  295. package/src/teams-projects-protocol.ts +132 -0
  296. package/src/theia-plugins.ts +1 -1
  297. package/src/typings/globals.ts +12 -0
  298. package/src/util/analytics.ts +87 -0
  299. package/src/util/async-iterator.ts +1 -1
  300. package/src/util/cancelable.ts +1 -1
  301. package/src/util/date-time.ts +1 -1
  302. package/src/util/deep-partial.ts +1 -1
  303. package/src/util/deferred.ts +2 -2
  304. package/src/util/garbage-collected-cache.ts +3 -3
  305. package/src/util/generate-workspace-id.spec.ts +31 -0
  306. package/src/util/generate-workspace-id.ts +457 -0
  307. package/src/util/gitpod-cookie.ts +39 -0
  308. package/src/util/gitpod-host-url.spec.ts +49 -0
  309. package/src/util/gitpod-host-url.ts +58 -14
  310. package/src/util/grpc.ts +15 -0
  311. package/src/util/jaeger-client.d.ts +1 -1
  312. package/src/util/logging.ts +111 -39
  313. package/src/util/make-link.ts +1 -1
  314. package/src/util/parse-workspace-id.spec.ts +46 -5
  315. package/src/util/parse-workspace-id.ts +39 -8
  316. package/src/util/queue.spec.ts +2 -2
  317. package/src/util/queue.ts +1 -1
  318. package/src/util/repeater.ts +1 -1
  319. package/src/util/safe-promise.ts +1 -1
  320. package/src/util/semaphore.ts +3 -3
  321. package/src/util/skip-if.ts +2 -2
  322. package/src/util/timeutil.spec.ts +1 -1
  323. package/src/util/timeutil.ts +5 -5
  324. package/src/util/tracing.ts +66 -4
  325. package/src/util/workspace-port-authentication.ts +1 -1
  326. package/src/workspace-cluster.ts +96 -0
  327. package/src/workspace-instance.ts +38 -16
  328. package/src/wsready.ts +2 -2
  329. package/lib/util/without.d.ts +0 -7
  330. package/lib/util/without.d.ts.map +0 -1
  331. package/lib/util/without.js.map +0 -1
@@ -14,70 +14,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
- var __generator = (this && this.__generator) || function (thisArg, body) {
18
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
19
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
- function verb(n) { return function (v) { return step([n, v]); }; }
21
- function step(op) {
22
- if (f) throw new TypeError("Generator is already executing.");
23
- while (_) try {
24
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
- if (y = 0, t) op = [op[0] & 2, t.value];
26
- switch (op[0]) {
27
- case 0: case 1: t = op; break;
28
- case 4: _.label++; return { value: op[1], done: false };
29
- case 5: _.label++; y = op[1]; op = [0]; continue;
30
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
- default:
32
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
- if (t[2]) _.ops.pop();
37
- _.trys.pop(); continue;
38
- }
39
- op = body.call(thisArg, _);
40
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
- }
43
- };
44
- var __read = (this && this.__read) || function (o, n) {
45
- var m = typeof Symbol === "function" && o[Symbol.iterator];
46
- if (!m) return o;
47
- var i = m.call(o), r, ar = [], e;
48
- try {
49
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
50
- }
51
- catch (error) { e = { error: error }; }
52
- finally {
53
- try {
54
- if (r && !r.done && (m = i["return"])) m.call(i);
55
- }
56
- finally { if (e) throw e.error; }
57
- }
58
- return ar;
59
- };
60
- var __spread = (this && this.__spread) || function () {
61
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
62
- return ar;
63
- };
64
17
  Object.defineProperty(exports, "__esModule", { value: true });
65
- var vscode_jsonrpc_1 = require("vscode-jsonrpc");
66
- var event_1 = require("../util/event");
67
- var logging_1 = require("../util/logging");
68
- var JsonRpcConnectionHandler = /** @class */ (function () {
69
- function JsonRpcConnectionHandler(path, targetFactory) {
18
+ exports.JsonRpcProxyFactory = exports.JsonRpcConnectionHandler = void 0;
19
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
20
+ const event_1 = require("../util/event");
21
+ const logging_1 = require("../util/logging");
22
+ class JsonRpcConnectionHandler {
23
+ constructor(path, targetFactory) {
70
24
  this.path = path;
71
25
  this.targetFactory = targetFactory;
72
26
  }
73
- JsonRpcConnectionHandler.prototype.onConnection = function (connection, request) {
74
- var factory = new JsonRpcProxyFactory();
75
- var proxy = factory.createProxy();
27
+ onConnection(connection, request) {
28
+ const factory = new JsonRpcProxyFactory();
29
+ const proxy = factory.createProxy();
76
30
  factory.target = this.targetFactory(proxy, request);
77
31
  factory.listen(connection);
78
- };
79
- return JsonRpcConnectionHandler;
80
- }());
32
+ }
33
+ }
81
34
  exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
82
35
  /**
83
36
  * Factory for JSON-RPC proxy objects.
@@ -121,67 +74,45 @@ exports.JsonRpcConnectionHandler = JsonRpcConnectionHandler;
121
74
  *
122
75
  * @param <T> - The type of the object to expose to JSON-RPC.
123
76
  */
124
- var JsonRpcProxyFactory = /** @class */ (function () {
77
+ class JsonRpcProxyFactory {
125
78
  /**
126
79
  * Build a new JsonRpcProxyFactory.
127
80
  *
128
81
  * @param target - The object to expose to JSON-RPC methods calls. If this
129
82
  * is omitted, the proxy won't be able to handle requests, only send them.
130
83
  */
131
- function JsonRpcProxyFactory(target) {
84
+ constructor(target) {
132
85
  this.target = target;
133
86
  this.onDidOpenConnectionEmitter = new event_1.Emitter();
134
87
  this.onDidCloseConnectionEmitter = new event_1.Emitter();
135
88
  this.waitForConnection();
136
89
  }
137
- JsonRpcProxyFactory.prototype.waitForConnection = function () {
138
- var _this = this;
139
- this.connectionPromise = new Promise(function (resolve) {
140
- return _this.connectionPromiseResolve = resolve;
141
- });
142
- this.connectionPromise.then(function (connection) {
143
- connection.onClose(function () {
144
- return _this.onDidCloseConnectionEmitter.fire(undefined);
145
- });
146
- _this.onDidOpenConnectionEmitter.fire(undefined);
90
+ waitForConnection() {
91
+ this.connectionPromise = new Promise(resolve => this.connectionPromiseResolve = resolve);
92
+ this.connectionPromise.then(connection => {
93
+ connection.onClose(() => this.fireConnectionClosed());
94
+ this.fireConnectionOpened();
147
95
  });
148
- };
96
+ }
97
+ fireConnectionClosed() {
98
+ this.onDidCloseConnectionEmitter.fire(undefined);
99
+ }
100
+ fireConnectionOpened() {
101
+ this.onDidOpenConnectionEmitter.fire(undefined);
102
+ }
149
103
  /**
150
104
  * Connect a MessageConnection to the factory.
151
105
  *
152
106
  * This connection will be used to send/receive JSON-RPC requests and
153
107
  * response.
154
108
  */
155
- JsonRpcProxyFactory.prototype.listen = function (connection) {
156
- var _this = this;
157
- if (this.target) {
158
- var _loop_1 = function (prop) {
159
- if (typeof this_1.target[prop] === 'function') {
160
- connection.onRequest(prop, function () {
161
- var args = [];
162
- for (var _i = 0; _i < arguments.length; _i++) {
163
- args[_i] = arguments[_i];
164
- }
165
- return _this.onRequest.apply(_this, __spread([prop], args));
166
- });
167
- connection.onNotification(prop, function () {
168
- var args = [];
169
- for (var _i = 0; _i < arguments.length; _i++) {
170
- args[_i] = arguments[_i];
171
- }
172
- return _this.onNotification.apply(_this, __spread([prop], args));
173
- });
174
- }
175
- };
176
- var this_1 = this;
177
- for (var prop in this.target) {
178
- _loop_1(prop);
179
- }
180
- }
181
- connection.onDispose(function () { return _this.waitForConnection(); });
109
+ listen(connection) {
110
+ connection.onRequest((method, ...params) => this.onRequest(method, ...params));
111
+ connection.onNotification((method, ...params) => this.onNotification(method, ...params));
112
+ connection.onDispose(() => this.waitForConnection());
182
113
  connection.listen();
183
114
  this.connectionPromiseResolve(connection);
184
- };
115
+ }
185
116
  /**
186
117
  * Process an incoming JSON-RPC method call.
187
118
  *
@@ -194,48 +125,33 @@ var JsonRpcProxyFactory = /** @class */ (function () {
194
125
  *
195
126
  * @returns A promise of the method call completion.
196
127
  */
197
- JsonRpcProxyFactory.prototype.onRequest = function (method) {
198
- var args = [];
199
- for (var _i = 1; _i < arguments.length; _i++) {
200
- args[_i - 1] = arguments[_i];
201
- }
202
- return __awaiter(this, void 0, void 0, function () {
203
- var e_1;
204
- var _a;
205
- return __generator(this, function (_b) {
206
- switch (_b.label) {
207
- case 0:
208
- _b.trys.push([0, 2, , 3]);
209
- return [4 /*yield*/, (_a = this.target)[method].apply(_a, __spread(args))];
210
- case 1: return [2 /*return*/, _b.sent()];
211
- case 2:
212
- e_1 = _b.sent();
213
- if (e_1 instanceof vscode_jsonrpc_1.ResponseError) {
214
- logging_1.log.info("Request " + method + " unsuccessful: " + e_1.code + "/\"" + e_1.message + "\"", { method: method, args: args });
215
- }
216
- else {
217
- logging_1.log.error("Request " + method + " failed with internal server error", e_1, { method: method, args: args });
218
- }
219
- throw e_1;
220
- case 3: return [2 /*return*/];
128
+ onRequest(method, ...args) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ try {
131
+ return yield this.target[method](...args);
132
+ }
133
+ catch (e) {
134
+ if (e instanceof vscode_jsonrpc_1.ResponseError) {
135
+ logging_1.log.info(`Request ${method} unsuccessful: ${e.code}/"${e.message}"`, { method, args });
136
+ }
137
+ else {
138
+ logging_1.log.error(`Request ${method} failed with internal server error`, e, { method, args });
221
139
  }
222
- });
140
+ throw e;
141
+ }
223
142
  });
224
- };
143
+ }
225
144
  /**
226
145
  * Process an incoming JSON-RPC notification.
227
146
  *
228
147
  * Same as [[onRequest]], but called on incoming notifications rather than
229
148
  * methods calls.
230
149
  */
231
- JsonRpcProxyFactory.prototype.onNotification = function (method) {
232
- var _a;
233
- var args = [];
234
- for (var _i = 1; _i < arguments.length; _i++) {
235
- args[_i - 1] = arguments[_i];
150
+ onNotification(method, ...args) {
151
+ if (this.target[method]) {
152
+ this.target[method](...args);
236
153
  }
237
- (_a = this.target)[method].apply(_a, __spread(args));
238
- };
154
+ }
239
155
  /**
240
156
  * Create a Proxy exposing the interface of an object of type T. This Proxy
241
157
  * can be used to do JSON-RPC method calls on the remote target object as
@@ -243,10 +159,10 @@ var JsonRpcProxyFactory = /** @class */ (function () {
243
159
  *
244
160
  * If `T` implements `JsonRpcServer` then a client is used as a target object for a remote target object.
245
161
  */
246
- JsonRpcProxyFactory.prototype.createProxy = function () {
247
- var result = new Proxy(this, this);
162
+ createProxy() {
163
+ const result = new Proxy(this, this);
248
164
  return result;
249
- };
165
+ }
250
166
  /**
251
167
  * Get a callable object that executes a JSON-RPC method call.
252
168
  *
@@ -269,11 +185,10 @@ var JsonRpcProxyFactory = /** @class */ (function () {
269
185
  * @param receiver - unused.
270
186
  * @returns A callable that executes the JSON-RPC call.
271
187
  */
272
- JsonRpcProxyFactory.prototype.get = function (target, p, receiver) {
273
- var _this = this;
188
+ get(target, p, receiver) {
274
189
  if (p === 'setClient') {
275
- return function (client) {
276
- _this.target = client;
190
+ return (client) => {
191
+ this.target = client;
277
192
  };
278
193
  }
279
194
  if (p === 'onDidOpenConnection') {
@@ -282,33 +197,25 @@ var JsonRpcProxyFactory = /** @class */ (function () {
282
197
  if (p === 'onDidCloseConnection') {
283
198
  return this.onDidCloseConnectionEmitter.event;
284
199
  }
285
- var isNotify = this.isNotification(p);
286
- return function () {
287
- var args = [];
288
- for (var _i = 0; _i < arguments.length; _i++) {
289
- args[_i] = arguments[_i];
200
+ const isNotify = this.isNotification(p);
201
+ return (...args) => this.connectionPromise.then(connection => new Promise((resolve, reject) => {
202
+ try {
203
+ if (isNotify) {
204
+ connection.sendNotification(p.toString(), ...args);
205
+ resolve(undefined);
206
+ }
207
+ else {
208
+ const resultPromise = connection.sendRequest(p.toString(), ...args);
209
+ resultPromise
210
+ .catch((err) => reject(err))
211
+ .then((result) => resolve(result));
212
+ }
290
213
  }
291
- return _this.connectionPromise.then(function (connection) {
292
- return new Promise(function (resolve, reject) {
293
- try {
294
- if (isNotify) {
295
- connection.sendNotification.apply(connection, __spread([p.toString()], args));
296
- resolve();
297
- }
298
- else {
299
- var resultPromise = connection.sendRequest.apply(connection, __spread([p.toString()], args));
300
- resultPromise
301
- .catch(function (err) { return reject(err); })
302
- .then(function (result) { return resolve(result); });
303
- }
304
- }
305
- catch (err) {
306
- reject(err);
307
- }
308
- });
309
- });
310
- };
311
- };
214
+ catch (err) {
215
+ reject(err);
216
+ }
217
+ }));
218
+ }
312
219
  /**
313
220
  * Return whether the given property represents a notification.
314
221
  *
@@ -318,10 +225,9 @@ var JsonRpcProxyFactory = /** @class */ (function () {
318
225
  * @param p - The property being called on the proxy.
319
226
  * @return Whether `p` represents a notification.
320
227
  */
321
- JsonRpcProxyFactory.prototype.isNotification = function (p) {
228
+ isNotification(p) {
322
229
  return p.toString().startsWith("notify") || p.toString().startsWith("on");
323
- };
324
- return JsonRpcProxyFactory;
325
- }());
230
+ }
231
+ }
326
232
  exports.JsonRpcProxyFactory = JsonRpcProxyFactory;
327
233
  //# sourceMappingURL=proxy-factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-factory.js","sourceRoot":"","sources":["../../src/messaging/proxy-factory.ts"],"names":[],"mappings":";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AM,CAAC,CAAC,CAAC;iBAC/C;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,GAAG,CAAC,CAAC;aACf;QACL,CAAC,CAAC,CACL,CAAC;IACV,CAAC;IAED;;;;;;;;OAQG;IACO,cAAc,CAAC,CAAc;QACnC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;CACJ;AAtKD,kDAsKC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ export declare namespace PaymentProtocol {
7
+ const UPDATE_GITPOD_SUBSCRIPTION_PATH = "/payment/chargebee";
8
+ }
9
+ export interface PlanCoupon {
10
+ chargebeePlanID: string;
11
+ newPrice: number;
12
+ description: string;
13
+ }
14
+ export interface GithubUpgradeURL {
15
+ url: string;
16
+ planID: number;
17
+ }
18
+ //# sourceMappingURL=payment-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-protocol.d.ts","sourceRoot":"","sources":["../src/payment-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEF,yBAAiB,eAAe,CAAC;IACvB,MAAM,+BAA+B,uBAAuB,CAAA;CACtE;AAED,MAAM,WAAW,UAAU;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PaymentProtocol = void 0;
9
+ var PaymentProtocol;
10
+ (function (PaymentProtocol) {
11
+ PaymentProtocol.UPDATE_GITPOD_SUBSCRIPTION_PATH = '/payment/chargebee';
12
+ })(PaymentProtocol = exports.PaymentProtocol || (exports.PaymentProtocol = {}));
13
+ //# sourceMappingURL=payment-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-protocol.js","sourceRoot":"","sources":["../src/payment-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEF,IAAiB,eAAe,CAEhC;AAFA,WAAiB,eAAe;IAChB,+CAA+B,GAAG,oBAAoB,CAAA;AACvE,CAAC,EAFiB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAEhC"}
@@ -1,22 +1,24 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
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
6
  export declare const Permissions: {
7
- "monitor": undefined;
8
- "enforcement": undefined;
7
+ monitor: undefined;
8
+ enforcement: undefined;
9
9
  "privileged-ws": undefined;
10
10
  "registry-access": undefined;
11
11
  "admin-users": undefined;
12
12
  "admin-workspaces": undefined;
13
13
  "admin-api": undefined;
14
+ "ide-settings": undefined;
15
+ "new-workspace-cluster": undefined;
14
16
  };
15
17
  export declare type PermissionName = keyof (typeof Permissions);
16
18
  export declare const Roles: {
17
- "devops": undefined;
18
- "viewer": undefined;
19
- "admin": undefined;
19
+ devops: undefined;
20
+ viewer: undefined;
21
+ admin: undefined;
20
22
  };
21
23
  export declare type RoleName = keyof (typeof Roles);
22
24
  export declare type RoleOrPermission = RoleName | PermissionName;
@@ -32,8 +34,6 @@ export declare namespace Permission {
32
34
  const MONITOR: PermissionName;
33
35
  /** The permission for actions like block user, stop workspace, etc. */
34
36
  const ENFORCEMENT: PermissionName;
35
- /** The permission to start privileged workspaces */
36
- const PRIVILEGED_WORKSPACE: PermissionName;
37
37
  /** The permission for registry access (start workspaces referencing gitpod-internal Docker images) */
38
38
  const REGISTRY_ACCESS: PermissionName;
39
39
  /** The permission for accessing all user data */
@@ -42,16 +42,18 @@ export declare namespace Permission {
42
42
  const ADMIN_WORKSPACES: PermissionName;
43
43
  /** The permission to access the admin API */
44
44
  const ADMIN_API: PermissionName;
45
- const is: (o: any) => o is "monitor" | "enforcement" | "privileged-ws" | "registry-access" | "admin-users" | "admin-workspaces" | "admin-api";
46
- const all: () => ("monitor" | "enforcement" | "privileged-ws" | "registry-access" | "admin-users" | "admin-workspaces" | "admin-api")[];
45
+ /** The permission to access the IDE settings */
46
+ const IDE_SETTINGS: PermissionName;
47
+ const is: (o: any) => o is "monitor" | "enforcement" | "privileged-ws" | "registry-access" | "admin-users" | "admin-workspaces" | "admin-api" | "ide-settings" | "new-workspace-cluster";
48
+ const all: () => PermissionName[];
47
49
  }
48
50
  export declare namespace Role {
49
- /** The default role for all Typefox developers */
51
+ /** The default role for all Gitpod developers */
50
52
  const DEVOPS: Role;
51
53
  /** A role for people that are allowed to view Gitpod internals */
52
54
  const VIEWER: Role;
53
55
  const ADMIN: Role;
54
- const getByName: (name: "devops" | "viewer" | "admin") => Role;
56
+ const getByName: (name: RoleName) => Role;
55
57
  const all: () => Role[];
56
58
  }
57
59
  //# sourceMappingURL=permission.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,WAAW;;;;;;;;CAQvB,CAAC;AACF,oBAAY,cAAc,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AACxD,eAAO,MAAM,KAAK;;;;CAAkE,CAAC;AACrF,oBAAY,QAAQ,GAAG,MAAM,CAAC,O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AAC,CAAC;AAC5C,oBAAY,gBAAgB,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEzD,yBAAiB,QAAQ,CAAC;IACf,MAAM,EAAE,MAAO,GAAG,uCAGxB,CAAA;CACJ;AAED,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,cAAc,EAAE,CAAC;CACjC;AAED,yBAAiB,UAAU,CAAC;IACxB,0EAA0E;IACnE,MAAM,OAAO,EAAE,cAA0B,CAAC;IAEjD,uEAAuE;IAChE,MAAM,WAAW,EAAE,cAA8B,CAAC;IAEzD,sGAAsG;IAC/F,MAAM,eAAe,EAAE,cAAkC,CAAC;IAEjE,iDAAiD;IAC1C,MAAM,WAAW,EAAE,cAA8B,CAAC;IAEzD,sDAAsD;IAC/C,MAAM,gBAAgB,EAAE,cAAmC,CAAC;IAEnE,6CAA6C;IACtC,MAAM,SAAS,EAAE,cAA4B,CAAC;IAErD,gDAAgD;IACzC,MAAM,YAAY,EAAE,cAA+B,CAAC;IAEpD,MAAM,EAAE,MAAO,GAAG,uKAGxB,CAAA;IAEM,MAAM,GAAG,QAAO,cAAc,EAIpC,CAAC;CACL;AAED,yBAAiB,IAAI,CAAC;IAClB,iDAAiD;IAC1C,MAAM,MAAM,EAAE,IAQpB,CAAC;IAEF,kEAAkE;IAC3D,MAAM,MAAM,EAAE,IAMpB,CAAC;IAEK,MAAM,KAAK,EAAE,IAQnB,CAAA;IAEM,MAAM,SAAS,SAAU,QAAQ,KAAG,IAM1C,CAAC;IAEK,MAAM,GAAG,QAAO,IAAI,EAI1B,CAAC;CACL"}
package/lib/permission.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
5
  * See License-AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Role = exports.Permission = exports.RoleName = exports.Roles = exports.Permissions = void 0;
8
9
  // see below for explanation
9
10
  exports.Permissions = {
10
11
  "monitor": undefined,
@@ -13,14 +14,16 @@ exports.Permissions = {
13
14
  "registry-access": undefined,
14
15
  "admin-users": undefined,
15
16
  "admin-workspaces": undefined,
16
- "admin-api": undefined
17
+ "admin-api": undefined,
18
+ "ide-settings": undefined,
19
+ "new-workspace-cluster": undefined,
17
20
  };
18
21
  exports.Roles = { "devops": undefined, "viewer": undefined, "admin": undefined };
19
22
  var RoleName;
20
23
  (function (RoleName) {
21
- RoleName.is = function (o) {
24
+ RoleName.is = (o) => {
22
25
  return typeof (o) === 'string'
23
- && Role.all().some(function (r) { return r.name === o; });
26
+ && Role.all().some(r => r.name === o);
24
27
  };
25
28
  })(RoleName = exports.RoleName || (exports.RoleName = {}));
26
29
  var Permission;
@@ -29,8 +32,6 @@ var Permission;
29
32
  Permission.MONITOR = "monitor";
30
33
  /** The permission for actions like block user, stop workspace, etc. */
31
34
  Permission.ENFORCEMENT = "enforcement";
32
- /** The permission to start privileged workspaces */
33
- Permission.PRIVILEGED_WORKSPACE = "privileged-ws";
34
35
  /** The permission for registry access (start workspaces referencing gitpod-internal Docker images) */
35
36
  Permission.REGISTRY_ACCESS = "registry-access";
36
37
  /** The permission for accessing all user data */
@@ -39,26 +40,28 @@ var Permission;
39
40
  Permission.ADMIN_WORKSPACES = "admin-workspaces";
40
41
  /** The permission to access the admin API */
41
42
  Permission.ADMIN_API = "admin-api";
42
- Permission.is = function (o) {
43
+ /** The permission to access the IDE settings */
44
+ Permission.IDE_SETTINGS = "ide-settings";
45
+ Permission.is = (o) => {
43
46
  return typeof (o) === 'string'
44
- && Permission.all().some(function (p) { return p === o; });
47
+ && Permission.all().some(p => p === o);
45
48
  };
46
- Permission.all = function () {
49
+ Permission.all = () => {
47
50
  return Object.keys(Permission)
48
- .map(function (k) { return Permission[k]; })
49
- .filter(function (k) { return typeof (k) === 'string'; });
51
+ .map(k => Permission[k])
52
+ .filter(k => typeof (k) === 'string');
50
53
  };
51
54
  })(Permission = exports.Permission || (exports.Permission = {}));
52
55
  var Role;
53
56
  (function (Role) {
54
- /** The default role for all Typefox developers */
57
+ /** The default role for all Gitpod developers */
55
58
  Role.DEVOPS = {
56
59
  name: "devops",
57
60
  permissions: [
58
61
  Permission.MONITOR,
59
62
  Permission.ENFORCEMENT,
60
- Permission.PRIVILEGED_WORKSPACE,
61
63
  Permission.REGISTRY_ACCESS,
64
+ Permission.IDE_SETTINGS
62
65
  ]
63
66
  };
64
67
  /** A role for people that are allowed to view Gitpod internals */
@@ -67,7 +70,6 @@ var Role;
67
70
  permissions: [
68
71
  Permission.MONITOR,
69
72
  Permission.REGISTRY_ACCESS,
70
- Permission.PRIVILEGED_WORKSPACE,
71
73
  ]
72
74
  };
73
75
  Role.ADMIN = {
@@ -79,17 +81,17 @@ var Role;
79
81
  Permission.ENFORCEMENT,
80
82
  ]
81
83
  };
82
- Role.getByName = function (name) {
83
- var result = Role.all().find(function (r) { return r.name === name; });
84
+ Role.getByName = (name) => {
85
+ const result = Role.all().find(r => r.name === name);
84
86
  if (!result) {
85
87
  throw Error("Unknown RoleName: " + name);
86
88
  }
87
89
  return result;
88
90
  };
89
- Role.all = function () {
91
+ Role.all = () => {
90
92
  return Object.keys(Role)
91
- .map(function (k) { return Role[k]; })
92
- .filter(function (k) { return typeof (k) === 'object'; });
93
+ .map(k => Role[k])
94
+ .filter(k => typeof (k) === 'object');
93
95
  };
94
96
  })(Role = exports.Role || (exports.Role = {}));
95
97
  //# sourceMappingURL=permission.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permission.js","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAGH,4BAA4B;AACf,QAAA,WAAW,GAAG;IACvB,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,SAAS;IACxB,eAAe,EAAE,SAAS;IAC1B,iBAAiB,EAAE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