Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwwinter committed Feb 27, 2024
1 parent cd2cddc commit ec00840
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/couchdb/couch-db-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class CouchDbClient {
return headers['etag'].replaceAll('"', '');
}
}),
catchError((err) => {
catchError(() => {
return of(undefined);
}),
);
Expand Down
9 changes: 2 additions & 7 deletions src/notification/controller/webhook.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export class WebhookController {
) {}

@Get()
fetchWebhooksOfUser(
@Headers('Authorization') token: string,
): Observable<WebhookDto[]> {
fetchWebhooksOfUser(): Observable<WebhookDto[]> {
return this.webhookStorage.fetchAllWebhooks('user-token').pipe(
map((webhooks) => webhooks.map((webhook) => this.mapToDto(webhook))),
zipAll(),
Expand All @@ -34,10 +32,7 @@ export class WebhookController {
}

@Get('/:webhookId')
fetchWebhook(
@Headers('Authorization') token: string,
@Param('webhookId') webhookId: string,
): Observable<WebhookDto> {
fetchWebhook(@Param('webhookId') webhookId: string): Observable<WebhookDto> {
return this.webhookStorage.fetchWebhook(new Reference(webhookId)).pipe(
// TODO: check auth?
map((webhook) => {
Expand Down
3 changes: 1 addition & 2 deletions src/notification/storage/webhook-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ export class WebhookStorage {

/**
* Get all registered webhooks subscribe by the user authenticated with the given token
* @param token
*/
fetchAllWebhooks(token?: string): Observable<Webhook[]> {
fetchAllWebhooks(): Observable<Webhook[]> {
return this.webhookRepository
.fetchAllWebhooks()
.pipe(
Expand Down
15 changes: 12 additions & 3 deletions src/query/domain/EntityConfig.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
export class EntityAttribute {
constructor(public name: string, public type: string) {}
constructor(
public name: string,
public type: string,
) {}
}

export class Entity {
constructor(public label: string, public attributes: EntityAttribute[]) {}
constructor(
public label: string,
public attributes: EntityAttribute[],
) {}
}

export class EntityConfig {
constructor(public version: string, public entities: Entity[]) {}
constructor(
public version: string,
public entities: Entity[],
) {}
}
1 change: 1 addition & 0 deletions src/query/sqs/sqs-schema-generator.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { SqsSchemaService } from './sqs-schema-generator.service';
describe('SchemaGeneratorService', () => {
let service: SqsSchemaService;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const entityConfig = {
'entity:Child': {
label: 'Child',
Expand Down
4 changes: 2 additions & 2 deletions src/report-changes/core/report-change-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class ReportChangeDetector {
}

affectsReport(doc: DocChangeDetails): boolean {
// TODO: consider removing the ReportChangeDetector class completely:
// do all query parsing in ReportSchemaGenerator and implement the conditions directly in ReportChangesService?
// TODO: consider removing the ReportChangeDetector class completely:
// do all query parsing in ReportSchemaGenerator and implement the conditions directly in ReportChangesService?
const entityType = doc.change.id.split(':')[0];
if (!this.sqlTableNames.includes(entityType)) {
return false;
Expand Down
1 change: 1 addition & 0 deletions src/report-changes/core/report-changes.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CreateReportCalculationUseCase } from '../../report/core/use-cases/crea
import { DatabaseChangeResult } from '../storage/database-changes.service';

describe('ReportChangesService', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let service: ReportChangesService;
let mockNotificationService: Partial<NotificationService>;

Expand Down
5 changes: 3 additions & 2 deletions src/report-changes/core/report-changes.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ReportChangesService {
.activeReports()
.subscribe((reports: Reference[]) => {
reports.forEach((r) => this.registerReportMonitoring(r));
for (const [id, monitor] of this.reportMonitors.entries()) {
for (const [id] of this.reportMonitors.entries()) {
if (!reports.some((r) => r.id === id)) {
this.reportMonitors.delete(id);
}
Expand Down Expand Up @@ -104,6 +104,7 @@ export class ReportChangesService {
): Observable<ReportDataChangeEvent[]> {
const affectedReports: Observable<ReportDataChangeEvent>[] = [];

// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const [reportId, changeDetector] of this.reportMonitors.entries()) {
if (!changeDetector.affectsReport(docChange)) {
continue;
Expand Down Expand Up @@ -165,7 +166,7 @@ export class ReportChangesService {
({
report: result.report,
calculation: result,
} as ReportDataChangeEvent),
}) as ReportDataChangeEvent,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ReportCalculationController', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/controller/report.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('ReportController', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/repository/report-repository.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('ReportRepositoryService', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/storage/reporting-storage.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('DefaultReportStorage', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/tasks/report-calculation-processor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ReportCalculationProcessor {
),
);
}),
catchError((err, caught) => {
catchError((err) => {
console.log(err);
return of();
}),
Expand Down
2 changes: 1 addition & 1 deletion src/report/tasks/report-calculation-task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ReportCalculationTask {
throw err;
}),
)
.subscribe((_) => {
.subscribe(() => {
this.logger.log('done');
});
}
Expand Down

0 comments on commit ec00840

Please sign in to comment.