podverse-external-services 5.1.12 → 5.1.13-alpha.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PodcastByGuidResponse, PodcastIndexSearchPodcastsResponse } from 'podverse-helpers';
|
|
1
|
+
import type { PodcastBatchByFeedGuidResponse, PodcastByGuidResponse, PodcastIndexSearchPodcastsResponse, EpisodeByGuidResponse, EpisodeByGuidSecondaryParams } from 'podverse-helpers';
|
|
2
2
|
import { LoggerService } from 'podverse-helpers/dist/lib/backend/logger';
|
|
3
3
|
type Constructor = {
|
|
4
4
|
userAgent: string;
|
|
@@ -23,6 +23,7 @@ export declare class PodcastIndexService {
|
|
|
23
23
|
podcastGetById: (podcast_index_id: number) => Promise<any | null>;
|
|
24
24
|
podcastGetByGuid: (podcastGuid: string) => Promise<PodcastByGuidResponse | null>;
|
|
25
25
|
podcastsByMedium: (medium: string, max?: number) => Promise<any>;
|
|
26
|
+
podcastsBatchByFeedGuid: (feedGuids: string[]) => Promise<PodcastBatchByFeedGuidResponse>;
|
|
26
27
|
recentGetData: (sinceRange: number) => Promise<any[]>;
|
|
27
28
|
searchPodcasts: (term: string, options?: {
|
|
28
29
|
max?: number;
|
|
@@ -37,6 +38,7 @@ export declare class PodcastIndexService {
|
|
|
37
38
|
feeds: any[];
|
|
38
39
|
nextSince?: number;
|
|
39
40
|
}>;
|
|
41
|
+
episodeGetByGuid: (guid: string, secondaryGuid: EpisodeByGuidSecondaryParams) => Promise<EpisodeByGuidResponse | null>;
|
|
40
42
|
valueGetByPodcastIds: () => Promise<number[]>;
|
|
41
43
|
valueGetByPodcastIdsRecursively: (accumulatedPodcastIndexIds: number[], startAt?: number) => Promise<number[]>;
|
|
42
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/podcast-index/index.ts"],"names":[],"mappings":"AAMA,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AA8B,CAAC,CAO7F;IAID,aAAa,GAAU,YAAY,MAAM,oBA4BxC;IAID,cAAc,GACZ,MAAM,MAAM,EACZ,UAAS;QACP,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,GAAG,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,MAAM,GAAG,iBAAiB,CAAA;QACtD,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,MAAM,CAAC,EAAE,OAAO,CAAA;KACZ,KACL,OAAO,CAAC,kCAAkC,GAAG,IAAI,CAAC,CAqCpD;IAID,mBAAmB,GACjB,MAAK,MAAW,EAChB,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,MAAM,MAAM,KACX,OAAO,CAAC;QAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAoB/C;IAID,gBAAgB,GAAU,MAAM,MAAM,EAAE,eAAe,4BAA4B,KAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA6B1H;IAID,oBAAoB,QAAa,OAAO,CAAC,MAAM,EAAE,CAAC,CAMjD;IAED,+BAA+B,GAC7B,4BAA4B,MAAM,EAAE,EAAE,gBAAW,KAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAatE;CACF"}
|
|
@@ -124,6 +124,14 @@ class PodcastIndexService {
|
|
|
124
124
|
const response = yield this.podcastIndexAPIRequest(url);
|
|
125
125
|
return response.feeds || [];
|
|
126
126
|
});
|
|
127
|
+
this.podcastsBatchByFeedGuid = (feedGuids) => __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const url = `${this.baseUrl}/podcasts/batch/byguid`;
|
|
129
|
+
const response = yield this.podcastIndexAPIRequest(url, {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
data: feedGuids
|
|
132
|
+
});
|
|
133
|
+
return response;
|
|
134
|
+
});
|
|
127
135
|
// Recent
|
|
128
136
|
this.recentGetData = (sinceRange) => __awaiter(this, void 0, void 0, function* () {
|
|
129
137
|
this.loggerService.info('recentGetData beginning...');
|
|
@@ -202,6 +210,36 @@ class PodcastIndexService {
|
|
|
202
210
|
nextSince: response.nextSince
|
|
203
211
|
};
|
|
204
212
|
});
|
|
213
|
+
// Episodes
|
|
214
|
+
this.episodeGetByGuid = (guid, secondaryGuid) => __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
let url = `${this.baseUrl}/episodes/byguid?guid=${guid}`;
|
|
216
|
+
if (secondaryGuid) {
|
|
217
|
+
const feedid = secondaryGuid.feedid;
|
|
218
|
+
const podcastguid = secondaryGuid.podcastguid;
|
|
219
|
+
const feedurl = secondaryGuid.feedurl;
|
|
220
|
+
if (!feedid && !podcastguid && !feedurl) {
|
|
221
|
+
this.loggerService.logError('[PodcastIndex] episodeGetByGuid called with invalid secondaryGuid', { secondaryGuid });
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
if (feedid) {
|
|
225
|
+
url += `&feedid=${feedid}`;
|
|
226
|
+
}
|
|
227
|
+
else if (podcastguid) {
|
|
228
|
+
url += `&podcastguid=${podcastguid}`;
|
|
229
|
+
}
|
|
230
|
+
else if (feedurl) {
|
|
231
|
+
url += `&feedurl=${feedurl}`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const data = yield this.podcastIndexAPIRequest(url);
|
|
236
|
+
return data;
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
console.log("error", error);
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
205
243
|
// Value
|
|
206
244
|
this.valueGetByPodcastIds = () => __awaiter(this, void 0, void 0, function* () {
|
|
207
245
|
const accumulatedPodcastIndexIds = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "podverse-external-services",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.13-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
},
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "AGPLv3",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"crypto-js": "^4.2.0",
|
|
20
|
+
"csv-parser": "^3.2.0",
|
|
21
|
+
"firebase-admin": "^13.5.0",
|
|
22
|
+
"http-errors": "2.0.0",
|
|
23
|
+
"module-alias": "^2.2.3",
|
|
24
|
+
"paypal-rest-sdk": "2.0.0-rc.2",
|
|
25
|
+
"web-push": "^3.6.7"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"podverse-helpers": "5.1.13-alpha.0"
|
|
29
|
+
},
|
|
18
30
|
"devDependencies": {
|
|
19
31
|
"@types/crypto-js": "^4.2.2",
|
|
20
32
|
"@types/http-errors": "^2.0.5",
|
|
@@ -24,16 +36,7 @@
|
|
|
24
36
|
"@typescript-eslint/parser": "^8.44.0",
|
|
25
37
|
"eslint": "^9.35.0",
|
|
26
38
|
"nodemon": "^3.1.10",
|
|
27
|
-
"typescript": "^5.9.2"
|
|
28
|
-
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"crypto-js": "^4.2.0",
|
|
31
|
-
"csv-parser": "^3.2.0",
|
|
32
|
-
"firebase-admin": "^13.5.0",
|
|
33
|
-
"http-errors": "2.0.0",
|
|
34
|
-
"module-alias": "^2.2.3",
|
|
35
|
-
"paypal-rest-sdk": "2.0.0-rc.2",
|
|
36
|
-
"podverse-helpers": "^5.1.0",
|
|
37
|
-
"web-push": "^3.6.7"
|
|
39
|
+
"typescript": "^5.9.2",
|
|
40
|
+
"podverse-helpers": "5.1.13-alpha.0"
|
|
38
41
|
}
|
|
39
42
|
}
|