2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-08-04 06:48:05 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const buildOperations: INodeProperties[] = [
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-08-04 06:48:05 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Cancel',
|
|
|
|
value: 'cancel',
|
|
|
|
description: 'Cancel a build',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Cancel a build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a build',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2020-08-04 06:48:05 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Get many builds',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many builds',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Restart',
|
|
|
|
value: 'restart',
|
|
|
|
description: 'Restart a build',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Restart a build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Trigger',
|
|
|
|
value: 'trigger',
|
|
|
|
description: 'Trigger a build',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Trigger a build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'cancel',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-08-04 06:48:05 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const buildFields: INodeProperties[] = [
|
2020-08-04 06:53:34 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* build:cancel */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'Build ID',
|
|
|
|
name: 'buildId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['cancel'],
|
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value uniquely identifying the build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
2020-08-04 06:53:34 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* build:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'Build ID',
|
|
|
|
name: 'buildId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['get'],
|
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value uniquely identifying the build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['build'],
|
|
|
|
operation: ['get'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include',
|
|
|
|
name: 'include',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'build.commit',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'List of attributes to eager load',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-08-04 06:53:34 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* build:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['build'],
|
|
|
|
returnAll: [false],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 500,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['build'],
|
|
|
|
operation: ['getAll'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include',
|
|
|
|
name: 'include',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'build.commit',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'List of attributes to eager load',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Order',
|
|
|
|
name: 'order',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'ASC',
|
|
|
|
value: 'asc',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'DESC',
|
|
|
|
value: 'desc',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-08-04 06:48:05 -07:00
|
|
|
],
|
|
|
|
default: 'asc',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'You may specify order to sort your response',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Sort By',
|
|
|
|
name: 'sortBy',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Created At',
|
|
|
|
value: 'created_at',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Finished At',
|
|
|
|
value: 'finished_at',
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'ID',
|
|
|
|
value: 'id',
|
|
|
|
},
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
name: 'Number',
|
|
|
|
value: 'number',
|
|
|
|
},
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'Started At',
|
|
|
|
value: 'started_at',
|
|
|
|
},
|
2020-08-04 06:48:05 -07:00
|
|
|
],
|
|
|
|
default: 'number',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-08-04 06:53:34 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* build:restart */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'Build ID',
|
|
|
|
name: 'buildId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['restart'],
|
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value uniquely identifying the build',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
2020-08-04 06:53:34 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* build:trigger */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
displayName: 'Slug',
|
|
|
|
name: 'slug',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['trigger'],
|
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
2020-08-04 06:53:34 -07:00
|
|
|
placeholder: 'n8n-io/n8n',
|
2020-08-04 06:48:05 -07:00
|
|
|
default: '',
|
|
|
|
description: 'Same as {ownerName}/{repositoryName}',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Branch',
|
|
|
|
name: 'branch',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['trigger'],
|
|
|
|
resource: ['build'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
placeholder: 'master',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Branch requested to be built',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['build'],
|
|
|
|
operation: ['trigger'],
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Message',
|
|
|
|
name: 'message',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Travis-ci status message attached to the request',
|
2020-08-04 06:48:05 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Merge Mode',
|
|
|
|
name: 'mergeMode',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
2022-06-03 10:23:49 -07:00
|
|
|
{
|
|
|
|
name: 'Deep Merge',
|
|
|
|
value: 'deep_merge',
|
|
|
|
},
|
2020-08-04 06:48:05 -07:00
|
|
|
{
|
|
|
|
name: 'Deep Merge Append',
|
|
|
|
value: 'deep_merge_append',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Deep Merge Prepend',
|
|
|
|
value: 'deep_merge_prepend',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Merge',
|
|
|
|
value: 'merge',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Replace',
|
|
|
|
value: 'replace',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|