@wix/auto_sdk_atlas_autocomplete 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
130
130
  srcPath: "/_api/wix-atlas-service-web",
131
131
  destPath: ""
132
132
  }
133
+ ],
134
+ "platform.rise.ai": [
135
+ {
136
+ srcPath: "/_api/wix-atlas-service-web",
137
+ destPath: ""
138
+ }
133
139
  ]
134
140
  };
135
141
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.public.ts","../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.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 { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QAC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AC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["predict","FilterType","predict","sdkTransformError","predict","import_rest_modules","predict"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.public.ts","../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;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U,qEAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["predict","FilterType","predict","sdkTransformError","predict","import_rest_modules","predict"]}
@@ -130,6 +130,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
130
130
  srcPath: "/_api/wix-atlas-service-web",
131
131
  destPath: ""
132
132
  }
133
+ ],
134
+ "platform.rise.ai": [
135
+ {
136
+ srcPath: "/_api/wix-atlas-service-web",
137
+ destPath: ""
138
+ }
133
139
  ]
134
140
  };
135
141
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\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;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAA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Aa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADnFO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AA8DZ,eAAsBC,SACpB,OACA,SAQA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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":["predict","FilterType","predict","sdkTransformError"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA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AAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADzFO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AA8DZ,eAAsBC,SACpB,OACA,SAQA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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":["predict","FilterType","predict","sdkTransformError"]}
package/build/cjs/meta.js CHANGED
@@ -125,6 +125,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
125
125
  srcPath: "/_api/wix-atlas-service-web",
126
126
  destPath: ""
127
127
  }
128
+ ],
129
+ "platform.rise.ai": [
130
+ {
131
+ srcPath: "/_api/wix-atlas-service-web",
132
+ destPath: ""
133
+ }
128
134
  ]
129
135
  };
130
136
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.meta.js';\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","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;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,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B;AAAA,UAC5B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC3HO,SAASC,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,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","predict"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import * 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;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,6BAA+B;AAC/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AA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["predict","predict"]}
@@ -106,6 +106,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
106
106
  srcPath: "/_api/wix-atlas-service-web",
107
107
  destPath: ""
108
108
  }
109
+ ],
110
+ "platform.rise.ai": [
111
+ {
112
+ srcPath: "/_api/wix-atlas-service-web",
113
+ destPath: ""
114
+ }
109
115
  ]
110
116
  };
111
117
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.public.ts","../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,U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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;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["FilterType","predict","predict","predict"]}
1
+ {"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.public.ts","../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";AAAA,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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D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;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;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["FilterType","predict","predict","predict"]}
@@ -106,6 +106,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
106
106
  srcPath: "/_api/wix-atlas-service-web",
107
107
  destPath: ""
108
108
  }
109
+ ],
110
+ "platform.rise.ai": [
111
+ {
112
+ srcPath: "/_api/wix-atlas-service-web",
113
+ destPath: ""
114
+ }
109
115
  ]
110
116
  };
111
117
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +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;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,Q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AEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;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
+ {"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.universal.ts","../../src/atlas-v2-prediction-autocomplete.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAA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M,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;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"]}
package/build/es/meta.mjs CHANGED
@@ -99,6 +99,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
99
99
  srcPath: "/_api/wix-atlas-service-web",
100
100
  destPath: ""
101
101
  }
102
+ ],
103
+ "platform.rise.ai": [
104
+ {
105
+ srcPath: "/_api/wix-atlas-service-web",
106
+ destPath: ""
107
+ }
102
108
  ]
103
109
  };
104
110
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.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,QAC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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
+ {"version":3,"sources":["../../src/atlas-v2-prediction-autocomplete.http.ts","../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\nimport * as ambassadorWixAtlasV2PredictionTypes from './atlas-v2-prediction-autocomplete.types.js';\nimport * as ambassadorWixAtlasV2PredictionUniversalTypes from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function predict(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictResponse,\n ambassadorWixAtlasV2PredictionTypes.PredictResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixAtlasV2Prediction.predict(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/predict',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;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;AAA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AAM,oBAAoB;AAAA,UAC5B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACjIO,SAASA,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,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"]}
@@ -130,6 +130,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
130
130
  srcPath: "/_api/wix-atlas-service-web",
