@aeriajs/server 0.0.156 → 0.0.159
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/routes.d.ts +6 -6
- package/package.json +8 -8
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/routes.d.ts
CHANGED
|
@@ -2,21 +2,21 @@ import type { RouteContext } from '@aeriajs/types';
|
|
|
2
2
|
export declare const registerRoutes: () => import("@aeriajs/http").ProxiedRouter<{
|
|
3
3
|
route: <const TContractWithRoles extends import("@aeriajs/types").ContractWithRoles, TCallback extends (TContractWithRoles extends {
|
|
4
4
|
response: infer Response;
|
|
5
|
-
} ? import("@aeriajs/types").InferProperties<Response> :
|
|
5
|
+
} ? import("@aeriajs/types").InferProperties<Response> : unknown) extends infer Response ? (context: Omit<RouteContext<import("@aeriajs/types").RoleFromAccessCondition<TContractWithRoles["roles"]>>, "request"> & {
|
|
6
6
|
request: Omit<import("@aeriajs/types").GenericRequest, "payload" | "query"> & {
|
|
7
7
|
payload: TContractWithRoles extends {
|
|
8
8
|
payload: infer Payload;
|
|
9
|
-
} ? import("@aeriajs/types").PackReferences<import("@aeriajs/types").InferProperties<Payload>> :
|
|
9
|
+
} ? import("@aeriajs/types").PackReferences<import("@aeriajs/types").InferProperties<Payload>> : Record<string, unknown>;
|
|
10
10
|
query: TContractWithRoles extends {
|
|
11
11
|
query: infer Query;
|
|
12
|
-
} ? import("@aeriajs/types").InferProperties<Query> :
|
|
12
|
+
} ? import("@aeriajs/types").InferProperties<Query> : Record<string, unknown>;
|
|
13
13
|
};
|
|
14
14
|
}) => Response : never>(method: import("@aeriajs/types").RequestMethod | import("@aeriajs/types").RequestMethod[], exp: import("@aeriajs/types").RouteUri, cb: TCallback, contract?: TContractWithRoles) => void;
|
|
15
15
|
routes: ((_: unknown, context: RouteContext, groupOptions?: import("@aeriajs/http").RouteGroupOptions) => ReturnType<typeof import("@aeriajs/http").registerRoute>)[];
|
|
16
16
|
routesMeta: import("@aeriajs/http").RoutesMeta;
|
|
17
17
|
group: <TRouter extends {
|
|
18
|
-
install: (context: RouteContext, options?: import("@aeriajs/http").RouterOptions) =>
|
|
18
|
+
install: (context: RouteContext, options?: import("@aeriajs/http").RouterOptions) => unknown;
|
|
19
19
|
routesMeta: import("@aeriajs/http").RoutesMeta;
|
|
20
|
-
}>(exp: import("@aeriajs/types").RouteUri, router: TRouter, middleware?: (context: RouteContext) =>
|
|
21
|
-
install: (_context: RouteContext, _options?: import("@aeriajs/http").RouterOptions) =>
|
|
20
|
+
}>(exp: import("@aeriajs/types").RouteUri, router: TRouter, middleware?: (context: RouteContext) => unknown) => void;
|
|
21
|
+
install: (_context: RouteContext, _options?: import("@aeriajs/http").RouterOptions) => Promise<{} | {} | null | undefined>;
|
|
22
22
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.159",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,13 +33,13 @@
|
|
|
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.
|
|
36
|
+
"@aeriajs/core": "^0.0.157",
|
|
37
|
+
"@aeriajs/builtins": "^0.0.157",
|
|
38
|
+
"@aeriajs/common": "^0.0.94",
|
|
39
|
+
"@aeriajs/entrypoint": "^0.0.96",
|
|
40
|
+
"@aeriajs/http": "^0.0.107",
|
|
41
|
+
"@aeriajs/node-http": "^0.0.107",
|
|
42
|
+
"@aeriajs/server": "^0.0.159",
|
|
43
43
|
"@aeriajs/types": "^0.0.80",
|
|
44
44
|
"mongodb": "^6.5.0"
|
|
45
45
|
},
|