podverse-parser 1.0.0 → 5.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/.nvmrc +1 -0
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +7 -81
  5. package/dist/lib/chapters/chapters.d.ts +3 -0
  6. package/dist/lib/chapters/chapters.d.ts.map +1 -0
  7. package/dist/lib/chapters/chapters.js +59 -0
  8. package/dist/lib/compat/channel.d.ts +108 -0
  9. package/dist/lib/compat/channel.d.ts.map +1 -0
  10. package/dist/lib/compat/channel.js +279 -0
  11. package/dist/lib/compat/chapters/chapters.d.ts +11 -0
  12. package/dist/lib/compat/chapters/chapters.d.ts.map +1 -0
  13. package/dist/lib/compat/chapters/chapters.js +16 -0
  14. package/dist/lib/compat/partytime/channel.d.ts +110 -0
  15. package/dist/lib/compat/partytime/channel.d.ts.map +1 -0
  16. package/dist/lib/compat/partytime/channel.js +281 -0
  17. package/dist/lib/compat/partytime/compatFull.d.ts +6 -0
  18. package/dist/lib/compat/partytime/compatFull.d.ts.map +1 -0
  19. package/dist/lib/compat/partytime/compatFull.js +11 -0
  20. package/dist/lib/compat/partytime/funding.d.ts +6 -0
  21. package/dist/lib/compat/partytime/funding.d.ts.map +1 -0
  22. package/dist/lib/compat/partytime/funding.js +10 -0
  23. package/dist/lib/compat/partytime/item.d.ts +146 -0
  24. package/dist/lib/compat/partytime/item.d.ts.map +1 -0
  25. package/dist/lib/compat/partytime/item.js +264 -0
  26. package/dist/lib/compat/partytime/liveItem.d.ts +11 -0
  27. package/dist/lib/compat/partytime/liveItem.d.ts.map +1 -0
  28. package/dist/lib/compat/partytime/liveItem.js +20 -0
  29. package/dist/lib/compat/partytime/value.d.ts +62 -0
  30. package/dist/lib/compat/partytime/value.d.ts.map +1 -0
  31. package/dist/lib/compat/partytime/value.js +69 -0
  32. package/dist/lib/rss/base/handleParsedManyData.d.ts +7 -0
  33. package/dist/lib/rss/base/handleParsedManyData.d.ts.map +1 -0
  34. package/dist/lib/rss/base/handleParsedManyData.js +21 -0
  35. package/dist/lib/rss/base/handleParsedOneData.d.ts +7 -0
  36. package/dist/lib/rss/base/handleParsedOneData.d.ts.map +1 -0
  37. package/dist/lib/rss/base/handleParsedOneData.js +21 -0
  38. package/dist/lib/rss/channel/channel.d.ts +4 -0
  39. package/dist/lib/rss/channel/channel.d.ts.map +1 -0
  40. package/dist/lib/rss/channel/channel.js +61 -0
  41. package/dist/lib/rss/channel/channelAbout.d.ts +4 -0
  42. package/dist/lib/rss/channel/channelAbout.d.ts.map +1 -0
  43. package/dist/lib/rss/channel/channelAbout.js +20 -0
  44. package/dist/lib/rss/channel/channelChat.d.ts +4 -0
  45. package/dist/lib/rss/channel/channelChat.d.ts.map +1 -0
  46. package/dist/lib/rss/channel/channelChat.js +21 -0
  47. package/dist/lib/rss/channel/channelDescription.d.ts +4 -0
  48. package/dist/lib/rss/channel/channelDescription.d.ts.map +1 -0
  49. package/dist/lib/rss/channel/channelDescription.js +21 -0
  50. package/dist/lib/rss/channel/channelFunding.d.ts +4 -0
  51. package/dist/lib/rss/channel/channelFunding.d.ts.map +1 -0
  52. package/dist/lib/rss/channel/channelFunding.js +21 -0
  53. package/dist/lib/rss/channel/channelImage.d.ts +4 -0
  54. package/dist/lib/rss/channel/channelImage.d.ts.map +1 -0
  55. package/dist/lib/rss/channel/channelImage.js +21 -0
  56. package/dist/lib/rss/channel/channelLicense.d.ts +4 -0
  57. package/dist/lib/rss/channel/channelLicense.d.ts.map +1 -0
  58. package/dist/lib/rss/channel/channelLicense.js +21 -0
  59. package/dist/lib/rss/channel/channelLocation.d.ts +4 -0
  60. package/dist/lib/rss/channel/channelLocation.d.ts.map +1 -0
  61. package/dist/lib/rss/channel/channelLocation.js +21 -0
  62. package/dist/lib/rss/channel/channelPerson.d.ts +4 -0
  63. package/dist/lib/rss/channel/channelPerson.d.ts.map +1 -0
  64. package/dist/lib/rss/channel/channelPerson.js +21 -0
  65. package/dist/lib/rss/channel/channelPodroll.d.ts +4 -0
  66. package/dist/lib/rss/channel/channelPodroll.d.ts.map +1 -0
  67. package/dist/lib/rss/channel/channelPodroll.js +28 -0
  68. package/dist/lib/rss/channel/channelRemoteItem.d.ts +4 -0
  69. package/dist/lib/rss/channel/channelRemoteItem.d.ts.map +1 -0
  70. package/dist/lib/rss/channel/channelRemoteItem.js +21 -0
  71. package/dist/lib/rss/channel/channelSeason.d.ts +4 -0
  72. package/dist/lib/rss/channel/channelSeason.d.ts.map +1 -0
  73. package/dist/lib/rss/channel/channelSeason.js +25 -0
  74. package/dist/lib/rss/channel/channelSocialInteract.d.ts +4 -0
  75. package/dist/lib/rss/channel/channelSocialInteract.d.ts.map +1 -0
  76. package/dist/lib/rss/channel/channelSocialInteract.js +21 -0
  77. package/dist/lib/rss/channel/channelTrailer.d.ts +4 -0
  78. package/dist/lib/rss/channel/channelTrailer.d.ts.map +1 -0
  79. package/dist/lib/rss/channel/channelTrailer.js +36 -0
  80. package/dist/lib/rss/channel/channelTxt.d.ts +4 -0
  81. package/dist/lib/rss/channel/channelTxt.d.ts.map +1 -0
  82. package/dist/lib/rss/channel/channelTxt.js +21 -0
  83. package/dist/lib/rss/channel/channelValue.d.ts +4 -0
  84. package/dist/lib/rss/channel/channelValue.d.ts.map +1 -0
  85. package/dist/lib/rss/channel/channelValue.js +37 -0
  86. package/dist/lib/rss/feed/feed.d.ts +5 -0
  87. package/dist/lib/rss/feed/feed.d.ts.map +1 -0
  88. package/dist/lib/rss/feed/feed.js +80 -0
  89. package/dist/lib/rss/hash/parsedFeed.d.ts +3 -0
  90. package/dist/lib/rss/hash/parsedFeed.d.ts.map +1 -0
  91. package/dist/lib/rss/hash/parsedFeed.js +22 -0
  92. package/dist/lib/rss/item/item.d.ts +5 -0
  93. package/dist/lib/rss/item/item.d.ts.map +1 -0
  94. package/dist/lib/rss/item/item.js +80 -0
  95. package/dist/lib/rss/item/itemAbout.d.ts +4 -0
  96. package/dist/lib/rss/item/itemAbout.d.ts.map +1 -0
  97. package/dist/lib/rss/item/itemAbout.js +20 -0
  98. package/dist/lib/rss/item/itemChaptersFeed.d.ts +4 -0
  99. package/dist/lib/rss/item/itemChaptersFeed.d.ts.map +1 -0
  100. package/dist/lib/rss/item/itemChaptersFeed.js +21 -0
  101. package/dist/lib/rss/item/itemChat.d.ts +4 -0
  102. package/dist/lib/rss/item/itemChat.d.ts.map +1 -0
  103. package/dist/lib/rss/item/itemChat.js +21 -0
  104. package/dist/lib/rss/item/itemContentLink.d.ts +1 -0
  105. package/dist/lib/rss/item/itemContentLink.d.ts.map +1 -0
  106. package/dist/lib/rss/item/itemContentLink.js +1 -0
  107. package/dist/lib/rss/item/itemDescription.d.ts +4 -0
  108. package/dist/lib/rss/item/itemDescription.d.ts.map +1 -0
  109. package/dist/lib/rss/item/itemDescription.js +21 -0
  110. package/dist/lib/rss/item/itemEnclosure.d.ts +4 -0
  111. package/dist/lib/rss/item/itemEnclosure.d.ts.map +1 -0
  112. package/dist/lib/rss/item/itemEnclosure.js +40 -0
  113. package/dist/lib/rss/item/itemImage.d.ts +4 -0
  114. package/dist/lib/rss/item/itemImage.d.ts.map +1 -0
  115. package/dist/lib/rss/item/itemImage.js +21 -0
  116. package/dist/lib/rss/item/itemLicense.d.ts +4 -0
  117. package/dist/lib/rss/item/itemLicense.d.ts.map +1 -0
  118. package/dist/lib/rss/item/itemLicense.js +21 -0
  119. package/dist/lib/rss/item/itemLocation.d.ts +4 -0
  120. package/dist/lib/rss/item/itemLocation.d.ts.map +1 -0
  121. package/dist/lib/rss/item/itemLocation.js +21 -0
  122. package/dist/lib/rss/item/itemPerson.d.ts +4 -0
  123. package/dist/lib/rss/item/itemPerson.d.ts.map +1 -0
  124. package/dist/lib/rss/item/itemPerson.js +21 -0
  125. package/dist/lib/rss/item/itemSeason.d.ts +4 -0
  126. package/dist/lib/rss/item/itemSeason.d.ts.map +1 -0
  127. package/dist/lib/rss/item/itemSeason.js +30 -0
  128. package/dist/lib/rss/item/itemSeasonEpisode.d.ts +4 -0
  129. package/dist/lib/rss/item/itemSeasonEpisode.d.ts.map +1 -0
  130. package/dist/lib/rss/item/itemSeasonEpisode.js +21 -0
  131. package/dist/lib/rss/item/itemSocialInteract.d.ts +4 -0
  132. package/dist/lib/rss/item/itemSocialInteract.d.ts.map +1 -0
  133. package/dist/lib/rss/item/itemSocialInteract.js +21 -0
  134. package/dist/lib/rss/item/itemSoundbite.d.ts +4 -0
  135. package/dist/lib/rss/item/itemSoundbite.d.ts.map +1 -0
  136. package/dist/lib/rss/item/itemSoundbite.js +21 -0
  137. package/dist/lib/rss/item/itemTranscript.d.ts +4 -0
  138. package/dist/lib/rss/item/itemTranscript.d.ts.map +1 -0
  139. package/dist/lib/rss/item/itemTranscript.js +21 -0
  140. package/dist/lib/rss/item/itemTxt.d.ts +4 -0
  141. package/dist/lib/rss/item/itemTxt.d.ts.map +1 -0
  142. package/dist/lib/rss/item/itemTxt.js +21 -0
  143. package/dist/lib/rss/item/itemValue.d.ts +4 -0
  144. package/dist/lib/rss/item/itemValue.d.ts.map +1 -0
  145. package/dist/lib/rss/item/itemValue.js +65 -0
  146. package/dist/lib/rss/liveItem/liveItem.d.ts +4 -0
  147. package/dist/lib/rss/liveItem/liveItem.d.ts.map +1 -0
  148. package/dist/lib/rss/liveItem/liveItem.js +41 -0
  149. package/dist/lib/rss/parser.d.ts +4 -0
  150. package/dist/lib/rss/parser.d.ts.map +1 -0
  151. package/dist/lib/rss/parser.js +83 -0
  152. package/dist/module-alias-config.d.ts +2 -0
  153. package/dist/module-alias-config.d.ts.map +1 -0
  154. package/dist/module-alias-config.js +7 -0
  155. package/eslint.config.mjs +38 -0
  156. package/package.json +20 -29
  157. package/src/index.ts +3 -0
  158. package/src/lib/chapters/chapters.ts +54 -0
  159. package/src/lib/compat/channel.ts +287 -0
  160. package/src/lib/compat/chapters/chapters.ts +23 -0
  161. package/src/lib/compat/partytime/channel.ts +289 -0
  162. package/src/lib/compat/partytime/compatFull.ts +7 -0
  163. package/src/lib/compat/partytime/funding.ts +8 -0
  164. package/src/lib/compat/partytime/item.ts +273 -0
  165. package/src/lib/compat/partytime/liveItem.ts +18 -0
  166. package/src/lib/compat/partytime/value.ts +64 -0
  167. package/src/lib/rss/base/handleParsedManyData.ts +16 -0
  168. package/src/lib/rss/base/handleParsedOneData.ts +17 -0
  169. package/src/lib/rss/channel/channel.ts +55 -0
  170. package/src/lib/rss/channel/channelAbout.ts +13 -0
  171. package/src/lib/rss/channel/channelChat.ts +14 -0
  172. package/src/lib/rss/channel/channelDescription.ts +14 -0
  173. package/src/lib/rss/channel/channelFunding.ts +14 -0
  174. package/src/lib/rss/channel/channelImage.ts +14 -0
  175. package/src/lib/rss/channel/channelLicense.ts +14 -0
  176. package/src/lib/rss/channel/channelLocation.ts +14 -0
  177. package/src/lib/rss/channel/channelPerson.ts +14 -0
  178. package/src/lib/rss/channel/channelPodroll.ts +21 -0
  179. package/src/lib/rss/channel/channelRemoteItem.ts +14 -0
  180. package/src/lib/rss/channel/channelSeason.ts +14 -0
  181. package/src/lib/rss/channel/channelSocialInteract.ts +14 -0
  182. package/src/lib/rss/channel/channelTrailer.ts +31 -0
  183. package/src/lib/rss/channel/channelTxt.ts +14 -0
  184. package/src/lib/rss/channel/channelValue.ts +30 -0
  185. package/src/lib/rss/feed/feed.ts +79 -0
  186. package/src/lib/rss/hash/parsedFeed.ts +9 -0
  187. package/src/lib/rss/item/item.ts +85 -0
  188. package/src/lib/rss/item/itemAbout.ts +13 -0
  189. package/src/lib/rss/item/itemChaptersFeed.ts +14 -0
  190. package/src/lib/rss/item/itemChat.ts +14 -0
  191. package/src/lib/rss/item/itemContentLink.ts +0 -0
  192. package/src/lib/rss/item/itemDescription.ts +14 -0
  193. package/src/lib/rss/item/itemEnclosure.ts +35 -0
  194. package/src/lib/rss/item/itemImage.ts +14 -0
  195. package/src/lib/rss/item/itemLicense.ts +14 -0
  196. package/src/lib/rss/item/itemLocation.ts +14 -0
  197. package/src/lib/rss/item/itemPerson.ts +14 -0
  198. package/src/lib/rss/item/itemSeason.ts +26 -0
  199. package/src/lib/rss/item/itemSeasonEpisode.ts +14 -0
  200. package/src/lib/rss/item/itemSocialInteract.ts +14 -0
  201. package/src/lib/rss/item/itemSoundbite.ts +14 -0
  202. package/src/lib/rss/item/itemTranscript.ts +14 -0
  203. package/src/lib/rss/item/itemTxt.ts +14 -0
  204. package/src/lib/rss/item/itemValue.ts +60 -0
  205. package/src/lib/rss/liveItem/liveItem.ts +34 -0
  206. package/src/lib/rss/parser.ts +85 -0
  207. package/src/module-alias-config.ts +8 -0
  208. package/tsconfig.json +25 -0
  209. package/LICENSE +0 -674
  210. package/README.md +0 -2
  211. package/dist/index.js.map +0 -7
