fixed merge conflict marker
This commit is contained in:
parent
ab691f648c
commit
ed7dc578c5
3 changed files with 1 additions and 89 deletions
|
@ -1,43 +1,12 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
ICredentialDataDecryptedObject,
|
||||
IAuthenticateGeneric,
|
||||
IExecuteFunctions,
|
||||
ICredentialTestRequest,
|
||||
NodeApiError,
|
||||
IDataObject,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class PlutioApi implements ICredentialType {
|
||||
name = 'plutioApi';
|
||||
displayName = 'Plutio API';
|
||||
extends = ['oAuth2Api'];
|
||||
properties: INodeProperties[] = [
|
||||
// {
|
||||
// displayName: 'Grant Type',
|
||||
// name: 'grantType',
|
||||
// type: 'hidden',
|
||||
// default: 'client_credentials',
|
||||
// },
|
||||
// {
|
||||
// displayName: 'Scope',
|
||||
// name: 'scope',
|
||||
// type: 'hidden',
|
||||
// default: '*',
|
||||
// },
|
||||
// {
|
||||
// displayName: 'Authentication',
|
||||
// name: 'authentication',
|
||||
// type: 'hidden',
|
||||
// default: 'header',
|
||||
// },
|
||||
// {
|
||||
// displayName: 'Access Token URL',
|
||||
// name: 'accessTokenUrl',
|
||||
// type: 'hidden',
|
||||
// default: 'https://api.plutio.com/v1.10/oauth/token',
|
||||
// },
|
||||
{
|
||||
displayName: 'Client ID',
|
||||
name: 'clientId',
|
||||
|
@ -60,57 +29,4 @@ export class PlutioApi implements ICredentialType {
|
|||
default: '',
|
||||
},
|
||||
];
|
||||
|
||||
// async preAuthentication(this: IExecuteFunctions, credentials: ICredentialDataDecryptedObject) {
|
||||
// const endpoint = 'api.plutio.com/v1.10';
|
||||
// const returnData: IDataObject[] = [];
|
||||
// let access_token;
|
||||
// try {
|
||||
// access_token = await this.helpers.httpRequest({
|
||||
// method: 'POST',
|
||||
// url: `https://${endpoint}/oauth/token`,
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/x-www-form-urlencoded',
|
||||
// 'business': `${credentials.business}`,
|
||||
// },
|
||||
// body: {
|
||||
// 'client_id': `${credentials.clientId}`,
|
||||
// 'client_secret': `${credentials.clientSecret}`,
|
||||
// 'grant_type': 'client_credentials',
|
||||
// },
|
||||
// json: true,
|
||||
// }) as {access_token: IDataObject};
|
||||
// if (Array.isArray(access_token)) {
|
||||
// returnData.push.apply(returnData, access_token as IDataObject[]);
|
||||
// } else {
|
||||
// if (access_token === undefined) {
|
||||
// access_token = {
|
||||
// success: true,
|
||||
// };
|
||||
// }
|
||||
// returnData.push(access_token as IDataObject);
|
||||
// }
|
||||
// if (returnData[0].accessToken) {
|
||||
// return {accessToken: returnData[0].accessToken};
|
||||
// }
|
||||
// } catch (error) {
|
||||
// throw new NodeApiError(this.getNode(), error);
|
||||
// }
|
||||
// }
|
||||
// authenticate: IAuthenticateGeneric = {
|
||||
// type: 'generic',
|
||||
// properties: {
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json',
|
||||
// 'Business': '={{$credentials.business}}',
|
||||
// 'Authorization': '=Bearer {{$credentials.accessToken}}',
|
||||
// },
|
||||
// },
|
||||
// };
|
||||
// test: ICredentialTestRequest = {
|
||||
// request: {
|
||||
// baseURL: 'https://api.plutio.com/v1.10',
|
||||
// url: '/templates',
|
||||
// },
|
||||
// };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue