discogs-marketplace-api-nodejs 1.3.1 → 1.3.5

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 (62) hide show
  1. package/LICENSE +20 -20
  2. package/README.MD +217 -197
  3. package/dist/enum/ECurrency.d.ts +18 -19
  4. package/dist/enum/ECurrency.js +21 -23
  5. package/dist/enum/EFormat.d.ts +59 -60
  6. package/dist/enum/EFormat.js +62 -64
  7. package/dist/enum/EFormatDescription.d.ts +144 -145
  8. package/dist/enum/EFormatDescription.js +147 -149
  9. package/dist/enum/EFrom.d.ts +251 -252
  10. package/dist/enum/EFrom.js +255 -256
  11. package/dist/enum/EFromIso.d.ts +316 -316
  12. package/dist/enum/EFromIso.js +321 -321
  13. package/dist/enum/EGenre.d.ts +21 -22
  14. package/dist/enum/EGenre.js +24 -26
  15. package/dist/enum/ELang.d.ts +15 -16
  16. package/dist/enum/ELang.js +18 -20
  17. package/dist/enum/EMediaCondition.d.ts +14 -15
  18. package/dist/enum/EMediaCondition.js +17 -19
  19. package/dist/enum/ESort.d.ts +62 -63
  20. package/dist/enum/ESort.js +65 -67
  21. package/dist/enum/EStyle.d.ts +255 -256
  22. package/dist/enum/EStyle.js +258 -260
  23. package/dist/enum/EType.d.ts +30 -31
  24. package/dist/enum/EType.js +33 -35
  25. package/dist/enum/iso/ECountryCode.d.ts +255 -0
  26. package/dist/enum/iso/ECountryCode.js +258 -0
  27. package/dist/enum/iso/ECountryName.d.ts +255 -0
  28. package/dist/enum/iso/ECountryName.js +258 -0
  29. package/dist/enum/iso/EDiscogsCountryNameToIsoCode.d.ts +69 -0
  30. package/dist/enum/iso/EDiscogsCountryNameToIsoCode.js +72 -0
  31. package/dist/enum/iso/EDiscogsCurrencyToIsoCode.d.ts +23 -0
  32. package/dist/enum/iso/EDiscogsCurrencyToIsoCode.js +26 -0
  33. package/dist/enum/iso/translate/EDiscogsCountryNameToIsoCode.d.ts +69 -0
  34. package/dist/enum/iso/translate/EDiscogsCountryNameToIsoCode.js +72 -0
  35. package/dist/enum/iso/translate/EDiscogsCurrencyToIsoCode.d.ts +23 -0
  36. package/dist/enum/iso/translate/EDiscogsCurrencyToIsoCode.js +26 -0
  37. package/dist/enum/iso/translates/EDiscogsCountryNameToIsoCode.d.ts +69 -0
  38. package/dist/enum/iso/translates/EDiscogsCountryNameToIsoCode.js +72 -0
  39. package/dist/enum/iso/translates/EDiscogsCurrencyToIsoCode.d.ts +23 -0
  40. package/dist/enum/iso/translates/EDiscogsCurrencyToIsoCode.js +26 -0
  41. package/dist/index.d.ts +22 -22
  42. package/dist/index.js +40 -39
  43. package/dist/interface/IDiscogsMarketplace.d.ts +11 -12
  44. package/dist/interface/IDiscogsMarketplace.js +7 -7
  45. package/dist/interface/IInput.d.ts +89 -89
  46. package/dist/interface/IInput.js +17 -6
  47. package/dist/interface/IItem.d.ts +54 -48
  48. package/dist/interface/IItem.js +7 -2
  49. package/dist/interface/IOutputError.d.ts +7 -7
  50. package/dist/interface/IOutputError.js +2 -2
  51. package/dist/interface/IOutputSuccess.d.ts +21 -21
  52. package/dist/interface/IOutputSuccess.js +7 -6
  53. package/dist/interface/IYears.d.ts +7 -7
  54. package/dist/interface/IYears.js +2 -2
  55. package/dist/marketplace.d.ts +56 -70
  56. package/dist/marketplace.js +290 -286
  57. package/dist/type/TLimit.d.ts +5 -6
  58. package/dist/type/TLimit.js +2 -2
  59. package/package.json +52 -45
  60. package/.gitattributes +0 -1
  61. package/notes.md +0 -9
  62. package/tsconfig.build.json +0 -40
