2022-08-01 13:47:55 -07:00
import { INodeProperties , INodePropertyOptions } from 'n8n-workflow' ;
2020-07-09 02:36:28 -07:00
export const resource = {
2020-08-25 02:22:14 -07:00
name : 'Locale' ,
value : 'locale' ,
2020-07-09 02:36:28 -07:00
} as INodePropertyOptions ;
2021-12-03 00:44:16 -08:00
export const operations : INodeProperties [ ] = [
2020-08-04 12:07:54 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-08-04 12:07:54 -07:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ resource . value ] ,
2020-08-04 12:07:54 -07:00
} ,
} ,
options : [
{
name : 'Get All' ,
value : 'getAll' ,
} ,
] ,
default : 'getAll' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-07-09 02:36:28 -07:00
2021-12-03 00:44:16 -08:00
export const fields : INodeProperties [ ] = [
2020-08-04 12:07:54 -07:00
{
displayName : 'Environment ID' ,
name : 'environmentId' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ resource . value ] ,
operation : [ 'get' , 'getAll' ] ,
2020-08-04 12:07:54 -07:00
} ,
} ,
default : 'master' ,
2022-08-01 13:47:55 -07:00
description :
'The ID for the Contentful environment (e.g. master, staging, etc.). Depending on your plan, you might not have environments. In that case use "master".' ,
2020-08-04 12:07:54 -07:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'getAll' ] ,
resource : [ resource . value ] ,
2020-08-04 12:07:54 -07: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-08-04 12:07:54 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'getAll' ] ,
resource : [ resource . value ] ,
returnAll : [ false ] ,
2020-08-04 12:07:54 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-08-04 12:07:54 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;