n8n-nodes-evolution-api
Advanced tools
Comparing version 0.1.79 to 0.1.80
@@ -1,6 +0,5 @@ | ||
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow'; | ||
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow'; | ||
export declare class HttpBin implements INodeType { | ||
description: INodeTypeDescription; | ||
getInstances(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>; | ||
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>; | ||
} |
@@ -58,31 +58,9 @@ "use strict"; | ||
} | ||
async getInstances() { | ||
const returnData = []; | ||
const credentials = await this.getCredentials('httpbinApi'); | ||
const serverUrl = credentials['server-url']; | ||
const apiKey = credentials.apikey; | ||
try { | ||
const response = await this.helpers.request({ | ||
method: 'GET', | ||
url: `${serverUrl}/instance/fetchInstances`, | ||
headers: { | ||
apikey: apiKey, | ||
}, | ||
}); | ||
const instances = JSON.parse(response); | ||
for (const instance of instances) { | ||
returnData.push({ | ||
name: instance.instanceName, | ||
value: instance.instanceName, | ||
}); | ||
} | ||
} | ||
catch (error) { | ||
throw new n8n_workflow_1.NodeApiError(this.getNode(), error); | ||
} | ||
return returnData; | ||
} | ||
async execute() { | ||
const resource = this.getNodeParameter('resource', 0); | ||
const operation = this.getNodeParameter('operation', 0); | ||
if (resource === 'instances-api' && operation === 'delete-instance') { | ||
const instanceOptions = await HttpVerbDescription_1.getInstances.call(this); | ||
this.getNodeParameter('instanceName', 0, instanceOptions); | ||
} | ||
let responseData; | ||
@@ -89,0 +67,0 @@ if (resource === 'instances-api' && operation === 'instance-basic') { |
@@ -1,3 +0,4 @@ | ||
import { INodeProperties } from 'n8n-workflow'; | ||
import { IExecuteFunctions, INodeProperties, INodePropertyOptions } from 'n8n-workflow'; | ||
export declare function getInstances(this: IExecuteFunctions): Promise<INodePropertyOptions[]>; | ||
export declare const httpVerbOperations: INodeProperties[]; | ||
export declare const httpVerbFields: INodeProperties[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.httpVerbFields = exports.httpVerbOperations = void 0; | ||
exports.getInstances = getInstances; | ||
async function getInstances() { | ||
const returnData = []; | ||
const credentials = await this.getCredentials('httpbinApi'); | ||
const serverUrl = credentials['server-url']; | ||
const apiKey = credentials.apikey; | ||
try { | ||
const response = await this.helpers.request({ | ||
method: 'GET', | ||
url: `${serverUrl}/instance/fetchInstances`, | ||
headers: { | ||
apikey: apiKey, | ||
}, | ||
}); | ||
const instances = JSON.parse(response); | ||
for (const instance of instances) { | ||
returnData.push({ | ||
name: instance.name, | ||
value: instance.id, | ||
}); | ||
} | ||
} | ||
catch (error) { | ||
throw new Error(`Erro ao buscar instâncias: ${error.message}`); | ||
} | ||
return returnData; | ||
} | ||
exports.httpVerbOperations = [ | ||
@@ -140,3 +167,3 @@ { | ||
{ | ||
displayName: 'Token', | ||
displayName: 'Apikey Para Instancia', | ||
name: 'token', | ||
@@ -192,3 +219,3 @@ type: 'string', | ||
{ | ||
displayName: 'Token', | ||
displayName: 'Apikey Para Instancia', | ||
name: 'token', | ||
@@ -198,3 +225,3 @@ type: 'string', | ||
default: '', | ||
description: 'Digite o token', | ||
description: 'Opicional: Digite um Token para a instancia', | ||
displayOptions: { | ||
@@ -301,3 +328,2 @@ show: { | ||
default: '', | ||
required: true, | ||
description: 'Digite a senha do proxy', | ||
@@ -474,6 +500,6 @@ displayOptions: { | ||
name: 'instanceName', | ||
type: 'string', | ||
type: 'options', | ||
default: '', | ||
required: true, | ||
description: 'Digite o nome para a instância', | ||
description: 'Selecione a instância que deseja deletar', | ||
displayOptions: { | ||
@@ -485,2 +511,3 @@ show: { | ||
}, | ||
options: [], | ||
}, | ||
@@ -487,0 +514,0 @@ ]; |
{ | ||
"name": "n8n-nodes-evolution-api", | ||
"version": "0.1.79", | ||
"version": "0.1.80", | ||
"description": "Api não oficial do WhatsApp", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "n8n-nodes-evolution-api", | ||
"version": "0.1.79", | ||
"version": "0.1.80", | ||
"description": "Api não oficial do WhatsApp", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116729
1640