@gitpod/gitpod-protocol 0.1.5-mp-content-service-gen.0 → 0.1.5-mp-server-errors.4

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.
Files changed (41) hide show
  1. package/lib/accounting-protocol.d.ts +2 -0
  2. package/lib/accounting-protocol.d.ts.map +1 -1
  3. package/lib/accounting-protocol.js +9 -0
  4. package/lib/accounting-protocol.js.map +1 -1
  5. package/lib/attribution.d.ts +1 -0
  6. package/lib/attribution.d.ts.map +1 -1
  7. package/lib/attribution.js +4 -0
  8. package/lib/attribution.js.map +1 -1
  9. package/lib/frontend-dashboard-service.d.ts +13 -4
  10. package/lib/frontend-dashboard-service.d.ts.map +1 -1
  11. package/lib/frontend-dashboard-service.js +6 -0
  12. package/lib/frontend-dashboard-service.js.map +1 -1
  13. package/lib/gitpod-service.d.ts +17 -2
  14. package/lib/gitpod-service.d.ts.map +1 -1
  15. package/lib/gitpod-service.js +8 -1
  16. package/lib/gitpod-service.js.map +1 -1
  17. package/lib/messaging/error.d.ts +1 -0
  18. package/lib/messaging/error.d.ts.map +1 -1
  19. package/lib/messaging/error.js +4 -0
  20. package/lib/messaging/error.js.map +1 -1
  21. package/lib/plans.d.ts +3 -1
  22. package/lib/plans.d.ts.map +1 -1
  23. package/lib/plans.js +16 -0
  24. package/lib/plans.js.map +1 -1
  25. package/lib/protocol.d.ts +19 -0
  26. package/lib/protocol.d.ts.map +1 -1
  27. package/lib/protocol.js +29 -2
  28. package/lib/protocol.js.map +1 -1
  29. package/lib/typings/globals.d.ts +3 -0
  30. package/lib/typings/globals.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/pkg-yarn.lock +1 -1
  33. package/provenance-bundle.jsonl +1 -1
  34. package/src/accounting-protocol.ts +9 -0
  35. package/src/attribution.ts +4 -0
  36. package/src/frontend-dashboard-service.ts +27 -4
  37. package/src/gitpod-service.ts +22 -1
  38. package/src/messaging/error.ts +4 -0
  39. package/src/plans.ts +16 -0
  40. package/src/protocol.ts +55 -1
  41. package/src/typings/globals.ts +4 -0
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;
@@ -152,12 +153,21 @@ export namespace User {
152
153
  user.additionalData.ideSettings = newIDESettings;
153
154
  }
154
155
 
156
+ // TODO: make it more explicit that these field names are relied for our tracking purposes
157
+ // and decouple frontend from relying on them - instead use user.additionalData.profile object directly in FE
155
158
  export function getProfile(user: User): Profile {
156
159
  return {
157
160
  name: User.getName(user!) || "",
158
161
  email: User.getPrimaryEmail(user!) || "",
159
162
  company: user?.additionalData?.profile?.companyName,
160
163
  avatarURL: user?.avatarUrl,
164
+ companyWebsite: user?.additionalData?.profile?.companyWebsite,
165
+ jobRole: user?.additionalData?.profile?.jobRole,
166
+ jobRoleOther: user?.additionalData?.profile?.jobRoleOther,
167
+ explorationReasons: user?.additionalData?.profile?.explorationReasons,
168
+ signupGoals: user?.additionalData?.profile?.signupGoals,
169
+ signupGoalsOther: user?.additionalData?.profile?.signupGoalsOther,
170
+ onboardedTimestamp: user?.additionalData?.profile?.onboardedTimestamp,
161
171
  };
162
172
  }
163
173
 
@@ -178,12 +188,32 @@ export namespace User {
178
188
  return user;
179
189
  }
180
190
 
