@wix/auto_sdk_atlas_location 1.0.1 → 1.0.3
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 +18 -1
- package/build/cjs/index.js +262 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +148 -1
- package/build/cjs/index.typings.js +249 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +99 -1
- package/build/cjs/meta.js +193 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +18 -0
- package/build/es/index.mjs +238 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/atlas-v2-search-result-location.universal.d.ts → es/index.typings.d.mts} +27 -35
- package/build/es/index.typings.mjs +225 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/{internal/cjs/src/atlas-v2-search-result-location.types.d.ts → es/meta.d.mts} +32 -45
- package/build/es/meta.mjs +169 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +18 -1
- package/build/internal/cjs/index.js +262 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +148 -1
- package/build/internal/cjs/index.typings.js +249 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +99 -1
- package/build/internal/cjs/meta.js +193 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +18 -0
- package/build/internal/es/index.mjs +238 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/{src/atlas-v2-search-result-location.universal.d.ts → index.typings.d.mts} +27 -35
- package/build/internal/es/index.typings.mjs +225 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/{es/src/atlas-v2-search-result-location.types.d.ts → internal/es/meta.d.mts} +32 -45
- package/build/internal/es/meta.mjs +169 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +11 -10
- package/build/cjs/src/atlas-v2-search-result-location.context.d.ts +0 -5
- package/build/cjs/src/atlas-v2-search-result-location.context.js +0 -11
- package/build/cjs/src/atlas-v2-search-result-location.context.js.map +0 -1
- package/build/cjs/src/atlas-v2-search-result-location.http.d.ts +0 -3
- package/build/cjs/src/atlas-v2-search-result-location.http.js +0 -144
- package/build/cjs/src/atlas-v2-search-result-location.http.js.map +0 -1
- package/build/cjs/src/atlas-v2-search-result-location.meta.d.ts +0 -13
- package/build/cjs/src/atlas-v2-search-result-location.meta.js +0 -47
- package/build/cjs/src/atlas-v2-search-result-location.meta.js.map +0 -1
- package/build/cjs/src/atlas-v2-search-result-location.public.d.ts +0 -13
- package/build/cjs/src/atlas-v2-search-result-location.public.js +0 -16
- package/build/cjs/src/atlas-v2-search-result-location.public.js.map +0 -1
- package/build/cjs/src/atlas-v2-search-result-location.types.d.ts +0 -112
- package/build/cjs/src/atlas-v2-search-result-location.types.js +0 -37
- package/build/cjs/src/atlas-v2-search-result-location.types.js.map +0 -1
- package/build/cjs/src/atlas-v2-search-result-location.universal.d.ts +0 -156
- package/build/cjs/src/atlas-v2-search-result-location.universal.js +0 -127
- package/build/cjs/src/atlas-v2-search-result-location.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/atlas-v2-search-result-location.context.d.ts +0 -5
- package/build/es/src/atlas-v2-search-result-location.context.js +0 -5
- package/build/es/src/atlas-v2-search-result-location.context.js.map +0 -1
- package/build/es/src/atlas-v2-search-result-location.http.d.ts +0 -3
- package/build/es/src/atlas-v2-search-result-location.http.js +0 -140
- package/build/es/src/atlas-v2-search-result-location.http.js.map +0 -1
- package/build/es/src/atlas-v2-search-result-location.meta.d.ts +0 -13
- package/build/es/src/atlas-v2-search-result-location.meta.js +0 -20
- package/build/es/src/atlas-v2-search-result-location.meta.js.map +0 -1
- package/build/es/src/atlas-v2-search-result-location.public.d.ts +0 -13
- package/build/es/src/atlas-v2-search-result-location.public.js +0 -9
- package/build/es/src/atlas-v2-search-result-location.public.js.map +0 -1
- package/build/es/src/atlas-v2-search-result-location.types.js +0 -34
- package/build/es/src/atlas-v2-search-result-location.types.js.map +0 -1
- package/build/es/src/atlas-v2-search-result-location.universal.d.ts +0 -156
- package/build/es/src/atlas-v2-search-result-location.universal.js +0 -100
- package/build/es/src/atlas-v2-search-result-location.universal.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-search-result-location.context.d.ts +0 -5
- package/build/internal/cjs/src/atlas-v2-search-result-location.context.js +0 -11
- package/build/internal/cjs/src/atlas-v2-search-result-location.context.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-search-result-location.http.d.ts +0 -3
- package/build/internal/cjs/src/atlas-v2-search-result-location.http.js +0 -144
- package/build/internal/cjs/src/atlas-v2-search-result-location.http.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-search-result-location.meta.d.ts +0 -13
- package/build/internal/cjs/src/atlas-v2-search-result-location.meta.js +0 -47
- package/build/internal/cjs/src/atlas-v2-search-result-location.meta.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-search-result-location.public.d.ts +0 -13
- package/build/internal/cjs/src/atlas-v2-search-result-location.public.js +0 -16
- package/build/internal/cjs/src/atlas-v2-search-result-location.public.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-search-result-location.types.js +0 -37
- package/build/internal/cjs/src/atlas-v2-search-result-location.types.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-search-result-location.universal.js +0 -127
- package/build/internal/cjs/src/atlas-v2-search-result-location.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/atlas-v2-search-result-location.context.d.ts +0 -5
- package/build/internal/es/src/atlas-v2-search-result-location.context.js +0 -5
- package/build/internal/es/src/atlas-v2-search-result-location.context.js.map +0 -1
- package/build/internal/es/src/atlas-v2-search-result-location.http.d.ts +0 -3
- package/build/internal/es/src/atlas-v2-search-result-location.http.js +0 -140
- package/build/internal/es/src/atlas-v2-search-result-location.http.js.map +0 -1
- package/build/internal/es/src/atlas-v2-search-result-location.meta.d.ts +0 -13
- package/build/internal/es/src/atlas-v2-search-result-location.meta.js +0 -20
- package/build/internal/es/src/atlas-v2-search-result-location.meta.js.map +0 -1
- package/build/internal/es/src/atlas-v2-search-result-location.public.d.ts +0 -13
- package/build/internal/es/src/atlas-v2-search-result-location.public.js +0 -9
- package/build/internal/es/src/atlas-v2-search-result-location.public.js.map +0 -1
- package/build/internal/es/src/atlas-v2-search-result-location.types.d.ts +0 -112
- package/build/internal/es/src/atlas-v2-search-result-location.types.js +0 -34
- package/build/internal/es/src/atlas-v2-search-result-location.types.js.map +0 -1
- package/build/internal/es/src/atlas-v2-search-result-location.universal.js +0 -100
- package/build/internal/es/src/atlas-v2-search-result-location.universal.js.map +0 -1
package/build/internal/es/{src/atlas-v2-search-result-location.universal.d.ts → index.typings.d.mts}
RENAMED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
interface SearchResult {
|
|
3
4
|
/** The Address object */
|
|
4
5
|
address?: Address;
|
|
5
6
|
/** stores additional data about the proximity to the specified location */
|
|
6
|
-
proximity?:
|
|
7
|
+
proximity?: ProximityWithLiterals;
|
|
7
8
|
}
|
|
8
9
|
/** Physical address */
|
|
9
|
-
|
|
10
|
+
interface Address extends AddressStreetOneOf {
|
|
10
11
|
/** Street name and number. */
|
|
11
12
|
streetAddress?: StreetAddress;
|
|
12
13
|
/** Main address line, usually street and number as free text. */
|
|
@@ -26,31 +27,31 @@ export interface Address extends AddressStreetOneOf {
|
|
|
26
27
|
addressLine2?: string | null;
|
|
27
28
|
}
|
|
28
29
|
/** @oneof */
|
|
29
|
-
|
|
30
|
+
interface AddressStreetOneOf {
|
|
30
31
|
/** Street name and number. */
|
|
31
32
|
streetAddress?: StreetAddress;
|
|
32
33
|
/** Main address line, usually street and number as free text. */
|
|
33
34
|
addressLine?: string | null;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
interface StreetAddress {
|
|
36
37
|
/** Street number. */
|
|
37
38
|
number?: string;
|
|
38
39
|
/** Street name. */
|
|
39
40
|
name?: string;
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
interface AddressLocation {
|
|
42
43
|
/** Address latitude. */
|
|
43
44
|
latitude?: number | null;
|
|
44
45
|
/** Address longitude. */
|
|
45
46
|
longitude?: number | null;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
interface Subdivision {
|
|
48
49
|
/** Short subdivision code. */
|
|
49
50
|
code?: string;
|
|
50
51
|
/** Subdivision full name. */
|
|
51
52
|
name?: string;
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
declare enum SubdivisionType {
|
|
54
55
|
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
55
56
|
/** State */
|
|
56
57
|
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
@@ -65,7 +66,9 @@ export declare enum SubdivisionType {
|
|
|
65
66
|
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
66
67
|
COUNTRY = "COUNTRY"
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
/** @enumType */
|
|
70
|
+
type SubdivisionTypeWithLiterals = SubdivisionType | 'UNKNOWN_SUBDIVISION_TYPE' | 'ADMINISTRATIVE_AREA_LEVEL_1' | 'ADMINISTRATIVE_AREA_LEVEL_2' | 'ADMINISTRATIVE_AREA_LEVEL_3' | 'ADMINISTRATIVE_AREA_LEVEL_4' | 'ADMINISTRATIVE_AREA_LEVEL_5' | 'COUNTRY';
|
|
71
|
+
declare enum Proximity {
|
|
69
72
|
UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
|
|
70
73
|
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
71
74
|
PINPOINT = "PINPOINT",
|
|
@@ -74,8 +77,10 @@ export declare enum Proximity {
|
|
|
74
77
|
/** indicates that the returned result is around an area */
|
|
75
78
|
GENERAL_AREA = "GENERAL_AREA"
|
|
76
79
|
}
|
|
80
|
+
/** @enumType */
|
|
81
|
+
type ProximityWithLiterals = Proximity | 'UNKNOWN_PROXIMITY' | 'PINPOINT' | 'APPROXIMATE' | 'GENERAL_AREA';
|
|
77
82
|
/** User must provide query or filter by parameters */
|
|
78
|
-
|
|
83
|
+
interface SearchRequest {
|
|
79
84
|
/** Free text */
|
|
80
85
|
query?: string | null;
|
|
81
86
|
/**
|
|
@@ -88,27 +93,29 @@ export interface SearchRequest {
|
|
|
88
93
|
/** Country codes filter the user can add in order to get more accurate results */
|
|
89
94
|
countryCodes?: string[];
|
|
90
95
|
}
|
|
91
|
-
|
|
96
|
+
interface FilterBy {
|
|
92
97
|
/** One of the filter types enum */
|
|
93
|
-
filterType?:
|
|
98
|
+
filterType?: FilterTypeWithLiterals;
|
|
94
99
|
/** Free text like "us" */
|
|
95
100
|
filterValue?: string;
|
|
96
101
|
}
|
|
97
|
-
|
|
102
|
+
declare enum FilterType {
|
|
98
103
|
/** Filter by zip code */
|
|
99
104
|
zip_code = "zip_code",
|
|
100
105
|
/** Filter by 2-letters or 3-letters country code */
|
|
101
106
|
country_code = "country_code"
|
|
102
107
|
}
|
|
103
|
-
|
|
108
|
+
/** @enumType */
|
|
109
|
+
type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';
|
|
110
|
+
interface SearchResponse {
|
|
104
111
|
/** List of 'Address' objects */
|
|
105
112
|
searchResults?: SearchResult[];
|
|
106
113
|
}
|
|
107
|
-
|
|
114
|
+
interface ReverseGeocodingRequest {
|
|
108
115
|
/** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */
|
|
109
116
|
addressLocation?: AddressLocation;
|
|
110
117
|
}
|
|
111
|
-
|
|
118
|
+
interface ReverseGeocodingResponse {
|
|
112
119
|
searchResults?: SearchResult[];
|
|
113
120
|
}
|
|
114
121
|
type SearchResultNonNullablePaths = `address.streetAddress.number` | `address.streetAddress.name` | `proximity`;
|
|
@@ -117,30 +124,14 @@ type SearchResultNonNullablePaths = `address.streetAddress.number` | `address.st
|
|
|
117
124
|
* @public
|
|
118
125
|
* @documentationMaturity preview
|
|
119
126
|
* @permissionId WIX_ATLAS.SEARCH
|
|
120
|
-
* @permissionScope Manage Stores
|
|
121
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
122
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
123
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
124
|
-
* @permissionScope Manage Events
|
|
125
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
126
|
-
* @permissionScope Manage Challenges
|
|
127
|
-
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
128
|
-
* @permissionScope Manage Portfolio
|
|
129
|
-
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
130
|
-
* @permissionScope Access Verticals by Automations
|
|
131
|
-
* @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
|
|
132
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
133
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
134
|
-
* @permissionScope Set Up Automations
|
|
135
|
-
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
136
127
|
* @applicableIdentity APP
|
|
137
128
|
* @applicableIdentity VISITOR
|
|
138
129
|
* @fqn com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search
|
|
139
130
|
*/
|
|
140
|
-
|
|
131
|
+
declare function search(options?: SearchOptions): Promise<NonNullablePaths<SearchResponse, {
|
|
141
132
|
[P in SearchResultNonNullablePaths]: `searchResults.${number}.${P}`;
|
|
142
133
|
}[SearchResultNonNullablePaths]>>;
|
|
143
|
-
|
|
134
|
+
interface SearchOptions {
|
|
144
135
|
/** Free text */
|
|
145
136
|
query?: string | null;
|
|
146
137
|
/**
|
|
@@ -153,4 +144,5 @@ export interface SearchOptions {
|
|
|
153
144
|
/** Country codes filter the user can add in order to get more accurate results */
|
|
154
145
|
countryCodes?: string[];
|
|
155
146
|
}
|
|
156
|
-
|
|
147
|
+
|
|
148
|
+
export { type Address, type AddressLocation, type AddressStreetOneOf, type FilterBy, FilterType, type FilterTypeWithLiterals, Proximity, type ProximityWithLiterals, type ReverseGeocodingRequest, type ReverseGeocodingResponse, type SearchOptions, type SearchRequest, type SearchResponse, type SearchResult, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, search };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// src/atlas-v2-search-result-location.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/atlas-v2-search-result-location.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
11
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
12
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
13
|
+
function resolveComWixpressViAtlasServiceV2LocationServiceV2Url(opts) {
|
|
14
|
+
const domainToMappings = {
|
|
15
|
+
"api._api_base_domain_": [
|
|
16
|
+
{
|
|
17
|
+
srcPath: "/wix-atlas-service-web",
|
|
18
|
+
destPath: ""
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"bo._base_domain_": [
|
|
22
|
+
{
|
|
23
|
+
srcPath: "/wix-atlas-service-web",
|
|
24
|
+
destPath: ""
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"wixbo.ai": [
|
|
28
|
+
{
|
|
29
|
+
srcPath: "/wix-atlas-service-web",
|
|
30
|
+
destPath: ""
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"wix-bo.com": [
|
|
34
|
+
{
|
|
35
|
+
srcPath: "/wix-atlas-service-web",
|
|
36
|
+
destPath: ""
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
_: [
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
42
|
+
destPath: ""
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
46
|
+
destPath: ""
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"www._base_domain_": [
|
|
50
|
+
{
|
|
51
|
+
srcPath: "/wix-atlas-service-web",
|
|
52
|
+
destPath: ""
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
56
|
+
destPath: ""
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
60
|
+
destPath: ""
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"manage._base_domain_": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/wix-atlas-service-web",
|
|
66
|
+
destPath: ""
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"editor._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
|
+
"blocks._base_domain_": [
|
|
80
|
+
{
|
|
81
|
+
srcPath: "/wix-atlas-service-web",
|
|
82
|
+
destPath: ""
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
86
|
+
destPath: ""
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"create.editorx": [
|
|
90
|
+
{
|
|
91
|
+
srcPath: "/wix-atlas-service-web",
|
|
92
|
+
destPath: ""
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
96
|
+
destPath: ""
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"editor.wixapps.net": [
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
102
|
+
destPath: ""
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"*.wixforms.com": [
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
108
|
+
destPath: ""
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
};
|
|
112
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
113
|
+
}
|
|
114
|
+
var PACKAGE_NAME = "@wix/auto_sdk_atlas_location";
|
|
115
|
+
function search(payload) {
|
|
116
|
+
function __search({ host }) {
|
|
117
|
+
const metadata = {
|
|
118
|
+
entityFqdn: "wix.atlas.v2.search_result",
|
|
119
|
+
method: "GET",
|
|
120
|
+
methodFqn: "com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search",
|
|
121
|
+
packageName: PACKAGE_NAME,
|
|
122
|
+
url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({
|
|
123
|
+
protoPath: "/v2/search",
|
|
124
|
+
data: payload,
|
|
125
|
+
host
|
|
126
|
+
}),
|
|
127
|
+
params: toURLSearchParams(payload),
|
|
128
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
129
|
+
{
|
|
130
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
131
|
+
paths: [
|
|
132
|
+
{ path: "searchResults.address.geocode.latitude" },
|
|
133
|
+
{ path: "searchResults.address.geocode.longitude" }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]),
|
|
137
|
+
fallback: [
|
|
138
|
+
{
|
|
139
|
+
method: "GET",
|
|
140
|
+
url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({
|
|
141
|
+
protoPath: "/v2/search",
|
|
142
|
+
data: payload,
|
|
143
|
+
host
|
|
144
|
+
}),
|
|
145
|
+
params: toURLSearchParams(payload)
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
return metadata;
|
|
150
|
+
}
|
|
151
|
+
return __search;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/atlas-v2-search-result-location.universal.ts
|
|
155
|
+
import { transformRESTAddressToSDKAddress } from "@wix/sdk-runtime/transformations/address";
|
|
156
|
+
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
157
|
+
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
158
|
+
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
159
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
160
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
161
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
162
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
163
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
164
|
+
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
165
|
+
return SubdivisionType2;
|
|
166
|
+
})(SubdivisionType || {});
|
|
167
|
+
var Proximity = /* @__PURE__ */ ((Proximity2) => {
|
|
168
|
+
Proximity2["UNKNOWN_PROXIMITY"] = "UNKNOWN_PROXIMITY";
|
|
169
|
+
Proximity2["PINPOINT"] = "PINPOINT";
|
|
170
|
+
Proximity2["APPROXIMATE"] = "APPROXIMATE";
|
|
171
|
+
Proximity2["GENERAL_AREA"] = "GENERAL_AREA";
|
|
172
|
+
return Proximity2;
|
|
173
|
+
})(Proximity || {});
|
|
174
|
+
var FilterType = /* @__PURE__ */ ((FilterType2) => {
|
|
175
|
+
FilterType2["zip_code"] = "zip_code";
|
|
176
|
+
FilterType2["country_code"] = "country_code";
|
|
177
|
+
return FilterType2;
|
|
178
|
+
})(FilterType || {});
|
|
179
|
+
async function search2(options) {
|
|
180
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
181
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
182
|
+
query: options?.query,
|
|
183
|
+
filterBy: options?.filterBy,
|
|
184
|
+
zipCode: options?.zipCode,
|
|
185
|
+
countryCodes: options?.countryCodes
|
|
186
|
+
});
|
|
187
|
+
const reqOpts = search(payload);
|
|
188
|
+
sideEffects?.onSiteCall?.();
|
|
189
|
+
try {
|
|
190
|
+
const result = await httpClient.request(reqOpts);
|
|
191
|
+
sideEffects?.onSuccess?.(result);
|
|
192
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
193
|
+
transformPaths2(result.data, [
|
|
194
|
+
{
|
|
195
|
+
transformFn: transformRESTAddressToSDKAddress,
|
|
196
|
+
paths: [{ path: "searchResults.address" }]
|
|
197
|
+
}
|
|
198
|
+
])
|
|
199
|
+
);
|
|
200
|
+
} catch (err) {
|
|
201
|
+
const transformedError = sdkTransformError(
|
|
202
|
+
err,
|
|
203
|
+
{
|
|
204
|
+
spreadPathsToArguments: {},
|
|
205
|
+
explicitPathsToArguments: {
|
|
206
|
+
query: "$[0].query",
|
|
207
|
+
filterBy: "$[0].filterBy",
|
|
208
|
+
zipCode: "$[0].zipCode",
|
|
209
|
+
countryCodes: "$[0].countryCodes"
|
|
210
|
+
},
|
|
211
|
+
singleArgumentUnchanged: false
|
|
212
|
+
},
|
|
213
|
+
["options"]
|
|
214
|
+
);
|
|
215
|
+
sideEffects?.onError?.(err);
|
|
216
|
+
throw transformedError;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
export {
|
|
220
|
+
FilterType,
|
|
221
|
+
Proximity,
|
|
222
|
+
SubdivisionType,
|
|
223
|
+
search2 as search
|
|
224
|
+
};
|
|
225
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atlas-v2-search-result-location.universal.ts","../../../src/atlas-v2-search-result-location.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2SearchResult from './atlas-v2-search-result-location.http.js';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface SearchResult {\n /** The Address object */\n address?: Address;\n /** stores additional data about the proximity to the specified location */\n proximity?: ProximityWithLiterals;\n}\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine1?: string | null;\n /**\n * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */\n subdivision?: string | null;\n /** City name. */\n city?: string | null;\n /** Zip/postal code. */\n postalCode?: string | null;\n /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */\n addressLine2?: string | null;\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n /** Street number. */\n number?: string;\n /** Street name. */\n name?: string;\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Subdivision {\n /** Short subdivision code. */\n code?: string;\n /** Subdivision full name. */\n name?: string;\n}\n\nexport enum SubdivisionType {\n UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n /** State */\n ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n /** County */\n ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n /** City/town */\n ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n /** Neighborhood/quarter */\n ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n /** Street/block */\n ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n | SubdivisionType\n | 'UNKNOWN_SUBDIVISION_TYPE'\n | 'ADMINISTRATIVE_AREA_LEVEL_1'\n | 'ADMINISTRATIVE_AREA_LEVEL_2'\n | 'ADMINISTRATIVE_AREA_LEVEL_3'\n | 'ADMINISTRATIVE_AREA_LEVEL_4'\n | 'ADMINISTRATIVE_AREA_LEVEL_5'\n | 'COUNTRY';\n\nexport enum Proximity {\n UNKNOWN_PROXIMITY = 'UNKNOWN_PROXIMITY',\n /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */\n PINPOINT = 'PINPOINT',\n /** indicates that the returned result is the geometric center of a result */\n APPROXIMATE = 'APPROXIMATE',\n /** indicates that the returned result is around an area */\n GENERAL_AREA = 'GENERAL_AREA',\n}\n\n/** @enumType */\nexport type ProximityWithLiterals =\n | Proximity\n | 'UNKNOWN_PROXIMITY'\n | 'PINPOINT'\n | 'APPROXIMATE'\n | 'GENERAL_AREA';\n\n/** User must provide query or filter by parameters */\nexport interface SearchRequest {\n /** Free text */\n query?: string | null;\n /**\n * Deprecate! - Please use 'zipCode' and 'countryCodes' fields\n * @deprecated\n */\n filterBy?: FilterBy[];\n /** Zip code filter the user can add in order to get more accurate results */\n zipCode?: string | null;\n /** Country codes filter the user can add in order to get more accurate results */\n countryCodes?: string[];\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface SearchResponse {\n /** List of 'Address' objects */\n searchResults?: SearchResult[];\n}\n\nexport interface ReverseGeocodingRequest {\n /** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */\n addressLocation?: AddressLocation;\n}\n\nexport interface ReverseGeocodingResponse {\n searchResults?: SearchResult[];\n}\n\ntype SearchResultNonNullablePaths =\n | `address.streetAddress.number`\n | `address.streetAddress.name`\n | `proximity`;\n\n/**\n * A Search request takes a free text as an input and returns a list of 'Address' objects.\n * @public\n * @documentationMaturity preview\n * @permissionId WIX_ATLAS.SEARCH\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search\n */\nexport async function search(\n options?: SearchOptions\n): Promise<\n NonNullablePaths<\n SearchResponse,\n {\n [P in SearchResultNonNullablePaths]: `searchResults.${number}.${P}`;\n }[SearchResultNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: options?.query,\n filterBy: options?.filterBy,\n zipCode: options?.zipCode,\n countryCodes: options?.countryCodes,\n });\n\n const reqOpts = ambassadorWixAtlasV2SearchResult.search(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [{ path: 'searchResults.address' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n query: '$[0].query',\n filterBy: '$[0].filterBy',\n zipCode: '$[0].zipCode',\n countryCodes: '$[0].countryCodes',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchOptions {\n /** Free text */\n query?: string | null;\n /**\n * Deprecate! - Please use 'zipCode' and 'countryCodes' fields\n * @deprecated\n */\n filterBy?: FilterBy[];\n /** Zip code filter the user can add in order to get more accurate results */\n zipCode?: string | null;\n /** Country codes filter the user can add in order to get more accurate results */\n countryCodes?: string[];\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2LocationServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_location';\n\n/** A Search request takes a free text as an input and returns a list of 'Address' objects. */\nexport function search(payload: object): RequestOptionsFactory<any> {\n function __search({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.atlas.v2.search_result',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({\n protoPath: '/v2/search',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'searchResults.address.geocode.latitude' },\n { path: 'searchResults.address.geocode.longitude' },\n ],\n },\n ]),\n fallback: [\n {\n method: 'GET' as any,\n url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({\n protoPath: '/v2/search',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __search;\n}\n"],"mappings":"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","names":["payload","transformPaths","SubdivisionType","Proximity","FilterType","search"]}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { SearchRequest as SearchRequest$1, SearchResponse as SearchResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
interface SearchResult {
|
|
2
5
|
/** The Address object */
|
|
3
6
|
address?: Address;
|
|
4
7
|
/** stores additional data about the proximity to the specified location */
|
|
5
|
-
proximity?:
|
|
8
|
+
proximity?: ProximityWithLiterals;
|
|
6
9
|
}
|
|
7
10
|
/** Physical address */
|
|
8
|
-
|
|
11
|
+
interface Address extends AddressStreetOneOf {
|
|
9
12
|
/** Street name and number. */
|
|
10
13
|
streetAddress?: StreetAddress;
|
|
11
14
|
/** Main address line, usually street and number as free text. */
|
|
@@ -25,46 +28,19 @@ export interface Address extends AddressStreetOneOf {
|
|
|
25
28
|
addressLine2?: string | null;
|
|
26
29
|
}
|
|
27
30
|
/** @oneof */
|
|
28
|
-
|
|
31
|
+
interface AddressStreetOneOf {
|
|
29
32
|
/** Street name and number. */
|
|
30
33
|
streetAddress?: StreetAddress;
|
|
31
34
|
/** Main address line, usually street and number as free text. */
|
|
32
35
|
addressLine?: string | null;
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
interface StreetAddress {
|
|
35
38
|
/** Street number. */
|
|
36
39
|
number?: string;
|
|
37
40
|
/** Street name. */
|
|
38
41
|
name?: string;
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
/** Address latitude. */
|
|
42
|
-
latitude?: number | null;
|
|
43
|
-
/** Address longitude. */
|
|
44
|
-
longitude?: number | null;
|
|
45
|
-
}
|
|
46
|
-
export interface Subdivision {
|
|
47
|
-
/** Short subdivision code. */
|
|
48
|
-
code?: string;
|
|
49
|
-
/** Subdivision full name. */
|
|
50
|
-
name?: string;
|
|
51
|
-
}
|
|
52
|
-
export declare enum SubdivisionType {
|
|
53
|
-
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
54
|
-
/** State */
|
|
55
|
-
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
56
|
-
/** County */
|
|
57
|
-
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
58
|
-
/** City/town */
|
|
59
|
-
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
60
|
-
/** Neighborhood/quarter */
|
|
61
|
-
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
62
|
-
/** Street/block */
|
|
63
|
-
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
64
|
-
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
65
|
-
COUNTRY = "COUNTRY"
|
|
66
|
-
}
|
|
67
|
-
export declare enum Proximity {
|
|
43
|
+
declare enum Proximity {
|
|
68
44
|
UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
|
|
69
45
|
/** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
|
|
70
46
|
PINPOINT = "PINPOINT",
|
|
@@ -73,8 +49,10 @@ export declare enum Proximity {
|
|
|
73
49
|
/** indicates that the returned result is around an area */
|
|
74
50
|
GENERAL_AREA = "GENERAL_AREA"
|
|
75
51
|
}
|
|
52
|
+
/** @enumType */
|
|
53
|
+
type ProximityWithLiterals = Proximity | 'UNKNOWN_PROXIMITY' | 'PINPOINT' | 'APPROXIMATE' | 'GENERAL_AREA';
|
|
76
54
|
/** User must provide query or filter by parameters */
|
|
77
|
-
|
|
55
|
+
interface SearchRequest {
|
|
78
56
|
/** Free text */
|
|
79
57
|
query?: string | null;
|
|
80
58
|
/**
|
|
@@ -87,26 +65,35 @@ export interface SearchRequest {
|
|
|
87
65
|
/** Country codes filter the user can add in order to get more accurate results */
|
|
88
66
|
countryCodes?: string[];
|
|
89
67
|
}
|
|
90
|
-
|
|
68
|
+
interface FilterBy {
|
|
91
69
|
/** One of the filter types enum */
|
|
92
|
-
filterType?:
|
|
70
|
+
filterType?: FilterTypeWithLiterals;
|
|
93
71
|
/** Free text like "us" */
|
|
94
72
|
filterValue?: string;
|
|
95
73
|
}
|
|
96
|
-
|
|
74
|
+
declare enum FilterType {
|
|
97
75
|
/** Filter by zip code */
|
|
98
76
|
zip_code = "zip_code",
|
|
99
77
|
/** Filter by 2-letters or 3-letters country code */
|
|
100
78
|
country_code = "country_code"
|
|
101
79
|
}
|
|
102
|
-
|
|
80
|
+
/** @enumType */
|
|
81
|
+
type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';
|
|
82
|
+
interface SearchResponse {
|
|
103
83
|
/** List of 'Address' objects */
|
|
104
84
|
searchResults?: SearchResult[];
|
|
105
85
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
86
|
+
|
|
87
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
88
|
+
getUrl: (context: any) => string;
|
|
89
|
+
httpMethod: K;
|
|
90
|
+
path: string;
|
|
91
|
+
pathParams: M;
|
|
92
|
+
__requestType: T;
|
|
93
|
+
__originalRequestType: S;
|
|
94
|
+
__responseType: Q;
|
|
95
|
+
__originalResponseType: R;
|
|
96
|
+
};
|
|
97
|
+
declare function search(): __PublicMethodMetaInfo<'GET', {}, SearchRequest$1, SearchRequest, SearchResponse$1, SearchResponse>;
|
|
98
|
+
|
|
99
|
+
export { type __PublicMethodMetaInfo, search };
|