discogs-marketplace-api-nodejs 1.16.6 → 1.16.8

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import search from './search.js';
2
- import type { SearchParams } from './interfaces/search-params.interface.js';
3
- import type SearchResult from './interfaces/search-result.interface.js';
1
+ import search from 'search';
2
+ import type { SearchParams } from 'interfaces/search-params.interface';
3
+ import type SearchResult from 'interfaces/search-result.interface';
4
4
  /**
5
5
  * Discogs Marketplace API, tools for interacting with the Discogs Marketplace.
6
6
  * @see {@link https://github.com/KirianCaumes/Discogs-Marketplace-API-NodeJS GitHub Repository}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DiscogsMarketplace = void 0;
7
- const search_1 = __importDefault(require("./search.js"));
7
+ const search_1 = __importDefault(require("search"));
8
8
  /**
9
9
  * Discogs Marketplace API, tools for interacting with the Discogs Marketplace.
10
10
  * @see {@link https://github.com/KirianCaumes/Discogs-Marketplace-API-NodeJS GitHub Repository}
@@ -1,14 +1,14 @@
1
- import type { Condition } from '../types/condition.type.js';
2
- import type { Currency } from '../types/currency.type.js';
3
- import type { FormatDescription } from '../types/format-description.type.js';
4
- import type { Format } from '../types/format.type.js';
5
- import type { From } from '../types/from.type.js';
6
- import type { Genre } from '../types/genre.type.js';
7
- import type { Lang } from '../types/lang.type.js';
8
- import type { Limit } from '../types/limit.type.js';
9
- import type { Api } from '../types/api.type.js';
10
- import type { Sort } from '../types/sort.type.js';
11
- import type { Style } from '../types/style.type.js';
1
+ import type { Condition } from 'types/condition.type';
2
+ import type { Currency } from 'types/currency.type';
3
+ import type { FormatDescription } from 'types/format-description.type';
4
+ import type { Format } from 'types/format.type';
5
+ import type { From } from 'types/from.type';
6
+ import type { Genre } from 'types/genre.type';
7
+ import type { Lang } from 'types/lang.type';
8
+ import type { Limit } from 'types/limit.type';
9
+ import type { Api } from 'types/api.type';
10
+ import type { Sort } from 'types/sort.type';
11
+ import type { Style } from 'types/style.type';
12
12
  interface SearchParamsBase {
13
13
  /**
14
14
  * List of formats.
@@ -1,5 +1,5 @@
1
- import type { CountryValues } from '../data/country.data.js';
2
- import type { CurrencyValues } from '../data/currency.data.js';
1
+ import type { CountryValues } from 'data/country.data';
2
+ import type { CurrencyValues } from 'data/currency.data';
3
3
  /**
4
4
  * Result returned from a Discogs Marketplace search.
5
5
  */
