@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-wth-test.41

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 (253) hide show
  1. package/data/builtin-theia-plugins.json +9 -9
  2. package/data/gitpod-schema.json +8 -22
  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 +20 -4
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +15 -0
  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/{util/without.js → analytics.js} +4 -2
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/context-url.d.ts +18 -0
  16. package/lib/context-url.d.ts.map +1 -0
  17. package/lib/context-url.js +49 -0
  18. package/lib/context-url.js.map +1 -0
  19. package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +3 -1
  20. package/lib/context-url.spec.d.ts.map +1 -0
  21. package/lib/context-url.spec.js +73 -0
  22. package/lib/context-url.spec.js.map +1 -0
  23. package/lib/email-protocol.d.ts +1 -2
  24. package/lib/email-protocol.d.ts.map +1 -1
  25. package/lib/email-protocol.js +4 -4
  26. package/lib/email-protocol.js.map +1 -1
  27. package/lib/encryption/container-module.js +5 -4
  28. package/lib/encryption/container-module.js.map +1 -1
  29. package/lib/encryption/encryption-engine.js +19 -20
  30. package/lib/encryption/encryption-engine.js.map +1 -1
  31. package/lib/encryption/encryption-engine.spec.js +29 -36
  32. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  33. package/lib/encryption/encryption-service.js +29 -43
  34. package/lib/encryption/encryption-service.js.map +1 -1
  35. package/lib/encryption/key-provider.js +25 -30
  36. package/lib/encryption/key-provider.js.map +1 -1
  37. package/lib/env.d.ts +1 -2
  38. package/lib/env.d.ts.map +1 -1
  39. package/lib/env.js +20 -21
  40. package/lib/env.js.map +1 -1
  41. package/lib/gitpod-file-parser.js +25 -41
  42. package/lib/gitpod-file-parser.js.map +1 -1
  43. package/lib/gitpod-file-parser.spec.js +116 -116
  44. package/lib/gitpod-file-parser.spec.js.map +1 -1
  45. package/lib/gitpod-service.d.ts +132 -18
  46. package/lib/gitpod-service.d.ts.map +1 -1
  47. package/lib/gitpod-service.js +168 -256
  48. package/lib/gitpod-service.js.map +1 -1
  49. package/lib/headless-workspace-log.d.ts +8 -11
  50. package/lib/headless-workspace-log.d.ts.map +1 -1
  51. package/lib/headless-workspace-log.js +4 -7
  52. package/lib/headless-workspace-log.js.map +1 -1
  53. package/lib/ide-frontend-service.d.ts +4 -0
  54. package/lib/ide-frontend-service.d.ts.map +1 -1
  55. package/lib/index.d.ts +4 -0
  56. package/lib/index.d.ts.map +1 -1
  57. package/lib/index.js +5 -1
  58. package/lib/index.js.map +1 -1
  59. package/lib/messaging/browser/connection.d.ts +5 -3
  60. package/lib/messaging/browser/connection.d.ts.map +1 -1
  61. package/lib/messaging/browser/connection.js +183 -33
  62. package/lib/messaging/browser/connection.js.map +1 -1
  63. package/lib/messaging/browser/window-connection.js +35 -55
  64. package/lib/messaging/browser/window-connection.js.map +1 -1
  65. package/lib/messaging/client-call-metrics.d.ts +35 -0
  66. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  67. package/lib/messaging/client-call-metrics.js +83 -0
  68. package/lib/messaging/client-call-metrics.js.map +1 -0
  69. package/lib/messaging/connection-error-handler.js +11 -23
  70. package/lib/messaging/connection-error-handler.js.map +1 -1
  71. package/lib/messaging/error.d.ts +3 -1
  72. package/lib/messaging/error.d.ts.map +1 -1
  73. package/lib/messaging/error.js +6 -2
  74. package/lib/messaging/error.js.map +1 -1
  75. package/lib/messaging/handler.d.ts +10 -0
  76. package/lib/messaging/handler.d.ts.map +1 -1
  77. package/lib/messaging/node/connection.js +22 -22
  78. package/lib/messaging/node/connection.js.map +1 -1
  79. package/lib/messaging/proxy-factory.d.ts +2 -0
  80. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  81. package/lib/messaging/proxy-factory.js +74 -159
  82. package/lib/messaging/proxy-factory.js.map +1 -1
  83. package/lib/payment-protocol.d.ts +18 -0
  84. package/lib/payment-protocol.d.ts.map +1 -0
  85. package/lib/payment-protocol.js +13 -0
  86. package/lib/payment-protocol.js.map +1 -0
  87. package/lib/permission.d.ts +2 -1
  88. package/lib/permission.d.ts.map +1 -1
  89. package/lib/permission.js +14 -13
  90. package/lib/permission.js.map +1 -1
  91. package/lib/plans.d.ts +210 -0
  92. package/lib/plans.d.ts.map +1 -0
  93. package/lib/plans.js +570 -0
  94. package/lib/plans.js.map +1 -0
  95. package/lib/protocol.d.ts +94 -16
  96. package/lib/protocol.d.ts.map +1 -1
  97. package/lib/protocol.js +104 -130
  98. package/lib/protocol.js.map +1 -1
  99. package/lib/snapshot-url.d.ts +14 -0
  100. package/lib/snapshot-url.d.ts.map +1 -0
  101. package/lib/snapshot-url.js +26 -0
  102. package/lib/snapshot-url.js.map +1 -0
  103. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  104. package/lib/snapshot-url.spec.d.ts.map +1 -0
  105. package/lib/snapshot-url.spec.js +41 -0
  106. package/lib/snapshot-url.spec.js.map +1 -0
  107. package/lib/team-subscription-protocol.d.ts +73 -0
  108. package/lib/team-subscription-protocol.d.ts.map +1 -0
  109. package/lib/team-subscription-protocol.js +63 -0
  110. package/lib/team-subscription-protocol.js.map +1 -0
  111. package/lib/teams-projects-protocol.d.ts +103 -0
  112. package/lib/teams-projects-protocol.d.ts.map +1 -0
  113. package/lib/teams-projects-protocol.js +23 -0
  114. package/lib/teams-projects-protocol.js.map +1 -0
  115. package/lib/util/analytics.d.ts +8 -0
  116. package/lib/util/analytics.d.ts.map +1 -0
  117. package/lib/util/analytics.js +79 -0
  118. package/lib/util/analytics.js.map +1 -0
  119. package/lib/util/async-iterator.js +55 -133
  120. package/lib/util/async-iterator.js.map +1 -1
  121. package/lib/util/cancelable.js +17 -59
  122. package/lib/util/cancelable.js.map +1 -1
  123. package/lib/util/date-time.js +8 -8
  124. package/lib/util/date-time.js.map +1 -1
  125. package/lib/util/deferred.js +10 -12
  126. package/lib/util/deferred.js.map +1 -1
  127. package/lib/util/disposable.js +26 -39
  128. package/lib/util/disposable.js.map +1 -1
  129. package/lib/util/event.js +58 -74
  130. package/lib/util/event.js.map +1 -1
  131. package/lib/util/garbage-collected-cache.js +22 -46
  132. package/lib/util/garbage-collected-cache.js.map +1 -1
  133. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  134. package/lib/util/generate-workspace-id.js +13 -67
  135. package/lib/util/generate-workspace-id.js.map +1 -1
  136. package/lib/util/generate-workspace-id.spec.js +34 -79
  137. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  138. package/lib/util/gitpod-cookie.d.ts +20 -0
  139. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  140. package/lib/util/gitpod-cookie.js +44 -0
  141. package/lib/util/gitpod-cookie.js.map +1 -0
  142. package/lib/util/gitpod-host-url.d.ts +1 -1
  143. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  144. package/lib/util/gitpod-host-url.js +98 -98
  145. package/lib/util/gitpod-host-url.js.map +1 -1
  146. package/lib/util/gitpod-host-url.spec.d.ts +7 -1
  147. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  148. package/lib/util/gitpod-host-url.spec.js +103 -31
  149. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  150. package/lib/util/grpc.d.ts +15 -0
  151. package/lib/util/grpc.d.ts.map +1 -0
  152. package/lib/util/grpc.js +18 -0
  153. package/lib/util/grpc.js.map +1 -0
  154. package/lib/util/logging.d.ts +49 -33
  155. package/lib/util/logging.d.ts.map +1 -1
  156. package/lib/util/logging.js +107 -110
  157. package/lib/util/logging.js.map +1 -1
  158. package/lib/util/make-link.js +2 -2
  159. package/lib/util/make-link.js.map +1 -1
  160. package/lib/util/parse-workspace-id.d.ts +10 -0
  161. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  162. package/lib/util/parse-workspace-id.js +32 -7
  163. package/lib/util/parse-workspace-id.js.map +1 -1
  164. package/lib/util/parse-workspace-id.spec.d.ts +4 -0
  165. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  166. package/lib/util/parse-workspace-id.spec.js +123 -84
  167. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  168. package/lib/util/queue.js +16 -55
  169. package/lib/util/queue.js.map +1 -1
  170. package/lib/util/queue.spec.js +144 -288
  171. package/lib/util/queue.spec.js.map +1 -1
  172. package/lib/util/repeater.js +35 -88
  173. package/lib/util/repeater.js.map +1 -1
  174. package/lib/util/safe-promise.js +9 -12
  175. package/lib/util/safe-promise.js.map +1 -1
  176. package/lib/util/semaphore.js +15 -46
  177. package/lib/util/semaphore.js.map +1 -1
  178. package/lib/util/skip-if.js +6 -6
  179. package/lib/util/skip-if.js.map +1 -1
  180. package/lib/util/timeutil.js +28 -16
  181. package/lib/util/timeutil.js.map +1 -1
  182. package/lib/util/timeutil.spec.js +21 -24
  183. package/lib/util/timeutil.spec.js.map +1 -1
  184. package/lib/util/tracing.js +43 -47
  185. package/lib/util/tracing.js.map +1 -1
  186. package/lib/util/workspace-port-authentication.js +3 -2
  187. package/lib/util/workspace-port-authentication.js.map +1 -1
  188. package/lib/workspace-cluster.d.ts +74 -0
  189. package/lib/workspace-cluster.d.ts.map +1 -0
  190. package/lib/workspace-cluster.js +16 -0
  191. package/lib/workspace-cluster.js.map +1 -0
  192. package/lib/workspace-instance.d.ts +7 -2
  193. package/lib/workspace-instance.d.ts.map +1 -1
  194. package/lib/wsready.d.ts +1 -1
  195. package/lib/wsready.js +2 -2
  196. package/package.json +28 -16
  197. package/pkg-yarn.lock +17 -9
  198. package/src/accounting-protocol.ts +229 -0
  199. package/src/admin-protocol.ts +39 -5
  200. package/src/analytics.ts +54 -0
  201. package/src/context-url.spec.ts +39 -0
  202. package/src/context-url.ts +51 -0
  203. package/src/email-protocol.ts +2 -3
  204. package/src/env.ts +10 -10
  205. package/src/gitpod-service.ts +198 -33
  206. package/src/headless-workspace-log.ts +7 -11
  207. package/src/ide-frontend-service.ts +4 -0
  208. package/src/index.ts +5 -1
  209. package/src/messaging/browser/connection.ts +195 -14
  210. package/src/messaging/client-call-metrics.ts +97 -0
  211. package/src/messaging/error.ts +8 -2
  212. package/src/messaging/handler.ts +12 -0
  213. package/src/messaging/node/connection.ts +2 -2
  214. package/src/messaging/proxy-factory.ts +14 -6
  215. package/src/payment-protocol.ts +20 -0
  216. package/src/permission.ts +2 -1
  217. package/src/plans.ts +632 -0
  218. package/src/protocol.ts +153 -43
  219. package/src/snapshot-url.spec.ts +25 -0
  220. package/src/snapshot-url.ts +27 -0
  221. package/src/team-subscription-protocol.ts +113 -0
  222. package/src/teams-projects-protocol.ts +132 -0
  223. package/src/util/analytics.ts +87 -0
  224. package/src/util/deferred.ts +1 -1
  225. package/src/util/garbage-collected-cache.ts +2 -2
  226. package/src/util/generate-workspace-id.spec.ts +3 -3
  227. package/src/util/generate-workspace-id.ts +2 -0
  228. package/src/util/gitpod-cookie.ts +39 -0
  229. package/src/util/gitpod-host-url.spec.ts +25 -1
  230. package/src/util/gitpod-host-url.ts +23 -10
  231. package/src/util/grpc.ts +15 -0
  232. package/src/util/logging.ts +102 -38
  233. package/src/util/parse-workspace-id.spec.ts +21 -1
  234. package/src/util/parse-workspace-id.ts +32 -6
  235. package/src/util/queue.spec.ts +1 -1
  236. package/src/util/semaphore.ts +2 -2
  237. package/src/util/skip-if.ts +1 -1
  238. package/src/util/timeutil.ts +4 -4
  239. package/src/workspace-cluster.ts +96 -0
  240. package/src/workspace-instance.ts +31 -13
  241. package/src/wsready.ts +2 -2
  242. package/lib/util/context-url.d.ts +0 -13
  243. package/lib/util/context-url.d.ts.map +0 -1
  244. package/lib/util/context-url.js +0 -26
  245. package/lib/util/context-url.js.map +0 -1
  246. package/lib/util/context-url.spec.d.ts.map +0 -1
  247. package/lib/util/context-url.spec.js +0 -52
  248. package/lib/util/context-url.spec.js.map +0 -1
  249. package/lib/util/without.d.ts +0 -7
  250. package/lib/util/without.d.ts.map +0 -1
  251. package/lib/util/without.js.map +0 -1
  252. package/src/util/context-url.spec.ts +0 -25
  253. package/src/util/context-url.ts +0 -23