@@ -1,89 +1,89 @@
1
- import { EFrom } from "../enum/EFrom";
2
- import { EType } from "../enum/EType";
3
- import { ECurrency } from "../enum/ECurrency";
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";
13
- /**
14
- * @interface IInput Element that can be provided by user
15
- */
16
- export default interface IInput {
17
- /**
18
- * Type of elements to search
19
- */
20
- searchType: EType;
21
- /**
22
- * Value to search corresponding to searchType
23
- */
24
- searchValue: string | number | undefined;
25
- /**
26
- * Currency
27
- */
28
- currency?: ECurrency;
29
- /**
30
- * Genre
31
- */
32
- genre?: EGenre;
33
- /**
34
- * Styles
35
- */
36
- style?: EStyle[];
37
- /**
38
- * Formats
39
- */
40
- format?: EFormat[];
41
- /**
42
- * Format descriptions
43
- */
44
- formatDescription?: EFormatDescription[];
45
- /**
46
- * Media conditions
47
- */
48
- mediaCondition?: EMediaCondition[];
49
- /**
50
- * Year (Do not use it with years)
51
- */
52
- year?: number;
53
- /**
54
- * Interval of years (Do not use it with year)
55
- */
56
- years?: IYears;
57
- /**
58
- * Is audio sample ?
59
- */
60
- isAudioSample?: boolean;
61
- /**
62
- * Is make an offer only ?
63
- */
64
- isMakeAnOfferOnly?: boolean;
65
- /**
66
- * Expedition country
67
- */
68
- from?: EFrom;
69
- /**
70
- * Seller name
71
- */
72
- seller?: string;
73
- /**
74
- * Sort elements by
75
- */
76
- sort?: ESort;
77
- /**
78
- * Limit of elements to search (25 | 50 | 100 | 250)
79
- */
80
- limit?: TLimit;
81
- /**
82
- * Page (Must be < 401 or discogs will return an error 404)
83
- */
84
- page?: number;
85
- /**
86
- * Lang to use for Discogs
87
- */
88
- lang?: ELang;
89
- }
1
+ import EFrom from "../enum/EFrom";
2
+ import EType from "../enum/EType";
3
+ import ECurrency from "../enum/ECurrency";
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";
13
+ /**
14
+ * Element that can be provided by user
15
+ */
16
+ export default interface IInput {
17
+ /**
18
+ * Type of elements to search
19
+ */
20
+ searchType: EType;
21
+ /**
22
+ * Value to search corresponding to searchType
23
+ */
24
+ searchValue: string | number | undefined;
25
+ /**
26
+ * Currency
27
+ */
28
+ currency?: ECurrency;
29
+ /**
30
+ * Genre
31
+ */
32
+ genre?: EGenre;
33
+ /**
34
+ * Styles
35
+ */
36
+ style?: EStyle[];
37
+ /**
38
+ * Formats
39
+ */
40
+ format?: EFormat[];
41
+ /**
42
+ * Format descriptions
43
+ */
44
+ formatDescription?: EFormatDescription[];
45
+ /**
46
+ * Media conditions
47
+ */
48
+ mediaCondition?: EMediaCondition[];
49
+ /**
50
+ * Year (Do not use it with years)
51
+ */
52
+ year?: number;
53
+ /**
54
+ * Interval of years (Do not use it with year)
55
+ */
56
+ years?: IYears;
57
+ /**
58
+ * Is audio sample ?
59
+ */
60
+ isAudioSample?: boolean;
61
+ /**
62
+ * Is make an offer only ?
63
+ */
64
+ isMakeAnOfferOnly?: boolean;
65
+ /**
66
+ * Expedition country
67
+ */
68
+ from?: EFrom;
69
+ /**
70
+ * Seller name
71
+ */
72
+ seller?: string;
73
+ /**
74
+ * Sort elements by
75
+ */
76
+ sort?: ESort;
77
+ /**
78
+ * Limit of elements to search (25 | 50 | 100 | 250)
79
+ */
80
+ limit?: TLimit;
81
+ /**
82
+ * Page (Must be < 401 or discogs will return an error 404)
83
+ */
84
+ page?: number;
85
+ /**
86
+ * Lang to use for Discogs
87
+ */
88
+ lang?: ELang;
89
+ }
@@ -1,6 +1,17 @@
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
- const IYears_1 = __importDefault(require("./IYears"));
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
+ const EFrom_1 = __importDefault(require("../enum/EFrom"));
7
+ const EType_1 = __importDefault(require("../enum/EType"));
8
+ const ECurrency_1 = __importDefault(require("../enum/ECurrency"));
9
+ const EGenre_1 = __importDefault(require("../enum/EGenre"));
10
+ const EStyle_1 = __importDefault(require("../enum/EStyle"));
11
+ const EMediaCondition_1 = __importDefault(require("../enum/EMediaCondition"));
12
+ const ESort_1 = __importDefault(require("../enum/ESort"));
13
+ const TLimit_1 = __importDefault(require("../type/TLimit"));
14
+ const IYears_1 = __importDefault(require("./IYears"));
15
+ const EFormat_1 = __importDefault(require("../enum/EFormat"));
16
+ const EFormatDescription_1 = __importDefault(require("../enum/EFormatDescription"));
17
+ const ELang_1 = __importDefault(require("../enum/ELang"));
@@ -1,48 +1,54 @@
1
- /**
2
- * @interface IItem One item from discogs
3
- */
4
- export default interface IItem {
5
- itemId: number;
6
- title: {
7
- original: string;
8
- artist: string;
9
- item: string;
10
- };
11
- url: string;
12
- labels: string[];
13
- catnos: string[];
14
- imageUrl: string;
15
- description: string;
16
- isAcceptingOffer: boolean;
17
- isAvailable: boolean;
18
- condition: {
19
- media: {
20
- full: string;
21
- short: string;
22
- };
23
- sleeve: {
24
- full: string;
25
- short: string;
26
- };
27
- };
28
- seller: {
29
- name: string;
30
- score: string;
31
- notes: string;
32
- };
33
- price: {
34
- base: string;
35
- shipping: string;
36
- };
37
- from: {
38
- countryName: string;
39
- isoCountryName: string;
40
- isoCode: string;
41
- };
42
- community: {
43
- have: number;
44
- want: number;
45
- };
46
- releaseUrl: string;
47
- releaseId: number;
48
- }
1
+ import ECountryCode from "../enum/iso/ECountryCode";
2
+ import ECountryName from "../enum/iso/ECountryName";
3
+ /**
4
+ * One item from discogs
5
+ */
6
+ export default interface IItem {
7
+ itemId: number;
8
+ title: {
9
+ original: string;
10
+ artist: string;
11
+ item: string;
12
+ formats: string[];
13
+ };
14
+ url: string;
15
+ labels: string[];
16
+ catnos: string[];
17
+ imageUrl: string;
18
+ description: string;
19
+ isAcceptingOffer: boolean;
20
+ isAvailable: boolean;
21
+ condition: {
22
+ media: {
23
+ full: string;
24
+ short: string;
25
+ };
26
+ sleeve: {
27
+ full: string;
28
+ short: string;
29
+ };
30
+ };
31
+ seller: {
32
+ name: string;
33
+ url: string;
34
+ score: string;
35
+ notes: number;
36
+ };
37
+ price: {
38
+ base: string;
39
+ shipping: string;
40
+ };
41
+ from: {
42
+ countryName: string;
43
+ isoCountryName: ECountryName;
44
+ isoCountryCode: ECountryCode;
45
+ };
46
+ community: {
47
+ have: number;
48
+ want: number;
49
+ };
50
+ release: {
51
+ id: number;
52
+ url: string;
53
+ };
54
+ }
@@ -1,2 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
+ const ECountryCode_1 = __importDefault(require("../enum/iso/ECountryCode"));
7
+ const ECountryName_1 = __importDefault(require("../enum/iso/ECountryName"));
@@ -1,7 +1,7 @@
1
- /**
2
- * @interface IOutputError Result provided to user
3
- */
4
- export default interface IOutputError {
5
- message: string;
6
- code: number;
7
- }
1
+ /**
2
+ * Result provided to user
3
+ */
4
+ export default interface IOutputError {
5
+ message: string;
6
+ code: number;
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +1,21 @@
1
- import IItem from "./IItem";
2
- import { EType } from "../enum/EType";
3
- /**
4
- * @interface IOutputSuccess Result provided to user
5
- */
6
- export default interface IOutputSuccess {
7
- result: IItem[];
8
- page: {
9
- current: number;
10
- total: number;
11
- };
12
- item: {
13
- total: number;
14
- perPage: number;
15
- };
16
- search: {
17
- value: string | number;
18
- type: EType;
19
- };
20
- urlGenerated: string;
21
- }
1
+ import IItem from "./IItem";
2
+ import EType from "../enum/EType";
3
+ /**
4
+ * Result provided to user
5
+ */
6
+ export default interface IOutputSuccess {
7
+ items: IItem[];
8
+ page: {
9
+ current: number;
10
+ total: number;
11
+ };
12
+ result: {
13
+ total: number;
14
+ perPage: number;
15
+ };
16
+ search: {
17
+ value: string | number;
18
+ type: EType;
19
+ };
20
+ urlGenerated: string;
21
+ }
@@ -1,6 +1,7 @@
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
- const IItem_1 = __importDefault(require("./IItem"));
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
+ const IItem_1 = __importDefault(require("./IItem"));
7
+ const EType_1 = __importDefault(require("../enum/EType"));
@@ -1,7 +1,7 @@
1
- /**
2
- * @interface IInput Provide interval of years
3
- */
4
- export default interface IYears {
5
- min: number;
6
- max: number;
7
- }
1
+ /**
2
+ * Provide interval of years
3
+ */
4
+ export default interface IYears {
5
+ min: number;
6
+ max: number;
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,70 +1,56 @@
1
- import { ECurrency } from "./enum/ECurrency";
2
- import { EFormat } from "./enum/EFormat";
3
- import { EFormatDescription } from "./enum/EFormatDescription";
4
- import { EFrom } from "./enum/EFrom";
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 IInput from "./interface/IInput";
12
- import IOutputSuccess from "./interface/IOutputSuccess";
13
- import IYears from "./interface/IYears";
14
- import { TLimit } from "./type/TLimit";
15
- /**
16
- * Discogs Marketplace
17
- * @class
18
- * @implements {IInput}
19
- */
20
- export default class Marketplace {
21
- protected searchType: EType;
22
- protected searchValue: string | number | undefined;
23
- protected currency?: ECurrency;
24
- protected genre?: EGenre;
25
- protected style?: EStyle[];
26
- protected format?: EFormat[];
27
- protected formatDescription?: EFormatDescription[];
28
- protected mediaCondition?: EMediaCondition[];
29
- protected year?: number;
30
- protected years?: IYears;
31
- protected isAudioSample: boolean;
32
- protected isMakeAnOfferOnly: boolean;
33
- protected from?: EFrom;
34
- protected seller?: string;
35
- protected sort: ESort;
36
- protected limit: TLimit;
37
- protected page: number;
38
- protected lang: ELang;
39
- /** Url generated by Puppetter */
40
- protected url: string;
41
- constructor({ searchType, searchValue, currency, genre, style, format, formatDescription, mediaCondition, year, years, isAudioSample, isMakeAnOfferOnly, from, seller, sort, limit, page, lang }: IInput);
42
- /**
43
- * Search elements on discogs
44
- * @returns {Promise<IOutputSuccess>} Items found
45
- */
46
- search(): Promise<IOutputSuccess>;
47
- /**
48
- * Generate URL to be parsed
49
- * @returns {string} Url
50
- */
51
- private generateUrl;
52
- /**
53
- * Serialize params URL
54
- * @param {any} params Object of GET parameters
55
- * @returns {string} Url
56
- */
57
- private serializeParams;
58
- /**
59
- * Function to convert devise to ISO name
60
- * @param str String to clean
61
- * @returns {string} Cleanup string
62
- */
63
- private convertDevise;
64
- /**
65
- * Parse HTML to clean result
66
- * @param {Document} document Document to parse
67
- * @returns {IOutputSuccess} Items found
68
- */
69
- private getItem;
70
- }
1
+ import IInput from "./interface/IInput";
2
+ import IOutputSuccess from "./interface/IOutputSuccess";
3
+ /**
4
+ * Discogs Marketplace
5
+ */
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);
28
+ /**
29
+ * Search elements on discogs
30
+ * @returns Items found
31
+ */
32
+ search(): Promise<IOutputSuccess>;
33
+ /**
34
+ * Generate URL to be parsed
35
+ * @returns Url
36
+ */
37
+ private generateUrl;
38
+ /**
39
+ * Serialize params URL
40
+ * @param params Object of GET parameters
41
+ * @returns Url
42
+ */
43
+ private serializeParams;
44
+ /**
45
+ * Function to convert devise to ISO name
46
+ * @param str String to clean
47
+ * @returns Cleanup string
48
+ */
49
+ private convertDevise;
50
+ /**
51
+ * Parse HTML to clean result
52
+ * @param document Document to parse
53
+ * @returns Items found
54
+ */
55
+ private getItem;
56
+ }