@m1cro/server-sdk 1.0.0-beta.12 → 1.0.0-beta.13
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/globals.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as node_stream from 'node:stream';
|
|
2
|
+
import { B as Bridge, L as LogLevel } from './log-DmWm50fd.js';
|
|
2
3
|
import * as console from 'node:console';
|
|
3
4
|
|
|
4
5
|
declare global {
|
|
@@ -6,4 +7,11 @@ declare global {
|
|
|
6
7
|
interface Console extends console.Console {
|
|
7
8
|
logLevel: LogLevel;
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* In this environment `Response.body` is a Node.js Readable stream
|
|
12
|
+
* rather than a WHATWG ReadableStream.
|
|
13
|
+
*/
|
|
14
|
+
interface Response {
|
|
15
|
+
readonly body: node_stream.Readable | null;
|
|
16
|
+
}
|
|
9
17
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { E as EntitySchema, G as GeneratedFields, C as CompiledSchema, F as Filter, a as FindQuery, H as HydratedDocument, b as FindOneQuery, I as InsertDocument, c as InsertQuery, d as InsertOneQuery, U as UpdateQuery, e as InferInterface, f as UpdateOneQuery, R as RemoveQuery, g as RemoveOneQuery, h as Router, i as HookEventMap, A as AppRole, j as EventHandler, J as JobHandler, k as JobOptions } from './log-
|
|
2
|
-
export { l as AppId, m as Artifacts, n as Auth, B as Bridge, o as Entity, p as InferSchema, L as LogLevel, M as Method, q as Middleware, N as Namespace, P as Provider, r as Providers, s as Request, t as RequestBuilder, u as RequestHandler, v as Response, w as ResponseBuilder, x as RouteOptions, S as Sorting, y as StatusCode, z as Subject, T as Tenant, V as Visibility, D as entitySchema } from './log-
|
|
1
|
+
import { E as EntitySchema, G as GeneratedFields, C as CompiledSchema, F as Filter, a as FindQuery, H as HydratedDocument, b as FindOneQuery, I as InsertDocument, c as InsertQuery, d as InsertOneQuery, U as UpdateQuery, e as InferInterface, f as UpdateOneQuery, R as RemoveQuery, g as RemoveOneQuery, h as Router, i as HookEventMap, A as AppRole, j as EventHandler, J as JobHandler, k as JobOptions } from './log-DmWm50fd.js';
|
|
2
|
+
export { l as AppId, m as Artifacts, n as Auth, B as Bridge, o as Entity, p as InferSchema, L as LogLevel, M as Method, q as Middleware, N as Namespace, P as Provider, r as Providers, s as Request, t as RequestBuilder, u as RequestHandler, v as Response, w as ResponseBuilder, x as RouteOptions, S as Sorting, y as StatusCode, z as Subject, T as Tenant, V as Visibility, D as entitySchema } from './log-DmWm50fd.js';
|
|
3
3
|
import util from 'node:util';
|
|
4
|
+
import 'node:stream';
|
|
4
5
|
|
|
5
6
|
declare function entityModel<S extends EntitySchema<any>>(name: string, schemaDef: S, options?: EntityModelOptions<S>): EntityModel<S>;
|
|
6
7
|
interface EntityModelRegistration {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as node_stream from 'node:stream';
|
|
2
|
+
|
|
1
3
|
type Filter = Record<string, unknown>;
|
|
2
4
|
type Sorting$1 = Record<string, 'asc' | 'desc'>;
|
|
3
5
|
type GeneratedFields = {
|
|
@@ -179,7 +181,7 @@ interface HookEventMap {
|
|
|
179
181
|
install: [];
|
|
180
182
|
}
|
|
181
183
|
|
|
182
|
-
type EventHandler = <T>(event: string, data
|
|
184
|
+
type EventHandler = (<T>(event: string, data: T) => void | Promise<void>) | ((event: string) => void | Promise<void>);
|
|
183
185
|
interface EventEmitter {
|
|
184
186
|
publish<T extends object = Record<string, any>>(event: string, payload?: T, visibility?: Visibility[]): Promise<void>;
|
|
185
187
|
}
|
|
@@ -285,6 +287,8 @@ interface Request {
|
|
|
285
287
|
get url(): URL;
|
|
286
288
|
get params(): Record<string, string>;
|
|
287
289
|
get headers(): Headers;
|
|
290
|
+
/** Node.js Readable stream for the request body. */
|
|
291
|
+
get bodyStream(): node_stream.Readable;
|
|
288
292
|
cookie(name: string): string | undefined;
|
|
289
293
|
payload<T = any>(): Promise<T>;
|
|
290
294
|
payload<T = any>(type: 'json' | 'cbor'): Promise<T>;
|
|
@@ -315,6 +319,8 @@ interface ResponseBuilder {
|
|
|
315
319
|
headers(headers: HeadersInit): this;
|
|
316
320
|
cookie(name: string, cookie?: SetCookie): this;
|
|
317
321
|
payload<T = unknown>(payload: T, type?: PayloadType): this;
|
|
322
|
+
/** Stream a Node.js Readable as the response body. */
|
|
323
|
+
stream(readable: node_stream.Readable): this;
|
|
318
324
|
}
|
|
319
325
|
interface SetCookie {
|
|
320
326
|
value?: string;
|