remult 0.27.2-next.0 → 0.27.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/package.json
CHANGED
|
@@ -590,6 +590,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
590
590
|
switch (_a.label) {
|
|
591
591
|
case 0:
|
|
592
592
|
if (!req) return [3 /*break*/, 8];
|
|
593
|
+
;
|
|
593
594
|
remult.context.request = req;
|
|
594
595
|
remult_static_js_1.remultStatic.asyncContext.setInInitRequest(true);
|
|
595
596
|
_a.label = 1;
|
package/src/context.d.ts
CHANGED
|
@@ -85,22 +85,17 @@ export declare class Remult {
|
|
|
85
85
|
export type GetArguments<T> = T extends (...args: infer FirstArgument) => any ? FirstArgument : never;
|
|
86
86
|
/**
|
|
87
87
|
* This type represents the context object available through `remult.context`
|
|
88
|
-
*
|
|
88
|
+
* If its used within the request lifecycle it's `request` member will be set automatically.
|
|
89
|
+
* To type it correctly, you can extend it with your own properties.
|
|
89
90
|
* @example
|
|
90
|
-
*
|
|
91
|
-
|
|
91
|
+
* import type express from 'express'
|
|
92
|
+
* declare module 'remult' {
|
|
93
|
+
* export interface RemultContext {
|
|
94
|
+
* request?: express.Request
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
97
|
+
* */
|
|
92
98
|
export interface RemultContext {
|
|
93
|
-
/** When running on the backend as part of a request, will have the request object.
|
|
94
|
-
* You can type it to your specific type
|
|
95
|
-
* @example
|
|
96
|
-
* import type express from 'express'
|
|
97
|
-
* declare module 'remult' {
|
|
98
|
-
* export interface RemultContext {
|
|
99
|
-
* request?: express.Request
|
|
100
|
-
* }
|
|
101
|
-
* }
|
|
102
|
-
* */
|
|
103
|
-
request?: unknown;
|
|
104
99
|
}
|
|
105
100
|
/**
|
|
106
101
|
* Interface for configuring the API client used by Remult to perform HTTP calls to the backend.
|