@@ -1,4 +1,4 @@
1
- import type SearchResult from '../../interfaces/search-result.interface.js';
1
+ import type SearchResult from 'interfaces/search-result.interface';
2
2
  /**
3
3
  * Parses the page and returns the items found.
4
4
  * @returns Items found and total
@@ -1,5 +1,5 @@
1
- import type SearchResult from '../interfaces/search-result.interface.js';
2
- import type { SearchParamsLegacy } from '../interfaces/search-params.interface.js';
1
+ import type SearchResult from 'interfaces/search-result.interface';
2
+ import type { SearchParamsLegacy } from 'interfaces/search-params.interface';
3
3
  import type { BrowserContext } from 'playwright-chromium';
4
4
  /**
5
5
  * Parses the page and returns the items found.
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = scrapeLegacy;
7
- const currency_data_1 = __importDefault(require("../data/currency.data.js"));
8
- const country_data_1 = __importDefault(require("../data/country.data.js"));
9
- const search_1 = require("../search.js");
10
- const legacy_extractor_1 = __importDefault(require("../scrapers/extractors/legacy.extractor.js"));
7
+ const currency_data_1 = __importDefault(require("data/currency.data"));
8
+ const country_data_1 = __importDefault(require("data/country.data"));
9
+ const search_1 = require("search");
10
+ const legacy_extractor_1 = __importDefault(require("scrapers/extractors/legacy.extractor"));
11
11
  /**
12
12
  * Generate URL to be parsed
13
13
  * @returns Url
@@ -1,5 +1,5 @@
1
- import type SearchResult from '../interfaces/search-result.interface.js';
2
- import type { SearchParamsModern } from '../interfaces/search-params.interface.js';
1
+ import type SearchResult from 'interfaces/search-result.interface';
2
+ import type { SearchParamsModern } from 'interfaces/search-params.interface';
3
3
  import type { BrowserContext } from 'playwright-chromium';
4
4
  /**
5
5
  * Parses the page and returns the items found.
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = scrape;
7
7
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
8
- const country_data_1 = __importDefault(require("../data/country.data.js"));
9
- const search_1 = require("../search.js");
8
+ const country_data_1 = __importDefault(require("data/country.data"));
9
+ const search_1 = require("search");
10
10
  /**
11
11
  * Parses the page and returns the items found.
12
12
  * @param SearchParams Search parameters
@@ -64,13 +64,14 @@ async function scrape({ currencies, genres, formats, formatDescriptions, conditi
64
64
  ].filter(([, p]) => !!p)).toString(),
65
65
  ].join('?');
66
66
  const browserPage = await browserContext.newPage();
67
+ await browserPage.goto('https://www.discogs.com/shop/mywants', { waitUntil: 'commit' });
67
68
  await browserPage.setExtraHTTPHeaders({
68
69
  'User-Agent': 'Discogs',
69
70
  Accept: 'application/json',
70
71
  'Accept-Language': 'en-US,en;q=0.9,fr-FR;q=0.8',
71
72
  Referer: 'https://www.discogs.com/shop/mywants',
72
73
  });
73
- const response = await browserPage.goto(urlGenerated);
74
+ const response = await browserPage.goto(urlGenerated, { waitUntil: 'domcontentloaded' });
74
75
  if (!response?.ok()) {
75
76
  const message = response?.headers()['content-type']?.includes('application/json')
76
77
  ? (await response.json())?.detail
@@ -1,5 +1,5 @@
1
- import type SearchResult from '../interfaces/search-result.interface.js';
2
- import type { SearchParamsModern } from '../interfaces/search-params.interface.js';
1
+ import type SearchResult from 'interfaces/search-result.interface';
2
+ import type { SearchParamsModern } from 'interfaces/search-params.interface';
3
3
  import type { BrowserContext } from 'playwright-chromium';
4
4
  /**
5
5
  * Parses the page and returns the items found.
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = scrapeWantlist;
7
- const modern_scraper_1 = __importDefault(require("../scrapers/modern.scraper.js"));
7
+ const modern_scraper_1 = __importDefault(require("scrapers/modern.scraper"));
8
8
  const PER_PAGE = 250;
9
9
  /**
10
10
  * Parses the page and returns the items found.
@@ -33,7 +33,7 @@ async function scrapeWantlist(searchParams, browserContext) {
33
33
  Referer: url,
34
34
  });
35
35
  await browserPage.route('**/*', route => (route.request().resourceType() === 'document' ? route.continue() : route.abort()));
