@kulkan/kulterra-api-client 1.2.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +75 -21
- package/dist/index.d.mts +100 -5
- package/dist/index.d.ts +100 -5
- package/dist/index.js +274 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +250 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [1.3.1] - 2026-08-05
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- **User endpoints** (`src/endpoints/user.ts`): aligned endpoint names, routes, request contracts, and response types with the current API implementation: `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateUserRoleByAdmin`, and `patchUpdateUserBySAdmin`.
|
|
27
|
+
- **Company endpoints** (`src/endpoints/company.ts`): updated company operations to use `getCompanies`, `getMyCompany`, `getCompanyBySlug`, `postCreateCompany`, `patchUpdateMyCompany`, and `patchUpdateCompanyBySAdmin`.
|
|
28
|
+
- **Project endpoints** (`src/endpoints/project.ts`): updated project operations to use `getProjects`, `getMyProjects`, `getMyProjectById`, `getProjectByCompanyAndSlug`, `getProjectsByCompany`, `postCreateProject`, and `patchUpdateProject`.
|
|
29
|
+
- **Property endpoints** (`src/endpoints/property.ts`): updated property operations to use `getProperties`, `getMyProperties`, `getMyPropertyById`, `getPropertiesByProject`, `getPropertyByProjectAndCode`, `postCreateProperty`, and `patchUpdateProperty`.
|
|
30
|
+
- **Typed API client** (`src/api-client.ts`): updated the `ApiClient` interface and `createApiClient` factory to expose the current user, company, project, and property endpoint functions.
|
|
31
|
+
- Corrected company routes to use `/api/v1/me/company`, `:companySlug`, and `:companyId` where applicable.
|
|
32
|
+
- Renamed `patchUpdateRoleUserByAdmin` to `patchUpdateUserRoleByAdmin`.
|
|
33
|
+
- Renamed `patchUpdatePropertyBySAdmin` to `patchUpdateProperty` to reflect that authorization is handled by the API service.
|
|
34
|
+
|
|
35
|
+
## [1.3.0] - 2026-04-04
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- **User endpoints** (`src/endpoints/user.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
40
|
+
- **Company endpoints** (`src/endpoints/company.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
41
|
+
- **Project endpoints** (`src/endpoints/project.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
42
|
+
- **Property endpoints** (`src/endpoints/property.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
22
46
|
## [1.2.1] - 2026-04-04
|
|
23
47
|
|
|
24
48
|
### Added
|
package/README.md
CHANGED
|
@@ -17,31 +17,85 @@ npm install @kulkan/kulterra-api-client @kulkan/kulterra-contracts
|
|
|
17
17
|
|
|
18
18
|
## What ships today
|
|
19
19
|
|
|
20
|
-
| Export
|
|
21
|
-
|
|
|
22
|
-
| `createApiClient(options)`
|
|
23
|
-
| `ApiClient` / `CreateApiClientOptions`
|
|
24
|
-
| `HttpClient`
|
|
25
|
-
| `HttpGet` / `HttpPost` / `HttpPatch`
|
|
26
|
-
| Named auth helpers
|
|
27
|
-
| Named user helpers
|
|
20
|
+
| Export | Description |
|
|
21
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
22
|
+
| `createApiClient(options)` | Factory returning `healthCheck` + **`auth`** namespace |
|
|
23
|
+
| `ApiClient` / `CreateApiClientOptions` | Typed client and `{ http: HttpClient }` options |
|
|
24
|
+
| `HttpClient` | **`get`** and **`post`** (minimal surface compatible with Axios) |
|
|
25
|
+
| `HttpGet` / `HttpPost` / `HttpPatch` | Method signatures |
|
|
26
|
+
| Named auth helpers | `postRegister`, `postLogin`, `getGoogleOAuthStart`, `postGoogleOAuthCallback`, `postRefresh`, `postLogout`, `getMe` (see `src/endpoints/auth.ts`) |
|
|
27
|
+
| Named user helpers | `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` (see `src/endpoints/user.ts`) |
|
|
28
|
+
| Named company helpers | `getCompanies`, `getCompanyById`, `getMyCompany`, `patchUpdateCompanyBySAdmin`, `patchUpdateMyCompany`, `postCreateCompany` (see `src/endpoints/company.ts`) |
|
|
29
|
+
| Named project helpers |
|
|
30
|
+
| `getMyProjectBySlug`, `getMyProjects`, `getProjectByCompanyAndSlug`, `getProjectsByCompany`, `getProjects`, `patchUpdateProjectByAdmin`, `patchUpdateProjectBySAdmin`, `postCreateProjectByAdmin`, `postCreateProjectBySAdmin` (see `src/endpoints/project.ts`) |
|
|
31
|
+
| Named property helpers |
|
|
32
|
+
|
|
33
|
+
`getMyProperties`,
|
|
34
|
+
`getMyPropertyById`,
|
|
35
|
+
`getProperties`,
|
|
36
|
+
`getPropertiesByAdmin`,
|
|
37
|
+
`getPropertiesByProject`, `getPropertiesByProjectByAdmin`, `getPropertyByProjectAndCode`, `getPropertyByProjectAndCodeByAdmin`, `patchUpdatePropertyByAdmin`, `patchUpdatePropertyBySAdmin`, `postCreatePropertyByAdmin`, `postCreatePropertyBySAdmin` (see `src/endpoints/property.ts`) |
|
|
28
38
|
|
|
29
39
|
### Endpoints implemented
|
|
30
40
|
|
|
31
|
-
| HTTP
|
|
32
|
-
|
|
|
33
|
-
| `GET`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| `GET`
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
|
|
41
|
+
| HTTP | Path | Client |
|
|
42
|
+
| ----- | ---------------------- | ---------------------- |
|
|
43
|
+
| `GET` | `/api/v1/health-check` | `client.healthCheck()` |
|
|
44
|
+
|
|
45
|
+
`USER ROUTES`
|
|
46
|
+
| `GET` | `/api/v1/users/` | `client.user.users(userQuery, accessToken)` or `getUsers(http, userQuery, accessToken)` |
|
|
47
|
+
| `GET` | `/api/v1/users/:userId` | `client.user.userById(accessToken, { userId })` or `getUserById(http, accessToken, { userId })` |
|
|
48
|
+
| `PATCH` | `/api/v1/users/me` | `client.users.updateMe(accessToken, patch)` or `patchUpdateMe(http, accessToken, patch)` |
|
|
49
|
+
| `PATCH` | `/api/v1/users/:id/role` | `client.user.updateRoleUserByAdmin({ id }, accessToken, body)` or `patchUpdateRoleUserByAdmin(http, accessToken, { id }, body)` |
|
|
50
|
+
| `PATCH` | `/api/v1/users/:userId` | `client.users.updateUserBySAdmin({ userId }, accessToken, patch)` or `patchUpdateUserBySAdmin(http, { userId }, accessToken, patch)` |
|
|
51
|
+
|
|
52
|
+
`COMPANY ROUTES`
|
|
53
|
+
| `GET` | `/api/v1/companies/` | `client.company.companies(userQuery, accessToken)` or `getCompanies(http, accessToken, companyQuery)` |
|
|
54
|
+
| `GET` | `/api/v1/companies/my` | `client.company.myCompany({ userId }, accessToken)` or `getMyCompany(http, accessToken)` |
|
|
55
|
+
| `GET` | `/api/v1/companies/:companyId` | `client.company.companyById(patch, accessToken)` or `getCompanyById(http, accessToken, { companyId })` |
|
|
56
|
+
| `POST` | `/api/v1/companies` | `client.company.createCompany({ userId }, patch, accessToken)` or `postCreateCompany(http, accessToken, newCompanyRequest)` |
|
|
57
|
+
| `PATCH` | `/api/v1/companies/my` | `client.company.updateMyCompany({ userId }, patch, accessToken)` or `patchUpdateMyCompany(http, accessToken, patch)` |
|
|
58
|
+
| `PATCH` | `/api/v1/companies/:id` | `client.company.updateCompanyBySAdmin({ userId }, patch, accessToken)` or `patchUpdateCompanyBySAdmin(http, accessToken, { companyId }, patch)` |
|
|
59
|
+
|
|
60
|
+
`PROJECT ROUTES`
|
|
61
|
+
| `GET` | `/api/v1/companies/projects` | `client.project.projects(accessToken, projectQuery)` or `getProjects(http, accessToken, projectQuery)` |
|
|
62
|
+
| `GET` | `/api/v1/companies/my/projects` | `client.project.myProjects(accessToken, projectQuery)` or `getMyProjects(http, accessToken, projectQuery)` |
|
|
63
|
+
| `GET` | `/api/v1/companies/my/projects/:projectSlug` | `client.project.myProjectBySlug(accessToken, { projectSlug })` or `getMyProjectBySlug(http, accessToken, { projectSlug })` |
|
|
64
|
+
| `GET` | `/api/v1/companies/:companySlug/projects/:projectSlug` | `client.project.projectByCompanyAndSlug(accessToken, { companySlug, projectSlug })` or `getProjectByCompanyAndSlug(http, accessToken, { companySlug, projectSlug })` |
|
|
65
|
+
| `GET` | `/api/v1/companies/:companySlug/projects` | `client.project.projectsByCompany(accessToken, { companySlug }, projectQuery)` or `getProjectsByCompany(http, accessToken, { companySlug }, projectQuery)` |
|
|
66
|
+
| `POST` | `/api/v1/companies/my/projects` | `client.project.createProjectByAdmin(accessToken, newProjectRequest)` or `postCreateProjectByAdmin(http, accessToken, newProjectRequest)` |
|
|
67
|
+
| `POST` | `/api/v1/companies/:companySlug/projects` | `client.project.createProjectBySAdmin(accessToken, { companySlug }, newProjectRequest)` or `postCreateProjectBySAdmin(http, accessToken, { companySlug }, newProjectRequest)` |
|
|
68
|
+
| `PATCH` | `/api/v1/companies/my/projects/:projectSlug` | `client.project.updateProjectByAdmin(accessToken, { projectSlug }, patch)` or `patchUpdateProjectByAdmin(http, accessToken, { projectSlug }, patch)` |
|
|
69
|
+
| `PATCH` | `/api/v1/companies/:companySlug/projects/:projectSlug` | `client.project.updateProjectBySAdmin(accessToken, { companySlug, projectSlug }, patch)` or `patchUpdateProjectBySAdmin(http, accessToken, { companySlug, projectSlug }, patch)` |
|
|
70
|
+
|
|
71
|
+
`PROPERTY ROUTES`
|
|
72
|
+
| `GET` | `/api/v1/properties` | `client.property.properties(accessToken, propertyQuery)` or `getProperties(http, accessToken, propertyQuery)` |
|
|
73
|
+
| `GET` | `/api/v1/properties/my` | `client.property.myProperties(accessToken, propertyQuery)` or `getMyProperties(http, accessToken, propertyQuery)` |
|
|
74
|
+
| `GET` | `/api/v1/properties/my/:propertyId` | `client.property.myPropertyById(accessToken, { propertyId })` or `getMyPropertyById(http, accessToken, { propertyId })` |
|
|
75
|
+
| `GET` | `/api/v1/companies/my/projects/properties` | `client.property.propertiesByAdmin(accessToken, propertyQuery)` or `getPropertiesByAdmin(http, accessToken, propertyQuery)` |
|
|
76
|
+
| `GET` | `/api/v1/companies/my/projects/:projectSlug/properties` | `client.property.propertiesByProjectByAdmin: (accessToken, { projectSlug }, propertyQuery)` or `getPropertiesByProjectByAdmin(http, accessToken, { projectSlug }, propertyQuery)` |
|
|
77
|
+
| `GET` | `/api/v1/companies/my/projects/:projectSlug/properties/:propertyCode` | `client.property.propertyByProjectAndCodeByAdmin: (accessToken, { projectSlug, propertyCode })` or `getPropertyByProjectAndCodeByAdmin(http, accessToken, { projectSlug, propertyCode })` |
|
|
78
|
+
| `GET` | `/api/v1/companies/:companySlug/projects/:projectSlug/properties` | `client.property.propertiesByProject: (accessToken, { companySlug, projectSlug }, propertyQuery)` or `getPropertiesByProject(http, accessToken, { companySlug, projectSlug }, propertyQuery)` |
|
|
79
|
+
| `GET` | `/api/v1/companies/:companySlug/projects/:projectSlug/properties/:propertyCode` | `client.property.propertyByProjectAndCode: (accessToken, { companySlug, projectSlug, propertyCode })` or `getPropertyByProjectAndCode(http, accessToken, { companySlug, projectSlug, propertyCode })` |
|
|
80
|
+
| `POST` | `/api/v1/companies/my/projects/:projectSlug/properties` | `client.property.createPropertyByAdmin: (accessToken, { projectSlug }, newPropertyRequest)` or `postCreatePropertyByAdmin(http, accessToken, { projectSlug }, newPropertyRequest)` |
|
|
81
|
+
| `POST` | `/api/v1/companies/:companySlug/projects/:projectSlug/properties` | `client.property.createPropertyBySAdmin: (accessToken, { companySlug, projectSlug }, newPropertyRequest)` or `postCreatePropertyBySAdmin(http, accessToken, { companySlug, projectSlug }, newPropertyRequest)` |
|
|
82
|
+
| `PATCH` | `/api/v1/companies/my/projects/:projectSlug/properties/:propertyCode` | `client.property.updatePropertyByAdmin: (accessToken, { projectSlug, propertyCode }, patch)` or `patchUpdatePropertyByAdmin(http, accessToken, { projectSlug, propertyCode }, patch)` |
|
|
83
|
+
| `PATCH` | `/api/v1/companies/:companySlug/projects/:projectSlug/properties/:propertyCode` | `client.property.updatePropertyBySAdmin: (accessToken, { companySlug, projectSlug, propertyCode }, patch)` or `patchUpdatePropertyBySAdmin(http, accessToken, { companySlug, projectSlug, propertyCode }, patch)` |
|
|
84
|
+
|
|
85
|
+
`AUTH ROUTES`
|
|
86
|
+
| `GET` | `/api/v1/auth/oauth/google/start?redirectUri=...` | `client.auth.getGoogleOAuthStart(redirectUri)` or `getGoogleOAuthStart(http, redirectUri)` |
|
|
87
|
+
| `GET` | `/api/v1/auth/me` | `client.auth.me(accessToken)` or `getMe(http, accessToken)` |
|
|
88
|
+
| `POST` | `/api/v1/auth/register` | `client.auth.register(body)` or `postRegister(http, body)` |
|
|
89
|
+
| `POST` | `/api/v1/auth/login` | `client.auth.login(body)` or `postLogin(http, body)` |
|
|
90
|
+
| `POST` | `/api/v1/auth/oauth/google/callback` | `client.auth.postGoogleOAuthCallback(body)` or `postGoogleOAuthCallback(http, body)` |
|
|
91
|
+
| `POST` | `/api/v1/auth/refresh` | `client.auth.refresh(body)` or `postRefresh(http, body)` |
|
|
92
|
+
| `POST` | `/api/v1/auth/logout` | `client.auth.logout(body)` or `postLogout(http, body)` |
|
|
42
93
|
|
|
43
94
|
Responses follow **`IApiResponse<T>`** from contracts (`success`, `data`, etc.). Auth session payloads are **`AuthSessionResponse`** (`TokenPair` + `user`). **`logout`** returns **204** with no JSON body.
|
|
44
|
-
User session payloads are **`
|
|
95
|
+
User session payloads are **`IPaginatedByTokenResponse<T>`, `ToAdminUsersResponse`, `ToSAdminUsersResponse` **`updateRoleUserByAdmin`, `updateUserBySAdmin`** returns **204\*\* with no JSON body.
|
|
96
|
+
Company session payloads are **`IPaginatedByTokenResponse<T>`, `PublicCompanyResponse`, `SAdminCompanyResponse`, `AdminCompanyResponse` **`updateMyCompany`, `updateCompanyBySAdmin`** returns **204\*\* with no JSON body.
|
|
97
|
+
Project session payloads are **`IPaginatedByTokenResponse<T>`, `ProjectResponse`, `PublicProjectResponse`, `OwnerProjectResponse` **`updateProjectByAdmin`, `updateProjectBySAdmin`** returns **204\*\* with no JSON body.
|
|
98
|
+
Property session payloads are **`IPaginatedByTokenResponse<T>`, `PropertyResponse`, `PublicPropertyResponse`, `BuyerPropertyResponse` **`updatePropertyByAdmin`, `updatePropertyBySAdmin`** returns **204\*\* with no JSON body.
|
|
45
99
|
|
|
46
100
|
### Usage example (Axios)
|
|
47
101
|
|
|
@@ -87,7 +141,7 @@ Axios returns `{ data: body }` where `body` is the full JSON from the server. Fo
|
|
|
87
141
|
|
|
88
142
|
### Extending further
|
|
89
143
|
|
|
90
|
-
If you add
|
|
144
|
+
If you add PUT/DELETE, extend **`HttpClient`** in `src/http-client.ts` and add endpoint modules. For request config (query params, headers), align types with your adapter (Axios uses a second `config` argument on `get`/`post`).
|
|
91
145
|
|
|
92
146
|
---
|
|
93
147
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IApiResponse, HealthCheck, RegisterRequest, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, AuthUserResponse, GetUsersQueryByTokenRequest, IPaginatedByTokenResponse, ToAdminUsersResponse, ToSAdminUsersResponse, UpdateUserByUserRequest, UpdateUserRoleByAdminRequest, UpdateUserBySAdminRequest, GetCompaniesQueryRequest, IPaginatedResponse, PublicCompanyResponse, SAdminCompanyResponse, AdminCompanyResponse, CreateCompanyRequest, UpdateCompanyByAdminRequest, UpdateCompanyBySAdminRequest, GetProjectsQueryByTokenRequest, ProjectResponse, PublicProjectResponse, OwnerProjectResponse, CreateProjectRequest, UpdateProjectRequest, GetPropertiesQueryByTokenRequest, PropertyResponse, PublicPropertyResponse, BuyerPropertyResponse, CreatePropertyRequest, UpdatePropertyRequest } from '@kulkan/kulterra-contracts';
|
|
2
2
|
|
|
3
3
|
type HttpGet = <TResponse>(url: string, config?: unknown) => Promise<{
|
|
4
4
|
data: TResponse;
|
|
@@ -15,6 +15,8 @@ interface HttpClient {
|
|
|
15
15
|
readonly patch: HttpPatch;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
declare function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>>;
|
|
19
|
+
|
|
18
20
|
declare function postRegister(http: HttpClient, body: RegisterRequest): Promise<IApiResponse<AuthSessionResponse>>;
|
|
19
21
|
declare function postLogin(http: HttpClient, body: LoginRequest): Promise<IApiResponse<AuthSessionResponse>>;
|
|
20
22
|
declare function getGoogleOAuthStart(http: HttpClient, redirectUri: string): Promise<IApiResponse<OAuthGoogleStartResponse>>;
|
|
@@ -23,9 +25,72 @@ declare function postRefresh(http: HttpClient, body: RefreshRequest): Promise<IA
|
|
|
23
25
|
declare function postLogout(http: HttpClient, body: LogoutRequest): Promise<void>;
|
|
24
26
|
declare function getMe(http: HttpClient, accessToken: string): Promise<IApiResponse<AuthUserResponse>>;
|
|
25
27
|
|
|
26
|
-
declare function
|
|
28
|
+
declare function getUsers(http: HttpClient, accessToken: string, userQuery: GetUsersQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ToAdminUsersResponse | ToSAdminUsersResponse>>>;
|
|
29
|
+
declare function getUserById(http: HttpClient, accessToken: string, { userId }: {
|
|
30
|
+
userId: string;
|
|
31
|
+
}): Promise<IApiResponse<ToSAdminUsersResponse>>;
|
|
32
|
+
declare function patchUpdateMe(http: HttpClient, accessToken: string, patch: UpdateUserByUserRequest): Promise<void>;
|
|
33
|
+
declare function patchUpdateUserRoleByAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
34
|
+
userId: string;
|
|
35
|
+
}, body: UpdateUserRoleByAdminRequest): Promise<void>;
|
|
36
|
+
declare function patchUpdateUserBySAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
37
|
+
userId: string;
|
|
38
|
+
}, patch: UpdateUserBySAdminRequest): Promise<void>;
|
|
27
39
|
|
|
28
|
-
declare function
|
|
40
|
+
declare function getCompanies(http: HttpClient, accessToken: string, companyQuery: GetCompaniesQueryRequest): Promise<IApiResponse<IPaginatedResponse<PublicCompanyResponse | SAdminCompanyResponse>>>;
|
|
41
|
+
declare function getMyCompany(http: HttpClient, accessToken: string): Promise<IApiResponse<AdminCompanyResponse>>;
|
|
42
|
+
declare function getCompanyBySlug(http: HttpClient, accessToken: string, { companySlug }: {
|
|
43
|
+
companySlug: string;
|
|
44
|
+
}): Promise<IApiResponse<PublicCompanyResponse | SAdminCompanyResponse>>;
|
|
45
|
+
declare function postCreateCompany(http: HttpClient, accessToken: string, newCompanyRequest: CreateCompanyRequest): Promise<IApiResponse<SAdminCompanyResponse>>;
|
|
46
|
+
declare function patchUpdateMyCompany(http: HttpClient, accessToken: string, patch: UpdateCompanyByAdminRequest): Promise<void>;
|
|
47
|
+
declare function patchUpdateCompanyBySAdmin(http: HttpClient, accessToken: string, { companyId }: {
|
|
48
|
+
companyId: string;
|
|
49
|
+
}, patch: UpdateCompanyBySAdminRequest): Promise<void>;
|
|
50
|
+
|
|
51
|
+
declare function getProjects(http: HttpClient, accessToken: string, projectQuery: GetProjectsQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ProjectResponse | PublicProjectResponse>>>;
|
|
52
|
+
declare function getMyProjects(http: HttpClient, accessToken: string, projectQuery: GetProjectsQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<OwnerProjectResponse>>>;
|
|
53
|
+
declare function getMyProjectById(http: HttpClient, accessToken: string, { projectId }: {
|
|
54
|
+
projectId: string;
|
|
55
|
+
}): Promise<IApiResponse<OwnerProjectResponse>>;
|
|
56
|
+
declare function getProjectByCompanyAndSlug(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
57
|
+
companySlug: string;
|
|
58
|
+
projectSlug: string;
|
|
59
|
+
}): Promise<IApiResponse<ProjectResponse | PublicProjectResponse>>;
|
|
60
|
+
declare function getProjectsByCompany(http: HttpClient, accessToken: string, { companySlug }: {
|
|
61
|
+
companySlug: string;
|
|
62
|
+
}, projectQuery: GetProjectsQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ProjectResponse | PublicProjectResponse>>>;
|
|
63
|
+
declare function postCreateProject(http: HttpClient, accessToken: string, { companySlug }: {
|
|
64
|
+
companySlug: string;
|
|
65
|
+
}, newProjectRequest: CreateProjectRequest): Promise<IApiResponse<ProjectResponse>>;
|
|
66
|
+
declare function patchUpdateProject(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
67
|
+
companySlug: string;
|
|
68
|
+
projectSlug: string;
|
|
69
|
+
}, patch: UpdateProjectRequest): Promise<void>;
|
|
70
|
+
|
|
71
|
+
declare function getProperties(http: HttpClient, accessToken: string, query: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
72
|
+
declare function getMyProperties(http: HttpClient, accessToken: string, query: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<BuyerPropertyResponse>>>;
|
|
73
|
+
declare function getMyPropertyById(http: HttpClient, accessToken: string, { propertyId }: {
|
|
74
|
+
propertyId: string;
|
|
75
|
+
}): Promise<IApiResponse<BuyerPropertyResponse>>;
|
|
76
|
+
declare function getPropertiesByProject(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
77
|
+
companySlug: string;
|
|
78
|
+
projectSlug: string;
|
|
79
|
+
}, query: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
80
|
+
declare function getPropertyByProjectAndCode(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
81
|
+
companySlug: string;
|
|
82
|
+
projectSlug: string;
|
|
83
|
+
propertyCode: string;
|
|
84
|
+
}): Promise<IApiResponse<PropertyResponse | PublicPropertyResponse>>;
|
|
85
|
+
declare function postCreateProperty(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
86
|
+
companySlug: string;
|
|
87
|
+
projectSlug: string;
|
|
88
|
+
}, newPropertyRequest: CreatePropertyRequest): Promise<IApiResponse<PropertyResponse>>;
|
|
89
|
+
declare function patchUpdateProperty(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
90
|
+
companySlug: string;
|
|
91
|
+
projectSlug: string;
|
|
92
|
+
propertyCode: string;
|
|
93
|
+
}, patch: UpdatePropertyRequest): Promise<void>;
|
|
29
94
|
|
|
30
95
|
interface CreateApiClientOptions {
|
|
31
96
|
readonly http: HttpClient;
|
|
@@ -42,9 +107,39 @@ interface ApiClient {
|
|
|
42
107
|
readonly me: (accessToken: string) => ReturnType<typeof getMe>;
|
|
43
108
|
};
|
|
44
109
|
readonly user: {
|
|
45
|
-
readonly
|
|
110
|
+
readonly users: (accessToken: string, userQuery: Parameters<typeof getUsers>[2]) => ReturnType<typeof getUsers>;
|
|
111
|
+
readonly userById: (accessToken: Parameters<typeof getUserById>[1], { userId }: Parameters<typeof getUserById>[2]) => ReturnType<typeof getUserById>;
|
|
112
|
+
readonly updateMe: (accessToken: Parameters<typeof patchUpdateMe>[1], patch: Parameters<typeof patchUpdateMe>[2]) => ReturnType<typeof patchUpdateMe>;
|
|
113
|
+
readonly updateUserRoleByAdmin: (accessToken: Parameters<typeof patchUpdateUserRoleByAdmin>[1], { userId }: Parameters<typeof patchUpdateUserRoleByAdmin>[2], body: Parameters<typeof patchUpdateUserRoleByAdmin>[3]) => ReturnType<typeof patchUpdateUserRoleByAdmin>;
|
|
114
|
+
readonly updateUserBySAdmin: (accessToken: Parameters<typeof patchUpdateUserBySAdmin>[1], { userId }: Parameters<typeof patchUpdateUserBySAdmin>[2], patch: Parameters<typeof patchUpdateUserBySAdmin>[3]) => ReturnType<typeof patchUpdateUserBySAdmin>;
|
|
115
|
+
};
|
|
116
|
+
readonly company: {
|
|
117
|
+
readonly companies: (accessToken: Parameters<typeof getCompanies>[1], companyQuery: Parameters<typeof getCompanies>[2]) => ReturnType<typeof getCompanies>;
|
|
118
|
+
readonly myCompany: (accessToken: Parameters<typeof getMyCompany>[1]) => ReturnType<typeof getMyCompany>;
|
|
119
|
+
readonly companyBySlug: (accessToken: Parameters<typeof getCompanyBySlug>[1], { companySlug }: Parameters<typeof getCompanyBySlug>[2]) => ReturnType<typeof getCompanyBySlug>;
|
|
120
|
+
readonly createCompany: (accessToken: Parameters<typeof postCreateCompany>[1], newCompanyRequest: Parameters<typeof postCreateCompany>[2]) => ReturnType<typeof postCreateCompany>;
|
|
121
|
+
readonly updateMyCompany: (accessToken: Parameters<typeof patchUpdateMyCompany>[1], patch: Parameters<typeof patchUpdateMyCompany>[2]) => ReturnType<typeof patchUpdateMyCompany>;
|
|
122
|
+
readonly updateCompanyBySAdmin: (accessToken: Parameters<typeof patchUpdateCompanyBySAdmin>[1], { companyId }: Parameters<typeof patchUpdateCompanyBySAdmin>[2], patch: Parameters<typeof patchUpdateCompanyBySAdmin>[3]) => ReturnType<typeof patchUpdateCompanyBySAdmin>;
|
|
123
|
+
};
|
|
124
|
+
readonly project: {
|
|
125
|
+
readonly projects: (accessToken: Parameters<typeof getProjects>[1], projectQuery: Parameters<typeof getProjects>[2]) => ReturnType<typeof getProjects>;
|
|
126
|
+
readonly myProjects: (accessToken: Parameters<typeof getMyProjects>[1], projectQuery: Parameters<typeof getMyProjects>[2]) => ReturnType<typeof getMyProjects>;
|
|
127
|
+
readonly myProjectById: (accessToken: Parameters<typeof getMyProjectById>[1], { projectId }: Parameters<typeof getMyProjectById>[2]) => ReturnType<typeof getMyProjectById>;
|
|
128
|
+
readonly projectByCompanyAndSlug: (accessToken: Parameters<typeof getProjectByCompanyAndSlug>[1], { companySlug, projectSlug }: Parameters<typeof getProjectByCompanyAndSlug>[2]) => ReturnType<typeof getProjectByCompanyAndSlug>;
|
|
129
|
+
readonly projectsByCompany: (accessToken: Parameters<typeof getProjectsByCompany>[1], { companySlug }: Parameters<typeof getProjectsByCompany>[2], projectQuery: Parameters<typeof getProjectsByCompany>[3]) => ReturnType<typeof getProjectsByCompany>;
|
|
130
|
+
readonly createProject: (accessToken: Parameters<typeof postCreateProject>[1], { companySlug }: Parameters<typeof postCreateProject>[2], newProjectRequest: Parameters<typeof postCreateProject>[3]) => ReturnType<typeof postCreateProject>;
|
|
131
|
+
readonly updateProject: (accessToken: Parameters<typeof patchUpdateProject>[1], { companySlug, projectSlug }: Parameters<typeof patchUpdateProject>[2], patch: Parameters<typeof patchUpdateProject>[3]) => ReturnType<typeof patchUpdateProject>;
|
|
132
|
+
};
|
|
133
|
+
readonly property: {
|
|
134
|
+
readonly properties: (accessToken: Parameters<typeof getProperties>[1], propertyQuery: Parameters<typeof getProperties>[2]) => ReturnType<typeof getProperties>;
|
|
135
|
+
readonly myProperties: (accessToken: Parameters<typeof getMyProperties>[1], propertyQuery: Parameters<typeof getMyProperties>[2]) => ReturnType<typeof getMyProperties>;
|
|
136
|
+
readonly myPropertyById: (accessToken: Parameters<typeof getMyPropertyById>[1], { propertyId }: Parameters<typeof getMyPropertyById>[2]) => ReturnType<typeof getMyPropertyById>;
|
|
137
|
+
readonly propertiesByProject: (accessToken: Parameters<typeof getPropertiesByProject>[1], { companySlug, projectSlug }: Parameters<typeof getPropertiesByProject>[2], propertyQuery: Parameters<typeof getPropertiesByProject>[3]) => ReturnType<typeof getPropertiesByProject>;
|
|
138
|
+
readonly propertyByProjectAndCode: (accessToken: Parameters<typeof getPropertyByProjectAndCode>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof getPropertyByProjectAndCode>[2]) => ReturnType<typeof getPropertyByProjectAndCode>;
|
|
139
|
+
readonly createProperty: (accessToken: Parameters<typeof postCreateProperty>[1], { companySlug, projectSlug }: Parameters<typeof postCreateProperty>[2], newPropertyRequest: Parameters<typeof postCreateProperty>[3]) => ReturnType<typeof postCreateProperty>;
|
|
140
|
+
readonly updateProperty: (accessToken: Parameters<typeof patchUpdateProperty>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof patchUpdateProperty>[2], patch: Parameters<typeof patchUpdateProperty>[3]) => ReturnType<typeof patchUpdateProperty>;
|
|
46
141
|
};
|
|
47
142
|
}
|
|
48
143
|
declare function createApiClient(options: CreateApiClientOptions): ApiClient;
|
|
49
144
|
|
|
50
|
-
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPost, createApiClient, getGoogleOAuthStart, getMe,
|
|
145
|
+
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPatch, type HttpPost, createApiClient, getCompanies, getCompanyBySlug, getGoogleOAuthStart, getMe, getMyCompany, getMyProjectById, getMyProjects, getMyProperties, getMyPropertyById, getProjectByCompanyAndSlug, getProjects, getProjectsByCompany, getProperties, getPropertiesByProject, getPropertyByProjectAndCode, getUserById, getUsers, patchUpdateCompanyBySAdmin, patchUpdateMe, patchUpdateMyCompany, patchUpdateProject, patchUpdateProperty, patchUpdateUserBySAdmin, patchUpdateUserRoleByAdmin, postCreateCompany, postCreateProject, postCreateProperty, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IApiResponse, HealthCheck, RegisterRequest, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, AuthUserResponse, GetUsersQueryByTokenRequest, IPaginatedByTokenResponse, ToAdminUsersResponse, ToSAdminUsersResponse, UpdateUserByUserRequest, UpdateUserRoleByAdminRequest, UpdateUserBySAdminRequest, GetCompaniesQueryRequest, IPaginatedResponse, PublicCompanyResponse, SAdminCompanyResponse, AdminCompanyResponse, CreateCompanyRequest, UpdateCompanyByAdminRequest, UpdateCompanyBySAdminRequest, GetProjectsQueryByTokenRequest, ProjectResponse, PublicProjectResponse, OwnerProjectResponse, CreateProjectRequest, UpdateProjectRequest, GetPropertiesQueryByTokenRequest, PropertyResponse, PublicPropertyResponse, BuyerPropertyResponse, CreatePropertyRequest, UpdatePropertyRequest } from '@kulkan/kulterra-contracts';
|
|
2
2
|
|
|
3
3
|
type HttpGet = <TResponse>(url: string, config?: unknown) => Promise<{
|
|
4
4
|
data: TResponse;
|
|
@@ -15,6 +15,8 @@ interface HttpClient {
|
|
|
15
15
|
readonly patch: HttpPatch;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
declare function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>>;
|
|
19
|
+
|
|
18
20
|
declare function postRegister(http: HttpClient, body: RegisterRequest): Promise<IApiResponse<AuthSessionResponse>>;
|
|
19
21
|
declare function postLogin(http: HttpClient, body: LoginRequest): Promise<IApiResponse<AuthSessionResponse>>;
|
|
20
22
|
declare function getGoogleOAuthStart(http: HttpClient, redirectUri: string): Promise<IApiResponse<OAuthGoogleStartResponse>>;
|
|
@@ -23,9 +25,72 @@ declare function postRefresh(http: HttpClient, body: RefreshRequest): Promise<IA
|
|
|
23
25
|
declare function postLogout(http: HttpClient, body: LogoutRequest): Promise<void>;
|
|
24
26
|
declare function getMe(http: HttpClient, accessToken: string): Promise<IApiResponse<AuthUserResponse>>;
|
|
25
27
|
|
|
26
|
-
declare function
|
|
28
|
+
declare function getUsers(http: HttpClient, accessToken: string, userQuery: GetUsersQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ToAdminUsersResponse | ToSAdminUsersResponse>>>;
|
|
29
|
+
declare function getUserById(http: HttpClient, accessToken: string, { userId }: {
|
|
30
|
+
userId: string;
|
|
31
|
+
}): Promise<IApiResponse<ToSAdminUsersResponse>>;
|
|
32
|
+
declare function patchUpdateMe(http: HttpClient, accessToken: string, patch: UpdateUserByUserRequest): Promise<void>;
|
|
33
|
+
declare function patchUpdateUserRoleByAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
34
|
+
userId: string;
|
|
35
|
+
}, body: UpdateUserRoleByAdminRequest): Promise<void>;
|
|
36
|
+
declare function patchUpdateUserBySAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
37
|
+
userId: string;
|
|
38
|
+
}, patch: UpdateUserBySAdminRequest): Promise<void>;
|
|
27
39
|
|
|
28
|
-
declare function
|
|
40
|
+
declare function getCompanies(http: HttpClient, accessToken: string, companyQuery: GetCompaniesQueryRequest): Promise<IApiResponse<IPaginatedResponse<PublicCompanyResponse | SAdminCompanyResponse>>>;
|
|
41
|
+
declare function getMyCompany(http: HttpClient, accessToken: string): Promise<IApiResponse<AdminCompanyResponse>>;
|
|
42
|
+
declare function getCompanyBySlug(http: HttpClient, accessToken: string, { companySlug }: {
|
|
43
|
+
companySlug: string;
|
|
44
|
+
}): Promise<IApiResponse<PublicCompanyResponse | SAdminCompanyResponse>>;
|
|
45
|
+
declare function postCreateCompany(http: HttpClient, accessToken: string, newCompanyRequest: CreateCompanyRequest): Promise<IApiResponse<SAdminCompanyResponse>>;
|
|
46
|
+
declare function patchUpdateMyCompany(http: HttpClient, accessToken: string, patch: UpdateCompanyByAdminRequest): Promise<void>;
|
|
47
|
+
declare function patchUpdateCompanyBySAdmin(http: HttpClient, accessToken: string, { companyId }: {
|
|
48
|
+
companyId: string;
|
|
49
|
+
}, patch: UpdateCompanyBySAdminRequest): Promise<void>;
|
|
50
|
+
|
|
51
|
+
declare function getProjects(http: HttpClient, accessToken: string, projectQuery: GetProjectsQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ProjectResponse | PublicProjectResponse>>>;
|
|
52
|
+
declare function getMyProjects(http: HttpClient, accessToken: string, projectQuery: GetProjectsQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<OwnerProjectResponse>>>;
|
|
53
|
+
declare function getMyProjectById(http: HttpClient, accessToken: string, { projectId }: {
|
|
54
|
+
projectId: string;
|
|
55
|
+
}): Promise<IApiResponse<OwnerProjectResponse>>;
|
|
56
|
+
declare function getProjectByCompanyAndSlug(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
57
|
+
companySlug: string;
|
|
58
|
+
projectSlug: string;
|
|
59
|
+
}): Promise<IApiResponse<ProjectResponse | PublicProjectResponse>>;
|
|
60
|
+
declare function getProjectsByCompany(http: HttpClient, accessToken: string, { companySlug }: {
|
|
61
|
+
companySlug: string;
|
|
62
|
+
}, projectQuery: GetProjectsQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ProjectResponse | PublicProjectResponse>>>;
|
|
63
|
+
declare function postCreateProject(http: HttpClient, accessToken: string, { companySlug }: {
|
|
64
|
+
companySlug: string;
|
|
65
|
+
}, newProjectRequest: CreateProjectRequest): Promise<IApiResponse<ProjectResponse>>;
|
|
66
|
+
declare function patchUpdateProject(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
67
|
+
companySlug: string;
|
|
68
|
+
projectSlug: string;
|
|
69
|
+
}, patch: UpdateProjectRequest): Promise<void>;
|
|
70
|
+
|
|
71
|
+
declare function getProperties(http: HttpClient, accessToken: string, query: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
72
|
+
declare function getMyProperties(http: HttpClient, accessToken: string, query: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<BuyerPropertyResponse>>>;
|
|
73
|
+
declare function getMyPropertyById(http: HttpClient, accessToken: string, { propertyId }: {
|
|
74
|
+
propertyId: string;
|
|
75
|
+
}): Promise<IApiResponse<BuyerPropertyResponse>>;
|
|
76
|
+
declare function getPropertiesByProject(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
77
|
+
companySlug: string;
|
|
78
|
+
projectSlug: string;
|
|
79
|
+
}, query: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
80
|
+
declare function getPropertyByProjectAndCode(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
81
|
+
companySlug: string;
|
|
82
|
+
projectSlug: string;
|
|
83
|
+
propertyCode: string;
|
|
84
|
+
}): Promise<IApiResponse<PropertyResponse | PublicPropertyResponse>>;
|
|
85
|
+
declare function postCreateProperty(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
86
|
+
companySlug: string;
|
|
87
|
+
projectSlug: string;
|
|
88
|
+
}, newPropertyRequest: CreatePropertyRequest): Promise<IApiResponse<PropertyResponse>>;
|
|
89
|
+
declare function patchUpdateProperty(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
90
|
+
companySlug: string;
|
|
91
|
+
projectSlug: string;
|
|
92
|
+
propertyCode: string;
|
|
93
|
+
}, patch: UpdatePropertyRequest): Promise<void>;
|
|
29
94
|
|
|
30
95
|
interface CreateApiClientOptions {
|
|
31
96
|
readonly http: HttpClient;
|
|
@@ -42,9 +107,39 @@ interface ApiClient {
|
|
|
42
107
|
readonly me: (accessToken: string) => ReturnType<typeof getMe>;
|
|
43
108
|
};
|
|
44
109
|
readonly user: {
|
|
45
|
-
readonly
|
|
110
|
+
readonly users: (accessToken: string, userQuery: Parameters<typeof getUsers>[2]) => ReturnType<typeof getUsers>;
|
|
111
|
+
readonly userById: (accessToken: Parameters<typeof getUserById>[1], { userId }: Parameters<typeof getUserById>[2]) => ReturnType<typeof getUserById>;
|
|
112
|
+
readonly updateMe: (accessToken: Parameters<typeof patchUpdateMe>[1], patch: Parameters<typeof patchUpdateMe>[2]) => ReturnType<typeof patchUpdateMe>;
|
|
113
|
+
readonly updateUserRoleByAdmin: (accessToken: Parameters<typeof patchUpdateUserRoleByAdmin>[1], { userId }: Parameters<typeof patchUpdateUserRoleByAdmin>[2], body: Parameters<typeof patchUpdateUserRoleByAdmin>[3]) => ReturnType<typeof patchUpdateUserRoleByAdmin>;
|
|
114
|
+
readonly updateUserBySAdmin: (accessToken: Parameters<typeof patchUpdateUserBySAdmin>[1], { userId }: Parameters<typeof patchUpdateUserBySAdmin>[2], patch: Parameters<typeof patchUpdateUserBySAdmin>[3]) => ReturnType<typeof patchUpdateUserBySAdmin>;
|
|
115
|
+
};
|
|
116
|
+
readonly company: {
|
|
117
|
+
readonly companies: (accessToken: Parameters<typeof getCompanies>[1], companyQuery: Parameters<typeof getCompanies>[2]) => ReturnType<typeof getCompanies>;
|
|
118
|
+
readonly myCompany: (accessToken: Parameters<typeof getMyCompany>[1]) => ReturnType<typeof getMyCompany>;
|
|
119
|
+
readonly companyBySlug: (accessToken: Parameters<typeof getCompanyBySlug>[1], { companySlug }: Parameters<typeof getCompanyBySlug>[2]) => ReturnType<typeof getCompanyBySlug>;
|
|
120
|
+
readonly createCompany: (accessToken: Parameters<typeof postCreateCompany>[1], newCompanyRequest: Parameters<typeof postCreateCompany>[2]) => ReturnType<typeof postCreateCompany>;
|
|
121
|
+
readonly updateMyCompany: (accessToken: Parameters<typeof patchUpdateMyCompany>[1], patch: Parameters<typeof patchUpdateMyCompany>[2]) => ReturnType<typeof patchUpdateMyCompany>;
|
|
122
|
+
readonly updateCompanyBySAdmin: (accessToken: Parameters<typeof patchUpdateCompanyBySAdmin>[1], { companyId }: Parameters<typeof patchUpdateCompanyBySAdmin>[2], patch: Parameters<typeof patchUpdateCompanyBySAdmin>[3]) => ReturnType<typeof patchUpdateCompanyBySAdmin>;
|
|
123
|
+
};
|
|
124
|
+
readonly project: {
|
|
125
|
+
readonly projects: (accessToken: Parameters<typeof getProjects>[1], projectQuery: Parameters<typeof getProjects>[2]) => ReturnType<typeof getProjects>;
|
|
126
|
+
readonly myProjects: (accessToken: Parameters<typeof getMyProjects>[1], projectQuery: Parameters<typeof getMyProjects>[2]) => ReturnType<typeof getMyProjects>;
|
|
127
|
+
readonly myProjectById: (accessToken: Parameters<typeof getMyProjectById>[1], { projectId }: Parameters<typeof getMyProjectById>[2]) => ReturnType<typeof getMyProjectById>;
|
|
128
|
+
readonly projectByCompanyAndSlug: (accessToken: Parameters<typeof getProjectByCompanyAndSlug>[1], { companySlug, projectSlug }: Parameters<typeof getProjectByCompanyAndSlug>[2]) => ReturnType<typeof getProjectByCompanyAndSlug>;
|
|
129
|
+
readonly projectsByCompany: (accessToken: Parameters<typeof getProjectsByCompany>[1], { companySlug }: Parameters<typeof getProjectsByCompany>[2], projectQuery: Parameters<typeof getProjectsByCompany>[3]) => ReturnType<typeof getProjectsByCompany>;
|
|
130
|
+
readonly createProject: (accessToken: Parameters<typeof postCreateProject>[1], { companySlug }: Parameters<typeof postCreateProject>[2], newProjectRequest: Parameters<typeof postCreateProject>[3]) => ReturnType<typeof postCreateProject>;
|
|
131
|
+
readonly updateProject: (accessToken: Parameters<typeof patchUpdateProject>[1], { companySlug, projectSlug }: Parameters<typeof patchUpdateProject>[2], patch: Parameters<typeof patchUpdateProject>[3]) => ReturnType<typeof patchUpdateProject>;
|
|
132
|
+
};
|
|
133
|
+
readonly property: {
|
|
134
|
+
readonly properties: (accessToken: Parameters<typeof getProperties>[1], propertyQuery: Parameters<typeof getProperties>[2]) => ReturnType<typeof getProperties>;
|
|
135
|
+
readonly myProperties: (accessToken: Parameters<typeof getMyProperties>[1], propertyQuery: Parameters<typeof getMyProperties>[2]) => ReturnType<typeof getMyProperties>;
|
|
136
|
+
readonly myPropertyById: (accessToken: Parameters<typeof getMyPropertyById>[1], { propertyId }: Parameters<typeof getMyPropertyById>[2]) => ReturnType<typeof getMyPropertyById>;
|
|
137
|
+
readonly propertiesByProject: (accessToken: Parameters<typeof getPropertiesByProject>[1], { companySlug, projectSlug }: Parameters<typeof getPropertiesByProject>[2], propertyQuery: Parameters<typeof getPropertiesByProject>[3]) => ReturnType<typeof getPropertiesByProject>;
|
|
138
|
+
readonly propertyByProjectAndCode: (accessToken: Parameters<typeof getPropertyByProjectAndCode>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof getPropertyByProjectAndCode>[2]) => ReturnType<typeof getPropertyByProjectAndCode>;
|
|
139
|
+
readonly createProperty: (accessToken: Parameters<typeof postCreateProperty>[1], { companySlug, projectSlug }: Parameters<typeof postCreateProperty>[2], newPropertyRequest: Parameters<typeof postCreateProperty>[3]) => ReturnType<typeof postCreateProperty>;
|
|
140
|
+
readonly updateProperty: (accessToken: Parameters<typeof patchUpdateProperty>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof patchUpdateProperty>[2], patch: Parameters<typeof patchUpdateProperty>[3]) => ReturnType<typeof patchUpdateProperty>;
|
|
46
141
|
};
|
|
47
142
|
}
|
|
48
143
|
declare function createApiClient(options: CreateApiClientOptions): ApiClient;
|
|
49
144
|
|
|
50
|
-
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPost, createApiClient, getGoogleOAuthStart, getMe,
|
|
145
|
+
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPatch, type HttpPost, createApiClient, getCompanies, getCompanyBySlug, getGoogleOAuthStart, getMe, getMyCompany, getMyProjectById, getMyProjects, getMyProperties, getMyPropertyById, getProjectByCompanyAndSlug, getProjects, getProjectsByCompany, getProperties, getPropertiesByProject, getPropertyByProjectAndCode, getUserById, getUsers, patchUpdateCompanyBySAdmin, patchUpdateMe, patchUpdateMyCompany, patchUpdateProject, patchUpdateProperty, patchUpdateUserBySAdmin, patchUpdateUserRoleByAdmin, postCreateCompany, postCreateProject, postCreateProperty, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister };
|