@hapl/api-queries 0.2.80 → 0.2.81
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/api-queries.cjs.development.js +632 -576
- 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 +632 -576
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/index.d.ts +1 -0
- package/dist/clients/v1/api/photoOrder/completePhotoOrder/index.d.ts +24 -0
- package/dist/clients/v1/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/clients/v1/api/index.ts +1 -0
- package/src/clients/v1/api/photoOrder/completePhotoOrder/index.ts +37 -0
- package/src/clients/v1/index.ts +4 -0
|
@@ -150,6 +150,7 @@ export * from './photoOrder/createPhotoOrder';
|
|
|
150
150
|
export * from './photoOrder/findPhotoOrders';
|
|
151
151
|
export * from './photoOrder/sendPhotoOrderFeedback';
|
|
152
152
|
export * from './photoOrder/terminatePhotoOrder';
|
|
153
|
+
export * from './photoOrder/completePhotoOrder';
|
|
153
154
|
export * from './realty/findRealtyDuplicate';
|
|
154
155
|
export * from './realty/findRealtyPriceHistory';
|
|
155
156
|
export * from './realty/findSimilarRealtyIdsById';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
declare type ErrorData = {
|
|
3
|
+
success: false;
|
|
4
|
+
data: {
|
|
5
|
+
error: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare type ResultData = null;
|
|
9
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
10
|
+
export declare type CompletePhotoOrderHeaders = {
|
|
11
|
+
'x-auth-hc': string;
|
|
12
|
+
};
|
|
13
|
+
export declare type CompletePhotoOrderUrlParams = {
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type CompletePhotoOrderData = AxiosResponse<ResultData>;
|
|
17
|
+
export declare type CompletePhotoOrderError = AxiosError<ResultError>;
|
|
18
|
+
export declare type CompletePhotoOrderConfig = {
|
|
19
|
+
baseURL?: string;
|
|
20
|
+
urlParams: CompletePhotoOrderUrlParams;
|
|
21
|
+
headers: CompletePhotoOrderHeaders;
|
|
22
|
+
};
|
|
23
|
+
export declare function completePhotoOrderRequest({ baseURL, urlParams, headers, }: CompletePhotoOrderConfig): Promise<CompletePhotoOrderData>;
|
|
24
|
+
export {};
|
|
@@ -153,6 +153,7 @@ export declare class Api {
|
|
|
153
153
|
createPhotoOrder: (body: api.CreatePhotoOrderBody, headers: api.CreatePhotoOrderHeaders) => Promise<api.CreatePhotoOrderData>;
|
|
154
154
|
findPhotoOrders: (params: api.FindPhotoOrdersParams, headers: api.FindPhotoOrdersHeaders) => Promise<api.FindPhotoOrdersData>;
|
|
155
155
|
sendPhotoOrderFeedback: (urlParams: api.SendPhotoOrderFeedbackUrlParams, headers: api.SendPhotoOrderFeedbackHeaders) => Promise<api.SendPhotoOrderFeedbackData>;
|
|
156
|
+
completePhotoOrder: (urlParams: api.CompletePhotoOrderUrlParams, headers: api.CompletePhotoOrderHeaders) => Promise<api.CompletePhotoOrderData>;
|
|
156
157
|
terminatePhotoOrder: (urlParams: api.TerminatePhotoOrderUrlParams, headers: api.TerminatePhotoOrderHeaders) => Promise<api.TerminatePhotoOrderData>;
|
|
157
158
|
findRealtyDuplicate: (params: api.FindRealtyDuplicateParams, headers: api.FindRealtyDuplicateHeaders) => Promise<api.FindRealtyDuplicateData>;
|
|
158
159
|
findRealtyPriceHistory: (params: api.FindRealtyPriceHistoryParams, headers: api.FindRealtyPriceHistoryHeaders) => Promise<api.FindRealtyPriceHistoryData>;
|
package/package.json
CHANGED
|
@@ -180,6 +180,7 @@ export * from './photoOrder/createPhotoOrder';
|
|
|
180
180
|
export * from './photoOrder/findPhotoOrders';
|
|
181
181
|
export * from './photoOrder/sendPhotoOrderFeedback';
|
|
182
182
|
export * from './photoOrder/terminatePhotoOrder';
|
|
183
|
+
export * from './photoOrder/completePhotoOrder';
|
|
183
184
|
|
|
184
185
|
export * from './realty/findRealtyDuplicate';
|
|
185
186
|
export * from './realty/findRealtyPriceHistory';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosResponseTransformer } from 'axios';
|
|
2
|
+
|
|
3
|
+
type SuccessData = { success: true };
|
|
4
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
5
|
+
|
|
6
|
+
type ResultData = null;
|
|
7
|
+
type ResultError = ErrorData['data']['error'];
|
|
8
|
+
|
|
9
|
+
export type CompletePhotoOrderHeaders = { 'x-auth-hc': string };
|
|
10
|
+
export type CompletePhotoOrderUrlParams = { id: string };
|
|
11
|
+
export type CompletePhotoOrderData = AxiosResponse<ResultData>;
|
|
12
|
+
export type CompletePhotoOrderError = AxiosError<ResultError>;
|
|
13
|
+
export type CompletePhotoOrderConfig = {
|
|
14
|
+
baseURL?: string;
|
|
15
|
+
urlParams: CompletePhotoOrderUrlParams;
|
|
16
|
+
headers: CompletePhotoOrderHeaders;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function completePhotoOrderRequest({
|
|
20
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
21
|
+
urlParams,
|
|
22
|
+
headers,
|
|
23
|
+
}: CompletePhotoOrderConfig) {
|
|
24
|
+
return axios
|
|
25
|
+
.patch(`/api/order-photos/${urlParams.id}/complete`, null, {
|
|
26
|
+
baseURL,
|
|
27
|
+
headers: { Accept: 'application/json', ...headers },
|
|
28
|
+
transformResponse: [
|
|
29
|
+
...(axios.defaults.transformResponse as AxiosResponseTransformer[]),
|
|
30
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? null : data.data.error),
|
|
31
|
+
],
|
|
32
|
+
})
|
|
33
|
+
.then((res: CompletePhotoOrderData) => res)
|
|
34
|
+
.catch((err: CompletePhotoOrderError) => {
|
|
35
|
+
throw err;
|
|
36
|
+
});
|
|
37
|
+
}
|
package/src/clients/v1/index.ts
CHANGED
|
@@ -931,6 +931,10 @@ export class Api {
|
|
|
931
931
|
return api.sendPhotoOrderFeedbackRequest({ urlParams, headers, baseURL: await this.baseURL });
|
|
932
932
|
};
|
|
933
933
|
|
|
934
|
+
completePhotoOrder = async (urlParams: api.CompletePhotoOrderUrlParams, headers: api.CompletePhotoOrderHeaders) => {
|
|
935
|
+
return api.completePhotoOrderRequest({ urlParams, headers, baseURL: await this.baseURL });
|
|
936
|
+
};
|
|
937
|
+
|
|
934
938
|
terminatePhotoOrder = async (
|
|
935
939
|
urlParams: api.TerminatePhotoOrderUrlParams,
|
|
936
940
|
headers: api.TerminatePhotoOrderHeaders
|