mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
b03e358a12
* 👕 Enable `consistent-type-imports` for nodes-base
* 👕 Apply to nodes-base
* ⏪ Undo unrelated changes
* 🚚 Move to `.eslintrc.js` in nodes-base
* ⏪ Revert "Enable `consistent-type-imports` for nodes-base"
This reverts commit 529ad72b05
.
* 👕 Fix severity
92 lines
1.7 KiB
TypeScript
92 lines
1.7 KiB
TypeScript
import type { INodeProperties } from 'n8n-workflow';
|
|
|
|
import { buildBinAPIURL, transformBinReponse } from './GenericFunctions';
|
|
|
|
// Operations for the `Bin` resource:
|
|
export const binOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['bin'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create bin',
|
|
routing: {
|
|
request: {
|
|
method: 'POST',
|
|
url: '/developers/postbin/api/bin',
|
|
},
|
|
output: {
|
|
postReceive: [transformBinReponse],
|
|
},
|
|
},
|
|
action: 'Create a bin',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get a bin',
|
|
routing: {
|
|
request: {
|
|
method: 'GET',
|
|
},
|
|
output: {
|
|
postReceive: [transformBinReponse],
|
|
},
|
|
send: {
|
|
preSend: [
|
|
// Parse binId before sending to make sure it's in the right format
|
|
buildBinAPIURL,
|
|
],
|
|
},
|
|
},
|
|
action: 'Get a bin',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a bin',
|
|
routing: {
|
|
request: {
|
|
method: 'DELETE',
|
|
},
|
|
send: {
|
|
preSend: [
|
|
// Parse binId before sending to make sure it's in the right format
|
|
buildBinAPIURL,
|
|
],
|
|
},
|
|
},
|
|
action: 'Delete a bin',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
// Properties of the `Bin` resource
|
|
export const binFields: INodeProperties[] = [
|
|
{
|
|
displayName: 'Bin ID',
|
|
name: 'binId',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['bin'],
|
|
operation: ['get', 'delete'],
|
|
},
|
|
},
|
|
description: 'Unique identifier for each bin',
|
|
},
|
|
];
|