2020-11-04 01:53:33 -08:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const storyManagementOperations : 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 : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
} ,
} ,
options : [
// {
// name: 'Create',
// value: 'create',
// description: 'Create a story',
// },
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a story' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a story' ,
2020-11-04 01:53:33 -08:00
} ,
{
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
} ,
{
name : 'Publish' ,
value : 'publish' ,
description : 'Publish a story' ,
2022-07-10 13:50:51 -07:00
action : 'Publish a story' ,
2020-11-04 01:53:33 -08:00
} ,
{
name : 'Unpublish' ,
value : 'unpublish' ,
description : 'Unpublish a story' ,
2022-07-10 13:50:51 -07:00
action : 'Unpublish a story' ,
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 storyManagementFields : INodeProperties [ ] = [
2020-11-04 01:53:33 -08:00
// /* -------------------------------------------------------------------------- */
// /* story:create */
// /* -------------------------------------------------------------------------- */
// {
// displayName: 'Space ID',
// name: 'space',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getSpaces',
// },
// default: '',
// required: true,
// displayOptions: {
// show: {
// source: [
// 'managementApi',
// ],
// resource: [
// 'story',
// ],
// operation: [
// 'create',
// ],
// },
// },
// description: 'The name of the space.',
// },
// {
// displayName: 'Name',
// name: 'name',
// type: 'string',
// default: '',
// required: true,
// displayOptions: {
// show: {
// source: [
// 'managementApi',
// ],
// resource: [
// 'story',
// ],
// operation: [
// 'create',
// ],
// },
// },
// description: 'The name you give this story.',
// },
// {
// displayName: 'Slug',
// name: 'slug',
// type: 'string',
// default: '',
// required: true,
// displayOptions: {
// show: {
// source: [
// 'managementApi',
// ],
// resource: [
// 'story',
// ],
// operation: [
// 'create',
// ],
// },
// },
// description: 'The slug/path you give this story.',
// },
// {
// displayName: 'JSON Parameters',
// name: 'jsonParameters',
// type: 'boolean',
// default: false,
// description: '',
// displayOptions: {
// show: {
// source: [
// 'managementApi',
// ],
// resource: [
// 'story',
// ],
// operation: [
// 'create',
// ],
// },
// },
// },
// {
// displayName: 'Additional Fields',
// name: 'additionalFields',
// type: 'collection',
// placeholder: 'Add Field',
// displayOptions: {
// show: {
// source: [
// 'managementApi',
// ],
// resource: [
// 'story',
// ],
// operation: [
// 'create',
// ],
// },
// },
// default: {},
// options: [
// {
// displayName: 'Content',
// name: 'contentUi',
// type: 'fixedCollection',
// description: 'Add Content',
// typeOptions: {
// multipleValues: false,
// },
// displayOptions: {
// show: {
// '/jsonParameters': [
// false,
// ],
// },
// },
// placeholder: 'Add Content',
// default: '',
// options: [
// {
// displayName: 'Content Data',
// name: 'contentValue',
// values: [
// {
// displayName: 'Component',
// name: 'component',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getComponents',
// loadOptionsDependsOn: [
// 'space',
// ],
// },
// default: '',
// },
// {
// displayName: 'Elements',
// name: 'elementUi',
// type: 'fixedCollection',
// description: 'Add Body',
// typeOptions: {
// multipleValues: true,
// },
// placeholder: 'Add Element',
// default: '',
// options: [
// {
// displayName: 'Element',
// name: 'elementValues',
// values: [
// {
// displayName: 'Component',
// name: 'component',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getComponents',
// loadOptionsDependsOn: [
// 'space',
// ],
// },
// default: '',
// },
// {
// displayName: 'Element Data',
// name: 'dataUi',
// type: 'fixedCollection',
// description: 'Add Data',
// typeOptions: {
// multipleValues: true,
// },
// placeholder: 'Add Data',
// default: '',
// options: [
// {
// displayName: 'Data',
// name: 'dataValues',
// values: [
// {
// displayName: 'Key',
// name: 'key',
// type: 'string',
// default: '',
// },
// {
// displayName: 'Value',
// name: 'value',
// type: 'string',
// default: '',
// },
// ],
// },
// ],
// },
// ],
// },
// ],
// },
// ],
// },
// ],
// },
// {
// displayName: 'Content (JSON)',
// name: 'contentJson',
// type: 'string',
// displayOptions: {
// show: {
// '/jsonParameters': [
// true,
// ],
// },
// },
// default: '',
// },
// {
// displayName: 'Parent ID',
// name: 'parentId',
// type: 'string',
// default: '',
// description: 'Parent story/folder numeric ID.',
// },
// {
// displayName: 'Path',
// name: 'path',
// type: 'string',
// default: '',
// description: 'Given real path, used in the preview editor.',
// },
// {
// displayName: 'Is Startpage',
// name: 'isStartpage',
// type: 'boolean',
// default: false,
// description: 'Is startpage of current folder.',
// },
// {
// displayName: 'First Published At',
// name: 'firstPublishedAt',
// type: 'dateTime',
// default: '',
// description: 'First publishing date.',
// },
// ],
// },
/* -------------------------------------------------------------------------- */
/* story:delete */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2020-11-04 01:53:33 -08:00
name : 'space' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The name of the space. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Story ID' ,
name : 'storyId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Numeric ID of the story' ,
2020-11-04 01:53:33 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* story:get */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2020-11-04 01:53:33 -08:00
name : 'space' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The name of the space. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Story ID' ,
name : 'storyId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Numeric ID of the story' ,
2020-11-04 01:53:33 -08:00
} ,
/* -------------------------------------------------------------------------- */
/* story:getAll */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2020-11-04 01:53:33 -08:00
name : 'space' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The name of the space. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
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 : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'getAll' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
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 : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
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
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* story:publish */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2020-11-04 01:53:33 -08:00
name : 'space' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'publish' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The name of the space. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Story ID' ,
name : 'storyId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'publish' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Numeric ID of the story' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'publish' ,
] ,
} ,
} ,
default : { } ,
options : [
{
displayName : 'Release ID' ,
name : 'releaseId' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Numeric ID of release' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Language' ,
name : 'language' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Language code to publish the story individually (must be enabled in the space settings)' ,
2020-11-04 01:53:33 -08:00
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* story:unpublish */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Space Name or ID' ,
2020-11-04 01:53:33 -08:00
name : 'space' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSpaces' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'unpublish' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'The name of the space. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-11-04 01:53:33 -08:00
} ,
{
displayName : 'Story ID' ,
name : 'storyId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
source : [
'managementApi' ,
] ,
resource : [
'story' ,
] ,
operation : [
'unpublish' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Numeric ID of the story' ,
2020-11-04 01:53:33 -08:00
} ,
2021-12-03 00:44:16 -08:00
] ;