n8n/packages/nodes-base/credentials/StrapiApi.credentials.ts
Harshil Agrawal 2a3cbf3fc8
fix(Strapi Node): Add support for Strapi v4
* 🐛 Fix get all operation for v4

* 🔨 Fix create operation

* 🔨 Fix update operation

* 🔨 Fix delete operation

* 🔨 Fix get operation

* 🔨 Fix Return All

* 👕 Fix nodelinter issues

*  Add Credential Test

* 🔨 Code improvement

* 👕 Fix lint issue

* Removed extra /api from Get All on v4

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
2022-03-12 10:56:34 +01:00

54 lines
982 B
TypeScript

import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class StrapiApi implements ICredentialType {
name = 'strapiApi';
displayName = 'Strapi API';
documentationUrl = 'strapi';
properties: INodeProperties[] = [
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: {
password: true,
},
default: '',
},
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
placeholder: 'https://api.example.com',
},
{
displayName: 'API Version',
name: 'apiVersion',
default: 'v3',
type: 'options',
description: 'The version of api to be used',
options: [
{
name: 'Version 4',
value: 'v4',
description: 'API version supported by Strapi 4',
},
{
name: 'Version 3',
value: 'v3',
description: 'API version supported by Strapi 3',
},
],
},
];
}