powr-sdk-api 3.2.0 → 3.2.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/feeds.js +12 -6
- package/package.json +67 -67
package/dist/routes/feeds.js
CHANGED
|
@@ -20,7 +20,7 @@ router.post('/', async (req, res) => {
|
|
|
20
20
|
mentions
|
|
21
21
|
} = req.body;
|
|
22
22
|
const projectId = req.projectId;
|
|
23
|
-
const userId = req.user.
|
|
23
|
+
const userId = req.user.powrId;
|
|
24
24
|
if (!content && (!media || media.length === 0)) {
|
|
25
25
|
return res.status(400).json({
|
|
26
26
|
success: false,
|
|
@@ -128,7 +128,10 @@ router.get('/', async (req, res) => {
|
|
|
128
128
|
as: 'author'
|
|
129
129
|
}
|
|
130
130
|
}, {
|
|
131
|
-
$unwind:
|
|
131
|
+
$unwind: {
|
|
132
|
+
path: '$author',
|
|
133
|
+
preserveNullAndEmptyArrays: true
|
|
134
|
+
}
|
|
132
135
|
}, {
|
|
133
136
|
$project: {
|
|
134
137
|
'author.password': 0,
|
|
@@ -176,7 +179,10 @@ router.get('/:id', async (req, res) => {
|
|
|
176
179
|
as: 'author'
|
|
177
180
|
}
|
|
178
181
|
}, {
|
|
179
|
-
$unwind:
|
|
182
|
+
$unwind: {
|
|
183
|
+
path: '$author',
|
|
184
|
+
preserveNullAndEmptyArrays: true
|
|
185
|
+
}
|
|
180
186
|
}, {
|
|
181
187
|
$project: {
|
|
182
188
|
'author.password': 0,
|
|
@@ -216,7 +222,7 @@ router.put('/:id', async (req, res) => {
|
|
|
216
222
|
mentions
|
|
217
223
|
} = req.body;
|
|
218
224
|
const projectId = req.projectId;
|
|
219
|
-
const userId = req.user.
|
|
225
|
+
const userId = req.user.powrId;
|
|
220
226
|
const db = await getDb();
|
|
221
227
|
const post = await db.collection('feeds').findOne({
|
|
222
228
|
_id: new ObjectId(id),
|
|
@@ -262,7 +268,7 @@ router.delete('/:id', async (req, res) => {
|
|
|
262
268
|
id
|
|
263
269
|
} = req.params;
|
|
264
270
|
const projectId = req.projectId;
|
|
265
|
-
const userId = req.user.
|
|
271
|
+
const userId = req.user.powrId;
|
|
266
272
|
const db = await getDb();
|
|
267
273
|
const post = await db.collection('feeds').findOne({
|
|
268
274
|
_id: new ObjectId(id),
|
|
@@ -301,7 +307,7 @@ router.post('/:id/like', async (req, res) => {
|
|
|
301
307
|
liked
|
|
302
308
|
} = req.body;
|
|
303
309
|
const projectId = req.projectId;
|
|
304
|
-
const userId = req.user.
|
|
310
|
+
const userId = req.user.powrId;
|
|
305
311
|
const db = await getDb();
|
|
306
312
|
|
|
307
313
|
// Update like count
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "powr-sdk-api",
|
|
3
|
-
"version": "3.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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "powr-sdk-api",
|
|
3
|
+
"version": "3.2.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
|
+
}
|