@@ -0,0 +1,281 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compatChannelValueDtos = exports.compatChannelTxtDtos = exports.compatChannelTrailerDtos = exports.compatChannelSeasonDtos = exports.compatChannelSocialInteractDtos = exports.compatChannelRemoteItemDtos = exports.compatChannelPublisherRemoteItemDtos = exports.compatChannelPodrollRemoteItemDtos = exports.compatChannelPersonDtos = exports.compatChannelLocationDto = exports.compatChannelLicenseDto = exports.compatChannelImageDtos = exports.compatChannelFundingDtos = exports.compatChannelDescriptionDto = exports.compatChannelChatDto = exports.compatChannelAboutDto = exports.compatChannelDto = void 0;
4
+ const podcast_partytime_1 = require("podcast-partytime");
5
+ const podverse_helpers_1 = require("podverse-helpers");
6
+ const podverse_orm_1 = require("podverse-orm");
7
+ const value_1 = require("@parser/lib/compat/partytime/value");
8
+ const compatChannelDto = (parsedFeed) => {
9
+ var _a;
10
+ return ({
11
+ podcast_guid: parsedFeed.guid,
12
+ title: parsedFeed.title,
13
+ sortable_title: (0, podverse_helpers_1.createSortableTitle)(parsedFeed.title),
14
+ medium: (0, podverse_orm_1.getMediumEnumValue)((_a = parsedFeed.medium) !== null && _a !== void 0 ? _a : podcast_partytime_1.Phase4Medium.Podcast)
15
+ });
16
+ };
17
+ exports.compatChannelDto = compatChannelDto;
18
+ const compatChannelAboutDto = (parsedFeed) => {
19
+ var _a, _b, _c;
20
+ return ({
21
+ author: ((_a = (Array.isArray(parsedFeed.author) ? parsedFeed.author : parsedFeed.author ? [parsedFeed.author] : [])) === null || _a === void 0 ? void 0 : _a.join(', ')) || null,
22
+ explicit: (0, podverse_helpers_1.getBooleanOrNull)(parsedFeed.explicit),
23
+ language: parsedFeed.language || null,
24
+ last_pub_date: parsedFeed.pubDate || null,
25
+ website_link_url: parsedFeed.link || null,
26
+ itunes_type: (0, podverse_orm_1.getChannelItunesTypeItunesTypeEnumValue)(parsedFeed.itunesType || 'episodic'),
27
+ episode_count: (((_b = parsedFeed.items) === null || _b === void 0 ? void 0 : _b.length) || 0) + (((_c = parsedFeed.podcastLiveItems) === null || _c === void 0 ? void 0 : _c.length) || 0),
28
+ });
29
+ };
30
+ exports.compatChannelAboutDto = compatChannelAboutDto;
31
+ const compatChannelChatDto = (parsedFeed) => {
32
+ if (!parsedFeed.chat) {
33
+ return null;
34
+ }
35
+ return {
36
+ server: parsedFeed.chat.server,
37
+ protocol: parsedFeed.chat.protocol,
38
+ account_id: parsedFeed.chat.accountId || null,
39
+ space: parsedFeed.chat.space || null
40
+ };
41
+ };
42
+ exports.compatChannelChatDto = compatChannelChatDto;
43
+ const compatChannelDescriptionDto = (parsedFeed) => {
44
+ if (!parsedFeed.description) {
45
+ return null;
46
+ }
47
+ return {
48
+ value: parsedFeed.description
49
+ };
50
+ };
51
+ exports.compatChannelDescriptionDto = compatChannelDescriptionDto;
52
+ const compatChannelFundingDtos = (parsedFeed) => {
53
+ const dtos = [];
54
+ if (Array.isArray(parsedFeed.podcastFunding)) {
55
+ for (const f of parsedFeed.podcastFunding) {
56
+ if (f.url) {
57
+ dtos.push({
58
+ url: f.url,
59
+ title: f.message || null
60
+ });
61
+ }
62
+ }
63
+ }
64
+ return dtos;
65
+ };
66
+ exports.compatChannelFundingDtos = compatChannelFundingDtos;
67
+ const compatChannelImageDtos = (parsedFeed) => {
68
+ var _a;
69
+ const dtos = [];
70
+ if (parsedFeed.itunesImage) {
71
+ dtos.push({
72
+ url: parsedFeed.itunesImage,
73
+ image_width_size: null
74
+ });
75
+ }
76
+ else if ((_a = parsedFeed.image) === null || _a === void 0 ? void 0 : _a.url) {
77
+ dtos.push({
78
+ url: parsedFeed.image.url,
79
+ image_width_size: null
80
+ });
81
+ }
82
+ function hasWidth(image) {
83
+ return image.width !== undefined;
84
+ }
85
+ if (Array.isArray(parsedFeed.podcastImages)) {
86
+ for (const image of parsedFeed.podcastImages) {
87
+ if (image.parsed.url && hasWidth(image.parsed)) {
88
+ dtos.push({
89
+ url: image.parsed.url,
90
+ image_width_size: image.parsed.width
91
+ });
92
+ }
93
+ }
94
+ }
95
+ return dtos;
96
+ };
97
+ exports.compatChannelImageDtos = compatChannelImageDtos;
98
+ const compatChannelLicenseDto = (parsedFeed) => {
99
+ var _a;
100
+ if (!((_a = parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.license) === null || _a === void 0 ? void 0 : _a.identifier)) {
101
+ return null;
102
+ }
103
+ return {
104
+ identifier: parsedFeed.license.identifier,
105
+ url: parsedFeed.license.url || null
106
+ };
107
+ };
108
+ exports.compatChannelLicenseDto = compatChannelLicenseDto;
109
+ const compatChannelLocationDto = (parsedFeed) => {
110
+ var _a, _b;
111
+ if (!((_a = parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.podcastLocation) === null || _a === void 0 ? void 0 : _a.geo) && !((_b = parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.podcastLocation) === null || _b === void 0 ? void 0 : _b.osm)) {
112
+ return null;
113
+ }
114
+ return {
115
+ geo: parsedFeed.podcastLocation.geo || null,
116
+ osm: parsedFeed.podcastLocation.osm || null,
117
+ name: parsedFeed.podcastLocation.name || null
118
+ };
119
+ };
120
+ exports.compatChannelLocationDto = compatChannelLocationDto;
121
+ const compatChannelPersonDtos = (parsedFeed) => {
122
+ var _a, _b;
123
+ const dtos = [];
124
+ if (Array.isArray(parsedFeed.podcastPeople)) {
125
+ for (const p of parsedFeed.podcastPeople) {
126
+ if (p.name) {
127
+ dtos.push({
128
+ name: p.name,
129
+ role: ((_a = p.role) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || null,
130
+ person_group: ((_b = p.group) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || 'cast',
131
+ img: p.img || null,
132
+ href: p.href || null
133
+ });
134
+ }
135
+ }
136
+ }
137
+ return dtos;
138
+ };
139
+ exports.compatChannelPersonDtos = compatChannelPersonDtos;
140
+ const compatChannelPodrollRemoteItemDtos = (parsedFeed) => {
141
+ const dtos = [];
142
+ if (Array.isArray(parsedFeed.podroll)) {
143
+ for (const ri of parsedFeed.podroll) {
144
+ if (ri.feedGuid) {
145
+ dtos.push({
146
+ feed_guid: ri.feedGuid,
147
+ feed_url: ri.feedUrl || null,
148
+ item_guid: null,
149
+ title: /* PTDO: ri.title || */ null
150
+ });
151
+ }
152
+ }
153
+ }
154
+ return dtos;
155
+ };
156
+ exports.compatChannelPodrollRemoteItemDtos = compatChannelPodrollRemoteItemDtos;
157
+ const compatChannelPublisherRemoteItemDtos = (parsedFeed) => {
158
+ const dtos = [];
159
+ if (Array.isArray(parsedFeed.podroll)) {
160
+ for (const ri of parsedFeed.podroll) {
161
+ if (ri.feedGuid) {
162
+ dtos.push({
163
+ feed_guid: ri.feedGuid,
164
+ feed_url: ri.feedUrl || null,
165
+ item_guid: null,
166
+ title: /* PTDO: ri.title || */ null
167
+ });
168
+ }
169
+ }
170
+ }
171
+ return dtos;
172
+ };
173
+ exports.compatChannelPublisherRemoteItemDtos = compatChannelPublisherRemoteItemDtos;
174
+ const compatChannelRemoteItemDtos = (parsedFeed) => {
175
+ const dtos = [];
176
+ if (Array.isArray(parsedFeed.podcastRemoteItems)) {
177
+ for (const ri of parsedFeed.podcastRemoteItems) {
178
+ if (ri.feedGuid) {
179
+ dtos.push({
180
+ feed_guid: ri.feedGuid,
181
+ feed_url: ri.feedUrl || null,
182
+ item_guid: null,
183
+ title: /* PTDO: ri.title || */ null
184
+ });
185
+ }
186
+ }
187
+ }
188
+ return dtos;
189
+ };
190
+ exports.compatChannelRemoteItemDtos = compatChannelRemoteItemDtos;
191
+ const compatChannelSocialInteractDtos = (parsedFeed) => {
192
+ var _a;
193
+ const dtos = [];
194
+ if ((_a = parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.podcastSocial) === null || _a === void 0 ? void 0 : _a.length) {
195
+ for (const ps of parsedFeed.podcastSocial) {
196
+ dtos.push({
197
+ // PTDO: fix keys mismatch between partytime and podverse
198
+ protocol: ps.platform,
199
+ uri: ps.url,
200
+ account_id: ps.id || null,
201
+ account_url: ps.name || null,
202
+ priority: ps.priority || null
203
+ });
204
+ }
205
+ }
206
+ return dtos;
207
+ };
208
+ exports.compatChannelSocialInteractDtos = compatChannelSocialInteractDtos;
209
+ const compatChannelSeasonDtos = (parsedFeed) => {
210
+ var _a, _b;
211
+ const dtos = [];
212
+ const parsedItems = (parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.items) || [];
213
+ const seasonsIndex = {};
214
+ for (const parsedItem of parsedItems) {
215
+ const seasonNumber = ((_a = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.podcastSeason) === null || _a === void 0 ? void 0 : _a.number) || (parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.itunesSeason);
216
+ const seasonName = ((_b = parsedItem === null || parsedItem === void 0 ? void 0 : parsedItem.podcastSeason) === null || _b === void 0 ? void 0 : _b.name) || null;
217
+ if (Number.isInteger(seasonNumber)) {
218
+ const seasonNumberAsNumber = seasonNumber;
219
+ seasonsIndex[seasonNumberAsNumber] = {
220
+ name: seasonName
221
+ };
222
+ }
223
+ }
224
+ for (const [number, { name }] of Object.entries(seasonsIndex)) {
225
+ dtos.push({
226
+ number: parseInt(number),
227
+ name: name || null
228
+ });
229
+ }
230
+ return dtos;
231
+ };
232
+ exports.compatChannelSeasonDtos = compatChannelSeasonDtos;
233
+ const compatChannelTrailerDtos = (parsedFeed) => {
234
+ var _a;
235
+ const dtos = [];
236
+ if ((_a = parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.trailers) === null || _a === void 0 ? void 0 : _a.length) {
237
+ for (const pt of parsedFeed.trailers) {
238
+ dtos.push({
239
+ url: pt.url,
240
+ title: /* PTDO: add pt.title || */ null,
241
+ pubdate: pt.pubdate,
242
+ length: pt.length || null,
243
+ type: pt.type || null,
244
+ season: pt.season || null
245
+ });
246
+ }
247
+ }
248
+ return dtos;
249
+ };
250
+ exports.compatChannelTrailerDtos = compatChannelTrailerDtos;
251
+ const compatChannelTxtDtos = (parsedFeed) => {
252
+ var _a;
253
+ const dtos = [];
254
+ if ((_a = parsedFeed === null || parsedFeed === void 0 ? void 0 : parsedFeed.podcastTxt) === null || _a === void 0 ? void 0 : _a.length) {
255
+ for (const pt of parsedFeed.podcastTxt) {
256
+ dtos.push({
257
+ purpose: pt.purpose || null,
258
+ value: pt.value
259
+ });
260
+ }
261
+ }
262
+ return dtos;
263
+ };
264
+ exports.compatChannelTxtDtos = compatChannelTxtDtos;
265
+ const compatChannelValueDtos = (parsedFeed) => {
266
+ let dtos = [];
267
+ if (parsedFeed.value) {
268
+ const dto = (0, value_1.compatChannelValue)(parsedFeed.value);
269
+ const formattedDto = {
270
+ channel_value: {
271
+ type: dto.type,
272
+ method: dto.method,
273
+ suggested: dto.suggested || null
274
+ },
275
+ channel_value_recipients: dto.channel_value_recipients
276
+ };
277
+ dtos.push(formattedDto);
278
+ }
279
+ return dtos;
280
+ };
281
+ exports.compatChannelValueDtos = compatChannelValueDtos;
@@ -0,0 +1,6 @@
1
+ export declare const convertParsedRSSFeedToCompat: () => {
2
+ channel: {};
3
+ items: never[];
4
+ liveItems: never[];
5
+ };
6
+ //# sourceMappingURL=compatFull.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatFull.d.ts","sourceRoot":"","sources":["../../../../src/lib/compat/partytime/compatFull.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;;CAMxC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertParsedRSSFeedToCompat = void 0;
4
+ const convertParsedRSSFeedToCompat = () => {
5
+ return {
6
+ channel: {},
7
+ items: [],
8
+ liveItems: []
9
+ };
10
+ };
11
+ exports.convertParsedRSSFeedToCompat = convertParsedRSSFeedToCompat;
@@ -0,0 +1,6 @@
1
+ import { Phase1Funding } from "podcast-partytime";
2
+ export declare const fundingCompat: (funding: Phase1Funding) => {
3
+ value: string;
4
+ url: string;
5
+ };
6
+ //# sourceMappingURL=funding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funding.d.ts","sourceRoot":"","sources":["../../../../src/lib/compat/partytime/funding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAO,MAAM,aAAa,YAAa,aAAa;;;CAKnD,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fundingCompat = void 0;
4
+ const fundingCompat = (funding) => {
5
+ return {
6
+ value: funding.message,
7
+ url: funding.url
8
+ };
9
+ };
10
+ exports.fundingCompat = fundingCompat;
@@ -0,0 +1,146 @@
1
+ import type { Episode } from 'podcast-partytime';
2
+ export declare const compatItemDto: (parsedItem: Episode) => {
3
+ guid: string | null;
4
+ guid_enclosure_url: string;
5
+ pubdate: Date | null;
6
+ title: string | null;
7
+ };
8
+ export declare const compatItemAboutDto: (parsedItem: Episode) => {
9
+ duration: string | null;
10
+ explicit: boolean;
11
+ website_link_url: string | null;
12
+ item_itunes_episode_type: import("podverse-orm").ItemItunesEpisodeTypeEnum;
13
+ };
14
+ export declare const compatItemChaptersFeedDto: (parsedItem: Episode) => {
15
+ url: string;
16
+ type: string;
17
+ } | null;
18
+ export declare const compatItemChatDto: (parsedItem: Episode) => {
19
+ server: string;
20
+ protocol: string;
21
+ account_id: string | null;
22
+ space: string | null;
23
+ } | null;
24
+ export declare const compatItemDescriptionDto: (parsedItem: Episode) => {
25
+ value: string;
26
+ } | null;
27
+ export declare const compatItemEnclosureDtos: (parsedItem: Episode) => {
28
+ item_enclosure: {
29
+ type: string;
30
+ length: number | null;
31
+ bitrate: number | null;
32
+ height: number | null;
33
+ language: string | null;
34
+ title: string | null;
35
+ rel: string | null;
36
+ codecs: string | null;
37
+ item_enclosure_default: boolean;
38
+ };
39
+ item_enclosure_integrity: any;
40
+ item_enclosure_sources: {
41
+ uri: string;
42
+ content_type: string;
43
+ }[];
44
+ }[];
45
+ export declare const compatItemImageDtos: (parsedItem: Episode) => ({
46
+ url: string;
47
+ image_width_size: null;
48
+ } | {
49
+ url: string;
50
+ image_width_size: number;
51
+ })[];
52
+ export declare const compatItemLicenseDto: (parsedItem: Episode) => {
53
+ identifier: string;
54
+ url: string | null;
55
+ } | null;
56
+ export declare const compatItemLocationDto: (parsedItem: Episode) => {
57
+ geo: string | null;
58
+ osm: string | null;
59
+ name: string | null;
60
+ } | null;
61
+ export declare const compatItemPersonDtos: (parsedItem: Episode) => {
62
+ name: string;
63
+ role: string | null;
64
+ person_group: string;
65
+ img: string | null;
66
+ href: string | null;
67
+ }[];
68
+ export declare const compatItemSeasonDto: (parsedItem: Episode) => {
69
+ number: number;
70
+ title: string | null;
71
+ } | null;
72
+ export declare const compatItemSeasonEpisodeDto: (parsedItem: Episode) => {
73
+ display: string | null;
74
+ number: number;
75
+ } | null;
76
+ export declare const compatItemSocialInteractDtos: (parsedItem: Episode) => {
77
+ protocol: string;
78
+ uri: string;
79
+ account_id: string | null;
80
+ account_url: string | null;
81
+ priority: number | null;
82
+ }[];
83
+ export declare const compatItemSoundbiteDtos: (parsedItem: Episode) => {
84
+ start_time: string;
85
+ duration: string;
86
+ title: string | null;
87
+ }[];
88
+ export declare const compatItemTranscriptDtos: (parsedItem: Episode) => {
89
+ url: string;
90
+ type: import("podcast-partytime").TranscriptType;
91
+ language: string | null;
92
+ rel: "captions" | null;
93
+ }[];
94
+ export declare const compatItemTxtDtos: (parsedItem: Episode) => {
95
+ purpose: string | null;
96
+ value: string;
97
+ }[];
98
+ export declare const compatItemValueDtos: (parsedItem: Episode) => {
99
+ item_value: {
100
+ type: string;
101
+ method: string;
102
+ suggested: number | null;
103
+ };
104
+ item_value_recipients: {
105
+ type: string;
106
+ address: string;
107
+ split: number;
108
+ name: string | null;
109
+ custom_key: string | null;
110
+ custom_value: string | null;
111
+ fee: boolean;
112
+ }[];
113
+ item_value_time_splits: ({
114
+ meta: {
115
+ start_time: string;
116
+ duration: string;
117
+ remote_start_time: string;
118
+ remote_percentage: string;
119
+ };
120
+ item_value_time_splits_recipients: never[];
121
+ item_value_time_splits_remote_item: {
122
+ feed_guid: string;
123
+ feed_url: string | null;
124
+ item_guid: string | null;
125
+ title: null;
126
+ } | null;
127
+ } | {
128
+ meta: {
129
+ start_time: string;
130
+ duration: string;
131
+ remote_start_time: string;
132
+ remote_percentage: string;
133
+ };
134
+ item_value_time_splits_recipients: {
135
+ type: string;
136
+ address: string;
137
+ split: number;
138
+ name: string | null;
139
+ custom_key: string | null;
140
+ custom_value: string | null;
141
+ fee: boolean;
142
+ }[];
143
+ item_value_time_splits_remote_item: null;
144
+ })[];
145
+ }[];
146
+ //# sourceMappingURL=item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/lib/compat/partytime/item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,eAAO,MAAM,aAAa,eAAgB,OAAO;;;;;CAK/C,CAAC;AAEH,eAAO,MAAM,kBAAkB,eAAgB,OAAO;;;;;CAKpD,CAAC;AAEH,eAAO,MAAM,yBAAyB,eAAgB,OAAO;;;QAO5D,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAAgB,OAAO;;;;;QAUpD,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,OAAO;;QAO3D,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAgB,OAAO;;;;;;;;;;;;;;;;;GAyC1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,OAAO;;;;;;IA8BtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAgB,OAAO;;;QAQvD,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAgB,OAAO;;;;QAUxD,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAgB,OAAO;;;;;;GAkBvD,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,OAAO;;;QAStD,CAAC;AAEF,eAAO,MAAM,0BAA0B,eAAgB,OAAO;;;QAS7D,CAAC;AAEF,eAAO,MAAM,4BAA4B,eAAgB,OAAO;;;;;;GAiB/D,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAgB,OAAO;;;;GAc1D,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,OAAO;;;;;GAe3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAAgB,OAAO;;;GAapD,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBtD,CAAC"}