@@ -0,0 +1,63 @@
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.TeamSubscriptionSlot = exports.TeamSubscription = void 0;
9
+ const uuid_1 = require("uuid");
10
+ var TeamSubscription;
11
+ (function (TeamSubscription) {
12
+ TeamSubscription.create = (ts) => {
13
+ const withId = ts;
14
+ withId.id = (0, uuid_1.v4)();
15
+ return withId;
16
+ };
17
+ TeamSubscription.isActive = (ts, date) => {
18
+ return ts.startDate <= date && (ts.endDate === undefined || date < ts.endDate);
19
+ };
20
+ })(TeamSubscription = exports.TeamSubscription || (exports.TeamSubscription = {}));
21
+ var TeamSubscriptionSlot;
22
+ (function (TeamSubscriptionSlot) {
23
+ TeamSubscriptionSlot.create = (ts) => {
24
+ const withId = ts;
25
+ withId.id = (0, uuid_1.v4)();
26
+ return withId;
27
+ };
28
+ TeamSubscriptionSlot.assign = (slot, assigneeId, subscriptionId, assigneeIdentifier) => {
29
+ slot.assigneeId = assigneeId;
30
+ slot.subscriptionId = subscriptionId;
31
+ slot.assigneeIdentifier = assigneeIdentifier;
32
+ };
33
+ TeamSubscriptionSlot.deactivate = (slot, cancellationDate) => {
34
+ slot.subscriptionId = undefined;
35
+ slot.cancellationDate = cancellationDate;
36
+ };
37
+ TeamSubscriptionSlot.reactivate = (slot, subscriptionId) => {
38
+ slot.subscriptionId = subscriptionId;
39
+ slot.cancellationDate = undefined;
40
+ };
41
+ TeamSubscriptionSlot.status = (slot, now) => {
42
+ if (slot.cancellationDate) {
43
+ if (slot.cancellationDate < now) {
44
+ return 'cancelled';
45
+ }
46
+ else {
47
+ return 'deactivated';
48
+ }
49
+ }
50
+ else {
51
+ if (slot.subscriptionId) {
52
+ return 'assigned';
53
+ }
54
+ else {
55
+ return 'unassigned';
56
+ }
57
+ }
58
+ };
59
+ TeamSubscriptionSlot.isActive = (slot) => {
60
+ return !slot.cancellationDate;
61
+ };
62
+ })(TeamSubscriptionSlot = exports.TeamSubscriptionSlot || (exports.TeamSubscriptionSlot = {}));
63
+ //# sourceMappingURL=team-subscription-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-subscription-protocol.js","sourceRoot":"","sources":["../src/team-subscription-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+BAAoC;AAgBpC,IAAiB,gBAAgB,CAShC;AATD,WAAiB,gBAAgB;IAChB,uBAAM,GAAG,CAAC,EAAgC,EAAoB,EAAE;QACzE,MAAM,MAAM,GAAG,EAAsB,CAAC;QACtC,MAAM,CAAC,EAAE,GAAG,IAAA,SAAM,GAAE,CAAC;QACrB,OAAO,MAAM,CAAC;IAClB,CAAC,CAAA;IACY,yBAAQ,GAAG,CAAC,EAAoB,EAAE,IAAY,EAAW,EAAE;QACpE,OAAO,EAAE,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;IACnF,CAAC,CAAA;AACL,CAAC,EATgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAShC;AAkBD,IAAiB,oBAAoB,CAsCpC;AAtCD,WAAiB,oBAAoB;IACpB,2BAAM,GAAG,CAAC,EAAoC,EAAwB,EAAE;QACjF,MAAM,MAAM,GAAG,EAA0B,CAAC;QAC1C,MAAM,CAAC,EAAE,GAAG,IAAA,SAA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the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ import { PrebuiltWorkspaceState } from "./protocol";
7
+ export interface ProjectConfig {
8
+ '.gitpod.yml': string;
9
+ }
10
+ export interface Project {
11
+ id: string;
12
+ name: string;
13
+ slug?: string;
14
+ cloneUrl: string;
15
+ teamId?: string;
16
+ userId?: string;
17
+ appInstallationId: string;
18
+ config?: ProjectConfig;
19
+ creationTime: string;
20
+ /** This is a flag that triggers the HARD DELETION of this entity */
21
+ deleted?: boolean;
22
+ markedDeleted?: boolean;
23
+ }
24
+ export declare namespace Project {
25
+ const create: (project: Omit<Project, 'id' | 'creationTime'>) => Project;
26
+ interface Overview {
27
+ branches: BranchDetails[];
28
+ }
29
+ interface BranchDetails {
30
+ name: string;
31
+ url: string;
32
+ isDefault: boolean;
33
+ changeTitle: string;
34
+ changeDate?: string;
35
+ changeAuthor?: string;
36
+ changeAuthorAvatar?: string;
37
+ changePR?: string;
38
+ changeUrl?: string;
39
+ changeHash: string;
40
+ }
41
+ }
42
+ export interface PrebuildWithStatus {
43
+ info: PrebuildInfo;
44
+ status: PrebuiltWorkspaceState;
45
+ error?: string;
46
+ }
47
+ export interface PrebuildInfo {
48
+ id: string;
49
+ buildWorkspaceId: string;
50
+ teamId?: string;
51
+ userId?: string;
52
+ projectId: string;
53
+ projectName: string;
54
+ cloneUrl: string;
55
+ branch: string;
56
+ startedAt: string;
57
+ startedBy: string;
58
+ startedByAvatar?: string;
59
+ changeTitle: string;
60
+ changeDate: string;
61
+ changeAuthor: string;
62
+ changeAuthorAvatar?: string;
63
+ changePR?: string;
64
+ changeUrl?: string;
65
+ changeHash: string;
66
+ }
67
+ export declare namespace PrebuildInfo {
68
+ function is(data?: any): data is PrebuildInfo;
69
+ }
70
+ export interface StartPrebuildResult {
71
+ prebuildId: string;
72
+ wsid: string;
73
+ done: boolean;
74
+ }
75
+ export interface Team {
76
+ id: string;
77
+ name: string;
78
+ slug: string;
79
+ creationTime: string;
80
+ markedDeleted?: boolean;
81
+ /** This is a flag that triggers the HARD DELETION of this entity */
82
+ deleted?: boolean;
83
+ }
84
+ export declare type TeamMemberRole = "owner" | "member";
85
+ export interface TeamMemberInfo {
86
+ userId: string;
87
+ fullName?: string;
88
+ primaryEmail?: string;
89
+ avatarUrl?: string;
90
+ role: TeamMemberRole;
91
+ memberSince: string;
92
+ }
93
+ export interface TeamMembershipInvite {
94
+ id: string;
95
+ teamId: string;
96
+ role: TeamMemberRole;
97
+ creationTime: string;
98
+ invalidationTime: string;
99
+ invitedEmail?: string;
100
+ /** This is a flag that triggers the HARD DELETION of this entity */
101
+ deleted?: boolean;
102
+ }
103
+ //# sourceMappingURL=teams-projects-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teams-projects-protocol.d.ts","sourceRoot":"","sources":["../src/teams-projects-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAGpD,MAAM,WAAW,aAAa;IAC1B,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,yBAAiB,OAAO,CAAC;IACd,MAAM,MAAM,YAAa,KAAK,OAAO,EAAE,IAAI,GAAG,cAAc,CAAC,KAAG,OAMtE,CAAA;IAED,UAAiB,QAAQ;QACrB,QAAQ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,IAAI,IAAI,YAAY,CAEnD;CACJ;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,IAAI;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,oBAAY,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,23 @@
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.PrebuildInfo = exports.Project = void 0;
9
+ const uuid_1 = require("uuid");
10
+ var Project;
11
+ (function (Project) {
12
+ Project.create = (project) => {
13
+ return Object.assign(Object.assign({}, project), { id: (0, uuid_1.v4)(), creationTime: new Date().toISOString() });
14
+ };
15
+ })(Project = exports.Project || (exports.Project = {}));
16
+ var PrebuildInfo;
17
+ (function (PrebuildInfo) {
18
+ function is(data) {
19
+ return typeof data === "object" && ["id", "buildWorkspaceId", "projectId", "branch"].every(p => p in data);
20
+ }
21
+ PrebuildInfo.is = is;
22
+ })(PrebuildInfo = exports.PrebuildInfo || (exports.PrebuildInfo = {}));
23
+ //# sourceMappingURL=teams-projects-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teams-projects-protocol.js","sourceRoot":"","sources":["../src/teams-projects-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,+BAAoC;AAqBpC,IAAiB,OAAO,CA2BvB;AA3BD,WAAiB,OAAO;IACP,cAAM,GAAG,CAAC,OAA6C,EAAW,EAAE;QAC7E,uCACO,OAAO,KACV,EAAE,EAAE,IAAA,SAAM,GAAE,EACZ,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IACxC;IACN,CAAC,CAAA;AAoBL,CAAC,EA3BgB,OAAO,GAAP,eAAO,KAAP,eAAO,QA2BvB;AAiCD,IAAiB,YAAY,CAI5B;AAJD,WAAiB,YAAY;IACzB,SAAgB,EAAE,CAAC,IAAU;QACzB,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IAC/G,CAAC;IAFe,eAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAI5B"}
@@ -0,0 +1,8 @@
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 { IAnalyticsWriter } from "../analytics";
7
+ export declare function newAnalyticsWriterFromEnv(): IAnalyticsWriter;
8
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/util/analytics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAA8C,MAAM,cAAc,CAAC;AAI5F,wBAAgB,yBAAyB,IAAI,gBAAgB,CAS5D"}
@@ -0,0 +1,79 @@
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.newAnalyticsWriterFromEnv = void 0;
9
+ const Analytics = require("analytics-node");
10
+ const logging_1 = require("./logging");
11
+ function newAnalyticsWriterFromEnv() {
12
+ switch (process.env.GITPOD_ANALYTICS_WRITER) {
13
+ case "segment":
14
+ return new SegmentAnalyticsWriter(process.env.GITPOD_ANALYTICS_SEGMENT_KEY || "");
15
+ case "log":
16
+ return new LogAnalyticsWriter();
17
+ default:
18
+ return new NoAnalyticsWriter();
19
+ }
20
+ }
21
+ exports.newAnalyticsWriterFromEnv = newAnalyticsWriterFromEnv;
22
+ class SegmentAnalyticsWriter {
23
+ constructor(writeKey) {
24
+ this.analytics = new Analytics(writeKey);
25
+ }
26
+ identify(msg) {
27
+ try {
28
+ this.analytics.identify(msg, (err) => {
29
+ if (err) {
30
+ logging_1.log.warn("analytics.identify failed", err);
31
+ }
32
+ });
33
+ }
34
+ catch (err) {
35
+ logging_1.log.warn("analytics.identify failed", err);
36
+ }
37
+ }
38
+ track(msg) {
39
+ try {
40
+ this.analytics.track(msg, (err) => {
41
+ if (err) {
42
+ logging_1.log.warn("analytics.track failed", err);
43
+ }
44
+ });
45
+ }
46
+ catch (err) {
47
+ logging_1.log.warn("analytics.track failed", err);
48
+ }
49
+ }
50
+ page(msg) {
51
+ try {
52
+ this.analytics.page(msg, (err) => {
53
+ if (err) {
54
+ logging_1.log.warn("analytics.page failed", err);
55
+ }
56
+ });
57
+ }
58
+ catch (err) {
59
+ logging_1.log.warn("analytics.page failed", err);
60
+ }
61
+ }
62
+ }
63
+ class LogAnalyticsWriter {
64
+ identify(msg) {
65
+ logging_1.log.debug("analytics identify", msg);
66
+ }
67
+ track(msg) {
68
+ logging_1.log.debug("analytics track", msg);
69
+ }
70
+ page(msg) {
71
+ logging_1.log.debug("analytics page", msg);
72
+ }
73
+ }
74
+ class NoAnalyticsWriter {
75
+ identify(msg) { }
76
+ track(msg) { }
77
+ page(msg) { }
78
+ }
79
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/util/analytics.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,4CAA6C;AAE7C,uCAAgC;AAGhC,SAAgB,yBAAyB;IACrC,QAAQ,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;QACzC,KAAK,SAAS;YACV,OAAO,IAAI,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;QACtF,KAAK,KAAK;YACN,OAAO,IAAI,kBAAkB,EAAE,CAAC;QACpC;YACI,OAAO,IAAI,iBAAiB,EAAE,CAAC;KACtC;AACL,CAAC;AATD,8DASC;AAED,MAAM,sBAAsB;IAIxB,YAAY,QAAgB;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAEG,QAAQ,CAAC,GAAoB;QAC7B,IAAI;YACA,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAU,EAAE,EAAE;gBACxC,IAAI,GAAG,EAAE;oBACL,aAAG,CAAC,IAAI,CAAC,2BAA2B,EAAE,GAAG,CAAC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AAC,GAAiB,IAAS,CAAC;IACjC,IAAI,CAAC,GAAgB,IAAS,CAAC;CAClC"}
@@ -13,33 +13,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  step((generator = generator.apply(thisArg, _arguments || [])).next());
14
14
  });
