@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,26 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.location = exports.autocomplete = exports.places = void 0;
|
|
23
|
+
exports.places = __importStar(require("./src/atlas-v2-place.public"));
|
|
24
|
+
exports.autocomplete = __importStar(require("./src/atlas-v2-prediction.public"));
|
|
25
|
+
exports.location = __importStar(require("./src/atlas-v2-search-result.public"));
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsD;AACtD,iFAAiE;AACjE,gFAAgE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { GetPlaceRequest, GetPlaceResponse } from './atlas-v2-place.types';
|
|
3
|
+
/** 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. */
|
|
4
|
+
export declare function getPlace(payload: GetPlaceRequest): RequestOptionsFactory<GetPlaceResponse>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPlace = 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 _getPlaceRequest = {};
|
|
13
|
+
const _getPlaceResponse = { place: '_place' };
|
|
14
|
+
const _place = { address: '_address' };
|
|
15
|
+
function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(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
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
50
|
+
destPath: '',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'manage._base_domain_': [
|
|
54
|
+
{
|
|
55
|
+
srcPath: '/wix-atlas-service-web',
|
|
56
|
+
destPath: '',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
'editor._base_domain_': [
|
|
60
|
+
{
|
|
61
|
+
srcPath: '/wix-atlas-service-web',
|
|
62
|
+
destPath: '',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
66
|
+
destPath: '',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
'blocks._base_domain_': [
|
|
70
|
+
{
|
|
71
|
+
srcPath: '/wix-atlas-service-web',
|
|
72
|
+
destPath: '',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
76
|
+
destPath: '',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
'create.editorx': [
|
|
80
|
+
{
|
|
81
|
+
srcPath: '/wix-atlas-service-web',
|
|
82
|
+
destPath: '',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
86
|
+
destPath: '',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
'editor.wixapps.net': [
|
|
90
|
+
{
|
|
91
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
92
|
+
destPath: '',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
97
|
+
}
|
|
98
|
+
/** 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. */
|
|
99
|
+
function getPlace(payload) {
|
|
100
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_getPlaceRequest, {});
|
|
101
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_getPlaceResponse, {
|
|
102
|
+
_address,
|
|
103
|
+
_addressLocation,
|
|
104
|
+
_place,
|
|
105
|
+
});
|
|
106
|
+
function __getPlace({ host }) {
|
|
107
|
+
const serializedData = toReq(payload);
|
|
108
|
+
const metadata = {
|
|
109
|
+
method: 'GET',
|
|
110
|
+
url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
|
|
111
|
+
protoPath: '/v2/place',
|
|
112
|
+
data: serializedData,
|
|
113
|
+
host,
|
|
114
|
+
}),
|
|
115
|
+
params: metro_runtime_1.toURLSearchParams(serializedData),
|
|
116
|
+
transformResponse: fromRes,
|
|
117
|
+
};
|
|
118
|
+
return metadata;
|
|
119
|
+
}
|
|
120
|
+
__getPlace.fromReq = fromReq;
|
|
121
|
+
return __getPlace;
|
|
122
|
+
}
|
|
123
|
+
exports.getPlace = getPlace;
|
|
124
|
+
//# sourceMappingURL=atlas-v2-place.http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-place.http.js","sourceRoot":"","sources":["../../../src/atlas-v2-place.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,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,iBAAiB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC9C,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAEvC,SAAS,oDAAoD,CAC3D,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;YACD;gBACE,OAAO,EAAE,4BAA4B;gBACrC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,O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,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAE7B,OAAO,UAAU,CAAC;AACpB,CAAC;AA7BD,4BA6BC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
+
import { GetPlaceOptions } from './atlas-v2-place.universal';
|
|
3
|
+
export declare function getPlace(httpClient: HttpClient): (searchId: string, options?: GetPlaceOptions | undefined) => Promise<import("./atlas-v2-place.universal").GetPlaceResponse>;
|
|
4
|
+
export { SubdivisionType } from './atlas-v2-place.universal';
|
|
5
|
+
export { Place, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, GetPlaceRequest, GetPlaceResponse, GetPlaceOptions, } from './atlas-v2-place.universal';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubdivisionType = exports.getPlace = void 0;
|
|
4
|
+
const atlas_v2_place_universal_1 = require("./atlas-v2-place.universal");
|
|
5
|
+
function getPlace(httpClient) {
|
|
6
|
+
return (searchId, options) => atlas_v2_place_universal_1.getPlace(searchId, options,
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
{ httpClient });
|
|
9
|
+
}
|
|
10
|
+
exports.getPlace = getPlace;
|
|
11
|
+
var atlas_v2_place_universal_2 = require("./atlas-v2-place.universal");
|
|
12
|
+
Object.defineProperty(exports, "SubdivisionType", { enumerable: true, get: function () { return atlas_v2_place_universal_2.SubdivisionType; } });
|
|
13
|
+
//# sourceMappingURL=atlas-v2-place.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-place.public.js","sourceRoot":"","sources":["../../../src/atlas-v2-place.public.ts"],"names":[],"mappings":";;;AACA,yEAGoC;AAEpC,SAAgB,QAAQ,CAAC,UAAsB;IAC7C,OAAO,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE,CACrD,mCAAiB,CACf,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,4BAQC;AAED,uEAA6D;AAApD,2HAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export interface Place {
|
|
2
|
+
/** The given place id */
|
|
3
|
+
placeId?: string;
|
|
4
|
+
/** The Address object */
|
|
5
|
+
address?: Address;
|
|
6
|
+
/** The Place type. For example: airport, library etc... */
|
|
7
|
+
types?: string[];
|
|
8
|
+
}
|
|
9
|
+
/** Physical address */
|
|
10
|
+
export interface Address extends AddressStreetOneOf {
|
|
11
|
+
/** country code */
|
|
12
|
+
country?: string | null;
|
|
13
|
+
/** subdivision (usually state or region) code according to ISO 3166-2 */
|
|
14
|
+
subdivision?: string | null;
|
|
15
|
+
/** city name */
|
|
16
|
+
city?: string | null;
|
|
17
|
+
/** zip/postal code */
|
|
18
|
+
postalCode?: string | null;
|
|
19
|
+
/** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */
|
|
20
|
+
addressLine2?: string | null;
|
|
21
|
+
/** A string containing the human-readable address of this location */
|
|
22
|
+
formattedAddress?: string | null;
|
|
23
|
+
/** Free text for human-to-human textual orientation aid purposes */
|
|
24
|
+
hint?: string | null;
|
|
25
|
+
/** coordinates of the physical address */
|
|
26
|
+
geocode?: AddressLocation;
|
|
27
|
+
/** country full-name */
|
|
28
|
+
countryFullname?: string | null;
|
|
29
|
+
/** multi-level subdivisions from top to bottom */
|
|
30
|
+
subdivisions?: Subdivision[];
|
|
31
|
+
/** a break down of the street to number and street name */
|
|
32
|
+
streetAddress?: StreetAddress;
|
|
33
|
+
/** Main address line (usually street and number) as free text */
|
|
34
|
+
addressLine?: string | null;
|
|
35
|
+
}
|
|
36
|
+
/** @oneof */
|
|
37
|
+
export interface AddressStreetOneOf {
|
|
38
|
+
/** a break down of the street to number and street name */
|
|
39
|
+
streetAddress?: StreetAddress;
|
|
40
|
+
/** Main address line (usually street and number) as free text */
|
|
41
|
+
addressLine?: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface StreetAddress {
|
|
44
|
+
/** street number */
|
|
45
|
+
number?: string;
|
|
46
|
+
/** street name */
|
|
47
|
+
name?: string;
|
|
48
|
+
/** apartment number */
|
|
49
|
+
apt?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface AddressLocation {
|
|
52
|
+
latitude?: number | null;
|
|
53
|
+
longitude?: number | null;
|
|
54
|
+
}
|
|
55
|
+
export interface Subdivision {
|
|
56
|
+
/** subdivision short code */
|
|
57
|
+
code?: string;
|
|
58
|
+
/** subdivision full-name */
|
|
59
|
+
name?: string;
|
|
60
|
+
type?: SubdivisionType;
|
|
61
|
+
/** a free-text description of subdivision type */
|
|
62
|
+
typeInfo?: string | null;
|
|
63
|
+
}
|
|
64
|
+
export declare enum SubdivisionType {
|
|
65
|
+
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
66
|
+
/** state */
|
|
67
|
+
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
68
|
+
/** county */
|
|
69
|
+
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
70
|
+
/** cities/towns */
|
|
71
|
+
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
72
|
+
/** neighborhood/quarter */
|
|
73
|
+
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
74
|
+
/** street/block */
|
|
75
|
+
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
76
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
77
|
+
COUNTRY = "COUNTRY"
|
|
78
|
+
}
|
|
79
|
+
export interface GetPlaceRequest {
|
|
80
|
+
searchId: string;
|
|
81
|
+
/** 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. */
|
|
82
|
+
sessionToken?: string | null;
|
|
83
|
+
}
|
|
84
|
+
export interface GetPlaceResponse {
|
|
85
|
+
place?: Place;
|
|
86
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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
|
+
//# sourceMappingURL=atlas-v2-place.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-place.types.js","sourceRoot":"","sources":["../../../src/atlas-v2-place.types.ts"],"names":[],"mappings":";;;AAqEA,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"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare const __debug: {
|
|
2
|
+
verboseLogging: {
|
|
3
|
+
on: () => boolean;
|
|
4
|
+
off: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export interface Place {
|
|
8
|
+
/** The given place id */
|
|
9
|
+
placeId?: string;
|
|
10
|
+
/** The Address object */
|
|
11
|
+
address?: Address;
|
|
12
|
+
/** The Place type. For example: airport, library etc... */
|
|
13
|
+
types?: string[];
|
|
14
|
+
}
|
|
15
|
+
/** Physical address */
|
|
16
|
+
export interface Address extends AddressStreetOneOf {
|
|
17
|
+
/** country code */
|
|
18
|
+
country?: string | null;
|
|
19
|
+
/** subdivision (usually state or region) code according to ISO 3166-2 */
|
|
20
|
+
subdivision?: string | null;
|
|
21
|
+
/** city name */
|
|
22
|
+
city?: string | null;
|
|
23
|
+
/** zip/postal code */
|
|
24
|
+
postalCode?: string | null;
|
|
25
|
+
/** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */
|
|
26
|
+
addressLine2?: string | null;
|
|
27
|
+
/** a break down of the street to number and street name */
|
|
28
|
+
streetAddress?: StreetAddress;
|
|
29
|
+
/** Main address line (usually street and number) as free text */
|
|
30
|
+
addressLine1?: string | null;
|
|
31
|
+
}
|
|
32
|
+
/** @oneof */
|
|
33
|
+
export interface AddressStreetOneOf {
|
|
34
|
+
/** a break down of the street to number and street name */
|
|
35
|
+
streetAddress?: StreetAddress;
|
|
36
|
+
/** Main address line (usually street and number) as free text */
|
|
37
|
+
addressLine?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface StreetAddress {
|
|
40
|
+
/** street number */
|
|
41
|
+
number?: string;
|
|
42
|
+
/** street name */
|
|
43
|
+
name?: string;
|
|
44
|
+
/** apartment number */
|
|
45
|
+
apt?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface AddressLocation {
|
|
48
|
+
latitude?: number | null;
|
|
49
|
+
longitude?: number | null;
|
|
50
|
+
}
|
|
51
|
+
export interface Subdivision {
|
|
52
|
+
/** subdivision short code */
|
|
53
|
+
code?: string;
|
|
54
|
+
/** subdivision full-name */
|
|
55
|
+
name?: string;
|
|
56
|
+
type?: SubdivisionType;
|
|
57
|
+
/** a free-text description of subdivision type */
|
|
58
|
+
typeInfo?: string | null;
|
|
59
|
+
}
|
|
60
|
+
export declare enum SubdivisionType {
|
|
61
|
+
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
62
|
+
/** state */
|
|
63
|
+
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
64
|
+
/** county */
|
|
65
|
+
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
66
|
+
/** cities/towns */
|
|
67
|
+
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
68
|
+
/** neighborhood/quarter */
|
|
69
|
+
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
70
|
+
/** street/block */
|
|
71
|
+
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
72
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
73
|
+
COUNTRY = "COUNTRY"
|
|
74
|
+
}
|
|
75
|
+
export interface GetPlaceRequest {
|
|
76
|
+
searchId: string;
|
|
77
|
+
/** 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. */
|
|
78
|
+
sessionToken?: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface GetPlaceResponse {
|
|
81
|
+
place?: Place;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 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.
|
|
85
|
+
* @public
|
|
86
|
+
* @requiredField searchId
|
|
87
|
+
*/
|
|
88
|
+
export declare function getPlace(searchId: string, options?: GetPlaceOptions): Promise<GetPlaceResponse>;
|
|
89
|
+
export interface GetPlaceOptions {
|
|
90
|
+
/** 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. */
|
|
91
|
+
sessionToken?: string | null;
|
|
92
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
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.getPlace = exports.SubdivisionType = exports.__debug = void 0;
|
|
32
|
+
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
+
const ambassadorWixAtlasV2Place = __importStar(require("./atlas-v2-place.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 SubdivisionType;
|
|
50
|
+
(function (SubdivisionType) {
|
|
51
|
+
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
52
|
+
/** state */
|
|
53
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
54
|
+
/** county */
|
|
55
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
56
|
+
/** cities/towns */
|
|
57
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
58
|
+
/** neighborhood/quarter */
|
|
59
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
60
|
+
/** street/block */
|
|
61
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
62
|
+
/** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
63
|
+
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
64
|
+
})(SubdivisionType = exports.SubdivisionType || (exports.SubdivisionType = {}));
|
|
65
|
+
const _getPlaceRequest = {};
|
|
66
|
+
const _getPlaceResponse = { place: '_place' };
|
|
67
|
+
const _place = { address: 'wix.common.Address' };
|
|
68
|
+
/**
|
|
69
|
+
* 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.
|
|
70
|
+
* @public
|
|
71
|
+
* @requiredField searchId
|
|
72
|
+
*/
|
|
73
|
+
function getPlace(searchId, options) {
|
|
74
|
+
var _a, _b, _c;
|
|
75
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
76
|
+
const requestTransformation = {
|
|
77
|
+
searchId: '$[0]',
|
|
78
|
+
sessionToken: '$[1].sessionToken',
|
|
79
|
+
};
|
|
80
|
+
const responseTransformation = '$';
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
83
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
84
|
+
rootSchema: _getPlaceRequest,
|
|
85
|
+
depSchemas: {},
|
|
86
|
+
fqdnTransformation: {
|
|
87
|
+
paths: [],
|
|
88
|
+
transformation: _fromVeloEntity,
|
|
89
|
+
},
|
|
90
|
+
customTransformation: requestTransformation,
|
|
91
|
+
});
|
|
92
|
+
const { fromJSON } = velo_1.serializer({
|
|
93
|
+
rootSchema: _getPlaceResponse,
|
|
94
|
+
depSchemas: { _place },
|
|
95
|
+
fqdnTransformation: {
|
|
96
|
+
paths: [...['place']],
|
|
97
|
+
transformation: _toVeloEntity,
|
|
98
|
+
},
|
|
99
|
+
customTransformation: responseTransformation,
|
|
100
|
+
});
|
|
101
|
+
const payload = toAmbassadorRequest([searchId, options]);
|
|
102
|
+
const reqOpts = ambassadorWixAtlasV2Place.getPlace(payload);
|
|
103
|
+
__log(`"GetPlace" sending request with: ${__inspect(reqOpts)}`);
|
|
104
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
105
|
+
try {
|
|
106
|
+
const result = yield httpClient.request(reqOpts);
|
|
107
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
108
|
+
return fromJSON(result.data);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
112
|
+
'searchId',
|
|
113
|
+
'options',
|
|
114
|
+
]);
|
|
115
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
116
|
+
throw transformedError;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
exports.getPlace = getPlace;
|
|
121
|
+
//# 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,kDAAqE;AAErE,iFAAmE;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;AAEY,QAAA,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,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;AAYD,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,iBAAiB,GAAG,EAAE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U,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,qBAAc,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;AAzDD,4BAyDC"}
|
|
@@ -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,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.predict = void 0;
|
|
4
|
+
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
5
|
+
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
6
|
+
const _addressLocation = {
|
|
7
|
+
latitude: 'google.protobuf.DoubleValue',
|
|
8
|
+
longitude: 'google.protobuf.DoubleValue',
|
|
9
|
+
};
|
|
10
|
+
const _predictRequest = {
|
|
11
|
+
origin: '_addressLocation',
|
|
12
|
+
location: '_addressLocation',
|
|
13
|
+
};
|
|
14
|
+
const _predictResponse = {};
|
|
15
|
+
function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(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
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
50
|
+
destPath: '',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'manage._base_domain_': [
|
|
54
|
+
{
|
|
55
|
+
srcPath: '/wix-atlas-service-web',
|
|
56
|
+
destPath: '',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
'editor._base_domain_': [
|
|
60
|
+
{
|
|
61
|
+
srcPath: '/wix-atlas-service-web',
|
|
62
|
+
destPath: '',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
66
|
+
destPath: '',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
'blocks._base_domain_': [
|
|
70
|
+
{
|
|
71
|
+
srcPath: '/wix-atlas-service-web',
|
|
72
|
+
destPath: '',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
76
|
+
destPath: '',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
'create.editorx': [
|
|
80
|
+
{
|
|
81
|
+
srcPath: '/wix-atlas-service-web',
|
|
82
|
+
destPath: '',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
86
|
+
destPath: '',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
'editor.wixapps.net': [
|
|
90
|
+
{
|
|
91
|
+
srcPath: '/api/wix-atlas-service-web',
|
|
92
|
+
destPath: '',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
return metro_runtime_1.resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
97
|
+
}
|
|
98
|
+
/** A Predict end-point take an input and returns an list of Prediction object. */
|
|
99
|
+
function predict(payload) {
|
|
100
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_predictRequest, {
|
|
101
|
+
_addressLocation,
|
|
102
|
+
});
|
|
103
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_predictResponse, {});
|
|
104
|
+
function __predict({ host }) {
|
|
105
|
+
const serializedData = toReq(payload);
|
|
106
|
+
const metadata = {
|
|
107
|
+
method: 'POST',
|
|
108
|
+
url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({
|
|
109
|
+
protoPath: '/v2/predict',
|
|
110
|
+
data: serializedData,
|
|
111
|
+
host,
|
|
112
|
+
}),
|
|
113
|
+
data: serializedData,
|
|
114
|
+
transformResponse: fromRes,
|
|
115
|
+
};
|
|
116
|
+
return metadata;
|
|
117
|
+
}
|
|
118
|
+
__predict.fromReq = fromReq;
|
|
119
|
+
return __predict;
|
|
120
|
+
}
|
|
121
|
+
exports.predict = predict;
|
|
122
|
+
//# sourceMappingURL=atlas-v2-prediction.http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atlas-v2-prediction.http.js","sourceRoot":"","s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