airbyte-faros-destination 0.19.47 → 0.19.49-rc0
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.
- package/lib/converters/harness/common.d.ts +6 -88
- package/lib/converters/harness/common.js +2 -2
- package/lib/converters/harness/common.js.map +1 -1
- package/lib/converters/harness/executions.d.ts +3 -7
- package/lib/converters/harness/executions.js +85 -184
- package/lib/converters/harness/executions.js.map +1 -1
- package/lib/converters/harness/organizations.d.ts +7 -0
- package/lib/converters/harness/organizations.js +29 -0
- package/lib/converters/harness/organizations.js.map +1 -0
- package/lib/converters/harness/pipelines.d.ts +7 -0
- package/lib/converters/harness/pipelines.js +29 -0
- package/lib/converters/harness/pipelines.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,102 +1,20 @@
|
|
|
1
1
|
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
-
import { ComputeApplication } from '../common/common';
|
|
3
2
|
import { Converter } from '../converter';
|
|
4
|
-
|
|
3
|
+
export { CDModuleInfo, Organization, Pipeline, PipelineExecution, } from 'faros-airbyte-common/harness';
|
|
4
|
+
export interface CICDOrganizationKey {
|
|
5
5
|
uid: string;
|
|
6
6
|
source: string;
|
|
7
7
|
}
|
|
8
|
-
interface
|
|
8
|
+
export interface CICDPipelineKey {
|
|
9
9
|
uid: string;
|
|
10
|
-
organization:
|
|
10
|
+
organization: CICDOrganizationKey;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface CICDBuildKey {
|
|
13
13
|
uid: string;
|
|
14
|
-
pipeline:
|
|
15
|
-
}
|
|
16
|
-
interface CICDRepository {
|
|
17
|
-
uid: string;
|
|
18
|
-
organization: CICDOrganization;
|
|
19
|
-
}
|
|
20
|
-
export interface CICDArtifact {
|
|
21
|
-
readonly uid: string;
|
|
22
|
-
readonly repository: CICDRepository;
|
|
23
|
-
}
|
|
24
|
-
export interface Execution {
|
|
25
|
-
uid: string;
|
|
26
|
-
application: ComputeApplication;
|
|
27
|
-
startedAt: number;
|
|
28
|
-
endedAt: number;
|
|
29
|
-
env: string;
|
|
30
|
-
status: string;
|
|
31
|
-
build: CICDBuild;
|
|
32
|
-
artifact: CICDArtifact;
|
|
33
|
-
}
|
|
34
|
-
export interface ExecutionImplementation {
|
|
35
|
-
application: ComputeApplication;
|
|
36
|
-
env: string;
|
|
37
|
-
build?: CICDBuild;
|
|
38
|
-
artifact?: CICDArtifact;
|
|
39
|
-
}
|
|
40
|
-
interface HarnessService {
|
|
41
|
-
id: string;
|
|
42
|
-
name?: string;
|
|
43
|
-
artifactType: string;
|
|
44
|
-
artifactSources: {
|
|
45
|
-
name: string;
|
|
46
|
-
}[];
|
|
47
|
-
}
|
|
48
|
-
interface HarnessEnvironment {
|
|
49
|
-
type: string;
|
|
50
|
-
name: string;
|
|
51
|
-
}
|
|
52
|
-
export interface HarnessExecutionNode {
|
|
53
|
-
id: string;
|
|
54
|
-
application: {
|
|
55
|
-
id: string;
|
|
56
|
-
name?: string;
|
|
57
|
-
services?: {
|
|
58
|
-
nodes: HarnessService[];
|
|
59
|
-
};
|
|
60
|
-
environments?: {
|
|
61
|
-
nodes: HarnessEnvironment[];
|
|
62
|
-
};
|
|
63
|
-
tags?: {
|
|
64
|
-
name: string;
|
|
65
|
-
value: string;
|
|
66
|
-
}[];
|
|
67
|
-
};
|
|
68
|
-
status: string;
|
|
69
|
-
createdAt: number;
|
|
70
|
-
startedAt: number;
|
|
71
|
-
endedAt: number;
|
|
72
|
-
artifacts?: {
|
|
73
|
-
id: string;
|
|
74
|
-
buildNo: string;
|
|
75
|
-
artifactSource: {
|
|
76
|
-
id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
};
|
|
79
|
-
}[];
|
|
80
|
-
outcomes?: {
|
|
81
|
-
nodes: {
|
|
82
|
-
service: HarnessService;
|
|
83
|
-
environment: HarnessEnvironment;
|
|
84
|
-
}[];
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export interface ExecutionWorkflow {
|
|
88
|
-
application: ComputeApplication;
|
|
89
|
-
env: string;
|
|
90
|
-
build: CICDBuild;
|
|
91
|
-
artifact: CICDArtifact;
|
|
92
|
-
}
|
|
93
|
-
export interface ExecutionPipeline {
|
|
94
|
-
application: ComputeApplication;
|
|
95
|
-
env: string;
|
|
14
|
+
pipeline: CICDPipelineKey;
|
|
96
15
|
}
|
|
97
16
|
/** Harness converter base */
|
|
98
17
|
export declare abstract class HarnessConverter extends Converter {
|
|
99
18
|
source: string;
|
|
100
19
|
id(record: AirbyteRecord): any;
|
|
101
20
|
}
|
|
102
|
-
export {};
|
|
@@ -9,8 +9,8 @@ class HarnessConverter extends converter_1.Converter {
|
|
|
9
9
|
this.source = 'Harness';
|
|
10
10
|
}
|
|
11
11
|
id(record) {
|
|
12
|
-
var _a, _b;
|
|
13
|
-
return (_b = (_a = record === null || record === void 0 ? void 0 : record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.
|
|
12
|
+
var _a, _b, _c, _d, _e;
|
|
13
|
+
return (_c = (_b = (_a = record === null || record === void 0 ? void 0 : record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.identifier) !== null && _c !== void 0 ? _c : (_e = (_d = record === null || record === void 0 ? void 0 : record.record) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.planExecutionId;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.HarnessConverter = HarnessConverter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/harness/common.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/harness/common.ts"],"names":[],"mappings":";;;AAEA,4CAAuC;AA0BvC,6BAA6B;AAC7B,MAAsB,gBAAiB,SAAQ,qBAAS;IAAxD;;QACE,WAAM,GAAG,SAAS,CAAC;IAKrB,CAAC;IAHC,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,UAAU,mCAAI,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,eAAe,CAAC;IACnF,CAAC;CACF;AAND,4CAMC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
-
import { DestinationModel, DestinationRecord
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
3
|
import { HarnessConverter } from './common';
|
|
4
4
|
export declare class Executions extends HarnessConverter {
|
|
5
5
|
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
6
|
private seenApplications;
|
|
7
|
-
convert(record: AirbyteRecord
|
|
8
|
-
private parseArtifactFromTags;
|
|
9
|
-
private parseWorkflow;
|
|
10
|
-
private parsePipeline;
|
|
7
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
11
8
|
private toBuildStatus;
|
|
12
|
-
private toEnvironmentStatus;
|
|
13
|
-
private toExecution;
|
|
14
9
|
private toDeploymentStatus;
|
|
10
|
+
private toEnvironment;
|
|
15
11
|
}
|
|
@@ -4,237 +4,138 @@ exports.Executions = void 0;
|
|
|
4
4
|
const faros_js_client_1 = require("faros-js-client");
|
|
5
5
|
const common_1 = require("../common/common");
|
|
6
6
|
const common_2 = require("./common");
|
|
7
|
-
const DEFAULT_CICD_ORGANIZATION_UID = 'default';
|
|
8
|
-
const DEFAULT_EXECUTION_TAG_APPLICATION_PLATFORM = 'faros_app_platform';
|
|
9
|
-
const DEFAULT_EXECUTION_TAG_ARTIFACT_ORG = 'faros_artifact_org';
|
|
10
|
-
const DEFAULT_EXECUTION_TAG_ARTIFACT_SOURCE = 'faros_artifact_source';
|
|
11
|
-
const DEFAULT_EXECUTION_TAG_ARTIFACT_REPO = 'faros_artifact_repo';
|
|
12
7
|
class Executions extends common_2.HarnessConverter {
|
|
13
8
|
constructor() {
|
|
14
9
|
super(...arguments);
|
|
15
10
|
this.destinationModels = [
|
|
16
|
-
'cicd_ArtifactDeployment',
|
|
17
11
|
'cicd_Build',
|
|
18
12
|
'cicd_Deployment',
|
|
19
13
|
'compute_Application',
|
|
20
14
|
];
|
|
21
15
|
this.seenApplications = new Set();
|
|
22
16
|
}
|
|
23
|
-
async convert(record
|
|
24
|
-
var _a, _b;
|
|
25
|
-
const executionRaw = record.record.data;
|
|
17
|
+
async convert(record) {
|
|
18
|
+
var _a, _b, _c, _d;
|
|
26
19
|
const source = this.streamName.source;
|
|
20
|
+
const execution = record.record.data;
|
|
27
21
|
const res = [];
|
|
28
|
-
const
|
|
22
|
+
const cdInfo = (_a = execution.moduleInfo) === null || _a === void 0 ? void 0 : _a.cd;
|
|
23
|
+
if (!cdInfo) {
|
|
24
|
+
return res;
|
|
25
|
+
}
|
|
26
|
+
// Build key
|
|
27
|
+
const build = {
|
|
28
|
+
uid: execution.planExecutionId,
|
|
29
|
+
pipeline: {
|
|
30
|
+
uid: execution.pipelineIdentifier,
|
|
31
|
+
organization: { uid: execution.orgIdentifier, source },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
// Build (pipeline execution)
|
|
35
|
+
res.push({
|
|
36
|
+
model: 'cicd_Build',
|
|
37
|
+
record: {
|
|
38
|
+
...build,
|
|
39
|
+
name: execution.name,
|
|
40
|
+
startedAt: faros_js_client_1.Utils.toDate(execution.startTs),
|
|
41
|
+
endedAt: faros_js_client_1.Utils.toDate(execution.endTs),
|
|
42
|
+
status: this.toBuildStatus(execution.status),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
// Application (from service)
|
|
46
|
+
const serviceName = (_b = cdInfo.serviceIdentifiers) === null || _b === void 0 ? void 0 : _b[0];
|
|
29
47
|
let application = null;
|
|
30
|
-
if (
|
|
31
|
-
application = common_1.Common.computeApplication(
|
|
48
|
+
if (serviceName) {
|
|
49
|
+
application = common_1.Common.computeApplication(serviceName, '');
|
|
32
50
|
const appKey = application.uid;
|
|
33
51
|
if (!this.seenApplications.has(appKey)) {
|
|
34
52
|
res.push({ model: 'compute_Application', record: application });
|
|
35
53
|
this.seenApplications.add(appKey);
|
|
36
54
|
}
|
|
37
55
|
}
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
56
|
+
// Deployment
|
|
57
|
+
const envName = (_c = cdInfo.envIdentifiers) === null || _c === void 0 ? void 0 : _c[0];
|
|
58
|
+
const envType = (_d = cdInfo.environmentTypes) === null || _d === void 0 ? void 0 : _d[0];
|
|
41
59
|
res.push({
|
|
42
60
|
model: 'cicd_Deployment',
|
|
43
61
|
record: {
|
|
44
|
-
|
|
62
|
+
uid: execution.planExecutionId,
|
|
63
|
+
source,
|
|
45
64
|
application,
|
|
46
|
-
build
|
|
47
|
-
startedAt: faros_js_client_1.Utils.toDate(execution.
|
|
48
|
-
endedAt: faros_js_client_1.Utils.toDate(execution.
|
|
49
|
-
env: this.
|
|
50
|
-
status:
|
|
65
|
+
build,
|
|
66
|
+
startedAt: faros_js_client_1.Utils.toDate(execution.startTs),
|
|
67
|
+
endedAt: faros_js_client_1.Utils.toDate(execution.endTs),
|
|
68
|
+
env: this.toEnvironment(envName, envType),
|
|
69
|
+
status: this.toDeploymentStatus(execution.status),
|
|
51
70
|
},
|
|
52
71
|
});
|
|
53
|
-
if (execution.build) {
|
|
54
|
-
res.push({
|
|
55
|
-
model: 'cicd_Build',
|
|
56
|
-
record: {
|
|
57
|
-
...execution.build,
|
|
58
|
-
startedAt: faros_js_client_1.Utils.toDate(execution.startedAt),
|
|
59
|
-
endedAt: faros_js_client_1.Utils.toDate(execution.endedAt),
|
|
60
|
-
status: buildStatus,
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (execution.artifact) {
|
|
65
|
-
res.push({
|
|
66
|
-
model: 'cicd_ArtifactDeployment',
|
|
67
|
-
record: {
|
|
68
|
-
artifact: execution.artifact,
|
|
69
|
-
deployment,
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
72
|
return res;
|
|
74
73
|
}
|
|
75
|
-
parseArtifactFromTags(execution) {
|
|
76
|
-
var _a, _b, _c, _d;
|
|
77
|
-
if (!execution.artifacts || !execution.artifacts.length) {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const executionArtifact = execution.artifacts[0];
|
|
81
|
-
// artifact repo organization pulled from application tags
|
|
82
|
-
const organization = {
|
|
83
|
-
uid: (_a = execution.application.tags.find((t) => t.name === DEFAULT_EXECUTION_TAG_ARTIFACT_ORG)) === null || _a === void 0 ? void 0 : _a.value,
|
|
84
|
-
source: (_c = (_b = execution.application.tags.find((t) => t.name === DEFAULT_EXECUTION_TAG_ARTIFACT_SOURCE)) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : executionArtifact === null || executionArtifact === void 0 ? void 0 : executionArtifact.artifactSource.name,
|
|
85
|
-
};
|
|
86
|
-
const repository = {
|
|
87
|
-
uid: (_d = execution.application.tags.find((t) => t.name === DEFAULT_EXECUTION_TAG_ARTIFACT_REPO)) === null || _d === void 0 ? void 0 : _d.value,
|
|
88
|
-
organization,
|
|
89
|
-
};
|
|
90
|
-
const artifact = {
|
|
91
|
-
uid: executionArtifact === null || executionArtifact === void 0 ? void 0 : executionArtifact.buildNo,
|
|
92
|
-
repository,
|
|
93
|
-
};
|
|
94
|
-
if (artifact.uid &&
|
|
95
|
-
artifact.repository.uid &&
|
|
96
|
-
artifact.repository.organization.uid &&
|
|
97
|
-
artifact.repository.organization.source) {
|
|
98
|
-
return artifact;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
parseWorkflow(execution, source) {
|
|
105
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
106
|
-
const outcome = (_a = execution.outcomes) === null || _a === void 0 ? void 0 : _a.nodes.find((o) => { var _a; return (_a = o.service) === null || _a === void 0 ? void 0 : _a.artifactType; });
|
|
107
|
-
if (!outcome) {
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
const artifactSource = outcome.service.artifactSources.find((a) => a.name);
|
|
111
|
-
if (!artifactSource) {
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
114
|
-
const build = {
|
|
115
|
-
uid: execution.id,
|
|
116
|
-
pipeline: {
|
|
117
|
-
uid: (_c = (_b = outcome.service.name) !== null && _b !== void 0 ? _b : execution.application.name) !== null && _c !== void 0 ? _c : artifactSource.name,
|
|
118
|
-
organization: {
|
|
119
|
-
uid: DEFAULT_CICD_ORGANIZATION_UID,
|
|
120
|
-
source,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
let artifact = undefined;
|
|
125
|
-
// artifact computation needs to have application tags
|
|
126
|
-
if (execution.application.tags) {
|
|
127
|
-
artifact = this.parseArtifactFromTags(execution);
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
application: common_1.Common.computeApplication((_d = execution.application.name) !== null && _d !== void 0 ? _d : artifactSource.name, (_g = (_f = (_e = execution.application.tags) === null || _e === void 0 ? void 0 : _e.find((t) => t.name === DEFAULT_EXECUTION_TAG_APPLICATION_PLATFORM)) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : ''),
|
|
131
|
-
env: (_h = outcome.environment.name) !== null && _h !== void 0 ? _h : outcome.environment.type,
|
|
132
|
-
build,
|
|
133
|
-
artifact,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
parsePipeline(execution) {
|
|
137
|
-
var _a, _b, _c;
|
|
138
|
-
const service = (_a = execution.application.services) === null || _a === void 0 ? void 0 : _a.nodes.find((s) => s.artifactType);
|
|
139
|
-
if (!service) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const artifactSource = service.artifactSources.find((a) => a.name);
|
|
143
|
-
const environment = (_b = execution.application.environments) === null || _b === void 0 ? void 0 : _b.nodes.find((e) => e.type);
|
|
144
|
-
if (!artifactSource || !environment) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
return {
|
|
148
|
-
application: common_1.Common.computeApplication(artifactSource.name, service.artifactType),
|
|
149
|
-
env: (_c = environment.name) !== null && _c !== void 0 ? _c : environment.type,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
74
|
toBuildStatus(status) {
|
|
153
|
-
const
|
|
154
|
-
switch (
|
|
155
|
-
case '
|
|
156
|
-
case 'rejected':
|
|
75
|
+
const statusUpper = status === null || status === void 0 ? void 0 : status.toUpperCase();
|
|
76
|
+
switch (statusUpper) {
|
|
77
|
+
case 'ABORTED':
|
|
157
78
|
return { category: 'Canceled', detail: status };
|
|
158
|
-
case '
|
|
159
|
-
case '
|
|
160
|
-
case 'failed':
|
|
79
|
+
case 'EXPIRED':
|
|
80
|
+
case 'FAILED':
|
|
161
81
|
return { category: 'Failed', detail: status };
|
|
162
|
-
case '
|
|
163
|
-
case '
|
|
164
|
-
case '
|
|
82
|
+
case 'QUEUED':
|
|
83
|
+
case 'PAUSED':
|
|
84
|
+
case 'WAITING':
|
|
85
|
+
case 'APPROVALWAITING':
|
|
86
|
+
case 'ASYNCWAITING':
|
|
87
|
+
case 'TASKWAITING':
|
|
88
|
+
case 'TIMEDWAITING':
|
|
165
89
|
return { category: 'Queued', detail: status };
|
|
166
|
-
case '
|
|
167
|
-
case 'running':
|
|
90
|
+
case 'RUNNING':
|
|
168
91
|
return { category: 'Running', detail: status };
|
|
169
|
-
case '
|
|
92
|
+
case 'SUCCESS':
|
|
170
93
|
return { category: 'Success', detail: status };
|
|
171
|
-
case 'skipped':
|
|
172
94
|
default:
|
|
173
95
|
return { category: 'Custom', detail: status };
|
|
174
96
|
}
|
|
175
97
|
}
|
|
176
|
-
toEnvironmentStatus(status) {
|
|
177
|
-
const statusLower = status.toLowerCase();
|
|
178
|
-
if (statusLower.startsWith('prod')) {
|
|
179
|
-
return { category: 'Prod', detail: status };
|
|
180
|
-
}
|
|
181
|
-
if (statusLower === 'staging') {
|
|
182
|
-
return { category: 'Staging', detail: status };
|
|
183
|
-
}
|
|
184
|
-
if (statusLower.startsWith('dev')) {
|
|
185
|
-
return { category: 'Dev', detail: status };
|
|
186
|
-
}
|
|
187
|
-
if (statusLower === 'qa') {
|
|
188
|
-
return { category: 'QA', detail: status };
|
|
189
|
-
}
|
|
190
|
-
return { category: 'Custom', detail: status };
|
|
191
|
-
}
|
|
192
|
-
toExecution(item, source) {
|
|
193
|
-
let implementation;
|
|
194
|
-
if (item.outcomes) {
|
|
195
|
-
implementation = this.parseWorkflow(item, source);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
implementation = this.parsePipeline(item);
|
|
199
|
-
}
|
|
200
|
-
if (!implementation) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
return {
|
|
204
|
-
uid: item.id,
|
|
205
|
-
application: implementation.application,
|
|
206
|
-
startedAt: item.startedAt,
|
|
207
|
-
endedAt: item.endedAt,
|
|
208
|
-
env: implementation.env,
|
|
209
|
-
status: item.status,
|
|
210
|
-
build: implementation.build,
|
|
211
|
-
artifact: implementation.artifact,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
98
|
toDeploymentStatus(status) {
|
|
215
|
-
const
|
|
216
|
-
switch (
|
|
217
|
-
case '
|
|
218
|
-
case 'rejected':
|
|
99
|
+
const statusUpper = status === null || status === void 0 ? void 0 : status.toUpperCase();
|
|
100
|
+
switch (statusUpper) {
|
|
101
|
+
case 'ABORTED':
|
|
219
102
|
return { category: 'Canceled', detail: status };
|
|
220
|
-
case '
|
|
221
|
-
case '
|
|
222
|
-
case 'failed':
|
|
103
|
+
case 'EXPIRED':
|
|
104
|
+
case 'FAILED':
|
|
223
105
|
return { category: 'Failed', detail: status };
|
|
224
|
-
case '
|
|
225
|
-
case '
|
|
226
|
-
case '
|
|
106
|
+
case 'QUEUED':
|
|
107
|
+
case 'PAUSED':
|
|
108
|
+
case 'WAITING':
|
|
109
|
+
case 'APPROVALWAITING':
|
|
110
|
+
case 'ASYNCWAITING':
|
|
111
|
+
case 'TASKWAITING':
|
|
112
|
+
case 'TIMEDWAITING':
|
|
227
113
|
return { category: 'Queued', detail: status };
|
|
228
|
-
case '
|
|
229
|
-
case 'running':
|
|
114
|
+
case 'RUNNING':
|
|
230
115
|
return { category: 'Running', detail: status };
|
|
231
|
-
case '
|
|
116
|
+
case 'SUCCESS':
|
|
232
117
|
return { category: 'Success', detail: status };
|
|
233
|
-
case 'skipped':
|
|
234
118
|
default:
|
|
235
119
|
return { category: 'Custom', detail: status };
|
|
236
120
|
}
|
|
237
121
|
}
|
|
122
|
+
toEnvironment(envName, envType) {
|
|
123
|
+
const env = envName || envType || 'unknown';
|
|
124
|
+
const envLower = env.toLowerCase();
|
|
125
|
+
if (envLower.includes('prod')) {
|
|
126
|
+
return { category: 'Prod', detail: env };
|
|
127
|
+
}
|
|
128
|
+
if (envLower.includes('staging')) {
|
|
129
|
+
return { category: 'Staging', detail: env };
|
|
130
|
+
}
|
|
131
|
+
if (envLower.includes('dev')) {
|
|
132
|
+
return { category: 'Dev', detail: env };
|
|
133
|
+
}
|
|
134
|
+
if (envLower.includes('qa') || envLower.includes('test')) {
|
|
135
|
+
return { category: 'QA', detail: env };
|
|
136
|
+
}
|
|
137
|
+
return { category: 'Custom', detail: env };
|
|
138
|
+
}
|
|
238
139
|
}
|
|
239
140
|
exports.Executions = Executions;
|
|
240
141
|
//# sourceMappingURL=executions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/converters/harness/executions.ts"],"names":[],"mappings":";;;AACA,qDAAsC;AAEtC,6CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"executions.js","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AC,CAAC;QACvC,CAAC;QAED,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAC,CAAC;IAC3C,CAAC;CACF;AAvJD,gCAuJC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { HarnessConverter } from './common';
|
|
4
|
+
export declare class Organizations extends HarnessConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Organizations = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class Organizations extends common_1.HarnessConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = [
|
|
9
|
+
'cicd_Organization',
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
async convert(record) {
|
|
13
|
+
const source = this.streamName.source;
|
|
14
|
+
const org = record.record.data;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
model: 'cicd_Organization',
|
|
18
|
+
record: {
|
|
19
|
+
uid: org.identifier,
|
|
20
|
+
name: org.name,
|
|
21
|
+
description: org.description,
|
|
22
|
+
source,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Organizations = Organizations;
|
|
29
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../../src/converters/harness/organizations.ts"],"names":[],"mappings":";;;AAGA,qCAAwD;AAExD,MAAa,aAAc,SAAQ,yBAAgB;IAAnD;;QACW,sBAAiB,GAAoC;YAC5D,mBAAmB;SACpB,CAAC;IAoBJ,CAAC;IAlBC,KAAK,CAAC,OAAO,CACX,MAAqB;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAoB,CAAC;QAE/C,OAAO;YACL;gBACE,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE;oBACN,GAAG,EAAE,GAAG,CAAC,UAAU;oBACnB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,WAAW,EAAE,GAAG,CAAC,WAAW;oBAC5B,MAAM;iBACP;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAvBD,sCAuBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { HarnessConverter } from './common';
|
|
4
|
+
export declare class Pipelines extends HarnessConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Pipelines = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class Pipelines extends common_1.HarnessConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = [
|
|
9
|
+
'cicd_Pipeline',
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
async convert(record) {
|
|
13
|
+
const source = this.streamName.source;
|
|
14
|
+
const pipeline = record.record.data;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
model: 'cicd_Pipeline',
|
|
18
|
+
record: {
|
|
19
|
+
uid: pipeline.identifier,
|
|
20
|
+
name: pipeline.name,
|
|
21
|
+
description: pipeline.description,
|
|
22
|
+
organization: { uid: pipeline.orgIdentifier, source },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Pipelines = Pipelines;
|
|
29
|
+
//# sourceMappingURL=pipelines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelines.js","sourceRoot":"","sources":["../../../src/converters/harness/pipelines.ts"],"names":[],"mappings":";;;AAGA,qCAAoD;AAEpD,MAAa,SAAU,SAAQ,yBAAgB;IAA/C;;QACW,sBAAiB,GAAoC;YAC5D,eAAe;SAChB,CAAC;IAoBJ,CAAC;IAlBC,KAAK,CAAC,OAAO,CACX,MAAqB;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAgB,CAAC;QAEhD,OAAO;YACL;gBACE,KAAK,EAAE,eAAe;gBACtB,MAAM,EAAE;oBACN,GAAG,EAAE,QAAQ,CAAC,UAAU;oBACxB,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;oBACjC,YAAY,EAAE,EAAC,GAAG,EAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAC;iBACpD;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAvBD,8BAuBC"}
|