feedsmith 2.8.0 → 3.0.0-next.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 (110) hide show
  1. package/README.md +2 -1
  2. package/dist/common/parse.cjs +3 -3
  3. package/dist/common/parse.d.cts +5 -5
  4. package/dist/common/parse.d.ts +5 -5
  5. package/dist/common/parse.js +11 -11
  6. package/dist/common/types.d.cts +21 -9
  7. package/dist/common/types.d.ts +21 -9
  8. package/dist/common/utils.cjs +24 -17
  9. package/dist/common/utils.js +25 -17
  10. package/dist/feeds/atom/common/types.d.cts +53 -50
  11. package/dist/feeds/atom/common/types.d.ts +53 -50
  12. package/dist/feeds/atom/detect/index.cjs +2 -1
  13. package/dist/feeds/atom/detect/index.js +2 -1
  14. package/dist/feeds/atom/generate/index.cjs +1 -1
  15. package/dist/feeds/atom/generate/index.d.cts +2 -2
  16. package/dist/feeds/atom/generate/index.d.ts +2 -2
  17. package/dist/feeds/atom/generate/index.js +1 -1
  18. package/dist/feeds/atom/generate/utils.cjs +17 -14
  19. package/dist/feeds/atom/generate/utils.js +33 -30
  20. package/dist/feeds/atom/parse/index.cjs +1 -1
  21. package/dist/feeds/atom/parse/index.d.cts +2 -2
  22. package/dist/feeds/atom/parse/index.d.ts +2 -2
  23. package/dist/feeds/atom/parse/index.js +1 -1
  24. package/dist/feeds/atom/parse/utils.cjs +11 -16
  25. package/dist/feeds/atom/parse/utils.js +21 -26
  26. package/dist/feeds/json/common/types.d.cts +19 -19
  27. package/dist/feeds/json/common/types.d.ts +19 -19
  28. package/dist/feeds/json/generate/index.d.cts +2 -2
  29. package/dist/feeds/json/generate/index.d.ts +2 -2
  30. package/dist/feeds/json/parse/index.cjs +1 -1
  31. package/dist/feeds/json/parse/index.d.cts +2 -2
  32. package/dist/feeds/json/parse/index.d.ts +2 -2
  33. package/dist/feeds/json/parse/index.js +1 -1
  34. package/dist/feeds/rdf/common/types.d.cts +31 -28
  35. package/dist/feeds/rdf/common/types.d.ts +31 -28
  36. package/dist/feeds/rdf/detect/index.cjs +13 -2
  37. package/dist/feeds/rdf/detect/index.js +13 -2
  38. package/dist/feeds/rdf/parse/index.cjs +1 -1
  39. package/dist/feeds/rdf/parse/index.d.cts +2 -2
  40. package/dist/feeds/rdf/parse/index.d.ts +2 -2
  41. package/dist/feeds/rdf/parse/index.js +1 -1
  42. package/dist/feeds/rdf/parse/utils.cjs +17 -14
  43. package/dist/feeds/rdf/parse/utils.js +15 -12
  44. package/dist/feeds/rss/common/types.d.cts +71 -68
  45. package/dist/feeds/rss/common/types.d.ts +71 -68
  46. package/dist/feeds/rss/generate/index.cjs +1 -1
  47. package/dist/feeds/rss/generate/index.d.cts +2 -2
  48. package/dist/feeds/rss/generate/index.d.ts +2 -2
  49. package/dist/feeds/rss/generate/index.js +1 -1
  50. package/dist/feeds/rss/generate/utils.cjs +35 -32
  51. package/dist/feeds/rss/generate/utils.js +57 -54
  52. package/dist/feeds/rss/parse/index.cjs +1 -1
  53. package/dist/feeds/rss/parse/index.d.cts +2 -2
  54. package/dist/feeds/rss/parse/index.d.ts +2 -2
  55. package/dist/feeds/rss/parse/index.js +1 -1
  56. package/dist/feeds/rss/parse/utils.cjs +69 -65
  57. package/dist/feeds/rss/parse/utils.js +87 -83
  58. package/dist/namespaces/atom/common/types.d.cts +4 -3
  59. package/dist/namespaces/atom/common/types.d.ts +4 -3
  60. package/dist/namespaces/atom/generate/utils.cjs +4 -4
  61. package/dist/namespaces/atom/generate/utils.js +6 -6
  62. package/dist/namespaces/georss/common/types.d.cts +21 -19
  63. package/dist/namespaces/georss/common/types.d.ts +21 -19
  64. package/dist/namespaces/georss/generate/utils.cjs +2 -2
  65. package/dist/namespaces/georss/generate/utils.js +2 -2
  66. package/dist/namespaces/googleplay/common/types.d.cts +9 -7
  67. package/dist/namespaces/googleplay/common/types.d.ts +9 -7
  68. package/dist/namespaces/itunes/common/types.d.cts +9 -5
  69. package/dist/namespaces/itunes/common/types.d.ts +9 -5
  70. package/dist/namespaces/media/common/types.d.cts +85 -85
  71. package/dist/namespaces/media/common/types.d.ts +85 -85
  72. package/dist/namespaces/media/generate/utils.cjs +1 -1
  73. package/dist/namespaces/media/generate/utils.js +2 -2
  74. package/dist/namespaces/media/parse/utils.cjs +1 -2
  75. package/dist/namespaces/media/parse/utils.js +1 -2
  76. package/dist/namespaces/opensearch/common/types.d.cts +7 -5
  77. package/dist/namespaces/opensearch/common/types.d.ts +7 -5
  78. package/dist/namespaces/podcast/common/types.d.cts +139 -148
  79. package/dist/namespaces/podcast/common/types.d.ts +139 -148
  80. package/dist/namespaces/podcast/generate/utils.cjs +11 -8
  81. package/dist/namespaces/podcast/generate/utils.js +12 -9
  82. package/dist/namespaces/podcast/parse/utils.cjs +7 -10
  83. package/dist/namespaces/podcast/parse/utils.js +7 -10
  84. package/dist/namespaces/psc/common/types.d.cts +8 -6
  85. package/dist/namespaces/psc/common/types.d.ts +8 -6
  86. package/dist/namespaces/rawvoice/common/types.d.cts +24 -24
  87. package/dist/namespaces/rawvoice/common/types.d.ts +24 -24
  88. package/dist/namespaces/source/common/types.d.cts +20 -18
  89. package/dist/namespaces/source/common/types.d.ts +20 -18
  90. package/dist/namespaces/spotify/common/types.d.cts +22 -20
  91. package/dist/namespaces/spotify/common/types.d.ts +22 -20
  92. package/dist/namespaces/thr/common/types.d.cts +6 -6
  93. package/dist/namespaces/thr/common/types.d.ts +6 -6
  94. package/dist/namespaces/xml/common/types.d.cts +11 -0
  95. package/dist/namespaces/xml/common/types.d.ts +11 -0
  96. package/dist/namespaces/xml/generate/utils.cjs +15 -0
  97. package/dist/namespaces/xml/generate/utils.js +15 -0
  98. package/dist/namespaces/xml/parse/utils.cjs +15 -0
  99. package/dist/namespaces/xml/parse/utils.js +15 -0
  100. package/dist/opml/common/types.d.cts +11 -9
  101. package/dist/opml/common/types.d.ts +11 -9
  102. package/dist/opml/generate/index.cjs +1 -1
  103. package/dist/opml/generate/index.d.cts +2 -2
  104. package/dist/opml/generate/index.d.ts +2 -2
  105. package/dist/opml/generate/index.js +1 -1
  106. package/dist/opml/parse/index.d.cts +1 -2
  107. package/dist/opml/parse/index.d.ts +1 -2
  108. package/dist/types.d.cts +1 -2
  109. package/dist/types.d.ts +1 -2
  110. package/package.json +6 -8
