@wix/auto_sdk_atlas_places 1.0.2 → 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 (37) hide show
  1. package/build/cjs/index.d.ts +7 -4
  2. package/build/cjs/index.js +6 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{atlas-v2-place-places.universal-8GIzacBO.d.ts → index.typings.d.ts} +19 -1
  5. package/build/cjs/index.typings.js +221 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/cjs/meta.js +6 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +7 -4
  11. package/build/es/index.mjs +6 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/{atlas-v2-place-places.universal-8GIzacBO.d.mts → index.typings.d.mts} +19 -1
  14. package/build/es/index.typings.mjs +196 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +2 -1
  17. package/build/es/meta.mjs +6 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +7 -4
  20. package/build/internal/cjs/index.js +6 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/{atlas-v2-place-places.universal-8GIzacBO.d.ts → index.typings.d.ts} +19 -1
  23. package/build/internal/cjs/index.typings.js +221 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -0
  25. package/build/internal/cjs/meta.d.ts +2 -1
  26. package/build/internal/cjs/meta.js +6 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +7 -4
  29. package/build/internal/es/index.mjs +6 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/{atlas-v2-place-places.universal-8GIzacBO.d.mts → index.typings.d.mts} +19 -1
  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/es/meta.d.mts +2 -1
  35. package/build/internal/es/meta.mjs +6 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +3 -3
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Place {
2
4
  /** The given place id */
3
5
  placeId?: string;
@@ -66,6 +68,8 @@ declare enum SubdivisionType {
66
68
  /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
67
69
  COUNTRY = "COUNTRY"
68
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';
69
73
  interface GetPlaceRequest {
70
74
  searchId: string;
71
75
  /**
@@ -77,6 +81,20 @@ interface GetPlaceRequest {
77
81
  interface GetPlaceResponse {
78
82
  place?: Place;
79
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]>>;
80
98
  interface GetPlaceOptions {
81
99
  /**
82
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.
@@ -85,4 +103,4 @@ interface GetPlaceOptions {
85
103
  sessionToken?: string | null;
86
104
  }
87
105
 
88
- export { type Address as A, type GetPlaceOptions as G, type Place as P, SubdivisionType as S, type GetPlaceResponse as a, type AddressStreetOneOf as b, type StreetAddress as c, type AddressLocation as d, type Subdivision as e, type GetPlaceRequest as f };
106
+ export { type Address, type AddressLocation, type AddressStreetOneOf, type GetPlaceOptions, type GetPlaceRequest, type GetPlaceResponse, type Place, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, getPlace };
@@ -0,0 +1,196 @@
1
+ // src/atlas-v2-place-places.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-place-places.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 resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(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_places";
115
+ function getPlace(payload) {
116
+ function __getPlace({ host }) {
117
+ const metadata = {
118
+ entityFqdn: "wix.atlas.v2.place",
119
+ method: "GET",
120
+ methodFqn: "com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace",
121
+ packageName: PACKAGE_NAME,
122
+ url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
123
+ protoPath: "/v2/place",
124
+ data: payload,
125
+ host
126
+ }),
127
+ params: toURLSearchParams(payload),
128
+ transformResponse: (payload2) => transformPaths(payload2, [
129
+ {
130
+ transformFn: transformRESTFloatToSDKFloat,
131
+ paths: [
132
+ { path: "place.address.geocode.latitude" },
133
+ { path: "place.address.geocode.longitude" }
134
+ ]
135
+ }
136
+ ])
137
+ };
138
+ return metadata;
139
+ }
140
+ return __getPlace;
141
+ }
142
+
143
+ // src/atlas-v2-place-places.universal.ts
144
+ import { transformRESTAddressToSDKAddress } from "@wix/sdk-runtime/transformations/address";
145
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
146
+ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
147
+ SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
148
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
149
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
150
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
151
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
152
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
153
+ SubdivisionType2["COUNTRY"] = "COUNTRY";
154
+ return SubdivisionType2;
155
+ })(SubdivisionType || {});
156
+ async function getPlace2(searchId, options) {
157
+ const { httpClient, sideEffects } = arguments[2];
158
+ const payload = renameKeysFromSDKRequestToRESTRequest({
159
+ searchId,
160
+ sessionToken: options?.sessionToken
161
+ });
162
+ const reqOpts = getPlace(payload);
163
+ sideEffects?.onSiteCall?.();
164
+ try {
165
+ const result = await httpClient.request(reqOpts);
166
+ sideEffects?.onSuccess?.(result);
167
+ return renameKeysFromRESTResponseToSDKResponse(
168
+ transformPaths2(result.data, [
169
+ {
170
+ transformFn: transformRESTAddressToSDKAddress,
171
+ paths: [{ path: "place.address" }]
172
+ }
173
+ ])
174
+ );
175
+ } catch (err) {
176
+ const transformedError = sdkTransformError(
177
+ err,
178
+ {
179
+ spreadPathsToArguments: {},
180
+ explicitPathsToArguments: {
181
+ searchId: "$[0]",
182
+ sessionToken: "$[1].sessionToken"
183
+ },
184
+ singleArgumentUnchanged: false
185
+ },
186
+ ["searchId", "options"]
187
+ );
188
+ sideEffects?.onError?.(err);
189
+ throw transformedError;
190
+ }
191
+ }
192
+ export {
193
+ SubdivisionType,
194
+ getPlace2 as getPlace
195
+ };
196
+ //# sourceMappingURL=index.typings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/atlas-v2-place-places.universal.ts","../../src/atlas-v2-place-places.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 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"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;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Aa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO;AAAA,MACLF,gBAAe,OAAO,MAAM;AAAA,QAC1B;AAAA,UACE,aAAa;AAAA,UACb,OAAO,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAAA,QACnC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","SubdivisionType","getPlace"]}
@@ -1,4 +1,5 @@
1
- import { f as GetPlaceRequest$1, a as GetPlaceResponse$1 } from './atlas-v2-place-places.universal-8GIzacBO.mjs';
1
+ import { GetPlaceRequest as GetPlaceRequest$1, GetPlaceResponse as GetPlaceResponse$1 } from './index.typings.mjs';
2
+ import '@wix/sdk-types';
2
3
 
3
4
  interface Place {
4
5
  /** The given place id */
package/build/es/meta.mjs CHANGED
@@ -94,6 +94,12 @@ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
94
94
  srcPath: "/api/wix-atlas-service-web",
95
95
  destPath: ""
96
96
  }
97
+ ],
98
+ "*.wixforms.com": [
99
+ {
100
+ srcPath: "/_api/wix-atlas-service-web",
101
+ destPath: ""
102
+ }
97
103
  ]
98
104
  };
