@wix/auto_sdk_atlas_autocomplete 1.0.0 → 1.0.2

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 (121) hide show
  1. package/build/{es/src/atlas-v2-prediction-autocomplete.types.d.ts → cjs/atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.ts} +29 -29
  2. package/build/cjs/index.d.ts +16 -1
  3. package/build/cjs/index.js +221 -15
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/meta.d.ts +69 -1
  6. package/build/cjs/meta.js +177 -15
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/{cjs/src/atlas-v2-prediction-autocomplete.types.d.ts → es/atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.mts} +29 -29
  9. package/build/es/index.d.mts +16 -0
  10. package/build/es/index.mjs +199 -0
  11. package/build/es/index.mjs.map +1 -0
  12. package/build/es/meta.d.mts +69 -0
  13. package/build/es/meta.mjs +153 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/internal/cjs/{src/atlas-v2-prediction-autocomplete.types.d.ts → atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.ts} +29 -29
  16. package/build/internal/cjs/index.d.ts +16 -1
  17. package/build/internal/cjs/index.js +221 -15
  18. package/build/internal/cjs/index.js.map +1 -1
  19. package/build/internal/cjs/meta.d.ts +69 -1
  20. package/build/internal/cjs/meta.js +177 -15
  21. package/build/internal/cjs/meta.js.map +1 -1
  22. package/build/internal/es/{src/atlas-v2-prediction-autocomplete.types.d.ts → atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.mts} +29 -29
  23. package/build/internal/es/index.d.mts +16 -0
  24. package/build/internal/es/index.mjs +199 -0
  25. package/build/internal/es/index.mjs.map +1 -0
  26. package/build/internal/es/meta.d.mts +69 -0
  27. package/build/internal/es/meta.mjs +153 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +11 -10
  30. package/build/cjs/index.typings.d.ts +0 -1
  31. package/build/cjs/index.typings.js +0 -18
  32. package/build/cjs/index.typings.js.map +0 -1
  33. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  34. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.js +0 -9
  35. package/build/cjs/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  36. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  37. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.js +0 -134
  38. package/build/cjs/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  39. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  40. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.js +0 -47
  41. package/build/cjs/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  42. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  43. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.js +0 -14
  44. package/build/cjs/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  45. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.js +0 -11
  46. package/build/cjs/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  47. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.d.ts +0 -140
  48. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js +0 -98
  49. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
  50. package/build/es/index.d.ts +0 -1
  51. package/build/es/index.js +0 -2
  52. package/build/es/index.js.map +0 -1
  53. package/build/es/index.typings.d.ts +0 -1
  54. package/build/es/index.typings.js +0 -2
  55. package/build/es/index.typings.js.map +0 -1
  56. package/build/es/meta.d.ts +0 -1
  57. package/build/es/meta.js +0 -2
  58. package/build/es/meta.js.map +0 -1
  59. package/build/es/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  60. package/build/es/src/atlas-v2-prediction-autocomplete.context.js +0 -5
  61. package/build/es/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  62. package/build/es/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  63. package/build/es/src/atlas-v2-prediction-autocomplete.http.js +0 -130
  64. package/build/es/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  65. package/build/es/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  66. package/build/es/src/atlas-v2-prediction-autocomplete.meta.js +0 -20
  67. package/build/es/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  68. package/build/es/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  69. package/build/es/src/atlas-v2-prediction-autocomplete.public.js +0 -9
  70. package/build/es/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  71. package/build/es/src/atlas-v2-prediction-autocomplete.types.js +0 -8
  72. package/build/es/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  73. package/build/es/src/atlas-v2-prediction-autocomplete.universal.d.ts +0 -140
  74. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js +0 -71
  75. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
  76. package/build/internal/cjs/index.typings.d.ts +0 -1
  77. package/build/internal/cjs/index.typings.js +0 -18
  78. package/build/internal/cjs/index.typings.js.map +0 -1
  79. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  80. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.js +0 -9
  81. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  82. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  83. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.js +0 -134
  84. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  85. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  86. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.js +0 -47
  87. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  88. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  89. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.js +0 -14
  90. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  91. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.js +0 -11
  92. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  93. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.d.ts +0 -140
  94. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js +0 -98
  95. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
  96. package/build/internal/es/index.d.ts +0 -1
  97. package/build/internal/es/index.js +0 -2
  98. package/build/internal/es/index.js.map +0 -1
  99. package/build/internal/es/index.typings.d.ts +0 -1
  100. package/build/internal/es/index.typings.js +0 -2
  101. package/build/internal/es/index.typings.js.map +0 -1
  102. package/build/internal/es/meta.d.ts +0 -1
  103. package/build/internal/es/meta.js +0 -2
  104. package/build/internal/es/meta.js.map +0 -1
  105. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.d.ts +0 -5
  106. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.js +0 -5
  107. package/build/internal/es/src/atlas-v2-prediction-autocomplete.context.js.map +0 -1
  108. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.d.ts +0 -3
  109. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.js +0 -130
  110. package/build/internal/es/src/atlas-v2-prediction-autocomplete.http.js.map +0 -1
  111. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.d.ts +0 -13
  112. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.js +0 -20
  113. package/build/internal/es/src/atlas-v2-prediction-autocomplete.meta.js.map +0 -1
  114. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.d.ts +0 -14
  115. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.js +0 -9
  116. package/build/internal/es/src/atlas-v2-prediction-autocomplete.public.js.map +0 -1
  117. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.js +0 -8
  118. package/build/internal/es/src/atlas-v2-prediction-autocomplete.types.js.map +0 -1
  119. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.d.ts +0 -140
  120. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js +0 -71
  121. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
