@gitpod/gitpod-protocol 0.1.5-wth-update-mysql-dependencies-2.31 → 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 +25 -24
- package/lib/accounting-protocol.d.ts +3 -6
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +10 -16
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +26 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +15 -0
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +44 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +14 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +94 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.js +5 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.js +19 -20
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -36
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.js +29 -43
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.js +25 -30
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.js +25 -41
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +116 -116
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +124 -22
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +169 -278
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +8 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +4 -7
- package/lib/headless-workspace-log.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 +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- 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/browser/connection.d.ts +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.js +35 -55
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +3 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +6 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.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 +23 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.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 +8 -1
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +36 -15
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +121 -54
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +117 -131
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +4 -4
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +15 -12
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +113 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +88 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.js +55 -133
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +8 -8
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.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 +26 -46
- 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 +31 -68
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +57 -78
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +95 -98
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +7 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +103 -31
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/{without.js → jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +107 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +2 -2
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +10 -0
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +32 -7
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +4 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +123 -84
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +144 -288
- package/lib/util/queue.spec.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/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.js +28 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +51 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -62
- 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/util/workspace-port-authentication.js +3 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +76 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +33 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +24 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +31 -17
- package/pkg-yarn.lock +17 -9
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +4 -10
- package/src/admin-protocol.ts +47 -5
- package/src/analytics.ts +52 -0
- package/src/context-url.spec.ts +53 -0
- package/src/context-url.ts +107 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +181 -44
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +7 -1
- package/src/installation-admin-protocol.ts +42 -0
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +8 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/oss-allowlist.ts +15 -0
- package/src/permission.ts +24 -4
- package/src/plans.ts +632 -0
- package/src/protocol.ts +196 -85
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +7 -5
- package/src/teams-projects-protocol.ts +147 -0
- package/src/util/analytics.ts +105 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +9 -3
- package/src/util/generate-workspace-id.spec.ts +20 -3
- package/src/util/generate-workspace-id.ts +22 -2
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +25 -1
- package/src/util/gitpod-host-url.ts +22 -13
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +21 -1
- package/src/util/parse-workspace-id.ts +32 -6
- package/src/util/queue.spec.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -17
- package/src/workspace-cluster.ts +104 -0
- package/src/workspace-instance.ts +45 -13
- package/src/wsready.ts +2 -2
- 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 -46
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/util/context-url.d.ts +0 -13
- package/lib/util/context-url.d.ts.map +0 -1
- package/lib/util/context-url.js +0 -26
- package/lib/util/context-url.js.map +0 -1
- package/lib/util/context-url.spec.d.ts +0 -10
- package/lib/util/context-url.spec.d.ts.map +0 -1
- package/lib/util/context-url.spec.js +0 -52
- package/lib/util/context-url.spec.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 -118
- 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 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
package/src/util/tracing.ts
CHANGED
|
@@ -6,40 +6,184 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import * as opentracing from 'opentracing';
|
|
9
|
-
import { TracingConfig, initTracerFromEnv
|
|
9
|
+
import { TracingConfig, initTracerFromEnv } from 'jaeger-client';
|
|
10
|
+
import { Sampler, SamplingDecision } from './jaeger-client-types';
|
|
10
11
|
import { initGlobalTracer } from 'opentracing';
|
|
11
12
|
import { injectable } from 'inversify';
|
|
13
|
+
import { ResponseError } from 'vscode-jsonrpc';
|
|
14
|
+
import { log, LogContext } from './logging';
|
|
12
15
|
|
|
13
16
|
export interface TraceContext {
|
|
14
17
|
span?: opentracing.Span
|
|
15
18
|
}
|
|
19
|
+
export type TraceContextWithSpan = TraceContext & {
|
|
20
|
+
span: opentracing.Span
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
|
|
17
24
|
export namespace TraceContext {
|
|
18
|
-
export function startSpan(operation: string,
|
|
19
|
-
const options: opentracing.SpanOptions = {
|
|
20
|
-
|
|
25
|
+
export function startSpan(operation: string, parentCtx?: TraceContext): opentracing.Span {
|
|
26
|
+
const options: opentracing.SpanOptions = {};
|
|
27
|
+
if (parentCtx && parentCtx.span && !!parentCtx.span.context().toSpanId()) {
|
|
28
|
+
options.childOf = parentCtx.span;
|
|
21
29
|
}
|
|
30
|
+
// TODO(gpl) references lead to a huge amount of errors in prod logs. Avoid those until we have time to figure out how to fix it.
|
|
31
|
+
// if (referencedSpans) {
|
|
32
|
+
// // note: allthough followsForm's type says it takes 'opentracing.Span | opentracing.SpanContext', it only works with SpanContext (typing mismatch)
|
|
33
|
+
// // note2: we need to filter out debug spans (spanId === "")
|
|
34
|
+
// options.references = referencedSpans.filter(s => s !== undefined)
|
|
35
|
+
// .filter(s => !!s!.context().toSpanId())
|
|
36
|
+
// .map(s => followsFrom(s!.context()));
|
|
37
|
+
// }
|
|
38
|
+
|
|
22
39
|
return opentracing.globalTracer().startSpan(operation, options);
|
|
23
40
|
}
|
|
24
41
|
|
|
25
|
-
export function
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
export function childContext(operation: string, parentCtx: TraceContext): TraceContextWithSpan {
|
|
43
|
+
const span = startSpan(operation, parentCtx);
|
|
44
|
+
return { span };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function withSpan(operation: string, callback: (ctx: TraceContext) => void, ctx?: TraceContext): void {
|
|
48
|
+
// if we don't have a parent span, don't create a trace here as those <trace-without-root-spans> are not useful.
|
|
49
|
+
if (!ctx || !ctx.span || !ctx.span.context()) {
|
|
50
|
+
callback({});
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const span = TraceContext.startSpan(operation, ctx);
|
|
55
|
+
try {
|
|
56
|
+
callback({span});
|
|
57
|
+
} catch (e) {
|
|
58
|
+
TraceContext.setError({span}, e);
|
|
59
|
+
throw e;
|
|
60
|
+
} finally {
|
|
61
|
+
span.finish();
|
|
29
62
|
}
|
|
30
|
-
return opentracing.globalTracer().startSpan(operation, options);
|
|
31
63
|
}
|
|
32
64
|
|
|
33
|
-
export function
|
|
65
|
+
export function setError(ctx: TraceContext, err: Error) {
|
|
34
66
|
if (!ctx.span) {
|
|
35
67
|
return;
|
|
36
68
|
}
|
|
37
69
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
70
|
+
TraceContext.addNestedTags(ctx, {
|
|
71
|
+
error: {
|
|
72
|
+
message: err.message,
|
|
73
|
+
stacktrace: err.stack,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
ctx.span.setTag("error", true);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function setJsonRPCMetadata(ctx: TraceContext, method?: string) {
|
|
80
|
+
if (!ctx.span) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const tags: { [key: string]: any } = {
|
|
85
|
+
rpc: {
|
|
86
|
+
system: "jsonrpc",
|
|
87
|
+
// version,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
if (method) {
|
|
91
|
+
tags.rpc.method = method;
|
|
92
|
+
}
|
|
93
|
+
addNestedTags(ctx, tags);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function setJsonRPCError(ctx: TraceContext, method: string, err: ResponseError<any>, withStatusCode: boolean = false) {
|
|
97
|
+
if (!ctx.span) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// not use setError bc this is (most likely) a working operation
|
|
101
|
+
|
|
102
|
+
setJsonRPCMetadata(ctx, method);
|
|
103
|
+
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md#json-rpc
|
|
104
|
+
addNestedTags(ctx, {
|
|
105
|
+
rpc: {
|
|
106
|
+
jsonrpc: {
|
|
107
|
+
error_code: err.code,
|
|
108
|
+
error_message: err.message,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// the field "status_code" is used by honeycomb to derive insights like success rate, etc. Defaults to "0".
|
|
114
|
+
if (withStatusCode) {
|
|
115
|
+
ctx.span.setTag("status_code", err.code);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function addJsonRPCParameters(ctx: TraceContext, params: { [key: string]: any }) {
|
|
120
|
+
if (!ctx.span) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setJsonRPCMetadata(ctx);
|
|
125
|
+
addNestedTags(ctx, {
|
|
126
|
+
rpc: {
|
|
127
|
+
jsonrpc: {
|
|
128
|
+
parameters: params,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Does what one would expect from `span.addTags`: Calls `span.addTag` for all keys in map, recursively for objects.
|
|
136
|
+
* Example:
|
|
137
|
+
* ```
|
|
138
|
+
* TraceContext.addNestedTags(ctx, {
|
|
139
|
+
* rpc: {
|
|
140
|
+
* system: "jsonrpc",
|
|
141
|
+
* jsonrpc: {
|
|
142
|
+
* version: "1.0",
|
|
143
|
+
* method: "test",
|
|
144
|
+
* parameters: ["abc", "def"],
|
|
145
|
+
* },
|
|
146
|
+
* },
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
* gives
|
|
150
|
+
* rpc.system = "jsonrpc"
|
|
151
|
+
* rpc.jsonrpc.version = "1.0"
|
|
152
|
+
* rpc.jsonrpc.method = "test"
|
|
153
|
+
* rpc.jsonrpc.parameters.0 = "abc"
|
|
154
|
+
* rpc.jsonrpc.parameters.1 = "def"
|
|
155
|
+
* @param ctx
|
|
156
|
+
* @param keyValueMap
|
|
157
|
+
* @returns
|
|
158
|
+
*/
|
|
159
|
+
export function addNestedTags(ctx: TraceContext, keyValueMap: { [key: string]: any }, _namespace?: string) {
|
|
160
|
+
if (!ctx.span) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const namespace = _namespace ? `${_namespace}.` : '';
|
|
164
|
+
|
|
165
|
+
try {
|
|
166
|
+
for (const k of Object.keys(keyValueMap)) {
|
|
167
|
+
const v = keyValueMap[k];
|
|
168
|
+
if (v instanceof Object) {
|
|
169
|
+
addNestedTags(ctx, v, `${namespace}${k}`);
|
|
170
|
+
} else {
|
|
171
|
+
ctx.span.setTag(`${namespace}${k}`, v);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} catch (err) {
|
|
175
|
+
// general resilience against odd shapes/parameters
|
|
176
|
+
log.error("Tracing.addNestedTags", err, { namespace });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function setOWI(ctx: TraceContext, owi: LogContext) {
|
|
181
|
+
if (!ctx.span) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
addNestedTags(ctx, {
|
|
185
|
+
context: owi,
|
|
186
|
+
});
|
|
43
187
|
}
|
|
44
188
|
}
|
|
45
189
|
|
|
@@ -56,11 +200,16 @@ export class TracingManager {
|
|
|
56
200
|
reporter: {
|
|
57
201
|
logSpans: false
|
|
58
202
|
},
|
|
59
|
-
serviceName
|
|
203
|
+
serviceName,
|
|
60
204
|
}
|
|
61
205
|
const t = initTracerFromEnv(config, {
|
|
62
|
-
logger: console
|
|
206
|
+
logger: console,
|
|
207
|
+
tags: {
|
|
208
|
+
'service.build.commit': process.env.GITPOD_BUILD_GIT_COMMIT,
|
|
209
|
+
'service.build.version': process.env.GITPOD_BUILD_VERSION,
|
|
210
|
+
}
|
|
63
211
|
});
|
|
212
|
+
|
|
64
213
|
if (opts) {
|
|
65
214
|
if (opts.perOpSampling) {
|
|
66
215
|
(t as any)._sampler = new PerOperationSampler((t as any)._sampler, opts.perOpSampling);
|
|
@@ -132,3 +281,20 @@ export class PerOperationSampler implements Sampler {
|
|
|
132
281
|
}
|
|
133
282
|
}
|
|
134
283
|
}
|
|
284
|
+
|
|
285
|
+
// Augment interfaces with an leading parameter "TraceContext" on every method
|
|
286
|
+
type IsValidArg<T> = T extends object ? keyof T extends never ? false : true : true;
|
|
287
|
+
type AddTraceContext<T> =
|
|
288
|
+
T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E, f: infer F) => infer R ? (
|
|
289
|
+
IsValidArg<F> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E, f: F) => R :
|
|
290
|
+
IsValidArg<E> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D, e: E) => R :
|
|
291
|
+
IsValidArg<D> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C, d: D) => R :
|
|
292
|
+
IsValidArg<C> extends true ? (ctx: TraceContextWithSpan, a: A, b: B, c: C) => R :
|
|
293
|
+
IsValidArg<B> extends true ? (ctx: TraceContextWithSpan, a: A, b: B) => R :
|
|
294
|
+
IsValidArg<A> extends true ? (ctx: TraceContextWithSpan, a: A) => R :
|
|
295
|
+
(ctx: TraceContextWithSpan) => Promise<R>
|
|
296
|
+
) : never;
|
|
297
|
+
|
|
298
|
+
export type InterfaceWithTraceContext<T> = {
|
|
299
|
+
[P in keyof T]: AddTraceContext<T[P]>
|
|
300
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
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 * as fs from 'fs';
|
|
8
|
+
import { filePathTelepresenceAware } from './env';
|
|
9
|
+
import { DeepPartial } from "./util/deep-partial";
|
|
10
|
+
import { PermissionName } from './permission';
|
|
11
|
+
|
|
12
|
+
export interface WorkspaceCluster {
|
|
13
|
+
// Name of the workspace cluster.
|
|
14
|
+
// This is the string set in each
|
|
15
|
+
// Must be identical to the installationShortname of the cluster it represents!
|
|
16
|
+
name: string;
|
|
17
|
+
|
|
18
|
+
// URL of the cluster's ws-manager API
|
|
19
|
+
url: string;
|
|
20
|
+
|
|
21
|
+
// TLS contains the keys and certificates necessary to use mTLS between server and clients
|
|
22
|
+
tls?: TLSConfig;
|
|
23
|
+
|
|
24
|
+
// Current state of the cluster
|
|
25
|
+
state: WorkspaceClusterState;
|
|
26
|
+
|
|
27
|
+
// Maximum value score can reach for this cluster
|
|
28
|
+
maxScore: number;
|
|
29
|
+
|
|
30
|
+
// Score used for cluster selection when starting workspace instances
|
|
31
|
+
score: number;
|
|
32
|
+
|
|
33
|
+
// True if this bridge should control this cluster
|
|
34
|
+
govern: boolean;
|
|
35
|
+
|
|
36
|
+
// An optional set of constraints that limit who can start workspaces on the cluster
|
|
37
|
+
admissionConstraints?: AdmissionConstraint[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type WorkspaceClusterState = "available" | "cordoned" | "draining";
|
|
41
|
+
export interface TLSConfig {
|
|
42
|
+
// the CA shared between client and server (base64 encoded)
|
|
43
|
+
ca: string;
|
|
44
|
+
// the private key (base64 encoded)
|
|
45
|
+
key: string;
|
|
46
|
+
// the certificate signed with the shared CA (base64 encoded)
|
|
47
|
+
crt: string;
|
|
48
|
+
}
|
|
49
|
+
export namespace TLSConfig {
|
|
50
|
+
export const loadFromBase64File = (path: string): string => fs.readFileSync(filePathTelepresenceAware(path)).toString("base64");
|
|
51
|
+
}
|
|
52
|
+
export type WorkspaceClusterWoTLS = Omit<WorkspaceCluster, "tls">;
|
|
53
|
+
export type WorkspaceManagerConnectionInfo = Pick<WorkspaceCluster, "name" | "url" | "tls">;
|
|
54
|
+
|
|
55
|
+
export type AdmissionConstraint = AdmissionConstraintFeaturePreview | AdmissionConstraintHasPermission | AdmissionConstraintHasUserLevel | AdmissionConstraintHasMoreResources;
|
|
56
|
+
export type AdmissionConstraintFeaturePreview = { type: "has-feature-preview" };
|
|
57
|
+
export type AdmissionConstraintHasPermission = { type: "has-permission", permission: PermissionName };
|
|
58
|
+
export type AdmissionConstraintHasUserLevel = { type: "has-user-level", level: string };
|
|
59
|
+
export type AdmissionConstraintHasMoreResources = { type: "has-more-resources" };
|
|
60
|
+
|
|
61
|
+
export namespace AdmissionConstraint {
|
|
62
|
+
export function is(o: any): o is AdmissionConstraint {
|
|
63
|
+
return !!o
|
|
64
|
+
&& 'type' in o;
|
|
65
|
+
}
|
|
66
|
+
export function isHasPermissionConstraint(o: any): o is AdmissionConstraintHasPermission {
|
|
67
|
+
return is(o)
|
|
68
|
+
&& o.type === "has-permission";
|
|
69
|
+
}
|
|
70
|
+
export function hasPermission(ac: AdmissionConstraint, permission: PermissionName): boolean {
|
|
71
|
+
return isHasPermissionConstraint(ac) && ac.permission === permission;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const WorkspaceClusterDB = Symbol("WorkspaceClusterDB");
|
|
76
|
+
export interface WorkspaceClusterDB {
|
|
77
|
+
/**
|
|
78
|
+
* Stores the given WorkspaceCluster to the cluster-local DB in a consistent manner.
|
|
79
|
+
* If there already is an entry with the same name it's merged and updated with the given state.
|
|
80
|
+
* @param cluster
|
|
81
|
+
*/
|
|
82
|
+
save(cluster: WorkspaceCluster): Promise<void>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Deletes the cluster identified by this name, if any.
|
|
86
|
+
* @param name
|
|
87
|
+
*/
|
|
88
|
+
deleteByName(name: string): Promise<void>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Finds a WorkspaceCluster with the given name. If there is none, `undefined` is returned.
|
|
92
|
+
* @param name
|
|
93
|
+
*/
|
|
94
|
+
findByName(name: string): Promise<WorkspaceCluster | undefined>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Lists all WorkspaceClusterWoTls for which the given predicate is true (does not return TLS for size/speed concerns)
|
|
98
|
+
* @param predicate
|
|
99
|
+
*/
|
|
100
|
+
findFiltered(predicate: DeepPartial<WorkspaceClusterFilter>): Promise<WorkspaceClusterWoTLS[]>;
|
|
101
|
+
}
|
|
102
|
+
export interface WorkspaceClusterFilter extends Pick<WorkspaceCluster, "state" | "govern" | "url"> {
|
|
103
|
+
minScore: number;
|
|
104
|
+
}
|
|
@@ -23,16 +23,22 @@ export interface WorkspaceInstance {
|
|
|
23
23
|
// The time an instance has switched phase to 'Running'
|
|
24
24
|
startedTime?: string;
|
|
25
25
|
|
|
26
|
+
// The time an instance has switched phase to 'Stopping' */
|
|
27
|
+
stoppingTime?: string;
|
|
28
|
+
|
|
26
29
|
// The time an instance has switched phase to 'Stopped' */
|
|
27
30
|
stoppedTime?: string;
|
|
28
31
|
|
|
29
32
|
// ideUrl is the URL at which the workspace is available on the internet
|
|
33
|
+
// Note: this is nitially empty, filled during starting process!
|
|
30
34
|
ideUrl: string;
|
|
31
35
|
|
|
32
36
|
// region is the name of the workspace cluster this instance runs in
|
|
37
|
+
// Note: this is nitially empty, filled during starting process!
|
|
33
38
|
region: string;
|
|
34
39
|
|
|
35
40
|
// workspaceImage is the name of the Docker image this instance runs
|
|
41
|
+
// Note: this is nitially empty, filled during starting process!
|
|
36
42
|
workspaceImage: string;
|
|
37
43
|
|
|
38
44
|
// status is the latest status of the instance that we're aware of
|
|
@@ -45,6 +51,11 @@ export interface WorkspaceInstance {
|
|
|
45
51
|
|
|
46
52
|
// instance is hard-deleted on the database and about to be collected by db-sync
|
|
47
53
|
readonly deleted?: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Contains information about the image build, if there was any
|
|
57
|
+
*/
|
|
58
|
+
imageBuildInfo?: ImageBuildInfo;
|
|
48
59
|
}
|
|
49
60
|
|
|
50
61
|
// WorkspaceInstanceStatus describes the current state of a workspace instance
|
|
@@ -83,7 +94,7 @@ export interface WorkspaceInstanceStatus {
|
|
|
83
94
|
// WorkspaceInstancePhase describes a high-level state of a workspace instance
|
|
84
95
|
export type WorkspaceInstancePhase =
|
|
85
96
|
// unknown indicates an issue within the system in that it cannot determine the actual phase of
|
|
86
|
-
|
|
97
|
+
// a workspace. This phase is usually accompanied by an error.
|
|
87
98
|
"unknown" |
|
|
88
99
|
|
|
89
100
|
// Preparing means that we haven't actually started the workspace instance just yet, but rather
|
|
@@ -91,21 +102,21 @@ export type WorkspaceInstancePhase =
|
|
|
91
102
|
"preparing" |
|
|
92
103
|
|
|
93
104
|
// Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
// some space within the cluster. If for example the cluster needs to scale up to accomodate the
|
|
106
|
+
// workspace, the workspace will be in Pending state until that happened.
|
|
96
107
|
"pending" |
|
|
97
108
|
|
|
98
109
|
// Creating means the workspace is currently being created. Thati includes downloading the images required
|
|
99
|
-
|
|
100
|
-
|
|
110
|
+
// to run the workspace over the network. The time spent in this phase varies widely and depends on the current
|
|
111
|
+
// network speed, image size and cache states.
|
|
101
112
|
"creating" |
|
|
102
113
|
|
|
103
114
|
// Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
|
|
104
|
-
|
|
115
|
+
// clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
|
|
105
116
|
"initializing" |
|
|
106
117
|
|
|
107
118
|
// Running means the workspace is able to actively perform work, either by serving a user through Theia,
|
|
108
|
-
|
|
119
|
+
// or as a headless workspace.
|
|
109
120
|
"running" |
|
|
110
121
|
|
|
111
122
|
// Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
|
|
@@ -128,9 +139,6 @@ export interface WorkspaceInstanceConditions {
|
|
|
128
139
|
// PullingImages marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating
|
|
129
140
|
pullingImages?: boolean
|
|
130
141
|
|
|
131
|
-
// ServiceExists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist.
|
|
132
|
-
serviceExists?: boolean
|
|
133
|
-
|
|
134
142
|
// deployed marks that a workspace instance was sent/deployed at a workspace manager
|
|
135
143
|
deployed?: boolean;
|
|
136
144
|
|
|
@@ -139,6 +147,12 @@ export interface WorkspaceInstanceConditions {
|
|
|
139
147
|
|
|
140
148
|
// ISO8601 timestamp when the first user activity was registered in the frontend. Only set if the workspace is running.
|
|
141
149
|
firstUserActivity?: string;
|
|
150
|
+
|
|
151
|
+
// headless_task_failed indicates that a headless workspace task failed
|
|
152
|
+
headlessTaskFailed?: string;
|
|
153
|
+
|
|
154
|
+
// stopped_by_request is true if the workspace was stopped using a StopWorkspace call
|
|
155
|
+
stoppedByRequest?: boolean;
|
|
142
156
|
}
|
|
143
157
|
|
|
144
158
|
// AdmissionLevel describes who can access a workspace instance and its ports.
|
|
@@ -152,9 +166,6 @@ export interface WorkspaceInstancePort {
|
|
|
152
166
|
// The outward-facing port number
|
|
153
167
|
port: number;
|
|
154
168
|
|
|
155
|
-
// An optional inward-facing port number. If not present we'll use port.
|
|
156
|
-
targetPort?: number;
|
|
157
|
-
|
|
158
169
|
// The visiblity of this port. Optional for backwards compatibility.
|
|
159
170
|
visibility?: PortVisibility;
|
|
160
171
|
|
|
@@ -200,4 +211,25 @@ export interface WorkspaceInstanceConfiguration {
|
|
|
200
211
|
|
|
201
212
|
// ideImage is the ref of the IDE image this instance uses.
|
|
202
213
|
ideImage: string;
|
|
214
|
+
|
|
215
|
+
// desktopIdeImage is the ref of the desktop IDE image this instance uses.
|
|
216
|
+
desktopIdeImage?: string
|
|
217
|
+
|
|
218
|
+
// supervisorImage is the ref of the supervisor image this instance uses.
|
|
219
|
+
supervisorImage?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Holds information about the image build (if there was one) for this WorkspaceInstance
|
|
224
|
+
*/
|
|
225
|
+
export interface ImageBuildInfo {
|
|
226
|
+
log?: ImageBuildLogInfo,
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Holds information about how to access logs for this an image build
|
|
231
|
+
*/
|
|
232
|
+
export interface ImageBuildLogInfo {
|
|
233
|
+
url: string,
|
|
234
|
+
headers: { [key: string]: string },
|
|
203
235
|
}
|
package/src/wsready.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// generated using github.com/32leaves/bel on
|
|
7
|
+
// generated using github.com/32leaves/bel on 2021-11-04 12:16:53.917570766 +0000 UTC m=+0.006002884
|
|
8
8
|
// DO NOT MODIFY
|
|
9
9
|
|
|
10
10
|
export enum WorkspaceInitSource {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Message } from "vscode-jsonrpc";
|
|
2
|
-
export interface ResolvedConnectionErrorHandlerOptions {
|
|
3
|
-
readonly serverName: string;
|
|
4
|
-
/**
|
|
5
|
-
* The maximum amount of errors allowed before stopping the server.
|
|
6
|
-
*/
|
|
7
|
-
readonly maxErrors: number;
|
|
8
|
-
/**
|
|
9
|
-
* The maimum amount of restarts allowed in the restart interval.
|
|
10
|
-
*/
|
|
11
|
-
readonly maxRestarts: number;
|
|
12
|
-
/**
|
|
13
|
-
* In minutes.
|
|
14
|
-
*/
|
|
15
|
-
readonly restartInterval: number;
|
|
16
|
-
}
|
|
17
|
-
export declare type ConnectionErrorHandlerOptions = Partial<ResolvedConnectionErrorHandlerOptions> & {
|
|
18
|
-
readonly serverName: string;
|
|
19
|
-
};
|
|
20
|
-
export declare class ConnectionErrorHandler {
|
|
21
|
-
protected readonly options: ResolvedConnectionErrorHandlerOptions;
|
|
22
|
-
constructor(options: ConnectionErrorHandlerOptions);
|
|
23
|
-
shouldStop(error: Error, message?: Message, count?: number): boolean;
|
|
24
|
-
protected readonly restarts: number[];
|
|
25
|
-
shouldRestart(): boolean;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=connection-error-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.d.ts","sourceRoot":"","sources":["../../src/messaging/connection-error-handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC,MAAM,WAAW,qCAAqC;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CACnC;AAED,oBAAY,6BAA6B,GAAG,OAAO,CAAC,qCAAqC,CAAC,GAAG;IACzF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC9B,CAAC;AAEF,qBAAa,sBAAsB;IAE/B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,qCAAqC,CAAC;gBACtD,OAAO,EAAE,6BAA6B;IASlD,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAIpE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAM;IAC3C,aAAa,IAAI,OAAO;CAc3B"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (C) 2017 TypeFox and others.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
*/
|
|
8
|
-
var __assign = (this && this.__assign) || function () {
|
|
9
|
-
__assign = Object.assign || function(t) {
|
|
10
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11
|
-
s = arguments[i];
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
}
|
|
15
|
-
return t;
|
|
16
|
-
};
|
|
17
|
-
return __assign.apply(this, arguments);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.ConnectionErrorHandler = void 0;
|
|
21
|
-
var logging_1 = require("../util/logging");
|
|
22
|
-
var ConnectionErrorHandler = /** @class */ (function () {
|
|
23
|
-
function ConnectionErrorHandler(options) {
|
|
24
|
-
this.restarts = [];
|
|
25
|
-
this.options = __assign({ maxErrors: 3, maxRestarts: 5, restartInterval: 3 }, options);
|
|
26
|
-
}
|
|
27
|
-
ConnectionErrorHandler.prototype.shouldStop = function (error, message, count) {
|
|
28
|
-
return !count || count > this.options.maxErrors;
|
|
29
|
-
};
|
|
30
|
-
ConnectionErrorHandler.prototype.shouldRestart = function () {
|
|
31
|
-
this.restarts.push(Date.now());
|
|
32
|
-
if (this.restarts.length <= this.options.maxRestarts) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
var diff = this.restarts[this.restarts.length - 1] - this.restarts[0];
|
|
36
|
-
if (diff <= this.options.restartInterval * 60 * 1000) {
|
|
37
|
-
logging_1.log.error("Server " + this.options.serverName + " crashed " + this.options.maxRestarts + " times in the last " + this.options.restartInterval + " minutes. Will not restart");
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
this.restarts.shift();
|
|
41
|
-
return true;
|
|
42
|
-
};
|
|
43
|
-
return ConnectionErrorHandler;
|
|
44
|
-
}());
|
|
45
|
-
exports.ConnectionErrorHandler = ConnectionErrorHandler;
|
|
46
|
-
//# sourceMappingURL=connection-error-handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection-error-handler.js","sourceRoot":"","sources":["../../src/messaging/connection-error-handler.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;AAGH,2CAAsC;AAsBtC;IAGI,gCAAY,OAAsC;QAa/B,aAAQ,GAAa,EAAE,CAAC;QAZvC,IAAI,CAAC,OAAO,cACR,SAAS,EAAE,CAAC,EACZ,WAAW,EAAE,CAAC,EACd,eAAe,EAAE,CAAC,IACf,OAAO,CACb,CAAC;IACN,CAAC;IAED,2CAAU,GAAV,UAAW,KAAY,EAAE,OAAiB,EAAE,KAAc;QACtD,OAAO,CAAC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACpD,CAAC;IAGD,8CAAa,GAAb;QACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YAClD,OAAO,IAAI,CAAC;SACf;QACD,IAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,EAAE,GAAG,IAAI,EAAE;YAClD,aAAG,CAAC,KAAK,CAAC,YAAU,IAAI,CAAC,OAAO,CAAC,UAAU,iBAAY,IAAI,CAAC,OAAO,CAAC,WAAW,2BAAsB,IAAI,CAAC,OAAO,CAAC,eAAe,+BAA4B,CAAC,CAAC;YAC/J,OAAO,KAAK,CAAC;SAChB;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;IAEL,6BAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,wDAAsB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020 TypeFox 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
|
-
* The field "contextUrl" might contain prefixes like:
|
|
8
|
-
* - envvar1=value1/...
|
|
9
|
-
* - prebuild/...
|
|
10
|
-
* This is the analogon to the (Prefix)ContextParser structure in "server".
|
|
11
|
-
*/
|
|
12
|
-
export declare function contextUrlToUrl(contextUrl: string | undefined): URL | undefined;
|
|
13
|
-
//# sourceMappingURL=context-url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-url.d.ts","sourceRoot":"","sources":["../../src/util/context-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,CAU/E"}
|
package/lib/util/context-url.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2020 TypeFox 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.contextUrlToUrl = void 0;
|
|
9
|
-
/**
|
|
10
|
-
* The field "contextUrl" might contain prefixes like:
|
|
11
|
-
* - envvar1=value1/...
|
|
12
|
-
* - prebuild/...
|
|
13
|
-
* This is the analogon to the (Prefix)ContextParser structure in "server".
|
|
14
|
-
*/
|
|
15
|
-
function contextUrlToUrl(contextUrl) {
|
|
16
|
-
if (contextUrl === undefined) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
if (contextUrl.startsWith("http")) {
|
|
20
|
-
return new URL(contextUrl);
|
|
21
|
-
}
|
|
22
|
-
var finding = contextUrl.search("/http");
|
|
23
|
-
return new URL(contextUrl.substr(finding + 1));
|
|
24
|
-
}
|
|
25
|
-
exports.contextUrlToUrl = contextUrlToUrl;
|
|
26
|
-
//# sourceMappingURL=context-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-url.js","sourceRoot":"","sources":["../../src/util/context-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,UAA8B;IAC5D,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACjC,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;KAC5B;IACD,IAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAVD,0CAUC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020 TypeFox GmbH. All rights reserved.
|
|
3
|
-
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License-AGPL.txt in the project root for license information.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ContextUrlTest {
|
|
7
|
-
parseContextUrl_withEnvVar(): void;
|
|
8
|
-
parseContextUrl_withPrebuild(): void;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=context-url.spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-url.spec.d.ts","sourceRoot":"","sources":["../../src/util/context-url.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,qBACa,cAAc;IAEV,0BAA0B;IAK1B,4BAA4B;CAI5C"}
|