mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 01:24:05 -08:00
6f95121fac
* 👕 Add `action` to `INodePropertyOptions` * 👕 Apply `node-param-operation-option-without-action` * ✏️ Fix add/remove phrasing * ✏️ Fix email template phrasing * ✏️ Fix add/remove phrasing * ✏️ Fix custom fields phrasing * ✏️ Fix job report phrasing * ✏️ Fix query phrasing * ✏️ Various phrasing fixes * ✏️ Fix final phrasings * ✏️ Remove `conversation` * ✏️ Fix plural
109 lines
1.8 KiB
TypeScript
109 lines
1.8 KiB
TypeScript
import {
|
|
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[] = [
|
|
{
|
|
name: 'binId',
|
|
displayName: 'Bin ID',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'bin',
|
|
],
|
|
operation: [
|
|
'get',
|
|
'delete',
|
|
],
|
|
},
|
|
},
|
|
description: 'Unique identifier for each bin',
|
|
},
|
|
];
|