@aeriajs/server 0.0.155 → 0.0.157
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/handler.js +9 -3
- package/dist/handler.mjs +9 -3
- package/dist/init.js +1 -1
- package/dist/init.mjs +1 -1
- package/package.json +9 -9
package/dist/handler.js
CHANGED
|
@@ -79,9 +79,15 @@ const regularVerb = (functionName) => async (parentContext) => {
|
|
|
79
79
|
const requestCopy = Object.assign({}, context.request);
|
|
80
80
|
if (id) {
|
|
81
81
|
requestCopy.payload.filters ??= {};
|
|
82
|
-
requestCopy.payload.filters.
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
if (requestCopy.payload.filters && typeof requestCopy.payload.filters === 'object') {
|
|
83
|
+
Object.assign(requestCopy.payload.filters, {
|
|
84
|
+
_id: id,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (requestCopy.payload.what && typeof requestCopy.payload.what === 'object') {
|
|
88
|
+
Object.assign(requestCopy.payload.what, {
|
|
89
|
+
_id: id,
|
|
90
|
+
});
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
93
|
const { error, result: fn } = await (0, core_1.getFunction)(collectionName, functionName, context.token, {
|
package/dist/handler.mjs
CHANGED
|
@@ -84,9 +84,15 @@ export const regularVerb = (functionName) => async (parentContext) => {
|
|
|
84
84
|
const requestCopy = Object.assign({}, context.request);
|
|
85
85
|
if (id) {
|
|
86
86
|
requestCopy.payload.filters ??= {};
|
|
87
|
-
requestCopy.payload.filters.
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (requestCopy.payload.filters && typeof requestCopy.payload.filters === "object") {
|
|
88
|
+
Object.assign(requestCopy.payload.filters, {
|
|
89
|
+
_id: id
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (requestCopy.payload.what && typeof requestCopy.payload.what === "object") {
|
|
93
|
+
Object.assign(requestCopy.payload.what, {
|
|
94
|
+
_id: id
|
|
95
|
+
});
|
|
90
96
|
}
|
|
91
97
|
}
|
|
92
98
|
const { error, result: fn } = await getFunction(
|
package/dist/init.js
CHANGED
|
@@ -23,7 +23,7 @@ const getToken = async (request, context) => {
|
|
|
23
23
|
}
|
|
24
24
|
try {
|
|
25
25
|
const decodedToken = await (0, core_1.decodeToken)(typeof request.headers.authorization === 'string'
|
|
26
|
-
? request.headers.authorization.split('Bearer ').
|
|
26
|
+
? request.headers.authorization.split('Bearer ').at(-1)
|
|
27
27
|
: '');
|
|
28
28
|
if (authenticationGuard(decodedToken)) {
|
|
29
29
|
if (typeof decodedToken.sub === 'string') {
|
package/dist/init.mjs
CHANGED
|
@@ -20,7 +20,7 @@ export const getToken = async (request, context) => {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
try {
|
|
23
|
-
const decodedToken = await decodeToken(typeof request.headers.authorization === "string" ? request.headers.authorization.split("Bearer ").
|
|
23
|
+
const decodedToken = await decodeToken(typeof request.headers.authorization === "string" ? request.headers.authorization.split("Bearer ").at(-1) : "");
|
|
24
24
|
if (authenticationGuard(decodedToken)) {
|
|
25
25
|
if (typeof decodedToken.sub === "string") {
|
|
26
26
|
decodedToken.sub = new ObjectId(decodedToken.sub);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.157",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"mongodb": "^6.5.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@aeriajs/core": "^0.0.
|
|
37
|
-
"@aeriajs/builtins": "^0.0.
|
|
38
|
-
"@aeriajs/common": "^0.0.
|
|
39
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
40
|
-
"@aeriajs/http": "^0.0.
|
|
41
|
-
"@aeriajs/node-http": "^0.0.
|
|
42
|
-
"@aeriajs/server": "^0.0.
|
|
43
|
-
"@aeriajs/types": "^0.0.
|
|
36
|
+
"@aeriajs/core": "^0.0.155",
|
|
37
|
+
"@aeriajs/builtins": "^0.0.155",
|
|
38
|
+
"@aeriajs/common": "^0.0.94",
|
|
39
|
+
"@aeriajs/entrypoint": "^0.0.96",
|
|
40
|
+
"@aeriajs/http": "^0.0.106",
|
|
41
|
+
"@aeriajs/node-http": "^0.0.106",
|
|
42
|
+
"@aeriajs/server": "^0.0.157",
|
|
43
|
+
"@aeriajs/types": "^0.0.80",
|
|
44
44
|
"mongodb": "^6.5.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|