discogs-marketplace-api-nodejs 1.7.1 → 1.7.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 (39) hide show
  1. package/README.MD +14 -14
  2. package/dist/index.d.ts +2 -2
  3. package/dist/interfaces/index.d.ts +4 -0
  4. package/dist/{types/commons/input.type.d.ts → interfaces/input.interface.d.ts} +8 -8
  5. package/dist/{types/commons/output-error.type.d.ts → interfaces/output-error.interface.d.ts} +3 -3
  6. package/dist/{types/commons/output-success.type.d.ts → interfaces/output-success.interface.d.ts} +9 -9
  7. package/dist/marketplace.d.ts +2 -2
  8. package/dist/marketplace.js +1 -1
  9. package/dist/types/index.d.ts +12 -0
  10. package/package.json +13 -13
  11. package/dist/types/commons/index.d.ts +0 -4
  12. package/dist/types/unions/index.d.ts +0 -12
  13. /package/dist/{types/commons → interfaces}/index.js +0 -0
  14. /package/dist/{types/commons/input.type.js → interfaces/input.interface.js} +0 -0
  15. /package/dist/{types/commons/output-error.type.js → interfaces/output-error.interface.js} +0 -0
  16. /package/dist/{types/commons/output-success.type.js → interfaces/output-success.interface.js} +0 -0
  17. /package/dist/types/{unions/condition.type.d.ts → condition.type.d.ts} +0 -0
  18. /package/dist/types/{unions/condition.type.js → condition.type.js} +0 -0
  19. /package/dist/types/{unions/currency.type.d.ts → currency.type.d.ts} +0 -0
  20. /package/dist/types/{unions/currency.type.js → currency.type.js} +0 -0
  21. /package/dist/types/{unions/format-description.type.d.ts → format-description.type.d.ts} +0 -0
  22. /package/dist/types/{unions/format-description.type.js → format-description.type.js} +0 -0
  23. /package/dist/types/{unions/format.type.d.ts → format.type.d.ts} +0 -0
  24. /package/dist/types/{unions/format.type.js → format.type.js} +0 -0
  25. /package/dist/types/{unions/from.type.d.ts → from.type.d.ts} +0 -0
  26. /package/dist/types/{unions/from.type.js → from.type.js} +0 -0
  27. /package/dist/types/{unions/genre.type.d.ts → genre.type.d.ts} +0 -0
  28. /package/dist/types/{unions/genre.type.js → genre.type.js} +0 -0
  29. /package/dist/types/{unions/index.js → index.js} +0 -0
  30. /package/dist/types/{unions/lang.type.d.ts → lang.type.d.ts} +0 -0
  31. /package/dist/types/{unions/lang.type.js → lang.type.js} +0 -0
  32. /package/dist/types/{unions/limit.type.d.ts → limit.type.d.ts} +0 -0
  33. /package/dist/types/{unions/limit.type.js → limit.type.js} +0 -0
  34. /package/dist/types/{unions/search-type.type.d.ts → search-type.type.d.ts} +0 -0
  35. /package/dist/types/{unions/search-type.type.js → search-type.type.js} +0 -0
  36. /package/dist/types/{unions/sort.type.d.ts → sort.type.d.ts} +0 -0
  37. /package/dist/types/{unions/sort.type.js → sort.type.js} +0 -0
  38. /package/dist/types/{unions/style.type.d.ts → style.type.d.ts} +0 -0
  39. /package/dist/types/{unions/style.type.js → style.type.js} +0 -0
