@gitpod/gitpod-protocol 0.1.5-server-vscode-ouath2.17 → 0.1.5-server-vscode-oauth2.14
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 +49 -4
- package/lib/accounting-protocol.d.ts +10 -11
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +31 -41
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +20 -2
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +2 -13
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +12 -1
- package/lib/analytics.d.ts.map +1 -1
- package/lib/analytics.js.map +1 -1
- package/lib/auth.d.ts.map +1 -1
- package/lib/context-url.d.ts +18 -5
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +63 -10
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +2 -0
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +81 -48
- package/lib/context-url.spec.js.map +1 -1
- package/lib/email-protocol.d.ts +1 -1
- 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.d.ts.map +1 -1
- package/lib/encryption/container-module.js +4 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +25 -26
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +30 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +31 -38
- 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 +17 -19
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +26 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +145 -142
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +67 -31
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +162 -309
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -0
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +2 -1
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +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 +16 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +3 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +173 -36
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +4 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +42 -59
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +2 -2
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +37 -38
- package/lib/messaging/client-call-metrics.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/handler.js +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 +24 -60
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +3 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -163
- 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/payment-protocol.d.ts.map +1 -1
- package/lib/payment-protocol.js +1 -1
- package/lib/payment-protocol.js.map +1 -1
- package/lib/permission.d.ts +9 -4
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +39 -31
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +4 -4
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +225 -209
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +83 -78
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +131 -190
- 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/theia-plugins.ts → lib/snapshot-url.spec.d.ts} +2 -6
- 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 +5 -3
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +17 -17
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +16 -3
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +11 -15
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +2 -2
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +44 -26
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +57 -135
- 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 +11 -11
- 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.d.ts.map +1 -1
- package/lib/util/disposable.js +27 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +63 -77
- 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 +27 -47
- 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 +460 -499
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +61 -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 +41 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +106 -114
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +97 -135
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +3 -3
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +33 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +87 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +5 -5
- 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 +30 -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 +147 -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.d.ts.map +1 -1
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +16 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts.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 +52 -6
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +199 -64
- 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.d.ts +7 -7
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +9 -12
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +15 -3
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +19 -4
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +25 -4
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +22 -13
- package/pkg-yarn.lock +12 -7
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +53 -53
- package/src/admin-protocol.ts +43 -20
- package/src/analytics.ts +28 -15
- package/src/auth.ts +2 -2
- package/src/context-url.spec.ts +37 -9
- package/src/context-url.ts +94 -36
- package/src/email-protocol.ts +5 -6
- package/src/encryption/container-module.ts +2 -3
- package/src/encryption/encryption-engine.spec.ts +9 -8
- package/src/encryption/encryption-engine.ts +14 -14
- package/src/encryption/encryption-service.ts +4 -5
- package/src/encryption/key-provider.ts +16 -19
- package/src/env.ts +9 -10
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +174 -109
- package/src/headless-workspace-log.ts +6 -4
- package/src/ide-frontend-service.ts +2 -2
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +16 -13
- package/src/installation-admin-protocol.ts +42 -0
- package/src/license-protocol.ts +5 -6
- package/src/messaging/browser/connection.ts +185 -21
- package/src/messaging/browser/window-connection.ts +39 -29
- package/src/messaging/client-call-metrics.ts +70 -71
- package/src/messaging/error.ts +6 -5
- package/src/messaging/handler.ts +13 -1
- package/src/messaging/node/connection.ts +23 -70
- package/src/messaging/proxy-factory.ts +32 -33
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +2 -2
- package/src/permission.ts +40 -33
- package/src/plans.ts +236 -189
- package/src/protocol.ts +280 -277
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +33 -23
- package/src/teams-projects-protocol.ts +27 -9
- package/src/typings/globals.ts +4 -4
- package/src/util/analytics.ts +56 -18
- package/src/util/async-iterator.ts +4 -5
- package/src/util/cancelable.ts +3 -3
- package/src/util/date-time.ts +8 -8
- package/src/util/deferred.ts +6 -6
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +9 -6
- package/src/util/generate-workspace-id.spec.ts +26 -6
- package/src/util/generate-workspace-id.ts +458 -440
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +40 -13
- package/src/util/gitpod-host-url.ts +41 -38
- package/src/util/grpc.ts +4 -4
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +109 -86
- package/src/util/make-link.ts +6 -7
- package/src/util/parse-workspace-id.spec.ts +37 -8
- package/src/util/parse-workspace-id.ts +32 -7
- package/src/util/queue.spec.ts +27 -25
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +4 -6
- package/src/util/skip-if.ts +9 -6
- package/src/util/timeutil.spec.ts +14 -15
- package/src/util/timeutil.ts +15 -11
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +202 -31
- package/src/util/workspace-port-authentication.ts +10 -13
- package/src/workspace-cluster.ts +26 -8
- package/src/workspace-instance.ts +53 -23
- package/src/wsready.ts +3 -3
- package/data/builtin-theia-plugins.json +0 -372
- 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/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.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/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
package/src/protocol.ts
CHANGED
|
@@ -7,26 +7,27 @@
|
|
|
7
7
|
import { WorkspaceInstance, PortVisibility } from "./workspace-instance";
|
|
8
8
|
import { RoleOrPermission } from "./permission";
|
|
9
9
|
import { Project } from "./teams-projects-protocol";
|
|
10
|
+
import { createHash } from "crypto";
|
|
10
11
|
|
|
11
12
|
export interface UserInfo {
|
|
12
|
-
name?: string
|
|
13
|
+
name?: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export interface User {
|
|
16
17
|
/** The user id */
|
|
17
|
-
id: string
|
|
18
|
+
id: string;
|
|
18
19
|
|
|
19
20
|
/** The timestamp when the user entry was created */
|
|
20
|
-
creationDate: string
|
|
21
|
+
creationDate: string;
|
|
21
22
|
|
|
22
|
-
avatarUrl?: string
|
|
23
|
+
avatarUrl?: string;
|
|
23
24
|
|
|
24
|
-
name?: string
|
|
25
|
+
name?: string;
|
|
25
26
|
|
|
26
27
|
/** Optional for backwards compatibility */
|
|
27
|
-
fullName?: string
|
|
28
|
+
fullName?: string;
|
|
28
29
|
|
|
29
|
-
identities: Identity[]
|
|
30
|
+
identities: Identity[];
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Whether the user has been blocked to use our service, because of TOS violation for example.
|
|
@@ -48,29 +49,27 @@ export interface User {
|
|
|
48
49
|
|
|
49
50
|
export namespace User {
|
|
50
51
|
export function is(data: any): data is User {
|
|
51
|
-
return data
|
|
52
|
-
&& data.hasOwnProperty('id')
|
|
53
|
-
&& data.hasOwnProperty('identities')
|
|
52
|
+
return data && data.hasOwnProperty("id") && data.hasOwnProperty("identities");
|
|
54
53
|
}
|
|
55
54
|
export function getIdentity(user: User, authProviderId: string): Identity | undefined {
|
|
56
|
-
return user.identities.find(id => id.authProviderId === authProviderId);
|
|
55
|
+
return user.identities.find((id) => id.authProviderId === authProviderId);
|
|
57
56
|
}
|
|
58
57
|
export function censor(user: User): User {
|
|
59
58
|
const res = { ...user };
|
|
60
|
-
delete
|
|
61
|
-
res.identities = res.identities.map(i => {
|
|
62
|
-
delete
|
|
59
|
+
delete res.additionalData;
|
|
60
|
+
res.identities = res.identities.map((i) => {
|
|
61
|
+
delete i.tokens;
|
|
63
62
|
|
|
64
63
|
// The user field is not in the Identity shape, but actually exists on DBIdentity.
|
|
65
64
|
// Trying to push this object out via JSON RPC will fail because of the cyclic nature
|
|
66
65
|
// of this field.
|
|
67
|
-
delete (
|
|
66
|
+
delete (i as any).user;
|
|
68
67
|
return i;
|
|
69
68
|
});
|
|
70
69
|
return res;
|
|
71
70
|
}
|
|
72
71
|
export function getPrimaryEmail(user: User): string {
|
|
73
|
-
const identities = user.identities.filter(i => !!i.primaryEmail);
|
|
72
|
+
const identities = user.identities.filter((i) => !!i.primaryEmail);
|
|
74
73
|
if (identities.length <= 0) {
|
|
75
74
|
throw new Error(`No identity with primary email for user: ${user.id}!`);
|
|
76
75
|
}
|
|
@@ -98,12 +97,15 @@ export interface AdditionalUserData {
|
|
|
98
97
|
featurePreview?: boolean;
|
|
99
98
|
ideSettings?: IDESettings;
|
|
100
99
|
// key is the name of the news, string the iso date when it was seen
|
|
101
|
-
whatsNewSeen?: { [key: string]: string }
|
|
100
|
+
whatsNewSeen?: { [key: string]: string };
|
|
102
101
|
// key is the name of the OAuth client i.e. local app, string the iso date when it was approved
|
|
103
102
|
// TODO(rl): provide a management UX to allow rescinding of approval
|
|
104
|
-
oauthClientsApproved?: { [key: string]: string }
|
|
103
|
+
oauthClientsApproved?: { [key: string]: string };
|
|
105
104
|
// to remember GH Orgs the user installed/updated the GH App for
|
|
106
105
|
knownGitHubOrgs?: string[];
|
|
106
|
+
|
|
107
|
+
// Git clone URL pointing to the user's dotfile repo
|
|
108
|
+
dotfileRepo?: string;
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
export interface EmailNotificationSettings {
|
|
@@ -113,8 +115,11 @@ export interface EmailNotificationSettings {
|
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
export type IDESettings = {
|
|
116
|
-
defaultIde?: string
|
|
117
|
-
|
|
118
|
+
defaultIde?: string;
|
|
119
|
+
useDesktopIde?: boolean;
|
|
120
|
+
defaultDesktopIde?: string;
|
|
121
|
+
useLatestVersion?: boolean;
|
|
122
|
+
};
|
|
118
123
|
|
|
119
124
|
export interface UserPlatform {
|
|
120
125
|
uid: string;
|
|
@@ -135,14 +140,6 @@ export interface UserPlatform {
|
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
export interface UserFeatureSettings {
|
|
138
|
-
/**
|
|
139
|
-
* This field is used as marker to grant users a free trial for using private repositories,
|
|
140
|
-
* independent of any subscription or Chargebee.
|
|
141
|
-
* - it is set when the user uses their first private repo
|
|
142
|
-
* - whether the trial is expired or not is juged by the UserService
|
|
143
|
-
*/
|
|
144
|
-
privateRepoTrialStartDate?: string;
|
|
145
|
-
|
|
146
143
|
/**
|
|
147
144
|
* Permanent feature flags are added to each and every workspace instance
|
|
148
145
|
* this user starts.
|
|
@@ -154,15 +151,30 @@ export interface UserFeatureSettings {
|
|
|
154
151
|
* The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
|
|
155
152
|
* If they don't we'll break things during workspace startup.
|
|
156
153
|
*/
|
|
157
|
-
export const WorkspaceFeatureFlags = {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
154
|
+
export const WorkspaceFeatureFlags = {
|
|
155
|
+
full_workspace_backup: undefined,
|
|
156
|
+
fixed_resources: undefined,
|
|
157
|
+
persistent_volume_claim: undefined,
|
|
158
|
+
};
|
|
159
|
+
export type NamedWorkspaceFeatureFlag = keyof typeof WorkspaceFeatureFlags;
|
|
160
|
+
|
|
161
|
+
export interface EnvVarWithValue {
|
|
162
162
|
name: string;
|
|
163
|
-
repositoryPattern: string;
|
|
164
163
|
value: string;
|
|
165
164
|
}
|
|
165
|
+
|
|
166
|
+
export interface ProjectEnvVarWithValue extends EnvVarWithValue {
|
|
167
|
+
id: string;
|
|
168
|
+
projectId: string;
|
|
169
|
+
censored: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type ProjectEnvVar = Omit<ProjectEnvVarWithValue, "value">;
|
|
173
|
+
|
|
174
|
+
export interface UserEnvVarValue extends EnvVarWithValue {
|
|
175
|
+
id?: string;
|
|
176
|
+
repositoryPattern: string; // DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
177
|
+
}
|
|
166
178
|
export interface UserEnvVar extends UserEnvVarValue {
|
|
167
179
|
id: string;
|
|
168
180
|
userId: string;
|
|
@@ -170,11 +182,12 @@ export interface UserEnvVar extends UserEnvVarValue {
|
|
|
170
182
|
}
|
|
171
183
|
|
|
172
184
|
export namespace UserEnvVar {
|
|
173
|
-
|
|
185
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
174
186
|
export function normalizeRepoPattern(pattern: string) {
|
|
175
187
|
return pattern.toLocaleLowerCase();
|
|
176
188
|
}
|
|
177
189
|
|
|
190
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
178
191
|
export function score(value: UserEnvVarValue): number {
|
|
179
192
|
// We use a score to enforce precedence:
|
|
180
193
|
// value/value = 0
|
|
@@ -188,7 +201,7 @@ export namespace UserEnvVar {
|
|
|
188
201
|
if (repoPattern == "*") {
|
|
189
202
|
score += 1;
|
|
190
203
|
}
|
|
191
|
-
if (ownerPattern ==
|
|
204
|
+
if (ownerPattern == "*") {
|
|
192
205
|
score += 2;
|
|
193
206
|
}
|
|
194
207
|
if (ownerPattern == "#" || repoPattern == "#") {
|
|
@@ -197,21 +210,22 @@ export namespace UserEnvVar {
|
|
|
197
210
|
return score;
|
|
198
211
|
}
|
|
199
212
|
|
|
213
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
200
214
|
export function filter<T extends UserEnvVarValue>(vars: T[], owner: string, repo: string): T[] {
|
|
201
|
-
let result = vars.filter(e => {
|
|
215
|
+
let result = vars.filter((e) => {
|
|
202
216
|
const [ownerPattern, repoPattern] = splitRepositoryPattern(e.repositoryPattern);
|
|
203
|
-
if (ownerPattern !==
|
|
217
|
+
if (ownerPattern !== "*" && ownerPattern !== "#" && !!owner && ownerPattern !== owner.toLocaleLowerCase()) {
|
|
204
218
|
return false;
|
|
205
219
|
}
|
|
206
|
-
if (repoPattern !==
|
|
220
|
+
if (repoPattern !== "*" && repoPattern !== "#" && !!repo && repoPattern !== repo.toLocaleLowerCase()) {
|
|
207
221
|
return false;
|
|
208
222
|
}
|
|
209
223
|
return true;
|
|
210
224
|
});
|
|
211
225
|
|
|
212
226
|
const resmap = new Map<string, T[]>();
|
|
213
|
-
result.forEach(e => {
|
|
214
|
-
const l =
|
|
227
|
+
result.forEach((e) => {
|
|
228
|
+
const l = resmap.get(e.name) || [];
|
|
215
229
|
l.push(e);
|
|
216
230
|
resmap.set(e.name, l);
|
|
217
231
|
});
|
|
@@ -244,47 +258,47 @@ export namespace UserEnvVar {
|
|
|
244
258
|
return result;
|
|
245
259
|
}
|
|
246
260
|
|
|
261
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
247
262
|
export function splitRepositoryPattern(repositoryPattern: string): string[] {
|
|
248
|
-
const patterns = repositoryPattern.split(
|
|
249
|
-
const repoPattern = patterns.
|
|
250
|
-
const ownerPattern = patterns
|
|
263
|
+
const patterns = repositoryPattern.split("/");
|
|
264
|
+
const repoPattern = patterns.slice(1).join("/");
|
|
265
|
+
const ownerPattern = patterns[0];
|
|
251
266
|
return [ownerPattern, repoPattern];
|
|
252
267
|
}
|
|
253
268
|
}
|
|
254
269
|
|
|
255
270
|
export interface GitpodToken {
|
|
256
|
-
|
|
257
271
|
/** Hash value (SHA256) of the token (primary key). */
|
|
258
|
-
tokenHash: string
|
|
272
|
+
tokenHash: string;
|
|
259
273
|
|
|
260
274
|
/** Human readable name of the token */
|
|
261
|
-
name?: string
|
|
275
|
+
name?: string;
|
|
262
276
|
|
|
263
277
|
/** Token kind */
|
|
264
|
-
type: GitpodTokenType
|
|
278
|
+
type: GitpodTokenType;
|
|
265
279
|
|
|
266
280
|
/** The user the token belongs to. */
|
|
267
|
-
user: User
|
|
281
|
+
user: User;
|
|
268
282
|
|
|
269
283
|
/** Scopes (e.g. limition to read-only) */
|
|
270
|
-
scopes: string[]
|
|
284
|
+
scopes: string[];
|
|
271
285
|
|
|
272
286
|
/** Created timestamp */
|
|
273
|
-
created: string
|
|
287
|
+
created: string;
|
|
274
288
|
|
|
275
289
|
// token is deleted on the database and about to be collected by db-sync
|
|
276
|
-
deleted?: boolean
|
|
290
|
+
deleted?: boolean;
|
|
277
291
|
}
|
|
278
292
|
|
|
279
293
|
export enum GitpodTokenType {
|
|
280
294
|
API_AUTH_TOKEN = 0,
|
|
281
|
-
MACHINE_AUTH_TOKEN = 1
|
|
295
|
+
MACHINE_AUTH_TOKEN = 1,
|
|
282
296
|
}
|
|
283
297
|
|
|
284
298
|
export interface OneTimeSecret {
|
|
285
|
-
id: string
|
|
299
|
+
id: string;
|
|
286
300
|
|
|
287
|
-
value: string
|
|
301
|
+
value: string;
|
|
288
302
|
|
|
289
303
|
expirationTime: string;
|
|
290
304
|
|
|
@@ -316,13 +330,12 @@ export type IdentityLookup = Pick<Identity, "authProviderId" | "authId">;
|
|
|
316
330
|
|
|
317
331
|
export namespace Identity {
|
|
318
332
|
export function is(data: any): data is Identity {
|
|
319
|
-
return
|
|
320
|
-
&& data.hasOwnProperty(
|
|
321
|
-
|
|
333
|
+
return (
|
|
334
|
+
data.hasOwnProperty("authProviderId") && data.hasOwnProperty("authId") && data.hasOwnProperty("authName")
|
|
335
|
+
);
|
|
322
336
|
}
|
|
323
337
|
export function equals(id1: IdentityLookup, id2: IdentityLookup) {
|
|
324
|
-
return id1.authProviderId === id2.authProviderId
|
|
325
|
-
&& id1.authId === id2.authId
|
|
338
|
+
return id1.authProviderId === id2.authProviderId && id1.authId === id2.authId;
|
|
326
339
|
}
|
|
327
340
|
}
|
|
328
341
|
|
|
@@ -378,11 +391,16 @@ export interface PendingGithubEvent {
|
|
|
378
391
|
export interface Snapshot {
|
|
379
392
|
id: string;
|
|
380
393
|
creationTime: string;
|
|
394
|
+
availableTime?: string;
|
|
381
395
|
originalWorkspaceId: string;
|
|
382
396
|
bucketId: string;
|
|
383
397
|
layoutData?: string;
|
|
398
|
+
state: SnapshotState;
|
|
399
|
+
message?: string;
|
|
384
400
|
}
|
|
385
401
|
|
|
402
|
+
export type SnapshotState = "pending" | "available" | "error";
|
|
403
|
+
|
|
386
404
|
export interface LayoutData {
|
|
387
405
|
workspaceId: string;
|
|
388
406
|
lastUpdatedTime: string;
|
|
@@ -410,13 +428,13 @@ export interface Workspace {
|
|
|
410
428
|
* The resolved, fix name of the workspace image. We only use this
|
|
411
429
|
* to access the logs during an image build.
|
|
412
430
|
*/
|
|
413
|
-
imageNameResolved?: string
|
|
431
|
+
imageNameResolved?: string;
|
|
414
432
|
|
|
415
433
|
/**
|
|
416
434
|
* The resolved/built fixed named of the base image. This field is only set if the workspace
|
|
417
435
|
* already has its base image built.
|
|
418
436
|
*/
|
|
419
|
-
baseImageNameResolved?: string
|
|
437
|
+
baseImageNameResolved?: string;
|
|
420
438
|
|
|
421
439
|
shareable?: boolean;
|
|
422
440
|
pinned?: boolean;
|
|
@@ -453,17 +471,16 @@ export type WorkspaceSoftDeletion = "user" | "gc";
|
|
|
453
471
|
export type WorkspaceType = "regular" | "prebuild" | "probe";
|
|
454
472
|
|
|
455
473
|
export namespace Workspace {
|
|
456
|
-
|
|
457
474
|
export function getFullRepositoryName(ws: Workspace): string | undefined {
|
|
458
475
|
if (CommitContext.is(ws.context)) {
|
|
459
|
-
return ws.context.repository.owner +
|
|
476
|
+
return ws.context.repository.owner + "/" + ws.context.repository.name;
|
|
460
477
|
}
|
|
461
478
|
return undefined;
|
|
462
479
|
}
|
|
463
480
|
|
|
464
481
|
export function getFullRepositoryUrl(ws: Workspace): string | undefined {
|
|
465
482
|
if (CommitContext.is(ws.context)) {
|
|
466
|
-
return `https://${ws.context.repository.host}/${getFullRepositoryName(ws)}
|
|
483
|
+
return `https://${ws.context.repository.host}/${getFullRepositoryName(ws)}`;
|
|
467
484
|
}
|
|
468
485
|
return undefined;
|
|
469
486
|
}
|
|
@@ -497,59 +514,36 @@ export namespace Workspace {
|
|
|
497
514
|
}
|
|
498
515
|
}
|
|
499
516
|
|
|
500
|
-
export interface PreparePluginUploadParams {
|
|
501
|
-
fullPluginName: string;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
export interface ResolvePluginsParams {
|
|
505
|
-
config?: WorkspaceConfig
|
|
506
|
-
builtins?: ResolvedPlugins
|
|
507
|
-
vsxRegistryUrl?: string
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
export interface InstallPluginsParams {
|
|
511
|
-
pluginIds: string[]
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
export interface UninstallPluginParams {
|
|
515
|
-
pluginId: string;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
517
|
export interface GuessGitTokenScopesParams {
|
|
519
|
-
host: string
|
|
520
|
-
repoUrl: string
|
|
521
|
-
|
|
522
|
-
currentToken: GitToken
|
|
518
|
+
host: string;
|
|
519
|
+
repoUrl: string;
|
|
520
|
+
gitCommand: string;
|
|
521
|
+
currentToken: GitToken;
|
|
523
522
|
}
|
|
524
523
|
|
|
525
524
|
export interface GitToken {
|
|
526
|
-
token: string
|
|
527
|
-
user: string
|
|
528
|
-
scopes: string[]
|
|
525
|
+
token: string;
|
|
526
|
+
user: string;
|
|
527
|
+
scopes: string[];
|
|
529
528
|
}
|
|
530
529
|
|
|
531
530
|
export interface GuessedGitTokenScopes {
|
|
532
|
-
message?: string
|
|
533
|
-
scopes?: string[]
|
|
531
|
+
message?: string;
|
|
532
|
+
scopes?: string[];
|
|
534
533
|
}
|
|
535
534
|
|
|
536
|
-
export
|
|
537
|
-
|
|
538
|
-
export interface ResolvedPlugins {
|
|
539
|
-
[pluginId: string]: ResolvedPlugin | undefined
|
|
535
|
+
export interface VSCodeConfig {
|
|
536
|
+
extensions?: string[];
|
|
540
537
|
}
|
|
541
538
|
|
|
542
|
-
export interface
|
|
543
|
-
fullPluginName: string;
|
|
539
|
+
export interface RepositoryCloneInformation {
|
|
544
540
|
url: string;
|
|
545
|
-
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
export interface VSCodeConfig {
|
|
549
|
-
extensions?: string[];
|
|
541
|
+
checkoutLocation?: string;
|
|
550
542
|
}
|
|
551
543
|
|
|
552
544
|
export interface WorkspaceConfig {
|
|
545
|
+
mainConfiguration?: string;
|
|
546
|
+
additionalRepositories?: RepositoryCloneInformation[];
|
|
553
547
|
image?: ImageConfig;
|
|
554
548
|
ports?: PortConfig[];
|
|
555
549
|
tasks?: TaskConfig[];
|
|
@@ -559,6 +553,9 @@ export interface WorkspaceConfig {
|
|
|
559
553
|
github?: GithubAppConfig;
|
|
560
554
|
vscode?: VSCodeConfig;
|
|
561
555
|
|
|
556
|
+
/** deprecated. Enabled by default **/
|
|
557
|
+
experimentalNetwork?: boolean;
|
|
558
|
+
|
|
562
559
|
/**
|
|
563
560
|
* Where the config object originates from.
|
|
564
561
|
*
|
|
@@ -569,7 +566,7 @@ export interface WorkspaceConfig {
|
|
|
569
566
|
* additional-content - config comes from additional content, usually provided through the project's configuration
|
|
570
567
|
* default - our static catch-all default config
|
|
571
568
|
*/
|
|
572
|
-
_origin?:
|
|
569
|
+
_origin?: "repo" | "project-db" | "definitely-gp" | "derived" | "additional-content" | "default";
|
|
573
570
|
|
|
574
571
|
/**
|
|
575
572
|
* Set of automatically infered feature flags. That's not something the user can set, but
|
|
@@ -579,34 +576,33 @@ export interface WorkspaceConfig {
|
|
|
579
576
|
}
|
|
580
577
|
|
|
581
578
|
export interface GithubAppConfig {
|
|
582
|
-
prebuilds?: GithubAppPrebuildConfig
|
|
579
|
+
prebuilds?: GithubAppPrebuildConfig;
|
|
583
580
|
}
|
|
584
581
|
export interface GithubAppPrebuildConfig {
|
|
585
|
-
master?: boolean
|
|
586
|
-
branches?: boolean
|
|
587
|
-
pullRequests?: boolean
|
|
588
|
-
pullRequestsFromForks?: boolean
|
|
589
|
-
addCheck?: boolean
|
|
590
|
-
addBadge?: boolean
|
|
591
|
-
addLabel?: boolean | string
|
|
592
|
-
addComment?: boolean
|
|
582
|
+
master?: boolean;
|
|
583
|
+
branches?: boolean;
|
|
584
|
+
pullRequests?: boolean;
|
|
585
|
+
pullRequestsFromForks?: boolean;
|
|
586
|
+
addCheck?: boolean | "prevent-merge-on-error";
|
|
587
|
+
addBadge?: boolean;
|
|
588
|
+
addLabel?: boolean | string;
|
|
589
|
+
addComment?: boolean;
|
|
593
590
|
}
|
|
594
591
|
export namespace GithubAppPrebuildConfig {
|
|
595
592
|
export function is(obj: boolean | GithubAppPrebuildConfig): obj is GithubAppPrebuildConfig {
|
|
596
|
-
return !(typeof obj ===
|
|
593
|
+
return !(typeof obj === "boolean");
|
|
597
594
|
}
|
|
598
595
|
}
|
|
599
596
|
|
|
600
597
|
export type WorkspaceImageSource = WorkspaceImageSourceDocker | WorkspaceImageSourceReference;
|
|
601
598
|
export interface WorkspaceImageSourceDocker {
|
|
602
|
-
dockerFilePath: string
|
|
603
|
-
dockerFileHash: string
|
|
604
|
-
dockerFileSource?: Commit
|
|
599
|
+
dockerFilePath: string;
|
|
600
|
+
dockerFileHash: string;
|
|
601
|
+
dockerFileSource?: Commit;
|
|
605
602
|
}
|
|
606
603
|
export namespace WorkspaceImageSourceDocker {
|
|
607
604
|
export function is(obj: object): obj is WorkspaceImageSourceDocker {
|
|
608
|
-
return
|
|
609
|
-
&& 'dockerFilePath' in obj;
|
|
605
|
+
return "dockerFileHash" in obj && "dockerFilePath" in obj;
|
|
610
606
|
}
|
|
611
607
|
}
|
|
612
608
|
export interface WorkspaceImageSourceReference {
|
|
@@ -615,21 +611,23 @@ export interface WorkspaceImageSourceReference {
|
|
|
615
611
|
}
|
|
616
612
|
export namespace WorkspaceImageSourceReference {
|
|
617
613
|
export function is(obj: object): obj is WorkspaceImageSourceReference {
|
|
618
|
-
return
|
|
614
|
+
return "baseImageResolved" in obj;
|
|
619
615
|
}
|
|
620
616
|
}
|
|
621
617
|
|
|
622
|
-
export type PrebuiltWorkspaceState
|
|
618
|
+
export type PrebuiltWorkspaceState =
|
|
623
619
|
// the prebuild is queued and may start at anytime
|
|
624
|
-
|
|
620
|
+
| "queued"
|
|
625
621
|
// the workspace prebuild is currently running (i.e. there's a workspace pod deployed)
|
|
626
622
|
| "building"
|
|
627
|
-
// the prebuild
|
|
623
|
+
// the prebuild was aborted
|
|
628
624
|
| "aborted"
|
|
629
625
|
// the prebuild timed out
|
|
630
626
|
| "timeout"
|
|
631
|
-
// the prebuild has finished and a snapshot is available
|
|
632
|
-
| "available"
|
|
627
|
+
// the prebuild has finished (even if a headless task failed) and a snapshot is available
|
|
628
|
+
| "available"
|
|
629
|
+
// the prebuild (headless workspace) failed due to some system error
|
|
630
|
+
| "failed";
|
|
633
631
|
|
|
634
632
|
export interface PrebuiltWorkspace {
|
|
635
633
|
id: string;
|
|
@@ -640,13 +638,14 @@ export interface PrebuiltWorkspace {
|
|
|
640
638
|
buildWorkspaceId: string;
|
|
641
639
|
creationTime: string;
|
|
642
640
|
state: PrebuiltWorkspaceState;
|
|
641
|
+
statusVersion: number;
|
|
643
642
|
error?: string;
|
|
644
643
|
snapshot?: string;
|
|
645
644
|
}
|
|
646
645
|
|
|
647
646
|
export namespace PrebuiltWorkspace {
|
|
648
647
|
export function isDone(pws: PrebuiltWorkspace) {
|
|
649
|
-
return pws.state === "available" || pws.state === "timeout" || pws.state ===
|
|
648
|
+
return pws.state === "available" || pws.state === "timeout" || pws.state === "aborted";
|
|
650
649
|
}
|
|
651
650
|
|
|
652
651
|
export function isAvailable(pws: PrebuiltWorkspace) {
|
|
@@ -665,27 +664,33 @@ export interface PrebuiltWorkspaceUpdatable {
|
|
|
665
664
|
repo: string;
|
|
666
665
|
isResolved: boolean;
|
|
667
666
|
installationId: string;
|
|
667
|
+
/**
|
|
668
|
+
* the commitSHA of the commit that triggered the prebuild
|
|
669
|
+
*/
|
|
670
|
+
commitSHA?: string;
|
|
668
671
|
issue?: string;
|
|
669
672
|
contextUrl?: string;
|
|
670
673
|
}
|
|
671
674
|
|
|
672
675
|
export interface WhitelistedRepository {
|
|
673
|
-
url: string
|
|
674
|
-
name: string
|
|
675
|
-
description?: string
|
|
676
|
-
avatar?: string
|
|
676
|
+
url: string;
|
|
677
|
+
name: string;
|
|
678
|
+
description?: string;
|
|
679
|
+
avatar?: string;
|
|
677
680
|
}
|
|
678
681
|
|
|
679
|
-
export type PortOnOpen =
|
|
682
|
+
export type PortOnOpen = "open-browser" | "open-preview" | "notify" | "ignore";
|
|
680
683
|
|
|
681
684
|
export interface PortConfig {
|
|
682
685
|
port: number;
|
|
683
686
|
onOpen?: PortOnOpen;
|
|
684
687
|
visibility?: PortVisibility;
|
|
688
|
+
description?: string;
|
|
689
|
+
name?: string;
|
|
685
690
|
}
|
|
686
691
|
export namespace PortConfig {
|
|
687
692
|
export function is(config: any): config is PortConfig {
|
|
688
|
-
return config &&
|
|
693
|
+
return config && "port" in config && typeof config.port === "number";
|
|
689
694
|
}
|
|
690
695
|
}
|
|
691
696
|
|
|
@@ -695,7 +700,7 @@ export interface PortRangeConfig {
|
|
|
695
700
|
}
|
|
696
701
|
export namespace PortRangeConfig {
|
|
697
702
|
export function is(config: any): config is PortRangeConfig {
|
|
698
|
-
return config &&
|
|
703
|
+
return config && "port" in config && (typeof config.port === "string" || config.port instanceof String);
|
|
699
704
|
}
|
|
700
705
|
}
|
|
701
706
|
|
|
@@ -706,32 +711,31 @@ export interface TaskConfig {
|
|
|
706
711
|
prebuild?: string;
|
|
707
712
|
command?: string;
|
|
708
713
|
env?: { [env: string]: any };
|
|
709
|
-
openIn?:
|
|
710
|
-
openMode?:
|
|
714
|
+
openIn?: "bottom" | "main" | "left" | "right";
|
|
715
|
+
openMode?: "split-top" | "split-left" | "split-right" | "split-bottom" | "tab-before" | "tab-after";
|
|
711
716
|
}
|
|
712
717
|
|
|
713
718
|
export namespace TaskConfig {
|
|
714
719
|
export function is(config: any): config is TaskConfig {
|
|
715
|
-
return config
|
|
716
|
-
&& ('command' in config || 'init' in config || 'before' in config);
|
|
720
|
+
return config && ("command" in config || "init" in config || "before" in config);
|
|
717
721
|
}
|
|
718
722
|
}
|
|
719
723
|
|
|
720
724
|
export namespace WorkspaceImageBuild {
|
|
721
|
-
export type Phase =
|
|
725
|
+
export type Phase = "BaseImage" | "GitpodLayer" | "Error" | "Done";
|
|
722
726
|
export interface StateInfo {
|
|
723
|
-
phase: Phase
|
|
724
|
-
currentStep?: number
|
|
725
|
-
maxSteps?: number
|
|
727
|
+
phase: Phase;
|
|
728
|
+
currentStep?: number;
|
|
729
|
+
maxSteps?: number;
|
|
726
730
|
}
|
|
727
731
|
export interface LogContent {
|
|
728
|
-
text: string
|
|
729
|
-
upToLine?: number
|
|
730
|
-
isDiff?: boolean
|
|
732
|
+
text: string;
|
|
733
|
+
upToLine?: number;
|
|
734
|
+
isDiff?: boolean;
|
|
731
735
|
}
|
|
732
736
|
export type LogCallback = (info: StateInfo, content: LogContent | undefined) => void;
|
|
733
737
|
export namespace LogLine {
|
|
734
|
-
export const DELIMITER =
|
|
738
|
+
export const DELIMITER = "\r\n";
|
|
735
739
|
export const DELIMITER_REGEX = /\r?\n/;
|
|
736
740
|
}
|
|
737
741
|
}
|
|
@@ -740,20 +744,18 @@ export type ImageConfig = ImageConfigString | ImageConfigFile;
|
|
|
740
744
|
export type ImageConfigString = string;
|
|
741
745
|
export namespace ImageConfigString {
|
|
742
746
|
export function is(config: ImageConfig | undefined): config is ImageConfigString {
|
|
743
|
-
return typeof config ===
|
|
747
|
+
return typeof config === "string";
|
|
744
748
|
}
|
|
745
|
-
|
|
746
749
|
}
|
|
747
750
|
export interface ImageConfigFile {
|
|
748
751
|
// Path to the Dockerfile relative to repository root
|
|
749
|
-
file: string
|
|
752
|
+
file: string;
|
|
750
753
|
// Path to the docker build context relative to repository root
|
|
751
|
-
context?: string
|
|
754
|
+
context?: string;
|
|
752
755
|
}
|
|
753
756
|
export namespace ImageConfigFile {
|
|
754
757
|
export function is(config: ImageConfig | undefined): config is ImageConfigFile {
|
|
755
|
-
return typeof config ===
|
|
756
|
-
&& 'file' in config;
|
|
758
|
+
return typeof config === "object" && "file" in config;
|
|
757
759
|
}
|
|
758
760
|
}
|
|
759
761
|
export interface ExternalImageConfigFile extends ImageConfigFile {
|
|
@@ -761,14 +763,13 @@ export interface ExternalImageConfigFile extends ImageConfigFile {
|
|
|
761
763
|
}
|
|
762
764
|
export namespace ExternalImageConfigFile {
|
|
763
765
|
export function is(config: any | undefined): config is ExternalImageConfigFile {
|
|
764
|
-
return typeof config ===
|
|
765
|
-
&& 'file' in config
|
|
766
|
-
&& 'externalSource' in config;
|
|
766
|
+
return typeof config === "object" && "file" in config && "externalSource" in config;
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
|
|
770
770
|
export interface WorkspaceContext {
|
|
771
771
|
title: string;
|
|
772
|
+
/** This contains the URL portion of the contextURL (which might contain other modifiers as well). It's optional because it's not set for older workspaces. */
|
|
772
773
|
normalizedContextURL?: string;
|
|
773
774
|
forceCreateNewWorkspace?: boolean;
|
|
774
775
|
forceImageBuild?: boolean;
|
|
@@ -776,8 +777,7 @@ export interface WorkspaceContext {
|
|
|
776
777
|
|
|
777
778
|
export namespace WorkspaceContext {
|
|
778
779
|
export function is(context: any): context is WorkspaceContext {
|
|
779
|
-
return context
|
|
780
|
-
&& 'title' in context;
|
|
780
|
+
return context && "title" in context;
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
783
|
|
|
@@ -786,22 +786,17 @@ export interface WithSnapshot {
|
|
|
786
786
|
}
|
|
787
787
|
export namespace WithSnapshot {
|
|
788
788
|
export function is(context: any): context is WithSnapshot {
|
|
789
|
-
return context
|
|
790
|
-
&& 'snapshotBucketId' in context;
|
|
789
|
+
return context && "snapshotBucketId" in context;
|
|
791
790
|
}
|
|
792
791
|
}
|
|
793
792
|
|
|
794
|
-
export interface WithPrebuild {
|
|
795
|
-
snapshotBucketId: string;
|
|
793
|
+
export interface WithPrebuild extends WithSnapshot {
|
|
796
794
|
prebuildWorkspaceId: string;
|
|
797
795
|
wasPrebuilt: true;
|
|
798
796
|
}
|
|
799
797
|
export namespace WithPrebuild {
|
|
800
798
|
export function is(context: any): context is WithPrebuild {
|
|
801
|
-
return context
|
|
802
|
-
&& 'snapshotBucketId' in context
|
|
803
|
-
&& 'prebuildWorkspaceId' in context
|
|
804
|
-
&& 'wasPrebuilt' in context;
|
|
799
|
+
return context && WithSnapshot.is(context) && "prebuildWorkspaceId" in context && "wasPrebuilt" in context;
|
|
805
800
|
}
|
|
806
801
|
}
|
|
807
802
|
|
|
@@ -815,16 +810,14 @@ export interface WithDefaultConfig {
|
|
|
815
810
|
|
|
816
811
|
export namespace WithDefaultConfig {
|
|
817
812
|
export function is(context: any): context is WithDefaultConfig {
|
|
818
|
-
return context
|
|
819
|
-
&& 'withDefaultConfig' in context
|
|
820
|
-
&& context.withDefaultConfig;
|
|
813
|
+
return context && "withDefaultConfig" in context && context.withDefaultConfig;
|
|
821
814
|
}
|
|
822
815
|
|
|
823
816
|
export function mark(ctx: WorkspaceContext): WorkspaceContext & WithDefaultConfig {
|
|
824
817
|
return {
|
|
825
818
|
...ctx,
|
|
826
|
-
withDefaultConfig: true
|
|
827
|
-
}
|
|
819
|
+
withDefaultConfig: true,
|
|
820
|
+
};
|
|
828
821
|
}
|
|
829
822
|
}
|
|
830
823
|
|
|
@@ -834,23 +827,24 @@ export interface SnapshotContext extends WorkspaceContext, WithSnapshot {
|
|
|
834
827
|
|
|
835
828
|
export namespace SnapshotContext {
|
|
836
829
|
export function is(context: any): context is SnapshotContext {
|
|
837
|
-
return context
|
|
838
|
-
&& WithSnapshot.is(context)
|
|
839
|
-
&& 'snapshotId' in context;
|
|
830
|
+
return context && WithSnapshot.is(context) && "snapshotId" in context;
|
|
840
831
|
}
|
|
841
832
|
}
|
|
842
833
|
|
|
843
834
|
export interface StartPrebuildContext extends WorkspaceContext {
|
|
844
835
|
actual: WorkspaceContext;
|
|
845
836
|
commitHistory?: string[];
|
|
837
|
+
additionalRepositoryCommitHistories?: {
|
|
838
|
+
cloneUrl: string;
|
|
839
|
+
commitHistory: string[];
|
|
840
|
+
}[];
|
|
846
841
|
project?: Project;
|
|
847
842
|
branch?: string;
|
|
848
843
|
}
|
|
849
844
|
|
|
850
845
|
export namespace StartPrebuildContext {
|
|
851
846
|
export function is(context: any): context is StartPrebuildContext {
|
|
852
|
-
return context
|
|
853
|
-
&& 'actual' in context;
|
|
847
|
+
return context && "actual" in context;
|
|
854
848
|
}
|
|
855
849
|
}
|
|
856
850
|
|
|
@@ -862,33 +856,39 @@ export interface PrebuiltWorkspaceContext extends WorkspaceContext {
|
|
|
862
856
|
|
|
863
857
|
export namespace PrebuiltWorkspaceContext {
|
|
864
858
|
export function is(context: any): context is PrebuiltWorkspaceContext {
|
|
865
|
-
return context
|
|
866
|
-
|
|
867
|
-
|
|
859
|
+
return context && "originalContext" in context && "prebuiltWorkspace" in context;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export interface WithReferrerContext extends WorkspaceContext {
|
|
864
|
+
referrer: string;
|
|
865
|
+
referrerIde?: string;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export namespace WithReferrerContext {
|
|
869
|
+
export function is(context: any): context is WithReferrerContext {
|
|
870
|
+
return context && "referrer" in context;
|
|
868
871
|
}
|
|
869
872
|
}
|
|
870
873
|
|
|
871
874
|
export interface WithEnvvarsContext extends WorkspaceContext {
|
|
872
|
-
envvars:
|
|
875
|
+
envvars: EnvVarWithValue[];
|
|
873
876
|
}
|
|
874
877
|
|
|
875
878
|
export namespace WithEnvvarsContext {
|
|
876
879
|
export function is(context: any): context is WithEnvvarsContext {
|
|
877
|
-
return context
|
|
878
|
-
&& 'envvars' in context
|
|
880
|
+
return context && "envvars" in context;
|
|
879
881
|
}
|
|
880
882
|
}
|
|
881
883
|
|
|
882
884
|
export interface WorkspaceProbeContext extends WorkspaceContext {
|
|
883
|
-
responseURL: string
|
|
884
|
-
responseToken: string
|
|
885
|
+
responseURL: string;
|
|
886
|
+
responseToken: string;
|
|
885
887
|
}
|
|
886
888
|
|
|
887
889
|
export namespace WorkspaceProbeContext {
|
|
888
890
|
export function is(context: any): context is WorkspaceProbeContext {
|
|
889
|
-
return context
|
|
890
|
-
&& 'responseURL' in context
|
|
891
|
-
&& 'responseToken' in context;
|
|
891
|
+
return context && "responseURL" in context && "responseToken" in context;
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
894
|
|
|
@@ -900,32 +900,30 @@ export namespace RefType {
|
|
|
900
900
|
}
|
|
901
901
|
// This fallback is meant to handle the cases where (for historic reasons) ref is present but refType is missing
|
|
902
902
|
return commit.refType || "branch";
|
|
903
|
-
}
|
|
903
|
+
};
|
|
904
904
|
}
|
|
905
905
|
|
|
906
906
|
export interface Commit {
|
|
907
|
-
repository: Repository
|
|
908
|
-
revision: string
|
|
907
|
+
repository: Repository;
|
|
908
|
+
revision: string;
|
|
909
909
|
|
|
910
910
|
// Might contain either a branch or a tag (determined by refType)
|
|
911
|
-
ref?: string
|
|
911
|
+
ref?: string;
|
|
912
912
|
|
|
913
913
|
// refType is only set if ref is present (and not for old workspaces, before this feature was added)
|
|
914
|
-
refType?: RefType
|
|
914
|
+
refType?: RefType;
|
|
915
915
|
}
|
|
916
916
|
|
|
917
917
|
export interface AdditionalContentContext extends WorkspaceContext {
|
|
918
|
-
|
|
919
918
|
/**
|
|
920
919
|
* utf-8 encoded contents that will be copied on top of the workspace's filesystem
|
|
921
920
|
*/
|
|
922
|
-
additionalFiles: {[filePath: string]: string};
|
|
923
|
-
|
|
921
|
+
additionalFiles: { [filePath: string]: string };
|
|
924
922
|
}
|
|
925
923
|
|
|
926
924
|
export namespace AdditionalContentContext {
|
|
927
925
|
export function is(ctx: any): ctx is AdditionalContentContext {
|
|
928
|
-
return
|
|
926
|
+
return "additionalFiles" in ctx;
|
|
929
927
|
}
|
|
930
928
|
|
|
931
929
|
export function hasDockerConfig(ctx: any, config: WorkspaceConfig): boolean {
|
|
@@ -933,16 +931,49 @@ export namespace AdditionalContentContext {
|
|
|
933
931
|
}
|
|
934
932
|
}
|
|
935
933
|
|
|
936
|
-
export interface CommitContext extends WorkspaceContext,
|
|
934
|
+
export interface CommitContext extends WorkspaceContext, GitCheckoutInfo {
|
|
937
935
|
/** @deprecated Moved to .repository.cloneUrl, left here for backwards-compatibility for old workspace contextes in the DB */
|
|
938
|
-
cloneUrl?: string
|
|
936
|
+
cloneUrl?: string;
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* The clone and checkout information for additional repositories in case of multi-repo projects.
|
|
940
|
+
*/
|
|
941
|
+
additionalRepositoryCheckoutInfo?: GitCheckoutInfo[];
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
export namespace CommitContext {
|
|
945
|
+
/**
|
|
946
|
+
* Creates a hash for all the commits of the CommitContext and all sub-repo commit infos.
|
|
947
|
+
* The hash is max 255 chars long.
|
|
948
|
+
* @param commitContext
|
|
949
|
+
* @returns hash for commitcontext
|
|
950
|
+
*/
|
|
951
|
+
export function computeHash(commitContext: CommitContext): string {
|
|
952
|
+
// for single commits we use the revision to be backward compatible.
|
|
953
|
+
if (
|
|
954
|
+
!commitContext.additionalRepositoryCheckoutInfo ||
|
|
955
|
+
commitContext.additionalRepositoryCheckoutInfo.length === 0
|
|
956
|
+
) {
|
|
957
|
+
return commitContext.revision;
|
|
958
|
+
}
|
|
959
|
+
const hasher = createHash("sha256");
|
|
960
|
+
hasher.update(commitContext.revision);
|
|
961
|
+
for (const info of commitContext.additionalRepositoryCheckoutInfo) {
|
|
962
|
+
hasher.update(info.revision);
|
|
963
|
+
}
|
|
964
|
+
return hasher.digest("hex");
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export interface GitCheckoutInfo extends Commit {
|
|
969
|
+
checkoutLocation?: string;
|
|
970
|
+
upstreamRemoteURI?: string;
|
|
971
|
+
localBranch?: string;
|
|
939
972
|
}
|
|
940
973
|
|
|
941
974
|
export namespace CommitContext {
|
|
942
975
|
export function is(commit: any): commit is CommitContext {
|
|
943
|
-
return WorkspaceContext.is(commit)
|
|
944
|
-
&& 'repository' in commit
|
|
945
|
-
&& 'revision' in commit
|
|
976
|
+
return WorkspaceContext.is(commit) && "repository" in commit && "revision" in commit;
|
|
946
977
|
}
|
|
947
978
|
}
|
|
948
979
|
|
|
@@ -950,17 +981,14 @@ export interface PullRequestContext extends CommitContext {
|
|
|
950
981
|
nr: number;
|
|
951
982
|
ref: string;
|
|
952
983
|
base: {
|
|
953
|
-
repository: Repository
|
|
954
|
-
ref: string
|
|
955
|
-
}
|
|
984
|
+
repository: Repository;
|
|
985
|
+
ref: string;
|
|
986
|
+
};
|
|
956
987
|
}
|
|
957
988
|
|
|
958
989
|
export namespace PullRequestContext {
|
|
959
990
|
export function is(ctx: any): ctx is PullRequestContext {
|
|
960
|
-
return CommitContext.is(ctx)
|
|
961
|
-
&& 'nr' in ctx
|
|
962
|
-
&& 'ref' in ctx
|
|
963
|
-
&& 'base' in ctx
|
|
991
|
+
return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "base" in ctx;
|
|
964
992
|
}
|
|
965
993
|
}
|
|
966
994
|
|
|
@@ -972,10 +1000,7 @@ export interface IssueContext extends CommitContext {
|
|
|
972
1000
|
|
|
973
1001
|
export namespace IssueContext {
|
|
974
1002
|
export function is(ctx: any): ctx is IssueContext {
|
|
975
|
-
return CommitContext.is(ctx)
|
|
976
|
-
&& 'nr' in ctx
|
|
977
|
-
&& 'ref' in ctx
|
|
978
|
-
&& 'localBranch' in ctx
|
|
1003
|
+
return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "localBranch" in ctx;
|
|
979
1004
|
}
|
|
980
1005
|
}
|
|
981
1006
|
|
|
@@ -986,9 +1011,7 @@ export interface NavigatorContext extends CommitContext {
|
|
|
986
1011
|
|
|
987
1012
|
export namespace NavigatorContext {
|
|
988
1013
|
export function is(ctx: any): ctx is NavigatorContext {
|
|
989
|
-
return CommitContext.is(ctx)
|
|
990
|
-
&& 'path' in ctx
|
|
991
|
-
&& 'isFile' in ctx
|
|
1014
|
+
return CommitContext.is(ctx) && "path" in ctx && "isFile" in ctx;
|
|
992
1015
|
}
|
|
993
1016
|
}
|
|
994
1017
|
|
|
@@ -997,6 +1020,8 @@ export interface Repository {
|
|
|
997
1020
|
owner: string;
|
|
998
1021
|
name: string;
|
|
999
1022
|
cloneUrl: string;
|
|
1023
|
+
/* Optional kind to differentiate between repositories of orgs/groups/projects and personal repos. */
|
|
1024
|
+
repoKind?: string;
|
|
1000
1025
|
description?: string;
|
|
1001
1026
|
avatarUrl?: string;
|
|
1002
1027
|
webUrl?: string;
|
|
@@ -1005,8 +1030,8 @@ export interface Repository {
|
|
|
1005
1030
|
private?: boolean;
|
|
1006
1031
|
fork?: {
|
|
1007
1032
|
// The direct parent of this fork
|
|
1008
|
-
parent: Repository
|
|
1009
|
-
}
|
|
1033
|
+
parent: Repository;
|
|
1034
|
+
};
|
|
1010
1035
|
}
|
|
1011
1036
|
export interface Branch {
|
|
1012
1037
|
name: string;
|
|
@@ -1031,21 +1056,19 @@ export namespace Repository {
|
|
|
1031
1056
|
export interface WorkspaceInstancePortsChangedEvent {
|
|
1032
1057
|
type: "PortsChanged";
|
|
1033
1058
|
instanceID: string;
|
|
1034
|
-
portsOpened: number[]
|
|
1035
|
-
portsClosed: number[]
|
|
1059
|
+
portsOpened: number[];
|
|
1060
|
+
portsClosed: number[];
|
|
1036
1061
|
}
|
|
1037
1062
|
|
|
1038
1063
|
export namespace WorkspaceInstancePortsChangedEvent {
|
|
1039
|
-
|
|
1040
1064
|
export function is(data: any): data is WorkspaceInstancePortsChangedEvent {
|
|
1041
1065
|
return data && data.type == "PortsChanged";
|
|
1042
1066
|
}
|
|
1043
|
-
|
|
1044
1067
|
}
|
|
1045
1068
|
|
|
1046
1069
|
export interface WorkspaceInfo {
|
|
1047
|
-
workspace: Workspace
|
|
1048
|
-
latestInstance?: WorkspaceInstance
|
|
1070
|
+
workspace: Workspace;
|
|
1071
|
+
latestInstance?: WorkspaceInstance;
|
|
1049
1072
|
}
|
|
1050
1073
|
|
|
1051
1074
|
export namespace WorkspaceInfo {
|
|
@@ -1061,35 +1084,36 @@ export interface WorkspaceCreationResult {
|
|
|
1061
1084
|
workspaceURL?: string;
|
|
1062
1085
|
existingWorkspaces?: WorkspaceInfo[];
|
|
1063
1086
|
runningWorkspacePrebuild?: {
|
|
1064
|
-
prebuildID: string
|
|
1065
|
-
workspaceID: string
|
|
1066
|
-
instanceID: string
|
|
1067
|
-
starting: RunningWorkspacePrebuildStarting
|
|
1068
|
-
sameCluster: boolean
|
|
1069
|
-
}
|
|
1087
|
+
prebuildID: string;
|
|
1088
|
+
workspaceID: string;
|
|
1089
|
+
instanceID: string;
|
|
1090
|
+
starting: RunningWorkspacePrebuildStarting;
|
|
1091
|
+
sameCluster: boolean;
|
|
1092
|
+
};
|
|
1070
1093
|
runningPrebuildWorkspaceID?: string;
|
|
1071
1094
|
}
|
|
1072
|
-
export type RunningWorkspacePrebuildStarting =
|
|
1095
|
+
export type RunningWorkspacePrebuildStarting = "queued" | "starting" | "running";
|
|
1073
1096
|
|
|
1074
1097
|
export enum CreateWorkspaceMode {
|
|
1075
1098
|
// Default returns a running prebuild if there is any, otherwise creates a new workspace (using a prebuild if one is available)
|
|
1076
|
-
Default =
|
|
1099
|
+
Default = "default",
|
|
1077
1100
|
// ForceNew creates a new workspace irrespective of any running prebuilds. This mode is guaranteed to actually create a workspace - but may degrade user experience as currently runnig prebuilds are ignored.
|
|
1078
|
-
ForceNew =
|
|
1101
|
+
ForceNew = "force-new",
|
|
1079
1102
|
// UsePrebuild polls the database waiting for a currently running prebuild to become available. This mode exists to handle the db-sync delay.
|
|
1080
|
-
UsePrebuild =
|
|
1103
|
+
UsePrebuild = "use-prebuild",
|
|
1081
1104
|
// SelectIfRunning returns a list of currently running workspaces for the context URL if there are any, otherwise falls back to Default mode
|
|
1082
|
-
SelectIfRunning =
|
|
1105
|
+
SelectIfRunning = "select-if-running",
|
|
1083
1106
|
}
|
|
1084
1107
|
|
|
1085
1108
|
export namespace WorkspaceCreationResult {
|
|
1086
1109
|
export function is(data: any): data is WorkspaceCreationResult {
|
|
1087
|
-
return
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1110
|
+
return (
|
|
1111
|
+
data &&
|
|
1112
|
+
("createdWorkspaceId" in data ||
|
|
1113
|
+
"existingWorkspaces" in data ||
|
|
1114
|
+
"runningWorkspacePrebuild" in data ||
|
|
1115
|
+
"runningPrebuildWorkspaceID" in data)
|
|
1116
|
+
);
|
|
1093
1117
|
}
|
|
1094
1118
|
}
|
|
1095
1119
|
|
|
@@ -1123,6 +1147,12 @@ export interface AuthProviderInfo {
|
|
|
1123
1147
|
readonly default: string[];
|
|
1124
1148
|
readonly publicRepo: string[];
|
|
1125
1149
|
readonly privateRepo: string[];
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
export namespace AuthProviderInfo {
|
|
1154
|
+
export function isGitHubEnterprise(info?: AuthProviderInfo): boolean {
|
|
1155
|
+
return !!info && info.authProviderType === "GitHub" && info.host !== "github.com";
|
|
1126
1156
|
}
|
|
1127
1157
|
}
|
|
1128
1158
|
|
|
@@ -1135,6 +1165,8 @@ export interface AuthProviderEntry {
|
|
|
1135
1165
|
readonly status: AuthProviderEntry.Status;
|
|
1136
1166
|
|
|
1137
1167
|
readonly oauth: OAuth2Config;
|
|
1168
|
+
/** A random string that is to change whenever oauth changes (enforced on DB level) */
|
|
1169
|
+
readonly oauthRevision?: string;
|
|
1138
1170
|
}
|
|
1139
1171
|
|
|
1140
1172
|
export interface OAuth2Config {
|
|
@@ -1147,56 +1179,27 @@ export interface OAuth2Config {
|
|
|
1147
1179
|
readonly scopeSeparator?: string;
|
|
1148
1180
|
|
|
1149
1181
|
readonly settingsUrl?: string;
|
|
1150
|
-
readonly authorizationParams?: { [key: string]: string }
|
|
1182
|
+
readonly authorizationParams?: { [key: string]: string };
|
|
1151
1183
|
readonly configURL?: string;
|
|
1152
1184
|
}
|
|
1153
1185
|
|
|
1154
1186
|
export namespace AuthProviderEntry {
|
|
1155
1187
|
export type Type = "GitHub" | "GitLab" | string;
|
|
1156
1188
|
export type Status = "pending" | "verified";
|
|
1157
|
-
export type NewEntry = Pick<AuthProviderEntry, "ownerId" | "host" | "type"> & {
|
|
1158
|
-
|
|
1189
|
+
export type NewEntry = Pick<AuthProviderEntry, "ownerId" | "host" | "type"> & {
|
|
1190
|
+
clientId?: string;
|
|
1191
|
+
clientSecret?: string;
|
|
1192
|
+
};
|
|
1193
|
+
export type UpdateEntry = Pick<AuthProviderEntry, "id" | "ownerId"> &
|
|
1194
|
+
Pick<OAuth2Config, "clientId" | "clientSecret">;
|
|
1159
1195
|
export function redact(entry: AuthProviderEntry): AuthProviderEntry {
|
|
1160
1196
|
return {
|
|
1161
1197
|
...entry,
|
|
1162
1198
|
oauth: {
|
|
1163
1199
|
...entry.oauth,
|
|
1164
|
-
clientSecret: "redacted"
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
export interface Branding {
|
|
1171
|
-
readonly name: string;
|
|
1172
|
-
readonly favicon?: string;
|
|
1173
|
-
/** Either including domain OR absolute path (interpreted relative to host URL) */
|
|
1174
|
-
readonly logo: string;
|
|
1175
|
-
readonly startupLogo: string;
|
|
1176
|
-
readonly showProductivityTips: boolean;
|
|
1177
|
-
readonly redirectUrlIfNotAuthenticated?: string;
|
|
1178
|
-
readonly redirectUrlAfterLogout?: string;
|
|
1179
|
-
readonly homepage: string;
|
|
1180
|
-
readonly ide?: {
|
|
1181
|
-
readonly logo: string;
|
|
1182
|
-
readonly showReleaseNotes: boolean;
|
|
1183
|
-
readonly helpMenu: Branding.Link[];
|
|
1184
|
-
}
|
|
1185
|
-
readonly links: {
|
|
1186
|
-
readonly header: Branding.Link[];
|
|
1187
|
-
readonly footer: Branding.Link[];
|
|
1188
|
-
readonly social: Branding.SocialLink[];
|
|
1189
|
-
readonly legal: Branding.Link[];
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
export namespace Branding {
|
|
1193
|
-
export interface Link {
|
|
1194
|
-
readonly name: string;
|
|
1195
|
-
readonly url: string;
|
|
1196
|
-
}
|
|
1197
|
-
export interface SocialLink {
|
|
1198
|
-
readonly type: string;
|
|
1199
|
-
readonly url: string;
|
|
1200
|
+
clientSecret: "redacted",
|
|
1201
|
+
},
|
|
1202
|
+
};
|
|
1200
1203
|
}
|
|
1201
1204
|
}
|
|
1202
1205
|
|