From 410ea9a2ef2e14b5e8e4493e5db66cfc2290d8f6 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 13 Dec 2024 20:45:08 +0000 Subject: [PATCH] feat(Linear Trigger Node): Add support for admin scope (#12211) --- .../credentials/LinearOAuth2Api.credentials.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/credentials/LinearOAuth2Api.credentials.ts b/packages/nodes-base/credentials/LinearOAuth2Api.credentials.ts index b1e22ddfd9..1f1ba72467 100644 --- a/packages/nodes-base/credentials/LinearOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/LinearOAuth2Api.credentials.ts @@ -1,7 +1,5 @@ import type { ICredentialType, INodeProperties } from 'n8n-workflow'; -const scopes = ['read', 'write', 'issues:create', 'comments:create']; - export class LinearOAuth2Api implements ICredentialType { name = 'linearOAuth2Api'; @@ -50,11 +48,19 @@ export class LinearOAuth2Api implements ICredentialType { ], default: 'user', }, + { + displayName: 'Include Admin Scope', + name: 'includeAdminScope', + type: 'boolean', + default: false, + description: 'Grants the "Admin" scope, Needed to create webhooks', + }, { displayName: 'Scope', name: 'scope', type: 'hidden', - default: scopes.join(' '), + default: + '={{$self["includeAdminScope"] ? "read write issues:create comments:create admin" : "read write issues:create comments:create"}}', required: true, }, {