@wix/atlas 1.0.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/build/cjs/index.d.ts +3 -0
- package/build/cjs/index.js +26 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/atlas-v2-place.http.d.ts +4 -0
- package/build/cjs/src/atlas-v2-place.http.js +124 -0
- package/build/cjs/src/atlas-v2-place.http.js.map +1 -0
- package/build/cjs/src/atlas-v2-place.public.d.ts +5 -0
- package/build/cjs/src/atlas-v2-place.public.js +13 -0
- package/build/cjs/src/atlas-v2-place.public.js.map +1 -0
- package/build/cjs/src/atlas-v2-place.types.d.ts +86 -0
- package/build/cjs/src/atlas-v2-place.types.js +20 -0
- package/build/cjs/src/atlas-v2-place.types.js.map +1 -0
- package/build/cjs/src/atlas-v2-place.universal.d.ts +92 -0
- package/build/cjs/src/atlas-v2-place.universal.js +121 -0
- package/build/cjs/src/atlas-v2-place.universal.js.map +1 -0
- package/build/cjs/src/atlas-v2-prediction.http.d.ts +4 -0
- package/build/cjs/src/atlas-v2-prediction.http.js +122 -0
- package/build/cjs/src/atlas-v2-prediction.http.js.map +1 -0
- package/build/cjs/src/atlas-v2-prediction.public.d.ts +5 -0
- package/build/cjs/src/atlas-v2-prediction.public.js +13 -0
- package/build/cjs/src/atlas-v2-prediction.public.js.map +1 -0
- package/build/cjs/src/atlas-v2-prediction.types.d.ts +72 -0
- package/build/cjs/src/atlas-v2-prediction.types.js +11 -0
- package/build/cjs/src/atlas-v2-prediction.types.js.map +1 -0
- package/build/cjs/src/atlas-v2-prediction.universal.d.ts +97 -0
- package/build/cjs/src/atlas-v2-prediction.universal.js +116 -0
- package/build/cjs/src/atlas-v2-prediction.universal.js.map +1 -0
- package/build/cjs/src/atlas-v2-search-result.http.d.ts +4 -0
- package/build/cjs/src/atlas-v2-search-result.http.js +96 -0
- package/build/cjs/src/atlas-v2-search-result.http.js.map +1 -0
- package/build/cjs/src/atlas-v2-search-result.public.d.ts +5 -0
- package/build/cjs/src/atlas-v2-search-result.public.js +15 -0
- package/build/cjs/src/atlas-v2-search-result.public.js.map +1 -0
- package/build/cjs/src/atlas-v2-search-result.types.d.ts +119 -0
- package/build/cjs/src/atlas-v2-search-result.types.js +37 -0
- package/build/cjs/src/atlas-v2-search-result.types.js.map +1 -0
- package/build/cjs/src/atlas-v2-search-result.universal.d.ts +129 -0
- package/build/cjs/src/atlas-v2-search-result.universal.js +137 -0
- package/build/cjs/src/atlas-v2-search-result.universal.js.map +1 -0
- package/build/es/index.d.ts +3 -0
- package/build/es/index.js +4 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/atlas-v2-place.http.d.ts +4 -0
- package/build/es/src/atlas-v2-place.http.js +120 -0
- package/build/es/src/atlas-v2-place.http.js.map +1 -0
- package/build/es/src/atlas-v2-place.public.d.ts +5 -0
- package/build/es/src/atlas-v2-place.public.js +8 -0
- package/build/es/src/atlas-v2-place.public.js.map +1 -0
- package/build/es/src/atlas-v2-place.types.d.ts +86 -0
- package/build/es/src/atlas-v2-place.types.js +17 -0
- package/build/es/src/atlas-v2-place.types.js.map +1 -0
- package/build/es/src/atlas-v2-place.universal.d.ts +92 -0
- package/build/es/src/atlas-v2-place.universal.js +98 -0
- package/build/es/src/atlas-v2-place.universal.js.map +1 -0
- package/build/es/src/atlas-v2-prediction.http.d.ts +4 -0
- package/build/es/src/atlas-v2-prediction.http.js +118 -0
- package/build/es/src/atlas-v2-prediction.http.js.map +1 -0
- package/build/es/src/atlas-v2-prediction.public.d.ts +5 -0
- package/build/es/src/atlas-v2-prediction.public.js +8 -0
- package/build/es/src/atlas-v2-prediction.public.js.map +1 -0
- package/build/es/src/atlas-v2-prediction.types.d.ts +72 -0
- package/build/es/src/atlas-v2-prediction.types.js +8 -0
- package/build/es/src/atlas-v2-prediction.types.js.map +1 -0
- package/build/es/src/atlas-v2-prediction.universal.d.ts +97 -0
- package/build/es/src/atlas-v2-prediction.universal.js +93 -0
- package/build/es/src/atlas-v2-prediction.universal.js.map +1 -0
- package/build/es/src/atlas-v2-search-result.http.d.ts +4 -0
- package/build/es/src/atlas-v2-search-result.http.js +92 -0
- package/build/es/src/atlas-v2-search-result.http.js.map +1 -0
- package/build/es/src/atlas-v2-search-result.public.d.ts +5 -0
- package/build/es/src/atlas-v2-search-result.public.js +8 -0
- package/build/es/src/atlas-v2-search-result.public.js.map +1 -0
- package/build/es/src/atlas-v2-search-result.types.d.ts +119 -0
- package/build/es/src/atlas-v2-search-result.types.js +34 -0
- package/build/es/src/atlas-v2-search-result.types.js.map +1 -0
- package/build/es/src/atlas-v2-search-result.universal.d.ts +129 -0
- package/build/es/src/atlas-v2-search-result.universal.js +114 -0
- package/build/es/src/atlas-v2-search-result.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { search as universalSearch, } from './atlas-v2-search-result.universal';
|
|
2
|
+
export function search(httpClient) {
|
|
3
|
+
return (options) => universalSearch(options,
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
{ httpClient });
|
|
6
|
+
}
|
|
7
|
+
export { SubdivisionType, Proximity, FilterType, } from './atlas-v2-search-result.universal';
|
|
8
|
+
//# sourceMappingURL=atlas-v2-search-result.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-search-result.public.js","sourceRoot":"","sources":["../../../src/atlas-v2-search-result.public.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,IAAI,eAAe,GAE1B,MAAM,oCAAoC,CAAC;AAE5C,MAAM,UAAU,MAAM,CAAC,UAAsB;IAC3C,OAAO,CAAC,OAAuB,EAAE,EAAE,CACjC,eAAe,CACb,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EACL,eAAe,EACf,SAAS,EACT,UAAU,GACX,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export interface SearchResult {
|
|
2
|
+
/** The Address object */
|
|
3
|
+
address?: Address;
|
|
4
|
+
/** stores additional data about the proximity to the specified location */
|
|
5
|
+
proximity?: Proximity;
|
|
6
|
+
}
|
|
7
|
+
/** Physical address */
|
|
8
|
+
export interface Address extends AddressStreetOneOf {
|
|
9
|
+
/** country code */
|
|
10
|
+
country?: string | null;
|
|
11
|
+
/** subdivision (usually state or region) code according to ISO 3166-2 */
|
|
12
|
+
subdivision?: string | null;
|
|
13
|
+
/** city name */
|
|
14
|
+
city?: string | null;
|
|
15
|
+
/** zip/postal code */
|
|
16
|
+
postalCode?: string | null;
|
|
17
|
+
/** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */
|
|
18
|
+
addressLine2?: string | null;
|
|
19
|
+
/** A string containing the human-readable address of this location */
|
|
20
|
+
formattedAddress?: string | null;
|
|
21
|
+
/** Free text for human-to-human textual orientation aid purposes */
|
|
22
|
+
hint?: string | null;
|
|
23
|
+
/** coordinates of the physical address */
|
|
24
|
+
geocode?: AddressLocation;
|
|
25
|
+
/** country full-name */
|
|
26
|
+
countryFullname?: string | null;
|
|
27
|
+
/** multi-level subdivisions from top to bottom */
|
|
28
|
+
subdivisions?: Subdivision[];
|
|
29
|
+
/** a break down of the street to number and street name */
|
|
30
|
+
streetAddress?: StreetAddress;
|
|
31
|
+
/** Main address line (usually street and number) as free text */
|
|
32
|
+
addressLine?: string | null;
|
|
33
|
+
}
|
|
34
|
+
/** @oneof */
|
|
35
|
+
export interface AddressStreetOneOf {
|
|
36
|
+
/** a break down of the street to number and street name */
|
|
37
|
+
streetAddress?: StreetAddress;
|
|
38
|
+
/** Main address line (usually street and number) as free text */
|
|
39
|
+
addressLine?: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface StreetAddress {
|
|
42
|
+
/** street number */
|
|
43
|
+
number?: string;
|
|
44
|
+
/** street name */
|
|
45
|
+
name?: string;
|
|
46
|
+
/** apartment number */
|
|
47
|
+
apt?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface AddressLocation {
|
|
50
|
+
latitude?: number | null;
|
|
51
|
+
longitude?: number | null;
|
|
52
|
+
}
|
|
53
|
+
export interface Subdivision {
|
|
54
|
+
/** subdivision short code */
|
|
55
|
+
code?: string;
|
|
56
|
+
/** subdivision full-name */
|
|
57
|
+
name?: string;
|
|
58
|
+
type?: SubdivisionType;
|
|
59
|
+
/** a free-text description of subdivision type */
|
|
60
|
+
typeInfo?: string | null;
|
|
61
|
+
}
|
|
62
|
+
export declare enum SubdivisionType {
|
|
63
|
+
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
64
|
+
/** state */
|
|
65
|
+
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
66
|
+
/** county */
|
|
67
|
+
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
68
|
+
/** cities/towns */
|
|
69
|
+
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
70
|
+
/** neighborhood/quarter */
|
|
71
|
+
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
72
|
+
/** street/block */
|
|
73
|
+
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
74
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
75
|
+
COUNTRY = "COUNTRY"
|
|
76
|
+
}
|
|
77
|
+
export declare enum Proximity {
|
|
78
|
+
UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
|
|
79
|
+
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
80
|
+
PINPOINT = "PINPOINT",
|
|
81
|
+
/** indicates that the returned result is the geometric center of a result */
|
|
82
|
+
APPROXIMATE = "APPROXIMATE",
|
|
83
|
+
/** indicates that the returned result is around an area */
|
|
84
|
+
GENERAL_AREA = "GENERAL_AREA"
|
|
85
|
+
}
|
|
86
|
+
/** User must provide query or filter by parameters */
|
|
87
|
+
export interface SearchRequest {
|
|
88
|
+
/** Free text */
|
|
89
|
+
query?: string | null;
|
|
90
|
+
/** Deprecate! - Please use 'zipCode' and 'countryCodes' fields */
|
|
91
|
+
filterBy?: FilterBy[];
|
|
92
|
+
/** Zip code filter the user can add in order to get more accurate results */
|
|
93
|
+
zipCode?: string | null;
|
|
94
|
+
/** Country codes filter the user can add in order to get more accurate results */
|
|
95
|
+
countryCodes?: string[];
|
|
96
|
+
}
|
|
97
|
+
export interface FilterBy {
|
|
98
|
+
/** One of the filter types enum */
|
|
99
|
+
filterType?: FilterType;
|
|
100
|
+
/** Free text like "us" */
|
|
101
|
+
filterValue?: string;
|
|
102
|
+
}
|
|
103
|
+
export declare enum FilterType {
|
|
104
|
+
/** Filter by zip code */
|
|
105
|
+
zip_code = "zip_code",
|
|
106
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
107
|
+
country_code = "country_code"
|
|
108
|
+
}
|
|
109
|
+
export interface SearchResponse {
|
|
110
|
+
/** List of 'Address' objects */
|
|
111
|
+
searchResults?: SearchResult[];
|
|
112
|
+
}
|
|
113
|
+
export interface ReverseGeocodingRequest {
|
|
114
|
+
/** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */
|
|
115
|
+
addressLocation?: AddressLocation;
|
|
116
|
+
}
|
|
117
|
+
export interface ReverseGeocodingResponse {
|
|
118
|
+
searchResults?: SearchResult[];
|
|
119
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export var SubdivisionType;
|
|
2
|
+
(function (SubdivisionType) {
|
|
3
|
+
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
4
|
+
/** state */
|
|
5
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
6
|
+
/** county */
|
|
7
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
8
|
+
/** cities/towns */
|
|
9
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
10
|
+
/** neighborhood/quarter */
|
|
11
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
12
|
+
/** street/block */
|
|
13
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
14
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
15
|
+
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
16
|
+
})(SubdivisionType || (SubdivisionType = {}));
|
|
17
|
+
export var Proximity;
|
|
18
|
+
(function (Proximity) {
|
|
19
|
+
Proximity["UNKNOWN_PROXIMITY"] = "UNKNOWN_PROXIMITY";
|
|
20
|
+
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
21
|
+
Proximity["PINPOINT"] = "PINPOINT";
|
|
22
|
+
/** indicates that the returned result is the geometric center of a result */
|
|
23
|
+
Proximity["APPROXIMATE"] = "APPROXIMATE";
|
|
24
|
+
/** indicates that the returned result is around an area */
|
|
25
|
+
Proximity["GENERAL_AREA"] = "GENERAL_AREA";
|
|
26
|
+
})(Proximity || (Proximity = {}));
|
|
27
|
+
export var FilterType;
|
|
28
|
+
(function (FilterType) {
|
|
29
|
+
/** Filter by zip code */
|
|
30
|
+
FilterType["zip_code"] = "zip_code";
|
|
31
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
32
|
+
FilterType["country_code"] = "country_code";
|
|
33
|
+
})(FilterType || (FilterType = {}));
|
|
34
|
+
//# sourceMappingURL=atlas-v2-search-result.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-search-result.types.js","sourceRoot":"","sources":["../../../src/atlas-v2-search-result.types.ts"],"names":[],"mappings":"AAmEA,MAAM,CAAN,IAAY,eAcX;AAdD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,YAAY;IACZ,8EAA2D,CAAA;IAC3D,aAAa;IACb,8EAA2D,CAAA;IAC3D,mBAAmB;IACnB,8EAA2D,CAAA;IAC3D,2BAA2B;IAC3B,8EAA2D,CAAA;IAC3D,mBAAmB;IACnB,8EAA2D,CAAA;IAC3D,+IAA+I;IAC/I,sCAAmB,CAAA;AACrB,CAAC,EAdW,eAAe,KAAf,eAAe,QAc1B;AAED,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,oDAAuC,CAAA;IACvC,+IAA+I;IAC/I,kCAAqB,CAAA;IACrB,6EAA6E;IAC7E,wCAA2B,CAAA;IAC3B,2DAA2D;IAC3D,0CAA6B,CAAA;AAC/B,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAqBD,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yBAAyB;IACzB,mCAAqB,CAAA;IACrB,oDAAoD;IACpD,2CAA6B,CAAA;AAC/B,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export declare const __debug: {
|
|
2
|
+
verboseLogging: {
|
|
3
|
+
on: () => boolean;
|
|
4
|
+
off: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export interface SearchResult {
|
|
8
|
+
/** The Address object */
|
|
9
|
+
address?: Address;
|
|
10
|
+
/** stores additional data about the proximity to the specified location */
|
|
11
|
+
proximity?: Proximity;
|
|
12
|
+
}
|
|
13
|
+
/** Physical address */
|
|
14
|
+
export interface Address extends AddressStreetOneOf {
|
|
15
|
+
/** country code */
|
|
16
|
+
country?: string | null;
|
|
17
|
+
/** subdivision (usually state or region) code according to ISO 3166-2 */
|
|
18
|
+
subdivision?: string | null;
|
|
19
|
+
/** city name */
|
|
20
|
+
city?: string | null;
|
|
21
|
+
/** zip/postal code */
|
|
22
|
+
postalCode?: string | null;
|
|
23
|
+
/** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */
|
|
24
|
+
addressLine2?: string | null;
|
|
25
|
+
/** a break down of the street to number and street name */
|
|
26
|
+
streetAddress?: StreetAddress;
|
|
27
|
+
/** Main address line (usually street and number) as free text */
|
|
28
|
+
addressLine1?: string | null;
|
|
29
|
+
}
|
|
30
|
+
/** @oneof */
|
|
31
|
+
export interface AddressStreetOneOf {
|
|
32
|
+
/** a break down of the street to number and street name */
|
|
33
|
+
streetAddress?: StreetAddress;
|
|
34
|
+
/** Main address line (usually street and number) as free text */
|
|
35
|
+
addressLine?: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface StreetAddress {
|
|
38
|
+
/** street number */
|
|
39
|
+
number?: string;
|
|
40
|
+
/** street name */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** apartment number */
|
|
43
|
+
apt?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AddressLocation {
|
|
46
|
+
latitude?: number | null;
|
|
47
|
+
longitude?: number | null;
|
|
48
|
+
}
|
|
49
|
+
export interface Subdivision {
|
|
50
|
+
/** subdivision short code */
|
|
51
|
+
code?: string;
|
|
52
|
+
/** subdivision full-name */
|
|
53
|
+
name?: string;
|
|
54
|
+
type?: SubdivisionType;
|
|
55
|
+
/** a free-text description of subdivision type */
|
|
56
|
+
typeInfo?: string | null;
|
|
57
|
+
}
|
|
58
|
+
export declare enum SubdivisionType {
|
|
59
|
+
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
60
|
+
/** state */
|
|
61
|
+
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
62
|
+
/** county */
|
|
63
|
+
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
64
|
+
/** cities/towns */
|
|
65
|
+
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
66
|
+
/** neighborhood/quarter */
|
|
67
|
+
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
68
|
+
/** street/block */
|
|
69
|
+
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
70
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
71
|
+
COUNTRY = "COUNTRY"
|
|
72
|
+
}
|
|
73
|
+
export declare enum Proximity {
|
|
74
|
+
UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
|
|
75
|
+
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
76
|
+
PINPOINT = "PINPOINT",
|
|
77
|
+
/** indicates that the returned result is the geometric center of a result */
|
|
78
|
+
APPROXIMATE = "APPROXIMATE",
|
|
79
|
+
/** indicates that the returned result is around an area */
|
|
80
|
+
GENERAL_AREA = "GENERAL_AREA"
|
|
81
|
+
}
|
|
82
|
+
/** User must provide query or filter by parameters */
|
|
83
|
+
export interface SearchRequest {
|
|
84
|
+
/** Free text */
|
|
85
|
+
query?: string | null;
|
|
86
|
+
/** Deprecate! - Please use 'zipCode' and 'countryCodes' fields */
|
|
87
|
+
filterBy?: FilterBy[];
|
|
88
|
+
/** Zip code filter the user can add in order to get more accurate results */
|
|
89
|
+
zipCode?: string | null;
|
|
90
|
+
/** Country codes filter the user can add in order to get more accurate results */
|
|
91
|
+
countryCodes?: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface FilterBy {
|
|
94
|
+
/** One of the filter types enum */
|
|
95
|
+
filterType?: FilterType;
|
|
96
|
+
/** Free text like "us" */
|
|
97
|
+
filterValue?: string;
|
|
98
|
+
}
|
|
99
|
+
export declare enum FilterType {
|
|
100
|
+
/** Filter by zip code */
|
|
101
|
+
zip_code = "zip_code",
|
|
102
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
103
|
+
country_code = "country_code"
|
|
104
|
+
}
|
|
105
|
+
export interface SearchResponse {
|
|
106
|
+
/** List of 'Address' objects */
|
|
107
|
+
searchResults?: SearchResult[];
|
|
108
|
+
}
|
|
109
|
+
export interface ReverseGeocodingRequest {
|
|
110
|
+
/** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */
|
|
111
|
+
addressLocation?: AddressLocation;
|
|
112
|
+
}
|
|
113
|
+
export interface ReverseGeocodingResponse {
|
|
114
|
+
searchResults?: SearchResult[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A Search request takes a free text as an input and returns a list of 'Address' objects.
|
|
118
|
+
* @public */
|
|
119
|
+
export declare function search(options?: SearchOptions): Promise<SearchResponse>;
|
|
120
|
+
export interface SearchOptions {
|
|
121
|
+
/** Free text */
|
|
122
|
+
query?: string | null;
|
|
123
|
+
/** Deprecate! - Please use 'zipCode' and 'countryCodes' fields */
|
|
124
|
+
filterBy?: FilterBy[];
|
|
125
|
+
/** Zip code filter the user can add in order to get more accurate results */
|
|
126
|
+
zipCode?: string | null;
|
|
127
|
+
/** Country codes filter the user can add in order to get more accurate results */
|
|
128
|
+
countryCodes?: string[];
|
|
129
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { serializer, transformError } from '@wix/metro-runtime/velo';
|
|
11
|
+
import * as ambassadorWixAtlasV2SearchResult from './atlas-v2-search-result.http';
|
|
12
|
+
let __verbose = false;
|
|
13
|
+
function __log(...args) {
|
|
14
|
+
__verbose && console.log(...args);
|
|
15
|
+
}
|
|
16
|
+
function __inspect(obj) {
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
export const __debug = {
|
|
20
|
+
verboseLogging: {
|
|
21
|
+
on: () => (__verbose = true),
|
|
22
|
+
off: () => (__verbose = false),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const _toVeloEntity = '$';
|
|
26
|
+
const _fromVeloEntity = '$';
|
|
27
|
+
export var SubdivisionType;
|
|
28
|
+
(function (SubdivisionType) {
|
|
29
|
+
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
30
|
+
/** state */
|
|
31
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
32
|
+
/** county */
|
|
33
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
34
|
+
/** cities/towns */
|
|
35
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
36
|
+
/** neighborhood/quarter */
|
|
37
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
38
|
+
/** street/block */
|
|
39
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
40
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
41
|
+
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
42
|
+
})(SubdivisionType || (SubdivisionType = {}));
|
|
43
|
+
export var Proximity;
|
|
44
|
+
(function (Proximity) {
|
|
45
|
+
Proximity["UNKNOWN_PROXIMITY"] = "UNKNOWN_PROXIMITY";
|
|
46
|
+
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
47
|
+
Proximity["PINPOINT"] = "PINPOINT";
|
|
48
|
+
/** indicates that the returned result is the geometric center of a result */
|
|
49
|
+
Proximity["APPROXIMATE"] = "APPROXIMATE";
|
|
50
|
+
/** indicates that the returned result is around an area */
|
|
51
|
+
Proximity["GENERAL_AREA"] = "GENERAL_AREA";
|
|
52
|
+
})(Proximity || (Proximity = {}));
|
|
53
|
+
export var FilterType;
|
|
54
|
+
(function (FilterType) {
|
|
55
|
+
/** Filter by zip code */
|
|
56
|
+
FilterType["zip_code"] = "zip_code";
|
|
57
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
58
|
+
FilterType["country_code"] = "country_code";
|
|
59
|
+
})(FilterType || (FilterType = {}));
|
|
60
|
+
const _searchRequest = {};
|
|
61
|
+
const _searchResponse = { searchResults: '_searchResult' };
|
|
62
|
+
const _searchResult = { address: 'wix.common.Address' };
|
|
63
|
+
/**
|
|
64
|
+
* A Search request takes a free text as an input and returns a list of 'Address' objects.
|
|
65
|
+
* @public */
|
|
66
|
+
export function search(options) {
|
|
67
|
+
var _a, _b, _c;
|
|
68
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
69
|
+
const requestTransformation = {
|
|
70
|
+
query: '$[0].query',
|
|
71
|
+
filterBy: '$[0].filterBy',
|
|
72
|
+
zipCode: '$[0].zipCode',
|
|
73
|
+
countryCodes: '$[0].countryCodes',
|
|
74
|
+
};
|
|
75
|
+
const responseTransformation = '$';
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
78
|
+
const { toAmbassadorRequest } = serializer({
|
|
79
|
+
rootSchema: _searchRequest,
|
|
80
|
+
depSchemas: {},
|
|
81
|
+
fqdnTransformation: {
|
|
82
|
+
paths: [],
|
|
83
|
+
transformation: _fromVeloEntity,
|
|
84
|
+
},
|
|
85
|
+
customTransformation: requestTransformation,
|
|
86
|
+
});
|
|
87
|
+
const { fromJSON } = serializer({
|
|
88
|
+
rootSchema: _searchResponse,
|
|
89
|
+
depSchemas: { _searchResult },
|
|
90
|
+
fqdnTransformation: {
|
|
91
|
+
paths: [...['Array#searchResults']],
|
|
92
|
+
transformation: _toVeloEntity,
|
|
93
|
+
},
|
|
94
|
+
customTransformation: responseTransformation,
|
|
95
|
+
});
|
|
96
|
+
const payload = toAmbassadorRequest([options]);
|
|
97
|
+
const reqOpts = ambassadorWixAtlasV2SearchResult.search(payload);
|
|
98
|
+
__log(`"Search" sending request with: ${__inspect(reqOpts)}`);
|
|
99
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
100
|
+
try {
|
|
101
|
+
const result = yield httpClient.request(reqOpts);
|
|
102
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
103
|
+
return fromJSON(result.data);
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
107
|
+
'options',
|
|
108
|
+
]);
|
|
109
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
110
|
+
throw transformedError;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=atlas-v2-search-result.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-search-result.universal.js","sourceRoot":"","sources":["../../../src/atlas-v2-search-result.universal.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wix/atlas",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org/",
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"module": "build/es/index.js",
|
|
10
|
+
"main": "build/cjs/index.js",
|
|
11
|
+
"typings": "./build/cjs/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"build",
|
|
14
|
+
"frontend/package.json"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@wix/metro-runtime": "^1.0.0",
|
|
18
|
+
"@wix/sdk-types": "^1.0.0",
|
|
19
|
+
"@wix/motion-edm-autogen-query-wrapper": "^1.0.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@wix/typescript-to-service-json": "^1.0.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json",
|
|
26
|
+
"autodocs": "ts-to-sj",
|
|
27
|
+
"posttest": "npm run autodocs",
|
|
28
|
+
"test": ":"
|
|
29
|
+
},
|
|
30
|
+
"wix": {
|
|
31
|
+
"artifact": {
|
|
32
|
+
"artifactId": "atlas-public-sdk-autogen",
|
|
33
|
+
"groupId": "com.wixpress.public-sdk-autogen"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"falconPackageHash": "b7c1dc6e7ec366086599b28c5ff5ca448c4be817a2c96086c25e2444"
|
|
37
|
+
}
|