131
131
  destPath: ""
132
132
  }
133
+ ],
134
+ "platform.rise.ai": [
135
+ {
136
+ srcPath: "/_api/wix-atlas-service-web",
137
+ destPath: ""
138
+ }
133
139
  ]
134
140
  };
135
141
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.ts","../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.public.ts","../../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.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 { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;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,IAC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AAAA,EACT;AAEA,SAAO;AACT;;;ADnFO,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,cAAW;AAEX,EAAAA,YAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AA8DZ,eAAsBC,SACpB,OACA,SAQA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["predict","FilterType","predict","sdkTransformError","predict","import_rest_modules","predict"]}
1
+ {"version":3,"sources":["../../../index.ts","../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.public.ts","../../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,S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Aa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,IAAAC,uBAAiC;AAG1B,IAAMC,WAEK,2DAAiBA,QAAa;","names":["predict","FilterType","predict","sdkTransformError","predict","import_rest_modules","predict"]}
@@ -130,6 +130,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
130
130
  srcPath: "/_api/wix-atlas-service-web",
131
131
  destPath: ""
132
132
  }
133
+ ],
134
+ "platform.rise.ai": [
135
+ {
136
+ srcPath: "/_api/wix-atlas-service-web",
137
+ destPath: ""
138
+ }
133
139
  ]
134
140
  };
135
141
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.typings.ts","../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\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;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;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C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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":["predict","FilterType","predict","sdkTransformError"]}
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AA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,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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":["predict","FilterType","predict","sdkTransformError"]}
@@ -125,6 +125,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
125
125
  srcPath: "/_api/wix-atlas-service-web",
126
126
  destPath: ""
127
127
  }
128
+ ],
129
+ "platform.rise.ai": [
130
+ {
131
+ srcPath: "/_api/wix-atlas-service-web",
132
+ destPath: ""
133
+ }
128
134
  ]
129
135
  };
130
136
  return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../meta.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.meta.js';\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","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;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,mBAA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EAC1B;AACF;","names":["predict","predict"]}
1
+ {"version":3,"sources":["../../../meta.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["export * from './src/atlas-v2-prediction-autocomplete.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import * 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;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,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MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACjIO,SAASC,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,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","predict"]}
@@ -106,6 +106,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
106
106
  srcPath: "/_api/wix-atlas-service-web",
107
107
  destPath: ""
108
108
  }
109
+ ],
110
+ "platform.rise.ai": [
111
+ {
112
+ srcPath: "/_api/wix-atlas-service-web",
113
+ destPath: ""
114
+ }
109
115
  ]
110
116
  };
111
117
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.public.ts","../../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,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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YAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AA8DZ,eAAsBC,SACpB,OACA,SAQA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU,SAAS;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,cAAc,SAAS;AAAA,IACvB,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAyC,QAAQ,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;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;;;AE9JO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC5BA,SAAS,wBAAwB;AAG1B,IAAMC,WAEK,iCAAiBA,QAAa;","names":["FilterType","predict","predict","predict"]}
1
+ {"version":3,"sources":["../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.public.ts","../../../src/atlas-v2-prediction-autocomplete.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n PredictOptions,\n PredictResponse,\n predict as universalPredict,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\nexport function predict(httpClient: HttpClient): PredictSignature {\n return (input: string, options?: PredictOptions) =>\n universalPredict(\n input,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PredictSignature {\n /**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param - The text the predictions will be based on.\n */\n (input: string, options?: PredictOptions): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n >;\n}\n\nexport {\n AddressLocation,\n FilterBy,\n FilterType,\n ListPredictionsRequest,\n ListPredictionsResponse,\n MatchedSubstrings,\n PredictOptions,\n PredictRequest,\n PredictResponse,\n Prediction,\n TextStructure,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n","import { predict as publicPredict } from './atlas-v2-prediction-autocomplete.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const predict: MaybeContext<\n BuildRESTFunction<typeof publicPredict> & typeof publicPredict\n> = /*#__PURE__*/ createRESTModule(publicPredict);\n\nexport { FilterType } from './atlas-v2-prediction-autocomplete.universal.js';\nexport {\n Prediction,\n MatchedSubstrings,\n TextStructure,\n ListPredictionsRequest,\n AddressLocation,\n FilterBy,\n ListPredictionsResponse,\n PredictRequest,\n PredictResponse,\n PredictOptions,\n} from './atlas-v2-prediction-autocomplete.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,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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,IAAMC,WAEK,iCAAiBA,QAAa;","names":["FilterType","predict","predict","predict"]}
@@ -106,6 +106,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
106
106
  srcPath: "/_api/wix-atlas-service-web",
107
107
  destPath: ""
108
108
  }
