@oystehr/sdk
Version:
Oystehr SDK
120 lines (117 loc) • 4.85 kB
text/typescript
// AUTOGENERATED -- DO NOT EDIT
import {
ApplicationCreateParams,
ApplicationCreateResponse,
ApplicationDeleteParams,
ApplicationGetParams,
ApplicationGetResponse,
ApplicationListResponse,
ApplicationRevokeAccessTokenParams,
ApplicationRevokeAccessTokenResponse,
ApplicationRevokeRefreshTokenParams,
ApplicationRevokeRefreshTokenResponse,
ApplicationRotateSecretParams,
ApplicationRotateSecretResponse,
ApplicationUpdateParams,
ApplicationUpdateResponse,
OystehrClientRequest,
} from '../..';
import { SDKResource } from '../../client/client';
import { OystehrConfig } from '../../config';
export class Application extends SDKResource {
constructor(config: OystehrConfig) {
super(config);
}
#baseUrlThunk(): string {
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
}
/**
* Get a list of Applications. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
*
* Access Policy Action: `App:ListAllApplications`
* Access Policy Resource: `App:Application`
*/
list(request?: OystehrClientRequest): Promise<ApplicationListResponse> {
return this.request('/application', 'get', this.#baseUrlThunk.bind(this))(request);
}
/**
* Create a new Application. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
*
* Access Policy Action: `App:CreateApplication`
* Access Policy Resource: `App:Application`
*/
create(params: ApplicationCreateParams, request?: OystehrClientRequest): Promise<ApplicationCreateResponse> {
return this.request('/application', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Get the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
*
* Access Policy Action: `App:GetApplication`
* Access Policy Resource: `App:Application`
*/
get(params: ApplicationGetParams, request?: OystehrClientRequest): Promise<ApplicationGetResponse> {
return this.request('/application/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Update the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
*
* Access Policy Action: `App:UpdateApplication`
* Access Policy Resource: `App:Application`
*/
update(params: ApplicationUpdateParams, request?: OystehrClientRequest): Promise<ApplicationUpdateResponse> {
return this.request('/application/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Delete the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
*
* Access Policy Action: `App:DeleteApplication`
* Access Policy Resource: `App:Application`
*/
delete(params: ApplicationDeleteParams, request?: OystehrClientRequest): Promise<void> {
return this.request('/application/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Rotate client's secrete associated with an application.
*
* Access Policy Action: `App:RotateApplicationSecret`
* Access Policy Resource: `App:Application`
*/
rotateSecret(
params: ApplicationRotateSecretParams,
request?: OystehrClientRequest
): Promise<ApplicationRotateSecretResponse> {
return this.request('/application/{id}/rotate-secret', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Revokes user's refresh token issued for the application.
*
* Access Policy Action: `App:RevokeRefreshToken`
* Access Policy Resource: `App:Application`
*/
revokeRefreshToken(
params: ApplicationRevokeRefreshTokenParams,
request?: OystehrClientRequest
): Promise<ApplicationRevokeRefreshTokenResponse> {
return this.request(
'/application/{id}/revoke-refresh-token',
'post',
this.#baseUrlThunk.bind(this)
)(params, request);
}
/**
* Revokes user's access token issued for the application.
*
* Access Policy Action: `App:RevokeAccessToken`
* Access Policy Resource: `App:Application`
*/
revokeAccessToken(
params: ApplicationRevokeAccessTokenParams,
request?: OystehrClientRequest
): Promise<ApplicationRevokeAccessTokenResponse> {
return this.request(
'/application/{id}/revoke-access-token',
'post',
this.#baseUrlThunk.bind(this)
)(params, request);
}
}