@justins-home/api-services 1.1.7 → 1.2.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/dist/index.d.mts +1931 -0
- package/dist/index.d.ts +1931 -0
- package/dist/index.js +6 -3
- package/dist/index.mjs +8 -4
- package/package.json +17 -5
- package/.turbo/turbo-build.log +0 -13
- package/CHANGELOG.md +0 -97
- package/src/api-client.ts +0 -108
- package/src/generated/admin.ts +0 -311
- package/src/generated/agent.ts +0 -11
- package/src/generated/appointment.ts +0 -36
- package/src/generated/auth.ts +0 -26
- package/src/generated/booking.ts +0 -26
- package/src/generated/conversations.ts +0 -31
- package/src/generated/customer.ts +0 -31
- package/src/generated/feature.ts +0 -11
- package/src/generated/github.ts +0 -16
- package/src/generated/google.ts +0 -16
- package/src/generated/inspection.ts +0 -11
- package/src/generated/landlord.ts +0 -126
- package/src/generated/listings.ts +0 -21
- package/src/generated/maintenance.ts +0 -21
- package/src/generated/notification.ts +0 -31
- package/src/generated/plan.ts +0 -16
- package/src/generated/review.ts +0 -36
- package/src/generated/tenancy.ts +0 -61
- package/src/generated/tenant.ts +0 -31
- package/src/generated/userverification.ts +0 -26
- package/src/generated/wishlist.ts +0 -21
- package/src/helpers/authTokenInit.ts +0 -1
- package/src/index.ts +0 -39
- package/src/types/openapi.ts +0 -29
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -39,6 +40,7 @@ __export(index_exports, {
|
|
|
39
40
|
plan: () => plan,
|
|
40
41
|
review: () => review,
|
|
41
42
|
setupAuth: () => import_http_client2.initApiToken,
|
|
43
|
+
setupClient: () => import_http_client2.configureHttpClient,
|
|
42
44
|
tenancy: () => tenancy,
|
|
43
45
|
tenant: () => tenant,
|
|
44
46
|
userverification: () => userverification,
|
|
@@ -61,18 +63,18 @@ var ApiError = class extends Error {
|
|
|
61
63
|
}
|
|
62
64
|
};
|
|
63
65
|
function normalizeError(error, operation) {
|
|
64
|
-
const response = error
|
|
66
|
+
const response = error?.response;
|
|
65
67
|
if (!response) {
|
|
66
68
|
throw new ApiError("Network error", void 0, void 0, operation);
|
|
67
69
|
}
|
|
68
70
|
const { status, data } = response;
|
|
69
71
|
let message = "Request failed";
|
|
70
|
-
if (data
|
|
72
|
+
if (data?.errors) {
|
|
71
73
|
const firstError = Object.values(data.errors)[0];
|
|
72
74
|
if (Array.isArray(firstError)) {
|
|
73
75
|
message = firstError[0];
|
|
74
76
|
}
|
|
75
|
-
} else if (data
|
|
77
|
+
} else if (data?.message) {
|
|
76
78
|
message = data.message;
|
|
77
79
|
}
|
|
78
80
|
throw new ApiError(message, status, data, operation);
|
|
@@ -680,6 +682,7 @@ var wishlist = {
|
|
|
680
682
|
plan,
|
|
681
683
|
review,
|
|
682
684
|
setupAuth,
|
|
685
|
+
setupClient,
|
|
683
686
|
tenancy,
|
|
684
687
|
tenant,
|
|
685
688
|
userverification,
|
package/dist/index.mjs
CHANGED
|
@@ -13,18 +13,18 @@ var ApiError = class extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
function normalizeError(error, operation) {
|
|
16
|
-
const response = error
|
|
16
|
+
const response = error?.response;
|
|
17
17
|
if (!response) {
|
|
18
18
|
throw new ApiError("Network error", void 0, void 0, operation);
|
|
19
19
|
}
|
|
20
20
|
const { status, data } = response;
|
|
21
21
|
let message = "Request failed";
|
|
22
|
-
if (data
|
|
22
|
+
if (data?.errors) {
|
|
23
23
|
const firstError = Object.values(data.errors)[0];
|
|
24
24
|
if (Array.isArray(firstError)) {
|
|
25
25
|
message = firstError[0];
|
|
26
26
|
}
|
|
27
|
-
} else if (data
|
|
27
|
+
} else if (data?.message) {
|
|
28
28
|
message = data.message;
|
|
29
29
|
}
|
|
30
30
|
throw new ApiError(message, status, data, operation);
|
|
@@ -51,7 +51,10 @@ var api = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// src/helpers/authTokenInit.ts
|
|
54
|
-
import {
|
|
54
|
+
import {
|
|
55
|
+
configureHttpClient,
|
|
56
|
+
initApiToken
|
|
57
|
+
} from "@justins-home/http-client";
|
|
55
58
|
|
|
56
59
|
// src/generated/admin.ts
|
|
57
60
|
var admin = {
|
|
@@ -631,6 +634,7 @@ export {
|
|
|
631
634
|
plan,
|
|
632
635
|
review,
|
|
633
636
|
initApiToken as setupAuth,
|
|
637
|
+
configureHttpClient as setupClient,
|
|
634
638
|
tenancy,
|
|
635
639
|
tenant,
|
|
636
640
|
userverification,
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justins-home/api-services",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
6
18
|
"dependencies": {
|
|
7
|
-
"@justins-home/http-client": "1.0
|
|
8
|
-
"@justins-home/types": "1.
|
|
19
|
+
"@justins-home/http-client": "1.1.0",
|
|
20
|
+
"@justins-home/types": "1.1.0"
|
|
9
21
|
},
|
|
10
22
|
"publishConfig": {
|
|
11
23
|
"access": "public"
|
|
@@ -13,7 +25,7 @@
|
|
|
13
25
|
"scripts": {
|
|
14
26
|
"lint": "eslint src",
|
|
15
27
|
"check-types": "tsc --noEmit -p ../../tsconfig.base.json",
|
|
16
|
-
"build": "tsup src/index.ts --format esm,cjs",
|
|
28
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --tsconfig tsconfig.json",
|
|
17
29
|
"test": "vitest"
|
|
18
30
|
}
|
|
19
31
|
}
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @justins-home/api-services@1.1.7 build /home/runner/work/justins-home-platform-ui/justins-home-platform-ui/packages/api-services
|
|
3
|
-
> tsup src/index.ts --format esm,cjs
|
|
4
|
-
|
|
5
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
-
[34mCLI[39m tsup v8.5.1
|
|
7
|
-
[34mCLI[39m Target: node16
|
|
8
|
-
[34mESM[39m Build start
|
|
9
|
-
[34mCJS[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m25.23 KB[39m
|
|
11
|
-
[32mESM[39m ⚡️ Build success in 48ms
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[32m26.89 KB[39m
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in 49ms
|
package/CHANGELOG.md
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# @justins-home/api-services
|
|
2
|
-
|
|
3
|
-
## 1.1.7
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies
|
|
8
|
-
- @justins-home/http-client@1.0.5
|
|
9
|
-
|
|
10
|
-
## 1.1.6
|
|
11
|
-
|
|
12
|
-
### Patch Changes
|
|
13
|
-
|
|
14
|
-
- fix validated script
|
|
15
|
-
- Updated dependencies
|
|
16
|
-
- @justins-home/http-client@1.0.4
|
|
17
|
-
|
|
18
|
-
## 1.1.5
|
|
19
|
-
|
|
20
|
-
### Patch Changes
|
|
21
|
-
|
|
22
|
-
- created a setup auth handler for handling token
|
|
23
|
-
- Updated dependencies
|
|
24
|
-
- @justins-home/http-client@1.0.3
|
|
25
|
-
|
|
26
|
-
## 1.1.4
|
|
27
|
-
|
|
28
|
-
### Patch Changes
|
|
29
|
-
|
|
30
|
-
- add new endpoint for landlord basic login
|
|
31
|
-
|
|
32
|
-
## 1.1.3
|
|
33
|
-
|
|
34
|
-
### Patch Changes
|
|
35
|
-
|
|
36
|
-
- added more typing to TS scribe doc
|
|
37
|
-
- Updated dependencies
|
|
38
|
-
- @justins-home/http-client@1.0.2
|
|
39
|
-
|
|
40
|
-
## 1.1.2
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- added ApiError to normalizeError
|
|
45
|
-
- Updated dependencies
|
|
46
|
-
- @justins-home/http-client@1.0.1
|
|
47
|
-
|
|
48
|
-
## 1.1.1
|
|
49
|
-
|
|
50
|
-
### Patch Changes
|
|
51
|
-
|
|
52
|
-
- feat(api-client): normalize Laravel API errors for all consumers
|
|
53
|
-
|
|
54
|
-
## 1.1.0
|
|
55
|
-
|
|
56
|
-
### Minor Changes
|
|
57
|
-
|
|
58
|
-
- aced108: added minor pumb
|
|
59
|
-
- 26690e2: release initial packages
|
|
60
|
-
|
|
61
|
-
### Patch Changes
|
|
62
|
-
|
|
63
|
-
- Updated dependencies [aced108]
|
|
64
|
-
- Updated dependencies [26690e2]
|
|
65
|
-
- @justins-home/http-client@1.0.0
|
|
66
|
-
- @justins-home/types@1.0.0
|
|
67
|
-
|
|
68
|
-
## 1.0.0
|
|
69
|
-
|
|
70
|
-
### Major Changes
|
|
71
|
-
|
|
72
|
-
- 77a273c: made package public
|
|
73
|
-
- fd43ee2: first release
|
|
74
|
-
|
|
75
|
-
## 0.3.0
|
|
76
|
-
|
|
77
|
-
### Minor Changes
|
|
78
|
-
|
|
79
|
-
- 5cffb1f: add public access
|
|
80
|
-
|
|
81
|
-
## 0.2.0
|
|
82
|
-
|
|
83
|
-
### Minor Changes
|
|
84
|
-
|
|
85
|
-
- 3f39ece: first release
|
|
86
|
-
|
|
87
|
-
### Patch Changes
|
|
88
|
-
|
|
89
|
-
- Updated dependencies [3f39ece]
|
|
90
|
-
- @justins-home/http-client@0.1.0
|
|
91
|
-
- @justins-home/types@0.0.2
|
|
92
|
-
|
|
93
|
-
## 0.1.0
|
|
94
|
-
|
|
95
|
-
### Minor Changes
|
|
96
|
-
|
|
97
|
-
- first change
|
package/src/api-client.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { authClient } from '@justins-home/http-client';
|
|
2
|
-
import type { operations } from '@justins-home/types/generated/api-types';
|
|
3
|
-
|
|
4
|
-
export class ApiError<T = unknown> extends Error {
|
|
5
|
-
status?: number;
|
|
6
|
-
data?: T;
|
|
7
|
-
operation?: string;
|
|
8
|
-
|
|
9
|
-
constructor(message: string, status?: number, data?: T, operation?: string) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.name = 'ApiError';
|
|
12
|
-
this.status = status;
|
|
13
|
-
this.data = data;
|
|
14
|
-
this.operation = operation;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type OperationId = keyof operations;
|
|
19
|
-
|
|
20
|
-
type ApiRequest<T extends OperationId> = operations[T] extends {
|
|
21
|
-
requestBody: { content: { 'application/json': infer R } };
|
|
22
|
-
}
|
|
23
|
-
? R
|
|
24
|
-
: operations[T] extends {
|
|
25
|
-
parameters: { query?: infer Q };
|
|
26
|
-
}
|
|
27
|
-
? Q
|
|
28
|
-
: never;
|
|
29
|
-
|
|
30
|
-
type ApiResponse<T extends OperationId> = operations[T] extends {
|
|
31
|
-
responses: { 200: { content: { 'application/json': infer R } } };
|
|
32
|
-
}
|
|
33
|
-
? R
|
|
34
|
-
: unknown;
|
|
35
|
-
|
|
36
|
-
type ApiErrorResponse<T extends OperationId> = operations[T] extends {
|
|
37
|
-
responses: infer R;
|
|
38
|
-
}
|
|
39
|
-
? {
|
|
40
|
-
[K in keyof R]: K extends 200
|
|
41
|
-
? never
|
|
42
|
-
: R[K] extends {
|
|
43
|
-
content: { 'application/json': infer E };
|
|
44
|
-
}
|
|
45
|
-
? E
|
|
46
|
-
: never;
|
|
47
|
-
}[keyof R]
|
|
48
|
-
: unknown;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Normalizes Laravel API errors
|
|
52
|
-
*/
|
|
53
|
-
function normalizeError<T extends OperationId>(
|
|
54
|
-
error: any,
|
|
55
|
-
operation: T,
|
|
56
|
-
): never {
|
|
57
|
-
const response = error?.response;
|
|
58
|
-
|
|
59
|
-
if (!response) {
|
|
60
|
-
throw new ApiError('Network error', undefined, undefined, operation);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const { status, data } = response;
|
|
64
|
-
|
|
65
|
-
let message = 'Request failed';
|
|
66
|
-
|
|
67
|
-
if (data?.errors) {
|
|
68
|
-
const firstError = Object.values(data.errors)[0];
|
|
69
|
-
if (Array.isArray(firstError)) {
|
|
70
|
-
message = firstError[0];
|
|
71
|
-
}
|
|
72
|
-
} else if (data?.message) {
|
|
73
|
-
message = data.message;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
throw new ApiError<ApiErrorResponse<T>>(message, status, data, operation);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const api = {
|
|
80
|
-
async post<T extends OperationId>(
|
|
81
|
-
operation: T,
|
|
82
|
-
url: string,
|
|
83
|
-
payload?: ApiRequest<T>,
|
|
84
|
-
): Promise<ApiResponse<T>> {
|
|
85
|
-
try {
|
|
86
|
-
const res = await authClient.post(url, payload ?? {});
|
|
87
|
-
return res.data;
|
|
88
|
-
} catch (error) {
|
|
89
|
-
normalizeError(error, operation);
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
async get<T extends OperationId>(
|
|
94
|
-
operation: T,
|
|
95
|
-
url: string,
|
|
96
|
-
query?: ApiRequest<T>,
|
|
97
|
-
): Promise<ApiResponse<T>> {
|
|
98
|
-
try {
|
|
99
|
-
const res = await authClient.get(url, {
|
|
100
|
-
params: query,
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
return res.data;
|
|
104
|
-
} catch (error) {
|
|
105
|
-
normalizeError(error, operation);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
};
|
package/src/generated/admin.ts
DELETED
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { api } from "../api-client";
|
|
3
|
-
import type { ApiRequest, ApiPathParams, Expand } from "../types/openapi";
|
|
4
|
-
|
|
5
|
-
export const admin = {
|
|
6
|
-
|
|
7
|
-
new: (payload: ApiRequest<'newAdmin'>) => {
|
|
8
|
-
return api.post('newAdmin', "/api/v1/portal/admin/create-admin", payload);
|
|
9
|
-
}
|
|
10
|
-
,
|
|
11
|
-
|
|
12
|
-
getSubmittedListing: () => {
|
|
13
|
-
return api.get('getSubmittedListing', "/api/v1/portal/admin/listing/review");
|
|
14
|
-
}
|
|
15
|
-
,
|
|
16
|
-
|
|
17
|
-
approveListing: (params: ApiPathParams<'approveListing'>) => {
|
|
18
|
-
return api.post('approveListing', `/api/v1/portal/admin/listing/${params.listing_uid}/approve`);
|
|
19
|
-
}
|
|
20
|
-
,
|
|
21
|
-
|
|
22
|
-
rejectListing: (params: ApiPathParams<'rejectListing'>, payload: ApiRequest<'rejectListing'>) => {
|
|
23
|
-
return api.post('rejectListing', `/api/v1/portal/admin/listing/${params.listing_uid}/reject`, payload);
|
|
24
|
-
}
|
|
25
|
-
,
|
|
26
|
-
|
|
27
|
-
unpublishListing: (params: ApiPathParams<'unpublishListing'>) => {
|
|
28
|
-
return api.post('unpublishListing', `/api/v1/portal/admin/listing/${params.listing_uid}/unpublish`);
|
|
29
|
-
}
|
|
30
|
-
,
|
|
31
|
-
|
|
32
|
-
republishListing: (params: ApiPathParams<'republishListing'>) => {
|
|
33
|
-
return api.post('republishListing', `/api/v1/portal/admin/listing/${params.listing_uid}/republish`);
|
|
34
|
-
}
|
|
35
|
-
,
|
|
36
|
-
|
|
37
|
-
getFeatures: () => {
|
|
38
|
-
return api.post('getFeaturesAdmin', "/api/v1/portal/admin/feature/fetch-all");
|
|
39
|
-
}
|
|
40
|
-
,
|
|
41
|
-
|
|
42
|
-
createFeature: (payload: ApiRequest<'createFeature'>) => {
|
|
43
|
-
return api.post('createFeature', "/api/v1/portal/admin/feature/create", payload);
|
|
44
|
-
}
|
|
45
|
-
,
|
|
46
|
-
|
|
47
|
-
updateFeature: (params: ApiPathParams<'updateFeature'>, payload: ApiRequest<'updateFeature'>) => {
|
|
48
|
-
return api.post('updateFeature', `/api/v1/portal/admin/feature/${params.feature_id}/update`, payload);
|
|
49
|
-
}
|
|
50
|
-
,
|
|
51
|
-
|
|
52
|
-
toggleFeature: (params: ApiPathParams<'toggleFeature'>) => {
|
|
53
|
-
return api.post('toggleFeature', `/api/v1/portal/admin/feature/${params.feature_id}/toggle`);
|
|
54
|
-
}
|
|
55
|
-
,
|
|
56
|
-
|
|
57
|
-
getFeatureCategories: () => {
|
|
58
|
-
return api.get('getFeatureCategories', "/api/v1/portal/admin/feature/category/fetch-all");
|
|
59
|
-
}
|
|
60
|
-
,
|
|
61
|
-
|
|
62
|
-
createFeatureCategory: (payload: ApiRequest<'createFeatureCategory'>) => {
|
|
63
|
-
return api.post('createFeatureCategory', "/api/v1/portal/admin/feature/category/create", payload);
|
|
64
|
-
}
|
|
65
|
-
,
|
|
66
|
-
|
|
67
|
-
updateFeatureCategory: (params: ApiPathParams<'updateFeatureCategory'>, payload: ApiRequest<'updateFeatureCategory'>) => {
|
|
68
|
-
return api.post('updateFeatureCategory', `/api/v1/portal/admin/feature/category/${params.category_id}/update`, payload);
|
|
69
|
-
}
|
|
70
|
-
,
|
|
71
|
-
|
|
72
|
-
toggleFeatureCategory: (params: ApiPathParams<'toggleFeatureCategory'>) => {
|
|
73
|
-
return api.post('toggleFeatureCategory', `/api/v1/portal/admin/feature/category/${params.category_id}/toggle`);
|
|
74
|
-
}
|
|
75
|
-
,
|
|
76
|
-
|
|
77
|
-
getVerificationLayers: () => {
|
|
78
|
-
return api.get('getVerificationLayers', "/api/v1/portal/admin/verification/layers/fetch-all");
|
|
79
|
-
}
|
|
80
|
-
,
|
|
81
|
-
|
|
82
|
-
createVerificationLayer: (payload: ApiRequest<'createVerificationLayer'>) => {
|
|
83
|
-
return api.post('createVerificationLayer', "/api/v1/portal/admin/verification/layers/create", payload);
|
|
84
|
-
}
|
|
85
|
-
,
|
|
86
|
-
|
|
87
|
-
updateVerificationLayer: (params: ApiPathParams<'updateVerificationLayer'>, payload: ApiRequest<'updateVerificationLayer'>) => {
|
|
88
|
-
return api.post('updateVerificationLayer', `/api/v1/portal/admin/verification/layers/update/${params.verificationLayer_id}`, payload);
|
|
89
|
-
}
|
|
90
|
-
,
|
|
91
|
-
|
|
92
|
-
getVerificationFlows: () => {
|
|
93
|
-
return api.get('getVerificationFlows', "/api/v1/portal/admin/verification/flows/fetch-all");
|
|
94
|
-
}
|
|
95
|
-
,
|
|
96
|
-
|
|
97
|
-
createVerificationFlow: (payload: ApiRequest<'createVerificationFlow'>) => {
|
|
98
|
-
return api.post('createVerificationFlow', "/api/v1/portal/admin/verification/flows/create", payload);
|
|
99
|
-
}
|
|
100
|
-
,
|
|
101
|
-
|
|
102
|
-
reorderVerificationFlow: (payload: ApiRequest<'reorderVerificationFlow'>) => {
|
|
103
|
-
return api.post('reorderVerificationFlow', "/api/v1/portal/admin/verification/flows/reorder", payload);
|
|
104
|
-
}
|
|
105
|
-
,
|
|
106
|
-
|
|
107
|
-
getUserVerifications: (query?: Expand<ApiRequest<'getUserVerifications'>>) => {
|
|
108
|
-
return api.get('getUserVerifications', "/api/v1/portal/admin/verification/fetch-all", query);
|
|
109
|
-
}
|
|
110
|
-
,
|
|
111
|
-
|
|
112
|
-
getUserVerificationHistory: (params: ApiPathParams<'getUserVerificationHistory'>) => {
|
|
113
|
-
return api.get('getUserVerificationHistory', `/api/v1/portal/admin/verification/user/${params.userId}`);
|
|
114
|
-
}
|
|
115
|
-
,
|
|
116
|
-
|
|
117
|
-
reviewUserVerification: (params: ApiPathParams<'reviewUserVerification'>, payload: ApiRequest<'reviewUserVerification'>) => {
|
|
118
|
-
return api.post('reviewUserVerification', `/api/v1/portal/admin/verification/reviews/${params.userVerificationId}`, payload);
|
|
119
|
-
}
|
|
120
|
-
,
|
|
121
|
-
|
|
122
|
-
resetUserVerification: (params: ApiPathParams<'resetUserVerification'>, payload: ApiRequest<'resetUserVerification'>) => {
|
|
123
|
-
return api.post('resetUserVerification', `/api/v1/portal/admin/verification/reset/${params.userVerificationId}`, payload);
|
|
124
|
-
}
|
|
125
|
-
,
|
|
126
|
-
|
|
127
|
-
getListingComplianceSubmissions: () => {
|
|
128
|
-
return api.get('getListingComplianceSubmissions', "/api/v1/portal/admin/verification/fetch-compliances");
|
|
129
|
-
}
|
|
130
|
-
,
|
|
131
|
-
|
|
132
|
-
getTenancyComplianceSubmissions: () => {
|
|
133
|
-
return api.get('getTenancyComplianceSubmissions', "/api/v1/portal/admin/verification/fetch-tenancy-compliances");
|
|
134
|
-
}
|
|
135
|
-
,
|
|
136
|
-
|
|
137
|
-
reviewListingComplianceSubmission: (params: ApiPathParams<'reviewListingComplianceSubmission'>, payload: ApiRequest<'reviewListingComplianceSubmission'>) => {
|
|
138
|
-
return api.post('reviewListingComplianceSubmission', `/api/v1/portal/admin/verification/review-compliance/${params.submissionId}`, payload);
|
|
139
|
-
}
|
|
140
|
-
,
|
|
141
|
-
|
|
142
|
-
reviewTenancyComplianceSubmission: (params: ApiPathParams<'reviewTenancyComplianceSubmission'>, payload: ApiRequest<'reviewTenancyComplianceSubmission'>) => {
|
|
143
|
-
return api.post('reviewTenancyComplianceSubmission', `/api/v1/portal/admin/verification/review-tenancy-compliance/${params.submissionId}`, payload);
|
|
144
|
-
}
|
|
145
|
-
,
|
|
146
|
-
|
|
147
|
-
getPlans: () => {
|
|
148
|
-
return api.get('getPlans', "/api/v1/portal/admin/plans/fetch-all");
|
|
149
|
-
}
|
|
150
|
-
,
|
|
151
|
-
|
|
152
|
-
createPlan: (payload: ApiRequest<'createPlan'>) => {
|
|
153
|
-
return api.post('createPlan', "/api/v1/portal/admin/plans/create", payload);
|
|
154
|
-
}
|
|
155
|
-
,
|
|
156
|
-
|
|
157
|
-
updatePlan: (params: ApiPathParams<'updatePlan'>, payload: ApiRequest<'updatePlan'>) => {
|
|
158
|
-
return api.post('updatePlan', `/api/v1/portal/admin/plans/update/${params.plan_id}`, payload);
|
|
159
|
-
}
|
|
160
|
-
,
|
|
161
|
-
|
|
162
|
-
assignPlanToUser: (params: ApiPathParams<'assignPlanToUser'>, payload: ApiRequest<'assignPlanToUser'>) => {
|
|
163
|
-
return api.post('assignPlanToUser', `/api/v1/portal/admin/plans/assign-to-user/${params.user_id}`, payload);
|
|
164
|
-
}
|
|
165
|
-
,
|
|
166
|
-
|
|
167
|
-
deactivateUserPlan: (params: ApiPathParams<'deactivateUserPlan'>, payload: ApiRequest<'deactivateUserPlan'>) => {
|
|
168
|
-
return api.post('deactivateUserPlan', `/api/v1/portal/admin/plans/deactivate-from-user/${params.user_id}`, payload);
|
|
169
|
-
}
|
|
170
|
-
,
|
|
171
|
-
|
|
172
|
-
attachPlanVerificationRequirements: (params: ApiPathParams<'attachPlanVerificationRequirements'>, payload: ApiRequest<'attachPlanVerificationRequirements'>) => {
|
|
173
|
-
return api.post('attachPlanVerificationRequirements', `/api/v1/portal/admin/plans/${params.plan_id}/requirements`, payload);
|
|
174
|
-
}
|
|
175
|
-
,
|
|
176
|
-
|
|
177
|
-
attachPlanCapabilities: (params: ApiPathParams<'attachPlanCapabilities'>, payload: ApiRequest<'attachPlanCapabilities'>) => {
|
|
178
|
-
return api.post('attachPlanCapabilities', `/api/v1/portal/admin/plans/${params.plan_id}/capabilities`, payload);
|
|
179
|
-
}
|
|
180
|
-
,
|
|
181
|
-
|
|
182
|
-
getPlanEntitlements: () => {
|
|
183
|
-
return api.get('getPlanEntitlements', "/api/v1/portal/admin/plans/entitlements/fetch-all");
|
|
184
|
-
}
|
|
185
|
-
,
|
|
186
|
-
|
|
187
|
-
createPlanEntitlement: (payload: ApiRequest<'createPlanEntitlement'>) => {
|
|
188
|
-
return api.post('createPlanEntitlement', "/api/v1/portal/admin/plans/entitlements/create", payload);
|
|
189
|
-
}
|
|
190
|
-
,
|
|
191
|
-
|
|
192
|
-
updatePlanEntitlement: (params: ApiPathParams<'updatePlanEntitlement'>, payload: ApiRequest<'updatePlanEntitlement'>) => {
|
|
193
|
-
return api.post('updatePlanEntitlement', `/api/v1/portal/admin/plans/entitlements/update/${params.entitlement_key}`, payload);
|
|
194
|
-
}
|
|
195
|
-
,
|
|
196
|
-
|
|
197
|
-
syncPlanEntitlements: (params: ApiPathParams<'syncPlanEntitlements'>, payload: ApiRequest<'syncPlanEntitlements'>) => {
|
|
198
|
-
return api.post('syncPlanEntitlements', `/api/v1/portal/admin/plans/entitlements/sync/${params.plan_id}`, payload);
|
|
199
|
-
}
|
|
200
|
-
,
|
|
201
|
-
|
|
202
|
-
getCapabilities: () => {
|
|
203
|
-
return api.get('getCapabilities', "/api/v1/portal/admin/capability/fetch-all");
|
|
204
|
-
}
|
|
205
|
-
,
|
|
206
|
-
|
|
207
|
-
createCapability: (payload: ApiRequest<'createCapability'>) => {
|
|
208
|
-
return api.post('createCapability', "/api/v1/portal/admin/capability/create", payload);
|
|
209
|
-
}
|
|
210
|
-
,
|
|
211
|
-
|
|
212
|
-
updateCapability: (params: ApiPathParams<'updateCapability'>, payload: ApiRequest<'updateCapability'>) => {
|
|
213
|
-
return api.post('updateCapability', `/api/v1/portal/admin/capability/update/${params.capability_id}`, payload);
|
|
214
|
-
}
|
|
215
|
-
,
|
|
216
|
-
|
|
217
|
-
getComplianceDefinitions: () => {
|
|
218
|
-
return api.get('getComplianceDefinitions', "/api/v1/portal/admin/compliances/fetch-all");
|
|
219
|
-
}
|
|
220
|
-
,
|
|
221
|
-
|
|
222
|
-
createComplianceDefinition: (payload: ApiRequest<'createComplianceDefinition'>) => {
|
|
223
|
-
return api.post('createComplianceDefinition', "/api/v1/portal/admin/compliances/create", payload);
|
|
224
|
-
}
|
|
225
|
-
,
|
|
226
|
-
|
|
227
|
-
updateComplianceDefinition: (params: ApiPathParams<'updateComplianceDefinition'>, payload: ApiRequest<'updateComplianceDefinition'>) => {
|
|
228
|
-
return api.post('updateComplianceDefinition', `/api/v1/portal/admin/compliances/update/${params.compliance_id}`, payload);
|
|
229
|
-
}
|
|
230
|
-
,
|
|
231
|
-
|
|
232
|
-
syncComplianceRequirements: (params: ApiPathParams<'syncComplianceRequirements'>, payload: ApiRequest<'syncComplianceRequirements'>) => {
|
|
233
|
-
return api.post('syncComplianceRequirements', `/api/v1/portal/admin/compliances/${params.compliance_id}/sync-requirements`, payload);
|
|
234
|
-
}
|
|
235
|
-
,
|
|
236
|
-
|
|
237
|
-
assignGlobalCompliance: (params: ApiPathParams<'assignGlobalCompliance'>) => {
|
|
238
|
-
return api.post('assignGlobalCompliance', `/api/v1/portal/admin/compliances/${params.compliance_id}/assign-global`);
|
|
239
|
-
}
|
|
240
|
-
,
|
|
241
|
-
|
|
242
|
-
assignComplianceToCategory: (params: ApiPathParams<'assignComplianceToCategory'>) => {
|
|
243
|
-
return api.post('assignComplianceToCategory', `/api/v1/portal/admin/compliances/${params.compliance_id}/assign-category/${params.categoryId}`);
|
|
244
|
-
}
|
|
245
|
-
,
|
|
246
|
-
|
|
247
|
-
assignComplianceToListing: (params: ApiPathParams<'assignComplianceToListing'>) => {
|
|
248
|
-
return api.post('assignComplianceToListing', `/api/v1/portal/admin/compliances/${params.compliance_id}/assign-to-listing/${params.listingId}`);
|
|
249
|
-
}
|
|
250
|
-
,
|
|
251
|
-
|
|
252
|
-
assignComplianceToTenancy: (params: ApiPathParams<'assignComplianceToTenancy'>) => {
|
|
253
|
-
return api.post('assignComplianceToTenancy', `/api/v1/portal/admin/compliances/${params.compliance_id}/assign-to-tenancy/${params.tenancy_id}`);
|
|
254
|
-
}
|
|
255
|
-
,
|
|
256
|
-
|
|
257
|
-
listingHistoryInspection: (params: ApiPathParams<'listingHistoryInspectionAdmin'>) => {
|
|
258
|
-
return api.get('listingHistoryInspectionAdmin', `/api/v1/portal/admin/inspections/fetch-history/${params.listing_uid}`);
|
|
259
|
-
}
|
|
260
|
-
,
|
|
261
|
-
|
|
262
|
-
scheduleInspection: (payload: ApiRequest<'scheduleInspection'>) => {
|
|
263
|
-
return api.post('scheduleInspection', "/api/v1/portal/admin/inspections/schedule", payload);
|
|
264
|
-
}
|
|
265
|
-
,
|
|
266
|
-
|
|
267
|
-
completeInspection: (params: ApiPathParams<'completeInspection'>, payload: ApiRequest<'completeInspection'>) => {
|
|
268
|
-
return api.post('completeInspection', `/api/v1/portal/admin/inspections/${params.uid}/complete`, payload);
|
|
269
|
-
}
|
|
270
|
-
,
|
|
271
|
-
|
|
272
|
-
rescheduleInspection: (params: ApiPathParams<'rescheduleInspection'>, payload: ApiRequest<'rescheduleInspection'>) => {
|
|
273
|
-
return api.post('rescheduleInspection', `/api/v1/portal/admin/inspections/${params.uid}/reschedule`, payload);
|
|
274
|
-
}
|
|
275
|
-
,
|
|
276
|
-
|
|
277
|
-
cancelInspection: (params: ApiPathParams<'cancelInspection'>, payload: ApiRequest<'cancelInspection'>) => {
|
|
278
|
-
return api.post('cancelInspection', `/api/v1/portal/admin/inspections/${params.uid}/cancel`, payload);
|
|
279
|
-
}
|
|
280
|
-
,
|
|
281
|
-
|
|
282
|
-
assignMaintenanceTechnician: (params: ApiPathParams<'assignMaintenanceTechnician'>, payload: ApiRequest<'assignMaintenanceTechnician'>) => {
|
|
283
|
-
return api.post('assignMaintenanceTechnician', `/api/v1/portal/admin/maintenance/${params.uid}/assign`, payload);
|
|
284
|
-
}
|
|
285
|
-
,
|
|
286
|
-
|
|
287
|
-
startMaintenanceRepair: (params: ApiPathParams<'startMaintenanceRepair'>, payload: ApiRequest<'startMaintenanceRepair'>) => {
|
|
288
|
-
return api.post('startMaintenanceRepair', `/api/v1/portal/admin/maintenance/${params.uid}/start`, payload);
|
|
289
|
-
}
|
|
290
|
-
,
|
|
291
|
-
|
|
292
|
-
completeMaintenanceRepair: (params: ApiPathParams<'completeMaintenanceRepair'>, payload: ApiRequest<'completeMaintenanceRepair'>) => {
|
|
293
|
-
return api.post('completeMaintenanceRepair', `/api/v1/portal/admin/maintenance/${params.uid}/complete`, payload);
|
|
294
|
-
}
|
|
295
|
-
,
|
|
296
|
-
|
|
297
|
-
cancelMaintenanceRequest: (params: ApiPathParams<'cancelMaintenanceRequest'>, payload: ApiRequest<'cancelMaintenanceRequest'>) => {
|
|
298
|
-
return api.post('cancelMaintenanceRequest', `/api/v1/portal/admin/maintenance/${params.uid}/cancel`, payload);
|
|
299
|
-
}
|
|
300
|
-
,
|
|
301
|
-
|
|
302
|
-
assignComplianceToListingVertical: (params: ApiPathParams<'assignComplianceToListingVertical'>, payload: ApiRequest<'assignComplianceToListingVertical'>) => {
|
|
303
|
-
return api.post('assignComplianceToListingVertical', `/api/v1/portal/admin/compliances/${params.compliance_id}/assign-to-listing-vertical`, payload);
|
|
304
|
-
}
|
|
305
|
-
,
|
|
306
|
-
|
|
307
|
-
assignComplianceToListingType: (params: ApiPathParams<'assignComplianceToListingType'>, payload: ApiRequest<'assignComplianceToListingType'>) => {
|
|
308
|
-
return api.post('assignComplianceToListingType', `/api/v1/portal/admin/compliances/${params.compliance_id}/assign-to-listing-type`, payload);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
};
|
package/src/generated/agent.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { api } from "../api-client";
|
|
3
|
-
import type { ApiRequest, ApiPathParams, Expand } from "../types/openapi";
|
|
4
|
-
|
|
5
|
-
export const agent = {
|
|
6
|
-
|
|
7
|
-
getApiV1PortalAgentTest: () => {
|
|
8
|
-
return api.get('getApiV1PortalAgentTest', "/api/v1/portal/agent/test");
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
};
|