2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2023-03-09 09:13:15 -08:00
|
|
|
IExecuteFunctions,
|
2022-11-15 05:57:07 -08:00
|
|
|
ICredentialsDecrypted,
|
|
|
|
ICredentialTestFunctions,
|
|
|
|
IDataObject,
|
|
|
|
ILoadOptionsFunctions,
|
|
|
|
INodeCredentialTestResult,
|
|
|
|
INodeExecutionData,
|
|
|
|
INodePropertyOptions,
|
|
|
|
INodeType,
|
|
|
|
INodeTypeBaseDescription,
|
|
|
|
INodeTypeDescription,
|
|
|
|
} from 'n8n-workflow';
|
2023-01-27 03:22:44 -08:00
|
|
|
import { NodeOperationError } from 'n8n-workflow';
|
2022-11-15 05:57:07 -08:00
|
|
|
|
2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2022-11-15 05:57:07 -08:00
|
|
|
ILookupValues,
|
|
|
|
ISheetUpdateData,
|
|
|
|
IToDelete,
|
|
|
|
ValueInputOption,
|
|
|
|
ValueRenderOption,
|
|
|
|
} from './GoogleSheet';
|
2023-01-27 03:22:44 -08:00
|
|
|
import { GoogleSheet } from './GoogleSheet';
|
2022-11-15 05:57:07 -08:00
|
|
|
|
2023-06-06 09:19:24 -07:00
|
|
|
import { googleApiRequest, hexToRgb } from './GenericFunctions';
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
import { versionDescription } from './versionDescription';
|
2023-06-06 09:19:24 -07:00
|
|
|
import { getGoogleAccessToken } from '../../GenericFunctions';
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
export class GoogleSheetsV1 implements INodeType {
|
|
|
|
description: INodeTypeDescription;
|
|
|
|
|
|
|
|
constructor(baseDescription: INodeTypeBaseDescription) {
|
|
|
|
this.description = {
|
|
|
|
...baseDescription,
|
|
|
|
...versionDescription,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
methods = {
|
|
|
|
loadOptions: {
|
|
|
|
// Get all the sheets in a Spreadsheet
|
|
|
|
async getSheets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
|
|
|
const spreadsheetId = this.getCurrentNodeParameter('sheetId') as string;
|
|
|
|
|
|
|
|
const sheet = new GoogleSheet(spreadsheetId, this);
|
|
|
|
const responseData = await sheet.spreadsheetGetSheets();
|
|
|
|
|
|
|
|
if (responseData === undefined) {
|
|
|
|
throw new NodeOperationError(this.getNode(), 'No data got returned');
|
|
|
|
}
|
|
|
|
|
|
|
|
const returnData: INodePropertyOptions[] = [];
|
2022-12-02 12:54:28 -08:00
|
|
|
for (const entry of responseData.sheets!) {
|
|
|
|
if (entry.properties!.sheetType !== 'GRID') {
|
2022-11-15 05:57:07 -08:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
returnData.push({
|
2022-12-02 12:54:28 -08:00
|
|
|
name: entry.properties!.title as string,
|
|
|
|
value: entry.properties!.sheetId as unknown as string,
|
2022-11-15 05:57:07 -08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return returnData;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
credentialTest: {
|
|
|
|
async googleApiCredentialTest(
|
|
|
|
this: ICredentialTestFunctions,
|
|
|
|
credential: ICredentialsDecrypted,
|
|
|
|
): Promise<INodeCredentialTestResult> {
|
|
|
|
try {
|
2023-06-06 09:19:24 -07:00
|
|
|
const tokenRequest = await getGoogleAccessToken.call(this, credential.data!, 'sheetV1');
|
|
|
|
|
2022-11-15 05:57:07 -08:00
|
|
|
if (!tokenRequest.access_token) {
|
|
|
|
return {
|
|
|
|
status: 'Error',
|
|
|
|
message: 'Could not generate a token from your private key.',
|
|
|
|
};
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
return {
|
|
|
|
status: 'Error',
|
|
|
|
message: `Private key validation failed: ${err.message}`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
status: 'OK',
|
|
|
|
message: 'Connection successful!',
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
2022-12-02 03:53:59 -08:00
|
|
|
const operation = this.getNodeParameter('operation', 0);
|
|
|
|
const resource = this.getNodeParameter('resource', 0);
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
if (resource === 'sheet') {
|
|
|
|
const spreadsheetId = this.getNodeParameter('sheetId', 0) as string;
|
|
|
|
|
|
|
|
const sheet = new GoogleSheet(spreadsheetId, this);
|
|
|
|
|
|
|
|
let range = '';
|
|
|
|
if (!['create', 'delete', 'remove'].includes(operation)) {
|
|
|
|
range = this.getNodeParameter('range', 0) as string;
|
|
|
|
}
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
const options = this.getNodeParameter('options', 0, {});
|
2022-11-15 05:57:07 -08:00
|
|
|
|
2023-01-19 04:37:19 -08:00
|
|
|
const valueInputMode = (options.valueInputMode || 'RAW') as ValueInputOption;
|
|
|
|
const valueRenderMode = (options.valueRenderMode || 'UNFORMATTED_VALUE') as ValueRenderOption;
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
if (operation === 'append') {
|
|
|
|
// ----------------------------------
|
|
|
|
// append
|
|
|
|
// ----------------------------------
|
|
|
|
try {
|
|
|
|
const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10);
|
|
|
|
|
|
|
|
const items = this.getInputData();
|
|
|
|
|
|
|
|
const setData: IDataObject[] = [];
|
|
|
|
items.forEach((item) => {
|
|
|
|
setData.push(item.json);
|
|
|
|
});
|
|
|
|
|
2023-01-19 04:37:19 -08:00
|
|
|
const usePathForKeyRow = (options.usePathForKeyRow || false) as boolean;
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
// Convert data into array format
|
|
|
|
const _data = await sheet.appendSheetData(
|
|
|
|
setData,
|
|
|
|
sheet.encodeRange(range),
|
|
|
|
keyRow,
|
|
|
|
valueInputMode,
|
|
|
|
usePathForKeyRow,
|
|
|
|
);
|
|
|
|
|
|
|
|
// TODO: Should add this data somewhere
|
|
|
|
// TODO: Should have something like add metadata which does not get passed through
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
return await this.prepareOutputData(items);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
return this.prepareOutputData([{ json: { error: error.message } }]);
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
} else if (operation === 'clear') {
|
|
|
|
// ----------------------------------
|
|
|
|
// clear
|
|
|
|
// ----------------------------------
|
|
|
|
try {
|
|
|
|
await sheet.clearData(sheet.encodeRange(range));
|
|
|
|
|
|
|
|
const items = this.getInputData();
|
2022-12-02 12:54:28 -08:00
|
|
|
return await this.prepareOutputData(items);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
return this.prepareOutputData([{ json: { error: error.message } }]);
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
} else if (operation === 'create') {
|
|
|
|
const returnData: IDataObject[] = [];
|
|
|
|
|
|
|
|
let responseData;
|
|
|
|
for (let i = 0; i < this.getInputData().length; i++) {
|
|
|
|
try {
|
2022-12-02 12:54:28 -08:00
|
|
|
const sheetId = this.getNodeParameter('sheetId', i) as string;
|
|
|
|
const iterationOptions = this.getNodeParameter('options', i, {});
|
2022-11-15 05:57:07 -08:00
|
|
|
const simple = this.getNodeParameter('simple', 0) as boolean;
|
2022-12-02 12:54:28 -08:00
|
|
|
const properties = { ...iterationOptions };
|
2022-11-15 05:57:07 -08:00
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
if (iterationOptions.tabColor) {
|
|
|
|
const { red, green, blue } = hexToRgb(iterationOptions.tabColor as string)!;
|
2022-11-15 05:57:07 -08:00
|
|
|
properties.tabColor = { red: red / 255, green: green / 255, blue: blue / 255 };
|
|
|
|
}
|
|
|
|
|
|
|
|
const requests = [
|
|
|
|
{
|
|
|
|
addSheet: {
|
|
|
|
properties,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
responseData = await googleApiRequest.call(
|
|
|
|
this,
|
|
|
|
'POST',
|
2022-12-02 12:54:28 -08:00
|
|
|
`/v4/spreadsheets/${sheetId}:batchUpdate`,
|
2022-11-15 05:57:07 -08:00
|
|
|
{ requests },
|
|
|
|
);
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
if (simple) {
|
2022-11-15 05:57:07 -08:00
|
|
|
Object.assign(responseData, responseData.replies[0].addSheet.properties);
|
|
|
|
delete responseData.replies;
|
|
|
|
}
|
2023-02-27 19:39:43 -08:00
|
|
|
returnData.push(responseData as IDataObject);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
returnData.push({ error: error.message });
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return [this.helpers.returnJsonArray(returnData)];
|
|
|
|
} else if (operation === 'delete') {
|
|
|
|
// ----------------------------------
|
|
|
|
// delete
|
|
|
|
// ----------------------------------
|
|
|
|
try {
|
|
|
|
const requests: IDataObject[] = [];
|
|
|
|
|
|
|
|
const toDelete = this.getNodeParameter('toDelete', 0) as IToDelete;
|
|
|
|
|
|
|
|
const deletePropertyToDimensions: IDataObject = {
|
|
|
|
columns: 'COLUMNS',
|
|
|
|
rows: 'ROWS',
|
|
|
|
};
|
|
|
|
|
|
|
|
for (const propertyName of Object.keys(deletePropertyToDimensions)) {
|
|
|
|
if (toDelete[propertyName] !== undefined) {
|
2022-12-02 12:54:28 -08:00
|
|
|
toDelete[propertyName]!.forEach((entry) => {
|
2022-11-15 05:57:07 -08:00
|
|
|
requests.push({
|
|
|
|
deleteDimension: {
|
|
|
|
range: {
|
2022-12-02 12:54:28 -08:00
|
|
|
sheetId: entry.sheetId,
|
2022-11-15 05:57:07 -08:00
|
|
|
dimension: deletePropertyToDimensions[propertyName] as string,
|
2022-12-02 12:54:28 -08:00
|
|
|
startIndex: entry.startIndex,
|
2022-11-15 05:57:07 -08:00
|
|
|
endIndex:
|
2022-12-02 12:54:28 -08:00
|
|
|
parseInt(entry.startIndex.toString(), 10) +
|
|
|
|
parseInt(entry.amount.toString(), 10),
|
2022-11-15 05:57:07 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const _data = await sheet.spreadsheetBatchUpdate(requests);
|
|
|
|
|
|
|
|
const items = this.getInputData();
|
2022-12-02 12:54:28 -08:00
|
|
|
return await this.prepareOutputData(items);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
return this.prepareOutputData([{ json: { error: error.message } }]);
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
} else if (operation === 'lookup') {
|
|
|
|
// ----------------------------------
|
|
|
|
// lookup
|
|
|
|
// ----------------------------------
|
|
|
|
try {
|
|
|
|
const sheetData = await sheet.getData(sheet.encodeRange(range), valueRenderMode);
|
|
|
|
|
|
|
|
if (sheetData === undefined) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
const dataStartRow = parseInt(this.getNodeParameter('dataStartRow', 0) as string, 10);
|
|
|
|
const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10);
|
|
|
|
|
|
|
|
const items = this.getInputData();
|
|
|
|
|
|
|
|
const lookupValues: ILookupValues[] = [];
|
|
|
|
for (let i = 0; i < items.length; i++) {
|
|
|
|
lookupValues.push({
|
|
|
|
lookupColumn: this.getNodeParameter('lookupColumn', i) as string,
|
|
|
|
lookupValue: this.getNodeParameter('lookupValue', i) as string,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
let returnData = await sheet.lookupValues(
|
|
|
|
sheetData,
|
|
|
|
keyRow,
|
|
|
|
dataStartRow,
|
|
|
|
lookupValues,
|
|
|
|
options.returnAllMatches as boolean | undefined,
|
|
|
|
);
|
|
|
|
|
|
|
|
if (returnData.length === 0 && options.continue && options.returnAllMatches) {
|
|
|
|
returnData = [{}];
|
|
|
|
} else if (
|
|
|
|
returnData.length === 1 &&
|
|
|
|
Object.keys(returnData[0]).length === 0 &&
|
|
|
|
!options.continue &&
|
|
|
|
!options.returnAllMatches
|
|
|
|
) {
|
|
|
|
returnData = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
return [this.helpers.returnJsonArray(returnData)];
|
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
return [this.helpers.returnJsonArray({ error: error.message })];
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
} else if (operation === 'read') {
|
|
|
|
// ----------------------------------
|
|
|
|
// read
|
|
|
|
// ----------------------------------
|
|
|
|
try {
|
2022-12-02 12:54:28 -08:00
|
|
|
const rawData = this.getNodeParameter('rawData', 0);
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
const sheetData = await sheet.getData(sheet.encodeRange(range), valueRenderMode);
|
|
|
|
|
|
|
|
let returnData: IDataObject[];
|
|
|
|
if (!sheetData) {
|
|
|
|
returnData = [];
|
2022-12-02 12:54:28 -08:00
|
|
|
} else if (rawData) {
|
2022-11-15 05:57:07 -08:00
|
|
|
const dataProperty = this.getNodeParameter('dataProperty', 0) as string;
|
|
|
|
returnData = [
|
|
|
|
{
|
|
|
|
[dataProperty]: sheetData,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
const dataStartRow = parseInt(this.getNodeParameter('dataStartRow', 0) as string, 10);
|
|
|
|
const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10);
|
|
|
|
|
|
|
|
returnData = sheet.structureArrayDataByColumn(sheetData, keyRow, dataStartRow);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (returnData.length === 0 && options.continue) {
|
|
|
|
returnData = [{}];
|
|
|
|
}
|
|
|
|
|
|
|
|
return [this.helpers.returnJsonArray(returnData)];
|
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
return [this.helpers.returnJsonArray({ error: error.message })];
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
} else if (operation === 'remove') {
|
|
|
|
const returnData: IDataObject[] = [];
|
|
|
|
|
|
|
|
let responseData;
|
|
|
|
for (let i = 0; i < this.getInputData().length; i++) {
|
|
|
|
try {
|
2022-12-02 12:54:28 -08:00
|
|
|
const id = this.getNodeParameter('id', i) as string;
|
|
|
|
const sheetId = this.getNodeParameter('sheetId', i) as string;
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
const requests = [
|
|
|
|
{
|
|
|
|
deleteSheet: {
|
2022-12-02 12:54:28 -08:00
|
|
|
sheetId: id,
|
2022-11-15 05:57:07 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
responseData = await googleApiRequest.call(
|
|
|
|
this,
|
|
|
|
'POST',
|
2022-12-02 12:54:28 -08:00
|
|
|
`/v4/spreadsheets/${sheetId}:batchUpdate`,
|
2022-11-15 05:57:07 -08:00
|
|
|
{ requests },
|
|
|
|
);
|
|
|
|
delete responseData.replies;
|
2023-02-27 19:39:43 -08:00
|
|
|
returnData.push(responseData as IDataObject);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
returnData.push({ error: error.message });
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return [this.helpers.returnJsonArray(returnData)];
|
|
|
|
} else if (operation === 'update' || operation === 'upsert') {
|
|
|
|
// ----------------------------------
|
|
|
|
// update/upsert
|
|
|
|
// ----------------------------------
|
|
|
|
const upsert = operation === 'upsert' ? true : false;
|
|
|
|
try {
|
2022-12-02 12:54:28 -08:00
|
|
|
const rawData = this.getNodeParameter('rawData', 0);
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
const items = this.getInputData();
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
if (rawData) {
|
2022-11-15 05:57:07 -08:00
|
|
|
const dataProperty = this.getNodeParameter('dataProperty', 0) as string;
|
|
|
|
|
|
|
|
const updateData: ISheetUpdateData[] = [];
|
|
|
|
for (let i = 0; i < items.length; i++) {
|
|
|
|
updateData.push({
|
|
|
|
range,
|
|
|
|
values: items[i].json[dataProperty] as string[][],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const _data = await sheet.batchUpdate(updateData, valueInputMode);
|
|
|
|
} else {
|
|
|
|
const keyName = this.getNodeParameter('key', 0) as string;
|
|
|
|
const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10);
|
|
|
|
const dataStartRow = parseInt(this.getNodeParameter('dataStartRow', 0) as string, 10);
|
|
|
|
|
|
|
|
const setData: IDataObject[] = [];
|
|
|
|
items.forEach((item) => {
|
|
|
|
setData.push(item.json);
|
|
|
|
});
|
|
|
|
|
|
|
|
const _data = await sheet.updateSheetData(
|
|
|
|
setData,
|
|
|
|
keyName,
|
|
|
|
range,
|
|
|
|
keyRow,
|
|
|
|
dataStartRow,
|
|
|
|
valueInputMode,
|
|
|
|
valueRenderMode,
|
|
|
|
upsert,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// TODO: Should add this data somewhere
|
|
|
|
// TODO: Should have something like add metadata which does not get passed through
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
return await this.prepareOutputData(items);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
return this.prepareOutputData([{ json: { error: error.message } }]);
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resource === 'spreadsheet') {
|
|
|
|
const returnData: IDataObject[] = [];
|
|
|
|
|
|
|
|
let responseData;
|
|
|
|
|
|
|
|
if (operation === 'create') {
|
|
|
|
// ----------------------------------
|
|
|
|
// create
|
|
|
|
// ----------------------------------
|
|
|
|
// https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create
|
|
|
|
|
|
|
|
for (let i = 0; i < this.getInputData().length; i++) {
|
|
|
|
try {
|
|
|
|
const title = this.getNodeParameter('title', i) as string;
|
|
|
|
const sheetsUi = this.getNodeParameter('sheetsUi', i, {}) as IDataObject;
|
|
|
|
|
|
|
|
const body = {
|
|
|
|
properties: {
|
|
|
|
title,
|
|
|
|
autoRecalc: undefined as undefined | string,
|
|
|
|
locale: undefined as undefined | string,
|
|
|
|
},
|
|
|
|
sheets: [] as IDataObject[],
|
|
|
|
};
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
const options = this.getNodeParameter('options', i, {});
|
2022-11-15 05:57:07 -08:00
|
|
|
|
|
|
|
if (Object.keys(sheetsUi).length) {
|
|
|
|
const data = [];
|
|
|
|
const sheets = sheetsUi.sheetValues as IDataObject[];
|
|
|
|
for (const sheet of sheets) {
|
|
|
|
const properties = sheet.propertiesUi as IDataObject;
|
|
|
|
if (properties) {
|
|
|
|
data.push({ properties });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
body.sheets = data;
|
|
|
|
}
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
body.properties.autoRecalc = options.autoRecalc
|
2022-11-15 05:57:07 -08:00
|
|
|
? (options.autoRecalc as string)
|
|
|
|
: undefined;
|
2022-12-02 12:54:28 -08:00
|
|
|
body.properties.locale = options.locale ? (options.locale as string) : undefined;
|
2022-11-15 05:57:07 -08:00
|
|
|
|
2022-12-29 03:20:43 -08:00
|
|
|
responseData = await googleApiRequest.call(this, 'POST', '/v4/spreadsheets', body);
|
2022-11-15 05:57:07 -08:00
|
|
|
|
2023-02-27 19:39:43 -08:00
|
|
|
returnData.push(responseData as IDataObject);
|
2022-11-15 05:57:07 -08:00
|
|
|
} catch (error) {
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
returnData.push({ error: error.message });
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return [this.helpers.returnJsonArray(returnData)];
|
|
|
|
}
|
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
}
|