discogs-marketplace-api-nodejs 1.7.0 → 1.7.2

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 (40) hide show
  1. package/README.MD +27 -20
  2. package/dist/data/countries.data.js +1 -0
  3. package/dist/index.d.ts +2 -2
  4. package/dist/interfaces/index.d.ts +4 -0
  5. package/dist/{types/commons/input.type.d.ts → interfaces/input.interface.d.ts} +14 -12
  6. package/dist/{types/commons/output-error.type.d.ts → interfaces/output-error.interface.d.ts} +3 -3
  7. package/dist/{types/commons/output-sucess.type.d.ts → interfaces/output-success.interface.d.ts} +9 -9
  8. package/dist/marketplace.d.ts +2 -2
  9. package/dist/marketplace.js +6 -4
  10. package/dist/types/{unions/from.type.d.ts → from.type.d.ts} +1 -1
  11. package/dist/types/index.d.ts +12 -0
  12. package/package.json +27 -22
  13. package/dist/types/commons/index.d.ts +0 -4
  14. package/dist/types/unions/index.d.ts +0 -12
  15. /package/dist/{types/commons → interfaces}/index.js +0 -0
  16. /package/dist/{types/commons/input.type.js → interfaces/input.interface.js} +0 -0
  17. /package/dist/{types/commons/output-error.type.js → interfaces/output-error.interface.js} +0 -0
  18. /package/dist/{types/commons/output-sucess.type.js → interfaces/output-success.interface.js} +0 -0
  19. /package/dist/types/{unions/condition.type.d.ts → condition.type.d.ts} +0 -0
  20. /package/dist/types/{unions/condition.type.js → condition.type.js} +0 -0
  21. /package/dist/types/{unions/currency.type.d.ts → currency.type.d.ts} +0 -0
  22. /package/dist/types/{unions/currency.type.js → currency.type.js} +0 -0
  23. /package/dist/types/{unions/format-description.type.d.ts → format-description.type.d.ts} +0 -0
  24. /package/dist/types/{unions/format-description.type.js → format-description.type.js} +0 -0
  25. /package/dist/types/{unions/format.type.d.ts → format.type.d.ts} +0 -0
  26. /package/dist/types/{unions/format.type.js → format.type.js} +0 -0
  27. /package/dist/types/{unions/from.type.js → from.type.js} +0 -0
  28. /package/dist/types/{unions/genre.type.d.ts → genre.type.d.ts} +0 -0
  29. /package/dist/types/{unions/genre.type.js → genre.type.js} +0 -0
  30. /package/dist/types/{unions/index.js → index.js} +0 -0
  31. /package/dist/types/{unions/lang.type.d.ts → lang.type.d.ts} +0 -0
  32. /package/dist/types/{unions/lang.type.js → lang.type.js} +0 -0
  33. /package/dist/types/{unions/limit.type.d.ts → limit.type.d.ts} +0 -0
  34. /package/dist/types/{unions/limit.type.js → limit.type.js} +0 -0
  35. /package/dist/types/{unions/search-type.type.d.ts → search-type.type.d.ts} +0 -0
  36. /package/dist/types/{unions/search-type.type.js → search-type.type.js} +0 -0
  37. /package/dist/types/{unions/sort.type.d.ts → sort.type.d.ts} +0 -0
  38. /package/dist/types/{unions/sort.type.js → sort.type.js} +0 -0
  39. /package/dist/types/{unions/style.type.d.ts → style.type.d.ts} +0 -0
  40. /package/dist/types/{unions/style.type.js → style.type.js} +0 -0
