Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 78fad1b

Browse files
committed
rename jwt to apiKey
1 parent 12a6c4c commit 78fad1b

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

.trunk/trunk.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ runtimes:
1818
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
1919
lint:
2020
enabled:
21-
- trivy@0.59.1
21+
- trivy@0.60.0
2222
23-
24-
- eslint@9.19.0
23+
24+
- eslint@9.22.0
2525
- git-diff-check
2626
27-
- osv-scanner@1.9.2
28-
- prettier@3.4.2
29-
- renovate@39.161.0
27+
- osv-scanner@2.0.0
28+
- prettier@3.5.3
29+
- renovate@39.207.2
3030
3131
32-
33-
- yamllint@1.35.1
32+
33+
- yamllint@1.36.2
3434
actions:
3535
enabled:
3636
- trunk-announce

src/commands/link/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default class LinkIndex extends Command {
150150

151151
const settings = await readSettingsJson(settingsFilePath);
152152

153-
if (!settings.email || !settings.jwt || !settings.orgId) {
153+
if (!settings.email || !settings.apiKey || !settings.orgId) {
154154
this.log(chalk.red("Not logged in.") + " Log in with `hyp login`.");
155155
return;
156156
}
@@ -169,15 +169,15 @@ export default class LinkIndex extends Command {
169169
}
170170

171171
// call hypermode getRepoId with the installationId and the git url, if it returns a repoId, continue, if not, throw an error
172-
const repoId = await sendGetRepoIdReq(settings.jwt, installationId, remoteUrl);
172+
const repoId = await sendGetRepoIdReq(settings.apiKey, installationId, remoteUrl);
173173

174174
if (!repoId) {
175175
throw new Error("No repoId found for the given installationId and gitUrl");
176176
}
177177

178178
// get list of the projects for the user in this org, if any have no repoId, ask if they want to link it, or give option of none.
179179
// If they pick an option, connect repo. If none, ask if they want to create a new project, prompt for name, and connect repoId to project
180-
const projects = await getProjectsByOrgReq(settings.jwt, settings.orgId);
180+
const projects = await getProjectsByOrgReq(settings.apiKey, settings.orgId);
181181

182182
const projectsNoRepoId = projects.filter((project) => !project.repoId);
183183

@@ -188,18 +188,18 @@ export default class LinkIndex extends Command {
188188

189189
if (confirmExistingProject) {
190190
selectedProject = await promptProjectLinkSelection(projectsNoRepoId);
191-
const completedProject = await sendMapRepoAndFinishProjectCreationReq(settings.jwt, selectedProject.id, repoId, repoFullName);
191+
const completedProject = await sendMapRepoAndFinishProjectCreationReq(settings.apiKey, selectedProject.id, repoId, repoFullName);
192192

193193
this.log(chalk.green("Successfully linked project " + completedProject.name + " to repo " + repoName + "! 🎉"));
194194
} else {
195195
const projectName = await promptProjectName(projects);
196-
const newProject = await sendCreateProjectReq(settings.jwt, settings.orgId, projectName, repoId, repoFullName);
196+
const newProject = await sendCreateProjectReq(settings.apiKey, settings.orgId, projectName, repoId, repoFullName);
197197

198198
this.log(chalk.green("Successfully created project " + newProject.name + " and linked it to repo " + repoName + "! 🎉"));
199199
}
200200
} else {
201201
const projectName = await promptProjectName(projects);
202-
const newProject = await sendCreateProjectReq(settings.jwt, settings.orgId, projectName, repoId, repoFullName);
202+
const newProject = await sendCreateProjectReq(settings.apiKey, settings.orgId, projectName, repoId, repoFullName);
203203

204204
this.log(chalk.blueBright("Successfully created project " + newProject.name + " and linked it to repo " + repoFullName + "! Setting up CI workflow..."));
205205
}

src/commands/logout/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class LogoutIndex extends Command {
3838

3939
const newSettingsContent = {
4040
HYP_EMAIL: null,
41-
HYP_JWT: null,
41+
HYP_API_KEY: null,
4242
HYP_ORG_ID: null,
4343
INSTALLATION_IDS: res.installationIds,
4444
};

src/commands/org/switch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export default class OrgSwitch extends Command {
2727

2828
const res = await readSettingsJson(settingsFilePath);
2929

30-
if (!res.email || !res.jwt || !res.orgId) {
30+
if (!res.email || !res.apiKey || !res.orgId) {
3131
this.log(chalk.red("Not logged in.") + " Log in with `hyp login`.");
3232
return;
3333
}
3434

35-
const orgs = await sendGetOrgsReq(res.jwt);
35+
const orgs = await sendGetOrgsReq(res.apiKey);
3636
const selectedOrg = await promptOrgSelection(orgs);
3737

38-
await writeToSettingsFile(res.jwt, res.email, selectedOrg.id);
38+
await writeToSettingsFile(res.apiKey, res.email, selectedOrg.id);
3939
}
4040
}

src/util/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,18 @@ export async function getGitRemoteUrl(filePath: string): Promise<string | null>
132132
return remoteMatch[1];
133133
}
134134

135-
export async function readSettingsJson(filePath: string): Promise<{ content: string; email: null | string; installationIds: { [key: string]: string } | null; jwt: null | string; orgId: null | string }> {
135+
export async function readSettingsJson(filePath: string): Promise<{ content: string; email: null | string; installationIds: { [key: string]: string } | null; apiKey: null | string; orgId: null | string }> {
136136
const content = await fs.readFile(filePath, "utf8");
137137

138138
let email: null | string = null;
139-
let jwt: null | string = null;
139+
let apiKey: null | string = null;
140140
let orgId: null | string = null;
141141
let installationIds: { [key: string]: string } | null = null;
142142

143143
try {
144144
const jsonContent = JSON.parse(content);
145145
email = jsonContent.HYP_EMAIL || null;
146-
jwt = jsonContent.HYP_JWT || null;
146+
apiKey = jsonContent.HYP_API_KEY || null;
147147
orgId = jsonContent.HYP_ORG_ID || null;
148148
installationIds = jsonContent.INSTALLATION_IDS || null;
149149
} catch {
@@ -154,7 +154,7 @@ export async function readSettingsJson(filePath: string): Promise<{ content: str
154154
content,
155155
email,
156156
installationIds,
157-
jwt,
157+
apiKey,
158158
orgId,
159159
};
160160
}

0 commit comments

Comments
 (0)