99
105
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/atlas-v2-place-places.http.ts","../../src/atlas-v2-place-places.meta.ts"],"sourcesContent":["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 };\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 * as ambassadorWixAtlasV2Place from './atlas-v2-place-places.http.js';\nimport * as ambassadorWixAtlasV2PlaceTypes from './atlas-v2-place-places.types.js';\nimport * as ambassadorWixAtlasV2PlaceUniversalTypes from './atlas-v2-place-places.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getPlace(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixAtlasV2PlaceUniversalTypes.GetPlaceRequest,\n ambassadorWixAtlasV2PlaceTypes.GetPlaceRequest,\n ambassadorWixAtlasV2PlaceUniversalTypes.GetPlaceResponse,\n ambassadorWixAtlasV2PlaceTypes.GetPlaceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixAtlasV2Place.getPlace(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/place',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,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IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getPlace"]}
1
+ {"version":3,"sources":["../../src/atlas-v2-place-places.http.ts","../../src/atlas-v2-place-places.meta.ts"],"sourcesContent":["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 * as ambassadorWixAtlasV2Place from './atlas-v2-place-places.http.js';\nimport * as ambassadorWixAtlasV2PlaceTypes from './atlas-v2-place-places.types.js';\nimport * as ambassadorWixAtlasV2PlaceUniversalTypes from './atlas-v2-place-places.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getPlace(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixAtlasV2PlaceUniversalTypes.GetPlaceRequest,\n ambassadorWixAtlasV2PlaceTypes.GetPlaceRequest,\n ambassadorWixAtlasV2PlaceUniversalTypes.GetPlaceResponse,\n ambassadorWixAtlasV2PlaceTypes.GetPlaceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixAtlasV2Place.getPlace(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/place',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;A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AM,iCAAiC;AAAA,YACzC,EAAE,MAAM,kCAAkC;AAAA,UAC5C;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC1HO,SAASC,YAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAA8C,SAAS,OAAO;AAEpE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getPlace"]}
@@ -1,13 +1,16 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { G as GetPlaceOptions, a as GetPlaceResponse } from './atlas-v2-place-places.universal-8GIzacBO.js';
3
- export { A as Address, d as AddressLocation, b as AddressStreetOneOf, f as GetPlaceRequest, P as Place, c as StreetAddress, e as Subdivision, S as SubdivisionType } from './atlas-v2-place-places.universal-8GIzacBO.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
4
 
