Skip to content

Commit

Permalink
[core] Add empty line linter
Browse files Browse the repository at this point in the history
  • Loading branch information
allburov committed Nov 25, 2023
1 parent d984382 commit d4d94ff
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
'lines-between-class-members': ['error', 'always', { 'exceptAfterSingleLine': true }],
}
};
1 change: 1 addition & 0 deletions src/api/contacts.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class ContactsController {
const whatsapp = this.manager.getSession(request.session);
return whatsapp.blockContact(request);
}

@Post('/unblock')
@ApiOperation({ summary: 'Unblock contact' })
unblock(@Body() request: ContactRequest) {
Expand Down
1 change: 1 addition & 0 deletions src/structures/auth.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export class RequestCodeRequest {
example: '12132132130',
})
phoneNumber: string;

@ApiProperty({
description:
'How would you like to receive the one time code for registration? |sms|voice. Leave empty for Web pairing.',
Expand Down
4 changes: 4 additions & 0 deletions src/structures/chatting.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class CheckNumberStatusQuery extends SessionQuery {
export class MessageTextQuery extends SessionQuery {
@IsString()
phone: string;

@IsString()
text: string;
}
Expand All @@ -40,6 +41,7 @@ export class ChatQuery extends SessionQuery {
export class GetMessageQuery extends ChatQuery {
@IsNumber()
limit: number;

@ApiProperty({
example: true,
required: false,
Expand Down Expand Up @@ -147,6 +149,7 @@ export class MessageVideoRequest extends ChatRequest {
],
})
file: VideoRemoteFile | VideoBinaryFile;

caption: string = 'Just watch at this!';
}

Expand Down Expand Up @@ -192,6 +195,7 @@ export class MessageDestination {
example: '[email protected]_AAAAAAAAAAAAAAAAAAAA',
})
id: string;

to: string;
from: string;
fromMe: boolean;
Expand Down
2 changes: 2 additions & 0 deletions src/structures/presence.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class WAHAPresenceData {
example: '[email protected]',
})
participant: string;

lastKnownPresence: WAHAPresenceStatus;
@ApiProperty({
example: 1686568773,
Expand All @@ -20,6 +21,7 @@ export class WAHAChatPresences {
example: '[email protected]',
})
id: string;

presences: WAHAPresenceData[];
}

Expand Down
3 changes: 3 additions & 0 deletions src/structures/sessions.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ export class ProxyConfig {
example: 'localhost:3128',
})
server: string;

@ApiProperty({
example: null,
})
username?: string;

@ApiProperty({
example: null,
})
Expand Down Expand Up @@ -71,6 +73,7 @@ export class SessionDTO {
export class MeInfo {
@ChatIdProperty()
id: string;

pushName: string;
}

Expand Down
3 changes: 3 additions & 0 deletions src/structures/status.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class ImageStatus extends StatusRequest {
],
})
file: BinaryFile | RemoteFile;

caption: string;
}

Expand All @@ -45,6 +46,7 @@ export class VoiceStatus extends StatusRequest {
],
})
file: VoiceBinaryFile | VoiceRemoteFile;

backgroundColor = '#38b42f';
}

Expand All @@ -57,5 +59,6 @@ export class VideoStatus extends StatusRequest {
],
})
file: BinaryFile | RemoteFile;

caption: string;
}
12 changes: 12 additions & 0 deletions src/structures/webhooks.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class WASessionStatusBody {
example: 'default',
})
name: string;

status: WAHASessionStatus;
}

Expand Down Expand Up @@ -122,12 +123,14 @@ class WAHAWebhookSessionStatus extends WAHAWebhook {
description: 'The event is triggered when the session status changes.',
})
event = WAHAEvents.SESSION_STATUS;

payload: WASessionStatusBody;
}

class WAHAWebhookMessage extends WAHAWebhook {
@ApiProperty({ description: 'Incoming message.' })
event = WAHAEvents.MESSAGE;

payload: WAMessage;
}

Expand All @@ -136,6 +139,7 @@ class WAHAWebhookMessageAny extends WAHAWebhook {
description: 'Fired on all message creations, including your own.',
})
event = WAHAEvents.MESSAGE_ANY;

payload: WAMessage;
}

Expand All @@ -145,6 +149,7 @@ class WAHAWebhookMessageAck extends WAHAWebhook {
'Receive events when server or recipient gets the message, read or played it.',
})
event = WAHAEvents.MESSAGE_ACK;

payload: WAMessageAckBody;
}

Expand All @@ -155,6 +160,7 @@ class WAHAWebhookMessageRevoked extends WAHAWebhook {
'revokes a previously sent message.',
})
event = WAHAEvents.MESSAGE_REVOKED;

payload: WAMessageRevokedBody;
}

Expand All @@ -163,6 +169,7 @@ class WAHAWebhookStateChange extends WAHAWebhook {
description: 'It’s an internal engine’s state, not session status.',
})
event = WAHAEvents.STATE_CHANGE;

payload: any;
}

Expand All @@ -171,6 +178,7 @@ class WAHAWebhookGroupJoin extends WAHAWebhook {
description: 'Some one join a group.',
})
event = WAHAEvents.GROUP_JOIN;

payload: any;
}

Expand All @@ -179,6 +187,7 @@ class WAHAWebhookGroupLeave extends WAHAWebhook {
description: 'Some one left a group.',
})
event = WAHAEvents.GROUP_LEAVE;

payload: any;
}

Expand All @@ -187,6 +196,7 @@ class WAHAWebhookPresenceUpdate extends WAHAWebhook {
description: 'The most recent presence information for a chat.',
})
event = WAHAEvents.PRESENCE_UPDATE;

payload: WAHAChatPresences;
}

Expand All @@ -195,6 +205,7 @@ class WAHAWebhookPollVote extends WAHAWebhook {
description: 'With this event, you receive new votes for the poll sent.',
})
event = WAHAEvents.POLL_VOTE;

payload: PollVotePayload;
}

Expand All @@ -205,6 +216,7 @@ class WAHAWebhookPollVoteFailed extends WAHAWebhook {
'Read more about how to handle such events: https://waha.devlike.pro/docs/how-to/polls/#pollvotefailed',
})
event = WAHAEvents.POLL_VOTE_FAILED;

payload: PollVotePayload;
}

Expand Down

0 comments on commit d4d94ff

Please sign in to comment.