Skip to content

Commit

Permalink
chore: consolidate types in plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolorentedev committed Sep 1, 2024
1 parent d1768d1 commit f1245b6
Show file tree
Hide file tree
Showing 32 changed files with 150 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser",
"settings": {
"import/resolver": {
"typescript": {}
}
},
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
Expand Down
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
104 changes: 104 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"electron-squirrel-startup": "1.0.1",
"electron-store": "8.1.0",
"eslint": "^8.0.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.25.0",
"fast-xml-parser": "4.4.1",
"husky": "9.1.4",
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/azureDevOps/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AzureDevOpsConfiguration } from '../../../types/AzureDevOpsConfiguration';
import { AzureDevOpsConfiguration } from '../type';
import { AzureDevOps } from '.';
import { expect, describe, it, vi, beforeEach } from 'vitest';
import { faker } from '@faker-js/faker';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/azureDevOps/observer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Observer } from '../../../types/Observer';
import { State } from '../../../types/State';
import { Status } from '../../../types/Status';
import { getPersonalAccessTokenHandler, WebApi } from 'azure-devops-node-api';
import { AzureDevOpsConfiguration } from '../../../types/AzureDevOpsConfiguration';
import { AzureDevOpsConfiguration } from '../type';
import { RunResult, RunState } from 'azure-devops-node-api/interfaces/PipelinesInterfaces';

export class AzureDevOps implements Observer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '../../../types/ObserverConfiguration';

export type AzureDevOpsConfiguration = ObserverConfiguration & {
authToken: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/bitbucket/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { expect, describe, it, vi, beforeEach } from 'vitest';
import { BitbucketConfiguration } from '../../../types/BitbucketConfiguration';
import { BitbucketConfiguration } from '../type';
import { Bitbucket } from './';

const fetchtMock = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/bitbucket/observer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { State } from '../../../types/State';
import { Observer } from '../../../types/Observer';
import { Status } from '../../../types/Status';
import fetch from 'electron-fetch';
import { BitbucketConfiguration } from '../../../types/BitbucketConfiguration';
import { BitbucketConfiguration } from '../type';

export class Bitbucket implements Observer {
private readonly apiUrl: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type BitbucketConfiguration = ObserverConfiguration & {
workspace: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/cctray/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CCTray } from './';
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { CCTrayConfiguration } from '../../../types/CCTrayConfiguration';
import { CCTrayConfiguration } from '../type';
import { expect, describe, it, vi, beforeEach } from 'vitest';

const fetchtMock = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/cctray/observer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { State } from '../../../types/State';
import { Observer } from '../../../types/Observer';
import { CCTrayConfiguration } from '../../../types/CCTrayConfiguration';
import { CCTrayConfiguration } from '../type';
import { Status } from '../../../types/Status';
import { XMLParser } from 'fast-xml-parser';
import fetch from 'electron-fetch';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type CCTrayConfiguration = ObserverConfiguration & {
url: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/datadog/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DatadogMonitor } from '.';
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { DetadogMonitorConfiguration } from '../../../types/DetadogMonitorConfiguration';
import { DetadogMonitorConfiguration } from '../type';
import { v1 } from '@datadog/datadog-api-client';
import { ServerConfiguration } from '@datadog/datadog-api-client/dist/packages/datadog-api-client-common';
import { expect, describe, it, vi, beforeEach } from 'vitest';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/datadog/observer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { State } from '../../../types/State';
import { Observer } from '../../../types/Observer';
import { DetadogMonitorConfiguration } from '../../../types/DetadogMonitorConfiguration';
import { DetadogMonitorConfiguration } from '../type';
import { client, v1 } from '@datadog/datadog-api-client';
import { Status } from '../../../types/Status';
import { ServerConfiguration } from '@datadog/datadog-api-client/dist/packages/datadog-api-client-common';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type DetadogMonitorConfiguration = ObserverConfiguration & {
site: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/github/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GithubActionConfiguration } from '../../../types/GithubActionConfiguration';
import { GithubActionConfiguration } from '../type';
import { GithubAction } from '.';
import { expect, describe, it, vi, beforeEach } from 'vitest';
import { faker } from '@faker-js/faker';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/github/observer/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Octokit } from 'octokit';
import { Observer } from '../../../types/Observer';
import { State } from '../../../types/State';
import { GithubActionConfiguration } from '../../../types/GithubActionConfiguration';
import { GithubActionConfiguration } from '../type';
import { Status } from '../../../types/Status';

export class GithubAction implements Observer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type GithubActionConfiguration = ObserverConfiguration & {
authToken: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/grafana/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { expect, describe, it, vi, beforeEach } from 'vitest';
import { GrafanaConfiguration } from '../../../types/GrafanaConfiguration';
import { GrafanaConfiguration } from '../type';
import { Grafana } from './';

const fetchtMock = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/grafana/observer/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { State } from '../../../types/State';
import { Observer } from '../../../types/Observer';
import { Status } from '../../../types/Status';
import { GrafanaConfiguration } from '../../../types/GrafanaConfiguration';
import { GrafanaConfiguration } from '../type';
import fetch from 'electron-fetch';

export class Grafana implements Observer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type GrafanaConfiguration = ObserverConfiguration & {
url: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/newRelic/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { NewRelicConfiguration } from '../../../types/NewRelicConfiguration';
import { NewRelicConfiguration } from '../type';
import { NewRelic } from '.';
import { expect, describe, it, vi, beforeEach } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/newRelic/observer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { State } from '../../../types/State';
import { Observer } from '../../../types/Observer';
import { NewRelicConfiguration } from '../../../types/NewRelicConfiguration';
import { NewRelicConfiguration } from '../type';
import { Status } from '../../../types/Status';
import fetch from 'electron-fetch';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type NewRelicConfiguration = ObserverConfiguration & {
site: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/opsgenie/observer/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Opsgenie } from '.';
import { expect, describe, it, vi, beforeEach } from 'vitest';
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { OpsgenieConfiguration } from '../../../types/OpsgenieConfiguration';
import { OpsgenieConfiguration } from '../type';

const configureMock = vi.fn();
const getAlertV2Mock = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/opsgenie/observer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Observer } from '../../../types/Observer';
import { State } from '../../../types/State';
import { Status } from '../../../types/Status';
import opsgenie from 'opsgenie-sdk';
import { OpsgenieConfiguration } from '../../../types/OpsgenieConfiguration';
import { OpsgenieConfiguration } from '../type';

const promisify =
(fun: any) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type OpsgenieConfiguration = ObserverConfiguration & {
apiKey: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/sentry/observer/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Sentry } from '.';
import { faker } from '@faker-js/faker';
import { Status } from '../../../types/Status';
import { SentryConfiguration } from '../../../types/SentryConfiguration';
import { SentryConfiguration } from '../type';
import { expect, describe, it, vi, beforeEach } from 'vitest';

const fetchtMock = vi.fn();
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/sentry/observer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { State } from '../../../types/State';
import { Observer } from '../../../types/Observer';
import { SentryConfiguration } from '../../../types/SentryConfiguration';
import { SentryConfiguration } from '../type';
import { Status } from '../../../types/Status';
import fetch from 'electron-fetch';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObserverConfiguration } from './ObserverConfiguration';
import { ObserverConfiguration } from '@/src/types/ObserverConfiguration';

export type SentryConfiguration = ObserverConfiguration & {
organization: string;
Expand Down
Loading

0 comments on commit f1245b6

Please sign in to comment.