@oystehr/sdk
Version:
Oystehr SDK
88 lines (85 loc) • 4.72 kB
JavaScript
import { SDKResource } from '../../client/client.js';
// AUTOGENERATED -- DO NOT EDIT
class User extends SDKResource {
constructor(config) {
super(config);
}
#baseUrlThunk() {
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
}
/**
* Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
*/
me(request) {
return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);
}
/**
* Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `App:GetUser`
* Access Policy Resource: `App:User`
*/
get(params, request) {
return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `App:UpdateUser`
* Access Policy Resource: `App:User`
*/
update(params, request) {
return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `App:DeleteUser`
* Access Policy Resource: `App:User`
*/
delete(params, request) {
return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Reset MFA for the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `App:ResetUserMFA`
* Access Policy Resource: `App:User`
*/
resetMfa(params, request) {
return this.request('/user/{id}/reset-mfa', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `App:CreateUser`
* Access Policy Resource: `App:User`
*/
invite(params, request) {
return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
*
* Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `App:ListAllUsers`
* Access Policy Resource: `App:User`
*/
list(request) {
return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);
}
/**
* Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
*
* Access Policy Action: `Project:ListAllUsers`
* Access Policy Resource: `Project:Settings`
*/
listV2(params, request) {
return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
}
export { User };
//# sourceMappingURL=user.js.map