@wix/auto_sdk_atlas_autocomplete 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.d.ts +5 -0
  11. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.js +9 -0
  12. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.js.map +1 -0
  13. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.d.ts +3 -0
  14. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.js +134 -0
  15. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.js.map +1 -0
  16. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.d.ts +13 -0
  17. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.js +47 -0
  18. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.js.map +1 -0
  19. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.d.ts +14 -0
  20. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.js +14 -0
  21. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.js.map +1 -0
  22. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.d.ts +99 -0
  23. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.js +11 -0
  24. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.js.map +1 -0
  25. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.d.ts +140 -0
  26. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js +98 -0
  27. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/atlas-v2-prediction-autocomplete.context.d.ts +5 -0
  39. package/build/es/src/atlas-v2-prediction-autocomplete.context.js +5 -0
  40. package/build/es/src/atlas-v2-prediction-autocomplete.context.js.map +1 -0
  41. package/build/es/src/atlas-v2-prediction-autocomplete.http.d.ts +3 -0
  42. package/build/es/src/atlas-v2-prediction-autocomplete.http.js +130 -0
  43. package/build/es/src/atlas-v2-prediction-autocomplete.http.js.map +1 -0
  44. package/build/es/src/atlas-v2-prediction-autocomplete.meta.d.ts +13 -0
  45. package/build/es/src/atlas-v2-prediction-autocomplete.meta.js +20 -0
  46. package/build/es/src/atlas-v2-prediction-autocomplete.meta.js.map +1 -0
  47. package/build/es/src/atlas-v2-prediction-autocomplete.public.d.ts +14 -0
  48. package/build/es/src/atlas-v2-prediction-autocomplete.public.js +9 -0
  49. package/build/es/src/atlas-v2-prediction-autocomplete.public.js.map +1 -0
  50. package/build/es/src/atlas-v2-prediction-autocomplete.types.d.ts +99 -0
  51. package/build/es/src/atlas-v2-prediction-autocomplete.types.js +8 -0
  52. package/build/es/src/atlas-v2-prediction-autocomplete.types.js.map +1 -0
  53. package/build/es/src/atlas-v2-prediction-autocomplete.universal.d.ts +140 -0
  54. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js +71 -0
  55. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.d.ts +5 -0
  66. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.js +9 -0
  67. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.js.map +1 -0
  68. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.d.ts +3 -0
  69. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.js +134 -0
  70. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.js.map +1 -0
  71. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.d.ts +13 -0
  72. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.js +47 -0
  73. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.js.map +1 -0
  74. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.d.ts +14 -0
  75. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.js +14 -0
  76. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.js.map +1 -0
  77. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.d.ts +99 -0
  78. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.js +11 -0
  79. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.js.map +1 -0
  80. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.d.ts +140 -0
  81. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js +98 -0
  82. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.d.ts +5 -0
  93. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.js +5 -0
  94. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.js.map +1 -0
  95. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.d.ts +3 -0
  96. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.js +130 -0
  97. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.js.map +1 -0
  98. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.d.ts +13 -0
  99. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.js +20 -0
  100. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.js.map +1 -0
  101. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.d.ts +14 -0
  102. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.js +9 -0
  103. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.js.map +1 -0
  104. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.d.ts +99 -0
  105. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.js +8 -0
  106. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.js.map +1 -0
  107. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.d.ts +140 -0
  108. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js +71 -0
  109. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,140 @@