109
+ ],
110
+ "platform.rise.ai": [
111
+ {
112
+ srcPath: "/_api/wix-atlas-service-web",
113
+ destPath: ""
114
+ }
109
115
  ]
110
116
  };
111
117
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +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;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,MAC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AA,MAC3B;AAAA,MACA,CAAC,SAAS,SAAS;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["FilterType","predict"]}
1
+ {"version":3,"sources":["../../../src/atlas-v2-prediction-autocomplete.universal.ts","../../../src/atlas-v2-prediction-autocomplete.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\n\nexport interface Prediction {\n /** The human-readable name of the prediction */\n description?: string;\n /** The id of the prediction that can be use in place api. Available for short time. */\n searchId?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n matchedSubstrings?: MatchedSubstrings[];\n /** Provides pre-formatted text that can be shown in your autocomplete results */\n textStructure?: TextStructure;\n /** Contains an integer indicating the straight-line distance between the predicted place, and the specified origin point, in meters. */\n distanceInMeters?: number | null;\n}\n\nexport interface MatchedSubstrings {\n length?: number;\n offset?: number;\n}\n\nexport interface TextStructure {\n /** Contains the main text of a prediction, usually the name of the place */\n mainText?: string;\n /** Contains the secondary text of a prediction, usually the location of the place */\n secondaryText?: string;\n /** Contains an array with offset value and length. These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired */\n mainTextMatchedSubstrings?: MatchedSubstrings[];\n}\n\nexport interface ListPredictionsRequest {\n /** The text the predictions will be based on. */\n input?: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** Filters the user can add in order to get more accurate results */\n filterBy?: FilterBy[];\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface FilterBy {\n /** One of the filter types enum */\n filterType?: FilterTypeWithLiterals;\n /** Free text like \"us\" */\n filterValue?: string;\n}\n\nexport enum FilterType {\n /** Filter by zip code */\n zip_code = 'zip_code',\n /** Filter by 2-letters or 3-letters country code */\n country_code = 'country_code',\n}\n\n/** @enumType */\nexport type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';\n\nexport interface ListPredictionsResponse {\n predictions?: Prediction[];\n}\n\nexport interface PredictRequest {\n /**\n * The text the predictions will be based on.\n * @minLength 1\n */\n input: string;\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n\nexport interface PredictResponse {\n predictions?: Prediction[];\n}\n\ntype PredictionNonNullablePaths =\n | `description`\n | `searchId`\n | `matchedSubstrings`\n | `matchedSubstrings.${number}.length`\n | `matchedSubstrings.${number}.offset`\n | `textStructure.mainText`\n | `textStructure.secondaryText`\n | `textStructure.mainTextMatchedSubstrings`\n | `textStructure.mainTextMatchedSubstrings.${number}.length`\n | `textStructure.mainTextMatchedSubstrings.${number}.offset`;\n\n/**\n * A Predict end-point take an input and returns an list of Prediction object.\n * @param input - The text the predictions will be based on.\n * @public\n * @documentationMaturity preview\n * @requiredField input\n * @permissionId WIX_ATLAS.LIST_PREDICTIONS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict\n */\nexport async function predict(\n input: string,\n options?: PredictOptions\n): Promise<\n NonNullablePaths<\n PredictResponse,\n {\n [P in PredictionNonNullablePaths]: `predictions.${number}.${P}`;\n }[PredictionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n input: input,\n origin: options?.origin,\n location: options?.location,\n radius: options?.radius,\n countryCodes: options?.countryCodes,\n sessionToken: options?.sessionToken,\n });\n\n const reqOpts = ambassadorWixAtlasV2Prediction.predict(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n input: '$[0]',\n origin: '$[1].origin',\n location: '$[1].location',\n radius: '$[1].radius',\n countryCodes: '$[1].countryCodes',\n sessionToken: '$[1].sessionToken',\n },\n singleArgumentUnchanged: false,\n },\n ['input', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PredictOptions {\n /** The origin point from which to calculate straight-line distance to the destination */\n origin?: AddressLocation;\n /** The point around which you wish to retrieve place information */\n location?: AddressLocation;\n /** The acceptable distance from that location (in meters) */\n radius?: string | null;\n /** alpha-2 or alpha-3 ISO-3166 country codes to filter by */\n countryCodes?: string[];\n /**\n * A random string which identifies an autocomplete session for billing purposes. The session begins when the user starts typing a query, and concludes when they select a place and a call to Get Place is made. Once a session has concluded, the token is no longer valid. your app must generate a fresh token for each session.\n * @format GUID\n */\n sessionToken?: string | null;\n}\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MAC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,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["FilterType","predict"]}
@@ -99,6 +99,12 @@ function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
99
99
  srcPath: "/_api/wix-atlas-service-web",
100
100
  destPath: ""
101
101
  }
102
+ ],
103
+ "platform.rise.ai": [
104
+ {
105
+ srcPath: "/_api/wix-atlas-service-web",
106
+ destPath: ""
107
+ }
102
108
  ]
