@gitpod/gitpod-protocol 0.1.5-vn-update-gitpod-json-schema.0 → 0.1.5-vn-jetbrains-backend-plugin-223.6
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 +63 -113
- package/lib/accounting-protocol.d.ts +8 -0
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +12 -1
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +7 -0
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/attribution.d.ts +20 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +40 -0
- package/lib/attribution.js.map +1 -0
- package/lib/billing-mode.d.ts +41 -0
- package/lib/billing-mode.d.ts.map +1 -0
- package/lib/billing-mode.js +44 -0
- package/lib/billing-mode.js.map +1 -0
- package/lib/blocked-repositories-protocol.d.ts +13 -0
- package/lib/blocked-repositories-protocol.d.ts.map +1 -0
- package/lib/blocked-repositories-protocol.js +8 -0
- package/lib/blocked-repositories-protocol.js.map +1 -0
- package/lib/context-url.js +1 -1
- package/lib/context-url.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +3 -3
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +1 -1
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/key-provider.js +1 -1
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/experiments/always-default.d.ts +8 -0
- package/lib/experiments/always-default.d.ts.map +1 -0
- package/lib/experiments/always-default.js +20 -0
- package/lib/experiments/always-default.js.map +1 -0
- package/lib/experiments/configcat-server.d.ts +10 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +36 -0
- package/lib/experiments/configcat-server.js.map +1 -0
- package/lib/experiments/configcat.d.ts +23 -0
- package/lib/experiments/configcat.d.ts.map +1 -0
- package/lib/experiments/configcat.js +57 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +24 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/experiments/types.js +10 -0
- package/lib/experiments/types.js.map +1 -0
- package/lib/gitpod-service.d.ts +39 -12
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +13 -1
- package/lib/gitpod-service.js.map +1 -1
- package/lib/ide-protocol.d.ts +8 -0
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +3 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -1
- package/lib/installation-admin-protocol.js +1 -0
- package/lib/installation-admin-protocol.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +1 -17
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +1 -2
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +6 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +13 -3
- package/lib/messaging/error.js.map +1 -1
- package/lib/plans.d.ts +1 -0
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +4 -0
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +94 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +119 -13
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +7 -0
- package/lib/protocol.spec.d.ts.map +1 -0
- package/lib/protocol.spec.js +127 -0
- package/lib/protocol.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +17 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +16 -1
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +14 -1
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/usage.d.ts +61 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +14 -0
- package/lib/usage.js.map +1 -0
- package/lib/util/debug-app.d.ts +25 -0
- package/lib/util/debug-app.d.ts.map +1 -0
- package/lib/util/debug-app.js +100 -0
- package/lib/util/debug-app.js.map +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +5 -0
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/gitpod-host-url.d.ts +3 -0
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +18 -0
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/grpc.d.ts +19 -0
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +73 -1
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +8 -1
- package/lib/util/logging.js.map +1 -1
- package/lib/util/logging.spec.d.ts +7 -0
- package/lib/util/logging.spec.d.ts.map +1 -0
- package/lib/util/logging.spec.js +52 -0
- package/lib/util/logging.spec.js.map +1 -0
- package/lib/util/timeutil.d.ts +2 -0
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +13 -1
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +2 -0
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +34 -0
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/webhook-event.js +8 -0
- package/lib/webhook-event.js.map +1 -0
- package/lib/workspace-class.d.ts +14 -0
- package/lib/workspace-class.d.ts.map +1 -0
- package/lib/workspace-class.js +8 -0
- package/lib/workspace-class.js.map +1 -0
- package/lib/workspace-cluster.d.ts +5 -7
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +12 -0
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +3 -3
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +0 -2
- package/lib/wsready.js.map +1 -1
- package/package.json +12 -6
- package/pkg-yarn.lock +8 -5
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +13 -0
- package/src/admin-protocol.ts +10 -0
- package/src/attribution.ts +48 -0
- package/src/billing-mode.ts +77 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +1 -1
- package/src/encryption/encryption-engine.ts +7 -3
- package/src/encryption/key-provider.ts +1 -1
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +41 -0
- package/src/experiments/configcat.ts +62 -0
- package/src/experiments/types.ts +38 -0
- package/src/gitpod-service.ts +67 -11
- package/src/ide-protocol.ts +10 -0
- package/src/index.ts +1 -1
- package/src/installation-admin-protocol.ts +3 -0
- package/src/messaging/client-call-metrics.ts +1 -20
- package/src/messaging/error.ts +19 -4
- package/src/plans.ts +4 -0
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +205 -20
- package/src/team-subscription-protocol.ts +27 -0
- package/src/teams-projects-protocol.ts +15 -1
- package/src/usage.ts +71 -0
- package/src/util/debug-app.ts +81 -0
- package/src/util/garbage-collected-cache.ts +5 -0
- package/src/util/gitpod-host-url.ts +21 -0
- package/src/util/grpc.ts +89 -0
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +11 -2
- package/src/util/timeutil.spec.ts +28 -1
- package/src/util/timeutil.ts +12 -0
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +2 -4
- package/src/workspace-instance.ts +20 -0
- package/src/wsready.ts +5 -4
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -28
- package/lib/email-protocol.js.map +0 -1
- package/src/email-protocol.ts +0 -65
package/src/util/grpc.ts
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as grpc from "@grpc/grpc-js";
|
|
8
|
+
import { Status } from "@grpc/grpc-js/build/src/constants";
|
|
9
|
+
|
|
7
10
|
export const defaultGRPCOptions = {
|
|
8
11
|
"grpc.keepalive_timeout_ms": 10000,
|
|
9
12
|
"grpc.keepalive_time_ms": 60000,
|
|
@@ -13,3 +16,89 @@ export const defaultGRPCOptions = {
|
|
|
13
16
|
"grpc.max_reconnect_backoff_ms": 5000,
|
|
14
17
|
"grpc.max_receive_message_length": 1024 * 1024 * 16,
|
|
15
18
|
};
|
|
19
|
+
|
|
20
|
+
export type GrpcMethodType = "unary" | "client_stream" | "server_stream" | "bidi_stream";
|
|
21
|
+
|
|
22
|
+
export interface IGrpcCallMetricsLabels {
|
|
23
|
+
service: string;
|
|
24
|
+
method: string;
|
|
25
|
+
type: GrpcMethodType;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IGrpcCallMetricsLabelsWithCode extends IGrpcCallMetricsLabels {
|
|
29
|
+
code: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const IClientCallMetrics = Symbol("IClientCallMetrics");
|
|
33
|
+
|
|
34
|
+
export interface IClientCallMetrics {
|
|
35
|
+
started(labels: IGrpcCallMetricsLabels): void;
|
|
36
|
+
sent(labels: IGrpcCallMetricsLabels): void;
|
|
37
|
+
received(labels: IGrpcCallMetricsLabels): void;
|
|
38
|
+
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getGrpcMethodType(requestStream: boolean, responseStream: boolean): GrpcMethodType {
|
|
42
|
+
if (requestStream) {
|
|
43
|
+
if (responseStream) {
|
|
44
|
+
return "bidi_stream";
|
|
45
|
+
} else {
|
|
46
|
+
return "client_stream";
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
if (responseStream) {
|
|
50
|
+
return "server_stream";
|
|
51
|
+
} else {
|
|
52
|
+
return "unary";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function createClientCallMetricsInterceptor(metrics: IClientCallMetrics): grpc.Interceptor {
|
|
58
|
+
return (options, nextCall): grpc.InterceptingCall => {
|
|
59
|
+
const methodDef = options.method_definition;
|
|
60
|
+
const method = methodDef.path.substring(methodDef.path.lastIndexOf("/") + 1);
|
|
61
|
+
const service = methodDef.path.substring(1, methodDef.path.length - method.length - 1);
|
|
62
|
+
const labels = {
|
|
63
|
+
service,
|
|
64
|
+
method,
|
|
65
|
+
type: getGrpcMethodType(options.method_definition.requestStream, options.method_definition.responseStream),
|
|
66
|
+
};
|
|
67
|
+
const requester = new grpc.RequesterBuilder()
|
|
68
|
+
.withStart((metadata, listener, next) => {
|
|
69
|
+
const newListener = new grpc.ListenerBuilder()
|
|
70
|
+
.withOnReceiveStatus((status, next) => {
|
|
71
|
+
try {
|
|
72
|
+
metrics.handled({
|
|
73
|
+
...labels,
|
|
74
|
+
code: Status[status.code],
|
|
75
|
+
});
|
|
76
|
+
} finally {
|
|
77
|
+
next(status);
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
.withOnReceiveMessage((message, next) => {
|
|
81
|
+
try {
|
|
82
|
+
metrics.received(labels);
|
|
83
|
+
} finally {
|
|
84
|
+
next(message);
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.build();
|
|
88
|
+
try {
|
|
89
|
+
metrics.started(labels);
|
|
90
|
+
} finally {
|
|
91
|
+
next(metadata, newListener);
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
.withSendMessage((message, next) => {
|
|
95
|
+
try {
|
|
96
|
+
metrics.sent(labels);
|
|
97
|
+
} finally {
|
|
98
|
+
next(message);
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
.build();
|
|
102
|
+
return new grpc.InterceptingCall(nextCall(options), requester);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { suite, test } from "mocha-typescript";
|
|
8
|
+
import { log } from "./logging";
|
|
9
|
+
|
|
10
|
+
@suite
|
|
11
|
+
class TestLogging {
|
|
12
|
+
@test public async testLogInfo_output() {
|
|
13
|
+
const testObj = {
|
|
14
|
+
null: null,
|
|
15
|
+
undefined: undefined,
|
|
16
|
+
empty: "",
|
|
17
|
+
foo: "bar",
|
|
18
|
+
number: 0,
|
|
19
|
+
};
|
|
20
|
+
log.info("info logging test", testObj);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
module.exports = new TestLogging();
|
package/src/util/logging.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
const inspect: (object: any) => string = require("util").inspect; // undefined in frontend
|
|
8
8
|
|
|
9
|
+
let plainLogging: boolean = false; // set to true during development to get non JSON output
|
|
9
10
|
let jsonLogging: boolean = false;
|
|
10
11
|
let component: string | undefined;
|
|
11
12
|
let version: string | undefined;
|
|
@@ -309,7 +310,7 @@ function makeLogItem(
|
|
|
309
310
|
}
|
|
310
311
|
|
|
311
312
|
const payload: any = payloadArgs.length == 0 ? undefined : payloadArgs.length == 1 ? payloadArgs[0] : payloadArgs;
|
|
312
|
-
const logItem
|
|
313
|
+
const logItem = {
|
|
313
314
|
// undefined fields get eliminated in JSON.stringify()
|
|
314
315
|
...reportedErrorEvent,
|
|
315
316
|
component,
|
|
@@ -321,11 +322,19 @@ function makeLogItem(
|
|
|
321
322
|
payload,
|
|
322
323
|
loggedViaConsole: calledViaConsole ? true : undefined,
|
|
323
324
|
};
|
|
325
|
+
if (plainLogging) {
|
|
326
|
+
return `[${logItem.severity}] [${logItem.component}] ${logItem.message}
|
|
327
|
+
${JSON.stringify(payload || "", undefined, " ")}
|
|
328
|
+
${error || ""}
|
|
329
|
+
`.trim();
|
|
330
|
+
}
|
|
324
331
|
let result: string = stringifyLogItem(logItem);
|
|
325
332
|
|
|
326
333
|
if (result.length > maxAllowedLogItemLength && payload !== undefined) {
|
|
327
334
|
delete logItem.payload;
|
|
328
|
-
|
|
335
|
+
(<any>(
|
|
336
|
+
logItem
|
|
337
|
+
)).payloadStub = `Payload stripped as log item was longer than ${maxAllowedLogItemLength} characters`;
|
|
329
338
|
|
|
330
339
|
result = stringifyLogItem(logItem);
|
|
331
340
|
|
|
@@ -7,10 +7,16 @@
|
|
|
7
7
|
import * as chai from "chai";
|
|
8
8
|
const expect = chai.expect;
|
|
9
9
|
import { suite, test } from "mocha-typescript";
|
|
10
|
-
import { oneMonthLater } from "./timeutil";
|
|
10
|
+
import { daysBefore, hoursBefore, oneMonthLater } from "./timeutil";
|
|
11
11
|
|
|
12
12
|
@suite()
|
|
13
13
|
export class TimeutilSpec {
|
|
14
|
+
@test
|
|
15
|
+
testDaysBefore() {
|
|
16
|
+
const now = new Date().toISOString();
|
|
17
|
+
expect(daysBefore(now, 2)).to.be.eq(hoursBefore(now, 48));
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
@test
|
|
15
21
|
testTimeutil() {
|
|
16
22
|
// targeting a 1st, 1th of Jan => 1st of Feb
|
|
@@ -39,4 +45,25 @@ export class TimeutilSpec {
|
|
|
39
45
|
const later = oneMonthLater(from.toISOString(), day);
|
|
40
46
|
expect(later, `expected ${later} to be equal ${expectation}`).to.be.equal(expectation.toISOString());
|
|
41
47
|
}
|
|
48
|
+
|
|
49
|
+
@test
|
|
50
|
+
testDaysBefore2() {
|
|
51
|
+
const tests: { date: Date; daysEarlier: number; expectation: string }[] = [
|
|
52
|
+
{
|
|
53
|
+
date: new Date("2021-07-13T00:00:00.000Z"),
|
|
54
|
+
daysEarlier: 365,
|
|
55
|
+
expectation: "2020-07-13T00:00:00.000Z",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
date: new Date("2019-02-01T00:00:00.000Z"),
|
|
59
|
+
daysEarlier: 365,
|
|
60
|
+
expectation: "2018-02-01T00:00:00.000Z",
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
for (const t of tests) {
|
|
65
|
+
const actual = daysBefore(t.date.toISOString(), t.daysEarlier);
|
|
66
|
+
expect(actual).to.equal(t.expectation, `expected ${actual} to be equal ${t.expectation}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
42
69
|
}
|
package/src/util/timeutil.ts
CHANGED
|
@@ -47,6 +47,18 @@ export const orderAsc = (d1: string, d2: string): number => liftDate(d1, d2, (d1
|
|
|
47
47
|
export const liftDate1 = <T>(d1: string, f: (d1: Date) => T): T => f(new Date(d1));
|
|
48
48
|
export const liftDate = <T>(d1: string, d2: string, f: (d1: Date, d2: Date) => T): T => f(new Date(d1), new Date(d2));
|
|
49
49
|
|
|
50
|
+
export function daysBefore(date: string, days: number): string {
|
|
51
|
+
const result = new Date(date);
|
|
52
|
+
result.setDate(result.getDate() - days);
|
|
53
|
+
return result.toISOString();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function hoursBefore(date: string, hours: number): string {
|
|
57
|
+
const result = new Date(date);
|
|
58
|
+
result.setHours(result.getHours() - hours);
|
|
59
|
+
return result.toISOString();
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
export function hoursLater(date: string, hours: number): string {
|
|
51
63
|
const result = new Date(date);
|
|
52
64
|
result.setHours(result.getHours() + hours);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 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
|
+
export interface WebhookEvent {
|
|
8
|
+
id: string;
|
|
9
|
+
creationTime: string;
|
|
10
|
+
type: "push" | string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Typically the webhook installer is referenced here.
|
|
14
|
+
*/
|
|
15
|
+
authorizedUserId?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* webhook event's payload
|
|
19
|
+
*/
|
|
20
|
+
rawEvent: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The general status of the received webhook event.
|
|
24
|
+
*/
|
|
25
|
+
status: WebhookEvent.Status;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Optional message to help understand errors with handling events.
|
|
29
|
+
*/
|
|
30
|
+
message?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* If the webhook event is considered to trigger a prebuild, the `prebuildStatus`
|
|
34
|
+
* contains a more specific status.
|
|
35
|
+
*/
|
|
36
|
+
prebuildStatus?: WebhookEvent.PrebuildStatus;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* If `prebuildStatus` is `prebuild_triggered` this points to a prebuild.
|
|
40
|
+
*/
|
|
41
|
+
prebuildId?: string;
|
|
42
|
+
|
|
43
|
+
projectId?: string;
|
|
44
|
+
|
|
45
|
+
cloneUrl?: string;
|
|
46
|
+
|
|
47
|
+
branch?: string;
|
|
48
|
+
|
|
49
|
+
commit?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export namespace WebhookEvent {
|
|
53
|
+
export type Status = "received" | "dismissed_unauthorized" | "ignored" | "processed";
|
|
54
|
+
export type PrebuildStatus = "ignored_unconfigured" | "prebuild_trigger_failed" | "prebuild_triggered";
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 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
|
+
export interface SupportedWorkspaceClass {
|
|
8
|
+
id: string;
|
|
9
|
+
category: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
description: string;
|
|
12
|
+
powerups: number;
|
|
13
|
+
isSelected: boolean;
|
|
14
|
+
}
|
package/src/workspace-cluster.ts
CHANGED
|
@@ -56,12 +56,10 @@ export type WorkspaceManagerConnectionInfo = Pick<WorkspaceCluster, "name" | "ur
|
|
|
56
56
|
export type AdmissionConstraint =
|
|
57
57
|
| AdmissionConstraintFeaturePreview
|
|
58
58
|
| AdmissionConstraintHasPermission
|
|
59
|
-
|
|
|
60
|
-
| AdmissionConstraintHasMoreResources;
|
|
59
|
+
| AdmissionConstraintHasClass;
|
|
61
60
|
export type AdmissionConstraintFeaturePreview = { type: "has-feature-preview" };
|
|
62
61
|
export type AdmissionConstraintHasPermission = { type: "has-permission"; permission: PermissionName };
|
|
63
|
-
export type
|
|
64
|
-
export type AdmissionConstraintHasMoreResources = { type: "has-more-resources" };
|
|
62
|
+
export type AdmissionConstraintHasClass = { type: "has-class"; id: string; displayName: string };
|
|
65
63
|
|
|
66
64
|
export namespace AdmissionConstraint {
|
|
67
65
|
export function is(o: any): o is AdmissionConstraint {
|
|
@@ -56,10 +56,27 @@ export interface WorkspaceInstance {
|
|
|
56
56
|
* Contains information about the image build, if there was any
|
|
57
57
|
*/
|
|
58
58
|
imageBuildInfo?: ImageBuildInfo;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* workspace class, also known as workspace size, determines the type of
|
|
62
|
+
* resources that are provided to the workspace.
|
|
63
|
+
*/
|
|
64
|
+
workspaceClass?: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Identifies the team or user to which this instance's runtime should be attributed to
|
|
68
|
+
* (e.g. for usage analytics or billing purposes).
|
|
69
|
+
*/
|
|
70
|
+
usageAttributionId?: string;
|
|
59
71
|
}
|
|
60
72
|
|
|
61
73
|
// WorkspaceInstanceStatus describes the current state of a workspace instance
|
|
62
74
|
export interface WorkspaceInstanceStatus {
|
|
75
|
+
// version is the current version of the workspace instance status
|
|
76
|
+
// Note: consider this value opague. The only guarantee given is that it imposes
|
|
77
|
+
// a partial order on status updates, i.e. a.version > b.version -> a newer than b.
|
|
78
|
+
version?: number;
|
|
79
|
+
|
|
63
80
|
// phase describes a high-level state of the workspace instance
|
|
64
81
|
phase: WorkspaceInstancePhase;
|
|
65
82
|
|
|
@@ -229,6 +246,9 @@ export interface WorkspaceInstanceConfiguration {
|
|
|
229
246
|
// desktopIdeImage is the ref of the desktop IDE image this instance uses.
|
|
230
247
|
desktopIdeImage?: string;
|
|
231
248
|
|
|
249
|
+
// desktopIdePluginImage is the ref of the desktop IDE plugin image this instance uses.
|
|
250
|
+
desktopIdePluginImage?: string;
|
|
251
|
+
|
|
232
252
|
// supervisorImage is the ref of the supervisor image this instance uses.
|
|
233
253
|
supervisorImage?: string;
|
|
234
254
|
|
package/src/wsready.ts
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
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 2022-
|
|
7
|
+
// generated using github.com/32leaves/bel on 2022-07-21 07:41:48.081573085 +0000 UTC m=+0.009109470
|
|
8
8
|
// DO NOT MODIFY
|
|
9
9
|
|
|
10
|
+
export interface WorkspaceReadyMessage {
|
|
11
|
+
source: WorkspaceInitSource;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
export enum WorkspaceInitSource {
|
|
11
15
|
WorkspaceInitFromBackup = "from-backup",
|
|
12
16
|
WorkspaceInitFromPrebuild = "from-prebuild",
|
|
13
17
|
WorkspaceInitFromOther = "from-other",
|
|
14
18
|
}
|
|
15
|
-
export interface WorkspaceReadyMessage {
|
|
16
|
-
source: WorkspaceInitSource;
|
|
17
|
-
}
|
package/lib/email-protocol.d.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
|
-
export declare type EMailState = "scheduledInternal" | "scheduledSendgrid";
|
|
7
|
-
export interface EMailStatus {
|
|
8
|
-
/** The time the email entry was inserted into the DB */
|
|
9
|
-
scheduledInternalTime: string;
|
|
10
|
-
/** The time the email state transitioned to "scheduledSendgrid" */
|
|
11
|
-
scheduledSendgridTime?: string;
|
|
12
|
-
/** In case of any errors during sending with Sendgrid it gets noted here */
|
|
13
|
-
error?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare namespace EMailStatus {
|
|
16
|
-
function getState(status: EMailStatus): EMailState;
|
|
17
|
-
}
|
|
18
|
-
export interface EmailAddress {
|
|
19
|
-
name?: string;
|
|
20
|
-
email: string;
|
|
21
|
-
}
|
|
22
|
-
export interface EMailParameters {
|
|
23
|
-
/** undefined means default from template */
|
|
24
|
-
subject?: string;
|
|
25
|
-
/** The sender address */
|
|
26
|
-
senderAddress: string | EmailAddress;
|
|
27
|
-
/** The replyTo address */
|
|
28
|
-
replyToAddress?: string | EmailAddress;
|
|
29
|
-
/** The SendGrid template id */
|
|
30
|
-
templateId: string;
|
|
31
|
-
/** The parameters for the SendGrid template */
|
|
32
|
-
templateParams: {};
|
|
33
|
-
}
|
|
34
|
-
export declare type EMail = {
|
|
35
|
-
/** The unique id of this email (uuid/v4 for now) */
|
|
36
|
-
uid: string;
|
|
37
|
-
/** The id of the user this email was sent to */
|
|
38
|
-
userId: string;
|
|
39
|
-
/** The address this email was sent to */
|
|
40
|
-
recipientAddress: string;
|
|
41
|
-
/** Which campaign scheduled this email */
|
|
42
|
-
campaignId: string;
|
|
43
|
-
/** The parameters this email was sent with (template id, template params, etc) */
|
|
44
|
-
params: EMailParameters;
|
|
45
|
-
} & EMailStatus;
|
|
46
|
-
export declare namespace EMail {
|
|
47
|
-
const create: (ts: Omit<EMail, "uid">) => EMail;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=email-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"email-protocol.d.ts","sourceRoot":"","sources":["../src/email-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,oBAAY,UAAU,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAEnE,MAAM,WAAW,WAAW;IACxB,wDAAwD;IACxD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mEAAmE;IACnE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,yBAAiB,WAAW,CAAC;IACzB,SAAgB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAKxD;CACJ;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC5B,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,aAAa,EAAE,MAAM,GAAG,YAAY,CAAC;IACrC,0BAA0B;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACvC,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,cAAc,EAAE,EAAE,CAAC;CACtB;AAED,oBAAY,KAAK,GAAG;IAChB,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,MAAM,EAAE,eAAe,CAAC;CAC3B,GAAG,WAAW,CAAC;AAEhB,yBAAiB,KAAK,CAAC;IACZ,MAAM,MAAM,OAAQ,KAAK,KAAK,EAAE,KAAK,CAAC,KAAG,KAI/C,CAAC;CACL"}
|
package/lib/email-protocol.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
|
-
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License-AGPL.txt in the project root for license information.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.EMail = exports.EMailStatus = void 0;
|
|
9
|
-
const uuid_1 = require("uuid");
|
|
10
|
-
var EMailStatus;
|
|
11
|
-
(function (EMailStatus) {
|
|
12
|
-
function getState(status) {
|
|
13
|
-
if (status.scheduledSendgridTime) {
|
|
14
|
-
return "scheduledSendgrid";
|
|
15
|
-
}
|
|
16
|
-
return "scheduledInternal";
|
|
17
|
-
}
|
|
18
|
-
EMailStatus.getState = getState;
|
|
19
|
-
})(EMailStatus = exports.EMailStatus || (exports.EMailStatus = {}));
|
|
20
|
-
var EMail;
|
|
21
|
-
(function (EMail) {
|
|
22
|
-
EMail.create = (ts) => {
|
|
23
|
-
const withId = ts;
|
|
24
|
-
withId.uid = (0, uuid_1.v4)();
|
|
25
|
-
return withId;
|
|
26
|
-
};
|
|
27
|
-
})(EMail = exports.EMail || (exports.EMail = {}));
|
|
28
|
-
//# sourceMappingURL=email-protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"email-protocol.js","sourceRoot":"","sources":["../src/email-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+BAAoC;AAYpC,IAAiB,WAAW,CAO3B;AAPD,WAAiB,WAAW;IACxB,SAAgB,QAAQ,CAAC,MAAmB;QACxC,IAAI,MAAM,CAAC,qBAAqB,EAAE;YAC9B,OAAO,mBAAmB,CAAC;SAC9B;QACD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IALe,oBAAQ,WAKvB,CAAA;AACL,CAAC,EAPgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAO3B;AAiCD,IAAiB,KAAK,CAMrB;AAND,WAAiB,KAAK;IACL,YAAM,GAAG,CAAC,EAAsB,EAAS,EAAE;QACpD,MAAM,MAAM,GAAG,EAAW,CAAC;QAC3B,MAAM,CAAC,GAAG,GAAG,IAAA,SAAM,GAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC,EANgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAMrB"}
|
package/src/email-protocol.ts
DELETED
|
@@ -1,65 +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 { v4 as uuidv4 } from "uuid";
|
|
8
|
-
|
|
9
|
-
export type EMailState = "scheduledInternal" | "scheduledSendgrid";
|
|
10
|
-
|
|
11
|
-
export interface EMailStatus {
|
|
12
|
-
/** The time the email entry was inserted into the DB */
|
|
13
|
-
scheduledInternalTime: string;
|
|
14
|
-
/** The time the email state transitioned to "scheduledSendgrid" */
|
|
15
|
-
scheduledSendgridTime?: string;
|
|
16
|
-
/** In case of any errors during sending with Sendgrid it gets noted here */
|
|
17
|
-
error?: string;
|
|
18
|
-
}
|
|
19
|
-
export namespace EMailStatus {
|
|
20
|
-
export function getState(status: EMailStatus): EMailState {
|
|
21
|
-
if (status.scheduledSendgridTime) {
|
|
22
|
-
return "scheduledSendgrid";
|
|
23
|
-
}
|
|
24
|
-
return "scheduledInternal";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface EmailAddress {
|
|
29
|
-
name?: string;
|
|
30
|
-
email: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface EMailParameters {
|
|
34
|
-
/** undefined means default from template */
|
|
35
|
-
subject?: string;
|
|
36
|
-
/** The sender address */
|
|
37
|
-
senderAddress: string | EmailAddress;
|
|
38
|
-
/** The replyTo address */
|
|
39
|
-
replyToAddress?: string | EmailAddress;
|
|
40
|
-
/** The SendGrid template id */
|
|
41
|
-
templateId: string;
|
|
42
|
-
/** The parameters for the SendGrid template */
|
|
43
|
-
templateParams: {};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type EMail = {
|
|
47
|
-
/** The unique id of this email (uuid/v4 for now) */
|
|
48
|
-
uid: string;
|
|
49
|
-
/** The id of the user this email was sent to */
|
|
50
|
-
userId: string;
|
|
51
|
-
/** The address this email was sent to */
|
|
52
|
-
recipientAddress: string;
|
|
53
|
-
/** Which campaign scheduled this email */
|
|
54
|
-
campaignId: string;
|
|
55
|
-
/** The parameters this email was sent with (template id, template params, etc) */
|
|
56
|
-
params: EMailParameters;
|
|
57
|
-
} & EMailStatus;
|
|
58
|
-
|
|
59
|
-
export namespace EMail {
|
|
60
|
-
export const create = (ts: Omit<EMail, "uid">): EMail => {
|
|
61
|
-
const withId = ts as EMail;
|
|
62
|
-
withId.uid = uuidv4();
|
|
63
|
-
return withId;
|
|
64
|
-
};
|
|
65
|
-
}
|