@wix/auto_sdk_atlas_location 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/build/cjs/index.d.ts +18 -1
  2. package/build/cjs/index.js +262 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +148 -1
  5. package/build/cjs/index.typings.js +249 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +99 -1
  8. package/build/cjs/meta.js +193 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +18 -0
  11. package/build/es/index.mjs +238 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/atlas-v2-search-result-location.universal.d.ts → es/index.typings.d.mts} +27 -35
  14. package/build/es/index.typings.mjs +225 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/{internal/cjs/src/atlas-v2-search-result-location.types.d.ts → es/meta.d.mts} +32 -45
  17. package/build/es/meta.mjs +169 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +18 -1
  20. package/build/internal/cjs/index.js +262 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +148 -1
  23. package/build/internal/cjs/index.typings.js +249 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +99 -1
  26. package/build/internal/cjs/meta.js +193 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +18 -0
  29. package/build/internal/es/index.mjs +238 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/atlas-v2-search-result-location.universal.d.ts → index.typings.d.mts} +27 -35
  32. package/build/internal/es/index.typings.mjs +225 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/{es/src/atlas-v2-search-result-location.types.d.ts → internal/es/meta.d.mts} +32 -45
  35. package/build/internal/es/meta.mjs +169 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +11 -10
  38. package/build/cjs/src/atlas-v2-search-result-location.context.d.ts +0 -5
  39. package/build/cjs/src/atlas-v2-search-result-location.context.js +0 -11
  40. package/build/cjs/src/atlas-v2-search-result-location.context.js.map +0 -1
  41. package/build/cjs/src/atlas-v2-search-result-location.http.d.ts +0 -3
  42. package/build/cjs/src/atlas-v2-search-result-location.http.js +0 -144
  43. package/build/cjs/src/atlas-v2-search-result-location.http.js.map +0 -1
  44. package/build/cjs/src/atlas-v2-search-result-location.meta.d.ts +0 -13
  45. package/build/cjs/src/atlas-v2-search-result-location.meta.js +0 -47
  46. package/build/cjs/src/atlas-v2-search-result-location.meta.js.map +0 -1
  47. package/build/cjs/src/atlas-v2-search-result-location.public.d.ts +0 -13
  48. package/build/cjs/src/atlas-v2-search-result-location.public.js +0 -16
  49. package/build/cjs/src/atlas-v2-search-result-location.public.js.map +0 -1
  50. package/build/cjs/src/atlas-v2-search-result-location.types.d.ts +0 -112
  51. package/build/cjs/src/atlas-v2-search-result-location.types.js +0 -37
  52. package/build/cjs/src/atlas-v2-search-result-location.types.js.map +0 -1
  53. package/build/cjs/src/atlas-v2-search-result-location.universal.d.ts +0 -156
  54. package/build/cjs/src/atlas-v2-search-result-location.universal.js +0 -127
  55. package/build/cjs/src/atlas-v2-search-result-location.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/atlas-v2-search-result-location.context.d.ts +0 -5
  66. package/build/es/src/atlas-v2-search-result-location.context.js +0 -5
  67. package/build/es/src/atlas-v2-search-result-location.context.js.map +0 -1
  68. package/build/es/src/atlas-v2-search-result-location.http.d.ts +0 -3
  69. package/build/es/src/atlas-v2-search-result-location.http.js +0 -140
  70. package/build/es/src/atlas-v2-search-result-location.http.js.map +0 -1
  71. package/build/es/src/atlas-v2-search-result-location.meta.d.ts +0 -13
  72. package/build/es/src/atlas-v2-search-result-location.meta.js +0 -20
  73. package/build/es/src/atlas-v2-search-result-location.meta.js.map +0 -1
  74. package/build/es/src/atlas-v2-search-result-location.public.d.ts +0 -13
  75. package/build/es/src/atlas-v2-search-result-location.public.js +0 -9
  76. package/build/es/src/atlas-v2-search-result-location.public.js.map +0 -1
  77. package/build/es/src/atlas-v2-search-result-location.types.js +0 -34
  78. package/build/es/src/atlas-v2-search-result-location.types.js.map +0 -1
  79. package/build/es/src/atlas-v2-search-result-location.universal.d.ts +0 -156
  80. package/build/es/src/atlas-v2-search-result-location.universal.js +0 -100
  81. package/build/es/src/atlas-v2-search-result-location.universal.js.map +0 -1
  82. package/build/internal/cjs/src/atlas-v2-search-result-location.context.d.ts +0 -5
  83. package/build/internal/cjs/src/atlas-v2-search-result-location.context.js +0 -11
  84. package/build/internal/cjs/src/atlas-v2-search-result-location.context.js.map +0 -1
  85. package/build/internal/cjs/src/atlas-v2-search-result-location.http.d.ts +0 -3
  86. package/build/internal/cjs/src/atlas-v2-search-result-location.http.js +0 -144
  87. package/build/internal/cjs/src/atlas-v2-search-result-location.http.js.map +0 -1
  88. package/build/internal/cjs/src/atlas-v2-search-result-location.meta.d.ts +0 -13
  89. package/build/internal/cjs/src/atlas-v2-search-result-location.meta.js +0 -47
  90. package/build/internal/cjs/src/atlas-v2-search-result-location.meta.js.map +0 -1
  91. package/build/internal/cjs/src/atlas-v2-search-result-location.public.d.ts +0 -13
  92. package/build/internal/cjs/src/atlas-v2-search-result-location.public.js +0 -16
  93. package/build/internal/cjs/src/atlas-v2-search-result-location.public.js.map +0 -1
  94. package/build/internal/cjs/src/atlas-v2-search-result-location.types.js +0 -37
  95. package/build/internal/cjs/src/atlas-v2-search-result-location.types.js.map +0 -1
  96. package/build/internal/cjs/src/atlas-v2-search-result-location.universal.js +0 -127
  97. package/build/internal/cjs/src/atlas-v2-search-result-location.universal.js.map +0 -1
  98. package/build/internal/es/index.d.ts +0 -1
  99. package/build/internal/es/index.js +0 -2
  100. package/build/internal/es/index.js.map +0 -1
  101. package/build/internal/es/index.typings.d.ts +0 -1
  102. package/build/internal/es/index.typings.js +0 -2
  103. package/build/internal/es/index.typings.js.map +0 -1
  104. package/build/internal/es/meta.d.ts +0 -1
  105. package/build/internal/es/meta.js +0 -2
  106. package/build/internal/es/meta.js.map +0 -1
  107. package/build/internal/es/src/atlas-v2-search-result-location.context.d.ts +0 -5
  108. package/build/internal/es/src/atlas-v2-search-result-location.context.js +0 -5
  109. package/build/internal/es/src/atlas-v2-search-result-location.context.js.map +0 -1
  110. package/build/internal/es/src/atlas-v2-search-result-location.http.d.ts +0 -3
  111. package/build/internal/es/src/atlas-v2-search-result-location.http.js +0 -140
  112. package/build/internal/es/src/atlas-v2-search-result-location.http.js.map +0 -1
  113. package/build/internal/es/src/atlas-v2-search-result-location.meta.d.ts +0 -13
  114. package/build/internal/es/src/atlas-v2-search-result-location.meta.js +0 -20
  115. package/build/internal/es/src/atlas-v2-search-result-location.meta.js.map +0 -1
  116. package/build/internal/es/src/atlas-v2-search-result-location.public.d.ts +0 -13
  117. package/build/internal/es/src/atlas-v2-search-result-location.public.js +0 -9
  118. package/build/internal/es/src/atlas-v2-search-result-location.public.js.map +0 -1
  119. package/build/internal/es/src/atlas-v2-search-result-location.types.d.ts +0 -112
  120. package/build/internal/es/src/atlas-v2-search-result-location.types.js +0 -34
  121. package/build/internal/es/src/atlas-v2-search-result-location.types.js.map +0 -1
  122. package/build/internal/es/src/atlas-v2-search-result-location.universal.js +0 -100
  123. package/build/internal/es/src/atlas-v2-search-result-location.universal.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mFAAiE"}
