@gitpod/gitpod-protocol 0.1.5-wth-test.41 → 0.1.5-wth-test.80

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 (140) hide show
  1. package/data/gitpod-schema.json +18 -3
  2. package/lib/admin-protocol.d.ts +12 -1
  3. package/lib/admin-protocol.d.ts.map +1 -1
  4. package/lib/admin-protocol.js.map +1 -1
  5. package/lib/analytics.d.ts +4 -5
  6. package/lib/analytics.d.ts.map +1 -1
  7. package/lib/context-url.d.ts +18 -5
  8. package/lib/context-url.d.ts.map +1 -1
  9. package/lib/context-url.js +58 -5
  10. package/lib/context-url.js.map +1 -1
  11. package/lib/context-url.spec.d.ts +2 -0
  12. package/lib/context-url.spec.d.ts.map +1 -1
  13. package/lib/context-url.spec.js +25 -4
  14. package/lib/context-url.spec.js.map +1 -1
  15. package/lib/gitpod-service.d.ts +33 -6
  16. package/lib/gitpod-service.d.ts.map +1 -1
  17. package/lib/gitpod-service.js +4 -2
  18. package/lib/gitpod-service.js.map +1 -1
  19. package/lib/ide-protocol.d.ts +105 -0
  20. package/lib/ide-protocol.d.ts.map +1 -0
  21. package/lib/ide-protocol.js +8 -0
  22. package/lib/ide-protocol.js.map +1 -0
  23. package/lib/index.d.ts +2 -0
  24. package/lib/index.d.ts.map +1 -1
  25. package/lib/index.js +2 -0
  26. package/lib/index.js.map +1 -1
  27. package/lib/installation-admin-protocol.d.ts +27 -0
  28. package/lib/installation-admin-protocol.d.ts.map +1 -0
  29. package/lib/installation-admin-protocol.js +30 -0
  30. package/lib/installation-admin-protocol.js.map +1 -0
  31. package/lib/messaging/error.d.ts +1 -0
  32. package/lib/messaging/error.d.ts.map +1 -1
  33. package/lib/messaging/error.js +2 -0
  34. package/lib/messaging/error.js.map +1 -1
  35. package/lib/messaging/node/connection.d.ts +1 -17
  36. package/lib/messaging/node/connection.d.ts.map +1 -1
  37. package/lib/messaging/node/connection.js +21 -57
  38. package/lib/messaging/node/connection.js.map +1 -1
  39. package/lib/oss-allowlist.d.ts +14 -0
  40. package/lib/oss-allowlist.d.ts.map +1 -0
  41. package/lib/oss-allowlist.js +8 -0
  42. package/lib/oss-allowlist.js.map +1 -0
  43. package/lib/permission.d.ts +7 -1
  44. package/lib/permission.d.ts.map +1 -1
  45. package/lib/permission.js +24 -4
  46. package/lib/permission.js.map +1 -1
  47. package/lib/protocol.d.ts +28 -40
  48. package/lib/protocol.d.ts.map +1 -1
  49. package/lib/protocol.js +16 -4
  50. package/lib/protocol.js.map +1 -1
  51. package/lib/teams-projects-protocol.d.ts +10 -0
  52. package/lib/teams-projects-protocol.d.ts.map +1 -1
  53. package/lib/teams-projects-protocol.js +7 -0
  54. package/lib/teams-projects-protocol.js.map +1 -1
  55. package/lib/util/analytics.js +12 -3
  56. package/lib/util/analytics.js.map +1 -1
  57. package/lib/util/garbage-collected-cache.d.ts +1 -0
  58. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  59. package/lib/util/garbage-collected-cache.js +5 -1
  60. package/lib/util/garbage-collected-cache.js.map +1 -1
  61. package/lib/util/generate-workspace-id.d.ts +1 -1
  62. package/lib/util/generate-workspace-id.d.ts.map +1 -1
  63. package/lib/util/generate-workspace-id.js +19 -2
  64. package/lib/util/generate-workspace-id.js.map +1 -1
  65. package/lib/util/generate-workspace-id.spec.js +24 -0
  66. package/lib/util/generate-workspace-id.spec.js.map +1 -1
  67. package/lib/util/gitpod-host-url.d.ts +0 -1
  68. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  69. package/lib/util/gitpod-host-url.js +3 -6
  70. package/lib/util/gitpod-host-url.js.map +1 -1
  71. package/lib/util/jaeger-client-types.d.ts +68 -0
  72. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  73. package/lib/util/jaeger-client-types.js +8 -0
  74. package/lib/util/jaeger-client-types.js.map +1 -0
  75. package/lib/util/parse-workspace-id.js +1 -1
  76. package/lib/util/parse-workspace-id.js.map +1 -1
  77. package/lib/util/repeat.d.ts +15 -0
  78. package/lib/util/repeat.d.ts.map +1 -0
  79. package/lib/util/repeat.js +55 -0
  80. package/lib/util/repeat.js.map +1 -0
  81. package/lib/util/tracing.d.ts +51 -5
  82. package/lib/util/tracing.d.ts.map +1 -1
  83. package/lib/util/tracing.js +156 -17
  84. package/lib/util/tracing.js.map +1 -1
  85. package/lib/util/tracing.spec.d.ts +7 -0
  86. package/lib/util/tracing.spec.d.ts.map +1 -0
  87. package/lib/util/tracing.spec.js +121 -0
  88. package/lib/util/tracing.spec.js.map +1 -0
  89. package/lib/workspace-cluster.d.ts +9 -7
  90. package/lib/workspace-cluster.d.ts.map +1 -1
  91. package/lib/workspace-cluster.js +18 -1
  92. package/lib/workspace-cluster.js.map +1 -1
  93. package/lib/workspace-instance.d.ts +19 -0
  94. package/lib/workspace-instance.d.ts.map +1 -1
  95. package/package.json +5 -3
  96. package/pkg-yarn.lock +2 -2
  97. package/provenance-bundle.jsonl +2 -0
  98. package/src/admin-protocol.ts +19 -5
  99. package/src/analytics.ts +4 -6
  100. package/src/context-url.spec.ts +18 -4
  101. package/src/context-url.ts +62 -6
  102. package/src/gitpod-service.ts +41 -10
  103. package/src/ide-frontend-service.ts +1 -1
  104. package/src/ide-protocol.ts +119 -0
  105. package/src/index.ts +2 -0
  106. package/src/installation-admin-protocol.ts +42 -0
  107. package/src/messaging/error.ts +3 -0
  108. package/src/messaging/node/connection.ts +21 -68
  109. package/src/oss-allowlist.ts +15 -0
  110. package/src/permission.ts +22 -3
  111. package/src/protocol.ts +45 -44
  112. package/src/teams-projects-protocol.ts +16 -1
  113. package/src/util/analytics.ts +21 -3
  114. package/src/util/garbage-collected-cache.ts +7 -1
  115. package/src/util/generate-workspace-id.spec.ts +17 -0
  116. package/src/util/generate-workspace-id.ts +20 -2
  117. package/src/util/gitpod-host-url.ts +4 -8
  118. package/src/util/jaeger-client-types.ts +102 -0
  119. package/src/util/parse-workspace-id.ts +1 -1
  120. package/src/util/repeat.ts +45 -0
  121. package/src/util/tracing.spec.ts +83 -0
  122. package/src/util/tracing.ts +183 -17
  123. package/src/workspace-cluster.ts +17 -9
  124. package/src/workspace-instance.ts +20 -0
  125. package/lib/messaging/connection-error-handler.d.ts +0 -27
  126. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  127. package/lib/messaging/connection-error-handler.js +0 -34
  128. package/lib/messaging/connection-error-handler.js.map +0 -1
  129. package/lib/util/repeater.d.ts +0 -22
  130. package/lib/util/repeater.d.ts.map +0 -1
  131. package/lib/util/repeater.js +0 -65
  132. package/lib/util/repeater.js.map +0 -1
  133. package/lib/util/safe-promise.d.ts +0 -11
  134. package/lib/util/safe-promise.d.ts.map +0 -1
  135. package/lib/util/safe-promise.js +0 -31
  136. package/lib/util/safe-promise.js.map +0 -1
  137. package/src/messaging/connection-error-handler.ts +0 -62
  138. package/src/util/jaeger-client.d.ts +0 -105
  139. package/src/util/repeater.ts +0 -49
  140. package/src/util/safe-promise.ts +0 -26
