discogs-marketplace-api-nodejs 1.5.1 → 1.6.0
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 +193 -112
- package/dist/data/countries.data.d.ts +306 -0
- package/dist/data/countries.data.js +327 -0
- package/dist/data/currencies.data.d.ts +33 -0
- package/dist/data/currencies.data.js +35 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/data/index.js +10 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +0 -12
- package/dist/marketplace.d.ts +1 -2
- package/dist/marketplace.js +21 -24
- package/dist/types/commons/index.d.ts +4 -0
- package/dist/{interfaces → types/commons}/index.js +0 -0
- package/dist/types/commons/input.type.d.ts +95 -0
- package/dist/{interfaces/input.interface.js → types/commons/input.type.js} +0 -0
- package/dist/{interfaces/output-error.interface.d.ts → types/commons/output-error.type.d.ts} +3 -2
- package/dist/{interfaces/item.interface.js → types/commons/output-error.type.js} +0 -0
- package/dist/types/commons/output-sucess.type.d.ts +116 -0
- package/dist/{interfaces/output-error.interface.js → types/commons/output-sucess.type.js} +0 -0
- package/dist/types/unions/condition.type.d.ts +5 -0
- package/dist/{interfaces/output-sucess.interface.js → types/unions/condition.type.js} +0 -0
- package/dist/types/unions/currency.type.d.ts +5 -0
- package/dist/{interfaces/year.interface.js → types/unions/currency.type.js} +0 -0
- package/dist/types/unions/format-description.type.d.ts +5 -0
- package/dist/types/{index.js → unions/format-description.type.js} +0 -0
- package/dist/types/unions/format.type.d.ts +5 -0
- package/dist/types/{limit.type.js → unions/format.type.js} +0 -0
- package/dist/types/unions/from.type.d.ts +5 -0
- package/dist/types/unions/from.type.js +2 -0
- package/dist/types/unions/genre.type.d.ts +5 -0
- package/dist/types/unions/genre.type.js +2 -0
- package/dist/types/unions/index.d.ts +12 -0
- package/dist/types/unions/index.js +2 -0
- package/dist/types/unions/lang.type.d.ts +5 -0
- package/dist/types/unions/lang.type.js +2 -0
- package/dist/types/{limit.type.d.ts → unions/limit.type.d.ts} +1 -1
- package/dist/types/unions/limit.type.js +2 -0
- package/dist/types/unions/search-type.type.d.ts +5 -0
- package/dist/types/unions/search-type.type.js +2 -0
- package/dist/types/unions/sort.type.d.ts +5 -0
- package/dist/types/unions/sort.type.js +2 -0
- package/dist/types/unions/style.type.d.ts +5 -0
- package/dist/types/unions/style.type.js +2 -0
- package/package.json +16 -16
- package/dist/enums/currency.enum.d.ts +0 -19
- package/dist/enums/currency.enum.js +0 -22
- package/dist/enums/format-description.enum.d.ts +0 -144
- package/dist/enums/format-description.enum.js +0 -147
- package/dist/enums/format.enum.d.ts +0 -59
- package/dist/enums/format.enum.js +0 -62
- package/dist/enums/from.enum.d.ts +0 -251
- package/dist/enums/from.enum.js +0 -254
- package/dist/enums/genre.enum.d.ts +0 -21
- package/dist/enums/genre.enum.js +0 -24
- package/dist/enums/index.d.ts +0 -11
- package/dist/enums/index.js +0 -26
- package/dist/enums/iso/country-code.enum.d.ts +0 -255
- package/dist/enums/iso/country-code.enum.js +0 -258
- package/dist/enums/iso/country-name.enum.d.ts +0 -255
- package/dist/enums/iso/country-name.enum.js +0 -258
- package/dist/enums/iso/index.d.ts +0 -3
- package/dist/enums/iso/index.js +0 -10
- package/dist/enums/iso/translate/discogs-country-name-to-iso-code.enum.d.ts +0 -69
- package/dist/enums/iso/translate/discogs-country-name-to-iso-code.enum.js +0 -72
- package/dist/enums/iso/translate/discogs-currency-to-iso-code.enum.d.ts +0 -36
- package/dist/enums/iso/translate/discogs-currency-to-iso-code.enum.js +0 -39
- package/dist/enums/iso/translate/index.d.ts +0 -3
- package/dist/enums/iso/translate/index.js +0 -10
- package/dist/enums/lang.enum.d.ts +0 -15
- package/dist/enums/lang.enum.js +0 -18
- package/dist/enums/media-condition.enum.d.ts +0 -14
- package/dist/enums/media-condition.enum.js +0 -17
- package/dist/enums/stort.enum.d.ts +0 -62
- package/dist/enums/stort.enum.js +0 -65
- package/dist/enums/style.enum.d.ts +0 -255
- package/dist/enums/style.enum.js +0 -258
- package/dist/enums/type.enum.d.ts +0 -30
- package/dist/enums/type.enum.js +0 -33
- package/dist/interfaces/index.d.ts +0 -6
- package/dist/interfaces/input.interface.d.ts +0 -80
- package/dist/interfaces/item.interface.d.ts +0 -91
- package/dist/interfaces/output-sucess.interface.d.ts +0 -32
- package/dist/interfaces/year.interface.d.ts +0 -9
- package/dist/types/index.d.ts +0 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const CURRENCIES = {
|
|
4
|
+
$US: 'USD',
|
|
5
|
+
US$: 'USD',
|
|
6
|
+
USD: 'USD',
|
|
7
|
+
'£GB': 'GBP',
|
|
8
|
+
GBP: 'GBP',
|
|
9
|
+
$CA: 'CAD',
|
|
10
|
+
CA$: 'CAD',
|
|
11
|
+
CAD: 'CAD',
|
|
12
|
+
$AU: 'AUD',
|
|
13
|
+
AU$: 'AUD',
|
|
14
|
+
AUD: 'AUD',
|
|
15
|
+
JPY: 'JPY',
|
|
16
|
+
CHF: 'CHF',
|
|
17
|
+
MX$: 'MXN',
|
|
18
|
+
$MX: 'MXN',
|
|
19
|
+
MXN: 'MXN',
|
|
20
|
+
$NZ: 'NZD',
|
|
21
|
+
NZ$: 'NZD',
|
|
22
|
+
NZD: 'NZD',
|
|
23
|
+
SEK: 'SEK',
|
|
24
|
+
ZAR: 'ZAR',
|
|
25
|
+
BRL: 'BRL',
|
|
26
|
+
DKK: 'DKK',
|
|
27
|
+
A$: 'AUD',
|
|
28
|
+
R$: 'BRL',
|
|
29
|
+
EUR: 'EUR',
|
|
30
|
+
'€': 'EUR',
|
|
31
|
+
$: 'USD',
|
|
32
|
+
'£': 'GBP',
|
|
33
|
+
'¥': 'JPY',
|
|
34
|
+
};
|
|
35
|
+
exports.default = CURRENCIES;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CURRENCIES = exports.COUNTRIES = void 0;
|
|
7
|
+
const countries_data_1 = __importDefault(require("../data/countries.data.js"));
|
|
8
|
+
exports.COUNTRIES = countries_data_1.default;
|
|
9
|
+
const currencies_data_1 = __importDefault(require("../data/currencies.data.js"));
|
|
10
|
+
exports.CURRENCIES = currencies_data_1.default;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IYears, IInput, IOutputSuccess, IOutputError, IItem } from './interfaces/index.js';
|
|
3
|
-
import { LimitType } from './types/index.js';
|
|
1
|
+
import { InputType, OutputErrorType, OutputSuccessType } from './types/commons/index.js';
|
|
4
2
|
import DiscogsMarketplace from './marketplace.js';
|
|
5
|
-
export {
|
|
6
|
-
export { IInput, IItem, IOutputError, IOutputSuccess, IYears, };
|
|
7
|
-
export { LimitType, };
|
|
3
|
+
export { InputType, OutputErrorType, OutputSuccessType, };
|
|
8
4
|
export default DiscogsMarketplace;
|
package/dist/index.js
CHANGED
|
@@ -3,17 +3,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EType = exports.EStyle = exports.ESort = exports.EMediaCondition = exports.ELang = exports.EGenre = exports.EFrom = exports.EFormatDescription = exports.EFormat = exports.ECurrency = void 0;
|
|
7
|
-
const enums_1 = require("./enums/index.js");
|
|
8
|
-
Object.defineProperty(exports, "ECurrency", { enumerable: true, get: function () { return enums_1.ECurrency; } });
|
|
9
|
-
Object.defineProperty(exports, "EFormat", { enumerable: true, get: function () { return enums_1.EFormat; } });
|
|
10
|
-
Object.defineProperty(exports, "EFormatDescription", { enumerable: true, get: function () { return enums_1.EFormatDescription; } });
|
|
11
|
-
Object.defineProperty(exports, "EFrom", { enumerable: true, get: function () { return enums_1.EFrom; } });
|
|
12
|
-
Object.defineProperty(exports, "EGenre", { enumerable: true, get: function () { return enums_1.EGenre; } });
|
|
13
|
-
Object.defineProperty(exports, "ELang", { enumerable: true, get: function () { return enums_1.ELang; } });
|
|
14
|
-
Object.defineProperty(exports, "EMediaCondition", { enumerable: true, get: function () { return enums_1.EMediaCondition; } });
|
|
15
|
-
Object.defineProperty(exports, "ESort", { enumerable: true, get: function () { return enums_1.ESort; } });
|
|
16
|
-
Object.defineProperty(exports, "EStyle", { enumerable: true, get: function () { return enums_1.EStyle; } });
|
|
17
|
-
Object.defineProperty(exports, "EType", { enumerable: true, get: function () { return enums_1.EType; } });
|
|
18
6
|
const marketplace_1 = __importDefault(require("./marketplace.js"));
|
|
19
7
|
exports.default = marketplace_1.default;
|
package/dist/marketplace.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IInput, IOutputSuccess } from './interfaces/index.js';
|
|
2
1
|
/**
|
|
3
2
|
* Discogs Marketplace
|
|
4
3
|
*/
|
|
@@ -7,7 +6,7 @@ export default abstract class Marketplace {
|
|
|
7
6
|
* Search elements on discogs
|
|
8
7
|
* @returns Items found
|
|
9
8
|
*/
|
|
10
|
-
static search({ searchType, searchValue, currency, genre, style, format, formatDescription,
|
|
9
|
+
static search({ searchType, searchValue, currency, genre, style, format, formatDescription, condition, year, years, isAudioSample, isMakeAnOfferOnly, from, seller, sort, limit, page, lang, }: import('./types/commons/index.js').InputType): Promise<import('./types/commons/index.js').OutputSuccessType>;
|
|
11
10
|
/**
|
|
12
11
|
* Generate URL to be parsed
|
|
13
12
|
* @returns Url
|
package/dist/marketplace.js
CHANGED
|
@@ -12,11 +12,9 @@ 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");
|
|
15
16
|
const user_agents_1 = __importDefault(require("user-agents"));
|
|
16
17
|
const linkedom_1 = require("linkedom");
|
|
17
|
-
const enums_1 = require("./enums/index.js");
|
|
18
|
-
const translate_1 = require("./enums/iso/translate/index.js");
|
|
19
|
-
const iso_1 = require("./enums/iso/index.js");
|
|
20
18
|
const axios_1 = __importDefault(require("axios"));
|
|
21
19
|
/**
|
|
22
20
|
* Discogs Marketplace
|
|
@@ -26,7 +24,7 @@ class Marketplace {
|
|
|
26
24
|
* Search elements on discogs
|
|
27
25
|
* @returns Items found
|
|
28
26
|
*/
|
|
29
|
-
static search({ searchType =
|
|
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', }) {
|
|
30
28
|
var _a, _b, _c, _d;
|
|
31
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
30
|
try {
|
|
@@ -40,7 +38,7 @@ class Marketplace {
|
|
|
40
38
|
style: (style === null || style === void 0 ? void 0 : style.length) ? style : undefined,
|
|
41
39
|
format: (format === null || format === void 0 ? void 0 : format.length) ? format : undefined,
|
|
42
40
|
format_desc: (formatDescription === null || formatDescription === void 0 ? void 0 : formatDescription.length) ? formatDescription : undefined,
|
|
43
|
-
condition: (
|
|
41
|
+
condition: (condition === null || condition === void 0 ? void 0 : condition.length) ? condition : undefined,
|
|
44
42
|
year: year && !years ? year : undefined,
|
|
45
43
|
year1: (years === null || years === void 0 ? void 0 : years.min) && !year ? years === null || years === void 0 ? void 0 : years.min : undefined,
|
|
46
44
|
year2: (years === null || years === void 0 ? void 0 : years.max) && !year ? years === null || years === void 0 ? void 0 : years.max : undefined,
|
|
@@ -51,7 +49,9 @@ class Marketplace {
|
|
|
51
49
|
page,
|
|
52
50
|
sort,
|
|
53
51
|
},
|
|
54
|
-
paramsSerializer:
|
|
52
|
+
paramsSerializer: {
|
|
53
|
+
serialize: this.serializeParams,
|
|
54
|
+
},
|
|
55
55
|
headers: {
|
|
56
56
|
'X-PJAX': 'true',
|
|
57
57
|
'User-Agent': new user_agents_1.default().toString(),
|
|
@@ -87,11 +87,11 @@ class Marketplace {
|
|
|
87
87
|
let url = `https://www.discogs.com/${lang}/`;
|
|
88
88
|
if (seller) {
|
|
89
89
|
url += `seller/${seller}/`;
|
|
90
|
-
url += searchType ===
|
|
90
|
+
url += searchType === 'user' ? 'mywants' : 'profile';
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
93
|
url += 'sell/';
|
|
94
|
-
url += searchType ===
|
|
94
|
+
url += searchType === 'user' ? 'mywants' : 'list';
|
|
95
95
|
}
|
|
96
96
|
return url;
|
|
97
97
|
}
|
|
@@ -130,14 +130,13 @@ class Marketplace {
|
|
|
130
130
|
var _a;
|
|
131
131
|
if (!value)
|
|
132
132
|
return value;
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
133
|
+
const currencyFound = (_a = Object.keys(data_1.CURRENCIES).find(key => value.includes(key))) !== null && _a !== void 0 ? _a : '';
|
|
134
|
+
if (!currencyFound)
|
|
135
135
|
return value;
|
|
136
|
-
|
|
137
|
-
const currencyClean = translate_1.EDiscogsCurrencyToIsoCode[currency];
|
|
136
|
+
const currencyClean = data_1.CURRENCIES[currencyFound];
|
|
138
137
|
const amount = value
|
|
139
|
-
.replace(currencyClean !==
|
|
140
|
-
.replace(
|
|
138
|
+
.replace(currencyClean !== 'JPY' ? /[.](?=.*[.])/g : /\./g, '') // Remove all dot but last, except if JPY
|
|
139
|
+
.replace(currencyFound, '') // Remove original currency
|
|
141
140
|
.replace(/\s/g, ''); // Remove spaces
|
|
142
141
|
return `${amount} ${currencyClean}`
|
|
143
142
|
.replace(/\s\s+/g, ' '); // Remove useless spaces
|
|
@@ -148,21 +147,20 @@ class Marketplace {
|
|
|
148
147
|
* @param urlGenerated Url generated
|
|
149
148
|
* @returns Items found
|
|
150
149
|
*/
|
|
151
|
-
static getData(document, urlGenerated, { searchType =
|
|
150
|
+
static getData(document, urlGenerated, { searchType = 'q', searchValue = undefined, limit = 25, page = 1, }) {
|
|
152
151
|
var _a, _b, _c, _d, _e;
|
|
153
152
|
const totalItems = parseFloat(
|
|
154
153
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
154
|
((_d = (_c = (_b = (_a = document.querySelector('.pagination_total')) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.split(' ')) === null || _c === void 0 ? void 0 : _c.filter((x) => x).pop()) === null || _d === void 0 ? void 0 : _d.replace(/(,|\.|\s)/g, '')) || '0');
|
|
156
155
|
return {
|
|
157
156
|
items: ((_e = [...document.querySelectorAll('table.table_block tbody tr')]) === null || _e === void 0 ? void 0 : _e.map(el => {
|
|
158
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58;
|
|
159
158
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
160
159
|
const shipping = this.convertCurrency((_g = (_f = (_e = (_d = (_c = (_b = (_a = el.querySelector('.item_shipping')) === null || _a === void 0 ? void 0 : _a.childNodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.textContent) === null || _d === void 0 ? void 0 : _d.replace(/(\s+|\+)/g, ' ')) === null || _e === void 0 ? void 0 : _e.trim()) === null || _f === void 0 ? void 0 : _f.replace(',', '.')) !== null && _g !== void 0 ? _g : '');
|
|
161
160
|
const have = Number.parseInt((_j = (_h = el.querySelector('.community_summary .community_result:nth-child(1) .community_number')) === null || _h === void 0 ? void 0 : _h.textContent) !== null && _j !== void 0 ? _j : '', 10);
|
|
162
161
|
const want = Number.parseInt((_l = (_k = el.querySelector('.community_summary .community_result:nth-child(2) .community_number')) === null || _k === void 0 ? void 0 : _k.textContent) !== null && _l !== void 0 ? _l : '', 10);
|
|
163
|
-
const countryName = (_q = (_p = (_o = (_m = el.querySelector('.seller_info li:nth-child(3)')) === null || _m === void 0 ? void 0 : _m.textContent) === null || _o === void 0 ? void 0 : _o.split(':')) === null || _p === void 0 ? void 0 : _p
|
|
164
|
-
const
|
|
165
|
-
|| translate_1.EDiscogsCountryNameToIsoCode[countryName]);
|
|
162
|
+
const countryName = (_q = (_p = (_o = (_m = el.querySelector('.seller_info li:nth-child(3)')) === null || _m === void 0 ? void 0 : _m.textContent) === null || _o === void 0 ? void 0 : _o.split(':')) === null || _p === void 0 ? void 0 : _p.pop()) !== null && _q !== void 0 ? _q : '';
|
|
163
|
+
const countryCode = data_1.COUNTRIES[countryName];
|
|
166
164
|
const releaseId = Number.parseInt((_v = (_u = (_t = (_s = (_r = el.querySelector('a.item_release_link')) === null || _r === void 0 ? void 0 : _r.href.split('release/')) === null || _s === void 0 ? void 0 : _s.pop()) === null || _t === void 0 ? void 0 : _t.split('-')) === null || _u === void 0 ? void 0 : _u.shift()) !== null && _v !== void 0 ? _v : '0', 10);
|
|
167
165
|
const itemId = Number.parseInt((_y = (_x = (_w = el.querySelector('a.item_description_title')) === null || _w === void 0 ? void 0 : _w.href) === null || _x === void 0 ? void 0 : _x.split('/').pop()) !== null && _y !== void 0 ? _y : '0', 10);
|
|
168
166
|
const notes = Number.parseInt((_5 = (_4 = (_3 = (_2 = (_1 = (_0 = (_z = el.querySelector('.seller_info li:nth-child(2) .section_link')) === null || _z === void 0 ? void 0 : _z.textContent) === null || _0 === void 0 ? void 0 : _0.replace(/\s+/g, ' ')) === null || _1 === void 0 ? void 0 : _1.trim()) === null || _2 === void 0 ? void 0 : _2.split(' ')) === null || _3 === void 0 ? void 0 : _3[0]) === null || _4 === void 0 ? void 0 : _4.replace(/,/g, '')) !== null && _5 !== void 0 ? _5 : '', 10);
|
|
@@ -208,10 +206,9 @@ class Marketplace {
|
|
|
208
206
|
base: this.convertCurrency((_57 = (_56 = (_55 = (_54 = el.querySelector('.price')) === null || _54 === void 0 ? void 0 : _54.textContent) === null || _55 === void 0 ? void 0 : _55.replace(/\s+/g, ' ')) === null || _56 === void 0 ? void 0 : _56.replace(/,/, '.')) !== null && _57 !== void 0 ? _57 : ''),
|
|
209
207
|
shipping: Number.isNaN(parseFloat(shipping)) ? null : shipping,
|
|
210
208
|
},
|
|
211
|
-
|
|
212
|
-
countryName,
|
|
213
|
-
|
|
214
|
-
isoCountryCode,
|
|
209
|
+
country: {
|
|
210
|
+
name: countryName,
|
|
211
|
+
code: countryCode,
|
|
215
212
|
},
|
|
216
213
|
community: {
|
|
217
214
|
have: Number.isNaN(have) ? 0 : have,
|
|
@@ -219,7 +216,7 @@ class Marketplace {
|
|
|
219
216
|
},
|
|
220
217
|
release: {
|
|
221
218
|
id: Number.isNaN(releaseId) ? 0 : releaseId,
|
|
222
|
-
url: `https://www.discogs.com${(
|
|
219
|
+
url: `https://www.discogs.com${(_58 = el.querySelector('a.item_release_link')) === null || _58 === void 0 ? void 0 : _58.href}`,
|
|
223
220
|
},
|
|
224
221
|
};
|
|
225
222
|
})) || [],
|
|
File without changes
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { LimitType, GenreType, CurrencyType, FromType, StyleType, FormatType, ConditionType, SortType, LangType, FormatDescriptionType, SearchTypeType } from '../../types/unions/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Element that can be provided by user
|
|
4
|
+
*/
|
|
5
|
+
type InputCommonType = {
|
|
6
|
+
/**
|
|
7
|
+
* Type of elements to search.
|
|
8
|
+
* Default to `q`.
|
|
9
|
+
* | Name | Description |
|
|
10
|
+
* |:---------: |:--------------------------:|
|
|
11
|
+
* | q | Basic query search |
|
|
12
|
+
* | master_id | Search in a master release |
|
|
13
|
+
* | release_id | Search in a release |
|
|
14
|
+
* | label_id | Search in a label |
|
|
15
|
+
* | artist_id | Search in a artist |
|
|
16
|
+
* | user | Search in user wantlist |
|
|
17
|
+
*/
|
|
18
|
+
searchType: SearchTypeType;
|
|
19
|
+
/**
|
|
20
|
+
* Value to search corresponding to searchType
|
|
21
|
+
*/
|
|
22
|
+
searchValue: string | number | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Currency
|
|
25
|
+
*/
|
|
26
|
+
currency?: CurrencyType;
|
|
27
|
+
/**
|
|
28
|
+
* Genre
|
|
29
|
+
*/
|
|
30
|
+
genre?: GenreType;
|
|
31
|
+
/**
|
|
32
|
+
* Styles
|
|
33
|
+
*/
|
|
34
|
+
style?: StyleType[];
|
|
35
|
+
/**
|
|
36
|
+
* Formats
|
|
37
|
+
*/
|
|
38
|
+
format?: FormatType[];
|
|
39
|
+
/**
|
|
40
|
+
* Format descriptions
|
|
41
|
+
*/
|
|
42
|
+
formatDescription?: FormatDescriptionType[];
|
|
43
|
+
/**
|
|
44
|
+
* Media conditions
|
|
45
|
+
*/
|
|
46
|
+
condition?: ConditionType[];
|
|
47
|
+
/**
|
|
48
|
+
* Year (Do not use it with `years`)
|
|
49
|
+
*/
|
|
50
|
+
year?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Interval of years (Do not use it with `year`)
|
|
53
|
+
*/
|
|
54
|
+
years?: {
|
|
55
|
+
/** Min */
|
|
56
|
+
min: number;
|
|
57
|
+
/** Max */
|
|
58
|
+
max: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Is audio sample ?
|
|
62
|
+
*/
|
|
63
|
+
isAudioSample?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Is make an offer only ?
|
|
66
|
+
*/
|
|
67
|
+
isMakeAnOfferOnly?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Expedition country
|
|
70
|
+
*/
|
|
71
|
+
from?: FromType;
|
|
72
|
+
/**
|
|
73
|
+
* Seller name
|
|
74
|
+
*/
|
|
75
|
+
seller?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Sort elements by
|
|
78
|
+
*/
|
|
79
|
+
sort?: SortType;
|
|
80
|
+
/**
|
|
81
|
+
* Limit of elements to search (25 | 50 | 100 | 250)
|
|
82
|
+
*/
|
|
83
|
+
limit?: LimitType;
|
|
84
|
+
/**
|
|
85
|
+
* Page (Must be < 401 or discogs will return an error 404).
|
|
86
|
+
* Default to `25`.
|
|
87
|
+
*/
|
|
88
|
+
page?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Lang to use for Discogs.
|
|
91
|
+
* Default to `en`.
|
|
92
|
+
*/
|
|
93
|
+
lang?: LangType;
|
|
94
|
+
};
|
|
95
|
+
export default InputCommonType;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { SearchTypeType } from '../../types/unions/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Result provided to user
|
|
4
|
+
*/
|
|
5
|
+
type OutputSuccessType = {
|
|
6
|
+
/** Items */
|
|
7
|
+
items: {
|
|
8
|
+
/** Id */
|
|
9
|
+
id: number;
|
|
10
|
+
/** Title */
|
|
11
|
+
title: {
|
|
12
|
+
/** Original */
|
|
13
|
+
original: string;
|
|
14
|
+
/** Artist */
|
|
15
|
+
artist: string;
|
|
16
|
+
/** Item */
|
|
17
|
+
item: string;
|
|
18
|
+
/** Formats */
|
|
19
|
+
formats: string[];
|
|
20
|
+
};
|
|
21
|
+
/** Url */
|
|
22
|
+
url: string;
|
|
23
|
+
/** Labels */
|
|
24
|
+
labels: string[];
|
|
25
|
+
/** Catnos */
|
|
26
|
+
catnos: string[];
|
|
27
|
+
/** ImageUrl */
|
|
28
|
+
imageUrl: string;
|
|
29
|
+
/** Description */
|
|
30
|
+
description: string;
|
|
31
|
+
/** IsAcceptingOffer */
|
|
32
|
+
isAcceptingOffer: boolean;
|
|
33
|
+
/** IsAvailable */
|
|
34
|
+
isAvailable: boolean;
|
|
35
|
+
/** Condition */
|
|
36
|
+
condition: {
|
|
37
|
+
/** Media */
|
|
38
|
+
media: {
|
|
39
|
+
/** Full */
|
|
40
|
+
full: string;
|
|
41
|
+
/** Short */
|
|
42
|
+
short: string;
|
|
43
|
+
};
|
|
44
|
+
/** Sleeve */
|
|
45
|
+
sleeve: {
|
|
46
|
+
/** Full */
|
|
47
|
+
full: string;
|
|
48
|
+
/** Short */
|
|
49
|
+
short: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** Seller */
|
|
53
|
+
seller: {
|
|
54
|
+
/** Name */
|
|
55
|
+
name: string;
|
|
56
|
+
/** Url */
|
|
57
|
+
url: string;
|
|
58
|
+
/** Score */
|
|
59
|
+
score: string;
|
|
60
|
+
/** Notes */
|
|
61
|
+
notes: number;
|
|
62
|
+
};
|
|
63
|
+
/** Price */
|
|
64
|
+
price: {
|
|
65
|
+
/** Base */
|
|
66
|
+
base: string;
|
|
67
|
+
/** Shipping */
|
|
68
|
+
shipping: string;
|
|
69
|
+
};
|
|
70
|
+
/** From */
|
|
71
|
+
country: {
|
|
72
|
+
/** Name */
|
|
73
|
+
name: string;
|
|
74
|
+
/** Iso code */
|
|
75
|
+
code: string;
|
|
76
|
+
};
|
|
77
|
+
/** Community */
|
|
78
|
+
community: {
|
|
79
|
+
/** Have */
|
|
80
|
+
have: number;
|
|
81
|
+
/** Want */
|
|
82
|
+
want: number;
|
|
83
|
+
};
|
|
84
|
+
/** Release */
|
|
85
|
+
release: {
|
|
86
|
+
/** Id */
|
|
87
|
+
id: number;
|
|
88
|
+
/** Url */
|
|
89
|
+
url: string;
|
|
90
|
+
};
|
|
91
|
+
}[];
|
|
92
|
+
/** Page */
|
|
93
|
+
page: {
|
|
94
|
+
/** Current */
|
|
95
|
+
current: number;
|
|
96
|
+
/** Total */
|
|
97
|
+
total: number;
|
|
98
|
+
};
|
|
99
|
+
/** Result */
|
|
100
|
+
result: {
|
|
101
|
+
/** Total */
|
|
102
|
+
total: number;
|
|
103
|
+
/** PerPage */
|
|
104
|
+
perPage: number;
|
|
105
|
+
};
|
|
106
|
+
/** Search */
|
|
107
|
+
search: {
|
|
108
|
+
/** Value */
|
|
109
|
+
value: string | number;
|
|
110
|
+
/** Type */
|
|
111
|
+
type: SearchTypeType;
|
|
112
|
+
};
|
|
113
|
+
/** UrlGenerated */
|
|
114
|
+
urlGenerated: string;
|
|
115
|
+
};
|
|
116
|
+
export default OutputSuccessType;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormatDescriptions
|
|
3
|
+
*/
|
|
4
|
+
type FormatDescriptionType = '1 ⅞ ips' | '1"' | '10"' | '10.5" NAB Reel' | '11"' | '12"' | '15 ips' | '15/16 ips' | '16 ⅔ RPM' | '16"' | '16mm' | '2 Minute' | '2"' | '2-Track Mono' | '2-Track Stereo' | '21cm' | '25cm' | '27cm' | '29cm' | '3 Minute' | '3 ¾ ips' | '3"' | '3" Cine Reel' | '3.5"' | '30 ips' | '33 ⅓ RPM' | '35cm' | '35mm' | '3½"' | '4 Minute' | '4"' | '4-Track Mono' | '4-Track Stereo' | '45 RPM' | '4K' | '5"' | '5" Cine Reel' | '5.25"' | '50cm' | '5½"' | '6"' | '6" Cine Reel' | '6½"' | '7 ½ ips' | '7"' | '7" Cine Reel' | '78 RPM' | '8 ⅓ RPM' | '8"' | '80 RPM' | '8K' | '9"' | '90 RPM' | 'AAC' | 'AIFC' | 'AIFF' | 'ALAC' | 'AMR' | 'APE' | 'AVCD' | 'AVI' | 'Advance' | 'Album' | 'Ambisonic' | 'Bioplastic' | 'Blu-ray Audio' | 'Business Card' | 'CD+G' | 'CD-ROM' | 'CD-Record' | 'CDi' | 'Card Backed' | 'Club Edition' | 'Compilation' | 'Concert' | 'Copy Protected' | 'DFF' | 'DSF' | 'DVD-Audio' | 'DVD-Data' | 'DVD-Video' | 'DVDplus' | 'Deluxe Edition' | 'Disc Image' | 'Double Sided' | 'DualDisc' | 'EP' | 'Enhanced' | 'Etched' | 'FLAC' | 'FLV' | 'HDCD' | 'Hybrid' | 'Jukebox' | 'LP' | 'Limited Edition' | 'MOV' | 'MP2' | 'MP3' | 'MP3 Surround' | 'MPEG Video' | 'MPEG-4 Video' | 'Maxi-Single' | 'Mini' | 'Mini-Album' | 'Minimax' | 'Mispress' | 'Misprint' | 'Mixed' | 'Mixtape' | 'Mono' | 'Multichannel' | 'NTSC' | 'Numbered' | 'Opus' | 'PAL' | 'Partially Mixed' | 'Partially Unofficial' | 'Picture Disc' | 'Promo' | 'Quadraphonic' | 'RA' | 'RM' | 'Reissue' | 'Remastered' | 'Repress' | 'SECAM' | 'SHN' | 'SVCD' | 'SWF' | 'Salon' | 'Sampler' | 'Shape' | 'Single' | 'Single Sided' | 'Special Edition' | 'Stereo' | 'Styrene' | 'TTA' | 'Test Pressing' | 'Transcription' | 'Unofficial Release' | 'VCD' | 'VinylDisc' | 'WAV' | 'WMA' | 'WMV' | 'WavPack' | 'White Label' | 'XRCD' | 'ogg-vorbis' | '¼"' | '½"' | '⅛"';
|
|
5
|
+
export default FormatDescriptionType;
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats
|
|
3
|
+
*/
|
|
4
|
+
type FormatType = '4-Track Cartridge' | '8-Track Cartridge' | 'Acetate' | 'All Media' | 'Betacam' | 'Betacam SP' | 'Betamax' | 'Blu-ray' | 'Blu-ray-R' | 'Box Set' | 'CD' | 'CDV' | 'CDr' | 'Cartrivision' | 'Cassette' | 'Cylinder' | 'DAT' | 'DC-International' | 'DCC' | 'DVD' | 'DVDr' | 'Edison Disc' | 'Elcaset' | 'File' | 'Film Reel' | 'Flexi-disc' | 'Floppy Disk' | 'HD DVD' | 'HD DVD-R' | 'HitClips' | 'Hybrid' | 'Laserdisc' | 'Lathe Cut' | 'MVD' | 'Memory Stick' | 'Microcassette' | 'Mighty Tiny' | 'MiniDV' | 'Minidisc' | 'NT Cassette' | 'Pathé Disc' | 'PlayTape' | 'Pocket Rocker' | 'RCA Tape Cartridge' | 'Reel-To-Reel' | 'Revere Magnetic Stereo Tape Ca' | 'SACD' | 'Sabamobil' | 'SelectaVision' | 'Shellac' | 'Sopic' | 'Super VHS' | 'TeD' | 'Tefifon' | 'U-matic' | 'UMD' | 'Ultra HD Blu-ray' | 'VHD' | 'VHS' | 'Video 2000' | 'Video8' | 'Vinyl' | 'Wire Recording';
|
|
5
|
+
export default FormatType;
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Froms
|
|
3
|
+
*/
|
|
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
|
+
export default FromType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Genres
|
|
3
|
+
*/
|
|
4
|
+
type GenreType = 'Blues' | 'Brass & Military' | "Children's" | 'Classical' | 'Electronic' | 'Folk, World, & Country' | 'Funk / Soul' | 'Hip Hop' | 'Jazz' | 'Latin' | 'Non-Music' | 'Pop' | 'Reggae' | 'Rock' | 'Stage & Screen';
|
|
5
|
+
export default GenreType;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import LimitType from '../../types/unions/limit.type.js';
|
|
2
|
+
import GenreType from '../../types/unions/genre.type.js';
|
|
3
|
+
import CurrencyType from '../../types/unions/currency.type.js';
|
|
4
|
+
import FromType from '../../types/unions/from.type.js';
|
|
5
|
+
import StyleType from '../../types/unions/style.type.js';
|
|
6
|
+
import FormatType from '../../types/unions/format.type.js';
|
|
7
|
+
import ConditionType from '../../types/unions/condition.type.js';
|
|
8
|
+
import SortType from '../../types/unions/sort.type.js';
|
|
9
|
+
import LangType from '../../types/unions/lang.type.js';
|
|
10
|
+
import FormatDescriptionType from '../../types/unions/format-description.type.js';
|
|
11
|
+
import SearchTypeType from '../../types/unions/search-type.type.js';
|
|
12
|
+
export { LimitType, GenreType, CurrencyType, FromType, StyleType, FormatType, ConditionType, SortType, LangType, FormatDescriptionType, SearchTypeType, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sorts
|
|
3
|
+
*/
|
|
4
|
+
type SortType = 'Artist A-Z' | 'Artist Z-A' | 'Condition (M)-(P)' | 'Condition (P)-(M)' | 'Label A-Z' | 'Label Z-A' | 'Listed Newest' | 'Listed Oldest' | 'Price Highest' | 'Price Lowest' | 'Seller A-Z' | 'Seller Z-A' | 'Title A-Z' | 'Title Z-A';
|
|
5
|
+
export default SortType;
|