podverse-external-services 5.0.3 → 5.1.0-develop-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.d.ts +18 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +20 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/module-alias-config.d.ts +2 -0
- package/dist/module-alias-config.d.ts.map +1 -0
- package/dist/module-alias-config.js +7 -0
- package/dist/services/google/fcm.d.ts +12 -0
- package/dist/services/google/fcm.d.ts.map +1 -1
- package/dist/services/google/fcm.js +107 -154
- package/dist/services/google/firebaseGenerateAccessToken.d.ts +2 -0
- package/dist/services/google/firebaseGenerateAccessToken.d.ts.map +1 -0
- package/dist/services/google/firebaseGenerateAccessToken.js +62 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +7 -3
- package/dist/services/notifications/index.d.ts +20 -0
- package/dist/services/notifications/index.d.ts.map +1 -1
- package/dist/services/notifications/index.js +34 -40
- package/dist/services/paypal/index.d.ts +8 -0
- package/dist/services/paypal/index.d.ts.map +1 -0
- package/dist/services/paypal/index.js +43 -0
- package/dist/services/podcast-index/index.d.ts +6 -30
- package/dist/services/podcast-index/index.d.ts.map +1 -1
- package/dist/services/podcast-index/index.js +60 -75
- package/dist/services/podcast-index/types/podcastByGuid.d.ts +73 -0
- package/dist/services/podcast-index/types/podcastByGuid.d.ts.map +1 -0
- package/dist/services/podcast-index/types/podcastByGuid.js +2 -0
- package/dist/services/podcast-index/types/podcastsByTag.d.ts +68 -0
- package/dist/services/podcast-index/types/podcastsByTag.d.ts.map +1 -0
- package/dist/services/podcast-index/types/podcastsByTag.js +2 -0
- package/dist/services/podcast-index/types/valueBatchByEpisodeGuid.d.ts +37 -0
- package/dist/services/podcast-index/types/valueBatchByEpisodeGuid.d.ts.map +1 -0
- package/dist/services/podcast-index/types/valueBatchByEpisodeGuid.js +2 -0
- package/dist/services/podcast-index/types/valueByEpisodeGuid.d.ts +32 -0
- package/dist/services/podcast-index/types/valueByEpisodeGuid.d.ts.map +1 -0
- package/dist/services/podcast-index/types/valueByEpisodeGuid.js +2 -0
- package/package.json +7 -3
- package/dist/services/google/index.d.ts +0 -1
- package/dist/services/google/index.d.ts.map +0 -1
- package/dist/services/google/index.js +0 -13
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const config: {
|
|
2
|
+
nodeEnv: string;
|
|
3
|
+
google: {
|
|
4
|
+
firebase: {
|
|
5
|
+
projectId: string;
|
|
6
|
+
patoToAuthJson: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
paypal: {
|
|
10
|
+
clientId: string;
|
|
11
|
+
clientSecret: string;
|
|
12
|
+
mode: string;
|
|
13
|
+
};
|
|
14
|
+
podcastIndex: {
|
|
15
|
+
recentlyUpdatedDataInterval: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;CAgBlB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.config = void 0;
|
|
4
|
+
exports.config = {
|
|
5
|
+
nodeEnv: process.env.NODE_ENV || 'development',
|
|
6
|
+
google: {
|
|
7
|
+
firebase: {
|
|
8
|
+
projectId: process.env.GOOGLE_FIREBASE_PROJECT_ID || '',
|
|
9
|
+
patoToAuthJson: process.env.GOOGLE_FIREBASE_PATH_TO_AUTH_JSON || '',
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
paypal: {
|
|
13
|
+
clientId: process.env.PAYPAL_CLIENT_ID || '',
|
|
14
|
+
clientSecret: process.env.PAYPAL_CLIENT_SECRET || '',
|
|
15
|
+
mode: process.env.PAYPAL_MODE || 'sandbox'
|
|
16
|
+
},
|
|
17
|
+
podcastIndex: {
|
|
18
|
+
recentlyUpdatedDataInterval: parseInt(process.env.PODCAST_INDEX_RECENTLY_UPDATED_DATA_INTERVAL || '1800', 10)
|
|
19
|
+
}
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -14,4 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("./module-alias-config");
|
|
18
|
+
__exportStar(require("./config"), exports);
|
|
17
19
|
__exportStar(require("./services/index"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-alias-config.d.ts","sourceRoot":"","sources":["../src/module-alias-config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
import { SendNotificationOptions } from '@external-services/services/notifications';
|
|
2
|
+
type Constructor = {
|
|
3
|
+
authToken: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class GoogleFCMService {
|
|
6
|
+
authToken: string;
|
|
7
|
+
constructor({ authToken }: Constructor);
|
|
8
|
+
sendFcmNewItemDetectedNotification: (account_fcm_tokens: string[], options: SendNotificationOptions) => Promise<void>;
|
|
9
|
+
sendFcmLiveItemLiveDetectedNotification: (account_fcm_tokens: string[], options: SendNotificationOptions) => Promise<void>;
|
|
10
|
+
sendFCMGoogleApiNotification: (fcmTokens: string[], title: string, body: string, channelIdText: string, notificationType: "live" | "new-item", channelTitle: string, itemTitle: string, channelImage?: string | null, itemImage?: string | null, itemIdText?: string) => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
1
13
|
//# sourceMappingURL=fcm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fcm.d.ts","sourceRoot":"","sources":["../../../src/services/google/fcm.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"fcm.d.ts","sourceRoot":"","sources":["../../../src/services/google/fcm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAIpF,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,qBAAa,gBAAgB;IACnB,SAAS,EAAE,MAAM,CAAA;gBAEZ,EAAE,SAAS,EAAE,EAAE,WAAW;IAIvC,kCAAkC,GAAU,oBAAoB,MAAM,EAAE,EAAE,SAAS,uBAAuB,mBAsBzG;IAED,uCAAuC,GAAU,oBAAoB,MAAM,EAAE,EAAE,SAAS,uBAAuB,mBAsB9G;IAED,4BAA4B,GAC1B,WAAW,MAAM,EAAE,EACnB,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,kBAAkB,MAAM,GAAG,UAAU,EACrC,cAAc,MAAM,EACpB,WAAW,MAAM,EACjB,eAAe,MAAM,GAAG,IAAI,EAC5B,YAAY,MAAM,GAAG,IAAI,EACzB,aAAa,MAAM,mBAoEpB;CACF"}
|
|
@@ -1,155 +1,108 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// podcastTitle: podcastTitle,
|
|
110
|
-
// episodeTitle: episodeTitle,
|
|
111
|
-
// notificationType,
|
|
112
|
-
// timeSent: new Date(),
|
|
113
|
-
// image: imageUrl
|
|
114
|
-
// },
|
|
115
|
-
// data: {
|
|
116
|
-
// body,
|
|
117
|
-
// title,
|
|
118
|
-
// podcastId,
|
|
119
|
-
// episodeId,
|
|
120
|
-
// podcastTitle: podcastTitle,
|
|
121
|
-
// episodeTitle: episodeTitle,
|
|
122
|
-
// notificationType,
|
|
123
|
-
// timeSent: new Date()
|
|
124
|
-
// },
|
|
125
|
-
// android: {
|
|
126
|
-
// notification: {
|
|
127
|
-
// imageUrl
|
|
128
|
-
// }
|
|
129
|
-
// },
|
|
130
|
-
// apns: {
|
|
131
|
-
// payload: {
|
|
132
|
-
// aps: {
|
|
133
|
-
// 'mutable-content': 1
|
|
134
|
-
// }
|
|
135
|
-
// },
|
|
136
|
-
// // eslint-disable-next-line @typescript-eslint/camelcase
|
|
137
|
-
// fcm_options: {
|
|
138
|
-
// image: imageUrl
|
|
139
|
-
// }
|
|
140
|
-
// },
|
|
141
|
-
// webpush: {
|
|
142
|
-
// headers: {
|
|
143
|
-
// image: imageUrl
|
|
144
|
-
// }
|
|
145
|
-
// }
|
|
146
|
-
// },
|
|
147
|
-
// responseType: 'json'
|
|
148
|
-
// })
|
|
149
|
-
// } catch (error) {
|
|
150
|
-
// console.log('sendFCMGoogleApiNotification error', error)
|
|
151
|
-
// }
|
|
152
|
-
// }
|
|
153
|
-
// }
|
|
154
|
-
// }
|
|
155
|
-
// }
|
|
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.GoogleFCMService = void 0;
|
|
13
|
+
const podverse_helpers_1 = require("podverse-helpers");
|
|
14
|
+
const config_1 = require("@external-services/config");
|
|
15
|
+
const fcmGoogleApiPath = `https://fcm.googleapis.com/v1/projects/${config_1.config.google.firebase.projectId}/messages:send`;
|
|
16
|
+
class GoogleFCMService {
|
|
17
|
+
constructor({ authToken }) {
|
|
18
|
+
this.sendFcmNewItemDetectedNotification = (account_fcm_tokens, options) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { channelIdText, /* podcastShrunkImageUrl, */ channelFullImageUrl, itemFullImageUrl, itemIdText } = options;
|
|
20
|
+
const channelTitle = options.channelTitle || 'Untitled';
|
|
21
|
+
const itemTitle = options.itemTitle || 'Untitled';
|
|
22
|
+
const title = channelTitle;
|
|
23
|
+
const body = itemTitle;
|
|
24
|
+
const finalPodcastImageUrl = /* podcastShrunkImageUrl || */ channelFullImageUrl;
|
|
25
|
+
const finalEpisodeImageUrl = itemFullImageUrl;
|
|
26
|
+
return this.sendFCMGoogleApiNotification(account_fcm_tokens, title, body, channelIdText, 'new-item', channelTitle, itemTitle, finalPodcastImageUrl, finalEpisodeImageUrl, itemIdText);
|
|
27
|
+
});
|
|
28
|
+
this.sendFcmLiveItemLiveDetectedNotification = (account_fcm_tokens, options) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const { channelIdText, /* podcastShrunkImageUrl, */ channelFullImageUrl, itemFullImageUrl, itemIdText } = options;
|
|
30
|
+
const channelTitle = options.channelTitle || 'Untitled';
|
|
31
|
+
const itemTitle = options.itemTitle || 'Livestream starting';
|
|
32
|
+
const title = `LIVE: ${channelTitle}`;
|
|
33
|
+
const body = itemTitle;
|
|
34
|
+
const finalPodcastImageUrl = /* podcastShrunkImageUrl ||*/ channelFullImageUrl;
|
|
35
|
+
const finalEpisodeImageUrl = itemFullImageUrl;
|
|
36
|
+
return this.sendFCMGoogleApiNotification(account_fcm_tokens, title, body, channelIdText, 'live', channelTitle, itemTitle, finalPodcastImageUrl, finalEpisodeImageUrl, itemIdText);
|
|
37
|
+
});
|
|
38
|
+
this.sendFCMGoogleApiNotification = (fcmTokens, title, body, channelIdText, notificationType, channelTitle, itemTitle, channelImage, itemImage, itemIdText) => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (!fcmTokens || fcmTokens.length === 0)
|
|
40
|
+
return;
|
|
41
|
+
const fcmTokenBatches = [];
|
|
42
|
+
const size = 1000;
|
|
43
|
+
for (let i = 0; i < fcmTokens.length; i += size) {
|
|
44
|
+
fcmTokenBatches.push(fcmTokens.slice(i, i + size));
|
|
45
|
+
}
|
|
46
|
+
for (const fcmTokenBatch of fcmTokenBatches) {
|
|
47
|
+
if ((fcmTokenBatch === null || fcmTokenBatch === void 0 ? void 0 : fcmTokenBatch.length) > 0) {
|
|
48
|
+
const imageUrl = itemImage || channelImage;
|
|
49
|
+
try {
|
|
50
|
+
for (const token of fcmTokenBatch) {
|
|
51
|
+
yield (0, podverse_helpers_1.request)(fcmGoogleApiPath, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: {
|
|
54
|
+
Authorization: `Bearer ${this.authToken}`,
|
|
55
|
+
'Content-Type': 'application/json'
|
|
56
|
+
},
|
|
57
|
+
data: {
|
|
58
|
+
message: {
|
|
59
|
+
token,
|
|
60
|
+
notification: {
|
|
61
|
+
title,
|
|
62
|
+
body,
|
|
63
|
+
image: imageUrl
|
|
64
|
+
},
|
|
65
|
+
data: {
|
|
66
|
+
podcastId: channelIdText,
|
|
67
|
+
episodeId: itemIdText,
|
|
68
|
+
podcastTitle: channelTitle,
|
|
69
|
+
episodeTitle: itemTitle,
|
|
70
|
+
notificationType,
|
|
71
|
+
timeSent: new Date().toISOString()
|
|
72
|
+
},
|
|
73
|
+
android: {
|
|
74
|
+
notification: {
|
|
75
|
+
image: imageUrl
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
apns: {
|
|
79
|
+
payload: {
|
|
80
|
+
aps: {
|
|
81
|
+
'mutable-content': 1
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
fcm_options: {
|
|
85
|
+
image: imageUrl
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
webpush: {
|
|
89
|
+
notification: {
|
|
90
|
+
image: imageUrl
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
responseType: 'json'
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
(0, podverse_helpers_1.logError)('sendFCMGoogleApiNotification error', error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
this.authToken = authToken;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.GoogleFCMService = GoogleFCMService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebaseGenerateAccessToken.d.ts","sourceRoot":"","sources":["../../../src/services/google/firebaseGenerateAccessToken.ts"],"names":[],"mappings":"AAgBA,wBAAsB,2BAA2B,oBAGhD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.firebaseGenerateAccessToken = firebaseGenerateAccessToken;
|
|
46
|
+
const admin = __importStar(require("firebase-admin"));
|
|
47
|
+
const config_1 = require("@external-services/config");
|
|
48
|
+
const fs = require('fs');
|
|
49
|
+
const keyFilePath = config_1.config.google.firebase.patoToAuthJson;
|
|
50
|
+
let serviceAccount = null;
|
|
51
|
+
if (keyFilePath) {
|
|
52
|
+
serviceAccount = JSON.parse(fs.readFileSync(keyFilePath, 'utf8'));
|
|
53
|
+
admin.initializeApp({
|
|
54
|
+
credential: admin.credential.cert(serviceAccount),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function firebaseGenerateAccessToken() {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const token = yield admin.credential.cert(serviceAccount).getAccessToken();
|
|
60
|
+
return token.access_token;
|
|
61
|
+
});
|
|
62
|
+
}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
export { firebaseGenerateAccessToken } from './google/firebaseGenerateAccessToken';
|
|
2
|
+
export { NotificationsService } from './notifications';
|
|
3
|
+
export { PayPalService } from './paypal';
|
|
1
4
|
export { PodcastIndexService } from './podcast-index';
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/services/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PodcastIndexService = void 0;
|
|
3
|
+
exports.PodcastIndexService = exports.PayPalService = exports.NotificationsService = exports.firebaseGenerateAccessToken = void 0;
|
|
4
4
|
// export { AWSS3Service, AWSSQSService } from './aws'
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var firebaseGenerateAccessToken_1 = require("./google/firebaseGenerateAccessToken");
|
|
6
|
+
Object.defineProperty(exports, "firebaseGenerateAccessToken", { enumerable: true, get: function () { return firebaseGenerateAccessToken_1.firebaseGenerateAccessToken; } });
|
|
7
|
+
var notifications_1 = require("./notifications");
|
|
8
|
+
Object.defineProperty(exports, "NotificationsService", { enumerable: true, get: function () { return notifications_1.NotificationsService; } });
|
|
9
|
+
var paypal_1 = require("./paypal");
|
|
10
|
+
Object.defineProperty(exports, "PayPalService", { enumerable: true, get: function () { return paypal_1.PayPalService; } });
|
|
7
11
|
var podcast_index_1 = require("./podcast-index");
|
|
8
12
|
Object.defineProperty(exports, "PodcastIndexService", { enumerable: true, get: function () { return podcast_index_1.PodcastIndexService; } });
|
|
9
13
|
// export { UnifiedPushService } from './unifiedpush'
|
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import { GoogleFCMService } from '@external-services/services/google/fcm';
|
|
2
|
+
export interface SendNotificationOptions {
|
|
3
|
+
itemFullImageUrl?: string | null;
|
|
4
|
+
itemGuid?: string | null;
|
|
5
|
+
itemIdText?: string;
|
|
6
|
+
itemTitle?: string | null;
|
|
7
|
+
channelIdText: string;
|
|
8
|
+
channelFullImageUrl?: string | null;
|
|
9
|
+
channelTitle?: string | null;
|
|
10
|
+
}
|
|
11
|
+
type Constructor = {
|
|
12
|
+
googleAuthToken: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class NotificationsService {
|
|
15
|
+
GoogleFCMService: GoogleFCMService;
|
|
16
|
+
constructor({ googleAuthToken }: Constructor);
|
|
17
|
+
sendNewItemDetectedNotifications: (account_fcm_tokens: string[], options: SendNotificationOptions) => Promise<void>;
|
|
18
|
+
sendLiveItemLiveDetectedNotifications: (account_fcm_tokens: string[], options: SendNotificationOptions) => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
1
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/notifications/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/notifications/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAEzE,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEnC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,qBAAa,oBAAoB;IACvB,gBAAgB,EAAE,gBAAgB,CAAA;gBAG7B,EAAE,eAAe,EAAE,EAAE,WAAW;IAQ7C,gCAAgC,GAAU,oBAAoB,MAAM,EAAE,EAAE,SAAS,uBAAuB,KAAG,OAAO,CAAC,IAAI,CAAC,CAKvH;IAED,qCAAqC,GAAU,oBAAoB,MAAM,EAAE,EAAE,SAAS,uBAAuB,KAAG,OAAO,CAAC,IAAI,CAAC,CAK5H;CACF"}
|
|
@@ -1,42 +1,36 @@
|
|
|
1
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.NotificationsService = void 0;
|
|
2
13
|
// import { UnifiedPushService } from '..'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// userAgent
|
|
27
|
-
// })
|
|
28
|
-
// this.UnifiedPushService = new UnifiedPushService()
|
|
29
|
-
// }
|
|
30
|
-
// sendNewEpisodeDetectedNotification = async (options: SendNotificationOptions) => {
|
|
31
|
-
// return Promise.all([
|
|
32
|
-
// this.GoogleFCMService.sendFcmNewEpisodeDetectedNotification(options),
|
|
33
|
-
// this.UnifiedPushService.sendUpNewEpisodeDetectedNotification(options)
|
|
34
|
-
// ])
|
|
35
|
-
// }
|
|
36
|
-
// sendLiveItemLiveDetectedNotification = async (options: SendNotificationOptions) => {
|
|
37
|
-
// return Promise.all([
|
|
38
|
-
// this.GoogleFCMService.sendFcmLiveItemLiveDetectedNotification(options),
|
|
39
|
-
// this.UnifiedPushService.sendUpLiveItemLiveDetectedNotification(options)
|
|
40
|
-
// ])
|
|
41
|
-
// }
|
|
42
|
-
// }
|
|
14
|
+
const fcm_1 = require("@external-services/services/google/fcm");
|
|
15
|
+
class NotificationsService {
|
|
16
|
+
// declare UnifiedPushService: UnifiedPushService
|
|
17
|
+
constructor({ googleAuthToken }) {
|
|
18
|
+
this.sendNewItemDetectedNotifications = (account_fcm_tokens, options) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield Promise.all([
|
|
20
|
+
this.GoogleFCMService.sendFcmNewItemDetectedNotification(account_fcm_tokens, options),
|
|
21
|
+
// this.UnifiedPushService.sendUpNewEpisodeDetectedNotification(options)
|
|
22
|
+
]);
|
|
23
|
+
});
|
|
24
|
+
this.sendLiveItemLiveDetectedNotifications = (account_fcm_tokens, options) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield Promise.all([
|
|
26
|
+
this.GoogleFCMService.sendFcmLiveItemLiveDetectedNotification(account_fcm_tokens, options),
|
|
27
|
+
// this.UnifiedPushService.sendUpLiveItemLiveDetectedNotification(options)
|
|
28
|
+
]);
|
|
29
|
+
});
|
|
30
|
+
this.GoogleFCMService = new fcm_1.GoogleFCMService({
|
|
31
|
+
authToken: googleAuthToken
|
|
32
|
+
});
|
|
33
|
+
// this.UnifiedPushService = new UnifiedPushService()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.NotificationsService = NotificationsService;
|
|
@@ -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 {
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/podcast-index/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AASD,qBAAa,mBAAmB;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;gBAEZ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,WAAW;IAMzD,sBAAsB,GAAU,KAAK,MAAM,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
|
|
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,118 +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* () {
|
|
40
41
|
podverse_helpers_1.logger.info('getRecentlyUpdatedData beginning...');
|
|
41
42
|
const currentTimeInSeconds = Math.floor(Date.now() / 1000);
|
|
42
|
-
const sinceRange =
|
|
43
|
+
const sinceRange = config_1.config.podcastIndex.recentlyUpdatedDataInterval;
|
|
43
44
|
const sinceTimeInSeconds = currentTimeInSeconds - sinceRange;
|
|
44
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}`);
|
|
45
47
|
const url = `${this.baseUrl}/recent/data?max=5000&since=${since}`;
|
|
46
48
|
const response = yield this.podcastIndexAPIRequest(url);
|
|
47
49
|
const updatedFeeds = response.data.feeds;
|
|
48
50
|
const nextSince = response.nextSince;
|
|
49
51
|
allData = allData.concat(updatedFeeds);
|
|
50
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`);
|
|
51
59
|
return fetchData(nextSince, allData);
|
|
52
60
|
}
|
|
53
61
|
return allData;
|
|
54
62
|
});
|
|
55
63
|
return fetchData(sinceTimeInSeconds);
|
|
56
64
|
});
|
|
57
|
-
this.
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const episodes = yield this.getAllEpisodesFromPodcastIndexById(podcastIndexId);
|
|
64
|
-
const pvEpisodesValueTagsByGuid = {};
|
|
65
|
-
for (const episode of episodes) {
|
|
66
|
-
if ((episode === null || episode === void 0 ? void 0 : episode.value) && (episode === null || episode === void 0 ? void 0 : episode.guid)) {
|
|
67
|
-
const pvValueTagArray = this.convertPIValueTagToPVValueTagArray(episode.value);
|
|
68
|
-
if ((pvValueTagArray === null || pvValueTagArray === void 0 ? void 0 : pvValueTagArray.length) > 0) {
|
|
69
|
-
pvEpisodesValueTagsByGuid[episode.guid] = pvValueTagArray;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
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;
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return this.podcastIndexAPIRequest(url);
|
|
78
|
-
});
|
|
79
|
-
this.getPodcastFromPodcastIndexById = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
const url = `${this.baseUrl}/podcasts/byfeedid?id=${id}`;
|
|
81
|
-
return this.podcastIndexAPIRequest(url);
|
|
82
|
-
});
|
|
83
|
-
this.getPodcastValueTagForPodcastIndexId = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
const podcast = yield this.getPodcastFromPodcastIndexById(id);
|
|
85
|
-
const pvValueTagArray = this.convertPIValueTagToPVValueTagArray(podcast.feed.value);
|
|
86
|
-
return pvValueTagArray;
|
|
72
|
+
catch (error) {
|
|
73
|
+
// assume a 404
|
|
74
|
+
}
|
|
75
|
+
return podcastIndexPodcast || null;
|
|
87
76
|
});
|
|
88
|
-
this.
|
|
89
|
-
const url = `${this.baseUrl}/podcasts/bytag?podcast-
|
|
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}`;
|
|
90
79
|
const data = yield this.podcastIndexAPIRequest(url);
|
|
91
80
|
for (const feed of data.feeds) {
|
|
92
81
|
accumulatedPodcastIndexIds.push(feed.id);
|
|
93
82
|
}
|
|
94
83
|
if (data.nextStartAt) {
|
|
95
|
-
return yield this.
|
|
84
|
+
return yield this.getValueTagEnabledPodcastIdsRecursively(accumulatedPodcastIndexIds, data.nextStartAt);
|
|
96
85
|
}
|
|
97
86
|
return accumulatedPodcastIndexIds;
|
|
98
87
|
});
|
|
99
|
-
this.
|
|
88
|
+
this.getValueTagEnabledPodcastIds = () => __awaiter(this, void 0, void 0, function* () {
|
|
100
89
|
const accumulatedPodcastIndexIds = [];
|
|
101
90
|
const nextStartAt = 1;
|
|
102
|
-
const podcastIndexIds = yield this.
|
|
91
|
+
const podcastIndexIds = yield this.getValueTagEnabledPodcastIdsRecursively(accumulatedPodcastIndexIds, nextStartAt);
|
|
103
92
|
return podcastIndexIds;
|
|
104
93
|
});
|
|
105
|
-
this.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
recipients: piValueTag.destinations.map((destination) => {
|
|
112
|
-
return {
|
|
113
|
-
address: destination.address,
|
|
114
|
-
customKey: destination.custom_key || '',
|
|
115
|
-
customValue: destination.custom_value || '',
|
|
116
|
-
fee: destination.fee || false,
|
|
117
|
-
name: destination.name || '',
|
|
118
|
-
split: destination.split || 0,
|
|
119
|
-
type: destination.type || ''
|
|
120
|
-
};
|
|
121
|
-
}),
|
|
122
|
-
valueTimeSplits: piValueTag.value_time_splits
|
|
123
|
-
}
|
|
124
|
-
];
|
|
125
|
-
};
|
|
126
|
-
this.getPodcastFromPodcastIndexByGuid = (podcastGuid) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
const url = `${this.baseUrl}/podcasts/byguid?guid=${podcastGuid}`;
|
|
128
|
-
let podcastIndexPodcast = null;
|
|
129
|
-
try {
|
|
130
|
-
const data = yield this.podcastIndexAPIRequest(url);
|
|
131
|
-
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);
|
|
132
100
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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;
|
|
140
125
|
});
|
|
141
126
|
this.authKey = authKey;
|
|
142
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,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,WAAW,EAAE,MAAM,CAAC;IACpB,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,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,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,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,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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "podverse-external-services",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.1.0-develop-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
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
|
-
"
|
|
14
|
+
"prepublishOnly": "npm run build",
|
|
15
15
|
"start": "ts-node ./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"author": "",
|
|
@@ -31,9 +31,13 @@
|
|
|
31
31
|
"@types/aws-sdk": "^2.7.0",
|
|
32
32
|
"aws-sdk": "2.814.0",
|
|
33
33
|
"crypto-js": "^4.2.0",
|
|
34
|
+
"csv-parser": "^3.2.0",
|
|
35
|
+
"firebase-admin": "^13.2.0",
|
|
34
36
|
"http-errors": "1.7.3",
|
|
37
|
+
"module-alias": "^2.2.3",
|
|
38
|
+
"paypal-rest-sdk": "2.0.0-rc.2",
|
|
35
39
|
"podcast-partytime": "^4.8.3",
|
|
36
|
-
"podverse-helpers": "^5.
|
|
40
|
+
"podverse-helpers": "^5.1.1-alpha.1",
|
|
37
41
|
"web-push": "^3.6.3"
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -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
|
-
// }
|