atlas-obscura-api 3.1.0 → 3.1.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/fetchers/index.js CHANGED
@@ -6,16 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.fetchPage = void 0;
7
7
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
8
8
  const USER_AGENTS = [
9
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
10
- 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.77 Mobile/15E148 Safari/604.1',
11
- 'Mozilla/5.0 (Linux; Android 10; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36',
12
- 'Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36',
13
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15',
14
9
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0',
15
- 'Mozilla/5.0 (iPad; CPU OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1',
16
- 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
17
10
  'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0',
18
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
11
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; C6L Build/OPM2.171019.012)',
12
+ 'Mozilla/5.0 (Windows; Windows NT 10.0; x64) AppleWebKit/537.50 (KHTML, like Gecko) Chrome/48.0.2572.385 Safari/537.9 Edge/8.37913',
13
+ 'Mozilla/5.0 (Linux; Android 12; SM-A127F Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/96.0.4664.104 Mobile Safari/537.36 Instagram 243.0.0.16.111 Android (31/12; 300dpi; 720x1467; samsung; SM-A127F; a12s; exynos850; in_ID; 382290496)',
14
+ 'Mozilla/5.0 (Linux; Android 11; M2101K7BNY Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.70 Mobile Safari/537.36 [FB_IAB/Orca-Android;FBAV/369.0.0.7.111;]'
19
15
  ];
20
16
  const headers = {
21
17
  'User-Agent': USER_AGENTS[Math.floor(Math.random() * USER_AGENTS.length)],
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Coordinates, FetchOptions } from 'interfaces/global';
2
- import { Place, PlaceShort } from 'interfaces/placeId.interface';
3
- import { PlacesAll } from 'interfaces/places-all.interface';
1
+ import { Coordinates, FetchOptions } from './interfaces/global';
4
2
  import { LocationResult } from './interfaces/locations.interface';
3
+ import { Place, PlaceShort } from './interfaces/placeId.interface';
4
+ import { PlacesAll } from './interfaces/places-all.interface';
5
5
  import { PlacesScraper } from './services/location.service';
6
6
  export declare class AtlasObscura {
7
7
  private locationService;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "atlas-obscura-api",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Atlas Obscura API in JavaScript. NPM library for scrapping atlasobscura.com",
5
5
  "main": "./index.js",
6
6
  "author": "BART! <bart@bartweb.cz>",
7
7
  "scripts": {
8
8
  "start": "tsc -w",
9
9
  "prebuild": "rimraf dist",
10
- "build": "tsc",
11
- "postbuild": "npm-prepare-dist -s postinstall -s prepare",
10
+ "build": "tsc && npm-prepare-dist -s postinstall -s prepare",
12
11
  "tsc": "tsc",
13
12
  "demo": "tsx demo",
14
13
  "lint": "eslint ./src/**/**/* --fix",
15
14
  "test": "vitest",
15
+ "test:coverage": "yarn test run --coverage",
16
16
  "publish:next": "yarn && yarn build && yarn test --coverage && npm publish --folder dist --tag beta",
17
17
  "postversion": "git push && git push --follow-tags",
18
18
  "release:beta": "npm version preminor --preid=beta -m \"chore(update): prelease %s β\"",
@@ -52,6 +52,7 @@
52
52
  "lint-staged": {
53
53
  "*.ts": "eslint --cache --fix"
54
54
  },
55
+ "packageManager": "yarn@4.10.3",
55
56
  "module": "./index.js",
56
57
  "types": "./index.d.ts"
57
58
  }
@@ -1,7 +1,7 @@
1
- import { Coordinates, FetchOptions } from 'interfaces/global';
2
- import { LocationResult } from 'interfaces/locations.interface';
3
- import { PlaceExtend, PlaceShort } from 'interfaces/placeId.interface';
4
- import { PlacesAll } from 'interfaces/places-all.interface';
1
+ import { Coordinates, FetchOptions } from './../interfaces/global';
2
+ import { LocationResult } from './../interfaces/locations.interface';
3
+ import { PlaceExtend, PlaceShort } from './../interfaces/placeId.interface';
4
+ import { PlacesAll } from './../interfaces/places-all.interface';
5
5
  export declare class PlacesScraper {
6
6
  placesAll(options?: FetchOptions): Promise<PlacesAll[]>;
7
7
  search(coords: Coordinates, page?: number, options?: FetchOptions): Promise<LocationResult>;