@pretto/places 0.45.0 → 0.46.1

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.
package/README.md CHANGED
@@ -209,5 +209,4 @@ This library is based on the API of data.gouv.
209
209
  These data are quite precise and are regularly updated:
210
210
  ![title](https://adresse.data.gouv.fr/_next/image?url=%2Fimages%2Fdonnees-nationales%2Fschema-donnees-ban.svg&w=1080&q=75)
211
211
 
212
- - https://adresse.data.gouv.fr/
213
- - https://api.gouv.fr/
212
+ - [https://geo.api.gouv.fr/](https://geo.api.gouv.fr/)
@@ -1,6 +1,6 @@
1
- export declare const MUNICIPALITY_API_URL = "https://geo.api.gouv.fr/communes";
2
- export declare const DEPARTMENT_API_URL = "https://geo.api.gouv.fr/departements";
3
- export declare const ADDRESS_API_URL = "https://api-adresse.data.gouv.fr/search";
1
+ export declare const MUNICIPALITY_API_URL = "https://api-geo.production.pretto.fr/communes";
2
+ export declare const DEPARTMENT_API_URL = "https://api-geo.production.pretto.fr/departements";
3
+ export declare const ADDRESS_API_URL = "https://addok.production.pretto.fr/search";
4
4
  export declare const FIELDS = "&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre";
5
5
  export declare const BOOST = "&boost=population";
6
6
  export declare const TYPES = "&type=arrondissement-municipal,commune-actuelle";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,qCAAqC,CAAA;AACtE,eAAO,MAAM,kBAAkB,yCAAyC,CAAA;AACxE,eAAO,MAAM,eAAe,4CAA4C,CAAA;AAExE,eAAO,MAAM,MAAM,mEAAmE,CAAA;AACtF,eAAO,MAAM,KAAK,sBAAsB,CAAA;AACxC,eAAO,MAAM,KAAK,oDAAoD,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,kDAAkD,CAAA;AACnF,eAAO,MAAM,kBAAkB,sDAAsD,CAAA;AACrF,eAAO,MAAM,eAAe,8CAA8C,CAAA;AAE1E,eAAO,MAAM,MAAM,mEAAmE,CAAA;AACtF,eAAO,MAAM,KAAK,sBAAsB,CAAA;AACxC,eAAO,MAAM,KAAK,oDAAoD,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { CustomFetchOptions, LongLat, MunicipalitySearchResult } from './types';
2
- declare type SearchType = 'city' | 'zipcode' | 'coordinates';
3
- export declare const searchPlaces: (searchValue: string | LongLat, options?: CustomFetchOptions | undefined, searchType?: SearchType[]) => Promise<MunicipalitySearchResult[]>;
4
- export declare const searchDepartment: (searchValue: string, options?: CustomFetchOptions | undefined) => Promise<import("./types").DepartmentSearchResult[]>;
5
- export declare const searchAddress: (searchValue: string, options?: CustomFetchOptions | undefined) => Promise<import("./types").AddressSearchResult[]>;
2
+ type SearchType = 'city' | 'zipcode' | 'coordinates';
3
+ export declare const searchPlaces: (searchValue: string | LongLat, options?: CustomFetchOptions, searchType?: SearchType[]) => Promise<MunicipalitySearchResult[]>;
4
+ export declare const searchDepartment: (searchValue: string, options?: CustomFetchOptions) => Promise<import("./types").DepartmentSearchResult[]>;
5
+ export declare const searchAddress: (searchValue: string, options?: CustomFetchOptions) => Promise<import("./types").AddressSearchResult[]>;
6
6
  export * as searchCountry from './searchByCountry';
7
7
  /**
8
8
  * @deprecated Use searchPlaces instead
9
9
  */
10
- export declare const municipalitySearch: (searchValue: string | LongLat, options?: CustomFetchOptions | undefined, searchType?: SearchType[]) => Promise<MunicipalitySearchResult[]>;
10
+ export declare const municipalitySearch: (searchValue: string | LongLat, options?: CustomFetchOptions, searchType?: SearchType[]) => Promise<MunicipalitySearchResult[]>;
11
11
  /**
12
12
  * @deprecated Use searchPlaces instead
13
13
  */
14
- export declare const geolocSearch: (searchValue: string | LongLat, options?: CustomFetchOptions | undefined, searchType?: SearchType[]) => Promise<MunicipalitySearchResult[]>;
14
+ export declare const geolocSearch: (searchValue: string | LongLat, options?: CustomFetchOptions, searchType?: SearchType[]) => Promise<MunicipalitySearchResult[]>;
15
15
  /**
16
16
  * @deprecated Use searchByCoordinates instead
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEhF,aAAK,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAA;AAEpD,eAAO,MAAM,YAAY,gBACV,MAAM,GAAG,OAAO,yDAEjB,UAAU,EAAE,KACvB,QAAQ,wBAAwB,EAAE,CAmCpC,CAAA;AAED,eAAO,MAAM,gBAAgB,gBAAuB,MAAM,kGAWzD,CAAA;AAED,eAAO,MAAM,aAAa,gBAAuB,MAAM,+FAOtD,CAAA;AAED,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAA;AAIlD;;GAEG;AACH,eAAO,MAAM,kBAAkB,gBArEhB,MAAM,GAAG,OAAO,yDAEjB,UAAU,EAAE,KACvB,QAAQ,wBAAwB,EAAE,CAkES,CAAA;AAE9C;;GAEG;AACH,eAAO,MAAM,YAAY,gBA1EV,MAAM,GAAG,OAAO,yDAEjB,UAAU,EAAE,KACvB,QAAQ,wBAAwB,EAAE,CAuEG,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,mBAAmB,qHAAsB,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,aAAa,qHAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEhF,KAAK,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAA;AAEpD,eAAO,MAAM,YAAY,gBACV,MAAM,GAAG,OAAO,YACnB,kBAAkB,eAChB,UAAU,EAAE,KACvB,QAAQ,wBAAwB,EAAE,CAmCpC,CAAA;AAED,eAAO,MAAM,gBAAgB,gBAAuB,MAAM,YAAY,kBAAkB,wDAWvF,CAAA;AAED,eAAO,MAAM,aAAa,gBAAuB,MAAM,YAAY,kBAAkB,qDAOpF,CAAA;AAED,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAA;AAIlD;;GAEG;AACH,eAAO,MAAM,kBAAkB,gBArEhB,MAAM,GAAG,OAAO,YACnB,kBAAkB,eAChB,UAAU,EAAE,KACvB,QAAQ,wBAAwB,EAAE,CAkES,CAAA;AAE9C;;GAEG;AACH,eAAO,MAAM,YAAY,gBA1EV,MAAM,GAAG,OAAO,YACnB,kBAAkB,eAChB,UAAU,EAAE,KACvB,QAAQ,wBAAwB,EAAE,CAuEG,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,mBAAmB,qHAAsB,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,aAAa,qHAAkB,CAAA"}
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
8
8
 
9
9
  var algoliasearch__default = /*#__PURE__*/_interopDefaultLegacy(algoliasearch);
10
10
 
11
- /*! *****************************************************************************
11
+ /******************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
13
13
 
14
14
  Permission to use, copy, modify, and/or distribute this software for any
@@ -31,7 +31,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
31
31
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
32
  step((generator = generator.apply(thisArg, _arguments || [])).next());
33
33
  });
34
- }
34
+ }
35
+
36
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
37
+ var e = new Error(message);
38
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
39
+ };
35
40
 
36
41
  let controller = { current: null };
37
42
  const getSignal = () => {
@@ -42,9 +47,9 @@ const getSignal = () => {
42
47
  return controller.current.signal;
43
48
  };
44
49
 
45
- const MUNICIPALITY_API_URL = 'https://geo.api.gouv.fr/communes';
46
- const DEPARTMENT_API_URL = 'https://geo.api.gouv.fr/departements';
47
- const ADDRESS_API_URL = 'https://api-adresse.data.gouv.fr/search';
50
+ const MUNICIPALITY_API_URL = 'https://api-geo.production.pretto.fr/communes';
51
+ const DEPARTMENT_API_URL = 'https://api-geo.production.pretto.fr/departements';
52
+ const ADDRESS_API_URL = 'https://addok.production.pretto.fr/search';
48
53
  const FIELDS = '&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre';
49
54
  const BOOST = '&boost=population';
50
55
  const TYPES = '&type=arrondissement-municipal,commune-actuelle';
@@ -53,30 +58,9 @@ const DEFAULT_DEBOUNCE_TIME = 300;
53
58
  let getDelayedData = null;
54
59
  const fetchData = (url, signal) => __awaiter(void 0, void 0, void 0, function* () {
55
60
  try {
56
- const response = yield fetch(url, {
57
- signal,
58
- headers: {
59
- Accept: 'application/json',
60
- 'Content-Type': 'application/json',
61
- },
62
- mode: 'cors',
63
- credentials: 'same-origin',
64
- cache: 'no-cache',
65
- redirect: 'follow',
66
- referrerPolicy: 'no-referrer',
67
- });
68
- console.log('RESPONSE', response);
61
+ const response = yield fetch(url, { signal });
69
62
  if (!response.ok) {
70
- throw new Error(`Erreur HTTP: ${response.status} - ${response.statusText}`);
71
- }
72
- // Vérification des en-têtes de réponse
73
- const contentType = response.headers.get('content-type');
74
- if (contentType && contentType.includes('application/json')) {
75
- // Si c'est du JSON, on vérifie que les en-têtes CORS sont présents
76
- const corsHeaders = response.headers.get('access-control-allow-origin');
77
- if (!corsHeaders) {
78
- console.warn('Attention: En-têtes CORS manquants dans la réponse JSON');
79
- }
63
+ throw new Error('Error: ' + response.status);
80
64
  }
81
65
  return response;
82
66
  }
@@ -84,9 +68,6 @@ const fetchData = (url, signal) => __awaiter(void 0, void 0, void 0, function* (
84
68
  if (error instanceof DOMException && error.name === 'AbortError') {
85
69
  return new Promise(() => { });
86
70
  }
87
- if (error instanceof Error) {
88
- throw new Error(`Erreur lors de la requête: ${error.message}`);
89
- }
90
71
  throw error;
91
72
  }
92
73
  });
@@ -123,23 +104,31 @@ function customFetch(url, options) {
123
104
  const searchByAddress = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
124
105
  const url = `${ADDRESS_API_URL}/?q=${searchValue}&autocomplete=1&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
125
106
  const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
126
- const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
127
- const addressResult = yield addressResponse.json();
128
- const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
129
- return [
130
- ...acc,
131
- {
132
- label: `${properties.name} ${properties.postcode}, ${properties.city}`,
133
- value: {
134
- city: properties.city,
135
- country: 'fr',
136
- street: `${properties.name}`,
137
- zipcode: properties.postcode,
107
+ try {
108
+ const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
109
+ const addressResult = yield addressResponse.json();
110
+ const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
111
+ return [
112
+ ...acc,
113
+ {
114
+ label: `${properties.name} ${properties.postcode}, ${properties.city}`,
115
+ value: {
116
+ city: properties.city,
117
+ country: 'fr',
118
+ street: `${properties.name}`,
119
+ zipcode: properties.postcode,
120
+ },
138
121
  },
139
- },
140
- ];
141
- }, []);
142
- return formatAddressResult;
122
+ ];
123
+ }, []);
124
+ return formatAddressResult;
125
+ }
126
+ catch (error) {
127
+ if (error instanceof DOMException && error.name === 'AbortError') {
128
+ return [];
129
+ }
130
+ throw error;
131
+ }
143
132
  });
144
133
 
145
134
  const formatToMunicipalitySearchResult = (results) => {
@@ -172,28 +161,36 @@ const searchByCoordinates = ({ latitude, longitude }, options) => __awaiter(void
172
161
  });
173
162
 
174
163
  const searchByDepartment = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
175
- if (isNaN(parseInt(searchValue))) {
176
- const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
177
- const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
178
- const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
164
+ try {
165
+ if (isNaN(parseInt(searchValue))) {
166
+ const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
167
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
168
+ const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
169
+ const departmentResult = yield departmentResponse.json();
170
+ return departmentResult.map(result => ({
171
+ label: `${result.nom} (${result.code})`,
172
+ value: {
173
+ code: result.code,
174
+ codeRegion: result.codeRegion,
175
+ country: 'fr',
176
+ region: result.region,
177
+ },
178
+ }));
179
+ }
180
+ const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
181
+ const departmentResponse = yield customFetch(codeDepartmentUrl, options);
179
182
  const departmentResult = yield departmentResponse.json();
180
- return departmentResult.map(result => ({
181
- label: `${result.nom} (${result.code})`,
182
- value: {
183
- code: result.code,
184
- codeRegion: result.codeRegion,
185
- country: 'fr',
186
- region: result.region,
187
- },
188
- }));
183
+ if ('nom' in departmentResult) {
184
+ return searchByDepartment(departmentResult.nom, options);
185
+ }
186
+ return [];
189
187
  }
190
- const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
191
- const departmentResponse = yield customFetch(codeDepartmentUrl, options);
192
- const departmentResult = yield departmentResponse.json();
193
- if ('nom' in departmentResult) {
194
- return searchByDepartment(departmentResult.nom, options);
188
+ catch (error) {
189
+ if (error instanceof DOMException && error.name === 'AbortError') {
190
+ return [];
191
+ }
192
+ throw error;
195
193
  }
196
- return [];
197
194
  });
198
195
 
199
196
  function isStartsWith(arr, value) {
@@ -219,40 +216,56 @@ const searchByMunicipality = (searchValue, options) => __awaiter(void 0, void 0,
219
216
  CURRENT_RESULT = [];
220
217
  const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}${FIELDS}${BOOST}&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
221
218
  const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
222
- const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
223
- const cityResult = yield cityResponse.json();
224
- // The first result is Paris, Lyon or Marseille, we want get all arrondissements
225
- if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
226
- const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
227
- const arrondissementsResponse = yield customFetch(url);
228
- const arrondissementsResult = yield arrondissementsResponse.json();
229
- const filtredAndSortArrondissementsResult = arrondissementsResult
230
- .reduce((acc, item) => {
231
- if (['75056', '13055', '69123'].includes(item.code))
232
- return acc;
233
- return [
234
- ...acc,
235
- Object.assign(Object.assign({}, item), { codesPostaux: [item.codesPostaux[0]] }),
236
- ];
237
- }, [])
238
- .sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
239
- CURRENT_RESULT = filtredAndSortArrondissementsResult;
240
- if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
241
- const filtredCurrentResult = filterOnCurrentResult(searchValue);
242
- return formatToMunicipalitySearchResult(filtredCurrentResult);
219
+ try {
220
+ const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
221
+ const cityResult = yield cityResponse.json();
222
+ // The first result is Paris, Lyon or Marseille, we want get all arrondissements
223
+ if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
224
+ const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
225
+ const arrondissementsResponse = yield customFetch(url);
226
+ const arrondissementsResult = yield arrondissementsResponse.json();
227
+ const filtredAndSortArrondissementsResult = arrondissementsResult
228
+ .reduce((acc, item) => {
229
+ if (['75056', '13055', '69123'].includes(item.code))
230
+ return acc;
231
+ return [
232
+ ...acc,
233
+ Object.assign(Object.assign({}, item), { codesPostaux: [item.codesPostaux[0]] }),
234
+ ];
235
+ }, [])
236
+ .sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
237
+ CURRENT_RESULT = filtredAndSortArrondissementsResult;
238
+ if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
239
+ const filtredCurrentResult = filterOnCurrentResult(searchValue);
240
+ return formatToMunicipalitySearchResult(filtredCurrentResult);
241
+ }
242
+ return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
243
243
  }
244
- return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
244
+ return formatToMunicipalitySearchResult(filterCityResults(cityResult));
245
+ }
246
+ catch (error) {
247
+ if (error instanceof DOMException && error.name === 'AbortError') {
248
+ return [];
249
+ }
250
+ throw error;
245
251
  }
246
- return formatToMunicipalitySearchResult(filterCityResults(cityResult));
247
252
  });
248
253
 
249
254
  const searchByZipcode = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
250
255
  const url = `${MUNICIPALITY_API_URL}?codePostal=${searchValue}${FIELDS}${BOOST}${TYPES}`;
251
256
  const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
252
- const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
253
- const zipCodeResult = yield zipCodeResponse.json();
254
- const filtredZipCodeResult = zipCodeResult.filter(item => !['75056', '13055', '69123'].includes(item.code));
255
- return formatToMunicipalitySearchResult(filtredZipCodeResult);
257
+ try {
258
+ const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
259
+ const zipCodeResult = yield zipCodeResponse.json();
260
+ const filtredZipCodeResult = zipCodeResult.filter(item => !['75056', '13055', '69123'].includes(item.code));
261
+ return formatToMunicipalitySearchResult(filtredZipCodeResult);
262
+ }
263
+ catch (error) {
264
+ if (error instanceof DOMException && error.name === 'AbortError') {
265
+ return [];
266
+ }
267
+ throw error;
268
+ }
256
269
  });
257
270
 
258
271
  const convertFirstLetterToUpperCase = (str) => {
@@ -279,8 +292,7 @@ const get = (instance, search, options) => __awaiter(void 0, void 0, void 0, fun
279
292
  return acc;
280
293
  const formatCountryName = convertFirstLetterToUpperCase(libcog.includes('(') ? libenr : libcog);
281
294
  const formatCog = !cog.includes('X') ? `(${cog})` : '';
282
- const label = `${formatCountryName} ${formatCog}`;
283
- return [...acc, { label, value: codeiso2.toLowerCase() }];
295
+ return [...acc, { label: formatCountryName, value: codeiso2.toLowerCase(), cog: formatCog }];
284
296
  }, []);
285
297
  });
286
298
  const init = (appId, apiKey, options) => {
@@ -1 +1 @@
1
- {"version":3,"file":"customFetch.d.ts","sourceRoot":"","sources":["../../src/lib/customFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAkD9C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAC3G,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"customFetch.d.ts","sourceRoot":"","sources":["../../src/lib/customFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAwB9C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAC3G,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA"}
package/dist/module.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import algoliasearch from 'algoliasearch';
2
2
 
3
- /*! *****************************************************************************
3
+ /******************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
5
5
 
6
6
  Permission to use, copy, modify, and/or distribute this software for any
@@ -23,7 +23,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
23
23
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
24
24
  step((generator = generator.apply(thisArg, _arguments || [])).next());
25
25
  });
26
- }
26
+ }
27
+
28
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
29
+ var e = new Error(message);
30
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
31
+ };
27
32
 
28
33
  let controller = { current: null };
29
34
  const getSignal = () => {
@@ -34,9 +39,9 @@ const getSignal = () => {
34
39
  return controller.current.signal;
35
40
  };
36
41
 
37
- const MUNICIPALITY_API_URL = 'https://geo.api.gouv.fr/communes';
38
- const DEPARTMENT_API_URL = 'https://geo.api.gouv.fr/departements';
39
- const ADDRESS_API_URL = 'https://api-adresse.data.gouv.fr/search';
42
+ const MUNICIPALITY_API_URL = 'https://api-geo.production.pretto.fr/communes';
43
+ const DEPARTMENT_API_URL = 'https://api-geo.production.pretto.fr/departements';
44
+ const ADDRESS_API_URL = 'https://addok.production.pretto.fr/search';
40
45
  const FIELDS = '&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre';
41
46
  const BOOST = '&boost=population';
42
47
  const TYPES = '&type=arrondissement-municipal,commune-actuelle';
@@ -45,30 +50,9 @@ const DEFAULT_DEBOUNCE_TIME = 300;
45
50
  let getDelayedData = null;
46
51
  const fetchData = (url, signal) => __awaiter(void 0, void 0, void 0, function* () {
47
52
  try {
48
- const response = yield fetch(url, {
49
- signal,
50
- headers: {
51
- Accept: 'application/json',
52
- 'Content-Type': 'application/json',
53
- },
54
- mode: 'cors',
55
- credentials: 'same-origin',
56
- cache: 'no-cache',
57
- redirect: 'follow',
58
- referrerPolicy: 'no-referrer',
59
- });
60
- console.log('RESPONSE', response);
53
+ const response = yield fetch(url, { signal });
61
54
  if (!response.ok) {
62
- throw new Error(`Erreur HTTP: ${response.status} - ${response.statusText}`);
63
- }
64
- // Vérification des en-têtes de réponse
65
- const contentType = response.headers.get('content-type');
66
- if (contentType && contentType.includes('application/json')) {
67
- // Si c'est du JSON, on vérifie que les en-têtes CORS sont présents
68
- const corsHeaders = response.headers.get('access-control-allow-origin');
69
- if (!corsHeaders) {
70
- console.warn('Attention: En-têtes CORS manquants dans la réponse JSON');
71
- }
55
+ throw new Error('Error: ' + response.status);
72
56
  }
73
57
  return response;
74
58
  }
@@ -76,9 +60,6 @@ const fetchData = (url, signal) => __awaiter(void 0, void 0, void 0, function* (
76
60
  if (error instanceof DOMException && error.name === 'AbortError') {
77
61
  return new Promise(() => { });
78
62
  }
79
- if (error instanceof Error) {
80
- throw new Error(`Erreur lors de la requête: ${error.message}`);
81
- }
82
63
  throw error;
83
64
  }
84
65
  });
@@ -115,23 +96,31 @@ function customFetch(url, options) {
115
96
  const searchByAddress = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
116
97
  const url = `${ADDRESS_API_URL}/?q=${searchValue}&autocomplete=1&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
117
98
  const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
118
- const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
119
- const addressResult = yield addressResponse.json();
120
- const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
121
- return [
122
- ...acc,
123
- {
124
- label: `${properties.name} ${properties.postcode}, ${properties.city}`,
125
- value: {
126
- city: properties.city,
127
- country: 'fr',
128
- street: `${properties.name}`,
129
- zipcode: properties.postcode,
99
+ try {
100
+ const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
101
+ const addressResult = yield addressResponse.json();
102
+ const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
103
+ return [
104
+ ...acc,
105
+ {
106
+ label: `${properties.name} ${properties.postcode}, ${properties.city}`,
107
+ value: {
108
+ city: properties.city,
109
+ country: 'fr',
110
+ street: `${properties.name}`,
111
+ zipcode: properties.postcode,
112
+ },
130
113
  },
131
- },
132
- ];
133
- }, []);
134
- return formatAddressResult;
114
+ ];
115
+ }, []);
116
+ return formatAddressResult;
117
+ }
118
+ catch (error) {
119
+ if (error instanceof DOMException && error.name === 'AbortError') {
120
+ return [];
121
+ }
122
+ throw error;
123
+ }
135
124
  });
136
125
 
137
126
  const formatToMunicipalitySearchResult = (results) => {
@@ -164,28 +153,36 @@ const searchByCoordinates = ({ latitude, longitude }, options) => __awaiter(void
164
153
  });
165
154
 
166
155
  const searchByDepartment = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
167
- if (isNaN(parseInt(searchValue))) {
168
- const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
169
- const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
170
- const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
156
+ try {
157
+ if (isNaN(parseInt(searchValue))) {
158
+ const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
159
+ const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
160
+ const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
161
+ const departmentResult = yield departmentResponse.json();
162
+ return departmentResult.map(result => ({
163
+ label: `${result.nom} (${result.code})`,
164
+ value: {
165
+ code: result.code,
166
+ codeRegion: result.codeRegion,
167
+ country: 'fr',
168
+ region: result.region,
169
+ },
170
+ }));
171
+ }
172
+ const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
173
+ const departmentResponse = yield customFetch(codeDepartmentUrl, options);
171
174
  const departmentResult = yield departmentResponse.json();
172
- return departmentResult.map(result => ({
173
- label: `${result.nom} (${result.code})`,
174
- value: {
175
- code: result.code,
176
- codeRegion: result.codeRegion,
177
- country: 'fr',
178
- region: result.region,
179
- },
180
- }));
175
+ if ('nom' in departmentResult) {
176
+ return searchByDepartment(departmentResult.nom, options);
177
+ }
178
+ return [];
181
179
  }
182
- const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
183
- const departmentResponse = yield customFetch(codeDepartmentUrl, options);
184
- const departmentResult = yield departmentResponse.json();
185
- if ('nom' in departmentResult) {
186
- return searchByDepartment(departmentResult.nom, options);
180
+ catch (error) {
181
+ if (error instanceof DOMException && error.name === 'AbortError') {
182
+ return [];
183
+ }
184
+ throw error;
187
185
  }
188
- return [];
189
186
  });
190
187
 
191
188
  function isStartsWith(arr, value) {
@@ -211,40 +208,56 @@ const searchByMunicipality = (searchValue, options) => __awaiter(void 0, void 0,
211
208
  CURRENT_RESULT = [];
212
209
  const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}${FIELDS}${BOOST}&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
213
210
  const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
214
- const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
215
- const cityResult = yield cityResponse.json();
216
- // The first result is Paris, Lyon or Marseille, we want get all arrondissements
217
- if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
218
- const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
219
- const arrondissementsResponse = yield customFetch(url);
220
- const arrondissementsResult = yield arrondissementsResponse.json();
221
- const filtredAndSortArrondissementsResult = arrondissementsResult
222
- .reduce((acc, item) => {
223
- if (['75056', '13055', '69123'].includes(item.code))
224
- return acc;
225
- return [
226
- ...acc,
227
- Object.assign(Object.assign({}, item), { codesPostaux: [item.codesPostaux[0]] }),
228
- ];
229
- }, [])
230
- .sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
231
- CURRENT_RESULT = filtredAndSortArrondissementsResult;
232
- if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
233
- const filtredCurrentResult = filterOnCurrentResult(searchValue);
234
- return formatToMunicipalitySearchResult(filtredCurrentResult);
211
+ try {
212
+ const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
213
+ const cityResult = yield cityResponse.json();
214
+ // The first result is Paris, Lyon or Marseille, we want get all arrondissements
215
+ if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
216
+ const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
217
+ const arrondissementsResponse = yield customFetch(url);
218
+ const arrondissementsResult = yield arrondissementsResponse.json();
219
+ const filtredAndSortArrondissementsResult = arrondissementsResult
220
+ .reduce((acc, item) => {
221
+ if (['75056', '13055', '69123'].includes(item.code))
222
+ return acc;
223
+ return [
224
+ ...acc,
225
+ Object.assign(Object.assign({}, item), { codesPostaux: [item.codesPostaux[0]] }),
226
+ ];
227
+ }, [])
228
+ .sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
229
+ CURRENT_RESULT = filtredAndSortArrondissementsResult;
230
+ if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
231
+ const filtredCurrentResult = filterOnCurrentResult(searchValue);
232
+ return formatToMunicipalitySearchResult(filtredCurrentResult);
233
+ }
234
+ return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
235
235
  }
236
- return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
236
+ return formatToMunicipalitySearchResult(filterCityResults(cityResult));
237
+ }
238
+ catch (error) {
239
+ if (error instanceof DOMException && error.name === 'AbortError') {
240
+ return [];
241
+ }
242
+ throw error;
237
243
  }
238
- return formatToMunicipalitySearchResult(filterCityResults(cityResult));
239
244
  });
240
245
 
241
246
  const searchByZipcode = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
242
247
  const url = `${MUNICIPALITY_API_URL}?codePostal=${searchValue}${FIELDS}${BOOST}${TYPES}`;
243
248
  const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
244
- const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
245
- const zipCodeResult = yield zipCodeResponse.json();
246
- const filtredZipCodeResult = zipCodeResult.filter(item => !['75056', '13055', '69123'].includes(item.code));
247
- return formatToMunicipalitySearchResult(filtredZipCodeResult);
249
+ try {
250
+ const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
251
+ const zipCodeResult = yield zipCodeResponse.json();
252
+ const filtredZipCodeResult = zipCodeResult.filter(item => !['75056', '13055', '69123'].includes(item.code));
253
+ return formatToMunicipalitySearchResult(filtredZipCodeResult);
254
+ }
255
+ catch (error) {
256
+ if (error instanceof DOMException && error.name === 'AbortError') {
257
+ return [];
258
+ }
259
+ throw error;
260
+ }
248
261
  });
249
262
 
250
263
  const convertFirstLetterToUpperCase = (str) => {
@@ -271,8 +284,7 @@ const get = (instance, search, options) => __awaiter(void 0, void 0, void 0, fun
271
284
  return acc;
272
285
  const formatCountryName = convertFirstLetterToUpperCase(libcog.includes('(') ? libenr : libcog);
273
286
  const formatCog = !cog.includes('X') ? `(${cog})` : '';
274
- const label = `${formatCountryName} ${formatCog}`;
275
- return [...acc, { label, value: codeiso2.toLowerCase() }];
287
+ return [...acc, { label: formatCountryName, value: codeiso2.toLowerCase(), cog: formatCog }];
276
288
  }, []);
277
289
  });
278
290
  const init = (appId, apiKey, options) => {
@@ -1,3 +1,3 @@
1
1
  import { AddressSearchResult, CustomFetchOptions } from './types';
2
- export declare const searchByAddress: (searchValue: string, options?: CustomFetchOptions | undefined) => Promise<AddressSearchResult[]>;
2
+ export declare const searchByAddress: (searchValue: string, options?: CustomFetchOptions) => Promise<AddressSearchResult[]>;
3
3
  //# sourceMappingURL=searchByAddress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchByAddress.d.ts","sourceRoot":"","sources":["../src/searchByAddress.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAalE,eAAO,MAAM,eAAe,gBACb,MAAM,+CAElB,QAAQ,mBAAmB,EAAE,CAuB/B,CAAA"}
1
+ {"version":3,"file":"searchByAddress.d.ts","sourceRoot":"","sources":["../src/searchByAddress.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAalE,eAAO,MAAM,eAAe,gBACb,MAAM,YACT,kBAAkB,KAC3B,QAAQ,mBAAmB,EAAE,CA8B/B,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { CustomFetchOptions, LongLat, MunicipalitySearchResult } from './types';
2
- export declare const searchByCoordinates: ({ latitude, longitude }: LongLat, options?: CustomFetchOptions | undefined) => Promise<MunicipalitySearchResult[]>;
2
+ export declare const searchByCoordinates: ({ latitude, longitude }: LongLat, options?: CustomFetchOptions) => Promise<MunicipalitySearchResult[]>;
3
3
  //# sourceMappingURL=searchByCoordinates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchByCoordinates.d.ts","sourceRoot":"","sources":["../src/searchByCoordinates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAgB,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE9F,eAAO,MAAM,mBAAmB,4BACL,OAAO,+CAE/B,QAAQ,wBAAwB,EAAE,CAiBpC,CAAA"}
1
+ {"version":3,"file":"searchByCoordinates.d.ts","sourceRoot":"","sources":["../src/searchByCoordinates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAgB,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE9F,eAAO,MAAM,mBAAmB,4BACL,OAAO,YACtB,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,CAiBpC,CAAA"}
@@ -4,8 +4,8 @@ interface Options {
4
4
  limit?: number;
5
5
  language?: 'fr' | 'en';
6
6
  }
7
- export declare const init: (appId: string, apiKey: string, options?: AlgoliaSearchOptions | undefined) => "An error occurred." | {
8
- get(search: string, options?: Options | undefined): Promise<CountriesSearchResult[]>;
7
+ export declare const init: (appId: string, apiKey: string, options?: AlgoliaSearchOptions) => "An error occurred." | {
8
+ get(search: string, options?: Options): Promise<CountriesSearchResult[]>;
9
9
  };
10
10
  export {};
11
11
  //# sourceMappingURL=searchByCountry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchByCountry.d.ts","sourceRoot":"","sources":["../src/searchByCountry.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,oBAAoB,EAAgB,MAAM,eAAe,CAAC;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAShD,UAAU,OAAO;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACvB;AAyBD,eAAO,MAAM,IAAI,UAAW,MAAM,UAAU,MAAM;gBAK1B,MAAM;CAS7B,CAAA"}
1
+ {"version":3,"file":"searchByCountry.d.ts","sourceRoot":"","sources":["../src/searchByCountry.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,oBAAoB,EAAgB,MAAM,eAAe,CAAA;AAGjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAS/C,UAAU,OAAO;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACvB;AAwBD,eAAO,MAAM,IAAI,UAAW,MAAM,UAAU,MAAM,YAAY,oBAAoB;gBAK1D,MAAM,YAAY,OAAO;CAShD,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { CustomFetchOptions, DepartmentSearchResult } from './types';
2
- export declare const searchByDepartment: (searchValue: string, options?: CustomFetchOptions | undefined) => Promise<DepartmentSearchResult[]>;
2
+ export declare const searchByDepartment: (searchValue: string, options?: CustomFetchOptions) => Promise<DepartmentSearchResult[]>;
3
3
  //# sourceMappingURL=searchByDepartment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchByDepartment.d.ts","sourceRoot":"","sources":["../src/searchByDepartment.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,kBAAkB,EAAE,sBAAsB,EAC7C,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,gBAChB,MAAM,+CAElB,QAAQ,sBAAsB,EAAE,CA4BlC,CAAA"}
1
+ {"version":3,"file":"searchByDepartment.d.ts","sourceRoot":"","sources":["../src/searchByDepartment.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,kBAAkB,EAAE,sBAAsB,EAC7C,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,gBAChB,MAAM,YACT,kBAAkB,KAC3B,QAAQ,sBAAsB,EAAE,CAmClC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { CustomFetchOptions, MunicipalitySearchResult } from './types';
2
- export declare const searchByMunicipality: (searchValue: string, options?: CustomFetchOptions | undefined) => Promise<MunicipalitySearchResult[]>;
2
+ export declare const searchByMunicipality: (searchValue: string, options?: CustomFetchOptions) => Promise<MunicipalitySearchResult[]>;
3
3
  //# sourceMappingURL=searchByMunicipality.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchByMunicipality.d.ts","sourceRoot":"","sources":["../src/searchByMunicipality.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAoBrF,eAAO,MAAM,oBAAoB,gBAClB,MAAM,+CAElB,QAAQ,wBAAwB,EAAE,CA+CpC,CAAA"}
1
+ {"version":3,"file":"searchByMunicipality.d.ts","sourceRoot":"","sources":["../src/searchByMunicipality.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAoBrF,eAAO,MAAM,oBAAoB,gBAClB,MAAM,YACT,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,CAsDpC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { CustomFetchOptions, MunicipalitySearchResult } from './types';
2
- export declare const searchByZipcode: (searchValue: string, options?: CustomFetchOptions | undefined) => Promise<MunicipalitySearchResult[]>;
2
+ export declare const searchByZipcode: (searchValue: string, options?: CustomFetchOptions) => Promise<MunicipalitySearchResult[]>;
3
3
  //# sourceMappingURL=searchByZipcode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchByZipcode.d.ts","sourceRoot":"","sources":["../src/searchByZipcode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAErF,eAAO,MAAM,eAAe,gBACb,MAAM,+CAElB,QAAQ,wBAAwB,EAAE,CAUpC,CAAA"}
1
+ {"version":3,"file":"searchByZipcode.d.ts","sourceRoot":"","sources":["../src/searchByZipcode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAErF,eAAO,MAAM,eAAe,gBACb,MAAM,YACT,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,CAiBpC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretto/places",
3
- "version": "0.45.0",
3
+ "version": "0.46.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -16,7 +16,6 @@
16
16
  "dist/**/*"
17
17
  ],
18
18
  "dependencies": {
19
- "@pretto/places": "^0.43.0",
20
19
  "@types/algoliasearch": "^4.0.0",
21
20
  "algoliasearch": "4.22.1",
22
21
  "array.prototype.flat": "^1.3.0",