@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.
- package/lib/accounting-protocol.d.ts +2 -0
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +9 -0
- package/lib/accounting-protocol.js.map +1 -1
- 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 +17 -2
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +8 -1
- package/lib/gitpod-service.js.map +1 -1
- package/lib/messaging/error.d.ts +1 -0
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +4 -0
- package/lib/messaging/error.js.map +1 -1
- package/lib/plans.d.ts +3 -1
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +16 -0
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +19 -0
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +29 -2
- 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/package.json +1 -1
- package/pkg-yarn.lock +1 -1
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +9 -0
- package/src/attribution.ts +4 -0
- package/src/frontend-dashboard-service.ts +27 -4
- package/src/gitpod-service.ts +22 -1
- package/src/messaging/error.ts +4 -0
- package/src/plans.ts +16 -0
- package/src/protocol.ts +55 -1
- 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;
|