@gitpod/gitpod-protocol 0.1.5-mp-workspace-region-type.7 → 0.1.5-mp-remove-slow-server-proxy.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/attribution.d.ts +1 -0
- package/lib/attribution.d.ts.map +1 -1
- package/lib/attribution.js +4 -0
- package/lib/attribution.js.map +1 -1
- package/lib/frontend-dashboard-service.d.ts +13 -4
- package/lib/frontend-dashboard-service.d.ts.map +1 -1
- package/lib/frontend-dashboard-service.js +6 -0
- package/lib/frontend-dashboard-service.js.map +1 -1
- package/lib/gitpod-service.d.ts +4 -0
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +8 -2
- package/lib/gitpod-service.js.map +1 -1
- package/lib/protocol.d.ts +3 -0
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +12 -0
- package/lib/protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +3 -0
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.d.ts +2 -0
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +6 -0
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +1 -1
- package/pkg-yarn.lock +1 -1
- package/provenance-bundle.jsonl +1 -1
- package/src/attribution.ts +4 -0
- package/src/frontend-dashboard-service.ts +27 -4
- package/src/gitpod-service.ts +15 -2
- package/src/protocol.ts +13 -0
- package/src/typings/globals.ts +4 -0
- package/src/util/gitpod-host-url.ts +8 -0
- package/src/wsready.ts +2 -2
package/src/gitpod-service.ts
CHANGED
|
@@ -117,6 +117,7 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
|
|
|
117
117
|
getWorkspace(id: string): Promise<WorkspaceInfo>;
|
|
118
118
|
isWorkspaceOwner(workspaceId: string): Promise<boolean>;
|
|
119
119
|
getOwnerToken(workspaceId: string): Promise<string>;
|
|
120
|
+
getIDECredentials(workspaceId: string): Promise<string>;
|
|
120
121
|
|
|
121
122
|
/**
|
|
122
123
|
* Creates and starts a workspace for the given context URL.
|
|
@@ -359,17 +360,26 @@ export interface ClientHeaderFields {
|
|
|
359
360
|
clientRegion?: string;
|
|
360
361
|
}
|
|
361
362
|
|
|
363
|
+
const WORKSPACE_MAXIMUM_TIMEOUT_HOURS = 24;
|
|
364
|
+
|
|
362
365
|
export type WorkspaceTimeoutDuration = string;
|
|
363
366
|
export namespace WorkspaceTimeoutDuration {
|
|
364
367
|
export function validate(duration: string): WorkspaceTimeoutDuration {
|
|
368
|
+
duration = duration.toLowerCase();
|
|
365
369
|
const unit = duration.slice(-1);
|
|
366
|
-
if (!["m", "h"
|
|
370
|
+
if (!["m", "h"].includes(unit)) {
|
|
367
371
|
throw new Error(`Invalid timeout unit: ${unit}`);
|
|
368
372
|
}
|
|
369
|
-
const value = parseInt(duration.slice(0, -1));
|
|
373
|
+
const value = parseInt(duration.slice(0, -1), 10);
|
|
370
374
|
if (isNaN(value) || value <= 0) {
|
|
371
375
|
throw new Error(`Invalid timeout value: ${duration}`);
|
|
372
376
|
}
|
|
377
|
+
if (
|
|
378
|
+
(unit === "h" && value > WORKSPACE_MAXIMUM_TIMEOUT_HOURS) ||
|
|
379
|
+
(unit === "m" && value > WORKSPACE_MAXIMUM_TIMEOUT_HOURS * 60)
|
|
380
|
+
) {
|
|
381
|
+
throw new Error("Workspace inactivity timeout cannot exceed 24h");
|
|
382
|
+
}
|
|
373
383
|
return duration;
|
|
374
384
|
}
|
|
375
385
|
}
|
|
@@ -403,11 +413,13 @@ export const createServerMock = function <C extends GitpodClient, S extends Gitp
|
|
|
403
413
|
|
|
404
414
|
export interface SetWorkspaceTimeoutResult {
|
|
405
415
|
resetTimeoutOnWorkspaces: string[];
|
|
416
|
+
humanReadableDuration: string;
|
|
406
417
|
}
|
|
407
418
|
|
|
408
419
|
export interface GetWorkspaceTimeoutResult {
|
|
409
420
|
duration: WorkspaceTimeoutDuration;
|
|
410
421
|
canChange: boolean;
|
|
422
|
+
humanReadableDuration: string;
|
|
411
423
|
}
|
|
412
424
|
|
|
413
425
|
export interface StartWorkspaceResult {
|
|
@@ -428,6 +440,7 @@ export namespace GitpodServer {
|
|
|
428
440
|
}
|
|
429
441
|
export interface CreateWorkspaceOptions extends StartWorkspaceOptions {
|
|
430
442
|
contextUrl: string;
|
|
443
|
+
organizationId?: string;
|
|
431
444
|
|
|
432
445
|
// whether running workspaces on the same context should be ignored. If false (default) users will be asked.
|
|
433
446
|
ignoreRunningWorkspaceOnSameCommit?: boolean;
|
package/src/protocol.ts
CHANGED
|
@@ -8,6 +8,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";
|
|
11
12
|
|
|
12
13
|
export interface UserInfo {
|
|
13
14
|
name?: string;
|
|
@@ -178,6 +179,17 @@ export namespace User {
|
|
|
178
179
|
return user;
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
export function getDefaultAttributionId(user: User): AttributionId {
|
|
183
|
+
if (user.usageAttributionId) {
|
|
184
|
+
const result = AttributionId.parse(user.usageAttributionId);
|
|
185
|
+
if (!result) {
|
|
186
|
+
throw new Error("Invalid attribution ID: " + user.usageAttributionId);
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
return AttributionId.create(user);
|
|
191
|
+
}
|
|
192
|
+
|
|
181
193
|
// The actual Profile of a User
|
|
182
194
|
export interface Profile {
|
|
183
195
|
name: string;
|
|
@@ -830,6 +842,7 @@ export interface WorkspaceConfig {
|
|
|
830
842
|
vscode?: VSCodeConfig;
|
|
831
843
|
jetbrains?: JetBrainsConfig;
|
|
832
844
|
coreDump?: CoreDumpConfig;
|
|
845
|
+
ideCredentials?: string;
|
|
833
846
|
|
|
834
847
|
/** deprecated. Enabled by default **/
|
|
835
848
|
experimentalNetwork?: boolean;
|
package/src/typings/globals.ts
CHANGED
|
@@ -100,6 +100,10 @@ export class GitpodHostUrl {
|
|
|
100
100
|
return this.with((url) => ({ pathname: "/" }));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
asBilling(): GitpodHostUrl {
|
|
104
|
+
return this.with((url) => ({ pathname: "/user/billing" }));
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
asLogin(): GitpodHostUrl {
|
|
104
108
|
return this.with((url) => ({ pathname: "/login" }));
|
|
105
109
|
}
|
|
@@ -108,6 +112,10 @@ export class GitpodHostUrl {
|
|
|
108
112
|
return this.with((url) => ({ pathname: "/integrations" }));
|
|
109
113
|
}
|
|
110
114
|
|
|
115
|
+
asSettings(): GitpodHostUrl {
|
|
116
|
+
return this.with((url) => ({ pathname: "/user/account" }));
|
|
117
|
+
}
|
|
118
|
+
|
|
111
119
|
asPreferences(): GitpodHostUrl {
|
|
112
120
|
return this.with((url) => ({ pathname: "/user/preferences" }));
|
|
113
121
|
}
|
package/src/wsready.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// generated using github.com/32leaves/bel on
|
|
7
|
+
// generated using github.com/32leaves/bel on 2023-02-14 09:41:16.808994006 +0000 UTC m=+0.008933200
|
|
8
8
|
// DO NOT MODIFY
|
|
9
9
|
|
|
10
10
|
export enum WorkspaceInitSource {
|