191
+ export function getDefaultAttributionId(user: User): AttributionId {
192
+ if (user.usageAttributionId) {
193
+ const result = AttributionId.parse(user.usageAttributionId);
194
+ if (!result) {
195
+ throw new Error("Invalid attribution ID: " + user.usageAttributionId);
196
+ }
197
+ return result;
198
+ }
199
+ return AttributionId.create(user);
200
+ }
201
+
202
+ // TODO: refactor where this is referenced so it's more clearly tied to just analytics-tracking
203
+ // Let other places rely on the ProfileDetails type since that's what we store
181
204
  // The actual Profile of a User
182
205
  export interface Profile {
183
206
  name: string;
184
207
  email: string;
185
208
  company?: string;
186
209
  avatarURL?: string;
210
+ companyWebsite?: string;
211
+ jobRole?: string;
212
+ jobRoleOther?: string;
213
+ explorationReasons?: string[];
214
+ signupGoals?: string[];
215
+ signupGoalsOther?: string;
216
+ onboardedTimestamp?: string;
187
217
  }
188
218
  export namespace Profile {
189
219
  export function hasChanges(before: Profile, after: Profile) {
@@ -191,7 +221,13 @@ export namespace User {
191
221
  before.name !== after.name ||
192
222
  before.email !== after.email ||
193
223
  before.company !== after.company ||
194
- before.avatarURL !== after.avatarURL
224
+ before.avatarURL !== after.avatarURL ||
225
+ before.companyWebsite !== after.companyWebsite ||
226
+ before.jobRole !== after.jobRole ||
227
+ before.jobRoleOther !== after.jobRoleOther ||
228
+ // not checking explorationReasons or signupGoals atm as it's an array - need to check deep equality
229
+ before.signupGoalsOther !== after.signupGoalsOther ||
230
+ before.onboardedTimestamp !== after.onboardedTimestamp
195
231
  );
196
232
  }
197
233
  }
@@ -242,6 +278,20 @@ export interface ProfileDetails {
242
278
  companyName?: string;
243
279
  // the user's email
244
280
  emailAddress?: string;
281
+ // the user's company website
282
+ companyWebsite?: string;
283
+ // type of role user has in their job
284
+ jobRole?: string;
285
+ // freeform entry for job role user works in (when jobRole is "other")
286
+ jobRoleOther?: string;
287
+ // Reasons user is exploring Gitpod when they signed up
288
+ explorationReasons?: string[];
289
+ // what user hopes to accomplish when they signed up
290
+ signupGoals?: string[];
291
+ // freeform entry for signup goals (when signupGoals is "other")
292
+ signupGoalsOther?: string;
293
+ // Set after a user completes the onboarding flow
294
+ onboardedTimestamp?: string;
245
295
  }
246
296
 
247
297
  export interface EmailNotificationSettings {
@@ -311,6 +361,8 @@ export namespace NamedWorkspaceFeatureFlag {
311
361
  }
312
362
  }
313
363
 
364
+ export type EnvVar = UserEnvVar | ProjectEnvVarWithValue | EnvVarWithValue;
365
+
314
366
  export interface EnvVarWithValue {
315
367
  name: string;
316
368
  value: string;
@@ -830,6 +882,7 @@ export interface WorkspaceConfig {
830
882
  vscode?: VSCodeConfig;
831
883
  jetbrains?: JetBrainsConfig;
832
884
  coreDump?: CoreDumpConfig;
885
+ ideCredentials?: string;
833
886
 
834
887
  /** deprecated. Enabled by default **/
835
888
  experimentalNetwork?: boolean;
@@ -1404,6 +1457,7 @@ export interface AuthProviderInfo {
1404
1457
  readonly authProviderType: string;
1405
1458
  readonly host: string;
1406
1459
  readonly ownerId?: string;
1460
+ readonly organizationId?: string;
1407
1461
  readonly verified: boolean;
1408
1462
  readonly isReadonly?: boolean;
1409
1463
  readonly hiddenOnDashboard?: boolean;
@@ -11,5 +11,9 @@ interface Window {
11
11
  loggedUserID?: string;
12
12
 
13
13
  openDesktopIDE(url: string): void;
14
+
15
+ encrypt(content: string): string;
16
+ decrypt(content: string): string;
17
+ isEncryptedData(content: string): boolean;
14
18
  };
15
19
  }