@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.
- package/data/gitpod-schema.json +18 -3
- package/lib/admin-protocol.d.ts +12 -1
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +4 -5
- package/lib/analytics.d.ts.map +1 -1
- package/lib/context-url.d.ts +18 -5
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +58 -5
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +2 -0
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +25 -4
- package/lib/context-url.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +33 -6
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +4 -2
- package/lib/gitpod-service.js.map +1 -1
- package/lib/ide-protocol.d.ts +105 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +8 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/messaging/error.d.ts +1 -0
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +2 -0
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +21 -57
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/permission.d.ts +7 -1
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +24 -4
- package/lib/permission.js.map +1 -1
- package/lib/protocol.d.ts +28 -40
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +16 -4
- package/lib/protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +10 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +7 -0
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/util/analytics.js +12 -3
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +5 -1
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +1 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +19 -2
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +24 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-host-url.d.ts +0 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +3 -6
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/jaeger-client-types.js +8 -0
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/parse-workspace-id.js +1 -1
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/tracing.d.ts +51 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +156 -17
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/workspace-cluster.d.ts +9 -7
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +18 -1
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +19 -0
- package/lib/workspace-instance.d.ts.map +1 -1
- package/package.json +5 -3
- package/pkg-yarn.lock +2 -2
- package/provenance-bundle.jsonl +2 -0
- package/src/admin-protocol.ts +19 -5
- package/src/analytics.ts +4 -6
- package/src/context-url.spec.ts +18 -4
- package/src/context-url.ts +62 -6
- package/src/gitpod-service.ts +41 -10
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +2 -0
- package/src/installation-admin-protocol.ts +42 -0
- package/src/messaging/error.ts +3 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/oss-allowlist.ts +15 -0
- package/src/permission.ts +22 -3
- package/src/protocol.ts +45 -44
- package/src/teams-projects-protocol.ts +16 -1
- package/src/util/analytics.ts +21 -3
- package/src/util/garbage-collected-cache.ts +7 -1
- package/src/util/generate-workspace-id.spec.ts +17 -0
- package/src/util/generate-workspace-id.ts +20 -2
- package/src/util/gitpod-host-url.ts +4 -8
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/parse-workspace-id.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -17
- package/src/workspace-cluster.ts +17 -9
- package/src/workspace-instance.ts +20 -0
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -34
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -65
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -31
- package/lib/util/safe-promise.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- 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
|
-
}
|
package/src/util/repeater.ts
DELETED
|
@@ -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
|
-
}
|
package/src/util/safe-promise.ts
DELETED
|
@@ -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
|
-
}
|