2021-09-05 10:24:56 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const releaseOperations : INodeProperties [ ] = [
2021-09-05 10:24:56 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-09-05 10:24:56 -07:00
displayOptions : {
show : {
resource : [
'release' ,
] ,
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a release' ,
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a release' ,
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Retrieve a release' ,
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Retrieve all releases' ,
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a release' ,
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-09-05 10:24:56 -07:00
2021-12-03 00:44:16 -08:00
export const releaseFields : INodeProperties [ ] = [
2021-09-05 10:24:56 -07:00
// ----------------------------------------
// release: create
// ----------------------------------------
{
displayName : 'Subject' ,
name : 'subject' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Release Type' ,
name : 'releaseType' ,
type : 'options' ,
default : 1 ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
options : [
{
name : 'Minor' ,
value : 1 ,
} ,
{
name : 'Standard' ,
value : 2 ,
} ,
{
name : 'Major' ,
value : 3 ,
} ,
{
name : 'Emergency' ,
value : 4 ,
} ,
] ,
} ,
{
displayName : 'Priority' ,
name : 'priority' ,
type : 'options' ,
default : 1 ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
options : [
{
name : 'Low' ,
value : 1 ,
} ,
{
name : 'Medium' ,
value : 2 ,
} ,
{
name : 'High' ,
value : 3 ,
} ,
{
name : 'Urgent' ,
value : 4 ,
} ,
] ,
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
default : 1 ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
2021-09-05 10:24:56 -07:00
options : [
{
name : 'Open' ,
value : 1 ,
} ,
{
name : 'On Hold' ,
value : 2 ,
} ,
{
name : 'In Progress' ,
value : 3 ,
} ,
{
name : 'Incomplete' ,
value : 4 ,
} ,
{
name : 'Completed' ,
value : 5 ,
} ,
] ,
} ,
{
displayName : 'Planned Start Date' ,
name : 'plannedStartDate' ,
type : 'dateTime' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Planned End Date' ,
name : 'plannedEndDate' ,
type : 'dateTime' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Department Name or ID' ,
2021-09-05 10:24:56 -07:00
name : 'department_id' ,
type : 'options' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'ID of the department initiating the release. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-09-05 10:24:56 -07:00
typeOptions : {
2021-12-03 00:44:16 -08:00
loadOptionsMethod : 'getDepartments' ,
2021-09-05 10:24:56 -07:00
} ,
} ,
{
displayName : 'Description' ,
name : 'description' ,
description : 'HTML supported' ,
type : 'string' ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Group Name or ID' ,
2021-09-05 10:24:56 -07:00
name : 'group_id' ,
type : 'options' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'ID of the agent group to which the release is assigned. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-09-05 10:24:56 -07:00
typeOptions : {
2021-12-03 00:44:16 -08:00
loadOptionsMethod : 'getAgentGroups' ,
2021-09-05 10:24:56 -07:00
} ,
} ,
] ,
} ,
// ----------------------------------------
// release: delete
// ----------------------------------------
{
displayName : 'Release ID' ,
name : 'releaseId' ,
description : 'ID of the release to delete' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
} ,
// ----------------------------------------
// release: get
// ----------------------------------------
{
displayName : 'Release ID' ,
name : 'releaseId' ,
description : 'ID of the release to retrieve' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
} ,
// ----------------------------------------
// release: getAll
// ----------------------------------------
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
default : false ,
description : 'Whether to return all results or only up to a given limit' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2021-09-05 10:24:56 -07:00
typeOptions : {
minValue : 1 ,
} ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'getAll' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
} ,
// ----------------------------------------
// release: update
// ----------------------------------------
{
displayName : 'Release ID' ,
name : 'releaseId' ,
description : 'ID of the release to update' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'release' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Department Name or ID' ,
2021-09-05 10:24:56 -07:00
name : 'department_id' ,
type : 'options' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'ID of the department initiating the release. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-09-05 10:24:56 -07:00
typeOptions : {
2021-12-03 00:44:16 -08:00
loadOptionsMethod : 'getDepartments' ,
2021-09-05 10:24:56 -07:00
} ,
} ,
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
description : 'HTML supported' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Group Name or ID' ,
2021-09-05 10:24:56 -07:00
name : 'group_id' ,
type : 'options' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'ID of the agent group to which the release is assigned. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2021-09-05 10:24:56 -07:00
typeOptions : {
2021-12-03 00:44:16 -08:00
loadOptionsMethod : 'getAgentGroups' ,
2021-09-05 10:24:56 -07:00
} ,
} ,
{
displayName : 'Priority' ,
name : 'priority' ,
type : 'options' ,
default : 1 ,
options : [
{
name : 'Low' ,
value : 1 ,
} ,
{
name : 'Medium' ,
value : 2 ,
} ,
{
name : 'High' ,
value : 3 ,
} ,
{
name : 'Urgent' ,
value : 4 ,
} ,
] ,
} ,
{
displayName : 'Release Type' ,
name : 'release_type' ,
type : 'options' ,
default : 1 ,
options : [
{
name : 'Minor' ,
value : 1 ,
} ,
{
name : 'Standard' ,
value : 2 ,
} ,
{
name : 'Major' ,
value : 3 ,
} ,
{
name : 'Emergency' ,
value : 4 ,
} ,
] ,
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
default : 1 ,
2022-06-03 10:23:49 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
2021-09-05 10:24:56 -07:00
options : [
{
name : 'Open' ,
value : 1 ,
} ,
{
name : 'On Hold' ,
value : 2 ,
} ,
{
name : 'In Progress' ,
value : 3 ,
} ,
{
name : 'Incomplete' ,
value : 4 ,
} ,
{
name : 'Completed' ,
value : 5 ,
} ,
] ,
} ,
{
displayName : 'Subject' ,
name : 'subject' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;