Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TS types #35

Merged
merged 3 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export default class NetsBloxApi {
* email address.
*/
async forgotUsername(email: string): Promise<void> {
return await this.post(`/users/forgot-username`, email);
const url = `/users/forgot-username`;
const opts = {method: 'post', body: JSON.stringify(email)};
await this.fetch(url, opts);
}

async login(loginData: LoginRequest): Promise<User> {
Expand Down
3 changes: 2 additions & 1 deletion src/types/AuthorizedServiceHost.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ServiceHostScope } from "./ServiceHostScope";

export interface AuthorizedServiceHost { url: string, id: string, public: boolean, }
export interface AuthorizedServiceHost { url: string, id: string, visibility: ServiceHostScope, }
3 changes: 1 addition & 2 deletions src/types/CreateProjectData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ClientId } from "./ClientId";
import type { RoleData } from "./RoleData";
import type { RoleId } from "./RoleId";
import type { SaveState } from "./SaveState";

export interface CreateProjectData { owner?: string, name: string, roles?: Array<RoleData>, clientId?: ClientId, saveState?: SaveState, roleDict?: Record<RoleId, RoleData>, }
export interface CreateProjectData { owner?: string, name: string, roles?: Array<RoleData>, clientId?: ClientId, saveState?: SaveState, }
2 changes: 1 addition & 1 deletion test/api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ describe("api", function () {
});

it("should authorize/list/unauthorize host", async function () {
const host = { url: "http://localhost", id: "TestHost", public: false };
const host = { url: "http://localhost", id: "TestHost", visibility: "private" };
const secret = await api.authorizedHost(host);
assert.equal(typeof secret, "string");

Expand Down
Loading