Skip to content

Commit b7a302a

Browse files
authored
Merge pull request #181 from stephenyeargin/feature/ship-typings
Feature/ship typings
2 parents c932fe4 + 5ccf881 commit b7a302a

7 files changed

Lines changed: 898 additions & 746 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"vscode": {
2424
"extensions": [
2525
"esbenp.prettier-vscode",
26-
"GitHub.copilot"
26+
"GitHub.copilot",
27+
"streetsidesoftware.code-spell-checker"
2728
]
2829
}
2930
}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ coverage.json
4242

4343
# Node versions (nodenv)
4444
.node-version
45-
.vscode/settings.json
4645

4746
# npm pack result
4847
*.tgz

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"cSpell.words": [
3+
"autofitpanels",
4+
"datasource",
5+
"gnet",
6+
"linewidth",
7+
"pointradius",
8+
"sparkline",
9+
"stephenyeargin",
10+
"templating",
11+
"xaxis",
12+
"yaxes",
13+
"yaxis",
14+
"Yeargin"
15+
]
16+
}

package-lock.json

Lines changed: 860 additions & 725 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hubot-grafana",
33
"description": "Query Grafana dashboards",
4-
"version": "6.0.0",
4+
"version": "6.0.1",
55
"author": "Stephen Yeargin <stephen@yearg.in>",
66
"license": "MIT",
77
"keywords": [
@@ -18,31 +18,31 @@
1818
"url": "https://github.com/stephenyeargin/hubot-grafana/issues"
1919
},
2020
"dependencies": {
21-
"@aws-sdk/client-s3": "^3.378.0",
22-
"node-fetch": "^2.6.12"
21+
"@aws-sdk/client-s3": "^3.565.0",
22+
"node-fetch": "^2.7.0"
2323
},
2424
"peerDependencies": {
2525
"hubot": ">=3 || 0.0.0-development"
2626
},
2727
"devDependencies": {
28-
"@types/hubot": "^3.3.2",
29-
"chai": "^4.3.7",
28+
"@types/hubot": "^3.3.7",
29+
"chai": "^4.4.1",
3030
"eslint": "^8.45.0",
3131
"eslint-config-airbnb-base": "^15.0.0",
3232
"eslint-plugin-import": "^2.27.5",
3333
"hubot": "^7.0.0",
3434
"hubot-mock-adapter": "^2.0.0",
35-
"husky": "^8.0.3",
36-
"mocha": "^10.2.0",
37-
"nock": "^13.3.2",
35+
"husky": "^9.0.11",
36+
"mocha": "^10.4.0",
37+
"nock": "^13.5.4",
3838
"nyc": "^15.1.0"
3939
},
4040
"main": "index.js",
4141
"scripts": {
42-
"test": "mocha \"test/**/*.js\" --reporter spec --no-experiemental-fetch --timeout 200",
42+
"test": "mocha \"test/**/*.js\" --reporter spec --no-experimental-fetch --timeout 200",
4343
"test-with-coverage": "nyc --reporter=text mocha \"test/**/*.js\" --reporter spec",
4444
"bootstrap": "script/bootstrap",
45-
"prepare": "husky install",
45+
"prepare": "husky",
4646
"lint": "eslint src/ test/"
4747
},
4848
"files": [
@@ -54,5 +54,6 @@
5454
],
5555
"volta": {
5656
"node": "18.19.0"
57-
}
57+
},
58+
"types": "types.d.ts"
5859
}

src/grafana-client.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ class GrafanaClient {
121121
});
122122
}
123123

124-
createGrafanaChartLink(query, uid, panel, timespan, variables) {
124+
createGrafanaChartLink(query, uid, panel, timeSpan, variables) {
125125
const url = new URL(`${this.host}/d/${uid}/`);
126126

127127
if (panel) {
128128
url.searchParams.set('panelId', panel.id);
129129
url.searchParams.set('fullscreen', '');
130130
}
131131

132-
url.searchParams.set('from', timespan.from);
133-
url.searchParams.set('to', timespan.to);
132+
url.searchParams.set('from', timeSpan.from);
133+
url.searchParams.set('to', timeSpan.to);
134134

135135
if (variables) {
136136
const additionalParams = new URLSearchParams(variables);
@@ -150,7 +150,7 @@ class GrafanaClient {
150150
return url.toString().replace('fullscreen=&', 'fullscreen&');
151151
}
152152

153-
createImageUrl(query, uid, panel, timespan, variables) {
153+
createImageUrl(query, uid, panel, timeSpan, variables) {
154154
const url = new URL(`${this.host}/render/${query.apiEndpoint}/${uid}/`);
155155

156156
if (panel) {
@@ -162,8 +162,8 @@ class GrafanaClient {
162162

163163
url.searchParams.set('width', query.width);
164164
url.searchParams.set('height', query.height);
165-
url.searchParams.set('from', timespan.from);
166-
url.searchParams.set('to', timespan.to);
165+
url.searchParams.set('from', timeSpan.from);
166+
url.searchParams.set('to', timeSpan.to);
167167

168168
if (variables) {
169169
const additionalParams = new URLSearchParams(variables);

types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
type DashboardChart = {
22
imageUrl: string;
3-
grafanaChartLink: grafanaChartLink;
3+
grafanaChartLink: string;
44
title: string;
55
};
66

7-
namespace GrafanaDashboardResponse {
7+
declare namespace GrafanaDashboardResponse {
88
type Response = {
99
meta: Meta;
1010
dashboard: Dashboard;

0 commit comments

Comments
 (0)