fase(16): integrations module

This commit is contained in:
Claude
2026-03-06 07:22:00 -05:00
committed by debian
parent cffa1aeea9
commit 1f1678af17
49 changed files with 2558 additions and 13 deletions

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IntegrationType = void 0;
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
class IntegrationType extends ValueObject_1.ValueObject {
get value() { return this.props.value; }
static fromString(s) {
if (s === 'jira' || s === 'slack' || s === 'github' || s === 'webhook') {
return new IntegrationType({ value: s });
}
throw new Error(`Invalid integration type: ${s}`);
}
static jira() { return new IntegrationType({ value: 'jira' }); }
static slack() { return new IntegrationType({ value: 'slack' }); }
static github() { return new IntegrationType({ value: 'github' }); }
static webhook() { return new IntegrationType({ value: 'webhook' }); }
}
exports.IntegrationType = IntegrationType;

View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebhookSecret = void 0;
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
const crypto_1 = require("crypto");
class WebhookSecret extends ValueObject_1.ValueObject {
get value() { return this.props.value; }
static generate() {
const secret = (0, crypto_1.randomBytes)(32).toString('hex');
return new WebhookSecret({ value: secret });
}
static fromString(s) {
if (!s || s.length < 16)
throw new Error('Webhook secret must be at least 16 characters');
return new WebhookSecret({ value: s });
}
sign(payload) {
return (0, crypto_1.createHmac)('sha256', this.props.value).update(payload).digest('hex');
}
}
exports.WebhookSecret = WebhookSecret;