2020-08-25 01:50:39 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const planOperations: INodeProperties[] = [
|
2020-08-25 01:50:39 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-08-25 01:50:39 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'plan',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Get a plan',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Get all plans',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-08-25 01:50:39 -07:00
|
|
|
],
|
|
|
|
default: 'get',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-08-25 01:50:39 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const planFields: INodeProperties[] = [
|
2020-08-25 01:50:39 -07:00
|
|
|
|
2020-08-25 01:51:16 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* plan:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-25 01:50:39 -07:00
|
|
|
{
|
|
|
|
displayName: 'Plan ID',
|
|
|
|
name: 'planId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'plan',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Filter: The subscription plan ID',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'plan',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'plan',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 500,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|