@wix/auto_sdk_atlas_places 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.
Files changed (123) hide show
  1. package/build/cjs/index.d.ts +18 -1
  2. package/build/cjs/index.js +232 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +106 -1
  5. package/build/cjs/index.typings.js +218 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +69 -1
  8. package/build/cjs/meta.js +182 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +18 -0
  11. package/build/es/index.mjs +210 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/atlas-v2-place-places.universal.d.ts → es/index.typings.d.mts} +16 -28
  14. package/build/es/index.typings.mjs +196 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/{src/atlas-v2-place-places.types.d.ts → meta.d.mts} +23 -33
  17. package/build/es/meta.mjs +158 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +18 -1
  20. package/build/internal/cjs/index.js +232 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +106 -1
  23. package/build/internal/cjs/index.typings.js +218 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +69 -1
  26. package/build/internal/cjs/meta.js +182 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +18 -0
  29. package/build/internal/es/index.mjs +210 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/atlas-v2-place-places.universal.d.ts → index.typings.d.mts} +16 -28
  32. package/build/internal/es/index.typings.mjs +196 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/{cjs/src/atlas-v2-place-places.types.d.ts → es/meta.d.mts} +23 -33
  35. package/build/internal/es/meta.mjs +158 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +11 -10
  38. package/build/cjs/src/atlas-v2-place-places.context.d.ts +0 -5
  39. package/build/cjs/src/atlas-v2-place-places.context.js +0 -9
  40. package/build/cjs/src/atlas-v2-place-places.context.js.map +0 -1
  41. package/build/cjs/src/atlas-v2-place-places.http.d.ts +0 -3
  42. package/build/cjs/src/atlas-v2-place-places.http.js +0 -133
  43. package/build/cjs/src/atlas-v2-place-places.http.js.map +0 -1
  44. package/build/cjs/src/atlas-v2-place-places.meta.d.ts +0 -13
  45. package/build/cjs/src/atlas-v2-place-places.meta.js +0 -47
  46. package/build/cjs/src/atlas-v2-place-places.meta.js.map +0 -1
  47. package/build/cjs/src/atlas-v2-place-places.public.d.ts +0 -13
  48. package/build/cjs/src/atlas-v2-place-places.public.js +0 -14
  49. package/build/cjs/src/atlas-v2-place-places.public.js.map +0 -1
  50. package/build/cjs/src/atlas-v2-place-places.types.d.ts +0 -79
  51. package/build/cjs/src/atlas-v2-place-places.types.js +0 -20
  52. package/build/cjs/src/atlas-v2-place-places.types.js.map +0 -1
  53. package/build/cjs/src/atlas-v2-place-places.universal.d.ts +0 -118
  54. package/build/cjs/src/atlas-v2-place-places.universal.js +0 -107
  55. package/build/cjs/src/atlas-v2-place-places.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/atlas-v2-place-places.context.d.ts +0 -5
  66. package/build/es/src/atlas-v2-place-places.context.js +0 -5
  67. package/build/es/src/atlas-v2-place-places.context.js.map +0 -1
  68. package/build/es/src/atlas-v2-place-places.http.d.ts +0 -3
  69. package/build/es/src/atlas-v2-place-places.http.js +0 -129
  70. package/build/es/src/atlas-v2-place-places.http.js.map +0 -1
  71. package/build/es/src/atlas-v2-place-places.meta.d.ts +0 -13
  72. package/build/es/src/atlas-v2-place-places.meta.js +0 -20
  73. package/build/es/src/atlas-v2-place-places.meta.js.map +0 -1
  74. package/build/es/src/atlas-v2-place-places.public.d.ts +0 -13
  75. package/build/es/src/atlas-v2-place-places.public.js +0 -9
  76. package/build/es/src/atlas-v2-place-places.public.js.map +0 -1
  77. package/build/es/src/atlas-v2-place-places.types.js +0 -17
  78. package/build/es/src/atlas-v2-place-places.types.js.map +0 -1
  79. package/build/es/src/atlas-v2-place-places.universal.d.ts +0 -118
  80. package/build/es/src/atlas-v2-place-places.universal.js +0 -80
  81. package/build/es/src/atlas-v2-place-places.universal.js.map +0 -1
  82. package/build/internal/cjs/src/atlas-v2-place-places.context.d.ts +0 -5
  83. package/build/internal/cjs/src/atlas-v2-place-places.context.js +0 -9
  84. package/build/internal/cjs/src/atlas-v2-place-places.context.js.map +0 -1
  85. package/build/internal/cjs/src/atlas-v2-place-places.http.d.ts +0 -3
  86. package/build/internal/cjs/src/atlas-v2-place-places.http.js +0 -133
  87. package/build/internal/cjs/src/atlas-v2-place-places.http.js.map +0 -1
  88. package/build/internal/cjs/src/atlas-v2-place-places.meta.d.ts +0 -13
  89. package/build/internal/cjs/src/atlas-v2-place-places.meta.js +0 -47
  90. package/build/internal/cjs/src/atlas-v2-place-places.meta.js.map +0 -1
  91. package/build/internal/cjs/src/atlas-v2-place-places.public.d.ts +0 -13
  92. package/build/internal/cjs/src/atlas-v2-place-places.public.js +0 -14
  93. package/build/internal/cjs/src/atlas-v2-place-places.public.js.map +0 -1
  94. package/build/internal/cjs/src/atlas-v2-place-places.types.js +0 -20
  95. package/build/internal/cjs/src/atlas-v2-place-places.types.js.map +0 -1
  96. package/build/internal/cjs/src/atlas-v2-place-places.universal.js +0 -107
  97. package/build/internal/cjs/src/atlas-v2-place-places.universal.js.map +0 -1
  98. package/build/internal/es/index.d.ts +0 -1
  99. package/build/internal/es/index.js +0 -2
  100. package/build/internal/es/index.js.map +0 -1
  101. package/build/internal/es/index.typings.d.ts +0 -1
  102. package/build/internal/es/index.typings.js +0 -2
  103. package/build/internal/es/index.typings.js.map +0 -1
  104. package/build/internal/es/meta.d.ts +0 -1
  105. package/build/internal/es/meta.js +0 -2
  106. package/build/internal/es/meta.js.map +0 -1
  107. package/build/internal/es/src/atlas-v2-place-places.context.d.ts +0 -5
  108. package/build/internal/es/src/atlas-v2-place-places.context.js +0 -5
  109. package/build/internal/es/src/atlas-v2-place-places.context.js.map +0 -1
  110. package/build/internal/es/src/atlas-v2-place-places.http.d.ts +0 -3
  111. package/build/internal/es/src/atlas-v2-place-places.http.js +0 -129
  112. package/build/internal/es/src/atlas-v2-place-places.http.js.map +0 -1
  113. package/build/internal/es/src/atlas-v2-place-places.meta.d.ts +0 -13
  114. package/build/internal/es/src/atlas-v2-place-places.meta.js +0 -20
  115. package/build/internal/es/src/atlas-v2-place-places.meta.js.map +0 -1
  116. package/build/internal/es/src/atlas-v2-place-places.public.d.ts +0 -13
  117. package/build/internal/es/src/atlas-v2-place-places.public.js +0 -9
  118. package/build/internal/es/src/atlas-v2-place-places.public.js.map +0 -1
  119. package/build/internal/es/src/atlas-v2-place-places.types.d.ts +0 -79
  120. package/build/internal/es/src/atlas-v2-place-places.types.js +0 -17
  121. package/build/internal/es/src/atlas-v2-place-places.types.js.map +0 -1
  122. package/build/internal/es/src/atlas-v2-place-places.universal.js +0 -80
  123. package/build/internal/es/src/atlas-v2-place-places.universal.js.map +0 -1
