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.
Files changed (280) hide show
  1. package/README.md +161 -0
  2. package/lib/common/write-stats.d.ts +16 -0
  3. package/lib/common/write-stats.js +48 -0
  4. package/lib/community/hasura-client.d.ts +27 -0
  5. package/lib/community/hasura-client.js +278 -0
  6. package/lib/community/hasura-writer.d.ts +12 -0
  7. package/lib/community/hasura-writer.js +44 -0
  8. package/lib/community/types.d.ts +26 -0
  9. package/lib/community/types.js +9 -0
  10. package/lib/converters/agileaccelerator/agileaccelerator_types.d.ts +315 -0
  11. package/lib/converters/agileaccelerator/agileaccelerator_types.js +81 -0
  12. package/lib/converters/agileaccelerator/common.d.ts +64 -0
  13. package/lib/converters/agileaccelerator/common.js +167 -0
  14. package/lib/converters/agileaccelerator/works.d.ts +7 -0
  15. package/lib/converters/agileaccelerator/works.js +105 -0
  16. package/lib/converters/asana/common.d.ts +39 -0
  17. package/lib/converters/asana/common.js +64 -0
  18. package/lib/converters/asana/projects.d.ts +7 -0
  19. package/lib/converters/asana/projects.js +29 -0
  20. package/lib/converters/asana/sections.d.ts +7 -0
  21. package/lib/converters/asana/sections.js +28 -0
  22. package/lib/converters/asana/stories.d.ts +7 -0
  23. package/lib/converters/asana/stories.js +32 -0
  24. package/lib/converters/asana/tags.d.ts +7 -0
  25. package/lib/converters/asana/tags.js +22 -0
  26. package/lib/converters/asana/tasks.d.ts +11 -0
  27. package/lib/converters/asana/tasks.js +160 -0
  28. package/lib/converters/asana/users.d.ts +7 -0
  29. package/lib/converters/asana/users.js +16 -0
  30. package/lib/converters/backlog/common.d.ts +20 -0
  31. package/lib/converters/backlog/common.js +59 -0
  32. package/lib/converters/backlog/issues.d.ts +7 -0
  33. package/lib/converters/backlog/issues.js +119 -0
  34. package/lib/converters/backlog/models.d.ts +156 -0
  35. package/lib/converters/backlog/models.js +23 -0
  36. package/lib/converters/backlog/projects.d.ts +7 -0
  37. package/lib/converters/backlog/projects.js +78 -0
  38. package/lib/converters/backlog/users.d.ts +7 -0
  39. package/lib/converters/backlog/users.js +26 -0
  40. package/lib/converters/bitbucket/branches.d.ts +7 -0
  41. package/lib/converters/bitbucket/branches.js +31 -0
  42. package/lib/converters/bitbucket/commits.d.ts +7 -0
  43. package/lib/converters/bitbucket/commits.js +50 -0
  44. package/lib/converters/bitbucket/common.d.ts +28 -0
  45. package/lib/converters/bitbucket/common.js +56 -0
  46. package/lib/converters/bitbucket/deployments.d.ts +11 -0
  47. package/lib/converters/bitbucket/deployments.js +100 -0
  48. package/lib/converters/bitbucket/issues.d.ts +12 -0
  49. package/lib/converters/bitbucket/issues.js +111 -0
  50. package/lib/converters/bitbucket/pipeline_steps.d.ts +10 -0
  51. package/lib/converters/bitbucket/pipeline_steps.js +83 -0
  52. package/lib/converters/bitbucket/pipelines.d.ts +8 -0
  53. package/lib/converters/bitbucket/pipelines.js +90 -0
  54. package/lib/converters/bitbucket/pull_request_activities.d.ts +13 -0
  55. package/lib/converters/bitbucket/pull_request_activities.js +112 -0
  56. package/lib/converters/bitbucket/pull_requests.d.ts +10 -0
  57. package/lib/converters/bitbucket/pull_requests.js +95 -0
  58. package/lib/converters/bitbucket/repositories.d.ts +9 -0
  59. package/lib/converters/bitbucket/repositories.js +41 -0
  60. package/lib/converters/bitbucket/types.d.ts +667 -0
  61. package/lib/converters/bitbucket/types.js +2 -0
  62. package/lib/converters/bitbucket/workspace_users.d.ts +7 -0
  63. package/lib/converters/bitbucket/workspace_users.js +31 -0
  64. package/lib/converters/bitbucket/workspaces.d.ts +8 -0
  65. package/lib/converters/bitbucket/workspaces.js +61 -0
  66. package/lib/converters/converter-registry.d.ts +25 -0
  67. package/lib/converters/converter-registry.js +64 -0
  68. package/lib/converters/converter.d.ts +63 -0
  69. package/lib/converters/converter.js +122 -0
  70. package/lib/converters/datadog/common.d.ts +27 -0
  71. package/lib/converters/datadog/common.js +34 -0
  72. package/lib/converters/datadog/incidents.d.ts +9 -0
  73. package/lib/converters/datadog/incidents.js +128 -0
  74. package/lib/converters/datadog/users.d.ts +7 -0
  75. package/lib/converters/datadog/users.js +27 -0
  76. package/lib/converters/docker/common.d.ts +87 -0
  77. package/lib/converters/docker/common.js +76 -0
  78. package/lib/converters/docker/tags.d.ts +8 -0
  79. package/lib/converters/docker/tags.js +98 -0
  80. package/lib/converters/github/assignees.d.ts +7 -0
  81. package/lib/converters/github/assignees.js +16 -0
  82. package/lib/converters/github/branches.d.ts +7 -0
  83. package/lib/converters/github/branches.js +28 -0
  84. package/lib/converters/github/collaborators.d.ts +7 -0
  85. package/lib/converters/github/collaborators.js +19 -0
  86. package/lib/converters/github/commits.d.ts +7 -0
  87. package/lib/converters/github/commits.js +48 -0
  88. package/lib/converters/github/common.d.ts +37 -0
  89. package/lib/converters/github/common.js +130 -0
  90. package/lib/converters/github/issue_labels.d.ts +7 -0
  91. package/lib/converters/github/issue_labels.js +20 -0
  92. package/lib/converters/github/issue_milestones.d.ts +8 -0
  93. package/lib/converters/github/issue_milestones.js +42 -0
  94. package/lib/converters/github/issues.d.ts +9 -0
  95. package/lib/converters/github/issues.js +90 -0
  96. package/lib/converters/github/organizations.d.ts +7 -0
  97. package/lib/converters/github/organizations.js +37 -0
  98. package/lib/converters/github/projects.d.ts +7 -0
  99. package/lib/converters/github/projects.js +21 -0
  100. package/lib/converters/github/pull_request_stats.d.ts +7 -0
  101. package/lib/converters/github/pull_request_stats.js +43 -0
  102. package/lib/converters/github/pull_requests.d.ts +7 -0
  103. package/lib/converters/github/pull_requests.js +63 -0
  104. package/lib/converters/github/releases.d.ts +7 -0
  105. package/lib/converters/github/releases.js +51 -0
  106. package/lib/converters/github/repositories.d.ts +7 -0
  107. package/lib/converters/github/repositories.js +44 -0
  108. package/lib/converters/github/review_comments.d.ts +7 -0
  109. package/lib/converters/github/review_comments.js +39 -0
  110. package/lib/converters/github/reviews.d.ts +7 -0
  111. package/lib/converters/github/reviews.js +58 -0
  112. package/lib/converters/github/tags.d.ts +7 -0
  113. package/lib/converters/github/tags.js +31 -0
  114. package/lib/converters/github/users.d.ts +7 -0
  115. package/lib/converters/github/users.js +19 -0
  116. package/lib/converters/gitlab/branches.d.ts +8 -0
  117. package/lib/converters/gitlab/branches.js +44 -0
  118. package/lib/converters/gitlab/commits.d.ts +7 -0
  119. package/lib/converters/gitlab/commits.js +33 -0
  120. package/lib/converters/gitlab/common.d.ts +30 -0
  121. package/lib/converters/gitlab/common.js +70 -0
  122. package/lib/converters/gitlab/group_labels.d.ts +7 -0
  123. package/lib/converters/gitlab/group_labels.js +15 -0
  124. package/lib/converters/gitlab/group_milestones.d.ts +8 -0
  125. package/lib/converters/gitlab/group_milestones.js +41 -0
  126. package/lib/converters/gitlab/groups.d.ts +7 -0
  127. package/lib/converters/gitlab/groups.js +43 -0
  128. package/lib/converters/gitlab/issues.d.ts +10 -0
  129. package/lib/converters/gitlab/issues.js +79 -0
  130. package/lib/converters/gitlab/jobs.d.ts +11 -0
  131. package/lib/converters/gitlab/jobs.js +75 -0
  132. package/lib/converters/gitlab/merge_request_commits.d.ts +7 -0
  133. package/lib/converters/gitlab/merge_request_commits.js +34 -0
  134. package/lib/converters/gitlab/merge_requests.d.ts +10 -0
  135. package/lib/converters/gitlab/merge_requests.js +65 -0
  136. package/lib/converters/gitlab/pipelines.d.ts +7 -0
  137. package/lib/converters/gitlab/pipelines.js +41 -0
  138. package/lib/converters/gitlab/project_labels.d.ts +7 -0
  139. package/lib/converters/gitlab/project_labels.js +15 -0
  140. package/lib/converters/gitlab/project_milestones.d.ts +8 -0
  141. package/lib/converters/gitlab/project_milestones.js +41 -0
  142. package/lib/converters/gitlab/projects.d.ts +7 -0
  143. package/lib/converters/gitlab/projects.js +51 -0
  144. package/lib/converters/gitlab/releases.d.ts +10 -0
  145. package/lib/converters/gitlab/releases.js +68 -0
  146. package/lib/converters/gitlab/tags.d.ts +10 -0
  147. package/lib/converters/gitlab/tags.js +41 -0
  148. package/lib/converters/gitlab/users.d.ts +7 -0
  149. package/lib/converters/gitlab/users.js +33 -0
  150. package/lib/converters/googlecalendar/calendar_models.d.ts +618 -0
  151. package/lib/converters/googlecalendar/calendar_models.js +2 -0
  152. package/lib/converters/googlecalendar/calendars.d.ts +7 -0
  153. package/lib/converters/googlecalendar/calendars.js +29 -0
  154. package/lib/converters/googlecalendar/common.d.ts +52 -0
  155. package/lib/converters/googlecalendar/common.js +130 -0
  156. package/lib/converters/googlecalendar/events.d.ts +8 -0
  157. package/lib/converters/googlecalendar/events.js +117 -0
  158. package/lib/converters/harness/common.d.ts +105 -0
  159. package/lib/converters/harness/common.js +16 -0
  160. package/lib/converters/harness/executions.d.ts +15 -0
  161. package/lib/converters/harness/executions.js +245 -0
  162. package/lib/converters/jenkins/builds.d.ts +9 -0
  163. package/lib/converters/jenkins/builds.js +74 -0
  164. package/lib/converters/jenkins/common.d.ts +25 -0
  165. package/lib/converters/jenkins/common.js +54 -0
  166. package/lib/converters/jenkins/jobs.d.ts +8 -0
  167. package/lib/converters/jenkins/jobs.js +29 -0
  168. package/lib/converters/jira/board_issues.d.ts +7 -0
  169. package/lib/converters/jira/board_issues.js +28 -0
  170. package/lib/converters/jira/boards.d.ts +7 -0
  171. package/lib/converters/jira/boards.js +34 -0
  172. package/lib/converters/jira/common.d.ts +61 -0
  173. package/lib/converters/jira/common.js +64 -0
  174. package/lib/converters/jira/epics.d.ts +8 -0
  175. package/lib/converters/jira/epics.js +45 -0
  176. package/lib/converters/jira/issue_fields.d.ts +7 -0
  177. package/lib/converters/jira/issue_fields.js +15 -0
  178. package/lib/converters/jira/issues.d.ts +52 -0
  179. package/lib/converters/jira/issues.js +545 -0
  180. package/lib/converters/jira/project_versions.d.ts +9 -0
  181. package/lib/converters/jira/project_versions.js +48 -0
  182. package/lib/converters/jira/projects.d.ts +7 -0
  183. package/lib/converters/jira/projects.js +40 -0
  184. package/lib/converters/jira/pull_requests.d.ts +7 -0
  185. package/lib/converters/jira/pull_requests.js +15 -0
  186. package/lib/converters/jira/sprint_issues.d.ts +7 -0
  187. package/lib/converters/jira/sprint_issues.js +15 -0
  188. package/lib/converters/jira/sprints.d.ts +16 -0
  189. package/lib/converters/jira/sprints.js +80 -0
  190. package/lib/converters/jira/users.d.ts +8 -0
  191. package/lib/converters/jira/users.js +33 -0
  192. package/lib/converters/jira/workflow_statuses.d.ts +7 -0
  193. package/lib/converters/jira/workflow_statuses.js +15 -0
  194. package/lib/converters/jsonata.d.ts +17 -0
  195. package/lib/converters/jsonata.js +47 -0
  196. package/lib/converters/okta/common.d.ts +8 -0
  197. package/lib/converters/okta/common.js +17 -0
  198. package/lib/converters/okta/groups.d.ts +7 -0
  199. package/lib/converters/okta/groups.js +47 -0
  200. package/lib/converters/okta/models.d.ts +102 -0
  201. package/lib/converters/okta/models.js +2 -0
  202. package/lib/converters/okta/users.d.ts +8 -0
  203. package/lib/converters/okta/users.js +73 -0
  204. package/lib/converters/okta_faros/common.d.ts +4 -0
  205. package/lib/converters/okta_faros/common.js +11 -0
  206. package/lib/converters/okta_faros/groups.d.ts +13 -0
  207. package/lib/converters/okta_faros/groups.js +23 -0
  208. package/lib/converters/okta_faros/users.d.ts +13 -0
  209. package/lib/converters/okta_faros/users.js +23 -0
  210. package/lib/converters/pagerduty/common.d.ts +37 -0
  211. package/lib/converters/pagerduty/common.js +40 -0
  212. package/lib/converters/pagerduty/incident_log_entries.d.ts +8 -0
  213. package/lib/converters/pagerduty/incident_log_entries.js +56 -0
  214. package/lib/converters/pagerduty/incidents.d.ts +10 -0
  215. package/lib/converters/pagerduty/incidents.js +127 -0
  216. package/lib/converters/pagerduty/priorities_resource.d.ts +11 -0
  217. package/lib/converters/pagerduty/priorities_resource.js +64 -0
  218. package/lib/converters/pagerduty/users.d.ts +7 -0
  219. package/lib/converters/pagerduty/users.js +26 -0
  220. package/lib/converters/phabricator/commits.d.ts +8 -0
  221. package/lib/converters/phabricator/commits.js +75 -0
  222. package/lib/converters/phabricator/common.d.ts +40 -0
  223. package/lib/converters/phabricator/common.js +107 -0
  224. package/lib/converters/phabricator/repositories.d.ts +7 -0
  225. package/lib/converters/phabricator/repositories.js +56 -0
  226. package/lib/converters/phabricator/revisions.d.ts +7 -0
  227. package/lib/converters/phabricator/revisions.js +83 -0
  228. package/lib/converters/phabricator/users.d.ts +7 -0
  229. package/lib/converters/phabricator/users.js +39 -0
  230. package/lib/converters/shortcut/common.d.ts +16 -0
  231. package/lib/converters/shortcut/common.js +68 -0
  232. package/lib/converters/shortcut/epics.d.ts +7 -0
  233. package/lib/converters/shortcut/epics.js +29 -0
  234. package/lib/converters/shortcut/iterations.d.ts +7 -0
  235. package/lib/converters/shortcut/iterations.js +29 -0
  236. package/lib/converters/shortcut/members.d.ts +7 -0
  237. package/lib/converters/shortcut/members.js +26 -0
  238. package/lib/converters/shortcut/models.d.ts +392 -0
  239. package/lib/converters/shortcut/models.js +30 -0
  240. package/lib/converters/shortcut/projects.d.ts +7 -0
  241. package/lib/converters/shortcut/projects.js +46 -0
  242. package/lib/converters/shortcut/stories.d.ts +7 -0
  243. package/lib/converters/shortcut/stories.js +127 -0
  244. package/lib/converters/squadcast/common.d.ts +169 -0
  245. package/lib/converters/squadcast/common.js +62 -0
  246. package/lib/converters/squadcast/events.d.ts +9 -0
  247. package/lib/converters/squadcast/events.js +53 -0
  248. package/lib/converters/squadcast/incidents.d.ts +10 -0
  249. package/lib/converters/squadcast/incidents.js +141 -0
  250. package/lib/converters/squadcast/services.d.ts +7 -0
  251. package/lib/converters/squadcast/services.js +28 -0
  252. package/lib/converters/squadcast/users.d.ts +7 -0
  253. package/lib/converters/squadcast/users.js +27 -0
  254. package/lib/converters/statuspage/common.d.ts +93 -0
  255. package/lib/converters/statuspage/common.js +80 -0
  256. package/lib/converters/statuspage/incident_updates.d.ts +8 -0
  257. package/lib/converters/statuspage/incident_updates.js +45 -0
  258. package/lib/converters/statuspage/incidents.d.ts +10 -0
  259. package/lib/converters/statuspage/incidents.js +128 -0
  260. package/lib/converters/statuspage/users.d.ts +7 -0
  261. package/lib/converters/statuspage/users.js +26 -0
  262. package/lib/converters/victorops/common.d.ts +16 -0
  263. package/lib/converters/victorops/common.js +24 -0
  264. package/lib/converters/victorops/incidents.d.ts +12 -0
  265. package/lib/converters/victorops/incidents.js +209 -0
  266. package/lib/converters/victorops/teams.d.ts +8 -0
  267. package/lib/converters/victorops/teams.js +30 -0
  268. package/lib/converters/victorops/users.d.ts +8 -0
  269. package/lib/converters/victorops/users.js +33 -0
  270. package/lib/destination-runner.d.ts +12 -0
  271. package/lib/destination-runner.js +22 -0
  272. package/lib/destination.d.ts +42 -0
  273. package/lib/destination.js +508 -0
  274. package/lib/index.d.ts +16 -0
  275. package/lib/index.js +39 -0
  276. package/lib/tsconfig.tsbuildinfo +1 -0
  277. package/package.json +71 -0
  278. package/resources/fetch-primary-keys.sql +16 -0
  279. package/resources/introspection-query.gql +61 -0
  280. package/resources/spec.json +468 -0
