@hapl/api-queries 0.1.187--canary.117.ad0d1ca.0 → 0.1.187
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 -0
- package/dist/api-queries.cjs.development.js +0 -30
- package/dist/api-queries.cjs.development.js.map +1 -1
- package/dist/api-queries.cjs.production.min.js +1 -1
- package/dist/api-queries.cjs.production.min.js.map +1 -1
- package/dist/api-queries.esm.js +0 -30
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/expert/createExpertCase/index.d.ts +1 -1
- package/dist/clients/v1/api/index.d.ts +0 -1
- package/dist/clients/v1/index.d.ts +1 -2
- package/dist/clients/v1/types/index.d.ts +0 -1
- package/dist/clients/v2/api/realty/updateRealty/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/clients/v1/api/expert/createExpertCase/index.ts +1 -1
- package/src/clients/v1/api/index.ts +0 -2
- package/src/clients/v1/index.ts +1 -6
- package/src/clients/v1/types/index.ts +0 -1
- package/src/clients/v2/api/realty/updateRealty/index.ts +1 -0
- package/dist/clients/v1/api/event/findEventById/index.d.ts +0 -31
- package/dist/clients/v1/types/Event.d.ts +0 -12
- package/src/clients/v1/api/event/findEventById/index.ts +0 -39
- package/src/clients/v1/types/Event.ts +0 -11
|
@@ -12,7 +12,7 @@ export declare type CreateExpertCaseError = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare type CreateExpertCaseConfig = {
|
|
14
14
|
baseURL?: string;
|
|
15
|
-
headers
|
|
15
|
+
headers: CreateExpertCaseHeaders;
|
|
16
16
|
body: CreateExpertCaseBody;
|
|
17
17
|
};
|
|
18
18
|
export declare function createExpertCaseRequest({ baseURL, headers, body, }: CreateExpertCaseConfig): Promise<CreateExpertCaseData>;
|
|
@@ -49,7 +49,6 @@ export * from './deal/setDealSignPlannedState';
|
|
|
49
49
|
export * from './deal/setDealSignedState';
|
|
50
50
|
export * from './deal/terminateDeal';
|
|
51
51
|
export * from './deal/updateDeal';
|
|
52
|
-
export * from './event/findEventById';
|
|
53
52
|
export * from './expert/createExpertCase';
|
|
54
53
|
export * from './expert/createExpertReview';
|
|
55
54
|
export * from './expert/findExpertById';
|
|
@@ -53,8 +53,7 @@ export declare class Api {
|
|
|
53
53
|
setDealSignPlannedState: (urlParams: api.SetDealSignPlannedStateUrlParams, body: api.SetDealSignPlannedStateBody, headers: api.SetDealSignPlannedStateHeaders) => Promise<api.SetDealSignPlannedStateData>;
|
|
54
54
|
terminateDeal: (urlParams: api.TerminateDealUrlParams, body: api.TerminateDealBody, headers: api.TerminateDealHeaders) => Promise<api.TerminateDealData>;
|
|
55
55
|
updateDeal: (urlParams: api.UpdateDealUrlParams, body: api.UpdateDealBody, headers: api.UpdateDealHeaders) => Promise<api.UpdateDealData>;
|
|
56
|
-
|
|
57
|
-
createExpertCase: (body: api.CreateExpertCaseBody, headers?: api.CreateExpertCaseHeaders | undefined) => Promise<api.CreateExpertCaseData>;
|
|
56
|
+
createExpertCase: (body: api.CreateExpertCaseBody, headers: api.CreateExpertCaseHeaders) => Promise<api.CreateExpertCaseData>;
|
|
58
57
|
createExpertReview: (urlParams: api.CreateExpertReviewUrlParams, body: api.CreateExpertReviewBody, headers: api.CreateExpertReviewHeaders) => Promise<api.CreateExpertReviewData>;
|
|
59
58
|
findExpertById: (urlParams: api.FindExpertByIdUrlParams, headers: api.FindExpertByIdHeaders) => Promise<api.FindExpertByIdData>;
|
|
60
59
|
findExpertCaseById: (urlParams: api.FindExpertCaseByIdUrlParams, headers?: api.FindExpertCaseByIdHeaders | undefined) => Promise<api.FindExpertCaseByIdData>;
|
|
@@ -50,6 +50,9 @@ export declare type UpdateRealtyBody = {
|
|
|
50
50
|
type: Realty['type'];
|
|
51
51
|
attributes?: Pick<Realty['attributes'], RequiredAttributes> & Nullable<Omit<Realty['attributes'], RequiredAttributes>>;
|
|
52
52
|
relationships?: Realty['relationships'];
|
|
53
|
+
meta: {
|
|
54
|
+
refreshedAt?: string;
|
|
55
|
+
};
|
|
53
56
|
};
|
|
54
57
|
};
|
|
55
58
|
export declare type UpdateRealtyData = AxiosResponse<ResultData>;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export type CreateExpertCaseData = { data: UserCase };
|
|
|
11
11
|
export type CreateExpertCaseError = { status: number; data: string };
|
|
12
12
|
export type CreateExpertCaseConfig = {
|
|
13
13
|
baseURL?: string;
|
|
14
|
-
headers
|
|
14
|
+
headers: CreateExpertCaseHeaders;
|
|
15
15
|
body: CreateExpertCaseBody;
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -59,8 +59,6 @@ export * from './deal/setDealSignedState';
|
|
|
59
59
|
export * from './deal/terminateDeal';
|
|
60
60
|
export * from './deal/updateDeal';
|
|
61
61
|
|
|
62
|
-
export * from './event/findEventById';
|
|
63
|
-
|
|
64
62
|
export * from './expert/createExpertCase';
|
|
65
63
|
export * from './expert/createExpertReview';
|
|
66
64
|
export * from './expert/findExpertById';
|
package/src/clients/v1/index.ts
CHANGED
|
@@ -310,14 +310,9 @@ export class Api {
|
|
|
310
310
|
return api.updateDealRequest({ urlParams, body, headers, baseURL: this.baseURL });
|
|
311
311
|
};
|
|
312
312
|
|
|
313
|
-
// event
|
|
314
|
-
findEventById = (urlParams: api.FindEventByIdUrlParams, headers?: api.FindEventByIdHeaders) => {
|
|
315
|
-
return api.findEventByIdRequest({ urlParams, headers, baseURL: this.baseURL });
|
|
316
|
-
};
|
|
317
|
-
|
|
318
313
|
// expert
|
|
319
314
|
|
|
320
|
-
createExpertCase = (body: api.CreateExpertCaseBody, headers
|
|
315
|
+
createExpertCase = (body: api.CreateExpertCaseBody, headers: api.CreateExpertCaseHeaders) => {
|
|
321
316
|
return api.createExpertCaseRequest({ body, headers, baseURL: this.baseURL });
|
|
322
317
|
};
|
|
323
318
|
|
|
@@ -41,6 +41,7 @@ export type UpdateRealtyBody = {
|
|
|
41
41
|
attributes?: Pick<Realty['attributes'], RequiredAttributes> &
|
|
42
42
|
Nullable<Omit<Realty['attributes'], RequiredAttributes>>;
|
|
43
43
|
relationships?: Realty['relationships'];
|
|
44
|
+
meta: { refreshedAt?: string };
|
|
44
45
|
};
|
|
45
46
|
};
|
|
46
47
|
export type UpdateRealtyData = AxiosResponse<ResultData>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
-
import { Event } from '../../../types';
|
|
3
|
-
declare type SuccessData = {
|
|
4
|
-
success: true;
|
|
5
|
-
data: Partial<Event> & {
|
|
6
|
-
id: number;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
declare type ErrorData = {
|
|
10
|
-
success: false;
|
|
11
|
-
data: {
|
|
12
|
-
error: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
declare type ResultData = SuccessData['data'];
|
|
16
|
-
declare type ResultError = ErrorData['data']['error'];
|
|
17
|
-
export declare type FindEventByIdUrlParams = {
|
|
18
|
-
id: number;
|
|
19
|
-
};
|
|
20
|
-
export declare type FindEventByIdHeaders = {
|
|
21
|
-
'x-auth-hc'?: string;
|
|
22
|
-
};
|
|
23
|
-
export declare type FindEventByIdData = AxiosResponse<ResultData>;
|
|
24
|
-
export declare type FindEventByIdError = AxiosError<ResultError>;
|
|
25
|
-
export declare type FindEventByIdConfig = {
|
|
26
|
-
baseURL?: string;
|
|
27
|
-
urlParams: FindEventByIdUrlParams;
|
|
28
|
-
headers?: FindEventByIdHeaders;
|
|
29
|
-
};
|
|
30
|
-
export declare function findEventByIdRequest({ baseURL, urlParams, headers, }: FindEventByIdConfig): Promise<FindEventByIdData>;
|
|
31
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
-
import { Event } from '../../../types';
|
|
3
|
-
|
|
4
|
-
type SuccessData = { success: true; data: Partial<Event> & { id: number } };
|
|
5
|
-
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
-
|
|
7
|
-
type ResultData = SuccessData['data'];
|
|
8
|
-
type ResultError = ErrorData['data']['error'];
|
|
9
|
-
|
|
10
|
-
export type FindEventByIdUrlParams = { id: number };
|
|
11
|
-
export type FindEventByIdHeaders = { 'x-auth-hc'?: string };
|
|
12
|
-
export type FindEventByIdData = AxiosResponse<ResultData>;
|
|
13
|
-
export type FindEventByIdError = AxiosError<ResultError>;
|
|
14
|
-
|
|
15
|
-
export type FindEventByIdConfig = {
|
|
16
|
-
baseURL?: string;
|
|
17
|
-
urlParams: FindEventByIdUrlParams;
|
|
18
|
-
headers?: FindEventByIdHeaders;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export function findEventByIdRequest({
|
|
22
|
-
baseURL = 'https://clients.homeapp.ru',
|
|
23
|
-
urlParams,
|
|
24
|
-
headers,
|
|
25
|
-
}: FindEventByIdConfig) {
|
|
26
|
-
return axios
|
|
27
|
-
.get(`/api/site/event/${urlParams.id}`, {
|
|
28
|
-
baseURL,
|
|
29
|
-
headers: { Accept: 'application/json', ...headers },
|
|
30
|
-
transformResponse: [
|
|
31
|
-
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
32
|
-
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
33
|
-
],
|
|
34
|
-
})
|
|
35
|
-
.then((res: FindEventByIdData) => res)
|
|
36
|
-
.catch((err: FindEventByIdError) => {
|
|
37
|
-
throw err;
|
|
38
|
-
});
|
|
39
|
-
}
|