@grafana/sign-plugin 2.0.0 → 2.0.1

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v2.0.1 (Tue Oct 03 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Allows to sign behind an https proxy [#436](https://github.com/grafana/plugin-tools/pull/436) ([@academo](https://github.com/academo))
6
+
7
+ #### Authors: 1
8
+
9
+ - Esteban Beltran ([@academo](https://github.com/academo))
10
+
11
+ ---
12
+
1
13
  # v2.0.0 (Mon Oct 02 2023)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -52,7 +52,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  exports.__esModule = true;
53
53
  exports.postData = void 0;
54
54
  var https_1 = __importDefault(require("https"));
55
+ var proxy_agent_1 = require("proxy-agent");
55
56
  var url_1 = require("url");
57
+ var agent = new proxy_agent_1.ProxyAgent();
56
58
  function postData(urlString, data, headers) {
57
59
  return __awaiter(this, void 0, void 0, function () {
58
60
  return __generator(this, function (_a) {
@@ -64,7 +66,8 @@ function postData(urlString, data, headers) {
64
66
  port: url.port || 443,
65
67
  path: url.pathname,
66
68
  method: 'POST',
67
- headers: __assign(__assign({}, headers), { 'Content-Type': 'application/json' })
69
+ headers: __assign(__assign({}, headers), { 'Content-Type': 'application/json' }),
70
+ agent: agent
68
71
  };
69
72
  var req = https_1["default"].request(options, function (res) {
70
73
  var chunks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/sign-plugin",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/sign-plugin",
@@ -23,7 +23,8 @@
23
23
  "typecheck": "tsc --noEmit"
24
24
  },
25
25
  "dependencies": {
26
- "minimist": "^1.2.2"
26
+ "minimist": "^1.2.2",
27
+ "proxy-agent": "6.3.1"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@types/minimist": "^1.2.2"
@@ -40,5 +41,5 @@
40
41
  "engines": {
41
42
  "node": ">=18"
42
43
  },
43
- "gitHead": "d61bc5effe7e3c9bd444ebe05c6840c48f15ecef"
44
+ "gitHead": "4678d6897236b3ce3aa15f354ae12f8783244e10"
44
45
  }
@@ -1,4 +1,6 @@
1
1
  import https, { RequestOptions } from 'https';
2
+ import { ProxyAgent } from 'proxy-agent';
3
+
2
4
  import { URL } from 'url';
3
5
 
4
6
  interface Headers {
@@ -11,6 +13,8 @@ interface Response<R> {
11
13
  status: number;
12
14
  }
13
15
 
16
+ const agent = new ProxyAgent();
17
+
14
18
  export async function postData(urlString: string, data: unknown, headers: Headers): Promise<Response<string>> {
15
19
  return new Promise<Response<string>>((resolve, reject) => {
16
20
  const url = new URL(urlString);
@@ -25,6 +29,7 @@ export async function postData(urlString: string, data: unknown, headers: Header
25
29
  ...headers,
26
30
  'Content-Type': 'application/json',
27
31
  },
32
+ agent,
28
33
  };
29
34
 
30
35
  const req = https.request(options, (res) => {