@@ -1,87 +1,83 @@
1
- import { DateLike } from "../../../common/types.js";
1
+ import { DateLike, Requirable, Strict } from "../../../common/types.js";
2
2
 
3
3
  //#region src/namespaces/podcast/common/types.d.ts
4
4
  declare namespace PodcastNs {
5
5
  /** @internal Common properties shared by Item and LiveItem. */
6
- type BaseItem = {
7
- transcripts?: Array<Transcript>;
8
- chapters?: Chapters;
9
- soundbites?: Array<Soundbite>;
10
- persons?: Array<Person>;
11
- locations?: Array<Location>;
12
- season?: Season;
13
- episode?: Episode;
14
- license?: License;
15
- alternateEnclosures?: Array<AlternateEnclosure>;
16
- values?: Array<Value>;
17
- images?: Array<Image>;
18
- socialInteracts?: Array<SocialInteract>;
19
- txts?: Array<Txt>;
20
- chat?: Chat;
21
- /** @deprecated Use `locations` (array) instead. Multiple podcast:location elements are allowed per specification. */
22
- location?: Location;
23
- /** @deprecated Use `values` (array) instead. Multiple podcast:value elements are allowed per specification. */
24
- value?: Value;
25
- /** @deprecated Use `chat` (singular) instead. Only one podcast:chat element is allowed per specification. */
26
- chats?: Array<Chat>;
27
- };
28
- type Transcript = {
29
- url: string;
30
- type: string;
6
+ type BaseItem<TStrict extends boolean = false> = {
7
+ transcripts?: Array<Transcript<TStrict>>;
8
+ chapters?: Chapters<TStrict>;
9
+ soundbites?: Array<Soundbite<TStrict>>;
10
+ persons?: Array<Person<TStrict>>;
11
+ locations?: Array<Location<TStrict>>;
12
+ season?: Season<TStrict>;
13
+ episode?: Episode<TStrict>;
14
+ license?: License<TStrict>;
15
+ alternateEnclosures?: Array<AlternateEnclosure<TStrict>>;
16
+ values?: Array<Value<TStrict>>;
17
+ images?: Array<Image<TStrict>>;
18
+ socialInteracts?: Array<SocialInteract<TStrict>>;
19
+ txts?: Array<Txt<TStrict>>;
20
+ chat?: Chat<TStrict>;
21
+ };
22
+ type Transcript<TStrict extends boolean = false> = Strict<{
23
+ url: Requirable<string>;
24
+ type: Requirable<string>;
31
25
  language?: string;
32
26
  rel?: string;
33
- };
34
- type Locked = {
35
- value: boolean;
27
+ }, TStrict>;
28
+ type Locked<TStrict extends boolean = false> = Strict<{
29
+ value: Requirable<boolean>;
36
30
  owner?: string;
37
- };
38
- type Funding = {
39
- url: string;
31
+ }, TStrict>;
32
+ type Funding<TStrict extends boolean = false> = Strict<{
33
+ url: Requirable<string>;
40
34
  display?: string;
41
- };
42
- type Chapters = {
43
- url: string;
44
- type: string;
45
- };
46
- type Soundbite = {
47
- startTime: number;
48
- duration: number;
35
+ }, TStrict>;
36
+ type Chapters<TStrict extends boolean = false> = Strict<{
37
+ url: Requirable<string>;
38
+ type: Requirable<string>;
39
+ }, TStrict>;
40
+ type Soundbite<TStrict extends boolean = false> = Strict<{
41
+ startTime: Requirable<number>;
42
+ duration: Requirable<number>;
49
43
  display?: string;
50
- };
51
- type Person = {
52
- display: string;
44
+ }, TStrict>;
45
+ type Person<TStrict extends boolean = false> = Strict<{
46
+ display: Requirable<string>;
53
47
  role?: string;
54
48
  group?: string;
55
49
  img?: string;
56
50
  href?: string;
57
- };
58
- type Location = {
59
- display: string;
51
+ }, TStrict>;
52
+ type Location<TStrict extends boolean = false> = Strict<{
53
+ display: Requirable<string>;
54
+ rel?: string;
60
55
  geo?: string;
61
56
  osm?: string;
62
- };
63
- type Season = {
64
- number: number;
57
+ country?: string;
58
+ }, TStrict>;
59
+ type Season<TStrict extends boolean = false> = Strict<{
60
+ number: Requirable<number>;
65
61
  name?: string;
66
- };
67
- type Episode = {
68
- number: number;
62
+ }, TStrict>;
63
+ type Episode<TStrict extends boolean = false> = Strict<{
64
+ number: Requirable<number>;
69
65
  display?: string;
70
- };
71
- type Trailer<TDate extends DateLike> = {
72
- display: string;
73
- url: string;
74
- pubDate: TDate;
66
+ }, TStrict>;
67
+ type Trailer<TDate extends DateLike, TStrict extends boolean = false> = Strict<{
68
+ display: Requirable<string>;
69
+ url: Requirable<string>;
70
+ pubDate: Requirable<TDate>;
75
71
  length?: number;
76
72
  type?: string;
77
73
  season?: number;
78
- };
79
- type License = {
80
- display: string;
74
+ }, TStrict>;
75
+ type License<TStrict extends boolean = false> = Strict<{
76
+ display: Requirable<string>;
81
77
  url?: string;
82
- };
83
- type AlternateEnclosure = {
84
- type: string;
78
+ }, TStrict>;
79
+ type AlternateEnclosure<TStrict extends boolean = false> = Strict<{
80
+ type: Requirable<string>;
85
81
  length?: number;
86
82
  bitrate?: number;
87
83
  height?: number;
@@ -90,133 +86,128 @@ declare namespace PodcastNs {
90
86
  rel?: string;
91
87
  codecs?: string;
92
88
  default?: boolean;
93
- sources?: Array<Source>;
94
- integrity?: Integrity;
95
- };
96
- type Source = {
97
- uri: string;
89
+ sources?: Array<Source<TStrict>>;
90
+ integrity?: Integrity<TStrict>;
91
+ }, TStrict>;
92
+ type Source<TStrict extends boolean = false> = Strict<{
93
+ uri: Requirable<string>;
98
94
  contentType?: string;
99
- };
100
- type Integrity = {
101
- type: string;
102
- value: string;
103
- };
104
- type Value = {
105
- type: string;
106
- method: string;
95
+ }, TStrict>;
96
+ type Integrity<TStrict extends boolean = false> = Strict<{
97
+ type: Requirable<string>;
98
+ value: Requirable<string>;
99
+ }, TStrict>;
100
+ type Value<TStrict extends boolean = false> = Strict<{
101
+ type: Requirable<string>;
102
+ method: Requirable<string>;
107
103
  suggested?: number;
108
- valueRecipients?: Array<ValueRecipient>;
109
- valueTimeSplits?: Array<ValueTimeSplit>;
110
- };
111
- type ValueRecipient = {
104
+ valueRecipients?: Array<ValueRecipient<TStrict>>;
105
+ valueTimeSplits?: Array<ValueTimeSplit<TStrict>>;
106
+ }, TStrict>;
107
+ type ValueRecipient<TStrict extends boolean = false> = Strict<{
112
108
  name?: string;
113
109
  customKey?: string;
114
110
  customValue?: string;
115
- type: string;
116
- address: string;
117
- split: number;
111
+ type: Requirable<string>;
112
+ address: Requirable<string>;
113
+ split: Requirable<number>;
118
114
  fee?: boolean;
119
- };
115
+ }, TStrict>;
120
116
  /** @internal Legacy type for parsing podcast:images with srcset attribute. */
121
117
  type Images = {
122
118
  srcset?: string;
123
119
  };
124
- type Image = {
125
- href: string;
120
+ type Image<TStrict extends boolean = false> = Strict<{
121
+ href: Requirable<string>;
126
122
  alt?: string;
127
123
  aspectRatio?: string;
128
124
  width?: number;
129
125
  height?: number;
130
126
  type?: string;
131
127
  purpose?: string;
132
- };
133
- type LiveItem<TDate extends DateLike> = BaseItem & {
134
- status: string;
135
- start: TDate;
128
+ }, TStrict>;
129
+ type LiveItem<TDate extends DateLike, TStrict extends boolean = false> = BaseItem<TStrict> & Strict<{
130
+ status: Requirable<string>;
131
+ start: Requirable<TDate>;
136
132
  end?: TDate;
137
- contentLinks?: Array<ContentLink>;
138
- };
139
- type ContentLink = {
140
- href: string;
133
+ contentLinks?: Array<ContentLink<TStrict>>;
134
+ }, TStrict>;
135
+ type ContentLink<TStrict extends boolean = false> = Strict<{
136
+ href: Requirable<string>;
141
137
  display?: string;
142
- };
143
- type SocialInteract = {
138
+ }, TStrict>;
139
+ type SocialInteract<TStrict extends boolean = false> = Strict<{
144
140
  uri?: string;
145
- protocol: string;
141
+ protocol: Requirable<string>;
146
142
  accountId?: string;
147
143
  accountUrl?: string;
148
144
  priority?: number;
149
- };
150
- type Chat = {
151
- server: string;
152
- protocol: string;
145
+ }, TStrict>;
146
+ type Chat<TStrict extends boolean = false> = Strict<{
147
+ server: Requirable<string>;
148
+ protocol: Requirable<string>;
153
149
  accountId?: string;
154
150
  space?: string;
155
- };
156
- type Block = {
157
- value: boolean;
151
+ }, TStrict>;
152
+ type Block<TStrict extends boolean = false> = Strict<{
153
+ value: Requirable<boolean>;
158
154
  id?: string;
159
- };
160
- type Txt = {
161
- display: string;
155
+ }, TStrict>;
156
+ type Txt<TStrict extends boolean = false> = Strict<{
157
+ display: Requirable<string>;
162
158
  purpose?: string;
163
- };
164
- type RemoteItem = {
165
- feedGuid: string;
159
+ }, TStrict>;
160
+ type RemoteItem<TStrict extends boolean = false> = Strict<{
161
+ feedGuid: Requirable<string>;
166
162
  feedUrl?: string;
167
163
  itemGuid?: string;
168
164
  medium?: string;
165
+ title?: string;
166
+ }, TStrict>;
167
+ type Podroll<TStrict extends boolean = false> = {
168
+ remoteItems?: Array<RemoteItem<TStrict>>;
169
169
  };
170
- type Podroll = {
171
- remoteItems?: Array<RemoteItem>;
172
- };
173
- type UpdateFrequency<TDate extends DateLike> = {
174
- display: string;
170
+ type UpdateFrequency<TDate extends DateLike, TStrict extends boolean = false> = Strict<{
171
+ display: Requirable<string>;
175
172
  complete?: boolean;
176
173
  dtstart?: TDate;
177
174
  rrule?: string;
178
- };
175
+ }, TStrict>;
179
176
  type Podping = {
180
177
  usesPodping?: boolean;
181
178
  };
182
- type Publisher = {
183
- remoteItem?: RemoteItem;
179
+ type Publisher<TStrict extends boolean = false> = {
180
+ remoteItem?: RemoteItem<TStrict>;
184
181
  };
185
- type ValueTimeSplit = {
186
- startTime: number;
187
- duration: number;
182
+ type ValueTimeSplit<TStrict extends boolean = false> = Strict<{
183
+ startTime: Requirable<number>;
184
+ duration: Requirable<number>;
188
185
  remoteStartTime?: number;
189
186
  remotePercentage?: number;
190
- remoteItem?: RemoteItem;
191
- valueRecipients?: Array<ValueRecipient>;
192
- };
193
- type Item = BaseItem;
194
- type Feed<TDate extends DateLike> = {
195
- locked?: Locked;
196
- fundings?: Array<Funding>;
197
- persons?: Array<Person>;
198
- locations?: Array<Location>;
199
- trailers?: Array<Trailer<TDate>>;
200
- license?: License;
187
+ remoteItem?: RemoteItem<TStrict>;
188
+ valueRecipients?: Array<ValueRecipient<TStrict>>;
189
+ }, TStrict>;
190
+ type Item<TStrict extends boolean = false> = BaseItem<TStrict>;
191
+ type Feed<TDate extends DateLike, TStrict extends boolean = false> = {
192
+ locked?: Locked<TStrict>;
193
+ fundings?: Array<Funding<TStrict>>;
194
+ persons?: Array<Person<TStrict>>;
195
+ locations?: Array<Location<TStrict>>;
196
+ trailers?: Array<Trailer<TDate, TStrict>>;
197
+ license?: License<TStrict>;
201
198
  guid?: string;
202
- values?: Array<Value>;
199
+ values?: Array<Value<TStrict>>;
203
200
  medium?: string;
204
- images?: Array<Image>;
205
- liveItems?: Array<LiveItem<TDate>>;
206
- blocks?: Array<Block>;
207
- txts?: Array<Txt>;
208
- remoteItems?: Array<RemoteItem>;
209
- podroll?: Podroll;
210
- updateFrequency?: UpdateFrequency<TDate>;
201
+ images?: Array<Image<TStrict>>;
202
+ liveItems?: Array<LiveItem<TDate, TStrict>>;
203
+ blocks?: Array<Block<TStrict>>;
204
+ txts?: Array<Txt<TStrict>>;
205
+ remoteItems?: Array<RemoteItem<TStrict>>;
206
+ podroll?: Podroll<TStrict>;
207
+ updateFrequency?: UpdateFrequency<TDate, TStrict>;
211
208
  podping?: Podping;
212
- chat?: Chat;
213
- publisher?: Publisher;
214
- /** @deprecated Use `locations` (array) instead. Multiple podcast:location elements are allowed per specification. */
215
- location?: Location;
216
- /** @deprecated Use `values` (array) instead. Multiple podcast:value elements are allowed per specification. */
217
- value?: Value;
218
- /** @deprecated Use `chat` (singular) instead. Only one podcast:chat element is allowed per specification. */
219
- chats?: Array<Chat>;
209
+ chat?: Chat<TStrict>;
210
+ publisher?: Publisher<TStrict>;
220
211
  };
221
212
  }
222
213
  //#endregion
@@ -8,16 +8,16 @@ const generateBaseItem = (baseItem) => {
8
8
  "podcast:chapters": generateChapters(baseItem.chapters),
9
9
  "podcast:soundbite": require_utils.trimArray(baseItem.soundbites, generateSoundbite),
10
10
  "podcast:person": require_utils.trimArray(baseItem.persons, generatePerson),
11
- "podcast:location": require_utils.generateArrayOrSingular(baseItem.locations, baseItem.location, generateLocation),
11
+ "podcast:location": require_utils.trimArray(baseItem.locations, generateLocation),
12
12
  "podcast:season": generateSeason(baseItem.season),
13
13
  "podcast:episode": generateEpisode(baseItem.episode),
14
14
  "podcast:license": generateLicense(baseItem.license),
15
15
  "podcast:alternateEnclosure": require_utils.trimArray(baseItem.alternateEnclosures, generateAlternateEnclosure),
16
- "podcast:value": require_utils.generateArrayOrSingular(baseItem.values, baseItem.value, generateValue),
16
+ "podcast:value": require_utils.trimArray(baseItem.values, generateValue),
17
17
  "podcast:image": require_utils.trimArray(baseItem.images, generateImage),
18
18
  "podcast:socialInteract": require_utils.trimArray(baseItem.socialInteracts, generateSocialInteract),
19
19
  "podcast:txt": require_utils.trimArray(baseItem.txts, generateTxt),
20
- "podcast:chat": require_utils.generateSingularOrArray(baseItem.chat, baseItem.chats, generateChat)
20
+ "podcast:chat": generateChat(baseItem.chat)
21
21
  });
22
22
  };
23
23
  const generateTranscript = (transcript) => {
@@ -72,8 +72,10 @@ const generateLocation = (location) => {
72
72
  if (!require_utils.isObject(location)) return;
73
73
  return require_utils.trimObject({
74
74
  ...require_utils.generateTextOrCdataString(location.display),
75
+ "@rel": require_utils.generatePlainString(location.rel),
75
76
  "@geo": require_utils.generatePlainString(location.geo),
76
- "@osm": require_utils.generatePlainString(location.osm)
77
+ "@osm": require_utils.generatePlainString(location.osm),
78
+ "@country": require_utils.generatePlainString(location.country)
77
79
  });
78
80
  };
79
81
  const generateSeason = (season) => {
@@ -239,7 +241,8 @@ const generateRemoteItem = (remoteItem) => {
239
241
  "@feedGuid": require_utils.generatePlainString(remoteItem.feedGuid),
240
242
  "@feedUrl": require_utils.generatePlainString(remoteItem.feedUrl),
241
243
  "@itemGuid": require_utils.generatePlainString(remoteItem.itemGuid),
242
- "@medium": require_utils.generatePlainString(remoteItem.medium)
244
+ "@medium": require_utils.generatePlainString(remoteItem.medium),
245
+ "@title": require_utils.generatePlainString(remoteItem.title)
243
246
  });
244
247
  };
245
248
  const generatePodroll = (podroll) => {
@@ -273,11 +276,11 @@ const generateFeed = (feed) => {
273
276
  "podcast:locked": generateLocked(feed.locked),
274
277
  "podcast:funding": require_utils.trimArray(feed.fundings, generateFunding),
275
278
  "podcast:person": require_utils.trimArray(feed.persons, generatePerson),
276
- "podcast:location": require_utils.generateArrayOrSingular(feed.locations, feed.location, generateLocation),
279
+ "podcast:location": require_utils.trimArray(feed.locations, generateLocation),
277
280
  "podcast:trailer": require_utils.trimArray(feed.trailers, generateTrailer),
278
281
  "podcast:license": generateLicense(feed.license),
279
282
  "podcast:guid": require_utils.generateCdataString(feed.guid),
280
- "podcast:value": require_utils.generateArrayOrSingular(feed.values, feed.value, generateValue),
283
+ "podcast:value": require_utils.trimArray(feed.values, generateValue),
281
284
  "podcast:medium": require_utils.generateCdataString(feed.medium),
282
285
  "podcast:image": require_utils.trimArray(feed.images, generateImage),
283
286
  "podcast:liveItem": require_utils.trimArray(feed.liveItems, generateLiveItem),
@@ -287,7 +290,7 @@ const generateFeed = (feed) => {
287
290
  "podcast:podroll": generatePodroll(feed.podroll),
288
291
  "podcast:updateFrequency": generateUpdateFrequency(feed.updateFrequency),
289
292
  "podcast:podping": generatePodping(feed.podping),
290
- "podcast:chat": require_utils.generateSingularOrArray(feed.chat, feed.chats, generateChat),
293
+ "podcast:chat": generateChat(feed.chat),
291
294
  "podcast:publisher": generatePublisher(feed.publisher)
292
295
  });
293
296
  };
@@ -1,4 +1,4 @@
1
- import { generateArrayOrSingular, generateBoolean, generateCdataString, generateNumber, generatePlainString, generateRfc3339Date, generateRfc822Date, generateSingularOrArray, generateTextOrCdataString, generateYesNoBoolean, isObject, trimArray, trimObject } from "../../../common/utils.js";
1
+ import { generateBoolean, generateCdataString, generateNumber, generatePlainString, generateRfc3339Date, generateRfc822Date, generateTextOrCdataString, generateYesNoBoolean, isObject, trimArray, trimObject } from "../../../common/utils.js";
2
2
 
3
3
  //#region src/namespaces/podcast/generate/utils.ts
4
4
  const generateBaseItem = (baseItem) => {
@@ -8,16 +8,16 @@ const generateBaseItem = (baseItem) => {
8
8
  "podcast:chapters": generateChapters(baseItem.chapters),
9
9
  "podcast:soundbite": trimArray(baseItem.soundbites, generateSoundbite),
10
10
  "podcast:person": trimArray(baseItem.persons, generatePerson),
11
- "podcast:location": generateArrayOrSingular(baseItem.locations, baseItem.location, generateLocation),
11
+ "podcast:location": trimArray(baseItem.locations, generateLocation),
12
12
  "podcast:season": generateSeason(baseItem.season),
13
13
  "podcast:episode": generateEpisode(baseItem.episode),
14
14
  "podcast:license": generateLicense(baseItem.license),
15
15
  "podcast:alternateEnclosure": trimArray(baseItem.alternateEnclosures, generateAlternateEnclosure),
16
- "podcast:value": generateArrayOrSingular(baseItem.values, baseItem.value, generateValue),
16
+ "podcast:value": trimArray(baseItem.values, generateValue),
17
17
  "podcast:image": trimArray(baseItem.images, generateImage),
18
18
  "podcast:socialInteract": trimArray(baseItem.socialInteracts, generateSocialInteract),
19
19
  "podcast:txt": trimArray(baseItem.txts, generateTxt),
20
- "podcast:chat": generateSingularOrArray(baseItem.chat, baseItem.chats, generateChat)
20
+ "podcast:chat": generateChat(baseItem.chat)
21
21
  });
22
22
  };
23
23
  const generateTranscript = (transcript) => {
@@ -72,8 +72,10 @@ const generateLocation = (location) => {
72
72
  if (!isObject(location)) return;
73
73
  return trimObject({
74
74
  ...generateTextOrCdataString(location.display),
75
+ "@rel": generatePlainString(location.rel),
75
76
  "@geo": generatePlainString(location.geo),
76
- "@osm": generatePlainString(location.osm)
77
+ "@osm": generatePlainString(location.osm),
78
+ "@country": generatePlainString(location.country)
77
79
  });
78
80
  };
79
81
  const generateSeason = (season) => {
@@ -239,7 +241,8 @@ const generateRemoteItem = (remoteItem) => {
239
241
  "@feedGuid": generatePlainString(remoteItem.feedGuid),
240
242
  "@feedUrl": generatePlainString(remoteItem.feedUrl),
241
243
  "@itemGuid": generatePlainString(remoteItem.itemGuid),
242
- "@medium": generatePlainString(remoteItem.medium)
244
+ "@medium": generatePlainString(remoteItem.medium),
245
+ "@title": generatePlainString(remoteItem.title)
243
246
  });
244
247
  };
245
248
  const generatePodroll = (podroll) => {
@@ -273,11 +276,11 @@ const generateFeed = (feed) => {
273
276
  "podcast:locked": generateLocked(feed.locked),
274
277
  "podcast:funding": trimArray(feed.fundings, generateFunding),
275
278
  "podcast:person": trimArray(feed.persons, generatePerson),
276
- "podcast:location": generateArrayOrSingular(feed.locations, feed.location, generateLocation),
279
+ "podcast:location": trimArray(feed.locations, generateLocation),
277
280
  "podcast:trailer": trimArray(feed.trailers, generateTrailer),
278
281
  "podcast:license": generateLicense(feed.license),
279
282
  "podcast:guid": generateCdataString(feed.guid),
280
- "podcast:value": generateArrayOrSingular(feed.values, feed.value, generateValue),
283
+ "podcast:value": trimArray(feed.values, generateValue),
281
284
  "podcast:medium": generateCdataString(feed.medium),
282
285
  "podcast:image": trimArray(feed.images, generateImage),
283
286
  "podcast:liveItem": trimArray(feed.liveItems, generateLiveItem),
@@ -287,7 +290,7 @@ const generateFeed = (feed) => {
287
290
  "podcast:podroll": generatePodroll(feed.podroll),
288
291
  "podcast:updateFrequency": generateUpdateFrequency(feed.updateFrequency),
289
292
  "podcast:podping": generatePodping(feed.podping),
290
- "podcast:chat": generateSingularOrArray(feed.chat, feed.chats, generateChat),
293
+ "podcast:chat": generateChat(feed.chat),
291
294
  "podcast:publisher": generatePublisher(feed.publisher)
292
295
  });
293
296
  };
@@ -50,8 +50,10 @@ const parsePerson = (value) => {
50
50
  const parseLocation = (value) => {
51
51
  return require_utils.trimObject({
52
52
  display: require_utils.parseString(require_utils.retrieveText(value)),
53
+ rel: require_utils.parseString(value?.["@rel"]),
53
54
  geo: require_utils.parseString(value?.["@geo"]),
54
- osm: require_utils.parseString(value?.["@osm"])
55
+ osm: require_utils.parseString(value?.["@osm"]),
56
+ country: require_utils.parseString(value?.["@country"])
55
57
  });
56
58
  };
57
59
  const parseSeason = (value) => {
@@ -219,7 +221,8 @@ const parseRemoteItem = (value) => {
219
221
  feedGuid: require_utils.parseString(value["@feedguid"]),
220
222
  feedUrl: require_utils.parseString(value["@feedurl"]),
221
223
  itemGuid: require_utils.parseString(value["@itemguid"]),
222
- medium: require_utils.parseString(value["@medium"])
224
+ medium: require_utils.parseString(value["@medium"]),
225
+ title: require_utils.parseString(value["@title"])
223
226
  });
224
227
  };
225
228
  const parsePodroll = (value) => {
@@ -269,10 +272,7 @@ const retrieveItem = (value) => {
269
272
  images: retrieveImages(value),
270
273
  socialInteracts: require_utils.parseArrayOf(value["podcast:socialinteract"], parseSocialInteract),
271
274
  txts: require_utils.parseArrayOf(value["podcast:txt"], parseTxt),
272
- chat: require_utils.parseSingularOf(value["podcast:chat"], parseChat),
273
- location: require_utils.parseSingularOf(value["podcast:location"], parseLocation),
274
- value: require_utils.parseSingularOf(value["podcast:value"], parseValue),
275
- chats: require_utils.parseArrayOf(value["podcast:chat"], parseChat)
275
+ chat: require_utils.parseSingularOf(value["podcast:chat"], parseChat)
276
276
  });
277
277
  };
