@wix/auto_sdk_atlas_autocomplete 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-prediction-autocomplete.universal-Bydmqyu-.d.ts → index.typings.d.ts} +18 -1
- package/build/cjs/index.typings.js +222 -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-prediction-autocomplete.universal-Bydmqyu-.d.mts → index.typings.d.mts} +18 -1
- package/build/es/index.typings.mjs +197 -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-prediction-autocomplete.universal-Bydmqyu-.d.ts → index.typings.d.ts} +18 -1
- package/build/internal/cjs/index.typings.js +222 -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-prediction-autocomplete.universal-Bydmqyu-.d.mts → index.typings.d.mts} +18 -1
- package/build/internal/es/index.typings.mjs +197 -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/es/{atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.mts → index.typings.d.mts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface Prediction {
|
|
2
4
|
/** The human-readable name of the prediction */
|
|
3
5
|
description?: string;
|
|
@@ -80,6 +82,21 @@ interface PredictRequest {
|
|
|
80
82
|
interface PredictResponse {
|
|
81
83
|
predictions?: Prediction[];
|
|
82
84
|
}
|
|
85
|
+
type PredictionNonNullablePaths = `description` | `searchId` | `matchedSubstrings` | `matchedSubstrings.${number}.length` | `matchedSubstrings.${number}.offset` | `textStructure.mainText` | `textStructure.secondaryText` | `textStructure.mainTextMatchedSubstrings` | `textStructure.mainTextMatchedSubstrings.${number}.length` | `textStructure.mainTextMatchedSubstrings.${number}.offset`;
|
|
86
|
+
/**
|
|
87
|
+
* A Predict end-point take an input and returns an list of Prediction object.
|
|
88
|
+
* @param input - The text the predictions will be based on.
|
|
89
|
+
* @public
|
|
90
|
+
* @documentationMaturity preview
|
|
91
|
+
* @requiredField input
|
|
92
|
+
* @permissionId WIX_ATLAS.LIST_PREDICTIONS
|
|
93
|
+
* @applicableIdentity APP
|
|
94
|
+
* @applicableIdentity VISITOR
|
|
95
|
+
* @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
|
|
96
|
+
*/
|
|
97
|
+
declare function predict(input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
|
|
98
|
+
[P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;
|
|
99
|
+
}[PredictionNonNullablePaths]>>;
|
|
83
100
|
interface PredictOptions {
|
|
84
101
|
/** The origin point from which to calculate straight-line distance to the destination */
|
|
85
102
|
origin?: AddressLocation;
|
|
@@ -96,4 +113,4 @@ interface PredictOptions {
|
|
|
96
113
|
sessionToken?: string | null;
|
|
97
114
|
}
|
|
98
115
|
|
|
99
|
-
export { type AddressLocation
|
|
116
|
+
export { type AddressLocation, type FilterBy, FilterType, type FilterTypeWithLiterals, type ListPredictionsRequest, type ListPredictionsResponse, type MatchedSubstrings, type PredictOptions, type PredictRequest, type PredictResponse, type Prediction, type TextStructure, predict };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// src/atlas-v2-prediction-autocomplete.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-prediction-autocomplete.http.ts
|
|
9
|
+
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
10
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
11
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
12
|
+
function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
|
|
13
|
+
const domainToMappings = {
|
|
14
|
+
"api._api_base_domain_": [
|
|
15
|
+
{
|
|
16
|
+
srcPath: "/wix-atlas-service-web",
|
|
17
|
+
destPath: ""
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"bo._base_domain_": [
|
|
21
|
+
{
|
|
22
|
+
srcPath: "/wix-atlas-service-web",
|
|
23
|
+
destPath: ""
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"wixbo.ai": [
|
|
27
|
+
{
|
|
28
|
+
srcPath: "/wix-atlas-service-web",
|
|
29
|
+
destPath: ""
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"wix-bo.com": [
|
|
33
|
+
{
|
|
34
|
+
srcPath: "/wix-atlas-service-web",
|
|
35
|
+
destPath: ""
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
_: [
|
|
39
|
+
{
|
|
40
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
41
|
+
destPath: ""
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
45
|
+
destPath: ""
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"www._base_domain_": [
|
|
49
|
+
{
|
|
50
|
+
srcPath: "/wix-atlas-service-web",
|
|
51
|
+
destPath: ""
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
55
|
+
destPath: ""
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
59
|
+
destPath: ""
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"manage._base_domain_": [
|
|
63
|
+
{
|
|
64
|
+
srcPath: "/wix-atlas-service-web",
|
|
65
|
+
destPath: ""
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"editor._base_domain_": [
|
|
69
|
+
{
|
|
70
|
+
srcPath: "/wix-atlas-service-web",
|
|
71
|
+
destPath: ""
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
75
|
+
destPath: ""
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"blocks._base_domain_": [
|
|
79
|
+
{
|
|
80
|
+
srcPath: "/wix-atlas-service-web",
|
|
81
|
+
destPath: ""
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
85
|
+
destPath: ""
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"create.editorx": [
|
|
89
|
+
{
|
|
90
|
+
srcPath: "/wix-atlas-service-web",
|
|
91
|
+
destPath: ""
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
95
|
+
destPath: ""
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"editor.wixapps.net": [
|
|
99
|
+
{
|
|
100
|
+
srcPath: "/api/wix-atlas-service-web",
|
|
101
|
+
destPath: ""
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"*.wixforms.com": [
|
|
105
|
+
{
|
|
106
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
107
|
+
destPath: ""
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"platform.rise.ai": [
|
|
111
|
+
{
|
|
112
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
113
|
+
destPath: ""
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
118
|
+
}
|
|
119
|
+
var PACKAGE_NAME = "@wix/auto_sdk_atlas_autocomplete";
|
|
120
|
+
function predict(payload) {
|
|
121
|
+
function __predict({ host }) {
|
|
122
|
+
const serializedData = transformPaths(payload, [
|
|
123
|
+
{
|
|
124
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
125
|
+
paths: [
|
|
126
|
+
{ path: "origin.latitude" },
|
|
127
|
+
{ path: "origin.longitude" },
|
|
128
|
+
{ path: "location.latitude" },
|
|
129
|
+
{ path: "location.longitude" }
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
]);
|
|
133
|
+
const metadata = {
|
|
134
|
+
entityFqdn: "wix.atlas.v2.prediction",
|
|
135
|
+
method: "POST",
|
|
136
|
+
methodFqn: "com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict",
|
|
137
|
+
packageName: PACKAGE_NAME,
|
|
138
|
+
url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({
|
|
139
|
+
protoPath: "/v2/predict",
|
|
140
|
+
data: serializedData,
|
|
141
|
+
host
|
|
142
|
+
}),
|
|
143
|
+
data: serializedData
|
|
144
|
+
};
|
|
145
|
+
return metadata;
|
|
146
|
+
}
|
|
147
|
+
return __predict;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/atlas-v2-prediction-autocomplete.universal.ts
|
|
151
|
+
var FilterType = /* @__PURE__ */ ((FilterType2) => {
|
|
152
|
+
FilterType2["zip_code"] = "zip_code";
|
|
153
|
+
FilterType2["country_code"] = "country_code";
|
|
154
|
+
return FilterType2;
|
|
155
|
+
})(FilterType || {});
|
|
156
|
+
async function predict2(input, options) {
|
|
157
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
158
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
159
|
+
input,
|
|
160
|
+
origin: options?.origin,
|
|
161
|
+
location: options?.location,
|
|
162
|
+
radius: options?.radius,
|
|
163
|
+
countryCodes: options?.countryCodes,
|
|
164
|
+
sessionToken: options?.sessionToken
|
|
165
|
+
});
|
|
166
|
+
const reqOpts = predict(payload);
|
|
167
|
+
sideEffects?.onSiteCall?.();
|
|
168
|
+
try {
|
|
169
|
+
const result = await httpClient.request(reqOpts);
|
|
170
|
+
sideEffects?.onSuccess?.(result);
|
|
171
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
172
|
+
} catch (err) {
|
|
173
|
+
const transformedError = sdkTransformError(
|
|
174
|
+
err,
|
|
175
|
+
{
|
|
176
|
+
spreadPathsToArguments: {},
|
|
177
|
+
explicitPathsToArguments: {
|
|
178
|
+
input: "$[0]",
|
|
179
|
+
origin: "$[1].origin",
|
|
180
|
+
location: "$[1].location",
|
|
181
|
+
radius: "$[1].radius",
|
|
182
|
+
countryCodes: "$[1].countryCodes",
|
|
183
|
+
sessionToken: "$[1].sessionToken"
|
|
184
|
+
},
|
|
185
|
+
singleArgumentUnchanged: false
|
|
186
|
+
},
|
|
187
|
+
["input", "options"]
|
|
188
|
+
);
|
|
189
|
+
sideEffects?.onError?.(err);
|
|
190
|
+
throw transformedError;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
export {
|
|
194
|
+
FilterType,
|
|
195
|
+
predict2 as predict
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.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 ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: 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 PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\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 input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: 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","import { transformSDKFloatToRESTFloat } 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 resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\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_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,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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B,UAAM;AAAA,EACR;AACF;","names":["FilterType","predict"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PredictRequest as PredictRequest$1, PredictResponse as PredictResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface Prediction {
|
|
4
5
|
/** The human-readable name of the prediction */
|
package/build/es/meta.mjs
CHANGED
|
@@ -93,6 +93,18 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
|
|
|
93
93
|
srcPath: "/api/wix-atlas-service-web",
|
|
94
94
|
destPath: ""
|
|
95
95
|
}
|
|
96
|
+
],
|
|
97
|
+
"*.wixforms.com": [
|
|
98
|
+
{
|
|
99
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
100
|
+
destPath: ""
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"platform.rise.ai": [
|
|
104
|
+
{
|
|
105
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
106
|
+
destPath: ""
|
|
107
|
+
}
|
|
96
108
|
]
|
|
97
109
|
};
|
|
98
110
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
package/build/es/meta.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } 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 resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\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_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\nimport * as ambassadorWixAtlasV2PredictionTypes from './atlas-v2-prediction-autocomplete.types.js';\nimport * as ambassadorWixAtlasV2PredictionUniversalTypes from './atlas-v2-prediction-autocomplete.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 predict(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictResponse,\n ambassadorWixAtlasV2PredictionTypes.PredictResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixAtlasV2Prediction.predict(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/predict',\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,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA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AAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,QAAQ,SAA6C;AACnE,WAAS,UAAU,EAAE,KAAK,GAAQ;AAChC,UAAM,iBAAiB,eAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,kBAAkB;AAAA,UAC1B,EAAE,MAAM,mBAAmB;AAAA,UAC3B,EAAE,MAAM,oBAAoB;AAAA,UAC5B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;
|
|
1
|
+
{"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } 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 resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\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_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\nimport * as ambassadorWixAtlasV2PredictionTypes from './atlas-v2-prediction-autocomplete.types.js';\nimport * as ambassadorWixAtlasV2PredictionUniversalTypes from './atlas-v2-prediction-autocomplete.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 predict(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictResponse,\n ambassadorWixAtlasV2PredictionTypes.PredictResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixAtlasV2Prediction.predict(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/predict',\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,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB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|
|
@@ -1,14 +1,17 @@
|
|
|
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 { PredictOptions, PredictResponse } from './index.typings.js';
|
|
3
|
+
export { AddressLocation, FilterBy, FilterType, ListPredictionsRequest, ListPredictionsResponse, MatchedSubstrings, PredictRequest, Prediction, TextStructure } from './index.typings.js';
|
|
4
4
|
|
|
5
|
+
type PredictionNonNullablePaths = `description` | `searchId` | `matchedSubstrings` | `matchedSubstrings.${number}.length` | `matchedSubstrings.${number}.offset` | `textStructure.mainText` | `textStructure.secondaryText` | `textStructure.mainTextMatchedSubstrings` | `textStructure.mainTextMatchedSubstrings.${number}.length` | `textStructure.mainTextMatchedSubstrings.${number}.offset`;
|
|
5
6
|
declare function predict$1(httpClient: HttpClient): PredictSignature;
|
|
6
7
|
interface PredictSignature {
|
|
7
8
|
/**
|
|
8
9
|
* A Predict end-point take an input and returns an list of Prediction object.
|
|
9
10
|
* @param - The text the predictions will be based on.
|
|
10
11
|
*/
|
|
11
|
-
(input: string, options?: PredictOptions
|
|
12
|
+
(input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
|
|
13
|
+
[P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;
|
|
14
|
+
}[PredictionNonNullablePaths]>>;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
declare const predict: MaybeContext<BuildRESTFunction<typeof predict$1> & typeof predict$1>;
|
|
@@ -124,6 +124,18 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
|
|
|
124
124
|
srcPath: "/api/wix-atlas-service-web",
|
|
125
125
|
destPath: ""
|
|
126
126
|
}
|
|
127
|
+
],
|
|
128
|
+
"*.wixforms.com": [
|
|
129
|
+
{
|
|
130
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
131
|
+
destPath: ""
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"platform.rise.ai": [
|
|
135
|
+
{
|
|
136
|
+
srcPath: "/_api/wix-atlas-service-web",
|
|
137
|
+
destPath: ""
|
|
138
|
+
}
|
|
127
139
|
]
|
|
128
140
|
};
|
|
129
141
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.ts","../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.public.ts","../../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.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 ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: 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 PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\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 input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: 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","import { transformSDKFloatToRESTFloat } 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 resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\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_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (\n input: string,\n options?: PredictOptions | undefined\n ): Promise<PredictResponse>;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,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,Q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
|
1
|
+
{"version":3,"sources":["../../../index.ts","../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.public.ts","../../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.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 ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: 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 PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\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 input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: 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","import { transformSDKFloatToRESTFloat } 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 resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\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_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,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;AA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;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,SAAS;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["predict","FilterType","predict","sdkTransformError","predict","import_rest_modules","predict"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface Prediction {
|
|
2
4
|
/** The human-readable name of the prediction */
|
|
3
5
|
description?: string;
|
|
@@ -80,6 +82,21 @@ interface PredictRequest {
|
|
|
80
82
|
interface PredictResponse {
|
|
81
83
|
predictions?: Prediction[];
|
|
82
84
|
}
|
|
85
|
+
type PredictionNonNullablePaths = `description` | `searchId` | `matchedSubstrings` | `matchedSubstrings.${number}.length` | `matchedSubstrings.${number}.offset` | `textStructure.mainText` | `textStructure.secondaryText` | `textStructure.mainTextMatchedSubstrings` | `textStructure.mainTextMatchedSubstrings.${number}.length` | `textStructure.mainTextMatchedSubstrings.${number}.offset`;
|
|
86
|
+
/**
|
|
87
|
+
* A Predict end-point take an input and returns an list of Prediction object.
|
|
88
|
+
* @param input - The text the predictions will be based on.
|
|
89
|
+
* @public
|
|
90
|
+
* @documentationMaturity preview
|
|
91
|
+
* @requiredField input
|
|
92
|
+
* @permissionId WIX_ATLAS.LIST_PREDICTIONS
|
|
93
|
+
* @applicableIdentity APP
|
|
94
|
+
* @applicableIdentity VISITOR
|
|
95
|
+
* @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
|
|
96
|
+
*/
|
|
97
|
+
declare function predict(input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
|
|
98
|
+
[P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;
|
|
99
|
+
}[PredictionNonNullablePaths]>>;
|
|
83
100
|
interface PredictOptions {
|
|
84
101
|
/** The origin point from which to calculate straight-line distance to the destination */
|
|
85
102
|
origin?: AddressLocation;
|
|
@@ -96,4 +113,4 @@ interface PredictOptions {
|
|
|
96
113
|
sessionToken?: string | null;
|
|
97
114
|
}
|
|
98
115
|
|
|
99
|
-
export { type AddressLocation
|
|
116
|
+
export { type AddressLocation, type FilterBy, FilterType, type FilterTypeWithLiterals, type ListPredictionsRequest, type ListPredictionsResponse, type MatchedSubstrings, type PredictOptions, type PredictRequest, type PredictResponse, type Prediction, type TextStructure, predict };
|