airbyte-faros-destination 0.9.95 → 0.9.97
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/github/common.d.ts +10 -2
- package/lib/converters/github/common.js +62 -31
- package/lib/converters/github/common.js.map +1 -1
- package/lib/converters/github/faros_commits.d.ts +7 -0
- package/lib/converters/github/faros_commits.js +17 -0
- package/lib/converters/github/faros_commits.js.map +1 -0
- package/lib/converters/github/faros_labels.d.ts +7 -0
- package/lib/converters/github/faros_labels.js +23 -0
- package/lib/converters/github/faros_labels.js.map +1 -0
- package/lib/converters/github/faros_pull_requests.d.ts +11 -0
- package/lib/converters/github/faros_pull_requests.js +114 -0
- package/lib/converters/github/faros_pull_requests.js.map +1 -0
- package/lib/converters/github/faros_users.d.ts +1 -0
- package/lib/converters/github/faros_users.js +5 -4
- package/lib/converters/github/faros_users.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -3,6 +3,9 @@ import { User } from 'faros-airbyte-common/github';
|
|
|
3
3
|
import { Dictionary } from 'ts-essentials';
|
|
4
4
|
import { RepoKey } from '../common/vcs';
|
|
5
5
|
import { Converter, DestinationRecord } from '../converter';
|
|
6
|
+
type PartialUser = Partial<Omit<User, 'type'> & {
|
|
7
|
+
type: string;
|
|
8
|
+
}>;
|
|
6
9
|
/** Common functions shares across GitHub converters */
|
|
7
10
|
export declare class GitHubCommon {
|
|
8
11
|
static readonly MAX_DESCRIPTION_LENGTH = 1000;
|
|
@@ -21,17 +24,22 @@ export declare class GitHubCommon {
|
|
|
21
24
|
category: string;
|
|
22
25
|
detail: string;
|
|
23
26
|
};
|
|
27
|
+
static repoKey(org: string, repo: string, source: string): RepoKey;
|
|
24
28
|
private static buildStatus;
|
|
25
29
|
}
|
|
26
30
|
/** Github converter base */
|
|
27
31
|
export declare abstract class GitHubConverter extends Converter {
|
|
28
32
|
source: string;
|
|
33
|
+
protected collectedUsers: Map<string, Partial<Omit<User, "type"> & {
|
|
34
|
+
type: string;
|
|
35
|
+
}>[]>;
|
|
29
36
|
/** All Github records should have id property */
|
|
30
37
|
id(record: AirbyteRecord): any;
|
|
31
|
-
protected
|
|
32
|
-
protected
|
|
38
|
+
protected collectUser(user: PartialUser): void;
|
|
39
|
+
protected convertUsers(): DestinationRecord[];
|
|
33
40
|
}
|
|
34
41
|
export interface ProjectKey {
|
|
35
42
|
uid: string;
|
|
36
43
|
source: string;
|
|
37
44
|
}
|
|
45
|
+
export {};
|
|
@@ -132,6 +132,16 @@ class GitHubCommon {
|
|
|
132
132
|
return { category: 'Custom', detail: statusLower };
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
+
static repoKey(org, repo, source) {
|
|
136
|
+
return {
|
|
137
|
+
uid: (0, lodash_1.toLower)(repo),
|
|
138
|
+
name: (0, lodash_1.toLower)(repo),
|
|
139
|
+
organization: {
|
|
140
|
+
uid: (0, lodash_1.toLower)(org),
|
|
141
|
+
source,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
135
145
|
static buildStatus(conclusion) {
|
|
136
146
|
const conclusionLower = conclusion.toLowerCase();
|
|
137
147
|
switch (conclusionLower) {
|
|
@@ -154,47 +164,68 @@ class GitHubConverter extends converter_1.Converter {
|
|
|
154
164
|
constructor() {
|
|
155
165
|
super(...arguments);
|
|
156
166
|
this.source = 'GitHub';
|
|
167
|
+
this.collectedUsers = new Map();
|
|
157
168
|
}
|
|
158
169
|
/** All Github records should have id property */
|
|
159
170
|
id(record) {
|
|
160
171
|
var _a, _b;
|
|
161
172
|
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.id;
|
|
162
173
|
}
|
|
163
|
-
|
|
174
|
+
collectUser(user) {
|
|
175
|
+
if (!(user === null || user === void 0 ? void 0 : user.login))
|
|
176
|
+
return;
|
|
177
|
+
if (!this.collectedUsers.has(user.login)) {
|
|
178
|
+
this.collectedUsers.set(user.login, []);
|
|
179
|
+
}
|
|
180
|
+
this.collectedUsers.get(user.login).push(user);
|
|
181
|
+
}
|
|
182
|
+
convertUsers() {
|
|
164
183
|
const res = [];
|
|
165
|
-
|
|
166
|
-
|
|
184
|
+
for (const [login, users] of this.collectedUsers.entries()) {
|
|
185
|
+
const emails = new Set(users
|
|
186
|
+
.map((user) => user.email)
|
|
187
|
+
.filter((email) => !(0, lodash_1.isEmpty)(email) && !email.includes('@users.noreply.github.com')));
|
|
188
|
+
for (const email of emails) {
|
|
189
|
+
res.push({
|
|
190
|
+
model: 'vcs_UserEmail',
|
|
191
|
+
record: {
|
|
192
|
+
user: { uid: login, source: this.streamName.source },
|
|
193
|
+
email,
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
const orgs = new Set(users.map((user) => user.org).filter((org) => !(0, lodash_1.isEmpty)(org)));
|
|
198
|
+
for (const org of orgs) {
|
|
199
|
+
res.push({
|
|
200
|
+
model: 'vcs_Membership',
|
|
201
|
+
record: {
|
|
202
|
+
user: { uid: login, source: this.streamName.source },
|
|
203
|
+
organization: { uid: (0, lodash_1.toLower)(org), source: this.streamName.source },
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
const finalUser = users[0];
|
|
208
|
+
// replace non-null user attributes to our copy of the user
|
|
209
|
+
// e.g. login, name, email, type, html_url.
|
|
210
|
+
for (const user of users.slice(1)) {
|
|
211
|
+
for (const key in user) {
|
|
212
|
+
if (!finalUser[key]) {
|
|
213
|
+
finalUser[key] = user[key];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
167
217
|
res.push({
|
|
168
|
-
model: '
|
|
169
|
-
record: {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
218
|
+
model: 'vcs_User',
|
|
219
|
+
record: (0, lodash_1.omitBy)({
|
|
220
|
+
uid: login,
|
|
221
|
+
source: this.streamName.source,
|
|
222
|
+
name: finalUser.name,
|
|
223
|
+
email: finalUser.email,
|
|
224
|
+
htmlUrl: finalUser.html_url,
|
|
225
|
+
type: GitHubCommon.vcs_UserType(finalUser),
|
|
226
|
+
}, (value) => (0, lodash_1.isNil)(value) || (0, lodash_1.isEmpty)(value)),
|
|
173
227
|
});
|
|
174
228
|
}
|
|
175
|
-
const type = GitHubCommon.vcs_UserType(user);
|
|
176
|
-
res.push({
|
|
177
|
-
model: 'vcs_User',
|
|
178
|
-
record: (0, lodash_1.omitBy)({
|
|
179
|
-
uid: user.login,
|
|
180
|
-
source: this.streamName.source,
|
|
181
|
-
name: user.name,
|
|
182
|
-
email: user.email,
|
|
183
|
-
htmlUrl: user.html_url,
|
|
184
|
-
type,
|
|
185
|
-
}, (value) => (0, lodash_1.isNil)(value) || (0, lodash_1.isEmpty)(value)),
|
|
186
|
-
});
|
|
187
|
-
return res;
|
|
188
|
-
}
|
|
189
|
-
convertMembership(user, org) {
|
|
190
|
-
const res = [];
|
|
191
|
-
res.push({
|
|
192
|
-
model: 'vcs_Membership',
|
|
193
|
-
record: {
|
|
194
|
-
user: { uid: user.login, source: this.streamName.source },
|
|
195
|
-
organization: { uid: (0, lodash_1.toLower)(org), source: this.streamName.source },
|
|
196
|
-
},
|
|
197
|
-
});
|
|
198
229
|
return res;
|
|
199
230
|
}
|
|
200
231
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/github/common.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,mCAAuD;AAIvD,4CAA0D;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/github/common.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,mCAAuD;AAIvD,4CAA0D;AAI1D,uDAAuD;AACvD,MAAa,YAAY;IAIvB,MAAM,CAAC,wBAAwB,CAC7B,IAAqB,EACrB,MAAc;QAEd,MAAM,OAAO,GAAG,YAAY,CAAC,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AC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;oBAC7B,CAAC;gBACH,CAAC;YACH,CAAC;YACD,GAAG,CAAC,IAAI,CAAC;gBACP,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,IAAA,eAAM,EACZ;oBACE,GAAG,EAAE,KAAK;oBACV,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;oBAC9B,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,OAAO,EAAE,SAAS,CAAC,QAAQ;oBAC3B,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC;iBAC3C,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,CAC1C;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA7ED,0CA6EC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { GitHubConverter } from './common';
|
|
4
|
+
export declare class FarosCommits extends GitHubConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FarosCommits = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class FarosCommits extends common_1.GitHubConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = ['vcs_Commit'];
|
|
9
|
+
}
|
|
10
|
+
async convert(record, ctx) {
|
|
11
|
+
const commit = record.record.data;
|
|
12
|
+
const source = this.streamName.source;
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.FarosCommits = FarosCommits;
|
|
17
|
+
//# sourceMappingURL=faros_commits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faros_commits.js","sourceRoot":"","sources":["../../../src/converters/github/faros_commits.ts"],"names":[],"mappings":";;;AAIA,qCAAyC;AAEzC,MAAa,YAAa,SAAQ,wBAAe;IAAjD;;QACW,sBAAiB,GAAoC,CAAC,YAAY,CAAC,CAAC;IAU/E,CAAC;IARC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAc,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAXD,oCAWC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { GitHubConverter } from './common';
|
|
4
|
+
export declare class FarosLabels extends GitHubConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FarosLabels = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class FarosLabels extends common_1.GitHubConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = ['vcs_Label'];
|
|
9
|
+
}
|
|
10
|
+
async convert(record, ctx) {
|
|
11
|
+
const label = record.record.data;
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
model: 'vcs_Label',
|
|
15
|
+
record: {
|
|
16
|
+
name: label.name,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.FarosLabels = FarosLabels;
|
|
23
|
+
//# sourceMappingURL=faros_labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faros_labels.js","sourceRoot":"","sources":["../../../src/converters/github/faros_labels.ts"],"names":[],"mappings":";;;AAIA,qCAAyC;AAEzC,MAAa,WAAY,SAAQ,wBAAe;IAAhD;;QACW,sBAAiB,GAAoC,CAAC,WAAW,CAAC,CAAC;IAgB9E,CAAC;IAdC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAa,CAAC;QAC1C,OAAO;YACL;gBACE,KAAK,EAAE,WAAW;gBAClB,MAAM,EAAE;oBACN,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAjBD,kCAiBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { GitHubConverter } from './common';
|
|
4
|
+
export declare class FarosPullRequests extends GitHubConverter {
|
|
5
|
+
private collectedBranches;
|
|
6
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
onProcessingComplete(ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
9
|
+
private collectBranch;
|
|
10
|
+
private convertBranches;
|
|
11
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FarosPullRequests = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
class FarosPullRequests extends common_1.GitHubConverter {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.collectedBranches = new Map();
|
|
11
|
+
this.destinationModels = [
|
|
12
|
+
'vcs_Branch',
|
|
13
|
+
'vcs_PullRequest',
|
|
14
|
+
'vcs_PullRequestLabel',
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
async convert(record, ctx) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const pr = record.record.data;
|
|
20
|
+
this.collectUser(pr.author);
|
|
21
|
+
// Github PR states
|
|
22
|
+
const prStates = ['closed', 'merged', 'open'];
|
|
23
|
+
const stateDetail = pr.isDraft ? 'DRAFT' : pr.state;
|
|
24
|
+
const state = prStates.includes(pr.state.toLowerCase())
|
|
25
|
+
? { category: (0, lodash_1.upperFirst)((0, lodash_1.camelCase)(pr.state)), detail: stateDetail }
|
|
26
|
+
: { category: 'Custom', detail: stateDetail };
|
|
27
|
+
const lastReviewEvent = (0, lodash_1.last)((_b = (_a = pr.reviewEvents) === null || _a === void 0 ? void 0 : _a.nodes) !== null && _b !== void 0 ? _b : []);
|
|
28
|
+
let readyForReviewAt = null;
|
|
29
|
+
if (!lastReviewEvent && !pr.isDraft) {
|
|
30
|
+
readyForReviewAt = faros_js_client_1.Utils.toDate(pr.createdAt);
|
|
31
|
+
}
|
|
32
|
+
else if ((lastReviewEvent === null || lastReviewEvent === void 0 ? void 0 : lastReviewEvent.type) === 'ReadyForReviewEvent') {
|
|
33
|
+
readyForReviewAt = faros_js_client_1.Utils.toDate(lastReviewEvent === null || lastReviewEvent === void 0 ? void 0 : lastReviewEvent.createdAt);
|
|
34
|
+
}
|
|
35
|
+
const sourceBranch = this.collectBranch(pr.headRefName, pr.headRepository);
|
|
36
|
+
const targetBranch = this.collectBranch(pr.baseRefName, pr.baseRepository);
|
|
37
|
+
// Ensure if we fail to get branch info we do not overwrite the previous branch info
|
|
38
|
+
// since we should always have branches for a PR
|
|
39
|
+
const branchInfo = (0, lodash_1.omitBy)({ sourceBranch, targetBranch }, lodash_1.isNil);
|
|
40
|
+
const prKey = {
|
|
41
|
+
repository: common_1.GitHubCommon.repoKey(pr.org, pr.repo, this.streamName.source),
|
|
42
|
+
number: pr.number,
|
|
43
|
+
};
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
model: 'vcs_PullRequest',
|
|
47
|
+
record: {
|
|
48
|
+
...prKey,
|
|
49
|
+
title: pr.title,
|
|
50
|
+
description: faros_js_client_1.Utils.cleanAndTruncate(pr.body),
|
|
51
|
+
state,
|
|
52
|
+
htmlUrl: pr.url,
|
|
53
|
+
createdAt: faros_js_client_1.Utils.toDate(pr.createdAt),
|
|
54
|
+
updatedAt: faros_js_client_1.Utils.toDate(pr.updatedAt),
|
|
55
|
+
mergedAt: faros_js_client_1.Utils.toDate(pr.mergedAt),
|
|
56
|
+
readyForReviewAt,
|
|
57
|
+
commitCount: pr.commits.totalCount,
|
|
58
|
+
commentCount: pr.comments.totalCount,
|
|
59
|
+
diffStats: {
|
|
60
|
+
linesAdded: pr.additions,
|
|
61
|
+
linesDeleted: pr.deletions,
|
|
62
|
+
filesChanged: pr.changedFiles,
|
|
63
|
+
},
|
|
64
|
+
author: pr.author
|
|
65
|
+
? { uid: pr.author.login, source: this.streamName.source }
|
|
66
|
+
: null,
|
|
67
|
+
mergeCommit: pr.mergeCommit
|
|
68
|
+
? { repository: pr.repo, sha: pr.mergeCommit.oid }
|
|
69
|
+
: null,
|
|
70
|
+
...branchInfo,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
...pr.labels.nodes.map((label) => ({
|
|
74
|
+
model: 'vcs_PullRequestLabel',
|
|
75
|
+
record: {
|
|
76
|
+
pullRequest: prKey,
|
|
77
|
+
label: { name: label.name },
|
|
78
|
+
},
|
|
79
|
+
})),
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
async onProcessingComplete(ctx) {
|
|
83
|
+
return [...this.convertBranches(), ...this.convertUsers()];
|
|
84
|
+
}
|
|
85
|
+
collectBranch(branchName, branchRepo) {
|
|
86
|
+
var _a;
|
|
87
|
+
if (!branchName || !(branchRepo === null || branchRepo === void 0 ? void 0 : branchRepo.name) || !((_a = branchRepo === null || branchRepo === void 0 ? void 0 : branchRepo.owner) === null || _a === void 0 ? void 0 : _a.login)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const key = branchKey(branchName, branchRepo, this.streamName.source);
|
|
91
|
+
const keyStr = branchKeyToString(key);
|
|
92
|
+
if (!this.collectedBranches.has(keyStr)) {
|
|
93
|
+
this.collectedBranches.set(keyStr, key);
|
|
94
|
+
}
|
|
95
|
+
return key;
|
|
96
|
+
}
|
|
97
|
+
convertBranches() {
|
|
98
|
+
return Array.from(this.collectedBranches.values()).map((branchKey) => ({
|
|
99
|
+
model: 'vcs_Branch',
|
|
100
|
+
record: branchKey,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.FarosPullRequests = FarosPullRequests;
|
|
105
|
+
function branchKey(branchName, branchRepo, source) {
|
|
106
|
+
return {
|
|
107
|
+
name: branchName,
|
|
108
|
+
repository: common_1.GitHubCommon.repoKey(branchRepo.owner.login, branchRepo.name, source),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function branchKeyToString(branchKey) {
|
|
112
|
+
return `${branchKey.repository.organization.uid}/${branchKey.repository.name}/${branchKey.name}`;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=faros_pull_requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faros_pull_requests.js","sourceRoot":"","sources":["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AAK,0CAAE,KAAK,CAAA,EAAE,CAAC;YAClE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAEtC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAEO,eAAe;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YACrE,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAjHD,8CAiHC;AAED,SAAS,SAAS,CAChB,UAAkB,EAClB,UAAyE,EACzE,MAAc;IAEd,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,qBAAY,CAAC,OAAO,CAC9B,UAAU,CAAC,KAAK,CAAC,KAAK,EACtB,UAAU,CAAC,IAAI,EACf,MAAM,CACP;KACF,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAoB;IAC7C,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;AACnG,CAAC"}
|
|
@@ -4,4 +4,5 @@ import { GitHubConverter } from './common';
|
|
|
4
4
|
export declare class FarosUsers extends GitHubConverter {
|
|
5
5
|
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
6
|
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
onProcessingComplete(ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
8
|
}
|
|
@@ -13,10 +13,11 @@ class FarosUsers extends common_1.GitHubConverter {
|
|
|
13
13
|
}
|
|
14
14
|
async convert(record, ctx) {
|
|
15
15
|
const user = record.record.data;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
this.collectUser(user);
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
async onProcessingComplete(ctx) {
|
|
20
|
+
return this.convertUsers();
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
exports.FarosUsers = FarosUsers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faros_users.js","sourceRoot":"","sources":["../../../src/converters/github/faros_users.ts"],"names":[],"mappings":";;;AAIA,qCAAyC;AAEzC,MAAa,UAAW,SAAQ,wBAAe;IAA/C;;QACW,sBAAiB,GAAoC;YAC5D,gBAAgB;YAChB,UAAU;YACV,eAAe;SAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"faros_users.js","sourceRoot":"","sources":["../../../src/converters/github/faros_users.ts"],"names":[],"mappings":";;;AAIA,qCAAyC;AAEzC,MAAa,UAAW,SAAQ,wBAAe;IAA/C;;QACW,sBAAiB,GAAoC;YAC5D,gBAAgB;YAChB,UAAU;YACV,eAAe;SAChB,CAAC;IAgBJ,CAAC;IAdC,KAAK,CAAC,OAAO,CACX,MAAqB,EACrB,GAAkB;QAElB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAY,CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,GAAkB;QAElB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;CACF;AArBD,gCAqBC"}
|