@unboundcx/sdk 4.13.81 → 4.13.82
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/package.json +1 -1
- package/services/reportingAgents.js +20 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.82",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -88,9 +88,10 @@ export class ReportingAgentsService {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* Per-agent per-local-day timesheet rows (net paid hours)
|
|
91
|
+
* Per-agent per-local-day timesheet rows (net paid hours), plus one
|
|
92
|
+
* additive-sum row per agent (`agents`) for grouped totals.
|
|
92
93
|
* @param {Object} params - { from, to, userIds, teamIds }
|
|
93
|
-
* @returns {Promise<Object>} { columns, rows }
|
|
94
|
+
* @returns {Promise<Object>} { columns, rows, agents }
|
|
94
95
|
* @example
|
|
95
96
|
* await sdk.reporting.agents.timesheet({ from, to, userIds: ['u1'] });
|
|
96
97
|
*/
|
|
@@ -107,13 +108,26 @@ export class ReportingAgentsService {
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
|
-
* CSV export of any of the four views above.
|
|
111
|
-
*
|
|
111
|
+
* CSV export of any of the four views above. For view: 'timesheet', pass
|
|
112
|
+
* `totals: true` to get one additive-sum row per agent instead of the
|
|
113
|
+
* flat per-agent-per-day rows.
|
|
114
|
+
* @param {Object} params - { view: 'summary'|'states'|'interactions'|'timesheet', from, to, userId, userIds, queueIds, teamIds, groupBy, totals }
|
|
112
115
|
* @returns {Promise<Object>} raw CSV response (transport-dependent)
|
|
113
116
|
* @example
|
|
114
117
|
* await sdk.reporting.agents.export({ view: 'timesheet', from, to });
|
|
118
|
+
* await sdk.reporting.agents.export({ view: 'timesheet', from, to, totals: true });
|
|
115
119
|
*/
|
|
116
|
-
async export({
|
|
120
|
+
async export({
|
|
121
|
+
view,
|
|
122
|
+
from,
|
|
123
|
+
to,
|
|
124
|
+
userId,
|
|
125
|
+
userIds,
|
|
126
|
+
queueIds,
|
|
127
|
+
teamIds,
|
|
128
|
+
groupBy,
|
|
129
|
+
totals,
|
|
130
|
+
} = {}) {
|
|
117
131
|
this.sdk.validateParams(
|
|
118
132
|
{ from, to },
|
|
119
133
|
{ from: { type: 'string', required: true }, to: { type: 'string', required: true } },
|
|
@@ -127,6 +141,7 @@ export class ReportingAgentsService {
|
|
|
127
141
|
queueIds,
|
|
128
142
|
teamIds,
|
|
129
143
|
groupBy,
|
|
144
|
+
totals: totals ? '1' : undefined,
|
|
130
145
|
format: 'csv',
|
|
131
146
|
});
|
|
132
147
|
return internalRequest(this.sdk, `/reporting/agents/export${qs}`, 'GET', { httpOnly: true });
|