airbyte-faros-destination 0.1.53
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/README.md +161 -0
- package/lib/common/write-stats.d.ts +16 -0
- package/lib/common/write-stats.js +48 -0
- package/lib/community/hasura-client.d.ts +27 -0
- package/lib/community/hasura-client.js +278 -0
- package/lib/community/hasura-writer.d.ts +12 -0
- package/lib/community/hasura-writer.js +44 -0
- package/lib/community/types.d.ts +26 -0
- package/lib/community/types.js +9 -0
- package/lib/converters/agileaccelerator/agileaccelerator_types.d.ts +315 -0
- package/lib/converters/agileaccelerator/agileaccelerator_types.js +81 -0
- package/lib/converters/agileaccelerator/common.d.ts +64 -0
- package/lib/converters/agileaccelerator/common.js +167 -0
- package/lib/converters/agileaccelerator/works.d.ts +7 -0
- package/lib/converters/agileaccelerator/works.js +105 -0
- package/lib/converters/asana/common.d.ts +39 -0
- package/lib/converters/asana/common.js +64 -0
- package/lib/converters/asana/projects.d.ts +7 -0
- package/lib/converters/asana/projects.js +29 -0
- package/lib/converters/asana/sections.d.ts +7 -0
- package/lib/converters/asana/sections.js +28 -0
- package/lib/converters/asana/stories.d.ts +7 -0
- package/lib/converters/asana/stories.js +32 -0
- package/lib/converters/asana/tags.d.ts +7 -0
- package/lib/converters/asana/tags.js +22 -0
- package/lib/converters/asana/tasks.d.ts +11 -0
- package/lib/converters/asana/tasks.js +160 -0
- package/lib/converters/asana/users.d.ts +7 -0
- package/lib/converters/asana/users.js +16 -0
- package/lib/converters/backlog/common.d.ts +20 -0
- package/lib/converters/backlog/common.js +59 -0
- package/lib/converters/backlog/issues.d.ts +7 -0
- package/lib/converters/backlog/issues.js +119 -0
- package/lib/converters/backlog/models.d.ts +156 -0
- package/lib/converters/backlog/models.js +23 -0
- package/lib/converters/backlog/projects.d.ts +7 -0
- package/lib/converters/backlog/projects.js +78 -0
- package/lib/converters/backlog/users.d.ts +7 -0
- package/lib/converters/backlog/users.js +26 -0
- package/lib/converters/bitbucket/branches.d.ts +7 -0
- package/lib/converters/bitbucket/branches.js +31 -0
- package/lib/converters/bitbucket/commits.d.ts +7 -0
- package/lib/converters/bitbucket/commits.js +50 -0
- package/lib/converters/bitbucket/common.d.ts +28 -0
- package/lib/converters/bitbucket/common.js +56 -0
- package/lib/converters/bitbucket/deployments.d.ts +11 -0
- package/lib/converters/bitbucket/deployments.js +100 -0
- package/lib/converters/bitbucket/issues.d.ts +12 -0
- package/lib/converters/bitbucket/issues.js +111 -0
- package/lib/converters/bitbucket/pipeline_steps.d.ts +10 -0
- package/lib/converters/bitbucket/pipeline_steps.js +83 -0
- package/lib/converters/bitbucket/pipelines.d.ts +8 -0
- package/lib/converters/bitbucket/pipelines.js +90 -0
- package/lib/converters/bitbucket/pull_request_activities.d.ts +13 -0
- package/lib/converters/bitbucket/pull_request_activities.js +112 -0
- package/lib/converters/bitbucket/pull_requests.d.ts +10 -0
- package/lib/converters/bitbucket/pull_requests.js +95 -0
- package/lib/converters/bitbucket/repositories.d.ts +9 -0
- package/lib/converters/bitbucket/repositories.js +41 -0
- package/lib/converters/bitbucket/types.d.ts +667 -0
- package/lib/converters/bitbucket/types.js +2 -0
- package/lib/converters/bitbucket/workspace_users.d.ts +7 -0
- package/lib/converters/bitbucket/workspace_users.js +31 -0
- package/lib/converters/bitbucket/workspaces.d.ts +8 -0
- package/lib/converters/bitbucket/workspaces.js +61 -0
- package/lib/converters/converter-registry.d.ts +25 -0
- package/lib/converters/converter-registry.js +64 -0
- package/lib/converters/converter.d.ts +63 -0
- package/lib/converters/converter.js +122 -0
- package/lib/converters/datadog/common.d.ts +27 -0
- package/lib/converters/datadog/common.js +34 -0
- package/lib/converters/datadog/incidents.d.ts +9 -0
- package/lib/converters/datadog/incidents.js +128 -0
- package/lib/converters/datadog/users.d.ts +7 -0
- package/lib/converters/datadog/users.js +27 -0
- package/lib/converters/docker/common.d.ts +87 -0
- package/lib/converters/docker/common.js +76 -0
- package/lib/converters/docker/tags.d.ts +8 -0
- package/lib/converters/docker/tags.js +98 -0
- package/lib/converters/github/assignees.d.ts +7 -0
- package/lib/converters/github/assignees.js +16 -0
- package/lib/converters/github/branches.d.ts +7 -0
- package/lib/converters/github/branches.js +28 -0
- package/lib/converters/github/collaborators.d.ts +7 -0
- package/lib/converters/github/collaborators.js +19 -0
- package/lib/converters/github/commits.d.ts +7 -0
- package/lib/converters/github/commits.js +48 -0
- package/lib/converters/github/common.d.ts +37 -0
- package/lib/converters/github/common.js +130 -0
- package/lib/converters/github/issue_labels.d.ts +7 -0
- package/lib/converters/github/issue_labels.js +20 -0
- package/lib/converters/github/issue_milestones.d.ts +8 -0
- package/lib/converters/github/issue_milestones.js +42 -0
- package/lib/converters/github/issues.d.ts +9 -0
- package/lib/converters/github/issues.js +90 -0
- package/lib/converters/github/organizations.d.ts +7 -0
- package/lib/converters/github/organizations.js +37 -0
- package/lib/converters/github/projects.d.ts +7 -0
- package/lib/converters/github/projects.js +21 -0
- package/lib/converters/github/pull_request_stats.d.ts +7 -0
- package/lib/converters/github/pull_request_stats.js +43 -0
- package/lib/converters/github/pull_requests.d.ts +7 -0
- package/lib/converters/github/pull_requests.js +63 -0
- package/lib/converters/github/releases.d.ts +7 -0
- package/lib/converters/github/releases.js +51 -0
- package/lib/converters/github/repositories.d.ts +7 -0
- package/lib/converters/github/repositories.js +44 -0
- package/lib/converters/github/review_comments.d.ts +7 -0
- package/lib/converters/github/review_comments.js +39 -0
- package/lib/converters/github/reviews.d.ts +7 -0
- package/lib/converters/github/reviews.js +58 -0
- package/lib/converters/github/tags.d.ts +7 -0
- package/lib/converters/github/tags.js +31 -0
- package/lib/converters/github/users.d.ts +7 -0
- package/lib/converters/github/users.js +19 -0
- package/lib/converters/gitlab/branches.d.ts +8 -0
- package/lib/converters/gitlab/branches.js +44 -0
- package/lib/converters/gitlab/commits.d.ts +7 -0
- package/lib/converters/gitlab/commits.js +33 -0
- package/lib/converters/gitlab/common.d.ts +30 -0
- package/lib/converters/gitlab/common.js +70 -0
- package/lib/converters/gitlab/group_labels.d.ts +7 -0
- package/lib/converters/gitlab/group_labels.js +15 -0
- package/lib/converters/gitlab/group_milestones.d.ts +8 -0
- package/lib/converters/gitlab/group_milestones.js +41 -0
- package/lib/converters/gitlab/groups.d.ts +7 -0
- package/lib/converters/gitlab/groups.js +43 -0
- package/lib/converters/gitlab/issues.d.ts +10 -0
- package/lib/converters/gitlab/issues.js +79 -0
- package/lib/converters/gitlab/jobs.d.ts +11 -0
- package/lib/converters/gitlab/jobs.js +75 -0
- package/lib/converters/gitlab/merge_request_commits.d.ts +7 -0
- package/lib/converters/gitlab/merge_request_commits.js +34 -0
- package/lib/converters/gitlab/merge_requests.d.ts +10 -0
- package/lib/converters/gitlab/merge_requests.js +65 -0
- package/lib/converters/gitlab/pipelines.d.ts +7 -0
- package/lib/converters/gitlab/pipelines.js +41 -0
- package/lib/converters/gitlab/project_labels.d.ts +7 -0
- package/lib/converters/gitlab/project_labels.js +15 -0
- package/lib/converters/gitlab/project_milestones.d.ts +8 -0
- package/lib/converters/gitlab/project_milestones.js +41 -0
- package/lib/converters/gitlab/projects.d.ts +7 -0
- package/lib/converters/gitlab/projects.js +51 -0
- package/lib/converters/gitlab/releases.d.ts +10 -0
- package/lib/converters/gitlab/releases.js +68 -0
- package/lib/converters/gitlab/tags.d.ts +10 -0
- package/lib/converters/gitlab/tags.js +41 -0
- package/lib/converters/gitlab/users.d.ts +7 -0
- package/lib/converters/gitlab/users.js +33 -0
- package/lib/converters/googlecalendar/calendar_models.d.ts +618 -0
- package/lib/converters/googlecalendar/calendar_models.js +2 -0
- package/lib/converters/googlecalendar/calendars.d.ts +7 -0
- package/lib/converters/googlecalendar/calendars.js +29 -0
- package/lib/converters/googlecalendar/common.d.ts +52 -0
- package/lib/converters/googlecalendar/common.js +130 -0
- package/lib/converters/googlecalendar/events.d.ts +8 -0
- package/lib/converters/googlecalendar/events.js +117 -0
- package/lib/converters/harness/common.d.ts +105 -0
- package/lib/converters/harness/common.js +16 -0
- package/lib/converters/harness/executions.d.ts +15 -0
- package/lib/converters/harness/executions.js +245 -0
- package/lib/converters/jenkins/builds.d.ts +9 -0
- package/lib/converters/jenkins/builds.js +74 -0
- package/lib/converters/jenkins/common.d.ts +25 -0
- package/lib/converters/jenkins/common.js +54 -0
- package/lib/converters/jenkins/jobs.d.ts +8 -0
- package/lib/converters/jenkins/jobs.js +29 -0
- package/lib/converters/jira/board_issues.d.ts +7 -0
- package/lib/converters/jira/board_issues.js +28 -0
- package/lib/converters/jira/boards.d.ts +7 -0
- package/lib/converters/jira/boards.js +34 -0
- package/lib/converters/jira/common.d.ts +61 -0
- package/lib/converters/jira/common.js +64 -0
- package/lib/converters/jira/epics.d.ts +8 -0
- package/lib/converters/jira/epics.js +45 -0
- package/lib/converters/jira/issue_fields.d.ts +7 -0
- package/lib/converters/jira/issue_fields.js +15 -0
- package/lib/converters/jira/issues.d.ts +52 -0
- package/lib/converters/jira/issues.js +545 -0
- package/lib/converters/jira/project_versions.d.ts +9 -0
- package/lib/converters/jira/project_versions.js +48 -0
- package/lib/converters/jira/projects.d.ts +7 -0
- package/lib/converters/jira/projects.js +40 -0
- package/lib/converters/jira/pull_requests.d.ts +7 -0
- package/lib/converters/jira/pull_requests.js +15 -0
- package/lib/converters/jira/sprint_issues.d.ts +7 -0
- package/lib/converters/jira/sprint_issues.js +15 -0
- package/lib/converters/jira/sprints.d.ts +16 -0
- package/lib/converters/jira/sprints.js +80 -0
- package/lib/converters/jira/users.d.ts +8 -0
- package/lib/converters/jira/users.js +33 -0
- package/lib/converters/jira/workflow_statuses.d.ts +7 -0
- package/lib/converters/jira/workflow_statuses.js +15 -0
- package/lib/converters/jsonata.d.ts +17 -0
- package/lib/converters/jsonata.js +47 -0
- package/lib/converters/okta/common.d.ts +8 -0
- package/lib/converters/okta/common.js +17 -0
- package/lib/converters/okta/groups.d.ts +7 -0
- package/lib/converters/okta/groups.js +47 -0
- package/lib/converters/okta/models.d.ts +102 -0
- package/lib/converters/okta/models.js +2 -0
- package/lib/converters/okta/users.d.ts +8 -0
- package/lib/converters/okta/users.js +73 -0
- package/lib/converters/okta_faros/common.d.ts +4 -0
- package/lib/converters/okta_faros/common.js +11 -0
- package/lib/converters/okta_faros/groups.d.ts +13 -0
- package/lib/converters/okta_faros/groups.js +23 -0
- package/lib/converters/okta_faros/users.d.ts +13 -0
- package/lib/converters/okta_faros/users.js +23 -0
- package/lib/converters/pagerduty/common.d.ts +37 -0
- package/lib/converters/pagerduty/common.js +40 -0
- package/lib/converters/pagerduty/incident_log_entries.d.ts +8 -0
- package/lib/converters/pagerduty/incident_log_entries.js +56 -0
- package/lib/converters/pagerduty/incidents.d.ts +10 -0
- package/lib/converters/pagerduty/incidents.js +127 -0
- package/lib/converters/pagerduty/priorities_resource.d.ts +11 -0
- package/lib/converters/pagerduty/priorities_resource.js +64 -0
- package/lib/converters/pagerduty/users.d.ts +7 -0
- package/lib/converters/pagerduty/users.js +26 -0
- package/lib/converters/phabricator/commits.d.ts +8 -0
- package/lib/converters/phabricator/commits.js +75 -0
- package/lib/converters/phabricator/common.d.ts +40 -0
- package/lib/converters/phabricator/common.js +107 -0
- package/lib/converters/phabricator/repositories.d.ts +7 -0
- package/lib/converters/phabricator/repositories.js +56 -0
- package/lib/converters/phabricator/revisions.d.ts +7 -0
- package/lib/converters/phabricator/revisions.js +83 -0
- package/lib/converters/phabricator/users.d.ts +7 -0
- package/lib/converters/phabricator/users.js +39 -0
- package/lib/converters/shortcut/common.d.ts +16 -0
- package/lib/converters/shortcut/common.js +68 -0
- package/lib/converters/shortcut/epics.d.ts +7 -0
- package/lib/converters/shortcut/epics.js +29 -0
- package/lib/converters/shortcut/iterations.d.ts +7 -0
- package/lib/converters/shortcut/iterations.js +29 -0
- package/lib/converters/shortcut/members.d.ts +7 -0
- package/lib/converters/shortcut/members.js +26 -0
- package/lib/converters/shortcut/models.d.ts +392 -0
- package/lib/converters/shortcut/models.js +30 -0
- package/lib/converters/shortcut/projects.d.ts +7 -0
- package/lib/converters/shortcut/projects.js +46 -0
- package/lib/converters/shortcut/stories.d.ts +7 -0
- package/lib/converters/shortcut/stories.js +127 -0
- package/lib/converters/squadcast/common.d.ts +169 -0
- package/lib/converters/squadcast/common.js +62 -0
- package/lib/converters/squadcast/events.d.ts +9 -0
- package/lib/converters/squadcast/events.js +53 -0
- package/lib/converters/squadcast/incidents.d.ts +10 -0
- package/lib/converters/squadcast/incidents.js +141 -0
- package/lib/converters/squadcast/services.d.ts +7 -0
- package/lib/converters/squadcast/services.js +28 -0
- package/lib/converters/squadcast/users.d.ts +7 -0
- package/lib/converters/squadcast/users.js +27 -0
- package/lib/converters/statuspage/common.d.ts +93 -0
- package/lib/converters/statuspage/common.js +80 -0
- package/lib/converters/statuspage/incident_updates.d.ts +8 -0
- package/lib/converters/statuspage/incident_updates.js +45 -0
- package/lib/converters/statuspage/incidents.d.ts +10 -0
- package/lib/converters/statuspage/incidents.js +128 -0
- package/lib/converters/statuspage/users.d.ts +7 -0
- package/lib/converters/statuspage/users.js +26 -0
- package/lib/converters/victorops/common.d.ts +16 -0
- package/lib/converters/victorops/common.js +24 -0
- package/lib/converters/victorops/incidents.d.ts +12 -0
- package/lib/converters/victorops/incidents.js +209 -0
- package/lib/converters/victorops/teams.d.ts +8 -0
- package/lib/converters/victorops/teams.js +30 -0
- package/lib/converters/victorops/users.d.ts +8 -0
- package/lib/converters/victorops/users.js +33 -0
- package/lib/destination-runner.d.ts +12 -0
- package/lib/destination-runner.js +22 -0
- package/lib/destination.d.ts +42 -0
- package/lib/destination.js +508 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +39 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +71 -0
- package/resources/fetch-primary-keys.sql +16 -0
- package/resources/introspection-query.gql +61 -0
- package/resources/spec.json +468 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OktaFarosConverter = void 0;
|
|
4
|
+
const converter_1 = require("../converter");
|
|
5
|
+
class OktaFarosConverter extends converter_1.Converter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.source = 'Okta_Faros';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.OktaFarosConverter = OktaFarosConverter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { OktaFarosConverter } from './common';
|
|
4
|
+
/**
|
|
5
|
+
* This converter is identical to OktaGroups for Okta community source.
|
|
6
|
+
* It is here to support the Okta source we developed at Faros.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Groups extends OktaFarosConverter {
|
|
9
|
+
private alias;
|
|
10
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
11
|
+
id(record: AirbyteRecord): any;
|
|
12
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Groups = void 0;
|
|
4
|
+
const groups_1 = require("../okta/groups");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
/**
|
|
7
|
+
* This converter is identical to OktaGroups for Okta community source.
|
|
8
|
+
* It is here to support the Okta source we developed at Faros.
|
|
9
|
+
*/
|
|
10
|
+
class Groups extends common_1.OktaFarosConverter {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.alias = new groups_1.Groups();
|
|
14
|
+
this.destinationModels = this.alias.destinationModels;
|
|
15
|
+
}
|
|
16
|
+
id(record) {
|
|
17
|
+
return this.alias.id(record);
|
|
18
|
+
}
|
|
19
|
+
async convert(record, ctx) {
|
|
20
|
+
return this.alias.convert(record, ctx);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Groups = Groups;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { OktaFarosConverter } from './common';
|
|
4
|
+
/**
|
|
5
|
+
* This converter is identical to OktaUsers for Okta community source.
|
|
6
|
+
* It is here to support the Okta source we developed at Faros.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Users extends OktaFarosConverter {
|
|
9
|
+
private alias;
|
|
10
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
11
|
+
id(record: AirbyteRecord): any;
|
|
12
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Users = void 0;
|
|
4
|
+
const users_1 = require("../okta/users");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
/**
|
|
7
|
+
* This converter is identical to OktaUsers for Okta community source.
|
|
8
|
+
* It is here to support the Okta source we developed at Faros.
|
|
9
|
+
*/
|
|
10
|
+
class Users extends common_1.OktaFarosConverter {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.alias = new users_1.Users();
|
|
14
|
+
this.destinationModels = this.alias.destinationModels;
|
|
15
|
+
}
|
|
16
|
+
id(record) {
|
|
17
|
+
return this.alias.id(record);
|
|
18
|
+
}
|
|
19
|
+
async convert(record, ctx) {
|
|
20
|
+
return this.alias.convert(record, ctx);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Users = Users;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { Converter, StreamContext } from '../converter';
|
|
3
|
+
export interface PagerdutyObject {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly summary: string;
|
|
7
|
+
readonly self: string;
|
|
8
|
+
readonly html_url: string;
|
|
9
|
+
}
|
|
10
|
+
export declare enum IncidentSeverityCategory {
|
|
11
|
+
Sev1 = "Sev1",
|
|
12
|
+
Sev2 = "Sev2",
|
|
13
|
+
Sev3 = "Sev3",
|
|
14
|
+
Sev4 = "Sev4",
|
|
15
|
+
Sev5 = "Sev5",
|
|
16
|
+
Custom = "Custom"
|
|
17
|
+
}
|
|
18
|
+
declare type ApplicationMapping = Record<string, {
|
|
19
|
+
name: string;
|
|
20
|
+
platform?: string;
|
|
21
|
+
}>;
|
|
22
|
+
interface PagerDutyConfig {
|
|
23
|
+
application_mapping?: ApplicationMapping;
|
|
24
|
+
default_severity?: IncidentSeverityCategory;
|
|
25
|
+
}
|
|
26
|
+
/** PagerDuty converter base */
|
|
27
|
+
export declare abstract class PagerDutyConverter extends Converter {
|
|
28
|
+
source: string;
|
|
29
|
+
/** Almost every Pagerduty record have id property. Function will be
|
|
30
|
+
* override if record doesn't have id property.
|
|
31
|
+
*/
|
|
32
|
+
id(record: AirbyteRecord): any;
|
|
33
|
+
protected pagerdutyConfig(ctx: StreamContext): PagerDutyConfig;
|
|
34
|
+
protected applicationMapping(ctx: StreamContext): ApplicationMapping;
|
|
35
|
+
protected defaultSeverity(ctx: StreamContext): IncidentSeverityCategory | null;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PagerDutyConverter = exports.IncidentSeverityCategory = void 0;
|
|
4
|
+
const converter_1 = require("../converter");
|
|
5
|
+
var IncidentSeverityCategory;
|
|
6
|
+
(function (IncidentSeverityCategory) {
|
|
7
|
+
IncidentSeverityCategory["Sev1"] = "Sev1";
|
|
8
|
+
IncidentSeverityCategory["Sev2"] = "Sev2";
|
|
9
|
+
IncidentSeverityCategory["Sev3"] = "Sev3";
|
|
10
|
+
IncidentSeverityCategory["Sev4"] = "Sev4";
|
|
11
|
+
IncidentSeverityCategory["Sev5"] = "Sev5";
|
|
12
|
+
IncidentSeverityCategory["Custom"] = "Custom";
|
|
13
|
+
})(IncidentSeverityCategory = exports.IncidentSeverityCategory || (exports.IncidentSeverityCategory = {}));
|
|
14
|
+
/** PagerDuty converter base */
|
|
15
|
+
class PagerDutyConverter extends converter_1.Converter {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.source = 'PagerDuty';
|
|
19
|
+
}
|
|
20
|
+
/** Almost every Pagerduty record have id property. Function will be
|
|
21
|
+
* override if record doesn't have id property.
|
|
22
|
+
*/
|
|
23
|
+
id(record) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
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;
|
|
26
|
+
}
|
|
27
|
+
pagerdutyConfig(ctx) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
return (_b = (_a = ctx.config.source_specific_configs) === null || _a === void 0 ? void 0 : _a.pagerduty) !== null && _b !== void 0 ? _b : {};
|
|
30
|
+
}
|
|
31
|
+
applicationMapping(ctx) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return ((_b = (0, converter_1.parseObjectConfig)((_a = this.pagerdutyConfig(ctx)) === null || _a === void 0 ? void 0 : _a.application_mapping, 'Application Mapping')) !== null && _b !== void 0 ? _b : {});
|
|
34
|
+
}
|
|
35
|
+
defaultSeverity(ctx) {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = this.pagerdutyConfig(ctx).default_severity) !== null && _a !== void 0 ? _a : null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.PagerDutyConverter = PagerDutyConverter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { PagerDutyConverter } from './common';
|
|
4
|
+
export declare class IncidentLogEntries extends PagerDutyConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
private eventType;
|
|
8
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IncidentLogEntries = void 0;
|
|
4
|
+
const faros_feeds_sdk_1 = require("faros-feeds-sdk");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
var IncidentEventTypeCategory;
|
|
7
|
+
(function (IncidentEventTypeCategory) {
|
|
8
|
+
IncidentEventTypeCategory["Created"] = "Created";
|
|
9
|
+
IncidentEventTypeCategory["Acknowledged"] = "Acknowledged";
|
|
10
|
+
IncidentEventTypeCategory["Resolved"] = "Resolved";
|
|
11
|
+
IncidentEventTypeCategory["Custom"] = "Custom";
|
|
12
|
+
})(IncidentEventTypeCategory || (IncidentEventTypeCategory = {}));
|
|
13
|
+
class IncidentLogEntries extends common_1.PagerDutyConverter {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.destinationModels = [
|
|
17
|
+
'ims_IncidentEvent',
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
async convert(record, ctx) {
|
|
21
|
+
const source = this.streamName.source;
|
|
22
|
+
const event = record.record.data;
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
model: 'ims_IncidentEvent',
|
|
26
|
+
record: {
|
|
27
|
+
uid: event.id,
|
|
28
|
+
type: this.eventType(event.type),
|
|
29
|
+
createdAt: faros_feeds_sdk_1.Utils.toDate(event.created_at),
|
|
30
|
+
detail: event.summary,
|
|
31
|
+
incident: { uid: event.incident.id, source },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
eventType(logEntryType) {
|
|
37
|
+
const typeRef = logEntryType.split('_')[0]; // i.e. "resolve" of "resolve_log_entry"
|
|
38
|
+
let eventTypeCategory;
|
|
39
|
+
switch (typeRef.toLowerCase()) {
|
|
40
|
+
case 'trigger':
|
|
41
|
+
eventTypeCategory = IncidentEventTypeCategory.Created;
|
|
42
|
+
break;
|
|
43
|
+
case 'acknowledge':
|
|
44
|
+
eventTypeCategory = IncidentEventTypeCategory.Acknowledged;
|
|
45
|
+
break;
|
|
46
|
+
case 'resolve':
|
|
47
|
+
eventTypeCategory = IncidentEventTypeCategory.Resolved;
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
eventTypeCategory = IncidentEventTypeCategory.Custom;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return { category: eventTypeCategory, detail: logEntryType };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.IncidentLogEntries = IncidentLogEntries;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { PagerDutyConverter } from './common';
|
|
4
|
+
export declare class Incidents extends PagerDutyConverter {
|
|
5
|
+
private readonly logger;
|
|
6
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
private incidentPriority;
|
|
9
|
+
private incidentState;
|
|
10
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Incidents = void 0;
|
|
4
|
+
const faros_airbyte_cdk_1 = require("faros-airbyte-cdk");
|
|
5
|
+
const faros_feeds_sdk_1 = require("faros-feeds-sdk");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
var IncidentStatusCategory;
|
|
8
|
+
(function (IncidentStatusCategory) {
|
|
9
|
+
IncidentStatusCategory["Created"] = "Created";
|
|
10
|
+
IncidentStatusCategory["Identified"] = "Identified";
|
|
11
|
+
IncidentStatusCategory["Investigating"] = "Investigating";
|
|
12
|
+
IncidentStatusCategory["Resolved"] = "Resolved";
|
|
13
|
+
IncidentStatusCategory["Custom"] = "Custom";
|
|
14
|
+
})(IncidentStatusCategory || (IncidentStatusCategory = {}));
|
|
15
|
+
class Incidents extends common_1.PagerDutyConverter {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.logger = new faros_airbyte_cdk_1.AirbyteLogger();
|
|
19
|
+
this.destinationModels = [
|
|
20
|
+
'compute_Application',
|
|
21
|
+
'ims_Incident',
|
|
22
|
+
'ims_IncidentApplicationImpact',
|
|
23
|
+
'ims_IncidentAssignment',
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
async convert(record, ctx) {
|
|
27
|
+
var _a;
|
|
28
|
+
const source = this.streamName.source;
|
|
29
|
+
const incident = record.record.data;
|
|
30
|
+
const res = [];
|
|
31
|
+
const incidentRef = { uid: incident.id, source };
|
|
32
|
+
const lastUpdated = faros_feeds_sdk_1.Utils.toDate(incident.last_status_change_at);
|
|
33
|
+
let acknowledgedAt, resolvedAt;
|
|
34
|
+
if (incident.status === 'acknowledged') {
|
|
35
|
+
if (!incident.acknowledgements || !incident.acknowledgements.length) {
|
|
36
|
+
this.logger.warn(`Incident ${incident.id} acknowledged, but acknowledger info missing`);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// find first acknowledgement
|
|
40
|
+
acknowledgedAt = faros_feeds_sdk_1.Utils.toDate(incident.acknowledgements
|
|
41
|
+
.map((ack) => ack.at)
|
|
42
|
+
.sort()[0]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (incident.status === 'resolved') {
|
|
46
|
+
resolvedAt = lastUpdated;
|
|
47
|
+
}
|
|
48
|
+
res.push({
|
|
49
|
+
// We are explicitly passing __Upsert command here with at := 0,
|
|
50
|
+
// to allow updating Incident severity from prioritiesResource stream
|
|
51
|
+
// in the same revision
|
|
52
|
+
model: 'ims_Incident__Upsert',
|
|
53
|
+
record: {
|
|
54
|
+
at: 0,
|
|
55
|
+
data: {
|
|
56
|
+
...incidentRef,
|
|
57
|
+
title: incident.title,
|
|
58
|
+
description: incident.description,
|
|
59
|
+
url: incident.self,
|
|
60
|
+
createdAt: faros_feeds_sdk_1.Utils.toDate(incident.created_at),
|
|
61
|
+
updatedAt: resolvedAt,
|
|
62
|
+
acknowledgedAt: acknowledgedAt,
|
|
63
|
+
resolvedAt: resolvedAt,
|
|
64
|
+
priority: this.incidentPriority(incident.urgency),
|
|
65
|
+
status: this.incidentState(incident.status),
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
for (const assignment of incident.assignments) {
|
|
70
|
+
const assignee = { uid: assignment.assignee.id, source };
|
|
71
|
+
res.push({
|
|
72
|
+
model: 'ims_IncidentAssignment',
|
|
73
|
+
record: {
|
|
74
|
+
incident: incidentRef,
|
|
75
|
+
assignee,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const applicationMapping = this.applicationMapping(ctx);
|
|
80
|
+
let application = {
|
|
81
|
+
name: incident.service.summary,
|
|
82
|
+
platform: '',
|
|
83
|
+
};
|
|
84
|
+
// if we have an app mapping specified
|
|
85
|
+
if (incident.service.summary in applicationMapping &&
|
|
86
|
+
applicationMapping[incident.service.summary].name) {
|
|
87
|
+
const mappedApp = applicationMapping[incident.service.summary];
|
|
88
|
+
application = {
|
|
89
|
+
name: mappedApp.name,
|
|
90
|
+
platform: (_a = mappedApp.platform) !== null && _a !== void 0 ? _a : application.platform,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
res.push({ model: 'compute_Application', record: application });
|
|
94
|
+
res.push({
|
|
95
|
+
model: 'ims_IncidentApplicationImpact',
|
|
96
|
+
record: {
|
|
97
|
+
incident: incidentRef,
|
|
98
|
+
application,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
return res;
|
|
102
|
+
}
|
|
103
|
+
incidentPriority(incidentUrgency) {
|
|
104
|
+
const detail = incidentUrgency;
|
|
105
|
+
switch (incidentUrgency.toLowerCase()) {
|
|
106
|
+
case 'high':
|
|
107
|
+
return { category: 'High', detail };
|
|
108
|
+
case 'low':
|
|
109
|
+
return { category: 'Low', detail };
|
|
110
|
+
default:
|
|
111
|
+
return { category: 'Custom', detail };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
incidentState(incidentStatus) {
|
|
115
|
+
const detail = incidentStatus;
|
|
116
|
+
switch (incidentStatus) {
|
|
117
|
+
case 'resolved':
|
|
118
|
+
return { category: IncidentStatusCategory.Resolved, detail };
|
|
119
|
+
case 'acknowledged':
|
|
120
|
+
return { category: IncidentStatusCategory.Investigating, detail };
|
|
121
|
+
case 'triggered':
|
|
122
|
+
default:
|
|
123
|
+
return { category: IncidentStatusCategory.Created, detail };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.Incidents = Incidents;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext, StreamName } from '../converter';
|
|
3
|
+
import { PagerDutyConverter } from './common';
|
|
4
|
+
export declare class PrioritiesResource extends PagerDutyConverter {
|
|
5
|
+
private readonly logger;
|
|
6
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
7
|
+
private readonly incidentsStream;
|
|
8
|
+
get dependencies(): ReadonlyArray<StreamName>;
|
|
9
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
10
|
+
private incidentSeverity;
|
|
11
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrioritiesResource = void 0;
|
|
4
|
+
const faros_airbyte_cdk_1 = require("faros-airbyte-cdk");
|
|
5
|
+
const converter_1 = require("../converter");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const SeverityLevel = ['Sev1', 'Sev2', 'Sev3', 'Sev4', 'Sev5'];
|
|
8
|
+
class PrioritiesResource extends common_1.PagerDutyConverter {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.logger = new faros_airbyte_cdk_1.AirbyteLogger();
|
|
12
|
+
this.destinationModels = [
|
|
13
|
+
'ims_Incident',
|
|
14
|
+
];
|
|
15
|
+
this.incidentsStream = new converter_1.StreamName('pagerduty', 'incidents');
|
|
16
|
+
}
|
|
17
|
+
get dependencies() {
|
|
18
|
+
return [this.incidentsStream];
|
|
19
|
+
}
|
|
20
|
+
async convert(record, ctx) {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const source = this.streamName.source;
|
|
23
|
+
const priorityResource = record.record.data;
|
|
24
|
+
const incidentsStream = this.incidentsStream.asString;
|
|
25
|
+
const incident = ctx.get(incidentsStream, String(priorityResource.id));
|
|
26
|
+
const incidentPriority = (_b = (_a = incident === null || incident === void 0 ? void 0 : incident.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.priority;
|
|
27
|
+
const defaultSeverity = this.defaultSeverity(ctx);
|
|
28
|
+
const severity = this.incidentSeverity(priorityResource, incidentPriority, defaultSeverity);
|
|
29
|
+
if (!severity)
|
|
30
|
+
return [];
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
model: 'ims_Incident__Update',
|
|
34
|
+
record: {
|
|
35
|
+
at: record.record.emitted_at,
|
|
36
|
+
where: {
|
|
37
|
+
uid: priorityResource.id,
|
|
38
|
+
source,
|
|
39
|
+
},
|
|
40
|
+
mask: ['severity'],
|
|
41
|
+
patch: {
|
|
42
|
+
severity,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
incidentSeverity(priorityResource, incidentPriority, defaultSeverity) {
|
|
49
|
+
var _a;
|
|
50
|
+
if (!incidentPriority && defaultSeverity) {
|
|
51
|
+
//priorities can be disabled on the PD account
|
|
52
|
+
return defaultSeverity
|
|
53
|
+
? { category: defaultSeverity, detail: 'default' }
|
|
54
|
+
: undefined;
|
|
55
|
+
}
|
|
56
|
+
const detail = (_a = incidentPriority === null || incidentPriority === void 0 ? void 0 : incidentPriority.summary) !== null && _a !== void 0 ? _a : priorityResource.summary;
|
|
57
|
+
const [severityIndex] = detail.match(/\d$/);
|
|
58
|
+
if (incidentPriority) {
|
|
59
|
+
return { category: SeverityLevel[severityIndex], detail };
|
|
60
|
+
}
|
|
61
|
+
return { category: 'Custom', detail };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.PrioritiesResource = PrioritiesResource;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { PagerDutyConverter } from './common';
|
|
4
|
+
export declare class Users extends PagerDutyConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Users = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class Users extends common_1.PagerDutyConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = ['ims_User'];
|
|
9
|
+
}
|
|
10
|
+
async convert(record, ctx) {
|
|
11
|
+
const source = this.streamName.source;
|
|
12
|
+
const user = record.record.data;
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
model: 'ims_User',
|
|
16
|
+
record: {
|
|
17
|
+
uid: user.id,
|
|
18
|
+
email: user.email,
|
|
19
|
+
name: user.name,
|
|
20
|
+
source,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Users = Users;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { PhabricatorConverter } from './common';
|
|
4
|
+
export declare class Commits extends PhabricatorConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
id(record: AirbyteRecord): any;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Commits = void 0;
|
|
4
|
+
const faros_feeds_sdk_1 = require("faros-feeds-sdk");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
class Commits extends common_1.PhabricatorConverter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.destinationModels = [
|
|
10
|
+
'vcs_BranchCommitAssociation',
|
|
11
|
+
'vcs_Commit',
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
id(record) {
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
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.fields) === null || _c === void 0 ? void 0 : _c.identifier;
|
|
17
|
+
}
|
|
18
|
+
async convert(record, ctx) {
|
|
19
|
+
var _a, _b, _c, _d;
|
|
20
|
+
const source = this.streamName.source;
|
|
21
|
+
const commit = record.record.data;
|
|
22
|
+
const res = [];
|
|
23
|
+
const sha = (_a = commit.fields) === null || _a === void 0 ? void 0 : _a.identifier;
|
|
24
|
+
const repository = common_1.PhabricatorCommon.repositoryKey(commit.repository, source);
|
|
25
|
+
if (!sha || !repository)
|
|
26
|
+
return res;
|
|
27
|
+
const author = (_b = commit.fields) === null || _b === void 0 ? void 0 : _b.author;
|
|
28
|
+
const fullMessage = (_c = commit.fields) === null || _c === void 0 ? void 0 : _c.message;
|
|
29
|
+
const commitMessage = common_1.PhabricatorCommon.parseCommitMessage(fullMessage);
|
|
30
|
+
res.push({
|
|
31
|
+
model: 'vcs_Commit',
|
|
32
|
+
record: {
|
|
33
|
+
uid: sha,
|
|
34
|
+
sha,
|
|
35
|
+
message: fullMessage,
|
|
36
|
+
author: (author === null || author === void 0 ? void 0 : author.userPHID) ? { uid: author.userPHID, source } : null,
|
|
37
|
+
htmlUrl: null,
|
|
38
|
+
createdAt: (author === null || author === void 0 ? void 0 : author.epoch) ? faros_feeds_sdk_1.Utils.toDate(author === null || author === void 0 ? void 0 : author.epoch) : null,
|
|
39
|
+
repository,
|
|
40
|
+
source,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
// TODO: figure out how to get the actual commit branch
|
|
44
|
+
// Until then we assume the default repository branch for all commits
|
|
45
|
+
const branch = (_d = commit.repository.fields) === null || _d === void 0 ? void 0 : _d.defaultBranch;
|
|
46
|
+
if (branch) {
|
|
47
|
+
res.push({
|
|
48
|
+
model: 'vcs_BranchCommitAssociation',
|
|
49
|
+
record: {
|
|
50
|
+
commit: { sha, repository },
|
|
51
|
+
branch: { name: branch, uid: branch, repository },
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (commitMessage === null || commitMessage === void 0 ? void 0 : commitMessage.revisionId) {
|
|
56
|
+
res.push({
|
|
57
|
+
model: 'vcs_PullRequest__Update',
|
|
58
|
+
record: {
|
|
59
|
+
at: record.record.emitted_at,
|
|
60
|
+
where: {
|
|
61
|
+
number: commitMessage === null || commitMessage === void 0 ? void 0 : commitMessage.revisionId,
|
|
62
|
+
uid: commitMessage === null || commitMessage === void 0 ? void 0 : commitMessage.revisionId.toString(),
|
|
63
|
+
repository,
|
|
64
|
+
},
|
|
65
|
+
mask: ['mergeCommit'],
|
|
66
|
+
patch: {
|
|
67
|
+
mergeCommit: { repository, sha },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return res;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.Commits = Commits;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { Dictionary } from 'ts-essentials';
|
|
3
|
+
import { Converter } from '../converter';
|
|
4
|
+
/** Common functions shares across Phabricator converters */
|
|
5
|
+
export declare class PhabricatorCommon {
|
|
6
|
+
static vcs_UserType(user: Dictionary<any>): {
|
|
7
|
+
category: string;
|
|
8
|
+
detail: string;
|
|
9
|
+
};
|
|
10
|
+
static vcs_PullRequestState(revisionStatus: Dictionary<any>): {
|
|
11
|
+
category: string;
|
|
12
|
+
detail: string;
|
|
13
|
+
};
|
|
14
|
+
static vcs_PullRequestReviewState(reviewStatus: string): {
|
|
15
|
+
category: string;
|
|
16
|
+
detail: string;
|
|
17
|
+
};
|
|
18
|
+
static parseCommitMessage(message: string): CommitMessage | undefined;
|
|
19
|
+
static repositoryURIs(repository: Dictionary<any>): ReadonlyArray<Dictionary<any>>;
|
|
20
|
+
static repositoryKey(repository: Dictionary<any>, source: string): undefined | RepositoryKey;
|
|
21
|
+
static orgKey(source: string): undefined | OrgKey;
|
|
22
|
+
}
|
|
23
|
+
/** Phabricator converter base */
|
|
24
|
+
export declare abstract class PhabricatorConverter extends Converter {
|
|
25
|
+
source: string;
|
|
26
|
+
/** Most of Phabricator records should have phid property */
|
|
27
|
+
id(record: AirbyteRecord): any;
|
|
28
|
+
}
|
|
29
|
+
export interface CommitMessage {
|
|
30
|
+
message?: string;
|
|
31
|
+
revisionId?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface RepositoryKey {
|
|
34
|
+
name: string;
|
|
35
|
+
organization: OrgKey;
|
|
36
|
+
}
|
|
37
|
+
export interface OrgKey {
|
|
38
|
+
uid: string;
|
|
39
|
+
source: string;
|
|
40
|
+
}
|