@unboundcx/sdk 4.13.17 → 4.13.18
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/dataImport.js +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.18",
|
|
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",
|
package/services/dataImport.js
CHANGED
|
@@ -147,6 +147,27 @@ export class DataImportService {
|
|
|
147
147
|
return internalRequest(this.sdk, `/dataImport/jobs/${jobId}/rows`, 'GET');
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Download job rows as CSV (source columns + rowNumber,status,errorCode,errorMessage).
|
|
152
|
+
* Returns the raw CSV text (UTF-8, BOM-prefixed).
|
|
153
|
+
* @param {string} jobId
|
|
154
|
+
* @param {Object} [query] { status } default 'error'; also 'resolved', 'skipped',
|
|
155
|
+
* a comma list, or 'all' for no filter.
|
|
156
|
+
*/
|
|
157
|
+
async downloadRowsCsv(jobId, query = { status: 'error' }) {
|
|
158
|
+
this.sdk.validateParams(
|
|
159
|
+
{ jobId },
|
|
160
|
+
{ jobId: { type: 'string', required: true } },
|
|
161
|
+
);
|
|
162
|
+
return internalRequest(
|
|
163
|
+
this.sdk,
|
|
164
|
+
`/dataImport/jobs/${jobId}/rows.csv`,
|
|
165
|
+
'GET',
|
|
166
|
+
{ query },
|
|
167
|
+
true,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
150
171
|
/**
|
|
151
172
|
* Resolve an errored row.
|
|
152
173
|
* @param {string} jobId
|