@universis/webhooks 1.1.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 (38) hide show
  1. package/.gitlab-ci.yml +40 -0
  2. package/LICENSE +163 -0
  3. package/README.md +113 -0
  4. package/dist/SchemaLoader.d.ts +4 -0
  5. package/dist/SchemaLoader.js +46 -0
  6. package/dist/SchemaLoader.js.map +1 -0
  7. package/dist/WebHookService.d.ts +11 -0
  8. package/dist/WebHookService.js +272 -0
  9. package/dist/WebHookService.js.map +1 -0
  10. package/dist/config/models/WebHook.json +182 -0
  11. package/dist/config/models/WebHookAction.json +85 -0
  12. package/dist/config/models/WebHookConfiguration.json +66 -0
  13. package/dist/config/scope.access.js +30 -0
  14. package/dist/config/scope.access.js.map +1 -0
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.js +3 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/listeners/OnWebHook.js +33 -0
  19. package/dist/listeners/OnWebHook.js.map +1 -0
  20. package/dist/listeners/OnWebHookAction.js +53 -0
  21. package/dist/listeners/OnWebHookAction.js.map +1 -0
  22. package/dist/listeners/package.json +3 -0
  23. package/jest.config.js +202 -0
  24. package/jsconfig.json +8 -0
  25. package/package.json +65 -0
  26. package/src/SchemaLoader.d.ts +4 -0
  27. package/src/SchemaLoader.js +46 -0
  28. package/src/WebHookService.d.ts +11 -0
  29. package/src/WebHookService.js +275 -0
  30. package/src/config/models/WebHook.json +182 -0
  31. package/src/config/models/WebHookAction.json +85 -0
  32. package/src/config/models/WebHookConfiguration.json +66 -0
  33. package/src/config/scope.access.js +34 -0
  34. package/src/index.d.ts +2 -0
  35. package/src/index.js +2 -0
  36. package/src/listeners/OnWebHook.js +37 -0
  37. package/src/listeners/OnWebHookAction.js +56 -0
  38. package/src/listeners/package.json +3 -0
