@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.
Files changed (79) hide show
  1. package/build/cjs/index.d.ts +3 -0
  2. package/build/cjs/index.js +26 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/atlas-v2-place.http.d.ts +4 -0
  5. package/build/cjs/src/atlas-v2-place.http.js +124 -0
  6. package/build/cjs/src/atlas-v2-place.http.js.map +1 -0
  7. package/build/cjs/src/atlas-v2-place.public.d.ts +5 -0
  8. package/build/cjs/src/atlas-v2-place.public.js +13 -0
  9. package/build/cjs/src/atlas-v2-place.public.js.map +1 -0
  10. package/build/cjs/src/atlas-v2-place.types.d.ts +86 -0
  11. package/build/cjs/src/atlas-v2-place.types.js +20 -0
  12. package/build/cjs/src/atlas-v2-place.types.js.map +1 -0
  13. package/build/cjs/src/atlas-v2-place.universal.d.ts +92 -0
  14. package/build/cjs/src/atlas-v2-place.universal.js +121 -0
  15. package/build/cjs/src/atlas-v2-place.universal.js.map +1 -0
  16. package/build/cjs/src/atlas-v2-prediction.http.d.ts +4 -0
  17. package/build/cjs/src/atlas-v2-prediction.http.js +122 -0
  18. package/build/cjs/src/atlas-v2-prediction.http.js.map +1 -0
  19. package/build/cjs/src/atlas-v2-prediction.public.d.ts +5 -0
  20. package/build/cjs/src/atlas-v2-prediction.public.js +13 -0
  21. package/build/cjs/src/atlas-v2-prediction.public.js.map +1 -0
  22. package/build/cjs/src/atlas-v2-prediction.types.d.ts +72 -0
  23. package/build/cjs/src/atlas-v2-prediction.types.js +11 -0
  24. package/build/cjs/src/atlas-v2-prediction.types.js.map +1 -0
  25. package/build/cjs/src/atlas-v2-prediction.universal.d.ts +97 -0
  26. package/build/cjs/src/atlas-v2-prediction.universal.js +116 -0
  27. package/build/cjs/src/atlas-v2-prediction.universal.js.map +1 -0
  28. package/build/cjs/src/atlas-v2-search-result.http.d.ts +4 -0
  29. package/build/cjs/src/atlas-v2-search-result.http.js +96 -0
  30. package/build/cjs/src/atlas-v2-search-result.http.js.map +1 -0
  31. package/build/cjs/src/atlas-v2-search-result.public.d.ts +5 -0
  32. package/build/cjs/src/atlas-v2-search-result.public.js +15 -0
  33. package/build/cjs/src/atlas-v2-search-result.public.js.map +1 -0
  34. package/build/cjs/src/atlas-v2-search-result.types.d.ts +119 -0
  35. package/build/cjs/src/atlas-v2-search-result.types.js +37 -0
  36. package/build/cjs/src/atlas-v2-search-result.types.js.map +1 -0
  37. package/build/cjs/src/atlas-v2-search-result.universal.d.ts +129 -0
  38. package/build/cjs/src/atlas-v2-search-result.universal.js +137 -0
  39. package/build/cjs/src/atlas-v2-search-result.universal.js.map +1 -0
  40. package/build/es/index.d.ts +3 -0
  41. package/build/es/index.js +4 -0
  42. package/build/es/index.js.map +1 -0
  43. package/build/es/src/atlas-v2-place.http.d.ts +4 -0
  44. package/build/es/src/atlas-v2-place.http.js +120 -0
  45. package/build/es/src/atlas-v2-place.http.js.map +1 -0
  46. package/build/es/src/atlas-v2-place.public.d.ts +5 -0
  47. package/build/es/src/atlas-v2-place.public.js +8 -0
  48. package/build/es/src/atlas-v2-place.public.js.map +1 -0
  49. package/build/es/src/atlas-v2-place.types.d.ts +86 -0
  50. package/build/es/src/atlas-v2-place.types.js +17 -0
  51. package/build/es/src/atlas-v2-place.types.js.map +1 -0
  52. package/build/es/src/atlas-v2-place.universal.d.ts +92 -0
  53. package/build/es/src/atlas-v2-place.universal.js +98 -0
  54. package/build/es/src/atlas-v2-place.universal.js.map +1 -0
  55. package/build/es/src/atlas-v2-prediction.http.d.ts +4 -0
  56. package/build/es/src/atlas-v2-prediction.http.js +118 -0
  57. package/build/es/src/atlas-v2-prediction.http.js.map +1 -0
  58. package/build/es/src/atlas-v2-prediction.public.d.ts +5 -0
  59. package/build/es/src/atlas-v2-prediction.public.js +8 -0
  60. package/build/es/src/atlas-v2-prediction.public.js.map +1 -0
  61. package/build/es/src/atlas-v2-prediction.types.d.ts +72 -0
  62. package/build/es/src/atlas-v2-prediction.types.js +8 -0
  63. package/build/es/src/atlas-v2-prediction.types.js.map +1 -0
  64. package/build/es/src/atlas-v2-prediction.universal.d.ts +97 -0
  65. package/build/es/src/atlas-v2-prediction.universal.js +93 -0
  66. package/build/es/src/atlas-v2-prediction.universal.js.map +1 -0
  67. package/build/es/src/atlas-v2-search-result.http.d.ts +4 -0
  68. package/build/es/src/atlas-v2-search-result.http.js +92 -0
  69. package/build/es/src/atlas-v2-search-result.http.js.map +1 -0
  70. package/build/es/src/atlas-v2-search-result.public.d.ts +5 -0
  71. package/build/es/src/atlas-v2-search-result.public.js +8 -0
  72. package/build/es/src/atlas-v2-search-result.public.js.map +1 -0
  73. package/build/es/src/atlas-v2-search-result.types.d.ts +119 -0
  74. package/build/es/src/atlas-v2-search-result.types.js +34 -0
  75. package/build/es/src/atlas-v2-search-result.types.js.map +1 -0
  76. package/build/es/src/atlas-v2-search-result.universal.d.ts +129 -0
  77. package/build/es/src/atlas-v2-search-result.universal.js +114 -0
  78. package/build/es/src/atlas-v2-search-result.universal.js.map +1 -0
  79. package/package.json +37 -0
