discogs-marketplace-api-nodejs 1.3.9 → 1.4.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 +1 -1
- package/dist/{enum/ECurrency.d.ts → enums/currency.enum.d.ts} +0 -0
- package/dist/{enum/ECurrency.js → enums/currency.enum.js} +0 -0
- package/dist/{enum/EFormatDescription.d.ts → enums/format-description.enum.d.ts} +0 -0
- package/dist/{enum/EFormatDescription.js → enums/format-description.enum.js} +0 -0
- package/dist/{enum/EFormat.d.ts → enums/format.enum.d.ts} +0 -0
- package/dist/{enum/EFormat.js → enums/format.enum.js} +0 -0
- package/dist/{enum/EFrom.d.ts → enums/from.enum.d.ts} +0 -0
- package/dist/{enum/EFrom.js → enums/from.enum.js} +0 -1
- package/dist/{enum/EGenre.d.ts → enums/genre.enum.d.ts} +0 -0
- package/dist/{enum/EGenre.js → enums/genre.enum.js} +0 -0
- package/dist/enums/index.d.ts +11 -0
- package/dist/enums/index.js +26 -0
- package/dist/{enum/iso/ECountryCode.d.ts → enums/iso/country-code.enum.d.ts} +0 -0
- package/dist/{enum/iso/ECountryCode.js → enums/iso/country-code.enum.js} +0 -0
- package/dist/{enum/iso/ECountryName.d.ts → enums/iso/country-name.enum.d.ts} +0 -0
- package/dist/{enum/iso/ECountryName.js → enums/iso/country-name.enum.js} +0 -0
- package/dist/enums/iso/index.d.ts +3 -0
- package/dist/enums/iso/index.js +10 -0
- package/dist/{enum/iso/EDiscogsCountryNameToIsoCode.d.ts → enums/iso/translate/discogs-country-name-to-iso-code.enum.d.ts} +0 -0
- package/dist/{enum/iso/EDiscogsCountryNameToIsoCode.js → enums/iso/translate/discogs-country-name-to-iso-code.enum.js} +0 -0
- package/dist/{enum/iso/translate/EDiscogsCurrencyToIsoCode.d.ts → enums/iso/translate/discogs-currency-to-iso-code.enum.d.ts} +0 -0
- package/dist/{enum/iso/translate/EDiscogsCurrencyToIsoCode.js → enums/iso/translate/discogs-currency-to-iso-code.enum.js} +0 -0
- package/dist/enums/iso/translate/index.d.ts +3 -0
- package/dist/enums/iso/translate/index.js +10 -0
- package/dist/{enum/ELang.d.ts → enums/lang.enum.d.ts} +0 -0
- package/dist/{enum/ELang.js → enums/lang.enum.js} +0 -0
- package/dist/{enum/EMediaCondition.d.ts → enums/media-condition.enum.d.ts} +0 -0
- package/dist/{enum/EMediaCondition.js → enums/media-condition.enum.js} +0 -0
- package/dist/{enum/ESort.d.ts → enums/stort.enum.d.ts} +0 -0
- package/dist/{enum/ESort.js → enums/stort.enum.js} +0 -0
- package/dist/{enum/EStyle.d.ts → enums/style.enum.d.ts} +0 -0
- package/dist/{enum/EStyle.js → enums/style.enum.js} +0 -0
- package/dist/{enum/EType.d.ts → enums/type.enum.d.ts} +0 -0
- package/dist/{enum/EType.js → enums/type.enum.js} +0 -0
- package/dist/index.d.ts +6 -20
- package/dist/index.js +13 -34
- package/dist/interfaces/index.d.ts +6 -0
- package/dist/{interface/IOutputError.js → interfaces/index.js} +0 -0
- package/dist/{interface/IInput.d.ts → interfaces/input.interface.d.ts} +4 -13
- package/dist/{interface/IYears.js → interfaces/input.interface.js} +0 -0
- package/dist/{interface/IItem.d.ts → interfaces/item.interface.d.ts} +39 -2
- package/dist/{type/TLimit.js → interfaces/item.interface.js} +0 -0
- package/dist/{interface/IOutputError.d.ts → interfaces/output-error.interface.d.ts} +2 -0
- package/dist/interfaces/output-error.interface.js +2 -0
- package/dist/{interface/IOutputSuccess.d.ts → interfaces/output-sucess.interface.d.ts} +13 -2
- package/dist/interfaces/output-sucess.interface.js +2 -0
- package/dist/{interface/IYears.d.ts → interfaces/year.interface.d.ts} +2 -0
- package/dist/interfaces/year.interface.js +2 -0
- package/dist/marketplace.d.ts +9 -30
- package/dist/marketplace.js +69 -96
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/limit.type.d.ts +5 -0
- package/dist/types/limit.type.js +2 -0
- package/package.json +22 -21
- package/dist/enum/EFromIso.d.ts +0 -316
- package/dist/enum/EFromIso.js +0 -321
- package/dist/enum/iso/EDiscogsCurrencyToIsoCode.d.ts +0 -23
- package/dist/enum/iso/EDiscogsCurrencyToIsoCode.js +0 -26
- package/dist/enum/iso/translate/EDiscogsCountryNameToIsoCode.d.ts +0 -69
- package/dist/enum/iso/translate/EDiscogsCountryNameToIsoCode.js +0 -72
- package/dist/enum/iso/translates/EDiscogsCountryNameToIsoCode.d.ts +0 -69
- package/dist/enum/iso/translates/EDiscogsCountryNameToIsoCode.js +0 -72
- package/dist/enum/iso/translates/EDiscogsCurrencyToIsoCode.d.ts +0 -23
- package/dist/enum/iso/translates/EDiscogsCurrencyToIsoCode.js +0 -26
- package/dist/interface/IDiscogsMarketplace.d.ts +0 -11
- package/dist/interface/IDiscogsMarketplace.js +0 -7
- package/dist/interface/IInput.js +0 -17
- package/dist/interface/IItem.js +0 -7
- package/dist/interface/IOutputSuccess.js +0 -7
- package/dist/type/TLimit.d.ts +0 -5
package/README.MD
CHANGED
|
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
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ECurrency from '../enums/currency.enum.js';
|
|
2
|
+
import EFormat from '../enums/format.enum.js';
|
|
3
|
+
import EFormatDescription from '../enums/format-description.enum.js';
|
|
4
|
+
import EFrom from '../enums/from.enum.js';
|
|
5
|
+
import EGenre from '../enums/genre.enum.js';
|
|
6
|
+
import ELang from '../enums/lang.enum.js';
|
|
7
|
+
import EMediaCondition from '../enums/media-condition.enum.js';
|
|
8
|
+
import ESort from '../enums/stort.enum.js';
|
|
9
|
+
import EStyle from '../enums/style.enum.js';
|
|
10
|
+
import EType from '../enums/type.enum.js';
|
|
11
|
+
export { ECurrency, EFormat, EFormatDescription, EFrom, EGenre, ELang, EMediaCondition, ESort, EStyle, EType, };
|
|
@@ -0,0 +1,26 @@
|
|
|
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.EType = exports.EStyle = exports.ESort = exports.EMediaCondition = exports.ELang = exports.EGenre = exports.EFrom = exports.EFormatDescription = exports.EFormat = exports.ECurrency = void 0;
|
|
7
|
+
const currency_enum_1 = __importDefault(require("../enums/currency.enum.js"));
|
|
8
|
+
exports.ECurrency = currency_enum_1.default;
|
|
9
|
+
const format_enum_1 = __importDefault(require("../enums/format.enum.js"));
|
|
10
|
+
exports.EFormat = format_enum_1.default;
|
|
11
|
+
const format_description_enum_1 = __importDefault(require("../enums/format-description.enum.js"));
|
|
12
|
+
exports.EFormatDescription = format_description_enum_1.default;
|
|
13
|
+
const from_enum_1 = __importDefault(require("../enums/from.enum.js"));
|
|
14
|
+
exports.EFrom = from_enum_1.default;
|
|
15
|
+
const genre_enum_1 = __importDefault(require("../enums/genre.enum.js"));
|
|
16
|
+
exports.EGenre = genre_enum_1.default;
|
|
17
|
+
const lang_enum_1 = __importDefault(require("../enums/lang.enum.js"));
|
|
18
|
+
exports.ELang = lang_enum_1.default;
|
|
19
|
+
const media_condition_enum_1 = __importDefault(require("../enums/media-condition.enum.js"));
|
|
20
|
+
exports.EMediaCondition = media_condition_enum_1.default;
|
|
21
|
+
const stort_enum_1 = __importDefault(require("../enums/stort.enum.js"));
|
|
22
|
+
exports.ESort = stort_enum_1.default;
|
|
23
|
+
const style_enum_1 = __importDefault(require("../enums/style.enum.js"));
|
|
24
|
+
exports.EStyle = style_enum_1.default;
|
|
25
|
+
const type_enum_1 = __importDefault(require("../enums/type.enum.js"));
|
|
26
|
+
exports.EType = type_enum_1.default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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.ECountryName = exports.ECountryCode = void 0;
|
|
7
|
+
const country_code_enum_1 = __importDefault(require("../../enums/iso/country-code.enum.js"));
|
|
8
|
+
exports.ECountryCode = country_code_enum_1.default;
|
|
9
|
+
const country_name_enum_1 = __importDefault(require("../../enums/iso/country-name.enum.js"));
|
|
10
|
+
exports.ECountryName = country_name_enum_1.default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import EDiscogsCountryNameToIsoCode from '../../../enums/iso/translate/discogs-country-name-to-iso-code.enum.js';
|
|
2
|
+
import EDiscogsCurrencyToIsoCode from '../../../enums/iso/translate/discogs-currency-to-iso-code.enum.js';
|
|
3
|
+
export { EDiscogsCountryNameToIsoCode, EDiscogsCurrencyToIsoCode, };
|
|
@@ -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.EDiscogsCurrencyToIsoCode = exports.EDiscogsCountryNameToIsoCode = void 0;
|
|
7
|
+
const discogs_country_name_to_iso_code_enum_1 = __importDefault(require("../../../enums/iso/translate/discogs-country-name-to-iso-code.enum.js"));
|
|
8
|
+
exports.EDiscogsCountryNameToIsoCode = discogs_country_name_to_iso_code_enum_1.default;
|
|
9
|
+
const discogs_currency_to_iso_code_enum_1 = __importDefault(require("../../../enums/iso/translate/discogs-currency-to-iso-code.enum.js"));
|
|
10
|
+
exports.EDiscogsCurrencyToIsoCode = discogs_currency_to_iso_code_enum_1.default;
|
|
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
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import ECurrency from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import EGenre from "./enum/EGenre";
|
|
6
|
-
import ELang from "./enum/ELang";
|
|
7
|
-
import EMediaCondition from "./enum/EMediaCondition";
|
|
8
|
-
import ESort from "./enum/ESort";
|
|
9
|
-
import EStyle from "./enum/EStyle";
|
|
10
|
-
import EType from "./enum/EType";
|
|
11
|
-
import { IDiscogsMarketplace } from "./interface/IDiscogsMarketplace";
|
|
12
|
-
import IInput from "./interface/IInput";
|
|
13
|
-
import IItem from "./interface/IItem";
|
|
14
|
-
import IOutputError from "./interface/IOutputError";
|
|
15
|
-
import IOutputSuccess from "./interface/IOutputSuccess";
|
|
16
|
-
import IYears from "./interface/IYears";
|
|
17
|
-
import TLimit from "./type/TLimit";
|
|
1
|
+
import { ECurrency, EFormat, EFormatDescription, EFrom, EGenre, ELang, EMediaCondition, ESort, EStyle, EType } from './enums/index.js';
|
|
2
|
+
import { IYears, IInput, IOutputSuccess, IOutputError, IItem } from './interfaces/index.js';
|
|
3
|
+
import { LimitType } from './types/index.js';
|
|
4
|
+
import DiscogsMarketplace from './marketplace.js';
|
|
18
5
|
export { ECurrency, EFormat, EFormatDescription, EFrom, EGenre, ELang, EMediaCondition, ESort, EStyle, EType, };
|
|
19
|
-
export { IInput, IItem, IOutputError, IOutputSuccess, IYears,
|
|
20
|
-
export {
|
|
21
|
-
declare const DiscogsMarketplace: IDiscogsMarketplace;
|
|
6
|
+
export { IInput, IItem, IOutputError, IOutputSuccess, IYears, };
|
|
7
|
+
export { LimitType, };
|
|
22
8
|
export default DiscogsMarketplace;
|
package/dist/index.js
CHANGED
|
@@ -4,37 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
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
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
exports
|
|
11
|
-
|
|
12
|
-
exports
|
|
13
|
-
|
|
14
|
-
exports
|
|
15
|
-
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.EMediaCondition = EMediaCondition_1.default;
|
|
21
|
-
const ESort_1 = __importDefault(require("./enum/ESort"));
|
|
22
|
-
exports.ESort = ESort_1.default;
|
|
23
|
-
const EStyle_1 = __importDefault(require("./enum/EStyle"));
|
|
24
|
-
exports.EStyle = EStyle_1.default;
|
|
25
|
-
const EType_1 = __importDefault(require("./enum/EType"));
|
|
26
|
-
exports.EType = EType_1.default;
|
|
27
|
-
const IInput_1 = __importDefault(require("./interface/IInput"));
|
|
28
|
-
const IItem_1 = __importDefault(require("./interface/IItem"));
|
|
29
|
-
const IOutputError_1 = __importDefault(require("./interface/IOutputError"));
|
|
30
|
-
const IOutputSuccess_1 = __importDefault(require("./interface/IOutputSuccess"));
|
|
31
|
-
const IYears_1 = __importDefault(require("./interface/IYears"));
|
|
32
|
-
const TLimit_1 = __importDefault(require("./type/TLimit"));
|
|
33
|
-
const marketplace_1 = __importDefault(require("./marketplace"));
|
|
34
|
-
const DiscogsMarketplace = {
|
|
35
|
-
search: (data) => {
|
|
36
|
-
const marketplace = new marketplace_1.default(data);
|
|
37
|
-
return marketplace.search();
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
exports.default = DiscogsMarketplace;
|
|
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
|
+
const marketplace_1 = __importDefault(require("./marketplace.js"));
|
|
19
|
+
exports.default = marketplace_1.default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import IInput from '../interfaces/input.interface.js';
|
|
2
|
+
import IItem from '../interfaces/item.interface.js';
|
|
3
|
+
import IOutputError from '../interfaces/output-error.interface.js';
|
|
4
|
+
import IOutputSuccess from '../interfaces/output-sucess.interface.js';
|
|
5
|
+
import IYears from '../interfaces/year.interface.js';
|
|
6
|
+
export { IInput, IItem, IOutputError, IOutputSuccess, IYears, };
|
|
File without changes
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import EFrom from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import EGenre from "../enum/EGenre";
|
|
5
|
-
import EStyle from "../enum/EStyle";
|
|
6
|
-
import EMediaCondition from "../enum/EMediaCondition";
|
|
7
|
-
import ESort from "../enum/ESort";
|
|
8
|
-
import TLimit from "../type/TLimit";
|
|
9
|
-
import IYears from "./IYears";
|
|
10
|
-
import EFormat from "../enum/EFormat";
|
|
11
|
-
import EFormatDescription from "../enum/EFormatDescription";
|
|
12
|
-
import ELang from "../enum/ELang";
|
|
1
|
+
import { ECurrency, EFormat, EFormatDescription, EFrom, EGenre, ELang, EMediaCondition, ESort, EStyle, EType } from '../enums/index.js';
|
|
2
|
+
import { LimitType } from '../types/index.js';
|
|
3
|
+
import IYears from '../interfaces/year.interface.js';
|
|
13
4
|
/**
|
|
14
5
|
* Element that can be provided by user
|
|
15
6
|
*/
|
|
@@ -77,7 +68,7 @@ export default interface IInput {
|
|
|
77
68
|
/**
|
|
78
69
|
* Limit of elements to search (25 | 50 | 100 | 250)
|
|
79
70
|
*/
|
|
80
|
-
limit?:
|
|
71
|
+
limit?: LimitType;
|
|
81
72
|
/**
|
|
82
73
|
* Page (Must be < 401 or discogs will return an error 404)
|
|
83
74
|
*/
|
|
File without changes
|
|
@@ -1,54 +1,91 @@
|
|
|
1
|
-
import ECountryCode from
|
|
2
|
-
import ECountryName from "../enum/iso/ECountryName";
|
|
1
|
+
import { ECountryCode, ECountryName } from '../enums/iso/index.js';
|
|
3
2
|
/**
|
|
4
3
|
* One item from discogs
|
|
5
4
|
*/
|
|
6
5
|
export default interface IItem {
|
|
6
|
+
/** Id */
|
|
7
7
|
id: number;
|
|
8
|
+
/** Title */
|
|
8
9
|
title: {
|
|
10
|
+
/** Original */
|
|
9
11
|
original: string;
|
|
12
|
+
/** Artist */
|
|
10
13
|
artist: string;
|
|
14
|
+
/** Item */
|
|
11
15
|
item: string;
|
|
16
|
+
/** Formats */
|
|
12
17
|
formats: string[];
|
|
13
18
|
};
|
|
19
|
+
/** Url */
|
|
14
20
|
url: string;
|
|
21
|
+
/** Labels */
|
|
15
22
|
labels: string[];
|
|
23
|
+
/** Catnos */
|
|
16
24
|
catnos: string[];
|
|
25
|
+
/** ImageUrl */
|
|
17
26
|
imageUrl: string;
|
|
27
|
+
/** Description */
|
|
18
28
|
description: string;
|
|
29
|
+
/** IsAcceptingOffer */
|
|
19
30
|
isAcceptingOffer: boolean;
|
|
31
|
+
/** IsAvailable */
|
|
20
32
|
isAvailable: boolean;
|
|
33
|
+
/** Condition */
|
|
21
34
|
condition: {
|
|
35
|
+
/** Media */
|
|
22
36
|
media: {
|
|
37
|
+
/** Full */
|
|
23
38
|
full: string;
|
|
39
|
+
/** Short */
|
|
24
40
|
short: string;
|
|
25
41
|
};
|
|
42
|
+
/** Sleeve */
|
|
26
43
|
sleeve: {
|
|
44
|
+
/** Full */
|
|
27
45
|
full: string;
|
|
46
|
+
/** Short */
|
|
28
47
|
short: string;
|
|
29
48
|
};
|
|
30
49
|
};
|
|
50
|
+
/** Seller */
|
|
31
51
|
seller: {
|
|
52
|
+
/** Name */
|
|
32
53
|
name: string;
|
|
54
|
+
/** Url */
|
|
33
55
|
url: string;
|
|
56
|
+
/** Score */
|
|
34
57
|
score: string;
|
|
58
|
+
/** Notes */
|
|
35
59
|
notes: number;
|
|
36
60
|
};
|
|
61
|
+
/** Price */
|
|
37
62
|
price: {
|
|
63
|
+
/** Base */
|
|
38
64
|
base: string;
|
|
65
|
+
/** Shipping */
|
|
39
66
|
shipping: string;
|
|
40
67
|
};
|
|
68
|
+
/** From */
|
|
41
69
|
from: {
|
|
70
|
+
/** CountryName */
|
|
42
71
|
countryName: string;
|
|
72
|
+
/** IsoCountryName */
|
|
43
73
|
isoCountryName: ECountryName;
|
|
74
|
+
/** IsoCountryCode */
|
|
44
75
|
isoCountryCode: ECountryCode;
|
|
45
76
|
};
|
|
77
|
+
/** Community */
|
|
46
78
|
community: {
|
|
79
|
+
/** Have */
|
|
47
80
|
have: number;
|
|
81
|
+
/** Want */
|
|
48
82
|
want: number;
|
|
49
83
|
};
|
|
84
|
+
/** Release */
|
|
50
85
|
release: {
|
|
86
|
+
/** Id */
|
|
51
87
|
id: number;
|
|
88
|
+
/** Url */
|
|
52
89
|
url: string;
|
|
53
90
|
};
|
|
54
91
|
}
|
|
File without changes
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { EType } from '../enums/index.js';
|
|
2
|
+
import IItem from '../interfaces/item.interface.js';
|
|
3
3
|
/**
|
|
4
4
|
* Result provided to user
|
|
5
5
|
*/
|
|
6
6
|
export default interface IOutputSuccess {
|
|
7
|
+
/** Items */
|
|
7
8
|
items: IItem[];
|
|
9
|
+
/** Page */
|
|
8
10
|
page: {
|
|
11
|
+
/** Current */
|
|
9
12
|
current: number;
|
|
13
|
+
/** Total */
|
|
10
14
|
total: number;
|
|
11
15
|
};
|
|
16
|
+
/** Result */
|
|
12
17
|
result: {
|
|
18
|
+
/** Total */
|
|
13
19
|
total: number;
|
|
20
|
+
/** PerPage */
|
|
14
21
|
perPage: number;
|
|
15
22
|
};
|
|
23
|
+
/** Search */
|
|
16
24
|
search: {
|
|
25
|
+
/** Value */
|
|
17
26
|
value: string | number;
|
|
27
|
+
/** Type */
|
|
18
28
|
type: EType;
|
|
19
29
|
};
|
|
30
|
+
/** UrlGenerated */
|
|
20
31
|
urlGenerated: string;
|
|
21
32
|
}
|
package/dist/marketplace.d.ts
CHANGED
|
@@ -1,56 +1,35 @@
|
|
|
1
|
-
import IInput from
|
|
2
|
-
import IOutputSuccess from "./interface/IOutputSuccess";
|
|
1
|
+
import { IInput, IOutputSuccess } from './interfaces/index.js';
|
|
3
2
|
/**
|
|
4
3
|
* Discogs Marketplace
|
|
5
4
|
*/
|
|
6
|
-
export default class Marketplace {
|
|
7
|
-
private searchType;
|
|
8
|
-
private searchValue;
|
|
9
|
-
private currency?;
|
|
10
|
-
private genre?;
|
|
11
|
-
private style?;
|
|
12
|
-
private format?;
|
|
13
|
-
private formatDescription?;
|
|
14
|
-
private mediaCondition?;
|
|
15
|
-
private year?;
|
|
16
|
-
private years?;
|
|
17
|
-
private isAudioSample;
|
|
18
|
-
private isMakeAnOfferOnly;
|
|
19
|
-
private from?;
|
|
20
|
-
private seller?;
|
|
21
|
-
private sort;
|
|
22
|
-
private limit;
|
|
23
|
-
private page;
|
|
24
|
-
private lang;
|
|
25
|
-
/** Url generated by Playwright */
|
|
26
|
-
private url;
|
|
27
|
-
constructor({ searchType, searchValue, currency, genre, style, format, formatDescription, mediaCondition, year, years, isAudioSample, isMakeAnOfferOnly, from, seller, sort, limit, page, lang, }: IInput);
|
|
5
|
+
export default abstract class Marketplace {
|
|
28
6
|
/**
|
|
29
7
|
* Search elements on discogs
|
|
30
8
|
* @returns Items found
|
|
31
9
|
*/
|
|
32
|
-
search(): Promise<IOutputSuccess>;
|
|
10
|
+
static search({ searchType, searchValue, currency, genre, style, format, formatDescription, mediaCondition, year, years, isAudioSample, isMakeAnOfferOnly, from, seller, sort, limit, page, lang, }: IInput): Promise<IOutputSuccess>;
|
|
33
11
|
/**
|
|
34
12
|
* Generate URL to be parsed
|
|
35
13
|
* @returns Url
|
|
36
14
|
*/
|
|
37
|
-
private generateUrl;
|
|
15
|
+
private static generateUrl;
|
|
38
16
|
/**
|
|
39
17
|
* Serialize params URL
|
|
40
18
|
* @param params Object of GET parameters
|
|
41
19
|
* @returns Url
|
|
42
20
|
*/
|
|
43
|
-
private serializeParams;
|
|
21
|
+
private static serializeParams;
|
|
44
22
|
/**
|
|
45
23
|
* Function to convert currency to ISO name
|
|
46
|
-
* @param
|
|
24
|
+
* @param value String to clean
|
|
47
25
|
* @returns Cleanup string
|
|
48
26
|
*/
|
|
49
|
-
private convertCurrency;
|
|
27
|
+
private static convertCurrency;
|
|
50
28
|
/**
|
|
51
29
|
* Parse HTML to clean result
|
|
52
30
|
* @param document Document to parse
|
|
31
|
+
* @param urlGenerated Url generated
|
|
53
32
|
* @returns Items found
|
|
54
33
|
*/
|
|
55
|
-
private getItem;
|
|
34
|
+
private static getItem;
|
|
56
35
|
}
|