Add update/delete to Team, Release and Project in SentryIo node (#1605)

* Add update/delete to Team, Release and Project in SentryIo node

* Add create/delete:Project in SentryIo node

* Minor fix

* Fix descriptions & display names

* Fix casing in descriptions

* Add getTeams load function & Update operations fields

* Change 'Additional Field' to 'Update Fields' for Team,Release,Project & Organization operations
This commit is contained in:
MedAliMarz
2021-04-24 00:37:37 +02:00
committed by GitHub
parent 35e790b8dd
commit a3c5f41b0f
8 changed files with 821 additions and 94 deletions

View File

@@ -30,6 +30,16 @@ export const teamOperations = [
value: 'getAll',
description: 'Get all teams',
},
{
name: 'Update',
value: 'update',
description: 'Update a team',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a team',
},
],
default: 'get',
description: 'The operation to perform',
@@ -59,7 +69,7 @@ export const teamFields = [
},
},
required: true,
description: 'The slug of the organization for which the teams should be listed',
description: 'The slug of the organization for which the teams should be listed.',
},
{
displayName: 'Return All',
@@ -76,7 +86,7 @@ export const teamFields = [
},
},
default: false,
description: 'If all results should be returned or only up to a given limit',
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
@@ -100,7 +110,7 @@ export const teamFields = [
maxValue: 500,
},
default: 100,
description: 'How many results to return',
description: 'How many results to return.',
},
/* -------------------------------------------------------------------------- */
/* team:get */
@@ -124,12 +134,18 @@ export const teamFields = [
},
},
required: true,
description: 'The slug of the organization the team belongs to',
description: 'The slug of the organization the team belongs to.',
},
{
displayName: 'Team Slug',
name: 'teamSlug',
type: 'string',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTeams',
loadOptionsDependsOn: [
'organizationSlug',
],
},
default: '',
displayOptions: {
show: {
@@ -142,7 +158,7 @@ export const teamFields = [
},
},
required: true,
description: 'The slug of the team to get',
description: 'The slug of the team to get.',
},
/* -------------------------------------------------------------------------- */
/* team:create */
@@ -166,7 +182,7 @@ export const teamFields = [
},
},
required: true,
description: 'The slug of the organization the team belongs to',
description: 'The slug of the organization the team belongs to.',
},
{
displayName: 'Name',
@@ -184,7 +200,7 @@ export const teamFields = [
},
},
required: true,
description: 'The name of the team',
description: 'The name of the team.',
},
{
displayName: 'Additional Fields',
@@ -208,7 +224,7 @@ export const teamFields = [
name: 'slug',
type: 'string',
default: '',
description: 'The optional slug for this team. If not provided it will be auto generated from the name',
description: 'The optional slug for this team. If not provided it will be auto generated from the name.',
},
],
},
@@ -229,16 +245,40 @@ export const teamFields = [
'team',
],
operation: [
'update', 'delete',
'update',
],
},
},
required: true,
description: 'The slug of the organization the team belongs to',
description: 'The slug of the organization the team belongs to.',
},
{
displayName: 'Team Slug',
name: 'teamSlug',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTeams',
loadOptionsDependsOn: [
'organizationSlug',
],
},
default: '',
displayOptions: {
show: {
resource: [
'team',
],
operation: [
'update',
],
},
},
required: true,
description: 'The slug of the team to update.',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
displayOptions: {
@@ -247,16 +287,16 @@ export const teamFields = [
'team',
],
operation: [
'update', 'delete',
'update',
],
},
},
required: true,
description: 'The slug of the team to get',
description: 'The new name of the team.',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
@@ -276,15 +316,56 @@ export const teamFields = [
name: 'slug',
type: 'string',
default: '',
description: 'The new slug of the team. Must be unique and available',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'The new name of the team',
description: 'The new slug of the team. Must be unique and available.',
},
],
},
/* -------------------------------------------------------------------------- */
/* team:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Organization Slug',
name: 'organizationSlug',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getOrganizations',
},
default: '',
displayOptions: {
show: {
resource: [
'team',
],
operation: [
'delete',
],
},
},
required: true,
description: 'The slug of the organization the team belongs to.',
},
{
displayName: 'Team Slug',
name: 'teamSlug',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTeams',
loadOptionsDependsOn: [
'organizationSlug',
],
},
default: '',
displayOptions: {
show: {
resource: [
'team',
],
operation: [
'delete',
],
},
},
required: true,
description: 'The slug of the team to delete.',
},
] as INodeProperties[];