n8n/packages/nodes-base/nodes/Phantombuster/AgentDescription.ts

451 lines
9.4 KiB
TypeScript
Raw Normal View History

import {
INodeProperties,
} from 'n8n-workflow';
export const agentOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'agent',
],
},
},
options: [
{
name: 'Delete',
value: 'delete',
description: 'Delete an agent by id.',
},
{
name: 'Get',
value: 'get',
description: 'Get an agent by id.',
},
{
name: 'Get All',
value: 'getAll',
description: `Get all agents of the current user's organization.`,
},
{
name: 'Get Output',
value: 'getOutput',
description: 'Get the output of the most recent container of an agent.',
},
{
name: 'Launch',
value: 'launch',
description: 'Add an agent to the launch queue.',
},
],
default: 'launch',
description: 'The operation to perform.',
},
];
export const agentFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* agent:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Agent',
name: 'agentId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAgents',
},
required: true,
displayOptions: {
show: {
operation: [
'delete',
],
resource: [
'agent',
],
},
},
default: '',
},
/* -------------------------------------------------------------------------- */
/* agent:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Agent ID',
name: 'agentId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'agent',
],
},
},
default: '',
},
/* -------------------------------------------------------------------------- */
/* agent:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'agent',
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'agent',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 50,
},
default: 25,
description: 'How many results to return.',
},
/* -------------------------------------------------------------------------- */
/* agent:getOutput */
/* -------------------------------------------------------------------------- */
{
displayName: 'Agent',
name: 'agentId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAgents',
},
required: true,
displayOptions: {
show: {
operation: [
'getOutput',
],
resource: [
'agent',
],
},
},
default: '',
},
{
displayName: 'Resolve Data',
name: 'resolveData',
type: 'boolean',
default: true,
displayOptions: {
show: {
operation: [
'getOutput',
],
resource: [
'agent',
],
},
},
:zap: Remove unnessasry <br/> (#2340) * introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * update parameter inputs to be multiline * update spacing * Survey new options (#2300) * split up options * fix quotes * remove unused import * refactor node credentials * add user created workflow event (#2301) * update multi params * simplify env vars * fix versionCli on FE * update personalization env * clean up node detail settings * fix event User opened Credentials panel * fix font sizes across modals * clean up input spacing * fix select modal spacing * increase spacing * fix input copy * fix webhook, tab spacing, retry button * fix button sizes * fix button size * add mini xlarge sizes * fix webhook spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * fix input error highlighting * revert change * update toggle spacing * fix delete positioning * keep tooltip while focused * set strict size * increase left spacing * fix sort icons * remove unnessasry <br/> * remove unnessary break * remove unnessary margin * clean unused functionality * remove unnessary css * remove duplicate tracking * only show tooltip when hovering over label * remove extra space * add br * remove extra space * clean up commas * clean up commas * remove extra space * remove extra space * rewrite desc * add commas * add space * remove extra space * add space * add dot * update credentials section * use includes Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-10-27 13:00:13 -07:00
description: 'By default the outpout is presented as string. If this option gets activated, it will resolve the data automatically.',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: [
'agent',
],
operation: [
'getOutput',
],
},
},
default: {},
options: [
{
displayName: 'Prev Container ID',
name: 'prevContainerId',
type: 'string',
default: '',
description: `If set, the output will be retrieved from the container after the specified previous container id.`,
},
{
displayName: 'Prev Status',
name: 'prevStatus',
type: 'options',
options: [
{
name: 'Starting',
value: 'starting',
},
{
name: 'Running',
value: 'running',
},
{
name: 'Finished',
value: 'finished',
},
{
name: 'Unknown',
value: 'unknown',
},
{
name: 'Launch Error',
value: 'lauch error',
},
{
name: 'Never Launched',
value: 'never launched',
},
],
default: '',
description: 'If set, allows to define which status was previously retrieved on user-side.',
},
{
displayName: 'Pre Runtime Event Index',
name: 'prevRuntimeEventIndex',
type: 'number',
default: 0,
description: `If set, the container's runtime events will be returned in the response starting from the provided previous runtime event index.`,
},
],
},
/* -------------------------------------------------------------------------- */
/* agent:launch */
/* -------------------------------------------------------------------------- */
{
displayName: 'Agent',
name: 'agentId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAgents',
},
required: true,
displayOptions: {
show: {
operation: [
'launch',
],
resource: [
'agent',
],
},
},
default: '',
},
{
displayName: 'Resolve Data',
name: 'resolveData',
type: 'boolean',
default: true,
displayOptions: {
show: {
operation: [
'launch',
],
resource: [
'agent',
],
},
},
:zap: Remove unnessasry <br/> (#2340) * introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * update parameter inputs to be multiline * update spacing * Survey new options (#2300) * split up options * fix quotes * remove unused import * refactor node credentials * add user created workflow event (#2301) * update multi params * simplify env vars * fix versionCli on FE * update personalization env * clean up node detail settings * fix event User opened Credentials panel * fix font sizes across modals * clean up input spacing * fix select modal spacing * increase spacing * fix input copy * fix webhook, tab spacing, retry button * fix button sizes * fix button size * add mini xlarge sizes * fix webhook spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * fix input error highlighting * revert change * update toggle spacing * fix delete positioning * keep tooltip while focused * set strict size * increase left spacing * fix sort icons * remove unnessasry <br/> * remove unnessary break * remove unnessary margin * clean unused functionality * remove unnessary css * remove duplicate tracking * only show tooltip when hovering over label * remove extra space * add br * remove extra space * clean up commas * clean up commas * remove extra space * remove extra space * rewrite desc * add commas * add space * remove extra space * add space * add dot * update credentials section * use includes Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-10-27 13:00:13 -07:00
description: 'By default the launch just include the container ID. If this option gets activated, it will resolve the data automatically.',
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
displayOptions: {
show: {
operation: [
'launch',
],
resource: [
'agent',
],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: [
'agent',
],
operation: [
'launch',
],
},
},
default: {},
options: [
{
displayName: 'Arguments (JSON)',
name: 'argumentsJson',
type: 'json',
displayOptions: {
show: {
'/jsonParameters': [
true,
],
},
},
default: '',
description: 'Agent argument. Can either be a JSON string or a plain object. The argument can be retrieved with buster.argument in the agents script.',
},
{
displayName: 'Arguments',
name: 'argumentsUi',
placeholder: 'Add Argument',
type: 'fixedCollection',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
default: {},
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
options: [
{
name: 'argumentValues',
displayName: 'Argument',
values: [
{
displayName: 'Key',
name: 'key',
type: 'string',
default: '',
description: 'Name of the argument key to add.',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
description: 'Value to set for the argument key.',
},
],
},
],
},
{
displayName: 'Bonus Argument',
name: 'bonusArgumentUi',
placeholder: 'Add Bonus Argument',
type: 'fixedCollection',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
default: {},
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
'/jsonParameters': [
false,
],
},
},
options: [
{
name: 'bonusArgumentValue',
displayName: 'Bonus Argument',
values: [
{
displayName: 'Key',
name: 'key',
type: 'string',
default: '',
description: 'Name of the argument key to add.',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
description: 'Value to set for the argument key.',
},
],
},
],
},
{
displayName: 'Bonus Argument (JSON)',
name: 'bonusArgumentJson',
type: 'string',
displayOptions: {
show: {
'/jsonParameters': [
true,
],
},
},
default: '',
description: `Agent bonus argument. Can either be a JSON string or a plain object. This bonus argument is single-use, it will only be used for the current launch. If present, it will be merged with the original argument, resulting in an effective argument that can be retrieved with buster.argument in the agents script.`,
},
{
displayName: 'Manual Launch',
name: 'manualLaunch',
type: 'boolean',
default: false,
description: 'If set, the agent will be considered as "launched manually".',
},
{
displayName: 'Max Instance Count',
name: 'maxInstanceCount',
type: 'number',
default: 0,
description: 'If set, the agent will only be launched if the number of already running instances is below the specified number.',
},
{
displayName: 'Save Argument',
name: 'saveArgument',
type: 'string',
default: '',
description: 'If true, argument will be saved as the default launch options for the agent.',
},
],
},
];