278
278
  const retrieveFeed = (value) => {
@@ -296,10 +296,7 @@ const retrieveFeed = (value) => {
296
296
  updateFrequency: require_utils.parseSingularOf(value["podcast:updatefrequency"], parseUpdateFrequency),
297
297
  podping: require_utils.parseSingularOf(value["podcast:podping"], parsePodping),
298
298
  chat: require_utils.parseSingularOf(value["podcast:chat"], parseChat),
299
- publisher: require_utils.parseSingularOf(value["podcast:publisher"], parsePublisher),
300
- location: require_utils.parseSingularOf(value["podcast:location"], parseLocation),
301
- value: require_utils.parseSingularOf(value["podcast:value"], parseValue),
302
- chats: require_utils.parseArrayOf(value["podcast:chat"], parseChat)
299
+ publisher: require_utils.parseSingularOf(value["podcast:publisher"], parsePublisher)
303
300
  });
304
301
  };
305
302
 
@@ -50,8 +50,10 @@ const parsePerson = (value) => {
50
50
  const parseLocation = (value) => {
51
51
  return trimObject({
52
52
  display: parseString(retrieveText(value)),
53
+ rel: parseString(value?.["@rel"]),
53
54
  geo: parseString(value?.["@geo"]),
54
- osm: parseString(value?.["@osm"])
55
+ osm: parseString(value?.["@osm"]),
56
+ country: parseString(value?.["@country"])
55
57
  });
56
58
  };
57
59
  const parseSeason = (value) => {
@@ -219,7 +221,8 @@ const parseRemoteItem = (value) => {
219
221
  feedGuid: parseString(value["@feedguid"]),
220
222
  feedUrl: parseString(value["@feedurl"]),
221
223
  itemGuid: parseString(value["@itemguid"]),
222
- medium: parseString(value["@medium"])
224
+ medium: parseString(value["@medium"]),
225
+ title: parseString(value["@title"])
223
226
  });
224
227
  };
