@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,5 @@
|
|
|
1
|
+
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
+
import { PredictOptions } from './atlas-v2-prediction.universal';
|
|
3
|
+
export declare function predict(httpClient: HttpClient): (input: string, options?: PredictOptions | undefined) => Promise<import("./atlas-v2-prediction.universal").PredictResponse>;
|
|
4
|
+
export { FilterType } from './atlas-v2-prediction.universal';
|
|
5
|
+
export { Prediction, MatchedSubstrings, TextStructure, ListPredictionsRequest, AddressLocation, FilterBy, ListPredictionsResponse, PredictRequest, PredictResponse, PredictOptions, } from './atlas-v2-prediction.universal';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterType = exports.predict = void 0;
|
|
4
|
+
const atlas_v2_prediction_universal_1 = require("./atlas-v2-prediction.universal");
|
|
5
|
+
function predict(httpClient) {
|
|
6
|
+
return (input, options) => atlas_v2_prediction_universal_1.predict(input, options,
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
{ httpClient });
|
|
9
|
+
}
|
|
10
|
+
exports.predict = predict;
|
|
11
|
+
var atlas_v2_prediction_universal_2 = require("./atlas-v2-prediction.universal");
|
|
12
|
+
Object.defineProperty(exports, "FilterType", { enumerable: true, get: function () { return atlas_v2_prediction_universal_2.FilterType; } });
|
|
13
|
+
//# sourceMappingURL=atlas-v2-prediction.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-prediction.public.js","sourceRoot":"","sources":["../../../src/atlas-v2-prediction.public.ts"],"names":[],"mappings":";;;AACA,mFAGyC;AAEzC,SAAgB,OAAO,CAAC,UAAsB;IAC5C,OAAO,CAAC,KAAa,EAAE,OAAwB,EAAE,EAAE,CACjD,uCAAgB,CACd,KAAK,EACL,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,0BAQC;AAED,iFAA6D;AAApD,2HAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface Prediction {
|
|
2
|
+
/** The human-readable name of the prediction */
|
|
3
|
+
description?: string;
|
|
4
|
+
/** The id of the prediction that can be use in place api. Available for short time. */
|
|
5
|
+
searchId?: string;
|
|
6
|
+
/** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */
|
|
7
|
+
matchedSubstrings?: MatchedSubstrings[];
|
|
8
|
+
/** Provides pre-formatted text that can be shown in your autocomplete results */
|
|
9
|
+
textStructure?: TextStructure;
|
|
10
|
+
/** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
|
|
11
|
+
distanceInMeters?: number | null;
|
|
12
|
+
}
|
|
13
|
+
export interface MatchedSubstrings {
|
|
14
|
+
length?: number;
|
|
15
|
+
offset?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface TextStructure {
|
|
18
|
+
/** Contains the main text of a prediction, usually the name of the place */
|
|
19
|
+
mainText?: string;
|
|
20
|
+
/** Contains the secondary text of a prediction, usually the location of the place */
|
|
21
|
+
secondaryText?: string;
|
|
22
|
+
/** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */
|
|
23
|
+
mainTextMatchedSubstrings?: MatchedSubstrings[];
|
|
24
|
+
}
|
|
25
|
+
export interface ListPredictionsRequest {
|
|
26
|
+
/** The text the predictions will be based on. */
|
|
27
|
+
input?: string;
|
|
28
|
+
/** The origin point from which to calculate straight-line distance to the destination */
|
|
29
|
+
origin?: AddressLocation;
|
|
30
|
+
/** The point around which you wish to retrieve place information */
|
|
31
|
+
location?: AddressLocation;
|
|
32
|
+
/** The acceptable distance from that location (in meters) */
|
|
33
|
+
radius?: string | null;
|
|
34
|
+
/** Filters the user can add in order to get more accurate results */
|
|
35
|
+
filterBy?: FilterBy[];
|
|
36
|
+
}
|
|
37
|
+
export interface AddressLocation {
|
|
38
|
+
latitude?: number | null;
|
|
39
|
+
longitude?: number | null;
|
|
40
|
+
}
|
|
41
|
+
export interface FilterBy {
|
|
42
|
+
/** One of the filter types enum */
|
|
43
|
+
filterType?: FilterType;
|
|
44
|
+
/** Free text like "us" */
|
|
45
|
+
filterValue?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare enum FilterType {
|
|
48
|
+
/** Filter by zip code */
|
|
49
|
+
zip_code = "zip_code",
|
|
50
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
51
|
+
country_code = "country_code"
|
|
52
|
+
}
|
|
53
|
+
export interface ListPredictionsResponse {
|
|
54
|
+
predictions?: Prediction[];
|
|
55
|
+
}
|
|
56
|
+
export interface PredictRequest {
|
|
57
|
+
/** The text the predictions will be based on. */
|
|
58
|
+
input: string;
|
|
59
|
+
/** The origin point from which to calculate straight-line distance to the destination */
|
|
60
|
+
origin?: AddressLocation;
|
|
61
|
+
/** The point around which you wish to retrieve place information */
|
|
62
|
+
location?: AddressLocation;
|
|
63
|
+
/** The acceptable distance from that location (in meters) */
|
|
64
|
+
radius?: string | null;
|
|
65
|
+
/** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
|
|
66
|
+
countryCodes?: string[];
|
|
67
|
+
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
68
|
+
sessionToken?: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface PredictResponse {
|
|
71
|
+
predictions?: Prediction[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterType = void 0;
|
|
4
|
+
var FilterType;
|
|
5
|
+
(function (FilterType) {
|
|
6
|
+
/** Filter by zip code */
|
|
7
|
+
FilterType["zip_code"] = "zip_code";
|
|
8
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
9
|
+
FilterType["country_code"] = "country_code";
|
|
10
|
+
})(FilterType = exports.FilterType || (exports.FilterType = {}));
|
|
11
|
+
//# sourceMappingURL=atlas-v2-prediction.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-prediction.types.js","sourceRoot":"","sources":["../../../src/atlas-v2-prediction.types.ts"],"names":[],"mappings":";;;AAoDA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yBAAyB;IACzB,mCAAqB,CAAA;IACrB,oDAAoD;IACpD,2CAA6B,CAAA;AAC/B,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export declare const __debug: {
|
|
2
|
+
verboseLogging: {
|
|
3
|
+
on: () => boolean;
|
|
4
|
+
off: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export interface Prediction {
|
|
8
|
+
/** The human-readable name of the prediction */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** The id of the prediction that can be use in place api. Available for short time. */
|
|
11
|
+
searchId?: string;
|
|
12
|
+
/** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */
|
|
13
|
+
matchedSubstrings?: MatchedSubstrings[];
|
|
14
|
+
/** Provides pre-formatted text that can be shown in your autocomplete results */
|
|
15
|
+
textStructure?: TextStructure;
|
|
16
|
+
/** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
|
|
17
|
+
distanceInMeters?: number | null;
|
|
18
|
+
}
|
|
19
|
+
export interface MatchedSubstrings {
|
|
20
|
+
length?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface TextStructure {
|
|
24
|
+
/** Contains the main text of a prediction, usually the name of the place */
|
|
25
|
+
mainText?: string;
|
|
26
|
+
/** Contains the secondary text of a prediction, usually the location of the place */
|
|
27
|
+
secondaryText?: string;
|
|
28
|
+
/** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */
|
|
29
|
+
mainTextMatchedSubstrings?: MatchedSubstrings[];
|
|
30
|
+
}
|
|
31
|
+
export interface ListPredictionsRequest {
|
|
32
|
+
/** The text the predictions will be based on. */
|
|
33
|
+
input?: string;
|
|
34
|
+
/** The origin point from which to calculate straight-line distance to the destination */
|
|
35
|
+
origin?: AddressLocation;
|
|
36
|
+
/** The point around which you wish to retrieve place information */
|
|
37
|
+
location?: AddressLocation;
|
|
38
|
+
/** The acceptable distance from that location (in meters) */
|
|
39
|
+
radius?: string | null;
|
|
40
|
+
/** Filters the user can add in order to get more accurate results */
|
|
41
|
+
filterBy?: FilterBy[];
|
|
42
|
+
}
|
|
43
|
+
export interface AddressLocation {
|
|
44
|
+
latitude?: number | null;
|
|
45
|
+
longitude?: number | null;
|
|
46
|
+
}
|
|
47
|
+
export interface FilterBy {
|
|
48
|
+
/** One of the filter types enum */
|
|
49
|
+
filterType?: FilterType;
|
|
50
|
+
/** Free text like "us" */
|
|
51
|
+
filterValue?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare enum FilterType {
|
|
54
|
+
/** Filter by zip code */
|
|
55
|
+
zip_code = "zip_code",
|
|
56
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
57
|
+
country_code = "country_code"
|
|
58
|
+
}
|
|
59
|
+
export interface ListPredictionsResponse {
|
|
60
|
+
predictions?: Prediction[];
|
|
61
|
+
}
|
|
62
|
+
export interface PredictRequest {
|
|
63
|
+
/** The text the predictions will be based on. */
|
|
64
|
+
input: string;
|
|
65
|
+
/** The origin point from which to calculate straight-line distance to the destination */
|
|
66
|
+
origin?: AddressLocation;
|
|
67
|
+
/** The point around which you wish to retrieve place information */
|
|
68
|
+
location?: AddressLocation;
|
|
69
|
+
/** The acceptable distance from that location (in meters) */
|
|
70
|
+
radius?: string | null;
|
|
71
|
+
/** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
|
|
72
|
+
countryCodes?: string[];
|
|
73
|
+
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
74
|
+
sessionToken?: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface PredictResponse {
|
|
77
|
+
predictions?: Prediction[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A Predict end-point take an input and returns an list of Prediction object.
|
|
81
|
+
* @param input - The text the predictions will be based on.
|
|
82
|
+
* @public
|
|
83
|
+
* @requiredField input
|
|
84
|
+
*/
|
|
85
|
+
export declare function predict(input: string, options?: PredictOptions): Promise<PredictResponse>;
|
|
86
|
+
export interface PredictOptions {
|
|
87
|
+
/** The origin point from which to calculate straight-line distance to the destination */
|
|
88
|
+
origin?: AddressLocation;
|
|
89
|
+
/** The point around which you wish to retrieve place information */
|
|
90
|
+
location?: AddressLocation;
|
|
91
|
+
/** The acceptable distance from that location (in meters) */
|
|
92
|
+
radius?: string | null;
|
|
93
|
+
/** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
|
|
94
|
+
countryCodes?: string[];
|
|
95
|
+
/** A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session. */
|
|
96
|
+
sessionToken?: string | null;
|
|
97
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.predict = exports.FilterType = exports.__debug = void 0;
|
|
32
|
+
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
+
const ambassadorWixAtlasV2Prediction = __importStar(require("./atlas-v2-prediction.http"));
|
|
34
|
+
let __verbose = false;
|
|
35
|
+
function __log(...args) {
|
|
36
|
+
__verbose && console.log(...args);
|
|
37
|
+
}
|
|
38
|
+
function __inspect(obj) {
|
|
39
|
+
return obj;
|
|
40
|
+
}
|
|
41
|
+
exports.__debug = {
|
|
42
|
+
verboseLogging: {
|
|
43
|
+
on: () => (__verbose = true),
|
|
44
|
+
off: () => (__verbose = false),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const _toVeloEntity = '$';
|
|
48
|
+
const _fromVeloEntity = '$';
|
|
49
|
+
var FilterType;
|
|
50
|
+
(function (FilterType) {
|
|
51
|
+
/** Filter by zip code */
|
|
52
|
+
FilterType["zip_code"] = "zip_code";
|
|
53
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
54
|
+
FilterType["country_code"] = "country_code";
|
|
55
|
+
})(FilterType = exports.FilterType || (exports.FilterType = {}));
|
|
56
|
+
const _predictRequest = {};
|
|
57
|
+
const _predictResponse = {};
|
|
58
|
+
/**
|
|
59
|
+
* A Predict end-point take an input and returns an list of Prediction object.
|
|
60
|
+
* @param input - The text the predictions will be based on.
|
|
61
|
+
* @public
|
|
62
|
+
* @requiredField input
|
|
63
|
+
*/
|
|
64
|
+
function predict(input, options) {
|
|
65
|
+
var _a, _b, _c;
|
|
66
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
67
|
+
const requestTransformation = {
|
|
68
|
+
input: '$[0]',
|
|
69
|
+
origin: '$[1].origin',
|
|
70
|
+
location: '$[1].location',
|
|
71
|
+
radius: '$[1].radius',
|
|
72
|
+
countryCodes: '$[1].countryCodes',
|
|
73
|
+
sessionToken: '$[1].sessionToken',
|
|
74
|
+
};
|
|
75
|
+
const responseTransformation = '$';
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
78
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
79
|
+
rootSchema: _predictRequest,
|
|
80
|
+
depSchemas: {},
|
|
81
|
+
fqdnTransformation: {
|
|
82
|
+
paths: [],
|
|
83
|
+
transformation: _fromVeloEntity,
|
|
84
|
+
},
|
|
85
|
+
customTransformation: requestTransformation,
|
|
86
|
+
});
|
|
87
|
+
const { fromJSON } = velo_1.serializer({
|
|
88
|
+
rootSchema: _predictResponse,
|
|
89
|
+
depSchemas: {},
|
|
90
|
+
fqdnTransformation: {
|
|
91
|
+
paths: [...['Array#predictions']],
|
|
92
|
+
transformation: _toVeloEntity,
|
|
93
|
+
},
|
|
94
|
+
customTransformation: responseTransformation,
|
|
95
|
+
});
|
|
96
|
+
const payload = toAmbassadorRequest([input, options]);
|
|
97
|
+
const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);
|
|
98
|
+
__log(`"Predict" 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 = velo_1.transformError(err, requestTransformation, [
|
|
107
|
+
'input',
|
|
108
|
+
'options',
|
|
109
|
+
]);
|
|
110
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
111
|
+
throw transformedError;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
exports.predict = predict;
|
|
116
|
+
//# sourceMappingURL=atlas-v2-prediction.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-prediction.universal.js","sourceRoot":"","sources":["../../../src/atlas-v2-prediction.universal.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { SearchRequest, SearchResponse } from './atlas-v2-search-result.types';
|
|
3
|
+
/** A Search request takes a free text as an input and returns a list of 'Address' objects. */
|
|
4
|
+
export declare function search(payload: SearchRequest): RequestOptionsFactory<SearchResponse>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.search = void 0;
|
|
4
|
+
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
5
|
+
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
6
|
+
const metro_runtime_2 = require("@wix/metro-runtime");
|
|
7
|
+
const _address = { geocode: '_addressLocation' };
|
|
8
|
+
const _addressLocation = {
|
|
9
|
+
latitude: 'google.protobuf.DoubleValue',
|
|
10
|
+
longitude: 'google.protobuf.DoubleValue',
|
|
11
|
+
};
|
|
12
|
+
const _searchRequest = {};
|
|
13
|
+
const _searchResponse = { searchResults: '_searchResult' };
|
|
14
|
+
const _searchResult = { address: '_address' };
|
|
15
|
+
function resolveComWixpressViAtlasServiceV2LocationServiceV2Url(opts) {
|
|
16
|
+
const domainToMappings = {
|
|
17
|
+
'api._api_base_domain_': [
|
|
18
|
+
{
|
|
19
|
+
srcPath: '/wix-atlas-service-web',
|
|
20
|
+
destPath: '',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'bo._base_domain_': [
|
|
24
|
+
{
|
|
25
|
+
srcPath: '/wix-atlas-service-web',
|
|
26
|
+
destPath: '',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
_: [
|
|
30
|
+
{
|
|
31
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
32
|
+
destPath: '',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
srcPath: '/_api/wix-atlas-service-web',
|
|
36
|
+
destPath: '',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
'www._base_domain_': [
|
|
40
|
+
{
|
|
41
|
+
srcPath: '/wix-atlas-service-web',
|
|
42
|
+
destPath: '',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
srcPath: '/_api/wix-atlas-service-web',
|
|
46
|
+
destPath: '',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
'manage._base_domain_': [
|
|
50
|
+
{
|
|
51
|
+
srcPath: '/wix-atlas-service-web',
|
|
52
|
+
destPath: '',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
'editor._base_domain_': [
|
|
56
|
+
{
|
|
57
|
+
srcPath: '/wix-atlas-service-web',
|
|
58
|
+
destPath: '',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
'editor.wixapps.net': [
|
|
62
|
+
{
|
|
63
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
64
|
+
destPath: '',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
69
|
+
}
|
|
70
|
+
/** A Search request takes a free text as an input and returns a list of 'Address' objects. */
|
|
71
|
+
function search(payload) {
|
|
72
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_searchRequest, {});
|
|
73
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_searchResponse, {
|
|
74
|
+
_address,
|
|
75
|
+
_addressLocation,
|
|
76
|
+
_searchResult,
|
|
77
|
+
});
|
|
78
|
+
function __search({ host }) {
|
|
79
|
+
const serializedData = toReq(payload);
|
|
80
|
+
const metadata = {
|
|
81
|
+
method: 'GET',
|
|
82
|
+
url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({
|
|
83
|
+
protoPath: '/v2/search',
|
|
84
|
+
data: serializedData,
|
|
85
|
+
host,
|
|
86
|
+
}),
|
|
87
|
+
params: metro_runtime_1.toURLSearchParams(serializedData),
|
|
88
|
+
transformResponse: fromRes,
|
|
89
|
+
};
|
|
90
|
+
return metadata;
|
|
91
|
+
}
|
|
92
|
+
__search.fromReq = fromReq;
|
|
93
|
+
return __search;
|
|
94
|
+
}
|
|
95
|
+
exports.search = search;
|
|
96
|
+
//# sourceMappingURL=atlas-v2-search-result.http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-search-result.http.js","sourceRoot":"","sources":["../../../src/atlas-v2-search-result.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8DAA2D;AAC3D,sDAAgD;AAKhD,MAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACjD,MAAM,gBAAgB,GAAG;IACvB,QAAQ,EAAE,6BAA6B;IACvC,SAAS,EAAE,6BAA6B;CACzC,CAAC;AACF,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,eAAe,GAAG,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC3D,MAAM,aAAa,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAE9C,SAAS,sDAAsD,CAC7D,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,CAAC,EAAE;YACD;gBACE,OAAO,EAAE,4BAA4B;gBACrC,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,6BAA6B;gBACtC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,6BAA6B;gBACtC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,oBAAoB,EAAE;YACpB;gBACE,OAAO,EAAE,4BAA4B;gBACrC,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,0BAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,8FAA8F;AAC9F,SAAgB,MAAM,CACpB,OAAsB;IAEtB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,uBAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,uBAAU,CAAC,eAAe,EAAE;QACxD,QAAQ;QACR,gBAAgB;QAChB,aAAa;KACd,CAAC,CAAC;IAEH,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAO;QAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,MAAM,EAAE,KAAY;YACpB,GAAG,EAAE,sDAAsD,CAAC;gBAC1D,SAAS,EAAE,YAAY;gBACvB,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,MAAM,EAAE,iCAAiB,CAAC,cAAc,CAAC;YACzC,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC;AA7BD,wBA6BC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
+
import { SearchOptions } from './atlas-v2-search-result.universal';
|
|
3
|
+
export declare function search(httpClient: HttpClient): (options?: SearchOptions | undefined) => Promise<import("./atlas-v2-search-result.universal").SearchResponse>;
|
|
4
|
+
export { SubdivisionType, Proximity, FilterType, } from './atlas-v2-search-result.universal';
|
|
5
|
+
export { SearchResult, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, SearchRequest, FilterBy, SearchResponse, ReverseGeocodingRequest, ReverseGeocodingResponse, SearchOptions, } from './atlas-v2-search-result.universal';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterType = exports.Proximity = exports.SubdivisionType = exports.search = void 0;
|
|
4
|
+
const atlas_v2_search_result_universal_1 = require("./atlas-v2-search-result.universal");
|
|
5
|
+
function search(httpClient) {
|
|
6
|
+
return (options) => atlas_v2_search_result_universal_1.search(options,
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
{ httpClient });
|
|
9
|
+
}
|
|
10
|
+
exports.search = search;
|
|
11
|
+
var atlas_v2_search_result_universal_2 = require("./atlas-v2-search-result.universal");
|
|
12
|
+
Object.defineProperty(exports, "SubdivisionType", { enumerable: true, get: function () { return atlas_v2_search_result_universal_2.SubdivisionType; } });
|
|
13
|
+
Object.defineProperty(exports, "Proximity", { enumerable: true, get: function () { return atlas_v2_search_result_universal_2.Proximity; } });
|
|
14
|
+
Object.defineProperty(exports, "FilterType", { enumerable: true, get: function () { return atlas_v2_search_result_universal_2.FilterType; } });
|
|
15
|
+
//# 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,yFAG4C;AAE5C,SAAgB,MAAM,CAAC,UAAsB;IAC3C,OAAO,CAAC,OAAuB,EAAE,EAAE,CACjC,yCAAe,CACb,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,wBAOC;AAED,uFAI4C;AAH1C,mIAAA,eAAe,OAAA;AACf,6HAAA,SAAS,OAAA;AACT,8HAAA,UAAU,OAAA"}
|
|
@@ -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,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterType = exports.Proximity = exports.SubdivisionType = void 0;
|
|
4
|
+
var SubdivisionType;
|
|
5
|
+
(function (SubdivisionType) {
|
|
6
|
+
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
7
|
+
/** state */
|
|
8
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
9
|
+
/** county */
|
|
10
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
11
|
+
/** cities/towns */
|
|
12
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
13
|
+
/** neighborhood/quarter */
|
|
14
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
15
|
+
/** street/block */
|
|
16
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
17
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
18
|
+
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
19
|
+
})(SubdivisionType = exports.SubdivisionType || (exports.SubdivisionType = {}));
|
|
20
|
+
var Proximity;
|
|
21
|
+
(function (Proximity) {
|
|
22
|
+
Proximity["UNKNOWN_PROXIMITY"] = "UNKNOWN_PROXIMITY";
|
|
23
|
+
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
24
|
+
Proximity["PINPOINT"] = "PINPOINT";
|
|
25
|
+
/** indicates that the returned result is the geometric center of a result */
|
|
26
|
+
Proximity["APPROXIMATE"] = "APPROXIMATE";
|
|
27
|
+
/** indicates that the returned result is around an area */
|
|
28
|
+
Proximity["GENERAL_AREA"] = "GENERAL_AREA";
|
|
29
|
+
})(Proximity = exports.Proximity || (exports.Proximity = {}));
|
|
30
|
+
var FilterType;
|
|
31
|
+
(function (FilterType) {
|
|
32
|
+
/** Filter by zip code */
|
|
33
|
+
FilterType["zip_code"] = "zip_code";
|
|
34
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
35
|
+
FilterType["country_code"] = "country_code";
|
|
36
|
+
})(FilterType = exports.FilterType || (exports.FilterType = {}));
|
|
37
|
+
//# 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,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,GAAf,uBAAe,KAAf,uBAAe,QAc1B;AAED,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,GAAT,iBAAS,KAAT,iBAAS,QAQpB;AAqBD,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yBAAyB;IACzB,mCAAqB,CAAA;IACrB,oDAAoD;IACpD,2CAA6B,CAAA;AAC/B,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB"}
|