@hapl/api-queries 0.2.74 → 0.2.75
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 +19 -0
- 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 +19 -0
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/external/api/dadata/findDadataSuggestions.d.ts +156 -0
- package/dist/external/api/index.d.ts +1 -0
- package/dist/external/index.d.ts +104 -0
- package/package.json +1 -1
- package/src/external/api/dadata/findDadataSuggestions.ts +152 -0
- package/src/external/api/index.ts +2 -0
- package/src/external/index.ts +4 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
declare type SuccessData = {
|
|
3
|
+
suggestions: Array<{
|
|
4
|
+
value: string;
|
|
5
|
+
data: {
|
|
6
|
+
area: string | null;
|
|
7
|
+
area_fias_id: string | null;
|
|
8
|
+
area_kladr_id: string | null;
|
|
9
|
+
area_type: string | null;
|
|
10
|
+
area_type_full: string | null;
|
|
11
|
+
area_with_type: string | null;
|
|
12
|
+
beltway_distance: string | null;
|
|
13
|
+
beltway_hit: 'IN_MKAD' | 'OUT_MKAD' | 'IN_KAD' | 'OUT_KAD' | null;
|
|
14
|
+
block: string | null;
|
|
15
|
+
block_type: string | null;
|
|
16
|
+
block_type_full: string | null;
|
|
17
|
+
federal_district: string | null;
|
|
18
|
+
capital_marker: '0' | '1' | '2' | '3' | '4';
|
|
19
|
+
city: string | null;
|
|
20
|
+
city_area: string | null;
|
|
21
|
+
city_district: string | null;
|
|
22
|
+
city_district_fias_id: string | null;
|
|
23
|
+
city_district_kladr_id: string | null;
|
|
24
|
+
city_district_type: string | null;
|
|
25
|
+
city_district_type_full: string | null;
|
|
26
|
+
city_district_with_type: string | null;
|
|
27
|
+
city_fias_id: string | null;
|
|
28
|
+
city_kladr_id: string | null;
|
|
29
|
+
city_type: string | null;
|
|
30
|
+
city_type_full: string | null;
|
|
31
|
+
city_with_type: string | null;
|
|
32
|
+
country: string;
|
|
33
|
+
country_iso_code: string;
|
|
34
|
+
fias_id: string;
|
|
35
|
+
fias_level: string;
|
|
36
|
+
flat: string | null;
|
|
37
|
+
flat_area: string | null;
|
|
38
|
+
flat_price: null;
|
|
39
|
+
flat_type: string | null;
|
|
40
|
+
flat_type_full: string | null;
|
|
41
|
+
flat_fias_id?: string | null;
|
|
42
|
+
flat_cadnum?: null;
|
|
43
|
+
geo_lat: string | null;
|
|
44
|
+
geo_lon: string | null;
|
|
45
|
+
geoname_id: string | null;
|
|
46
|
+
history_values: string[] | null;
|
|
47
|
+
house: string | null;
|
|
48
|
+
house_fias_id: string | null;
|
|
49
|
+
house_kladr_id: string | null;
|
|
50
|
+
house_type: string | null;
|
|
51
|
+
house_type_full: string | null;
|
|
52
|
+
house_cadnum?: null;
|
|
53
|
+
entrance?: null;
|
|
54
|
+
floor?: null;
|
|
55
|
+
kladr_id: string;
|
|
56
|
+
okato: string | null;
|
|
57
|
+
oktmo: string | null;
|
|
58
|
+
postal_box: string | null;
|
|
59
|
+
postal_code: string | null;
|
|
60
|
+
qc: null;
|
|
61
|
+
qc_complete: null;
|
|
62
|
+
qc_geo: '0' | '1' | '2' | '3' | '4' | '5' | null;
|
|
63
|
+
qc_house: null;
|
|
64
|
+
region: string;
|
|
65
|
+
region_fias_id: string;
|
|
66
|
+
region_kladr_id: string;
|
|
67
|
+
region_type: string;
|
|
68
|
+
region_type_full: string;
|
|
69
|
+
region_with_type: string;
|
|
70
|
+
settlement: string | null;
|
|
71
|
+
settlement_fias_id: string | null;
|
|
72
|
+
settlement_kladr_id: string | null;
|
|
73
|
+
settlement_type: string | null;
|
|
74
|
+
settlement_type_full: string | null;
|
|
75
|
+
settlement_with_type: string | null;
|
|
76
|
+
source: string | null;
|
|
77
|
+
square_meter_price?: string | null;
|
|
78
|
+
street: string | null;
|
|
79
|
+
street_fias_id: string | null;
|
|
80
|
+
street_kladr_id: string | null;
|
|
81
|
+
street_type: string | null;
|
|
82
|
+
street_type_full: string | null;
|
|
83
|
+
street_with_type: string | null;
|
|
84
|
+
stead?: string | null;
|
|
85
|
+
stead_fias_id?: string | null;
|
|
86
|
+
stead_kladr_id?: string | null;
|
|
87
|
+
stead_type?: string | null;
|
|
88
|
+
stead_type_full?: string | null;
|
|
89
|
+
stead_cadnum?: null;
|
|
90
|
+
tax_office: string | null;
|
|
91
|
+
tax_office_legal: string | null;
|
|
92
|
+
timezone: string | null;
|
|
93
|
+
unparsed_parts: null;
|
|
94
|
+
fias_code: string;
|
|
95
|
+
region_iso_code: string;
|
|
96
|
+
fias_actuality_state: string;
|
|
97
|
+
metro: Array<{
|
|
98
|
+
name: string;
|
|
99
|
+
line: string;
|
|
100
|
+
distance: number;
|
|
101
|
+
}> | null;
|
|
102
|
+
divisions?: unknown;
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
106
|
+
declare type GranularHint = {
|
|
107
|
+
value: 'country' | 'region' | 'area' | 'city' | 'settlement' | 'street' | 'house' | 'flat';
|
|
108
|
+
};
|
|
109
|
+
export declare type FindDadataSuggestionsBody = {
|
|
110
|
+
query: string;
|
|
111
|
+
count?: number;
|
|
112
|
+
language?: string;
|
|
113
|
+
division?: string;
|
|
114
|
+
locations?: Array<{
|
|
115
|
+
country_iso_code?: string;
|
|
116
|
+
region_iso_code?: string;
|
|
117
|
+
kladr_id?: string;
|
|
118
|
+
country?: string;
|
|
119
|
+
region?: string;
|
|
120
|
+
area?: string;
|
|
121
|
+
city?: string;
|
|
122
|
+
settlement?: string;
|
|
123
|
+
street?: string;
|
|
124
|
+
region_type_full?: string;
|
|
125
|
+
area_type_full?: string;
|
|
126
|
+
city_type_full?: string;
|
|
127
|
+
settlement_type_full?: string;
|
|
128
|
+
street_type_full?: string;
|
|
129
|
+
fias_id?: string;
|
|
130
|
+
region_fias_id?: string;
|
|
131
|
+
area_fias_id?: string;
|
|
132
|
+
city_fias_id?: string;
|
|
133
|
+
settlement_fias_id?: string;
|
|
134
|
+
street_fias_id?: string;
|
|
135
|
+
}>;
|
|
136
|
+
locations_geo?: Array<{
|
|
137
|
+
lat: number;
|
|
138
|
+
lon: number;
|
|
139
|
+
radius_meters?: number;
|
|
140
|
+
}>;
|
|
141
|
+
locations_boost?: Array<{
|
|
142
|
+
kladr_id: string;
|
|
143
|
+
}>;
|
|
144
|
+
from_bound?: GranularHint;
|
|
145
|
+
to_bound?: GranularHint;
|
|
146
|
+
};
|
|
147
|
+
export declare type FindDadataSuggestionsHeaders = {
|
|
148
|
+
Authorization: string;
|
|
149
|
+
};
|
|
150
|
+
export declare type FindDadataSuggestionsData = AxiosResponse<SuccessData>;
|
|
151
|
+
export declare type FindDadataSuggestionsConfig = {
|
|
152
|
+
body: FindDadataSuggestionsBody;
|
|
153
|
+
headers: FindDadataSuggestionsHeaders;
|
|
154
|
+
};
|
|
155
|
+
export declare function findDadataSuggestionsRequest({ body, headers }: FindDadataSuggestionsConfig): Promise<AxiosResponse<SuccessData, any>>;
|
|
156
|
+
export {};
|
package/dist/external/index.d.ts
CHANGED
|
@@ -1,6 +1,110 @@
|
|
|
1
1
|
import * as api from './api';
|
|
2
2
|
export declare class Api {
|
|
3
3
|
findCallTransferByExpertId: (urlParams: api.FindCallTransferByExpertIdUrlParams) => Promise<api.FindCallTransferByExpertIdData>;
|
|
4
|
+
findDadataSuggestions: (body: api.FindDadataSuggestionsBody, headers: api.FindDadataSuggestionsHeaders) => Promise<import("axios").AxiosResponse<{
|
|
5
|
+
suggestions: {
|
|
6
|
+
value: string;
|
|
7
|
+
data: {
|
|
8
|
+
area: string | null;
|
|
9
|
+
area_fias_id: string | null;
|
|
10
|
+
area_kladr_id: string | null;
|
|
11
|
+
area_type: string | null;
|
|
12
|
+
area_type_full: string | null;
|
|
13
|
+
area_with_type: string | null;
|
|
14
|
+
beltway_distance: string | null;
|
|
15
|
+
beltway_hit: "IN_MKAD" | "OUT_MKAD" | "IN_KAD" | "OUT_KAD" | null;
|
|
16
|
+
block: string | null;
|
|
17
|
+
block_type: string | null;
|
|
18
|
+
block_type_full: string | null;
|
|
19
|
+
federal_district: string | null;
|
|
20
|
+
capital_marker: "0" | "1" | "2" | "3" | "4";
|
|
21
|
+
city: string | null;
|
|
22
|
+
city_area: string | null;
|
|
23
|
+
city_district: string | null;
|
|
24
|
+
city_district_fias_id: string | null;
|
|
25
|
+
city_district_kladr_id: string | null;
|
|
26
|
+
city_district_type: string | null;
|
|
27
|
+
city_district_type_full: string | null;
|
|
28
|
+
city_district_with_type: string | null;
|
|
29
|
+
city_fias_id: string | null;
|
|
30
|
+
city_kladr_id: string | null;
|
|
31
|
+
city_type: string | null;
|
|
32
|
+
city_type_full: string | null;
|
|
33
|
+
city_with_type: string | null;
|
|
34
|
+
country: string;
|
|
35
|
+
country_iso_code: string;
|
|
36
|
+
fias_id: string;
|
|
37
|
+
fias_level: string;
|
|
38
|
+
flat: string | null;
|
|
39
|
+
flat_area: string | null;
|
|
40
|
+
flat_price: null;
|
|
41
|
+
flat_type: string | null;
|
|
42
|
+
flat_type_full: string | null;
|
|
43
|
+
flat_fias_id?: string | null | undefined;
|
|
44
|
+
flat_cadnum?: null | undefined;
|
|
45
|
+
geo_lat: string | null;
|
|
46
|
+
geo_lon: string | null;
|
|
47
|
+
geoname_id: string | null;
|
|
48
|
+
history_values: string[] | null;
|
|
49
|
+
house: string | null;
|
|
50
|
+
house_fias_id: string | null;
|
|
51
|
+
house_kladr_id: string | null;
|
|
52
|
+
house_type: string | null;
|
|
53
|
+
house_type_full: string | null;
|
|
54
|
+
house_cadnum?: null | undefined;
|
|
55
|
+
entrance?: null | undefined;
|
|
56
|
+
floor?: null | undefined;
|
|
57
|
+
kladr_id: string;
|
|
58
|
+
okato: string | null;
|
|
59
|
+
oktmo: string | null;
|
|
60
|
+
postal_box: string | null;
|
|
61
|
+
postal_code: string | null;
|
|
62
|
+
qc: null;
|
|
63
|
+
qc_complete: null;
|
|
64
|
+
qc_geo: "0" | "1" | "2" | "3" | "4" | "5" | null;
|
|
65
|
+
qc_house: null;
|
|
66
|
+
region: string;
|
|
67
|
+
region_fias_id: string;
|
|
68
|
+
region_kladr_id: string;
|
|
69
|
+
region_type: string;
|
|
70
|
+
region_type_full: string;
|
|
71
|
+
region_with_type: string;
|
|
72
|
+
settlement: string | null;
|
|
73
|
+
settlement_fias_id: string | null;
|
|
74
|
+
settlement_kladr_id: string | null;
|
|
75
|
+
settlement_type: string | null;
|
|
76
|
+
settlement_type_full: string | null;
|
|
77
|
+
settlement_with_type: string | null;
|
|
78
|
+
source: string | null;
|
|
79
|
+
square_meter_price?: string | null | undefined;
|
|
80
|
+
street: string | null;
|
|
81
|
+
street_fias_id: string | null;
|
|
82
|
+
street_kladr_id: string | null;
|
|
83
|
+
street_type: string | null;
|
|
84
|
+
street_type_full: string | null;
|
|
85
|
+
street_with_type: string | null;
|
|
86
|
+
stead?: string | null | undefined;
|
|
87
|
+
stead_fias_id?: string | null | undefined;
|
|
88
|
+
stead_kladr_id?: string | null | undefined;
|
|
89
|
+
stead_type?: string | null | undefined;
|
|
90
|
+
stead_type_full?: string | null | undefined;
|
|
91
|
+
stead_cadnum?: null | undefined;
|
|
92
|
+
tax_office: string | null;
|
|
93
|
+
tax_office_legal: string | null;
|
|
94
|
+
timezone: string | null;
|
|
95
|
+
unparsed_parts: null;
|
|
96
|
+
fias_code: string;
|
|
97
|
+
region_iso_code: string;
|
|
98
|
+
fias_actuality_state: string;
|
|
99
|
+
metro: {
|
|
100
|
+
name: string;
|
|
101
|
+
line: string;
|
|
102
|
+
distance: number;
|
|
103
|
+
}[] | null;
|
|
104
|
+
divisions?: unknown;
|
|
105
|
+
};
|
|
106
|
+
}[];
|
|
107
|
+
}, any>>;
|
|
4
108
|
findIconById: (params: api.FindIconByIdParams) => Promise<import("axios").AxiosResponse<{
|
|
5
109
|
success: boolean;
|
|
6
110
|
icon: {
|
package/package.json
CHANGED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// документация https://dadata.ru/api/suggest/address/
|
|
2
|
+
import axios, { AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
type SuccessData = {
|
|
5
|
+
suggestions: Array<{
|
|
6
|
+
value: string;
|
|
7
|
+
data: {
|
|
8
|
+
area: string | null;
|
|
9
|
+
area_fias_id: string | null;
|
|
10
|
+
area_kladr_id: string | null;
|
|
11
|
+
area_type: string | null;
|
|
12
|
+
area_type_full: string | null;
|
|
13
|
+
area_with_type: string | null;
|
|
14
|
+
beltway_distance: string | null;
|
|
15
|
+
beltway_hit: 'IN_MKAD' | 'OUT_MKAD' | 'IN_KAD' | 'OUT_KAD' | null;
|
|
16
|
+
block: string | null;
|
|
17
|
+
block_type: string | null;
|
|
18
|
+
block_type_full: string | null;
|
|
19
|
+
federal_district: string | null;
|
|
20
|
+
capital_marker: '0' | '1' | '2' | '3' | '4';
|
|
21
|
+
city: string | null;
|
|
22
|
+
city_area: string | null;
|
|
23
|
+
city_district: string | null;
|
|
24
|
+
city_district_fias_id: string | null;
|
|
25
|
+
city_district_kladr_id: string | null;
|
|
26
|
+
city_district_type: string | null;
|
|
27
|
+
city_district_type_full: string | null;
|
|
28
|
+
city_district_with_type: string | null;
|
|
29
|
+
city_fias_id: string | null;
|
|
30
|
+
city_kladr_id: string | null;
|
|
31
|
+
city_type: string | null;
|
|
32
|
+
city_type_full: string | null;
|
|
33
|
+
city_with_type: string | null;
|
|
34
|
+
country: string;
|
|
35
|
+
country_iso_code: string;
|
|
36
|
+
fias_id: string;
|
|
37
|
+
fias_level: string;
|
|
38
|
+
flat: string | null;
|
|
39
|
+
flat_area: string | null;
|
|
40
|
+
flat_price: null;
|
|
41
|
+
flat_type: string | null;
|
|
42
|
+
flat_type_full: string | null;
|
|
43
|
+
flat_fias_id?: string | null;
|
|
44
|
+
flat_cadnum?: null;
|
|
45
|
+
geo_lat: string | null;
|
|
46
|
+
geo_lon: string | null;
|
|
47
|
+
geoname_id: string | null;
|
|
48
|
+
history_values: string[] | null;
|
|
49
|
+
house: string | null;
|
|
50
|
+
house_fias_id: string | null;
|
|
51
|
+
house_kladr_id: string | null;
|
|
52
|
+
house_type: string | null;
|
|
53
|
+
house_type_full: string | null;
|
|
54
|
+
house_cadnum?: null;
|
|
55
|
+
entrance?: null;
|
|
56
|
+
floor?: null;
|
|
57
|
+
kladr_id: string;
|
|
58
|
+
okato: string | null;
|
|
59
|
+
oktmo: string | null;
|
|
60
|
+
postal_box: string | null;
|
|
61
|
+
postal_code: string | null;
|
|
62
|
+
qc: null;
|
|
63
|
+
qc_complete: null;
|
|
64
|
+
qc_geo: '0' | '1' | '2' | '3' | '4' | '5' | null;
|
|
65
|
+
qc_house: null;
|
|
66
|
+
region: string;
|
|
67
|
+
region_fias_id: string;
|
|
68
|
+
region_kladr_id: string;
|
|
69
|
+
region_type: string;
|
|
70
|
+
region_type_full: string;
|
|
71
|
+
region_with_type: string;
|
|
72
|
+
settlement: string | null;
|
|
73
|
+
settlement_fias_id: string | null;
|
|
74
|
+
settlement_kladr_id: string | null;
|
|
75
|
+
settlement_type: string | null;
|
|
76
|
+
settlement_type_full: string | null;
|
|
77
|
+
settlement_with_type: string | null;
|
|
78
|
+
source: string | null;
|
|
79
|
+
square_meter_price?: string | null;
|
|
80
|
+
street: string | null;
|
|
81
|
+
street_fias_id: string | null;
|
|
82
|
+
street_kladr_id: string | null;
|
|
83
|
+
street_type: string | null;
|
|
84
|
+
street_type_full: string | null;
|
|
85
|
+
street_with_type: string | null;
|
|
86
|
+
stead?: string | null;
|
|
87
|
+
stead_fias_id?: string | null;
|
|
88
|
+
stead_kladr_id?: string | null;
|
|
89
|
+
stead_type?: string | null;
|
|
90
|
+
stead_type_full?: string | null;
|
|
91
|
+
stead_cadnum?: null;
|
|
92
|
+
tax_office: string | null;
|
|
93
|
+
tax_office_legal: string | null;
|
|
94
|
+
timezone: string | null;
|
|
95
|
+
unparsed_parts: null;
|
|
96
|
+
fias_code: string;
|
|
97
|
+
region_iso_code: string;
|
|
98
|
+
fias_actuality_state: string;
|
|
99
|
+
metro: Array<{ name: string; line: string; distance: number }> | null;
|
|
100
|
+
divisions?: unknown;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
type GranularHint = { value: 'country' | 'region' | 'area' | 'city' | 'settlement' | 'street' | 'house' | 'flat' };
|
|
106
|
+
|
|
107
|
+
export type FindDadataSuggestionsBody = {
|
|
108
|
+
query: string;
|
|
109
|
+
count?: number;
|
|
110
|
+
language?: string;
|
|
111
|
+
division?: string;
|
|
112
|
+
locations?: Array<{
|
|
113
|
+
country_iso_code?: string;
|
|
114
|
+
region_iso_code?: string;
|
|
115
|
+
kladr_id?: string;
|
|
116
|
+
country?: string;
|
|
117
|
+
region?: string;
|
|
118
|
+
area?: string;
|
|
119
|
+
city?: string;
|
|
120
|
+
settlement?: string;
|
|
121
|
+
street?: string;
|
|
122
|
+
region_type_full?: string;
|
|
123
|
+
area_type_full?: string;
|
|
124
|
+
city_type_full?: string;
|
|
125
|
+
settlement_type_full?: string;
|
|
126
|
+
street_type_full?: string;
|
|
127
|
+
fias_id?: string;
|
|
128
|
+
region_fias_id?: string;
|
|
129
|
+
area_fias_id?: string;
|
|
130
|
+
city_fias_id?: string;
|
|
131
|
+
settlement_fias_id?: string;
|
|
132
|
+
street_fias_id?: string;
|
|
133
|
+
}>;
|
|
134
|
+
locations_geo?: Array<{
|
|
135
|
+
lat: number;
|
|
136
|
+
lon: number;
|
|
137
|
+
radius_meters?: number;
|
|
138
|
+
}>;
|
|
139
|
+
locations_boost?: Array<{ kladr_id: string }>;
|
|
140
|
+
from_bound?: GranularHint;
|
|
141
|
+
to_bound?: GranularHint;
|
|
142
|
+
};
|
|
143
|
+
export type FindDadataSuggestionsHeaders = { Authorization: string };
|
|
144
|
+
|
|
145
|
+
export type FindDadataSuggestionsData = AxiosResponse<SuccessData>;
|
|
146
|
+
export type FindDadataSuggestionsConfig = { body: FindDadataSuggestionsBody; headers: FindDadataSuggestionsHeaders };
|
|
147
|
+
|
|
148
|
+
export function findDadataSuggestionsRequest({ body, headers }: FindDadataSuggestionsConfig) {
|
|
149
|
+
return axios.post<SuccessData>('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address', body, {
|
|
150
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
151
|
+
});
|
|
152
|
+
}
|
package/src/external/index.ts
CHANGED
|
@@ -5,6 +5,10 @@ export class Api {
|
|
|
5
5
|
return api.findCallTransferByExpertIdRequest({ urlParams });
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
+
findDadataSuggestions = (body: api.FindDadataSuggestionsBody, headers: api.FindDadataSuggestionsHeaders) => {
|
|
9
|
+
return api.findDadataSuggestionsRequest({ body, headers });
|
|
10
|
+
};
|
|
11
|
+
|
|
8
12
|
findIconById = (params: api.FindIconByIdParams) => {
|
|
9
13
|
return api.findIconByIdRequest({ params });
|
|
10
14
|
};
|