airbyte-faros-destination 0.19.57-rc4 → 0.19.57-rc6
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/azure-tfvc/changesets.d.ts +0 -3
- package/lib/converters/azure-tfvc/changesets.js +27 -72
- package/lib/converters/azure-tfvc/changesets.js.map +1 -1
- package/lib/converters/azure-tfvc/common.d.ts +0 -4
- package/lib/converters/azure-tfvc/common.js +0 -10
- package/lib/converters/azure-tfvc/common.js.map +1 -1
- package/lib/converters/azure-workitems/workitems.js +6 -10
- package/lib/converters/azure-workitems/workitems.js.map +1 -1
- package/lib/converters/github/faros_pull_requests.js +22 -28
- package/lib/converters/github/faros_pull_requests.js.map +1 -1
- package/lib/converters/github/review_comments.js +1 -4
- package/lib/converters/github/review_comments.js.map +1 -1
- 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 +6 -7
- package/lib/converters/harness/executions.js +143 -170
- 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 +5 -3
- package/lib/converters/azure-tfvc/users.d.ts +0 -7
- package/lib/converters/azure-tfvc/users.js +0 -56
- package/lib/converters/azure-tfvc/users.js.map +0 -1
- package/lib/converters/github/faros_stats.d.ts +0 -10
- package/lib/converters/github/faros_stats.js +0 -107
- package/lib/converters/github/faros_stats.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airbyte-faros-destination",
|
|
3
|
-
"version": "0.19.57-
|
|
3
|
+
"version": "0.19.57-rc6",
|
|
4
4
|
"description": "Faros Destination for Airbyte",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airbyte",
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
"ajv-formats": "^2.1.1",
|
|
37
37
|
"csv-parse": "^6.1.0",
|
|
38
38
|
"date-format": "^4.0.6",
|
|
39
|
-
"faros-airbyte-cdk": "0.19.57-
|
|
40
|
-
"faros-airbyte-common": "0.19.57-
|
|
39
|
+
"faros-airbyte-cdk": "0.19.57-rc6",
|
|
40
|
+
"faros-airbyte-common": "0.19.57-rc6",
|
|
41
41
|
"fs-extra": "^11.2.0",
|
|
42
42
|
"git-url-parse": "^13.1.0",
|
|
43
43
|
"graphql": "^16.8.1",
|
|
44
44
|
"http-proxy-agent": "^7.0.2",
|
|
45
45
|
"https-proxy-agent": "^7.0.6",
|
|
46
|
+
"js-yaml": "^4.1.0",
|
|
46
47
|
"json-to-graphql-query": "^2.2.0",
|
|
47
48
|
"jsonata": "^1.8.7",
|
|
48
49
|
"object-sizeof": "^1.6.1",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/jest": "^29.5.12",
|
|
60
|
+
"@types/js-yaml": "^4.0.9",
|
|
59
61
|
"@types/node": "^20.14.11",
|
|
60
62
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
61
63
|
"@typescript-eslint/parser": "^6.21.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
-
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
-
import { AzureTfvcConverter } from './common';
|
|
4
|
-
export declare class Users extends AzureTfvcConverter {
|
|
5
|
-
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
-
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Users = void 0;
|
|
4
|
-
const azure_devops_1 = require("faros-airbyte-common/azure-devops");
|
|
5
|
-
const azure_devops_2 = require("../common/azure-devops");
|
|
6
|
-
const vcs_1 = require("../common/vcs");
|
|
7
|
-
const common_1 = require("./common");
|
|
8
|
-
class Users extends common_1.AzureTfvcConverter {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.destinationModels = [
|
|
12
|
-
'vcs_Membership',
|
|
13
|
-
'vcs_User',
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
async convert(record, ctx) {
|
|
17
|
-
var _a, _b, _c;
|
|
18
|
-
const source = this.streamName.source;
|
|
19
|
-
const userItem = record.record.data;
|
|
20
|
-
const uniqueName = (0, azure_devops_1.getUserIdentifier)(userItem);
|
|
21
|
-
if (!uniqueName) {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
const url = (_c = (_b = (_a = userItem._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : userItem.url;
|
|
25
|
-
const organizationName = (0, azure_devops_2.getOrganization)(ctx, url, 1);
|
|
26
|
-
const organization = this.getOrgKey(organizationName);
|
|
27
|
-
const type = {
|
|
28
|
-
category: vcs_1.UserTypeCategory.User,
|
|
29
|
-
detail: 'subjectKind' in userItem ? userItem.subjectKind : null,
|
|
30
|
-
};
|
|
31
|
-
const uid = uniqueName.toLowerCase();
|
|
32
|
-
this.uidsFromUsersStream.add(uid);
|
|
33
|
-
return [
|
|
34
|
-
{
|
|
35
|
-
model: 'vcs_Membership',
|
|
36
|
-
record: {
|
|
37
|
-
organization,
|
|
38
|
-
user: { uid, source },
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
model: 'vcs_User',
|
|
43
|
-
record: {
|
|
44
|
-
uid,
|
|
45
|
-
name: userItem.displayName,
|
|
46
|
-
email: 'mailAddress' in userItem ? userItem.mailAddress : undefined,
|
|
47
|
-
type,
|
|
48
|
-
htmlUrl: userItem.url,
|
|
49
|
-
source,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.Users = Users;
|
|
56
|
-
//# sourceMappingURL=users.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/converters/azure-tfvc/users.ts"],"names":[],"mappings":";;;AACA,oEAA0E;AAE1E,yDAAuD;AAEvD,uCAA+C;AAE/C,qCAA4C;AAE5C,MAAa,KAAM,SAAQ,2BAAkB;IAA7C;;QACW,sBAAiB,GAAoC;YAC5D,gBAAgB;YAChB,UAAU;SACX,CAAC;IA8CJ,CAAC;IA5CC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;;QAElB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAY,CAAC;QAE5C,MAAM,UAAU,GAAG,IAAA,gCAAiB,EAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,GAAG,GAAG,MAAA,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAE,IAAI,0CAAE,IAAI,mCAAI,QAAQ,CAAC,GAAG,CAAC;QACxD,MAAM,gBAAgB,GAAG,IAAA,8BAAe,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACtD,MAAM,IAAI,GAAmB;YAC3B,QAAQ,EAAE,sBAAgB,CAAC,IAAI;YAC/B,MAAM,EAAE,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;SAChE,CAAC;QAEF,MAAM,GAAG,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QACrC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAElC,OAAO;YACL;gBACE,KAAK,EAAE,gBAAgB;gBACvB,MAAM,EAAE;oBACN,YAAY;oBACZ,IAAI,EAAE,EAAC,GAAG,EAAE,MAAM,EAAC;iBACpB;aACF;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE;oBACN,GAAG;oBACH,IAAI,EAAE,QAAQ,CAAC,WAAW;oBAC1B,KAAK,EAAE,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;oBACnE,IAAI;oBACJ,OAAO,EAAE,QAAQ,CAAC,GAAG;oBACrB,MAAM;iBACP;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAlDD,sBAkDC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
-
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
-
import { GitHubConverter } from './common';
|
|
4
|
-
export declare class FarosStats extends GitHubConverter {
|
|
5
|
-
private readonly seenDefinitions;
|
|
6
|
-
private readonly seenTags;
|
|
7
|
-
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
8
|
-
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
9
|
-
private getMetricName;
|
|
10
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FarosStats = void 0;
|
|
4
|
-
const github_1 = require("faros-airbyte-common/github");
|
|
5
|
-
const faros_js_client_1 = require("faros-js-client");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
const common_1 = require("./common");
|
|
8
|
-
class FarosStats extends common_1.GitHubConverter {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.seenDefinitions = new Set();
|
|
12
|
-
this.seenTags = new Set();
|
|
13
|
-
this.destinationModels = [
|
|
14
|
-
'faros_MetricDefinition',
|
|
15
|
-
'faros_MetricValue',
|
|
16
|
-
'faros_MetricValueTag',
|
|
17
|
-
'faros_Tag',
|
|
18
|
-
'vcs_RepositoryMetric',
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
async convert(record, ctx) {
|
|
22
|
-
const stats = record.record.data;
|
|
23
|
-
const results = [];
|
|
24
|
-
const source = this.streamName.source;
|
|
25
|
-
const definitionUid = stats.type;
|
|
26
|
-
const metricValueUid = (0, lodash_1.toLower)(`${source}/${stats.org}/${stats.repo}/${stats.type}/`).concat(`${stats.start_timestamp}`);
|
|
27
|
-
const metricValueRef = {
|
|
28
|
-
definition: { uid: definitionUid },
|
|
29
|
-
uid: metricValueUid,
|
|
30
|
-
};
|
|
31
|
-
// Write MetricDefinition once per type
|
|
32
|
-
if (!this.seenDefinitions.has(definitionUid)) {
|
|
33
|
-
this.seenDefinitions.add(definitionUid);
|
|
34
|
-
results.push({
|
|
35
|
-
model: 'faros_MetricDefinition',
|
|
36
|
-
record: {
|
|
37
|
-
uid: definitionUid,
|
|
38
|
-
name: this.getMetricName(stats.type),
|
|
39
|
-
valueType: { category: 'Numeric' },
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
// Write tags for start_timestamp and end_timestamp (deduplicated)
|
|
44
|
-
const startTagUid = `start_timestamp:${stats.start_timestamp}`;
|
|
45
|
-
const endTagUid = `end_timestamp:${stats.end_timestamp}`;
|
|
46
|
-
if (!this.seenTags.has(startTagUid)) {
|
|
47
|
-
this.seenTags.add(startTagUid);
|
|
48
|
-
results.push({
|
|
49
|
-
model: 'faros_Tag',
|
|
50
|
-
record: {
|
|
51
|
-
uid: startTagUid,
|
|
52
|
-
key: 'start_timestamp',
|
|
53
|
-
value: stats.start_timestamp,
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
if (!this.seenTags.has(endTagUid)) {
|
|
58
|
-
this.seenTags.add(endTagUid);
|
|
59
|
-
results.push({
|
|
60
|
-
model: 'faros_Tag',
|
|
61
|
-
record: {
|
|
62
|
-
uid: endTagUid,
|
|
63
|
-
key: 'end_timestamp',
|
|
64
|
-
value: stats.end_timestamp,
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// Write MetricValue, MetricValueTags, and RepositoryMetric
|
|
69
|
-
const repoKey = common_1.GitHubCommon.repoKey(stats.org, stats.repo, source);
|
|
70
|
-
results.push({
|
|
71
|
-
model: 'faros_MetricValue',
|
|
72
|
-
record: {
|
|
73
|
-
uid: metricValueUid,
|
|
74
|
-
value: `${stats.count}`,
|
|
75
|
-
computedAt: faros_js_client_1.Utils.toDate(record.record.emitted_at),
|
|
76
|
-
definition: { uid: definitionUid },
|
|
77
|
-
},
|
|
78
|
-
}, {
|
|
79
|
-
model: 'faros_MetricValueTag',
|
|
80
|
-
record: {
|
|
81
|
-
value: metricValueRef,
|
|
82
|
-
tag: { uid: startTagUid },
|
|
83
|
-
},
|
|
84
|
-
}, {
|
|
85
|
-
model: 'faros_MetricValueTag',
|
|
86
|
-
record: {
|
|
87
|
-
value: metricValueRef,
|
|
88
|
-
tag: { uid: endTagUid },
|
|
89
|
-
},
|
|
90
|
-
}, {
|
|
91
|
-
model: 'vcs_RepositoryMetric',
|
|
92
|
-
record: {
|
|
93
|
-
repository: repoKey,
|
|
94
|
-
metricValue: metricValueRef,
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
return results;
|
|
98
|
-
}
|
|
99
|
-
getMetricName(type) {
|
|
100
|
-
if (type === github_1.StatsType.MERGED_PRS_PER_MONTH) {
|
|
101
|
-
return 'Merged PRs per Month';
|
|
102
|
-
}
|
|
103
|
-
return type;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.FarosStats = FarosStats;
|
|
107
|
-
//# sourceMappingURL=faros_stats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"faros_stats.js","sourceRoot":"","sources":["../../../src/converters/github/faros_stats.ts"],"names":[],"mappings":";;;AACA,wDAAmE;AACnE,qDAAsC;AACtC,mCAA+B;AAG/B,qCAAuD;AAEvD,MAAa,UAAW,SAAQ,wBAAe;IAA/C;;QACmB,oBAAe,GAAG,IAAI,GAAG,EAAU,CAAC;QACpC,aAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;QAErC,sBAAiB,GAAoC;YAC5D,wBAAwB;YACxB,mBAAmB;YACnB,sBAAsB;YACtB,WAAW;YACX,sBAAsB;SACvB,CAAC;IAuGJ,CAAC;IArGC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAmB,CAAC;QAChD,MAAM,OAAO,GAAwB,EAAE,CAAC;QAExC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC;QACjC,MAAM,cAAc,GAAG,IAAA,gBAAO,EAC5B,GAAG,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,GAAG,CACtD,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;QACrC,MAAM,cAAc,GAAG;YACrB,UAAU,EAAE,EAAC,GAAG,EAAE,aAAa,EAAC;YAChC,GAAG,EAAE,cAAc;SACpB,CAAC;QAEF,uCAAuC;QACvC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,E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