@roarkanalytics/sdk 0.34.0 → 0.36.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 +16 -0
- package/README.md +26 -32
- package/package.json +1 -1
- package/resources/call-analysis.d.ts +19 -4
- package/resources/call-analysis.d.ts.map +1 -1
- package/src/resources/call-analysis.ts +23 -8
- 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,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.36.0 (2025-02-08)
|
4
|
+
|
5
|
+
Full Changelog: [v0.35.0...v0.36.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v0.35.0...v0.36.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** api update ([#142](https://github.com/roarkhq/sdk-roark-analytics-node/issues/142)) ([ce35f20](https://github.com/roarkhq/sdk-roark-analytics-node/commit/ce35f2032b7746349c215c6a0debffa664b75c37))
|
10
|
+
|
11
|
+
## 0.35.0 (2025-02-07)
|
12
|
+
|
13
|
+
Full Changelog: [v0.34.0...v0.35.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v0.34.0...v0.35.0)
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
* **api:** api update ([#139](https://github.com/roarkhq/sdk-roark-analytics-node/issues/139)) ([02d63aa](https://github.com/roarkhq/sdk-roark-analytics-node/commit/02d63aaf05b508621c22fceb5438f5d5b822127f))
|
18
|
+
|
3
19
|
## 0.34.0 (2025-02-07)
|
4
20
|
|
5
21
|
Full Changelog: [v0.33.0...v0.34.0](https://github.com/roarkhq/sdk-roark-analytics-node/compare/v0.33.0...v0.34.0)
|
package/README.md
CHANGED
@@ -28,12 +28,11 @@ const client = new Roark({
|
|
28
28
|
|
29
29
|
async function main() {
|
30
30
|
const callAnalysis = await client.callAnalysis.create({
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
],
|
31
|
+
callDirection: 'INBOUND',
|
32
|
+
interfaceType: 'PHONE',
|
33
|
+
participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
|
35
34
|
recordingUrl: 'https://example.com/recording.wav',
|
36
|
-
startedAt: '2025-02-
|
35
|
+
startedAt: '2025-02-07T23:54:52.479Z',
|
37
36
|
});
|
38
37
|
|
39
38
|
console.log(callAnalysis.data);
|
@@ -56,12 +55,11 @@ const client = new Roark({
|
|
56
55
|
|
57
56
|
async function main() {
|
58
57
|
const params: Roark.CallAnalysisCreateParams = {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
],
|
58
|
+
callDirection: 'INBOUND',
|
59
|
+
interfaceType: 'PHONE',
|
60
|
+
participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
|
63
61
|
recordingUrl: 'https://example.com/recording.wav',
|
64
|
-
startedAt: '2025-02-
|
62
|
+
startedAt: '2025-02-07T23:54:52.479Z',
|
65
63
|
};
|
66
64
|
const callAnalysis: Roark.CallAnalysisCreateResponse = await client.callAnalysis.create(params);
|
67
65
|
}
|
@@ -82,12 +80,11 @@ a subclass of `APIError` will be thrown:
|
|
82
80
|
async function main() {
|
83
81
|
const callAnalysis = await client.callAnalysis
|
84
82
|
.create({
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
],
|
83
|
+
callDirection: 'INBOUND',
|
84
|
+
interfaceType: 'PHONE',
|
85
|
+
participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
|
89
86
|
recordingUrl: 'https://example.com/recording.wav',
|
90
|
-
startedAt: '2025-02-
|
87
|
+
startedAt: '2025-02-07T23:54:52.479Z',
|
91
88
|
})
|
92
89
|
.catch(async (err) => {
|
93
90
|
if (err instanceof Roark.APIError) {
|
@@ -132,7 +129,7 @@ const client = new Roark({
|
|
132
129
|
});
|
133
130
|
|
134
131
|
// Or, configure per-request:
|
135
|
-
await client.callAnalysis.create({ participants: [{ role: 'AGENT'
|
132
|
+
await client.callAnalysis.create({ callDirection: 'INBOUND', interfaceType: 'PHONE', participants: [{ role: 'AGENT' }, { role: 'AGENT' }], recordingUrl: 'https://example.com/recording.wav', startedAt: '2025-02-07T23:54:52.479Z' }, {
|
136
133
|
maxRetries: 5,
|
137
134
|
});
|
138
135
|
```
|
@@ -149,7 +146,7 @@ const client = new Roark({
|
|
149
146
|
});
|
150
147
|
|
151
148
|
// Override per-request:
|
152
|
-
await client.callAnalysis.create({ participants: [{ role: 'AGENT'
|
149
|
+
await client.callAnalysis.create({ callDirection: 'INBOUND', interfaceType: 'PHONE', participants: [{ role: 'AGENT' }, { role: 'AGENT' }], recordingUrl: 'https://example.com/recording.wav', startedAt: '2025-02-07T23:54:52.479Z' }, {
|
153
150
|
timeout: 5 * 1000,
|
154
151
|
});
|
155
152
|
```
|
@@ -172,12 +169,11 @@ const client = new Roark();
|
|
172
169
|
|
173
170
|
const response = await client.callAnalysis
|
174
171
|
.create({
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
],
|
172
|
+
callDirection: 'INBOUND',
|
173
|
+
interfaceType: 'PHONE',
|
174
|
+
participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
|
179
175
|
recordingUrl: 'https://example.com/recording.wav',
|
180
|
-
startedAt: '2025-02-
|
176
|
+
startedAt: '2025-02-07T23:54:52.479Z',
|
181
177
|
})
|
182
178
|
.asResponse();
|
183
179
|
console.log(response.headers.get('X-My-Header'));
|
@@ -185,12 +181,11 @@ console.log(response.statusText); // access the underlying Response object
|
|
185
181
|
|
186
182
|
const { data: callAnalysis, response: raw } = await client.callAnalysis
|
187
183
|
.create({
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
],
|
184
|
+
callDirection: 'INBOUND',
|
185
|
+
interfaceType: 'PHONE',
|
186
|
+
participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
|
192
187
|
recordingUrl: 'https://example.com/recording.wav',
|
193
|
-
startedAt: '2025-02-
|
188
|
+
startedAt: '2025-02-07T23:54:52.479Z',
|
194
189
|
})
|
195
190
|
.withResponse();
|
196
191
|
console.log(raw.headers.get('X-My-Header'));
|
@@ -300,12 +295,11 @@ const client = new Roark({
|
|
300
295
|
// Override per-request:
|
301
296
|
await client.callAnalysis.create(
|
302
297
|
{
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
],
|
298
|
+
callDirection: 'INBOUND',
|
299
|
+
interfaceType: 'PHONE',
|
300
|
+
participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
|
307
301
|
recordingUrl: 'https://example.com/recording.wav',
|
308
|
-
startedAt: '2025-02-
|
302
|
+
startedAt: '2025-02-07T23:54:52.479Z',
|
309
303
|
},
|
310
304
|
{
|
311
305
|
httpAgent: new http.Agent({ keepAlive: false }),
|
package/package.json
CHANGED
@@ -40,14 +40,22 @@ export declare namespace CallAnalysisCreateResponse {
|
|
40
40
|
namespace Call {
|
41
41
|
interface Participant {
|
42
42
|
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
43
|
-
spokeFirst: boolean;
|
44
43
|
name?: string;
|
45
44
|
phoneNumber?: string;
|
45
|
+
spokeFirst?: boolean;
|
46
46
|
}
|
47
47
|
}
|
48
48
|
}
|
49
49
|
}
|
50
50
|
export interface CallAnalysisCreateParams {
|
51
|
+
/**
|
52
|
+
* Direction of the call (INBOUND or OUTBOUND)
|
53
|
+
*/
|
54
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
55
|
+
/**
|
56
|
+
* Interface type of the call (PHONE or WEB)
|
57
|
+
*/
|
58
|
+
interfaceType: 'PHONE' | 'WEB';
|
51
59
|
/**
|
52
60
|
* Exactly two participants in the call
|
53
61
|
*/
|
@@ -56,10 +64,17 @@ export interface CallAnalysisCreateParams {
|
|
56
64
|
* URL of source recording (must be an accessible WAV file). Can be a signed URL.
|
57
65
|
*/
|
58
66
|
recordingUrl: string;
|
67
|
+
/**
|
68
|
+
* When the call started (ISO 8601 format)
|
69
|
+
*/
|
59
70
|
startedAt: string;
|
60
|
-
|
71
|
+
/**
|
72
|
+
* Reason why the call ended (optional)
|
73
|
+
*/
|
61
74
|
endedReason?: string;
|
62
|
-
|
75
|
+
/**
|
76
|
+
* Whether this is a test call
|
77
|
+
*/
|
63
78
|
isTest?: boolean;
|
64
79
|
/**
|
65
80
|
* URL of source stereo recording in WAV format. Must be accessible. Can be a
|
@@ -70,9 +85,9 @@ export interface CallAnalysisCreateParams {
|
|
70
85
|
export declare namespace CallAnalysisCreateParams {
|
71
86
|
interface Participant {
|
72
87
|
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
73
|
-
spokeFirst: boolean;
|
74
88
|
name?: string;
|
75
89
|
phoneNumber?: string;
|
90
|
+
spokeFirst?: boolean;
|
76
91
|
}
|
77
92
|
}
|
78
93
|
export declare namespace CallAnalysis {
|
@@ -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;;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,WAA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,OAAO,CAAC;IAEjB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,WAAW;QAC1B,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;QAEtE,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,UAAU,CAAC,EAAE,OAAO,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"}
|
@@ -64,17 +64,27 @@ export namespace CallAnalysisCreateResponse {
|
|
64
64
|
export interface Participant {
|
65
65
|
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
66
66
|
|
67
|
-
spokeFirst: boolean;
|
68
|
-
|
69
67
|
name?: string;
|
70
68
|
|
71
69
|
phoneNumber?: string;
|
70
|
+
|
71
|
+
spokeFirst?: boolean;
|
72
72
|
}
|
73
73
|
}
|
74
74
|
}
|
75
75
|
}
|
76
76
|
|
77
77
|
export interface CallAnalysisCreateParams {
|
78
|
+
/**
|
79
|
+
* Direction of the call (INBOUND or OUTBOUND)
|
80
|
+
*/
|
81
|
+
callDirection: 'INBOUND' | 'OUTBOUND';
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Interface type of the call (PHONE or WEB)
|
85
|
+
*/
|
86
|
+
interfaceType: 'PHONE' | 'WEB';
|
87
|
+
|
78
88
|
/**
|
79
89
|
* Exactly two participants in the call
|
80
90
|
*/
|
@@ -85,14 +95,19 @@ export interface CallAnalysisCreateParams {
|
|
85
95
|
*/
|
86
96
|
recordingUrl: string;
|
87
97
|
|
98
|
+
/**
|
99
|
+
* When the call started (ISO 8601 format)
|
100
|
+
*/
|
88
101
|
startedAt: string;
|
89
102
|
|
90
|
-
|
91
|
-
|
103
|
+
/**
|
104
|
+
* Reason why the call ended (optional)
|
105
|
+
*/
|
92
106
|
endedReason?: string;
|
93
107
|
|
94
|
-
|
95
|
-
|
108
|
+
/**
|
109
|
+
* Whether this is a test call
|
110
|
+
*/
|
96
111
|
isTest?: boolean;
|
97
112
|
|
98
113
|
/**
|
@@ -106,11 +121,11 @@ export namespace CallAnalysisCreateParams {
|
|
106
121
|
export interface Participant {
|
107
122
|
role: 'AGENT' | 'CUSTOMER' | 'SIMULATED_AGENT' | 'SIMULATED_CUSTOMER';
|
108
123
|
|
109
|
-
spokeFirst: boolean;
|
110
|
-
|
111
124
|
name?: string;
|
112
125
|
|
113
126
|
phoneNumber?: string;
|
127
|
+
|
128
|
+
spokeFirst?: boolean;
|
114
129
|
}
|
115
130
|
}
|
116
131
|
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = '0.
|
1
|
+
export const VERSION = '0.36.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.36.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.36.0'; // x-release-please-version
|
2
2
|
//# sourceMappingURL=version.mjs.map
|