Skip to content

Commit

Permalink
Merge branch 'main' into feat-add-rules-module-to-push-video
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur-push authored Dec 18, 2023
2 parents 95bc516 + e021be9 commit 13136c1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
echo "\nRunning GIT hooks..."
yarn cleanbuild
yarn nx affected --target=lint
yarn nx affected --target=test
yarn nx affected --target=test
70 changes: 36 additions & 34 deletions packages/restapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5599,7 +5599,7 @@ export type VideoCallData = {
video: boolean | null; // local video status
address: string; // local address
};
incoming: [PeerData];
incoming: PeerData[];
};

private data: VideoCallData;
Expand Down Expand Up @@ -5648,14 +5648,14 @@ constructor({
}) {}
```

Allowed Options (params with _ are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| signer_ | SignerType | - | signer object for a user |
| chainId* | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 |
| pgpPrivatekey* | string | - | PGP private key of the user, used while sending video call notifications |
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
| setData\* | `(fn: (data: VideoCallData) => VideoCallData) => void` | - | Function to update video call data |
| signer | SignerType | - | signer object for a user |
| chainId | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 |
| pgpPrivatekey | string | - | PGP private key of the user, used while sending video call notifications |
| env* | string | 'prod' | API env - 'prod', 'staging', 'dev'|
| setData | `(fn: (data: VideoCallData) => VideoCallData) => void` | - | Function to update video call data |

---

Expand All @@ -5668,16 +5668,18 @@ Allowed Options (params with _ are mandatory)
export type VideoCreateInputOptions = {
video?: boolean;
audio?: boolean;
stream?: MediaStream; // for backend use
};

async create(options: VideoCreateInputOptions): Promise<void> {}
```

Allowed Options (params with \* are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| video | boolean | true | video status for the local stream |
| audio | boolean | true | audio status for the local stream |
| video* | boolean | true | video status for the local stream |
| audio* | boolean | true | audio status for the local stream |
| stream* | MediaStream | null | local stream, for backend use |

Note - If audio, video aren't enabled in create() then they wont be available during the call respectively.

Expand All @@ -5691,7 +5693,7 @@ Note - If audio, video aren't enabled in create() then they wont be available du
```typescript
export type VideoRequestInputOptions = {
senderAddress: string;
recipientAddress: string;
recipientAddress: string | string[];
chatId: string;
onReceiveMessage?: (message: string) => void;
retry?: boolean;
Expand All @@ -5700,14 +5702,14 @@ export type VideoRequestInputOptions = {
async request(options: VideoRequestInputOptions): Promise<void> {}
```

Allowed Options (params with _ are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| senderAddress_ | string | - | Local peer address |
| recipientAddress* | string | - | Incoming/remote peer address |
| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
| retry | boolean | false | If we are retrying the call, only for internal use |
| senderAddress | string | - | Wallet address of the local user |
| recipientAddress | string, string[] | - | Wallet addresses of users you want to call, single address for wallet to wallet call and array of addresses for group call |
| chatId | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
| onReceiveMessage* | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
| retry* | boolean | false | If we are retrying the call, only for internal use |

---

Expand All @@ -5729,15 +5731,15 @@ export type VideoAcceptRequestInputOptions = {
async acceptRequest(options: VideoAcceptRequestInputOptions): Promise<void> {}
```

Allowed Options (params with _ are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| signalData_ | any | - | Signal data received from the initiator peer via psuh notification upon call request |
| senderAddress* | string | - | Local peer address |
| recipientAddress* | string | - | Incoming/remote peer address |
| chatId\* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
| onReceiveMessage | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
| retry | boolean | false | If we are retrying the call, only for internal use |
| signalData | any | - | Signal data received from the initiator peer via psuh notification upon call request |
| senderAddress | string | - | Local peer address |
| recipientAddress | string | - | Incoming/remote peer address |
| chatId | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
| onReceiveMessage* | `(message: string) => void` | `(message: string) => {console.log('received a meesage', message);}` | Function which will be called when the sender receives a message via webRTC data channel |
| retry* | boolean | false | If we are retrying the call, only for internal use |

---

Expand All @@ -5755,11 +5757,11 @@ export type VideoConnectInputOptions = {
connect(options: VideoConnectInputOptions): void {}
```

Allowed Options (params with _ are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| signalData_ | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest |
| peerAddress | string | data.incoming[0].address | Address of the receiver peer, received via push notification upon call acceptRequest |
| signalData | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest |
| peerAddress* | string | data.incoming[0].address | Address of the receiver peer, received via push notification upon call acceptRequest |

---

Expand All @@ -5771,15 +5773,15 @@ Allowed Options (params with _ are mandatory)
```typescript
export type VideoDisconnectOptions = {
peerAddress: string;
} | null;
};

disconnect(options: VideoDisconnectOptions): void {}
disconnect(options?: VideoDisconnectOptions): void {}
```

Allowed Options (params with \* are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| peerAddress | string | data.incoming[0].address | Address of the peer to be disconnected from |
| peerAddress* | string | data.incoming[0].address | Address of the peer to be disconnected from |

---

Expand All @@ -5790,14 +5792,14 @@ Allowed Options (params with \* are mandatory)
- **Note -** If video was not enabled during `create()` then it will always remain off.

```typescript
export type EnableVideoInputOptions = {
export type EnableVideoInputOptions = {
state: boolean;
}

enableVideo(options: EnableVideoInputOptions): void
```

Allowed Options (params with \* are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| state | boolean | - | true for enable and false for disable |
Expand All @@ -5818,7 +5820,7 @@ export type EnableAudioInputOptions = {
enableAudio(options: EnableAudioInputOptions): void
```

Allowed Options (params with \* are mandatory)
Allowed Options (params with * are optional)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| state | boolean | - | true for enable and false for disable |
Expand Down
2 changes: 1 addition & 1 deletion packages/restapi/src/lib/video/Video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ export class Video {
}
}

disconnect(options: VideoDisconnectOptions): void {
disconnect(options?: VideoDisconnectOptions): void {
const { peerAddress, details } = options || {};

try {
Expand Down

0 comments on commit 13136c1

Please sign in to comment.