103
109
  };
104
110
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.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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AAM,mBAAmB;AAAA,UAC3B,EAAE,MAAM,oBAAoB;AAAA,UAC5B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,2DAA2D;AAAA,QAC9D,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC3HO,SAASA,WAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAmD,QAAQ,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,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
+ {"version":3,"sources":["../../../src/atlas-v2-prediction-autocomplete.http.ts","../../../src/atlas-v2-prediction-autocomplete.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-atlas-service-web',\n destPath: '',\n },\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n '*.wixforms.com': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n 'platform.rise.ai': [\n {\n srcPath: '/_api/wix-atlas-service-web',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_atlas_autocomplete';\n\n/** A Predict end-point take an input and returns an list of Prediction object. */\nexport function predict(payload: object): RequestOptionsFactory<any> {\n function __predict({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'origin.latitude' },\n { path: 'origin.longitude' },\n { path: 'location.latitude' },\n { path: 'location.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.atlas.v2.prediction',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.vi.atlas.service.v2.AutocompleteServiceV2.Predict',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url({\n protoPath: '/v2/predict',\n data: serializedData,\n host,\n }),\n data: serializedData,\n };\n\n return metadata;\n }\n\n return __predict;\n}\n","import * as ambassadorWixAtlasV2Prediction from './atlas-v2-prediction-autocomplete.http.js';\nimport * as ambassadorWixAtlasV2PredictionTypes from './atlas-v2-prediction-autocomplete.types.js';\nimport * as ambassadorWixAtlasV2PredictionUniversalTypes from './atlas-v2-prediction-autocomplete.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function predict(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionTypes.PredictRequest,\n ambassadorWixAtlasV2PredictionUniversalTypes.PredictResponse,\n ambassadorWixAtlasV2PredictionTypes.PredictResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixAtlasV2Prediction.predict(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/predict',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBA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AAwB;AAAA,EAC1B;AACF;","names":["predict"]}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_atlas_autocomplete",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
+ "license": "MIT",
4
5
  "publishConfig": {
5
6
  "registry": "https://registry.npmjs.org/",
6
7
  "access": "public"
@@ -49,5 +50,5 @@
49
50
  "fqdn": "wix.atlas.v2.prediction"
50
51
  }
51
52
  },
52
- "falconPackageHash": "7550a587f8f91c35aeef1fbf5ae24fcc660b48d2036cc610f75d414e"
53
+ "falconPackageHash": "aac098c21f1b53bb1a784fd5f8054d26092388a175af101cdb08ed8a"
53
54
  }