2022-08-01 13:47:55 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-09-05 10:24:56 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const softwareOperations: 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: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a software application',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a software application',
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a software application',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a software application',
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Retrieve a software application',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a software application',
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-09-05 10:24:56 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Retrieve many software applications',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many software applications',
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a software application',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a software application',
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
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 softwareFields: INodeProperties[] = [
|
2021-09-05 10:24:56 -07:00
|
|
|
// ----------------------------------------
|
|
|
|
// software: create
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Application Type',
|
|
|
|
name: 'applicationType',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Desktop',
|
|
|
|
value: 'desktop',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Mobile',
|
|
|
|
value: 'mobile',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'SaaS',
|
|
|
|
value: 'saas',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'desktop',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['create'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['create'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['create'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Notes',
|
|
|
|
name: 'notes',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Status',
|
|
|
|
name: 'status',
|
|
|
|
type: 'options',
|
|
|
|
default: 'managed',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Disabled',
|
|
|
|
value: 'disabled',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Ignored',
|
|
|
|
value: 'ignored',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Needs Review',
|
|
|
|
value: 'needs review',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Restricted',
|
|
|
|
value: 'restricted',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// software: delete
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Software ID',
|
|
|
|
name: 'softwareId',
|
|
|
|
description: 'ID of the software application to delete',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['delete'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// software: get
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Software ID',
|
|
|
|
name: 'softwareId',
|
|
|
|
description: 'ID of the software application to retrieve',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['get'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// software: 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: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['getAll'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// software: update
|
|
|
|
// ----------------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Software ID',
|
|
|
|
name: 'softwareId',
|
|
|
|
description: 'ID of the software application to update',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['update'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['software'],
|
|
|
|
operation: ['update'],
|
2021-09-05 10:24:56 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Application Type',
|
|
|
|
name: 'application_type',
|
|
|
|
type: 'options',
|
|
|
|
default: 'desktop',
|
|
|
|
description: 'Type of the software',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Desktop',
|
|
|
|
value: 'desktop',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Mobile',
|
|
|
|
value: 'mobile',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'SaaS',
|
|
|
|
value: 'saas',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Notes',
|
|
|
|
name: 'notes',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Status',
|
|
|
|
name: 'status',
|
|
|
|
type: 'options',
|
|
|
|
default: 'managed',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Disabled',
|
|
|
|
value: 'disabled',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Ignored',
|
|
|
|
value: 'ignored',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Needs Review',
|
|
|
|
value: 'needs review',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Restricted',
|
|
|
|
value: 'restricted',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|