podverse-mq 5.1.6-alpha.2 → 5.1.6-alpha.4

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,9 +1,10 @@
1
1
  import { ActiveMQArtemisService } from "@queue/services/activeMQArtemis";
2
2
  import { MQQueueConfig } from "podverse-helpers";
3
+ import { ParseRSSFeedAndSaveToDatabase } from "podverse-parser";
3
4
  type MQRSSAddOptions = MQQueueConfig & {
4
5
  feedUrl: string;
5
6
  podcast_index_id: number;
6
7
  };
7
- export declare const mqRSSAdd: (activeMQArtemisService: ActiveMQArtemisService, options: MQRSSAddOptions) => Promise<void>;
8
+ export declare const mqRSSAdd: (activeMQArtemisService: ActiveMQArtemisService, options: MQRSSAddOptions, msgOptions: ParseRSSFeedAndSaveToDatabase) => Promise<void>;
8
9
  export {};
9
10
  //# sourceMappingURL=add.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,KAAK,eAAe,GAAG,aAAa,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GACnB,wBAAwB,sBAAsB,EAC9C,SAAS,eAAe,kBAezB,CAAC"}
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAEhE,KAAK,eAAe,GAAG,aAAa,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GACnB,wBAAwB,sBAAsB,EAC9C,SAAS,eAAe,EACxB,YAAY,6BAA6B,kBAgB1C,CAAC"}
@@ -10,11 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.mqRSSAdd = void 0;
13
- const mqRSSAdd = (activeMQArtemisService, options) => __awaiter(void 0, void 0, void 0, function* () {
13
+ const mqRSSAdd = (activeMQArtemisService, options, msgOptions) => __awaiter(void 0, void 0, void 0, function* () {
14
14
  yield activeMQArtemisService.initialize();
15
15
  const message = {
16
16
  url: options.feedUrl,
17
- podcast_index_id: options.podcast_index_id
17
+ podcast_index_id: options.podcast_index_id,
18
+ options: msgOptions
18
19
  };
19
20
  yield activeMQArtemisService.sendMessage({
20
21
  queueName: options.queueName,
@@ -1,6 +1,7 @@
1
1
  import { ActiveMQArtemisService } from "@queue/services/activeMQArtemis";
2
2
  import { MQQueueConfig } from "podverse-helpers";
3
+ import { ParseRSSFeedAndSaveToDatabase } from "podverse-parser";
3
4
  type MQRSSAddAllConfig = MQQueueConfig;
4
- export declare const mqRSSAddAll: (activeMQArtemisService: ActiveMQArtemisService, config: MQRSSAddAllConfig) => Promise<void>;
5
+ export declare const mqRSSAddAll: (activeMQArtemisService: ActiveMQArtemisService, options: MQRSSAddAllConfig, msgOptions: ParseRSSFeedAndSaveToDatabase) => Promise<void>;
5
6
  export {};
6
7
  //# sourceMappingURL=addAll.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addAll.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/addAll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,KAAK,iBAAiB,GAAG,aAAa,CAAC;AAEvC,eAAO,MAAM,WAAW,GACtB,wBAAwB,sBAAsB,EAC9C,QAAQ,iBAAiB,kBAoB1B,CAAC"}
1
+ {"version":3,"file":"addAll.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/addAll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAEhE,KAAK,iBAAiB,GAAG,aAAa,CAAC;AAEvC,eAAO,MAAM,WAAW,GACtB,wBAAwB,sBAAsB,EAC9C,SAAS,iBAAiB,EAC1B,YAAY,6BAA6B,kBAqB1C,CAAC"}
@@ -11,20 +11,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.mqRSSAddAll = void 0;
13
13
  const podverse_orm_1 = require("podverse-orm");
14
- const mqRSSAddAll = (activeMQArtemisService, config) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const mqRSSAddAll = (activeMQArtemisService, options, msgOptions) => __awaiter(void 0, void 0, void 0, function* () {
15
15
  const feedService = new podverse_orm_1.FeedService();
16
16
  const feeds = yield feedService.getAll();
17
17
  yield activeMQArtemisService.initialize();
18
18
  for (const feed of feeds) {
19
19
  const message = {
20
20
  url: feed.url,
21
- podcast_index_id: feed.podcast_index_id
21
+ podcast_index_id: feed.podcast_index_id,
22
+ options: msgOptions
22
23
  };
23
24
  yield activeMQArtemisService.sendMessage({
24
- queueName: config.queueName,
25
+ queueName: options.queueName,
25
26
  message,
26
- priority: config.priority,
27
- dedupeCacheTimeMS: config.dedupeCacheTimeMS
27
+ priority: options.priority,
28
+ dedupeCacheTimeMS: options.dedupeCacheTimeMS
28
29
  });
29
30
  }
30
31
  });
@@ -1,9 +1,10 @@
1
1
  import { PodcastIndexService } from 'podverse-external-services';
2
2
  import { MQQueueConfig } from 'podverse-helpers';
3
3
  import { ActiveMQArtemisService } from "@queue/services/activeMQArtemis";
4
+ import { ParseRSSFeedAndSaveToDatabase } from 'podverse-parser';
4
5
  type MQRSSAddAllRecentlyUpdatedFeedsOptions = MQQueueConfig & {
5
6
  sinceRange: number;
6
7
  };
7
- export declare const mqRSSAddRecentlyUpdatedFeedsFromPodcastIndex: (activeMQArtemisService: ActiveMQArtemisService, podcastIndexService: PodcastIndexService, options: MQRSSAddAllRecentlyUpdatedFeedsOptions) => Promise<void>;
8
+ export declare const mqRSSAddRecentlyUpdatedFeedsFromPodcastIndex: (activeMQArtemisService: ActiveMQArtemisService, podcastIndexService: PodcastIndexService, options: MQRSSAddAllRecentlyUpdatedFeedsOptions, msgOptions: ParseRSSFeedAndSaveToDatabase) => Promise<void>;
8
9
  export {};
9
10
  //# sourceMappingURL=addRecentlyUpdatedFeedsFromPodcastIndex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addRecentlyUpdatedFeedsFromPodcastIndex.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/addRecentlyUpdatedFeedsFromPodcastIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE,KAAK,sCAAsC,GAAG,aAAa,GAAG;IAC5D,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,4CAA4C,GACvD,wBAAwB,sBAAsB,EAC9C,qBAAqB,mBAAmB,EACxC,SAAS,sCAAsC,kBA2BhD,CAAC"}
1
+ {"version":3,"file":"addRecentlyUpdatedFeedsFromPodcastIndex.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/addRecentlyUpdatedFeedsFromPodcastIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAEhE,KAAK,sCAAsC,GAAG,aAAa,GAAG;IAC5D,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAED,eAAO,MAAM,4CAA4C,GACvD,wBAAwB,sBAAsB,EAC9C,qBAAqB,mBAAmB,EACxC,SAAS,sCAAsC,EAC/C,YAAY,6BAA6B,kBA4B1C,CAAC"}
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.mqRSSAddRecentlyUpdatedFeedsFromPodcastIndex = void 0;
13
13
  const podverse_orm_1 = require("podverse-orm");
14
- const mqRSSAddRecentlyUpdatedFeedsFromPodcastIndex = (activeMQArtemisService, podcastIndexService, options) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const mqRSSAddRecentlyUpdatedFeedsFromPodcastIndex = (activeMQArtemisService, podcastIndexService, options, msgOptions) => __awaiter(void 0, void 0, void 0, function* () {
15
15
  const sinceRange = options.sinceRange;
16
16
  const recentlyUpdatedFeeds = yield podcastIndexService.recentGetData(sinceRange);
17
17
  yield activeMQArtemisService.initialize();
@@ -23,7 +23,8 @@ const mqRSSAddRecentlyUpdatedFeedsFromPodcastIndex = (activeMQArtemisService, po
23
23
  if (shouldAddToQueue) {
24
24
  const message = {
25
25
  url: feed.feedUrl,
26
- podcast_index_id: feed.feedId
26
+ podcast_index_id: feed.feedId,
27
+ options: msgOptions
27
28
  };
28
29
  yield activeMQArtemisService.sendMessage({
29
30
  queueName: options.queueName,
@@ -1 +1 @@
1
- {"version":3,"file":"runLiveItemListener.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/runLiveItemListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAe,MAAM,iCAAiC,CAAC;AAMtF,eAAO,MAAM,wBAAwB,GACnC,wBAAwB,sBAAsB,SAoI/C,CAAC"}
1
+ {"version":3,"file":"runLiveItemListener.d.ts","sourceRoot":"","sources":["../../../../src/functions/mq/rss/runLiveItemListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAe,MAAM,iCAAiC,CAAC;AAMtF,eAAO,MAAM,wBAAwB,GACnC,wBAAwB,sBAAsB,SAqI/C,CAAC"}
@@ -89,7 +89,7 @@ const mqRSSRunLiveItemListener = (activeMQArtemisService) => {
89
89
  const queueType = 'rss-live';
90
90
  const mqConstantMessageOptions = podverse_helpers_1.MQ_QUEUES[queueType];
91
91
  for (const addRSSObj of addRSSObjs) {
92
- yield (0, add_1.mqRSSAdd)(activeMQArtemisService, Object.assign(Object.assign({}, mqConstantMessageOptions), { feedUrl: addRSSObj.url, podcast_index_id: addRSSObj.podcast_index_id }));
92
+ yield (0, add_1.mqRSSAdd)(activeMQArtemisService, Object.assign(Object.assign({}, mqConstantMessageOptions), { feedUrl: addRSSObj.url, podcast_index_id: addRSSObj.podcast_index_id }), { forceParse: true });
93
93
  }
94
94
  }
95
95
  }
@@ -18,9 +18,9 @@ const mqRSSRunParser = (activeMQArtemisService, queueName) => __awaiter(void 0,
18
18
  try {
19
19
  const bodyStr = (_b = (_a = context.message) === null || _a === void 0 ? void 0 : _a.body) !== null && _b !== void 0 ? _b : '';
20
20
  const receivedMessage = JSON.parse(bodyStr);
21
- const { url, podcast_index_id } = receivedMessage;
21
+ const { url, podcast_index_id, options } = receivedMessage;
22
22
  if (url || podcast_index_id) {
23
- yield (0, podverse_parser_1.parseRSSFeedAndSaveToDatabase)(url, podcast_index_id);
23
+ yield (0, podverse_parser_1.parseRSSFeedAndSaveToDatabase)(url, podcast_index_id, options);
24
24
  (_c = context.delivery) === null || _c === void 0 ? void 0 : _c.accept();
25
25
  }
26
26
  else {
@@ -1,6 +1,6 @@
1
1
  import { EventContext } from 'rhea';
2
2
  import { LoggerService } from 'podverse-helpers/dist/lib/backend/logger';
3
- export type MQQueueName = 'rss-normal' | 'rss-on-demand' | 'rss-live' | 'DLQ' | `DLQ.${'rss-normal' | 'rss-on-demand' | 'rss-live'}`;
3
+ export type MQQueueName = 'rss-normal' | 'rss-on-demand' | 'rss-live' | `DLQ.${'rss-normal' | 'rss-on-demand' | 'rss-live'}`;
4
4
  type MQRSSMessage = {
5
5
  url: string;
6
6
  podcast_index_id: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/activeMQArtemis/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,YAAY,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAIzE,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,eAAe,GACf,UAAU,GACV,KAAK,GACL,OAAO,YAAY,GAAG,eAAe,GAAG,UAAU,EAAE,CAAC;AAEzD,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,KAAK,OAAO,GAAG,YAAY,CAAC;AAE5B,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,WAAW,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC,CAAA;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa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,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC,CAAA;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE,4BAA4B,EAAE,MAAM,EAAE,aAAa;IAKjE,UAAU;YASF,OAAO;YAwDP,YAAY;YAaZ,cAAc;IAa5B,OAAO,CAAC,kBAAkB;IAQpB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC3D;;;;OAIG;IACG,eAAe,CACnB,SAAS,EAAE,WAAW,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,kBAAkB,SAAqC,GACtD,OAAO,CAAC,IAAI,CAAC;IAoDV,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CA0B9G"}
@@ -170,7 +170,7 @@ class ActiveMQArtemisService {
170
170
  if (!this.connection)
171
171
  yield this.connect();
172
172
  // Choose target based on what exists in your broker
173
- const dlqTargets = ['DLQ', `DLQ.${queueName}`];
173
+ const dlqTargets = [`DLQ.${queueName}`];
174
174
  for (const dlqQueue of dlqTargets) {
175
175
  const sender = this.connection.open_sender({ target: { address: dlqQueue } });
176
176
  yield new Promise((resolve) => sender.once('sender_open', () => resolve()));
@@ -1,5 +1,7 @@
1
+ import { ParseRSSFeedAndSaveToDatabase } from "podverse-parser";
1
2
  export type MQFeedMessage = {
2
3
  url: string;
3
4
  podcast_index_id: number;
5
+ options: ParseRSSFeedAndSaveToDatabase;
4
6
  };
5
7
  //# sourceMappingURL=mq.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mq.d.ts","sourceRoot":"","sources":["../../src/types/mq.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAA"}
1
+ {"version":3,"file":"mq.d.ts","sourceRoot":"","sources":["../../src/types/mq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,6BAA6B,CAAC;CACxC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-mq",
3
- "version": "5.1.6-alpha.2",
3
+ "version": "5.1.6-alpha.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "license": "AGPLv3",
18
18
  "dependencies": {
19
19
  "module-alias": "^2.2.3",
20
- "podverse-external-services": "^5.1.6-alpha.2",
21
- "podverse-helpers": "^5.1.6-alpha.0",
22
- "podverse-orm": "^5.1.6-alpha.0",
23
- "podverse-parser": "^5.1.6-alpha.1",
20
+ "podverse-external-services": "^5.1.6-alpha.3",
21
+ "podverse-helpers": "^5.1.6-alpha.1",
22
+ "podverse-orm": "^5.1.6-alpha.3",
23
+ "podverse-parser": "^5.1.6-alpha.3",
24
24
  "rhea": "^2.0.6",
25
25
  "ws": "^8.18.3"
26
26
  },