package/README.MD CHANGED
@@ -104,10 +104,10 @@ const result = await DiscogsMarketplace.search({
104
104
 
105
105
  ## Data format
106
106
 
107
- You can provide parameters to `DiscogsMarketplace.search` function according to this type:
107
+ You can provide parameters to `DiscogsMarketplace.search` function according to this interface:
108
108
 
109
109
  ```ts
110
- type InputType = {
110
+ interface InputInterface {
111
111
  /**
112
112
  * Type of elements to search.
113
113
  * Default to `q`.
@@ -136,19 +136,19 @@ type InputType = {
136
136
  /**
137
137
  * Styles
138
138
  */
139
- style?: StyleType[]
139
+ style?: Array<StyleType>
140
140
  /**
141
141
  * Formats
142
142
  */
143
- format?: FormatType[]
143
+ format?: Array<FormatType>
144
144
  /**
145
145
  * Format descriptions
146
146
  */
147
- formatDescription?: FormatDescriptionType[]
147
+ formatDescription?: Array<FormatDescriptionType>
148
148
  /**
149
149
  * Media conditions
150
150
  */
151
- condition?: ConditionType[]
151
+ condition?: Array<ConditionType>
152
152
  /**
153
153
  * Year (Do not use it with `years`)
154
154
  */
@@ -204,18 +204,18 @@ type InputType = {
204
204
  If success, it will return:
205
205
 
206
206
  ```ts
207
- type OutputSuccessType = {
208
- items: {
207
+ interface OutputSuccessInterface {
208
+ items: Array<{
209
209
  id: number
210
210
  title: {
211
211
  original: string
212
212
  artist: string
213
213
  item: string
214
- formats: string[]
214
+ formats: Array<string>
215
215
  }
216
216
  url: string
217
- labels: string[]
218
- catnos: string[]
217
+ labels: Array<string>
218
+ catnos: Array<string>
219
219
  imageUrl: string
220
220
  description: string
221
221
  isAcceptingOffer: boolean
@@ -242,7 +242,7 @@ type OutputSuccessType = {
242
242
  }
243
243
  country: {
244
244
  name: string
245
- code: ECountryCode
245
+ code: string
246
246
  }
247
247
  community: {
248
248
  have: number
@@ -252,7 +252,7 @@ type OutputSuccessType = {
252
252
  id: number
253
253
  url: string
254
254
  }
255
- }[]
255
+ }>
256
256
  page: {
257
257
  current: number
258
258
  total: number
@@ -272,7 +272,7 @@ type OutputSuccessType = {
272
272
  If error, it will throw:
273
273
 
274
274
  ```ts
275
- type OutputErrorType = {
275
+ interface OutputErrorInterface {
276
276
  message: string
277
277
  code: number
278
278
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import DiscogsMarketplace from './marketplace.js';
2
- import type { InputType, OutputErrorType, OutputSuccessType } from './types/commons/index.js';
3
- export { DiscogsMarketplace, InputType, OutputErrorType, OutputSuccessType };
2
+ import type { InputInterface, OutputErrorInterface, OutputSuccessInterface } from './interfaces/index.js';
3
+ export { DiscogsMarketplace, InputInterface, OutputErrorInterface, OutputSuccessInterface };
@@ -0,0 +1,4 @@
1
+ import type InputInterface from '../interfaces/input.interface.js';
2
+ import type OutputErrorInterface from '../interfaces/output-error.interface.js';
3
+ import type OutputSuccessInterface from '../interfaces/output-success.interface.js';
4
+ export { InputInterface, OutputErrorInterface, OutputSuccessInterface };
@@ -1,8 +1,8 @@
1
- import type { LimitType, GenreType, CurrencyType, FromType, StyleType, FormatType, ConditionType, SortType, LangType, FormatDescriptionType, SearchTypeType } from '../../types/unions/index.js';
1
+ import type { LimitType, GenreType, CurrencyType, FromType, StyleType, FormatType, ConditionType, SortType, LangType, FormatDescriptionType, SearchTypeType } from '../types/index.js';
2
2
  /**
3
3
  * Element that can be provided by user
4
4
  */
5
- type InputType = {
5
+ interface InputInterface {
6
6
  /**
7
7
  * Type of elements to search.
8
8
  * Default to `q`.
@@ -31,19 +31,19 @@ type InputType = {
31
31
  /**
32
32
  * Styles
33
33
  */
34
- style?: StyleType[];
34
+ style?: Array<StyleType>;
35
35
  /**
36
36
  * Formats
37
37
  */
38
- format?: FormatType[];
38
+ format?: Array<FormatType>;
39
39
  /**
40
40
  * Format descriptions
41
41
  */
42
- formatDescription?: FormatDescriptionType[];
42
+ formatDescription?: Array<FormatDescriptionType>;
43
43
  /**
44
44
  * Media conditions
45
45
  */
46
- condition?: ConditionType[];
46
+ condition?: Array<ConditionType>;
47
47
  /**
48
48
  * Year (Do not use it with `years`)
49
49
  */
@@ -93,5 +93,5 @@ type InputType = {
93
93
  * Default to `en`.
94
94
  */
95
95
  lang?: LangType;
96
- };
97
- export default InputType;
96
+ }
97
+ export default InputInterface;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Result provided to user
3
3
  */
4
- type OutputErrorType = {
4
+ interface OutputErrorInterface {
5
5
  /** Message */
6
6
  message: string;
7
7
  /** Code */
8
8
  code: number;
9
- };
10
- export default OutputErrorType;
9
+ }
10
+ export default OutputErrorInterface;
@@ -1,10 +1,10 @@
1
- import type { SearchTypeType } from '../../types/unions/index.js';
1
+ import type { SearchTypeType } from '../types/index.js';
2
2
  /**
3
3
  * Result provided to user
4
4
  */
5
- type OutputSuccessType = {
5
+ interface OutputSuccessInterface {
6
6
  /** Items */
7
- items: {
7
+ items: Array<{
8
8
  /** Id */
9
9
  id: number;
10
10
  /** Title */
@@ -16,14 +16,14 @@ type OutputSuccessType = {
16
16
  /** Item */
17
17
  item: string;
18
18
  /** Formats */
19
- formats: string[];
19
+ formats: Array<string>;
20
20
  };
21
21
  /** Url */
22
22
  url: string;
23
23
  /** Labels */
24
- labels: string[];
24
+ labels: Array<string>;
25
25
  /** Catnos */
26
- catnos: string[];
26
+ catnos: Array<string>;
27
27
  /** ImageUrl */
28
28
  imageUrl: string;
29
29
  /** Description */
@@ -88,7 +88,7 @@ type OutputSuccessType = {
88
88
  /** Url */
89
89
  url: string;
90
90
  };
91
- }[];
91
+ }>;
92
92
  /** Page */
93
93
  page: {
94
94
  /** Current */
@@ -112,5 +112,5 @@ type OutputSuccessType = {
112
112
  };
113
113
  /** UrlGenerated */
114
114
  urlGenerated: string;
115
- };
116
- export default OutputSuccessType;
115
+ }
116
+ export default OutputSuccessInterface;
@@ -1,4 +1,4 @@
1
- import type { InputType, OutputSuccessType } from './types/commons/index.js';
1
+ import type { InputInterface, OutputSuccessInterface } from './interfaces/index.js';
2
2
  /**
3
3
  * Discogs Marketplace
4
4
  */
@@ -7,7 +7,7 @@ export default abstract class Marketplace {
7
7
  * Search elements on discogs
8
8
  * @returns Items found
9
9
  */
10
- static search({ searchType, searchValue, currency, genre, style, format, formatDescription, condition, year, years, isAudioSample, isMakeAnOfferOnly, from, seller, sort, limit, page, lang, }: InputType): Promise<OutputSuccessType>;
10
+ static search({ searchType, searchValue, currency, genre, style, format, formatDescription, condition, year, years, isAudioSample, isMakeAnOfferOnly, from, seller, sort, limit, page, lang, }: InputInterface): Promise<OutputSuccessInterface>;
11
11
  /**
12
12
  * Generate URL to be parsed
13
13
  * @returns Url
@@ -55,7 +55,7 @@ class Marketplace {
55
55
  headers: {
56
56
  // cspell: disable-next-line
57
57
  'X-PJAX': 'true',
58
- 'User-Agent': new user_agents_1.default().toString(),
58
+ 'User-Agent': new user_agents_1.default({ platform: 'Win32' }).toString(),
59
59
  },
60
60
  };
61
61
  const { data: bodyHTML } = yield axios_1.default.request(config);
@@ -0,0 +1,12 @@
1
+ import type LimitType from '../types/limit.type.js';
2
+ import type GenreType from '../types/genre.type.js';
3
+ import type CurrencyType from '../types/currency.type.js';
4
+ import type FromType from '../types/from.type.js';
5
+ import type StyleType from '../types/style.type.js';
6
+ import type FormatType from '../types/format.type.js';
7
+ import type ConditionType from '../types/condition.type.js';
8
+ import type SortType from '../types/sort.type.js';
9
+ import type LangType from '../types/lang.type.js';
10
+ import type FormatDescriptionType from '../types/format-description.type.js';
11
+ import type SearchTypeType from '../types/search-type.type.js';
12
+ export type { LimitType, GenreType, CurrencyType, FromType, StyleType, FormatType, ConditionType, SortType, LangType, FormatDescriptionType, SearchTypeType, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discogs-marketplace-api-nodejs",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Another (better ?) NodeJs library to fetch data from Discogs marketplace",
5
5
  "keywords": [
6
6
  "discogs",
@@ -33,28 +33,28 @@
33
33
  "node": ">=14.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "axios": "^1.6.0",
37
- "linkedom": "^0.16.1",
38
- "user-agents": "^1.1.15"
36
+ "axios": "^1.6.2",
37
+ "linkedom": "^0.16.4",
38
+ "user-agents": "^1.1.24"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/jest": "^29.5.7",
42
- "@types/node": "^18.18.8",
43
- "@types/user-agents": "^1.0.3",
44
- "@typescript-eslint/eslint-plugin": "^6.10.0",
45
- "@typescript-eslint/parser": "^6.10.0",
46
- "cspell": "^7.3.8",
41
+ "@types/jest": "^29.5.8",
42
+ "@types/node": "^18.18.9",
43
+ "@types/user-agents": "^1.0.4",
44
+ "@typescript-eslint/eslint-plugin": "^6.11.0",
45
+ "@typescript-eslint/parser": "^6.11.0",
46
+ "cspell": "^8.0.0",
47
47
  "eslint": "^8.53.0",
48
48
  "eslint-config-airbnb-base": "^15.0.0",
49
49
  "eslint-config-airbnb-typescript": "^17.1.0",
50
50
  "eslint-config-prettier": "^9.0.0",
51
51
  "eslint-import-resolver-typescript": "^3.6.1",
52
52
  "eslint-plugin-import": "^2.29.0",
53
- "eslint-plugin-jsdoc": "^46.8.2",
53
+ "eslint-plugin-jsdoc": "^46.9.0",
54
54
  "husky": "^8.0.3",
55
55
  "jest": "^29.7.0",
56
- "lint-staged": "^15.0.2",
57
- "prettier": "^3.0.3",
56
+ "lint-staged": "^15.1.0",
57
+ "prettier": "^3.1.0",
58
58
  "ts-jest": "^29.1.1",
59
59
  "ts-node": "^10.9.1",
60
60
  "tsc-alias": "^1.8.8",
@@ -1,4 +0,0 @@
1
- import type InputType from '../../types/commons/input.type.js';
2
- import type OutputErrorType from '../../types/commons/output-error.type.js';
3
- import type OutputSuccessType from '../../types/commons/output-success.type.js';
4
- export { InputType, OutputErrorType, OutputSuccessType };
@@ -1,12 +0,0 @@
1
- import type LimitType from '../../types/unions/limit.type.js';
2
- import type GenreType from '../../types/unions/genre.type.js';
3
- import type CurrencyType from '../../types/unions/currency.type.js';
4
- import type FromType from '../../types/unions/from.type.js';
5
- import type StyleType from '../../types/unions/style.type.js';
6
- import type FormatType from '../../types/unions/format.type.js';
7
- import type ConditionType from '../../types/unions/condition.type.js';
8
- import type SortType from '../../types/unions/sort.type.js';
9
- import type LangType from '../../types/unions/lang.type.js';
10
- import type FormatDescriptionType from '../../types/unions/format-description.type.js';
11
- import type SearchTypeType from '../../types/unions/search-type.type.js';
12
- export type { LimitType, GenreType, CurrencyType, FromType, StyleType, FormatType, ConditionType, SortType, LangType, FormatDescriptionType, SearchTypeType, };
File without changes
File without changes