n8n-nodes-github-copilot 3.31.5 → 3.31.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,37 +31,34 @@ class GitHubCopilotAuthHelper {
31
31
  ],
32
32
  properties: [
33
33
  {
34
- displayName: "🎯 Como Usar",
35
- name: "instructions",
34
+ displayName: " Autenticação Visual - Sem Terminal!",
35
+ name: "notice1",
36
36
  type: "notice",
37
- default: "",
38
- description: `
39
- <div style="background: #e8f5e8; padding: 20px; border-left: 4px solid #4CAF50; border-radius: 4px;">
40
- <h3 style="margin-top: 0; color: #2E7D32;">✨ Autenticação Visual - Sem Terminal!</h3>
41
-
42
- <p><strong>1. Ative este workflow</strong></p>
43
- <p>Clique em "Active" no canto superior direito</p>
44
-
45
- <p><strong>2. Copie a URL do Webhook</strong></p>
46
- <p>Clique em "Copy URL" abaixo e envie para o usuário</p>
47
-
48
- <p><strong>3. Usuário acessa a URL no navegador</strong></p>
49
- <p>Uma página bonita vai abrir com instruções claras</p>
50
-
51
- <p><strong>4. Processo automático!</strong></p>
52
- <ul style="margin: 10px 0; padding-left: 20px;">
53
- <li>✅ Página solicita código do GitHub</li>
54
- <li>✅ Mostra código grande para copiar</li>
55
- <li>✅ Abre GitHub automaticamente</li>
56
- <li>✅ Aguarda autorização (polling automático)</li>
57
- <li>✅ Exibe token pronto para copiar</li>
58
- </ul>
59
-
60
- <p style="background: #fff3e0; padding: 10px; border-radius: 4px; margin-top: 15px;">
61
- <strong>💡 Sem CORS!</strong> O n8n faz as chamadas para o GitHub, não o navegador!
62
- </p>
63
- </div>
64
- `,
37
+ default: "Este node permite que usuários finais obtenham tokens GitHub Copilot sem usar terminal.",
38
+ },
39
+ {
40
+ displayName: "📋 Passo 1: Ativar Workflow",
41
+ name: "notice2",
42
+ type: "notice",
43
+ default: "Clique no botão 'Active' no canto superior direito para ativar o workflow. A Production URL só funciona com workflow ativo!",
44
+ },
45
+ {
46
+ displayName: "🔗 Passo 2: Copiar URL",
47
+ name: "notice3",
48
+ type: "notice",
49
+ default: "Copie a 'Production URL' que aparece abaixo (em Webhook URLs) e envie para o usuário final.",
50
+ },
51
+ {
52
+ displayName: "🌐 Passo 3: Usuário Acessa URL",
53
+ name: "notice4",
54
+ type: "notice",
55
+ default: "O usuário abre a URL no navegador e segue as instruções visuais: 1) Clica 'Começar', 2) Copia o código, 3) Autoriza no GitHub, 4) Copia o token gerado automaticamente.",
56
+ },
57
+ {
58
+ displayName: "💡 Sem CORS!",
59
+ name: "notice5",
60
+ type: "notice",
61
+ default: "O n8n faz proxy das requisições para GitHub API, então não problemas de CORS quando usuário acessa a página pelo navegador.",
65
62
  },
66
63
  {
67
64
  displayName: "Client ID",
@@ -468,8 +465,41 @@ function generateAuthPage(proxyUrl) {
468
465
  }
469
466
 
470
467
  function copyCode() {
471
- navigator.clipboard.writeText(userCode);
472
- const btn = document.getElementById("step2").querySelector(".btn");
468
+ // Try modern clipboard API first
469
+ if (navigator.clipboard && navigator.clipboard.writeText) {
470
+ navigator.clipboard.writeText(userCode).then(() => {
471
+ showCopySuccess("step2");
472
+ }).catch((err) => {
473
+ // Fallback to execCommand
474
+ fallbackCopyCode();
475
+ });
476
+ } else {
477
+ // Fallback for older browsers
478
+ fallbackCopyCode();
479
+ }
480
+ }
481
+
482
+ function fallbackCopyCode() {
483
+ // Create temporary textarea
484
+ const textarea = document.createElement("textarea");
485
+ textarea.value = userCode;
486
+ textarea.style.position = "fixed";
487
+ textarea.style.opacity = "0";
488
+ document.body.appendChild(textarea);
489
+ textarea.select();
490
+
491
+ try {
492
+ document.execCommand("copy");
493
+ showCopySuccess("step2");
494
+ } catch (err) {
495
+ alert("Erro ao copiar. Código: " + userCode);
496
+ } finally {
497
+ document.body.removeChild(textarea);
498
+ }
499
+ }
500
+
501
+ function showCopySuccess(stepId) {
502
+ const btn = document.getElementById(stepId).querySelector(".btn");
473
503
  const originalText = btn.innerHTML;
474
504
  btn.innerHTML = '<span>✅</span><span>Copiado!</span>';
475
505
  setTimeout(() => {
@@ -560,13 +590,37 @@ function generateAuthPage(proxyUrl) {
560
590
  }
561
591
 
562
592
  function copyToken() {
563
- navigator.clipboard.writeText(accessToken);
564
- const btn = document.getElementById("successSection").querySelector(".btn");
565
- const originalText = btn.innerHTML;
566
- btn.innerHTML = '<span>✅</span><span>Token Copiado!</span>';
567
- setTimeout(() => {
568
- btn.innerHTML = originalText;
569
- }, 2000);
593
+ // Try modern clipboard API first
594
+ if (navigator.clipboard && navigator.clipboard.writeText) {
595
+ navigator.clipboard.writeText(accessToken).then(() => {
596
+ showCopySuccess("successSection");
597
+ }).catch((err) => {
598
+ // Fallback to execCommand
599
+ fallbackCopyToken();
600
+ });
601
+ } else {
602
+ // Fallback for older browsers
603
+ fallbackCopyToken();
604
+ }
605
+ }
606
+
607
+ function fallbackCopyToken() {
608
+ // Create temporary textarea
609
+ const textarea = document.createElement("textarea");
610
+ textarea.value = accessToken;
611
+ textarea.style.position = "fixed";
612
+ textarea.style.opacity = "0";
613
+ document.body.appendChild(textarea);
614
+ textarea.select();
615
+
616
+ try {
617
+ document.execCommand("copy");
618
+ showCopySuccess("successSection");
619
+ } catch (err) {
620
+ alert("Erro ao copiar token. Por favor, selecione e copie manualmente.");
621
+ } finally {
622
+ document.body.removeChild(textarea);
623
+ }
570
624
  }
571
625
 
572
626
  function sleep(ms) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.31.5",
3
+ "version": "3.31.7",
4
4
  "description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.31.5",
3
+ "version": "3.31.7",
4
4
  "description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",