Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive notification messages from server and print received messages to console #2731

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Allow receiving notification messages from server and print messages received to console

### Removed

### Changed
Expand Down
26 changes: 13 additions & 13 deletions docs/classes/monitortask.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h3>constructor</h3>
<aside class="tsd-sources">
<p>Overrides <a href="basetask.html">BaseTask</a>.<a href="basetask.html#constructor">constructor</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L49">src/task/MonitorTask.ts:49</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L53">src/task/MonitorTask.ts:53</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -178,7 +178,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> task<wbr>Name</h3>
<aside class="tsd-sources">
<p>Overrides <a href="basetask.html">BaseTask</a>.<a href="basetask.html#taskname">taskName</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L35">src/task/MonitorTask.ts:35</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L39">src/task/MonitorTask.ts:39</a></li>
</ul>
</aside>
</section>
Expand All @@ -196,7 +196,7 @@ <h3>audio<wbr>Video<wbr>Did<wbr>Start</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#audiovideodidstart">audioVideoDidStart</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L265">src/task/MonitorTask.ts:265</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L269">src/task/MonitorTask.ts:269</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -219,7 +219,7 @@ <h3>audio<wbr>Video<wbr>Did<wbr>Start<wbr>Connecting</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#audiovideodidstartconnecting">audioVideoDidStartConnecting</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L270">src/task/MonitorTask.ts:270</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L274">src/task/MonitorTask.ts:274</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -248,7 +248,7 @@ <h3>audio<wbr>Video<wbr>Did<wbr>Stop</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#audiovideodidstop">audioVideoDidStop</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L276">src/task/MonitorTask.ts:276</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L280">src/task/MonitorTask.ts:280</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -306,7 +306,7 @@ <h3>connection<wbr>Health<wbr>Did<wbr>Change</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#connectionhealthdidchange">connectionHealthDidChange</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L211">src/task/MonitorTask.ts:211</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L215">src/task/MonitorTask.ts:215</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -353,7 +353,7 @@ <h3>handle<wbr>Signaling<wbr>Client<wbr>Event</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/signalingclientobserver.html">SignalingClientObserver</a>.<a href="../interfaces/signalingclientobserver.html#handlesignalingclientevent">handleSignalingClientEvent</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L316">src/task/MonitorTask.ts:316</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L320">src/task/MonitorTask.ts:320</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -406,7 +406,7 @@ <h3>metrics<wbr>Did<wbr>Receive</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#metricsdidreceive">metricsDidReceive</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L185">src/task/MonitorTask.ts:185</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L189">src/task/MonitorTask.ts:189</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -481,7 +481,7 @@ <h3>pause<wbr>Resubscribe<wbr>Check</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L103">src/task/MonitorTask.ts:103</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L107">src/task/MonitorTask.ts:107</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
Expand All @@ -499,7 +499,7 @@ <h3>remove<wbr>Observer</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/removableobserver.html">RemovableObserver</a>.<a href="../interfaces/removableobserver.html#removeobserver">removeObserver</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L73">src/task/MonitorTask.ts:73</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L77">src/task/MonitorTask.ts:77</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -521,7 +521,7 @@ <h3>resume<wbr>Resubscribe<wbr>Check</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L107">src/task/MonitorTask.ts:107</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L111">src/task/MonitorTask.ts:111</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
Expand All @@ -539,7 +539,7 @@ <h3>run</h3>
<aside class="tsd-sources">
<p>Overrides <a href="basetask.html">BaseTask</a>.<a href="basetask.html#run">run</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L87">src/task/MonitorTask.ts:87</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L91">src/task/MonitorTask.ts:91</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -594,7 +594,7 @@ <h3>video<wbr>Tile<wbr>Did<wbr>Update</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/audiovideoobserver.html">AudioVideoObserver</a>.<a href="../interfaces/audiovideoobserver.html#videotiledidupdate">videoTileDidUpdate</a></p>
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L121">src/task/MonitorTask.ts:121</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/main/src/task/MonitorTask.ts#L125">src/task/MonitorTask.ts:125</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
14 changes: 13 additions & 1 deletion protocol/SignalingProtocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ message SdkSignalFrame {
PRIMARY_MEETING_JOIN = 25;
PRIMARY_MEETING_JOIN_ACK = 26;
PRIMARY_MEETING_LEAVE = 27;
NOTIFICATION = 34;
}
required uint64 timestamp_ms = 1;
required Type type = 2;
Expand All @@ -50,6 +51,7 @@ message SdkSignalFrame {
optional SdkPrimaryMeetingJoinFrame primary_meeting_join = 26;
optional SdkPrimaryMeetingJoinAckFrame primary_meeting_join_ack = 27;
optional SdkPrimaryMeetingLeaveFrame primary_meeting_leave = 28;
optional SdkNotificationFrame notification = 35;
}

