2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-11-04 01:53:33 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const storyContentOperations: INodeProperties[] = [
|
2020-11-04 01:53:33 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-11-04 01:53:33 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
source: ['contentApi'],
|
|
|
|
resource: ['story'],
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a story',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a story',
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all stories',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get all stories',
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'get',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-11-04 01:53:33 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const storyContentFields: INodeProperties[] = [
|
2020-11-04 01:53:33 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* story:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Identifier',
|
|
|
|
name: 'identifier',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
source: ['contentApi'],
|
|
|
|
resource: ['story'],
|
|
|
|
operation: ['get'],
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID or slug of the story to get',
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* story:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
source: ['contentApi'],
|
|
|
|
resource: ['story'],
|
|
|
|
operation: ['getAll'],
|
2020-11-04 01:53:33 -08: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-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
source: ['contentApi'],
|
|
|
|
resource: ['story'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Filters',
|
|
|
|
name: 'filters',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Filter',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
source: ['contentApi'],
|
|
|
|
resource: ['story'],
|
|
|
|
operation: ['getAll'],
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Starts With',
|
|
|
|
name: 'starts_with',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Filter by slug',
|
2020-11-04 01:53:33 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|