@@ -1,140 +0,0 @@
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 {};
@@ -1,71 +0,0 @@
1
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
- import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
- import * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';
4
- export var FilterType;
5
- (function (FilterType) {
6
- /** Filter by zip code */
7
- FilterType["zip_code"] = "zip_code";
8
- /** Filter by 2-letters or 3-letters country code */
9
- FilterType["country_code"] = "country_code";
10
- })(FilterType || (FilterType = {}));
11
- /**
12
- * A Predict end-point take an input and returns an list of Prediction object.
13
- * @param input - The text the predictions will be based on.
14
- * @public
15
- * @documentationMaturity preview
16
- * @requiredField input
17
- * @permissionId WIX_ATLAS.LIST_PREDICTIONS
18
- * @permissionScope Manage Bookings Services and Settings
19
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
20
- * @permissionScope Manage Events
21
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
22
- * @permissionScope Manage Challenges
23
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
24
- * @permissionScope Manage Portfolio
25
- * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
26
- * @permissionScope Access Verticals by Automations
27
- * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
28
- * @permissionScope Manage Restaurants - all permissions
29
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
30
- * @permissionScope Set Up Automations
31
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
32
- * @applicableIdentity APP
33
- * @applicableIdentity VISITOR
34
- * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
35
- */
36
- export async function predict(input, options) {
37
- // @ts-ignore
38
- const { httpClient, sideEffects } = arguments[2];
39
- const payload = renameKeysFromSDKRequestToRESTRequest({
40
- input: input,
41
- origin: options?.origin,
42
- location: options?.location,
43
- radius: options?.radius,
44
- countryCodes: options?.countryCodes,
45
- sessionToken: options?.sessionToken,
46
- });
47
- const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);
48
- sideEffects?.onSiteCall?.();
49
- try {
50
- const result = await httpClient.request(reqOpts);
51
- sideEffects?.onSuccess?.(result);
52
- return renameKeysFromRESTResponseToSDKResponse(result.data);
53
- }
54
- catch (err) {
55
- const transformedError = sdkTransformError(err, {
56
- spreadPathsToArguments: {},
57
- explicitPathsToArguments: {
58
- input: '$[0]',
59
- origin: '$[1].origin',
60
- location: '$[1].location',
61
- radius: '$[1].radius',
62
- countryCodes: '$[1].countryCodes',
63
- sessionToken: '$[1].sessionToken',
64
- },
65
- singleArgumentUnchanged: false,
66
- }, ['input', 'options']);
67
- sideEffects?.onError?.(err);
68
- throw transformedError;
69
- }
70
- }
71
- //# sourceMappingURL=atlas-v2-prediction-autocomplete.universal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atlas-v2-prediction-autocomplete.universal.js","sourceRoot":"","sources":["../../../../src/atlas-v2-prediction-autocomplete.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,8BAA8B,MAAM,4CAA4C,CAAC;AAwD7F,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;AAqDD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,KAAa,EACb,OAAwB;IAExB,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,qCAAqC,CAAC;QACpD,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,QAAQ,EAAE,OAAO,EAAE,QAAQ;QAC3B,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,YAAY,EAAE,OAAO,EAAE,YAAY;QACnC,YAAY,EAAE,OAAO,EAAE,YAAY;KACpC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,uCAAuC,CAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE;gBACxB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,aAAa;gBACrB,QAAQ,EAAE,eAAe;gBACzB,MAAM,EAAE,aAAa;gBACrB,YAAY,EAAE,mBAAmB;gBACjC,YAAY,EAAE,mBAAmB;aAClC;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,OAAO,EAAE,SAAS,CAAC,CACrB,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}