podverse-helpers 5.0.7 → 5.1.1-alpha.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.
Files changed (65) hide show
  1. package/dist/config/index.d.ts +1 -0
  2. package/dist/config/index.d.ts.map +1 -1
  3. package/dist/config/index.js +2 -1
  4. package/dist/index.d.ts +18 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +18 -0
  7. package/dist/lib/accountMembership.d.ts +5 -0
  8. package/dist/lib/accountMembership.d.ts.map +1 -0
  9. package/dist/lib/accountMembership.js +8 -0
  10. package/dist/lib/auth/password.d.ts +3 -0
  11. package/dist/lib/auth/password.d.ts.map +1 -0
  12. package/dist/lib/auth/password.js +31 -0
  13. package/dist/lib/category.d.ts +114 -0
  14. package/dist/lib/category.d.ts.map +1 -0
  15. package/dist/lib/category.js +233 -0
  16. package/dist/lib/date.d.ts +2 -0
  17. package/dist/lib/date.d.ts.map +1 -0
  18. package/dist/lib/date.js +8 -0
  19. package/dist/lib/error/errorMessages.d.ts +8 -0
  20. package/dist/lib/error/errorMessages.d.ts.map +1 -0
  21. package/dist/lib/error/errorMessages.js +10 -0
  22. package/dist/lib/guid.d.ts +2 -0
  23. package/dist/lib/guid.d.ts.map +1 -0
  24. package/dist/lib/guid.js +7 -0
  25. package/dist/lib/item.d.ts +2 -0
  26. package/dist/lib/item.d.ts.map +1 -0
  27. package/dist/lib/item.js +8 -0
  28. package/dist/lib/itemImage.d.ts +9 -0
  29. package/dist/lib/itemImage.d.ts.map +1 -0
  30. package/dist/lib/itemImage.js +41 -0
  31. package/dist/lib/logTimer.d.ts +10 -0
  32. package/dist/lib/logTimer.d.ts.map +1 -0
  33. package/dist/lib/logTimer.js +41 -0
  34. package/dist/lib/logger.d.ts +1 -1
  35. package/dist/lib/logger.d.ts.map +1 -1
  36. package/dist/lib/logger.js +25 -9
  37. package/dist/lib/medium.d.ts +24 -0
  38. package/dist/lib/medium.d.ts.map +1 -0
  39. package/dist/lib/medium.js +76 -0
  40. package/dist/lib/playlistResource.d.ts +5 -0
  41. package/dist/lib/playlistResource.d.ts.map +1 -0
  42. package/dist/lib/playlistResource.js +18 -0
  43. package/dist/lib/remoteItem.d.ts +6 -0
  44. package/dist/lib/remoteItem.d.ts.map +1 -0
  45. package/dist/lib/remoteItem.js +2 -0
  46. package/dist/lib/request.js +1 -1
  47. package/dist/lib/sharableStatus.d.ts +6 -0
  48. package/dist/lib/sharableStatus.d.ts.map +1 -0
  49. package/dist/lib/sharableStatus.js +9 -0
  50. package/dist/lib/sleep.d.ts +2 -0
  51. package/dist/lib/sleep.d.ts.map +1 -0
  52. package/dist/lib/sleep.js +6 -0
  53. package/dist/lib/time.d.ts +6 -0
  54. package/dist/lib/time.d.ts.map +1 -0
  55. package/dist/lib/time.js +8 -0
  56. package/dist/lib/validation/email.d.ts +2 -0
  57. package/dist/lib/validation/email.d.ts.map +1 -0
  58. package/dist/lib/validation/email.js +12 -0
  59. package/dist/lib/validation/password.d.ts +2 -0
  60. package/dist/lib/validation/password.d.ts.map +1 -0
  61. package/dist/lib/validation/password.js +17 -0
  62. package/dist/lib/validation/url.d.ts +2 -0
  63. package/dist/lib/validation/url.d.ts.map +1 -0
  64. package/dist/lib/validation/url.js +10 -0
  65. package/package.json +7 -2
@@ -5,5 +5,6 @@ export declare const config: {
5
5
  logging: {
6
6
  logDir: string;
7
7
  };
8
+ shouldLogTimer: boolean;
8
9
  };
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;CAQlB,CAAC"}
@@ -7,5 +7,6 @@ exports.config = {
7
7
  logLevel: process.env.LOG_LEVEL || 'info',
8
8
  logging: {
9
9
  logDir: process.env.LOG_DIR || 'logs',
10
- }
10
+ },
11
+ shouldLogTimer: process.env.LOG_TIMER === 'true'
11
12
  };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,28 @@
1
1
  import './module-alias-config';
2
+ export * from './lib/error/errorMessages';
3
+ export * from './lib/accountMembership';
2
4
  export * from './lib/array';
5
+ export * from './lib/auth/password';
3
6
  export * from './lib/boolean';
7
+ export * from './lib/category';
8
+ export * from './lib/date';
4
9
  export * from './lib/debug';
10
+ export * from './lib/guid';
5
11
  export * from './lib/hash';
12
+ export * from './lib/item';
13
+ export * from './lib/itemImage';
6
14
  export * from './lib/logger';
15
+ export * from './lib/logTimer';
16
+ export * from './lib/medium';
17
+ export * from './lib/playlistResource';
18
+ export * from './lib/remoteItem';
7
19
  export * from './lib/request';
20
+ export * from './lib/sharableStatus';
21
+ export * from './lib/sleep';
8
22
  export * from './lib/sortableTitle';
23
+ export * from './lib/time';
9
24
  export * from './lib/validation/databaseConstants';
25
+ export * from './lib/validation/email';
26
+ export * from './lib/validation/password';
27
+ export * from './lib/validation/url';
10
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -15,11 +15,29 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  require("./module-alias-config");
18
+ __exportStar(require("./lib/error/errorMessages"), exports);
19
+ __exportStar(require("./lib/accountMembership"), exports);
18
20
  __exportStar(require("./lib/array"), exports);
21
+ __exportStar(require("./lib/auth/password"), exports);
19
22
  __exportStar(require("./lib/boolean"), exports);
23
+ __exportStar(require("./lib/category"), exports);
24
+ __exportStar(require("./lib/date"), exports);
20
25
  __exportStar(require("./lib/debug"), exports);
26
+ __exportStar(require("./lib/guid"), exports);
21
27
  __exportStar(require("./lib/hash"), exports);
28
+ __exportStar(require("./lib/item"), exports);
29
+ __exportStar(require("./lib/itemImage"), exports);
22
30
  __exportStar(require("./lib/logger"), exports);
31
+ __exportStar(require("./lib/logTimer"), exports);
32
+ __exportStar(require("./lib/medium"), exports);
33
+ __exportStar(require("./lib/playlistResource"), exports);
34
+ __exportStar(require("./lib/remoteItem"), exports);
23
35
  __exportStar(require("./lib/request"), exports);
36
+ __exportStar(require("./lib/sharableStatus"), exports);
37
+ __exportStar(require("./lib/sleep"), exports);
24
38
  __exportStar(require("./lib/sortableTitle"), exports);
39
+ __exportStar(require("./lib/time"), exports);
25
40
  __exportStar(require("./lib/validation/databaseConstants"), exports);