225
228
  const parsePodroll = (value) => {
@@ -269,10 +272,7 @@ const retrieveItem = (value) => {
269
272
  images: retrieveImages(value),
270
273
  socialInteracts: parseArrayOf(value["podcast:socialinteract"], parseSocialInteract),
271
274
  txts: parseArrayOf(value["podcast:txt"], parseTxt),
272
- chat: parseSingularOf(value["podcast:chat"], parseChat),
273
- location: parseSingularOf(value["podcast:location"], parseLocation),
274
- value: parseSingularOf(value["podcast:value"], parseValue),
275
- chats: parseArrayOf(value["podcast:chat"], parseChat)
275
+ chat: parseSingularOf(value["podcast:chat"], parseChat)
276
276
  });
277
277
  };
278
278
  const retrieveFeed = (value) => {
@@ -296,10 +296,7 @@ const retrieveFeed = (value) => {
296
296
  updateFrequency: parseSingularOf(value["podcast:updatefrequency"], parseUpdateFrequency),
297
297
  podping: parseSingularOf(value["podcast:podping"], parsePodping),
298
298
  chat: parseSingularOf(value["podcast:chat"], parseChat),
299
- publisher: parseSingularOf(value["podcast:publisher"], parsePublisher),
300
- location: parseSingularOf(value["podcast:location"], parseLocation),
301
- value: parseSingularOf(value["podcast:value"], parseValue),
302
- chats: parseArrayOf(value["podcast:chat"], parseChat)
299
+ publisher: parseSingularOf(value["podcast:publisher"], parsePublisher)
303
300
  });
