@n8n/task-runner 1.10.0 → 1.11.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.
@@ -1,111 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.ErrorReporter = void 0;
37
- const node_1 = require("@sentry/node");
38
- const a = __importStar(require("assert/strict"));
39
- const crypto_1 = require("crypto");
40
- const n8n_workflow_1 = require("n8n-workflow");
41
- class ErrorReporter {
42
- get dsn() {
43
- return this.sentryConfig.sentryDsn;
44
- }
45
- constructor(sentryConfig) {
46
- this.sentryConfig = sentryConfig;
47
- this.isInitialized = false;
48
- this.seenErrors = new Set();
49
- a.ok(this.dsn, 'Sentry DSN is required to initialize Sentry');
50
- }
51
- async start() {
52
- if (this.isInitialized)
53
- return;
54
- Error.stackTraceLimit = 50;
55
- process.on('uncaughtException', node_1.captureException);
56
- const ENABLED_INTEGRATIONS = [
57
- 'InboundFilters',
58
- 'FunctionToString',
59
- 'LinkedErrors',
60
- 'OnUnhandledRejection',
61
- 'ContextLines',
62
- ];
63
- (0, node_1.setTag)('server_type', 'task_runner');
64
- (0, node_1.init)({
65
- dsn: this.dsn,
66
- release: this.sentryConfig.n8nVersion,
67
- environment: this.sentryConfig.environment,
68
- enableTracing: false,
69
- serverName: this.sentryConfig.deploymentName,
70
- beforeBreadcrumb: () => null,
71
- beforeSend: async (event, hint) => await this.beforeSend(event, hint),
72
- integrations: (integrations) => [
73
- ...integrations.filter(({ name }) => ENABLED_INTEGRATIONS.includes(name)),
74
- (0, node_1.rewriteFramesIntegration)({ root: process.cwd() }),
75
- ],
76
- });
77
- this.isInitialized = true;
78
- }
79
- async stop() {
80
- if (!this.isInitialized) {
81
- return;
82
- }
83
- await (0, node_1.close)(1000);
84
- }
85
- async beforeSend(event, { originalException }) {
86
- if (!originalException)
87
- return null;
88
- if (originalException instanceof Promise) {
89
- originalException = await originalException.catch((error) => error);
90
- }
91
- if (originalException instanceof n8n_workflow_1.ApplicationError) {
92
- const { level, extra, tags } = originalException;
93
- if (level === 'warning')
94
- return null;
95
- event.level = level;
96
- if (extra)
97
- event.extra = { ...event.extra, ...extra };
98
- if (tags)
99
- event.tags = { ...event.tags, ...tags };
100
- }
101
- if (originalException instanceof Error && originalException.stack) {
102
- const eventHash = (0, crypto_1.createHash)('sha1').update(originalException.stack).digest('base64');
103
- if (this.seenErrors.has(eventHash))
104
- return null;
105
- this.seenErrors.add(eventHash);
106
- }
107
- return event;
108
- }
109
- }
110
- exports.ErrorReporter = ErrorReporter;
111
- //# sourceMappingURL=error-reporter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-reporter.js","sourceRoot":"","sources":["../src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