@gitpod/gitpod-protocol 0.1.5-wth-test.41 → 0.1.5-yh-vmoptions-fork.3

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 (311) hide show
  1. package/data/gitpod-schema.json +199 -7
  2. package/lib/accounting-protocol.d.ts +17 -10
  3. package/lib/accounting-protocol.d.ts.map +1 -1
  4. package/lib/accounting-protocol.js +30 -32
  5. package/lib/accounting-protocol.js.map +1 -1
  6. package/lib/admin-protocol.d.ts +12 -0
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js.map +1 -1
  9. package/lib/analytics.d.ts +4 -5
  10. package/lib/analytics.d.ts.map +1 -1
  11. package/lib/analytics.js.map +1 -1
  12. package/lib/auth.d.ts.map +1 -1
  13. package/lib/context-url.d.ts +18 -5
  14. package/lib/context-url.d.ts.map +1 -1
  15. package/lib/context-url.js +59 -6
  16. package/lib/context-url.js.map +1 -1
  17. package/lib/context-url.spec.d.ts +2 -0
  18. package/lib/context-url.spec.d.ts.map +1 -1
  19. package/lib/context-url.spec.js +40 -4
  20. package/lib/context-url.spec.js.map +1 -1
  21. package/lib/email-protocol.d.ts +1 -1
  22. package/lib/email-protocol.d.ts.map +1 -1
  23. package/lib/email-protocol.js.map +1 -1
  24. package/lib/encryption/container-module.d.ts.map +1 -1
  25. package/lib/encryption/container-module.js +1 -1
  26. package/lib/encryption/container-module.js.map +1 -1
  27. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  28. package/lib/encryption/encryption-engine.js +7 -7
  29. package/lib/encryption/encryption-engine.js.map +1 -1
  30. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  31. package/lib/encryption/encryption-engine.spec.js +2 -3
  32. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  33. package/lib/encryption/encryption-service.d.ts.map +1 -1
  34. package/lib/encryption/encryption-service.js +1 -1
  35. package/lib/encryption/encryption-service.js.map +1 -1
  36. package/lib/encryption/key-provider.d.ts.map +1 -1
  37. package/lib/encryption/key-provider.js +7 -9
  38. package/lib/encryption/key-provider.js.map +1 -1
  39. package/lib/env.d.ts +0 -5
  40. package/lib/env.d.ts.map +1 -1
  41. package/lib/env.js +1 -20
  42. package/lib/env.js.map +1 -1
  43. package/lib/gitpod-file-parser.d.ts.map +1 -1
  44. package/lib/gitpod-file-parser.js +6 -6
  45. package/lib/gitpod-file-parser.js.map +1 -1
  46. package/lib/gitpod-file-parser.spec.js +42 -39
  47. package/lib/gitpod-file-parser.spec.js.map +1 -1
  48. package/lib/gitpod-service.d.ts +61 -28
  49. package/lib/gitpod-service.d.ts.map +1 -1
  50. package/lib/gitpod-service.js +43 -34
  51. package/lib/gitpod-service.js.map +1 -1
  52. package/lib/headless-workspace-log.d.ts +1 -0
  53. package/lib/headless-workspace-log.d.ts.map +1 -1
  54. package/lib/headless-workspace-log.js +2 -1
  55. package/lib/headless-workspace-log.js.map +1 -1
  56. package/lib/ide-frontend-service.d.ts +1 -1
  57. package/lib/ide-protocol.d.ts +105 -0
  58. package/lib/ide-protocol.d.ts.map +1 -0
  59. package/lib/ide-protocol.js +8 -0
  60. package/lib/ide-protocol.js.map +1 -0
  61. package/lib/index.d.ts +16 -14
  62. package/lib/index.d.ts.map +1 -1
  63. package/lib/index.js +2 -0
  64. package/lib/index.js.map +1 -1
  65. package/lib/installation-admin-protocol.d.ts +27 -0
  66. package/lib/installation-admin-protocol.d.ts.map +1 -0
  67. package/lib/installation-admin-protocol.js +30 -0
  68. package/lib/installation-admin-protocol.js.map +1 -0
  69. package/lib/license-protocol.d.ts +7 -0
  70. package/lib/license-protocol.d.ts.map +1 -1
  71. package/lib/license-protocol.js.map +1 -1
  72. package/lib/messaging/browser/connection.d.ts +1 -1
  73. package/lib/messaging/browser/connection.d.ts.map +1 -1
  74. package/lib/messaging/browser/connection.js +19 -19
  75. package/lib/messaging/browser/connection.js.map +1 -1
  76. package/lib/messaging/browser/window-connection.d.ts +4 -4
  77. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  78. package/lib/messaging/browser/window-connection.js +9 -6
  79. package/lib/messaging/browser/window-connection.js.map +1 -1
  80. package/lib/messaging/client-call-metrics.d.ts +2 -2
  81. package/lib/messaging/client-call-metrics.d.ts.map +1 -1
  82. package/lib/messaging/client-call-metrics.js +20 -20
  83. package/lib/messaging/client-call-metrics.js.map +1 -1
  84. package/lib/messaging/error.d.ts +3 -0
  85. package/lib/messaging/error.d.ts.map +1 -1
  86. package/lib/messaging/error.js +6 -0
  87. package/lib/messaging/error.js.map +1 -1
  88. package/lib/messaging/handler.d.ts.map +1 -1
  89. package/lib/messaging/handler.js +1 -1
  90. package/lib/messaging/node/connection.d.ts +1 -17
  91. package/lib/messaging/node/connection.d.ts.map +1 -1
  92. package/lib/messaging/node/connection.js +23 -59
  93. package/lib/messaging/node/connection.js.map +1 -1
  94. package/lib/messaging/proxy-factory.d.ts +1 -1
  95. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  96. package/lib/messaging/proxy-factory.js +7 -9
  97. package/lib/messaging/proxy-factory.js.map +1 -1
  98. package/lib/oss-allowlist.d.ts +14 -0
  99. package/lib/oss-allowlist.d.ts.map +1 -0
  100. package/lib/oss-allowlist.js +8 -0
  101. package/lib/oss-allowlist.js.map +1 -0
  102. package/lib/payment-protocol.d.ts.map +1 -1
  103. package/lib/payment-protocol.js +1 -1
  104. package/lib/payment-protocol.js.map +1 -1
  105. package/lib/permission.d.ts +9 -3
  106. package/lib/permission.d.ts.map +1 -1
  107. package/lib/permission.js +34 -25
  108. package/lib/permission.js.map +1 -1
  109. package/lib/plans.d.ts +3 -3
  110. package/lib/plans.d.ts.map +1 -1
  111. package/lib/plans.js +206 -171
  112. package/lib/plans.js.map +1 -1
  113. package/lib/protocol.d.ts +109 -74
  114. package/lib/protocol.d.ts.map +1 -1
  115. package/lib/protocol.js +177 -87
  116. package/lib/protocol.js.map +1 -1
  117. package/lib/snapshot-url.spec.js.map +1 -1
  118. package/lib/team-subscription-protocol.d.ts +21 -3
  119. package/lib/team-subscription-protocol.d.ts.map +1 -1
  120. package/lib/team-subscription-protocol.js +16 -5
  121. package/lib/team-subscription-protocol.js.map +1 -1
  122. package/lib/teams-projects-protocol.d.ts +17 -2
  123. package/lib/teams-projects-protocol.d.ts.map +1 -1
  124. package/lib/teams-projects-protocol.js +8 -1
  125. package/lib/teams-projects-protocol.js.map +1 -1
  126. package/lib/typings/globals.d.ts +2 -2
  127. package/lib/typings/globals.d.ts.map +1 -1
  128. package/lib/util/analytics.d.ts.map +1 -1
  129. package/lib/util/analytics.js +12 -3
  130. package/lib/util/analytics.js.map +1 -1
  131. package/lib/util/async-iterator.d.ts.map +1 -1
  132. package/lib/util/async-iterator.js +3 -3
  133. package/lib/util/async-iterator.js.map +1 -1
  134. package/lib/util/cancelable.js.map +1 -1
  135. package/lib/util/date-time.js +6 -6
  136. package/lib/util/date-time.js.map +1 -1
  137. package/lib/util/deferred.js.map +1 -1
  138. package/lib/util/disposable.d.ts.map +1 -1
  139. package/lib/util/disposable.js +2 -2
  140. package/lib/util/disposable.js.map +1 -1
  141. package/lib/util/event.d.ts.map +1 -1
  142. package/lib/util/event.js +5 -3
  143. package/lib/util/event.js.map +1 -1
  144. package/lib/util/garbage-collected-cache.d.ts +1 -0
  145. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  146. package/lib/util/garbage-collected-cache.js +6 -2
  147. package/lib/util/garbage-collected-cache.js.map +1 -1
  148. package/lib/util/generate-workspace-id.d.ts +6 -1
  149. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  150. package/lib/util/generate-workspace-id.js +461 -440
  151. package/lib/util/generate-workspace-id.js.map +1 -1
  152. package/lib/util/generate-workspace-id.spec.js +36 -1
  153. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  154. package/lib/util/gitpod-cookie.d.ts +1 -1
  155. package/lib/util/gitpod-cookie.d.ts.map +1 -1
  156. package/lib/util/gitpod-cookie.js +0 -3
  157. package/lib/util/gitpod-cookie.js.map +1 -1
  158. package/lib/util/gitpod-host-url.d.ts +0 -1
  159. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  160. package/lib/util/gitpod-host-url.js +34 -35
  161. package/lib/util/gitpod-host-url.js.map +1 -1
  162. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  163. package/lib/util/gitpod-host-url.spec.js +15 -5
  164. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  165. package/lib/util/grpc.d.ts.map +1 -1
  166. package/lib/util/grpc.js.map +1 -1
  167. package/lib/util/jaeger-client-types.d.ts +68 -0
  168. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  169. package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
  170. package/lib/util/jaeger-client-types.js.map +1 -0
  171. package/lib/util/logging.d.ts +1 -1
  172. package/lib/util/logging.d.ts.map +1 -1
  173. package/lib/util/logging.js +23 -24
  174. package/lib/util/logging.js.map +1 -1
  175. package/lib/util/make-link.js +5 -5
  176. package/lib/util/make-link.js.map +1 -1
  177. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  178. package/lib/util/parse-workspace-id.js +2 -3
  179. package/lib/util/parse-workspace-id.js.map +1 -1
  180. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  181. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  182. package/lib/util/queue.spec.js +9 -6
  183. package/lib/util/queue.spec.js.map +1 -1
  184. package/lib/util/repeat.d.ts +15 -0
  185. package/lib/util/repeat.d.ts.map +1 -0
  186. package/lib/util/repeat.js +55 -0
  187. package/lib/util/repeat.js.map +1 -0
  188. package/lib/util/semaphore.d.ts.map +1 -1
  189. package/lib/util/semaphore.js.map +1 -1
  190. package/lib/util/skip-if.d.ts.map +1 -1
  191. package/lib/util/skip-if.js.map +1 -1
  192. package/lib/util/timeutil.d.ts +1 -0
  193. package/lib/util/timeutil.d.ts.map +1 -1
  194. package/lib/util/timeutil.js +9 -3
  195. package/lib/util/timeutil.js.map +1 -1
  196. package/lib/util/timeutil.spec.d.ts.map +1 -1
  197. package/lib/util/timeutil.spec.js.map +1 -1
  198. package/lib/util/tracing.d.ts +52 -6
  199. package/lib/util/tracing.d.ts.map +1 -1
  200. package/lib/util/tracing.js +156 -19
  201. package/lib/util/tracing.js.map +1 -1
  202. package/lib/util/tracing.spec.d.ts +7 -0
  203. package/lib/util/tracing.spec.d.ts.map +1 -0
  204. package/lib/util/tracing.spec.js +121 -0
  205. package/lib/util/tracing.spec.js.map +1 -0
  206. package/lib/util/workspace-port-authentication.d.ts +7 -7
  207. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  208. package/lib/util/workspace-port-authentication.js +8 -11
  209. package/lib/util/workspace-port-authentication.js.map +1 -1
  210. package/lib/workspace-cluster.d.ts +10 -8
  211. package/lib/workspace-cluster.d.ts.map +1 -1
  212. package/lib/workspace-cluster.js +16 -1
  213. package/lib/workspace-cluster.js.map +1 -1
  214. package/lib/workspace-instance.d.ts +38 -3
  215. package/lib/workspace-instance.d.ts.map +1 -1
  216. package/lib/wsready.d.ts +1 -1
  217. package/lib/wsready.d.ts.map +1 -1
  218. package/lib/wsready.js +2 -2
  219. package/package.json +10 -8
  220. package/pkg-yarn.lock +6 -6
  221. package/provenance-bundle.jsonl +2 -0
  222. package/src/accounting-protocol.ts +63 -51
  223. package/src/admin-protocol.ts +35 -18
  224. package/src/analytics.ts +26 -28
  225. package/src/auth.ts +2 -2
  226. package/src/context-url.spec.ts +37 -9
  227. package/src/context-url.ts +94 -36
  228. package/src/email-protocol.ts +5 -6
  229. package/src/encryption/container-module.ts +2 -3
  230. package/src/encryption/encryption-engine.spec.ts +9 -8
  231. package/src/encryption/encryption-engine.ts +14 -14
  232. package/src/encryption/encryption-service.ts +4 -5
  233. package/src/encryption/key-provider.ts +16 -19
  234. package/src/env.ts +0 -22
  235. package/src/gitpod-file-parser.spec.ts +55 -61
  236. package/src/gitpod-file-parser.ts +16 -17
  237. package/src/gitpod-service.ts +185 -112
  238. package/src/headless-workspace-log.ts +6 -4
  239. package/src/ide-frontend-service.ts +2 -2
  240. package/src/ide-protocol.ts +119 -0
  241. package/src/index.ts +16 -14
  242. package/src/installation-admin-protocol.ts +42 -0
  243. package/src/license-protocol.ts +12 -6
  244. package/src/messaging/browser/connection.ts +45 -47
  245. package/src/messaging/browser/window-connection.ts +39 -29
  246. package/src/messaging/client-call-metrics.ts +70 -71
  247. package/src/messaging/error.ts +10 -3
  248. package/src/messaging/handler.ts +6 -6
  249. package/src/messaging/node/connection.ts +23 -70
  250. package/src/messaging/proxy-factory.ts +23 -30
  251. package/src/oss-allowlist.ts +15 -0
  252. package/src/payment-protocol.ts +2 -2
  253. package/src/permission.ts +40 -32
  254. package/src/plans.ts +236 -189
  255. package/src/protocol.ts +383 -275
  256. package/src/snapshot-url.spec.ts +9 -7
  257. package/src/team-subscription-protocol.ts +57 -23
  258. package/src/teams-projects-protocol.ts +29 -8
  259. package/src/typings/globals.ts +4 -4
  260. package/src/util/analytics.ts +46 -24
  261. package/src/util/async-iterator.ts +4 -5
  262. package/src/util/cancelable.ts +3 -3
  263. package/src/util/date-time.ts +8 -8
  264. package/src/util/deferred.ts +6 -6
  265. package/src/util/disposable.ts +3 -6
  266. package/src/util/event.ts +9 -11
  267. package/src/util/garbage-collected-cache.ts +9 -6
  268. package/src/util/generate-workspace-id.spec.ts +34 -7
  269. package/src/util/generate-workspace-id.ts +464 -440
  270. package/src/util/gitpod-cookie.ts +8 -9
  271. package/src/util/gitpod-host-url.spec.ts +40 -13
  272. package/src/util/gitpod-host-url.ts +40 -41
  273. package/src/util/grpc.ts +1 -1
  274. package/src/util/jaeger-client-types.ts +102 -0
  275. package/src/util/logging.ts +49 -40
  276. package/src/util/make-link.ts +6 -7
  277. package/src/util/parse-workspace-id.spec.ts +17 -8
  278. package/src/util/parse-workspace-id.ts +6 -7
  279. package/src/util/queue.spec.ts +27 -25
  280. package/src/util/repeat.ts +45 -0
  281. package/src/util/semaphore.ts +4 -6
  282. package/src/util/skip-if.ts +9 -6
  283. package/src/util/timeutil.spec.ts +14 -15
  284. package/src/util/timeutil.ts +21 -11
  285. package/src/util/tracing.spec.ts +88 -0
  286. package/src/util/tracing.ts +200 -31
  287. package/src/util/workspace-port-authentication.ts +10 -13
  288. package/src/workspace-cluster.ts +26 -15
  289. package/src/workspace-instance.ts +69 -20
  290. package/src/wsready.ts +3 -3
  291. package/data/builtin-theia-plugins.json +0 -372
  292. package/lib/messaging/connection-error-handler.d.ts +0 -27
  293. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  294. package/lib/messaging/connection-error-handler.js +0 -34
  295. package/lib/messaging/connection-error-handler.js.map +0 -1
  296. package/lib/theia-plugins.d.ts +0 -11
  297. package/lib/theia-plugins.d.ts.map +0 -1
  298. package/lib/theia-plugins.js.map +0 -1
  299. package/lib/util/repeater.d.ts +0 -22
  300. package/lib/util/repeater.d.ts.map +0 -1
  301. package/lib/util/repeater.js +0 -65
  302. package/lib/util/repeater.js.map +0 -1
  303. package/lib/util/safe-promise.d.ts +0 -11
  304. package/lib/util/safe-promise.d.ts.map +0 -1
  305. package/lib/util/safe-promise.js +0 -31
  306. package/lib/util/safe-promise.js.map +0 -1
  307. package/src/messaging/connection-error-handler.ts +0 -62
  308. package/src/theia-plugins.ts +0 -11
  309. package/src/util/jaeger-client.d.ts +0 -105
  310. package/src/util/repeater.ts +0 -49
  311. package/src/util/safe-promise.ts +0 -26
