@kulkan/kulterra-api-client 1.2.1 → 1.3.0
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 +12 -1
- package/README.md +75 -18
- package/dist/index.d.mts +125 -4
- package/dist/index.d.ts +125 -4
- package/dist/index.js +352 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +322 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -19,7 +19,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
-
## [1.
|
|
22
|
+
## [1.3.0] - 2026-04-04
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **User endpoints** (`src/endpoints/user.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
27
|
+
- **Company endpoints** (`src/endpoints/company.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
28
|
+
- **Project endpoints** (`src/endpoints/project.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
29
|
+
- **Property endpoints** (`src/endpoints/property.ts`): `getUsers`, `getUserById`, `patchUpdateMe`, `patchUpdateRoleUserByAdmin`, `patchUpdateUserBySAdmin` - Implemented end points to get, update and create users
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
## [1.2.1] - 2026-04-04
|
|
23
34
|
|
|
24
35
|
### Added
|
|
25
36
|
|
package/README.md
CHANGED
|
@@ -17,28 +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`
|
|
26
|
-
| Named auth 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`) |
|
|
27
38
|
|
|
28
39
|
### Endpoints implemented
|
|
29
40
|
|
|
30
|
-
| HTTP
|
|
31
|
-
|
|
|
32
|
-
| `GET`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| `GET`
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
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)` |
|
|
40
93
|
|
|
41
94
|
Responses follow **`IApiResponse<T>`** from contracts (`success`, `data`, etc.). Auth session payloads are **`AuthSessionResponse`** (`TokenPair` + `user`). **`logout`** returns **204** with no JSON body.
|
|
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.
|
|
42
99
|
|
|
43
100
|
### Usage example (Axios)
|
|
44
101
|
|
|
@@ -84,7 +141,7 @@ Axios returns `{ data: body }` where `body` is the full JSON from the server. Fo
|
|
|
84
141
|
|
|
85
142
|
### Extending further
|
|
86
143
|
|
|
87
|
-
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`).
|
|
88
145
|
|
|
89
146
|
---
|
|
90
147
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, AuthUserResponse,
|
|
1
|
+
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, AuthUserResponse, GetUsersQueryByTokenRequest, IPaginatedByTokenResponse, ToAdminUsersResponse, ToSAdminUsersResponse, UpdateUserByUserRequest, UpdateUserRoleByAdminRequest, UpdateUserBySAdminRequest, HealthCheck, 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;
|
|
@@ -23,10 +23,94 @@ declare function postRefresh(http: HttpClient, body: RefreshRequest): Promise<IA
|
|
|
23
23
|
declare function postLogout(http: HttpClient, body: LogoutRequest): Promise<void>;
|
|
24
24
|
declare function getMe(http: HttpClient, accessToken: string): Promise<IApiResponse<AuthUserResponse>>;
|
|
25
25
|
|
|
26
|
-
declare function
|
|
26
|
+
declare function getUsers(http: HttpClient, accessToken: string, userQuery: GetUsersQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ToAdminUsersResponse | ToSAdminUsersResponse>>>;
|
|
27
|
+
declare function getUserById(http: HttpClient, accessToken: string, { userId }: {
|
|
28
|
+
userId: string;
|
|
29
|
+
}): Promise<IApiResponse<ToSAdminUsersResponse>>;
|
|
30
|
+
declare function patchUpdateMe(http: HttpClient, accessToken: string, patch: UpdateUserByUserRequest): Promise<void>;
|
|
31
|
+
declare function patchUpdateRoleUserByAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
32
|
+
userId: string;
|
|
33
|
+
}, body: UpdateUserRoleByAdminRequest): Promise<void>;
|
|
34
|
+
declare function patchUpdateUserBySAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
35
|
+
userId: string;
|
|
36
|
+
}, patch: UpdateUserBySAdminRequest): Promise<void>;
|
|
27
37
|
|
|
28
38
|
declare function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>>;
|
|
29
39
|
|
|
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 getCompanyById(http: HttpClient, accessToken: string, { companyId }: {
|
|
43
|
+
companyId: string;
|
|
44
|
+
}): Promise<IApiResponse<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<ProjectResponse | OwnerProjectResponse>>>;
|
|
53
|
+
declare function getMyProjectBySlug(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
54
|
+
projectSlug: string;
|
|
55
|
+
}): Promise<IApiResponse<ProjectResponse | 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 postCreateProjectByAdmin(http: HttpClient, accessToken: string, newProjectRequest: CreateProjectRequest): Promise<IApiResponse<ProjectResponse>>;
|
|
64
|
+
declare function postCreateProjectBySAdmin(http: HttpClient, accessToken: string, { companySlug }: {
|
|
65
|
+
companySlug: string;
|
|
66
|
+
}, newProjectRequest: CreateProjectRequest): Promise<IApiResponse<ProjectResponse>>;
|
|
67
|
+
declare function patchUpdateProjectByAdmin(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
68
|
+
projectSlug: string;
|
|
69
|
+
}, patch: UpdateProjectRequest): Promise<void>;
|
|
70
|
+
declare function patchUpdateProjectBySAdmin(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
71
|
+
companySlug: string;
|
|
72
|
+
projectSlug: string;
|
|
73
|
+
}, patch: UpdateProjectRequest): Promise<void>;
|
|
74
|
+
|
|
75
|
+
declare function getProperties(http: HttpClient, accessToken: string, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
76
|
+
declare function getMyProperties(http: HttpClient, accessToken: string, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<BuyerPropertyResponse>>>;
|
|
77
|
+
declare function getMyPropertyById(http: HttpClient, accessToken: string, { propertyId }: {
|
|
78
|
+
propertyId: string;
|
|
79
|
+
}): Promise<IApiResponse<BuyerPropertyResponse>>;
|
|
80
|
+
declare function getPropertiesByAdmin(http: HttpClient, accessToken: string, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse>>>;
|
|
81
|
+
declare function getPropertiesByProjectByAdmin(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
82
|
+
projectSlug: string;
|
|
83
|
+
}, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse>>>;
|
|
84
|
+
declare function getPropertyByProjectAndCodeByAdmin(http: HttpClient, accessToken: string, { projectSlug, propertyCode }: {
|
|
85
|
+
projectSlug: string;
|
|
86
|
+
propertyCode: string;
|
|
87
|
+
}): Promise<IApiResponse<PropertyResponse>>;
|
|
88
|
+
declare function getPropertiesByProject(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
89
|
+
companySlug: string;
|
|
90
|
+
projectSlug: string;
|
|
91
|
+
}, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
92
|
+
declare function getPropertyByProjectAndCode(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
93
|
+
companySlug: string;
|
|
94
|
+
projectSlug: string;
|
|
95
|
+
propertyCode: string;
|
|
96
|
+
}): Promise<IApiResponse<PropertyResponse | PublicPropertyResponse>>;
|
|
97
|
+
declare function postCreatePropertyByAdmin(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
98
|
+
projectSlug: string;
|
|
99
|
+
}, newPropertyRequest: CreatePropertyRequest): Promise<IApiResponse<PropertyResponse>>;
|
|
100
|
+
declare function postCreatePropertyBySAdmin(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
101
|
+
companySlug: string;
|
|
102
|
+
projectSlug: string;
|
|
103
|
+
}, newPropertyRequest: CreatePropertyRequest): Promise<IApiResponse<PropertyResponse>>;
|
|
104
|
+
declare function patchUpdatePropertyByAdmin(http: HttpClient, accessToken: string, { projectSlug, propertyCode }: {
|
|
105
|
+
projectSlug: string;
|
|
106
|
+
propertyCode: string;
|
|
107
|
+
}, patch: UpdatePropertyRequest): Promise<void>;
|
|
108
|
+
declare function patchUpdatePropertyBySAdmin(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
109
|
+
companySlug: string;
|
|
110
|
+
projectSlug: string;
|
|
111
|
+
propertyCode: string;
|
|
112
|
+
}, patch: UpdatePropertyRequest): Promise<void>;
|
|
113
|
+
|
|
30
114
|
interface CreateApiClientOptions {
|
|
31
115
|
readonly http: HttpClient;
|
|
32
116
|
}
|
|
@@ -42,9 +126,46 @@ interface ApiClient {
|
|
|
42
126
|
readonly me: (accessToken: string) => ReturnType<typeof getMe>;
|
|
43
127
|
};
|
|
44
128
|
readonly user: {
|
|
45
|
-
readonly
|
|
129
|
+
readonly users: (accessToken: string, userQuery: Parameters<typeof getUsers>[2]) => ReturnType<typeof getUsers>;
|
|
130
|
+
readonly userById: (accessToken: Parameters<typeof getUserById>[1], { userId }: Parameters<typeof getUserById>[2]) => ReturnType<typeof getUserById>;
|
|
131
|
+
readonly updateMe: (accessToken: Parameters<typeof patchUpdateMe>[1], patch: Parameters<typeof patchUpdateMe>[2]) => ReturnType<typeof patchUpdateMe>;
|
|
132
|
+
readonly updateRoleUserByAdmin: (accessToken: Parameters<typeof patchUpdateRoleUserByAdmin>[1], { userId }: Parameters<typeof patchUpdateRoleUserByAdmin>[2], body: Parameters<typeof patchUpdateRoleUserByAdmin>[3]) => ReturnType<typeof patchUpdateRoleUserByAdmin>;
|
|
133
|
+
readonly updateUserBySAdmin: (accessToken: Parameters<typeof patchUpdateUserBySAdmin>[1], { userId }: Parameters<typeof patchUpdateUserBySAdmin>[2], patch: Parameters<typeof patchUpdateUserBySAdmin>[3]) => ReturnType<typeof patchUpdateUserBySAdmin>;
|
|
134
|
+
};
|
|
135
|
+
readonly company: {
|
|
136
|
+
readonly companies: (accessToken: Parameters<typeof getCompanies>[1], companyQuery: Parameters<typeof getCompanies>[2]) => ReturnType<typeof getCompanies>;
|
|
137
|
+
readonly myCompany: (accessToken: Parameters<typeof getMyCompany>[1]) => ReturnType<typeof getMyCompany>;
|
|
138
|
+
readonly companyById: (accessToken: Parameters<typeof getCompanyById>[1], { companyId }: Parameters<typeof getCompanyById>[2]) => ReturnType<typeof getCompanyById>;
|
|
139
|
+
readonly createCompany: (accessToken: Parameters<typeof postCreateCompany>[1], newCompanyRequest: Parameters<typeof postCreateCompany>[2]) => ReturnType<typeof postCreateCompany>;
|
|
140
|
+
readonly updateMyCompany: (accessToken: Parameters<typeof patchUpdateMyCompany>[1], patch: Parameters<typeof patchUpdateMyCompany>[2]) => ReturnType<typeof patchUpdateMyCompany>;
|
|
141
|
+
readonly updateCompanyBySAdmin: (accessToken: Parameters<typeof patchUpdateCompanyBySAdmin>[1], { companyId }: Parameters<typeof patchUpdateCompanyBySAdmin>[2], patch: Parameters<typeof patchUpdateCompanyBySAdmin>[3]) => ReturnType<typeof patchUpdateCompanyBySAdmin>;
|
|
142
|
+
};
|
|
143
|
+
readonly project: {
|
|
144
|
+
readonly projects: (accessToken: Parameters<typeof getProjects>[1], projectQuery: Parameters<typeof getProjects>[2]) => ReturnType<typeof getProjects>;
|
|
145
|
+
readonly myProjects: (accessToken: Parameters<typeof getMyProjects>[1], projectQuery: Parameters<typeof getMyProjects>[2]) => ReturnType<typeof getMyProjects>;
|
|
146
|
+
readonly myProjectBySlug: (accessToken: Parameters<typeof getMyProjectBySlug>[1], { projectSlug }: Parameters<typeof getMyProjectBySlug>[2]) => ReturnType<typeof getMyProjectBySlug>;
|
|
147
|
+
readonly projectByCompanyAndSlug: (accessToken: Parameters<typeof getProjectByCompanyAndSlug>[1], { companySlug, projectSlug }: Parameters<typeof getProjectByCompanyAndSlug>[2]) => ReturnType<typeof getProjectByCompanyAndSlug>;
|
|
148
|
+
readonly projectsByCompany: (accessToken: Parameters<typeof getProjectsByCompany>[1], { companySlug }: Parameters<typeof getProjectsByCompany>[2], projectQuery: Parameters<typeof getProjectsByCompany>[3]) => ReturnType<typeof getProjectsByCompany>;
|
|
149
|
+
readonly createProjectByAdmin: (accessToken: Parameters<typeof postCreateProjectByAdmin>[1], newProjectRequest: Parameters<typeof postCreateProjectByAdmin>[2]) => ReturnType<typeof postCreateProjectByAdmin>;
|
|
150
|
+
readonly createProjectBySAdmin: (accessToken: Parameters<typeof postCreateProjectBySAdmin>[1], { companySlug }: Parameters<typeof postCreateProjectBySAdmin>[2], newProjectRequest: Parameters<typeof postCreateProjectBySAdmin>[3]) => ReturnType<typeof postCreateProjectBySAdmin>;
|
|
151
|
+
readonly updateProjectByAdmin: (accessToken: Parameters<typeof patchUpdateProjectByAdmin>[1], { projectSlug }: Parameters<typeof patchUpdateProjectByAdmin>[2], patch: Parameters<typeof patchUpdateProjectByAdmin>[3]) => ReturnType<typeof patchUpdateProjectByAdmin>;
|
|
152
|
+
readonly updateProjectBySAdmin: (accessToken: Parameters<typeof patchUpdateProjectBySAdmin>[1], { companySlug, projectSlug }: Parameters<typeof patchUpdateProjectBySAdmin>[2], patch: Parameters<typeof patchUpdateProjectBySAdmin>[3]) => ReturnType<typeof patchUpdateProjectBySAdmin>;
|
|
153
|
+
};
|
|
154
|
+
readonly property: {
|
|
155
|
+
readonly properties: (accessToken: Parameters<typeof getProperties>[1], propertyQuery: Parameters<typeof getProperties>[2]) => ReturnType<typeof getProperties>;
|
|
156
|
+
readonly myProperties: (accessToken: Parameters<typeof getMyProperties>[1], propertyQuery: Parameters<typeof getMyProperties>[2]) => ReturnType<typeof getMyProperties>;
|
|
157
|
+
readonly myPropertyById: (accessToken: Parameters<typeof getMyPropertyById>[1], { propertyId }: Parameters<typeof getMyPropertyById>[2]) => ReturnType<typeof getMyPropertyById>;
|
|
158
|
+
readonly propertiesByAdmin: (accessToken: Parameters<typeof getPropertiesByAdmin>[1], propertyQuery: Parameters<typeof getPropertiesByAdmin>[2]) => ReturnType<typeof getPropertiesByAdmin>;
|
|
159
|
+
readonly propertiesByProjectByAdmin: (accessToken: Parameters<typeof getPropertiesByProjectByAdmin>[1], { projectSlug }: Parameters<typeof getPropertiesByProjectByAdmin>[2], propertyQuery: Parameters<typeof getPropertiesByProjectByAdmin>[3]) => ReturnType<typeof getPropertiesByProjectByAdmin>;
|
|
160
|
+
readonly propertyByProjectAndCodeByAdmin: (accessToken: Parameters<typeof getPropertyByProjectAndCodeByAdmin>[1], { projectSlug, propertyCode }: Parameters<typeof getPropertyByProjectAndCodeByAdmin>[2]) => ReturnType<typeof getPropertyByProjectAndCodeByAdmin>;
|
|
161
|
+
readonly propertiesByProject: (accessToken: Parameters<typeof getPropertiesByProject>[1], { companySlug, projectSlug }: Parameters<typeof getPropertiesByProject>[2], propertyQuery: Parameters<typeof getPropertiesByProject>[3]) => ReturnType<typeof getPropertiesByProject>;
|
|
162
|
+
readonly propertyByProjectAndCode: (accessToken: Parameters<typeof getPropertyByProjectAndCode>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof getPropertyByProjectAndCode>[2]) => ReturnType<typeof getPropertyByProjectAndCode>;
|
|
163
|
+
readonly createPropertyByAdmin: (accessToken: Parameters<typeof postCreatePropertyByAdmin>[1], { projectSlug }: Parameters<typeof postCreatePropertyByAdmin>[2], newPropertyRequest: Parameters<typeof postCreatePropertyByAdmin>[3]) => ReturnType<typeof postCreatePropertyByAdmin>;
|
|
164
|
+
readonly createPropertyBySAdmin: (accessToken: Parameters<typeof postCreatePropertyBySAdmin>[1], { companySlug, projectSlug }: Parameters<typeof postCreatePropertyBySAdmin>[2], newPropertyRequest: Parameters<typeof postCreatePropertyBySAdmin>[3]) => ReturnType<typeof postCreatePropertyBySAdmin>;
|
|
165
|
+
readonly updatePropertyByAdmin: (accessToken: Parameters<typeof patchUpdatePropertyByAdmin>[1], { projectSlug, propertyCode }: Parameters<typeof patchUpdatePropertyByAdmin>[2], patch: Parameters<typeof patchUpdatePropertyByAdmin>[3]) => ReturnType<typeof patchUpdatePropertyByAdmin>;
|
|
166
|
+
readonly updatePropertyBySAdmin: (accessToken: Parameters<typeof patchUpdatePropertyBySAdmin>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof patchUpdatePropertyBySAdmin>[2], patch: Parameters<typeof patchUpdatePropertyBySAdmin>[3]) => ReturnType<typeof patchUpdatePropertyBySAdmin>;
|
|
46
167
|
};
|
|
47
168
|
}
|
|
48
169
|
declare function createApiClient(options: CreateApiClientOptions): ApiClient;
|
|
49
170
|
|
|
50
|
-
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPost, createApiClient, getGoogleOAuthStart, getMe, patchUpdateRoleUserByAdmin, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister };
|
|
171
|
+
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPost, createApiClient, getCompanies, getCompanyById, getGoogleOAuthStart, getMe, getMyCompany, getMyProjectBySlug, getMyProjects, getMyProperties, getMyPropertyById, getProjectByCompanyAndSlug, getProjects, getProjectsByCompany, getProperties, getPropertiesByAdmin, getPropertiesByProject, getPropertiesByProjectByAdmin, getPropertyByProjectAndCode, getPropertyByProjectAndCodeByAdmin, getUserById, getUsers, patchUpdateCompanyBySAdmin, patchUpdateMe, patchUpdateMyCompany, patchUpdateProjectByAdmin, patchUpdateProjectBySAdmin, patchUpdatePropertyByAdmin, patchUpdatePropertyBySAdmin, patchUpdateRoleUserByAdmin, patchUpdateUserBySAdmin, postCreateCompany, postCreateProjectByAdmin, postCreateProjectBySAdmin, postCreatePropertyByAdmin, postCreatePropertyBySAdmin, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, AuthUserResponse,
|
|
1
|
+
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, AuthUserResponse, GetUsersQueryByTokenRequest, IPaginatedByTokenResponse, ToAdminUsersResponse, ToSAdminUsersResponse, UpdateUserByUserRequest, UpdateUserRoleByAdminRequest, UpdateUserBySAdminRequest, HealthCheck, 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;
|
|
@@ -23,10 +23,94 @@ declare function postRefresh(http: HttpClient, body: RefreshRequest): Promise<IA
|
|
|
23
23
|
declare function postLogout(http: HttpClient, body: LogoutRequest): Promise<void>;
|
|
24
24
|
declare function getMe(http: HttpClient, accessToken: string): Promise<IApiResponse<AuthUserResponse>>;
|
|
25
25
|
|
|
26
|
-
declare function
|
|
26
|
+
declare function getUsers(http: HttpClient, accessToken: string, userQuery: GetUsersQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<ToAdminUsersResponse | ToSAdminUsersResponse>>>;
|
|
27
|
+
declare function getUserById(http: HttpClient, accessToken: string, { userId }: {
|
|
28
|
+
userId: string;
|
|
29
|
+
}): Promise<IApiResponse<ToSAdminUsersResponse>>;
|
|
30
|
+
declare function patchUpdateMe(http: HttpClient, accessToken: string, patch: UpdateUserByUserRequest): Promise<void>;
|
|
31
|
+
declare function patchUpdateRoleUserByAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
32
|
+
userId: string;
|
|
33
|
+
}, body: UpdateUserRoleByAdminRequest): Promise<void>;
|
|
34
|
+
declare function patchUpdateUserBySAdmin(http: HttpClient, accessToken: string, { userId }: {
|
|
35
|
+
userId: string;
|
|
36
|
+
}, patch: UpdateUserBySAdminRequest): Promise<void>;
|
|
27
37
|
|
|
28
38
|
declare function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>>;
|
|
29
39
|
|
|
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 getCompanyById(http: HttpClient, accessToken: string, { companyId }: {
|
|
43
|
+
companyId: string;
|
|
44
|
+
}): Promise<IApiResponse<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<ProjectResponse | OwnerProjectResponse>>>;
|
|
53
|
+
declare function getMyProjectBySlug(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
54
|
+
projectSlug: string;
|
|
55
|
+
}): Promise<IApiResponse<ProjectResponse | 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 postCreateProjectByAdmin(http: HttpClient, accessToken: string, newProjectRequest: CreateProjectRequest): Promise<IApiResponse<ProjectResponse>>;
|
|
64
|
+
declare function postCreateProjectBySAdmin(http: HttpClient, accessToken: string, { companySlug }: {
|
|
65
|
+
companySlug: string;
|
|
66
|
+
}, newProjectRequest: CreateProjectRequest): Promise<IApiResponse<ProjectResponse>>;
|
|
67
|
+
declare function patchUpdateProjectByAdmin(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
68
|
+
projectSlug: string;
|
|
69
|
+
}, patch: UpdateProjectRequest): Promise<void>;
|
|
70
|
+
declare function patchUpdateProjectBySAdmin(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
71
|
+
companySlug: string;
|
|
72
|
+
projectSlug: string;
|
|
73
|
+
}, patch: UpdateProjectRequest): Promise<void>;
|
|
74
|
+
|
|
75
|
+
declare function getProperties(http: HttpClient, accessToken: string, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
76
|
+
declare function getMyProperties(http: HttpClient, accessToken: string, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<BuyerPropertyResponse>>>;
|
|
77
|
+
declare function getMyPropertyById(http: HttpClient, accessToken: string, { propertyId }: {
|
|
78
|
+
propertyId: string;
|
|
79
|
+
}): Promise<IApiResponse<BuyerPropertyResponse>>;
|
|
80
|
+
declare function getPropertiesByAdmin(http: HttpClient, accessToken: string, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse>>>;
|
|
81
|
+
declare function getPropertiesByProjectByAdmin(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
82
|
+
projectSlug: string;
|
|
83
|
+
}, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse>>>;
|
|
84
|
+
declare function getPropertyByProjectAndCodeByAdmin(http: HttpClient, accessToken: string, { projectSlug, propertyCode }: {
|
|
85
|
+
projectSlug: string;
|
|
86
|
+
propertyCode: string;
|
|
87
|
+
}): Promise<IApiResponse<PropertyResponse>>;
|
|
88
|
+
declare function getPropertiesByProject(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
89
|
+
companySlug: string;
|
|
90
|
+
projectSlug: string;
|
|
91
|
+
}, propertyQuery: GetPropertiesQueryByTokenRequest): Promise<IApiResponse<IPaginatedByTokenResponse<PropertyResponse | PublicPropertyResponse>>>;
|
|
92
|
+
declare function getPropertyByProjectAndCode(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
93
|
+
companySlug: string;
|
|
94
|
+
projectSlug: string;
|
|
95
|
+
propertyCode: string;
|
|
96
|
+
}): Promise<IApiResponse<PropertyResponse | PublicPropertyResponse>>;
|
|
97
|
+
declare function postCreatePropertyByAdmin(http: HttpClient, accessToken: string, { projectSlug }: {
|
|
98
|
+
projectSlug: string;
|
|
99
|
+
}, newPropertyRequest: CreatePropertyRequest): Promise<IApiResponse<PropertyResponse>>;
|
|
100
|
+
declare function postCreatePropertyBySAdmin(http: HttpClient, accessToken: string, { companySlug, projectSlug }: {
|
|
101
|
+
companySlug: string;
|
|
102
|
+
projectSlug: string;
|
|
103
|
+
}, newPropertyRequest: CreatePropertyRequest): Promise<IApiResponse<PropertyResponse>>;
|
|
104
|
+
declare function patchUpdatePropertyByAdmin(http: HttpClient, accessToken: string, { projectSlug, propertyCode }: {
|
|
105
|
+
projectSlug: string;
|
|
106
|
+
propertyCode: string;
|
|
107
|
+
}, patch: UpdatePropertyRequest): Promise<void>;
|
|
108
|
+
declare function patchUpdatePropertyBySAdmin(http: HttpClient, accessToken: string, { companySlug, projectSlug, propertyCode, }: {
|
|
109
|
+
companySlug: string;
|
|
110
|
+
projectSlug: string;
|
|
111
|
+
propertyCode: string;
|
|
112
|
+
}, patch: UpdatePropertyRequest): Promise<void>;
|
|
113
|
+
|
|
30
114
|
interface CreateApiClientOptions {
|
|
31
115
|
readonly http: HttpClient;
|
|
32
116
|
}
|
|
@@ -42,9 +126,46 @@ interface ApiClient {
|
|
|
42
126
|
readonly me: (accessToken: string) => ReturnType<typeof getMe>;
|
|
43
127
|
};
|
|
44
128
|
readonly user: {
|
|
45
|
-
readonly
|
|
129
|
+
readonly users: (accessToken: string, userQuery: Parameters<typeof getUsers>[2]) => ReturnType<typeof getUsers>;
|
|
130
|
+
readonly userById: (accessToken: Parameters<typeof getUserById>[1], { userId }: Parameters<typeof getUserById>[2]) => ReturnType<typeof getUserById>;
|
|
131
|
+
readonly updateMe: (accessToken: Parameters<typeof patchUpdateMe>[1], patch: Parameters<typeof patchUpdateMe>[2]) => ReturnType<typeof patchUpdateMe>;
|
|
132
|
+
readonly updateRoleUserByAdmin: (accessToken: Parameters<typeof patchUpdateRoleUserByAdmin>[1], { userId }: Parameters<typeof patchUpdateRoleUserByAdmin>[2], body: Parameters<typeof patchUpdateRoleUserByAdmin>[3]) => ReturnType<typeof patchUpdateRoleUserByAdmin>;
|
|
133
|
+
readonly updateUserBySAdmin: (accessToken: Parameters<typeof patchUpdateUserBySAdmin>[1], { userId }: Parameters<typeof patchUpdateUserBySAdmin>[2], patch: Parameters<typeof patchUpdateUserBySAdmin>[3]) => ReturnType<typeof patchUpdateUserBySAdmin>;
|
|
134
|
+
};
|
|
135
|
+
readonly company: {
|
|
136
|
+
readonly companies: (accessToken: Parameters<typeof getCompanies>[1], companyQuery: Parameters<typeof getCompanies>[2]) => ReturnType<typeof getCompanies>;
|
|
137
|
+
readonly myCompany: (accessToken: Parameters<typeof getMyCompany>[1]) => ReturnType<typeof getMyCompany>;
|
|
138
|
+
readonly companyById: (accessToken: Parameters<typeof getCompanyById>[1], { companyId }: Parameters<typeof getCompanyById>[2]) => ReturnType<typeof getCompanyById>;
|
|
139
|
+
readonly createCompany: (accessToken: Parameters<typeof postCreateCompany>[1], newCompanyRequest: Parameters<typeof postCreateCompany>[2]) => ReturnType<typeof postCreateCompany>;
|
|
140
|
+
readonly updateMyCompany: (accessToken: Parameters<typeof patchUpdateMyCompany>[1], patch: Parameters<typeof patchUpdateMyCompany>[2]) => ReturnType<typeof patchUpdateMyCompany>;
|
|
141
|
+
readonly updateCompanyBySAdmin: (accessToken: Parameters<typeof patchUpdateCompanyBySAdmin>[1], { companyId }: Parameters<typeof patchUpdateCompanyBySAdmin>[2], patch: Parameters<typeof patchUpdateCompanyBySAdmin>[3]) => ReturnType<typeof patchUpdateCompanyBySAdmin>;
|
|
142
|
+
};
|
|
143
|
+
readonly project: {
|
|
144
|
+
readonly projects: (accessToken: Parameters<typeof getProjects>[1], projectQuery: Parameters<typeof getProjects>[2]) => ReturnType<typeof getProjects>;
|
|
145
|
+
readonly myProjects: (accessToken: Parameters<typeof getMyProjects>[1], projectQuery: Parameters<typeof getMyProjects>[2]) => ReturnType<typeof getMyProjects>;
|
|
146
|
+
readonly myProjectBySlug: (accessToken: Parameters<typeof getMyProjectBySlug>[1], { projectSlug }: Parameters<typeof getMyProjectBySlug>[2]) => ReturnType<typeof getMyProjectBySlug>;
|
|
147
|
+
readonly projectByCompanyAndSlug: (accessToken: Parameters<typeof getProjectByCompanyAndSlug>[1], { companySlug, projectSlug }: Parameters<typeof getProjectByCompanyAndSlug>[2]) => ReturnType<typeof getProjectByCompanyAndSlug>;
|
|
148
|
+
readonly projectsByCompany: (accessToken: Parameters<typeof getProjectsByCompany>[1], { companySlug }: Parameters<typeof getProjectsByCompany>[2], projectQuery: Parameters<typeof getProjectsByCompany>[3]) => ReturnType<typeof getProjectsByCompany>;
|
|
149
|
+
readonly createProjectByAdmin: (accessToken: Parameters<typeof postCreateProjectByAdmin>[1], newProjectRequest: Parameters<typeof postCreateProjectByAdmin>[2]) => ReturnType<typeof postCreateProjectByAdmin>;
|
|
150
|
+
readonly createProjectBySAdmin: (accessToken: Parameters<typeof postCreateProjectBySAdmin>[1], { companySlug }: Parameters<typeof postCreateProjectBySAdmin>[2], newProjectRequest: Parameters<typeof postCreateProjectBySAdmin>[3]) => ReturnType<typeof postCreateProjectBySAdmin>;
|
|
151
|
+
readonly updateProjectByAdmin: (accessToken: Parameters<typeof patchUpdateProjectByAdmin>[1], { projectSlug }: Parameters<typeof patchUpdateProjectByAdmin>[2], patch: Parameters<typeof patchUpdateProjectByAdmin>[3]) => ReturnType<typeof patchUpdateProjectByAdmin>;
|
|
152
|
+
readonly updateProjectBySAdmin: (accessToken: Parameters<typeof patchUpdateProjectBySAdmin>[1], { companySlug, projectSlug }: Parameters<typeof patchUpdateProjectBySAdmin>[2], patch: Parameters<typeof patchUpdateProjectBySAdmin>[3]) => ReturnType<typeof patchUpdateProjectBySAdmin>;
|
|
153
|
+
};
|
|
154
|
+
readonly property: {
|
|
155
|
+
readonly properties: (accessToken: Parameters<typeof getProperties>[1], propertyQuery: Parameters<typeof getProperties>[2]) => ReturnType<typeof getProperties>;
|
|
156
|
+
readonly myProperties: (accessToken: Parameters<typeof getMyProperties>[1], propertyQuery: Parameters<typeof getMyProperties>[2]) => ReturnType<typeof getMyProperties>;
|
|
157
|
+
readonly myPropertyById: (accessToken: Parameters<typeof getMyPropertyById>[1], { propertyId }: Parameters<typeof getMyPropertyById>[2]) => ReturnType<typeof getMyPropertyById>;
|
|
158
|
+
readonly propertiesByAdmin: (accessToken: Parameters<typeof getPropertiesByAdmin>[1], propertyQuery: Parameters<typeof getPropertiesByAdmin>[2]) => ReturnType<typeof getPropertiesByAdmin>;
|
|
159
|
+
readonly propertiesByProjectByAdmin: (accessToken: Parameters<typeof getPropertiesByProjectByAdmin>[1], { projectSlug }: Parameters<typeof getPropertiesByProjectByAdmin>[2], propertyQuery: Parameters<typeof getPropertiesByProjectByAdmin>[3]) => ReturnType<typeof getPropertiesByProjectByAdmin>;
|
|
160
|
+
readonly propertyByProjectAndCodeByAdmin: (accessToken: Parameters<typeof getPropertyByProjectAndCodeByAdmin>[1], { projectSlug, propertyCode }: Parameters<typeof getPropertyByProjectAndCodeByAdmin>[2]) => ReturnType<typeof getPropertyByProjectAndCodeByAdmin>;
|
|
161
|
+
readonly propertiesByProject: (accessToken: Parameters<typeof getPropertiesByProject>[1], { companySlug, projectSlug }: Parameters<typeof getPropertiesByProject>[2], propertyQuery: Parameters<typeof getPropertiesByProject>[3]) => ReturnType<typeof getPropertiesByProject>;
|
|
162
|
+
readonly propertyByProjectAndCode: (accessToken: Parameters<typeof getPropertyByProjectAndCode>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof getPropertyByProjectAndCode>[2]) => ReturnType<typeof getPropertyByProjectAndCode>;
|
|
163
|
+
readonly createPropertyByAdmin: (accessToken: Parameters<typeof postCreatePropertyByAdmin>[1], { projectSlug }: Parameters<typeof postCreatePropertyByAdmin>[2], newPropertyRequest: Parameters<typeof postCreatePropertyByAdmin>[3]) => ReturnType<typeof postCreatePropertyByAdmin>;
|
|
164
|
+
readonly createPropertyBySAdmin: (accessToken: Parameters<typeof postCreatePropertyBySAdmin>[1], { companySlug, projectSlug }: Parameters<typeof postCreatePropertyBySAdmin>[2], newPropertyRequest: Parameters<typeof postCreatePropertyBySAdmin>[3]) => ReturnType<typeof postCreatePropertyBySAdmin>;
|
|
165
|
+
readonly updatePropertyByAdmin: (accessToken: Parameters<typeof patchUpdatePropertyByAdmin>[1], { projectSlug, propertyCode }: Parameters<typeof patchUpdatePropertyByAdmin>[2], patch: Parameters<typeof patchUpdatePropertyByAdmin>[3]) => ReturnType<typeof patchUpdatePropertyByAdmin>;
|
|
166
|
+
readonly updatePropertyBySAdmin: (accessToken: Parameters<typeof patchUpdatePropertyBySAdmin>[1], { companySlug, projectSlug, propertyCode }: Parameters<typeof patchUpdatePropertyBySAdmin>[2], patch: Parameters<typeof patchUpdatePropertyBySAdmin>[3]) => ReturnType<typeof patchUpdatePropertyBySAdmin>;
|
|
46
167
|
};
|
|
47
168
|
}
|
|
48
169
|
declare function createApiClient(options: CreateApiClientOptions): ApiClient;
|
|
49
170
|
|
|
50
|
-
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPost, createApiClient, getGoogleOAuthStart, getMe, patchUpdateRoleUserByAdmin, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister };
|
|
171
|
+
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpGet, type HttpPost, createApiClient, getCompanies, getCompanyById, getGoogleOAuthStart, getMe, getMyCompany, getMyProjectBySlug, getMyProjects, getMyProperties, getMyPropertyById, getProjectByCompanyAndSlug, getProjects, getProjectsByCompany, getProperties, getPropertiesByAdmin, getPropertiesByProject, getPropertiesByProjectByAdmin, getPropertyByProjectAndCode, getPropertyByProjectAndCodeByAdmin, getUserById, getUsers, patchUpdateCompanyBySAdmin, patchUpdateMe, patchUpdateMyCompany, patchUpdateProjectByAdmin, patchUpdateProjectBySAdmin, patchUpdatePropertyByAdmin, patchUpdatePropertyBySAdmin, patchUpdateRoleUserByAdmin, patchUpdateUserBySAdmin, postCreateCompany, postCreateProjectByAdmin, postCreateProjectBySAdmin, postCreatePropertyByAdmin, postCreatePropertyBySAdmin, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister };
|