@gitpod/gitpod-protocol 0.1.5-wv-add-image-builds-to-dashboard.0 → 0.1.5-wv-remove-without-ws-flag.5

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 (38) hide show
  1. package/lib/billing-mode.js +2 -2
  2. package/lib/billing-mode.js.map +1 -1
  3. package/lib/frontend-dashboard-service.d.ts +90 -0
  4. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  5. package/lib/frontend-dashboard-service.js +49 -0
  6. package/lib/frontend-dashboard-service.js.map +1 -0
  7. package/lib/gitpod-service.d.ts +9 -9
  8. package/lib/gitpod-service.d.ts.map +1 -1
  9. package/lib/gitpod-service.js +19 -11
  10. package/lib/gitpod-service.js.map +1 -1
  11. package/lib/permission.d.ts +4 -1
  12. package/lib/permission.d.ts.map +1 -1
  13. package/lib/permission.js +3 -0
  14. package/lib/permission.js.map +1 -1
  15. package/lib/protocol.d.ts +1 -0
  16. package/lib/protocol.d.ts.map +1 -1
  17. package/lib/protocol.js.map +1 -1
  18. package/lib/teams-projects-protocol.d.ts +3 -0
  19. package/lib/teams-projects-protocol.d.ts.map +1 -1
  20. package/lib/teams-projects-protocol.js +8 -1
  21. package/lib/teams-projects-protocol.js.map +1 -1
  22. package/lib/typings/globals.d.ts +1 -1
  23. package/lib/typings/globals.d.ts.map +1 -1
  24. package/lib/util/gitpod-host-url.d.ts +6 -2
  25. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  26. package/lib/util/gitpod-host-url.js +11 -4
  27. package/lib/util/gitpod-host-url.js.map +1 -1
  28. package/package.json +1 -1
  29. package/pkg-yarn.lock +1 -1
  30. package/provenance-bundle.jsonl +1 -1
  31. package/src/billing-mode.ts +2 -2
  32. package/src/frontend-dashboard-service.ts +125 -0
  33. package/src/gitpod-service.ts +20 -14
  34. package/src/permission.ts +4 -0
  35. package/src/protocol.ts +3 -0
  36. package/src/teams-projects-protocol.ts +6 -0
  37. package/src/typings/globals.ts +2 -1
  38. package/src/util/gitpod-host-url.ts +15 -4
@@ -5,8 +5,9 @@
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
- service: import("../gitpod-service").GitpodService;
10
10
  ideService?: import("../ide-frontend-service").IDEFrontendService;
11
+ loggedUserID?: string;
11
12
  };
12
13
  }
@@ -77,8 +77,15 @@ export class GitpodHostUrl {
77
77
  return updated.with((url) => ({ pathname: `/api${url.pathname}` }));
78
78
  }
79
79
 
80
- withContext(contextUrl: string) {
81
- return this.with((url) => ({ hash: contextUrl }));
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 {
@@ -124,10 +131,9 @@ export class GitpodHostUrl {
124
131
  });
125
132
  }
126
133
 
127
- asWorkspaceAuth(instanceID: string, redirect?: boolean): GitpodHostUrl {
134
+ asWorkspaceAuth(instanceID: string): GitpodHostUrl {
128
135
  return this.with((url) => ({
129
136
  pathname: `/api/auth/workspace-cookie/${instanceID}`,
130
- search: redirect ? "redirect" : "",
131
137
  }));
132
138
  }
133
139
 
@@ -163,6 +169,11 @@ export class GitpodHostUrl {
163
169
  return pathSegs[2];
164
170
  }
165
171
 
172
+ const cleanHash = this.url.hash.replace(/^#/, "");
173
+ if (this.url.pathname == "/start/" && cleanHash.match(workspaceIDRegex)) {
174
+ return cleanHash;
175
+ }
176
+
166
177
  return undefined;
167
178
  }
168
179