@stepzen/graphiql-proxy 0.44.0 → 0.45.0-beta.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/package.json +18 -12
- package/src/server/api/debugging.js +1 -1
- package/src/server/api/details.js +1 -1
- package/src/server/api/ping.js +1 -1
- package/src/server/api/predicates.js +1 -1
- package/src/server/api/proxy.js +5 -4
- package/src/server/api/samples.js +3 -3
- package/src/server/index.js +24 -15
- package/src/server/utils/open-browser.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stepzen/graphiql-proxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0-beta.1",
|
|
4
4
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://stepzen.com",
|
|
@@ -9,26 +9,27 @@
|
|
|
9
9
|
"/src/ui/build"
|
|
10
10
|
],
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
13
|
-
"npm": ">=6.14"
|
|
12
|
+
"node": ">=18.0"
|
|
14
13
|
},
|
|
15
|
-
"
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "src/server/index.js",
|
|
16
16
|
"scripts": {
|
|
17
17
|
"dev:server": "nodemon src/dev --watch src/dev --watch src/server",
|
|
18
18
|
"dev:ui": "cd src/ui && REACT_APP_IS_DEVELOPMENT=1 npm start",
|
|
19
19
|
"prepare": "cd src/ui && npm install --legacy-peer-deps",
|
|
20
20
|
"build": "cd src/ui && npm run build",
|
|
21
21
|
"start": "concurrently \"npm run dev:server\" \"npm run dev:ui\"",
|
|
22
|
-
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
22
|
+
"test": "cross-env TS_NODE_PROJECT='test/tsconfig.json' nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
23
23
|
"posttest": "prettier . --check"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@stepzen/fetch": "0.
|
|
26
|
+
"@stepzen/fetch": "0.45.0-beta.1",
|
|
27
27
|
"chalk": "^4.1.2",
|
|
28
|
-
"cross-spawn": "^7.0.
|
|
28
|
+
"cross-spawn": "^7.0.6",
|
|
29
29
|
"debug": "^4.3.4",
|
|
30
30
|
"express": "^4.21.1",
|
|
31
31
|
"express-promise-router": "^4.1.1",
|
|
32
|
+
"helmet": "^8.0.0",
|
|
32
33
|
"open": "^8.4.0",
|
|
33
34
|
"prettier": "^2.8.3"
|
|
34
35
|
},
|
|
@@ -39,21 +40,26 @@
|
|
|
39
40
|
"@types/express": "^4.17.9",
|
|
40
41
|
"@types/glob": "^7.2.0",
|
|
41
42
|
"@types/license-checker": "^25.0.1",
|
|
42
|
-
"@types/mocha": "^10.0.
|
|
43
|
-
"@types/node": "^14.18.36",
|
|
43
|
+
"@types/mocha": "^10.0.9",
|
|
44
44
|
"@types/sinon-chai": "3.2.8",
|
|
45
45
|
"chai": "^4.3.10",
|
|
46
46
|
"concurrently": "^6.0.2",
|
|
47
|
+
"cross-env": "^7.0.3",
|
|
47
48
|
"dotenv": "^16.0.3",
|
|
48
49
|
"fancy-test": "^1.4.10",
|
|
49
50
|
"license-checker": "^25.0.1",
|
|
50
|
-
"mocha": "^10.2
|
|
51
|
+
"mocha": "^10.8.2",
|
|
51
52
|
"nock": "^13.0.4",
|
|
52
53
|
"nodemon": "^2.0.22",
|
|
53
54
|
"nyc": "^15.1.0",
|
|
54
55
|
"sinon": "13.0.1",
|
|
55
56
|
"sinon-chai": "3.7.0",
|
|
56
|
-
"ts-node": "^10.
|
|
57
|
+
"ts-node": "^10.9.2",
|
|
58
|
+
"typescript": ">=5 <5.4"
|
|
57
59
|
},
|
|
58
|
-
"
|
|
60
|
+
"overrides": {
|
|
61
|
+
"--comment--": "workaround for CVE-2024-21538",
|
|
62
|
+
"cross-spawn": "^7.0.6"
|
|
63
|
+
},
|
|
64
|
+
"gitHead": "bb5012d7d656fb6788e99694f8de7d753f2752e9"
|
|
59
65
|
}
|
package/src/server/api/ping.js
CHANGED
package/src/server/api/proxy.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// Copyright IBM Corp. 2020, 2024
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import debug from 'debug'
|
|
4
|
+
import fetch from '@stepzen/fetch'
|
|
5
|
+
import {createRequire} from 'node:module'
|
|
5
6
|
|
|
6
|
-
const {version} =
|
|
7
|
+
const {version} = createRequire(import.meta.url)('../../../package.json')
|
|
7
8
|
|
|
8
9
|
const proxy = async (req, res) => {
|
|
9
10
|
const {adminkey, debugging, zenservUrl, predicates, workspace} = req.stepzen
|
|
@@ -43,4 +44,4 @@ const proxy = async (req, res) => {
|
|
|
43
44
|
res.json(json)
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
export default proxy
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright IBM Corp. 2020, 2024
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import fs from 'node:fs'
|
|
4
|
+
import prettier from 'prettier'
|
|
5
5
|
|
|
6
6
|
const samples = async (req, res) => {
|
|
7
7
|
const {workspace} = req.stepzen
|
|
@@ -23,4 +23,4 @@ const samples = async (req, res) => {
|
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
export default samples
|
package/src/server/index.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
// Copyright IBM Corp. 2020, 2024
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
import debug from 'debug'
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import fs from 'node:fs'
|
|
6
|
+
import PromiseRouter from 'express-promise-router'
|
|
7
|
+
import path from 'node:path'
|
|
8
|
+
import {fileURLToPath} from 'node:url'
|
|
9
|
+
|
|
10
|
+
import openBrowser from './utils/open-browser.js'
|
|
11
|
+
|
|
12
|
+
import _debugging from './api/debugging.js'
|
|
13
|
+
import details from './api/details.js'
|
|
14
|
+
import ping from './api/ping.js'
|
|
15
|
+
import _predicates from './api/predicates.js'
|
|
16
|
+
import proxy from './api/proxy.js'
|
|
17
|
+
import samples from './api/samples.js'
|
|
18
|
+
import helmet from 'helmet'
|
|
19
|
+
|
|
20
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
21
|
+
|
|
22
|
+
export default async function (options) {
|
|
18
23
|
const {
|
|
19
24
|
/** @deprecated use zenservUrl */
|
|
20
25
|
account,
|
|
@@ -52,6 +57,8 @@ module.exports = async options => {
|
|
|
52
57
|
|
|
53
58
|
app.use(express.json())
|
|
54
59
|
|
|
60
|
+
app.use(helmet.frameguard())
|
|
61
|
+
|
|
55
62
|
app.use(express.static(`${__dirname}/../ui/build`))
|
|
56
63
|
app.use((req, res, next) => {
|
|
57
64
|
req.stepzen = {
|
|
@@ -67,6 +74,8 @@ module.exports = async options => {
|
|
|
67
74
|
next()
|
|
68
75
|
})
|
|
69
76
|
|
|
77
|
+
const router = PromiseRouter()
|
|
78
|
+
|
|
70
79
|
router.all('/api/predicates', _predicates)
|
|
71
80
|
router.all('/api/debugging', _debugging)
|
|
72
81
|
router.get('/api/details', details)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Copyright IBM Corp. 2020, 2024
|
|
2
2
|
// Original code from https://github.com/facebook/create-react-app/blob/0f6fc2bc71d78f0dcae67f3f08ce98a42fc0a57c/packages/react-dev-utils/openChrome.applescript
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import chalk from 'chalk'
|
|
5
|
+
import {execSync} from 'node:child_process'
|
|
6
|
+
import open from 'open'
|
|
7
|
+
import spawn from 'cross-spawn'
|
|
8
8
|
|
|
9
9
|
// https://github.com/sindresorhus/open#app
|
|
10
10
|
const OSX_CHROME = 'google chrome'
|
|
@@ -141,4 +141,4 @@ function openBrowser(url) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
export default openBrowser
|