n8n-nodes-github-copilot 3.31.4 → 3.31.6

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.
@@ -34,8 +34,7 @@ class GitHubCopilotAuthHelper {
34
34
  displayName: "🎯 Como Usar",
35
35
  name: "instructions",
36
36
  type: "notice",
37
- default: "",
38
- description: `
37
+ default: `
39
38
  <div style="background: #e8f5e8; padding: 20px; border-left: 4px solid #4CAF50; border-radius: 4px;">
40
39
  <h3 style="margin-top: 0; color: #2E7D32;">✨ Autenticação Visual - Sem Terminal!</h3>
41
40
 
@@ -104,12 +103,10 @@ class GitHubCopilotAuthHelper {
104
103
  }),
105
104
  });
106
105
  const data = await response.json();
106
+ res.setHeader("Content-Type", "application/json");
107
+ res.status(200).json(data);
107
108
  return {
108
- webhookResponse: {
109
- status: 200,
110
- headers: { "Content-Type": "application/json" },
111
- body: JSON.stringify(data),
112
- },
109
+ noWebhookResponse: true,
113
110
  };
114
111
  }
115
112
  if (action === "poll_token") {
@@ -127,23 +124,19 @@ class GitHubCopilotAuthHelper {
127
124
  }),
128
125
  });
129
126
  const data = await response.json();
127
+ res.setHeader("Content-Type", "application/json");
128
+ res.status(200).json(data);
130
129
  return {
131
- webhookResponse: {
132
- status: 200,
133
- headers: { "Content-Type": "application/json" },
134
- body: JSON.stringify(data),
135
- },
130
+ noWebhookResponse: true,
136
131
  };
137
132
  }
138
133
  throw new Error(`Unknown action: ${action}`);
139
134
  }
140
135
  catch (error) {
136
+ res.setHeader("Content-Type", "application/json");
137
+ res.status(500).json({ error: error.message });
141
138
  return {
142
- webhookResponse: {
143
- status: 500,
144
- headers: { "Content-Type": "application/json" },
145
- body: JSON.stringify({ error: error.message }),
146
- },
139
+ noWebhookResponse: true,
147
140
  };
148
141
  }
149
142
  }
@@ -474,8 +467,41 @@ function generateAuthPage(proxyUrl) {
474
467
  }
475
468
 
476
469
  function copyCode() {
477
- navigator.clipboard.writeText(userCode);
478
- const btn = document.getElementById("step2").querySelector(".btn");
470
+ // Try modern clipboard API first
471
+ if (navigator.clipboard && navigator.clipboard.writeText) {
472
+ navigator.clipboard.writeText(userCode).then(() => {
473
+ showCopySuccess("step2");
474
+ }).catch((err) => {
475
+ // Fallback to execCommand
476
+ fallbackCopyCode();
477
+ });
478
+ } else {
479
+ // Fallback for older browsers
480
+ fallbackCopyCode();
481
+ }
482
+ }
483
+
484
+ function fallbackCopyCode() {
485
+ // Create temporary textarea
486
+ const textarea = document.createElement("textarea");
487
+ textarea.value = userCode;
488
+ textarea.style.position = "fixed";
489
+ textarea.style.opacity = "0";
490
+ document.body.appendChild(textarea);
491
+ textarea.select();
492
+
493
+ try {
494
+ document.execCommand("copy");
495
+ showCopySuccess("step2");
496
+ } catch (err) {
497
+ alert("Erro ao copiar. Código: " + userCode);
498
+ } finally {
499
+ document.body.removeChild(textarea);
500
+ }
501
+ }
502
+
503
+ function showCopySuccess(stepId) {
504
+ const btn = document.getElementById(stepId).querySelector(".btn");
479
505
  const originalText = btn.innerHTML;
480
506
  btn.innerHTML = '<span>✅</span><span>Copiado!</span>';
481
507
  setTimeout(() => {
@@ -566,13 +592,37 @@ function generateAuthPage(proxyUrl) {
566
592
  }
567
593
 
568
594
  function copyToken() {
569
- navigator.clipboard.writeText(accessToken);
570
- const btn = document.getElementById("successSection").querySelector(".btn");
571
- const originalText = btn.innerHTML;
572
- btn.innerHTML = '<span>✅</span><span>Token Copiado!</span>';
573
- setTimeout(() => {
574
- btn.innerHTML = originalText;
575
- }, 2000);
595
+ // Try modern clipboard API first
596
+ if (navigator.clipboard && navigator.clipboard.writeText) {
597
+ navigator.clipboard.writeText(accessToken).then(() => {
598
+ showCopySuccess("successSection");
599
+ }).catch((err) => {
600
+ // Fallback to execCommand
601
+ fallbackCopyToken();
602
+ });
603
+ } else {
604
+ // Fallback for older browsers
605
+ fallbackCopyToken();
606
+ }
607
+ }
608
+
609
+ function fallbackCopyToken() {
610
+ // Create temporary textarea
611
+ const textarea = document.createElement("textarea");
612
+ textarea.value = accessToken;
613
+ textarea.style.position = "fixed";
614
+ textarea.style.opacity = "0";
615
+ document.body.appendChild(textarea);
616
+ textarea.select();
617
+
618
+ try {
619
+ document.execCommand("copy");
620
+ showCopySuccess("successSection");
621
+ } catch (err) {
622
+ alert("Erro ao copiar token. Por favor, selecione e copie manualmente.");
623
+ } finally {
624
+ document.body.removeChild(textarea);
625
+ }
576
626
  }
577
627
 
578
628
  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.4",
3
+ "version": "3.31.6",
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.4",
3
+ "version": "3.31.6",
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",