@wix/auto_sdk_atlas_places 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +7 -4
- package/build/cjs/index.js +12 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{atlas-v2-place-places.universal-8GIzacBO.d.ts → index.typings.d.ts} +19 -1
- package/build/cjs/index.typings.js +227 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/cjs/meta.js +12 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +7 -4
- package/build/es/index.mjs +12 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/{atlas-v2-place-places.universal-8GIzacBO.d.mts → index.typings.d.mts} +19 -1
- package/build/es/index.typings.mjs +202 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/es/meta.mjs +12 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +7 -4
- package/build/internal/cjs/index.js +12 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{atlas-v2-place-places.universal-8GIzacBO.d.ts → index.typings.d.ts} +19 -1
- package/build/internal/cjs/index.typings.js +227 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/cjs/meta.js +12 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +7 -4
- package/build/internal/es/index.mjs +12 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{atlas-v2-place-places.universal-8GIzacBO.d.mts → index.typings.d.mts} +19 -1
- package/build/internal/es/index.typings.mjs +202 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/build/internal/es/meta.mjs +12 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +4 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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
|
|
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>;
|
package/build/cjs/index.js
CHANGED
|
@@ -125,6 +125,18 @@ 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
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"platform.rise.ai": [
|
|
136
|
+
{
|
|
137
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
138
|
+
destPath: ""
|
|
139
|
+
}
|
|
128
140
|
]
|
|
129
141
|
};
|
|
130
142
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
package/build/cjs/index.js.map
CHANGED
|
@@ -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,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,I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DAAiBA,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 'platform.rise.ai': [\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,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;AAA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B,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
|
|
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,227 @@
|
|
|
1
|
+
"use strict";
|
|
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 });
|
|
9
|
+
};
|
|
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
|
+
"platform.rise.ai": [
|
|
136
|
+
{
|
|
137
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
138
|
+
destPath: ""
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
143
|
+
}
|
|
144
|
+
var PACKAGE_NAME = "@wix/auto_sdk_atlas_places";
|
|
145
|
+
function getPlace(payload) {
|
|
146
|
+
function __getPlace({ host }) {
|
|
147
|
+
const metadata = {
|
|
148
|
+
entityFqdn: "wix.atlas.v2.place",
|
|
149
|
+
method: "GET",
|
|
150
|
+
methodFqn: "com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace",
|
|
151
|
+
packageName: PACKAGE_NAME,
|
|
152
|
+
url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
|
|
153
|
+
protoPath: "/v2/place",
|
|
154
|
+
data: payload,
|
|
155
|
+
host
|
|
156
|
+
}),
|
|
157
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
158
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
159
|
+
{
|
|
160
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
161
|
+
paths: [
|
|
162
|
+
{ path: "place.address.geocode.latitude" },
|
|
163
|
+
{ path: "place.address.geocode.longitude" }
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
])
|
|
167
|
+
};
|
|
168
|
+
return metadata;
|
|
169
|
+
}
|
|
170
|
+
return __getPlace;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// src/atlas-v2-place-places.universal.ts
|
|
174
|
+
var import_address = require("@wix/sdk-runtime/transformations/address");
|
|
175
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
176
|
+
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
177
|
+
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
178
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
179
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
180
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
181
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
182
|
+
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
183
|
+
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
184
|
+
return SubdivisionType2;
|
|
185
|
+
})(SubdivisionType || {});
|
|
186
|
+
async function getPlace2(searchId, options) {
|
|
187
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
188
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
189
|
+
searchId,
|
|
190
|
+
sessionToken: options?.sessionToken
|
|
191
|
+
});
|
|
192
|
+
const reqOpts = getPlace(payload);
|
|
193
|
+
sideEffects?.onSiteCall?.();
|
|
194
|
+
try {
|
|
195
|
+
const result = await httpClient.request(reqOpts);
|
|
196
|
+
sideEffects?.onSuccess?.(result);
|
|
197
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
198
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
199
|
+
{
|
|
200
|
+
transformFn: import_address.transformRESTAddressToSDKAddress,
|
|
201
|
+
paths: [{ path: "place.address" }]
|
|
202
|
+
}
|
|
203
|
+
])
|
|
204
|
+
);
|
|
205
|
+
} catch (err) {
|
|
206
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
207
|
+
err,
|
|
208
|
+
{
|
|
209
|
+
spreadPathsToArguments: {},
|
|
210
|
+
explicitPathsToArguments: {
|
|
211
|
+
searchId: "$[0]",
|
|
212
|
+
sessionToken: "$[1].sessionToken"
|
|
213
|
+
},
|
|
214
|
+
singleArgumentUnchanged: false
|
|
215
|
+
},
|
|
216
|
+
["searchId", "options"]
|
|
217
|
+
);
|
|
218
|
+
sideEffects?.onError?.(err);
|
|
219
|
+
throw transformedError;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
223
|
+
0 && (module.exports = {
|
|
224
|
+
SubdivisionType,
|
|
225
|
+
getPlace
|
|
226
|
+
});
|
|
227
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/atlas-v2-place-places.universal.ts","../../src/atlas-v2-place-places.http.ts"],"sourcesContent":["export * from './src/atlas-v2-place-places.universal.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 'platform.rise.ai': [\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;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,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,MACt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ths","SubdivisionType","getPlace","sdkTransformError"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetPlaceRequest as GetPlaceRequest$1, GetPlaceResponse as GetPlaceResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface Place {
|
|
4
5
|
/** The given place id */
|
package/build/cjs/meta.js
CHANGED
|
@@ -120,6 +120,18 @@ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
|
|
|
120
120
|
srcPath: "/api/wix-atlas-service-web",
|
|
121
121
|
destPath: ""
|
|
122
122
|
}
|
|
123
|
+
],
|
|
124
|
+
"*.wixforms.com": [
|
|
125
|
+
{
|
|
126
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
127
|
+
destPath: ""
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"platform.rise.ai": [
|
|
131
|
+
{
|
|
132
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
133
|
+
destPath: ""
|
|
134
|
+
}
|
|
123
135
|
]
|
|
124
136
|
};
|
|
125
137
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/atlas-v2-place-places.http.ts","../../src/atlas-v2-place-places.meta.ts"],"sourcesContent":["export * from './src/atlas-v2-place-places.meta.js';\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 * 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;AAAA;AAAA,kBAAAA;AAAA;AAAA;;;AC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UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,SAAS,SAA6C;AACpE,WAAS,WAAW,EAAE,KAAK,GAAQ;AACjC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,qDAAqD;AAAA,QACxD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,iCAAiC;AAAA,YACzC,EAAE,MAAM,kCAAkC;AAAA,UAC5C;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/atlas-v2-place-places.http.ts","../../src/atlas-v2-place-places.meta.ts"],"sourcesContent":["export * from './src/atlas-v2-place-places.meta.js';\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 'platform.rise.ai': [\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;AAAA;AAAA,kBAAAA;AAAA;AAAA;;;ACAA,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,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,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,Q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ACzC,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":["getPlace","import_rest_modules","payload","getPlace"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { GetPlaceOptions, GetPlaceResponse } from './index.typings.mjs';
|
|
3
|
+
export { Address, AddressLocation, AddressStreetOneOf, GetPlaceRequest, Place, StreetAddress, Subdivision, SubdivisionType } from './index.typings.mjs';
|
|
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
|
|
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>;
|
package/build/es/index.mjs
CHANGED
|
@@ -101,6 +101,18 @@ function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
|
|
|
101
101
|
srcPath: "/api/wix-atlas-service-web",
|
|
102
102
|
destPath: ""
|
|
103
103
|
}
|
|
104
|
+
],
|
|
105
|
+
"*.wixforms.com": [
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
108
|
+
destPath: ""
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"platform.rise.ai": [
|
|
112
|
+
{
|
|
113
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
114
|
+
destPath: ""
|
|
115
|
+
}
|
|
104
116
|
]
|
|
105
117
|
};
|
|
106
118
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../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":["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,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;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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KO,SAASG,UAAS,YAA2C;AAClE,SAAO,CAAC,UAAkB,YACxBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChBA,SAAS,wBAAwB;AAG1B,IAAMC,YAEK,iCAAiBA,SAAc;","names":["payload","transformPaths","SubdivisionType","getPlace","getPlace","getPlace"]}
|
|
1
|
+
{"version":3,"sources":["../../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":["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 'platform.rise.ai': [\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,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;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,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