1
+ {"version":3,"sources":["../../../index.ts","../../../src/atlas-v2-search-result-location.universal.ts","../../../src/atlas-v2-search-result-location.http.ts","../../../src/atlas-v2-search-result-location.public.ts","../../../src/atlas-v2-search-result-location.context.ts"],"sourcesContent":["export * from './src/atlas-v2-search-result-location.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 ambassadorWixAtlasV2SearchResult from './atlas-v2-search-result-location.http.js';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface SearchResult {\n /** The Address object */\n address?: Address;\n /** stores additional data about the proximity to the specified location */\n proximity?: ProximityWithLiterals;\n}\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine1?: string | null;\n /**\n * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */\n subdivision?: string | null;\n /** City name. */\n city?: string | null;\n /** Zip/postal code. */\n postalCode?: string | null;\n /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */\n addressLine2?: string | null;\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n /** Street number. */\n number?: string;\n /** Street name. */\n name?: string;\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Subdivision {\n /** Short subdivision code. */\n code?: string;\n /** Subdivision full name. */\n name?: string;\n}\n\nexport enum SubdivisionType {\n UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n /** State */\n ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n /** County */\n ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n /** City/town */\n ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n /** Neighborhood/quarter */\n ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n /** Street/block */\n ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n | SubdivisionType\n | 'UNKNOWN_SUBDIVISION_TYPE'\n | 'ADMINISTRATIVE_AREA_LEVEL_1'\n | 'ADMINISTRATIVE_AREA_LEVEL_2'\n | 'ADMINISTRATIVE_AREA_LEVEL_3'\n | 'ADMINISTRATIVE_AREA_LEVEL_4'\n | 'ADMINISTRATIVE_AREA_LEVEL_5'\n | 'COUNTRY';\n\nexport enum Proximity {\n UNKNOWN_PROXIMITY = 'UNKNOWN_PROXIMITY',\n /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */\n PINPOINT = 'PINPOINT',\n /** indicates that the returned result is the geometric center of a result */\n APPROXIMATE = 'APPROXIMATE',\n /** indicates that the returned result is around an area */\n GENERAL_AREA = 'GENERAL_AREA',\n}\n\n/** @enumType */\nexport type ProximityWithLiterals =\n | Proximity\n | 'UNKNOWN_PROXIMITY'\n | 'PINPOINT'\n | 'APPROXIMATE'\n | 'GENERAL_AREA';\n\n/** User must provide query or filter by parameters */\nexport interface SearchRequest {\n /** Free text */\n query?: string | null;\n /**\n * Deprecate! - Please use 'zipCode' and 'countryCodes' fields\n * @deprecated\n */\n filterBy?: FilterBy[];\n /** Zip code filter the user can add in order to get more accurate results */\n zipCode?: string | null;\n /** Country codes filter the user can add in order to get more accurate results */\n countryCodes?: string[];\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 SearchResponse {\n /** List of 'Address' objects */\n searchResults?: SearchResult[];\n}\n\nexport interface ReverseGeocodingRequest {\n /** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */\n addressLocation?: AddressLocation;\n}\n\nexport interface ReverseGeocodingResponse {\n searchResults?: SearchResult[];\n}\n\ntype SearchResultNonNullablePaths =\n | `address.streetAddress.number`\n | `address.streetAddress.name`\n | `proximity`;\n\n/**\n * A Search request takes a free text as an input and returns a list of 'Address' objects.\n * @public\n * @documentationMaturity preview\n * @permissionId WIX_ATLAS.SEARCH\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search\n */\nexport async function search(\n options?: SearchOptions\n): Promise<\n NonNullablePaths<\n SearchResponse,\n {\n [P in SearchResultNonNullablePaths]: `searchResults.${number}.${P}`;\n }[SearchResultNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: options?.query,\n filterBy: options?.filterBy,\n zipCode: options?.zipCode,\n countryCodes: options?.countryCodes,\n });\n\n const reqOpts = ambassadorWixAtlasV2SearchResult.search(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [{ path: 'searchResults.address' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n query: '$[0].query',\n filterBy: '$[0].filterBy',\n zipCode: '$[0].zipCode',\n countryCodes: '$[0].countryCodes',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchOptions {\n /** Free text */\n query?: string | null;\n /**\n * Deprecate! - Please use 'zipCode' and 'countryCodes' fields\n * @deprecated\n */\n filterBy?: FilterBy[];\n /** Zip code filter the user can add in order to get more accurate results */\n zipCode?: string | null;\n /** Country codes filter the user can add in order to get more accurate results */\n countryCodes?: string[];\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTFloatToSDKFloat } 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 resolveComWixpressViAtlasServiceV2LocationServiceV2Url(\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_location';\n\n/** A Search request takes a free text as an input and returns a list of 'Address' objects. */\nexport function search(payload: object): RequestOptionsFactory<any> {\n function __search({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.atlas.v2.search_result',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({\n protoPath: '/v2/search',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'searchResults.address.geocode.latitude' },\n { path: 'searchResults.address.geocode.longitude' },\n ],\n },\n ]),\n fallback: [\n {\n method: 'GET' as any,\n url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({\n protoPath: '/v2/search',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __search;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n SearchOptions,\n SearchResponse,\n search as universalSearch,\n} from './atlas-v2-search-result-location.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/atlas' };\n\ntype SearchResultNonNullablePaths =\n | `address.streetAddress.number`\n | `address.streetAddress.name`\n | `proximity`;\n\nexport function search(httpClient: HttpClient): SearchSignature {\n return (options?: SearchOptions) =>\n universalSearch(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SearchSignature {\n /**\n * A Search request takes a free text as an input and returns a list of 'Address' objects.\n */\n (options?: SearchOptions): Promise<\n NonNullablePaths<\n SearchResponse,\n {\n [P in SearchResultNonNullablePaths]: `searchResults.${number}.${P}`;\n }[SearchResultNonNullablePaths]\n >\n >;\n}\n\nexport {\n Address,\n AddressLocation,\n AddressStreetOneOf,\n FilterBy,\n FilterType,\n Proximity,\n ReverseGeocodingRequest,\n ReverseGeocodingResponse,\n SearchOptions,\n SearchRequest,\n SearchResponse,\n SearchResult,\n StreetAddress,\n Subdivision,\n SubdivisionType,\n} from './atlas-v2-search-result-location.universal.js';\n","import { search as publicSearch } from './atlas-v2-search-result-location.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const search: MaybeContext<\n BuildRESTFunction<typeof publicSearch> & typeof publicSearch\n> = /*#__PURE__*/ createRESTModule(publicSearch);\n\nexport {\n SubdivisionType,\n Proximity,\n FilterType,\n} from './atlas-v2-search-result-location.universal.js';\nexport {\n SearchResult,\n Address,\n AddressStreetOneOf,\n StreetAddress,\n AddressLocation,\n Subdivision,\n SearchRequest,\n FilterBy,\n SearchResponse,\n ReverseGeocodingRequest,\n ReverseGeocodingResponse,\n SearchOptions,\n} from './atlas-v2-search-result-location.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,mBAA6C;AAC7C,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uDACP,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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U;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,SAAS;AAAA,UACT,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvNO,SAASC,QAAO,YAAyC;AAC9D,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACpBA,IAAAC,uBAAiC;AAG1B,IAAMC,UAEK,2DAAiBA,OAAY;","names":["search","import_rest_modules","payload","import_transform_paths","SubdivisionType","Proximity","FilterType","search","sdkTransformError","search","import_rest_modules","search"]}
@@ -1 +1,148 @@
1
- export * from './src/atlas-v2-search-result-location.universal.js';
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface SearchResult {
4
+ /** The Address object */
5
+ address?: Address;
6
+ /** stores additional data about the proximity to the specified location */
7
+ proximity?: ProximityWithLiterals;
8
+ }
9
+ /** Physical address */
10
+ interface Address extends AddressStreetOneOf {
11
+ /** Street name and number. */
12
+ streetAddress?: StreetAddress;
13
+ /** Main address line, usually street and number as free text. */
14
+ addressLine1?: string | null;
15
+ /**
16
+ * Country code.
17
+ * @format COUNTRY
18
+ */
19
+ country?: string | null;
20
+ /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
21
+ subdivision?: string | null;
22
+ /** City name. */
23
+ city?: string | null;
24
+ /** Zip/postal code. */
25
+ postalCode?: string | null;
26
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
27
+ addressLine2?: string | null;
28
+ }
29
+ /** @oneof */
30
+ interface AddressStreetOneOf {
31
+ /** Street name and number. */
32
+ streetAddress?: StreetAddress;
33
+ /** Main address line, usually street and number as free text. */
34
+ addressLine?: string | null;
35
+ }
36
+ interface StreetAddress {
37
+ /** Street number. */
38
+ number?: string;
39
+ /** Street name. */
40
+ name?: string;
41
+ }
42
+ interface AddressLocation {
43
+ /** Address latitude. */
44
+ latitude?: number | null;
45
+ /** Address longitude. */
46
+ longitude?: number | null;
47
+ }
48
+ interface Subdivision {
49
+ /** Short subdivision code. */
50
+ code?: string;
51
+ /** Subdivision full name. */
52
+ name?: string;
53
+ }
54
+ declare enum SubdivisionType {
55
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
56
+ /** State */
57
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
58
+ /** County */
59
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
60
+ /** City/town */
61
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
62
+ /** Neighborhood/quarter */
63
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
64
+ /** Street/block */
65
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
66
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
67
+ COUNTRY = "COUNTRY"
68
+ }
69
+ /** @enumType */
70
+ type SubdivisionTypeWithLiterals = SubdivisionType | 'UNKNOWN_SUBDIVISION_TYPE' | 'ADMINISTRATIVE_AREA_LEVEL_1' | 'ADMINISTRATIVE_AREA_LEVEL_2' | 'ADMINISTRATIVE_AREA_LEVEL_3' | 'ADMINISTRATIVE_AREA_LEVEL_4' | 'ADMINISTRATIVE_AREA_LEVEL_5' | 'COUNTRY';
71
+ declare enum Proximity {
72
+ UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
73
+ /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
74
+ PINPOINT = "PINPOINT",
75
+ /** indicates that the returned result is the geometric center of a result */
76
+ APPROXIMATE = "APPROXIMATE",
77
+ /** indicates that the returned result is around an area */
78
+ GENERAL_AREA = "GENERAL_AREA"
79
+ }
80
+ /** @enumType */
81
+ type ProximityWithLiterals = Proximity | 'UNKNOWN_PROXIMITY' | 'PINPOINT' | 'APPROXIMATE' | 'GENERAL_AREA';
82
+ /** User must provide query or filter by parameters */
83
+ interface SearchRequest {
84
+ /** Free text */
85
+ query?: string | null;
86
+ /**
87
+ * Deprecate! - Please use 'zipCode' and 'countryCodes' fields
88
+ * @deprecated
89
+ */
90
+ filterBy?: FilterBy[];
91
+ /** Zip code filter the user can add in order to get more accurate results */
92
+ zipCode?: string | null;
93
+ /** Country codes filter the user can add in order to get more accurate results */
94
+ countryCodes?: string[];
95
+ }
96
+ interface FilterBy {
97
+ /** One of the filter types enum */
98
+ filterType?: FilterTypeWithLiterals;
99
+ /** Free text like "us" */
100
+ filterValue?: string;
101
+ }
102
+ declare enum FilterType {
103
+ /** Filter by zip code */
104
+ zip_code = "zip_code",
105
+ /** Filter by 2-letters or 3-letters country code */
106
+ country_code = "country_code"
107
+ }
108
+ /** @enumType */
109
+ type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';
110
+ interface SearchResponse {
111
+ /** List of 'Address' objects */
112
+ searchResults?: SearchResult[];
113
+ }
114
+ interface ReverseGeocodingRequest {
115
+ /** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */
116
+ addressLocation?: AddressLocation;
117
+ }
118
+ interface ReverseGeocodingResponse {
119
+ searchResults?: SearchResult[];
120
+ }
121
+ type SearchResultNonNullablePaths = `address.streetAddress.number` | `address.streetAddress.name` | `proximity`;
122
+ /**
123
+ * A Search request takes a free text as an input and returns a list of 'Address' objects.
124
+ * @public
125
+ * @documentationMaturity preview
126
+ * @permissionId WIX_ATLAS.SEARCH
127
+ * @applicableIdentity APP
128
+ * @applicableIdentity VISITOR
129
+ * @fqn com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search
130
+ */
131
+ declare function search(options?: SearchOptions): Promise<NonNullablePaths<SearchResponse, {
132
+ [P in SearchResultNonNullablePaths]: `searchResults.${number}.${P}`;
133
+ }[SearchResultNonNullablePaths]>>;
134
+ interface SearchOptions {
135
+ /** Free text */
136
+ query?: string | null;
137
+ /**
138
+ * Deprecate! - Please use 'zipCode' and 'countryCodes' fields
139
+ * @deprecated
140
+ */
141
+ filterBy?: FilterBy[];
142
+ /** Zip code filter the user can add in order to get more accurate results */
143
+ zipCode?: string | null;
144
+ /** Country codes filter the user can add in order to get more accurate results */
145
+ countryCodes?: string[];
146
+ }
147
+
148
+ export { type Address, type AddressLocation, type AddressStreetOneOf, type FilterBy, FilterType, type FilterTypeWithLiterals, Proximity, type ProximityWithLiterals, type ReverseGeocodingRequest, type ReverseGeocodingResponse, type SearchOptions, type SearchRequest, type SearchResponse, type SearchResult, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, search };
@@ -1,18 +1,252 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/atlas-v2-search-result-location.universal.js"), exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ FilterType: () => FilterType,
24
+ Proximity: () => Proximity,
25
+ SubdivisionType: () => SubdivisionType,
26
+ search: () => search2
27
+ });
28
+ module.exports = __toCommonJS(index_typings_exports);
29
+
30
+ // src/atlas-v2-search-result-location.universal.ts
31
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
32
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
33
+
34
+ // src/atlas-v2-search-result-location.http.ts
35
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
36
+ var import_float = require("@wix/sdk-runtime/transformations/float");
37
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
38
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
39
+ function resolveComWixpressViAtlasServiceV2LocationServiceV2Url(opts) {
40
+ const domainToMappings = {
41
+ "api._api_base_domain_": [
42
+ {
43
+ srcPath: "/wix-atlas-service-web",
44
+ destPath: ""
45
+ }
46
+ ],
47
+ "bo._base_domain_": [
48
+ {
49
+ srcPath: "/wix-atlas-service-web",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "wixbo.ai": [
54
+ {
55
+ srcPath: "/wix-atlas-service-web",
56
+ destPath: ""
57
+ }
58
+ ],
59
+ "wix-bo.com": [
60
+ {
61
+ srcPath: "/wix-atlas-service-web",
62
+ destPath: ""
63
+ }
64
+ ],
65
+ _: [
66
+ {
67
+ srcPath: "/api/wix-atlas-service-web",
68
+ destPath: ""
69
+ },
70
+ {
71
+ srcPath: "/_api/wix-atlas-service-web",
72
+ destPath: ""
73
+ }
74
+ ],
75
+ "www._base_domain_": [
76
+ {
77
+ srcPath: "/wix-atlas-service-web",
78
+ destPath: ""
79
+ },
80
+ {
81
+ srcPath: "/_api/wix-atlas-service-web",
82
+ destPath: ""
83
+ },
84
+ {
85
+ srcPath: "/api/wix-atlas-service-web",
86
+ destPath: ""
87
+ }
88
+ ],
89
+ "manage._base_domain_": [
90
+ {
91
+ srcPath: "/wix-atlas-service-web",
92
+ destPath: ""
93
+ }
94
+ ],
95
+ "editor._base_domain_": [
96
+ {
97
+ srcPath: "/wix-atlas-service-web",
98
+ destPath: ""
99
+ },
100
+ {
101
+ srcPath: "/api/wix-atlas-service-web",
102
+ destPath: ""
103
+ }
104
+ ],
105
+ "blocks._base_domain_": [
106
+ {
107
+ srcPath: "/wix-atlas-service-web",
108
+ destPath: ""
109
+ },
110
+ {
111
+ srcPath: "/api/wix-atlas-service-web",
112
+ destPath: ""
113
+ }
114
+ ],
115
+ "create.editorx": [
116
+ {
117
+ srcPath: "/wix-atlas-service-web",
118
+ destPath: ""
119
+ },
120
+ {
121
+ srcPath: "/api/wix-atlas-service-web",
122
+ destPath: ""
123
+ }
124
+ ],
125
+ "editor.wixapps.net": [
126
+ {
127
+ srcPath: "/api/wix-atlas-service-web",
128
+ destPath: ""
129
+ }
130
+ ],
131
+ "*.wixforms.com": [
132
+ {
133
+ srcPath: "/_api/wix-atlas-service-web",
134
+ destPath: ""
135
+ }
136
+ ]
137
+ };
138
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
139
+ }
140
+ var PACKAGE_NAME = "@wix/auto_sdk_atlas_location";
141
+ function search(payload) {
142
+ function __search({ host }) {
143
+ const metadata = {
144
+ entityFqdn: "wix.atlas.v2.search_result",
145
+ method: "GET",
146
+ methodFqn: "com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search",
147
+ packageName: PACKAGE_NAME,
148
+ url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({
149
+ protoPath: "/v2/search",
150
+ data: payload,
151
+ host
152
+ }),
153
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
154
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
155
+ {
156
+ transformFn: import_float.transformRESTFloatToSDKFloat,
157
+ paths: [
158
+ { path: "searchResults.address.geocode.latitude" },
159
+ { path: "searchResults.address.geocode.longitude" }
160
+ ]
161
+ }
162
+ ]),
163
+ fallback: [
164
+ {
165
+ method: "GET",
166
+ url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({
167
+ protoPath: "/v2/search",
168
+ data: payload,
169
+ host
170
+ }),
171
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
172
+ }
173
+ ]
174
+ };
175
+ return metadata;
176
+ }
177
+ return __search;
178
+ }
179
+
180
+ // src/atlas-v2-search-result-location.universal.ts
181
+ var import_address = require("@wix/sdk-runtime/transformations/address");
182
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
183
+ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
184
+ SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
185
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
186
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
187
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
188
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
189
+ SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
190
+ SubdivisionType2["COUNTRY"] = "COUNTRY";
191
+ return SubdivisionType2;
192
+ })(SubdivisionType || {});
193
+ var Proximity = /* @__PURE__ */ ((Proximity2) => {
194
+ Proximity2["UNKNOWN_PROXIMITY"] = "UNKNOWN_PROXIMITY";
195
+ Proximity2["PINPOINT"] = "PINPOINT";
196
+ Proximity2["APPROXIMATE"] = "APPROXIMATE";
197
+ Proximity2["GENERAL_AREA"] = "GENERAL_AREA";
198
+ return Proximity2;
199
+ })(Proximity || {});
200
+ var FilterType = /* @__PURE__ */ ((FilterType2) => {
201
+ FilterType2["zip_code"] = "zip_code";
202
+ FilterType2["country_code"] = "country_code";
203
+ return FilterType2;
204
+ })(FilterType || {});
205
+ async function search2(options) {
206
+ const { httpClient, sideEffects } = arguments[1];
207
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
208
+ query: options?.query,
209
+ filterBy: options?.filterBy,
210
+ zipCode: options?.zipCode,
211
+ countryCodes: options?.countryCodes
212
+ });
213
+ const reqOpts = search(payload);
214
+ sideEffects?.onSiteCall?.();
215
+ try {
216
+ const result = await httpClient.request(reqOpts);
217
+ sideEffects?.onSuccess?.(result);
218
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
219
+ (0, import_transform_paths2.transformPaths)(result.data, [
220
+ {
221
+ transformFn: import_address.transformRESTAddressToSDKAddress,
222
+ paths: [{ path: "searchResults.address" }]
223
+ }
224
+ ])
225
+ );
226
+ } catch (err) {
227
+ const transformedError = (0, import_transform_error.transformError)(
228
+ err,
229
+ {
230
+ spreadPathsToArguments: {},
231
+ explicitPathsToArguments: {
232
+ query: "$[0].query",
233
+ filterBy: "$[0].filterBy",
234
+ zipCode: "$[0].zipCode",
235
+ countryCodes: "$[0].countryCodes"
236
+ },
237
+ singleArgumentUnchanged: false
238
+ },
239
+ ["options"]
240
+ );
241
+ sideEffects?.onError?.(err);
242
+ throw transformedError;
243
+ }
244
+ }
245
+ // Annotate the CommonJS export names for ESM import in node:
246
+ 0 && (module.exports = {
247
+ FilterType,
248
+ Proximity,
249
+ SubdivisionType,
250
+ search
251
+ });
18
252
  //# sourceMappingURL=index.typings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qFAAmE"}
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/atlas-v2-search-result-location.universal.ts","../../../src/atlas-v2-search-result-location.http.ts"],"sourcesContent":["export * from './src/atlas-v2-search-result-location.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 ambassadorWixAtlasV2SearchResult from './atlas-v2-search-result-location.http.js';\nimport { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface SearchResult {\n /** The Address object */\n address?: Address;\n /** stores additional data about the proximity to the specified location */\n proximity?: ProximityWithLiterals;\n}\n\n/** Physical address */\nexport interface Address extends AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine1?: string | null;\n /**\n * Country code.\n * @format COUNTRY\n */\n country?: string | null;\n /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */\n subdivision?: string | null;\n /** City name. */\n city?: string | null;\n /** Zip/postal code. */\n postalCode?: string | null;\n /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */\n addressLine2?: string | null;\n}\n\n/** @oneof */\nexport interface AddressStreetOneOf {\n /** Street name and number. */\n streetAddress?: StreetAddress;\n /** Main address line, usually street and number as free text. */\n addressLine?: string | null;\n}\n\nexport interface StreetAddress {\n /** Street number. */\n number?: string;\n /** Street name. */\n name?: string;\n}\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Subdivision {\n /** Short subdivision code. */\n code?: string;\n /** Subdivision full name. */\n name?: string;\n}\n\nexport enum SubdivisionType {\n UNKNOWN_SUBDIVISION_TYPE = 'UNKNOWN_SUBDIVISION_TYPE',\n /** State */\n ADMINISTRATIVE_AREA_LEVEL_1 = 'ADMINISTRATIVE_AREA_LEVEL_1',\n /** County */\n ADMINISTRATIVE_AREA_LEVEL_2 = 'ADMINISTRATIVE_AREA_LEVEL_2',\n /** City/town */\n ADMINISTRATIVE_AREA_LEVEL_3 = 'ADMINISTRATIVE_AREA_LEVEL_3',\n /** Neighborhood/quarter */\n ADMINISTRATIVE_AREA_LEVEL_4 = 'ADMINISTRATIVE_AREA_LEVEL_4',\n /** Street/block */\n ADMINISTRATIVE_AREA_LEVEL_5 = 'ADMINISTRATIVE_AREA_LEVEL_5',\n /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */\n COUNTRY = 'COUNTRY',\n}\n\n/** @enumType */\nexport type SubdivisionTypeWithLiterals =\n | SubdivisionType\n | 'UNKNOWN_SUBDIVISION_TYPE'\n | 'ADMINISTRATIVE_AREA_LEVEL_1'\n | 'ADMINISTRATIVE_AREA_LEVEL_2'\n | 'ADMINISTRATIVE_AREA_LEVEL_3'\n | 'ADMINISTRATIVE_AREA_LEVEL_4'\n | 'ADMINISTRATIVE_AREA_LEVEL_5'\n | 'COUNTRY';\n\nexport enum Proximity {\n UNKNOWN_PROXIMITY = 'UNKNOWN_PROXIMITY',\n /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */\n PINPOINT = 'PINPOINT',\n /** indicates that the returned result is the geometric center of a result */\n APPROXIMATE = 'APPROXIMATE',\n /** indicates that the returned result is around an area */\n GENERAL_AREA = 'GENERAL_AREA',\n}\n\n/** @enumType */\nexport type ProximityWithLiterals =\n | Proximity\n | 'UNKNOWN_PROXIMITY'\n | 'PINPOINT'\n | 'APPROXIMATE'\n | 'GENERAL_AREA';\n\n/** User must provide query or filter by parameters */\nexport interface SearchRequest {\n /** Free text */\n query?: string | null;\n /**\n * Deprecate! - Please use 'zipCode' and 'countryCodes' fields\n * @deprecated\n */\n filterBy?: FilterBy[];\n /** Zip code filter the user can add in order to get more accurate results */\n zipCode?: string | null;\n /** Country codes filter the user can add in order to get more accurate results */\n countryCodes?: string[];\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 SearchResponse {\n /** List of 'Address' objects */\n searchResults?: SearchResult[];\n}\n\nexport interface ReverseGeocodingRequest {\n /** The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address. */\n addressLocation?: AddressLocation;\n}\n\nexport interface ReverseGeocodingResponse {\n searchResults?: SearchResult[];\n}\n\ntype SearchResultNonNullablePaths =\n | `address.streetAddress.number`\n | `address.streetAddress.name`\n | `proximity`;\n\n/**\n * A Search request takes a free text as an input and returns a list of 'Address' objects.\n * @public\n * @documentationMaturity preview\n * @permissionId WIX_ATLAS.SEARCH\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @fqn com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search\n */\nexport async function search(\n options?: SearchOptions\n): Promise<\n NonNullablePaths<\n SearchResponse,\n {\n [P in SearchResultNonNullablePaths]: `searchResults.${number}.${P}`;\n }[SearchResultNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: options?.query,\n filterBy: options?.filterBy,\n zipCode: options?.zipCode,\n countryCodes: options?.countryCodes,\n });\n\n const reqOpts = ambassadorWixAtlasV2SearchResult.search(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(\n transformPaths(result.data, [\n {\n transformFn: transformRESTAddressToSDKAddress,\n paths: [{ path: 'searchResults.address' }],\n },\n ])\n )!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n query: '$[0].query',\n filterBy: '$[0].filterBy',\n zipCode: '$[0].zipCode',\n countryCodes: '$[0].countryCodes',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SearchOptions {\n /** Free text */\n query?: string | null;\n /**\n * Deprecate! - Please use 'zipCode' and 'countryCodes' fields\n * @deprecated\n */\n filterBy?: FilterBy[];\n /** Zip code filter the user can add in order to get more accurate results */\n zipCode?: string | null;\n /** Country codes filter the user can add in order to get more accurate results */\n countryCodes?: string[];\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTFloatToSDKFloat } 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 resolveComWixpressViAtlasServiceV2LocationServiceV2Url(\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_location';\n\n/** A Search request takes a free text as an input and returns a list of 'Address' objects. */\nexport function search(payload: object): RequestOptionsFactory<any> {\n function __search({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.atlas.v2.search_result',\n method: 'GET' as any,\n methodFqn: 'com.wixpress.vi.atlas.service.v2.LocationServiceV2.Search',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({\n protoPath: '/v2/search',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'searchResults.address.geocode.latitude' },\n { path: 'searchResults.address.geocode.longitude' },\n ],\n },\n ]),\n fallback: [\n {\n method: 'GET' as any,\n url: resolveComWixpressViAtlasServiceV2LocationServiceV2Url({\n protoPath: '/v2/search',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __search;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,mBAA6C;AAC7C,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uDACP,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;AAA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,QAAM,UAA2C,OAAO,OAAO;AAE/D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO;AAAA,UACL,wCAAe,OAAO,MAAM;AAAA,QAC1B;AAAA,UACE,aAAa;AAAA,UACb,OAAO,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAAA,QAC3C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,SAAS;AAAA,UACT,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["search","import_rest_modules","payload","import_transform_paths","SubdivisionType","Proximity","FilterType","search","sdkTransformError"]}
@@ -1 +1,99 @@
1
- export * from './src/atlas-v2-search-result-location.meta.js';
1
+ import { SearchRequest as SearchRequest$1, SearchResponse as SearchResponse$1 } from './index.typings.js';
2
+ import '@wix/sdk-types';
3
+
4
+ interface SearchResult {
5
+ /** The Address object */
6
+ address?: Address;
7
+ /** stores additional data about the proximity to the specified location */
8
+ proximity?: ProximityWithLiterals;
9
+ }
10
+ /** Physical address */
11
+ interface Address extends AddressStreetOneOf {
12
+ /** Street name and number. */
13
+ streetAddress?: StreetAddress;
14
+ /** Main address line, usually street and number as free text. */
15
+ addressLine?: string | null;
16
+ /**
17
+ * Country code.
18
+ * @format COUNTRY
19
+ */
20
+ country?: string | null;
21
+ /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
22
+ subdivision?: string | null;
23
+ /** City name. */
24
+ city?: string | null;
25
+ /** Zip/postal code. */
26
+ postalCode?: string | null;
27
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
28
+ addressLine2?: string | null;
29
+ }
30
+ /** @oneof */
31
+ interface AddressStreetOneOf {
32
+ /** Street name and number. */
33
+ streetAddress?: StreetAddress;
34
+ /** Main address line, usually street and number as free text. */
35
+ addressLine?: string | null;
36
+ }
37
+ interface StreetAddress {
38
+ /** Street number. */
39
+ number?: string;
40
+ /** Street name. */
41
+ name?: string;
42
+ }
43
+ declare enum Proximity {
44
+ UNKNOWN_PROXIMITY = "UNKNOWN_PROXIMITY",
45
+ /** indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision */
46
+ PINPOINT = "PINPOINT",
47
+ /** indicates that the returned result is the geometric center of a result */
48
+ APPROXIMATE = "APPROXIMATE",
49
+ /** indicates that the returned result is around an area */
50
+ GENERAL_AREA = "GENERAL_AREA"
51
+ }
52
+ /** @enumType */
53
+ type ProximityWithLiterals = Proximity | 'UNKNOWN_PROXIMITY' | 'PINPOINT' | 'APPROXIMATE' | 'GENERAL_AREA';
54
+ /** User must provide query or filter by parameters */
55
+ interface SearchRequest {
56
+ /** Free text */
57
+ query?: string | null;
58
+ /**
59
+ * Deprecate! - Please use 'zipCode' and 'countryCodes' fields
60
+ * @deprecated
61
+ */
62
+ filterBy?: FilterBy[];
63
+ /** Zip code filter the user can add in order to get more accurate results */
64
+ zipCode?: string | null;
65
+ /** Country codes filter the user can add in order to get more accurate results */
66
+ countryCodes?: string[];
67
+ }
68
+ interface FilterBy {
69
+ /** One of the filter types enum */
70
+ filterType?: FilterTypeWithLiterals;
71
+ /** Free text like "us" */
72
+ filterValue?: string;
73
+ }
74
+ declare enum FilterType {
75
+ /** Filter by zip code */
76
+ zip_code = "zip_code",
77
+ /** Filter by 2-letters or 3-letters country code */
78
+ country_code = "country_code"
79
+ }
80
+ /** @enumType */
81
+ type FilterTypeWithLiterals = FilterType | 'zip_code' | 'country_code';
82
+ interface SearchResponse {
83
+ /** List of 'Address' objects */
84
+ searchResults?: SearchResult[];
85
+ }
86
+
87
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
88
+ getUrl: (context: any) => string;
89
+ httpMethod: K;
90
+ path: string;
91
+ pathParams: M;
92
+ __requestType: T;
93
+ __originalRequestType: S;
94
+ __responseType: Q;
95
+ __originalResponseType: R;
96
+ };
97
+ declare function search(): __PublicMethodMetaInfo<'GET', {}, SearchRequest$1, SearchRequest, SearchResponse$1, SearchResponse>;
98
+
99
+ export { type __PublicMethodMetaInfo, search };