Skip to content

Commit f351f07

Browse files
Merge pull request #1479 from credebl/fix/minor-eslint-issues
Fix/minor eslint issues
2 parents b24c68e + ba5d66c commit f351f07

File tree

17 files changed

+331
-348
lines changed

17 files changed

+331
-348
lines changed

apps/agent-service/test/app.e2e-spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,5 @@ describe('AgentServiceController (e2e)', () => {
1515
await app.init();
1616
});
1717

18-
it('/ (GET)', () => {
19-
return request(app.getHttpServer())
20-
.get('/')
21-
.expect(200)
22-
.expect('Hello World!');
23-
});
18+
it('/ (GET)', () => request(app.getHttpServer()).get('/').expect(200).expect('Hello World!'));
2419
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export declare enum HandshakeProtocol {
2-
Connections = "https://didcomm.org/connections/1.0",
3-
DidExchange = "https://didcomm.org/didexchange/1.0"
4-
}
2+
Connections = 'https://didcomm.org/connections/1.0',
3+
DidExchange = 'https://didcomm.org/didexchange/1.0'
4+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export declare enum HandshakeProtocol {
2-
Connections = "https://didcomm.org/connections/1.0",
3-
DidExchange = "https://didcomm.org/didexchange/1.0"
4-
}
2+
Connections = 'https://didcomm.org/connections/1.0',
3+
DidExchange = 'https://didcomm.org/didexchange/1.0'
4+
}