message SdkErrorFrame {
Expand Down Expand Up @@ -430,6 +432,16 @@ message SdkVideoSubscriptionConfiguration {
optional uint32 group_id = 6;
}

message SdkNotificationFrame {
enum NotificationLevel {
INFO = 1;
WARNING = 2;
ERROR = 3;
}
optional NotificationLevel level = 1 [default=ERROR];
optional string message = 2;
}

message SdkPrimaryMeetingJoinFrame {
optional SdkMeetingSessionCredentials credentials = 1;
}
Expand All @@ -449,4 +461,4 @@ message SdkMeetingSessionCredentials {
enum SdkVideoCodecCapability {
VP8 = 1;
H264_CONSTRAINED_BASELINE_PROFILE = 3;
};
};
115 changes: 114 additions & 1 deletion src/signalingprotocol/SignalingProtocol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export interface ISdkSignalFrame {

/** SdkSignalFrame primaryMeetingLeave */
primaryMeetingLeave?: (ISdkPrimaryMeetingLeaveFrame|null);

/** SdkSignalFrame notification */
notification?: (ISdkNotificationFrame|null);
}

/** Represents a SdkSignalFrame. */
Expand Down Expand Up @@ -151,6 +154,9 @@ export class SdkSignalFrame implements ISdkSignalFrame {
/** SdkSignalFrame primaryMeetingLeave. */
public primaryMeetingLeave?: (ISdkPrimaryMeetingLeaveFrame|null);

/** SdkSignalFrame notification. */
public notification?: (ISdkNotificationFrame|null);

/**
* Creates a new SdkSignalFrame instance using the specified properties.
* @param [properties] Properties to set
Expand Down Expand Up @@ -246,7 +252,8 @@ export namespace SdkSignalFrame {
REMOTE_VIDEO_UPDATE = 24,
PRIMARY_MEETING_JOIN = 25,
PRIMARY_MEETING_JOIN_ACK = 26,
PRIMARY_MEETING_LEAVE = 27
PRIMARY_MEETING_LEAVE = 27,
NOTIFICATION = 34
}
}

Expand Down Expand Up @@ -4715,6 +4722,112 @@ export class SdkVideoSubscriptionConfiguration implements ISdkVideoSubscriptionC
public toJSON(): { [k: string]: any };
}

/** Properties of a SdkNotificationFrame. */
export interface ISdkNotificationFrame {

/** SdkNotificationFrame level */
level?: (SdkNotificationFrame.NotificationLevel|null);

/** SdkNotificationFrame message */
message?: (string|null);
}

/** Represents a SdkNotificationFrame. */
export class SdkNotificationFrame implements ISdkNotificationFrame {

/**
* Constructs a new SdkNotificationFrame.
* @param [properties] Properties to set
*/
constructor(properties?: ISdkNotificationFrame);

/** SdkNotificationFrame level. */
public level: SdkNotificationFrame.NotificationLevel;

/** SdkNotificationFrame message. */
public message: string;

/**
* Creates a new SdkNotificationFrame instance using the specified properties.
* @param [properties] Properties to set
* @returns SdkNotificationFrame instance
*/
public static create(properties?: ISdkNotificationFrame): SdkNotificationFrame;

/**
* Encodes the specified SdkNotificationFrame message. Does not implicitly {@link SdkNotificationFrame.verify|verify} messages.
* @param message SdkNotificationFrame message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: ISdkNotificationFrame, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified SdkNotificationFrame message, length delimited. Does not implicitly {@link SdkNotificationFrame.verify|verify} messages.
* @param message SdkNotificationFrame message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: ISdkNotificationFrame, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a SdkNotificationFrame message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns SdkNotificationFrame
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SdkNotificationFrame;

/**
* Decodes a SdkNotificationFrame message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SdkNotificationFrame
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SdkNotificationFrame;

/**
* Verifies a SdkNotificationFrame message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a SdkNotificationFrame message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns SdkNotificationFrame
*/
public static fromObject(object: { [k: string]: any }): SdkNotificationFrame;

/**
* Creates a plain object from a SdkNotificationFrame message. Also converts values to other types if specified.
* @param message SdkNotificationFrame
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: SdkNotificationFrame, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this SdkNotificationFrame to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

export namespace SdkNotificationFrame {

/** NotificationLevel enum. */
enum NotificationLevel {
INFO = 1,
WARNING = 2,
ERROR = 3
}
}

/** Properties of a SdkPrimaryMeetingJoinFrame. */
export interface ISdkPrimaryMeetingJoinFrame {

Expand Down
Loading
Loading