@bluelibs/runner 4.8.0 → 4.8.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/AI.md +44 -5
- package/README.md +24 -25
- package/dist/browser/index.cjs +362 -175
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.mjs +362 -175
- package/dist/browser/index.mjs.map +1 -1
- package/dist/edge/index.cjs +362 -175
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.mjs +362 -175
- package/dist/edge/index.mjs.map +1 -1
- package/dist/globals/globalResources.d.ts +17 -8
- package/dist/globals/resources/httpClientFactory.resource.d.ts +28 -0
- package/dist/http-client.d.ts +1 -3
- package/dist/index.d.ts +15 -8
- package/dist/node/http-mixed-client.d.ts +3 -0
- package/dist/node/node.cjs +1125 -4525
- package/dist/node/node.cjs.map +1 -1
- package/dist/node/node.d.ts +93 -0
- package/dist/node/node.mjs +1121 -4523
- package/dist/node/node.mjs.map +1 -1
- package/dist/node/resources/http-mixed-client.factory.resource.d.ts +17 -0
- package/dist/node/resources/http-smart-client.factory.resource.d.ts +16 -0
- package/dist/universal/index.cjs +362 -175
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.mjs +362 -175
- package/dist/universal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4,14 +4,16 @@ import { Store } from "../models/Store";
|
|
|
4
4
|
import { TaskRunner } from "../models/TaskRunner";
|
|
5
5
|
import { MiddlewareManager } from "../models/MiddlewareManager";
|
|
6
6
|
import type { Serializer } from "./resources/tunnel/serializer";
|
|
7
|
+
export declare const store: import("..").IResource<void, Promise<Store>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
8
|
+
export declare const serializer: import("..").IResource<void, Promise<Serializer>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
7
9
|
export declare const globalResources: {
|
|
8
|
-
store: import("..").IResource<void, Promise<Store>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
9
|
-
middlewareManager: import("..").IResource<void, Promise<MiddlewareManager>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
10
|
-
eventManager: import("..").IResource<void, Promise<EventManager>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
11
|
-
taskRunner: import("..").IResource<void, Promise<TaskRunner>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
12
|
-
logger: import("..").IResource<void, Promise<Logger>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
13
|
-
serializer: import("..").IResource<void, Promise<Serializer>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
14
|
-
cache: import("..").IResource<{
|
|
10
|
+
readonly store: import("..").IResource<void, Promise<Store>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
11
|
+
readonly middlewareManager: import("..").IResource<void, Promise<MiddlewareManager>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
12
|
+
readonly eventManager: import("..").IResource<void, Promise<EventManager>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
13
|
+
readonly taskRunner: import("..").IResource<void, Promise<TaskRunner>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
14
|
+
readonly logger: import("..").IResource<void, Promise<Logger>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
15
|
+
readonly serializer: import("..").IResource<void, Promise<Serializer>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
16
|
+
readonly cache: import("..").IResource<{
|
|
15
17
|
defaultOptions?: any;
|
|
16
18
|
}, Promise<{
|
|
17
19
|
map: Map<string, import("..").ICacheInstance>;
|
|
@@ -20,7 +22,7 @@ export declare const globalResources: {
|
|
|
20
22
|
}>, {
|
|
21
23
|
cacheFactoryTask: import("..").ITask<any, Promise<import("..").ICacheInstance>, any, any, import("..").TagType[], import("..").TaskMiddlewareAttachmentType[]>;
|
|
22
24
|
}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
23
|
-
queue: import("..").IResource<void, Promise<{
|
|
25
|
+
readonly queue: import("..").IResource<void, Promise<{
|
|
24
26
|
map: Map<string, import("..").Queue>;
|
|
25
27
|
run: <T>(id: string, task: (signal: AbortSignal) => Promise<T>) => Promise<T>;
|
|
26
28
|
}>, {}, {
|
|
@@ -29,4 +31,11 @@ export declare const globalResources: {
|
|
|
29
31
|
title: string;
|
|
30
32
|
description: string;
|
|
31
33
|
}, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
34
|
+
readonly httpClientFactory: import("..").IResource<void, Promise<import("./resources/httpClientFactory.resource").HttpClientFactory>, {
|
|
35
|
+
serializer: import("..").IResource<void, Promise<Serializer>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
36
|
+
store: import("..").IResource<void, Promise<Store>, {}, any, any, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
37
|
+
}, any, {
|
|
38
|
+
title: string;
|
|
39
|
+
description: string;
|
|
40
|
+
}, import("..").TagType[], import("..").ResourceMiddlewareAttachmentType[]>;
|
|
32
41
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type HttpClient } from "../../http-client";
|
|
2
|
+
import type { HttpClientConfig } from "../../http-client";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for creating HTTP clients with automatic injection of:
|
|
5
|
+
* - serializer (EJSON-compatible)
|
|
6
|
+
* - error registry (from Store)
|
|
7
|
+
* - async contexts (from Store)
|
|
8
|
+
*
|
|
9
|
+
* Note: Node streaming clients are exposed via the Node entry only
|
|
10
|
+
* (see createHttpSmartClient/createHttpMixedClient in `@bluelibs/runner/node`).
|
|
11
|
+
* Keeping this universal factory browser-safe avoids dynamic imports.
|
|
12
|
+
*/
|
|
13
|
+
export interface HttpClientFactoryConfig {
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
auth?: HttpClientConfig["auth"];
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
fetchImpl?: typeof fetch;
|
|
18
|
+
onRequest?: HttpClientConfig["onRequest"];
|
|
19
|
+
}
|
|
20
|
+
export type HttpClientFactory = (config: HttpClientFactoryConfig) => HttpClient;
|
|
21
|
+
export declare const httpClientFactory: import("../..").IResource<void, Promise<HttpClientFactory>, {
|
|
22
|
+
serializer: import("../..").IResource<void, Promise<import("./tunnel/serializer").Serializer>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
23
|
+
store: import("../..").IResource<void, Promise<import("../..").Store>, {}, any, any, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
24
|
+
}, any, {
|
|
25
|
+
title: string;
|
|
26
|
+
description: string;
|
|
27
|
+
}, import("../..").TagType[], import("../..").ResourceMiddlewareAttachmentType[]>;
|
|
28
|
+
export type { HttpClient };
|
package/dist/http-client.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Readable } from "stream";
|
|
2
1
|
import type { Serializer } from "./globals/resources/tunnel/serializer";
|
|
3
2
|
import type { IAsyncContext } from "./types/asyncContext";
|
|
4
3
|
import type { IErrorHelper } from "./types/error";
|
|
@@ -20,8 +19,7 @@ export interface HttpClientConfig {
|
|
|
20
19
|
errorRegistry?: Map<string, IErrorHelper<any>>;
|
|
21
20
|
}
|
|
22
21
|
export interface HttpClient {
|
|
23
|
-
task<I = unknown, O = unknown>(id: string, input?: I): Promise<O
|
|
22
|
+
task<I = unknown, O = unknown>(id: string, input?: I): Promise<O>;
|
|
24
23
|
event<P = unknown>(id: string, payload?: P): Promise<void>;
|
|
25
24
|
}
|
|
26
25
|
export declare function createHttpClient(cfg: HttpClientConfig): HttpClient;
|
|
27
|
-
export type { Readable };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ declare const globals: {
|
|
|
7
7
|
readonly ready: import(".").IEvent<void>;
|
|
8
8
|
};
|
|
9
9
|
resources: {
|
|
10
|
-
store: import(".").IResource<void, Promise<import("./models").Store>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
11
|
-
middlewareManager: import(".").IResource<void, Promise<import("./models").MiddlewareManager>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
12
|
-
eventManager: import(".").IResource<void, Promise<import("./models").EventManager>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
13
|
-
taskRunner: import(".").IResource<void, Promise<import("./models").TaskRunner>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
14
|
-
logger: import(".").IResource<void, Promise<import("./models").Logger>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
15
|
-
serializer: import(".").IResource<void, Promise<import("./globals/resources/tunnel/serializer").Serializer>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
16
|
-
cache: import(".").IResource<{
|
|
10
|
+
readonly store: import(".").IResource<void, Promise<import("./models").Store>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
11
|
+
readonly middlewareManager: import(".").IResource<void, Promise<import("./models").MiddlewareManager>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
12
|
+
readonly eventManager: import(".").IResource<void, Promise<import("./models").EventManager>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
13
|
+
readonly taskRunner: import(".").IResource<void, Promise<import("./models").TaskRunner>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
14
|
+
readonly logger: import(".").IResource<void, Promise<import("./models").Logger>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
15
|
+
readonly serializer: import(".").IResource<void, Promise<import("./globals/resources/tunnel/serializer").Serializer>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
16
|
+
readonly cache: import(".").IResource<{
|
|
17
17
|
defaultOptions?: any;
|
|
18
18
|
}, Promise<{
|
|
19
19
|
map: Map<string, import(".").ICacheInstance>;
|
|
@@ -22,7 +22,7 @@ declare const globals: {
|
|
|
22
22
|
}>, {
|
|
23
23
|
cacheFactoryTask: import(".").ITask<any, Promise<import(".").ICacheInstance>, any, any, import(".").TagType[], import(".").TaskMiddlewareAttachmentType[]>;
|
|
24
24
|
}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
25
|
-
queue: import(".").IResource<void, Promise<{
|
|
25
|
+
readonly queue: import(".").IResource<void, Promise<{
|
|
26
26
|
map: Map<string, import("./models").Queue>;
|
|
27
27
|
run: <T>(id: string, task: (signal: AbortSignal) => Promise<T>) => Promise<T>;
|
|
28
28
|
}>, {}, {
|
|
@@ -31,6 +31,13 @@ declare const globals: {
|
|
|
31
31
|
title: string;
|
|
32
32
|
description: string;
|
|
33
33
|
}, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
34
|
+
readonly httpClientFactory: import(".").IResource<void, Promise<import("./globals/resources/httpClientFactory.resource").HttpClientFactory>, {
|
|
35
|
+
serializer: import(".").IResource<void, Promise<import("./globals/resources/tunnel/serializer").Serializer>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
36
|
+
store: import(".").IResource<void, Promise<import("./models").Store>, {}, any, any, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
37
|
+
}, any, {
|
|
38
|
+
title: string;
|
|
39
|
+
description: string;
|
|
40
|
+
}, import(".").TagType[], import(".").ResourceMiddlewareAttachmentType[]>;
|
|
34
41
|
};
|
|
35
42
|
middleware: {
|
|
36
43
|
requireContext: import(".").ITaskMiddleware<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Readable } from "stream";
|
|
2
2
|
import type { Serializer } from "../globals/resources/tunnel/serializer";
|
|
3
|
+
import type { IAsyncContext } from "../types/asyncContext";
|
|
3
4
|
export interface MixedHttpClientAuthConfig {
|
|
4
5
|
header?: string;
|
|
5
6
|
token: string;
|
|
@@ -14,6 +15,8 @@ export interface MixedHttpClientConfig {
|
|
|
14
15
|
url: string;
|
|
15
16
|
headers: Record<string, string>;
|
|
16
17
|
}) => void | Promise<void>;
|
|
18
|
+
contexts?: Array<IAsyncContext<any>>;
|
|
19
|
+
errorRegistry?: Map<string, any>;
|
|
17
20
|
}
|
|
18
21
|
export interface MixedHttpClient {
|
|
19
22
|
task<I = unknown, O = unknown>(id: string, input?: I): Promise<O | Readable | ReadableStream<Uint8Array>>;
|