1
+ export interface Prediction {
2
+ /** The human-readable name of the prediction */
3
+ description?: string;
4
+ /** The id of the prediction that can be use in place api. Available for short time. */
5
+ searchId?: string;
6
+ /** 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 */
7
+ matchedSubstrings?: MatchedSubstrings[];
8
+ /** Provides pre-formatted text that can be shown in your autocomplete results */
9
+ textStructure?: TextStructure;
10
+ /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
11
+ distanceInMeters?: number | null;
12
+ }
13
+ export interface MatchedSubstrings {
14
+ length?: number;
15
+ offset?: number;
16
+ }
17
+ export interface TextStructure {
18
+ /** Contains the main text of a prediction, usually the name of the place */
19
+ mainText?: string;
20
+ /** Contains the secondary text of a prediction, usually the location of the place */
21
+ secondaryText?: string;
22
+ /** 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
+ mainTextMatchedSubstrings?: MatchedSubstrings[];
24
+ }
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 {
38
+ /** Address latitude. */
39
+ latitude?: number | null;
40
+ /** Address longitude. */
41
+ longitude?: number | null;
42
+ }
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 {
59
+ /**
60
+ * The text the predictions will be based on.
61
+ * @minLength 1
62
+ */
63
+ input: string;
64
+ /** The origin point from which to calculate straight-line distance to the destination */
65
+ origin?: AddressLocation;
66
+ /** The point around which you wish to retrieve place information */
67
+ location?: AddressLocation;
68
+ /** The acceptable distance from that location (in meters) */
69
+ radius?: string | null;
70
+ /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
71
+ countryCodes?: string[];
72
+ /**
73
+ * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.
74
+ * @format GUID
75
+ */
76
+ sessionToken?: string | null;
77
+ }
78
+ export interface PredictResponse {
79
+ predictions?: Prediction[];
80
+ }
81
+ interface MatchedSubstringsNonNullableFields {
82
+ length: number;
83
+ offset: number;
84
+ }
85
+ interface TextStructureNonNullableFields {
86
+ mainText: string;
87
+ secondaryText: string;
88
+ mainTextMatchedSubstrings: MatchedSubstringsNonNullableFields[];
89
+ }
90
+ interface PredictionNonNullableFields {
91
+ description: string;
92
+ searchId: string;
93
+ matchedSubstrings: MatchedSubstringsNonNullableFields[];
94
+ textStructure?: TextStructureNonNullableFields;
95
+ }
96
+ export interface PredictResponseNonNullableFields {
97
+ predictions: PredictionNonNullableFields[];
98
+ }
99
+ /**
100
+ * A Predict end-point take an input and returns an list of Prediction object.
101
+ * @param input - The text the predictions will be based on.
102
+ * @public
103
+ * @documentationMaturity preview
104
+ * @requiredField input
105
+ * @permissionId WIX_ATLAS.LIST_PREDICTIONS
106
+ * @permissionScope Manage Bookings Services and Settings
107
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
108
+ * @permissionScope Manage Events
109
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
110
+ * @permissionScope Manage Challenges
111
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
112
+ * @permissionScope Manage Portfolio
113
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
114
+ * @permissionScope Access Verticals by Automations
115
+ * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
116
+ * @permissionScope Manage Restaurants - all permissions
117
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
118
+ * @permissionScope Set Up Automations
119
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
120
+ * @applicableIdentity APP
121
+ * @applicableIdentity VISITOR
122
+ * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
123
+ */
124
+ export declare function predict(input: string, options?: PredictOptions): Promise<PredictResponse & PredictResponseNonNullableFields>;
125
+ export interface PredictOptions {
126
+ /** The origin point from which to calculate straight-line distance to the destination */
127
+ origin?: AddressLocation;
128
+ /** The point around which you wish to retrieve place information */
129
+ location?: AddressLocation;
130
+ /** The acceptable distance from that location (in meters) */
131
+ radius?: string | null;
132
+ /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
133
+ countryCodes?: string[];
134
+ /**
135
+ * 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.
136
+ * @format GUID
137
+ */
138
+ sessionToken?: string | null;
139
+ }
140
+ export {};
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.predict = exports.FilterType = void 0;
27
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
+ const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
+ const ambassadorWixAtlasV2Prediction = __importStar(require("./atlas-v2-prediction-autocomplete.http.js"));
30
+ var FilterType;
31
+ (function (FilterType) {
32
+ /** Filter by zip code */
33
+ FilterType["zip_code"] = "zip_code";
34
+ /** Filter by 2-letters or 3-letters country code */
35
+ FilterType["country_code"] = "country_code";
36
+ })(FilterType || (exports.FilterType = FilterType = {}));
37
+ /**
38
+ * A Predict end-point take an input and returns an list of Prediction object.
39
+ * @param input - The text the predictions will be based on.
40
+ * @public
41
+ * @documentationMaturity preview
42
+ * @requiredField input
43
+ * @permissionId WIX_ATLAS.LIST_PREDICTIONS
44
+ * @permissionScope Manage Bookings Services and Settings
45
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
46
+ * @permissionScope Manage Events
47
+ * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
48
+ * @permissionScope Manage Challenges
49
+ * @permissionScopeId SCOPE.CHALLENGES.MANAGE
50
+ * @permissionScope Manage Portfolio
51
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
52
+ * @permissionScope Access Verticals by Automations
53
+ * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
54
+ * @permissionScope Manage Restaurants - all permissions
55
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
56
+ * @permissionScope Set Up Automations
57
+ * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
58
+ * @applicableIdentity APP
59
+ * @applicableIdentity VISITOR
60
+ * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
61
+ */
62
+ async function predict(input, options) {
63
+ // @ts-ignore
64
+ const { httpClient, sideEffects } = arguments[2];
65
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
66
+ input: input,
67
+ origin: options?.origin,
68
+ location: options?.location,
69
+ radius: options?.radius,
70
+ countryCodes: options?.countryCodes,
71
+ sessionToken: options?.sessionToken,
72
+ });
73
+ const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);
74
+ sideEffects?.onSiteCall?.();
75
+ try {
76
+ const result = await httpClient.request(reqOpts);
77
+ sideEffects?.onSuccess?.(result);
78
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
79
+ }
80
+ catch (err) {
81
+ const transformedError = (0, transform_error_1.transformError)(err, {
82
+ spreadPathsToArguments: {},
83
+ explicitPathsToArguments: {
84
+ input: '$[0]',
85
+ origin: '$[1].origin',
86
+ location: '$[1].location',
87
+ radius: '$[1].radius',
88
+ countryCodes: '$[1].countryCodes',
89
+ sessionToken: '$[1].sessionToken',
90
+ },
91
+ singleArgumentUnchanged: false,
92
+ }, ['input', 'options']);
93
+ sideEffects?.onError?.(err);
94
+ throw transformedError;
95
+ }
96
+ }
97
+ exports.predict = predict;
98
+ //# sourceMappingURL=atlas-v2-prediction-autocomplete.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-v2-prediction-autocomplete.universal.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,2GAA6F;AAwD7F,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yBAAyB;IACzB,mCAAqB,CAAA;IACrB,oDAAoD;IACpD,2CAA6B,CAAA;AAC/B,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAqDD;;;;;;;;;;;;;;;;;;;;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AC;AAhDD,0BAgDC"}
@@ -0,0 +1 @@
1
+ export * from './src/atlas-v2-prediction-autocomplete.context.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/atlas-v2-prediction-autocomplete.context.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/atlas-v2-prediction-autocomplete.universal.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/atlas-v2-prediction-autocomplete.universal.js';
2
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/atlas-v2-prediction-autocomplete.meta.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/atlas-v2-prediction-autocomplete.meta.js';
2
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';
2
+ import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
3
+ export declare const predict: MaybeContext<BuildRESTFunction<typeof publicPredict> & typeof publicPredict>;
4
+ export { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';
5
+ export { Prediction, MatchedSubstrings, TextStructure, ListPredictionsRequest, AddressLocation, FilterBy, ListPredictionsResponse, PredictRequest, PredictResponse, PredictResponseNonNullableFields, PredictOptions, } from './atlas-v2-prediction-autocomplete.universal.js';
@@ -0,0 +1,5 @@
1
+ import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';
2
+ import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
3
+ export const predict = /*#__PURE__*/ createRESTModule(publicPredict);
4
+ export { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';
5
+ //# sourceMappingURL=atlas-v2-prediction-autocomplete.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-v2-prediction-autocomplete.context.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,CAAC,MAAM,OAAO,GAEhB,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ /** A Predict end-point take an input and returns an list of Prediction object. */
3
+ export declare function predict(payload: object): RequestOptionsFactory<any>;
@@ -0,0 +1,130 @@
1
+ import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';
2
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
3
+ import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
4
+ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
5
+ const domainToMappings = {
6
+ 'api._api_base_domain_': [
7
+ {
8
+ srcPath: '/wix-atlas-service-web',
9
+ destPath: '',
10
+ },
11
+ ],
12
+ 'bo._base_domain_': [
13
+ {
14
+ srcPath: '/wix-atlas-service-web',
15
+ destPath: '',
16
+ },
17
+ ],
18
+ 'wixbo.ai': [
19
+ {
20
+ srcPath: '/wix-atlas-service-web',
21
+ destPath: '',
22
+ },
23
+ ],
24
+ 'wix-bo.com': [
25
+ {
26
+ srcPath: '/wix-atlas-service-web',
27
+ destPath: '',
28
+ },
29
+ ],
30
+ _: [
31
+ {
32
+ srcPath: '/api/wix-atlas-service-web',
33
+ destPath: '',
34
+ },
35
+ {
36
+ srcPath: '/_api/wix-atlas-service-web',
37
+ destPath: '',
38
+ },
39
+ ],
40
+ 'www._base_domain_': [
41
+ {
42
+ srcPath: '/wix-atlas-service-web',
43
+ destPath: '',
44
+ },
45
+ {
46
+ srcPath: '/_api/wix-atlas-service-web',
47
+ destPath: '',
48
+ },
49
+ {
50
+ srcPath: '/api/wix-atlas-service-web',
51
+ destPath: '',
52
+ },
53
+ ],
54
+ 'manage._base_domain_': [
55
+ {
56
+ srcPath: '/wix-atlas-service-web',
57
+ destPath: '',
58
+ },
59
+ ],
60
+ 'editor._base_domain_': [
61
+ {
62
+ srcPath: '/wix-atlas-service-web',
63
+ destPath: '',
64
+ },
65
+ {
66
+ srcPath: '/api/wix-atlas-service-web',
67
+ destPath: '',
68
+ },
69
+ ],
70
+ 'blocks._base_domain_': [
71
+ {
72
+ srcPath: '/wix-atlas-service-web',
73
+ destPath: '',
74
+ },
75
+ {
76
+ srcPath: '/api/wix-atlas-service-web',
77
+ destPath: '',
78
+ },
79
+ ],
80
+ 'create.editorx': [
81
+ {
82
+ srcPath: '/wix-atlas-service-web',
83
+ destPath: '',
84
+ },
85
+ {
86
+ srcPath: '/api/wix-atlas-service-web',
87
+ destPath: '',
88
+ },
89
+ ],
90
+ 'editor.wixapps.net': [
91
+ {
92
+ srcPath: '/api/wix-atlas-service-web',
93
+ destPath: '',
94
+ },
95
+ ],
96
+ };
97
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
98
+ }
99
+ const PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';
100
+ /** A Predict end-point take an input and returns an list of Prediction object. */
101
+ export function predict(payload) {
102
+ function __predict({ host }) {
103
+ const serializedData = transformPaths(payload, [
104
+ {
105
+ transformFn: transformSDKFloatToRESTFloat,
106
+ paths: [
107
+ { path: 'origin.latitude' },
108
+ { path: 'origin.longitude' },
109
+ { path: 'location.latitude' },
110
+ { path: 'location.longitude' },
111
+ ],
112
+ },
113
+ ]);
114
+ const metadata = {
115
+ entityFqdn: 'wix.atlas.v2.prediction',
116
+ method: 'POST',
117
+ methodFqn: 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',
118
+ packageName: PACKAGE_NAME,
119
+ url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({
120
+ protoPath: '/v2/predict',
121
+ data: serializedData,
122
+ host,
123
+ }),
124
+ data: serializedData,
125
+ };
126
+ return metadata;
127
+ }
128
+ return __predict;
129
+ }
130
+ //# sourceMappingURL=atlas-v2-prediction-autocomplete.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-v2-prediction-autocomplete.http.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,SAAS,0DAA0D,CACjE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,UAAU,EAAE;YACV;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,YAAY,EAAE;YACZ;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,CAAC,EAAE;YACD;gBACE,OAAO,EAAE,4BAA4B;gBACrC,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,6BAA6B;gBACtC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;g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,kBAAkB,EAAE;oBAC5B,EAAE,IAAI,EAAE,mBAAmB,EAAE;oBAC7B,EAAE,IAAI,EAAE,oBAAoB,EAAE;iBAC/B;aACF;SACF,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,yBAAyB;YACrC,MAAM,EAAE,MAAa;YACrB,SAAS,EACP,gEAAgE;YAClE,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,0DAA0D,CAAC;gBAC9D,SAAS,EAAE,aAAa;gBACxB,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;SACrB,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as ambassadorWixAtlasV2PredictionTypes from './atlas-v2-prediction-autocomplete.types.js';
2
+ import * as ambassadorWixAtlasV2PredictionUniversalTypes from './atlas-v2-prediction-autocomplete.universal.js';
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
+ getUrl: (context: any) => string;
5
+ httpMethod: K;
6
+ path: string;
7
+ pathParams: M;
8
+ __requestType: T;
9
+ __originalRequestType: S;
10
+ __responseType: Q;
11
+ __originalResponseType: R;
12
+ };
13
+ export declare function predict(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixAtlasV2PredictionUniversalTypes.PredictRequest, ambassadorWixAtlasV2PredictionTypes.PredictRequest, ambassadorWixAtlasV2PredictionUniversalTypes.PredictResponse & ambassadorWixAtlasV2PredictionUniversalTypes.PredictResponseNonNullableFields, ambassadorWixAtlasV2PredictionTypes.PredictResponse & ambassadorWixAtlasV2PredictionTypes.PredictResponseNonNullableFields>;
@@ -0,0 +1,20 @@
1
+ import * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';
2
+ export function predict() {
3
+ const payload = {};
4
+ const getRequestOptions = ambassadorWixAtlasV2Prediction.predict(payload);
5
+ const getUrl = (context) => {
6
+ const { url } = getRequestOptions(context);
7
+ return url;
8
+ };
9
+ return {
10
+ getUrl,
11
+ httpMethod: 'POST',
12
+ path: '/v2/predict',
13
+ pathParams: {},
14
+ __requestType: null,
15
+ __originalRequestType: null,
16
+ __responseType: null,
17
+ __originalResponseType: null,
18
+ };
19
+ }
20
+ //# sourceMappingURL=atlas-v2-prediction-autocomplete.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-v2-prediction-autocomplete.meta.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,8BAA8B,MAAM,4CAA4C,CAAC;AAsB7F,MAAM,UAAU,OAAO;IAUrB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GAAG,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { PredictOptions, PredictResponse, PredictResponseNonNullableFields } from './atlas-v2-prediction-autocomplete.universal.js';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function predict(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 | undefined): Promise<PredictResponse & PredictResponseNonNullableFields>;
13
+ }
14
+ export { AddressLocation, FilterBy, FilterType, ListPredictionsRequest, ListPredictionsResponse, MatchedSubstrings, PredictOptions, PredictRequest, PredictResponse, PredictResponseNonNullableFields, Prediction, TextStructure, } from './atlas-v2-prediction-autocomplete.universal.js';
@@ -0,0 +1,9 @@
1
+ import { predict as universalPredict, } from './atlas-v2-prediction-autocomplete.universal.js';
2
+ export const __metadata = { PACKAGE_NAME: '@wix/atlas' };
3
+ export function predict(httpClient) {
4
+ return (input, options) => universalPredict(input, options,
5
+ // @ts-ignore
6
+ { httpClient });
7
+ }
8
+ export { FilterType, } from './atlas-v2-prediction-autocomplete.universal.js';
9
+ //# sourceMappingURL=atlas-v2-prediction-autocomplete.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-v2-prediction-autocomplete.public.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.public.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,OAAO,IAAI,gBAAgB,GAC5B,MAAM,iDAAiD,CAAC;AAEzD,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAEzD,MAAM,UAAU,OAAO,CAAC,UAAsB;IAC5C,OAAO,CAAC,KAAa,EAAE,OAAwB,EAAE,EAAE,CACjD,gBAAgB,CACd,KAAK,EACL,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAYD,OAAO,EAGL,UAAU,GAUX,MAAM,iDAAiD,CAAC"}
@@ -0,0 +1,99 @@
1
+ export interface Prediction {
2
+ /** The human-readable name of the prediction */
3
+ description?: string;
4
+ /** The id of the prediction that can be use in place api. Available for short time. */
5
+ searchId?: string;
6
+ /** 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 */
7
+ matchedSubstrings?: MatchedSubstrings[];
8
+ /** Provides pre-formatted text that can be shown in your autocomplete results */
9
+ textStructure?: TextStructure;
10
+ /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
11
+ distanceInMeters?: number | null;
12
+ }
13
+ export interface MatchedSubstrings {
14
+ length?: number;
15
+ offset?: number;
16
+ }
17
+ export interface TextStructure {
18
+ /** Contains the main text of a prediction, usually the name of the place */
19
+ mainText?: string;
20
+ /** Contains the secondary text of a prediction, usually the location of the place */
21
+ secondaryText?: string;
22
+ /** 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
+ mainTextMatchedSubstrings?: MatchedSubstrings[];
24
+ }
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 {
38
+ /** Address latitude. */
39
+ latitude?: number | null;
40
+ /** Address longitude. */
41
+ longitude?: number | null;
42
+ }
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 {
59
+ /**
60
+ * The text the predictions will be based on.
61
+ * @minLength 1
62
+ */
63
+ input: string;
64
+ /** The origin point from which to calculate straight-line distance to the destination */
65
+ origin?: AddressLocation;
66
+ /** The point around which you wish to retrieve place information */
67
+ location?: AddressLocation;
68
+ /** The acceptable distance from that location (in meters) */
69
+ radius?: string | null;
70
+ /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
71
+ countryCodes?: string[];
72
+ /**
73
+ * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.
74
+ * @format GUID
75
+ */
76
+ sessionToken?: string | null;
77
+ }
78
+ export interface PredictResponse {
79
+ predictions?: Prediction[];
80
+ }
81
+ interface MatchedSubstringsNonNullableFields {
82
+ length: number;
83
+ offset: number;
84
+ }
85
+ interface TextStructureNonNullableFields {
86
+ mainText: string;
87
+ secondaryText: string;
88
+ mainTextMatchedSubstrings: MatchedSubstringsNonNullableFields[];
89
+ }
90
+ interface PredictionNonNullableFields {
91
+ description: string;
92
+ searchId: string;
93
+ matchedSubstrings: MatchedSubstringsNonNullableFields[];
94
+ textStructure?: TextStructureNonNullableFields;
95
+ }
96
+ export interface PredictResponseNonNullableFields {
97
+ predictions: PredictionNonNullableFields[];
98
+ }
99
+ export {};
@@ -0,0 +1,8 @@
1
+ export var FilterType;
2
+ (function (FilterType) {
3
+ /** Filter by zip code */
4
+ FilterType["zip_code"] = "zip_code";
5
+ /** Filter by 2-letters or 3-letters country code */
6
+ FilterType["country_code"] = "country_code";
7
+ })(FilterType || (FilterType = {}));
8
+ //# sourceMappingURL=atlas-v2-prediction-autocomplete.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-v2-prediction-autocomplete.types.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.types.ts"],"names":[],"mappings":"AAsDA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yBAAyB;IACzB,mCAAqB,CAAA;IACrB,oDAAoD;IACpD,2CAA6B,CAAA;AAC/B,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB"}