41
+ __exportStar(require("./lib/validation/email"), exports);
42
+ __exportStar(require("./lib/validation/password"), exports);
43
+ __exportStar(require("./lib/validation/url"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum AccountMembershipEnum {
2
+ Trial = 1,
3
+ Basic = 2
4
+ }
5
+ //# sourceMappingURL=accountMembership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountMembership.d.ts","sourceRoot":"","sources":["../../src/lib/accountMembership.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,KAAK,IAAI;IACT,KAAK,IAAI;CACV"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountMembershipEnum = void 0;
4
+ var AccountMembershipEnum;
5
+ (function (AccountMembershipEnum) {
6
+ AccountMembershipEnum[AccountMembershipEnum["Trial"] = 1] = "Trial";
7
+ AccountMembershipEnum[AccountMembershipEnum["Basic"] = 2] = "Basic";
8
+ })(AccountMembershipEnum || (exports.AccountMembershipEnum = AccountMembershipEnum = {}));
@@ -0,0 +1,3 @@
1
+ export declare function hashPassword(password: string): Promise<string>;
2
+ export declare function verifyPassword(password: string, hashedPassword: string): Promise<boolean>;
3
+ //# sourceMappingURL=password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/password.ts"],"names":[],"mappings":"AAEA,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG/F"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.hashPassword = hashPassword;
16
+ exports.verifyPassword = verifyPassword;
17
+ const bcrypt_1 = __importDefault(require("bcrypt"));
18
+ function hashPassword(password) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const saltRounds = 10;
21
+ const salt = yield bcrypt_1.default.genSalt(saltRounds);
22
+ const hashedPassword = yield bcrypt_1.default.hash(password, salt);
23
+ return hashedPassword;
24
+ });
25
+ }
26
+ function verifyPassword(password, hashedPassword) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ const isMatch = yield bcrypt_1.default.compare(password, hashedPassword);
29
+ return isMatch;
30
+ });
31
+ }
@@ -0,0 +1,114 @@
1
+ export declare enum CategoryEnum {
2
+ Arts = 1,
3
+ Business = 2,
4
+ Comedy = 3,
5
+ Education = 4,
6
+ Fiction = 5,
7
+ Government = 6,
8
+ History = 7,
9
+ HealthAndFitness = 8,
10
+ KidsAndFamily = 9,
11
+ Leisure = 10,
12
+ Music = 11,
13
+ News = 12,
14
+ ReligionAndSpirituality = 13,
15
+ Science = 14,
16
+ SocietyAndCulture = 15,
17
+ Sports = 16,
18
+ Technology = 17,
19
+ TrueCrime = 18,
20
+ TVAndFilm = 19,
21
+ Books = 20,
22
+ Design = 21,
23
+ FashionAndBeauty = 22,
24
+ Food = 23,
25
+ PerformingArts = 24,
26
+ VisualArts = 25,
27
+ Careers = 26,
28
+ Entrepreneurship = 27,
29
+ Investing = 28,
30
+ Management = 29,
31
+ Marketing = 30,
32
+ NonProfit = 31,
33
+ ComedyInterviews = 32,
34
+ Improv = 33,
35
+ StandUp = 34,
36
+ Courses = 35,
37
+ HowTo = 36,
38
+ LanguageLearning = 37,
39
+ SelfImprovement = 38,
40
+ ComedyFiction = 39,
41
+ Drama = 40,
42
+ ScienceFiction = 41,
43
+ AlternativeHealth = 42,
44
+ Fitness = 43,
45
+ Medicine = 44,
46
+ MentalHealth = 45,
47
+ Nutrition = 46,
48
+ Sexuality = 47,
49
+ EducationForKids = 48,
50
+ Parenting = 49,
51
+ PetsAndAnimals = 50,
52
+ StoriesForKids = 51,
53
+ AnimationAndManga = 52,
54
+ Automotive = 53,
55
+ Aviation = 54,
56
+ Crafts = 55,
57
+ Games = 56,
58
+ Hobbies = 57,
59
+ HomeAndGarden = 58,
60
+ VideoGames = 59,
61
+ MusicCommentary = 60,
62
+ MusicHistory = 61,
63
+ MusicInterviews = 62,
64
+ BusinessNews = 63,
65
+ DailyNews = 64,
66
+ EntertainmentNews = 65,
67
+ NewsCommentary = 66,
68
+ Politics = 67,
69
+ SportsNews = 68,
70
+ TechNews = 69,
71
+ Buddhism = 70,
72
+ Christianity = 71,
73
+ Hinduism = 72,
74
+ Islam = 73,
75
+ Judaism = 74,
76
+ Religion = 75,
77
+ Spirituality = 76,
78
+ Astronomy = 77,
79
+ Chemistry = 78,
80
+ EarthSciences = 79,
81
+ LifeSciences = 80,
82
+ Mathematics = 81,
83
+ NaturalSciences = 82,
84
+ Nature = 83,
85
+ Physics = 84,
86
+ SocialSciences = 85,
87
+ Documentary = 86,
88
+ PersonalJournals = 87,
89
+ Philosophy = 88,
90
+ PlacesAndTravel = 89,
91
+ Relationships = 90,
92
+ Baseball = 91,
93
+ Basketball = 92,
94
+ Cricket = 93,
95
+ FantasySports = 94,
96
+ Football = 95,
97
+ Golf = 96,
98
+ Hockey = 97,
99
+ Rugby = 98,
100
+ Running = 99,
101
+ Soccer = 100,
102
+ Swimming = 101,
103
+ Tennis = 102,
104
+ Volleyball = 103,
105
+ Wilderness = 104,
106
+ Wrestling = 105,
107
+ AfterShows = 106,
108
+ FilmHistory = 107,
109
+ FilmInterviews = 108,
110
+ FilmReviews = 109,
111
+ TVReviews = 110
112
+ }
113
+ export declare function getCategoryEnumValue(input: string | null): CategoryEnum | null;
114
+ //# sourceMappingURL=category.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/lib/category.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,SAAS,IAAI;IACb,OAAO,IAAI;IACX,UAAU,IAAI;IACd,OAAO,IAAI;IACX,gBAAgB,IAAI;IACpB,aAAa,IAAI;IACjB,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,IAAI,KAAK;IACT,uBAAuB,KAAK;IAC5B,OAAO,KAAK;IACZ,iBAAiB,KAAK;IACtB,MAAM,KAAK;IACX,UAAU,KAAK;IACf,SAAS,KAAK;IACd,SAAS,KAAK;IACd,KAAK,KAAK;IACV,MAAM,KAAK;IACX,gBAAgB,KAAK;IACrB,IAAI,KAAK;IACT,cAAc,KAAK;IACnB,UAAU,KAAK;IACf,OAAO,KAAK;IACZ,gBAAgB,KAAK;IACrB,SAAS,KAAK;IACd,UAAU,KAAK;IACf,SAAS,KAAK;IACd,SAAS,KAAK;IACd,gBAAgB,KAAK;IACrB,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,gBAAgB,KAAK;IACrB,eAAe,KAAK;IACpB,aAAa,KAAK;IAClB,KAAK,KAAK;IACV,cAAc,KAAK;IACnB,iBAAiB,KAAK;IACtB,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,YAAY,KAAK;IACjB,SAAS,KAAK;IACd,SAAS,KAAK;IACd,gBAAgB,KAAK;IACrB,SAAS,KAAK;IACd,cAAc,KAAK;IACnB,cAAc,KAAK;IACnB,iBAAiB,KAAK;IACtB,UAAU,KAAK;IACf,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,aAAa,KAAK;IAClB,UAAU,KAAK;IACf,eAAe,KAAK;IACpB,YAAY,KAAK;IACjB,eAAe,KAAK;IACpB,YAAY,KAAK;IACjB,SAAS,KAAK;IACd,iBAAiB,KAAK;IACtB,cAAc,KAAK;IACnB,QAAQ,KAAK;IACb,UAAU,KAAK;IACf,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,YAAY,KAAK;IACjB,QAAQ,KAAK;IACb,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,YAAY,KAAK;IACjB,SAAS,KAAK;IACd,SAAS,KAAK;IACd,aAAa,KAAK;IAClB,YAAY,KAAK;IACjB,WAAW,KAAK;IAChB,eAAe,KAAK;IACpB,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,cAAc,KAAK;IACnB,WAAW,KAAK;IAChB,gBAAgB,KAAK;IACrB,UAAU,KAAK;IACf,eAAe,KAAK;IACpB,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,UAAU,KAAK;IACf,OAAO,KAAK;IACZ,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,IAAI,KAAK;IACT,MAAM,KAAK;IACX,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,MAAM,MAAM;IACZ,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,UAAU,MAAM;IAChB,UAAU,MAAM;IAChB,SAAS,MAAM;IACf,UAAU,MAAM;IAChB,WAAW,MAAM;IACjB,cAAc,MAAM;IACpB,WAAW,MAAM;IACjB,SAAS,MAAM;CAChB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY,GAAG,IAAI,CAuH9E"}
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CategoryEnum = void 0;
4
+ exports.getCategoryEnumValue = getCategoryEnumValue;
5
+ var CategoryEnum;
6
+ (function (CategoryEnum) {
7
+ CategoryEnum[CategoryEnum["Arts"] = 1] = "Arts";
8
+ CategoryEnum[CategoryEnum["Business"] = 2] = "Business";
9
+ CategoryEnum[CategoryEnum["Comedy"] = 3] = "Comedy";
10
+ CategoryEnum[CategoryEnum["Education"] = 4] = "Education";
11
+ CategoryEnum[CategoryEnum["Fiction"] = 5] = "Fiction";
12
+ CategoryEnum[CategoryEnum["Government"] = 6] = "Government";
13
+ CategoryEnum[CategoryEnum["History"] = 7] = "History";
14
+ CategoryEnum[CategoryEnum["HealthAndFitness"] = 8] = "HealthAndFitness";
15
+ CategoryEnum[CategoryEnum["KidsAndFamily"] = 9] = "KidsAndFamily";
16
+ CategoryEnum[CategoryEnum["Leisure"] = 10] = "Leisure";
17
+ CategoryEnum[CategoryEnum["Music"] = 11] = "Music";
18
+ CategoryEnum[CategoryEnum["News"] = 12] = "News";
19
+ CategoryEnum[CategoryEnum["ReligionAndSpirituality"] = 13] = "ReligionAndSpirituality";
20
+ CategoryEnum[CategoryEnum["Science"] = 14] = "Science";
21
+ CategoryEnum[CategoryEnum["SocietyAndCulture"] = 15] = "SocietyAndCulture";
22
+ CategoryEnum[CategoryEnum["Sports"] = 16] = "Sports";
23
+ CategoryEnum[CategoryEnum["Technology"] = 17] = "Technology";
24
+ CategoryEnum[CategoryEnum["TrueCrime"] = 18] = "TrueCrime";
25
+ CategoryEnum[CategoryEnum["TVAndFilm"] = 19] = "TVAndFilm";
26
+ CategoryEnum[CategoryEnum["Books"] = 20] = "Books";
27
+ CategoryEnum[CategoryEnum["Design"] = 21] = "Design";
28
+ CategoryEnum[CategoryEnum["FashionAndBeauty"] = 22] = "FashionAndBeauty";
29
+ CategoryEnum[CategoryEnum["Food"] = 23] = "Food";
30
+ CategoryEnum[CategoryEnum["PerformingArts"] = 24] = "PerformingArts";
31
+ CategoryEnum[CategoryEnum["VisualArts"] = 25] = "VisualArts";
32
+ CategoryEnum[CategoryEnum["Careers"] = 26] = "Careers";
33
+ CategoryEnum[CategoryEnum["Entrepreneurship"] = 27] = "Entrepreneurship";
34
+ CategoryEnum[CategoryEnum["Investing"] = 28] = "Investing";
35
+ CategoryEnum[CategoryEnum["Management"] = 29] = "Management";
36
+ CategoryEnum[CategoryEnum["Marketing"] = 30] = "Marketing";
37
+ CategoryEnum[CategoryEnum["NonProfit"] = 31] = "NonProfit";
38
+ CategoryEnum[CategoryEnum["ComedyInterviews"] = 32] = "ComedyInterviews";
39
+ CategoryEnum[CategoryEnum["Improv"] = 33] = "Improv";
40
+ CategoryEnum[CategoryEnum["StandUp"] = 34] = "StandUp";
41
+ CategoryEnum[CategoryEnum["Courses"] = 35] = "Courses";
42
+ CategoryEnum[CategoryEnum["HowTo"] = 36] = "HowTo";
43
+ CategoryEnum[CategoryEnum["LanguageLearning"] = 37] = "LanguageLearning";
44
+ CategoryEnum[CategoryEnum["SelfImprovement"] = 38] = "SelfImprovement";
45
+ CategoryEnum[CategoryEnum["ComedyFiction"] = 39] = "ComedyFiction";
46
+ CategoryEnum[CategoryEnum["Drama"] = 40] = "Drama";
47
+ CategoryEnum[CategoryEnum["ScienceFiction"] = 41] = "ScienceFiction";
48
+ CategoryEnum[CategoryEnum["AlternativeHealth"] = 42] = "AlternativeHealth";
49
+ CategoryEnum[CategoryEnum["Fitness"] = 43] = "Fitness";
50
+ CategoryEnum[CategoryEnum["Medicine"] = 44] = "Medicine";
51
+ CategoryEnum[CategoryEnum["MentalHealth"] = 45] = "MentalHealth";
52
+ CategoryEnum[CategoryEnum["Nutrition"] = 46] = "Nutrition";
53
+ CategoryEnum[CategoryEnum["Sexuality"] = 47] = "Sexuality";
54
+ CategoryEnum[CategoryEnum["EducationForKids"] = 48] = "EducationForKids";
55
+ CategoryEnum[CategoryEnum["Parenting"] = 49] = "Parenting";
56
+ CategoryEnum[CategoryEnum["PetsAndAnimals"] = 50] = "PetsAndAnimals";
57
+ CategoryEnum[CategoryEnum["StoriesForKids"] = 51] = "StoriesForKids";
58
+ CategoryEnum[CategoryEnum["AnimationAndManga"] = 52] = "AnimationAndManga";
59
+ CategoryEnum[CategoryEnum["Automotive"] = 53] = "Automotive";
60
+ CategoryEnum[CategoryEnum["Aviation"] = 54] = "Aviation";
61
+ CategoryEnum[CategoryEnum["Crafts"] = 55] = "Crafts";
62
+ CategoryEnum[CategoryEnum["Games"] = 56] = "Games";
63
+ CategoryEnum[CategoryEnum["Hobbies"] = 57] = "Hobbies";
64
+ CategoryEnum[CategoryEnum["HomeAndGarden"] = 58] = "HomeAndGarden";
65
+ CategoryEnum[CategoryEnum["VideoGames"] = 59] = "VideoGames";
66
+ CategoryEnum[CategoryEnum["MusicCommentary"] = 60] = "MusicCommentary";
67
+ CategoryEnum[CategoryEnum["MusicHistory"] = 61] = "MusicHistory";
68
+ CategoryEnum[CategoryEnum["MusicInterviews"] = 62] = "MusicInterviews";
69
+ CategoryEnum[CategoryEnum["BusinessNews"] = 63] = "BusinessNews";
70
+ CategoryEnum[CategoryEnum["DailyNews"] = 64] = "DailyNews";
71
+ CategoryEnum[CategoryEnum["EntertainmentNews"] = 65] = "EntertainmentNews";
72
+ CategoryEnum[CategoryEnum["NewsCommentary"] = 66] = "NewsCommentary";
73
+ CategoryEnum[CategoryEnum["Politics"] = 67] = "Politics";
74
+ CategoryEnum[CategoryEnum["SportsNews"] = 68] = "SportsNews";
75
+ CategoryEnum[CategoryEnum["TechNews"] = 69] = "TechNews";
76
+ CategoryEnum[CategoryEnum["Buddhism"] = 70] = "Buddhism";
77
+ CategoryEnum[CategoryEnum["Christianity"] = 71] = "Christianity";
78
+ CategoryEnum[CategoryEnum["Hinduism"] = 72] = "Hinduism";
79
+ CategoryEnum[CategoryEnum["Islam"] = 73] = "Islam";
80
+ CategoryEnum[CategoryEnum["Judaism"] = 74] = "Judaism";
81
+ CategoryEnum[CategoryEnum["Religion"] = 75] = "Religion";
82
+ CategoryEnum[CategoryEnum["Spirituality"] = 76] = "Spirituality";
83
+ CategoryEnum[CategoryEnum["Astronomy"] = 77] = "Astronomy";
84
+ CategoryEnum[CategoryEnum["Chemistry"] = 78] = "Chemistry";
85
+ CategoryEnum[CategoryEnum["EarthSciences"] = 79] = "EarthSciences";
86
+ CategoryEnum[CategoryEnum["LifeSciences"] = 80] = "LifeSciences";
87
+ CategoryEnum[CategoryEnum["Mathematics"] = 81] = "Mathematics";
88
+ CategoryEnum[CategoryEnum["NaturalSciences"] = 82] = "NaturalSciences";
89
+ CategoryEnum[CategoryEnum["Nature"] = 83] = "Nature";
90
+ CategoryEnum[CategoryEnum["Physics"] = 84] = "Physics";
91
+ CategoryEnum[CategoryEnum["SocialSciences"] = 85] = "SocialSciences";
92
+ CategoryEnum[CategoryEnum["Documentary"] = 86] = "Documentary";
93
+ CategoryEnum[CategoryEnum["PersonalJournals"] = 87] = "PersonalJournals";
94
+ CategoryEnum[CategoryEnum["Philosophy"] = 88] = "Philosophy";
95
+ CategoryEnum[CategoryEnum["PlacesAndTravel"] = 89] = "PlacesAndTravel";
96
+ CategoryEnum[CategoryEnum["Relationships"] = 90] = "Relationships";
97
+ CategoryEnum[CategoryEnum["Baseball"] = 91] = "Baseball";
98
+ CategoryEnum[CategoryEnum["Basketball"] = 92] = "Basketball";
99
+ CategoryEnum[CategoryEnum["Cricket"] = 93] = "Cricket";
100
+ CategoryEnum[CategoryEnum["FantasySports"] = 94] = "FantasySports";
101
+ CategoryEnum[CategoryEnum["Football"] = 95] = "Football";
102
+ CategoryEnum[CategoryEnum["Golf"] = 96] = "Golf";
103
+ CategoryEnum[CategoryEnum["Hockey"] = 97] = "Hockey";
104
+ CategoryEnum[CategoryEnum["Rugby"] = 98] = "Rugby";
105
+ CategoryEnum[CategoryEnum["Running"] = 99] = "Running";
106
+ CategoryEnum[CategoryEnum["Soccer"] = 100] = "Soccer";
107
+ CategoryEnum[CategoryEnum["Swimming"] = 101] = "Swimming";
108
+ CategoryEnum[CategoryEnum["Tennis"] = 102] = "Tennis";
109
+ CategoryEnum[CategoryEnum["Volleyball"] = 103] = "Volleyball";
110
+ CategoryEnum[CategoryEnum["Wilderness"] = 104] = "Wilderness";
111
+ CategoryEnum[CategoryEnum["Wrestling"] = 105] = "Wrestling";
112
+ CategoryEnum[CategoryEnum["AfterShows"] = 106] = "AfterShows";
113
+ CategoryEnum[CategoryEnum["FilmHistory"] = 107] = "FilmHistory";
114
+ CategoryEnum[CategoryEnum["FilmInterviews"] = 108] = "FilmInterviews";
115
+ CategoryEnum[CategoryEnum["FilmReviews"] = 109] = "FilmReviews";
116
+ CategoryEnum[CategoryEnum["TVReviews"] = 110] = "TVReviews";
117
+ })(CategoryEnum || (exports.CategoryEnum = CategoryEnum = {}));
118
+ function getCategoryEnumValue(input) {
119
+ const sanitizedInput = input === null || input === void 0 ? void 0 : input.toLowerCase().replace(/\s+/g, '').replace(/[^a-z0-9]/g, '');
120
+ const mapping = {
121
+ arts: CategoryEnum.Arts,
122
+ books: CategoryEnum.Books,
123
+ design: CategoryEnum.Design,
124
+ fashionandbeauty: CategoryEnum.FashionAndBeauty,
125
+ food: CategoryEnum.Food,
126
+ performingarts: CategoryEnum.PerformingArts,
127
+ visualarts: CategoryEnum.VisualArts,
128
+ business: CategoryEnum.Business,
129
+ careers: CategoryEnum.Careers,
130
+ entrepreneurship: CategoryEnum.Entrepreneurship,
131
+ investing: CategoryEnum.Investing,
132
+ management: CategoryEnum.Management,
133
+ marketing: CategoryEnum.Marketing,
134
+ nonprofit: CategoryEnum.NonProfit,
135
+ comedy: CategoryEnum.Comedy,
136
+ comedyinterviews: CategoryEnum.ComedyInterviews,
137
+ improv: CategoryEnum.Improv,
138
+ standup: CategoryEnum.StandUp,
139
+ education: CategoryEnum.Education,
140
+ courses: CategoryEnum.Courses,
141
+ howto: CategoryEnum.HowTo,
142
+ languagelearning: CategoryEnum.LanguageLearning,
143
+ selfimprovement: CategoryEnum.SelfImprovement,
144
+ fiction: CategoryEnum.Fiction,
145
+ comedyfiction: CategoryEnum.ComedyFiction,
146
+ drama: CategoryEnum.Drama,
147
+ sciencefiction: CategoryEnum.ScienceFiction,
148
+ government: CategoryEnum.Government,
149
+ history: CategoryEnum.History,
150
+ healthandfitness: CategoryEnum.HealthAndFitness,
151
+ alternativehealth: CategoryEnum.AlternativeHealth,
152
+ fitness: CategoryEnum.Fitness,
153
+ medicine: CategoryEnum.Medicine,
154
+ mentalhealth: CategoryEnum.MentalHealth,
155
+ nutrition: CategoryEnum.Nutrition,
156
+ sexuality: CategoryEnum.Sexuality,
157
+ kidsandfamily: CategoryEnum.KidsAndFamily,
158
+ educationforkids: CategoryEnum.EducationForKids,
159
+ parenting: CategoryEnum.Parenting,
160
+ petsandanimals: CategoryEnum.PetsAndAnimals,
161
+ storiesforkids: CategoryEnum.StoriesForKids,
162
+ leisure: CategoryEnum.Leisure,
163
+ animationandmanga: CategoryEnum.AnimationAndManga,
164
+ automotive: CategoryEnum.Automotive,
165
+ aviation: CategoryEnum.Aviation,
166
+ crafts: CategoryEnum.Crafts,
167
+ games: CategoryEnum.Games,
168
+ hobbies: CategoryEnum.Hobbies,
169
+ homeandgarden: CategoryEnum.HomeAndGarden,
170
+ videogames: CategoryEnum.VideoGames,
171
+ music: CategoryEnum.Music,
172
+ musiccommentary: CategoryEnum.MusicCommentary,
173
+ musichistory: CategoryEnum.MusicHistory,
174
+ musicinterviews: CategoryEnum.MusicInterviews,
175
+ news: CategoryEnum.News,
176
+ businessnews: CategoryEnum.BusinessNews,
177
+ dailynews: CategoryEnum.DailyNews,
178
+ entertainmentnews: CategoryEnum.EntertainmentNews,
179
+ newscommentary: CategoryEnum.NewsCommentary,
180
+ politics: CategoryEnum.Politics,
181
+ sportsnews: CategoryEnum.SportsNews,
182
+ technews: CategoryEnum.TechNews,
183
+ religionandspirituality: CategoryEnum.ReligionAndSpirituality,
184
+ buddhism: CategoryEnum.Buddhism,
185
+ christianity: CategoryEnum.Christianity,
186
+ hinduism: CategoryEnum.Hinduism,
187
+ islam: CategoryEnum.Islam,
188
+ judaism: CategoryEnum.Judaism,
189
+ religion: CategoryEnum.Religion,
190
+ spirituality: CategoryEnum.Spirituality,
191
+ science: CategoryEnum.Science,
192
+ astronomy: CategoryEnum.Astronomy,
193
+ chemistry: CategoryEnum.Chemistry,
194
+ earthsciences: CategoryEnum.EarthSciences,
195
+ lifesciences: CategoryEnum.LifeSciences,
196
+ mathematics: CategoryEnum.Mathematics,
197
+ naturalsciences: CategoryEnum.NaturalSciences,
198
+ nature: CategoryEnum.Nature,
199
+ physics: CategoryEnum.Physics,
200
+ socialsciences: CategoryEnum.SocialSciences,
201
+ societyandculture: CategoryEnum.SocietyAndCulture,
202
+ documentary: CategoryEnum.Documentary,
203
+ personaljournals: CategoryEnum.PersonalJournals,
204
+ philosophy: CategoryEnum.Philosophy,
205
+ placesandtravel: CategoryEnum.PlacesAndTravel,
206
+ relationships: CategoryEnum.Relationships,
207
+ sports: CategoryEnum.Sports,
208
+ baseball: CategoryEnum.Baseball,
209
+ basketball: CategoryEnum.Basketball,
210
+ cricket: CategoryEnum.Cricket,
211
+ fantasysports: CategoryEnum.FantasySports,
212
+ football: CategoryEnum.Football,
213
+ golf: CategoryEnum.Golf,
214
+ hockey: CategoryEnum.Hockey,
215
+ rugby: CategoryEnum.Rugby,
216
+ running: CategoryEnum.Running,
217
+ soccer: CategoryEnum.Soccer,
218
+ swimming: CategoryEnum.Swimming,
219
+ tennis: CategoryEnum.Tennis,
220
+ volleyball: CategoryEnum.Volleyball,
221
+ wilderness: CategoryEnum.Wilderness,
222
+ wrestling: CategoryEnum.Wrestling,
223
+ technology: CategoryEnum.Technology,
224
+ truecrime: CategoryEnum.TrueCrime,
225
+ tvandfilm: CategoryEnum.TVAndFilm,
226
+ aftershows: CategoryEnum.AfterShows,
227
+ filmhistory: CategoryEnum.FilmHistory,
228
+ filminterviews: CategoryEnum.FilmInterviews,
229
+ filmreviews: CategoryEnum.FilmReviews,
230
+ tvreviews: CategoryEnum.TVReviews
231
+ };
232
+ return (sanitizedInput && mapping[sanitizedInput]) || null;
233
+ }
@@ -0,0 +1,2 @@
1
+ export declare const convertSecondsToDaysText: (seconds: string) => string;
2
+ //# sourceMappingURL=date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/lib/date.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,YAAa,MAAM,WAGvD,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertSecondsToDaysText = void 0;
4
+ const convertSecondsToDaysText = (seconds) => {
5
+ const totalDays = Math.round(parseInt(seconds, 10) / 86400);
6
+ return `${totalDays > 1 ? `${totalDays} days` : '24 hours'}`;
7
+ };
8
+ exports.convertSecondsToDaysText = convertSecondsToDaysText;
@@ -0,0 +1,8 @@
1
+ export declare const ERROR_MESSAGES: {
2
+ ACCOUNT: {
3
+ ALREADY_EXISTS: string;
4
+ NOT_VERIFIED: string;
5
+ };
6
+ INTERNAL_SERVER_ERROR: string;
7
+ };
8
+ //# sourceMappingURL=errorMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorMessages.d.ts","sourceRoot":"","sources":["../../../src/lib/error/errorMessages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;CAM1B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ERROR_MESSAGES = void 0;
4
+ exports.ERROR_MESSAGES = {
5
+ ACCOUNT: {
6
+ ALREADY_EXISTS: 'Cannot create account. Account already exists.',
7
+ NOT_VERIFIED: 'Account not verified.',
8
+ },
9
+ INTERNAL_SERVER_ERROR: 'Something went wrong. Please contact support for assistance.',
10
+ };
@@ -0,0 +1,2 @@
1
+ export declare function generateGuidV4(): string;
2
+ //# sourceMappingURL=guid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guid.d.ts","sourceRoot":"","sources":["../../src/lib/guid.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateGuidV4 = generateGuidV4;
4
+ const uuid_1 = require("uuid");
5
+ function generateGuidV4() {
6
+ return (0, uuid_1.v4)();
7
+ }
@@ -0,0 +1,2 @@
1
+ export declare const formatGuidEnclosureUrl: (url: string) => string;
2
+ //# sourceMappingURL=item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/lib/item.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,QAAS,MAAM,KAAG,MAEpD,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatGuidEnclosureUrl = void 0;
4
+ const databaseConstants_1 = require("@helpers/lib/validation/databaseConstants");
5
+ const formatGuidEnclosureUrl = (url) => {
6
+ return url.slice(0, databaseConstants_1.DATABASE_CONSTANTS.varchar_url);
7
+ };
8
+ exports.formatGuidEnclosureUrl = formatGuidEnclosureUrl;
@@ -0,0 +1,9 @@
1
+ type ItemImagePartial = {
2
+ image_width_size: number | null;
3
+ url: string;
4
+ };
5
+ type Comparison = 'greater' | 'lesser';
6
+ type AllowedExtension = 'png' | 'jpg' | 'gif' | 'jpeg';
7
+ export declare function findImageBySize(itemImages: ItemImagePartial[], size: number, comparison: Comparison, allowedExtensions?: AllowedExtension[]): ItemImagePartial | null;
8
+ export {};
9
+ //# sourceMappingURL=itemImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemImage.d.ts","sourceRoot":"","sources":["../../src/lib/itemImage.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb,CAAA;AAED,KAAK,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AACvC,KAAK,gBAAgB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAGvD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,gBAAgB,EAAE,EAC9B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,UAAU,EACtB,iBAAiB,GAAE,gBAAgB,EAAmB,GACrD,gBAAgB,GAAG,IAAI,CAwCzB"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findImageBySize = findImageBySize;
4
+ function findImageBySize(itemImages, size, comparison, allowedExtensions = ['png', 'jpg']) {
5
+ const extensions = allowedExtensions.map(ext => ext === 'jpeg' ? 'jpg' : ext);
6
+ const isValidExtension = (url) => {
7
+ var _a;
8
+ const urlWithoutParams = url.split('?')[0].split('#')[0];
9
+ const extension = (_a = urlWithoutParams.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
10
+ return extension ? extensions.includes(extension === 'jpeg' ? 'jpg' : extension) : false;
11
+ };
12
+ let filteredImages = [];
13
+ if (comparison === 'greater') {
14
+ filteredImages = itemImages
15
+ .filter(image => image.image_width_size !== null && image.image_width_size >= size && isValidExtension(image.url))
16
+ .sort((a, b) => (a.image_width_size - b.image_width_size));
17
+ }
18
+ else if (comparison === 'lesser') {
19
+ filteredImages = itemImages
20
+ .filter(image => image.image_width_size !== null && image.image_width_size <= size && isValidExtension(image.url))
21
+ .sort((a, b) => (b.image_width_size - a.image_width_size));
22
+ }
23
+ if (filteredImages.length > 0) {
24
+ return filteredImages[0];
25
+ }
26
+ if (comparison === 'greater') {
27
+ filteredImages = itemImages
28
+ .filter(image => image.image_width_size !== null && image.image_width_size < size && isValidExtension(image.url))
29
+ .sort((a, b) => (b.image_width_size - a.image_width_size));
30
+ }
31
+ else if (comparison === 'lesser') {
32
+ filteredImages = itemImages
33
+ .filter(image => image.image_width_size !== null && image.image_width_size > size && isValidExtension(image.url))
34
+ .sort((a, b) => (a.image_width_size - b.image_width_size));
35
+ }
36
+ if (filteredImages.length > 0) {
37
+ return filteredImages[0];
38
+ }
39
+ const nullSizeImage = itemImages.find(image => image.image_width_size === null && isValidExtension(image.url));
40
+ return nullSizeImage || null;
41
+ }
@@ -0,0 +1,10 @@
1
+ declare class TimerManager {
2
+ private timers;
3
+ constructor();
4
+ start(label: string): void;
5
+ end(label: string, preventLog?: boolean): number;
6
+ endAll(): void;
7
+ }
8
+ export declare const timerManager: TimerManager;
9
+ export {};
10
+ //# sourceMappingURL=logTimer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logTimer.d.ts","sourceRoot":"","sources":["../../src/lib/logTimer.ts"],"names":[],"mappings":"AAGA,cAAM,YAAY;IAChB,OAAO,CAAC,MAAM,CAAsB;;IAMpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM1B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAgBhD,MAAM,IAAI,IAAI;CAUf;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timerManager = void 0;
4
+ const config_1 = require("../config");
5
+ const logger_1 = require("./logger");
6
+ class TimerManager {
7
+ constructor() {
8
+ this.timers = new Map();
9
+ }
10
+ start(label) {
11
+ if (config_1.config.shouldLogTimer) {
12
+ this.timers.set(label, performance.now());
13
+ }
14
+ }
15
+ end(label, preventLog) {
16
+ if (config_1.config.shouldLogTimer) {
17
+ const startTime = this.timers.get(label);
18
+ if (startTime !== undefined) {
19
+ const endTime = performance.now();
20
+ const duration = endTime - startTime;
21
+ if (!preventLog) {
22
+ logger_1.logger.info(`${label} took ${duration}ms`);
23
+ }
24
+ this.timers.delete(label);
25
+ return duration;
26
+ }
27
+ }
28
+ return 0;
29
+ }
30
+ endAll() {
31
+ if (config_1.config.shouldLogTimer) {
32
+ this.timers.forEach((startTime, label) => {
33
+ const endTime = performance.now();
34
+ const duration = endTime - startTime;
35
+ logger_1.logger.info(`${label} took ${duration}ms`);
36
+ });
37
+ this.timers.clear();
38
+ }
39
+ }
40
+ }
41
+ exports.timerManager = new TimerManager();
@@ -1,5 +1,5 @@
1
1
  import * as TransportStream from 'winston-transport';
2
2
  export declare const logger: import("winston").Logger;
3
3
  export declare const addRemoteTransport: (transport: TransportStream) => void;
4
- export declare const logError: (message: string, error?: Error) => void;
4
+ export declare const logError: (message: string, error?: Error | unknown) => void;
5
5
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAerD,eAAO,MAAM,MAAM,0BA+BjB,CAAC;AAEH,eAAO,MAAM,kBAAkB,cAAe,eAAe,SAE5D,CAAC;AAEF,eAAO,MAAM,QAAQ,YAAa,MAAM,UAAU,KAAK,SAKtD,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAerD,eAAO,MAAM,MAAM,0BA+BjB,CAAC;AAEH,eAAO,MAAM,kBAAkB,cAAe,eAAe,SAE5D,CAAC;AAEF,eAAO,MAAM,QAAQ,YAAa,MAAM,UAAU,KAAK,GAAG,OAAO,SAUhE,CAAC"}
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.logError = exports.addRemoteTransport = exports.logger = void 0;
27
37
  const config_1 = require("@helpers/config");
@@ -61,8 +71,14 @@ const addRemoteTransport = (transport) => {
61
71
  exports.addRemoteTransport = addRemoteTransport;
62
72
  const logError = (message, error) => {
63
73
  exports.logger.error(message);
64
- if (error === null || error === void 0 ? void 0 : error.message) {
65
- exports.logger.error(error === null || error === void 0 ? void 0 : error.message, { stack: error === null || error === void 0 ? void 0 : error.stack });
74
+ if (error instanceof Error) {
75
+ exports.logger.error(error.message, { stack: error.stack });
76
+ }
77
+ else if (typeof error === 'string') {
78
+ exports.logger.error(error);
79
+ }
80
+ else if (error) {
81
+ exports.logger.error('An unknown error occurred:', { error });
66
82
  }
67
83
  };
68
84
  exports.logError = logError;
@@ -0,0 +1,24 @@
1
+ export declare enum MediumEnum {
2
+ Publisher = 1,
3
+ Podcast = 2,
4
+ Music = 3,
5
+ Video = 4,
6
+ Film = 5,
7
+ Audiobook = 6,
8
+ Newsletter = 7,
9
+ Blog = 8,
10
+ Course = 9,
11
+ Mixed = 10,
12
+ PodcastL = 11,
13
+ MusicL = 12,
14
+ VideoL = 13,
15
+ FilmL = 14,
16
+ AudiobookL = 15,
17
+ NewsletterL = 16,
18
+ BlogL = 17,
19
+ PublisherL = 18,
20
+ CourseL = 19
21
+ }
22
+ export declare function getMediumEnumValue(input: string | null): MediumEnum | null;
23
+ export declare const checkIfSupportedMedium: (mediumEnumKey: number | null) => boolean;
24
+ //# sourceMappingURL=medium.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medium.d.ts","sourceRoot":"","sources":["../../src/lib/medium.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,SAAS,IAAI;IACb,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;IACT,IAAI,IAAI;IACR,SAAS,IAAI;IACb,UAAU,IAAI;IACd,IAAI,IAAI;IACR,MAAM,IAAI;IACV,KAAK,KAAK;IACV,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,MAAM,KAAK;IACX,KAAK,KAAK;IACV,UAAU,KAAK;IACf,WAAW,KAAK;IAChB,KAAK,KAAK;IACV,UAAU,KAAK;IACf,OAAO,KAAK;CACb;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CA4B1E;AAwBD,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,GAAG,IAAI,KAAG,OAErE,CAAC"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkIfSupportedMedium = exports.MediumEnum = void 0;
4
+ exports.getMediumEnumValue = getMediumEnumValue;
5
+ var MediumEnum;
6
+ (function (MediumEnum) {
7
+ MediumEnum[MediumEnum["Publisher"] = 1] = "Publisher";
8
+ MediumEnum[MediumEnum["Podcast"] = 2] = "Podcast";
9
+ MediumEnum[MediumEnum["Music"] = 3] = "Music";
10
+ MediumEnum[MediumEnum["Video"] = 4] = "Video";
11
+ MediumEnum[MediumEnum["Film"] = 5] = "Film";
12
+ MediumEnum[MediumEnum["Audiobook"] = 6] = "Audiobook";
13
+ MediumEnum[MediumEnum["Newsletter"] = 7] = "Newsletter";
14
+ MediumEnum[MediumEnum["Blog"] = 8] = "Blog";
15
+ MediumEnum[MediumEnum["Course"] = 9] = "Course";
16
+ MediumEnum[MediumEnum["Mixed"] = 10] = "Mixed";
17
+ MediumEnum[MediumEnum["PodcastL"] = 11] = "PodcastL";
18
+ MediumEnum[MediumEnum["MusicL"] = 12] = "MusicL";
19
+ MediumEnum[MediumEnum["VideoL"] = 13] = "VideoL";
20
+ MediumEnum[MediumEnum["FilmL"] = 14] = "FilmL";
21
+ MediumEnum[MediumEnum["AudiobookL"] = 15] = "AudiobookL";
22
+ MediumEnum[MediumEnum["NewsletterL"] = 16] = "NewsletterL";
23
+ MediumEnum[MediumEnum["BlogL"] = 17] = "BlogL";
24
+ MediumEnum[MediumEnum["PublisherL"] = 18] = "PublisherL";
25
+ MediumEnum[MediumEnum["CourseL"] = 19] = "CourseL";
26
+ })(MediumEnum || (exports.MediumEnum = MediumEnum = {}));
27
+ function getMediumEnumValue(input) {
28
+ const sanitizedInput = input === null || input === void 0 ? void 0 : input.toLowerCase().replace(/\s+/g, '').replace(/[^a-z0-9]/g, '');
29
+ const mapping = {
30
+ publisher: MediumEnum.Publisher,
31
+ podcast: MediumEnum.Podcast,
32
+ music: MediumEnum.Music,
33
+ video: MediumEnum.Video,
34
+ film: MediumEnum.Film,
35
+ audiobook: MediumEnum.Audiobook,
36
+ newsletter: MediumEnum.Newsletter,
37
+ blog: MediumEnum.Blog,
38
+ course: MediumEnum.Course,
39
+ mixed: MediumEnum.Mixed,
40
+ podcastl: MediumEnum.PodcastL,
41
+ musicl: MediumEnum.MusicL,
42
+ videol: MediumEnum.VideoL,
43
+ filml: MediumEnum.FilmL,
44
+ audiobookl: MediumEnum.AudiobookL,
45
+ newsletterl: MediumEnum.NewsletterL,
46
+ blogl: MediumEnum.BlogL,
47
+ publisherl: MediumEnum.PublisherL,
48
+ coursel: MediumEnum.CourseL
49
+ };
50
+ return (sanitizedInput && mapping[sanitizedInput]) || null;
51
+ }
52
+ const supportedMediums = {
53
+ [MediumEnum.Publisher]: true,
54
+ [MediumEnum.Podcast]: true,
55
+ [MediumEnum.Music]: true,
56
+ [MediumEnum.Video]: true,
57
+ [MediumEnum.Film]: true,
58
+ [MediumEnum.Audiobook]: true,
59
+ [MediumEnum.Newsletter]: false,
60
+ [MediumEnum.Blog]: false,
61
+ [MediumEnum.Course]: false,
62
+ [MediumEnum.Mixed]: false,
63
+ [MediumEnum.PodcastL]: false,
64
+ [MediumEnum.MusicL]: false,
65
+ [MediumEnum.VideoL]: false,
66
+ [MediumEnum.FilmL]: false,
67
+ [MediumEnum.AudiobookL]: false,
68
+ [MediumEnum.NewsletterL]: false,
69
+ [MediumEnum.BlogL]: false,
70
+ [MediumEnum.PublisherL]: false,
71
+ [MediumEnum.CourseL]: false
72
+ };
73
+ const checkIfSupportedMedium = (mediumEnumKey) => {
74
+ return (mediumEnumKey && supportedMediums[mediumEnumKey]) || false;
75
+ };
76
+ exports.checkIfSupportedMedium = checkIfSupportedMedium;
@@ -0,0 +1,5 @@
1
+ export declare function calculateExactRangePositions(value: string): {
2
+ position1: any;
3
+ position2: any;
4
+ };
5
+ //# sourceMappingURL=playlistResource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playlistResource.d.ts","sourceRoot":"","sources":["../../src/lib/playlistResource.ts"],"names":[],"mappings":"AAGA,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,GAAG,CAAC;IAAC,SAAS,EAAE,GAAG,CAAA;CAAE,CAW9F"}
@@ -0,0 +1,18 @@
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.calculateExactRangePositions = calculateExactRangePositions;
7
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ function calculateExactRangePositions(value) {
10
+ const increment = new bignumber_js_1.default('0.000000000000000000001');
11
+ const numValue = new bignumber_js_1.default(value);
12
+ const position1 = numValue.minus(increment).toFixed(21);
13
+ const position2 = numValue.plus(increment).toFixed(21);
14
+ return {
15
+ position1,
16
+ position2
17
+ };
18
+ }
@@ -0,0 +1,6 @@
1
+ export type RemoteItemDto = {
2
+ feed_guid: string;
3
+ feed_url: string | null;
4
+ item_guid: string | null;
5
+ };
6
+ //# sourceMappingURL=remoteItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteItem.d.ts","sourceRoot":"","sources":["../../src/lib/remoteItem.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAEzB,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -25,7 +25,7 @@ const request = (url, requestConfig, abort) => __awaiter(void 0, void 0, void 0,
25
25
  }, abort.timeoutMs);
26
26
  }
