@roarkanalytics/sdk 0.32.0 → 0.33.0
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/CHANGELOG.md +8 -0
- package/README.md +38 -20
- package/package.json +1 -1
- package/resources/call-analysis.d.ts +40 -53
- package/resources/call-analysis.d.ts.map +1 -1
- package/src/resources/call-analysis.ts +46 -57
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.33.0 (2025-02-07)
|
4
|
+
|
5
|
+
Full Changelog: [v0.32.0...v0.33.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v0.32.0...v0.33.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** api update ([#133](https://github.com/roarkhq/sdk-roark-analytics-node/issues/133)) ([ba1102a](https://github.com/roarkhq/sdk-roark-analytics-node/commit/ba1102a65b56588d8bc918fee71004036921b197))
|
10
|
+
|
3
11
|
## 0.32.0 (2025-02-07)
|
4
12
|
|
5
13
|
Full Changelog: [v0.31.0...v0.32.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v0.31.0...v0.32.0)
|
package/README.md
CHANGED
@@ -28,9 +28,12 @@ const client = new Roark({
|
|
28
28
|
|
29
29
|
async function main() {
|
30
30
|
const callAnalysis = await client.callAnalysis.create({
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
participants: [
|
32
|
+
{ role: 'AGENT', spokeFirst: true },
|
33
|
+
{ role: 'AGENT', spokeFirst: false },
|
34
|
+
],
|
35
|
+
recordingUrl: 'https://example.com/recording.wav',
|
36
|
+
startedAt: '2025-02-07T13:01:56.604Z',
|
34
37
|
});
|
35
38
|
|
36
39
|
console.log(callAnalysis.data);
|
@@ -53,9 +56,12 @@ const client = new Roark({
|
|
53
56
|
|
54
57
|
async function main() {
|
55
58
|
const params: Roark.CallAnalysisCreateParams = {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
+
participants: [
|
60
|
+
{ role: 'AGENT', spokeFirst: true },
|
61
|
+
{ role: 'AGENT', spokeFirst: false },
|
62
|
+
],
|
63
|
+
recordingUrl: 'https://example.com/recording.wav',
|
64
|
+
startedAt: '2025-02-07T13:01:56.604Z',
|
59
65
|
};
|
60
66
|
const callAnalysis: Roark.CallAnalysisCreateResponse = await client.callAnalysis.create(params);
|
61
67
|
}
|
@@ -76,9 +82,12 @@ a subclass of `APIError` will be thrown:
|
|
76
82
|
async function main() {
|
77
83
|
const callAnalysis = await client.callAnalysis
|
78
84
|
.create({
|
79
|
-
|
80
|
-
|
81
|
-
|
85
|
+
participants: [
|
86
|
+
{ role: 'AGENT', spokeFirst: true },
|
87
|
+
{ role: 'AGENT', spokeFirst: false },
|
88
|
+
],
|
89
|
+
recordingUrl: 'https://example.com/recording.wav',
|
90
|
+
startedAt: '2025-02-07T13:01:56.604Z',
|
82
91
|
})
|
83
92
|
.catch(async (err) => {
|
84
93
|
if (err instanceof Roark.APIError) {
|
@@ -123,7 +132,7 @@ const client = new Roark({
|
|
123
132
|
});
|
124
133
|
|
125
134
|
// Or, configure per-request:
|
126
|
-
await client.callAnalysis.create({
|
135
|
+
await client.callAnalysis.create({ participants: [{ role: 'AGENT', spokeFirst: true }, { role: 'AGENT', spokeFirst: false }], recordingUrl: 'https://example.com/recording.wav', startedAt: '2025-02-07T13:01:56.604Z' }, {
|
127
136
|
maxRetries: 5,
|
128
137
|
});
|
129
138
|
```
|
@@ -140,7 +149,7 @@ const client = new Roark({
|
|
140
149
|
});
|
141
150
|
|
142
151
|
// Override per-request:
|
143
|
-
await client.callAnalysis.create({
|
152
|
+
await client.callAnalysis.create({ participants: [{ role: 'AGENT', spokeFirst: true }, { role: 'AGENT', spokeFirst: false }], recordingUrl: 'https://example.com/recording.wav', startedAt: '2025-02-07T13:01:56.604Z' }, {
|
144
153
|
timeout: 5 * 1000,
|
145
154
|
});
|
146
155
|
```
|
@@ -163,9 +172,12 @@ const client = new Roark();
|
|
163
172
|
|
164
173
|
const response = await client.callAnalysis
|
165
174
|
.create({
|
166
|
-
|
167
|
-
|
168
|
-
|
175
|
+
participants: [
|
176
|
+
{ role: 'AGENT', spokeFirst: true },
|
177
|
+
{ role: 'AGENT', spokeFirst: false },
|
178
|
+
],
|
179
|
+
recordingUrl: 'https://example.com/recording.wav',
|
180
|
+
startedAt: '2025-02-07T13:01:56.604Z',
|
169
181
|
})
|
170
182
|
.asResponse();
|
171
183
|
console.log(response.headers.get('X-My-Header'));
|
@@ -173,9 +185,12 @@ console.log(response.statusText); // access the underlying Response object
|
|
173
185
|
|
174
186
|
const { data: callAnalysis, response: raw } = await client.callAnalysis
|
175
187
|
.create({
|
176
|
-
|
177
|
-
|
178
|
-
|
188
|
+
participants: [
|
189
|
+
{ role: 'AGENT', spokeFirst: true },
|
190
|
+
{ role: 'AGENT', spokeFirst: false },
|
191
|
+
],
|
192
|
+
recordingUrl: 'https://example.com/recording.wav',
|
193
|
+
startedAt: '2025-02-07T13:01:56.604Z',
|
179
194
|
})
|
180
195
|
.withResponse();
|
181
196
|
console.log(raw.headers.get('X-My-Header'));
|
@@ -285,9 +300,12 @@ const client = new Roark({
|
|
285
300
|
// Override per-request:
|
286
301
|
await client.callAnalysis.create(
|
287
302
|
{
|
288
|
-
|
289
|
-
|
290
|
-
|
303
|
+
participants: [
|
304
|
+
{ role: 'AGENT', spokeFirst: true },
|
305
|
+
{ role: 'AGENT', spokeFirst: false },
|
306
|
+
],
|
307
|
+
recordingUrl: 'https://example.com/recording.wav',
|
308
|
+
startedAt: '2025-02-07T13:01:56.604Z',
|
291
309
|
},
|
292
310
|
{
|
293
311
|
httpAgent: new http.Agent({ keepAlive: false }),
|
package/package.json
CHANGED
@@ -7,83 +7,70 @@ export declare class CallAnalysis extends APIResource {
|
|
7
7
|
create(body: CallAnalysisCreateParams, options?: Core.RequestOptions): Core.APIPromise<CallAnalysisCreateResponse>;
|
8
8
|
}
|
9
9
|
export interface CallAnalysisCreateResponse {
|
10
|
+
/**
|
11
|
+
* Analysis job with associated call context
|
12
|
+
*/
|
10
13
|
data: CallAnalysisCreateResponse.Data;
|
11
14
|
}
|
12
15
|
export declare namespace CallAnalysisCreateResponse {
|
16
|
+
/**
|
17
|
+
* Analysis job with associated call context
|
18
|
+
*/
|
13
19
|
interface Data {
|
14
|
-
|
15
|
-
direction: 'INBOUND' | 'OUTBOUND';
|
16
|
-
interfaceType: 'PHONE' | 'WEB';
|
17
|
-
isTest: boolean;
|
18
|
-
startedAt: string;
|
19
|
-
status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
20
|
-
/**
|
21
|
-
* Participant contact information
|
22
|
-
*/
|
23
|
-
agent?: Data.Agent;
|
20
|
+
call: Data.Call;
|
24
21
|
/**
|
25
|
-
*
|
22
|
+
* Analysis job ID for tracking progress
|
26
23
|
*/
|
27
|
-
|
28
|
-
|
29
|
-
endedReason?: string | null;
|
30
|
-
summary?: string | null;
|
24
|
+
jobId: string;
|
25
|
+
status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
|
31
26
|
}
|
32
27
|
namespace Data {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
28
|
+
interface Call {
|
29
|
+
id: string;
|
30
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
31
|
+
isTest: boolean;
|
32
|
+
participants: Array<Call.Participant>;
|
33
|
+
startedAt: string;
|
34
|
+
status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
35
|
+
durationMs?: number | null;
|
36
|
+
endedAt?: string | null;
|
37
|
+
endedReason?: string | null;
|
38
|
+
summary?: string | null;
|
39
39
|
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
namespace Call {
|
41
|
+
interface Participant {
|
42
|
+
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
43
|
+
spokeFirst: boolean;
|
44
|
+
name?: string;
|
45
|
+
phoneNumber?: string;
|
46
|
+
}
|
46
47
|
}
|
47
48
|
}
|
48
49
|
}
|
49
50
|
export interface CallAnalysisCreateParams {
|
50
51
|
/**
|
51
|
-
*
|
52
|
+
* Exactly two participants in the call
|
52
53
|
*/
|
53
|
-
|
54
|
+
participants: Array<CallAnalysisCreateParams.Participant>;
|
54
55
|
/**
|
55
|
-
* URL of source recording
|
56
|
+
* URL of source recording (must be an accessible WAV file). Can be a signed URL.
|
56
57
|
*/
|
57
|
-
|
58
|
+
recordingUrl: string;
|
58
59
|
startedAt: string;
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
agent?: CallAnalysisCreateParams.Agent;
|
63
|
-
agentSpokeFirst?: boolean;
|
64
|
-
/**
|
65
|
-
* Customer information
|
66
|
-
*/
|
67
|
-
customer?: CallAnalysisCreateParams.Customer;
|
60
|
+
callDirection?: 'INBOUND' | 'OUTBOUND';
|
61
|
+
endedReason?: string;
|
62
|
+
interfaceType?: 'PHONE' | 'WEB';
|
68
63
|
isTest?: boolean;
|
69
64
|
/**
|
70
|
-
* URL of source stereo recording.
|
71
|
-
* player
|
65
|
+
* URL of source stereo recording in WAV format. Must be accessible. Can be a
|
66
|
+
* signed URL. While optional it allows for a richer audio player
|
72
67
|
*/
|
73
68
|
stereoRecordingUrl?: string;
|
74
69
|
}
|
75
70
|
export declare namespace CallAnalysisCreateParams {
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
interface Agent {
|
80
|
-
name?: string;
|
81
|
-
phoneNumber?: string;
|
82
|
-
}
|
83
|
-
/**
|
84
|
-
* Customer information
|
85
|
-
*/
|
86
|
-
interface Customer {
|
71
|
+
interface Participant {
|
72
|
+
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
73
|
+
spokeFirst: boolean;
|
87
74
|
name?: string;
|
88
75
|
phoneNumber?: string;
|
89
76
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"call-analysis.d.ts","sourceRoot":"","sources":["../src/resources/call-analysis.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC;CAG/C;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC;CACvC;AAED,yBAAiB,0BAA0B,CAAC;IAC1C,UAAiB,IAAI;QACnB,EAAE,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"call-analysis.d.ts","sourceRoot":"","sources":["../src/resources/call-analysis.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC;CAG/C;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC;CACvC;AAED,yBAAiB,0BAA0B,CAAC;IAC1C;;OAEG;IACH,UAAiB,IAAI;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;QAEhB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,QAA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I,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;QAEtE,UAAU,EAAE,OAAO,CAAC;QAEpB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
@@ -16,109 +16,98 @@ export class CallAnalysis extends APIResource {
|
|
16
16
|
}
|
17
17
|
|
18
18
|
export interface CallAnalysisCreateResponse {
|
19
|
+
/**
|
20
|
+
* Analysis job with associated call context
|
21
|
+
*/
|
19
22
|
data: CallAnalysisCreateResponse.Data;
|
20
23
|
}
|
21
24
|
|
22
25
|
export namespace CallAnalysisCreateResponse {
|
26
|
+
/**
|
27
|
+
* Analysis job with associated call context
|
28
|
+
*/
|
23
29
|
export interface Data {
|
24
|
-
|
30
|
+
call: Data.Call;
|
25
31
|
|
26
|
-
|
32
|
+
/**
|
33
|
+
* Analysis job ID for tracking progress
|
34
|
+
*/
|
35
|
+
jobId: string;
|
27
36
|
|
28
|
-
|
37
|
+
status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
|
38
|
+
}
|
29
39
|
|
30
|
-
|
40
|
+
export namespace Data {
|
41
|
+
export interface Call {
|
42
|
+
id: string;
|
31
43
|
|
32
|
-
|
44
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
33
45
|
|
34
|
-
|
46
|
+
isTest: boolean;
|
35
47
|
|
36
|
-
|
37
|
-
* Participant contact information
|
38
|
-
*/
|
39
|
-
agent?: Data.Agent;
|
48
|
+
participants: Array<Call.Participant>;
|
40
49
|
|
41
|
-
|
42
|
-
* Participant contact information
|
43
|
-
*/
|
44
|
-
customer?: Data.Customer;
|
50
|
+
startedAt: string;
|
45
51
|
|
46
|
-
|
52
|
+
status: 'RINGING' | 'IN_PROGRESS' | 'ENDED' | null;
|
47
53
|
|
48
|
-
|
54
|
+
durationMs?: number | null;
|
49
55
|
|
50
|
-
|
51
|
-
}
|
56
|
+
endedAt?: string | null;
|
52
57
|
|
53
|
-
|
54
|
-
/**
|
55
|
-
* Participant contact information
|
56
|
-
*/
|
57
|
-
export interface Agent {
|
58
|
-
name?: string;
|
58
|
+
endedReason?: string | null;
|
59
59
|
|
60
|
-
|
60
|
+
summary?: string | null;
|
61
61
|
}
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
export namespace Call {
|
64
|
+
export interface Participant {
|
65
|
+
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
66
|
+
|
67
|
+
spokeFirst: boolean;
|
68
|
+
|
69
|
+
name?: string;
|
68
70
|
|
69
|
-
|
71
|
+
phoneNumber?: string;
|
72
|
+
}
|
70
73
|
}
|
71
74
|
}
|
72
75
|
}
|
73
76
|
|
74
77
|
export interface CallAnalysisCreateParams {
|
75
78
|
/**
|
76
|
-
*
|
79
|
+
* Exactly two participants in the call
|
77
80
|
*/
|
78
|
-
|
81
|
+
participants: Array<CallAnalysisCreateParams.Participant>;
|
79
82
|
|
80
83
|
/**
|
81
|
-
* URL of source recording
|
84
|
+
* URL of source recording (must be an accessible WAV file). Can be a signed URL.
|
82
85
|
*/
|
83
|
-
|
86
|
+
recordingUrl: string;
|
84
87
|
|
85
88
|
startedAt: string;
|
86
89
|
|
87
|
-
|
88
|
-
* Agent information
|
89
|
-
*/
|
90
|
-
agent?: CallAnalysisCreateParams.Agent;
|
90
|
+
callDirection?: 'INBOUND' | 'OUTBOUND';
|
91
91
|
|
92
|
-
|
92
|
+
endedReason?: string;
|
93
93
|
|
94
|
-
|
95
|
-
* Customer information
|
96
|
-
*/
|
97
|
-
customer?: CallAnalysisCreateParams.Customer;
|
94
|
+
interfaceType?: 'PHONE' | 'WEB';
|
98
95
|
|
99
96
|
isTest?: boolean;
|
100
97
|
|
101
98
|
/**
|
102
|
-
* URL of source stereo recording.
|
103
|
-
* player
|
99
|
+
* URL of source stereo recording in WAV format. Must be accessible. Can be a
|
100
|
+
* signed URL. While optional it allows for a richer audio player
|
104
101
|
*/
|
105
102
|
stereoRecordingUrl?: string;
|
106
103
|
}
|
107
104
|
|
108
105
|
export namespace CallAnalysisCreateParams {
|
109
|
-
|
110
|
-
|
111
|
-
*/
|
112
|
-
export interface Agent {
|
113
|
-
name?: string;
|
106
|
+
export interface Participant {
|
107
|
+
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
114
108
|
|
115
|
-
|
116
|
-
}
|
109
|
+
spokeFirst: boolean;
|
117
110
|
|
118
|
-
/**
|
119
|
-
* Customer information
|
120
|
-
*/
|
121
|
-
export interface Customer {
|
122
111
|
name?: string;
|
123
112
|
|
124
113
|
phoneNumber?: string;
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = '0.
|
1
|
+
export const VERSION = '0.33.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const VERSION = "0.
|
1
|
+
export declare const VERSION = "0.33.0";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const VERSION = '0.
|
1
|
+
export const VERSION = '0.33.0'; // x-release-please-version
|
2
2
|
//# sourceMappingURL=version.mjs.map
|