powr-sdk-api 4.1.0 → 4.1.2
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/dist/routes/tools.js +6 -6
- package/package.json +67 -67
package/dist/routes/tools.js
CHANGED
|
@@ -157,7 +157,7 @@ router.post('/:toolId/configure', async (req, res) => {
|
|
|
157
157
|
const {
|
|
158
158
|
config
|
|
159
159
|
} = req.body;
|
|
160
|
-
const userId = (_req$user = req.user) === null || _req$user === void 0 ? void 0 : _req$user.
|
|
160
|
+
const userId = (_req$user = req.user) === null || _req$user === void 0 ? void 0 : _req$user.powrId; // From JWT token
|
|
161
161
|
|
|
162
162
|
if (!userId) {
|
|
163
163
|
return res.status(401).json({
|
|
@@ -197,7 +197,7 @@ router.post('/:toolId/execute', async (req, res) => {
|
|
|
197
197
|
actionId,
|
|
198
198
|
params
|
|
199
199
|
} = req.body;
|
|
200
|
-
const userId = (_req$user2 = req.user) === null || _req$user2 === void 0 ? void 0 : _req$user2.
|
|
200
|
+
const userId = (_req$user2 = req.user) === null || _req$user2 === void 0 ? void 0 : _req$user2.powrId; // From JWT token
|
|
201
201
|
|
|
202
202
|
if (!userId) {
|
|
203
203
|
return res.status(401).json({
|
|
@@ -233,7 +233,7 @@ router.post('/:toolId/test', async (req, res) => {
|
|
|
233
233
|
const {
|
|
234
234
|
toolId
|
|
235
235
|
} = req.params;
|
|
236
|
-
const userId = (_req$user3 = req.user) === null || _req$user3 === void 0 ? void 0 : _req$user3.
|
|
236
|
+
const userId = (_req$user3 = req.user) === null || _req$user3 === void 0 ? void 0 : _req$user3.powrId; // From JWT token
|
|
237
237
|
|
|
238
238
|
if (!userId) {
|
|
239
239
|
return res.status(401).json({
|
|
@@ -260,7 +260,7 @@ router.post('/:toolId/test', async (req, res) => {
|
|
|
260
260
|
router.get('/user/configured', async (req, res) => {
|
|
261
261
|
try {
|
|
262
262
|
var _req$user4;
|
|
263
|
-
const userId = (_req$user4 = req.user) === null || _req$user4 === void 0 ? void 0 : _req$user4.
|
|
263
|
+
const userId = (_req$user4 = req.user) === null || _req$user4 === void 0 ? void 0 : _req$user4.powrId; // From JWT token
|
|
264
264
|
|
|
265
265
|
if (!userId) {
|
|
266
266
|
return res.status(401).json({
|
|
@@ -310,7 +310,7 @@ router.post('/user/:toolId/toggle', async (req, res) => {
|
|
|
310
310
|
const {
|
|
311
311
|
enabled
|
|
312
312
|
} = req.body;
|
|
313
|
-
const userId = (_req$user5 = req.user) === null || _req$user5 === void 0 ? void 0 : _req$user5.
|
|
313
|
+
const userId = (_req$user5 = req.user) === null || _req$user5 === void 0 ? void 0 : _req$user5.powrId; // From JWT token
|
|
314
314
|
|
|
315
315
|
if (!userId) {
|
|
316
316
|
return res.status(401).json({
|
|
@@ -346,7 +346,7 @@ router.get('/user/:toolId/history', async (req, res) => {
|
|
|
346
346
|
const {
|
|
347
347
|
toolId
|
|
348
348
|
} = req.params;
|
|
349
|
-
const userId = (_req$user6 = req.user) === null || _req$user6 === void 0 ? void 0 : _req$user6.
|
|
349
|
+
const userId = (_req$user6 = req.user) === null || _req$user6 === void 0 ? void 0 : _req$user6.powrId; // From JWT token
|
|
350
350
|
|
|
351
351
|
if (!userId) {
|
|
352
352
|
return res.status(401).json({
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "powr-sdk-api",
|
|
3
|
-
"version": "4.1.
|
|
4
|
-
"description": "Shared API core library for PowrStack projects",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"README.md"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"test": "jest --passWithNoTests",
|
|
13
|
-
"lint": "eslint .",
|
|
14
|
-
"build": "babel src -d dist",
|
|
15
|
-
"prepare": "npm run build",
|
|
16
|
-
"prepublishOnly": "npm run test"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"api",
|
|
20
|
-
"express",
|
|
21
|
-
"middleware",
|
|
22
|
-
"error-handling",
|
|
23
|
-
"response-formatting",
|
|
24
|
-
"logging",
|
|
25
|
-
"swagger",
|
|
26
|
-
"documentation"
|
|
27
|
-
],
|
|
28
|
-
"author": "Lawazia Tech",
|
|
29
|
-
"license": "ISC",
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/powrstack/powr-sdk-api.git"
|
|
33
|
-
},
|
|
34
|
-
"bugs": {
|
|
35
|
-
"url": "https://github.com/powrstack/powr-sdk-api/issues"
|
|
36
|
-
},
|
|
37
|
-
"homepage": "https://github.com/powrstack/powr-sdk-api#readme",
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@aws-sdk/client-s3": "^3.787.0",
|
|
40
|
-
"@google-cloud/storage": "^7.16.0",
|
|
41
|
-
"express": "^4.18.2",
|
|
42
|
-
"jsonwebtoken": "^9.0.2",
|
|
43
|
-
"swagger-jsdoc": "^6.2.8",
|
|
44
|
-
"swagger-ui-express": "^5.0.0",
|
|
45
|
-
"winston": "^3.17.0",
|
|
46
|
-
"mongodb": "^6.3.0",
|
|
47
|
-
"multer": "^1.4.5-lts.1",
|
|
48
|
-
"bcrypt": "^5.1.1"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@babel/cli": "^7.23.9",
|
|
52
|
-
"@babel/core": "^7.24.0",
|
|
53
|
-
"@babel/preset-env": "^7.24.0",
|
|
54
|
-
"@types/express": "^4.17.21",
|
|
55
|
-
"@types/swagger-jsdoc": "^6.0.4",
|
|
56
|
-
"@types/swagger-ui-express": "^4.1.6",
|
|
57
|
-
"eslint": "^8.57.0",
|
|
58
|
-
"jest": "^29.7.0",
|
|
59
|
-
"typescript": "^5.3.3"
|
|
60
|
-
},
|
|
61
|
-
"peerDependencies": {
|
|
62
|
-
"express": "^4.18.2"
|
|
63
|
-
},
|
|
64
|
-
"engines": {
|
|
65
|
-
"node": ">=14.0.0"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "powr-sdk-api",
|
|
3
|
+
"version": "4.1.2",
|
|
4
|
+
"description": "Shared API core library for PowrStack projects",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "jest --passWithNoTests",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"build": "babel src -d dist",
|
|
15
|
+
"prepare": "npm run build",
|
|
16
|
+
"prepublishOnly": "npm run test"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"api",
|
|
20
|
+
"express",
|
|
21
|
+
"middleware",
|
|
22
|
+
"error-handling",
|
|
23
|
+
"response-formatting",
|
|
24
|
+
"logging",
|
|
25
|
+
"swagger",
|
|
26
|
+
"documentation"
|
|
27
|
+
],
|
|
28
|
+
"author": "Lawazia Tech",
|
|
29
|
+
"license": "ISC",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/powrstack/powr-sdk-api.git"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/powrstack/powr-sdk-api/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/powrstack/powr-sdk-api#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@aws-sdk/client-s3": "^3.787.0",
|
|
40
|
+
"@google-cloud/storage": "^7.16.0",
|
|
41
|
+
"express": "^4.18.2",
|
|
42
|
+
"jsonwebtoken": "^9.0.2",
|
|
43
|
+
"swagger-jsdoc": "^6.2.8",
|
|
44
|
+
"swagger-ui-express": "^5.0.0",
|
|
45
|
+
"winston": "^3.17.0",
|
|
46
|
+
"mongodb": "^6.3.0",
|
|
47
|
+
"multer": "^1.4.5-lts.1",
|
|
48
|
+
"bcrypt": "^5.1.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@babel/cli": "^7.23.9",
|
|
52
|
+
"@babel/core": "^7.24.0",
|
|
53
|
+
"@babel/preset-env": "^7.24.0",
|
|
54
|
+
"@types/express": "^4.17.21",
|
|
55
|
+
"@types/swagger-jsdoc": "^6.0.4",
|
|
56
|
+
"@types/swagger-ui-express": "^4.1.6",
|
|
57
|
+
"eslint": "^8.57.0",
|
|
58
|
+
"jest": "^29.7.0",
|
|
59
|
+
"typescript": "^5.3.3"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"express": "^4.18.2"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=14.0.0"
|
|
66
|
+
}
|
|
67
|
+
}
|