@wix/auto_sdk_atlas_autocomplete 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/build/cjs/index.d.ts +19 -1
  2. package/build/cjs/index.js +227 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +116 -1
  5. package/build/cjs/index.typings.js +213 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +70 -1
  8. package/build/cjs/meta.js +183 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +19 -0
  11. package/build/es/index.mjs +205 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/atlas-v2-prediction-autocomplete.universal.d.ts → es/index.typings.d.mts} +18 -30
  14. package/build/es/index.typings.mjs +191 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/{src/atlas-v2-prediction-autocomplete.types.d.ts → meta.d.mts} +23 -33
  17. package/build/es/meta.mjs +159 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +19 -1
  20. package/build/internal/cjs/index.js +227 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +116 -1
  23. package/build/internal/cjs/index.typings.js +213 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +70 -1
  26. package/build/internal/cjs/meta.js +183 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +19 -0
  29. package/build/internal/es/index.mjs +205 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/atlas-v2-prediction-autocomplete.universal.d.ts → index.typings.d.mts} +18 -30
  32. package/build/internal/es/index.typings.mjs +191 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/{cjs/src/atlas-v2-prediction-autocomplete.types.d.ts → es/meta.d.mts} +23 -33
  35. package/build/internal/es/meta.mjs +159 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +11 -10
  38. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  39. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.js +0 -9
  40. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  41. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  42. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.js +0 -134
  43. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  44. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  45. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.js +0 -47
  46. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  47. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  48. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.js +0 -14
  49. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  50. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.d.ts +0 -80
  51. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.js +0 -11
  52. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  53. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.d.ts +0 -128
  54. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js +0 -100
  55. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  66. package/build/es/src/atlas-v2-prediction-autocomplete.context.js +0 -5
  67. package/build/es/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  68. package/build/es/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  69. package/build/es/src/atlas-v2-prediction-autocomplete.http.js +0 -130
  70. package/build/es/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  71. package/build/es/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  72. package/build/es/src/atlas-v2-prediction-autocomplete.meta.js +0 -20
  73. package/build/es/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  74. package/build/es/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  75. package/build/es/src/atlas-v2-prediction-autocomplete.public.js +0 -9
  76. package/build/es/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  77. package/build/es/src/atlas-v2-prediction-autocomplete.types.js +0 -8
  78. package/build/es/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  79. package/build/es/src/atlas-v2-prediction-autocomplete.universal.d.ts +0 -128
  80. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js +0 -73
  81. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
  82. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  83. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.js +0 -9
  84. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  85. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  86. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.js +0 -134
  87. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  88. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  89. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.js +0 -47
  90. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  91. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  92. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.js +0 -14
  93. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  94. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.js +0 -11
  95. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  96. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js +0 -100
  97. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
  98. package/build/internal/es/index.d.ts +0 -1
  99. package/build/internal/es/index.js +0 -2
  100. package/build/internal/es/index.js.map +0 -1
  101. package/build/internal/es/index.typings.d.ts +0 -1
  102. package/build/internal/es/index.typings.js +0 -2
  103. package/build/internal/es/index.typings.js.map +0 -1
  104. package/build/internal/es/meta.d.ts +0 -1
  105. package/build/internal/es/meta.js +0 -2
  106. package/build/internal/es/meta.js.map +0 -1
  107. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  108. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.js +0 -5
  109. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  110. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  111. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.js +0 -130
  112. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  113. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  114. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.js +0 -20
  115. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  116. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  117. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.js +0 -9
  118. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  119. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.d.ts +0 -80
  120. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.js +0 -8
  121. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  122. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js +0 -73
  123. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { NonNullablePaths } from '@wix/sdk-types';
