@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,98 @@
|
|
|
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 ambassadorWixAtlasV2Place from './atlas-v2-place.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
|
+
const _getPlaceRequest = {};
|
|
44
|
+
const _getPlaceResponse = { place: '_place' };
|
|
45
|
+
const _place = { address: 'wix.common.Address' };
|
|
46
|
+
/**
|
|
47
|
+
* Once you have a search_id from a autocomplete Search, you can request more details about a particular establishment or point of interest by initiating a get place request.
|
|
48
|
+
* @public
|
|
49
|
+
* @requiredField searchId
|
|
50
|
+
*/
|
|
51
|
+
export function getPlace(searchId, options) {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
54
|
+
const requestTransformation = {
|
|
55
|
+
searchId: '$[0]',
|
|
56
|
+
sessionToken: '$[1].sessionToken',
|
|
57
|
+
};
|
|
58
|
+
const responseTransformation = '$';
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
61
|
+
const { toAmbassadorRequest } = serializer({
|
|
62
|
+
rootSchema: _getPlaceRequest,
|
|
63
|
+
depSchemas: {},
|
|
64
|
+
fqdnTransformation: {
|
|
65
|
+
paths: [],
|
|
66
|
+
transformation: _fromVeloEntity,
|
|
67
|
+
},
|
|
68
|
+
customTransformation: requestTransformation,
|
|
69
|
+
});
|
|
70
|
+
const { fromJSON } = serializer({
|
|
71
|
+
rootSchema: _getPlaceResponse,
|
|
72
|
+
depSchemas: { _place },
|
|
73
|
+
fqdnTransformation: {
|
|
74
|
+
paths: [...['place']],
|
|
75
|
+
transformation: _toVeloEntity,
|
|
76
|
+
},
|
|
77
|
+
customTransformation: responseTransformation,
|
|
78
|
+
});
|
|
79
|
+
const payload = toAmbassadorRequest([searchId, options]);
|
|
80
|
+
const reqOpts = ambassadorWixAtlasV2Place.getPlace(payload);
|
|
81
|
+
__log(`"GetPlace" sending request with: ${__inspect(reqOpts)}`);
|
|
82
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
83
|
+
try {
|
|
84
|
+
const result = yield httpClient.request(reqOpts);
|
|
85
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
86
|
+
return fromJSON(result.data);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
90
|
+
'searchId',
|
|
91
|
+
'options',
|
|
92
|
+
]);
|
|
93
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
94
|
+
throw transformedError;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=atlas-v2-place.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-place.universal.js","sourceRoot":"","sources":["../../../src/atlas-v2-place.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,yBAAyB,MAAM,uBAAuB,CAAC;AAEnE,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AA6D5B,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,e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,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { PredictRequest, PredictResponse } from './atlas-v2-prediction.types';
|
|
3
|
+
/** A Predict end-point take an input and returns an list of Prediction object. */
|
|
4
|
+
export declare function predict(payload: PredictRequest): RequestOptionsFactory<PredictResponse>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { serializer } from '@wix/metro-runtime/ambassador';
|
|
2
|
+
import { resolveUrl } from '@wix/metro-runtime';
|
|
3
|
+
const _addressLocation = {
|
|
4
|
+
latitude: 'google.protobuf.DoubleValue',
|
|
5
|
+
longitude: 'google.protobuf.DoubleValue',
|
|
6
|
+
};
|
|
7
|
+
const _predictRequest = {
|
|
8
|
+
origin: '_addressLocation',
|
|
9
|
+
location: '_addressLocation',
|
|
10
|
+
};
|
|
11
|
+
const _predictResponse = {};
|
|
12
|
+
function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
|
|
13
|
+
const domainToMappings = {
|
|
14
|
+
'api._api_base_domain_': [
|
|
15
|
+
{
|
|
16
|
+
srcPath: '/wix-atlas-service-web',
|
|
17
|
+
destPath: '',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
'bo._base_domain_': [
|
|
21
|
+
{
|
|
22
|
+
srcPath: '/wix-atlas-service-web',
|
|
23
|
+
destPath: '',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
_: [
|
|
27
|
+
{
|
|
28
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
29
|
+
destPath: '',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
srcPath: '/_api/wix-atlas-service-web',
|
|
33
|
+
destPath: '',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
'www._base_domain_': [
|
|
37
|
+
{
|
|
38
|
+
srcPath: '/wix-atlas-service-web',
|
|
39
|
+
destPath: '',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
srcPath: '/_api/wix-atlas-service-web',
|
|
43
|
+
destPath: '',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
47
|
+
destPath: '',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
'manage._base_domain_': [
|
|
51
|
+
{
|
|
52
|
+
srcPath: '/wix-atlas-service-web',
|
|
53
|
+
destPath: '',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
'editor._base_domain_': [
|
|
57
|
+
{
|
|
58
|
+
srcPath: '/wix-atlas-service-web',
|
|
59
|
+
destPath: '',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
63
|
+
destPath: '',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
'blocks._base_domain_': [
|
|
67
|
+
{
|
|
68
|
+
srcPath: '/wix-atlas-service-web',
|
|
69
|
+
destPath: '',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
73
|
+
destPath: '',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
'create.editorx': [
|
|
77
|
+
{
|
|
78
|
+
srcPath: '/wix-atlas-service-web',
|
|
79
|
+
destPath: '',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
83
|
+
destPath: '',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
'editor.wixapps.net': [
|
|
87
|
+
{
|
|
88
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
89
|
+
destPath: '',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
94
|
+
}
|
|
95
|
+
/** A Predict end-point take an input and returns an list of Prediction object. */
|
|
96
|
+
export function predict(payload) {
|
|
97
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_predictRequest, {
|
|
98
|
+
_addressLocation,
|
|
99
|
+
});
|
|
100
|
+
const { fromJSON: fromRes } = serializer(_predictResponse, {});
|
|
101
|
+
function __predict({ host }) {
|
|
102
|
+
const serializedData = toReq(payload);
|
|
103
|
+
const metadata = {
|
|
104
|
+
method: 'POST',
|
|
105
|
+
url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({
|
|
106
|
+
protoPath: '/v2/predict',
|
|
107
|
+
data: serializedData,
|
|
108
|
+
host,
|
|
109
|
+
}),
|
|
110
|
+
data: serializedData,
|
|
111
|
+
transformResponse: fromRes,
|
|
112
|
+
};
|
|
113
|
+
return metadata;
|
|
114
|
+
}
|
|
115
|
+
__predict.fromReq = fromReq;
|
|
116
|
+
return __predict;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=atlas-v2-prediction.http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-prediction.http.js","sourceRoot":"","sources":["../../../src/atlas-v2-prediction.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE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|
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,8 @@
|
|
|
1
|
+
import { predict as universalPredict, } from './atlas-v2-prediction.universal';
|
|
2
|
+
export function predict(httpClient) {
|
|
3
|
+
return (input, options) => universalPredict(input, options,
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
{ httpClient });
|
|
6
|
+
}
|
|
7
|
+
export { FilterType } from './atlas-v2-prediction.universal';
|
|
8
|
+
//# 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,OAAO,EACL,OAAO,IAAI,gBAAgB,GAE5B,MAAM,iCAAiC,CAAC;AAEzC,MAAM,UAAU,OAAO,CAAC,UAAsB;IAC5C,OAAO,CAAC,KAAa,EAAE,OAAwB,EAAE,EAAE,CACjD,gBAAgB,CACd,KAAK,EACL,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -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,8 @@
|
|
|
1
|
+
export var FilterType;
|
|
2
|
+
(function (FilterType) {
|
|
3
|
+
/** Filter by zip code */
|
|
4
|
+
FilterType["zip_code"] = "zip_code";
|
|
5
|
+
/** Filter by 2-letters or 3-letters country code */
|
|
6
|
+
FilterType["country_code"] = "country_code";
|
|
7
|
+
})(FilterType || (FilterType = {}));
|
|
8
|
+
//# 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,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,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,93 @@
|
|
|
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 ambassadorWixAtlasV2Prediction from './atlas-v2-prediction.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 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
|
+
const _predictRequest = {};
|
|
35
|
+
const _predictResponse = {};
|
|
36
|
+
/**
|
|
37
|
+
* A Predict end-point take an input and returns an list of Prediction object.
|
|
38
|
+
* @param input - The text the predictions will be based on.
|
|
39
|
+
* @public
|
|
40
|
+
* @requiredField input
|
|
41
|
+
*/
|
|
42
|
+
export function predict(input, options) {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
45
|
+
const requestTransformation = {
|
|
46
|
+
input: '$[0]',
|
|
47
|
+
origin: '$[1].origin',
|
|
48
|
+
location: '$[1].location',
|
|
49
|
+
radius: '$[1].radius',
|
|
50
|
+
countryCodes: '$[1].countryCodes',
|
|
51
|
+
sessionToken: '$[1].sessionToken',
|
|
52
|
+
};
|
|
53
|
+
const responseTransformation = '$';
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
56
|
+
const { toAmbassadorRequest } = serializer({
|
|
57
|
+
rootSchema: _predictRequest,
|
|
58
|
+
depSchemas: {},
|
|
59
|
+
fqdnTransformation: {
|
|
60
|
+
paths: [],
|
|
61
|
+
transformation: _fromVeloEntity,
|
|
62
|
+
},
|
|
63
|
+
customTransformation: requestTransformation,
|
|
64
|
+
});
|
|
65
|
+
const { fromJSON } = serializer({
|
|
66
|
+
rootSchema: _predictResponse,
|
|
67
|
+
depSchemas: {},
|
|
68
|
+
fqdnTransformation: {
|
|
69
|
+
paths: [...['Array#predictions']],
|
|
70
|
+
transformation: _toVeloEntity,
|
|
71
|
+
},
|
|
72
|
+
customTransformation: responseTransformation,
|
|
73
|
+
});
|
|
74
|
+
const payload = toAmbassadorRequest([input, options]);
|
|
75
|
+
const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);
|
|
76
|
+
__log(`"Predict" sending request with: ${__inspect(reqOpts)}`);
|
|
77
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
78
|
+
try {
|
|
79
|
+
const result = yield httpClient.request(reqOpts);
|
|
80
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
81
|
+
return fromJSON(result.data);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
85
|
+
'input',
|
|
86
|
+
'options',
|
|
87
|
+
]);
|
|
88
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
89
|
+
throw transformedError;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//# 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":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,8BAA8B,MAAM,4BAA4B,CAAC;AAE7E,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,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E,gBAAgB;YAC5B,UAAU,EAAE,EAAE;YACd,kBAAkB,EAAE;gBAClB,KAAK,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;gBACjC,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QAEtD,MAAM,OAAO,GAAG,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEhE,KAAK,CAAC,mCAAmC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE/D,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
|
|
@@ -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,92 @@
|
|
|
1
|
+
import { toURLSearchParams } from '@wix/metro-runtime';
|
|
2
|
+
import { serializer } from '@wix/metro-runtime/ambassador';
|
|
3
|
+
import { resolveUrl } from '@wix/metro-runtime';
|
|
4
|
+
const _address = { geocode: '_addressLocation' };
|
|
5
|
+
const _addressLocation = {
|
|
6
|
+
latitude: 'google.protobuf.DoubleValue',
|
|
7
|
+
longitude: 'google.protobuf.DoubleValue',
|
|
8
|
+
};
|
|
9
|
+
const _searchRequest = {};
|
|
10
|
+
const _searchResponse = { searchResults: '_searchResult' };
|
|
11
|
+
const _searchResult = { address: '_address' };
|
|
12
|
+
function resolveComWixpressViAtlasServiceV2LocationServiceV2Url(opts) {
|
|
13
|
+
const domainToMappings = {
|
|
14
|
+
'api._api_base_domain_': [
|
|
15
|
+
{
|
|
16
|
+
srcPath: '/wix-atlas-service-web',
|
|
17
|
+
destPath: '',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
'bo._base_domain_': [
|
|
21
|
+
{
|
|
22
|
+
srcPath: '/wix-atlas-service-web',
|
|
23
|
+
destPath: '',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
_: [
|
|
27
|
+
{
|
|
28
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
29
|
+
destPath: '',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
srcPath: '/_api/wix-atlas-service-web',
|
|
33
|
+
destPath: '',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
'www._base_domain_': [
|
|
37
|
+
{
|
|
38
|
+
srcPath: '/wix-atlas-service-web',
|
|
39
|
+
destPath: '',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
srcPath: '/_api/wix-atlas-service-web',
|
|
43
|
+
destPath: '',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
'manage._base_domain_': [
|
|
47
|
+
{
|
|
48
|
+
srcPath: '/wix-atlas-service-web',
|
|
49
|
+
destPath: '',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'editor._base_domain_': [
|
|
53
|
+
{
|
|
54
|
+
srcPath: '/wix-atlas-service-web',
|
|
55
|
+
destPath: '',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'editor.wixapps.net': [
|
|
59
|
+
{
|
|
60
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
61
|
+
destPath: '',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
66
|
+
}
|
|
67
|
+
/** A Search request takes a free text as an input and returns a list of 'Address' objects. */
|
|
68
|
+
export function search(payload) {
|
|
69
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_searchRequest, {});
|
|
70
|
+
const { fromJSON: fromRes } = serializer(_searchResponse, {
|
|
71
|
+
_address,
|
|
72
|
+
_addressLocation,
|
|
73
|
+
_searchResult,
|
|
74
|
+
});
|
|
75
|
+
function __search({ host }) {
|
|
76
|
+
const serializedData = toReq(payload);
|
|
77
|
+
const metadata = {
|
|
78
|
+
method: 'GET',
|
|
79
|
+
url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({
|
|
80
|
+
protoPath: '/v2/search',
|
|
81
|
+
data: serializedData,
|
|
82
|
+
host,
|
|
83
|
+
}),
|
|
84
|
+
params: toURLSearchParams(serializedData),
|
|
85
|
+
transformResponse: fromRes,
|
|
86
|
+
};
|
|
87
|
+
return metadata;
|
|
88
|
+
}
|
|
89
|
+
__search.fromReq = fromReq;
|
|
90
|
+
return __search;
|
|
91
|
+
}
|
|
92
|
+
//# 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,E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U,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,MAAM,CACpB,OAAsB;IAEtB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,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,iBAAiB,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"}
|
|
@@ -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';
|