@wix/auto_sdk_atlas_places 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +18 -1
- package/build/cjs/index.js +232 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +106 -1
- package/build/cjs/index.typings.js +218 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +69 -1
- package/build/cjs/meta.js +182 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +18 -0
- package/build/es/index.mjs +210 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/atlas-v2-place-places.universal.d.ts → es/index.typings.d.mts} +16 -28
- package/build/es/index.typings.mjs +196 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/{src/atlas-v2-place-places.types.d.ts → meta.d.mts} +23 -33
- package/build/es/meta.mjs +158 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +18 -1
- package/build/internal/cjs/index.js +232 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +106 -1
- package/build/internal/cjs/index.typings.js +218 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +69 -1
- package/build/internal/cjs/meta.js +182 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +18 -0
- package/build/internal/es/index.mjs +210 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/{src/atlas-v2-place-places.universal.d.ts → index.typings.d.mts} +16 -28
- package/build/internal/es/index.typings.mjs +196 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/{cjs/src/atlas-v2-place-places.types.d.ts → es/meta.d.mts} +23 -33
- package/build/internal/es/meta.mjs +158 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +11 -10
- package/build/cjs/src/atlas-v2-place-places.context.d.ts +0 -5
- package/build/cjs/src/atlas-v2-place-places.context.js +0 -9
- package/build/cjs/src/atlas-v2-place-places.context.js.map +0 -1
- package/build/cjs/src/atlas-v2-place-places.http.d.ts +0 -3
- package/build/cjs/src/atlas-v2-place-places.http.js +0 -133
- package/build/cjs/src/atlas-v2-place-places.http.js.map +0 -1
- package/build/cjs/src/atlas-v2-place-places.meta.d.ts +0 -13
- package/build/cjs/src/atlas-v2-place-places.meta.js +0 -47
- package/build/cjs/src/atlas-v2-place-places.meta.js.map +0 -1
- package/build/cjs/src/atlas-v2-place-places.public.d.ts +0 -13
- package/build/cjs/src/atlas-v2-place-places.public.js +0 -14
- package/build/cjs/src/atlas-v2-place-places.public.js.map +0 -1
- package/build/cjs/src/atlas-v2-place-places.types.d.ts +0 -79
- package/build/cjs/src/atlas-v2-place-places.types.js +0 -20
- package/build/cjs/src/atlas-v2-place-places.types.js.map +0 -1
- package/build/cjs/src/atlas-v2-place-places.universal.d.ts +0 -118
- package/build/cjs/src/atlas-v2-place-places.universal.js +0 -107
- package/build/cjs/src/atlas-v2-place-places.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/atlas-v2-place-places.context.d.ts +0 -5
- package/build/es/src/atlas-v2-place-places.context.js +0 -5
- package/build/es/src/atlas-v2-place-places.context.js.map +0 -1
- package/build/es/src/atlas-v2-place-places.http.d.ts +0 -3
- package/build/es/src/atlas-v2-place-places.http.js +0 -129
- package/build/es/src/atlas-v2-place-places.http.js.map +0 -1
- package/build/es/src/atlas-v2-place-places.meta.d.ts +0 -13
- package/build/es/src/atlas-v2-place-places.meta.js +0 -20
- package/build/es/src/atlas-v2-place-places.meta.js.map +0 -1
- package/build/es/src/atlas-v2-place-places.public.d.ts +0 -13
- package/build/es/src/atlas-v2-place-places.public.js +0 -9
- package/build/es/src/atlas-v2-place-places.public.js.map +0 -1
- package/build/es/src/atlas-v2-place-places.types.js +0 -17
- package/build/es/src/atlas-v2-place-places.types.js.map +0 -1
- package/build/es/src/atlas-v2-place-places.universal.d.ts +0 -118
- package/build/es/src/atlas-v2-place-places.universal.js +0 -80
- package/build/es/src/atlas-v2-place-places.universal.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-place-places.context.d.ts +0 -5
- package/build/internal/cjs/src/atlas-v2-place-places.context.js +0 -9
- package/build/internal/cjs/src/atlas-v2-place-places.context.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-place-places.http.d.ts +0 -3
- package/build/internal/cjs/src/atlas-v2-place-places.http.js +0 -133
- package/build/internal/cjs/src/atlas-v2-place-places.http.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-place-places.meta.d.ts +0 -13
- package/build/internal/cjs/src/atlas-v2-place-places.meta.js +0 -47
- package/build/internal/cjs/src/atlas-v2-place-places.meta.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-place-places.public.d.ts +0 -13
- package/build/internal/cjs/src/atlas-v2-place-places.public.js +0 -14
- package/build/internal/cjs/src/atlas-v2-place-places.public.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-place-places.types.js +0 -20
- package/build/internal/cjs/src/atlas-v2-place-places.types.js.map +0 -1
- package/build/internal/cjs/src/atlas-v2-place-places.universal.js +0 -107
- package/build/internal/cjs/src/atlas-v2-place-places.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/atlas-v2-place-places.context.d.ts +0 -5
- package/build/internal/es/src/atlas-v2-place-places.context.js +0 -5
- package/build/internal/es/src/atlas-v2-place-places.context.js.map +0 -1
- package/build/internal/es/src/atlas-v2-place-places.http.d.ts +0 -3
- package/build/internal/es/src/atlas-v2-place-places.http.js +0 -129
- package/build/internal/es/src/atlas-v2-place-places.http.js.map +0 -1
- package/build/internal/es/src/atlas-v2-place-places.meta.d.ts +0 -13
- package/build/internal/es/src/atlas-v2-place-places.meta.js +0 -20
- package/build/internal/es/src/atlas-v2-place-places.meta.js.map +0 -1
- package/build/internal/es/src/atlas-v2-place-places.public.d.ts +0 -13
- package/build/internal/es/src/atlas-v2-place-places.public.js +0 -9
- package/build/internal/es/src/atlas-v2-place-places.public.js.map +0 -1
- package/build/internal/es/src/atlas-v2-place-places.types.d.ts +0 -79
- package/build/internal/es/src/atlas-v2-place-places.types.js +0 -17
- package/build/internal/es/src/atlas-v2-place-places.types.js.map +0 -1
- package/build/internal/es/src/atlas-v2-place-places.universal.js +0 -80
- package/build/internal/es/src/atlas-v2-place-places.universal.js.map +0 -1
package/build/{internal/cjs/src/atlas-v2-place-places.universal.d.ts → es/index.typings.d.mts}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
interface Place {
|
|
3
4
|
/** The given place id */
|
|
4
5
|
placeId?: string;
|
|
5
6
|
/** The Address object */
|
|
@@ -8,7 +9,7 @@ export interface Place {
|
|
|
8
9
|
types?: string[];
|
|
9
10
|
}
|
|
10
11
|
/** Physical address */
|
|
11
|
-
|
|
12
|
+
interface Address extends AddressStreetOneOf {
|
|
12
13
|
/** Street name and number. */
|
|
13
14
|
streetAddress?: StreetAddress;
|
|
14
15
|
/** Main address line, usually street and number as free text. */
|
|
@@ -28,31 +29,31 @@ export interface Address extends AddressStreetOneOf {
|
|
|
28
29
|
addressLine2?: string | null;
|
|
29
30
|
}
|
|
30
31
|
/** @oneof */
|
|
31
|
-
|
|
32
|
+
interface AddressStreetOneOf {
|
|
32
33
|
/** Street name and number. */
|
|
33
34
|
streetAddress?: StreetAddress;
|
|
34
35
|
/** Main address line, usually street and number as free text. */
|
|
35
36
|
addressLine?: string | null;
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
interface StreetAddress {
|
|
38
39
|
/** Street number. */
|
|
39
40
|
number?: string;
|
|
40
41
|
/** Street name. */
|
|
41
42
|
name?: string;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
interface AddressLocation {
|
|
44
45
|
/** Address latitude. */
|
|
45
46
|
latitude?: number | null;
|
|
46
47
|
/** Address longitude. */
|
|
47
48
|
longitude?: number | null;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
+
interface Subdivision {
|
|
50
51
|
/** Short subdivision code. */
|
|
51
52
|
code?: string;
|
|
52
53
|
/** Subdivision full name. */
|
|
53
54
|
name?: string;
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
declare enum SubdivisionType {
|
|
56
57
|
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
57
58
|
/** State */
|
|
58
59
|
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
@@ -67,7 +68,9 @@ export declare enum SubdivisionType {
|
|
|
67
68
|
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
68
69
|
COUNTRY = "COUNTRY"
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
+
/** @enumType */
|
|
72
|
+
type SubdivisionTypeWithLiterals = SubdivisionType | 'UNKNOWN_SUBDIVISION_TYPE' | 'ADMINISTRATIVE_AREA_LEVEL_1' | 'ADMINISTRATIVE_AREA_LEVEL_2' | 'ADMINISTRATIVE_AREA_LEVEL_3' | 'ADMINISTRATIVE_AREA_LEVEL_4' | 'ADMINISTRATIVE_AREA_LEVEL_5' | 'COUNTRY';
|
|
73
|
+
interface GetPlaceRequest {
|
|
71
74
|
searchId: string;
|
|
72
75
|
/**
|
|
73
76
|
* A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.
|
|
@@ -75,7 +78,7 @@ export interface GetPlaceRequest {
|
|
|
75
78
|
*/
|
|
76
79
|
sessionToken?: string | null;
|
|
77
80
|
}
|
|
78
|
-
|
|
81
|
+
interface GetPlaceResponse {
|
|
79
82
|
place?: Place;
|
|
80
83
|
}
|
|
81
84
|
type PlaceNonNullablePaths = `placeId` | `address.streetAddress.number` | `address.streetAddress.name` | `types`;
|
|
@@ -85,34 +88,19 @@ type PlaceNonNullablePaths = `placeId` | `address.streetAddress.number` | `addre
|
|
|
85
88
|
* @documentationMaturity preview
|
|
86
89
|
* @requiredField searchId
|
|
87
90
|
* @permissionId WIX_ATLAS.GET_PLACE
|
|
88
|
-
* @permissionScope Manage Stores
|
|
89
|
-
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
90
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
91
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
92
|
-
* @permissionScope Manage Events
|
|
93
|
-
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
94
|
-
* @permissionScope Manage Challenges
|
|
95
|
-
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
96
|
-
* @permissionScope Manage Portfolio
|
|
97
|
-
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
98
|
-
* @permissionScope Access Verticals by Automations
|
|
99
|
-
* @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
|
|
100
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
101
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
102
|
-
* @permissionScope Set Up Automations
|
|
103
|
-
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
104
91
|
* @applicableIdentity APP
|
|
105
92
|
* @applicableIdentity VISITOR
|
|
106
93
|
* @fqn com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace
|
|
107
94
|
*/
|
|
108
|
-
|
|
95
|
+
declare function getPlace(searchId: string, options?: GetPlaceOptions): Promise<NonNullablePaths<GetPlaceResponse, {
|
|
109
96
|
[P in PlaceNonNullablePaths]: `place.${P}`;
|
|
110
97
|
}[PlaceNonNullablePaths]>>;
|
|
111
|
-
|
|
98
|
+
interface GetPlaceOptions {
|
|
112
99
|
/**
|
|
113
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.
|
|
114
101
|
* @format GUID
|
|
115
102
|
*/
|
|
116
103
|
sessionToken?: string | null;
|
|
117
104
|
}
|
|
118
|
-
|
|
105
|
+
|
|
106
|
+
export { type Address, type AddressLocation, type AddressStreetOneOf, type GetPlaceOptions, type GetPlaceRequest, type GetPlaceResponse, type Place, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, getPlace };
|
|
@@ -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;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,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,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,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,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,QAAQ,kBAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACA,aAClB,eAAeA,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;;;ADzIA,SAAS,wCAAwC;AACjD,SAAS,kBAAAC,uBAAsB;AA6DxB,IAAK,kBAAL,kBAAKC,qBAAL;AACL,EAAAA,iBAAA,8BAA2B;AAE3B,EAAAA,iBAAA,iCAA8B;AAE9B,EAAAA,iBAAA,iCAA8B;AAE9B,EAAAA,iBAAA,iCAA8B;AAE9B,EAAAA,iBAAA,iCAA8B;AAE9B,EAAAA,iBAAA,iCAA8B;AAE9B,EAAAA,iBAAA,aAAU;AAbA,SAAAA;AAAA,GAAA;AAwDZ,eAAsBC,UACpB,UACA,SAMA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAoC,SAAS,OAAO;AAE1D,eAAa,aAAa;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,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { GetPlaceRequest as GetPlaceRequest$1, GetPlaceResponse as GetPlaceResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
interface Place {
|
|
2
5
|
/** The given place id */
|
|
3
6
|
placeId?: string;
|
|
4
7
|
/** The Address object */
|
|
@@ -7,7 +10,7 @@ export interface Place {
|
|
|
7
10
|
types?: string[];
|
|
8
11
|
}
|
|
9
12
|
/** Physical address */
|
|
10
|
-
|
|
13
|
+
interface Address extends AddressStreetOneOf {
|
|
11
14
|
/** Street name and number. */
|
|
12
15
|
streetAddress?: StreetAddress;
|
|
13
16
|
/** Main address line, usually street and number as free text. */
|
|
@@ -27,46 +30,19 @@ export interface Address extends AddressStreetOneOf {
|
|
|
27
30
|
addressLine2?: string | null;
|
|
28
31
|
}
|
|
29
32
|
/** @oneof */
|
|
30
|
-
|
|
33
|
+
interface AddressStreetOneOf {
|
|
31
34
|
/** Street name and number. */
|
|
32
35
|
streetAddress?: StreetAddress;
|
|
33
36
|
/** Main address line, usually street and number as free text. */
|
|
34
37
|
addressLine?: string | null;
|
|
35
38
|
}
|
|
36
|
-
|
|
39
|
+
interface StreetAddress {
|
|
37
40
|
/** Street number. */
|
|
38
41
|
number?: string;
|
|
39
42
|
/** Street name. */
|
|
40
43
|
name?: string;
|
|
41
44
|
}
|
|
42
|
-
|
|
43
|
-
/** Address latitude. */
|
|
44
|
-
latitude?: number | null;
|
|
45
|
-
/** Address longitude. */
|
|
46
|
-
longitude?: number | null;
|
|
47
|
-
}
|
|
48
|
-
export interface Subdivision {
|
|
49
|
-
/** Short subdivision code. */
|
|
50
|
-
code?: string;
|
|
51
|
-
/** Subdivision full name. */
|
|
52
|
-
name?: string;
|
|
53
|
-
}
|
|
54
|
-
export declare enum SubdivisionType {
|
|
55
|
-
UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
|
|
56
|
-
/** State */
|
|
57
|
-
ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
|
|
58
|
-
/** County */
|
|
59
|
-
ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
|
|
60
|
-
/** City/town */
|
|
61
|
-
ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
|
|
62
|
-
/** Neighborhood/quarter */
|
|
63
|
-
ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
|
|
64
|
-
/** Street/block */
|
|
65
|
-
ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
|
|
66
|
-
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
67
|
-
COUNTRY = "COUNTRY"
|
|
68
|
-
}
|
|
69
|
-
export interface GetPlaceRequest {
|
|
45
|
+
interface GetPlaceRequest {
|
|
70
46
|
searchId: string;
|
|
71
47
|
/**
|
|
72
48
|
* 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.
|
|
@@ -74,6 +50,20 @@ export interface GetPlaceRequest {
|
|
|
74
50
|
*/
|
|
75
51
|
sessionToken?: string | null;
|
|
76
52
|
}
|
|
77
|
-
|
|
53
|
+
interface GetPlaceResponse {
|
|
78
54
|
place?: Place;
|
|
79
55
|
}
|
|
56
|
+
|
|
57
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
58
|
+
getUrl: (context: any) => string;
|
|
59
|
+
httpMethod: K;
|
|
60
|
+
path: string;
|
|
61
|
+
pathParams: M;
|
|
62
|
+
__requestType: T;
|
|
63
|
+
__originalRequestType: S;
|
|
64
|
+
__responseType: Q;
|
|
65
|
+
__originalResponseType: R;
|
|
66
|
+
};
|
|
67
|
+
declare function getPlace(): __PublicMethodMetaInfo<'GET', {}, GetPlaceRequest$1, GetPlaceRequest, GetPlaceResponse$1, GetPlaceResponse>;
|
|
68
|
+
|
|
69
|
+
export { type __PublicMethodMetaInfo, getPlace };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// src/atlas-v2-place-places.http.ts
|
|
2
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
3
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
4
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
5
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
6
|
+
function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
|
|
7
|
+
const domainToMappings = {
|
|
8
|
+
"api._api_base_domain_": [
|
|
9
|
+
{
|
|
10
|
+
srcPath: "/wix-atlas-service-web",
|
|
11
|
+
destPath: ""
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"bo._base_domain_": [
|
|
15
|
+
{
|
|
16
|
+
srcPath: "/wix-atlas-service-web",
|
|
17
|
+
destPath: ""
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"wixbo.ai": [
|
|
21
|
+
{
|
|
22
|
+
srcPath: "/wix-atlas-service-web",
|
|
23
|
+
destPath: ""
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"wix-bo.com": [
|
|
27
|
+
{
|
|
28
|
+
srcPath: "/wix-atlas-service-web",
|
|
29
|
+
destPath: ""
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
_: [
|
|
33
|
+
{
|
|
34
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
35
|
+
destPath: ""
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
39
|
+
destPath: ""
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"www._base_domain_": [
|
|
43
|
+
{
|
|
44
|
+
srcPath: "/wix-atlas-service-web",
|
|
45
|
+
destPath: ""
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
49
|
+
destPath: ""
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
53
|
+
destPath: ""
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"manage._base_domain_": [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/wix-atlas-service-web",
|
|
59
|
+
destPath: ""
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"editor._base_domain_": [
|
|
63
|
+
{
|
|
64
|
+
srcPath: "/wix-atlas-service-web",
|
|
65
|
+
destPath: ""
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
69
|
+
destPath: ""
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"blocks._base_domain_": [
|
|
73
|
+
{
|
|
74
|
+
srcPath: "/wix-atlas-service-web",
|
|
75
|
+
destPath: ""
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
79
|
+
destPath: ""
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"create.editorx": [
|
|
83
|
+
{
|
|
84
|
+
srcPath: "/wix-atlas-service-web",
|
|
85
|
+
destPath: ""
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
89
|
+
destPath: ""
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"editor.wixapps.net": [
|
|
93
|
+
{
|
|
94
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
95
|
+
destPath: ""
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"*.wixforms.com": [
|
|
99
|
+
{
|
|
100
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
101
|
+
destPath: ""
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
106
|
+
}
|
|
107
|
+
var PACKAGE_NAME = "@wix/auto_sdk_atlas_places";
|
|
108
|
+
function getPlace(payload) {
|
|
109
|
+
function __getPlace({ host }) {
|
|
110
|
+
const metadata = {
|
|
111
|
+
entityFqdn: "wix.atlas.v2.place",
|
|
112
|
+
method: "GET",
|
|
113
|
+
methodFqn: "com.wixpress.vi.atlas.service.v2.PlacesServiceV2.GetPlace",
|
|
114
|
+
packageName: PACKAGE_NAME,
|
|
115
|
+
url: resolveComWixpressViAtlasServiceV2PlacesServiceV2Url({
|
|
116
|
+
protoPath: "/v2/place",
|
|
117
|
+
data: payload,
|
|
118
|
+
host
|
|
119
|
+
}),
|
|
120
|
+
params: toURLSearchParams(payload),
|
|
121
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
122
|
+
{
|
|
123
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
124
|
+
paths: [
|
|
125
|
+
{ path: "place.address.geocode.latitude" },
|
|
126
|
+
{ path: "place.address.geocode.longitude" }
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
])
|
|
130
|
+
};
|
|
131
|
+
return metadata;
|
|
132
|
+
}
|
|
133
|
+
return __getPlace;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/atlas-v2-place-places.meta.ts
|
|
137
|
+
function getPlace2() {
|
|
138
|
+
const payload = {};
|
|
139
|
+
const getRequestOptions = getPlace(payload);
|
|
140
|
+
const getUrl = (context) => {
|
|
141
|
+
const { url } = getRequestOptions(context);
|
|
142
|
+
return url;
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
getUrl,
|
|
146
|
+
httpMethod: "GET",
|
|
147
|
+
path: "/v2/place",
|
|
148
|
+
pathParams: {},
|
|
149
|
+
__requestType: null,
|
|
150
|
+
__originalRequestType: null,
|
|
151
|
+
__responseType: null,
|
|
152
|
+
__originalResponseType: null
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export {
|
|
156
|
+
getPlace2 as getPlace
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +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 '*.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;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,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,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,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,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,QAAQ,kBAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACA,aAClB,eAAeA,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;;;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 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { GetPlaceOptions, GetPlaceResponse } from './index.typings.js';
|
|
3
|
+
export { Address, AddressLocation, AddressStreetOneOf, GetPlaceRequest, Place, StreetAddress, Subdivision, SubdivisionType } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
type PlaceNonNullablePaths = `placeId` | `address.streetAddress.number` | `address.streetAddress.name` | `types`;
|
|
6
|
+
declare function getPlace$1(httpClient: HttpClient): GetPlaceSignature;
|
|
7
|
+
interface GetPlaceSignature {
|
|
8
|
+
/**
|
|
9
|
+
* Once you have a search_id from a autocomplete Search, you can request more details about a particular establishment or point of interest by initiating a get place request.
|
|
10
|
+
*/
|
|
11
|
+
(searchId: string, options?: GetPlaceOptions): Promise<NonNullablePaths<GetPlaceResponse, {
|
|
12
|
+
[P in PlaceNonNullablePaths]: `place.${P}`;
|
|
13
|
+
}[PlaceNonNullablePaths]>>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const getPlace: MaybeContext<BuildRESTFunction<typeof getPlace$1> & typeof getPlace$1>;
|
|
17
|
+
|
|
18
|
+
export { GetPlaceOptions, GetPlaceResponse, getPlace };
|