From 52fa9c4986f84f2c8e4c0b32d9175e5434f54ad7 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Tue, 13 Sep 2022 21:21:24 +0800
Subject: [PATCH 01/10] enable chykalophia specific operation

---
 nodes/Plutio/descriptions/ProjectDescription.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 01464d8..f97cf77 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -41,12 +41,12 @@ export const projectOperations: INodeProperties[] = [
 				description: 'Get projects',
 				action: 'Get a project',
 			},
-			// {
-			// 	name: 'Chykalophia',
-			// 	value: 'getCklph',
-			// 	description: 'Get projects by contributor\'s email for CKLPH',
-			// 	action: 'Get a project',
-			// },
+			{
+				name: 'Chykalophia',
+				value: 'getCklph',
+				description: 'Get projects by contributor\'s email for CKLPH',
+				action: 'Get a project',
+			},
 			{
 				name: 'Move',
 				value: 'move',

From dcb49053f6864039e253e39c1ab3c48bf0f3c366 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Tue, 13 Sep 2022 21:23:59 +0800
Subject: [PATCH 02/10] minor fixes

---
 .../Plutio/descriptions/ProjectDescription.ts | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index f97cf77..5200aaa 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -17,6 +17,12 @@ export const projectOperations: INodeProperties[] = [
 			},
 		},
 		options: [
+			{
+				name: 'Chykalophia',
+				value: 'getCklph',
+				description: 'Get projects by contributor\'s email for CKLPH',
+				action: 'Get a project',
+			},
 			{
 				name: 'Copy',
 				value: 'copy',
@@ -41,12 +47,6 @@ export const projectOperations: INodeProperties[] = [
 				description: 'Get projects',
 				action: 'Get a project',
 			},
-			{
-				name: 'Chykalophia',
-				value: 'getCklph',
-				description: 'Get projects by contributor\'s email for CKLPH',
-				action: 'Get a project',
-			},
 			{
 				name: 'Move',
 				value: 'move',
@@ -114,7 +114,7 @@ export const projectDescription: INodeProperties[] = [
 				displayName: 'Template Name or ID',
 				name: 'templateId',
 				type: 'options',
-				description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
+				description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
 				default: '',
 				typeOptions: {
 					loadOptionsMethod: 'getProjectTemplateId',
@@ -152,7 +152,7 @@ export const projectDescription: INodeProperties[] = [
 						displayName: 'Custom Field Name or ID',
 						name: '_id',
 						type: 'options',
-						description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
+						description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
 						default: '',
 						typeOptions: {
 							loadOptionsMethod: 'getProjectCustomField',
@@ -198,7 +198,7 @@ export const projectDescription: INodeProperties[] = [
 						displayName: 'Contributors: Name or ID',
 						name: 'value',
 						type: 'options',
-						description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
+						description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
 						default: '',
 						typeOptions: {
 							loadOptionsMethod: 'getUsers',
@@ -248,7 +248,7 @@ export const projectDescription: INodeProperties[] = [
 				displayName: 'Contributor\'s Email\, Name or ID',
 				name: 'contributor',
 				type: 'options',
-				description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
+				description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
 				default: '',
 				typeOptions: {
 					loadOptionsMethod: 'getEmails',
@@ -258,7 +258,7 @@ export const projectDescription: INodeProperties[] = [
 				displayName: 'Project Name or ID',
 				name: '_id',
 				type: 'options',
-				description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
+				description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
 				default: '',
 				typeOptions: {
 					loadOptionsMethod: 'getProjectId',
@@ -270,7 +270,7 @@ export const projectDescription: INodeProperties[] = [
 		displayName: 'Contributor\'s Email\, Name or ID',
 		name: 'contributor',
 		type: 'options',
-		description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
+		description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
 		default: '',
 		typeOptions: {
 			loadOptionsMethod: 'getEmails',

From a4683de8f07873f0c148a0e4a97f20eedf96c5d9 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 00:18:01 +0800
Subject: [PATCH 03/10] archiving

---
 nodes/Plutio/GenericFunctions.ts | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/nodes/Plutio/GenericFunctions.ts b/nodes/Plutio/GenericFunctions.ts
index df1a2b8..80b8b40 100644
--- a/nodes/Plutio/GenericFunctions.ts
+++ b/nodes/Plutio/GenericFunctions.ts
@@ -17,11 +17,8 @@ async function plutioApiRequestToken(this: IExecuteFunctions | ILoadOptionsFunct
 	const clientId = `${credentials.clientId}`;
 	const clientSecret = `${credentials.clientSecret}`;
 	const business = `${credentials.business}`;
-<<<<<<< HEAD
+
 	const endpoint = 'api.plutio.com/v1.10';
-=======
-	const endpoint = 'api.plutio.com/v1.9';
->>>>>>> master
 	const returnData: IDataObject[] = [];
 
 	let responseData;

From ed7dc578c5f2820583be0bcddaf1456ada778d53 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 00:43:01 +0800
Subject: [PATCH 04/10] fixed merge conflict marker

---
 credentials/PlutioApi.credentials.ts | 84 ----------------------------
 nodes/Plutio/GenericFunctions.ts     |  4 --
 nodes/Plutio/Plutio.node.ts          |  2 +-
 3 files changed, 1 insertion(+), 89 deletions(-)

diff --git a/credentials/PlutioApi.credentials.ts b/credentials/PlutioApi.credentials.ts
index e26e800..c87656d 100644
--- a/credentials/PlutioApi.credentials.ts
+++ b/credentials/PlutioApi.credentials.ts
@@ -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',
-	// 	},
-	// };
 }
diff --git a/nodes/Plutio/GenericFunctions.ts b/nodes/Plutio/GenericFunctions.ts
index 80b8b40..1f18a1e 100644
--- a/nodes/Plutio/GenericFunctions.ts
+++ b/nodes/Plutio/GenericFunctions.ts
@@ -59,11 +59,7 @@ async function plutioApiRequestToken(this: IExecuteFunctions | ILoadOptionsFunct
 
 // Rest API function for plutio node.
 export async function plutioApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
-<<<<<<< HEAD
 	const endpoint = 'api.plutio.com/v1.10';
-=======
-	const endpoint = 'api.plutio.com/v1.9';
->>>>>>> master
 	const credentials = await this.getCredentials('plutioApi');
 	const plutioApiToken = await plutioApiRequestToken.call(this);
 	const business = `${credentials.business}`;
diff --git a/nodes/Plutio/Plutio.node.ts b/nodes/Plutio/Plutio.node.ts
index b3753a1..1b0036e 100644
--- a/nodes/Plutio/Plutio.node.ts
+++ b/nodes/Plutio/Plutio.node.ts
@@ -997,7 +997,7 @@ export class Plutio implements INodeType {
 
 							body.contributors = contributor as [string];
 						}
-						responseData = await plutioApiRequest.call(this, 'PUT', '/projects', body);;
+						responseData = await plutioApiRequest.call(this, 'PUT', '/projects', body);
 					}
 					if ('move' === operation) {
 						const _id = this.getNodeParameter('_id', 0) as string;

From 48a12ba8cd06e0d409e6acbc901c1567e8a130ce Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 00:46:06 +0800
Subject: [PATCH 05/10] disable code for chykalophia specific operation

---
 nodes/Plutio/descriptions/ProjectDescription.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 5200aaa..8e29476 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -17,12 +17,12 @@ export const projectOperations: INodeProperties[] = [
 			},
 		},
 		options: [
-			{
-				name: 'Chykalophia',
-				value: 'getCklph',
-				description: 'Get projects by contributor\'s email for CKLPH',
-				action: 'Get a project',
-			},
+			// {
+			// 	name: 'Chykalophia',
+			// 	value: 'getCklph',
+			// 	description: 'Get projects by contributor\'s email for CKLPH',
+			// 	action: 'Get a project',
+			// },
 			{
 				name: 'Copy',
 				value: 'copy',

From c6ef0dd966d8bf2025d51115510c03195960c9a9 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 00:50:03 +0800
Subject: [PATCH 06/10] fixed merge marker error

---
 nodes/Plutio/descriptions/ProjectDescription.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 5200aaa..8e29476 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -17,12 +17,12 @@ export const projectOperations: INodeProperties[] = [
 			},
 		},
 		options: [
-			{
-				name: 'Chykalophia',
-				value: 'getCklph',
-				description: 'Get projects by contributor\'s email for CKLPH',
-				action: 'Get a project',
-			},
+			// {
+			// 	name: 'Chykalophia',
+			// 	value: 'getCklph',
+			// 	description: 'Get projects by contributor\'s email for CKLPH',
+			// 	action: 'Get a project',
+			// },
 			{
 				name: 'Copy',
 				value: 'copy',

From 30bf56d941a697facde7f9bddea6bdddd1f8c33b Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 00:55:06 +0800
Subject: [PATCH 07/10] merge conflict

---
 nodes/Plutio/descriptions/ProjectDescription.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 8e29476..5200aaa 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -17,12 +17,12 @@ export const projectOperations: INodeProperties[] = [
 			},
 		},
 		options: [
-			// {
-			// 	name: 'Chykalophia',
-			// 	value: 'getCklph',
-			// 	description: 'Get projects by contributor\'s email for CKLPH',
-			// 	action: 'Get a project',
-			// },
+			{
+				name: 'Chykalophia',
+				value: 'getCklph',
+				description: 'Get projects by contributor\'s email for CKLPH',
+				action: 'Get a project',
+			},
 			{
 				name: 'Copy',
 				value: 'copy',

From 99addde632903653bdc9bd401ee0a00f0a9f43ad Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 00:58:36 +0800
Subject: [PATCH 08/10] fixing merge conflict

---
 nodes/Plutio/descriptions/ProjectDescription.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 5200aaa..8e29476 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -17,12 +17,12 @@ export const projectOperations: INodeProperties[] = [
 			},
 		},
 		options: [
-			{
-				name: 'Chykalophia',
-				value: 'getCklph',
-				description: 'Get projects by contributor\'s email for CKLPH',
-				action: 'Get a project',
-			},
+			// {
+			// 	name: 'Chykalophia',
+			// 	value: 'getCklph',
+			// 	description: 'Get projects by contributor\'s email for CKLPH',
+			// 	action: 'Get a project',
+			// },
 			{
 				name: 'Copy',
 				value: 'copy',

From ee8c3f4a3e889b3065d09900ce7e92092a21bec3 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 01:16:24 +0800
Subject: [PATCH 09/10] remove all chykalophia specific operation

---
 nodes/Plutio/Plutio.node.ts                   | 20 -------------------
 .../Plutio/descriptions/ProjectDescription.ts |  8 +-------
 2 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/nodes/Plutio/Plutio.node.ts b/nodes/Plutio/Plutio.node.ts
index 1b0036e..4d82ad6 100644
--- a/nodes/Plutio/Plutio.node.ts
+++ b/nodes/Plutio/Plutio.node.ts
@@ -826,26 +826,6 @@ export class Plutio implements INodeType {
 					}
 				}
 				if ('project' === resource) {
-					if ('getCklph' === operation) {
-						const contributor = this.getNodeParameter('contributor', i) as IDataObject;
-
-						if (contributor) {
-							let contributorId;
-							const users = await plutioApiRequest.call(this, 'GET', '/people');
-							for (const user of users) {
-								if (user.contactEmails[0].address === contributor || contributor === user._id) {
-									contributorId = user._id;
-								}
-							}
-							qs.contributors = contributorId as string;
-						}
-						const project = await plutioApiRequest.call(this, 'GET', '/projects', {}, qs);
-						if (project.length === 1) {
-							responseData = project;
-						} else {
-							responseData = {'name': 'default'};
-						}
-					}
 					if ('get' === operation) {
 						const options = this.getNodeParameter('options', i) as IDataObject;
 
diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 8e29476..5852b01 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -17,12 +17,6 @@ export const projectOperations: INodeProperties[] = [
 			},
 		},
 		options: [
-			// {
-			// 	name: 'Chykalophia',
-			// 	value: 'getCklph',
-			// 	description: 'Get projects by contributor\'s email for CKLPH',
-			// 	action: 'Get a project',
-			// },
 			{
 				name: 'Copy',
 				value: 'copy',
@@ -60,7 +54,7 @@ export const projectOperations: INodeProperties[] = [
 				action: 'Update a project',
 			},
 		],
-		default: 'getCklph',
+		default: 'get',
 	},
 ];
 

From 6a17ab840b14727de2171c56a3bca2d0bcf104b2 Mon Sep 17 00:00:00 2001
From: joel <joel@chykalophia.com>
Date: Thu, 15 Sep 2022 01:19:37 +0800
Subject: [PATCH 10/10] removed chykalophia specific operations

---
 .../Plutio/descriptions/ProjectDescription.ts | 20 -------------------
 1 file changed, 20 deletions(-)

diff --git a/nodes/Plutio/descriptions/ProjectDescription.ts b/nodes/Plutio/descriptions/ProjectDescription.ts
index 5852b01..ef3c511 100644
--- a/nodes/Plutio/descriptions/ProjectDescription.ts
+++ b/nodes/Plutio/descriptions/ProjectDescription.ts
@@ -260,24 +260,4 @@ export const projectDescription: INodeProperties[] = [
 			},
 		],
 	},
-	{
-		displayName: 'Contributor\'s Email\, Name or ID',
-		name: 'contributor',
-		type: 'options',
-		description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
-		default: '',
-		typeOptions: {
-			loadOptionsMethod: 'getEmails',
-		},
-		displayOptions: {
-			show: {
-				resource: [
-					'project',
-				],
-				operation: [
-					'getCklph',
-				],
-			},
-		},
-	},
 ];