27
27
  try {
28
- const response = yield axios_1.default.request(Object.assign({ url, method: 'GET', headers: Object.assign({ 'User-Agent': config_1.config === null || config_1.config === void 0 ? void 0 : config_1.config.userAgent }, requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.headers), signal: (_a = abort === null || abort === void 0 ? void 0 : abort.controller) === null || _a === void 0 ? void 0 : _a.signal }, requestConfig));
28
+ const response = yield axios_1.default.request(Object.assign(Object.assign({ url, method: 'GET' }, requestConfig), { headers: Object.assign({ 'User-Agent': config_1.config === null || config_1.config === void 0 ? void 0 : config_1.config.userAgent }, requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.headers), signal: (_a = abort === null || abort === void 0 ? void 0 : abort.controller) === null || _a === void 0 ? void 0 : _a.signal }));
29
29
  return response.data;
30
30
  }
31
31
  finally {
@@ -0,0 +1,6 @@
1
+ export declare enum SharableStatusEnum {
2
+ Public = 1,
3
+ Unlisted = 2,
4
+ Private = 3
5
+ }
6
+ //# sourceMappingURL=sharableStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharableStatus.d.ts","sourceRoot":"","sources":["../../src/lib/sharableStatus.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,OAAO,IAAI;CACZ"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SharableStatusEnum = void 0;
4
+ var SharableStatusEnum;
5
+ (function (SharableStatusEnum) {
6
+ SharableStatusEnum[SharableStatusEnum["Public"] = 1] = "Public";
7
+ SharableStatusEnum[SharableStatusEnum["Unlisted"] = 2] = "Unlisted";
8
+ SharableStatusEnum[SharableStatusEnum["Private"] = 3] = "Private";
9
+ })(SharableStatusEnum || (exports.SharableStatusEnum = SharableStatusEnum = {}));
@@ -0,0 +1,2 @@
1
+ export declare function sleep(ms: number): Promise<unknown>;
2
+ //# sourceMappingURL=sleep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/lib/sleep.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAE/B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sleep = sleep;
4
+ function sleep(ms) {
5
+ return new Promise(resolve => setTimeout(resolve, ms));
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare const TIME_CONSTANTS: {
2
+ ONE_DAY_IN_MINUTES: number;
3
+ ONE_WEEK_IN_MINUTES: number;
4
+ ONE_MONTH_IN_MINUTES: number;
5
+ };
6
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/lib/time.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;CAI1B,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TIME_CONSTANTS = void 0;
4
+ exports.TIME_CONSTANTS = {
5
+ ONE_DAY_IN_MINUTES: 1440,
6
+ ONE_WEEK_IN_MINUTES: 10080,
7
+ ONE_MONTH_IN_MINUTES: 43200
8
+ };
@@ -0,0 +1,2 @@
1
+ export declare function validateEmail(email: string): boolean;
2
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/email.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIpD"}
@@ -0,0 +1,12 @@
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.validateEmail = validateEmail;
7
+ const joi_1 = __importDefault(require("joi"));
8
+ function validateEmail(email) {
9
+ const schema = joi_1.default.string().email();
10
+ const { error } = schema.validate(email);
11
+ return error ? false : true;
12
+ }
@@ -0,0 +1,2 @@
1
+ export declare const validatePassword: (password: string) => boolean;
2
+ //# sourceMappingURL=password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/password.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,gBAAgB,aAAc,MAAM,YAGhD,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePassword = void 0;
4
+ const databaseConstants_1 = require("./databaseConstants");
5
+ const Joi = require('joi');
6
+ const passwordSchema = Joi.string()
7
+ .min(8)
8
+ .max(databaseConstants_1.DATABASE_CONSTANTS.varchar_password)
9
+ .pattern(new RegExp('(?=.*[a-z])')) // at least one lowercase letter
10
+ .pattern(new RegExp('(?=.*[A-Z])')) // at least one uppercase letter
11
+ .pattern(new RegExp('(?=.*[0-9])')) // at least one number
12
+ .required();
13
+ const validatePassword = (password) => {
14
+ const { error } = passwordSchema.validate(password);
15
+ return error ? false : true;
16
+ };
17
+ exports.validatePassword = validatePassword;
@@ -0,0 +1,2 @@
1
+ export declare function isValidHttpUrl(url?: string | null): true | null;
2
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAM/D"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidHttpUrl = isValidHttpUrl;
4
+ function isValidHttpUrl(url) {
5
+ if (!url) {
6
+ return null;
7
+ }
8
+ const pattern = /^(http|https):\/\//;
9
+ return pattern.test(url) ? true : null;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-helpers",
3
- "version": "5.0.7",
3
+ "version": "5.1.1-alpha.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,15 +11,19 @@
11
11
  "build:watch": "nodemon --watch 'src' --delay 500ms -x \"npm run build\"",
12
12
  "build": "tsc",
13
13
  "lint": "eslint ./src --ext .ts",
14
- "prepare": "npm run build",
14
+ "prepublishOnly": "npm run build",
15
15
  "start": "ts-node ./dist/index.js"
16
16
  },
17
17
  "author": "",
18
18
  "license": "AGPLv3",
19
19
  "dependencies": {
20
20
  "axios": "^1.7.4",
21
+ "bcrypt": "^5.1.1",
22
+ "bignumber.js": "^9.1.2",
23
+ "joi": "^17.13.3",
21
24
  "module-alias": "^2.2.3",
22
25
  "podcast-partytime": "^4.8.0",
26
+ "uuid": "^11.1.0",
23
27
  "winston": "^3.14.2",
24
28
  "winston-transport": "^4.7.1"
25
29
  },
@@ -27,6 +31,7 @@
27
31
  "@eslint/config-array": "^0.18.0",
28
32
  "@eslint/eslintrc": "^3.1.0",
29
33
  "@eslint/js": "^9.8.0",
34
+ "@types/bcrypt": "^5.0.2",
30
35
  "@types/node": "^22.1.0",
31
36
  "eslint": "^9.9.0",
32
37
  "nodemon": "^3.1.4",