-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] NOWEB - get contacts list for status from store if not provided
- Loading branch information
1 parent
65b61c0
commit 3865254
Showing
2 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,22 +11,27 @@ import { | |
|
||
export const BROADCAST_ID = 'status@broadcast'; | ||
|
||
export class StatusRequest { | ||
@ApiProperty({ | ||
description: 'Contact list to send the status to.', | ||
example: ['[email protected]'], | ||
}) | ||
contacts = ['[email protected]']; | ||
const ContactsProperty = ApiProperty({ | ||
description: 'Contact list to send the status to.', | ||
example: null, | ||
required: false, | ||
}); | ||
|
||
export interface StatusRequest { | ||
contacts?: string[]; | ||
} | ||
|
||
export class TextStatus extends StatusRequest { | ||
export class TextStatus { | ||
text: string = 'Have a look! https://github.com/'; | ||
backgroundColor: string = '#38b42f'; | ||
font: number = 1; | ||
|
||
@ContactsProperty | ||
contacts?: string[]; | ||
} | ||
|
||
@ApiExtraModels(RemoteFile, BinaryFile) | ||
export class ImageStatus extends StatusRequest { | ||
export class ImageStatus { | ||
@ApiProperty({ | ||
oneOf: [ | ||
{ $ref: getSchemaPath(RemoteFile) }, | ||
|
@@ -36,10 +41,13 @@ export class ImageStatus extends StatusRequest { | |
file: RemoteFile | BinaryFile; | ||
|
||
caption?: string; | ||
|
||
@ContactsProperty | ||
contacts?: string[]; | ||
} | ||
|
||
@ApiExtraModels(VoiceRemoteFile, VoiceBinaryFile) | ||
export class VoiceStatus extends StatusRequest { | ||
export class VoiceStatus { | ||
@ApiProperty({ | ||
oneOf: [ | ||
{ $ref: getSchemaPath(VoiceRemoteFile) }, | ||
|
@@ -49,10 +57,13 @@ export class VoiceStatus extends StatusRequest { | |
file: VoiceRemoteFile | VoiceBinaryFile; | ||
|
||
backgroundColor: string = '#38b42f'; | ||
|
||
@ContactsProperty | ||
contacts?: string[]; | ||
} | ||
|
||
@ApiExtraModels(VideoRemoteFile, VideoBinaryFile) | ||
export class VideoStatus extends StatusRequest { | ||
export class VideoStatus { | ||
@ApiProperty({ | ||
oneOf: [ | ||
{ $ref: getSchemaPath(VideoRemoteFile) }, | ||
|
@@ -62,12 +73,18 @@ export class VideoStatus extends StatusRequest { | |
file: VideoRemoteFile | VideoBinaryFile; | ||
|
||
caption?: string; | ||
|
||
@ContactsProperty | ||
contacts?: string[]; | ||
} | ||
|
||
export class DeleteStatusRequest extends StatusRequest { | ||
export class DeleteStatusRequest { | ||
@ApiProperty({ | ||
description: 'status message id', | ||
example: 'AAAAAAAAAAAAAAAAA', | ||
}) | ||
id: string; | ||
|
||
@ContactsProperty | ||
contacts?: string[]; | ||
} |