@gitpod/gitpod-protocol 0.1.5-vn-jetbrains-backend-plugin-223.6 → 0.1.5-wk-inte-test-20230117000019.1
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 +16 -0
- package/lib/accounting-protocol.d.ts +1 -1
- package/lib/accounting-protocol.js +1 -1
- package/lib/admin-protocol.d.ts +11 -2
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +1 -1
- package/lib/analytics.js +1 -1
- package/lib/attribution.d.ts +5 -1
- package/lib/attribution.d.ts.map +1 -1
- package/lib/attribution.js +15 -1
- package/lib/attribution.js.map +1 -1
- package/lib/auth.d.ts +1 -1
- package/lib/auth.js +1 -1
- package/lib/billing-mode.d.ts +5 -1
- package/lib/billing-mode.d.ts.map +1 -1
- package/lib/billing-mode.js +1 -1
- package/lib/blocked-repositories-protocol.d.ts +1 -1
- package/lib/blocked-repositories-protocol.js +1 -1
- package/lib/context-url.d.ts +1 -2
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +1 -3
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +1 -3
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +1 -29
- package/lib/context-url.spec.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.js +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +1 -1
- package/lib/encryption/encryption-engine.spec.js +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.js +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.js +1 -1
- package/lib/env.d.ts +1 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +1 -1
- package/lib/env.js.map +1 -1
- package/lib/experiments/always-default.d.ts +1 -1
- package/lib/experiments/configcat-server.d.ts +1 -1
- package/lib/experiments/configcat-server.d.ts.map +1 -1
- package/lib/experiments/configcat-server.js +2 -1
- package/lib/experiments/configcat-server.js.map +1 -1
- package/lib/experiments/configcat.d.ts +1 -3
- package/lib/experiments/configcat.d.ts.map +1 -1
- package/lib/experiments/configcat.js +2 -8
- package/lib/experiments/configcat.js.map +1 -1
- package/lib/experiments/types.d.ts +1 -3
- package/lib/experiments/types.d.ts.map +1 -1
- package/lib/experiments/types.js +1 -1
- package/lib/experiments/types.js.map +1 -1
- package/lib/frontend-dashboard-service.d.ts +85 -0
- package/lib/frontend-dashboard-service.d.ts.map +1 -0
- package/lib/frontend-dashboard-service.js +32 -0
- package/lib/frontend-dashboard-service.js.map +1 -0
- package/lib/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.js +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +1 -1
- package/lib/gitpod-service.d.ts +17 -22
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +1 -1
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -1
- package/lib/headless-workspace-log.js +1 -1
- package/lib/ide-frontend-service.d.ts +1 -1
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +15 -2
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/ide-protocol.js +11 -1
- package/lib/ide-protocol.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installation-admin-protocol.d.ts +1 -1
- package/lib/installation-admin-protocol.js +1 -1
- package/lib/license-protocol.d.ts +1 -1
- package/lib/license-protocol.js +1 -1
- package/lib/messaging/browser/window-connection.d.ts +1 -1
- package/lib/messaging/browser/window-connection.js +1 -1
- package/lib/messaging/client-call-metrics.d.ts +3 -1
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +14 -1
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +3 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +5 -1
- package/lib/messaging/error.js.map +1 -1
- package/lib/oss-allowlist.d.ts +1 -1
- package/lib/oss-allowlist.js +1 -1
- package/lib/payment-protocol.d.ts +1 -1
- package/lib/payment-protocol.js +1 -1
- package/lib/permission.d.ts +1 -1
- package/lib/permission.js +1 -1
- package/lib/plans.d.ts +1 -1
- package/lib/plans.js +3 -3
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +22 -37
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +11 -19
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +1 -1
- package/lib/protocol.spec.js +1 -1
- package/lib/snapshot-url.d.ts +1 -1
- package/lib/snapshot-url.js +1 -1
- package/lib/snapshot-url.spec.d.ts +1 -1
- package/lib/snapshot-url.spec.js +1 -1
- package/lib/team-subscription-protocol.d.ts +1 -1
- package/lib/team-subscription-protocol.js +1 -1
- package/lib/teams-projects-protocol.d.ts +9 -3
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +9 -2
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +2 -1
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/typings/globals.js +1 -1
- package/lib/usage.d.ts +13 -1
- package/lib/usage.d.ts.map +1 -1
- package/lib/usage.js +8 -2
- package/lib/usage.js.map +1 -1
- package/lib/util/analytics.d.ts +1 -1
- package/lib/util/analytics.js +1 -1
- package/lib/util/async-iterator.d.ts +1 -1
- package/lib/util/async-iterator.js +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +1 -1
- package/lib/util/debug-app.d.ts +1 -1
- package/lib/util/debug-app.js +1 -1
- package/lib/util/deep-partial.d.ts +1 -1
- package/lib/util/deep-partial.js +1 -1
- package/lib/util/deferred.d.ts +1 -1
- package/lib/util/deferred.js +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -1
- package/lib/util/garbage-collected-cache.js +1 -1
- package/lib/util/generate-workspace-id.d.ts +1 -1
- package/lib/util/generate-workspace-id.js +1 -1
- package/lib/util/generate-workspace-id.spec.d.ts +1 -1
- package/lib/util/generate-workspace-id.spec.js +1 -1
- package/lib/util/gitpod-cookie.d.ts +1 -1
- package/lib/util/gitpod-cookie.js +1 -1
- package/lib/util/gitpod-host-url.d.ts +9 -3
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +22 -8
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +1 -1
- package/lib/util/gitpod-host-url.spec.js +1 -1
- package/lib/util/grpc.d.ts +2 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +1 -1
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +1 -1
- package/lib/util/jaeger-client-types.js +1 -1
- package/lib/util/logging.d.ts +1 -1
- package/lib/util/logging.js +1 -1
- package/lib/util/logging.spec.d.ts +1 -1
- package/lib/util/logging.spec.js +1 -1
- package/lib/util/make-link.d.ts +1 -1
- package/lib/util/make-link.js +1 -1
- package/lib/util/nice-grpc.d.ts +9 -0
- package/lib/util/nice-grpc.d.ts.map +1 -0
- package/lib/util/nice-grpc.js +121 -0
- package/lib/util/nice-grpc.js.map +1 -0
- package/lib/util/parse-workspace-id.d.ts +1 -1
- package/lib/util/parse-workspace-id.js +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +1 -1
- package/lib/util/parse-workspace-id.spec.js +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +1 -1
- package/lib/util/repeat.d.ts +1 -1
- package/lib/util/repeat.js +1 -1
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.js +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +1 -1
- package/lib/util/timeutil.d.ts +1 -1
- package/lib/util/timeutil.js +1 -1
- package/lib/util/timeutil.spec.d.ts +1 -1
- package/lib/util/timeutil.spec.js +1 -1
- package/lib/util/tracing.d.ts +1 -1
- package/lib/util/tracing.js +1 -1
- package/lib/util/tracing.spec.d.ts +1 -1
- package/lib/util/tracing.spec.js +1 -1
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.js +1 -1
- package/lib/webhook-event.d.ts +1 -1
- package/lib/webhook-event.js +1 -1
- package/lib/workspace-class.d.ts +2 -2
- package/lib/workspace-class.d.ts.map +1 -1
- package/lib/workspace-class.js +1 -1
- package/lib/workspace-cluster.d.ts +7 -6
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +1 -1
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +2 -1
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +1 -1
- package/lib/wsready.d.ts +10 -4
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +3 -1
- package/lib/wsready.js.map +1 -1
- package/package.json +3 -1
- package/pkg-yarn.lock +3 -1
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +1 -1
- package/src/admin-protocol.ts +15 -2
- package/src/analytics.ts +1 -1
- package/src/attribution.ts +16 -1
- package/src/auth.ts +1 -1
- package/src/billing-mode.ts +8 -1
- package/src/blocked-repositories-protocol.ts +1 -1
- package/src/context-url.spec.ts +1 -19
- package/src/context-url.ts +1 -3
- package/src/encryption/container-module.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +1 -1
- package/src/encryption/encryption-engine.ts +1 -1
- package/src/encryption/encryption-service.ts +1 -1
- package/src/encryption/key-provider.ts +1 -1
- package/src/env.ts +2 -3
- package/src/experiments/always-default.ts +1 -1
- package/src/experiments/configcat-server.ts +2 -1
- package/src/experiments/configcat.ts +1 -7
- package/src/experiments/types.ts +1 -5
- package/src/frontend-dashboard-service.ts +109 -0
- package/src/gitpod-file-parser.spec.ts +1 -1
- package/src/gitpod-file-parser.ts +1 -1
- package/src/gitpod-service.ts +20 -26
- package/src/headless-workspace-log.ts +1 -1
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +20 -2
- package/src/index.ts +1 -1
- package/src/installation-admin-protocol.ts +1 -1
- package/src/license-protocol.ts +1 -1
- package/src/messaging/browser/window-connection.ts +1 -1
- package/src/messaging/client-call-metrics.ts +18 -1
- package/src/messaging/error.ts +7 -1
- package/src/oss-allowlist.ts +1 -1
- package/src/payment-protocol.ts +1 -1
- package/src/permission.ts +1 -1
- package/src/plans.ts +3 -3
- package/src/protocol.spec.ts +1 -1
- package/src/protocol.ts +30 -49
- package/src/snapshot-url.spec.ts +1 -1
- package/src/snapshot-url.ts +1 -1
- package/src/team-subscription-protocol.ts +1 -1
- package/src/teams-projects-protocol.ts +15 -4
- package/src/typings/globals.ts +3 -1
- package/src/usage.ts +15 -1
- package/src/util/analytics.ts +1 -1
- package/src/util/async-iterator.ts +1 -1
- package/src/util/cancelable.ts +1 -1
- package/src/util/date-time.ts +1 -1
- package/src/util/debug-app.ts +1 -1
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +1 -1
- package/src/util/generate-workspace-id.spec.ts +1 -1
- package/src/util/generate-workspace-id.ts +1 -1
- package/src/util/gitpod-cookie.ts +1 -1
- package/src/util/gitpod-host-url.spec.ts +1 -1
- package/src/util/gitpod-host-url.ts +27 -8
- package/src/util/grpc.ts +4 -1
- package/src/util/jaeger-client-types.ts +1 -1
- package/src/util/logging.spec.ts +1 -1
- package/src/util/logging.ts +1 -1
- package/src/util/make-link.ts +1 -1
- package/src/util/nice-grpc.ts +96 -0
- package/src/util/parse-workspace-id.spec.ts +1 -1
- package/src/util/parse-workspace-id.ts +1 -1
- package/src/util/queue.spec.ts +1 -1
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +1 -1
- package/src/util/semaphore.ts +1 -1
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.spec.ts +1 -1
- package/src/util/timeutil.ts +1 -1
- package/src/util/tracing.spec.ts +1 -1
- package/src/util/tracing.ts +1 -1
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/webhook-event.ts +1 -1
- package/src/workspace-class.ts +2 -2
- package/src/workspace-cluster.ts +12 -7
- package/src/workspace-instance.ts +7 -1
- package/src/wsready.ts +12 -6
package/src/protocol.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { WorkspaceInstance, PortVisibility } from "./workspace-instance";
|
|
8
8
|
import { RoleOrPermission } from "./permission";
|
|
9
9
|
import { Project } from "./teams-projects-protocol";
|
|
10
10
|
import { createHash } from "crypto";
|
|
11
|
-
import { AttributionId } from "./attribution";
|
|
12
11
|
|
|
13
12
|
export interface UserInfo {
|
|
14
13
|
name?: string;
|
|
@@ -213,6 +212,9 @@ export interface AdditionalUserData {
|
|
|
213
212
|
workspaceClasses?: WorkspaceClasses;
|
|
214
213
|
// additional user profile data
|
|
215
214
|
profile?: ProfileDetails;
|
|
215
|
+
// whether the user has been migrated to team attribution.
|
|
216
|
+
// a corresponding feature flag (team_only_attribution) triggers the migration.
|
|
217
|
+
isMigratedToTeamOnlyAttribution?: boolean;
|
|
216
218
|
}
|
|
217
219
|
export namespace AdditionalUserData {
|
|
218
220
|
export function set(user: User, partialData: Partial<AdditionalUserData>): User {
|
|
@@ -256,8 +258,8 @@ export type IDESettings = {
|
|
|
256
258
|
};
|
|
257
259
|
|
|
258
260
|
export interface WorkspaceClasses {
|
|
259
|
-
regular
|
|
260
|
-
prebuild
|
|
261
|
+
regular?: string;
|
|
262
|
+
prebuild?: string;
|
|
261
263
|
}
|
|
262
264
|
|
|
263
265
|
export interface UserPlatform {
|
|
@@ -294,17 +296,13 @@ export type BillingTier = "paid" | "free";
|
|
|
294
296
|
*/
|
|
295
297
|
export const WorkspaceFeatureFlags = {
|
|
296
298
|
full_workspace_backup: undefined,
|
|
297
|
-
persistent_volume_claim: undefined,
|
|
298
|
-
protected_secrets: undefined,
|
|
299
299
|
workspace_class_limiting: undefined,
|
|
300
300
|
workspace_connection_limiting: undefined,
|
|
301
|
+
workspace_psi: undefined,
|
|
301
302
|
};
|
|
302
303
|
export type NamedWorkspaceFeatureFlag = keyof typeof WorkspaceFeatureFlags;
|
|
303
304
|
export namespace NamedWorkspaceFeatureFlag {
|
|
304
|
-
export const WORKSPACE_PERSISTED_FEATTURE_FLAGS: NamedWorkspaceFeatureFlag[] = [
|
|
305
|
-
"full_workspace_backup",
|
|
306
|
-
"persistent_volume_claim",
|
|
307
|
-
];
|
|
305
|
+
export const WORKSPACE_PERSISTED_FEATTURE_FLAGS: NamedWorkspaceFeatureFlag[] = ["full_workspace_backup"];
|
|
308
306
|
export function isWorkspacePersisted(ff: NamedWorkspaceFeatureFlag): boolean {
|
|
309
307
|
return WORKSPACE_PERSISTED_FEATTURE_FLAGS.includes(ff);
|
|
310
308
|
}
|
|
@@ -471,7 +469,7 @@ export interface UserSSHPublicKey extends SSHPublicKeyValue {
|
|
|
471
469
|
lastUsedTime?: string;
|
|
472
470
|
}
|
|
473
471
|
|
|
474
|
-
export type UserSSHPublicKeyValue = Omit<UserSSHPublicKey, "
|
|
472
|
+
export type UserSSHPublicKeyValue = Omit<UserSSHPublicKey, "userId">;
|
|
475
473
|
|
|
476
474
|
export namespace SSHPublicKeyValue {
|
|
477
475
|
export function validate(value: SSHPublicKeyValue): string | undefined {
|
|
@@ -639,6 +637,7 @@ export interface PendingGithubEvent {
|
|
|
639
637
|
creationDate: Date;
|
|
640
638
|
type: string;
|
|
641
639
|
event: string;
|
|
640
|
+
deleted: boolean;
|
|
642
641
|
}
|
|
643
642
|
|
|
644
643
|
export interface Snapshot {
|
|
@@ -647,26 +646,12 @@ export interface Snapshot {
|
|
|
647
646
|
availableTime?: string;
|
|
648
647
|
originalWorkspaceId: string;
|
|
649
648
|
bucketId: string;
|
|
650
|
-
layoutData?: string;
|
|
651
649
|
state: SnapshotState;
|
|
652
650
|
message?: string;
|
|
653
651
|
}
|
|
654
652
|
|
|
655
|
-
export interface VolumeSnapshot {
|
|
656
|
-
id: string;
|
|
657
|
-
workspaceId: string;
|
|
658
|
-
creationTime: string;
|
|
659
|
-
volumeHandle: string;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
653
|
export type SnapshotState = "pending" | "available" | "error";
|
|
663
654
|
|
|
664
|
-
export interface LayoutData {
|
|
665
|
-
workspaceId: string;
|
|
666
|
-
lastUpdatedTime: string;
|
|
667
|
-
layoutData: string;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
655
|
export interface Workspace {
|
|
671
656
|
id: string;
|
|
672
657
|
creationTime: string;
|
|
@@ -801,6 +786,10 @@ export interface JetBrainsConfig {
|
|
|
801
786
|
goland?: JetBrainsProductConfig;
|
|
802
787
|
pycharm?: JetBrainsProductConfig;
|
|
803
788
|
phpstorm?: JetBrainsProductConfig;
|
|
789
|
+
rubymine?: JetBrainsProductConfig;
|
|
790
|
+
webstorm?: JetBrainsProductConfig;
|
|
791
|
+
rider?: JetBrainsProductConfig;
|
|
792
|
+
clion?: JetBrainsProductConfig;
|
|
804
793
|
}
|
|
805
794
|
export interface JetBrainsProductConfig {
|
|
806
795
|
prebuilds?: JetBrainsPrebuilds;
|
|
@@ -1115,14 +1104,17 @@ export namespace SnapshotContext {
|
|
|
1115
1104
|
}
|
|
1116
1105
|
}
|
|
1117
1106
|
|
|
1118
|
-
export interface
|
|
1119
|
-
actual: WorkspaceContext;
|
|
1107
|
+
export interface WithCommitHistory {
|
|
1120
1108
|
commitHistory?: string[];
|
|
1121
1109
|
additionalRepositoryCommitHistories?: {
|
|
1122
1110
|
cloneUrl: string;
|
|
1123
1111
|
commitHistory: string[];
|
|
1124
1112
|
}[];
|
|
1125
|
-
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export interface StartPrebuildContext extends WorkspaceContext, WithCommitHistory {
|
|
1116
|
+
actual: WorkspaceContext;
|
|
1117
|
+
project: Project;
|
|
1126
1118
|
branch?: string;
|
|
1127
1119
|
}
|
|
1128
1120
|
|
|
@@ -1204,6 +1196,16 @@ export namespace AdditionalContentContext {
|
|
|
1204
1196
|
}
|
|
1205
1197
|
}
|
|
1206
1198
|
|
|
1199
|
+
export interface OpenPrebuildContext extends WorkspaceContext {
|
|
1200
|
+
openPrebuildID: string;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export namespace OpenPrebuildContext {
|
|
1204
|
+
export function is(ctx: any): ctx is OpenPrebuildContext {
|
|
1205
|
+
return "openPrebuildID" in ctx;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1207
1209
|
export interface CommitContext extends WorkspaceContext, GitCheckoutInfo {
|
|
1208
1210
|
/** @deprecated Moved to .repository.cloneUrl, left here for backwards-compatibility for old workspace contextes in the DB */
|
|
1209
1211
|
cloneUrl?: string;
|
|
@@ -1367,17 +1369,6 @@ export interface WorkspaceCreationResult {
|
|
|
1367
1369
|
}
|
|
1368
1370
|
export type RunningWorkspacePrebuildStarting = "queued" | "starting" | "running";
|
|
1369
1371
|
|
|
1370
|
-
export enum CreateWorkspaceMode {
|
|
1371
|
-
// Default returns a running prebuild if there is any, otherwise creates a new workspace (using a prebuild if one is available)
|
|
1372
|
-
Default = "default",
|
|
1373
|
-
// 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.
|
|
1374
|
-
ForceNew = "force-new",
|
|
1375
|
-
// UsePrebuild polls the database waiting for a currently running prebuild to become available. This mode exists to handle the db-sync delay.
|
|
1376
|
-
UsePrebuild = "use-prebuild",
|
|
1377
|
-
// SelectIfRunning returns a list of currently running workspaces for the context URL if there are any, otherwise falls back to Default mode
|
|
1378
|
-
SelectIfRunning = "select-if-running",
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
1372
|
export namespace WorkspaceCreationResult {
|
|
1382
1373
|
export function is(data: any): data is WorkspaceCreationResult {
|
|
1383
1374
|
return (
|
|
@@ -1515,13 +1506,3 @@ export interface StripeConfig {
|
|
|
1515
1506
|
individualUsagePriceIds: { [currency: string]: string };
|
|
1516
1507
|
teamUsagePriceIds: { [currency: string]: string };
|
|
1517
1508
|
}
|
|
1518
|
-
|
|
1519
|
-
export type BillingStrategy = "other" | "stripe";
|
|
1520
|
-
export interface CostCenter {
|
|
1521
|
-
readonly id: AttributionId;
|
|
1522
|
-
/**
|
|
1523
|
-
* Unit: credits
|
|
1524
|
-
*/
|
|
1525
|
-
spendingLimit: number;
|
|
1526
|
-
billingStrategy: BillingStrategy;
|
|
1527
|
-
}
|
package/src/snapshot-url.spec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { suite, test } from "mocha-typescript";
|
package/src/snapshot-url.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export interface SnapshotUrl {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { v4 as uuidv4 } from "uuid";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { PrebuiltWorkspaceState } from "./protocol";
|
|
7
|
+
import { PrebuiltWorkspaceState, WorkspaceClasses } from "./protocol";
|
|
8
8
|
import { v4 as uuidv4 } from "uuid";
|
|
9
9
|
import { DeepPartial } from "./util/deep-partial";
|
|
10
10
|
import { WebhookEvent } from "./webhook-event";
|
|
@@ -15,8 +15,13 @@ export interface ProjectConfig {
|
|
|
15
15
|
|
|
16
16
|
export interface ProjectSettings {
|
|
17
17
|
useIncrementalPrebuilds?: boolean;
|
|
18
|
-
usePersistentVolumeClaim?: boolean;
|
|
19
18
|
keepOutdatedPrebuildsRunning?: boolean;
|
|
19
|
+
// whether new workspaces can start on older prebuilds and incrementally update
|
|
20
|
+
allowUsingPreviousPrebuilds?: boolean;
|
|
21
|
+
// how many commits in the commit history a prebuild is good (undefined and 0 means every commit is prebuilt)
|
|
22
|
+
prebuildEveryNthCommit?: number;
|
|
23
|
+
// preferred workspace classes
|
|
24
|
+
workspaceClasses?: WorkspaceClasses;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export interface Project {
|
|
@@ -45,6 +50,7 @@ export namespace Project {
|
|
|
45
50
|
|
|
46
51
|
export interface Overview {
|
|
47
52
|
branches: BranchDetails[];
|
|
53
|
+
isConsideredInactive?: boolean;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
export namespace Overview {
|
|
@@ -119,7 +125,6 @@ export interface StartPrebuildResult {
|
|
|
119
125
|
wsid: string;
|
|
120
126
|
done: boolean;
|
|
121
127
|
}
|
|
122
|
-
|
|
123
128
|
export interface Team {
|
|
124
129
|
id: string;
|
|
125
130
|
name: string;
|
|
@@ -132,6 +137,12 @@ export interface Team {
|
|
|
132
137
|
|
|
133
138
|
export type TeamMemberRole = "owner" | "member";
|
|
134
139
|
|
|
140
|
+
export namespace TeamMemberRole {
|
|
141
|
+
export function isValid(role: any): role is TeamMemberRole {
|
|
142
|
+
return role === "owner" || role === "member";
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
135
146
|
export interface TeamMemberInfo {
|
|
136
147
|
userId: string;
|
|
137
148
|
fullName?: string;
|
package/src/typings/globals.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
interface Window {
|
|
8
|
+
// gitpod is used by supervisor/frontend and vscode browser https://github.com/gitpod-io/openvscode-server/blob/dadd40deda5959c0efdaa0c7d02ab64b6f8b5ad0/src/vs/gitpod/browser/workbench/workbench.ts#L7
|
|
8
9
|
gitpod: {
|
|
9
10
|
service: import("../gitpod-service").GitpodService;
|
|
10
11
|
ideService?: import("../ide-frontend-service").IDEFrontendService;
|
|
12
|
+
loggedUserID?: string;
|
|
11
13
|
};
|
|
12
14
|
}
|
package/src/usage.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { WorkspaceType } from "./protocol";
|
|
@@ -69,3 +69,17 @@ export interface InvoiceUsageData {
|
|
|
69
69
|
startDate: string;
|
|
70
70
|
endDate: string;
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
export interface CostCenterJSON {
|
|
74
|
+
attributionId: string;
|
|
75
|
+
spendingLimit: number;
|
|
76
|
+
billingStrategy: CostCenter_BillingStrategy;
|
|
77
|
+
nextBillingTime?: string;
|
|
78
|
+
billingCycleStart?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export enum CostCenter_BillingStrategy {
|
|
82
|
+
BILLING_STRATEGY_STRIPE = "BILLING_STRATEGY_STRIPE",
|
|
83
|
+
BILLING_STRATEGY_OTHER = "BILLING_STRATEGY_OTHER",
|
|
84
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
85
|
+
}
|
package/src/util/analytics.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import Analytics = require("analytics-node");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
// Use asyncIterators with es2015
|
package/src/util/cancelable.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Disposable } from "./disposable";
|
package/src/util/date-time.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export function formatDate(date?: string) {
|
package/src/util/debug-app.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as http from "http";
|
package/src/util/deep-partial.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
package/src/util/deferred.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export class Deferred<T> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { repeat } from "./repeat";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { suite, test } from "mocha-typescript";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import randomNumber = require("random-number-csprng");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
import * as cookie from "cookie";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as chai from "chai";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const URL = require("url").URL || window.URL;
|
|
@@ -16,10 +16,10 @@ const baseWorkspaceIDRegex =
|
|
|
16
16
|
"(([a-f][0-9a-f]{7}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|([0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}))";
|
|
17
17
|
|
|
18
18
|
// this pattern matches v4 UUIDs as well as the new generated workspace ids (e.g. pink-panda-ns35kd21)
|
|
19
|
-
const workspaceIDRegex = RegExp(
|
|
19
|
+
const workspaceIDRegex = RegExp(`^(?:debug-)?${baseWorkspaceIDRegex}$`);
|
|
20
20
|
|
|
21
21
|
// this pattern matches URL prefixes of workspaces
|
|
22
|
-
const workspaceUrlPrefixRegex = RegExp(`^([0-9]{4,6}-)?${baseWorkspaceIDRegex}\\.`);
|
|
22
|
+
const workspaceUrlPrefixRegex = RegExp(`^(([0-9]{4,6}|debug)-)?${baseWorkspaceIDRegex}\\.`);
|
|
23
23
|
|
|
24
24
|
export class GitpodHostUrl {
|
|
25
25
|
readonly url: URL;
|
|
@@ -77,8 +77,15 @@ export class GitpodHostUrl {
|
|
|
77
77
|
return updated.with((url) => ({ pathname: `/api${url.pathname}` }));
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
withContext(
|
|
81
|
-
|
|
80
|
+
withContext(
|
|
81
|
+
contextUrl: string,
|
|
82
|
+
startOptions?: { showOptions?: boolean; editor?: string; workspaceClass?: string },
|
|
83
|
+
) {
|
|
84
|
+
const searchParams = new URLSearchParams();
|
|
85
|
+
if (startOptions?.showOptions) {
|
|
86
|
+
searchParams.append("showOptions", "true");
|
|
87
|
+
}
|
|
88
|
+
return this.with((url) => ({ hash: contextUrl, search: searchParams.toString() }));
|
|
82
89
|
}
|
|
83
90
|
|
|
84
91
|
asWebsocket(): GitpodHostUrl {
|
|
@@ -93,6 +100,10 @@ export class GitpodHostUrl {
|
|
|
93
100
|
return this.with((url) => ({ pathname: "/" }));
|
|
94
101
|
}
|
|
95
102
|
|
|
103
|
+
asBilling(): GitpodHostUrl {
|
|
104
|
+
return this.with((url) => ({ pathname: "/billing" }));
|
|
105
|
+
}
|
|
106
|
+
|
|
96
107
|
asLogin(): GitpodHostUrl {
|
|
97
108
|
return this.with((url) => ({ pathname: "/login" }));
|
|
98
109
|
}
|
|
@@ -120,10 +131,9 @@ export class GitpodHostUrl {
|
|
|
120
131
|
});
|
|
121
132
|
}
|
|
122
133
|
|
|
123
|
-
asWorkspaceAuth(instanceID: string
|
|
134
|
+
asWorkspaceAuth(instanceID: string): GitpodHostUrl {
|
|
124
135
|
return this.with((url) => ({
|
|
125
136
|
pathname: `/api/auth/workspace-cookie/${instanceID}`,
|
|
126
|
-
search: redirect ? "redirect" : "",
|
|
127
137
|
}));
|
|
128
138
|
}
|
|
129
139
|
|
|
@@ -139,6 +149,10 @@ export class GitpodHostUrl {
|
|
|
139
149
|
return result;
|
|
140
150
|
}
|
|
141
151
|
|
|
152
|
+
get debugWorkspace(): boolean {
|
|
153
|
+
return this.url.host.match(workspaceUrlPrefixRegex)?.[2] === "debug";
|
|
154
|
+
}
|
|
155
|
+
|
|
142
156
|
get workspaceId(): string | undefined {
|
|
143
157
|
const hostSegs = this.url.host.split(".");
|
|
144
158
|
if (hostSegs.length > 1) {
|
|
@@ -146,7 +160,7 @@ export class GitpodHostUrl {
|
|
|
146
160
|
if (matchResults) {
|
|
147
161
|
// URL has a workspace prefix
|
|
148
162
|
// port prefixes are excluded
|
|
149
|
-
return matchResults[
|
|
163
|
+
return matchResults[1];
|
|
150
164
|
}
|
|
151
165
|
}
|
|
152
166
|
|
|
@@ -155,6 +169,11 @@ export class GitpodHostUrl {
|
|
|
155
169
|
return pathSegs[2];
|
|
156
170
|
}
|
|
157
171
|
|
|
172
|
+
const cleanHash = this.url.hash.replace(/^#/, "");
|
|
173
|
+
if (this.url.pathname == "/start/" && cleanHash.match(workspaceIDRegex)) {
|
|
174
|
+
return cleanHash;
|
|
175
|
+
}
|
|
176
|
+
|
|
158
177
|
return undefined;
|
|
159
178
|
}
|
|
160
179
|
|
package/src/util/grpc.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as grpc from "@grpc/grpc-js";
|
|
@@ -36,6 +36,9 @@ export interface IClientCallMetrics {
|
|
|
36
36
|
sent(labels: IGrpcCallMetricsLabels): void;
|
|
37
37
|
received(labels: IGrpcCallMetricsLabels): void;
|
|
38
38
|
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
39
|
+
startHandleTimer(
|
|
40
|
+
labels: IGrpcCallMetricsLabels,
|
|
41
|
+
): (labels?: Partial<Record<string, string | number>> | undefined) => number;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
export function getGrpcMethodType(requestStream: boolean, responseStream: boolean): GrpcMethodType {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { opentracing } from "jaeger-client";
|
package/src/util/logging.spec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { suite, test } from "mocha-typescript";
|
package/src/util/logging.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const inspect: (object: any) => string = require("util").inspect; // undefined in frontend
|
package/src/util/make-link.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
function isOpenNewTab(event: MouseEvent): boolean {
|