@@ -4,7 +4,7 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- const inspect: (object: any) => string = require('util').inspect; // undefined in frontend
7
+ const inspect: (object: any) => string = require("util").inspect; // undefined in frontend
8
8
 
9
9
  let jsonLogging: boolean = false;
10
10
  let component: string | undefined;
@@ -15,19 +15,19 @@ export interface LogContext {
15
15
  sessionId?: string;
16
16
  userId?: string;
17
17
  workspaceId?: string;
18
- };
18
+ }
19
19
  export namespace LogContext {
20
- export function from(params : { userId?: string, user?: any, request?: any } ) {
20
+ export function from(params: { userId?: string; user?: any; request?: any }) {
21
21
  return <LogContext>{
22
22
  sessionId: params.request?.requestID,
23
- userId: params.userId || params.user?.id
24
- }
23
+ userId: params.userId || params.user?.id,
24
+ };
25
25
  }
26
26
  }
27
27
 
28
28
  export interface LogPayload {
29
29
  // placeholder to indicate that only dictionary-style objects should be passed as payload
30
- };
30
+ }
31
31
 
32
32
  export namespace log {
33
33
  export function error(context: LogContext, message: string, error: any, payload: LogPayload): void;
@@ -97,7 +97,11 @@ export namespace log {
97
97
  /**
98
98
  * Do not use in frontend.
99
99
  */
100
- export function enableJSONLogging(componentArg: string, versionArg: string | undefined, logLevel?: LogrusLogLevel): void {
100
+ export function enableJSONLogging(
101
+ componentArg: string,
102
+ versionArg: string | undefined,
103
+ logLevel?: LogrusLogLevel,
104
+ ): void {
101
105
  component = componentArg;
102
106
  version = versionArg;
103
107
 
@@ -109,16 +113,16 @@ export namespace log {
109
113
 
110
114
  console.error = function (...args: any[]): void {
111
115
  errorLog(true, args);
112
- }
116
+ };
113
117
  console.warn = function (...args: any[]): void {
114
118
  warnLog(true, args);
115
- }
119
+ };
116
120
  console.info = function (...args: any[]): void {
117
121
  infoLog(true, args);
118
- }
122
+ };
119
123
  console.debug = function (...args: any[]): void {
120
124
  debugLog(true, args);
121
- }
125
+ };
122
126
 
123
127
  console.log = console.info;
124
128
  // FIXME wrap also other console methods (e.g. trace())
@@ -154,26 +158,26 @@ type DoLogFunction = (calledViaConsole: boolean, args: any[]) => void;
154
158
 
155
159
  let errorLog = doErrorLog;
156
160
  function doErrorLog(calledViaConsole: boolean, args: any[]): void {
157
- doLog(calledViaConsole, errorConsoleLog, 'ERROR', args);
161
+ doLog(calledViaConsole, errorConsoleLog, "ERROR", args);
158
162
  }
159
163
 
160
164
  let warnLog = doWarnLog;
161
165
  function doWarnLog(calledViaConsole: boolean, args: any[]): void {
162
- doLog(calledViaConsole, warnConsoleLog, 'WARNING', args);
166
+ doLog(calledViaConsole, warnConsoleLog, "WARNING", args);
163
167
  }
164
168
 
165
169
  let infoLog = doInfoLog;
166
170
  function doInfoLog(calledViaConsole: boolean, args: any[]): void {
167
- doLog(calledViaConsole, infoConsoleLog, 'INFO', args);
171
+ doLog(calledViaConsole, infoConsoleLog, "INFO", args);
168
172
  }
169
173
 
170
174
  let debugLog = doDebugLog;
171
175
  function doDebugLog(calledViaConsole: boolean, args: any[]): void {
172
- doLog(calledViaConsole, debugConsoleLog, 'DEBUG', args);
176
+ doLog(calledViaConsole, debugConsoleLog, "DEBUG", args);
173
177
  }
174
178
 
175
179
  // Ref: https://github.com/sirupsen/logrus#level-logging
176
- export type LogrusLogLevel = keyof (typeof LogrusLogLevels);
180
+ export type LogrusLogLevel = keyof typeof LogrusLogLevels;
177
181
  export const LogrusLogLevels = {
178
182
  trace: true,
179
183
  debug: true,
@@ -182,7 +186,7 @@ export const LogrusLogLevels = {
182
186
  error: true,
183
187
  fatal: true,
184
188
  panic: true,
185
- }
189
+ };
186
190
  export namespace LogrusLogLevel {
187
191
  export function isGreatherOrEqual(lvl: LogrusLogLevel | undefined, ref: LogrusLogLevel | undefined): boolean {
188
192
  if (lvl === undefined) {
@@ -194,8 +198,7 @@ export namespace LogrusLogLevel {
194
198
  return getLevelArity(lvl) >= getLevelArity(ref);
195
199
  }
196
200
  function getLevelArity(lvl: LogrusLogLevel): number {
197
- return Object.keys(LogrusLogLevels)
198
- .findIndex((l) => l === lvl);
201
+ return Object.keys(LogrusLogLevels).findIndex((l) => l === lvl);
199
202
  }
200
203
  export function getFromEnv(): LogrusLogLevel | undefined {
201
204
  const lvlStr = process.env.LOG_LEVEL;
@@ -203,7 +206,7 @@ export namespace LogrusLogLevel {
203
206
  return undefined;
204
207
  }
205
208
  const lvl = lvlStr as LogrusLogLevel;
206
- const exists = LogrusLogLevels[lvl]
209
+ const exists = LogrusLogLevels[lvl];
207
210
  if (!exists) {
208
211
  return undefined;
209
212
  }
@@ -212,12 +215,12 @@ export namespace LogrusLogLevel {
212
215
  }
213
216
 
214
217
  // Source: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity
215
- type GoogleLogSeverity = 'EMERGENCY' | 'ALERT' | 'CRITICAL' | 'ERROR' | 'WARNING' | 'INFO' | 'DEBUG';
218
+ type GoogleLogSeverity = "EMERGENCY" | "ALERT" | "CRITICAL" | "ERROR" | "WARNING" | "INFO" | "DEBUG";
216
219
  namespace GoogleLogSeverity {
217
220
  export const isGreaterOrEqualThanWarning = (severity: GoogleLogSeverity) => {
218
221
  switch (severity) {
219
- case 'INFO':
220
- case 'DEBUG':
222
+ case "INFO":
223
+ case "DEBUG":
221
224
  return false;
222
225
  default:
223
226
  return true;
@@ -245,7 +248,7 @@ function doLog(calledViaConsole: boolean, consoleLog: ConsoleLog, severity: Goog
245
248
  // console.xyz(Error, ...any) / log.xyz(Error) / log.xyz(Error, LogPayload)
246
249
  error = args[0];
247
250
  payloadArgs = args.slice(1);
248
- } else if (typeof args[0] === 'string') {
251
+ } else if (typeof args[0] === "string") {
249
252
  message = args[0];
250
253
  if (args.length < 2 || !(args[1] instanceof Error)) {
251
254
  // console.xyz(string) / console.xyz(string, !Error, ...any) / log.xyz(string) / log.xyz(string, LogPayload)
@@ -265,7 +268,7 @@ function doLog(calledViaConsole: boolean, consoleLog: ConsoleLog, severity: Goog
265
268
  // log.xyz(LogContext, Error) / log.xyz(LogContext, Error, LogPayload)
266
269
  error = args[1];
267
270
  payloadArgs = args.slice(2);
268
- } else if (typeof args[1] === 'string') {
271
+ } else if (typeof args[1] === "string") {
269
272
  message = args[1];
270
273
  if (args.length < 3 || !(args[2] instanceof Error)) {
271
274
  // log.xyz(LogContext, string) / log.xyz(LogContext, string, LogPayload)
@@ -288,9 +291,14 @@ function doLog(calledViaConsole: boolean, consoleLog: ConsoleLog, severity: Goog
288
291
  }
289
292
  }
290
293
 
291
- function makeLogItem(severity: GoogleLogSeverity, context: LogContext | undefined, message: string | undefined,
292
- error: Error | undefined, payloadArgs: any[], calledViaConsole: boolean): string | undefined {
293
-
294
+ function makeLogItem(
295
+ severity: GoogleLogSeverity,
296
+ context: LogContext | undefined,
297
+ message: string | undefined,
298
+ error: Error | undefined,
299
+ payloadArgs: any[],
300
+ calledViaConsole: boolean,
301
+ ): string | undefined {
294
302
  if (context !== undefined && Object.keys(context).length == 0) {
295
303
  context = undefined;
296
304
  }
@@ -307,12 +315,11 @@ function makeLogItem(severity: GoogleLogSeverity, context: LogContext | undefine
307
315
  component,
308
316
  severity,
309
317
  time: new Date().toISOString(),
310
- environment: process.env.KUBE_STAGE,
311
318
  context,
312
319
  message,
313
320
  error,
314
321
  payload,
315
- loggedViaConsole: calledViaConsole ? true : undefined
322
+ loggedViaConsole: calledViaConsole ? true : undefined,
316
323
  };
317
324
  let result: string = stringifyLogItem(logItem);
318
325
 
@@ -323,11 +330,11 @@ function makeLogItem(severity: GoogleLogSeverity, context: LogContext | undefine
323
330
  result = stringifyLogItem(logItem);
324
331
 
325
332
  if (result.length <= maxAllowedLogItemLength) {
326
- log.warn('Log item too large, stripping payload', { logItemStub: makeLogItemStub(logItem) });
333
+ log.warn("Log item too large, stripping payload", { logItemStub: makeLogItemStub(logItem) });
327
334
  }
328
335
  }
329
336
  if (result.length > maxAllowedLogItemLength) {
330
- log.error('Log item too large w/o payload, discarding', { logItemStub: makeLogItemStub(logItem) });
337
+ log.error("Log item too large w/o payload, discarding", { logItemStub: makeLogItemStub(logItem) });
331
338
  return undefined;
332
339
  }
333
340
 
@@ -341,10 +348,10 @@ function makeReportedErrorEvent(error: Error | undefined) {
341
348
  // Serves as marker only
342
349
  "@type": "type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent",
343
350
  // This is useful for filtering in the UI
344
- "serviceContext": {
345
- "service": component || "<ts-not-set>",
346
- "version": version || "<ts-not-set>",
347
- }
351
+ serviceContext: {
352
+ service: component || "<ts-not-set>",
353
+ version: version || "<ts-not-set>",
354
+ },
348
355
  };
349
356
 
350
357
  if (error) {
@@ -364,9 +371,9 @@ function makeLogItemStub(logItem: any): any {
364
371
  severity: logItem.severity,
365
372
  time: logItem.time,
366
373
  environment: logItem.environment,
367
- region: logItem.region
374
+ region: logItem.region,
368
375
  };
369
- if (typeof (logItem.message) === 'string') {
376
+ if (typeof logItem.message === "string") {
370
377
  if (logItem.message.length <= maxMessageStubLength) {
371
378
  result.message = logItem.message;
372
379
  } else {
@@ -400,10 +407,12 @@ function stringifyLogItem(logItem: any): string {
400
407
  * Jsonifies Errors properly, not as {} only.
401
408
  */
402
409
  function jsonStringifyWithErrors(value: any): string {
403
- return JSON.stringify(value, (key: string, value: any): any => { return value instanceof Error ? value.stack : value });
410
+ return JSON.stringify(value, (key: string, value: any): any => {
411
+ return value instanceof Error ? value.stack : value;
412
+ });
404
413
  }
405
414
 
406
- type ConsoleLog = (message?: any, ...optionalArgs: any[]) => void; // signature of console.xyz
415
+ type ConsoleLog = (message?: any, ...optionalArgs: any[]) => void; // signature of console.xyz
407
416
  const logConsoleLog: ConsoleLog = console.log;
408
417
  const errorConsoleLog: ConsoleLog = console.error;
409
418
  const warnConsoleLog: ConsoleLog = console.warn;
@@ -5,18 +5,17 @@
5
5
  */
6
6
 
7
7
  function isOpenNewTab(event: MouseEvent): boolean {
8
- return event.metaKey || (event.ctrlKey);
8
+ return event.metaKey || event.ctrlKey;
9
9
  }
10
10
 
11
11
  export function makeLink(node: HTMLElement, url: string, hover: string): void {
12
- node.onclick = event => {
13
- let target = '_self';
12
+ node.onclick = (event) => {
13
+ let target = "_self";
14
14
  if (isOpenNewTab(event)) {
15
- target = '_blank';
15
+ target = "_blank";
16
16
  }
17
17
  window.open(url, target);
18
- }
19
- node.style.cursor = 'pointer';
18
+ };
19
+ node.style.cursor = "pointer";
20
20
  node.title = hover;
21
21
  }
22
-
@@ -4,14 +4,17 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import * as chai from 'chai';
8
- import { suite, test } from 'mocha-typescript';
9
- import { matchesInstanceIdOrLegacyWorkspaceIdExactly, matchesNewWorkspaceIdExactly, parseWorkspaceIdFromHostname } from './parse-workspace-id';
7
+ import * as chai from "chai";
8
+ import { suite, test } from "mocha-typescript";
9
+ import {
10
+ matchesInstanceIdOrLegacyWorkspaceIdExactly,
11
+ matchesNewWorkspaceIdExactly,
12
+ parseWorkspaceIdFromHostname,
13
+ } from "./parse-workspace-id";
10
14
  const expect = chai.expect;
11
15
 
12
16
  @suite
13
17
  export class ParseWorkspaceIdTest {
14
-
15
18
  @test public parseWorkspaceIdFromHostname_fromWorkspaceLocation() {
16
19
  const actual = parseWorkspaceIdFromHostname("moccasin-ferret-155799b3.ws-eu01.gitpod.io");
17
20
  expect(actual).to.equal("moccasin-ferret-155799b3");
@@ -28,7 +31,9 @@ export class ParseWorkspaceIdTest {
28
31
  }
29
32
 
30
33
  @test public parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
31
- const actual = parseWorkspaceIdFromHostname("webview-3000-moccasin-ferret-155799b3.ws-eu01.some.subdomain.somehost.com");
34
+ const actual = parseWorkspaceIdFromHostname(
35
+ "webview-3000-moccasin-ferret-155799b3.ws-eu01.some.subdomain.somehost.com",
36
+ );
32
37
  expect(actual).to.equal("moccasin-ferret-155799b3");
33
38
  }
34
39
 
@@ -44,12 +49,16 @@ export class ParseWorkspaceIdTest {
44
49
  }
45
50
 
46
51
  @test public parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix() {
47
- const actual = parseWorkspaceIdFromHostname("webview-3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
52
+ const actual = parseWorkspaceIdFromHostname(
53
+ "webview-3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io",
54
+ );
48
55
  expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
49
56
  }
50
57
 
51
58
  @test public parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
52
- const actual = parseWorkspaceIdFromHostname("webview-3000-ca81a50f-09d7-465c-acd9-264a747d5351.ws-eu01.some.subdomain.somehost.com");
59
+ const actual = parseWorkspaceIdFromHostname(
60
+ "webview-3000-ca81a50f-09d7-465c-acd9-264a747d5351.ws-eu01.some.subdomain.somehost.com",
61
+ );
53
62
  expect(actual).to.equal("ca81a50f-09d7-465c-acd9-264a747d5351");
54
63
  }
55
64
 
@@ -73,4 +82,4 @@ export class ParseWorkspaceIdTest {
73
82
  expect(actual).to.be.false;
74
83
  }
75
84
  }
76
- module.exports = new ParseWorkspaceIdTest()
85
+ module.exports = new ParseWorkspaceIdTest();
@@ -4,7 +4,7 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- const REGEX_WORKSPACE_ID = /[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8}/;
7
+ const REGEX_WORKSPACE_ID = /[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}/;
8
8
  const REGEX_WORKSPACE_ID_EXACT = new RegExp(`^${REGEX_WORKSPACE_ID.source}$`);
9
9
  // We need to parse the workspace id precisely here to get the case '<some-str>-<port>-<wsid>.ws.' right
10
10
  const REGEX_WORKSPACE_ID_FROM_HOSTNAME = new RegExp(`(${REGEX_WORKSPACE_ID.source})\.ws`);
@@ -20,7 +20,7 @@ const REGEX_WORKSPACE_ID_LEGACY_FROM_HOSTNAME = new RegExp(`(${REGEX_WORKSPACE_I
20
20
  * - webview-1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io (or any other string replacing webview)
21
21
  * @param hostname The hostname the request is headed to
22
22
  */
23
- export const parseWorkspaceIdFromHostname = function(hostname: string) {
23
+ export const parseWorkspaceIdFromHostname = function (hostname: string) {
24
24
  const match = REGEX_WORKSPACE_ID_FROM_HOSTNAME.exec(hostname);
25
25
  if (match && match.length >= 2) {
26
26
  return match[1];
@@ -41,15 +41,14 @@ const REGEX_INSTANCE_ID_EXACT = new RegExp(`^${REGEX_INSTANCE_ID.source}$`);
41
41
  * @param maybeId
42
42
  * @returns
43
43
  */
44
- export const matchesInstanceIdOrLegacyWorkspaceIdExactly = function(maybeId: string): boolean {
45
- return REGEX_INSTANCE_ID_EXACT.test(maybeId)
46
- || REGEX_WORKSPACE_ID_LEGACY_EXACT.test(maybeId);
44
+ export const matchesInstanceIdOrLegacyWorkspaceIdExactly = function (maybeId: string): boolean {
45
+ return REGEX_INSTANCE_ID_EXACT.test(maybeId) || REGEX_WORKSPACE_ID_LEGACY_EXACT.test(maybeId);
47
46
  };
48
47
 
49
48
  /**
50
49
  * @param maybeWorkspaceId
51
50
  * @returns
52
51
  */
53
- export const matchesNewWorkspaceIdExactly = function(maybeWorkspaceId: string): boolean {
52
+ export const matchesNewWorkspaceIdExactly = function (maybeWorkspaceId: string): boolean {
54
53
  return REGEX_WORKSPACE_ID_EXACT.test(maybeWorkspaceId);
55
- };
54
+ };
@@ -4,19 +4,19 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import { suite, test, slow, timeout } from 'mocha-typescript'
8
- import * as chai from 'chai'
9
- const chaiSubset = require('chai-subset');
7
+ import { suite, test, slow, timeout } from "mocha-typescript";
8
+ import * as chai from "chai";
9
+ const chaiSubset = require("chai-subset");
10
10
  chai.use(chaiSubset);
11
11
 
12
- import { Queue } from '..';
13
- import { fail } from 'assert';
14
- import { Deferred } from './deferred';
12
+ import { Queue } from "..";
13
+ import { fail } from "assert";
14
+ import { Deferred } from "./deferred";
15
15
 
16
- const expect = chai.expect
17
-
18
- @suite class QueueSpec {
16
+ const expect = chai.expect;
19
17
 
18
+ @suite
19
+ class QueueSpec {
20
20
  queue: Queue;
21
21
  seq: number[];
22
22
 
@@ -35,8 +35,7 @@ const expect = chai.expect
35
35
  resolve(undefined);
36
36
  }, sleep);
37
37
  });
38
- else
39
- this.seq.push(seqNr);
38
+ else this.seq.push(seqNr);
40
39
  };
41
40
 
42
41
  if (nextTick)
@@ -45,20 +44,22 @@ const expect = chai.expect
45
44
  push().then(resolve);
46
45
  });
47
46
  });
48
- else
49
- await push();
47
+ else await push();
50
48
  });
51
49
  }
52
50
  execError(seqNr: number): Deferred<boolean> {
53
51
  const deferred = new Deferred<boolean>();
54
- this.queue.enqueue(async () => {
55
- this.seq.push(seqNr);
56
- throw new Error('test error');
57
- }).then(() => {
58
- deferred.reject(false);
59
- }).catch(() => {
60
- deferred.resolve(true);
61
- });
52
+ this.queue
53
+ .enqueue(async () => {
54
+ this.seq.push(seqNr);
55
+ throw new Error("test error");
56
+ })
57
+ .then(() => {
58
+ deferred.reject(false);
59
+ })
60
+ .catch(() => {
61
+ deferred.resolve(true);
62
+ });
62
63
 
63
64
  return deferred;
64
65
  }
@@ -67,7 +68,9 @@ const expect = chai.expect
67
68
  expect(actual).to.have.lengthOf(expected.length);
68
69
  const expIt = expected.entries();
69
70
  for (const act of actual) {
70
- const { value: [, exp] } = expIt.next();
71
+ const {
72
+ value: [, exp],
73
+ } = expIt.next();
71
74
  expect(act).to.deep.equal(exp);
72
75
  }
73
76
  }
@@ -93,7 +96,6 @@ const expect = chai.expect
93
96
  this.expectArray(this.seq, [1, 2]);
94
97
  }
95
98
 
96
-
97
99
  @test public async continueDespiteError() {
98
100
  this.exec(1);
99
101
  const receivedError = this.execError(2);
@@ -107,7 +109,7 @@ const expect = chai.expect
107
109
  @test public async mustCatchError() {
108
110
  const f = async () => {
109
111
  throw new Error();
110
- }
112
+ };
111
113
  try {
112
114
  const p = this.queue.enqueue(async () => {
113
115
  return f();
@@ -124,7 +126,7 @@ const expect = chai.expect
124
126
  @test public async expectUncaughtError() {
125
127
  const f = async () => {
126
128
  throw new Error();
127
- }
129
+ };
128
130
  const p = this.queue.enqueue(async () => {
129
131
  return f();
130
132
  });
@@ -0,0 +1,45 @@
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
+
7
+ import { Disposable } from "..";
8
+ import { log } from "./logging";
9
+
10
+ /**
11
+ * This intends to be a drop-in replacement for 'setInterval' implemented with a 'setTimeout' chain
12
+ * to ensure we're not creating more timeouts than we can process.
13
+ * @param op
14
+ * @param everyMilliseconds
15
+ * @returns
16
+ */
17
+ export function repeat(op: () => Promise<void> | void, everyMilliseconds: number): Disposable {
18
+ let timer: NodeJS.Timeout | undefined = undefined;
19
+ let stopped = false;
20
+ const repeated = () => {
21
+ if (stopped) {
22
+ // in case we missed the clearTimeout i 'await'
23
+ return;
24
+ }
25
+
26
+ timer = setTimeout(async () => {
27
+ try {
28
+ await op();
29
+ } catch (err) {
30
+ // catch error here to
31
+ log.error(err);
32
+ }
33
+
34
+ repeated(); // chain ourselves - after the 'await'
35
+ }, everyMilliseconds);
36
+ };
37
+ repeated();
38
+
39
+ return Disposable.create(() => {
40
+ stopped = true;
41
+ if (timer) {
42
+ clearTimeout(timer);
43
+ }
44
+ });
45
+ }
@@ -4,19 +4,18 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
-
8
7
  export class Semaphore {
9
8
  protected queue: (() => void)[] = [];
10
9
  protected used: number;
11
10
 
12
11
  constructor(protected readonly capacity: number) {
13
- if(capacity < 1) {
12
+ if (capacity < 1) {
14
13
  throw new Error("Capacity cannot be less than 1");
15
14
  }
16
15
  }
17
16
 
18
17
  public release() {
19
- if(this.used == 0) return;
18
+ if (this.used == 0) return;
20
19
 
21
20
  const queued = this.queue.shift();
22
21
  if (queued) {
@@ -28,7 +27,7 @@ export class Semaphore {
28
27
 
29
28
  public async acquire(): Promise<void> {
30
29
  this.used++;
31
- if(this.used <= this.capacity) {
30
+ if (this.used <= this.capacity) {
32
31
  return Promise.resolve();
33
32
  }
34
33
 
@@ -36,5 +35,4 @@ export class Semaphore {
36
35
  this.queue.push(rs);
37
36
  });
38
37
  }
39
-
40
- }
38
+ }
@@ -4,7 +4,6 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
-
8
7
  /**
9
8
  * The subset of actually available fields and methods which are not exported but we care about
10
9
  */
@@ -18,14 +17,18 @@ interface TestSuiteContext extends Mocha.ISuiteCallbackContext {
18
17
  * @param doSkip A function which takes a TestSuite and decides if it should be skipped
19
18
  */
20
19
  export function skipIf(doSkip: (suite: TestSuiteContext) => boolean): MochaTypeScript.SuiteTrait {
21
- const trait: MochaTypeScript.SuiteTrait = function(this: Mocha.ISuiteCallbackContext, ctx: Mocha.ISuiteCallbackContext, ctor: Function): void {
22
- const suite = ctx as any as TestSuiteContext; // No idea why those fields are not exported in the types
20
+ const trait: MochaTypeScript.SuiteTrait = function (
21
+ this: Mocha.ISuiteCallbackContext,
22
+ ctx: Mocha.ISuiteCallbackContext,
23
+ ctor: Function,
24
+ ): void {
25
+ const suite = ctx as any as TestSuiteContext; // No idea why those fields are not exported in the types
23
26
  const skip = doSkip(suite);
24
- suite.beforeEach(function(this: Mocha.IHookCallbackContext) {
27
+ suite.beforeEach(function (this: Mocha.IHookCallbackContext) {
25
28
  if (skip) {
26
29
  this.skip();
27
30
  }
28
- })
31
+ });
29
32
  };
30
33
 
31
34
  // Mark as "trait": mimics the behavior of https://github.com/testdeck/testdeck/blob/9d2dd6a458c2c86c945f6f2999b8278b7528a7a7/index.ts#L433
@@ -45,4 +48,4 @@ export function skipIfEnvVarNotSet(name: string): MochaTypeScript.SuiteTrait {
45
48
  }
46
49
  return skip;
47
50
  });
48
- }
51
+ }
@@ -4,40 +4,39 @@
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import * as chai from 'chai';
7
+ import * as chai from "chai";
8
8
  const expect = chai.expect;
9
- import { suite, test } from 'mocha-typescript';
10
- import { oneMonthLater } from './timeutil';
9
+ import { suite, test } from "mocha-typescript";
10
+ import { oneMonthLater } from "./timeutil";
11
11
 
12
12
  @suite()
13
13
  export class TimeutilSpec {
14
-
15
14
  @test
16
15
  testTimeutil() {
17
16
  // targeting a 1st, 1th of Jan => 1st of Feb
18
- this.isOneMonthLater(new Date(2000, 0, 1), 1, new Date(2000, 1, 1))
17
+ this.isOneMonthLater(new Date(2000, 0, 1), 1, new Date(2000, 1, 1));
19
18
 
20
19
  // targeting a 31th, 30th of Apr => 31st of May
21
- this.isOneMonthLater(new Date(2000, 3, 30), 31, new Date(2000, 4, 31))
20
+ this.isOneMonthLater(new Date(2000, 3, 30), 31, new Date(2000, 4, 31));
22
21
 
23
22
  // targeting a 31th, 31th of Mar => 30th of Apr
24
- this.isOneMonthLater(new Date(2000, 2, 31), 31, new Date(2000, 3, 30))
23
+ this.isOneMonthLater(new Date(2000, 2, 31), 31, new Date(2000, 3, 30));
25
24
 
26
25
  // targeting a 30th, 30th of Mar => 30th of Apr
27
- this.isOneMonthLater(new Date(2000, 2, 30), 30, new Date(2000, 3, 30))
26
+ this.isOneMonthLater(new Date(2000, 2, 30), 30, new Date(2000, 3, 30));
28
27
 
29
28
  // next year
30
- this.isOneMonthLater(new Date(2000, 11, 1), 1, new Date(2001, 0, 1))
31
- this.isOneMonthLater(new Date(2000, 11, 31), 31, new Date(2001, 0, 31))
29
+ this.isOneMonthLater(new Date(2000, 11, 1), 1, new Date(2001, 0, 1));
30
+ this.isOneMonthLater(new Date(2000, 11, 31), 31, new Date(2001, 0, 31));
32
31
 
33
32
  // Feb
34
- this.isOneMonthLater(new Date(2001, 0, 31), 31, new Date(2001, 1, 28))
33
+ this.isOneMonthLater(new Date(2001, 0, 31), 31, new Date(2001, 1, 28));
35
34
  // Feb leap year
36
- this.isOneMonthLater(new Date(2000, 0, 31), 31, new Date(2000, 1, 29))
35
+ this.isOneMonthLater(new Date(2000, 0, 31), 31, new Date(2000, 1, 29));
37
36
  }
38
37
 
39
38
  isOneMonthLater(from: Date, day: number, expectation: Date) {
40
- const later = oneMonthLater(from.toISOString(), day)
41
- expect(later, `expected ${later} to be equal ${expectation}`).to.be.equal(expectation.toISOString())
39
+ const later = oneMonthLater(from.toISOString(), day);
40
+ expect(later, `expected ${later} to be equal ${expectation}`).to.be.equal(expectation.toISOString());
42
41
  }
43
- }
42
+ }