apps/api-gateway/src/connection/interfaces/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export interface ISelectedOrgInterface {
2626
export interface IOrganizationInterface {
2727
name: string;
2828
description: string;
29-
org_agents: IOrgAgentInterface[]
30-
29+
org_agents: IOrgAgentInterface[];
3130
}
3231

3332
export interface IOrgAgentInterface {
@@ -40,7 +39,6 @@ export interface IOrgAgentInterface {
4039
orgId: string;
4140
}
4241

43-
4442
export class IConnectionInterface {
4543
tag: object;
4644
createdAt: string;
@@ -71,8 +69,8 @@ interface IOutOfBandInvitationService {
7169
}
7270

7371
interface IOutOfBandInvitation {
74-
"@type": string;
75-
"@id": string;
72+
'@type': string;
73+
'@id': string;
7674
label: string;
7775
accept: string[];
7876
handshake_protocols: string[];
@@ -114,4 +112,4 @@ interface IConnectionRecord {
114112
export interface IReceiveInvitationRes {
115113
outOfBandRecord: IOutOfBandRecord;
116114
connectionRecord: IConnectionRecord;
117-
}
115+
}
Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
import { ApiProperty } from "@nestjs/swagger";
2-
import { IsArray, IsNotEmpty, IsString } from "class-validator";
1+
import { ApiProperty } from '@nestjs/swagger';
2+
import { IsArray, IsNotEmpty, IsString } from 'class-validator';
33

44
interface attributeValue {
5-
name: string,
6-
value: string,
5+
name: string;
6+
value: string;
77
}
88

99
export class IssueCredentialOffer {
10+
@ApiProperty({ example: { protocolVersion: 'v1' } })
11+
@IsNotEmpty({ message: 'Please provide valid protocol-version' })
12+
@IsString({ message: 'protocol-version should be string' })
13+
protocolVersion: string;
1014

11-
@ApiProperty({ example: { 'protocolVersion': 'v1' } })
12-
@IsNotEmpty({ message: 'Please provide valid protocol-version' })
13-
@IsString({ message: 'protocol-version should be string' })
14-
protocolVersion: string;
15-
16-
@ApiProperty({ example: { 'attributes': [{ 'value': 'string', 'name': 'string' }] } })
17-
@IsNotEmpty({ message: 'Please provide valid attributes' })
18-
@IsArray({ message: 'attributes should be array' })
19-
attributes: attributeValue[];
15+
@ApiProperty({ example: { attributes: [{ value: 'string', name: 'string' }] } })
16+
@IsNotEmpty({ message: 'Please provide valid attributes' })
17+
@IsArray({ message: 'attributes should be array' })
18+
attributes: attributeValue[];
2019

21-
@ApiProperty({ example: { 'credentialDefinitionId': 'string' } })
22-
@IsNotEmpty({ message: 'Please provide valid credentialDefinitionId' })
23-
@IsString({ message: 'credentialDefinitionId should be string' })
24-
credentialDefinitionId: string;
20+
@ApiProperty({ example: { credentialDefinitionId: 'string' } })
21+
@IsNotEmpty({ message: 'Please provide valid credentialDefinitionId' })
22+
@IsString({ message: 'credentialDefinitionId should be string' })
23+
credentialDefinitionId: string;
2524

26-
@ApiProperty({ example: { autoAcceptCredential: 'always' } })
27-
@IsNotEmpty({ message: 'Please provide valid autoAcceptCredential' })
28-
@IsString({ message: 'autoAcceptCredential should be string' })
29-
autoAcceptCredential: string;
25+
@ApiProperty({ example: { autoAcceptCredential: 'always' } })
26+
@IsNotEmpty({ message: 'Please provide valid autoAcceptCredential' })
27+
@IsString({ message: 'autoAcceptCredential should be string' })
28+
autoAcceptCredential: string;
3029

31-
@ApiProperty({ example: { comment: 'string' } })
32-
@IsNotEmpty({ message: 'Please provide valid comment' })
33-
@IsString({ message: 'comment should be string' })
34-
comment: string;
30+
@ApiProperty({ example: { comment: 'string' } })
31+
@IsNotEmpty({ message: 'Please provide valid comment' })
32+
@IsString({ message: 'comment should be string' })
33+
comment: string;
3534

36-
@ApiProperty({ example: { connectionId: '3fa85f64-5717-4562-b3fc-2c963f66afa6' } })
37-
@IsNotEmpty({ message: 'Please provide valid connection-id' })
38-
@IsString({ message: 'Connection-id should be string' })
39-
connectionId: string;
35+
@ApiProperty({ example: { connectionId: '3fa85f64-5717-4562-b3fc-2c963f66afa6' } })
36+
@IsNotEmpty({ message: 'Please provide valid connection-id' })
37+
@IsString({ message: 'Connection-id should be string' })
38+
connectionId: string;
4039
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { ApiProperty } from "@nestjs/swagger";
2-
import { IsNotEmpty, IsString } from "class-validator";
1+
import { ApiProperty } from '@nestjs/swagger';
2+
import { IsNotEmpty, IsString } from 'class-validator';
33

44
export class CredentialSendOffer {
5-
6-
@ApiProperty({ example: 'string' })
7-
@IsNotEmpty({ message: 'Please provide valid credentialRecordId' })
8-
@IsString({ message: 'credentialRecordId should be string' })
9-
credentialRecordId: string;
5+
@ApiProperty({ example: 'string' })
6+
@IsNotEmpty({ message: 'Please provide valid credentialRecordId' })
7+
@IsString({ message: 'credentialRecordId should be string' })
8+
credentialRecordId: string;
109
}
Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
import { promisify } from "util";
2-
import * as fs from "fs";
1+
import { promisify } from 'util';
2+
import * as fs from 'fs';
33

4+
export const createFile = async (path: string, fileName: string, data: string): Promise<void> => {
5+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
6+
if (!checkIfFileOrDirectoryExists(path)) {
7+
fs.mkdirSync(path, { recursive: true });
8+
}
9+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
10+
const writeFile = promisify(fs.writeFile);
11+
return fs.writeFileSync(`${path}/${fileName}`, data, 'utf8');
12+
};
413

5-
export const createFile = async (
6-
path: string,
7-
fileName: string,
8-
data: string
9-
): Promise<void> => {
10-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
11-
if (!checkIfFileOrDirectoryExists(path)) {
12-
13-
fs.mkdirSync(path);
14-
}
15-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
16-
const writeFile = promisify(fs.writeFile);
17-
return fs.writeFileSync(`${path}/${fileName}`, data, 'utf8');
18-
};
14+
export const checkIfFileOrDirectoryExists = (path: string): boolean => fs.existsSync(path);
1915

20-
export const checkIfFileOrDirectoryExists = (path: string): boolean => fs.existsSync(path);
21-
22-
export const getFile = async (
23-
path: string,
24-
encoding: BufferEncoding
25-
): Promise<string | Buffer> => {
26-
const readFile = promisify(fs.readFile);
27-
28-
return encoding ? readFile(path, {encoding}) : readFile(path, {});
29-
};
16+
export const getFile = async (path: string, encoding: BufferEncoding): Promise<string | Buffer> => {
17+
const readFile = promisify(fs.readFile);
3018

19+
return encoding ? readFile(path, { encoding }) : readFile(path, {});
20+
};
3121

32-
export const deleteFile = async (path: string): Promise<void> => {
33-
const unlink = promisify(fs.unlink);
34-
35-
return unlink(path);
36-
};
22+
export const deleteFile = async (path: string): Promise<void> => {
23+
const unlink = promisify(fs.unlink);
24+
25+
return unlink(path);
26+
};
Lines changed: 76 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,82 @@
1-
import { ApiPropertyOptional } from "@nestjs/swagger";
2-
import { IsOptional } from "class-validator";
1+
import { ApiPropertyOptional } from '@nestjs/swagger';
2+
import { IsOptional } from 'class-validator';
33

44
interface IWebhookPresentationProof {
5-
threadId: string;
6-
state: string;
7-
connectionId
5+
threadId: string;
6+
state: string;
7+
connectionId;
88
}
99

1010
export class WebhookPresentationProofDto {
11+
@ApiPropertyOptional()
12+
@IsOptional()
13+
metadata: object;
1114

12-
@ApiPropertyOptional()
13-
@IsOptional()
14-
metadata: object;
15-
16-
@ApiPropertyOptional()
17-
@IsOptional()
18-
_tags: IWebhookPresentationProof;
19-
20-
@ApiPropertyOptional()
21-
@IsOptional()
22-
id: string;
23-
24-
@ApiPropertyOptional()
25-
@IsOptional()
26-
createdAt: string;
27-
28-
@ApiPropertyOptional()
29-
@IsOptional()
30-
protocolVersion: string;
31-
32-
@ApiPropertyOptional()
33-
@IsOptional()
34-
state: string;
35-
36-
@ApiPropertyOptional()
37-
@IsOptional()
38-
connectionId: string;
39-
40-
@ApiPropertyOptional()
41-
@IsOptional()
42-
threadId: string;
43-
44-
@ApiPropertyOptional()
45-
@IsOptional()
46-
parentThreadId?: string;
47-
48-
@ApiPropertyOptional()
49-
@IsOptional()
50-
presentationId: string;
51-
52-
@ApiPropertyOptional()
53-
@IsOptional()
54-
autoAcceptProof: string;
55-
56-
@ApiPropertyOptional()
57-
@IsOptional()
58-
updatedAt: string;
59-
60-
@ApiPropertyOptional()
61-
@IsOptional()
62-
isVerified: boolean;
63-
64-
@ApiPropertyOptional()
65-
@IsOptional()
66-
contextCorrelationId: string;
67-
68-
@ApiPropertyOptional()
69-
@IsOptional()
70-
type: string;
71-
72-
@ApiPropertyOptional()
73-
@IsOptional()
74-
proofData: object;
75-
76-
@ApiPropertyOptional()
77-
@IsOptional()
78-
orgId: string;
79-
80-
@ApiPropertyOptional()
81-
@IsOptional()
82-
errorMessage: string;
83-
}
15+
@ApiPropertyOptional()
16+
@IsOptional()
17+
_tags: IWebhookPresentationProof;
18+
19+
@ApiPropertyOptional()
20+
@IsOptional()
21+
id: string;
22+
23+
@ApiPropertyOptional()
24+
@IsOptional()
25+
createdAt: string;
26+
27+
@ApiPropertyOptional()
28+
@IsOptional()
29+
protocolVersion: string;
30+
31+
@ApiPropertyOptional()
32+
@IsOptional()
33+
state: string;
34+
35+
@ApiPropertyOptional()
36+
@IsOptional()
37+
connectionId: string;
38+
39+
@ApiPropertyOptional()
40+
@IsOptional()
41+
threadId: string;
42+
43+
@ApiPropertyOptional()
44+
@IsOptional()
45+
parentThreadId?: string;
46+
47+
@ApiPropertyOptional()
48+
@IsOptional()
49+
presentationId: string;
50+
51+
@ApiPropertyOptional()
52+
@IsOptional()
53+
autoAcceptProof: string;
54+
55+
@ApiPropertyOptional()
56+
@IsOptional()
57+
updatedAt: string;
58+
59+
@ApiPropertyOptional()
60+
@IsOptional()
61+
isVerified: boolean;
62+
63+
@ApiPropertyOptional()
64+
@IsOptional()
65+
contextCorrelationId: string;
66+
67+
@ApiPropertyOptional()
68+
@IsOptional()
69+
type: string;
70+
71+
@ApiPropertyOptional()
72+
@IsOptional()
73+
proofData: object;
74+
75+
@ApiPropertyOptional()
76+
@IsOptional()
77+
orgId: string;
78+
79+
@ApiPropertyOptional()
80+
@IsOptional()
81+
errorMessage: string;
82+
}

0 commit comments

Comments
 (0)