2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-09-18 13:12:20 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const deployOperations: INodeProperties[] = [
|
2021-09-18 13:12:20 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-09-18 13:12:20 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['deploy'],
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Cancel',
|
|
|
|
value: 'cancel',
|
|
|
|
description: 'Cancel a deployment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Cancel a deployment',
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a new deployment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a deployment',
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a deployment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a deployment',
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-09-18 13:12:20 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Get many deployments',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many deployments',
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-09-18 13:12:20 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const deployFields: INodeProperties[] = [
|
2021-09-18 13:12:20 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Site Name or ID',
|
2021-09-18 13:12:20 -07:00
|
|
|
name: 'siteId',
|
|
|
|
required: true,
|
|
|
|
type: 'options',
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2021-09-18 13:12:20 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSites',
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Enter the Site ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
|
|
displayOptions: {
|
2021-09-18 13:12:20 -07:00
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['deploy'],
|
|
|
|
operation: ['get', 'create', 'getAll'],
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Deploy ID',
|
|
|
|
name: 'deployId',
|
|
|
|
required: true,
|
|
|
|
type: 'string',
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
displayOptions: {
|
2021-09-18 13:12:20 -07:00
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['deploy'],
|
|
|
|
operation: ['get', 'cancel'],
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
// ----- Get All Deploys ------ //
|
2021-09-18 13:12:20 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['deploy'],
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['deploy'],
|
|
|
|
returnAll: [false],
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 200,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
// ---- Create Site Deploy ---- //
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Fields',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['deploy'],
|
|
|
|
operation: ['create'],
|
2021-09-18 13:12:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Branch',
|
|
|
|
name: 'branch',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Title',
|
|
|
|
name: 'title',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|