@@ -1 +1,18 @@
1
- export * from './src/atlas-v2-place-places.context.js';
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { GetPlaceOptions, GetPlaceResponse } from './index.typings.js';
3
+ export { Address, AddressLocation, AddressStreetOneOf, GetPlaceRequest, Place, StreetAddress, Subdivision, SubdivisionType } from './index.typings.js';
4
+
5
+ type PlaceNonNullablePaths = `placeId` | `address.streetAddress.number` | `address.streetAddress.name` | `types`;
6
+ declare function getPlace$1(httpClient: HttpClient): GetPlaceSignature;
7
+ interface GetPlaceSignature {
8
+ /**
9
+ * 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.
10
+ */
11
+ (searchId: string, options?: GetPlaceOptions): Promise<NonNullablePaths<GetPlaceResponse, {
12
+ [P in PlaceNonNullablePaths]: `place.${P}`;
13
+ }[PlaceNonNullablePaths]>>;
14
+ }
15
+
16
+ declare const getPlace: MaybeContext<BuildRESTFunction<typeof getPlace$1> & typeof getPlace$1>;
17
+
18
+ export { GetPlaceOptions, GetPlaceResponse, getPlace };
@@ -1,18 +1,235 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/atlas-v2-place-places.context.js"), exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ SubdivisionType: () => SubdivisionType,
24
+ getPlace: () => getPlace4
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+
28
+ // src/atlas-v2-place-places.universal.ts
29
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
30
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
31
+
32
+ // src/atlas-v2-place-places.http.ts
33
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
34
+ var import_float = require("@wix/sdk-runtime/transformations/float");
35
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
36
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
37
+ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
38
+ const domainToMappings = {
39
+ "api._api_base_domain_": [
40
+ {
41
+ srcPath: "/wix-atlas-service-web",
42
+ destPath: ""
43
+ }
44
+ ],
45
+ "bo._base_domain_": [
46
+ {
47
+ srcPath: "/wix-atlas-service-web",
48
+ destPath: ""
49
+ }
50
+ ],
51
+ "wixbo.ai": [
52
+ {
53
+ srcPath: "/wix-atlas-service-web",
54
+ destPath: ""
55
+ }
56
+ ],
57
+ "wix-bo.com": [
58
+ {
59
+ srcPath: "/wix-atlas-service-web",
60
+ destPath: ""
61
+ }
62
+ ],
63
+ _: [
64
+ {
65
+ srcPath: "/api/wix-atlas-service-web",
66
+ destPath: ""
67
+ },
68
+ {
69
+ srcPath: "/_api/wix-atlas-service-web",
70
+ destPath: ""
71
+ }
72
+ ],
73
+ "www._base_domain_": [
74
+ {
75
+ srcPath: "/wix-atlas-service-web",
76
+ destPath: ""
77
+ },
78
+ {
79
+ srcPath: "/_api/wix-atlas-service-web",
80
+ destPath: ""
81
+ },
82
+ {
83
+ srcPath: "/api/wix-atlas-service-web",
84
+ destPath: ""
85
+ }
86
+ ],
87
+ "manage._base_domain_": [
88
+ {
89
+ srcPath: "/wix-atlas-service-web",
90
+ destPath: ""
91
+ }
92
+ ],
93
+ "editor._base_domain_": [
94
+ {
95
+ srcPath: "/wix-atlas-service-web",
96
+ destPath: ""
97
+ },
98
+ {
99
+ srcPath: "/api/wix-atlas-service-web",
100
+ destPath: ""
101
+ }
102
+ ],
103
+ "blocks._base_domain_": [
104
+ {
105
+ srcPath: "/wix-atlas-service-web",
106
+ destPath: ""
107
+ },
108
+ {
109
+ srcPath: "/api/wix-atlas-service-web",
110
+ destPath: ""
111
+ }
112
+ ],
113
+ "create.editorx": [
114
+ {
115
+ srcPath: "/wix-atlas-service-web",
116
+ destPath: ""
117
+ },
118
+ {
119
+ srcPath: "/api/wix-atlas-service-web",
120
+ destPath: ""
121
+ }
122
+ ],
123
+ "editor.wixapps.net": [
124
+ {
125
+ srcPath: "/api/wix-atlas-service-web",
126
+ destPath: ""
127
+ }
128
+ ],
129
+ "*.wixforms.com": [
130
+ {
131
+ srcPath: "/_api/wix-atlas-service-web",
132
+ destPath: ""
133
+ }
134
+ ]
135
+ };
136
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
137
+ }
138
+ var PACKAGE_NAME = "@wix/auto_sdk_atlas_places";
139
+ function getPlace(payload) {
140
+ function __getPlace({ host }) {
141
+ const metadata = {
142
+ entityFqdn: "wix.atlas.v2.place",
143
+ method: "GET",
144
+ methodFqn: "com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace",
145
+ packageName: PACKAGE_NAME,
146
+ url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
147
+ protoPath: "/v2/place",
148
+ data: payload,
149
+ host
150
+ }),
151
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
152
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
153
+ {
154
+ transformFn: import_float.transformRESTFloatToSDKFloat,
155
+ paths: [
156
+ { path: "place.address.geocode.latitude" },
157
+ { path: "place.address.geocode.longitude" }
158
+ ]
159
+ }
160
+ ])
161
+ };
162
+ return metadata;
163
+ }
164
+ return __getPlace;
165
+ }
166
+
167
+ // src/atlas-v2-place-places.universal.ts
168
+ var import_address = require("@wix/sdk-runtime/transformations/address");
169
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
170
+ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
171
+ SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
172
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
173
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
174
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
175
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
176
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
177
+ SubdivisionType2["COUNTRY"] = "COUNTRY";
178
+ return SubdivisionType2;
179
+ })(SubdivisionType || {});
180
+ async function getPlace2(searchId, options) {
181
+ const { httpClient, sideEffects } = arguments[2];
182
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
183
+ searchId,
184
+ sessionToken: options?.sessionToken
185
+ });
186
+ const reqOpts = getPlace(payload);
187
+ sideEffects?.onSiteCall?.();
188
+ try {
189
+ const result = await httpClient.request(reqOpts);
190
+ sideEffects?.onSuccess?.(result);
191
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
192
+ (0, import_transform_paths2.transformPaths)(result.data, [
193
+ {
194
+ transformFn: import_address.transformRESTAddressToSDKAddress,
195
+ paths: [{ path: "place.address" }]
196
+ }
197
+ ])
198
+ );
199
+ } catch (err) {
200
+ const transformedError = (0, import_transform_error.transformError)(
201
+ err,
202
+ {
203
+ spreadPathsToArguments: {},
204
+ explicitPathsToArguments: {
205
+ searchId: "$[0]",
206
+ sessionToken: "$[1].sessionToken"
207
+ },
208
+ singleArgumentUnchanged: false
209
+ },
210
+ ["searchId", "options"]
211
+ );
212
+ sideEffects?.onError?.(err);
213
+ throw transformedError;
214
+ }
215
+ }
216
+
217
+ // src/atlas-v2-place-places.public.ts
218
+ function getPlace3(httpClient) {
219
+ return (searchId, options) => getPlace2(
220
+ searchId,
221
+ options,
222
+ // @ts-ignore
223
+ { httpClient }
224
+ );
225
+ }
226
+
227
+ // src/atlas-v2-place-places.context.ts
228
+ var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
229
+ var getPlace4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPlace3);
230
+ // Annotate the CommonJS export names for ESM import in node:
231
+ 0 && (module.exports = {
232
+ SubdivisionType,
233
+ getPlace
234
+ });
18
235
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yEAAuD"}
1
+ {"version":3,"sources":["../../index.ts","../../src/atlas-v2-place-places.universal.ts","../../src/atlas-v2-place-places.http.ts","../../src/atlas-v2-place-places.public.ts","../../src/atlas-v2-place-places.context.ts"],"sourcesContent":["export * from './src/atlas-v2-place-places.context.js';\n","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 ambassadorWixAtlasV2Place from './atlas-v2-place-places.http.js';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Place {\n /** The given place id */\n placeId?: string;\n /** The Address object */\n address?: Address;\n /** The Place type. For example: airport, library etc... */\n types?: string[];\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 interface GetPlaceRequest {\n searchId: string;\n /**\n * 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.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface GetPlaceResponse {\n place?: Place;\n}\n\ntype PlaceNonNullablePaths =\n | `placeId`\n | `address.streetAddress.number`\n | `address.streetAddress.name`\n | `types`;\n\n/**\n * 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.\n * @public\n * @documentationMaturity preview\n * @requiredField searchId\n * @permissionId WIX_ATLAS.GET_PLACE\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace\n */\nexport async function getPlace(\n searchId: string,\n options?: GetPlaceOptions\n): Promise<\n NonNullablePaths<\n GetPlaceResponse,\n { [P in PlaceNonNullablePaths]: `place.${P}` }[PlaceNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n searchId: searchId,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Place.getPlace(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: 'place.address' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n searchId: '$[0]',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['searchId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetPlaceOptions {\n /**\n * 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.\n * @format GUID\n */\n sessionToken?: string | null;\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 resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(\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_places';\n\n/** 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. */\nexport function getPlace(payload: object): RequestOptionsFactory<any> {\n function __getPlace({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.atlas.v2.place',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({\n protoPath: '/v2/place',\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: 'place.address.geocode.latitude' },\n { path: 'place.address.geocode.longitude' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPlace;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetPlaceOptions,\n GetPlaceResponse,\n getPlace as universalGetPlace,\n} from './atlas-v2-place-places.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PlaceNonNullablePaths =\n | `placeId`\n | `address.streetAddress.number`\n | `address.streetAddress.name`\n | `types`;\n\nexport function getPlace(httpClient: HttpClient): GetPlaceSignature {\n return (searchId: string, options?: GetPlaceOptions) =>\n universalGetPlace(\n searchId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetPlaceSignature {\n /**\n * 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.\n */\n (searchId: string, options?: GetPlaceOptions): Promise<\n NonNullablePaths<\n GetPlaceResponse,\n { [P in PlaceNonNullablePaths]: `place.${P}` }[PlaceNonNullablePaths]\n >\n >;\n}\n\nexport {\n Address,\n AddressLocation,\n AddressStreetOneOf,\n GetPlaceOptions,\n GetPlaceRequest,\n GetPlaceResponse,\n Place,\n StreetAddress,\n Subdivision,\n SubdivisionType,\n} from './atlas-v2-place-places.universal.js';\n","import { getPlace as publicGetPlace } from './atlas-v2-place-places.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getPlace: MaybeContext<\n BuildRESTFunction<typeof publicGetPlace> & typeof publicGetPlace\n> = /*#__PURE__*/ createRESTModule(publicGetPlace);\n\nexport { SubdivisionType } from './atlas-v2-place-places.universal.js';\nexport {\n Place,\n Address,\n AddressStreetOneOf,\n StreetAddress,\n AddressLocation,\n Subdivision,\n GetPlaceRequest,\n GetPlaceResponse,\n GetPlaceOptions,\n} from './atlas-v2-place-places.universal.js';\n"],"mappings":"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","names":["getPlace","import_rest_modules","payload","import_transform_paths","SubdivisionType","getPlace","sdkTransformError","getPlace","import_rest_modules","getPlace"]}
@@ -1 +1,106 @@
1
- export * from './src/atlas-v2-place-places.universal.js';
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface Place {
4
+ /** The given place id */
5
+ placeId?: string;
6
+ /** The Address object */
7
+ address?: Address;
8
+ /** The Place type. For example: airport, library etc... */
9
+ types?: string[];
10
+ }
11
+ /** Physical address */
12
+ interface Address extends AddressStreetOneOf {
13
+ /** Street name and number. */
14
+ streetAddress?: StreetAddress;
15
+ /** Main address line, usually street and number as free text. */
16
+ addressLine1?: string | null;
17
+ /**
18
+ * Country code.
19
+ * @format COUNTRY
20
+ */
21
+ country?: string | null;
22
+ /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
23
+ subdivision?: string | null;
24
+ /** City name. */
25
+ city?: string | null;
26
+ /** Zip/postal code. */
27
+ postalCode?: string | null;
28
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
29
+ addressLine2?: string | null;
30
+ }
31
+ /** @oneof */
32
+ interface AddressStreetOneOf {
33
+ /** Street name and number. */
34
+ streetAddress?: StreetAddress;
35
+ /** Main address line, usually street and number as free text. */
36
+ addressLine?: string | null;
37
+ }
38
+ interface StreetAddress {
39
+ /** Street number. */
40
+ number?: string;
41
+ /** Street name. */
42
+ name?: string;
43
+ }
44
+ interface AddressLocation {
45
+ /** Address latitude. */
46
+ latitude?: number | null;
47
+ /** Address longitude. */
48
+ longitude?: number | null;
49
+ }
50
+ interface Subdivision {
51
+ /** Short subdivision code. */
52
+ code?: string;
53
+ /** Subdivision full name. */
54
+ name?: string;
55
+ }
56
+ declare enum SubdivisionType {
57
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
58
+ /** State */
59
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
60
+ /** County */
61
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
62
+ /** City/town */
63
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
64
+ /** Neighborhood/quarter */
65
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
66
+ /** Street/block */
67
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
68
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
69
+ COUNTRY = "COUNTRY"
70
+ }
71
+ /** @enumType */
72
+ 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';
73
+ interface GetPlaceRequest {
74
+ searchId: string;
75
+ /**
76
+ * 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.
77
+ * @format GUID
78
+ */
79
+ sessionToken?: string | null;
80
+ }
81
+ interface GetPlaceResponse {
82
+ place?: Place;
83
+ }
84
+ type PlaceNonNullablePaths = `placeId` | `address.streetAddress.number` | `address.streetAddress.name` | `types`;
85
+ /**
86
+ * 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.
87
+ * @public
88
+ * @documentationMaturity preview
89
+ * @requiredField searchId
90
+ * @permissionId WIX_ATLAS.GET_PLACE
91
+ * @applicableIdentity APP
92
+ * @applicableIdentity VISITOR
93
+ * @fqn com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace
94
+ */
95
+ declare function getPlace(searchId: string, options?: GetPlaceOptions): Promise<NonNullablePaths<GetPlaceResponse, {
96
+ [P in PlaceNonNullablePaths]: `place.${P}`;
97
+ }[PlaceNonNullablePaths]>>;
98
+ interface GetPlaceOptions {
99
+ /**
100
+ * 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.
101
+ * @format GUID
102
+ */
103
+ sessionToken?: string | null;
104
+ }
105
+
106
+ export { type Address, type AddressLocation, type AddressStreetOneOf, type GetPlaceOptions, type GetPlaceRequest, type GetPlaceResponse, type Place, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, getPlace };
@@ -1,18 +1,221 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/atlas-v2-place-places.universal.js"), exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ SubdivisionType: () => SubdivisionType,
24
+ getPlace: () => getPlace2
25
+ });
26
+ module.exports = __toCommonJS(index_typings_exports);
27
+
28
+ // src/atlas-v2-place-places.universal.ts
29
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
30
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
31
+
32
+ // src/atlas-v2-place-places.http.ts
33
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
34
+ var import_float = require("@wix/sdk-runtime/transformations/float");
35
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
36
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
37
+ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
38
+ const domainToMappings = {
39
+ "api._api_base_domain_": [
40
+ {
41
+ srcPath: "/wix-atlas-service-web",
42
+ destPath: ""
43
+ }
44
+ ],
45
+ "bo._base_domain_": [
46
+ {
47
+ srcPath: "/wix-atlas-service-web",
48
+ destPath: ""
49
+ }
50
+ ],
51
+ "wixbo.ai": [
52
+ {
53
+ srcPath: "/wix-atlas-service-web",
54
+ destPath: ""
55
+ }
56
+ ],
57
+ "wix-bo.com": [
58
+ {
59
+ srcPath: "/wix-atlas-service-web",
60
+ destPath: ""
61
+ }
62
+ ],
63
+ _: [
64
+ {
65
+ srcPath: "/api/wix-atlas-service-web",
66
+ destPath: ""
67
+ },
68
+ {
69
+ srcPath: "/_api/wix-atlas-service-web",
70
+ destPath: ""
71
+ }
72
+ ],
73
+ "www._base_domain_": [
74
+ {
75
+ srcPath: "/wix-atlas-service-web",
76
+ destPath: ""
77
+ },
78
+ {
79
+ srcPath: "/_api/wix-atlas-service-web",
80
+ destPath: ""
81
+ },
82
+ {
83
+ srcPath: "/api/wix-atlas-service-web",
84
+ destPath: ""
85
+ }
86
+ ],
87
+ "manage._base_domain_": [
88
+ {
89
+ srcPath: "/wix-atlas-service-web",
90
+ destPath: ""
91
+ }
92
+ ],
93
+ "editor._base_domain_": [
94
+ {
95
+ srcPath: "/wix-atlas-service-web",
96
+ destPath: ""
97
+ },
98
+ {
99
+ srcPath: "/api/wix-atlas-service-web",
100
+ destPath: ""
101
+ }
102
+ ],
103
+ "blocks._base_domain_": [
104
+ {
105
+ srcPath: "/wix-atlas-service-web",
106
+ destPath: ""
107
+ },
108
+ {
109
+ srcPath: "/api/wix-atlas-service-web",
110
+ destPath: ""
111
+ }
112
+ ],
113
+ "create.editorx": [
114
+ {
115
+ srcPath: "/wix-atlas-service-web",
116
+ destPath: ""
117
+ },
118
+ {
119
+ srcPath: "/api/wix-atlas-service-web",
120
+ destPath: ""
121
+ }
122
+ ],
123
+ "editor.wixapps.net": [
124
+ {
125
+ srcPath: "/api/wix-atlas-service-web",
126
+ destPath: ""
127
+ }
128
+ ],
129
+ "*.wixforms.com": [
130
+ {
131
+ srcPath: "/_api/wix-atlas-service-web",
132
+ destPath: ""
133
+ }
134
+ ]
135
+ };
136
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
137
+ }
138
+ var PACKAGE_NAME = "@wix/auto_sdk_atlas_places";
139
+ function getPlace(payload) {
140
+ function __getPlace({ host }) {
141
+ const metadata = {
142
+ entityFqdn: "wix.atlas.v2.place",
143
+ method: "GET",
144
+ methodFqn: "com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace",
145
+ packageName: PACKAGE_NAME,
146
+ url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
147
+ protoPath: "/v2/place",
148
+ data: payload,
149
+ host
150
+ }),
151
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
152
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
153
+ {
154
+ transformFn: import_float.transformRESTFloatToSDKFloat,
155
+ paths: [
156
+ { path: "place.address.geocode.latitude" },
157
+ { path: "place.address.geocode.longitude" }
158
+ ]
159
+ }
160
+ ])
161
+ };
162
+ return metadata;
163
+ }
164
+ return __getPlace;
165
+ }
166
+
167
+ // src/atlas-v2-place-places.universal.ts
168
+ var import_address = require("@wix/sdk-runtime/transformations/address");
169
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
170
+ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
171
+ SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
172
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
173
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
174
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
175
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
176
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
177
+ SubdivisionType2["COUNTRY"] = "COUNTRY";
178
+ return SubdivisionType2;
179
+ })(SubdivisionType || {});
180
+ async function getPlace2(searchId, options) {
181
+ const { httpClient, sideEffects } = arguments[2];
182
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
183
+ searchId,
184
+ sessionToken: options?.sessionToken
185
+ });
186
+ const reqOpts = getPlace(payload);
187
+ sideEffects?.onSiteCall?.();
188
+ try {
189
+ const result = await httpClient.request(reqOpts);
190
+ sideEffects?.onSuccess?.(result);
191
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
192
+ (0, import_transform_paths2.transformPaths)(result.data, [
193
+ {
194
+ transformFn: import_address.transformRESTAddressToSDKAddress,
195
+ paths: [{ path: "place.address" }]
196
+ }
197
+ ])
198
+ );
199
+ } catch (err) {
200
+ const transformedError = (0, import_transform_error.transformError)(
201
+ err,
202
+ {
203
+ spreadPathsToArguments: {},
204
+ explicitPathsToArguments: {
205
+ searchId: "$[0]",
206
+ sessionToken: "$[1].sessionToken"
207
+ },
208
+ singleArgumentUnchanged: false
209
+ },
210
+ ["searchId", "options"]
211
+ );
212
+ sideEffects?.onError?.(err);
213
+ throw transformedError;
214
+ }
215
+ }
216
+ // Annotate the CommonJS export names for ESM import in node:
217
+ 0 && (module.exports = {
218
+ SubdivisionType,
219
+ getPlace
220
+ });
18
221
  //# sourceMappingURL=index.typings.js.map