openvidu-node-client: link to Error JS object in TypeDocs

pull/743/head
pabloFuente 2022-07-18 11:37:40 +02:00
parent 4102d5c8c3
commit d071529e12
2 changed files with 22 additions and 12 deletions

View File

@ -100,7 +100,8 @@ export class OpenVidu {
/** /**
* Creates an OpenVidu session. The session identifier will be available at property [[Session.sessionId]] * Creates an OpenVidu session. The session identifier will be available at property [[Session.sessionId]]
* *
* @returns A Promise that is resolved to the [[Session]] if success and rejected with an Error object if not. * @returns A Promise that is resolved to the [[Session]] if success and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not.
* This Error object has as `message` property with a status code carrying a specific meaning * This Error object has as `message` property with a status code carrying a specific meaning
* (see [REST API](/en/stable/reference-docs/REST-API/#post-recording-start)). * (see [REST API](/en/stable/reference-docs/REST-API/#post-recording-start)).
* *
@ -133,8 +134,9 @@ export class OpenVidu {
* @param name The name you want to give to the video file. You can access this same value in your clients on recording events (`recordingStarted`, `recordingStopped`) * @param name The name you want to give to the video file. You can access this same value in your clients on recording events (`recordingStarted`, `recordingStopped`)
* @param properties Custom RecordingProperties to apply to this Recording. This will override the global default values set to the Session with [[SessionProperties.defaultRecordingProperties]] * @param properties Custom RecordingProperties to apply to this Recording. This will override the global default values set to the Session with [[SessionProperties.defaultRecordingProperties]]
* *
* @returns A Promise that is resolved to the [[Recording]] if it successfully started (the recording can be stopped with guarantees) and rejected with an Error * @returns A Promise that is resolved to the [[Recording]] if it successfully started (the recording can be stopped with guarantees) and rejected with an
* object if not. This Error object has as `message` property with a status code carrying a specific meaning * [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not.
* This Error object has as `message` property with a status code carrying a specific meaning
* (see [REST API](/en/stable/reference-docs/REST-API/#post-recording-start)). * (see [REST API](/en/stable/reference-docs/REST-API/#post-recording-start)).
*/ */
public startRecording(sessionId: string, param2?: string | RecordingProperties): Promise<Recording> { public startRecording(sessionId: string, param2?: string | RecordingProperties): Promise<Recording> {
@ -209,7 +211,8 @@ export class OpenVidu {
* *
* @param recordingId The `id` property of the [[Recording]] you want to stop * @param recordingId The `id` property of the [[Recording]] you want to stop
* *
* @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not.
* This Error object has as `message` property with a status code carrying a specific meaning * This Error object has as `message` property with a status code carrying a specific meaning
* (see [REST API](/en/stable/reference-docs/REST-API/#post-recording-stop)). * (see [REST API](/en/stable/reference-docs/REST-API/#post-recording-stop)).
*/ */
@ -252,7 +255,8 @@ export class OpenVidu {
* *
* @param recordingId The `id` property of the [[Recording]] you want to retrieve * @param recordingId The `id` property of the [[Recording]] you want to retrieve
* *
* @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not.
* This Error object has as `message` property with a status code carrying a specific meaning * This Error object has as `message` property with a status code carrying a specific meaning
* (see [REST API](/en/stable/reference-docs/REST-API/#get-recording)). * (see [REST API](/en/stable/reference-docs/REST-API/#get-recording)).
*/ */
@ -324,7 +328,8 @@ export class OpenVidu {
* *
* @param recordingId * @param recordingId
* *
* @returns A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. * @returns A Promise that is resolved if the Recording was successfully deleted and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not.
* This Error object has as `message` property with a status code carrying a specific meaning * This Error object has as `message` property with a status code carrying a specific meaning
* (see [REST API](/en/stable/reference-docs/REST-API/#delete-recording)). * (see [REST API](/en/stable/reference-docs/REST-API/#delete-recording)).
*/ */

View File

@ -98,7 +98,8 @@ export class Session {
/** /**
* @deprecated Use [[Session.createConnection]] instead to get a [[Connection]] object. * @deprecated Use [[Session.createConnection]] instead to get a [[Connection]] object.
* *
* @returns A Promise that is resolved to the generated _token_ string if success and rejected with an Error object if not * @returns A Promise that is resolved to the generated _token_ string if success and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not
*/ */
public generateToken(tokenOptions?: TokenOptions): Promise<string> { public generateToken(tokenOptions?: TokenOptions): Promise<string> {
return new Promise<string>((resolve, reject) => { return new Promise<string>((resolve, reject) => {
@ -137,7 +138,8 @@ export class Session {
* `connectionProperties`. Each user connecting to the Session requires a Connection. * `connectionProperties`. Each user connecting to the Session requires a Connection.
* The token string value to send to the client side is available at [[Connection.token]]. * The token string value to send to the client side is available at [[Connection.token]].
* *
* @returns A Promise that is resolved to the generated [[Connection]] object if success and rejected with an Error object if not * @returns A Promise that is resolved to the generated [[Connection]] object if success and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not
*/ */
public createConnection(connectionProperties?: ConnectionProperties): Promise<Connection> { public createConnection(connectionProperties?: ConnectionProperties): Promise<Connection> {
return new Promise<Connection>((resolve, reject) => { return new Promise<Connection>((resolve, reject) => {
@ -185,7 +187,8 @@ export class Session {
/** /**
* Gracefully closes the Session: unpublishes all streams and evicts every participant * Gracefully closes the Session: unpublishes all streams and evicts every participant
* *
* @returns A Promise that is resolved if the session has been closed successfully and rejected with an Error object if not * @returns A Promise that is resolved if the session has been closed successfully and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not
*/ */
public close(): Promise<void> { public close(): Promise<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
@ -268,7 +271,8 @@ export class Session {
* *
* @param connection The Connection object to remove from the session, or its `connectionId` property * @param connection The Connection object to remove from the session, or its `connectionId` property
* *
* @returns A Promise that is resolved if the Connection was successfully removed from the Session and rejected with an Error object if not * @returns A Promise that is resolved if the Connection was successfully removed from the Session and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not
*/ */
public forceDisconnect(connection: string | Connection): Promise<void> { public forceDisconnect(connection: string | Connection): Promise<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
@ -340,7 +344,8 @@ export class Session {
* *
* @param publisher The Publisher object to unpublish, or its `streamId` property * @param publisher The Publisher object to unpublish, or its `streamId` property
* *
* @returns A Promise that is resolved if the stream was successfully unpublished and rejected with an Error object if not * @returns A Promise that is resolved if the stream was successfully unpublished and rejected with an
* [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not
*/ */
public forceUnpublish(publisher: string | Publisher): Promise<void> { public forceUnpublish(publisher: string | Publisher): Promise<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
@ -405,7 +410,7 @@ export class Session {
* @param connectionProperties A new [[ConnectionProperties]] object with the updated values to apply * @param connectionProperties A new [[ConnectionProperties]] object with the updated values to apply
* *
* @returns A Promise that is resolved to the updated [[Connection]] object if the operation was * @returns A Promise that is resolved to the updated [[Connection]] object if the operation was
* successful and rejected with an Error object if not * successful and rejected with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object if not
*/ */
public updateConnection(connectionId: string, connectionProperties: ConnectionProperties): Promise<Connection | undefined> { public updateConnection(connectionId: string, connectionProperties: ConnectionProperties): Promise<Connection | undefined> {
return new Promise<any>((resolve, reject) => { return new Promise<any>((resolve, reject) => {