5
+ type PlaceNonNullablePaths = `placeId` | `address.streetAddress.number` | `address.streetAddress.name` | `types`;
5
6
  declare function getPlace$1(httpClient: HttpClient): GetPlaceSignature;
6
7
  interface GetPlaceSignature {
7
8
  /**
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.
9
10
  */
10
- (searchId: string, options?: GetPlaceOptions | undefined): Promise<GetPlaceResponse>;
11
+ (searchId: string, options?: GetPlaceOptions): Promise<NonNullablePaths<GetPlaceResponse, {
12
+ [P in PlaceNonNullablePaths]: `place.${P}`;
13
+ }[PlaceNonNullablePaths]>>;
11
14
  }
12
15
 
13
16
  declare const getPlace: MaybeContext<BuildRESTFunction<typeof getPlace$1> & typeof getPlace$1>;
@@ -125,6 +125,12 @@ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
125
125
  srcPath: "/api/wix-atlas-service-web",
126
126
  destPath: ""
127
127
  }
128
+ ],
129
+ "*.wixforms.com": [
130
+ {
131
+ srcPath: "/_api/wix-atlas-service-web",
132
+ destPath: ""
133
+ }
128
134
  ]
129
135
  };
130
136
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
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 };\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 } 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\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 (\n searchId: string,\n options?: GetPlaceOptions | undefined\n ): Promise<GetPlaceResponse>;\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,kBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,mBAA6C;AAC7C,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,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B;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AExKO,SAASC,UAAS,YAA2C;AAClE,SAAO,CAAC,UAAkB,YACxBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,IAAAC,uBAAiC;AAG1B,IAAMC,YAEK,2DAAiBA,SAAc;","names":["getPlace","import_rest_modules","payload","import_transform_paths","SubdivisionType","getPlace","sdkTransformError","getPlace","import_rest_modules","getPlace"]}
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,kBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,mBAA6C;AAC7C,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,U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S,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,UAAU;AAAA,UACV,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AElKO,SAASC,UAAS,YAA2C;AAClE,SAAO,CAAC,UAAkB,YACxBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,IAAAC,uBAAiC;AAG1B,IAAMC,YAEK,2DAAiBA,SAAc;","names":["getPlace","import_rest_modules","payload","import_transform_paths","SubdivisionType","getPlace","sdkTransformError","getPlace","import_rest_modules","getPlace"]}
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Place {
2
4
  /** The given place id */
3
5
  placeId?: string;
@@ -66,6 +68,8 @@ declare enum SubdivisionType {
66
68
  /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
67
69
  COUNTRY = "COUNTRY"
68
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';
69
73
  interface GetPlaceRequest {
70
74
  searchId: string;
71
75
  /**
@@ -77,6 +81,20 @@ interface GetPlaceRequest {
77
81
  interface GetPlaceResponse {
78
82
  place?: Place;
79
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]>>;
80
98
  interface GetPlaceOptions {
81
99
  /**
82
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.
@@ -85,4 +103,4 @@ interface GetPlaceOptions {
85
103
  sessionToken?: string | null;
86
104
  }
87
105
 
88
- export { type Address as A, type GetPlaceOptions as G, type Place as P, SubdivisionType as S, type GetPlaceResponse as a, type AddressStreetOneOf as b, type StreetAddress as c, type AddressLocation as d, type Subdivision as e, type GetPlaceRequest as f };
106
+ export { type Address, type AddressLocation, type AddressStreetOneOf, type GetPlaceOptions, type GetPlaceRequest, type GetPlaceResponse, type Place, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, getPlace };