package/README.MD CHANGED
@@ -44,6 +44,7 @@ const result = await DiscogsMarketplace.search({
44
44
  // https://www.discogs.com/sell/mywants?limit=50&user=Kirian_&sort=price,asc
45
45
  const result = await DiscogsMarketplace.search({
46
46
  limit: 50,
47
+ page: 1,
47
48
  sort: 'Price Lowest',
48
49
  searchType: 'user',
49
50
  searchValue: 'Kirian_',
@@ -56,6 +57,7 @@ const result = await DiscogsMarketplace.search({
56
57
  // https://www.discogs.com/sell/release/767931?sort=seller,asc&limit=25&page=1
57
58
  const result = await DiscogsMarketplace.search({
58
59
  sort: 'Seller A-Z',
60
+ page: 1,
59
61
  searchType: 'release_id',
60
62
  searchValue: '767931',
61
63
  })
@@ -67,6 +69,7 @@ const result = await DiscogsMarketplace.search({
67
69
  // https://www.discogs.com/sell/list?sort=listed,desc&limit=100&q=in+flames&page=1
68
70
  const result = await DiscogsMarketplace.search({
69
71
  limit: 100,
72
+ page: 1,
70
73
  sort: 'Listed Newest',
71
74
  searchType: 'q',
72
75
  searchValue: 'in flames',
@@ -79,6 +82,7 @@ const result = await DiscogsMarketplace.search({
79
82
  // https://www.discogs.com/seller/Kirian_/profile?sort=listed,desc&limit=25&page=1
80
83
  const result = await DiscogsMarketplace.search({
81
84
  sort: 'Listed Newest',
85
+ page: 1,
82
86
  searchType: 'q',
83
87
  searchValue: '',
84
88
  seller: 'Kirian_',
@@ -91,6 +95,7 @@ const result = await DiscogsMarketplace.search({
91
95
  // https://www.discogs.com/seller/Kirian_/mywants?sort=listed,desc&limit=25&user=Kirian_&page=1
92
96
  const result = await DiscogsMarketplace.search({
93
97
  sort: 'Listed Newest',
98
+ page: 1,
94
99
  searchType: 'user',
95
100
  searchValue: 'Kirian_',
96
101
  seller: 'Kirian_',
@@ -99,10 +104,10 @@ const result = await DiscogsMarketplace.search({
99
104
 
100
105
  ## Data format
101
106
 
102
- 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:
103
108
 
104
109
  ```ts
105
- type InputType = {
110
+ interface InputInterface {
106
111
  /**
107
112
  * Type of elements to search.
108
113
  * Default to `q`.
@@ -119,7 +124,7 @@ type InputType = {
119
124
  /**
120
125
  * Value to search corresponding to searchType
121
126
  */
122
- searchValue: string | number | undefined
127
+ searchValue?: string | number
123
128
  /**
124
129
  * Currency
125
130
  */
@@ -131,19 +136,19 @@ type InputType = {
131
136
  /**
132
137
  * Styles
133
138
  */
134
- style?: StyleType[]
139
+ style?: Array<StyleType>
135
140
  /**
136
141
  * Formats
137
142
  */
138
- format?: FormatType[]
143
+ format?: Array<FormatType>
139
144
  /**
140
145
  * Format descriptions
141
146
  */
142
- formatDescription?: FormatDescriptionType[]
147
+ formatDescription?: Array<FormatDescriptionType>
143
148
  /**
144
149
  * Media conditions
145
150
  */
146
- condition?: ConditionType[]
151
+ condition?: Array<ConditionType>
147
152
  /**
148
153
  * Year (Do not use it with `years`)
149
154
  */
@@ -174,16 +179,18 @@ type InputType = {
174
179
  */
175
180
  seller?: string
176
181
  /**
177
- * Sort elements by
182
+ * Sort elements by.
183
+ * Default to `Listed Newest`.
178
184
  */
179
185
  sort?: SortType
180
186
  /**
181
- * Limit of elements to search (25 | 50 | 100 | 250)
187
+ * Limit of elements to search (25 | 50 | 100 | 250).
188
+ * Default to `25`.
182
189
  */
183
190
  limit?: LimitType
184
191
  /**
185
192
  * Page (Must be < 401 or discogs will return an error 404).
186
- * Default to `25`.
193
+ * Default to `1`.
187
194
  */
188
195
  page?: number
189
196
  /**
@@ -197,18 +204,18 @@ type InputType = {
197
204
  If success, it will return:
198
205
 
199
206
  ```ts
200
- type OutputSuccessType = {
201
- items: {
207
+ interface OutputSuccessInterface {
208
+ items: Array<{
202
209
  id: number
203
210
  title: {
204
211
  original: string
205
212
  artist: string
206
213
  item: string
207
- formats: string[]
214
+ formats: Array<string>
208
215
  }
209
216
  url: string
210
- labels: string[]
211
- catnos: string[]
217
+ labels: Array<string>
218
+ catnos: Array<string>
212
219
  imageUrl: string
213
220
  description: string
214
221
  isAcceptingOffer: boolean
@@ -235,7 +242,7 @@ type OutputSuccessType = {
235
242
  }
236
243
  country: {
237
244
  name: string
238
- code: ECountryCode
245
+ code: string
239
246
  }
240
247
  community: {
241
248
  have: number
@@ -245,7 +252,7 @@ type OutputSuccessType = {
245
252
  id: number
246
253
  url: string
247
254
  }
248
- }[]
255
+ }>
249
256
  page: {
250
257
  current: number
251
258
  total: number
@@ -265,7 +272,7 @@ type OutputSuccessType = {
265
272
  If error, it will throw:
266
273
 
267
274
  ```ts
268
- type OutputErrorType = {
275
+ interface OutputErrorInterface {
269
276
  message: string
270
277
  code: number
271
278
  }
@@ -275,7 +282,7 @@ type OutputErrorType = {
275
282
 
276
283
  There is a [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) on that project already configured, feel free to use it.
277
284
 
278
- Install dependecies with:
285
+ Install dependencies with:
279
286
 
280
287
  ```sh
281
288
  npm install
@@ -287,7 +294,7 @@ You can open a pull request with your new additions.
287
294
 
288
295
  ### Linkedom
289
296
 
290
- If you are using this librairy on a Typescript project, you might encounter issues with `linkedom`.
297
+ If you are using this library on a Typescript project, you might encounter issues with `linkedom`.
291
298
 
292
299
  To fix it, use this in command line: `--skipLibCheck` or add that in you `tsconfig.json`:
293
300
 
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // cspell: disable
3
4
  /**
4
5
  * ISO name
5
6
  * {@link https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { InputType, OutputErrorType, OutputSuccessType } from './types/commons/index.js';
2
1
  import DiscogsMarketplace from './marketplace.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`.
@@ -19,7 +19,7 @@ type InputType = {
19
19
  /**
20
20
  * Value to search corresponding to searchType
21
21
  */
22
- searchValue: string | number | undefined;
22
+ searchValue?: string | number;
23
23
  /**
24
24
  * Currency
25
25
  */
@@ -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
  */
@@ -74,16 +74,18 @@ type InputType = {
74
74
  */
75
75
  seller?: string;
76
76
  /**
77
- * Sort elements by
77
+ * Sort elements by.
78
+ * Default to `Listed Newest`.
78
79
  */
79
80
  sort?: SortType;
80
81
  /**
81
- * Limit of elements to search (25 | 50 | 100 | 250)
82
+ * Limit of elements to search (25 | 50 | 100 | 250).
83
+ * Default to `25`.
82
84
  */
83
85
  limit?: LimitType;
84
86
  /**
85
87
  * Page (Must be < 401 or discogs will return an error 404).
86
- * Default to `25`.
88
+ * Default to `1`.
87
89
  */
88
90
  page?: number;
89
91
  /**
@@ -91,5 +93,5 @@ type InputType = {
91
93
  * Default to `en`.
92
94
  */
93
95
  lang?: LangType;
94
- };
95
- 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
@@ -12,10 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const data_1 = require("./data/index.js");
16
15
  const user_agents_1 = __importDefault(require("user-agents"));
17
16
  const linkedom_1 = require("linkedom");
18
17
  const axios_1 = __importDefault(require("axios"));
18
+ const data_1 = require("./data/index.js");
19
19
  /**
20
20
  * Discogs Marketplace
21
21
  */
@@ -24,7 +24,7 @@ class Marketplace {
24
24
  * Search elements on discogs
25
25
  * @returns Items found
26
26
  */
27
- static search({ searchType = 'q', searchValue = undefined, currency = undefined, genre = undefined, style = [], format = [], formatDescription = [], condition = [], year = undefined, years = undefined, isAudioSample = false, isMakeAnOfferOnly = false, from = undefined, seller = undefined, sort = undefined, limit = 25, page = undefined, lang = 'en', }) {
27
+ static search({ searchType = 'q', searchValue = undefined, currency = undefined, genre = undefined, style = [], format = [], formatDescription = [], condition = [], year = undefined, years = undefined, isAudioSample = false, isMakeAnOfferOnly = false, from = undefined, seller = undefined, sort = 'Listed Newest', limit = 25, page = 1, lang = 'en', }) {
28
28
  var _a, _b, _c, _d;
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
30
  try {
@@ -53,6 +53,7 @@ class Marketplace {
53
53
  serialize: this.serializeParams,
54
54
  },
55
55
  headers: {
56
+ // cspell: disable-next-line
56
57
  'X-PJAX': 'true',
57
58
  'User-Agent': new user_agents_1.default().toString(),
58
59
  },
@@ -71,13 +72,13 @@ class Marketplace {
71
72
  if ((response === null || response === void 0 ? void 0 : response.data) && response.status) {
72
73
  // eslint-disable-next-line @typescript-eslint/no-throw-literal
73
74
  throw {
74
- message: (_d = (_c = (_b = (_a = (0, linkedom_1.parseHTML)(response.data).document) === null || _a === void 0 ? void 0 : _a.querySelector('h1 + p')) === null || _b === void 0 ? void 0 : _b.innerHTML) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : 'An error occured',
75
+ message: (_d = (_c = (_b = (_a = (0, linkedom_1.parseHTML)(response.data).document) === null || _a === void 0 ? void 0 : _a.querySelector('h1 + p')) === null || _b === void 0 ? void 0 : _b.innerHTML) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : 'An error occurred',
75
76
  code: response.status,
76
77
  };
77
78
  }
78
79
  // eslint-disable-next-line @typescript-eslint/no-throw-literal
79
80
  throw {
80
- message: message || 'An error occured',
81
+ message: message || 'An error occurred',
81
82
  code: 500,
82
83
  };
83
84
  }
@@ -195,6 +196,7 @@ class Marketplace {
195
196
  url: `https://www.discogs.com${(_13 = el.querySelector('a.item_description_title')) === null || _13 === void 0 ? void 0 : _13.href}`,
196
197
  labels: (_15 = (_14 = [...el.querySelectorAll(".label_and_cat a[href^='https://www.discogs.com/']")]) === null || _14 === void 0 ? void 0 : _14.map(x => { var _a; return (_a = x === null || x === void 0 ? void 0 : x.textContent) !== null && _a !== void 0 ? _a : ''; })) === null || _15 === void 0 ? void 0 : _15.filter((value, index, self) => self.indexOf(value) === index),
197
198
  catnos: (_20 = (_19 = (_18 = (_17 = (_16 = el
199
+ // cspell: disable-next-line
198
200
  .querySelector('.label_and_cat .item_catno')) === null || _16 === void 0 ? void 0 : _16.textContent) === null || _17 === void 0 ? void 0 : _17.replace(/\s+/g, ' ')) === null || _18 === void 0 ? void 0 : _18.split(', ')) === null || _19 === void 0 ? void 0 : _19.filter(x => x !== 'none')) !== null && _20 !== void 0 ? _20 : [],
199
201
  imageUrl: (_22 = (_21 = el.querySelector('.marketplace_image')) === null || _21 === void 0 ? void 0 : _21.getAttribute('data-src')) !== null && _22 !== void 0 ? _22 : '',
200
202
  description: (_27 = (_26 = (_25 = (_24 = (_23 = el.querySelector('.item_condition')) === null || _23 === void 0 ? void 0 : _23.nextElementSibling) === null || _24 === void 0 ? void 0 : _24.textContent) === null || _25 === void 0 ? void 0 : _25.replace(/\s+/g, ' ')) === null || _26 === void 0 ? void 0 : _26.trim()) !== null && _27 !== void 0 ? _27 : '',
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Froms
2
+ * From
3
3
  */
4
4
  type FromType = 'Afghanistan' | 'Albania' | 'Algeria' | 'American Samoa' | 'Andorra' | 'Angola' | 'Anguilla' | 'Antarctica' | 'Antigua and Barbuda' | 'Argentina' | 'Armenia' | 'Aruba' | 'Australia' | 'Austria' | 'Azerbaidjan' | 'Bahamas' | 'Bahrain' | 'Bangladesh' | 'Barbados' | 'Belarus' | 'Belgium' | 'Belize' | 'Benin' | 'Bermuda' | 'Bhutan' | 'Bolivia' | 'Bosnia-Herzegovina' | 'Botswana' | 'Bouvet Island' | 'Brazil' | 'British Indian Ocean Territory' | 'Brunei Darussalam' | 'Bulgaria' | 'Burkina Faso' | 'Burundi' | 'Cambodia' | 'Cameroon' | 'Canada' | 'Cape Verde' | 'Cayman Islands' | 'Central African Republic' | 'Chad' | 'Chile' | 'China' | 'Christmas Island' | 'Cocos (Keeling) Islands' | 'Colombia' | 'Comoros' | 'Congo' | 'Cook Islands' | 'Costa Rica' | 'Croatia' | 'Cuba' | 'Cyprus' | 'Czech Republic' | 'Denmark' | 'Djibouti' | 'Dominica' | 'Dominican Republic' | 'East Timor' | 'Ecuador' | 'Egypt' | 'El Salvador' | 'Equatorial Guinea' | 'Eritrea' | 'Estonia' | 'Ethiopia' | 'Falkland Islands' | 'Faroe Islands' | 'Fiji' | 'Finland' | 'Former Czechoslovakia' | 'Former USSR' | 'France' | 'France (European Territory)' | 'French Guyana' | 'French Southern Territories' | 'Gabon' | 'Gambia' | 'Georgia' | 'Germany' | 'Ghana' | 'Gibraltar' | 'Greece' | 'Greenland' | 'Grenada' | 'Guadeloupe (French)' | 'Guam (USA)' | 'Guatemala' | 'Guinea' | 'Guinea Bissau' | 'Guyana' | 'Haiti' | 'Heard and McDonald Islands' | 'Honduras' | 'Hong Kong' | 'Hungary' | 'Iceland' | 'India' | 'Indonesia' | 'Iran' | 'Iraq' | 'Ireland' | 'Israel' | 'Italy' | "Ivory Coast (Cote D'Ivoire)" | 'Jamaica' | 'Japan' | 'Jordan' | 'Kazakhstan' | 'Kenya' | 'Kiribati' | 'Kuwait' | 'Kyrgyzstan' | 'Laos' | 'Latvia' | 'Lebanon' | 'Lesotho' | 'Liberia' | 'Libya' | 'Liechtenstein' | 'Lithuania' | 'Luxembourg' | 'Macau' | 'Macedonia' | 'Madagascar' | 'Malawi' | 'Malaysia' | 'Maldives' | 'Mali' | 'Malta' | 'Marshall Islands' | 'Martinique (French)' | 'Mauritania' | 'Mauritius' | 'Mayotte' | 'Mexico' | 'Micronesia' | 'Moldova, Republic of' | 'Monaco' | 'Mongolia' | 'Montenegro' | 'Montserrat' | 'Morocco' | 'Mozambique' | 'Myanmar' | 'Namibia' | 'Nauru' | 'Nepal' | 'Netherlands' | 'Netherlands Antilles' | 'Neutral Zone' | 'New Caledonia (French)' | 'New Zealand' | 'Nicaragua' | 'Niger' | 'Nigeria' | 'Niue' | 'Norfolk Island' | 'Northern Ireland' | 'Northern Mariana Islands' | 'Norway' | 'Oman' | 'Pakistan' | 'Palau' | 'Panama' | 'Papua New Guinea' | 'Paraguay' | 'Peru' | 'Philippines' | 'Pitcairn Island' | 'Poland' | 'Polynesia (French)' | 'Portugal' | 'Puerto Rico' | 'Qatar' | 'Reunion (French)' | 'Romania' | 'Russian Federation' | 'Rwanda' | 'S. Georgia & S. Sandwich Isls.' | 'Saint Helena' | 'Saint Kitts & Nevis Anguilla' | 'Saint Lucia' | 'Saint Pierre and Miquelon' | 'Saint Tome (Sao Tome) and Princi' | 'Saint Vincent & Grenadines' | 'Samoa' | 'San Marino' | 'Saudi Arabia' | 'Select your country' | 'Senegal' | 'Serbia' | 'Seychelles' | 'Sierra Leone' | 'Singapore' | 'Slovak Republic' | 'Slovenia' | 'Solomon Islands' | 'Somalia' | 'South Africa' | 'South Korea' | 'Spain' | 'Spain (Canary Islands)' | 'Sri Lanka' | 'Sudan' | 'Suriname' | 'Svalbard and Jan Mayen Islands' | 'Swaziland' | 'Sweden' | 'Switzerland' | 'Syria' | 'Tadjikistan' | 'Taiwan' | 'Tanzania' | 'Thailand' | 'Togo' | 'Tokelau' | 'Tonga' | 'Trinidad and Tobago' | 'Tunisia' | 'Turkey' | 'Turkmenistan' | 'Turks and Caicos Islands' | 'Tuvalu' | 'USA Minor Outlying Islands' | 'Uganda' | 'Ukraine' | 'United Arab Emirates' | 'United Kingdom' | 'United Kingdom (Channel Islands)' | 'United States' | 'Uruguay' | 'Uzbekistan' | 'Vanuatu' | 'Vatican City State' | 'Venezuela' | 'Vietnam' | 'Virgin Islands (British)' | 'Virgin Islands (USA)' | 'Wallis and Futuna Islands' | 'Western Sahara' | 'Yemen' | 'Yugoslavia' | 'Zaire' | 'Zambia' | 'Zimbabwe';
5
5
  export default FromType;
@@ -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,7 +1,7 @@
1
1
  {
2
2
  "name": "discogs-marketplace-api-nodejs",
3
- "version": "1.7.0",
4
- "description": "Another (better ?) NodeJs library to fetch data from Discog's marketplace",
3
+ "version": "1.7.2",
4
+ "description": "Another (better ?) NodeJs library to fetch data from Discogs marketplace",
5
5
  "keywords": [
6
6
  "discogs",
7
7
  "marketplace",
@@ -16,7 +16,7 @@
16
16
  "author": "KirianCaumes",
17
17
  "license": "MIT",
18
18
  "scripts": {
19
- "prepare": "npm run build",
19
+ "prepare": "husky install && npm run build",
20
20
  "prebuild": "rimraf dist",
21
21
  "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
22
22
  "start:dev": "nodemon -r tsconfig-paths/register ./src/index.ts",
@@ -24,7 +24,8 @@
24
24
  "eslint:fix": "eslint src test --ext .ts,.js --fix",
25
25
  "eslint": "eslint src test --ext .ts,.js",
26
26
  "prettier": "prettier --check .",
27
- "prettier:fix": "prettier --write ."
27
+ "prettier:fix": "prettier --write .",
28
+ "cspell": "npx cspell ./ --no-progress"
28
29
  },
29
30
  "main": "dist/index.js",
30
31
  "types": "dist/index.d.ts",
@@ -32,28 +33,32 @@
32
33
  "node": ">=14.0.0"
33
34
  },
34
35
  "dependencies": {
35
- "axios": "^1.4.0",
36
- "linkedom": "^0.14.26",
37
- "user-agents": "^1.0.1381"
36
+ "axios": "^1.6.0",
37
+ "linkedom": "^0.16.1",
38
+ "user-agents": "^1.1.15"
38
39
  },
39
40
  "devDependencies": {
40
- "@types/jest": "^29.5.1",
41
- "@types/node": "^18.16.10",
42
- "@types/user-agents": "^1.0.2",
43
- "@typescript-eslint/eslint-plugin": "^5.59.6",
44
- "@typescript-eslint/parser": "^5.59.6",
45
- "eslint": "^8.40.0",
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",
47
+ "eslint": "^8.53.0",
46
48
  "eslint-config-airbnb-base": "^15.0.0",
47
- "eslint-config-airbnb-typescript": "^17.0.0",
48
- "eslint-config-prettier": "^8.8.0",
49
- "eslint-plugin-import": "^2.27.5",
50
- "eslint-plugin-jsdoc": "^44.2.4",
51
- "jest": "^29.5.0",
52
- "prettier": "^2.8.8",
53
- "ts-jest": "^29.1.0",
49
+ "eslint-config-airbnb-typescript": "^17.1.0",
50
+ "eslint-config-prettier": "^9.0.0",
51
+ "eslint-import-resolver-typescript": "^3.6.1",
52
+ "eslint-plugin-import": "^2.29.0",
53
+ "eslint-plugin-jsdoc": "^46.8.2",
54
+ "husky": "^8.0.3",
55
+ "jest": "^29.7.0",
56
+ "lint-staged": "^15.0.2",
57
+ "prettier": "^3.0.3",
58
+ "ts-jest": "^29.1.1",
54
59
  "ts-node": "^10.9.1",
55
- "tsc-alias": "^1.8.6",
60
+ "tsc-alias": "^1.8.8",
56
61
  "tsconfig-paths": "^4.2.0",
57
- "typescript": "^5.0.4"
62
+ "typescript": "^5.2.2"
58
63
  }
59
64
  }
@@ -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-sucess.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