2023-01-27 03:22:44 -08:00
|
|
|
|
import type { IExecuteFunctions } from 'n8n-core';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2023-01-27 03:22:44 -08:00
|
|
|
|
import type {
|
2019-10-16 17:53:15 -07:00
|
|
|
|
IDataObject,
|
|
|
|
|
INodeExecutionData,
|
|
|
|
|
INodeType,
|
2020-10-01 05:01:39 -07:00
|
|
|
|
INodeTypeDescription,
|
2019-10-16 17:53:15 -07:00
|
|
|
|
} from 'n8n-workflow';
|
2023-01-27 03:22:44 -08:00
|
|
|
|
import { NodeOperationError } from 'n8n-workflow';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
|
import { gitlabApiRequest, gitlabApiRequestAllItems } from './GenericFunctions';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
|
|
|
|
export class Gitlab implements INodeType {
|
|
|
|
|
description: INodeTypeDescription = {
|
2020-07-24 03:56:41 -07:00
|
|
|
|
displayName: 'GitLab',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
name: 'gitlab',
|
2021-03-25 09:10:02 -07:00
|
|
|
|
icon: 'file:gitlab.svg',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
group: ['input'],
|
|
|
|
|
version: 1,
|
2019-10-24 23:15:36 -07:00
|
|
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
2021-07-03 05:40:16 -07:00
|
|
|
|
description: 'Retrieve data from GitLab API',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
defaults: {
|
feat(editor): Node creator actions (#4696)
* WIP: Node Actions List UI
* WIP: Recommended Actions and preseting of fields
* WIP: Resource category
* :art: Moved actions categorisation to the server
* :label: Add missing INodeAction type
* :sparkles: Improve SSR categorisation, fix adding of mixed actions
* :recycle: Refactor CategorizedItems to composition api, style fixes
* WIP: Adding multiple nodes
* :recycle: Refactor rest of the NodeCreator component to composition API, conver globalLinkActions to composable
* :sparkles: Allow actions dragging, fix search and refactor passing of actions to categorized items
* :lipstick: Fix node actions title
* Migrate to the pinia store, add posthog feature and various fixes
* :bug: Fix filtering of trigger actions when not merged
* fix: N8N-5439 — Do not use simple node item when at NodeHelperPanel root
* :bug: Design review fixes
* :bug: Fix disabling of merged actions
* Fix trigger root filtering
* :sparkles: Allow for custom node actions parser, introduce hubspot parser
* :bug: Fix initial node params validation, fix position of second added node
* :bug: Introduce operations category, removed canvas node names overrride, fix API actions display and prevent dragging of action nodes
* :sparkles: Prevent NDV auto-open feature flag
* :bug: Inject recommened action for trigger nodes without actions
* Refactored NodeCreatorNode to Storybook, change filtering of merged nodes for the trigger helper panel, minor fixes
* Improve rendering of app nodes and animation
* Cleanup, any only enable accordion transition on triggerhelperpanel
* Hide node creator scrollbars in Firefox
* Minor styles fixes
* Do not copy the array in rendering method
* Removed unused props
* Fix memory leak
* Fix categorisation of regular nodes with a single resource
* Implement telemetry calls for node actions
* Move categorization to FE
* Fix client side actions categorisation
* Skip custom action show
* Only load tooltip for NodeIcon if necessary
* Fix lodash startCase import
* Remove lodash.startcase
* Cleanup
* Fix node creator autofocus on "tab"
* Prevent posthog getFeatureFlag from crashing
* Debugging preview env search issues
* Remove logs
* Make sure the pre-filled params are update not overwritten
* Get rid of transition in itemiterator
* WIP: Rough version of NodeActions keyboard navigation, replace nodeCreator composable with Pinia store module
* Rewrite to add support for ActionItem to ItemIterator and make CategorizedItems accept items props
* Fix category item counter & cleanup
* Add APIHint to actions search no-result, clean up NodeCreatorNode
* Improve node actions no results message
* Remove logging, fix filtering of recommended placeholder category
* Remove unused NodeActions component and node merging feature falg
* Do not show regular nodes without actions
* Make sure to add manual trigger when adding http node via actions hint
* Fixed api hint footer line height
* Prevent pointer-events od NodeIcon img and remove "this" from template
* Address PR points
* Fix e2e specs
* Make sure canvas ia loaded
* Make sure canvas ia loaded before opening nodeCreator in e2e spec
* Fix flaky workflows tags e2e getter
* Imrpove node creator click outside UX, add manual node to regular nodes added from trigger panel
* Add manual trigger node if dragging regular from trigger panel
2022-12-09 01:56:36 -08:00
|
|
|
|
name: 'GitLab',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
inputs: ['main'],
|
|
|
|
|
outputs: ['main'],
|
|
|
|
|
credentials: [
|
|
|
|
|
{
|
|
|
|
|
name: 'gitlabApi',
|
|
|
|
|
required: true,
|
2020-06-16 06:50:17 -07:00
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
authentication: ['accessToken'],
|
2020-06-16 06:50:17 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'gitlabOAuth2Api',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
authentication: ['oAuth2'],
|
2020-06-16 06:50:17 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
],
|
|
|
|
|
properties: [
|
2020-06-16 06:50:17 -07:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Authentication',
|
|
|
|
|
name: 'authentication',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Access Token',
|
|
|
|
|
value: 'accessToken',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'OAuth2',
|
|
|
|
|
value: 'oAuth2',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'accessToken',
|
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Resource',
|
|
|
|
|
name: 'resource',
|
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
|
noDataExpression: true,
|
2019-10-16 17:53:15 -07:00
|
|
|
|
options: [
|
|
|
|
|
{
|
2023-01-27 05:58:32 -08:00
|
|
|
|
name: 'File',
|
|
|
|
|
value: 'file',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-01-27 05:58:32 -08:00
|
|
|
|
name: 'Issue',
|
|
|
|
|
value: 'issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Release',
|
|
|
|
|
value: 'release',
|
|
|
|
|
},
|
2023-01-27 05:58:32 -08:00
|
|
|
|
{
|
|
|
|
|
name: 'Repository',
|
|
|
|
|
value: 'repository',
|
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
{
|
|
|
|
|
name: 'User',
|
|
|
|
|
value: 'user',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'issue',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// operations
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
|
noDataExpression: true,
|
2019-10-16 17:53:15 -07:00
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Create',
|
|
|
|
|
value: 'create',
|
|
|
|
|
description: 'Create a new issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Create an issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Create Comment',
|
|
|
|
|
value: 'createComment',
|
|
|
|
|
description: 'Create a new comment on an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Create a comment on an issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Edit',
|
|
|
|
|
value: 'edit',
|
|
|
|
|
description: 'Edit an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Edit an issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Get',
|
|
|
|
|
value: 'get',
|
2020-07-24 03:56:41 -07:00
|
|
|
|
description: 'Get the data of a single issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Get an issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Lock',
|
|
|
|
|
value: 'lock',
|
|
|
|
|
description: 'Lock an issue',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Lock an issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'create',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
|
noDataExpression: true,
|
2019-10-16 17:53:15 -07:00
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
resource: ['repository'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Get',
|
|
|
|
|
value: 'get',
|
|
|
|
|
description: 'Get the data of a single repository',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Get a repository',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Get Issues',
|
|
|
|
|
value: 'getIssues',
|
|
|
|
|
description: 'Returns issues of a repository',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Get issues of a repository',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'getIssues',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
|
noDataExpression: true,
|
2019-10-16 17:53:15 -07:00
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
resource: ['user'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Get Repositories',
|
|
|
|
|
value: 'getRepositories',
|
|
|
|
|
description: 'Returns the repositories of a user',
|
2022-08-17 08:50:24 -07:00
|
|
|
|
action: "Get a user's repositories",
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'getRepositories',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
|
noDataExpression: true,
|
2019-10-16 17:53:15 -07:00
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
resource: ['release'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Create',
|
|
|
|
|
value: 'create',
|
2020-07-24 03:56:41 -07:00
|
|
|
|
description: 'Create a new release',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Create a release',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
2021-04-15 15:27:12 -07:00
|
|
|
|
{
|
|
|
|
|
name: 'Delete',
|
|
|
|
|
value: 'delete',
|
2023-01-27 05:58:32 -08:00
|
|
|
|
description: 'Delete a release',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Delete a release',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Get',
|
|
|
|
|
value: 'get',
|
2023-01-27 05:58:32 -08:00
|
|
|
|
description: 'Get a release',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Get a release',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
|
name: 'Get Many',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
|
description: 'Get many releases',
|
2022-09-08 08:10:13 -07:00
|
|
|
|
action: 'Get many releases',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Update',
|
|
|
|
|
value: 'update',
|
2023-01-27 05:58:32 -08:00
|
|
|
|
description: 'Update a release',
|
2022-07-10 13:50:51 -07:00
|
|
|
|
action: 'Update a release',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
],
|
|
|
|
|
default: 'create',
|
|
|
|
|
},
|
|
|
|
|
|
2023-01-27 05:58:32 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
|
|
|
|
noDataExpression: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Create',
|
|
|
|
|
value: 'create',
|
|
|
|
|
description: 'Create a new file in repository',
|
|
|
|
|
action: 'Create a file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Delete',
|
|
|
|
|
value: 'delete',
|
|
|
|
|
description: 'Delete a file in repository',
|
|
|
|
|
action: 'Delete a file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Edit',
|
|
|
|
|
value: 'edit',
|
|
|
|
|
description: 'Edit a file in repository',
|
|
|
|
|
action: 'Edit a file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Get',
|
|
|
|
|
value: 'get',
|
|
|
|
|
description: 'Get the data of a single file',
|
|
|
|
|
action: 'Get a file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'List',
|
|
|
|
|
value: 'list',
|
|
|
|
|
description: 'List contents of a folder',
|
|
|
|
|
action: 'List files',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'create',
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-16 17:53:15 -07:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// shared
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Project Owner',
|
|
|
|
|
name: 'owner',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
placeholder: 'n8n-io',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'User, group or namespace of the project',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Project Name',
|
|
|
|
|
name: 'repository',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
hide: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
resource: ['user'],
|
|
|
|
|
operation: ['getRepositories'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
placeholder: 'n8n',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The name of the project',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// issue
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// issue:create
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Title',
|
|
|
|
|
name: 'title',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The title of the issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Body',
|
2019-11-10 01:17:56 -08:00
|
|
|
|
name: 'body',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
type: 'string',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
rows: 5,
|
|
|
|
|
},
|
|
|
|
|
default: '',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The body of the issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
2019-11-10 01:17:56 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Due Date',
|
|
|
|
|
name: 'due_date',
|
|
|
|
|
type: 'dateTime',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['issue'],
|
2019-11-10 01:17:56 -08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Due Date for issue',
|
2019-11-10 01:17:56 -08:00
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Labels',
|
|
|
|
|
name: 'labels',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValues: true,
|
|
|
|
|
multipleValueButtonText: 'Add Label',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
|
default: { label: '' },
|
2019-10-16 17:53:15 -07:00
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Label',
|
|
|
|
|
name: 'label',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Label to add to issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Assignees',
|
|
|
|
|
name: 'assignee_ids',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValues: true,
|
|
|
|
|
multipleValueButtonText: 'Add Assignee',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
|
default: { assignee: '' },
|
2019-10-16 17:53:15 -07:00
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Assignee',
|
|
|
|
|
name: 'assignee',
|
|
|
|
|
type: 'number',
|
|
|
|
|
default: 0,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'User ID to assign issue to',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-11-10 01:17:56 -08:00
|
|
|
|
|
2019-10-16 17:53:15 -07:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// issue:createComment
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Issue Number',
|
|
|
|
|
name: 'issueNumber',
|
|
|
|
|
type: 'number',
|
|
|
|
|
default: 0,
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['createComment'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The number of the issue on which to create the comment on',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Body',
|
|
|
|
|
name: 'body',
|
|
|
|
|
type: 'string',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
rows: 5,
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['createComment'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The body of the comment',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// issue:edit
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Issue Number',
|
|
|
|
|
name: 'issueNumber',
|
|
|
|
|
type: 'number',
|
|
|
|
|
default: 0,
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['edit'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The number of the issue edit',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Edit Fields',
|
|
|
|
|
name: 'editFields',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValueButtonText: 'Add Field',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['edit'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Title',
|
|
|
|
|
name: 'title',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The title of the issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Body',
|
2019-11-08 06:13:48 -08:00
|
|
|
|
name: 'description',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
type: 'string',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
rows: 5,
|
|
|
|
|
},
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The body of the issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'State',
|
|
|
|
|
name: 'state',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Closed',
|
|
|
|
|
value: 'closed',
|
|
|
|
|
description: 'Set the state to "closed"',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Open',
|
|
|
|
|
value: 'open',
|
|
|
|
|
description: 'Set the state to "open"',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'open',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The state to set',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Labels',
|
|
|
|
|
name: 'labels',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValues: true,
|
|
|
|
|
multipleValueButtonText: 'Add Label',
|
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
|
default: { label: '' },
|
2019-10-16 17:53:15 -07:00
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Label',
|
|
|
|
|
name: 'label',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Label to add to issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Assignees',
|
|
|
|
|
name: 'assignee_ids',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValues: true,
|
|
|
|
|
multipleValueButtonText: 'Add Assignee',
|
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
|
default: { assignee: '' },
|
2019-10-16 17:53:15 -07:00
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Assignees',
|
|
|
|
|
name: 'assignee',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'User to assign issue too',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-11-08 03:41:47 -08:00
|
|
|
|
{
|
|
|
|
|
displayName: 'Due Date',
|
|
|
|
|
name: 'due_date',
|
2019-11-10 01:17:56 -08:00
|
|
|
|
type: 'dateTime',
|
2019-11-08 03:41:47 -08:00
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Due Date for issue',
|
2019-11-08 03:41:47 -08:00
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// issue:get
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Issue Number',
|
|
|
|
|
name: 'issueNumber',
|
|
|
|
|
type: 'number',
|
|
|
|
|
default: 0,
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['get'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The number of the issue get data of',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// issue:lock
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Issue Number',
|
|
|
|
|
name: 'issueNumber',
|
|
|
|
|
type: 'number',
|
|
|
|
|
default: 0,
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['lock'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The number of the issue to lock',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Lock Reason',
|
|
|
|
|
name: 'lockReason',
|
|
|
|
|
type: 'options',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['lock'],
|
|
|
|
|
resource: ['issue'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Off-Topic',
|
|
|
|
|
value: 'off-topic',
|
|
|
|
|
description: 'The issue is Off-Topic',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Too Heated',
|
|
|
|
|
value: 'too heated',
|
|
|
|
|
description: 'The discussion is too heated',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Resolved',
|
|
|
|
|
value: 'resolved',
|
|
|
|
|
description: 'The issue got resolved',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Spam',
|
|
|
|
|
value: 'spam',
|
|
|
|
|
description: 'The issue is spam',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'resolved',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The reason to lock the issue',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// release
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// release:create
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Tag',
|
|
|
|
|
name: 'releaseTag',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['release'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The tag of the release',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
|
name: 'additionalFields',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValueButtonText: 'Add Field',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['create'],
|
|
|
|
|
resource: ['release'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Name',
|
|
|
|
|
name: 'name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The name of the release',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Description',
|
|
|
|
|
name: 'description',
|
|
|
|
|
type: 'string',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
rows: 5,
|
|
|
|
|
},
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The description of the release',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Ref',
|
|
|
|
|
name: 'ref',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
|
description:
|
|
|
|
|
'If Tag doesn’t exist, the release will be created from Ref. It can be a commit SHA, another tag name, or a branch name.',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
2021-04-15 15:27:12 -07:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// release:get/delete
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Project ID',
|
|
|
|
|
name: 'projectId',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['delete', 'get'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID or URL-encoded path of the project',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Tag Name',
|
|
|
|
|
name: 'tag_name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['delete', 'get'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The Git tag the release is associated with',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-04-15 15:27:12 -07:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// release:getAll
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Project ID',
|
|
|
|
|
name: 'projectId',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['getAll'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID or URL-encoded path of the project',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Return All',
|
|
|
|
|
name: 'returnAll',
|
|
|
|
|
type: 'boolean',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2023-01-27 05:58:32 -08:00
|
|
|
|
resource: ['release', 'file'],
|
|
|
|
|
operation: ['getAll', 'list'],
|
2021-04-15 15:27:12 -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',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Limit',
|
|
|
|
|
name: 'limit',
|
|
|
|
|
type: 'number',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2023-01-27 05:58:32 -08:00
|
|
|
|
resource: ['release', 'file'],
|
|
|
|
|
operation: ['getAll', 'list'],
|
2022-08-17 08:50:24 -07:00
|
|
|
|
returnAll: [false],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
typeOptions: {
|
|
|
|
|
minValue: 1,
|
|
|
|
|
maxValue: 100,
|
|
|
|
|
},
|
|
|
|
|
default: 20,
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Max number of results to return',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
|
name: 'additionalFields',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValueButtonText: 'Add Field',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['getAll'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
|
displayName: 'Order By',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
name: 'order_by',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Created At',
|
|
|
|
|
value: 'created_at',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Released At',
|
|
|
|
|
value: 'released_at',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'released_at',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The field to use as order',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Sort',
|
|
|
|
|
name: 'sort',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'ASC',
|
|
|
|
|
value: 'asc',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'DESC',
|
|
|
|
|
value: 'desc',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'desc',
|
|
|
|
|
description: 'The direction of the order. .',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-04-15 15:27:12 -07:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// release:update
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Project ID',
|
|
|
|
|
name: 'projectId',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['update'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The ID or URL-encoded path of the project',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Tag Name',
|
|
|
|
|
name: 'tag_name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['update'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The Git tag the release is associated with',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
|
name: 'additionalFields',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValueButtonText: 'Add Field',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['update'],
|
|
|
|
|
resource: ['release'],
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Name',
|
|
|
|
|
name: 'name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The release name',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Description',
|
|
|
|
|
name: 'description',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
description: 'The description of the release. You can use Markdown.',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Milestones',
|
|
|
|
|
name: 'milestones',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
|
description:
|
|
|
|
|
'The title of each milestone to associate with the release (provide a titles list spearated with comma)',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Released At',
|
|
|
|
|
name: 'released_at',
|
|
|
|
|
type: 'dateTime',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The date when the release is/was ready',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// repository
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// repository:getIssues
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Filters',
|
|
|
|
|
name: 'getRepositoryIssuesFilters',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
typeOptions: {
|
|
|
|
|
multipleValueButtonText: 'Add Filter',
|
|
|
|
|
},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
operation: ['getIssues'],
|
|
|
|
|
resource: ['repository'],
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
default: {},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Assignee',
|
|
|
|
|
name: 'assignee_username',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Return only issues which are assigned to a specific user',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Creator',
|
|
|
|
|
name: 'author_username',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Return only issues which were created by a specific user',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Labels',
|
|
|
|
|
name: 'labels',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
|
description:
|
|
|
|
|
'Return only issues with the given labels. Multiple lables can be separated by comma.',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Updated After',
|
|
|
|
|
name: 'updated_after',
|
|
|
|
|
type: 'dateTime',
|
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Return only issues updated at or after this time',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'State',
|
|
|
|
|
name: 'state',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'All',
|
|
|
|
|
value: '',
|
|
|
|
|
description: 'Returns issues with any state',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Closed',
|
|
|
|
|
value: 'closed',
|
|
|
|
|
description: 'Return issues with "closed" state',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Open',
|
|
|
|
|
value: 'opened',
|
|
|
|
|
description: 'Return issues with "open" state',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'opened',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The state to filter by',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Sort',
|
|
|
|
|
name: 'order_by',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Created At',
|
|
|
|
|
value: 'created_at',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Sort by created date',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Updated At',
|
|
|
|
|
value: 'updated_at',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Sort by updated date',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Priority',
|
|
|
|
|
value: 'priority',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'Sort by priority',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
2019-10-24 23:15:36 -07:00
|
|
|
|
default: 'created_at',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The order the issues should be returned in',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Direction',
|
|
|
|
|
name: 'sort',
|
|
|
|
|
type: 'options',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Ascending',
|
|
|
|
|
value: 'asc',
|
|
|
|
|
description: 'Sort in ascending order',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Descending',
|
|
|
|
|
value: 'desc',
|
|
|
|
|
description: 'Sort in descending order',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'desc',
|
2022-05-06 14:01:25 -07:00
|
|
|
|
description: 'The sort order',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2023-01-27 05:58:32 -08:00
|
|
|
|
// ----------------------------------
|
|
|
|
|
// file
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// file:create/delete/edit/get
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'File Path',
|
|
|
|
|
name: 'filePath',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
hide: {
|
|
|
|
|
operation: ['list'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
placeholder: 'docs/README.md',
|
|
|
|
|
description:
|
|
|
|
|
'The file path of the file. Has to contain the full path or leave it empty for root folder.',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// file:list
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Path',
|
|
|
|
|
name: 'filePath',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
operation: ['list'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
placeholder: 'docs/',
|
|
|
|
|
description: 'The path of the folder to list',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Page',
|
|
|
|
|
name: 'page',
|
|
|
|
|
type: 'number',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
operation: ['list'],
|
|
|
|
|
returnAll: [false],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
typeOptions: {
|
|
|
|
|
minValue: 1,
|
|
|
|
|
maxValue: 1000,
|
|
|
|
|
},
|
|
|
|
|
default: 1,
|
|
|
|
|
description: 'Page of results to display',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// file:get
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'As Binary Property',
|
|
|
|
|
name: 'asBinaryProperty',
|
|
|
|
|
type: 'boolean',
|
|
|
|
|
default: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['get'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
description:
|
|
|
|
|
'Whether to set the data of the file as binary property instead of returning the raw API response',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: 'data',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
asBinaryProperty: [true],
|
|
|
|
|
operation: ['get'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
placeholder: '',
|
|
|
|
|
description:
|
|
|
|
|
'Name of the binary property in which to save the binary data of the received file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Additional Parameters',
|
|
|
|
|
name: 'additionalParameters',
|
|
|
|
|
placeholder: 'Add Parameter',
|
|
|
|
|
description: 'Additional fields to add',
|
|
|
|
|
type: 'collection',
|
|
|
|
|
default: {},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['get'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Reference',
|
|
|
|
|
name: 'reference',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
placeholder: 'master',
|
|
|
|
|
description:
|
|
|
|
|
'The name of the commit/branch/tag. Default: the repository’s default branch (usually master).',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// file:create/edit
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Binary Data',
|
|
|
|
|
name: 'binaryData',
|
|
|
|
|
type: 'boolean',
|
|
|
|
|
default: false,
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['create', 'edit'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
description: 'Whether the data to upload should be taken from binary field',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'File Content',
|
|
|
|
|
name: 'fileContent',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
binaryData: [false],
|
|
|
|
|
operation: ['create', 'edit'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
placeholder: '',
|
|
|
|
|
description: 'The text content of the file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: 'data',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
binaryData: [true],
|
|
|
|
|
operation: ['create', 'edit'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
placeholder: '',
|
|
|
|
|
description: 'Name of the binary property which contains the data for the file',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Commit Message',
|
|
|
|
|
name: 'commitMessage',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['create', 'delete', 'edit'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Branch',
|
|
|
|
|
name: 'branch',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
description: 'Name of the new branch to create. The commit is added to this branch.',
|
|
|
|
|
required: true,
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['create', 'delete', 'edit'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Additional Parameters',
|
|
|
|
|
name: 'additionalParameters',
|
|
|
|
|
placeholder: 'Add Parameter',
|
|
|
|
|
description: 'Additional fields to add',
|
|
|
|
|
type: 'fixedCollection',
|
|
|
|
|
default: {},
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['create', 'delete', 'edit'],
|
|
|
|
|
resource: ['file'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Start Branch',
|
|
|
|
|
name: 'branchStart',
|
|
|
|
|
values: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Start Branch',
|
|
|
|
|
name: 'branchStart',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
description: 'Name of the base branch to create the new branch from',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'author',
|
|
|
|
|
displayName: 'Author',
|
|
|
|
|
values: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Name',
|
|
|
|
|
name: 'name',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
description: 'The name of the author of the commit',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Email',
|
|
|
|
|
name: 'email',
|
|
|
|
|
type: 'string',
|
|
|
|
|
placeholder: 'name@email.com',
|
|
|
|
|
default: '',
|
|
|
|
|
description: 'The email of the author of the commit',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'encoding',
|
|
|
|
|
displayName: 'Encoding',
|
|
|
|
|
values: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Encoding',
|
|
|
|
|
name: 'encoding',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: 'text',
|
|
|
|
|
description: 'Change encoding to base64. Default is text.',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-10-16 17:53:15 -07:00
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
|
const items = this.getInputData();
|
2022-08-30 08:55:33 -07:00
|
|
|
|
const returnData: INodeExecutionData[] = [];
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2022-11-08 06:28:21 -08:00
|
|
|
|
let _credentials;
|
2020-06-16 06:50:17 -07:00
|
|
|
|
|
|
|
|
|
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2020-06-16 06:50:17 -07:00
|
|
|
|
try {
|
|
|
|
|
if (authenticationMethod === 'accessToken') {
|
2022-11-08 06:28:21 -08:00
|
|
|
|
_credentials = await this.getCredentials('gitlabApi');
|
2020-06-16 06:50:17 -07:00
|
|
|
|
} else {
|
2022-11-08 06:28:21 -08:00
|
|
|
|
_credentials = await this.getCredentials('gitlabOAuth2Api');
|
2020-06-16 06:50:17 -07:00
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
2021-07-19 23:58:54 -07:00
|
|
|
|
if (this.continueOnFail()) {
|
|
|
|
|
return [this.helpers.returnJsonArray([{ error: error.message }])];
|
|
|
|
|
}
|
2023-02-27 19:39:43 -08:00
|
|
|
|
throw new NodeOperationError(this.getNode(), error as Error);
|
2019-10-16 17:53:15 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Operations which overwrite the returned data
|
|
|
|
|
const overwriteDataOperations = [
|
2023-01-27 05:58:32 -08:00
|
|
|
|
'file:get',
|
|
|
|
|
'file:create',
|
|
|
|
|
'file:edit',
|
|
|
|
|
'file:delete',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
'issue:create',
|
|
|
|
|
'issue:createComment',
|
|
|
|
|
'issue:edit',
|
|
|
|
|
'issue:get',
|
|
|
|
|
'release:create',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
'release:delete',
|
|
|
|
|
'release:get',
|
|
|
|
|
'release:update',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
'repository:get',
|
|
|
|
|
];
|
|
|
|
|
// Operations which overwrite the returned data and return arrays
|
|
|
|
|
// and has so to be merged with the data of other items
|
|
|
|
|
const overwriteDataOperationsArray = [
|
2023-01-27 05:58:32 -08:00
|
|
|
|
'file:list',
|
2021-04-15 15:27:12 -07:00
|
|
|
|
'release:getAll',
|
2019-10-16 17:53:15 -07:00
|
|
|
|
'repository:getIssues',
|
|
|
|
|
'user:getRepositories',
|
|
|
|
|
];
|
|
|
|
|
|
2021-04-15 15:27:12 -07:00
|
|
|
|
let responseData;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
// For Post
|
|
|
|
|
let body: IDataObject;
|
|
|
|
|
// For Query string
|
|
|
|
|
let qs: IDataObject;
|
|
|
|
|
|
|
|
|
|
let requestMethod: string;
|
|
|
|
|
let endpoint: string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
let returnAll = false;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2022-12-02 03:53:59 -08:00
|
|
|
|
const operation = this.getNodeParameter('operation', 0);
|
|
|
|
|
const resource = this.getNodeParameter('resource', 0);
|
2019-10-16 17:53:15 -07:00
|
|
|
|
const fullOperation = `${resource}:${operation}`;
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < items.length; i++) {
|
2021-07-19 23:58:54 -07:00
|
|
|
|
try {
|
|
|
|
|
// Reset all values
|
|
|
|
|
requestMethod = 'GET';
|
|
|
|
|
endpoint = '';
|
|
|
|
|
body = {};
|
|
|
|
|
qs = {};
|
|
|
|
|
|
|
|
|
|
// Request the parameters which almost all operations need
|
|
|
|
|
let owner = this.getNodeParameter('owner', i) as string;
|
|
|
|
|
|
|
|
|
|
// Replace all slashes to work with subgroups
|
|
|
|
|
owner = owner.replace(new RegExp(/\//g), '%2F');
|
|
|
|
|
|
|
|
|
|
let repository = '';
|
|
|
|
|
if (fullOperation !== 'user:getRepositories') {
|
|
|
|
|
repository = this.getNodeParameter('repository', i) as string;
|
|
|
|
|
}
|
2019-12-13 09:43:01 -08:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const baseEndpoint = `/projects/${owner}%2F${repository}`;
|
2019-12-13 09:43:01 -08:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
if (resource === 'issue') {
|
|
|
|
|
if (operation === 'create') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// create
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'POST';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
body.title = this.getNodeParameter('title', i) as string;
|
|
|
|
|
body.description = this.getNodeParameter('body', i) as string;
|
|
|
|
|
body.due_date = this.getNodeParameter('due_date', i) as string;
|
|
|
|
|
const labels = this.getNodeParameter('labels', i) as IDataObject[];
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const assigneeIds = this.getNodeParameter('assignee_ids', i) as IDataObject[];
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
|
body.labels = labels.map((data) => data.label).join(',');
|
|
|
|
|
body.assignee_ids = assigneeIds.map((data) => data.assignee);
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/issues`;
|
|
|
|
|
} else if (operation === 'createComment') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// createComment
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
requestMethod = 'POST';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const issueNumber = this.getNodeParameter('issueNumber', i) as string;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
body.body = this.getNodeParameter('body', i) as string;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/issues/${issueNumber}/notes`;
|
|
|
|
|
} else if (operation === 'edit') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// edit
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'PUT';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const issueNumber = this.getNodeParameter('issueNumber', i) as string;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
body = this.getNodeParameter('editFields', i, {}) as IDataObject;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
if (body.labels !== undefined) {
|
2022-12-02 12:54:28 -08:00
|
|
|
|
body.labels = (body.labels as IDataObject[]).map((data) => data.label).join(',');
|
2021-07-19 23:58:54 -07:00
|
|
|
|
}
|
|
|
|
|
if (body.assignee_ids !== undefined) {
|
2022-12-02 12:54:28 -08:00
|
|
|
|
body.assignee_ids = (body.assignee_ids as IDataObject[]).map((data) => data.assignee);
|
2021-07-19 23:58:54 -07:00
|
|
|
|
}
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/issues/${issueNumber}`;
|
|
|
|
|
} else if (operation === 'get') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// get
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'GET';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const issueNumber = this.getNodeParameter('issueNumber', i) as string;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/issues/${issueNumber}`;
|
|
|
|
|
} else if (operation === 'lock') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// lock
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'PUT';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const issueNumber = this.getNodeParameter('issueNumber', i) as string;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
body.discussion_locked = true;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/issues/${issueNumber}`;
|
|
|
|
|
}
|
|
|
|
|
} else if (resource === 'release') {
|
|
|
|
|
if (operation === 'create') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// create
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'POST';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
|
body = this.getNodeParameter('additionalFields', i, {});
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
body.tag_name = this.getNodeParameter('releaseTag', i) as string;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/releases`;
|
|
|
|
|
}
|
|
|
|
|
if (operation === 'delete') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// delete
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'DELETE';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const id = this.getNodeParameter('projectId', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const tagName = this.getNodeParameter('tag_name', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `/projects/${id}/releases/${tagName}`;
|
|
|
|
|
}
|
|
|
|
|
if (operation === 'get') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// get
|
|
|
|
|
// ----------------------------------
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'GET';
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const id = this.getNodeParameter('projectId', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const tagName = this.getNodeParameter('tag_name', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `/projects/${id}/releases/${tagName}`;
|
|
|
|
|
}
|
|
|
|
|
if (operation === 'getAll') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// getAll
|
|
|
|
|
// ----------------------------------
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'GET';
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const id = this.getNodeParameter('projectId', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
|
qs = this.getNodeParameter('additionalFields', i, {});
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2022-11-18 05:31:38 -08:00
|
|
|
|
returnAll = this.getNodeParameter('returnAll', 0);
|
2021-04-15 15:27:49 -07:00
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
|
if (!returnAll) {
|
2022-11-18 06:26:22 -08:00
|
|
|
|
qs.per_page = this.getNodeParameter('limit', 0);
|
2021-07-19 23:58:54 -07:00
|
|
|
|
}
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `/projects/${id}/releases`;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
}
|
2021-07-19 23:58:54 -07:00
|
|
|
|
if (operation === 'update') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// update
|
|
|
|
|
// ----------------------------------
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'PUT';
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const id = this.getNodeParameter('projectId', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
const tagName = this.getNodeParameter('tag_name', i) as string;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2022-12-02 12:54:28 -08:00
|
|
|
|
body = this.getNodeParameter('additionalFields', i, {});
|
2022-08-17 08:50:24 -07:00
|
|
|
|
if (body.milestones) {
|
2021-07-19 23:58:54 -07:00
|
|
|
|
body.milestones = (body.milestones as string).split(',');
|
|
|
|
|
}
|
2021-04-15 15:27:12 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `/projects/${id}/releases/${tagName}`;
|
2021-04-15 15:27:12 -07:00
|
|
|
|
}
|
2021-07-19 23:58:54 -07:00
|
|
|
|
} else if (resource === 'repository') {
|
|
|
|
|
if (operation === 'get') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// get
|
|
|
|
|
// ----------------------------------
|
2021-04-15 15:27:49 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'GET';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}`;
|
|
|
|
|
} else if (operation === 'getIssues') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// getIssues
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'GET';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
qs = this.getNodeParameter('getRepositoryIssuesFilters', i) as IDataObject;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `${baseEndpoint}/issues`;
|
|
|
|
|
}
|
|
|
|
|
} else if (resource === 'user') {
|
|
|
|
|
if (operation === 'getRepositories') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// getRepositories
|
|
|
|
|
// ----------------------------------
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
requestMethod = 'GET';
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2021-07-19 23:58:54 -07:00
|
|
|
|
endpoint = `/users/${owner}/projects`;
|
|
|
|
|
}
|
2023-01-27 05:58:32 -08:00
|
|
|
|
} else if (resource === 'file') {
|
|
|
|
|
if (['create', 'edit'].includes(operation)) {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// create
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
requestMethod = operation === 'create' ? 'POST' : 'PUT';
|
|
|
|
|
|
|
|
|
|
const filePath = this.getNodeParameter('filePath', i);
|
|
|
|
|
const additionalParameters = this.getNodeParameter(
|
|
|
|
|
'additionalParameters',
|
|
|
|
|
i,
|
|
|
|
|
) as IDataObject;
|
|
|
|
|
|
|
|
|
|
body.branch = this.getNodeParameter('branch', i) as string;
|
|
|
|
|
body.commit_message = this.getNodeParameter('commitMessage', i) as string;
|
|
|
|
|
|
|
|
|
|
if (additionalParameters.author) {
|
|
|
|
|
body.author = additionalParameters.author;
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
additionalParameters.branchStart &&
|
|
|
|
|
(additionalParameters.branchStart as IDataObject).branchStart
|
|
|
|
|
) {
|
|
|
|
|
body.start_branch = (additionalParameters.branchStart as IDataObject).branchStart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.getNodeParameter('binaryData', i)) {
|
|
|
|
|
// Is binary file to upload
|
|
|
|
|
const item = items[i];
|
|
|
|
|
|
|
|
|
|
if (item.binary === undefined) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', {
|
|
|
|
|
itemIndex: i,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
|
|
|
|
|
|
|
|
if (item.binary[binaryPropertyName] === undefined) {
|
|
|
|
|
throw new NodeOperationError(
|
|
|
|
|
this.getNode(),
|
2023-02-23 00:33:43 -08:00
|
|
|
|
`Item has no binary property called "${binaryPropertyName}"`,
|
2023-01-27 05:58:32 -08:00
|
|
|
|
{ itemIndex: i },
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Currently internally n8n uses base64 and also GitLab expects it base64 encoded.
|
|
|
|
|
// If that ever changes the data has to get converted here.
|
|
|
|
|
body.content = item.binary[binaryPropertyName].data;
|
|
|
|
|
body.encoding = 'base64';
|
|
|
|
|
} else {
|
|
|
|
|
// Is text file
|
|
|
|
|
if (additionalParameters.encoding === 'base64') {
|
|
|
|
|
body.content = Buffer.from(
|
|
|
|
|
this.getNodeParameter('fileContent', i) as string,
|
|
|
|
|
).toString('base64');
|
|
|
|
|
} else {
|
|
|
|
|
body.content = this.getNodeParameter('fileContent', i) as string;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
endpoint = `${baseEndpoint}/repository/files/${encodeURIComponent(filePath)}`;
|
|
|
|
|
} else if (operation === 'delete') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// delete
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
requestMethod = 'DELETE';
|
|
|
|
|
|
|
|
|
|
const additionalParameters = this.getNodeParameter(
|
|
|
|
|
'additionalParameters',
|
|
|
|
|
i,
|
|
|
|
|
{},
|
|
|
|
|
) as IDataObject;
|
|
|
|
|
if (additionalParameters.author) {
|
|
|
|
|
body.author = additionalParameters.author;
|
|
|
|
|
}
|
|
|
|
|
body.branch = this.getNodeParameter('branch', i) as string;
|
|
|
|
|
body.commit_message = this.getNodeParameter('commitMessage', i) as string;
|
|
|
|
|
|
|
|
|
|
const filePath = this.getNodeParameter('filePath', i);
|
|
|
|
|
|
|
|
|
|
endpoint = `${baseEndpoint}/repository/files/${encodeURIComponent(filePath)}`;
|
|
|
|
|
} else if (operation === 'get') {
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
// get
|
|
|
|
|
// ----------------------------------
|
|
|
|
|
|
|
|
|
|
requestMethod = 'GET';
|
|
|
|
|
|
|
|
|
|
const filePath = this.getNodeParameter('filePath', i);
|
|
|
|
|
const additionalParameters = this.getNodeParameter(
|
|
|
|
|
'additionalParameters',
|
|
|
|
|
i,
|
|
|
|
|
) as IDataObject;
|
|
|
|
|
|
|
|
|
|
if (additionalParameters.reference) {
|
|
|
|
|
qs.ref = additionalParameters.reference;
|
|
|
|
|
} else {
|
|
|
|
|
qs.ref = 'master';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
endpoint = `${baseEndpoint}/repository/files/${encodeURIComponent(filePath)}`;
|
|
|
|
|
} else if (operation === 'list') {
|
|
|
|
|
requestMethod = 'GET';
|
|
|
|
|
|
|
|
|
|
const filePath = this.getNodeParameter('filePath', i);
|
|
|
|
|
qs = this.getNodeParameter('additionalFields', i, {});
|
|
|
|
|
returnAll = this.getNodeParameter('returnAll', i);
|
|
|
|
|
|
|
|
|
|
if (!returnAll) {
|
|
|
|
|
qs.per_page = this.getNodeParameter('limit', i);
|
|
|
|
|
qs.page = this.getNodeParameter('page', i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (filePath) {
|
|
|
|
|
qs.path = filePath;
|
|
|
|
|
}
|
|
|
|
|
endpoint = `${baseEndpoint}/repository/tree`;
|
|
|
|
|
}
|
2021-07-19 23:58:54 -07:00
|
|
|
|
} else {
|
2022-08-30 08:55:33 -07:00
|
|
|
|
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
|
|
|
|
|
itemIndex: i,
|
|
|
|
|
});
|
2019-10-16 17:53:15 -07:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-27 05:58:32 -08:00
|
|
|
|
const asBinaryProperty = this.getNodeParameter('asBinaryProperty', i, false) as boolean;
|
2022-12-02 12:54:28 -08:00
|
|
|
|
if (returnAll) {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
responseData = await gitlabApiRequestAllItems.call(
|
|
|
|
|
this,
|
|
|
|
|
requestMethod,
|
|
|
|
|
endpoint,
|
|
|
|
|
body,
|
|
|
|
|
qs,
|
|
|
|
|
);
|
2021-07-19 23:58:54 -07:00
|
|
|
|
} else {
|
|
|
|
|
responseData = await gitlabApiRequest.call(this, requestMethod, endpoint, body, qs);
|
|
|
|
|
}
|
2019-10-16 17:53:15 -07:00
|
|
|
|
|
2023-01-27 05:58:32 -08:00
|
|
|
|
if (fullOperation === 'file:get' && asBinaryProperty) {
|
|
|
|
|
if (Array.isArray(responseData) && responseData.length > 1) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), 'File Path is a folder, not a file.', {
|
|
|
|
|
itemIndex: i,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// Add the returned data to the item as binary property
|
|
|
|
|
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
|
|
|
|
|
|
|
|
const newItem: INodeExecutionData = {
|
|
|
|
|
json: items[i].json,
|
|
|
|
|
binary: {},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (items[i].binary !== undefined) {
|
|
|
|
|
// Create a shallow copy of the binary data so that the old
|
|
|
|
|
// data references which do not get changed still stay behind
|
|
|
|
|
// but the incoming data does not get changed.
|
|
|
|
|
Object.assign(newItem.binary as object, items[i].binary!);
|
|
|
|
|
}
|
|
|
|
|
const { content, path } = responseData;
|
|
|
|
|
newItem.binary![binaryPropertyName] = await this.helpers.prepareBinaryData(
|
|
|
|
|
Buffer.from(content as string, 'base64'),
|
|
|
|
|
path as string,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
items[i] = newItem;
|
|
|
|
|
|
|
|
|
|
return [items];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
overwriteDataOperations.includes(fullOperation) ||
|
|
|
|
|
overwriteDataOperationsArray.includes(fullOperation)
|
|
|
|
|
) {
|
|
|
|
|
const executionData = this.helpers.constructExecutionMetaData(
|
2023-02-27 19:39:43 -08:00
|
|
|
|
this.helpers.returnJsonArray(responseData as IDataObject),
|
2023-01-27 05:58:32 -08:00
|
|
|
|
{ itemData: { item: i } },
|
|
|
|
|
);
|
|
|
|
|
returnData.push(...executionData);
|
|
|
|
|
}
|
2021-07-19 23:58:54 -07:00
|
|
|
|
} catch (error) {
|
|
|
|
|
if (this.continueOnFail()) {
|
2022-08-17 08:50:24 -07:00
|
|
|
|
if (
|
|
|
|
|
overwriteDataOperations.includes(fullOperation) ||
|
|
|
|
|
overwriteDataOperationsArray.includes(fullOperation)
|
|
|
|
|
) {
|
2022-08-30 08:55:33 -07:00
|
|
|
|
const executionErrorData = this.helpers.constructExecutionMetaData(
|
|
|
|
|
this.helpers.returnJsonArray({ error: error.message }),
|
|
|
|
|
{ itemData: { item: i } },
|
|
|
|
|
);
|
|
|
|
|
returnData.push(...executionErrorData);
|
2021-07-19 23:58:54 -07:00
|
|
|
|
} else {
|
|
|
|
|
items[i].json = { error: error.message };
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
throw error;
|
2019-10-16 17:53:15 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
|
if (
|
|
|
|
|
overwriteDataOperations.includes(fullOperation) ||
|
|
|
|
|
overwriteDataOperationsArray.includes(fullOperation)
|
|
|
|
|
) {
|
2019-10-16 17:53:15 -07:00
|
|
|
|
// Return data gets replaced
|
2022-08-30 08:55:33 -07:00
|
|
|
|
return this.prepareOutputData(returnData);
|
2019-10-16 17:53:15 -07:00
|
|
|
|
} else {
|
|
|
|
|
// For all other ones simply return the unchanged items
|
|
|
|
|
return this.prepareOutputData(items);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|