2
- export interface Prediction {
2
+
3
+ interface Prediction {
3
4
  /** The human-readable name of the prediction */
4
5
  description?: string;
5
6
  /** The id of the prediction that can be use in place api. Available for short time. */
@@ -11,11 +12,11 @@ export interface Prediction {
11
12
  /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
12
13
  distanceInMeters?: number | null;
13
14
  }
14
- export interface MatchedSubstrings {
15
+ interface MatchedSubstrings {
15
16
  length?: number;
16
17
  offset?: number;
17
18
  }
18
- export interface TextStructure {
19
+ interface TextStructure {
19
20
  /** Contains the main text of a prediction, usually the name of the place */
20
21
  mainText?: string;
21
22
  /** Contains the secondary text of a prediction, usually the location of the place */
@@ -23,7 +24,7 @@ export interface TextStructure {
23
24
  /** 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 */
24
25
  mainTextMatchedSubstrings?: MatchedSubstrings[];
25
26
  }
26
- export interface ListPredictionsRequest {
27
+ interface ListPredictionsRequest {
27
28
  /** The text the predictions will be based on. */
28
29
  input?: string;
29
30
  /** The origin point from which to calculate straight-line distance to the destination */
@@ -35,28 +36,30 @@ export interface ListPredictionsRequest {
35
36
  /** Filters the user can add in order to get more accurate results */
36
37
  filterBy?: FilterBy[];
37
38
  }
38
- export interface AddressLocation {
39
+ interface AddressLocation {
39
40
  /** Address latitude. */
40
41
  latitude?: number | null;
41
42
  /** Address longitude. */
42
43
  longitude?: number | null;
43
44
  }
44
- export interface FilterBy {
45
+ interface FilterBy {
45
46
  /** One of the filter types enum */
46
- filterType?: FilterType;
47
+ filterType?: FilterTypeWithLiterals;
47
48
  /** Free text like "us" */
48
49
  filterValue?: string;
49
50
  }
50
- export declare enum FilterType {
51
+ declare enum FilterType {
51
52
  /** Filter by zip code */
52
53
  zip_code = "zip_code",
53
54
  /** Filter by 2-letters or 3-letters country code */
54
55
  country_code = "country_code"
55
56
  }
56
- export interface ListPredictionsResponse {
57
+ /** @enumType */
58
+ type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';
59
+ interface ListPredictionsResponse {
57
60
  predictions?: Prediction[];
58
61
  }
59
- export interface PredictRequest {
62
+ interface PredictRequest {
60
63
  /**
61
64
  * The text the predictions will be based on.
62
65
  * @minLength 1
@@ -76,7 +79,7 @@ export interface PredictRequest {
76
79
  */
77
80
  sessionToken?: string | null;
78
81
  }
79
- export interface PredictResponse {
82
+ interface PredictResponse {
80
83
  predictions?: Prediction[];
81
84
  }
82
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`;
@@ -87,30 +90,14 @@ type PredictionNonNullablePaths = `description` | `searchId` | `matchedSubstring
87
90
  * @documentationMaturity preview
88
91
  * @requiredField input
89
92
  * @permissionId WIX_ATLAS.LIST_PREDICTIONS
90
- * @permissionScope Manage Stores
91
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
92
- * @permissionScope Manage Bookings Services and Settings
93
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
94
- * @permissionScope Manage Events
95
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
96
- * @permissionScope Manage Challenges
97
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
98
- * @permissionScope Manage Portfolio
99
- * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
100
- * @permissionScope Access Verticals by Automations
101
- * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
102
- * @permissionScope Manage Restaurants - all permissions
103
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
104
- * @permissionScope Set Up Automations
105
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
106
93
  * @applicableIdentity APP
107
94
  * @applicableIdentity VISITOR
108
95
  * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
109
96
  */
110
- export declare function predict(input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
97
+ declare function predict(input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
111
98
  [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;
112
99
  }[PredictionNonNullablePaths]>>;
113
- export interface PredictOptions {
100
+ interface PredictOptions {
114
101
  /** The origin point from which to calculate straight-line distance to the destination */
115
102
  origin?: AddressLocation;
116
103
  /** The point around which you wish to retrieve place information */
@@ -125,4 +112,5 @@ export interface PredictOptions {
125
112
  */
126
113
  sessionToken?: string | null;
127
114
  }
128
- export {};
115
+
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,191 @@
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
+ };
111
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
112
+ }
113
+ var PACKAGE_NAME = "@wix/auto_sdk_atlas_autocomplete";
114
+ function predict(payload) {
115
+ function __predict({ host }) {
116
+ const serializedData = transformPaths(payload, [
117
+ {
118
+ transformFn: transformSDKFloatToRESTFloat,
119
+ paths: [
120
+ { path: "origin.latitude" },
121
+ { path: "origin.longitude" },
122
+ { path: "location.latitude" },
123
+ { path: "location.longitude" }
124
+ ]
125
+ }
126
+ ]);
127
+ const metadata = {
128
+ entityFqdn: "wix.atlas.v2.prediction",
129
+ method: "POST",
130
+ methodFqn: "com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict",
131
+ packageName: PACKAGE_NAME,
132
+ url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({
133
+ protoPath: "/v2/predict",
134
+ data: serializedData,
135
+ host
136
+ }),
137
+ data: serializedData
138
+ };
139
+ return metadata;
140
+ }
141
+ return __predict;
142
+ }
143
+
144
+ // src/atlas-v2-prediction-autocomplete.universal.ts
145
+ var FilterType = /* @__PURE__ */ ((FilterType2) => {
146
+ FilterType2["zip_code"] = "zip_code";
147
+ FilterType2["country_code"] = "country_code";
148
+ return FilterType2;
149
+ })(FilterType || {});
150
+ async function predict2(input, options) {
151
+ const { httpClient, sideEffects } = arguments[2];
152
+ const payload = renameKeysFromSDKRequestToRESTRequest({
153
+ input,
154
+ origin: options?.origin,
155
+ location: options?.location,
156
+ radius: options?.radius,
157
+ countryCodes: options?.countryCodes,
158
+ sessionToken: options?.sessionToken
159
+ });
160
+ const reqOpts = predict(payload);
161
+ sideEffects?.onSiteCall?.();
162
+ try {
163
+ const result = await httpClient.request(reqOpts);
164
+ sideEffects?.onSuccess?.(result);
165
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
166
+ } catch (err) {
167
+ const transformedError = sdkTransformError(
168
+ err,
169
+ {
170
+ spreadPathsToArguments: {},
171
+ explicitPathsToArguments: {
172
+ input: "$[0]",
173
+ origin: "$[1].origin",
174
+ location: "$[1].location",
175
+ radius: "$[1].radius",
176
+ countryCodes: "$[1].countryCodes",
177
+ sessionToken: "$[1].sessionToken"
178
+ },
179
+ singleArgumentUnchanged: false
180
+ },
181
+ ["input", "options"]
182
+ );
183
+ sideEffects?.onError?.(err);
184
+ throw transformedError;
185
+ }
186
+ }
187
+ export {
188
+ FilterType,
189
+ predict2 as predict
190
+ };
191
+ //# 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 };\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;AAA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BAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,SAAS;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["FilterType","predict"]}
@@ -1,4 +1,7 @@
1
- export interface Prediction {
1
+ import { PredictRequest as PredictRequest$1, PredictResponse as PredictResponse$1 } from './index.typings.mjs';
2
+ import '@wix/sdk-types';
3
+
4
+ interface Prediction {
2
5
  /** The human-readable name of the prediction */
3
6
  description?: string;
4
7
  /** The id of the prediction that can be use in place api. Available for short time. */
@@ -10,11 +13,11 @@ export interface Prediction {
10
13
  /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
11
14
  distanceInMeters?: number | null;
12
15
  }
13
- export interface MatchedSubstrings {
16
+ interface MatchedSubstrings {
14
17
  length?: number;
15
18
  offset?: number;
16
19
  }
17
- export interface TextStructure {
20
+ interface TextStructure {
18
21
  /** Contains the main text of a prediction, usually the name of the place */
19
22
  mainText?: string;
20
23
  /** Contains the secondary text of a prediction, usually the location of the place */
@@ -22,40 +25,13 @@ export interface TextStructure {
22
25
  /** 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 */
23
26
  mainTextMatchedSubstrings?: MatchedSubstrings[];
24
27
  }
25
- export interface ListPredictionsRequest {
26
- /** The text the predictions will be based on. */
27
- input?: string;
28
- /** The origin point from which to calculate straight-line distance to the destination */
29
- origin?: AddressLocation;
30
- /** The point around which you wish to retrieve place information */
31
- location?: AddressLocation;
32
- /** The acceptable distance from that location (in meters) */
33
- radius?: string | null;
34
- /** Filters the user can add in order to get more accurate results */
35
- filterBy?: FilterBy[];
36
- }
37
- export interface AddressLocation {
28
+ interface AddressLocation {
38
29
  /** Address latitude. */
39
30
  latitude?: number | null;
40
31
  /** Address longitude. */
41
32
  longitude?: number | null;
42
33
  }
43
- export interface FilterBy {
44
- /** One of the filter types enum */
45
- filterType?: FilterType;
46
- /** Free text like "us" */
47
- filterValue?: string;
48
- }
49
- export declare enum FilterType {
50
- /** Filter by zip code */
51
- zip_code = "zip_code",
52
- /** Filter by 2-letters or 3-letters country code */
53
- country_code = "country_code"
54
- }
55
- export interface ListPredictionsResponse {
56
- predictions?: Prediction[];
57
- }
58
- export interface PredictRequest {
34
+ interface PredictRequest {
59
35
  /**
60
36
  * The text the predictions will be based on.
61
37
  * @minLength 1
@@ -75,6 +51,20 @@ export interface PredictRequest {
75
51
  */
76
52
  sessionToken?: string | null;
77
53
  }
78
- export interface PredictResponse {
54
+ interface PredictResponse {
79
55
  predictions?: Prediction[];
80
56
  }
57
+
58
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
59
+ getUrl: (context: any) => string;
60
+ httpMethod: K;
61
+ path: string;
62
+ pathParams: M;
63
+ __requestType: T;
64
+ __originalRequestType: S;
65
+ __responseType: Q;
66
+ __originalResponseType: R;
67
+ };
68
+ declare function predict(): __PublicMethodMetaInfo<'POST', {}, PredictRequest$1, PredictRequest, PredictResponse$1, PredictResponse>;
69
+
70
+ export { type __PublicMethodMetaInfo, predict };
@@ -0,0 +1,159 @@
1
+ // src/atlas-v2-prediction-autocomplete.http.ts
2
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
3
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
4
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
5
+ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
6
+ const domainToMappings = {
7
+ "api._api_base_domain_": [
8
+ {
9
+ srcPath: "/wix-atlas-service-web",
10
+ destPath: ""
11
+ }
12
+ ],
13
+ "bo._base_domain_": [
14
+ {
15
+ srcPath: "/wix-atlas-service-web",
16
+ destPath: ""
17
+ }
18
+ ],
19
+ "wixbo.ai": [
20
+ {
21
+ srcPath: "/wix-atlas-service-web",
22
+ destPath: ""
23
+ }
24
+ ],
25
+ "wix-bo.com": [
26
+ {
27
+ srcPath: "/wix-atlas-service-web",
28
+ destPath: ""
29
+ }
30
+ ],
31
+ _: [
32
+ {
33
+ srcPath: "/api/wix-atlas-service-web",
34
+ destPath: ""
35
+ },
36
+ {
37
+ srcPath: "/_api/wix-atlas-service-web",
38
+ destPath: ""
39
+ }
40
+ ],
41
+ "www._base_domain_": [
42
+ {
43
+ srcPath: "/wix-atlas-service-web",
44
+ destPath: ""
45
+ },
46
+ {
47
+ srcPath: "/_api/wix-atlas-service-web",
48
+ destPath: ""
49
+ },
50
+ {
51
+ srcPath: "/api/wix-atlas-service-web",
52
+ destPath: ""
53
+ }
54
+ ],
55
+ "manage._base_domain_": [
56
+ {
57
+ srcPath: "/wix-atlas-service-web",
58
+ destPath: ""
59
+ }
60
+ ],
61
+ "editor._base_domain_": [
62
+ {
63
+ srcPath: "/wix-atlas-service-web",
64
+ destPath: ""
65
+ },
66
+ {
67
+ srcPath: "/api/wix-atlas-service-web",
68
+ destPath: ""
69
+ }
70
+ ],
71
+ "blocks._base_domain_": [
72
+ {
73
+ srcPath: "/wix-atlas-service-web",
74
+ destPath: ""
75
+ },
76
+ {
77
+ srcPath: "/api/wix-atlas-service-web",
78
+ destPath: ""
79
+ }
80
+ ],
81
+ "create.editorx": [
82
+ {
83
+ srcPath: "/wix-atlas-service-web",
84
+ destPath: ""
85
+ },
86
+ {
87
+ srcPath: "/api/wix-atlas-service-web",
88
+ destPath: ""
89
+ }
90
+ ],
91
+ "editor.wixapps.net": [
92
+ {
93
+ srcPath: "/api/wix-atlas-service-web",
94
+ destPath: ""
95
+ }
96
+ ],
97
+ "*.wixforms.com": [
98
+ {
99
+ srcPath: "/_api/wix-atlas-service-web",
100
+ destPath: ""
101
+ }
102
+ ]
103
+ };
104
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
105
+ }
106
+ var PACKAGE_NAME = "@wix/auto_sdk_atlas_autocomplete";
107
+ function predict(payload) {
108
+ function __predict({ host }) {
109
+ const serializedData = transformPaths(payload, [
110
+ {
111
+ transformFn: transformSDKFloatToRESTFloat,
112
+ paths: [
113
+ { path: "origin.latitude" },
114
+ { path: "origin.longitude" },
115
+ { path: "location.latitude" },
116
+ { path: "location.longitude" }
117
+ ]
118
+ }
119
+ ]);
120
+ const metadata = {
121
+ entityFqdn: "wix.atlas.v2.prediction",
122
+ method: "POST",
123
+ methodFqn: "com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict",
124
+ packageName: PACKAGE_NAME,
125
+ url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({
126
+ protoPath: "/v2/predict",
127
+ data: serializedData,
128
+ host
129
+ }),
130
+ data: serializedData
131
+ };
132
+ return metadata;
133
+ }
134
+ return __predict;
135
+ }
136
+
137
+ // src/atlas-v2-prediction-autocomplete.meta.ts
138
+ function predict2() {
139
+ const payload = {};
140
+ const getRequestOptions = predict(payload);
141
+ const getUrl = (context) => {
142
+ const { url } = getRequestOptions(context);
143
+ return url;
144
+ };
145
+ return {
146
+ getUrl,
147
+ httpMethod: "POST",
148
+ path: "/v2/predict",
149
+ pathParams: {},
150
+ __requestType: null,
151
+ __originalRequestType: null,
152
+ __responseType: null,
153
+ __originalResponseType: null
154
+ };
155
+ }
156
+ export {
157
+ predict2 as predict
158
+ };
159
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +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 '*.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_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,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,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A,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":["predict"]}
@@ -1 +1,19 @@
1
- export * from './src/atlas-v2-prediction-autocomplete.context.js';
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
+
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`;
6
+ declare function predict$1(httpClient: HttpClient): PredictSignature;
7
+ interface PredictSignature {
8
+ /**
9
+ * A Predict end-point take an input and returns an list of Prediction object.
10
+ * @param - The text the predictions will be based on.
11
+ */
12
+ (input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
13
+ [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;
14
+ }[PredictionNonNullablePaths]>>;
15
+ }
16
+
17
+ declare const predict: MaybeContext<BuildRESTFunction<typeof predict$1> & typeof predict$1>;
18
+
19
+ export { PredictOptions, PredictResponse, predict };