mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
⚡ Improvements to Quick Base Node
This commit is contained in:
parent
4eed7bb9fb
commit
60be31d410
|
@ -13,6 +13,7 @@ export class QuickBaseApi implements ICredentialType {
|
||||||
name: 'hostname',
|
name: 'hostname',
|
||||||
type: 'string' as NodePropertyTypes,
|
type: 'string' as NodePropertyTypes,
|
||||||
default: '',
|
default: '',
|
||||||
|
required: true,
|
||||||
placeholder: 'demo.quickbase.com',
|
placeholder: 'demo.quickbase.com',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -20,6 +21,7 @@ export class QuickBaseApi implements ICredentialType {
|
||||||
name: 'userToken',
|
name: 'userToken',
|
||||||
type: 'string' as NodePropertyTypes,
|
type: 'string' as NodePropertyTypes,
|
||||||
default: '',
|
default: '',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const fieldOperations = [
|
||||||
description: 'Get all fields',
|
description: 'Get all fields',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'getAll',
|
||||||
description: 'The operation to perform.',
|
description: 'The operation to perform.',
|
||||||
},
|
},
|
||||||
] as INodeProperties[];
|
] as INodeProperties[];
|
||||||
|
|
|
@ -52,7 +52,7 @@ export const fileFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The table identifier',
|
description: 'The table identifier.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Record ID',
|
displayName: 'Record ID',
|
||||||
|
@ -71,7 +71,7 @@ export const fileFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The unique identifier of the record',
|
description: 'The unique identifier of the record.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Field ID',
|
displayName: 'Field ID',
|
||||||
|
|
|
@ -17,11 +17,15 @@ export async function quickbaseApiRequest(this: IExecuteFunctions | ILoadOptions
|
||||||
|
|
||||||
const credentials = this.getCredentials('quickbaseApi') as IDataObject;
|
const credentials = this.getCredentials('quickbaseApi') as IDataObject;
|
||||||
|
|
||||||
if (credentials.hostname === '') {
|
if (credentials === undefined) {
|
||||||
|
throw new Error('No credentials got returned!');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!credentials.hostname) {
|
||||||
throw new Error('Hostname must be defined');
|
throw new Error('Hostname must be defined');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (credentials.userKey === '') {
|
if (!credentials.userToken) {
|
||||||
throw new Error('User Token must be defined');
|
throw new Error('User Token must be defined');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ export class QuickBase implements INodeType {
|
||||||
displayName: 'Quick Base',
|
displayName: 'Quick Base',
|
||||||
name: 'quickbase',
|
name: 'quickbase',
|
||||||
icon: 'file:quickbase.png',
|
icon: 'file:quickbase.png',
|
||||||
group: [ 'input' ],
|
group: ['input'],
|
||||||
version: 1,
|
version: 1,
|
||||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||||
description: 'Integrate with the Quick Base RESTful API.',
|
description: 'Integrate with the Quick Base RESTful API.',
|
||||||
|
@ -50,11 +50,12 @@ export class QuickBase implements INodeType {
|
||||||
name: 'Quick Base',
|
name: 'Quick Base',
|
||||||
color: '#73489d',
|
color: '#73489d',
|
||||||
},
|
},
|
||||||
inputs: [ 'main' ],
|
inputs: ['main'],
|
||||||
outputs: [ 'main' ],
|
outputs: ['main'],
|
||||||
credentials: [
|
credentials: [
|
||||||
{
|
{
|
||||||
name: 'quickbaseApi',
|
name: 'quickbaseApi',
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
properties: [
|
properties: [
|
||||||
|
@ -176,7 +177,7 @@ export class QuickBase implements INodeType {
|
||||||
|
|
||||||
const versionNumber = this.getNodeParameter('versionNumber', i) as string;
|
const versionNumber = this.getNodeParameter('versionNumber', i) as string;
|
||||||
|
|
||||||
responseData = await quickbaseApiRequest.call(this,'DELETE', `/files/${tableId}/${recordId}/${fieldId}/${versionNumber}`);
|
responseData = await quickbaseApiRequest.call(this, 'DELETE', `/files/${tableId}/${recordId}/${fieldId}/${versionNumber}`);
|
||||||
|
|
||||||
returnData.push(responseData);
|
returnData.push(responseData);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +211,7 @@ export class QuickBase implements INodeType {
|
||||||
|
|
||||||
const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string;
|
const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string;
|
||||||
|
|
||||||
responseData = await quickbaseApiRequest.call(this,'GET', `/files/${tableId}/${recordId}/${fieldId}/${versionNumber}`, {}, {}, { json: false, resolveWithFullResponse: true });
|
responseData = await quickbaseApiRequest.call(this, 'GET', `/files/${tableId}/${recordId}/${fieldId}/${versionNumber}`, {}, {}, { json: false, resolveWithFullResponse: true });
|
||||||
|
|
||||||
//content-disposition': 'attachment; filename="dog-puppy-on-garden-royalty-free-image-1586966191.jpg"',
|
//content-disposition': 'attachment; filename="dog-puppy-on-garden-royalty-free-image-1586966191.jpg"',
|
||||||
const contentDisposition = responseData.headers['content-disposition'];
|
const contentDisposition = responseData.headers['content-disposition'];
|
||||||
|
|
|
@ -83,6 +83,7 @@ export const recordFields = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
required: true,
|
||||||
placeholder: 'id,name,description',
|
placeholder: 'id,name,description',
|
||||||
description: 'Comma separated list of the properties which should used as columns for the new rows.',
|
description: 'Comma separated list of the properties which should used as columns for the new rows.',
|
||||||
},
|
},
|
||||||
|
@ -403,6 +404,7 @@ export const recordFields = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
required: true,
|
||||||
placeholder: 'id,name,description',
|
placeholder: 'id,name,description',
|
||||||
description: 'Comma separated list of the properties which should used as columns for the new rows.',
|
description: 'Comma separated list of the properties which should used as columns for the new rows.',
|
||||||
},
|
},
|
||||||
|
@ -520,6 +522,7 @@ export const recordFields = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
required: true,
|
||||||
placeholder: 'id,name,description',
|
placeholder: 'id,name,description',
|
||||||
description: 'Comma separated list of the properties which should used as columns for the new rows.',
|
description: 'Comma separated list of the properties which should used as columns for the new rows.',
|
||||||
},
|
},
|
||||||
|
|
|
@ -51,7 +51,7 @@ export const reportFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The table identifier',
|
description: 'The table identifier.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Report ID',
|
displayName: 'Report ID',
|
||||||
|
@ -69,7 +69,7 @@ export const reportFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The identifier of the report, unique to the table',
|
description: 'The identifier of the report, unique to the table.',
|
||||||
},
|
},
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* report:run */
|
/* report:run */
|
||||||
|
@ -90,7 +90,7 @@ export const reportFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The table identifier',
|
description: 'The table identifier.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Report ID',
|
displayName: 'Report ID',
|
||||||
|
@ -108,7 +108,7 @@ export const reportFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'The identifier of the report, unique to the table',
|
description: 'The identifier of the report, unique to the table.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Return All',
|
displayName: 'Return All',
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in a new issue