Skip to content

js: Replace api/ files by generated files with minor manual changes #1578

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

Merged
merged 1 commit into from
Dec 20, 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
45 changes: 34 additions & 11 deletions javascript/src/api/application.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// this file is @generated (with the exception of getOrCreate)
import {
Configuration,
ApplicationApi,
ApplicationIn,
ApplicationOut,
ApplicationPatch,
Configuration,
ListResponseApplicationOut,
Ordering,
} from "../openapi";
Expand All @@ -25,18 +26,26 @@ export class Application {
this.api = new ApplicationApi(config);
}

/// List of all the organization's applications.
public list(options?: ApplicationListOptions): Promise<ListResponseApplicationOut> {
const iterator = options?.iterator ?? undefined;
return this.api.v1ApplicationList({ ...options, iterator });
return this.api.v1ApplicationList({
...options,
iterator: options?.iterator ?? undefined,
});
}

/// Create a new application.
public create(
applicationIn: ApplicationIn,
options?: PostOptions
): Promise<ApplicationOut> {
return this.api.v1ApplicationCreate({ applicationIn, ...options });
return this.api.v1ApplicationCreate({
applicationIn,
...options,
});
}

/// Get the application with the UID from `applicationIn`, or create it if it doesn't exist yet.
public getOrCreate(
applicationIn: ApplicationIn,
options?: PostOptions
Expand All @@ -48,22 +57,36 @@ export class Application {
});
}

/// Get an application.
public get(appId: string): Promise<ApplicationOut> {
return this.api.v1ApplicationGet({ appId });
return this.api.v1ApplicationGet({
appId,
});
}

/// Update an application.
public update(appId: string, applicationIn: ApplicationIn): Promise<ApplicationOut> {
return this.api.v1ApplicationUpdate({ appId, applicationIn });
return this.api.v1ApplicationUpdate({
appId,
applicationIn,
});
}

/// Delete an application.
public delete(appId: string): Promise<void> {
return this.api.v1ApplicationDelete({
appId,
});
}

/// Partially update an application.
public patch(
appId: string,
applicationPatch: ApplicationPatch
): Promise<ApplicationOut> {
return this.api.v1ApplicationPatch({ appId, applicationPatch });
}

public delete(appId: string): Promise<void> {
return this.api.v1ApplicationDelete({ appId });
return this.api.v1ApplicationPatch({
appId,
applicationPatch,
});
}
}
27 changes: 24 additions & 3 deletions javascript/src/api/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// this file is @generated (with minor manual changes)
import {
Configuration,
AuthenticationApi,
DashboardAccessOut,
AppPortalAccessOut,
AppPortalAccessIn,
AppPortalAccessOut,
ApplicationTokenExpireIn,
DashboardAccessOut,
} from "../openapi";
import { PostOptions } from "../util";

Expand All @@ -14,6 +16,7 @@ export class Authentication {
this.api = new AuthenticationApi(config);
}

/// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
public appPortalAccess(
appId: string,
appPortalAccessIn: AppPortalAccessIn,
Expand All @@ -36,7 +39,25 @@ export class Authentication {
});
}

/// Expire all of the tokens associated with a specific Application
public expireAll(
appId: string,
applicationTokenExpireIn: ApplicationTokenExpireIn,
options?: PostOptions
): Promise<void> {
return this.api.v1AuthenticationExpireAll({
appId,
applicationTokenExpireIn,
...options,
});
}

/// Logout an app token.
///
/// Trying to log out other tokens will fail.
public logout(options?: PostOptions): Promise<void> {
return this.api.v1AuthenticationLogout({ ...options });
return this.api.v1AuthenticationLogout({
...options,
});
}
}
Loading