@gitpod/gitpod-protocol 0.1.5-patch-1-fork.0 → 0.1.5-pd-del-private-repo-check-fork.0
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 +8 -22
- package/lib/accounting-protocol.d.ts +3 -5
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +9 -14
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +15 -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 +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/{util/without.js → analytics.js} +4 -2
- package/lib/analytics.js.map +1 -0
- package/lib/context-url.d.ts +18 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +49 -0
- package/lib/context-url.js.map +1 -0
- package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +3 -1
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +73 -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 +95 -20
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +167 -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/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- 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/connection-error-handler.js +11 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +2 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +4 -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.js +22 -22
- 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/permission.d.ts +2 -1
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +14 -13
- 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 +93 -15
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +104 -130
- 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 +103 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +23 -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 +79 -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.js +22 -46
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +13 -67
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +34 -79
- 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 +0 -1
- 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/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/repeater.js +35 -88
- package/lib/util/repeater.js.map +1 -1
- package/lib/util/safe-promise.js +9 -12
- package/lib/util/safe-promise.js.map +1 -1
- 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.js +43 -47
- package/lib/util/tracing.js.map +1 -1
- 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 +74 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +16 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +4 -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 +28 -16
- package/pkg-yarn.lock +17 -9
- package/src/accounting-protocol.ts +4 -8
- package/src/admin-protocol.ts +33 -5
- package/src/analytics.ts +54 -0
- package/src/context-url.spec.ts +39 -0
- package/src/context-url.ts +51 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +145 -39
- package/src/headless-workspace-log.ts +7 -11
- package/src/index.ts +5 -1
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +5 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +2 -2
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/permission.ts +2 -1
- package/src/plans.ts +632 -0
- package/src/protocol.ts +152 -43
- 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 +132 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +2 -2
- package/src/util/generate-workspace-id.spec.ts +3 -3
- package/src/util/generate-workspace-id.ts +2 -0
- 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 +19 -10
- package/src/util/grpc.ts +15 -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/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/workspace-cluster.ts +96 -0
- package/src/workspace-instance.ts +22 -13
- package/src/wsready.ts +2 -2
- 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.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/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
|
@@ -10,6 +10,7 @@ export interface WorkspaceInstance {
|
|
|
10
10
|
creationTime: string;
|
|
11
11
|
deployedTime?: string;
|
|
12
12
|
startedTime?: string;
|
|
13
|
+
stoppingTime?: string;
|
|
13
14
|
stoppedTime?: string;
|
|
14
15
|
ideUrl: string;
|
|
15
16
|
region: string;
|
|
@@ -35,16 +36,16 @@ export interface WorkspaceInstanceConditions {
|
|
|
35
36
|
failed?: string;
|
|
36
37
|
timeout?: string;
|
|
37
38
|
pullingImages?: boolean;
|
|
38
|
-
serviceExists?: boolean;
|
|
39
39
|
deployed?: boolean;
|
|
40
40
|
neededImageBuild?: boolean;
|
|
41
41
|
firstUserActivity?: string;
|
|
42
|
+
headlessTaskFailed?: string;
|
|
43
|
+
stoppedByRequest?: boolean;
|
|
42
44
|
}
|
|
43
45
|
export declare type AdmissionLevel = 'owner_only' | 'everyone';
|
|
44
46
|
export declare type PortVisibility = 'public' | 'private';
|
|
45
47
|
export interface WorkspaceInstancePort {
|
|
46
48
|
port: number;
|
|
47
|
-
targetPort?: number;
|
|
48
49
|
visibility?: PortVisibility;
|
|
49
50
|
url?: string;
|
|
50
51
|
}
|
|
@@ -62,5 +63,6 @@ export interface WorkspaceInstanceConfiguration {
|
|
|
62
63
|
theiaVersion?: string;
|
|
63
64
|
featureFlags?: NamedWorkspaceFeatureFlag[];
|
|
64
65
|
ideImage: string;
|
|
66
|
+
desktopIdeImage?: string;
|
|
65
67
|
}
|
|
66
68
|
//# sourceMappingURL=workspace-instance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-instance.d.ts","sourceRoot":"","sources":["../src/workspace-instance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD,MAAM,WAAW,iBAAiB;IAE9B,EAAE,EAAE,MAAM,CAAC;IAGX,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace-instance.d.ts","sourceRoot":"","sources":["../src/workspace-instance.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD,MAAM,WAAW,iBAAiB;IAE9B,EAAE,EAAE,MAAM,CAAC;IAGX,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,EAAE,MAAM,CAAC;IAIf,cAAc,EAAE,MAAM,CAAC;IAGvB,MAAM,EAAE,uBAAuB,CAAC;IAKhC,aAAa,CAAC,EAAE,8BAA8B,CAAC;IAG/C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC9B;AAGD,MAAM,WAAW,uBAAuB;IAEpC,KAAK,EAAE,sBAAsB,CAAC;IAG9B,UAAU,EAAE,2BAA2B,CAAC;IAGxC,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAGvC,IAAI,CAAC,EAAE,2BAA2B,CAAC;IAGnC,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,oBAAY,sBAAsB,GAG9B,SAAS,GAIT,WAAW,GAKX,SAAS,GAKT,UAAU,GAIV,cAAc,GAId,SAAS,GAIT,aAAa,GAGb,UAAU,GAGV,SAAS,CAAC;AAEd,MAAM,WAAW,2BAA2B;IAExC,MAAM,CAAC,EAAE,MAAM,CAAA;IAGf,OAAO,CAAC,EAAE,MAAM,CAAA;IAGhB,aAAa,CAAC,EAAE,OAAO,CAAA;IAGvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAGnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAG3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAGD,oBAAY,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;AAGvD,oBAAY,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAGlD,MAAM,WAAW,qBAAqB;IAElC,IAAI,EAAE,MAAM,CAAC;IAGb,UAAU,CAAC,EAAE,cAAc,CAAC;IAG5B,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,2BAA2B;IAExC,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAG3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAG1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAG5B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAG3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAChC;AAGD,MAAM,WAAW,8BAA8B;IAG3C,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,YAAY,CAAC,EAAE,yBAAyB,EAAE,CAAC;IAG3C,QAAQ,EAAE,MAAM,CAAC;IAGjB,eAAe,CAAC,EAAE,MAAM,CAAA;CAC3B"}
|
package/lib/wsready.d.ts
CHANGED
package/lib/wsready.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
5
|
* See License-AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.WorkspaceInitSource = void 0;
|
|
9
|
-
// generated using github.com/32leaves/bel on
|
|
9
|
+
// generated using github.com/32leaves/bel on 2021-11-04 12:16:53.917570766 +0000 UTC m=+0.006002884
|
|
10
10
|
// DO NOT MODIFY
|
|
11
11
|
var WorkspaceInitSource;
|
|
12
12
|
(function (WorkspaceInitSource) {
|
package/package.json
CHANGED
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
+
"@types/react": "17.0.32",
|
|
3
4
|
"ajv": "^6.5.4",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
5
|
+
"analytics-node": "^4.0.1",
|
|
6
|
+
"cookie": "^0.4.1",
|
|
7
|
+
"inversify": "^5.1.1",
|
|
8
|
+
"jaeger-client": "^3.18.1",
|
|
6
9
|
"js-yaml": "^3.10.0",
|
|
7
|
-
"opentracing": "^0.14.
|
|
8
|
-
"prom-client": "^
|
|
10
|
+
"opentracing": "^0.14.5",
|
|
11
|
+
"prom-client": "^13.2.0",
|
|
9
12
|
"random-number-csprng": "^1.0.2",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
+
"react": "17.0.2",
|
|
14
|
+
"react-dom": "17.0.2",
|
|
15
|
+
"reconnecting-websocket": "^4.4.0",
|
|
16
|
+
"reflect-metadata": "^0.1.13",
|
|
17
|
+
"uuid": "^8.3.2",
|
|
18
|
+
"vscode-jsonrpc": "^5.0.1",
|
|
19
|
+
"vscode-languageserver-protocol": "3.16.0",
|
|
20
|
+
"vscode-languageserver-types": "3.16.0",
|
|
13
21
|
"vscode-uri": "^1.0.1",
|
|
14
22
|
"vscode-ws-jsonrpc": "^0.2.0",
|
|
15
|
-
"ws": "^
|
|
23
|
+
"ws": "^7.4.6"
|
|
16
24
|
},
|
|
17
25
|
"devDependencies": {
|
|
18
|
-
"@types/
|
|
26
|
+
"@types/analytics-node": "^3.1.5",
|
|
27
|
+
"@types/chai-subset": "^1.3.3",
|
|
28
|
+
"@types/cookie": "^0.4.1",
|
|
19
29
|
"@types/js-yaml": "^3.10.1",
|
|
30
|
+
"@types/mocha": "^5.2.7",
|
|
31
|
+
"@types/node": "^16.11.6",
|
|
20
32
|
"@types/random-number-csprng": "^1.0.0",
|
|
21
|
-
"@types/uuid": "^3.
|
|
33
|
+
"@types/uuid": "^8.3.1",
|
|
22
34
|
"@types/ws": "^5.1.2",
|
|
23
|
-
"chai": "^4.
|
|
35
|
+
"chai": "^4.3.4",
|
|
24
36
|
"chai-subset": "^1.6.0",
|
|
25
37
|
"mocha": "^5.0.0",
|
|
26
38
|
"mocha-typescript": "^1.1.11",
|
|
27
39
|
"rimraf": "^2.6.2",
|
|
28
40
|
"ts-node": "^9.0.0",
|
|
29
|
-
"typescript": "
|
|
30
|
-
"typescript-json-schema": "^0.
|
|
41
|
+
"typescript": "~4.4.2",
|
|
42
|
+
"typescript-json-schema": "^0.50.1",
|
|
31
43
|
"typescript-parser": "^2.6.1"
|
|
32
44
|
},
|
|
33
45
|
"files": [
|
|
@@ -43,9 +55,9 @@
|
|
|
43
55
|
"build": "tsc",
|
|
44
56
|
"clean": "rimraf lib",
|
|
45
57
|
"prepare": "yarn run clean && yarn run build",
|
|
46
|
-
"test": "mocha --opts mocha.opts '
|
|
58
|
+
"test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'",
|
|
47
59
|
"watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput"
|
|
48
60
|
},
|
|
49
61
|
"types": "./lib/index.d.ts",
|
|
50
|
-
"version": "0.1.5-
|
|
51
|
-
}
|
|
62
|
+
"version": "0.1.5-pd-del-private-repo-check-fork.0"
|
|
63
|
+
}
|
package/pkg-yarn.lock
CHANGED
|
@@ -4,19 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
"@gitpod/gitpod-protocol@0.1.5":
|
|
6
6
|
version "0.1.5"
|
|
7
|
-
resolved "file:///tmp/cache/
|
|
7
|
+
resolved "file:///tmp/cache/06ffa40025b4ff2316a3c27b5bbbcfede7ab2951.tar.gz"
|
|
8
8
|
dependencies:
|
|
9
|
+
"@types/react" "17.0.32"
|
|
9
10
|
ajv "^6.5.4"
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
analytics-node "^4.0.1"
|
|
12
|
+
cookie "^0.4.1"
|
|
13
|
+
inversify "^5.1.1"
|
|
14
|
+
jaeger-client "^3.18.1"
|
|
12
15
|
js-yaml "^3.10.0"
|
|
13
|
-
opentracing "^0.14.
|
|
14
|
-
prom-client "^
|
|
16
|
+
opentracing "^0.14.5"
|
|
17
|
+
prom-client "^13.2.0"
|
|
15
18
|
random-number-csprng "^1.0.2"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
react "17.0.2"
|
|
20
|
+
react-dom "17.0.2"
|
|
21
|
+
reconnecting-websocket "^4.4.0"
|
|
22
|
+
reflect-metadata "^0.1.13"
|
|
23
|
+
uuid "^8.3.2"
|
|
24
|
+
vscode-jsonrpc "^5.0.1"
|
|
25
|
+
vscode-languageserver-protocol "3.16.0"
|
|
26
|
+
vscode-languageserver-types "3.16.0"
|
|
19
27
|
vscode-uri "^1.0.1"
|
|
20
28
|
vscode-ws-jsonrpc "^0.2.0"
|
|
21
|
-
ws "^
|
|
29
|
+
ws "^7.4.6"
|
|
22
30
|
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import { Without } from "./util/without";
|
|
7
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
8
|
import { User } from './protocol';
|
|
10
9
|
import { oneMonthLater } from './util/timeutil';
|
|
11
10
|
|
|
@@ -47,7 +46,7 @@ export interface AccountEntry {
|
|
|
47
46
|
description?: object;
|
|
48
47
|
}
|
|
49
48
|
export namespace AccountEntry {
|
|
50
|
-
export function create<T extends AccountEntry>(entry:
|
|
49
|
+
export function create<T extends AccountEntry>(entry: Omit<T, 'uid'>): T {
|
|
51
50
|
const result = entry as T;
|
|
52
51
|
result.uid = uuidv4();
|
|
53
52
|
return result;
|
|
@@ -164,7 +163,7 @@ export namespace AssignedTeamSubscription {
|
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
export namespace Subscription {
|
|
167
|
-
export function create(newSubscription:
|
|
166
|
+
export function create(newSubscription: Omit<Subscription, 'uid'>) {
|
|
168
167
|
const subscription = newSubscription as Subscription;
|
|
169
168
|
subscription.uid = uuidv4();
|
|
170
169
|
return subscription;
|
|
@@ -193,9 +192,6 @@ export namespace Subscription {
|
|
|
193
192
|
export function isDowngraded(s: Subscription) {
|
|
194
193
|
return s.paymentData && s.paymentData.downgradeDate;
|
|
195
194
|
};
|
|
196
|
-
export function isCancelled(s: Subscription) {
|
|
197
|
-
return !!s.cancellationDate;
|
|
198
|
-
};
|
|
199
195
|
export function calculateCurrentPeriod(startDate: string, now: Date) {
|
|
200
196
|
let nextStartDate = startDate;
|
|
201
197
|
do {
|
|
@@ -215,7 +211,7 @@ export interface Period {
|
|
|
215
211
|
|
|
216
212
|
export type MaybePeriod = Period | undefined;
|
|
217
213
|
|
|
218
|
-
export type AccountEntryFixedPeriod =
|
|
214
|
+
export type AccountEntryFixedPeriod = Omit<AccountEntry, 'uid'> & { expiryDate: string };
|
|
219
215
|
export interface AccountStatement extends Period {
|
|
220
216
|
userId: string;
|
|
221
217
|
/**
|
package/src/admin-protocol.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { User, Workspace, NamedWorkspaceFeatureFlag } from "./protocol";
|
|
8
|
-
import { Without } from "./util/without";
|
|
9
8
|
import { WorkspaceInstance, WorkspaceInstancePhase } from "./workspace-instance";
|
|
10
9
|
import { RoleOrPermission } from "./permission";
|
|
11
10
|
import { AccountStatement } from "./accounting-protocol";
|
|
@@ -21,6 +20,7 @@ export interface AdminServer {
|
|
|
21
20
|
adminGetWorkspaces(req: AdminGetWorkspacesRequest): Promise<AdminGetListResult<WorkspaceAndInstance>>;
|
|
22
21
|
adminGetWorkspace(id: string): Promise<WorkspaceAndInstance>;
|
|
23
22
|
adminForceStopWorkspace(id: string): Promise<void>;
|
|
23
|
+
adminRestoreSoftDeletedWorkspace(id: string): Promise<void>;
|
|
24
24
|
|
|
25
25
|
adminSetLicense(key: string): Promise<void>;
|
|
26
26
|
|
|
@@ -28,6 +28,7 @@ export interface AdminServer {
|
|
|
28
28
|
adminSetProfessionalOpenSource(userId: string, shouldGetProfOSS: boolean): Promise<void>;
|
|
29
29
|
adminIsStudent(userId: string): Promise<boolean>;
|
|
30
30
|
adminAddStudentEmailDomain(userId: string, domain: string): Promise<void>;
|
|
31
|
+
adminGrantExtraHours(userId: string, extraHours: number): Promise<void>;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export interface AdminGetListRequest<T> {
|
|
@@ -64,7 +65,7 @@ export interface AdminModifyPermanentWorkspaceFeatureFlagRequest {
|
|
|
64
65
|
}[]
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
export interface WorkspaceAndInstance extends
|
|
68
|
+
export interface WorkspaceAndInstance extends Omit<Workspace, "id"|"creationTime">, Omit<WorkspaceInstance, "id"|"creationTime"> {
|
|
68
69
|
workspaceId: string;
|
|
69
70
|
workspaceCreationTime: string;
|
|
70
71
|
instanceId: string;
|
|
@@ -72,6 +73,33 @@ export interface WorkspaceAndInstance extends Without<Workspace, "id"|"creationT
|
|
|
72
73
|
phase: WorkspaceInstancePhase;
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
export
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
export namespace WorkspaceAndInstance {
|
|
77
|
+
export function toWorkspace(wai: WorkspaceAndInstance): Workspace {
|
|
78
|
+
return {
|
|
79
|
+
id: wai.workspaceId,
|
|
80
|
+
creationTime: wai.workspaceCreationTime,
|
|
81
|
+
... wai
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function toInstance(wai: WorkspaceAndInstance): WorkspaceInstance | undefined {
|
|
86
|
+
if (!wai.instanceId) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
id: wai.instanceId,
|
|
91
|
+
creationTime: wai.instanceCreationTime,
|
|
92
|
+
... wai
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type AdminGetWorkspacesRequest = AdminGetListRequest<WorkspaceAndInstance> & AdminGetWorkspacesQuery;
|
|
98
|
+
/** The fields are meant to be used either OR (not combined) */
|
|
99
|
+
export type AdminGetWorkspacesQuery = {
|
|
100
|
+
/** we use this field in case we have a UUIDv4 and don't know whether it's an (old) workspace or instance id */
|
|
101
|
+
instanceIdOrWorkspaceId?: string;
|
|
102
|
+
instanceId?: string;
|
|
103
|
+
workspaceId?: string;
|
|
104
|
+
ownerId?: string;
|
|
105
|
+
};
|
package/src/analytics.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
|
|
8
|
+
export const IAnalyticsWriter = Symbol("IAnalyticsWriter");
|
|
9
|
+
|
|
10
|
+
type Identity =
|
|
11
|
+
| { userId: string | number }
|
|
12
|
+
| { userId?: string | number; anonymousId: string | number };
|
|
13
|
+
|
|
14
|
+
interface Message {
|
|
15
|
+
messageId?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type IdentifyMessage = Message & Identity & {
|
|
19
|
+
traits?: any;
|
|
20
|
+
timestamp?: Date;
|
|
21
|
+
context?: any;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type TrackMessage = Message & Identity & {
|
|
25
|
+
event: string;
|
|
26
|
+
properties?: any;
|
|
27
|
+
timestamp?: Date;
|
|
28
|
+
context?: any;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type PageMessage = Message & Identity & {
|
|
32
|
+
properties?: any;
|
|
33
|
+
timestamp?: Date;
|
|
34
|
+
context?: any;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type RemoteTrackMessage = Omit<TrackMessage, "timestamp" | "userId" | "anonymousId"> & {
|
|
38
|
+
anonymousId?: string | number;
|
|
39
|
+
};
|
|
40
|
+
export type RemotePageMessage = Omit<PageMessage, "timestamp" | "userId"> & {
|
|
41
|
+
anonymousId?: string | number;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type RemoteIdentifyMessage = Omit<IdentifyMessage, "timestamp" | "userId" | "anonymousId">;
|
|
45
|
+
|
|
46
|
+
export interface IAnalyticsWriter {
|
|
47
|
+
|
|
48
|
+
identify(msg: IdentifyMessage): void;
|
|
49
|
+
|
|
50
|
+
track(msg: TrackMessage): void;
|
|
51
|
+
|
|
52
|
+
page(msg: PageMessage): void;
|
|
53
|
+
|
|
54
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 chai from 'chai';
|
|
8
|
+
import { suite, test } from 'mocha-typescript';
|
|
9
|
+
import { ContextURL } from './context-url';
|
|
10
|
+
const expect = chai.expect;
|
|
11
|
+
|
|
12
|
+
@suite
|
|
13
|
+
export class ContextUrlTest {
|
|
14
|
+
|
|
15
|
+
@test public parseContextUrl_withEnvVar() {
|
|
16
|
+
const actual = ContextURL.parseToURL("passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo");
|
|
17
|
+
expect(actual?.host).to.equal("github.com");
|
|
18
|
+
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@test public parseContextUrl_withEnvVar_withoutSchema() {
|
|
22
|
+
const actual = ContextURL.parseToURL("passedin=test%20value/github.com/gitpod-io/gitpod-test-repo");
|
|
23
|
+
expect(actual?.host).to.equal("github.com");
|
|
24
|
+
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@test public parseContextUrl_withPrebuild() {
|
|
28
|
+
const actual = ContextURL.parseToURL("prebuild/https://github.com/gitpod-io/gitpod-test-repo");
|
|
29
|
+
expect(actual?.host).to.equal("github.com");
|
|
30
|
+
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@test public parseContextUrl_withPrebuild_withoutSchema() {
|
|
34
|
+
const actual = ContextURL.parseToURL("prebuild/github.com/gitpod-io/gitpod-test-repo");
|
|
35
|
+
expect(actual?.host).to.equal("github.com");
|
|
36
|
+
expect(actual?.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
module.exports = new ContextUrlTest()
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
export namespace ContextURL {
|
|
8
|
+
export const INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild";
|
|
9
|
+
export const PREBUILD_PREFIX = "prebuild";
|
|
10
|
+
export const IMAGEBUILD_PREFIX = "imagebuild";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The field "contextUrl" might contain prefixes like:
|
|
14
|
+
* - envvar1=value1/...
|
|
15
|
+
* - prebuild/...
|
|
16
|
+
* This is the analogon to the (Prefix)ContextParser structure in "server".
|
|
17
|
+
*/
|
|
18
|
+
export function parseToURL(contextUrl: string | undefined): URL | undefined {
|
|
19
|
+
if (contextUrl === undefined) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const segments = contextUrl.split("/");
|
|
24
|
+
if (segments.length === 1) {
|
|
25
|
+
return new URL(segments[0]); // this might be something, we just try
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const segmentsToURL = (offset: number): URL => {
|
|
29
|
+
let rest = segments.slice(offset).join("/");
|
|
30
|
+
if (!rest.startsWith("http")) {
|
|
31
|
+
rest = 'https://' + rest;
|
|
32
|
+
}
|
|
33
|
+
return new URL(rest);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const firstSegment = segments[0];
|
|
38
|
+
if (firstSegment === PREBUILD_PREFIX ||
|
|
39
|
+
firstSegment === INCREMENTAL_PREBUILD_PREFIX ||
|
|
40
|
+
firstSegment === IMAGEBUILD_PREFIX) {
|
|
41
|
+
return segmentsToURL(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// check for env vars
|
|
45
|
+
if (firstSegment.indexOf("=") !== -1) {
|
|
46
|
+
return segmentsToURL(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return segmentsToURL(0);
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/email-protocol.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import uuidv4 = require("uuid/v4");
|
|
7
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
8
|
|
|
10
9
|
export type EMailState = "scheduledInternal"
|
|
11
10
|
| "scheduledSendgrid";
|
|
@@ -59,7 +58,7 @@ export type EMail = {
|
|
|
59
58
|
} & EMailStatus;
|
|
60
59
|
|
|
61
60
|
export namespace EMail {
|
|
62
|
-
export const create = (ts:
|
|
61
|
+
export const create = (ts: Omit<EMail, 'uid'>): EMail => {
|
|
63
62
|
const withId = ts as EMail;
|
|
64
63
|
withId.uid = uuidv4();
|
|
65
64
|
return withId;
|
package/src/env.ts
CHANGED
|
@@ -13,18 +13,18 @@ const legacyStagenameTranslation: { [key: string]: KubeStage } = {
|
|
|
13
13
|
"dev": "dev"
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export function translateLegacyStagename(kubeStage: string): KubeStage {
|
|
17
|
+
const stage = legacyStagenameTranslation[kubeStage];
|
|
18
|
+
if (!stage) {
|
|
19
|
+
throw new Error(`Invalid KUBE_STAGE: ${kubeStage}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return stage;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
@injectable()
|
|
17
26
|
export abstract class AbstractComponentEnv {
|
|
18
|
-
readonly kubeStage: KubeStage = getEnvVarParsed('KUBE_STAGE',
|
|
19
|
-
const stage = legacyStagenameTranslation[kubeStage];
|
|
20
|
-
if (!stage) {
|
|
21
|
-
throw new Error(`Environment variable invalid: KUBE_STAGE=${kubeStage}`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return stage;
|
|
25
|
-
});
|
|
26
|
-
readonly kubeNamespace: string = getEnvVar('KUBE_NAMESPACE');
|
|
27
|
-
readonly version: string = getEnvVar('VERSION');
|
|
27
|
+
readonly kubeStage: KubeStage = getEnvVarParsed('KUBE_STAGE', translateLegacyStagename);
|
|
28
28
|
|
|
29
29
|
readonly installationLongname: string = getEnvVar("GITPOD_INSTALLATION_LONGNAME")
|
|
30
30
|
readonly installationShortname: string = getEnvVar("GITPOD_INSTALLATION_SHORTNAME")
|