package/jest.config.js ADDED
@@ -0,0 +1,202 @@
1
+ /**
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ /** @type {import('jest').Config} */
7
+ const config = {
8
+ // All imported modules in your tests should be mocked automatically
9
+ // automock: false,
10
+
11
+ // Stop running tests after `n` failures
12
+ // bail: 0,
13
+
14
+ // The directory where Jest should store its cached dependency information
15
+ // cacheDirectory: "/private/var/folders/bs/w3b1f9k16kb7mm17d66vdmwc0000gn/T/jest_dx",
16
+
17
+ // Automatically clear mock calls, instances, contexts and results before every test
18
+ // clearMocks: false,
19
+
20
+ // Indicates whether the coverage information should be collected while executing the test
21
+ // collectCoverage: false,
22
+
23
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
24
+ // collectCoverageFrom: undefined,
25
+
26
+ // The directory where Jest should output its coverage files
27
+ // coverageDirectory: undefined,
28
+
29
+ // An array of regexp pattern strings used to skip coverage collection
30
+ // coveragePathIgnorePatterns: [
31
+ // "/node_modules/"
32
+ // ],
33
+
34
+ // Indicates which provider should be used to instrument code for coverage
35
+ coverageProvider: "v8",
36
+
37
+ // A list of reporter names that Jest uses when writing coverage reports
38
+ // coverageReporters: [
39
+ // "json",
40
+ // "text",
41
+ // "lcov",
42
+ // "clover"
43
+ // ],
44
+
45
+ // An object that configures minimum threshold enforcement for coverage results
46
+ // coverageThreshold: undefined,
47
+
48
+ // A path to a custom dependency extractor
49
+ // dependencyExtractor: undefined,
50
+
51
+ // Make calling deprecated APIs throw helpful error messages
52
+ // errorOnDeprecated: false,
53
+
54
+ // The default configuration for fake timers
55
+ // fakeTimers: {
56
+ // "enableGlobally": false
57
+ // },
58
+
59
+ // Force coverage collection from ignored files using an array of glob patterns
60
+ // forceCoverageMatch: [],
61
+
62
+ // A path to a module which exports an async function that is triggered once before all test suites
63
+ // globalSetup: undefined,
64
+
65
+ // A path to a module which exports an async function that is triggered once after all test suites
66
+ // globalTeardown: undefined,
67
+
68
+ // A set of global variables that need to be available in all test environments
69
+ // globals: {},
70
+
71
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72
+ // maxWorkers: "50%",
73
+
74
+ // An array of directory names to be searched recursively up from the requiring module's location
75
+ // moduleDirectories: [
76
+ // "node_modules"
77
+ // ],
78
+
79
+ // An array of file extensions your modules use
80
+ // moduleFileExtensions: [
81
+ // "js",
82
+ // "mjs",
83
+ // "cjs",
84
+ // "jsx",
85
+ // "ts",
86
+ // "mts",
87
+ // "cts",
88
+ // "tsx",
89
+ // "json",
90
+ // "node"
91
+ // ],
92
+
93
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
94
+ moduleNameMapper: {
95
+ '@universis/webhooks': '<rootDir>/src',
96
+ },
97
+
98
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
99
+ // modulePathIgnorePatterns: [],
100
+
101
+ // Activates notifications for test results
102
+ // notify: false,
103
+
104
+ // An enum that specifies notification mode. Requires { notify: true }
105
+ // notifyMode: "failure-change",
106
+
107
+ // A preset that is used as a base for Jest's configuration
108
+ // preset: undefined,
109
+
110
+ // Run tests from one or more projects
111
+ // projects: undefined,
112
+
113
+ // Use this configuration option to add custom reporters to Jest
114
+ // reporters: undefined,
115
+
116
+ // Automatically reset mock state before every test
117
+ // resetMocks: false,
118
+
119
+ // Reset the module registry before running each individual test
120
+ // resetModules: false,
121
+
122
+ // A path to a custom resolver
123
+ // resolver: undefined,
124
+
125
+ // Automatically restore mock state and implementation before every test
126
+ // restoreMocks: false,
127
+
128
+ // The root directory that Jest should scan for tests and modules within
129
+ // rootDir: undefined,
130
+
131
+ // A list of paths to directories that Jest should use to search for files in
132
+ // roots: [
133
+ // "<rootDir>"
134
+ // ],
135
+
136
+ // Allows you to use a custom runner instead of Jest's default test runner
137
+ // runner: "jest-runner",
138
+
139
+ // The paths to modules that run some code to configure or set up the testing environment before each test
140
+ // setupFiles: [],
141
+
142
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
143
+ // setupFilesAfterEnv: [],
144
+
145
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
146
+ // slowTestThreshold: 5,
147
+
148
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
149
+ // snapshotSerializers: [],
150
+
151
+ // The test environment that will be used for testing
152
+ // testEnvironment: "jest-environment-node",
153
+
154
+ // Options that will be passed to the testEnvironment
155
+ // testEnvironmentOptions: {},
156
+
157
+ // Adds a location field to test results
158
+ // testLocationInResults: false,
159
+
160
+ // The glob patterns Jest uses to detect test files
161
+ // testMatch: [
162
+ // "**/__tests__/**/*.?([mc])[jt]s?(x)",
163
+ // "**/?(*.)+(spec|test).?([mc])[jt]s?(x)"
164
+ // ],
165
+
166
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
167
+ // testPathIgnorePatterns: [
168
+ // "/node_modules/"
169
+ // ],
170
+
171
+ // The regexp pattern or array of patterns that Jest uses to detect test files
172
+ // testRegex: [],
173
+
174
+ // This option allows the use of a custom results processor
175
+ // testResultsProcessor: undefined,
176
+
177
+ // This option allows use of a custom test runner
178
+ // testRunner: "jest-circus/runner",
179
+
180
+ // A map from regular expressions to paths to transformers
181
+ // transform: undefined,
182
+
183
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
184
+ // transformIgnorePatterns: [
185
+ // "/node_modules/",
186
+ // "\\.pnp\\.[^\\/]+$"
187
+ // ],
188
+
189
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
190
+ // unmockedModulePathPatterns: undefined,
191
+
192
+ // Indicates whether each individual test should be reported during the run
193
+ // verbose: undefined,
194
+
195
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
196
+ // watchPathIgnorePatterns: [],
197
+
198
+ // Whether to use watchman for file crawling
199
+ // watchman: true,
200
+ };
201
+
202
+ module.exports = config;
package/jsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "paths": {
5
+ "@universis/webhooks": ["./src"]
6
+ }
7
+ }
8
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@universis/webhooks",
3
+ "version": "1.1.1",
4
+ "description": "Universis Webhooks API Library",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "engines": {
8
+ "node": ">=14"
9
+ },
10
+ "scripts": {
11
+ "test": "jest",
12
+ "eslint": "eslint",
13
+ "build": "rimraf dist && babel src --out-dir dist --copy-files --source-maps"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://gitlab.com/universis/webhooks.git"
18
+ },
19
+ "keywords": [
20
+ "universis",
21
+ "api",
22
+ "extension",
23
+ "plugin",
24
+ "library",
25
+ "microservice"
26
+ ],
27
+ "author": "",
28
+ "license": "LGPL-3.0-or-later",
29
+ "bugs": {
30
+ "url": "https://gitlab.com/universis/webhooks/issues"
31
+ },
32
+ "peerDependencies": {
33
+ "@themost/common": "^2",
34
+ "@themost/data": "^2",
35
+ "@themost/express": "^1",
36
+ "@themost/query": "^2",
37
+ "@themost/xml": "^2"
38
+ },
39
+ "devDependencies": {
40
+ "@babel/cli": "^7.21.0",
41
+ "@babel/core": "^7.21.4",
42
+ "@babel/eslint-parser": "^7.21.3",
43
+ "@babel/plugin-proposal-decorators": "^7.21.0",
44
+ "@babel/preset-env": "^7.21.4",
45
+ "@babel/register": "^7.21.0",
46
+ "@rollup/plugin-babel": "^6.0.3",
47
+ "@themost/data": "^2.21.1",
48
+ "@themost/test": "^2.11.4",
49
+ "@types/express": "^4.17.6",
50
+ "@types/jasmine": "^3.5.10",
51
+ "@types/superagent": "^8.1.9",
52
+ "dotenv": "^8.2.0",
53
+ "eslint": "^8.57.1",
54
+ "jest": "^30.1.3",
55
+ "rimraf": "3.0.2",
56
+ "typescript": "^5.0.4"
57
+ },
58
+ "homepage": "https://gitlab.com/universis/webhooks#readme",
59
+ "dependencies": {
60
+ "@themost/json-logger": "^1.3.0",
61
+ "rotating-file-stream": "^3.2.7",
62
+ "rxjs": "^7.8.2",
63
+ "superagent": "^10.2.3"
64
+ }
65
+ }
@@ -0,0 +1,4 @@
1
+ import { FileSchemaLoaderStrategy } from '@themost/data';
2
+ export declare class SchemaLoader extends FileSchemaLoaderStrategy {
3
+
4
+ }
@@ -0,0 +1,46 @@
1
+ import {FileSchemaLoaderStrategy} from '@themost/data';
2
+ import path from 'path';
3
+ import { ValueDialect } from '@themost/data';
4
+
5
+ if (typeof ValueDialect.prototype.$literal === 'undefined') {
6
+ /**
7
+ * Add $literal support to ValueDialect
8
+ */
9
+ ValueDialect.prototype.$literal = async function (value) {
10
+ return value;
11
+ }
12
+ }
13
+
14
+ /**
15
+ * A schema loader for loading extra data models
16
+ */
17
+ export class SchemaLoader extends FileSchemaLoaderStrategy {
18
+
19
+ /**
20
+ * @param {import('@themost/data').ConfigurationBase} config
21
+ */
22
+ constructor(config) {
23
+ super(config);
24
+ // set model path
25
+ this.setModelPath(path.resolve(__dirname, 'config/models'));
26
+ }
27
+
28
+ getModelDefinition(name) {
29
+ const model = super.getModelDefinition.bind(this)(name);
30
+ if (model) {
31
+ if (Array.isArray(model.eventListeners) ) {
32
+ model.eventListeners.forEach(eventListener => {
33
+ if (eventListener.type.indexOf('.') === 0) {
34
+ eventListener.type = path.resolve(__dirname, eventListener.type);
35
+ }
36
+ });
37
+ }
38
+ if (model.classPath && model.classPath.indexOf('.')===0) {
39
+ model.classPath= path.resolve(__dirname, model.classPath);
40
+ }
41
+ }
42
+ return model;
43
+ }
44
+
45
+ }
46
+
@@ -0,0 +1,11 @@
1
+ import { ApplicationService } from '@themost/common';
2
+ import {DataEventArgs} from '@themost/data';
3
+ import {JsonLogger} from '@themost/json-logger';
4
+
5
+ export declare class WebHookService extends ApplicationService {
6
+ readonly logger: JsonLogger;
7
+ refresh(): Promise<void>;
8
+ emit(event: DataEventArgs, extraArgs?: {
9
+ action?: string
10
+ }): void;
11
+ }
@@ -0,0 +1,275 @@
1
+ // noinspection NpmUsedModulesInstalled
2
+
3
+ import {ApplicationService} from '@themost/common';
4
+ import {WebHookScopeAccessElements} from './config/scope.access';
5
+ import {
6
+ DataObjectState,
7
+ DataQueryable,
8
+ ODataModelBuilder,
9
+ SchemaLoaderStrategy
10
+ } from '@themost/data';
11
+ import {SchemaLoader} from './SchemaLoader';
12
+ import request from 'superagent';
13
+ import {QueryExpression} from '@themost/query';
14
+ import { JsonLogger } from '@themost/json-logger';
15
+ import path from 'path';
16
+ import { createStream } from 'rotating-file-stream';
17
+ import {DataModelFilterParser} from '@themost/data/data-model-filter.parser';
18
+ import { afterSave } from './listeners/OnWebHookAction';
19
+
20
+ class WebHookService extends ApplicationService {
21
+ constructor(app) {
22
+ super(app);
23
+ /**
24
+ * @type {import('@themost/data').DefaultSchemaLoaderStrategy}
25
+ */
26
+ const schemaLoader = app.getConfiguration().getStrategy(SchemaLoaderStrategy);
27
+ schemaLoader.loaders.push(new SchemaLoader(app.getConfiguration()));
28
+ /**
29
+ * @type {import('@themost/data').ODataModelBuilder}
30
+ */
31
+ const builder = app.getService(ODataModelBuilder);
32
+ if (builder) {
33
+ builder.clean(true);
34
+ }
35
+ // extend universis api scope access configuration
36
+ if (app && app.container) {
37
+ app.container.subscribe((container) => {
38
+ if (container) {
39
+ // add extra scope access elements
40
+ const scopeAccess = app.getConfiguration().getStrategy(function ScopeAccessConfiguration() {
41
+ });
42
+ if (scopeAccess != null) {
43
+ scopeAccess.elements.unshift(...WebHookScopeAccessElements);
44
+ }
45
+ }
46
+ });
47
+ }
48
+
49
+ // configure logger
50
+ // get options from configuration
51
+ const options = Object.assign({
52
+ logLevel: 'info',
53
+ logFormat: 'raw',
54
+ logDir: path.join(process.cwd(), 'log')
55
+ }, app.getConfiguration().getSourceAt('settings/universis/webhooks'));
56
+ const logDir = options.logDir ? path.resolve(options.logDir) : path.join(process.cwd(), 'log');
57
+ const logFile = 'webhooks.log';
58
+ // create a rotating write stream
59
+ // noinspection JSValidateTypes
60
+ const logStream = createStream(logFile, {
61
+ interval: '1d', // rotate daily
62
+ path: logDir
63
+ });
64
+ this.logger = new JsonLogger({
65
+ level: options.logLevel,
66
+ format: options.logFormat,
67
+ stdout: logStream,
68
+ stderr: logStream
69
+ });
70
+ this.logger.info(`Universis WebHookService initialized with log level "${options.logLevel}"`);
71
+
72
+ if (app) {
73
+ const self = this;
74
+ setTimeout(() => {
75
+ (async () => {
76
+ await self.refresh();
77
+ })();
78
+ }, 1000);
79
+ }
80
+
81
+ }
82
+
83
+ /**
84
+ * Refresh web hook actions
85
+ * @returns {Promise<void>}
86
+ */
87
+ async refresh() {
88
+ /**
89
+ * @type {import('@themost/data').DataContext}
90
+ */
91
+ let context;
92
+ try {
93
+ // noinspection JSUnresolvedReference
94
+ context = this.getApplication().createContext();
95
+ this.logger.info('Registering existing web hook actions');
96
+ const items = await context.model('WebHookAction').asQueryable().take(-1).silent().getAllItems();
97
+ if (items.length > 0) {
98
+ this.logger.info(`Found ${items.length} web hook action(s). The operation will automatically register event listeners to the underlying data models.`);
99
+ }
100
+ for (const item of items) {
101
+ const model = context.model(item.about);
102
+ if (model) {
103
+ await new Promise((resolve, reject) => {
104
+ afterSave({ state: DataObjectState.Insert, target: item, model}, (err) => {
105
+ if (err) {
106
+ return reject(err);
107
+ }
108
+ return resolve();
109
+ });
110
+ });
111
+ } else {
112
+ this.logger.warn(`Cannot register web hook action with name "${item.name || 'unknown'}" because model "${item.about}" does not exist.`);
113
+ }
114
+ }
115
+ } catch(err) {
116
+ this.logger.error('An error occurred when registering existing web hooks');
117
+ this.logger.error(err);
118
+ } finally {
119
+ if (context) {
120
+ await context.finalizeAsync()
121
+ }
122
+ }
123
+ }
124
+
125
+ /**
126
+ *
127
+ * @param {import('@themost/data').DataModel} model
128
+ * @param {*} target
129
+ * @param {string} filter
130
+ * @param {number} state
131
+ * @returns {Promise<boolean>}
132
+ */
133
+ async filterObjectAsync(model, target, filter, state) {
134
+ const parser = new DataModelFilterParser(model);
135
+ const { $expand, $where } = await parser.parseAsync(filter)
136
+ const q = new DataQueryable(model);
137
+ Object.assign(q.query, {
138
+ $where,
139
+ $expand
140
+ });
141
+ const { primaryKey } = model;
142
+ const id = target[primaryKey];
143
+ q.prepare();
144
+ if (state !== DataObjectState.Delete) {
145
+ q.where(primaryKey).equal(id);
146
+ }
147
+ const exists = await q.count();
148
+ return (exists > 0);
149
+ }
150
+
151
+ /**
152
+ * Emit web hook events
153
+ * @param {import('@themost/data').DataEventArgs} event
154
+ * @param {{action?: string, emit?: boolean}} extraArgs
155
+ */
156
+ emit(event, extraArgs) {
157
+ const context = event.model.context;
158
+ // get previous and current state of the entity
159
+ const { previous, target, state, model } = event;
160
+ /**
161
+ * @type {import('@themost/express').ExpressDataApplication|import('@themost/common').ApplicationBase}
162
+ */
163
+ const application = context.application;
164
+ // noinspection JSUnresolvedReference
165
+ /**
166
+ * @type {import('@themost/express').ExpressDataContext|import('@themost/data').DataContext}
167
+ */
168
+ const newContext = application.createContext();
169
+ const about = model.name;
170
+ const self = this;
171
+ (async function() {
172
+ // noinspection JSUnresolvedReference
173
+ const q = newContext.model('WebHook').asQueryable().where((x, about, state) => {
174
+ // noinspection JSBitwiseOperatorUsage
175
+ return (x.action.about === about) && (x.action.state === state) && (x.active === true);
176
+ }, about, state).select((x) => {
177
+ return {
178
+ id: x.id,
179
+ config: x.config,
180
+ action: x.action,
181
+ about: x.action.about,
182
+ emit: x.emit,
183
+ username: x.owner.name,
184
+ filter: x.action.filter,
185
+ when: x.action.when
186
+ }
187
+ }).silent().take(25).skip(0);
188
+ // apply extra arguments for finding web hooks
189
+ const findArgs = Object.assign({ emit: true }, extraArgs || {});
190
+ q.prepare();
191
+ Object.keys(findArgs).forEach((key) => {
192
+ const value = findArgs[key];
193
+ q.query.$where ? q.and(key).equal(value) : q.where(key).equal(value);
194
+ });
195
+
196
+ const { viewAdapter: WebHooks } = newContext.model('WebHook');
197
+ const targetModel = newContext.model(about);
198
+ // get entity set
199
+ const builder = application.getService(ODataModelBuilder);
200
+ const entitySet = builder.getEntityTypeEntitySet(targetModel.name)
201
+ const { primaryKey: key } = targetModel;
202
+ // get origin
203
+ const origin = context.getConfiguration().getSourceAt('settings/universis/api/origin');
204
+ /**
205
+ * @type {{total: number, skip: number, value: Array<{ id: string,config: { url: string, insecure: boolean, secret?: string, contentType: string }, emit: boolean, username: string,action: string,about: string,filter: string,when: string}>}} list
206
+ */
207
+ let list = await q.getList();
208
+ if (list.total > 0) {
209
+ while (list.total >= (list.skip + list.value.length)) {
210
+ for (const item of list.value) {
211
+ // set context user
212
+ newContext.user = {
213
+ name: item.username || 'anonymous'
214
+ }
215
+ try {
216
+ let send = true;
217
+ if (state === DataObjectState.Insert) {
218
+ // validate the current state of a new object
219
+ const filter = item.when || item.filter;
220
+ send = await self.filterObjectAsync(targetModel, target, filter, state);
221
+ } else {
222
+ // validate previous state
223
+ send = await self.filterObjectAsync(targetModel, previous, item.when, state);
224
+ // validate current state
225
+ if (send && item.filter) {
226
+ if (state === DataObjectState.Delete) {
227
+ send = await self.filterObjectAsync(targetModel, previous, item.filter, state);
228
+ } else {
229
+ send = await self.filterObjectAsync(targetModel, target, item.filter, state);
230
+ }
231
+ }
232
+ }
233
+ if (send) {
234
+ self.logger.info(`Sending web hook for model "${about}" to url "${item.config.url}"`);
235
+ // send web hook request
236
+ const result = await request('post', item.config.url)
237
+ .set('Content-Type', item.config.contentType)
238
+ .send({
239
+ event: item.action,
240
+ entityType: targetModel.name,
241
+ entitySet: entitySet && entitySet.name,
242
+ origin: origin,
243
+ target: {
244
+ id: (state === DataObjectState.Insert) ? target[key] : previous[key],
245
+ }
246
+ });
247
+ const lastResponse = {
248
+ status: result.status
249
+ };
250
+ self.logger.info(`Web hook for model "${about}" to url ${item.config.url} returned status ${result.status}`);
251
+ // update last response with an ad-hoc query
252
+ await newContext.db.executeAsync(
253
+ new QueryExpression().update(WebHooks).set({
254
+ lastResponse: JSON.stringify(lastResponse),
255
+ }).where('id').equal(item.id)
256
+ , []);
257
+ } else {
258
+ self.logger.debug(`Web hook for model "${about}" and object with identifier ${target[key]} to url "${item.config.url}" was filtered and not sent`);
259
+ }
260
+ } catch (err) {
261
+ self.logger.error(`Error sending web hook for model "${about}" to url "${item.config.url}"`);
262
+ self.logger.error(err);
263
+ }
264
+ }
265
+ list = await q.take(25).skip(list.skip + list.value.length);
266
+ }
267
+ }
268
+ })();
269
+ }
270
+
271
+ }
272
+
273
+ export {
274
+ WebHookService
275
+ }