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,52 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { Converter } from '../converter';
|
|
3
|
+
import { Schema$CalendarListEntry, Schema$Event } from './calendar_models';
|
|
4
|
+
export declare type Event = Schema$Event;
|
|
5
|
+
export declare type Calendar = Schema$CalendarListEntry;
|
|
6
|
+
export interface CategoryRef {
|
|
7
|
+
category: string;
|
|
8
|
+
detail: string;
|
|
9
|
+
}
|
|
10
|
+
export declare enum EventGuestStatusCategory {
|
|
11
|
+
NEEDS_ACTION = "NeedsAction",
|
|
12
|
+
ACCEPTED = "Accepted",
|
|
13
|
+
TENTATIVE = "Tentative",
|
|
14
|
+
CANCELED = "Canceled",
|
|
15
|
+
CUSTOM = "Custom"
|
|
16
|
+
}
|
|
17
|
+
export declare enum EventTypeCategory {
|
|
18
|
+
REGULAR = "Regular",
|
|
19
|
+
RECURRING = "Recurring",
|
|
20
|
+
CUSTOM = "Custom"
|
|
21
|
+
}
|
|
22
|
+
export declare enum EventStatusCategory {
|
|
23
|
+
CONFIRMED = "Confirmed",
|
|
24
|
+
TENTATIVE = "Tentative",
|
|
25
|
+
CANCELED = "Canceled",
|
|
26
|
+
CUSTOM = "Custom"
|
|
27
|
+
}
|
|
28
|
+
export declare enum EventPrivacyCategory {
|
|
29
|
+
PRIVATE = "Private",
|
|
30
|
+
PUBLIC = "Public",
|
|
31
|
+
CUSTOM = "Custom"
|
|
32
|
+
}
|
|
33
|
+
export declare enum EventVisibilityCategory {
|
|
34
|
+
FREE = "Free",
|
|
35
|
+
BUSY = "Busy",
|
|
36
|
+
CUSTOM = "Custom"
|
|
37
|
+
}
|
|
38
|
+
/** Common functions shares across GoogleCalendar converters */
|
|
39
|
+
export declare class GoogleCalendarCommon {
|
|
40
|
+
static readonly MAX_DESCRIPTION_LENGTH = 1000;
|
|
41
|
+
static EventType(type: string): CategoryRef;
|
|
42
|
+
static EventPrivacy(privacy: string): CategoryRef;
|
|
43
|
+
static EventVisibility(visibility: string): CategoryRef;
|
|
44
|
+
static EventStatus(status: string): CategoryRef;
|
|
45
|
+
static EventGuestStatus(status: string): CategoryRef;
|
|
46
|
+
}
|
|
47
|
+
/** GoogleCalendar converter base */
|
|
48
|
+
export declare abstract class GoogleCalendarConverter extends Converter {
|
|
49
|
+
source: string;
|
|
50
|
+
/** Every GoogleCalendar record have id property */
|
|
51
|
+
id(record: AirbyteRecord): any;
|
|
52
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleCalendarConverter = exports.GoogleCalendarCommon = exports.EventVisibilityCategory = exports.EventPrivacyCategory = exports.EventStatusCategory = exports.EventTypeCategory = exports.EventGuestStatusCategory = void 0;
|
|
4
|
+
const converter_1 = require("../converter");
|
|
5
|
+
var EventGuestStatusCategory;
|
|
6
|
+
(function (EventGuestStatusCategory) {
|
|
7
|
+
EventGuestStatusCategory["NEEDS_ACTION"] = "NeedsAction";
|
|
8
|
+
EventGuestStatusCategory["ACCEPTED"] = "Accepted";
|
|
9
|
+
EventGuestStatusCategory["TENTATIVE"] = "Tentative";
|
|
10
|
+
EventGuestStatusCategory["CANCELED"] = "Canceled";
|
|
11
|
+
EventGuestStatusCategory["CUSTOM"] = "Custom";
|
|
12
|
+
})(EventGuestStatusCategory = exports.EventGuestStatusCategory || (exports.EventGuestStatusCategory = {}));
|
|
13
|
+
var EventTypeCategory;
|
|
14
|
+
(function (EventTypeCategory) {
|
|
15
|
+
EventTypeCategory["REGULAR"] = "Regular";
|
|
16
|
+
EventTypeCategory["RECURRING"] = "Recurring";
|
|
17
|
+
EventTypeCategory["CUSTOM"] = "Custom";
|
|
18
|
+
})(EventTypeCategory = exports.EventTypeCategory || (exports.EventTypeCategory = {}));
|
|
19
|
+
var EventStatusCategory;
|
|
20
|
+
(function (EventStatusCategory) {
|
|
21
|
+
EventStatusCategory["CONFIRMED"] = "Confirmed";
|
|
22
|
+
EventStatusCategory["TENTATIVE"] = "Tentative";
|
|
23
|
+
EventStatusCategory["CANCELED"] = "Canceled";
|
|
24
|
+
EventStatusCategory["CUSTOM"] = "Custom";
|
|
25
|
+
})(EventStatusCategory = exports.EventStatusCategory || (exports.EventStatusCategory = {}));
|
|
26
|
+
var EventPrivacyCategory;
|
|
27
|
+
(function (EventPrivacyCategory) {
|
|
28
|
+
EventPrivacyCategory["PRIVATE"] = "Private";
|
|
29
|
+
EventPrivacyCategory["PUBLIC"] = "Public";
|
|
30
|
+
EventPrivacyCategory["CUSTOM"] = "Custom";
|
|
31
|
+
})(EventPrivacyCategory = exports.EventPrivacyCategory || (exports.EventPrivacyCategory = {}));
|
|
32
|
+
var EventVisibilityCategory;
|
|
33
|
+
(function (EventVisibilityCategory) {
|
|
34
|
+
EventVisibilityCategory["FREE"] = "Free";
|
|
35
|
+
EventVisibilityCategory["BUSY"] = "Busy";
|
|
36
|
+
EventVisibilityCategory["CUSTOM"] = "Custom";
|
|
37
|
+
})(EventVisibilityCategory = exports.EventVisibilityCategory || (exports.EventVisibilityCategory = {}));
|
|
38
|
+
/** Common functions shares across GoogleCalendar converters */
|
|
39
|
+
class GoogleCalendarCommon {
|
|
40
|
+
static EventType(type) {
|
|
41
|
+
if (!type)
|
|
42
|
+
return null;
|
|
43
|
+
const detail = type === null || type === void 0 ? void 0 : type.toLowerCase();
|
|
44
|
+
switch (detail) {
|
|
45
|
+
case 'default':
|
|
46
|
+
return { category: EventTypeCategory.REGULAR, detail };
|
|
47
|
+
case 'focusTime':
|
|
48
|
+
return { category: EventTypeCategory.RECURRING, detail };
|
|
49
|
+
default:
|
|
50
|
+
return { category: EventTypeCategory.CUSTOM, detail };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
static EventPrivacy(privacy) {
|
|
54
|
+
if (!privacy)
|
|
55
|
+
return null;
|
|
56
|
+
const detail = privacy === null || privacy === void 0 ? void 0 : privacy.toLowerCase();
|
|
57
|
+
switch (detail) {
|
|
58
|
+
case 'public':
|
|
59
|
+
return { category: EventPrivacyCategory.PUBLIC, detail };
|
|
60
|
+
case 'private':
|
|
61
|
+
case 'confidential':
|
|
62
|
+
return { category: EventPrivacyCategory.PRIVATE, detail };
|
|
63
|
+
default:
|
|
64
|
+
return { category: EventPrivacyCategory.CUSTOM, detail };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static EventVisibility(visibility) {
|
|
68
|
+
if (!visibility)
|
|
69
|
+
return null;
|
|
70
|
+
const detail = visibility === null || visibility === void 0 ? void 0 : visibility.toLowerCase();
|
|
71
|
+
switch (detail) {
|
|
72
|
+
case 'opaque':
|
|
73
|
+
return { category: EventVisibilityCategory.BUSY, detail };
|
|
74
|
+
case 'transparent':
|
|
75
|
+
return { category: EventVisibilityCategory.FREE, detail };
|
|
76
|
+
default:
|
|
77
|
+
return { category: EventVisibilityCategory.CUSTOM, detail };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
static EventStatus(status) {
|
|
81
|
+
if (!status)
|
|
82
|
+
return null;
|
|
83
|
+
const detail = status === null || status === void 0 ? void 0 : status.toLowerCase();
|
|
84
|
+
switch (detail) {
|
|
85
|
+
case 'confirmed':
|
|
86
|
+
return { category: EventStatusCategory.CONFIRMED, detail };
|
|
87
|
+
case 'tentative':
|
|
88
|
+
return { category: EventStatusCategory.TENTATIVE, detail };
|
|
89
|
+
case 'cancelled':
|
|
90
|
+
return { category: EventStatusCategory.CANCELED, detail };
|
|
91
|
+
default:
|
|
92
|
+
return { category: EventStatusCategory.CUSTOM, detail };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
static EventGuestStatus(status) {
|
|
96
|
+
if (!status)
|
|
97
|
+
return null;
|
|
98
|
+
const detail = status === null || status === void 0 ? void 0 : status.toLowerCase();
|
|
99
|
+
switch (detail) {
|
|
100
|
+
case 'accepted':
|
|
101
|
+
return { category: EventGuestStatusCategory.ACCEPTED, detail };
|
|
102
|
+
case 'tentative':
|
|
103
|
+
return { category: EventGuestStatusCategory.TENTATIVE, detail };
|
|
104
|
+
case 'needs_action':
|
|
105
|
+
case 'needsaction':
|
|
106
|
+
return { category: EventGuestStatusCategory.NEEDS_ACTION, detail };
|
|
107
|
+
case 'declined':
|
|
108
|
+
case 'canceled':
|
|
109
|
+
return { category: EventGuestStatusCategory.CANCELED, detail };
|
|
110
|
+
default:
|
|
111
|
+
return { category: EventGuestStatusCategory.CUSTOM, detail };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.GoogleCalendarCommon = GoogleCalendarCommon;
|
|
116
|
+
// Max length for free-form description text fields such as issue body
|
|
117
|
+
GoogleCalendarCommon.MAX_DESCRIPTION_LENGTH = 1000;
|
|
118
|
+
/** GoogleCalendar converter base */
|
|
119
|
+
class GoogleCalendarConverter extends converter_1.Converter {
|
|
120
|
+
constructor() {
|
|
121
|
+
super(...arguments);
|
|
122
|
+
this.source = 'GoogleCalendar';
|
|
123
|
+
}
|
|
124
|
+
/** Every GoogleCalendar record have id property */
|
|
125
|
+
id(record) {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
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;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.GoogleCalendarConverter = GoogleCalendarConverter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { GoogleCalendarConverter } from './common';
|
|
4
|
+
export declare class Events extends GoogleCalendarConverter {
|
|
5
|
+
private locationsCache;
|
|
6
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Events = void 0;
|
|
4
|
+
const faros_feeds_sdk_1 = require("faros-feeds-sdk");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
class Events extends common_1.GoogleCalendarConverter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
// Locations cache to avoid querying the API for the same location
|
|
10
|
+
this.locationsCache = new Map();
|
|
11
|
+
this.destinationModels = [
|
|
12
|
+
'cal_Event',
|
|
13
|
+
'cal_EventGuestAssociation',
|
|
14
|
+
'cal_User',
|
|
15
|
+
'geo_Address',
|
|
16
|
+
'geo_Location',
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
async convert(record, ctx) {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
21
|
+
const source = this.streamName.source;
|
|
22
|
+
const event = record.record.data;
|
|
23
|
+
const res = [];
|
|
24
|
+
const eventRef = { uid: event.id, calendar: { uid: event.id, source } };
|
|
25
|
+
(_a = event.attendees) === null || _a === void 0 ? void 0 : _a.forEach((attender) => {
|
|
26
|
+
const attenderRef = { uid: attender.id, source };
|
|
27
|
+
res.push({
|
|
28
|
+
model: 'cal_User',
|
|
29
|
+
record: {
|
|
30
|
+
...attenderRef,
|
|
31
|
+
email: attender.email,
|
|
32
|
+
displayName: attender.displayName,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
res.push({
|
|
36
|
+
model: 'cal_EventGuestAssociation',
|
|
37
|
+
record: {
|
|
38
|
+
event: eventRef,
|
|
39
|
+
guest: attenderRef,
|
|
40
|
+
status: common_1.GoogleCalendarCommon.EventGuestStatus(attender.responseStatus),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
let organizer = null;
|
|
45
|
+
if (event.organizer) {
|
|
46
|
+
organizer = { uid: ((_b = event.organizer) === null || _b === void 0 ? void 0 : _b.id) || ((_c = event.organizer) === null || _c === void 0 ? void 0 : _c.email), source };
|
|
47
|
+
res.push({
|
|
48
|
+
model: 'cal_User',
|
|
49
|
+
record: {
|
|
50
|
+
...organizer,
|
|
51
|
+
email: (_d = event.organizer) === null || _d === void 0 ? void 0 : _d.email,
|
|
52
|
+
displayName: (_e = event.organizer) === null || _e === void 0 ? void 0 : _e.displayName,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const start = faros_feeds_sdk_1.Utils.toDate(((_f = event === null || event === void 0 ? void 0 : event.start) === null || _f === void 0 ? void 0 : _f.date)
|
|
57
|
+
? event.start.date.concat('T00:00:00.000Z')
|
|
58
|
+
: (_g = event === null || event === void 0 ? void 0 : event.start) === null || _g === void 0 ? void 0 : _g.dateTime);
|
|
59
|
+
const end = faros_feeds_sdk_1.Utils.toDate(((_h = event === null || event === void 0 ? void 0 : event.end) === null || _h === void 0 ? void 0 : _h.date)
|
|
60
|
+
? event.end.date.concat('T24:00:00.000Z')
|
|
61
|
+
: (_j = event === null || event === void 0 ? void 0 : event.end) === null || _j === void 0 ? void 0 : _j.dateTime);
|
|
62
|
+
let durationMs;
|
|
63
|
+
if (start && end) {
|
|
64
|
+
durationMs = end.getTime() - start.getTime();
|
|
65
|
+
}
|
|
66
|
+
let location = null;
|
|
67
|
+
if (event.location) {
|
|
68
|
+
const cachedLocation = this.locationsCache.get(event.location);
|
|
69
|
+
if (cachedLocation) {
|
|
70
|
+
location = { uid: cachedLocation.uid };
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const locations = await ((_k = ctx.farosClient) === null || _k === void 0 ? void 0 : _k.geocode(event.location));
|
|
74
|
+
if (locations.length > 0) {
|
|
75
|
+
const loc = locations[0];
|
|
76
|
+
this.locationsCache.set(event.location, loc);
|
|
77
|
+
if (loc.coordinates) {
|
|
78
|
+
res.push({ model: 'geo_Coordinates', record: loc.coordinates });
|
|
79
|
+
}
|
|
80
|
+
if (loc.address) {
|
|
81
|
+
res.push({ model: 'geo_Address', record: loc.address });
|
|
82
|
+
}
|
|
83
|
+
const geo_Location = {
|
|
84
|
+
uid: loc.uid,
|
|
85
|
+
name: loc.raw,
|
|
86
|
+
raw: loc.raw,
|
|
87
|
+
room: loc.room,
|
|
88
|
+
coordinates: loc.coordinates ? loc.coordinates : null,
|
|
89
|
+
address: loc.address ? { uid: loc.address.uid } : null,
|
|
90
|
+
};
|
|
91
|
+
res.push({ model: 'geo_Location', record: geo_Location });
|
|
92
|
+
location = { uid: loc.uid };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
res.push({
|
|
97
|
+
model: 'cal_Event',
|
|
98
|
+
record: {
|
|
99
|
+
...eventRef,
|
|
100
|
+
title: (_l = event.summary) === null || _l === void 0 ? void 0 : _l.substring(0, common_1.GoogleCalendarCommon.MAX_DESCRIPTION_LENGTH),
|
|
101
|
+
description: (_m = event.description) === null || _m === void 0 ? void 0 : _m.substring(0, common_1.GoogleCalendarCommon.MAX_DESCRIPTION_LENGTH),
|
|
102
|
+
start,
|
|
103
|
+
end,
|
|
104
|
+
durationMs,
|
|
105
|
+
url: event.htmlLink,
|
|
106
|
+
location,
|
|
107
|
+
organizer,
|
|
108
|
+
type: common_1.GoogleCalendarCommon.EventType(event.eventType),
|
|
109
|
+
visibility: common_1.GoogleCalendarCommon.EventVisibility(event.transparency),
|
|
110
|
+
privacy: common_1.GoogleCalendarCommon.EventPrivacy(event.visibility),
|
|
111
|
+
status: common_1.GoogleCalendarCommon.EventStatus(event.status),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
return res;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.Events = Events;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { Converter } from '../converter';
|
|
3
|
+
export interface ComputeApplication {
|
|
4
|
+
name: string;
|
|
5
|
+
platform: string;
|
|
6
|
+
}
|
|
7
|
+
interface CICDOrganization {
|
|
8
|
+
uid: string;
|
|
9
|
+
source: string;
|
|
10
|
+
}
|
|
11
|
+
interface CICDPipeline {
|
|
12
|
+
uid: string;
|
|
13
|
+
organization: CICDOrganization;
|
|
14
|
+
}
|
|
15
|
+
export interface CICDBuild {
|
|
16
|
+
uid: string;
|
|
17
|
+
pipeline: CICDPipeline;
|
|
18
|
+
}
|
|
19
|
+
interface CICDRepository {
|
|
20
|
+
uid: string;
|
|
21
|
+
organization: CICDOrganization;
|
|
22
|
+
}
|
|
23
|
+
export interface CICDArtifact {
|
|
24
|
+
readonly uid: string;
|
|
25
|
+
readonly repository: CICDRepository;
|
|
26
|
+
}
|
|
27
|
+
export interface Execution {
|
|
28
|
+
uid: string;
|
|
29
|
+
application: ComputeApplication;
|
|
30
|
+
startedAt: number;
|
|
31
|
+
endedAt: number;
|
|
32
|
+
env: string;
|
|
33
|
+
status: string;
|
|
34
|
+
build: CICDBuild;
|
|
35
|
+
artifact: CICDArtifact;
|
|
36
|
+
}
|
|
37
|
+
export interface ExecutionImplementation {
|
|
38
|
+
application: ComputeApplication;
|
|
39
|
+
env: string;
|
|
40
|
+
build?: CICDBuild;
|
|
41
|
+
artifact?: CICDArtifact;
|
|
42
|
+
}
|
|
43
|
+
interface HarnessService {
|
|
44
|
+
id: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
artifactType: string;
|
|
47
|
+
artifactSources: {
|
|
48
|
+
name: string;
|
|
49
|
+
}[];
|
|
50
|
+
}
|
|
51
|
+
interface HarnessEnvironment {
|
|
52
|
+
type: string;
|
|
53
|
+
name: string;
|
|
54
|
+
}
|
|
55
|
+
export interface HarnessExecutionNode {
|
|
56
|
+
id: string;
|
|
57
|
+
application: {
|
|
58
|
+
id: string;
|
|
59
|
+
name?: string;
|
|
60
|
+
services?: {
|
|
61
|
+
nodes: HarnessService[];
|
|
62
|
+
};
|
|
63
|
+
environments?: {
|
|
64
|
+
nodes: HarnessEnvironment[];
|
|
65
|
+
};
|
|
66
|
+
tags?: {
|
|
67
|
+
name: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}[];
|
|
70
|
+
};
|
|
71
|
+
status: string;
|
|
72
|
+
createdAt: number;
|
|
73
|
+
startedAt: number;
|
|
74
|
+
endedAt: number;
|
|
75
|
+
artifacts?: {
|
|
76
|
+
id: string;
|
|
77
|
+
buildNo: string;
|
|
78
|
+
artifactSource: {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
};
|
|
82
|
+
}[];
|
|
83
|
+
outcomes?: {
|
|
84
|
+
nodes: {
|
|
85
|
+
service: HarnessService;
|
|
86
|
+
environment: HarnessEnvironment;
|
|
87
|
+
}[];
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export interface ExecutionWorkflow {
|
|
91
|
+
application: ComputeApplication;
|
|
92
|
+
env: string;
|
|
93
|
+
build: CICDBuild;
|
|
94
|
+
artifact: CICDArtifact;
|
|
95
|
+
}
|
|
96
|
+
export interface ExecutionPipeline {
|
|
97
|
+
application: ComputeApplication;
|
|
98
|
+
env: string;
|
|
99
|
+
}
|
|
100
|
+
/** Harness converter base */
|
|
101
|
+
export declare abstract class HarnessConverter extends Converter {
|
|
102
|
+
source: string;
|
|
103
|
+
id(record: AirbyteRecord): any;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HarnessConverter = void 0;
|
|
4
|
+
const converter_1 = require("../converter");
|
|
5
|
+
/** Harness converter base */
|
|
6
|
+
class HarnessConverter extends converter_1.Converter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.source = 'Harness';
|
|
10
|
+
}
|
|
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.id;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.HarnessConverter = HarnessConverter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
3
|
+
import { HarnessConverter } from './common';
|
|
4
|
+
export declare class Executions extends HarnessConverter {
|
|
5
|
+
private readonly logger;
|
|
6
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
7
|
+
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
private parseArtifactFromTags;
|
|
9
|
+
private parseWorkflow;
|
|
10
|
+
private parsePipeline;
|
|
11
|
+
private toBuildStatus;
|
|
12
|
+
private toEnvironmentStatus;
|
|
13
|
+
private toExecution;
|
|
14
|
+
private toDeploymentStatus;
|
|
15
|
+
}
|