15
15
  };
16
- var __generator = (this && this.__generator) || function (thisArg, body) {
17
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
18
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19
- function verb(n) { return function (v) { return step([n, v]); }; }
20
- function step(op) {
21
- if (f) throw new TypeError("Generator is already executing.");
22
- while (_) try {
23
- 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;
24
- if (y = 0, t) op = [op[0] & 2, t.value];
25
- switch (op[0]) {
26
- case 0: case 1: t = op; break;
27
- case 4: _.label++; return { value: op[1], done: false };
28
- case 5: _.label++; y = op[1]; op = [0]; continue;
29
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
30
- default:
31
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
34
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
35
- if (t[2]) _.ops.pop();
36
- _.trys.pop(); continue;
37
- }
38
- op = body.call(thisArg, _);
39
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
40
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
41
- }
42
- };
43
16
  var __asyncValues = (this && this.__asyncValues) || function (o) {
44
17
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
45
18
  var m = o[Symbol.asyncIterator], i;
@@ -56,131 +29,80 @@ if (typeof Symbol.asyncIterator === 'undefined') {
56
29
  function find(it, predicate) {
57
30
  var it_1, it_1_1;
58
31
  var e_1, _a;
59
- return __awaiter(this, void 0, void 0, function () {
60
- var t, e_1_1;
61
- return __generator(this, function (_b) {
62
- switch (_b.label) {
63
- case 0:
64
- _b.trys.push([0, 5, 6, 11]);
65
- it_1 = __asyncValues(it);
66
- _b.label = 1;
67
- case 1: return [4 /*yield*/, it_1.next()];
68
- case 2:
69
- if (!(it_1_1 = _b.sent(), !it_1_1.done)) return [3 /*break*/, 4];
70
- t = it_1_1.value;
71
- if (predicate(t)) {
72
- return [2 /*return*/, t];
73
- }
74
- _b.label = 3;
75
- case 3: return [3 /*break*/, 1];
76
- case 4: return [3 /*break*/, 11];
77
- case 5:
78
- e_1_1 = _b.sent();
79
- e_1 = { error: e_1_1 };
80
- return [3 /*break*/, 11];
81
- case 6:
82
- _b.trys.push([6, , 9, 10]);
83
- if (!(it_1_1 && !it_1_1.done && (_a = it_1.return))) return [3 /*break*/, 8];
84
- return [4 /*yield*/, _a.call(it_1)];
85
- case 7:
86
- _b.sent();
87
- _b.label = 8;
88
- case 8: return [3 /*break*/, 10];
89
- case 9:
90
- if (e_1) throw e_1.error;
91
- return [7 /*endfinally*/];
92
- case 10: return [7 /*endfinally*/];
93
- case 11: return [2 /*return*/, undefined];
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ try {
34
+ for (it_1 = __asyncValues(it); it_1_1 = yield it_1.next(), !it_1_1.done;) {
35
+ const t = it_1_1.value;
36
+ if (predicate(t)) {
37
+ return t;
38
+ }
94
39
  }
95
- });
40
+ }
41
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
42
+ finally {
43
+ try {
44
+ if (it_1_1 && !it_1_1.done && (_a = it_1.return)) yield _a.call(it_1);
45
+ }
46
+ finally { if (e_1) throw e_1.error; }
47
+ }
48
+ return undefined;
96
49
  });
97
50
  }
98
51
  exports.find = find;
99
52
  function filter(it, predicate) {
100
53
  var it_2, it_2_1;
101
54
  var e_2, _a;
102
- return __awaiter(this, void 0, void 0, function () {
103
- var result, t, e_2_1;
104
- return __generator(this, function (_b) {
105
- switch (_b.label) {
106
- case 0:
107
- result = [];
108
- _b.label = 1;
109
- case 1:
110
- _b.trys.push([1, 6, 7, 12]);
111
- it_2 = __asyncValues(it);
112
- _b.label = 2;
113
- case 2: return [4 /*yield*/, it_2.next()];
114
- case 3:
115
- if (!(it_2_1 = _b.sent(), !it_2_1.done)) return [3 /*break*/, 5];
116
- t = it_2_1.value;
117
- if (predicate(t)) {
118
- result.push(t);
119
- }
120
- _b.label = 4;
121
- case 4: return [3 /*break*/, 2];
122
- case 5: return [3 /*break*/, 12];
123
- case 6:
124
- e_2_1 = _b.sent();
125
- e_2 = { error: e_2_1 };
126
- return [3 /*break*/, 12];
127
- case 7:
128
- _b.trys.push([7, , 10, 11]);
129
- if (!(it_2_1 && !it_2_1.done && (_a = it_2.return))) return [3 /*break*/, 9];
130
- return [4 /*yield*/, _a.call(it_2)];
131
- case 8:
132
- _b.sent();
133
- _b.label = 9;
134
- case 9: return [3 /*break*/, 11];
135
- case 10:
136
- if (e_2) throw e_2.error;
137
- return [7 /*endfinally*/];
138
- case 11: return [7 /*endfinally*/];
139
- case 12: return [2 /*return*/, result];
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const result = [];
57
+ try {
58
+ for (it_2 = __asyncValues(it); it_2_1 = yield it_2.next(), !it_2_1.done;) {
59
+ const t = it_2_1.value;
60
+ if (predicate(t)) {
61
+ result.push(t);
62
+ }
140
63
  }
141
- });
64
+ }
65
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
66
+ finally {
67
+ try {
68
+ if (it_2_1 && !it_2_1.done && (_a = it_2.return)) yield _a.call(it_2);
69
+ }
70
+ finally { if (e_2) throw e_2.error; }
71
+ }
72
+ return result;
142
73
  });
143
74
  }
144
75
  exports.filter = filter;
145
- var AsyncCachingIteratorImpl = /** @class */ (function () {
146
- function AsyncCachingIteratorImpl(iterable) {
76
+ class AsyncCachingIteratorImpl {
77
+ constructor(iterable) {
147
78
  this.iterable = iterable;
148
79
  this.cache = [];
149
80
  this.cursor = 0;
150
81
  this.cacheRead = false;
151
82
  }
152
- AsyncCachingIteratorImpl.prototype.resetCursor = function () {
83
+ resetCursor() {
153
84
  this.cursor = 0;
154
85
  this.cacheRead = false;
155
- };
156
- AsyncCachingIteratorImpl.prototype.next = function (value) {
157
- return __awaiter(this, void 0, void 0, function () {
158
- var result;
159
- return __generator(this, function (_a) {
160
- switch (_a.label) {
161
- case 0:
162
- if (!this.cacheRead && this.cursor < this.cache.length) {
163
- return [2 /*return*/, {
164
- done: false,
165
- value: this.cache[this.cursor++]
166
- }];
167
- }
168
- this.cacheRead = true;
169
- return [4 /*yield*/, this.iterable.next(value)];
170
- case 1:
171
- result = _a.sent();
172
- if (!result.done) {
173
- this.cache.push(result.value);
174
- }
175
- return [2 /*return*/, result];
176
- }
177
- });
86
+ }
87
+ next(value) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ if (!this.cacheRead && this.cursor < this.cache.length) {
90
+ return {
91
+ done: false,
92
+ value: this.cache[this.cursor++]
93
+ };
94
+ }
95
+ this.cacheRead = true;
96
+ const result = yield this.iterable.next(value);
97
+ if (!result.done) {
98
+ this.cache.push(result.value);
99
+ }
100
+ return result;
178
101
  });
179
- };
180
- AsyncCachingIteratorImpl.prototype[Symbol.asyncIterator] = function () {
102
+ }
103
+ [Symbol.asyncIterator]() {
181
104
  return this;
182
- };
183
- return AsyncCachingIteratorImpl;
184
- }());
105
+ }
106
+ }
185
107
  exports.AsyncCachingIteratorImpl = AsyncCachingIteratorImpl;
186
108
  //# sourceMappingURL=async-iterator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"async-iterator.js","sourceRoot":"","sources":["../../src/util/async-iterator.ts"],"names":[],"mappings":";AAA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AAA,CAAA;gBACd,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;oBACd,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAClB;aACJ;;;;;;;;;QACD,OAAO,MAAM,CAAC;;CACjB;AARD,wBAQC;AAKD,MAAa,wBAAwB;IAMjC,YAA+B,QAAkC;QAAlC,aAAQ,GAAR,QAAQ,CAA0B;QAJvD,UAAK,GAAQ,EAAE,CAAC;QAChB,WAAM,GAAG,CAAC,CAAC;QACX,cAAS,GAAG,KAAK,CAAC;IAEyC,CAAC;IAE/D,WAAW;QACd,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAEY,IAAI,CAAC,KAAW;;YACzB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBACpD,OAAO;oBACH,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;iBACnC,CAAC;aACL;YACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YAEtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBACd,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACjC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;IAED,CAAC,MAAM,CAAC,aAAa,CAAC;QAClB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAhCD,4DAgCC"}
@@ -13,72 +13,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  step((generator = generator.apply(thisArg, _arguments || [])).next());
14
14
  });
15
15
  };
16
- var __generator = (this && this.__generator) || function (thisArg, body) {
17
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
18
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
19
- function verb(n) { return function (v) { return step([n, v]); }; }
20
- function step(op) {
21
- if (f) throw new TypeError("Generator is already executing.");
22
- while (_) try {
23
- 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;
24
- if (y = 0, t) op = [op[0] & 2, t.value];
25
- switch (op[0]) {
26
- case 0: case 1: t = op; break;
27
- case 4: _.label++; return { value: op[1], done: false };
28
- case 5: _.label++; y = op[1]; op = [0]; continue;
29
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
30
- default:
31
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
34
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
35
- if (t[2]) _.ops.pop();
36
- _.trys.pop(); continue;
37
- }
38
- op = body.call(thisArg, _);
39
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
40
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
41
- }
42
- };
43
16
  Object.defineProperty(exports, "__esModule", { value: true });
44
17
  exports.Cancelable = void 0;
45
- var Cancelable = /** @class */ (function () {
46
- function Cancelable(activity) {
18
+ class Cancelable {
19
+ constructor(activity) {
47
20
  this.activity = activity;
48
21
  }
49
- Cancelable.prototype.run = function () {
50
- return __awaiter(this, void 0, void 0, function () {
51
- var r;
52
- return __generator(this, function (_a) {
53
- switch (_a.label) {
54
- case 0: return [4 /*yield*/, this.activity(this.canceled)];
55
- case 1:
56
- r = _a.sent();
57
- _a.label = 2;
58
- case 2:
59
- if (this.canceled) {
60
- return [2 /*return*/];
61
- }
62
- else if (r !== undefined) {
63
- return [2 /*return*/, r];
64
- }
65
- _a.label = 3;
66
- case 3: return [4 /*yield*/, this.activity(this.canceled)];
67
- case 4:
68
- r = _a.sent();
69
- return [3 /*break*/, 2];
70
- case 5: return [2 /*return*/];
22
+ run() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ for (let r = yield this.activity(this.canceled);; r = yield this.activity(this.canceled)) {
25
+ if (this.canceled) {
26
+ return;
27
+ }
28
+ else if (r !== undefined) {
29
+ return r;
71
30
  }
72
- });
31
+ }
73
32
  });
74
- };
75
- Cancelable.prototype.cancel = function () {
33
+ }
34
+ cancel() {
76
35
  this.canceled = true;
77
- };
78
- Cancelable.prototype.dispose = function () {
36
+ }
37
+ dispose() {
79
38
  this.cancel();
80
- };
81
- return Cancelable;
82
- }());
39
+ }
40
+ }
83
41
  exports.Cancelable = Cancelable;
84
42
  //# sourceMappingURL=cancelable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cancelable.js","sourceRoot":"","sources":["../../src/util/cancelable.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH;IAGI,oBAA+B,QAAqD;QAArD,aAAQ,GAAR,QAAQ,CAA6C;IAAI,CAAC;IAE5E,wBAAG,GAAhB;;;;;4BACgB,qBAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAA;;wBAAtC,CAAC,GAAG,SAAkC;;;wBAC1C,IAAI,IAAI,CAAC,QAAQ,EAAE;4BACf,sBAAO;yBACV;6BAAM,IAAI,CAAC,KAAK,SAAS,EAAE;4BACxB,sBAAO,CAAC,EAAC;yBACZ;;4BALiD,qBAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CA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