@riddance/host 0.0.7 → 0.0.9
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/context.d.ts +2 -2
- package/host/context.d.ts +1 -1
- package/host/http.d.ts +1 -1
- package/host/reflect.d.ts +3 -3
- package/host/registry.d.ts +1 -1
- package/http.d.ts +2 -2
- package/package.json +38 -38
package/context.d.ts
CHANGED
|
@@ -21,10 +21,10 @@ export interface AbortSignal {
|
|
|
21
21
|
capture?: boolean;
|
|
22
22
|
}) => void;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type MutableJson = null | boolean | number | string | MutableJson[] | {
|
|
25
25
|
[key: string]: MutableJson;
|
|
26
26
|
};
|
|
27
|
-
export
|
|
27
|
+
export type Json = null | boolean | number | string | readonly Json[] | {
|
|
28
28
|
readonly [key: string]: Json;
|
|
29
29
|
};
|
|
30
30
|
export declare function objectSpreadable(json?: Json): {
|
package/host/context.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface EventTransport {
|
|
|
24
24
|
readonly publishRate: number;
|
|
25
25
|
sendEvents(topic: string, events: BufferedEvent[], signal: AbortSignal): Promise<void>;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type LogLevel = 'trace' | 'debug' | 'info' | 'warning' | 'error' | 'fatal';
|
|
28
28
|
export interface LogEntry {
|
|
29
29
|
readonly level: LogLevel;
|
|
30
30
|
readonly timestamp: number;
|
package/host/http.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface Response {
|
|
|
10
10
|
status: number;
|
|
11
11
|
body?: string | Buffer;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
type RequestOptions = BodylessRequestOptions | StringRequestOptions | JsonRequestOptions;
|
|
14
14
|
interface BodylessRequestOptions {
|
|
15
15
|
uri: string;
|
|
16
16
|
headers?: {
|
package/host/reflect.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { HttpHandlerConfiguration } from '../http.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type CPU = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64';
|
|
4
|
+
type CpuConfig = CPU | `!${CPU}`;
|
|
5
|
+
type OSConfig = NodeJS.Platform | `!${NodeJS.Platform}`;
|
|
6
6
|
export interface PackageJsonConfiguration {
|
|
7
7
|
nodeVersion?: string;
|
|
8
8
|
cpus?: CpuConfig[];
|
package/host/registry.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ export interface Metadata {
|
|
|
21
21
|
revision: string | undefined;
|
|
22
22
|
config?: PackageConfiguration;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
25
25
|
export declare function registerHttpHandler(method: Method, path: string, configOrHandler: HandlerConfiguration | Handler, fn?: Handler): void;
|
|
26
26
|
export {};
|
package/http.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface FullResult {
|
|
|
10
10
|
status?: number;
|
|
11
11
|
body?: unknown;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type Result = void | string | FullResult;
|
|
14
14
|
export interface HttpRequest {
|
|
15
15
|
readonly rawUrl: string;
|
|
16
16
|
readonly url: Readonly<UrlWithParsedQuery> & {
|
|
@@ -26,7 +26,7 @@ export interface HttpHandlerConfiguration extends HandlerConfiguration {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly cors?: string;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type Handler = (context: Context, request: HttpRequest) => Promise<Result> | Result;
|
|
30
30
|
export declare function get(path: string, fn: Handler): void;
|
|
31
31
|
export declare function get(path: string, config: HttpHandlerConfiguration, fn: Handler): void;
|
|
32
32
|
export declare function post(path: string, fn: Handler): void;
|
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@riddance/host",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"engines": {
|
|
7
|
-
"node": ">=16"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"riddance",
|
|
11
|
-
"serverless",
|
|
12
|
-
"environment",
|
|
13
|
-
"devenv",
|
|
14
|
-
"opinionated"
|
|
15
|
-
],
|
|
16
|
-
"files": [
|
|
17
|
-
"*.js",
|
|
18
|
-
"*.d.ts",
|
|
19
|
-
"host/*.js",
|
|
20
|
-
"host/*.d.ts"
|
|
21
|
-
],
|
|
22
|
-
"exports": {
|
|
23
|
-
"./lib/context": "./context.js",
|
|
24
|
-
"./lib/http": "./http.js",
|
|
25
|
-
"./registry": "./host/registry.js",
|
|
26
|
-
"./reflect": "./host/reflect.js",
|
|
27
|
-
"./logging": "./host/logging.js",
|
|
28
|
-
"./context": "./host/context.js",
|
|
29
|
-
"./http": "./host/http.js"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@riddance/env": "0.
|
|
33
|
-
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"prepare": "tsc",
|
|
36
|
-
"watch": "watch"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@riddance/host",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=16"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"riddance",
|
|
11
|
+
"serverless",
|
|
12
|
+
"environment",
|
|
13
|
+
"devenv",
|
|
14
|
+
"opinionated"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"*.js",
|
|
18
|
+
"*.d.ts",
|
|
19
|
+
"host/*.js",
|
|
20
|
+
"host/*.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./lib/context": "./context.js",
|
|
24
|
+
"./lib/http": "./http.js",
|
|
25
|
+
"./registry": "./host/registry.js",
|
|
26
|
+
"./reflect": "./host/reflect.js",
|
|
27
|
+
"./logging": "./host/logging.js",
|
|
28
|
+
"./context": "./host/context.js",
|
|
29
|
+
"./http": "./host/http.js"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@riddance/env": "0.1.2"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"prepare": "tsc",
|
|
36
|
+
"watch": "watch"
|
|
37
|
+
}
|
|
38
|
+
}
|