36
- const response = await browserPage.goto(url);
36
+ const response = await browserPage.goto(url, { waitUntil: 'domcontentloaded' });
37
37
  const [total, ids] = await Promise.all([
38
38
  browserPage.evaluate(() => +(document.querySelector('.pagination_total')?.textContent.split(' of ').pop()?.replace(',', '') ?? '0')),
39
39
  browserPage.evaluate(() => {
package/dist/search.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { SearchParams } from './interfaces/search-params.interface.js';
2
- import type SearchResult from './interfaces/search-result.interface.js';
1
+ import type { SearchParams } from 'interfaces/search-params.interface';
2
+ import type SearchResult from 'interfaces/search-result.interface';
3
3
  import type { Browser } from 'playwright-chromium';
4
4
  export declare const DEFAULT_LIMIT = 25;
5
5
  export declare const DEFAULT_PAGE = 1;
package/dist/search.js CHANGED
@@ -7,9 +7,9 @@ exports.DEFAULT_SORT = exports.DEFAULT_PAGE = exports.DEFAULT_LIMIT = void 0;
7
7
  exports.default = search;
8
8
  const playwright_extra_1 = require("playwright-extra");
9
9
  const puppeteer_extra_plugin_stealth_1 = __importDefault(require("puppeteer-extra-plugin-stealth"));
10
- const legacy_scraper_1 = __importDefault(require("./scrapers/legacy.scraper.js"));
11
- const wantlist_scraper_1 = __importDefault(require("./scrapers/wantlist.scraper.js"));
12
- const modern_scraper_1 = __importDefault(require("./scrapers/modern.scraper.js"));
10
+ const legacy_scraper_1 = __importDefault(require("scrapers/legacy.scraper"));
11
+ const wantlist_scraper_1 = __importDefault(require("scrapers/wantlist.scraper"));
12
+ const modern_scraper_1 = __importDefault(require("scrapers/modern.scraper"));
13
13
  exports.DEFAULT_LIMIT = 25;
14
14
  exports.DEFAULT_PAGE = 1;
15
15
  exports.DEFAULT_SORT = 'listed,desc';
@@ -1,4 +1,4 @@
1
- import type { CountryValues } from '../data/country.data.js';
1
+ import type { CountryValues } from 'data/country.data';
2
2
  /**
3
3
  * From
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discogs-marketplace-api-nodejs",
3
- "version": "1.16.6",
3
+ "version": "1.16.8",
4
4
  "description": "Another (better ?) NodeJs library to fetch data from Discogs marketplace",
5
5
  "keywords": [
6
6
  "discogs",
@@ -40,30 +40,30 @@
40
40
  }
41
41
  ],
42
42
  "dependencies": {
43
- "playwright-chromium": "^1.58.2",
43
+ "playwright-chromium": "^1.60.0",
44
44
  "playwright-extra": "^4.3.6",
45
45
  "puppeteer-extra-plugin-stealth": "^2.11.2"
46
46
  },
47
47
  "devDependencies": {
48
- "@eslint/js": "^9.39.2",
49
- "@types/node": "^22.19.11",
50
- "@typescript-eslint/eslint-plugin": "^8.55.0",
51
- "@typescript-eslint/parser": "^8.55.0",
52
- "cspell": "^9.6.4",
53
- "eslint": "^9.39.2",
48
+ "@eslint/js": "^9.39.4",
49
+ "@types/node": "^24.13.0",
50
+ "@typescript-eslint/eslint-plugin": "^8.60.1",
51
+ "@typescript-eslint/parser": "^8.60.1",
52
+ "cspell": "^9.8.0",
53
+ "eslint": "^9.39.4",
54
54
  "eslint-config-prettier": "^10.1.8",
55
- "eslint-import-resolver-typescript": "^4.4.4",
55
+ "eslint-import-resolver-typescript": "^4.4.5",
56
56
  "eslint-plugin-import": "^2.32.0",
57
- "eslint-plugin-jsdoc": "^62.5.5",
58
- "globals": "^17.3.0",
57
+ "eslint-plugin-jsdoc": "^63.0.1",
58
+ "globals": "^17.6.0",
59
59
  "husky": "^9.1.7",
60
- "knip": "^5.83.1",
61
- "lint-staged": "^16.2.7",
62
- "prettier": "^3.8.1",
63
- "rimraf": "^6.1.2",
64
- "tsc-alias": "^1.8.16",
65
- "tsx": "^4.21.0",
66
- "typescript": "^5.9.3",
67
- "typescript-eslint": "^8.55.0"
60
+ "knip": "^6.15.0",
61
+ "lint-staged": "^16.4.0",
62
+ "prettier": "^3.8.3",
63
+ "rimraf": "^6.1.3",
64
+ "tsc-alias": "^1.8.17",
65
+ "tsx": "^4.22.4",
66
+ "typescript": "^6.0.3",
67
+ "typescript-eslint": "^8.60.1"
68
68
  }
69
69
  }