airbyte-faros-destination 0.16.50 → 0.17.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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { JiraConverter } from './common';
|
|
4
|
+
export declare class FarosAuditEvents extends JiraConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
private createDeletionRecord;
|
|
8
|
+
private extractIssueKey;
|
|
9
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FarosAuditEvents = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class FarosAuditEvents extends common_1.JiraConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = [];
|
|
9
|
+
}
|
|
10
|
+
async convert(record, ctx) {
|
|
11
|
+
var _a;
|
|
12
|
+
const auditRecord = record.record.data;
|
|
13
|
+
const source = this.initializeSource(ctx);
|
|
14
|
+
// Only process ISSUE_DELETE events
|
|
15
|
+
if (((_a = auditRecord.objectItem) === null || _a === void 0 ? void 0 : _a.typeName) !== 'ISSUE_DELETE') {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const issueKey = this.extractIssueKey(auditRecord);
|
|
19
|
+
if (!issueKey) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
const taskReference = { uid: issueKey, source };
|
|
23
|
+
const models = [
|
|
24
|
+
{ model: 'tms_TaskAssignment__Deletion', where: { task: taskReference } },
|
|
25
|
+
{ model: 'tms_TaskDependency__Deletion', where: { dependentTask: taskReference } },
|
|
26
|
+
{ model: 'tms_TaskDependency__Deletion', where: { fulfillingTask: taskReference } },
|
|
27
|
+
{ model: 'tms_TaskProjectRelationship__Deletion', where: { task: taskReference } },
|
|
28
|
+
{ model: 'tms_TaskBoardRelationship__Deletion', where: { task: taskReference } },
|
|
29
|
+
{ model: 'tms_TaskPullRequestAssociation__Deletion', where: { task: taskReference } },
|
|
30
|
+
{ model: 'tms_TaskReleaseRelationship__Deletion', where: { task: taskReference } },
|
|
31
|
+
{ model: 'tms_TaskTag__Deletion', where: { task: taskReference } },
|
|
32
|
+
{ model: 'tms_SprintHistory__Deletion', where: { task: taskReference } },
|
|
33
|
+
{ model: 'tms_SprintReport__Deletion', where: { sprintHistory: { task: taskReference } } },
|
|
34
|
+
{ model: 'tms_Epic__Deletion', where: taskReference },
|
|
35
|
+
{ model: 'tms_Task__Deletion', where: taskReference }, // Main task
|
|
36
|
+
];
|
|
37
|
+
return models.map(({ model, where }) => this.createDeletionRecord(model, where));
|
|
38
|
+
}
|
|
39
|
+
createDeletionRecord(model, where) {
|
|
40
|
+
return {
|
|
41
|
+
model,
|
|
42
|
+
record: {
|
|
43
|
+
flushRequired: false,
|
|
44
|
+
where,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
extractIssueKey(auditRecord) {
|
|
49
|
+
var _a;
|
|
50
|
+
return (_a = auditRecord.objectItem) === null || _a === void 0 ? void 0 : _a.name;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.FarosAuditEvents = FarosAuditEvents;
|
|
54
|
+
//# sourceMappingURL=faros_audit_events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faros_audit_events.js","sourceRoot":"","sources":["../../../src/converters/jira/faros_audit_events.ts"],"names":[],"mappings":";;;AAIA,qCAAuC;AAEvC,MAAa,gBAAiB,SAAQ,sBAAa;IAAnD;;QACW,sBAAiB,GAAoC,EAAE,CAAC;IAqDn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