@xtr-dev/rondevu-client 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/offers.d.ts +4 -1
- package/dist/offers.js +2 -2
- package/package.json +1 -1
package/dist/offers.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export interface CreateOfferRequest {
|
|
|
3
3
|
sdp: string;
|
|
4
4
|
topics: string[];
|
|
5
5
|
ttl?: number;
|
|
6
|
+
secret?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface Offer {
|
|
8
9
|
id: string;
|
|
@@ -12,6 +13,8 @@ export interface Offer {
|
|
|
12
13
|
createdAt?: number;
|
|
13
14
|
expiresAt: number;
|
|
14
15
|
lastSeen: number;
|
|
16
|
+
secret?: string;
|
|
17
|
+
hasSecret?: boolean;
|
|
15
18
|
answererPeerId?: string;
|
|
16
19
|
answerSdp?: string;
|
|
17
20
|
answeredAt?: number;
|
|
@@ -74,7 +77,7 @@ export declare class RondevuOffers {
|
|
|
74
77
|
/**
|
|
75
78
|
* Answer an offer
|
|
76
79
|
*/
|
|
77
|
-
answer(offerId: string, sdp: string): Promise<void>;
|
|
80
|
+
answer(offerId: string, sdp: string, secret?: string): Promise<void>;
|
|
78
81
|
/**
|
|
79
82
|
* Get answers to your offers
|
|
80
83
|
*/
|
package/dist/offers.js
CHANGED
|
@@ -129,14 +129,14 @@ export class RondevuOffers {
|
|
|
129
129
|
/**
|
|
130
130
|
* Answer an offer
|
|
131
131
|
*/
|
|
132
|
-
async answer(offerId, sdp) {
|
|
132
|
+
async answer(offerId, sdp, secret) {
|
|
133
133
|
const response = await this.fetchFn(`${this.baseUrl}/offers/${encodeURIComponent(offerId)}/answer`, {
|
|
134
134
|
method: 'POST',
|
|
135
135
|
headers: {
|
|
136
136
|
'Content-Type': 'application/json',
|
|
137
137
|
Authorization: RondevuAuth.createAuthHeader(this.credentials),
|
|
138
138
|
},
|
|
139
|
-
body: JSON.stringify({ sdp }),
|
|
139
|
+
body: JSON.stringify({ sdp, secret }),
|
|
140
140
|
});
|
|
141
141
|
if (!response.ok) {
|
|
142
142
|
const error = await response.json().catch(() => ({ error: 'Unknown error' }));
|