@@ -1,105 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
- // Type definitions for jaeger-client
8
- // Project: https://github.com/uber/jaeger-client-node
9
- // Definitions by: Julian Steger <https://github.com/julianste>
10
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
11
-
12
- declare module 'jaeger-client' {
13
- import * as opentracing from "opentracing";
14
-
15
- export interface TracingConfig {
16
- serviceName?: string;
17
- disable?: boolean;
18
- sampler?: SamplerConfig;
19
- reporter?: ReporterConfig;
20
- }
21
-
22
- export interface TracingOptions {
23
- reporter?: Reporter;
24
- metrics?: MetricsFactory;
25
- logger?: Logger;
26
- tags?: any;
27
- }
28
-
29
- export interface ReporterConfig {
30
- logSpans?: boolean;
31
- agentHost?: string;
32
- agentPort?: number;
33
- flushIntervalMs?: number;
34
- }
35
-
36
- export interface SamplerConfig {
37
- type: string;
38
- param: number;
39
- host?: string;
40
- port?: number;
41
- refreshIntervalMs?: number;
42
- }
43
-
44
- export interface Logger {
45
- info(msg: string): void;
46
- error(msg: string): void;
47
- }
48
-
49
- export interface Reporter {
50
- report(span: opentracing.Span): void;
51
- close(callback?: () => void): void;
52
- setProcess(serviceName: string, tags: any): void;
53
- }
54
-
55
- export interface MetricsFactory {
56
- createCounter(name: string, tags: any): Counter;
57
- createTimer(name: string, tags: any): Timer;
58
- createGauge(name: string, tags: any): Gauge;
59
- }
60
-
61
- // Counter tracks the number of times an event has occurred
62
- export interface Counter {
63
- // Adds the given value to the counter.
64
- increment(delta: number): void;
65
- }
66
-
67
- // Timer tracks how long an operation took and also computes percentiles.
68
- export interface Timer {
69
- // Records the time passed in.
70
- record(value: number): void;
71
- }
72
-
73
- // Gauge returns instantaneous measurements of something as an int64 value
74
- export interface Gauge {
75
- // Update the gauge to the value passed in.
76
- update(value: number): void;
77
- }
78
-
79
- export function initTracer(
80
- tracingConfig: TracingConfig,
81
- tracingOptions: TracingOptions,
82
- ): opentracing.Tracer;
83
-
84
- export function initTracerFromEnv(
85
- tracingConfig: TracingConfig,
86
- tracingOptions: TracingOptions,
87
- ): opentracing.Tracer;
88
-
89
- export interface SamplingDecision {
90
- sample: boolean;
91
- retryable: boolean;
92
- tags: any;
93
- }
94
-
95
- // added by TypeFox
96
- export interface Sampler {
97
- name(): string
98
- isSampled(operation: string, tags: any): boolean;
99
- onCreateSpan(span: opentracing.Span): SamplingDecision;
100
- onSetOperationName(span: opentracing.Span, operationName: string): SamplingDecision;
101
- onSetTag(span: opentracing.Span, key: string, value: any): SamplingDecision;
102
- close(callback: () => void): void
103
- }
104
-
105
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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 { Deferred } from "./deferred";
8
- import { log } from './logging';
9
-
10
- /**
11
- * Repeats a given function until it is stopped
12
- */
13
- export class Repeater {
14
- protected shouldRun: boolean;
15
- protected finished: Deferred<void>
16
- protected timer?: any;
17
-
18
- constructor(protected readonly fn: () => Promise<void> | void, protected readonly timeout: number) { }
19
-
20
- async start() {
21
- this.run();
22
- }
23
-
24
- async run() {
25
- this.shouldRun = true;
26
- this.finished = new Deferred<void>();
27
- while (this.shouldRun) {
28
- try {
29
- await this.fn();
30
- } catch (err) {
31
- log.error(err);
32
- }
33
- await this.sleep(this.timeout);
34
- }
35
- this.finished.resolve();
36
- }
37
-
38
- protected async sleep(timeout: number) {
39
- return new Promise(resolve => this.timer = setTimeout(resolve, timeout));
40
- }
41
-
42
- async stop() {
43
- this.shouldRun = false;
44
- if (this.timer) {
45
- clearTimeout(this.timer);
46
- }
47
- return this.finished.promise;
48
- }
49
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2020 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
-
8
- import { log, LogContext } from './logging';
9
-
10
- export class SafePromise {
11
- public static catchAndLog<T>(p: Promise<T>, logCtx?: LogContext) {
12
- return SafePromise.catch(p, (err) => {
13
- if (logCtx) {
14
- log.error(logCtx, err);
15
- } else {
16
- log.error(err);
17
- }
18
- });
19
- };
20
- public static catch<T>(p: Promise<T>, handler: (err: any) => void): Promise<T> {
21
- return p.catch((err) => {
22
- handler(err);
23
- return {} as T; // Nobody will ever see this value as the Promise already failed. It's just there to please the compiler
24
- });
25
- };
26
- }