discogs-marketplace-api-nodejs 1.7.1 → 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.
- package/README.MD +14 -14
- package/dist/index.d.ts +2 -2
- package/dist/interfaces/index.d.ts +4 -0
- package/dist/{types/commons/input.type.d.ts → interfaces/input.interface.d.ts} +8 -8
- package/dist/{types/commons/output-error.type.d.ts → interfaces/output-error.interface.d.ts} +3 -3
- package/dist/{types/commons/output-success.type.d.ts → interfaces/output-success.interface.d.ts} +9 -9
- package/dist/marketplace.d.ts +2 -2
- package/dist/types/index.d.ts +12 -0
- package/package.json +1 -1
- package/dist/types/commons/index.d.ts +0 -4
- package/dist/types/unions/index.d.ts +0 -12
- /package/dist/{types/commons → interfaces}/index.js +0 -0
- /package/dist/{types/commons/input.type.js → interfaces/input.interface.js} +0 -0
- /package/dist/{types/commons/output-error.type.js → interfaces/output-error.interface.js} +0 -0
- /package/dist/{types/commons/output-success.type.js → interfaces/output-success.interface.js} +0 -0
- /package/dist/types/{unions/condition.type.d.ts → condition.type.d.ts} +0 -0
- /package/dist/types/{unions/condition.type.js → condition.type.js} +0 -0
- /package/dist/types/{unions/currency.type.d.ts → currency.type.d.ts} +0 -0
- /package/dist/types/{unions/currency.type.js → currency.type.js} +0 -0
- /package/dist/types/{unions/format-description.type.d.ts → format-description.type.d.ts} +0 -0
- /package/dist/types/{unions/format-description.type.js → format-description.type.js} +0 -0
- /package/dist/types/{unions/format.type.d.ts → format.type.d.ts} +0 -0
- /package/dist/types/{unions/format.type.js → format.type.js} +0 -0
- /package/dist/types/{unions/from.type.d.ts → from.type.d.ts} +0 -0
- /package/dist/types/{unions/from.type.js → from.type.js} +0 -0
- /package/dist/types/{unions/genre.type.d.ts → genre.type.d.ts} +0 -0
- /package/dist/types/{unions/genre.type.js → genre.type.js} +0 -0
- /package/dist/types/{unions/index.js → index.js} +0 -0
- /package/dist/types/{unions/lang.type.d.ts → lang.type.d.ts} +0 -0
- /package/dist/types/{unions/lang.type.js → lang.type.js} +0 -0
- /package/dist/types/{unions/limit.type.d.ts → limit.type.d.ts} +0 -0
- /package/dist/types/{unions/limit.type.js → limit.type.js} +0 -0
- /package/dist/types/{unions/search-type.type.d.ts → search-type.type.d.ts} +0 -0
- /package/dist/types/{unions/search-type.type.js → search-type.type.js} +0 -0
- /package/dist/types/{unions/sort.type.d.ts → sort.type.d.ts} +0 -0
- /package/dist/types/{unions/sort.type.js → sort.type.js} +0 -0
- /package/dist/types/{unions/style.type.d.ts → style.type.d.ts} +0 -0
- /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
|
|
107
|
+
You can provide parameters to `DiscogsMarketplace.search` function according to this interface:
|
|
108
108
|
|
|
109
109
|
```ts
|
|
110
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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 {
|
|
3
|
-
export { DiscogsMarketplace,
|
|
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 '
|
|
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
|
-
|
|
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
|
|
96
|
+
}
|
|
97
|
+
export default InputInterface;
|
package/dist/{types/commons/output-success.type.d.ts → interfaces/output-success.interface.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { SearchTypeType } from '
|
|
1
|
+
import type { SearchTypeType } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Result provided to user
|
|
4
4
|
*/
|
|
5
|
-
|
|
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
|
|
115
|
+
}
|
|
116
|
+
export default OutputSuccessInterface;
|
package/dist/marketplace.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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, }:
|
|
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
|
|
@@ -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,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
|
|
File without changes
|
/package/dist/{types/commons/output-success.type.js → interfaces/output-success.interface.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|