@@ -37,12 +37,6 @@ const OrgCheck = {
3737 /**
3838 * Private connection to Salesforce using JsForce
3939 */
40- //const BULK_CONNECTION = new jsforce.Connection({
41- // accessToken: configuration.accessToken,
42- // version: API_VERSION + ".0",
43- // proxyUrl: '/services/proxy',
44- // instanceUrl: 'https://eu29.salesforce.com'
45- //});
4640 const CONNECTION = new jsforce.Connection({
4741 accessToken: configuration.accessToken,
4842 version: API_VERSION + ".0",
@@ -283,51 +277,6 @@ const OrgCheck = {
283277 }
284278 api.query(config.queryString, callback_api);
285279 break;
286-
287- case 'bulk':
288- /* bug in jsforce for bulk api with more than one batch */
289- //const query = config.queryString;
290- //const start = query.toUpperCase().lastIndexOf('FROM ')+5;
291- //const end = query.indexOf(' ', start);
292- //const table = query.substring(start, end);
293- //const job = BULK_CONNECTION.bulk.createJob(table, 'query');
294- //const batch = job.createBatch();
295- //batch.execute(query);
296- //batch.on('error', err => config.onError(err));
297- //batch.on('queue', info => {
298- // console.log('queue ==> info: ', info);
299- // batch.poll(1000, 500000);
300- //});
301- //batch.on('response', responses => {
302- // console.log('response ==> responses: ', responses);
303- // responses.forEach(response => {
304- // const ebatch = BULK_CONNECTION.bulk.job(response.jobId).batch(response.batchId);
305- // ebatch.retrieve((error, results) => {
306- // // Check errors
307- // if (error) {
308- // config.onError(error);
309- // return;
310- // }
311- // // Add results to data
312- // console.log('response ==> results: ', results);
313- // results.forEach(result => ebatch.result(result.id)
314- // .on('data', d => {
315- // console.log('record====', d);
316- // wrap(d);
317- // })
318- // .on('end', function() {
319- // if (config.onEnd) {
320- // config.onEnd(data.records, data.size);
321- // }
322- // console.log('end====', data.records, data.size);
323- // })
324- // );
325- // });
326- // });
327- // // Close job
328- // job.close();
329- //});
330- break;
331280 }
332281 } catch (error) {
333282 config.onError(error);
0 commit comments