@dtelecom/x402-client 0.1.1 → 0.1.2
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/index.d.mts +21 -5
- package/dist/index.d.ts +21 -5
- package/dist/index.js +28 -9
- package/dist/index.mjs +28 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ interface CreateWebRTCTokenRequest {
|
|
|
8
8
|
participantIdentity: string;
|
|
9
9
|
durationMinutes: number;
|
|
10
10
|
metadata?: string;
|
|
11
|
+
clientIp?: string;
|
|
11
12
|
}
|
|
12
13
|
interface ExtendWebRTCTokenRequest {
|
|
13
14
|
sessionId: string;
|
|
@@ -36,6 +37,8 @@ interface CreateAgentSessionRequest {
|
|
|
36
37
|
language?: string;
|
|
37
38
|
ttsMaxCharacters?: number;
|
|
38
39
|
metadata?: string;
|
|
40
|
+
clientIdentity?: string;
|
|
41
|
+
clientIp?: string;
|
|
39
42
|
}
|
|
40
43
|
interface ExtendAgentSessionRequest {
|
|
41
44
|
bundleId: string;
|
|
@@ -134,9 +137,16 @@ interface ExtendTTSSessionResponse {
|
|
|
134
137
|
interface AgentSessionResponse {
|
|
135
138
|
bundleId: string;
|
|
136
139
|
webrtc: {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
agent: {
|
|
141
|
+
sessionId: string;
|
|
142
|
+
token: string;
|
|
143
|
+
wsUrl: string;
|
|
144
|
+
};
|
|
145
|
+
client: {
|
|
146
|
+
sessionId: string;
|
|
147
|
+
token: string;
|
|
148
|
+
wsUrl: string;
|
|
149
|
+
};
|
|
140
150
|
};
|
|
141
151
|
stt: {
|
|
142
152
|
sessionId: string;
|
|
@@ -152,8 +162,14 @@ interface AgentSessionResponse {
|
|
|
152
162
|
}
|
|
153
163
|
interface ExtendAgentSessionResponse {
|
|
154
164
|
webrtc?: {
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
agent?: {
|
|
166
|
+
token: string;
|
|
167
|
+
newExpiresAt: string;
|
|
168
|
+
};
|
|
169
|
+
client?: {
|
|
170
|
+
token: string;
|
|
171
|
+
newExpiresAt: string;
|
|
172
|
+
};
|
|
157
173
|
};
|
|
158
174
|
stt?: {
|
|
159
175
|
token: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface CreateWebRTCTokenRequest {
|
|
|
8
8
|
participantIdentity: string;
|
|
9
9
|
durationMinutes: number;
|
|
10
10
|
metadata?: string;
|
|
11
|
+
clientIp?: string;
|
|
11
12
|
}
|
|
12
13
|
interface ExtendWebRTCTokenRequest {
|
|
13
14
|
sessionId: string;
|
|
@@ -36,6 +37,8 @@ interface CreateAgentSessionRequest {
|
|
|
36
37
|
language?: string;
|
|
37
38
|
ttsMaxCharacters?: number;
|
|
38
39
|
metadata?: string;
|
|
40
|
+
clientIdentity?: string;
|
|
41
|
+
clientIp?: string;
|
|
39
42
|
}
|
|
40
43
|
interface ExtendAgentSessionRequest {
|
|
41
44
|
bundleId: string;
|
|
@@ -134,9 +137,16 @@ interface ExtendTTSSessionResponse {
|
|
|
134
137
|
interface AgentSessionResponse {
|
|
135
138
|
bundleId: string;
|
|
136
139
|
webrtc: {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
agent: {
|
|
141
|
+
sessionId: string;
|
|
142
|
+
token: string;
|
|
143
|
+
wsUrl: string;
|
|
144
|
+
};
|
|
145
|
+
client: {
|
|
146
|
+
sessionId: string;
|
|
147
|
+
token: string;
|
|
148
|
+
wsUrl: string;
|
|
149
|
+
};
|
|
140
150
|
};
|
|
141
151
|
stt: {
|
|
142
152
|
sessionId: string;
|
|
@@ -152,8 +162,14 @@ interface AgentSessionResponse {
|
|
|
152
162
|
}
|
|
153
163
|
interface ExtendAgentSessionResponse {
|
|
154
164
|
webrtc?: {
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
agent?: {
|
|
166
|
+
token: string;
|
|
167
|
+
newExpiresAt: string;
|
|
168
|
+
};
|
|
169
|
+
client?: {
|
|
170
|
+
token: string;
|
|
171
|
+
newExpiresAt: string;
|
|
172
|
+
};
|
|
157
173
|
};
|
|
158
174
|
stt?: {
|
|
159
175
|
token: string;
|
package/dist/index.js
CHANGED
|
@@ -178,14 +178,23 @@ var DtelecomGateway = class {
|
|
|
178
178
|
duration_minutes: options.durationMinutes,
|
|
179
179
|
language: options.language,
|
|
180
180
|
tts_max_characters: options.ttsMaxCharacters,
|
|
181
|
-
metadata: options.metadata
|
|
181
|
+
metadata: options.metadata,
|
|
182
|
+
client_identity: options.clientIdentity,
|
|
183
|
+
client_ip: options.clientIp
|
|
182
184
|
});
|
|
183
185
|
return {
|
|
184
186
|
bundleId: r.bundle_id,
|
|
185
187
|
webrtc: {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
agent: {
|
|
189
|
+
sessionId: r.webrtc.agent.session_id,
|
|
190
|
+
token: r.webrtc.agent.token,
|
|
191
|
+
wsUrl: r.webrtc.agent.ws_url
|
|
192
|
+
},
|
|
193
|
+
client: {
|
|
194
|
+
sessionId: r.webrtc.client.session_id,
|
|
195
|
+
token: r.webrtc.client.token,
|
|
196
|
+
wsUrl: r.webrtc.client.ws_url
|
|
197
|
+
}
|
|
189
198
|
},
|
|
190
199
|
stt: {
|
|
191
200
|
sessionId: r.stt.session_id,
|
|
@@ -208,10 +217,19 @@ var DtelecomGateway = class {
|
|
|
208
217
|
});
|
|
209
218
|
const result = {};
|
|
210
219
|
if (r.webrtc) {
|
|
211
|
-
result.webrtc = {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
result.webrtc = {};
|
|
221
|
+
if (r.webrtc.agent) {
|
|
222
|
+
result.webrtc.agent = {
|
|
223
|
+
token: r.webrtc.agent.token,
|
|
224
|
+
newExpiresAt: r.webrtc.agent.new_expires_at
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
if (r.webrtc.client) {
|
|
228
|
+
result.webrtc.client = {
|
|
229
|
+
token: r.webrtc.client.token,
|
|
230
|
+
newExpiresAt: r.webrtc.client.new_expires_at
|
|
231
|
+
};
|
|
232
|
+
}
|
|
215
233
|
}
|
|
216
234
|
if (r.stt) {
|
|
217
235
|
result.stt = {
|
|
@@ -233,7 +251,8 @@ var DtelecomGateway = class {
|
|
|
233
251
|
room_name: options.roomName,
|
|
234
252
|
participant_identity: options.participantIdentity,
|
|
235
253
|
duration_minutes: options.durationMinutes,
|
|
236
|
-
metadata: options.metadata
|
|
254
|
+
metadata: options.metadata,
|
|
255
|
+
client_ip: options.clientIp
|
|
237
256
|
});
|
|
238
257
|
return {
|
|
239
258
|
sessionId: r.session_id,
|
package/dist/index.mjs
CHANGED
|
@@ -145,14 +145,23 @@ var DtelecomGateway = class {
|
|
|
145
145
|
duration_minutes: options.durationMinutes,
|
|
146
146
|
language: options.language,
|
|
147
147
|
tts_max_characters: options.ttsMaxCharacters,
|
|
148
|
-
metadata: options.metadata
|
|
148
|
+
metadata: options.metadata,
|
|
149
|
+
client_identity: options.clientIdentity,
|
|
150
|
+
client_ip: options.clientIp
|
|
149
151
|
});
|
|
150
152
|
return {
|
|
151
153
|
bundleId: r.bundle_id,
|
|
152
154
|
webrtc: {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
agent: {
|
|
156
|
+
sessionId: r.webrtc.agent.session_id,
|
|
157
|
+
token: r.webrtc.agent.token,
|
|
158
|
+
wsUrl: r.webrtc.agent.ws_url
|
|
159
|
+
},
|
|
160
|
+
client: {
|
|
161
|
+
sessionId: r.webrtc.client.session_id,
|
|
162
|
+
token: r.webrtc.client.token,
|
|
163
|
+
wsUrl: r.webrtc.client.ws_url
|
|
164
|
+
}
|
|
156
165
|
},
|
|
157
166
|
stt: {
|
|
158
167
|
sessionId: r.stt.session_id,
|
|
@@ -175,10 +184,19 @@ var DtelecomGateway = class {
|
|
|
175
184
|
});
|
|
176
185
|
const result = {};
|
|
177
186
|
if (r.webrtc) {
|
|
178
|
-
result.webrtc = {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
187
|
+
result.webrtc = {};
|
|
188
|
+
if (r.webrtc.agent) {
|
|
189
|
+
result.webrtc.agent = {
|
|
190
|
+
token: r.webrtc.agent.token,
|
|
191
|
+
newExpiresAt: r.webrtc.agent.new_expires_at
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
if (r.webrtc.client) {
|
|
195
|
+
result.webrtc.client = {
|
|
196
|
+
token: r.webrtc.client.token,
|
|
197
|
+
newExpiresAt: r.webrtc.client.new_expires_at
|
|
198
|
+
};
|
|
199
|
+
}
|
|
182
200
|
}
|
|
183
201
|
if (r.stt) {
|
|
184
202
|
result.stt = {
|
|
@@ -200,7 +218,8 @@ var DtelecomGateway = class {
|
|
|
200
218
|
room_name: options.roomName,
|
|
201
219
|
participant_identity: options.participantIdentity,
|
|
202
220
|
duration_minutes: options.durationMinutes,
|
|
203
|
-
metadata: options.metadata
|
|
221
|
+
metadata: options.metadata,
|
|
222
|
+
client_ip: options.clientIp
|
|
204
223
|
});
|
|
205
224
|
return {
|
|
206
225
|
sessionId: r.session_id,
|
package/package.json
CHANGED