@skriptfabrik/n8n-nodes-sentry-io-enhanced
Version:
Enhanced Sentry.io community nodes for n8n
52 lines • 1.81 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.SentryIoDSNApi = void 0;
const tslib_1 = require("tslib");
const crypto = require("crypto");
class SentryIoDSNApi {
constructor() {
this.name = 'sentryIoDSNApi';
this.displayName = 'Sentry.io DSN';
this.documentationUrl = 'https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/';
this.properties = [
{
displayName: 'Project ID',
name: 'projectId',
required: true,
type: 'string',
default: undefined,
},
{
displayName: 'DSN',
name: 'dsn',
required: true,
type: 'string',
typeOptions: { password: true },
default: undefined,
},
];
}
authenticate(credentials, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const envelopeHeader = JSON.stringify({
dsn: credentials['dsn'],
sdk: {
name: 'skriptfabrik.javascript.n8n',
version: '0.1.0',
},
sent_at: new Date().toISOString(),
event_id: crypto.randomUUID(),
});
return Object.assign(requestOptions, {
baseURL: 'https://sentry.io',
method: 'POST',
headers: {
'content-type': 'application/x-sentry-envelope',
},
body: `${envelopeHeader}\n${requestOptions.body}`,
});
});
}
}
exports.SentryIoDSNApi = SentryIoDSNApi;
//# sourceMappingURL=SentryIoDSNApi.credentials.js.map
;