@@ -0,0 +1,169 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { Converter, StreamContext } from '../converter';
3
+ export declare type ApplicationMapping = Record<string, {
4
+ name: string;
5
+ platform?: string;
6
+ }>;
7
+ interface SquadcastConfig {
8
+ application_mapping?: ApplicationMapping;
9
+ }
10
+ export declare enum IncidentEventTypeCategory {
11
+ Created = "Created",
12
+ Acknowledged = "Acknowledged",
13
+ Resolved = "Resolved",
14
+ Custom = "Custom"
15
+ }
16
+ export declare enum IncidentStatusCategory {
17
+ Identified = "Identified",
18
+ Investigating = "Investigating",
19
+ Monitoring = "Monitoring",
20
+ Resolved = "Resolved",
21
+ Custom = "Custom"
22
+ }
23
+ export interface IncidentPriority {
24
+ category: IncidentPriorityCategory;
25
+ detail: string;
26
+ }
27
+ export declare enum IncidentPriorityCategory {
28
+ Critical = "Critical",
29
+ High = "High",
30
+ Medium = "Medium",
31
+ Low = "Low",
32
+ Custom = "Custom"
33
+ }
34
+ export declare enum IncidentSeverityCategory {
35
+ Sev1 = "Sev1",
36
+ Sev2 = "Sev2",
37
+ Sev3 = "Sev3",
38
+ Sev4 = "Sev4",
39
+ Sev5 = "Sev5",
40
+ Custom = "Custom"
41
+ }
42
+ export interface IncidentSeverity {
43
+ category: IncidentSeverityCategory;
44
+ detail: string;
45
+ }
46
+ interface Assignee {
47
+ id: string;
48
+ type: string;
49
+ }
50
+ interface Log {
51
+ action: string;
52
+ assignedTo: string;
53
+ id: string;
54
+ time: string;
55
+ reason: string;
56
+ additionalInfo: any | null;
57
+ }
58
+ declare type Tags = Record<string, Tag> | null;
59
+ interface Tag {
60
+ value: string;
61
+ color: string;
62
+ }
63
+ export interface Event {
64
+ incident_id: string;
65
+ alert_source_id: string;
66
+ message: string;
67
+ description: string;
68
+ time_of_creation: string;
69
+ tags: Tags;
70
+ deduplication_reason?: {
71
+ matched_event_id: string;
72
+ evaluated_expression: string;
73
+ time_window: number;
74
+ };
75
+ payload: {
76
+ description: string;
77
+ event_id?: string;
78
+ message: string;
79
+ metric?: {
80
+ absolute: {
81
+ current_value: number;
82
+ threshold: number;
83
+ unit: string;
84
+ };
85
+ pod: string;
86
+ relative: {
87
+ current_value: number;
88
+ threshold: number;
89
+ };
90
+ time: string;
91
+ };
92
+ status?: string;
93
+ assignee?: {
94
+ id: string;
95
+ type: string;
96
+ };
97
+ created_by?: string;
98
+ tags?: Tags;
99
+ };
100
+ }
101
+ export interface Incident {
102
+ id: string;
103
+ title: string;
104
+ description: string;
105
+ status: string;
106
+ service: string;
107
+ alert_source: string;
108
+ assignee: string;
109
+ created_at: string;
110
+ acknowledged_at: string;
111
+ resolved_at: string;
112
+ tags: Tags;
113
+ event_count: number;
114
+ 'tta (ms)': number;
115
+ 'ttr (ms)': number;
116
+ logs: Log[];
117
+ url: string;
118
+ }
119
+ export interface Service {
120
+ id: string;
121
+ name: string;
122
+ slug: string;
123
+ email: string;
124
+ escalation_policy_id: string;
125
+ organization_id: string;
126
+ api_key: string;
127
+ description: string;
128
+ depends: any[] | null;
129
+ owner?: Assignee;
130
+ access_control: any | null;
131
+ on_maintenance: boolean;
132
+ escalation_policy: {
133
+ id: string;
134
+ name: string;
135
+ description: string;
136
+ slug: string;
137
+ };
138
+ }
139
+ export interface User {
140
+ id: string;
141
+ first_name: string;
142
+ last_name: string;
143
+ email: string;
144
+ contact: {
145
+ dial_code: string;
146
+ phone_number: string;
147
+ };
148
+ secondary_emails: string[];
149
+ email_verified: boolean;
150
+ phone_verified: boolean;
151
+ in_grace_period: boolean;
152
+ time_zone: string;
153
+ title: string;
154
+ bio: string;
155
+ role_id: string;
156
+ role: string;
157
+ }
158
+ export declare class SquadcastCommon {
159
+ static readonly MAX_DESCRIPTION_LENGTH = 1000;
160
+ }
161
+ /** SquadCast converter base */
162
+ export declare abstract class SquadcastConverter extends Converter {
163
+ source: string;
164
+ /** Almost every SquadCast record have id property */
165
+ id(record: AirbyteRecord): any;
166
+ protected squadcastConfig(ctx: StreamContext): SquadcastConfig;
167
+ protected applicationMapping(ctx: StreamContext): ApplicationMapping;
168
+ }
169
+ export {};
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SquadcastConverter = exports.SquadcastCommon = exports.IncidentSeverityCategory = exports.IncidentPriorityCategory = exports.IncidentStatusCategory = exports.IncidentEventTypeCategory = void 0;
4
+ const converter_1 = require("../converter");
5
+ var IncidentEventTypeCategory;
6
+ (function (IncidentEventTypeCategory) {
7
+ IncidentEventTypeCategory["Created"] = "Created";
8
+ IncidentEventTypeCategory["Acknowledged"] = "Acknowledged";
9
+ IncidentEventTypeCategory["Resolved"] = "Resolved";
10
+ IncidentEventTypeCategory["Custom"] = "Custom";
11
+ })(IncidentEventTypeCategory = exports.IncidentEventTypeCategory || (exports.IncidentEventTypeCategory = {}));
12
+ var IncidentStatusCategory;
13
+ (function (IncidentStatusCategory) {
14
+ IncidentStatusCategory["Identified"] = "Identified";
15
+ IncidentStatusCategory["Investigating"] = "Investigating";
16
+ IncidentStatusCategory["Monitoring"] = "Monitoring";
17
+ IncidentStatusCategory["Resolved"] = "Resolved";
18
+ IncidentStatusCategory["Custom"] = "Custom";
19
+ })(IncidentStatusCategory = exports.IncidentStatusCategory || (exports.IncidentStatusCategory = {}));
20
+ var IncidentPriorityCategory;
21
+ (function (IncidentPriorityCategory) {
22
+ IncidentPriorityCategory["Critical"] = "Critical";
23
+ IncidentPriorityCategory["High"] = "High";
24
+ IncidentPriorityCategory["Medium"] = "Medium";
25
+ IncidentPriorityCategory["Low"] = "Low";
26
+ IncidentPriorityCategory["Custom"] = "Custom";
27
+ })(IncidentPriorityCategory = exports.IncidentPriorityCategory || (exports.IncidentPriorityCategory = {}));
28
+ var IncidentSeverityCategory;
29
+ (function (IncidentSeverityCategory) {
30
+ IncidentSeverityCategory["Sev1"] = "Sev1";
31
+ IncidentSeverityCategory["Sev2"] = "Sev2";
32
+ IncidentSeverityCategory["Sev3"] = "Sev3";
33
+ IncidentSeverityCategory["Sev4"] = "Sev4";
34
+ IncidentSeverityCategory["Sev5"] = "Sev5";
35
+ IncidentSeverityCategory["Custom"] = "Custom";
36
+ })(IncidentSeverityCategory = exports.IncidentSeverityCategory || (exports.IncidentSeverityCategory = {}));
37
+ class SquadcastCommon {
38
+ }
39
+ exports.SquadcastCommon = SquadcastCommon;
40
+ // Max length for free-form description text fields such as issue body
41
+ SquadcastCommon.MAX_DESCRIPTION_LENGTH = 1000;
42
+ /** SquadCast converter base */
43
+ class SquadcastConverter extends converter_1.Converter {
44
+ constructor() {
45
+ super(...arguments);
46
+ this.source = 'SquadCast';
47
+ }
48
+ /** Almost every SquadCast record have id property */
49
+ id(record) {
50
+ var _a, _b;
51
+ 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;
52
+ }
53
+ squadcastConfig(ctx) {
54
+ var _a, _b;
55
+ return (_b = (_a = ctx.config.source_specific_configs) === null || _a === void 0 ? void 0 : _a.squadcast) !== null && _b !== void 0 ? _b : {};
56
+ }
57
+ applicationMapping(ctx) {
58
+ var _a, _b;
59
+ return ((_b = (0, converter_1.parseObjectConfig)((_a = this.squadcastConfig(ctx)) === null || _a === void 0 ? void 0 : _a.application_mapping, 'Application Mapping')) !== null && _b !== void 0 ? _b : {});
60
+ }
61
+ }
62
+ exports.SquadcastConverter = SquadcastConverter;
@@ -0,0 +1,9 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
+ import { SquadcastConverter } from './common';
4
+ export declare class Events extends SquadcastConverter {
5
+ id(record: AirbyteRecord): string;
6
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
7
+ convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
8
+ private toEventType;
9
+ }
@@ -0,0 +1,53 @@
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.SquadcastConverter {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.destinationModels = [
10
+ 'ims_IncidentEvent',
11
+ ];
12
+ }
13
+ id(record) {
14
+ var _a, _b;
15
+ 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.alert_source_id;
16
+ }
17
+ async convert(record, ctx) {
18
+ var _a, _b, _c;
19
+ const source = this.streamName.source;
20
+ const event = record.record.data;
21
+ const status = (_a = event === null || event === void 0 ? void 0 : event.payload) === null || _a === void 0 ? void 0 : _a.status;
22
+ // Event ID can be undefined. It maybe because incident has one event
23
+ const DEFAULT_EVENT_ID = 1;
24
+ return [
25
+ {
26
+ model: 'ims_IncidentEvent',
27
+ record: {
28
+ uid: (_c = (_b = event === null || event === void 0 ? void 0 : event.payload) === null || _b === void 0 ? void 0 : _b.event_id) !== null && _c !== void 0 ? _c : String(DEFAULT_EVENT_ID),
29
+ type: status && this.toEventType(status),
30
+ createdAt: faros_feeds_sdk_1.Utils.toDate(event.time_of_creation),
31
+ detail: event.message,
32
+ incident: { uid: event.incident_id, source },
33
+ },
34
+ },
35
+ ];
36
+ }
37
+ toEventType(status) {
38
+ const detail = status.toLowerCase();
39
+ switch (detail) {
40
+ case 'investigating':
41
+ case 'triggered':
42
+ return { category: common_1.IncidentEventTypeCategory.Created, detail };
43
+ case 'identified':
44
+ case 'acknowledged':
45
+ return { category: common_1.IncidentEventTypeCategory.Acknowledged, detail };
46
+ case 'resolved':
47
+ return { category: common_1.IncidentEventTypeCategory.Resolved, detail };
48
+ default:
49
+ return { category: common_1.IncidentEventTypeCategory.Custom, detail };
50
+ }
51
+ }
52
+ }
53
+ exports.Events = Events;
@@ -0,0 +1,10 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
+ import { SquadcastConverter } from './common';
4
+ export declare class Incidents extends SquadcastConverter {
5
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
6
+ convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
7
+ private toPriority;
8
+ private toSeverity;
9
+ private toIncidentStatus;
10
+ }
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Incidents = void 0;
4
+ const faros_feeds_sdk_1 = require("faros-feeds-sdk");
5
+ const common_1 = require("./common");
6
+ class Incidents extends common_1.SquadcastConverter {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.destinationModels = [
10
+ 'compute_Application',
11
+ 'ims_Incident',
12
+ 'ims_IncidentApplicationImpact',
13
+ 'ims_Label',
14
+ ];
15
+ }
16
+ async convert(record, ctx) {
17
+ var _a, _b;
18
+ const source = this.streamName.source;
19
+ const incident = record.record.data;
20
+ const res = [];
21
+ const incidentRef = { uid: incident.id, source };
22
+ const createdAt = faros_feeds_sdk_1.Utils.toDate(incident.created_at);
23
+ const acknowledgedAt = faros_feeds_sdk_1.Utils.toDate(incident.acknowledged_at);
24
+ const resolvedAt = faros_feeds_sdk_1.Utils.toDate(incident.resolved_at);
25
+ let updatedAt = resolvedAt > acknowledgedAt ? resolvedAt : acknowledgedAt;
26
+ if (createdAt > updatedAt) {
27
+ updatedAt = createdAt;
28
+ }
29
+ const status = incident.status && this.toIncidentStatus(incident.status);
30
+ /** SquadCast doesn't have incident severity and priority, take "severity" and "priority" from tags */
31
+ let priority;
32
+ let severity;
33
+ Object.entries(incident.tags || {}).forEach(([name, tag]) => {
34
+ if (tag.value) {
35
+ if (name === 'severity') {
36
+ severity = this.toSeverity(tag.value);
37
+ }
38
+ if (name === 'priority') {
39
+ priority = this.toPriority(tag.value);
40
+ }
41
+ }
42
+ const label = { name };
43
+ res.push({
44
+ model: 'ims_Label',
45
+ record: label,
46
+ });
47
+ res.push({
48
+ model: 'ims_IncidentTag',
49
+ record: {
50
+ incident: incidentRef,
51
+ label,
52
+ },
53
+ });
54
+ });
55
+ res.push({
56
+ model: 'ims_Incident',
57
+ record: {
58
+ ...incidentRef,
59
+ title: incident.title,
60
+ description: (_a = incident.description) === null || _a === void 0 ? void 0 : _a.substring(0, common_1.SquadcastCommon.MAX_DESCRIPTION_LENGTH),
61
+ createdAt,
62
+ updatedAt,
63
+ acknowledgedAt,
64
+ resolvedAt,
65
+ priority,
66
+ severity,
67
+ status,
68
+ },
69
+ });
70
+ if (incident.service) {
71
+ const applicationMapping = this.applicationMapping(ctx);
72
+ let application = { name: incident.service, platform: '' };
73
+ if (incident.service in applicationMapping &&
74
+ applicationMapping[incident.service].name) {
75
+ const mappedApp = applicationMapping[incident.service];
76
+ application = {
77
+ name: mappedApp.name,
78
+ platform: (_b = mappedApp.platform) !== null && _b !== void 0 ? _b : application.platform,
79
+ };
80
+ }
81
+ res.push({
82
+ model: 'ims_IncidentApplicationImpact',
83
+ record: {
84
+ incident: incidentRef,
85
+ application,
86
+ },
87
+ });
88
+ }
89
+ return res;
90
+ }
91
+ toPriority(priority) {
92
+ const detail = priority.toLowerCase();
93
+ switch (detail) {
94
+ case 'critical':
95
+ return { category: common_1.IncidentPriorityCategory.Critical, detail };
96
+ case 'high':
97
+ return { category: common_1.IncidentPriorityCategory.High, detail };
98
+ case 'medium':
99
+ return { category: common_1.IncidentPriorityCategory.Medium, detail };
100
+ case 'low':
101
+ return { category: common_1.IncidentPriorityCategory.Low, detail };
102
+ default:
103
+ return { category: common_1.IncidentPriorityCategory.Custom, detail };
104
+ }
105
+ }
106
+ toSeverity(severity) {
107
+ const detail = severity.toLowerCase();
108
+ switch (detail) {
109
+ case 'sev1':
110
+ return { category: common_1.IncidentSeverityCategory.Sev1, detail };
111
+ case 'sev2':
112
+ return { category: common_1.IncidentSeverityCategory.Sev2, detail };
113
+ case 'sev3':
114
+ return { category: common_1.IncidentSeverityCategory.Sev3, detail };
115
+ case 'sev4':
116
+ return { category: common_1.IncidentSeverityCategory.Sev4, detail };
117
+ case 'sev5':
118
+ return { category: common_1.IncidentSeverityCategory.Sev5, detail };
119
+ default:
120
+ return { category: common_1.IncidentSeverityCategory.Custom, detail };
121
+ }
122
+ }
123
+ toIncidentStatus(incidentState) {
124
+ const detail = incidentState.toLowerCase();
125
+ switch (incidentState) {
126
+ case 'investigating':
127
+ case 'triggered':
128
+ return { category: common_1.IncidentStatusCategory.Investigating, detail };
129
+ case 'identified':
130
+ case 'acknowledged':
131
+ return { category: common_1.IncidentStatusCategory.Identified, detail };
132
+ case 'monitoring':
133
+ return { category: common_1.IncidentStatusCategory.Monitoring, detail };
134
+ case 'resolved':
135
+ return { category: common_1.IncidentStatusCategory.Resolved, detail };
136
+ default:
137
+ return { category: common_1.IncidentStatusCategory.Custom, detail };
138
+ }
139
+ }
140
+ }
141
+ exports.Incidents = Incidents;
@@ -0,0 +1,7 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
+ import { SquadcastConverter } from './common';
4
+ export declare class Services extends SquadcastConverter {
5
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
6
+ convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
7
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Services = void 0;
4
+ const common_1 = require("./common");
5
+ class Services extends common_1.SquadcastConverter {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.destinationModels = [
9
+ 'compute_Application',
10
+ ];
11
+ }
12
+ async convert(record, ctx) {
13
+ var _a;
14
+ const service = record.record.data;
15
+ const applicationMapping = this.applicationMapping(ctx);
16
+ let application = { name: service.name, platform: '' };
17
+ if (service.name in applicationMapping &&
18
+ applicationMapping[service.name].name) {
19
+ const mappedApp = applicationMapping[service.name];
20
+ application = {
21
+ name: mappedApp.name,
22
+ platform: (_a = mappedApp.platform) !== null && _a !== void 0 ? _a : application.platform,
23
+ };
24
+ }
25
+ return [{ model: 'compute_Application', record: application }];
26
+ }
27
+ }
28
+ exports.Services = Services;
@@ -0,0 +1,7 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
3
+ import { SquadcastConverter } from './common';
4
+ export declare class Users extends SquadcastConverter {
5
+ readonly destinationModels: ReadonlyArray<DestinationModel>;
6
+ convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
7
+ }
@@ -0,0 +1,27 @@
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.SquadcastConverter {
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
+ const username = `${user.first_name} ${user.last_name}`;
14
+ return [
15
+ {
16
+ model: 'ims_User',
17
+ record: {
18
+ uid: user.id,
19
+ email: user.email,
20
+ name: username,
21
+ source,
22
+ },
23
+ },
24
+ ];
25
+ }
26
+ }
27
+ exports.Users = Users;
@@ -0,0 +1,93 @@
1
+ import { AirbyteRecord } from 'faros-airbyte-cdk';
2
+ import { Converter, StreamContext } from '../converter';
3
+ declare type ApplicationMapping = Record<string, {
4
+ name: string;
5
+ platform?: string;
6
+ }>;
7
+ interface StatusPageConfig {
8
+ application_mapping?: ApplicationMapping;
9
+ }
10
+ export interface Component {
11
+ created_at: string;
12
+ description: string | null;
13
+ group: boolean;
14
+ group_id: string | null;
15
+ id: string;
16
+ name: string;
17
+ only_show_if_degraded: boolean;
18
+ page_id: string;
19
+ position: number;
20
+ showcase: boolean;
21
+ start_date: string | null;
22
+ status: string;
23
+ updated_at: string;
24
+ }
25
+ export declare enum ComponentStatus {
26
+ degraded_performance = "degraded_performance",
27
+ major_outage = "major_outage",
28
+ operational = "operational",
29
+ partial_outage = "partial_outage",
30
+ under_maintenance = "under_maintenance"
31
+ }
32
+ export declare enum IncidentEventTypeCategory {
33
+ Created = "Created",
34
+ Acknowledged = "Acknowledged",
35
+ Resolved = "Resolved",
36
+ Custom = "Custom"
37
+ }
38
+ export interface IncidentEventType {
39
+ category: IncidentEventTypeCategory;
40
+ detail: string;
41
+ }
42
+ export declare enum StatuspageIncidentImpact {
43
+ Critical = "critical",
44
+ Major = "major",
45
+ Minor = "minor",
46
+ None = "none"
47
+ }
48
+ export declare enum StatuspageIncidentStatus {
49
+ Identified = "identified",
50
+ Investigating = "investigating",
51
+ Monitoring = "monitoring",
52
+ Postmortem = "postmortem",
53
+ Resolved = "resolved"
54
+ }
55
+ export declare enum IncidentStatusCategory {
56
+ Identified = "Identified",
57
+ Investigating = "Investigating",
58
+ Monitoring = "Monitoring",
59
+ Resolved = "Resolved",
60
+ Custom = "Custom"
61
+ }
62
+ export interface IncidentPriority {
63
+ category: IncidentPriorityCategory;
64
+ detail: string;
65
+ }
66
+ export declare enum IncidentPriorityCategory {
67
+ Critical = "Critical",
68
+ High = "High",
69
+ Medium = "Medium",
70
+ Low = "Low",
71
+ Custom = "Custom"
72
+ }
73
+ export declare enum IncidentSeverityCategory {
74
+ Sev1 = "Sev1",
75
+ Sev2 = "Sev2",
76
+ Sev3 = "Sev3",
77
+ Sev4 = "Sev4",
78
+ Sev5 = "Sev5",
79
+ Custom = "Custom"
80
+ }
81
+ export interface IncidentSeverity {
82
+ category: IncidentSeverityCategory;
83
+ detail: string;
84
+ }
85
+ /** StatusPage converter base */
86
+ export declare abstract class StatusPageConverter extends Converter {
87
+ source: string;
88
+ /** Every StatusPage record have id property */
89
+ id(record: AirbyteRecord): any;
90
+ protected statuspageConfig(ctx: StreamContext): StatusPageConfig;
91
+ protected applicationMapping(ctx: StreamContext): ApplicationMapping;
92
+ }
93
+ export {};