@messenger-box/cron-job-server-module 10.0.2-alpha.0 → 10.0.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.0.2-alpha.2](https://github.com/CDEBase/messenger-box/compare/v10.0.2-alpha.1...v10.0.2-alpha.2) (2025-02-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/cron-job-server-module
|
|
9
|
+
|
|
6
10
|
## [10.0.2-alpha.0](https://github.com/cdmbase/messenger-box/compare/v9.0.4-alpha.23...v10.0.2-alpha.0) (2025-02-04)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @messenger-box/cron-job-server-module
|
package/lib/index.js
CHANGED
|
@@ -134,18 +134,18 @@ class MessengerNotificationCronMoleculerService extends moleculer__WEBPACK_IMPOR
|
|
|
134
134
|
const logger = container.get(_common_stack_core__WEBPACK_IMPORTED_MODULE_3__.CommonType.LOGGER);
|
|
135
135
|
const messengerService = container.get(_messenger_box_platform_server__WEBPACK_IMPORTED_MODULE_2__.TYPES.MessengerNotificationService);
|
|
136
136
|
this.broker.createService({
|
|
137
|
-
name: common__WEBPACK_IMPORTED_MODULE_1__.
|
|
137
|
+
name: common__WEBPACK_IMPORTED_MODULE_1__.MoleculerCronServiceName.MessengerNotificationCronJob,
|
|
138
138
|
mixins: [(_skoropletov_moleculer_cron_tasks__WEBPACK_IMPORTED_MODULE_4___default())],
|
|
139
139
|
tasks: [
|
|
140
140
|
// {
|
|
141
|
-
// name: `${
|
|
141
|
+
// name: `${MessengerNotificationCronTaskName.SendNotificationOfUnreadMessages}`,
|
|
142
142
|
// cronTime: '0 * * * *',
|
|
143
143
|
// async callback() {
|
|
144
144
|
// return messengerService.sendNotificationOfUnreadMessages(NotificationDurationUnitEnum.hours, 1);
|
|
145
145
|
// },
|
|
146
146
|
// },
|
|
147
147
|
{
|
|
148
|
-
name: `${common__WEBPACK_IMPORTED_MODULE_1__.
|
|
148
|
+
name: `${common__WEBPACK_IMPORTED_MODULE_1__.MessengerNotificationCronTaskName.SendNotificationOfAlertMessages}`,
|
|
149
149
|
cronTime: '*/10 * * * * *',
|
|
150
150
|
async callback() {
|
|
151
151
|
logger.debug('CronJob (sendNotificationOfAlertMessages) - running at', new Date());
|
|
@@ -153,7 +153,7 @@ class MessengerNotificationCronMoleculerService extends moleculer__WEBPACK_IMPOR
|
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
|
-
name: `${common__WEBPACK_IMPORTED_MODULE_1__.
|
|
156
|
+
name: `${common__WEBPACK_IMPORTED_MODULE_1__.MessengerNotificationCronTaskName.SendNotificationOfUnreadServiceMessages}`,
|
|
157
157
|
cronTime: '0 */10 * * * *',
|
|
158
158
|
async callback() {
|
|
159
159
|
logger.debug('CronJob (sendNotificationOfUnreadServiceMessages) - running at', new Date());
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAA,iEAAe,uCAAuC,qCAAqC,4CAA4C,sNAAsN,GAAG;;;;;;;;;;;;;;;ACAvU;;;;;;;;;;;;;;;;ACAzB,aAAa;AACmG;AAEzG,MAAM,MAAM,GAAG,CAAC,8FAAyC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;ACHzB;AAGjC;AACgB;AAEnC,iEAAe,IAAI,8DAAO,CAAC;IACvB,MAAM;IACN,2BAA2B,EAAE;QACzB,+EAAyC;KAC5C;CACJ,CAAC;;;;;;;;;;;;;;;;ACX8D;;;;;;;;;;;;;;;;;;;;;;;;;ACAb;
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;;;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E,GAAG,qEAAiC,CAAC,+BAA+B,EAAE;oBAC5E,QAAQ,EAAE,gBAAgB;oBAC1B,KAAK,CAAC,QAAQ;wBACV,MAAM,CAAC,KAAK,CAAC,yDAAyD,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;wBACpF,MAAM,gBAAgB,CAAC,+BAA+B,CAClD,wFAA4B,CAAC,OAAO,EACpC,EAAE,CACL,CAAC;oBACN,CAAC;iBACJ;gBACD;oBACI,IAAI,EAAE,GAAG,qEAAiC,CAAC,uCAAuC,EAAE;oBACpF,QAAQ,EAAE,gBAAgB;oBAC1B,KAAK,CAAC,QAAQ;wBACV,MAAM,CAAC,KAAK,CAAC,iEAAiE,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;wBAC5F,MAAM,gBAAgB,CAAC,uCAAuC,CAC1D,wFAA4B,CAAC,OAAO,EACpC,EAAE,CACL,CAAC;oBACN,CAAC;iBACJ;aACJ;SACJ,CAAC,CAAC;IACP,CAAC;CACJ;;;;;;;;;;;AC5DD;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNmC","sources":["webpack://@messenger-box/cron-job-server-module/./src/graphql/schema/messenger-notification-cron-moleculer-service.graphql","webpack://@messenger-box/cron-job-server-module/./src/graphql/index.ts","webpack://@messenger-box/cron-job-server-module/./src/graphql/schema/index.ts","webpack://@messenger-box/cron-job-server-module/./src/module.ts","webpack://@messenger-box/cron-job-server-module/./src/plugins/index.ts","webpack://@messenger-box/cron-job-server-module/./src/plugins/messenger-notification-cron-moleculer-service.ts","webpack://@messenger-box/cron-job-server-module/external commonjs \"@common-stack/core\"","webpack://@messenger-box/cron-job-server-module/external commonjs \"@common-stack/server-core\"","webpack://@messenger-box/cron-job-server-module/external commonjs \"@messenger-box/platform-server\"","webpack://@messenger-box/cron-job-server-module/external commonjs \"@skoropletov/moleculer-cron-tasks\"","webpack://@messenger-box/cron-job-server-module/external commonjs \"common\"","webpack://@messenger-box/cron-job-server-module/external commonjs \"moleculer\"","webpack://@messenger-box/cron-job-server-module/webpack/bootstrap","webpack://@messenger-box/cron-job-server-module/webpack/runtime/compat get default export","webpack://@messenger-box/cron-job-server-module/webpack/runtime/define property getters","webpack://@messenger-box/cron-job-server-module/webpack/runtime/hasOwnProperty shorthand","webpack://@messenger-box/cron-job-server-module/webpack/runtime/make namespace object","webpack://@messenger-box/cron-job-server-module/./src/index.ts"],"sourcesContent":["export default \"extend enum MoleculerCronServiceName {\\n MessengerNotificationCronJob\\n}\\n\\nenum MessengerNotificationCronTaskName {\\n sendNotificationOfUnreadMessages\\n sendNotificationOnPost\\n sendNotificationOfAlertMessages\\n sendPushNotificationsExpo\\n sendExpoNotificationOnPost\\n sendNotificationOfUnreadServiceMessages\\n}\\n\";","export * from './schema';\n","// @ts-ignore\nimport messengerNotificationCronMoleculerService from './messenger-notification-cron-moleculer-service.graphql';\n\nexport const schema = [messengerNotificationCronMoleculerService].join('\\n');\n","import { Feature } from '@common-stack/server-core';\nimport {\n MessengerNotificationCronMoleculerService,\n} from './plugins';\nimport { schema } from './graphql';\n\nexport default new Feature({\n schema,\n addBrokerClientServiceClass: [\n MessengerNotificationCronMoleculerService,\n ],\n})\n","export * from './messenger-notification-cron-moleculer-service';\n","import { Service, ServiceBroker } from 'moleculer';\nimport { MoleculerCronServiceName, MessengerNotificationCronTaskName } from 'common';\nimport { NotificationDurationUnitEnum, IMessengerNotificationService, TYPES } from '@messenger-box/platform-server';\nimport { Container } from 'inversify';\nimport { CommonType } from '@common-stack/core';\nimport CronTasks from '@skoropletov/moleculer-cron-tasks';\nimport { CdmLogger } from '@cdm-logger/core';\n\nexport class MessengerNotificationCronMoleculerService extends Service {\n constructor(broker: ServiceBroker, { container }: { container: Container } & { settings: any }) {\n super(broker);\n this.container = container;\n this.parseServiceSchema({\n name: MessengerNotificationCronMoleculerService.name,\n started() {\n // @ts-ignore\n this.registerCronJobs(container);\n },\n });\n }\n\n private registerCronJobs(container: Container): void {\n const logger: CdmLogger.ILogger = container.get(CommonType.LOGGER);\n const messengerService: IMessengerNotificationService = container.get(TYPES.MessengerNotificationService);\n this.broker.createService({\n name: MoleculerCronServiceName.MessengerNotificationCronJob,\n mixins: [CronTasks],\n tasks: [\n // {\n // name: `${MessengerNotificationCronTaskName.SendNotificationOfUnreadMessages}`,\n // cronTime: '0 * * * *',\n // async callback() {\n // return messengerService.sendNotificationOfUnreadMessages(NotificationDurationUnitEnum.hours, 1);\n // },\n // },\n {\n name: `${MessengerNotificationCronTaskName.SendNotificationOfAlertMessages}`,\n cronTime: '*/10 * * * * *',\n async callback() {\n logger.debug('CronJob (sendNotificationOfAlertMessages) - running at', new Date());\n await messengerService.sendNotificationOfAlertMessages(\n NotificationDurationUnitEnum.seconds,\n 10,\n );\n },\n },\n {\n name: `${MessengerNotificationCronTaskName.SendNotificationOfUnreadServiceMessages}`,\n cronTime: '0 */10 * * * *',\n async callback() {\n logger.debug('CronJob (sendNotificationOfUnreadServiceMessages) - running at', new Date());\n await messengerService.sendNotificationOfUnreadServiceMessages(\n NotificationDurationUnitEnum.minutes,\n 10,\n );\n },\n },\n ],\n });\n }\n}\n","module.exports = require(\"@common-stack/core\");","module.exports = require(\"@common-stack/server-core\");","module.exports = require(\"@messenger-box/platform-server\");","module.exports = require(\"@skoropletov/moleculer-cron-tasks\");","module.exports = require(\"common\");","module.exports = require(\"moleculer\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { default } from './module';\n"],"names":[],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/cron-job-server-module",
|
|
3
|
-
"version": "10.0.2-alpha.
|
|
3
|
+
"version": "10.0.2-alpha.2",
|
|
4
4
|
"description": "Extension to Messenger box cron jobs server",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"watch": "yarn build:lib:watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@messenger-box/core": "10.0.2-alpha.
|
|
25
|
-
"@messenger-box/platform-server": "10.0.2-alpha.
|
|
24
|
+
"@messenger-box/core": "10.0.2-alpha.2",
|
|
25
|
+
"@messenger-box/platform-server": "10.0.2-alpha.2",
|
|
26
26
|
"@skoropletov/moleculer-cron-tasks": "^0.0.8"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"typescript": {
|
|
59
59
|
"definition": "lib/index.d.ts"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4e6f143b5ea50dbd90354eb28b22b936a8fe59a3"
|
|
62
62
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Service, ServiceBroker } from 'moleculer';
|
|
2
|
-
import {
|
|
2
|
+
import { MoleculerCronServiceName, MessengerNotificationCronTaskName } from 'common';
|
|
3
3
|
import { NotificationDurationUnitEnum, IMessengerNotificationService, TYPES } from '@messenger-box/platform-server';
|
|
4
4
|
import { Container } from 'inversify';
|
|
5
5
|
import { CommonType } from '@common-stack/core';
|
|
@@ -23,18 +23,18 @@ export class MessengerNotificationCronMoleculerService extends Service {
|
|
|
23
23
|
const logger: CdmLogger.ILogger = container.get(CommonType.LOGGER);
|
|
24
24
|
const messengerService: IMessengerNotificationService = container.get(TYPES.MessengerNotificationService);
|
|
25
25
|
this.broker.createService({
|
|
26
|
-
name:
|
|
26
|
+
name: MoleculerCronServiceName.MessengerNotificationCronJob,
|
|
27
27
|
mixins: [CronTasks],
|
|
28
28
|
tasks: [
|
|
29
29
|
// {
|
|
30
|
-
// name: `${
|
|
30
|
+
// name: `${MessengerNotificationCronTaskName.SendNotificationOfUnreadMessages}`,
|
|
31
31
|
// cronTime: '0 * * * *',
|
|
32
32
|
// async callback() {
|
|
33
33
|
// return messengerService.sendNotificationOfUnreadMessages(NotificationDurationUnitEnum.hours, 1);
|
|
34
34
|
// },
|
|
35
35
|
// },
|
|
36
36
|
{
|
|
37
|
-
name: `${
|
|
37
|
+
name: `${MessengerNotificationCronTaskName.SendNotificationOfAlertMessages}`,
|
|
38
38
|
cronTime: '*/10 * * * * *',
|
|
39
39
|
async callback() {
|
|
40
40
|
logger.debug('CronJob (sendNotificationOfAlertMessages) - running at', new Date());
|
|
@@ -45,7 +45,7 @@ export class MessengerNotificationCronMoleculerService extends Service {
|
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
name: `${
|
|
48
|
+
name: `${MessengerNotificationCronTaskName.SendNotificationOfUnreadServiceMessages}`,
|
|
49
49
|
cronTime: '0 */10 * * * *',
|
|
50
50
|
async callback() {
|
|
51
51
|
logger.debug('CronJob (sendNotificationOfUnreadServiceMessages) - running at', new Date());
|