2021-12-03 00:44:16 -08:00
import {
2021-09-18 13:12:20 -07:00
INodeProperties ,
} from 'n8n-workflow' ;
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 : {
resource : [
'deploy' ,
] ,
} ,
} ,
options : [
{
name : 'Cancel' ,
value : 'cancel' ,
description : 'Cancel a deployment' ,
} ,
{
name : 'Create' ,
value : 'create' ,
description : 'Create a new deployment' ,
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a deployment' ,
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all deployments' ,
} ,
] ,
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-06-03 10:23:49 -07:00
description : 'Enter the Site ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-09-18 13:12:20 -07:00
displayOptions : {
show : {
resource : [
'deploy' ,
] ,
operation : [
'get' ,
'create' ,
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Deploy ID' ,
name : 'deployId' ,
required : true ,
type : 'string' ,
2021-12-03 00:44:16 -08:00
default : '' ,
2021-09-18 13:12:20 -07:00
displayOptions : {
show : {
resource : [
'deploy' ,
] ,
operation : [
'get' ,
'cancel' ,
] ,
} ,
} ,
} ,
// ----- Get All Deploys ------ //
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
operation : [
'getAll' ,
] ,
resource : [
'deploy' ,
] ,
} ,
} ,
default : false ,
description : 'Whether to return all results or only up to a given limit' ,
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
operation : [
'getAll' ,
] ,
resource : [
'deploy' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
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 : {
resource : [
'deploy' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
options : [
{
displayName : 'Branch' ,
name : 'branch' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;