@@ -0,0 +1,129 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ export interface SearchResult {
8
+ /** The Address object */
9
+ address?: Address;
10
+ /** stores additional data about the proximity to the specified location */
11
+ proximity?: Proximity;
12
+ }
13
+ /** Physical address */
14
+ export interface Address extends AddressStreetOneOf {
15
+ /** country code */
16
+ country?: string | null;
17
+ /** subdivision (usually state or region) code according to ISO 3166-2 */
18
+ subdivision?: string | null;
19
+ /** city name */
20
+ city?: string | null;
21
+ /** zip/postal code */
22
+ postalCode?: string | null;
23
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, Floor */
24
+ addressLine2?: string | null;
25
+ /** a break down of the street to number and street name */
26
+ streetAddress?: StreetAddress;
27
+ /** Main address line (usually street and number) as free text */
28
+ addressLine1?: string | null;
29
+ }
30
+ /** @oneof */
31
+ export interface AddressStreetOneOf {
32
+ /** a break down of the street to number and street name */
33
+ streetAddress?: StreetAddress;
34
+ /** Main address line (usually street and number) as free text */
35
+ addressLine?: string | null;
36
+ }
37
+ export interface StreetAddress {
38
+ /** street number */
39
+ number?: string;
40
+ /** street name */
41
+ name?: string;
42
+ /** apartment number */
43
+ apt?: string;
44
+ }
45
+ export interface AddressLocation {
46
+ latitude?: number | null;
47
+ longitude?: number | null;
48
+ }
49
+ export interface Subdivision {
50
+ /** subdivision short code */
51
+ code?: string;
52
+ /** subdivision full-name */
53
+ name?: string;
54
+ type?: SubdivisionType;
55
+ /** a free-text description of subdivision type */
56
+ typeInfo?: string | null;
57
+ }
58
+ export declare enum SubdivisionType {
59
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
60
+ /** state */
61
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
62
+ /** county */
63
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
64
+ /** cities/towns */
65
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
66
+ /** neighborhood/quarter */
67
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
68
+ /** street/block */
69
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
70
+ /** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
71
+ COUNTRY = "COUNTRY"
72
+ }
73
+ export declare enum Proximity {
74
+ UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
75
+ /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
76
+ PINPOINT = "PINPOINT",
77
+ /** indicates that the returned result is the geometric center of a result */
78
+ APPROXIMATE = "APPROXIMATE",
79
+ /** indicates that the returned result is around an area */
80
+ GENERAL_AREA = "GENERAL_AREA"
81
+ }
82
+ /** User must provide query or filter by parameters */
83
+ export interface SearchRequest {
84
+ /** Free text */
85
+ query?: string | null;
86
+ /** Deprecate! - Please use 'zipCode' and 'countryCodes' fields */
87
+ filterBy?: FilterBy[];
88
+ /** Zip code filter the user can add in order to get more accurate results */
89
+ zipCode?: string | null;
90
+ /** Country codes filter the user can add in order to get more accurate results */
91
+ countryCodes?: string[];
92
+ }
93
+ export interface FilterBy {
94
+ /** One of the filter types enum */
95
+ filterType?: FilterType;
96
+ /** Free text like "us" */
97
+ filterValue?: string;
98
+ }
99
+ export declare enum FilterType {
100
+ /** Filter by zip code */
101
+ zip_code = "zip_code",
102
+ /** Filter by 2-letters or 3-letters country code */
103
+ country_code = "country_code"
104
+ }
105
+ export interface SearchResponse {
106
+ /** List of 'Address' objects */
107
+ searchResults?: SearchResult[];
108
+ }
109
+ export interface ReverseGeocodingRequest {
110
+ /** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */
111
+ addressLocation?: AddressLocation;
112
+ }
113
+ export interface ReverseGeocodingResponse {
114
+ searchResults?: SearchResult[];
115
+ }
116
+ /**
117
+ * A Search request takes a free text as an input and returns a list of 'Address' objects.
118
+ * @public */
119
+ export declare function search(options?: SearchOptions): Promise<SearchResponse>;
120
+ export interface SearchOptions {
121
+ /** Free text */
122
+ query?: string | null;
123
+ /** Deprecate! - Please use 'zipCode' and 'countryCodes' fields */
124
+ filterBy?: FilterBy[];
125
+ /** Zip code filter the user can add in order to get more accurate results */
126
+ zipCode?: string | null;
127
+ /** Country codes filter the user can add in order to get more accurate results */
128
+ countryCodes?: string[];
129
+ }
@@ -0,0 +1,137 @@
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.search = exports.FilterType = exports.Proximity = exports.SubdivisionType = exports.__debug = void 0;
32
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixAtlasV2SearchResult = __importStar(require("./atlas-v2-search-result.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
+ var Proximity;
66
+ (function (Proximity) {
67
+ Proximity["UNKNOWN_PROXIMITY"] = "UNKNOWN_PROXIMITY";
68
+ /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
69
+ Proximity["PINPOINT"] = "PINPOINT";
70
+ /** indicates that the returned result is the geometric center of a result */
71
+ Proximity["APPROXIMATE"] = "APPROXIMATE";
72
+ /** indicates that the returned result is around an area */
73
+ Proximity["GENERAL_AREA"] = "GENERAL_AREA";
74
+ })(Proximity = exports.Proximity || (exports.Proximity = {}));
75
+ var FilterType;
76
+ (function (FilterType) {
77
+ /** Filter by zip code */
78
+ FilterType["zip_code"] = "zip_code";
79
+ /** Filter by 2-letters or 3-letters country code */
80
+ FilterType["country_code"] = "country_code";
81
+ })(FilterType = exports.FilterType || (exports.FilterType = {}));
82
+ const _searchRequest = {};
83
+ const _searchResponse = { searchResults: '_searchResult' };
84
+ const _searchResult = { address: 'wix.common.Address' };
85
+ /**
86
+ * A Search request takes a free text as an input and returns a list of 'Address' objects.
87
+ * @public */
88
+ function search(options) {
89
+ var _a, _b, _c;
90
+ return __awaiter(this, arguments, void 0, function* () {
91
+ const requestTransformation = {
92
+ query: '$[0].query',
93
+ filterBy: '$[0].filterBy',
94
+ zipCode: '$[0].zipCode',
95
+ countryCodes: '$[0].countryCodes',
96
+ };
97
+ const responseTransformation = '$';
98
+ // @ts-ignore
99
+ const { httpClient, sideEffects } = arguments[1];
100
+ const { toAmbassadorRequest } = velo_1.serializer({
101
+ rootSchema: _searchRequest,
102
+ depSchemas: {},
103
+ fqdnTransformation: {
104
+ paths: [],
105
+ transformation: _fromVeloEntity,
106
+ },
107
+ customTransformation: requestTransformation,
108
+ });
109
+ const { fromJSON } = velo_1.serializer({
110
+ rootSchema: _searchResponse,
111
+ depSchemas: { _searchResult },
112
+ fqdnTransformation: {
113
+ paths: [...['Array#searchResults']],
114
+ transformation: _toVeloEntity,
115
+ },
116
+ customTransformation: responseTransformation,
117
+ });
118
+ const payload = toAmbassadorRequest([options]);
119
+ const reqOpts = ambassadorWixAtlasV2SearchResult.search(payload);
120
+ __log(`"Search" sending request with: ${__inspect(reqOpts)}`);
121
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
122
+ try {
123
+ const result = yield httpClient.request(reqOpts);
124
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
125
+ return fromJSON(result.data);
126
+ }
127
+ catch (err) {
128
+ const transformedError = velo_1.transformError(err, requestTransformation, [
129
+ 'options',
130
+ ]);
131
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
132
+ throw transformedError;
133
+ }
134
+ });
135
+ }
136
+ exports.search = search;
137
+ //# sourceMappingURL=atlas-v2-search-result.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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AAC,kCAAkC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE9D,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,qBAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,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;AAvDD,wBAuDC"}
@@ -0,0 +1,3 @@
1
+ export * as places from './src/atlas-v2-place.public';
2
+ export * as autocomplete from './src/atlas-v2-prediction.public';
3
+ export * as location from './src/atlas-v2-search-result.public';
@@ -0,0 +1,4 @@
1
+ export * as places from './src/atlas-v2-place.public';
2
+ export * as autocomplete from './src/atlas-v2-prediction.public';
3
+ export * as location from './src/atlas-v2-search-result.public';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,QAAQ,MAAM,qCAAqC,CAAC"}
@@ -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,120 @@
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 _getPlaceRequest = {};
10
+ const _getPlaceResponse = { place: '_place' };
11
+ const _place = { address: '_address' };
12
+ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(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
+ /** 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. */
96
+ export function getPlace(payload) {
97
+ const { toJSON: toReq, fromJSON: fromReq } = serializer(_getPlaceRequest, {});
98
+ const { fromJSON: fromRes } = serializer(_getPlaceResponse, {
99
+ _address,
100
+ _addressLocation,
101
+ _place,
102
+ });
103
+ function __getPlace({ host }) {
104
+ const serializedData = toReq(payload);
105
+ const metadata = {
106
+ method: 'GET',
107
+ url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
108
+ protoPath: '/v2/place',
109
+ data: serializedData,
110
+ host,
111
+ }),
112
+ params: toURLSearchParams(serializedData),
113
+ transformResponse: fromRes,
114
+ };
115
+ return metadata;
116
+ }
117
+ __getPlace.fromReq = fromReq;
118
+ return __getPlace;
119
+ }
120
+ //# 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,MAAM,QAAQ,GAAG,EAAE,O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'./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,8 @@
1
+ import { getPlace as universalGetPlace, } from './atlas-v2-place.universal';
2
+ export function getPlace(httpClient) {
3
+ return (searchId, options) => universalGetPlace(searchId, options,
4
+ // @ts-ignore
5
+ { httpClient });
6
+ }
7
+ export { SubdivisionType } from './atlas-v2-place.universal';
8
+ //# 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,OAAO,EACL,QAAQ,IAAI,iBAAiB,GAE9B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,UAAU,QAAQ,CAAC,UAAsB;IAC7C,OAAO,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE,CACrD,iBAAiB,CACf,QAAQ,EACR,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC"}
@@ -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,17 @@
1
+ export var SubdivisionType;
2
+ (function (SubdivisionType) {
3
+ SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
4
+ /** state */
5
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
6
+ /** county */
7
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
8
+ /** cities/towns */
9
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
10
+ /** neighborhood/quarter */
11
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
12
+ /** street/block */
13
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
14
+ /** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
15
+ SubdivisionType["COUNTRY"] = "COUNTRY";
16
+ })(SubdivisionType || (SubdivisionType = {}));
17
+ //# 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,MAAM,CAAN,IAAY,eAcX;AAdD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,YAAY;IACZ,8EAA2D,CAAA;IAC3D,aAAa;IACb,8EAA2D,CAAA;IAC3D,mBAAmB;IACnB,8EAA2D,CAAA;IAC3D,2BAA2B;IAC3B,8EAA2D,CAAA;IAC3D,mBAAmB;IACnB,8EAA2D,CAAA;IAC3D,+IAA+I;IAC/I,sCAAmB,CAAA;AACrB,CAAC,EAdW,eAAe,KAAf,eAAe,QAc1B"}
@@ -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
+ }