@wix/auto_sdk_atlas_location 1.0.1 → 1.0.2

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