@wix/auto_sdk_atlas_autocomplete 1.0.1 → 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/cjs/{src/atlas-v2-prediction-autocomplete.types.d.ts → atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.ts} +30 -11
  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/{internal/es/src/atlas-v2-prediction-autocomplete.types.d.ts → es/atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.mts} +30 -11
  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/{src/atlas-v2-prediction-autocomplete.types.d.ts → meta.d.mts} +22 -33
  13. package/build/es/meta.mjs +153 -0
  14. package/build/es/meta.mjs.map +1 -0
  15. package/build/internal/cjs/atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.ts +99 -0
  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/atlas-v2-prediction-autocomplete.universal-Bydmqyu-.d.mts +99 -0
  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/{cjs/src/atlas-v2-prediction-autocomplete.types.d.ts → es/meta.d.mts} +22 -33
  27. package/build/internal/es/meta.mjs +153 -0
  28. package/build/internal/es/meta.mjs.map +1 -0
  29. package/package.json +10 -9
  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 -128
  48. package/build/cjs/src/atlas-v2-prediction-autocomplete.universal.js +0 -100
  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 -128
  74. package/build/es/src/atlas-v2-prediction-autocomplete.universal.js +0 -73
  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 -128
  94. package/build/internal/cjs/src/atlas-v2-prediction-autocomplete.universal.js +0 -100
  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 -128
  120. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js +0 -73
  121. package/build/internal/es/src/atlas-v2-prediction-autocomplete.universal.js.map +0 -1
@@ -1,128 +0,0 @@
1
- import { NonNullablePaths } from '@wix/sdk-types';
2
- export interface Prediction {
3
- /** The human-readable name of the prediction */
4
- description?: string;
5
- /** The id of the prediction that can be use in place api. Available for short time. */
6
- searchId?: string;
7
- /** 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 */
8
- matchedSubstrings?: MatchedSubstrings[];
9
- /** Provides pre-formatted text that can be shown in your autocomplete results */
10
- textStructure?: TextStructure;
11
- /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */
12
- distanceInMeters?: number | null;
13
- }
14
- export interface MatchedSubstrings {
15
- length?: number;
16
- offset?: number;
17
- }
18
- export interface TextStructure {
19
- /** Contains the main text of a prediction, usually the name of the place */
20
- mainText?: string;
21
- /** Contains the secondary text of a prediction, usually the location of the place */
22
- secondaryText?: string;
23
- /** 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
- mainTextMatchedSubstrings?: MatchedSubstrings[];
25
- }
26
- export interface ListPredictionsRequest {
27
- /** The text the predictions will be based on. */
28
- input?: string;
29
- /** The origin point from which to calculate straight-line distance to the destination */
30
- origin?: AddressLocation;
31
- /** The point around which you wish to retrieve place information */
32
- location?: AddressLocation;
33
- /** The acceptable distance from that location (in meters) */
34
- radius?: string | null;
35
- /** Filters the user can add in order to get more accurate results */
36
- filterBy?: FilterBy[];
37
- }
38
- export interface AddressLocation {
39
- /** Address latitude. */
40
- latitude?: number | null;
41
- /** Address longitude. */
42
- longitude?: number | null;
43
- }
44
- export interface FilterBy {
45
- /** One of the filter types enum */
46
- filterType?: FilterType;
47
- /** Free text like "us" */
48
- filterValue?: string;
49
- }
50
- export declare enum FilterType {
51
- /** Filter by zip code */
52
- zip_code = "zip_code",
53
- /** Filter by 2-letters or 3-letters country code */
54
- country_code = "country_code"
55
- }
56
- export interface ListPredictionsResponse {
57
- predictions?: Prediction[];
58
- }
59
- export interface PredictRequest {
60
- /**
61
- * The text the predictions will be based on.
62
- * @minLength 1
63
- */
64
- input: string;
65
- /** The origin point from which to calculate straight-line distance to the destination */
66
- origin?: AddressLocation;
67
- /** The point around which you wish to retrieve place information */
68
- location?: AddressLocation;
69
- /** The acceptable distance from that location (in meters) */
70
- radius?: string | null;
71
- /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
72
- countryCodes?: string[];
73
- /**
74
- * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.
75
- * @format GUID
76
- */
77
- sessionToken?: string | null;
78
- }
79
- export interface PredictResponse {
80
- predictions?: Prediction[];
81
- }
82
- 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`;
83
- /**
84
- * A Predict end-point take an input and returns an list of Prediction object.
85
- * @param input - The text the predictions will be based on.
86
- * @public
87
- * @documentationMaturity preview
88
- * @requiredField input
89
- * @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
- * @applicableIdentity APP
107
- * @applicableIdentity VISITOR
108
- * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
109
- */
110
- export declare function predict(input: string, options?: PredictOptions): Promise<NonNullablePaths<PredictResponse, {
111
- [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;
112
- }[PredictionNonNullablePaths]>>;
113
- export interface PredictOptions {
114
- /** The origin point from which to calculate straight-line distance to the destination */
115
- origin?: AddressLocation;
116
- /** The point around which you wish to retrieve place information */
117
- location?: AddressLocation;
118
- /** The acceptable distance from that location (in meters) */
119
- radius?: string | null;
120
- /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */
121
- countryCodes?: string[];
122
- /**
123
- * 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.
124
- * @format GUID
125
- */
126
- sessionToken?: string | null;
127
- }
128
- export {};
@@ -1,73 +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 Stores
19
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
20
- * @permissionScope Manage Bookings Services and Settings
21
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
22
- * @permissionScope Manage Events
23
- * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
24
- * @permissionScope Manage Challenges
25
- * @permissionScopeId SCOPE.CHALLENGES.MANAGE
26
- * @permissionScope Manage Portfolio
27
- * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
28
- * @permissionScope Access Verticals by Automations
29
- * @permissionScopeId SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS
30
- * @permissionScope Manage Restaurants - all permissions
31
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
32
- * @permissionScope Set Up Automations
33
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
34
- * @applicableIdentity APP
35
- * @applicableIdentity VISITOR
36
- * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict
37
- */
38
- export async function predict(input, options) {
39
- // @ts-ignore
40
- const { httpClient, sideEffects } = arguments[2];
41
- const payload = renameKeysFromSDKRequestToRESTRequest({
42
- input: input,
43
- origin: options?.origin,
44
- location: options?.location,
45
- radius: options?.radius,
46
- countryCodes: options?.countryCodes,
47
- sessionToken: options?.sessionToken,
48
- });
49
- const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);
50
- sideEffects?.onSiteCall?.();
51
- try {
52
- const result = await httpClient.request(reqOpts);
53
- sideEffects?.onSuccess?.(result);
54
- return renameKeysFromRESTResponseToSDKResponse(result.data);
55
- }
56
- catch (err) {
57
- const transformedError = sdkTransformError(err, {
58
- spreadPathsToArguments: {},
59
- explicitPathsToArguments: {
60
- input: '$[0]',
61
- origin: '$[1].origin',
62
- location: '$[1].location',
63
- radius: '$[1].radius',
64
- countryCodes: '$[1].countryCodes',
65
- sessionToken: '$[1].sessionToken',
66
- },
67
- singleArgumentUnchanged: false,
68
- }, ['input', 'options']);
69
- sideEffects?.onError?.(err);
70
- throw transformedError;
71
- }
72
- }
73
- //# 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;AA2CD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,KAAa,EACb,OAAwB;IASxB,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"}