304
301
  };
305
302
 
@@ -1,13 +1,15 @@
1
+ import { Requirable, Strict } from "../../../common/types.cjs";
2
+
1
3
  //#region src/namespaces/psc/common/types.d.ts
2
4
  declare namespace PscNs {
3
- type Chapter = {
4
- start: string;
5
- title: string;
5
+ type Chapter<TStrict extends boolean = false> = Strict<{
6
+ start: Requirable<string>;
7
+ title: Requirable<string>;
6
8
  href?: string;
7
9
  image?: string;
8
- };
9
- type Item = {
10
- chapters?: Array<Chapter>;
10
+ }, TStrict>;
11
+ type Item<TStrict extends boolean = false> = {
12
+ chapters?: Array<Chapter<TStrict>>;
11
13
  };
12
14
  }
13
15
  //#endregion
@@ -1,13 +1,15 @@
1
+ import { Requirable, Strict } from "../../../common/types.js";
2
+
1
3
  //#region src/namespaces/psc/common/types.d.ts
2
4
  declare namespace PscNs {
3
- type Chapter = {
4
- start: string;
5
- title: string;
5
+ type Chapter<TStrict extends boolean = false> = Strict<{
6
+ start: Requirable<string>;
7
+ title: Requirable<string>;
6
8
  href?: string;
7
9
  image?: string;
8
- };
9
- type Item = {
10
- chapters?: Array<Chapter>;
10
+ }, TStrict>;
11
+ type Item<TStrict extends boolean = false> = {
12
+ chapters?: Array<Chapter<TStrict>>;
11
13
  };
12
14
  }
13
15
  //#endregion