podverse-external-services 5.0.2 → 5.1.0-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.
Files changed (44) hide show
  1. package/README.md +26 -8
  2. package/dist/config/index.d.ts +18 -0
  3. package/dist/config/index.d.ts.map +1 -0
  4. package/dist/config/index.js +20 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -0
  8. package/dist/module-alias-config.d.ts +2 -0
  9. package/dist/module-alias-config.d.ts.map +1 -0
  10. package/dist/module-alias-config.js +7 -0
  11. package/dist/services/google/fcm.d.ts +12 -0
  12. package/dist/services/google/fcm.d.ts.map +1 -1
  13. package/dist/services/google/fcm.js +107 -154
  14. package/dist/services/google/firebaseGenerateAccessToken.d.ts +2 -0
  15. package/dist/services/google/firebaseGenerateAccessToken.d.ts.map +1 -0
  16. package/dist/services/google/firebaseGenerateAccessToken.js +62 -0
  17. package/dist/services/index.d.ts +3 -0
  18. package/dist/services/index.d.ts.map +1 -1
  19. package/dist/services/index.js +7 -3
  20. package/dist/services/notifications/index.d.ts +20 -0
  21. package/dist/services/notifications/index.d.ts.map +1 -1
  22. package/dist/services/notifications/index.js +34 -40
  23. package/dist/services/paypal/index.d.ts +8 -0
  24. package/dist/services/paypal/index.d.ts.map +1 -0
  25. package/dist/services/paypal/index.js +43 -0
  26. package/dist/services/podcast-index/index.d.ts +6 -30
  27. package/dist/services/podcast-index/index.d.ts.map +1 -1
  28. package/dist/services/podcast-index/index.js +62 -76
  29. package/dist/services/podcast-index/types/podcastByGuid.d.ts +73 -0
  30. package/dist/services/podcast-index/types/podcastByGuid.d.ts.map +1 -0
  31. package/dist/services/podcast-index/types/podcastByGuid.js +2 -0
  32. package/dist/services/podcast-index/types/podcastsByTag.d.ts +68 -0
  33. package/dist/services/podcast-index/types/podcastsByTag.d.ts.map +1 -0
  34. package/dist/services/podcast-index/types/podcastsByTag.js +2 -0
  35. package/dist/services/podcast-index/types/valueBatchByEpisodeGuid.d.ts +37 -0
  36. package/dist/services/podcast-index/types/valueBatchByEpisodeGuid.d.ts.map +1 -0
  37. package/dist/services/podcast-index/types/valueBatchByEpisodeGuid.js +2 -0
  38. package/dist/services/podcast-index/types/valueByEpisodeGuid.d.ts +32 -0
  39. package/dist/services/podcast-index/types/valueByEpisodeGuid.d.ts.map +1 -0
  40. package/dist/services/podcast-index/types/valueByEpisodeGuid.js +2 -0
  41. package/package.json +7 -4
  42. package/dist/services/google/index.d.ts +0 -1
  43. package/dist/services/google/index.d.ts.map +0 -1
  44. package/dist/services/google/index.js +0 -13
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/paypal/index.ts"],"names":[],"mappings":"AAIA,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAM;;IAMpB,OAAO,CAAC,cAAc;IAQhB,cAAc,CAAC,SAAS,EAAE,MAAM;IAMhC,cAAc,CAAC,SAAS,EAAE,MAAM;CAKvC"}
@@ -0,0 +1,43 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PayPalService = void 0;
13
+ const config_1 = require("@external-services/config");
14
+ const paypalRestSdk = require('paypal-rest-sdk');
15
+ const payments = paypalRestSdk.v1.payments;
16
+ class PayPalService {
17
+ constructor() {
18
+ this.client = new paypalRestSdk.core.PayPalHttpClient(this.getEnvironment());
19
+ }
20
+ getEnvironment() {
21
+ if (config_1.config.nodeEnv === 'production') {
22
+ return new paypalRestSdk.core.LiveEnvironment(config_1.config.paypal.clientId, config_1.config.paypal.clientSecret);
23
+ }
24
+ else {
25
+ return new paypalRestSdk.core.SandboxEnvironment(config_1.config.paypal.clientId, config_1.config.paypal.clientSecret);
26
+ }
27
+ }
28
+ getPaymentInfo(paymentId) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const request = new payments.PaymentGetRequest(paymentId);
31
+ const response = yield this.client.execute(request);
32
+ return response.result;
33
+ });
34
+ }
35
+ getCaptureInfo(paymentId) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const request = new payments.CaptureGetRequest(paymentId);
38
+ const response = yield this.client.execute(request);
39
+ return response.result;
40
+ });
41
+ }
42
+ }
43
+ exports.PayPalService = PayPalService;
@@ -1,23 +1,4 @@
1
- import { Phase6ValueTimeSplit } from 'podcast-partytime/dist/parser/phase/phase-6';
2
- type PIValueModel = {
3
- type: string;
4
- method: string;
5
- suggested: string;
6
- };
7
- type PIValueDestination = {
8
- name: string;
9
- type: string;
10
- address: string;
11
- split: number;
12
- custom_key?: string;
13
- custom_value?: string;
14
- fee?: boolean;
15
- };
16
- type PIValueTag = {
17
- model: PIValueModel;
18
- destinations: PIValueDestination[];
19
- value_time_splits: Phase6ValueTimeSplit[];
20
- };
1
+ import { PodcastByGuidResponse } from './types/podcastByGuid';
21
2
  type Constructor = {
22
3
  authKey: string;
23
4
  baseUrl: string;
@@ -28,17 +9,12 @@ export declare class PodcastIndexService {
28
9
  baseUrl: string;
29
10
  secretKey: string;
30
11
  constructor({ authKey, baseUrl, secretKey }: Constructor);
31
- podcastIndexAPIRequest: (url: string) => Promise<any>;
12
+ podcastIndexAPIRequest: (url: string, config?: any) => Promise<any>;
32
13
  getRecentlyUpdatedData: () => Promise<any[]>;
33
- getAllEpisodesFromPodcastIndexById: (podcastIndexId: string) => Promise<any>;
34
- getAllEpisodeValueTagsFromPodcastIndexById: (podcastIndexId: string) => Promise<any>;
35
- getEpisodesFromPodcastIndexById: (podcastIndexId: string) => Promise<any>;
36
- getPodcastFromPodcastIndexById: (id: string) => Promise<any>;
37
- getPodcastValueTagForPodcastIndexId: (id: string) => Promise<any[]>;
38
- getValueTagEnabledPodcastIdsFromPIRecursively: (accumulatedPodcastIndexIds: number[], startAt?: number) => Promise<number[]>;
39
- getValueTagEnabledPodcastIdsFromPI: () => Promise<number[]>;
40
- convertPIValueTagToPVValueTagArray: (piValueTag: PIValueTag) => any[];
41
- getPodcastFromPodcastIndexByGuid: (podcastGuid: string) => Promise<any>;
14
+ getPodcastByGuid: (podcastGuid: string) => Promise<PodcastByGuidResponse | null>;
15
+ getValueTagEnabledPodcastIdsRecursively: (accumulatedPodcastIndexIds: number[], startAt?: number) => Promise<number[]>;
16
+ getValueTagEnabledPodcastIds: () => Promise<number[]>;
17
+ downloadAndExtractCSV: () => Promise<any[]>;
42
18
  }
43
19
  export {};
44
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/podcast-index/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAElF,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,YAAY,CAAA;IACnB,YAAY,E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AAM,EAAE,SAAS,GAAG,kBAcxD;IAED,sBAAsB,uBA6BrB;IAED,gBAAgB,GAAU,aAAa,MAAM,KAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAYpF;IAED,uCAAuC,GACrC,4BAA4B,MAAM,EAAE,EAAE,gBAAW,KAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAatE;IAED,4BAA4B,QAAa,OAAO,CAAC,MAAM,EAAE,CAAC,CAMzD;IAED,qBAAqB,QAAa,OAAO,CAAC,GAAG,EAAE,CAAC,CAwC/C;CACF"}
@@ -15,8 +15,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.PodcastIndexService = void 0;
16
16
  const sha1_1 = __importDefault(require("crypto-js/sha1"));
17
17
  const enc_hex_1 = __importDefault(require("crypto-js/enc-hex"));
18
- const http_errors_1 = __importDefault(require("http-errors"));
18
+ const csv_parser_1 = __importDefault(require("csv-parser"));
19
+ const fs_1 = __importDefault(require("fs"));
20
+ const path_1 = __importDefault(require("path"));
19
21
  const podverse_helpers_1 = require("podverse-helpers");
22
+ const config_1 = require("@external-services/config");
20
23
  /*
21
24
  NOTE!!!
22
25
  The episodeGuid needs to be encoded both on the client-side and server side if it is an http url guid.
@@ -25,117 +28,100 @@ const podverse_helpers_1 = require("podverse-helpers");
25
28
  */
26
29
  class PodcastIndexService {
27
30
  constructor({ authKey, baseUrl, secretKey }) {
28
- this.podcastIndexAPIRequest = (url) => __awaiter(this, void 0, void 0, function* () {
31
+ this.podcastIndexAPIRequest = (url, config) => __awaiter(this, void 0, void 0, function* () {
29
32
  const apiHeaderTime = new Date().getTime() / 1000;
30
33
  const hash = (0, sha1_1.default)(this.authKey + this.secretKey + apiHeaderTime).toString(enc_hex_1.default);
31
- return (0, podverse_helpers_1.request)(url, {
32
- headers: {
34
+ return (0, podverse_helpers_1.request)(url, Object.assign({ headers: {
33
35
  'X-Auth-Key': this.authKey,
34
36
  'X-Auth-Date': apiHeaderTime,
35
37
  Authorization: hash
36
- }
37
- });
38
+ } }, config));
38
39
  });
39
40
  this.getRecentlyUpdatedData = () => __awaiter(this, void 0, void 0, function* () {
41
+ podverse_helpers_1.logger.info('getRecentlyUpdatedData beginning...');
40
42
  const currentTimeInSeconds = Math.floor(Date.now() / 1000);
41
- const sinceRange = 1800; // 30 minutes
43
+ const sinceRange = config_1.config.podcastIndex.recentlyUpdatedDataInterval;
42
44
  const sinceTimeInSeconds = currentTimeInSeconds - sinceRange;
43
- const fetchData = (since, allData = []) => __awaiter(this, void 0, void 0, function* () {
45
+ const fetchData = (since_1, ...args_1) => __awaiter(this, [since_1, ...args_1], void 0, function* (since, allData = []) {
46
+ podverse_helpers_1.logger.info(`fetchData since: ${since}, allData.length: ${allData.length}`);
44
47
  const url = `${this.baseUrl}/recent/data?max=5000&since=${since}`;
45
48
  const response = yield this.podcastIndexAPIRequest(url);
46
49
  const updatedFeeds = response.data.feeds;
47
50
  const nextSince = response.nextSince;
48
51
  allData = allData.concat(updatedFeeds);
49
52
  if (nextSince && nextSince <= currentTimeInSeconds) {
53
+ if (nextSince <= since) {
54
+ podverse_helpers_1.logger.info(`nextSince (${nextSince}) is not greater than since (${since}). Exiting to avoid infinite loop.`);
55
+ return allData;
56
+ }
57
+ const timeLeft = currentTimeInSeconds - nextSince;
58
+ podverse_helpers_1.logger.info(`Time remaining: ${timeLeft} seconds`);
50
59
  return fetchData(nextSince, allData);
51
60
  }
52
61
  return allData;
53
62
  });
54
63
  return fetchData(sinceTimeInSeconds);
55
64
  });
56
- this.getAllEpisodesFromPodcastIndexById = (podcastIndexId) => __awaiter(this, void 0, void 0, function* () {
57
- const response = yield this.getEpisodesFromPodcastIndexById(podcastIndexId);
58
- const allEpisodes = response === null || response === void 0 ? void 0 : response.items;
59
- return allEpisodes;
60
- });
61
- this.getAllEpisodeValueTagsFromPodcastIndexById = (podcastIndexId) => __awaiter(this, void 0, void 0, function* () {
62
- const episodes = yield this.getAllEpisodesFromPodcastIndexById(podcastIndexId);
63
- const pvEpisodesValueTagsByGuid = {};
64
- for (const episode of episodes) {
65
- if ((episode === null || episode === void 0 ? void 0 : episode.value) && (episode === null || episode === void 0 ? void 0 : episode.guid)) {
66
- const pvValueTagArray = this.convertPIValueTagToPVValueTagArray(episode.value);
67
- if ((pvValueTagArray === null || pvValueTagArray === void 0 ? void 0 : pvValueTagArray.length) > 0) {
68
- pvEpisodesValueTagsByGuid[episode.guid] = pvValueTagArray;
69
- }
70
- }
65
+ this.getPodcastByGuid = (podcastGuid) => __awaiter(this, void 0, void 0, function* () {
66
+ const url = `${this.baseUrl}/podcasts/byguid?guid=${podcastGuid}`;
67
+ let podcastIndexPodcast = null;
68
+ try {
69
+ const data = yield this.podcastIndexAPIRequest(url);
70
+ podcastIndexPodcast = data;
71
71
  }
72
- return pvEpisodesValueTagsByGuid;
73
- });
74
- this.getEpisodesFromPodcastIndexById = (podcastIndexId) => __awaiter(this, void 0, void 0, function* () {
75
- const url = `${this.baseUrl}/episodes/byfeedid?id=${podcastIndexId}&max=1000`;
76
- return this.podcastIndexAPIRequest(url);
77
- });
78
- this.getPodcastFromPodcastIndexById = (id) => __awaiter(this, void 0, void 0, function* () {
79
- const url = `${this.baseUrl}/podcasts/byfeedid?id=${id}`;
80
- return this.podcastIndexAPIRequest(url);
81
- });
82
- this.getPodcastValueTagForPodcastIndexId = (id) => __awaiter(this, void 0, void 0, function* () {
83
- const podcast = yield this.getPodcastFromPodcastIndexById(id);
84
- const pvValueTagArray = this.convertPIValueTagToPVValueTagArray(podcast.feed.value);
85
- return pvValueTagArray;
72
+ catch (error) {
73
+ // assume a 404
74
+ }
75
+ return podcastIndexPodcast || null;
86
76
  });
87
- this.getValueTagEnabledPodcastIdsFromPIRecursively = (accumulatedPodcastIndexIds, startAt = 1) => __awaiter(this, void 0, void 0, function* () {
88
- const url = `${this.baseUrl}/podcasts/bytag?podcast-value=true&max=5000&start_at=${startAt}`;
77
+ this.getValueTagEnabledPodcastIdsRecursively = (accumulatedPodcastIndexIds_1, ...args_1) => __awaiter(this, [accumulatedPodcastIndexIds_1, ...args_1], void 0, function* (accumulatedPodcastIndexIds, startAt = 1) {
78
+ const url = `${this.baseUrl}/podcasts/bytag?podcast-valueTimeSplit=true&max=5000&start_at=${startAt}`;
89
79
  const data = yield this.podcastIndexAPIRequest(url);
90
80
  for (const feed of data.feeds) {
91
81
  accumulatedPodcastIndexIds.push(feed.id);
92
82
  }
93
83
  if (data.nextStartAt) {
94
- return yield this.getValueTagEnabledPodcastIdsFromPIRecursively(accumulatedPodcastIndexIds, data.nextStartAt);
84
+ return yield this.getValueTagEnabledPodcastIdsRecursively(accumulatedPodcastIndexIds, data.nextStartAt);
95
85
  }
96
86
  return accumulatedPodcastIndexIds;
97
87
  });
98
- this.getValueTagEnabledPodcastIdsFromPI = () => __awaiter(this, void 0, void 0, function* () {
88
+ this.getValueTagEnabledPodcastIds = () => __awaiter(this, void 0, void 0, function* () {
99
89
  const accumulatedPodcastIndexIds = [];
100
90
  const nextStartAt = 1;
101
- const podcastIndexIds = yield this.getValueTagEnabledPodcastIdsFromPIRecursively(accumulatedPodcastIndexIds, nextStartAt);
91
+ const podcastIndexIds = yield this.getValueTagEnabledPodcastIdsRecursively(accumulatedPodcastIndexIds, nextStartAt);
102
92
  return podcastIndexIds;
103
93
  });
104
- this.convertPIValueTagToPVValueTagArray = (piValueTag) => {
105
- return [
106
- {
107
- method: piValueTag.model.method,
108
- suggested: piValueTag.model.suggested,
109
- type: piValueTag.model.type,
110
- recipients: piValueTag.destinations.map((destination) => {
111
- return {
112
- address: destination.address,
113
- customKey: destination.custom_key || '',
114
- customValue: destination.custom_value || '',
115
- fee: destination.fee || false,
116
- name: destination.name || '',
117
- split: destination.split || 0,
118
- type: destination.type || ''
119
- };
120
- }),
121
- valueTimeSplits: piValueTag.value_time_splits
122
- }
123
- ];
124
- };
125
- this.getPodcastFromPodcastIndexByGuid = (podcastGuid) => __awaiter(this, void 0, void 0, function* () {
126
- const url = `${this.baseUrl}/podcasts/byguid?guid=${podcastGuid}`;
127
- let podcastIndexPodcast = null;
128
- try {
129
- const data = yield this.podcastIndexAPIRequest(url);
130
- podcastIndexPodcast = data;
94
+ this.downloadAndExtractCSV = () => __awaiter(this, void 0, void 0, function* () {
95
+ const url = 'https://public.podcastindex.org/podcastindex_dead_feeds.csv';
96
+ const tmpDir = path_1.default.join(__dirname, 'tmp');
97
+ const filePath = path_1.default.join(tmpDir, 'podcastindex_dead_feeds.csv');
98
+ if (!fs_1.default.existsSync(tmpDir)) {
99
+ fs_1.default.mkdirSync(tmpDir);
131
100
  }
132
- catch (error) {
133
- // assume a 404
134
- }
135
- if (!podcastIndexPodcast) {
136
- throw new http_errors_1.default.NotFound('Podcast not found in Podcast Index');
137
- }
138
- return podcastIndexPodcast;
101
+ const data = yield this.podcastIndexAPIRequest(url, { responseType: 'stream' });
102
+ const writer = fs_1.default.createWriteStream(filePath);
103
+ data.pipe(writer);
104
+ yield new Promise((resolve, reject) => {
105
+ writer.on('finish', () => resolve());
106
+ writer.on('error', reject);
107
+ });
108
+ const results = [];
109
+ yield new Promise((resolve, reject) => {
110
+ fs_1.default.createReadStream(filePath)
111
+ .pipe((0, csv_parser_1.default)())
112
+ .on('data', (data) => results.push(data))
113
+ .on('end', resolve)
114
+ .on('error', reject);
115
+ });
116
+ fs_1.default.unlinkSync(filePath);
117
+ const parsedResults = results.map((row) => {
118
+ const [id, duplicateOf] = Object.values(row).map((value) => value.trim());
119
+ return {
120
+ podcast_index_id: parseInt(id, 10),
121
+ duplicateOf: duplicateOf ? parseInt(duplicateOf, 10) : null
122
+ };
123
+ });
124
+ return parsedResults;
139
125
  });
140
126
  this.authKey = authKey;
141
127
  this.baseUrl = baseUrl;
@@ -0,0 +1,73 @@
1
+ type Query = {
2
+ guid: string;
3
+ id: string;
4
+ };
5
+ type Model = {
6
+ type: string;
7
+ method: string;
8
+ suggested: string;
9
+ };
10
+ type Destination = {
11
+ name: string;
12
+ address: string;
13
+ type: string;
14
+ split: number;
15
+ fee: boolean;
16
+ customKey: string;
17
+ customValue: string;
18
+ };
19
+ type Value = {
20
+ model: Model;
21
+ destinations: Destination[];
22
+ };
23
+ type Funding = {
24
+ url: string;
25
+ message: string;
26
+ };
27
+ type Categories = {
28
+ [key: string]: string;
29
+ };
30
+ type Feed = {
31
+ id: number;
32
+ podcastGuid: string;
33
+ title: string;
34
+ url: string;
35
+ originalUrl: string;
36
+ link: string;
37
+ description: string;
38
+ author: string;
39
+ ownerName: string;
40
+ image: string;
41
+ artwork: string;
42
+ lastUpdateTime: number;
43
+ lastCrawlTime: number;
44
+ lastParseTime: number;
45
+ lastGoodHttpStatusTime: number;
46
+ lastHttpStatus: number;
47
+ contentType: string;
48
+ itunesId: number;
49
+ itunesType: string;
50
+ generator: string;
51
+ language: string;
52
+ explicit: boolean;
53
+ type: number;
54
+ medium: string;
55
+ dead: number;
56
+ chash: string;
57
+ episodeCount: number;
58
+ crawlErrors: number;
59
+ parseErrors: number;
60
+ categories: Categories;
61
+ locked: number;
62
+ imageUrlHash: number;
63
+ value: Value;
64
+ funding: Funding;
65
+ };
66
+ export type PodcastByGuidResponse = {
67
+ status: string;
68
+ query: Query;
69
+ feed: Feed;
70
+ description: string;
71
+ };
72
+ export {};
73
+ //# sourceMappingURL=podcastByGuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"podcastByGuid.d.ts","sourceRoot":"","sources":["../../../../src/services/podcast-index/types/podcastByGuid.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CA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MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,68 @@
1
+ type Model = {
2
+ type: string;
3
+ method: string;
4
+ suggested: string;
5
+ };
6
+ type Destination = {
7
+ name: string;
8
+ address: string;
9
+ type: string;
10
+ split: number;
11
+ fee: boolean;
12
+ customKey: string;
13
+ customValue: string;
14
+ };
15
+ type Value = {
16
+ model: Model;
17
+ destinations: Destination[];
18
+ };
19
+ type Funding = {
20
+ url: string;
21
+ message: string;
22
+ };
23
+ type Categories = {
24
+ [key: string]: string;
25
+ };
26
+ type Feed = {
27
+ id: number;
28
+ title: string;
29
+ url: string;
30
+ originalUrl: string;
31
+ link: string;
32
+ description: string;
33
+ author: string;
34
+ ownerName: string;
35
+ image: string;
36
+ artwork: string;
37
+ lastUpdateTime: number;
38
+ lastCrawlTime: number;
39
+ lastParseTime: number;
40
+ lastGoodHttpStatusTime: number;
41
+ lastHttpStatus: number;
42
+ contentType: string;
43
+ itunesId: number;
44
+ generator: string;
45
+ language: string;
46
+ type: number;
47
+ dead: number;
48
+ crawlErrors: number;
49
+ parseErrors: number;
50
+ categories: Categories;
51
+ locked: number;
52
+ popularity: number;
53
+ imageUrlHash: number;
54
+ value: Value;
55
+ funding: Funding;
56
+ podcastGuid: string;
57
+ valueCreatedOn: number;
58
+ };
59
+ export type PodcastsByTagResponse = {
60
+ status: string;
61
+ feeds: Feed[];
62
+ count: number;
63
+ total: number;
64
+ nextStartAt: number;
65
+ description: string;
66
+ };
67
+ export {};
68
+ //# sourceMappingURL=podcastsByTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"podcastsByTag.d.ts","sourceRoot":"","sources":["../../../../src/services/podcast-index/types/podcastsByTag.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,37 @@
1
+ type QueryGuids = {
2
+ [key: string]: string[];
3
+ };
4
+ type Model = {
5
+ type: string;
6
+ method: string;
7
+ suggested: string;
8
+ };
9
+ type Destination = {
10
+ name: string;
11
+ address: string;
12
+ type: string;
13
+ split: number;
14
+ fee: boolean;
15
+ customKey: string;
16
+ customValue: string;
17
+ };
18
+ type ValueItem = {
19
+ podcastGUID: string;
20
+ guid: string;
21
+ title: string;
22
+ feedTitle: string;
23
+ model: Model;
24
+ destinations: Destination[];
25
+ };
26
+ export type ValueBatchByEpisodeGuidResponse = {
27
+ status: string;
28
+ query: {
29
+ guids: QueryGuids;
30
+ };
31
+ value: ValueItem[];
32
+ description: string;
33
+ allFound: boolean;
34
+ found: number;
35
+ };
36
+ export {};
37
+ //# sourceMappingURL=valueBatchByEpisodeGuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueBatchByEpisodeGuid.d.ts","sourceRoot":"","sources":["../../../../src/services/podcast-index/types/valueBatchByEpisodeGuid.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC;KACnB,CAAC;IACF,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ type Query = {
2
+ podcastguid: string;
3
+ episodeguid: string;
4
+ };
5
+ type Model = {
6
+ type: string;
7
+ method: string;
8
+ suggested: string;
9
+ };
10
+ type Destination = {
11
+ name: string;
12
+ address: string;
13
+ type: string;
14
+ split: number;
15
+ fee: boolean;
16
+ customKey: string;
17
+ customValue: string;
18
+ };
19
+ type Value = {
20
+ model: Model;
21
+ destinations: Destination[];
22
+ title: string;
23
+ feedTitle: string;
24
+ };
25
+ export type ValueByEpisodeGuidResponse = {
26
+ status: string;
27
+ query: Query;
28
+ value: Value;
29
+ description: string;
30
+ };
31
+ export {};
32
+ //# sourceMappingURL=valueByEpisodeGuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueByEpisodeGuid.d.ts","sourceRoot":"","sources":["../../../../src/services/podcast-index/types/valueByEpisodeGuid.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-external-services",
3
- "version": "5.0.2",
3
+ "version": "5.1.0-alpha.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,10 +8,9 @@
8
8
  "dist/**/*"
9
9
  ],
10
10
  "scripts": {
11
- "dev:watch": "nodemon --watch 'src' --watch $(realpath node_modules/podverse-helpers) --delay 500ms -x \"npm run build\"",
11
+ "build:watch": "nodemon --watch 'src' --watch $(realpath node_modules/podverse-helpers) --delay 500ms -x \"npm run build\"",
12
12
  "build": "tsc",
13
13
  "lint": "eslint ./src --ext .ts",
14
- "prepare": "npm run build",
15
14
  "start": "ts-node ./dist/index.js"
16
15
  },
17
16
  "author": "",
@@ -31,9 +30,13 @@
31
30
  "@types/aws-sdk": "^2.7.0",
32
31
  "aws-sdk": "2.814.0",
33
32
  "crypto-js": "^4.2.0",
33
+ "csv-parser": "^3.2.0",
34
+ "firebase-admin": "^13.2.0",
34
35
  "http-errors": "1.7.3",
36
+ "module-alias": "^2.2.3",
37
+ "paypal-rest-sdk": "2.0.0-rc.2",
35
38
  "podcast-partytime": "^4.8.3",
36
- "podverse-helpers": "^5.0.1",
39
+ "podverse-helpers": "^5.1.1-alpha.1",
37
40
  "web-push": "^3.6.3"
38
41
  }
39
42
  }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/google/index.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- // type Constructor = {
3
- // authToken: string
4
- // userAgent: string
5
- // }
6
- // export class GoogleService {
7
- // declare authToken: string
8
- // declare userAgent: string
9
- // constructor ({ authToken, userAgent }: Constructor) {
10
- // this.authToken = authToken
11
- // this.userAgent = userAgent
12
- // }
13
- // }