@gitpod/gitpod-protocol 0.1.5-pd-timeout-16089.2 → 0.1.5-pd-port-15915.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import { v4 as uuidv4 } from "uuid";
8
+ import { Plans } from "./plans";
8
9
  import { User } from "./protocol";
9
10
  import { oneMonthLater } from "./util/timeutil";
10
11
 
@@ -213,6 +214,14 @@ export namespace Subscription {
213
214
  } while (nextStartDate < now.toISOString());
214
215
  return { startDate, endDate: nextStartDate };
215
216
  }
217
+
218
+ export function isOldTeamSubscription(s: Subscription): boolean {
219
+ return Plans.isTeamPlan(s.planId) && !s.teamMembershipId;
220
+ }
221
+
222
+ export function isTeamSubscription2(s: Subscription): boolean {
223
+ return Plans.isTeamPlan(s.planId) && !!s.teamMembershipId;
224
+ }
216
225
  }
217
226
 
218
227
  export type MaybeSubscription = Subscription | undefined;
@@ -27,6 +27,7 @@ import {
27
27
  UserSSHPublicKeyValue,
28
28
  SSHPublicKeyValue,
29
29
  IDESettings,
30
+ EnvVarWithValue,
30
31
  } from "./protocol";
31
32
  import {
32
33
  Team,
@@ -153,6 +154,9 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
153
154
  getUserStorageResource(options: GitpodServer.GetUserStorageResourceOptions): Promise<string>;
154
155
  updateUserStorageResource(options: GitpodServer.UpdateUserStorageResourceOptions): Promise<void>;
155
156
 
157
+ // Workspace env vars
158
+ getWorkspaceEnvVars(workspaceId: string): Promise<EnvVarWithValue[]>;
159
+
156
160
  // User env vars
157
161
  getEnvVars(): Promise<UserEnvVarValue[]>;
158
162
  getAllEnvVars(): Promise<UserEnvVarValue[]>;
@@ -305,11 +309,25 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
305
309
  /**
306
310
  * Frontend notifications
307
311
  */
308
- getNotifications(): Promise<string[]>;
312
+ getNotifications(): Promise<AppNotification[]>;
309
313
 
310
314
  getSupportedWorkspaceClasses(): Promise<SupportedWorkspaceClass[]>;
311
315
  }
312
316
 
317
+ export interface AppNotification {
318
+ message: string;
319
+ action?: {
320
+ url: string;
321
+ label: string;
322
+ };
323
+ notClosable?: boolean;
324
+ }
325
+ export namespace AppNotification {
326
+ export function is(data: any): data is AppNotification {
327
+ return data && typeof data === "object" && data.hasOwnProperty("message");
328
+ }
329
+ }
330
+
313
331
  export interface RateLimiterError {
314
332
  method?: string;
315
333
 
package/src/plans.ts CHANGED
@@ -490,6 +490,22 @@ export namespace Plans {
490
490
  return chargebeeId === Plans.FREE_OPEN_SOURCE.chargebeeId;
491
491
  }
492
492
 
493
+ export function isPersonalPlan(planId: string | undefined): boolean {
494
+ const plan = Plans.getById(planId);
495
+ if (!plan) {
496
+ return false;
497
+ }
498
+ return !plan.team;
499
+ }
500
+
501
+ export function isTeamPlan(planId: string | undefined): boolean {
502
+ const plan = Plans.getById(planId);
503
+ if (!plan) {
504
+ return false;
505
+ }
506
+ return !!plan.team;
507
+ }
508
+
493
509
  export function getHoursPerMonth(plan: Plan): number {
494
510
  return plan.hoursPerMonth == "unlimited" ? ABSOLUTE_MAX_USAGE : plan.hoursPerMonth;
495
511
  }
package/src/protocol.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
 
7
- import { WorkspaceInstance, PortVisibility } from "./workspace-instance";
7
+ import { WorkspaceInstance, PortVisibility, PortProtocol } from "./workspace-instance";
8
8
  import { RoleOrPermission } from "./permission";
9
9
  import { Project } from "./teams-projects-protocol";
10
10
  import { createHash } from "crypto";
@@ -230,9 +230,6 @@ export interface AdditionalUserData {
230
230
  // whether the user has been migrated to team attribution.
231
231
  // a corresponding feature flag (team_only_attribution) triggers the migration.
232
232
  isMigratedToTeamOnlyAttribution?: boolean;
233
- // user globol workspace timeout
234
- workspaceTimeout?: string;
235
- disabledClosedTimeout?: boolean;
236
233
  }
237
234
  export namespace AdditionalUserData {
238
235
  export function set(user: User, partialData: Partial<AdditionalUserData>): User {
@@ -257,6 +254,16 @@ export interface ProfileDetails {
257
254
  companyName?: string;
258
255
  // the user's email
259
256
  emailAddress?: string;
257
+ // the user's company website
258
+ companyWebsite?: string;
259
+ // type of role user has in their job
260
+ jobRole?: string;
261
+ // freeform entry for job role user works in (when jobRole is "other")
262
+ jobRoleOther?: string;
263
+ // what user hopes to accomplish when they signed up
264
+ signupGoals?: string;
265
+ // freeform entry for signup goals (when signupGoals is "other")
266
+ signupGoalsOther?: string;
260
267
  }
261
268
 
262
269
  export interface EmailNotificationSettings {
@@ -326,6 +333,8 @@ export namespace NamedWorkspaceFeatureFlag {
326
333
  }
327
334
  }
328
335
 
336
+ export type EnvVar = UserEnvVar | ProjectEnvVarWithValue | EnvVarWithValue;
337
+
329
338
  export interface EnvVarWithValue {
330
339
  name: string;
331
340
  value: string;
@@ -980,6 +989,7 @@ export interface PortConfig {
980
989
  port: number;
981
990
  onOpen?: PortOnOpen;
982
991
  visibility?: PortVisibility;
992
+ protocol?: PortProtocol;
983
993
  description?: string;
984
994
  name?: string;
985
995
  }
@@ -186,6 +186,9 @@ export type AdmissionLevel = "owner_only" | "everyone";
186
186
  // PortVisibility describes how a port can be accessed
187
187
  export type PortVisibility = "public" | "private";
188
188
 
189
+ // PortProtocol
190
+ export type PortProtocol = "http" | "https";
191
+
189
192
  // WorkspaceInstancePort describes a port exposed on a workspace instance
190
193
  export interface WorkspaceInstancePort {
191
194
  // The outward-facing port number
@@ -196,6 +199,8 @@ export interface WorkspaceInstancePort {
196
199
 
197
200
  // Public, outward-facing URL where the port can be accessed on.
198
201
  url?: string;
202
+
203
+ protocol?: PortProtocol;
199
204
  }
200
205
 
201
206
  // WorkspaceInstanceRepoStatus describes the status of th Git working copy of a workspace