@nice-code/action 0.4.4 → 0.4.6
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/README.md +20 -28
- package/build/devtools/browser/index.js +159 -60
- package/build/devtools/server/index.js +2 -0
- package/build/index.js +329 -166
- package/build/types/ActionDefinition/Action/Payload/ActionPayload.types.d.ts +2 -1
- package/build/types/ActionRuntime/Handler/ExternalClient/ActionExternalClientHandler.d.ts +4 -3
- package/build/types/ActionRuntime/Handler/ExternalClient/ActionExternalClientHandler.types.d.ts +3 -3
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/ConnectionTransportManager.d.ts +2 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Custom/{TransportCustom.d.ts → CustomConnection.d.ts} +2 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Custom/CustomTransport.d.ts +33 -0
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/{TransportHttp.d.ts → HttpConnection.d.ts} +2 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/HttpTransport.d.ts +28 -0
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/TransportHttp.types.d.ts +1 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Transport.d.ts +25 -12
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Transport.types.d.ts +15 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/TransportConnection.d.ts +27 -0
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/{TransportWebSocket.d.ts → WebSocketConnection.d.ts} +6 -3
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/WebSocketTransport.d.ts +41 -0
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/ws_util.d.ts +2 -0
- package/build/types/ActionRuntime/test/helpers/new_action_test_data.d.ts +2 -2
- package/build/types/devtools/browser/components/HandlerChips.d.ts +11 -0
- package/build/types/devtools/browser/components/Tooltip.d.ts +11 -1
- package/build/types/devtools/core/ActionDevtools.types.d.ts +5 -0
- package/build/types/index.d.ts +4 -4
- package/package.json +4 -4
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Transport.combined.types.d.ts +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Transport } from "../Transport";
|
|
2
1
|
import { ETransportType, type IActionTransportReadyData_Methods, type ITransportRouteActionParams } from "../Transport.types";
|
|
2
|
+
import { TransportConnection } from "../TransportConnection";
|
|
3
3
|
import type { IActionTransportDef_Custom, IActionTransportInitialized_Custom, IActionTransportReadyData_Custom, TActionTransportDef_Custom_NoType } from "./TransportCustom.types";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class CustomConnection extends TransportConnection<ETransportType.custom, ITransportRouteActionParams, IActionTransportReadyData_Custom, IActionTransportInitialized_Custom, IActionTransportDef_Custom> {
|
|
5
5
|
constructor(def: TActionTransportDef_Custom_NoType);
|
|
6
6
|
protected _finalizeTransportMethods(inputs: IActionTransportReadyData_Custom): IActionTransportReadyData_Methods;
|
|
7
7
|
}
|
package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Custom/CustomTransport.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ITransportConnectionContext, Transport } from "../Transport";
|
|
2
|
+
import { ETransportType, type ITransportMethod_SendActionData_Input, type ITransportRouteActionParams, type ITransportRouteInfo, type TSendReturnDataMethod, type TUpdateActionRunConfig } from "../Transport.types";
|
|
3
|
+
import { CustomConnection } from "./CustomConnection";
|
|
4
|
+
import type { IActionTransportInitialized_Custom } from "./TransportCustom.types";
|
|
5
|
+
export interface ICustomTransportOptions {
|
|
6
|
+
/** Send a request/progress payload to the external client. */
|
|
7
|
+
sendActionData: (input: ITransportMethod_SendActionData_Input) => void;
|
|
8
|
+
/** Optional return-path dispatch for bidirectional channels. */
|
|
9
|
+
sendReturnData?: TSendReturnDataMethod;
|
|
10
|
+
closeTransport?: (input?: ITransportRouteActionParams) => void;
|
|
11
|
+
updateRunConfig?: TUpdateActionRunConfig;
|
|
12
|
+
getTransportCacheKey?: (input: ITransportRouteActionParams) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* Advanced escape hatch — full control over readiness/initialization. When provided, the simple
|
|
15
|
+
* `sendActionData` / `sendReturnData` / `closeTransport` fields are ignored.
|
|
16
|
+
*/
|
|
17
|
+
getTransport?: IActionTransportInitialized_Custom["getTransport"];
|
|
18
|
+
/** Short label shown in the devtools chip (defaults to "custom"). */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Override the devtools route info for a specific action. */
|
|
21
|
+
getRouteInfo?: (input: ITransportRouteActionParams) => ITransportRouteInfo;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reusable custom transport definition for channels nice-action doesn't model natively. Provide
|
|
25
|
+
* `sendActionData` for the simple case, or `getTransport` for full control over the lifecycle.
|
|
26
|
+
*/
|
|
27
|
+
export declare class CustomTransport extends Transport<ETransportType.custom> {
|
|
28
|
+
private readonly options;
|
|
29
|
+
readonly type = ETransportType.custom;
|
|
30
|
+
constructor(options: ICustomTransportOptions);
|
|
31
|
+
_createConnection(_ctx: ITransportConnectionContext): CustomConnection;
|
|
32
|
+
getRouteInfo(input: ITransportRouteActionParams): ITransportRouteInfo;
|
|
33
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Transport } from "../Transport";
|
|
2
1
|
import { ETransportType, type IActionTransportReadyData_Methods, type ITransportDispatchAction, type ITransportRouteActionParams } from "../Transport.types";
|
|
2
|
+
import { TransportConnection } from "../TransportConnection";
|
|
3
3
|
import type { IActionTransportDef_Http, IActionTransportInitialized_Http, IActionTransportReadyData_Http, IActionTransportReadyParams_Http } from "./TransportHttp.types";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class HttpConnection extends TransportConnection<ETransportType.http, ITransportRouteActionParams, IActionTransportReadyData_Http, IActionTransportInitialized_Http, IActionTransportDef_Http> {
|
|
5
5
|
constructor(def: Omit<IActionTransportDef_Http, "type">);
|
|
6
6
|
_finalizeTransportMethods(methods: IActionTransportReadyData_Http): IActionTransportReadyData_Methods;
|
|
7
7
|
protected send(input: ITransportDispatchAction<IActionTransportReadyParams_Http>): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ITransportConnectionContext, Transport } from "../Transport";
|
|
2
|
+
import { ETransportType, type ITransportRouteActionParams, type ITransportRouteInfo, type TUpdateActionRunConfig } from "../Transport.types";
|
|
3
|
+
import { HttpConnection } from "./HttpConnection";
|
|
4
|
+
import type { IHttpRequestParams } from "./TransportHttp.types";
|
|
5
|
+
type TMaybeResolved<T> = T | ((input: ITransportRouteActionParams) => T);
|
|
6
|
+
export interface IHttpTransportOptions {
|
|
7
|
+
/** Endpoint URL, either static or derived per action. */
|
|
8
|
+
url: TMaybeResolved<string>;
|
|
9
|
+
/** Optional extra headers, either static or derived per action. */
|
|
10
|
+
headers?: TMaybeResolved<Record<string, string>>;
|
|
11
|
+
/** Advanced escape hatch — full control over the request. Overrides `url` / `headers`. */
|
|
12
|
+
createRequest?: (input: ITransportRouteActionParams) => IHttpRequestParams;
|
|
13
|
+
updateRunConfig?: TUpdateActionRunConfig;
|
|
14
|
+
getTransportCacheKey?: (input: ITransportRouteActionParams) => string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reusable HTTP transport definition. Common case is just `new HttpTransport({ url })`; pass
|
|
18
|
+
* functions for `url` / `headers` to derive them per action, or `createRequest` for full control.
|
|
19
|
+
*/
|
|
20
|
+
export declare class HttpTransport extends Transport<ETransportType.http> {
|
|
21
|
+
private readonly options;
|
|
22
|
+
readonly type = ETransportType.http;
|
|
23
|
+
constructor(options: IHttpTransportOptions);
|
|
24
|
+
private _resolveRequest;
|
|
25
|
+
_createConnection(_ctx: ITransportConnectionContext): HttpConnection;
|
|
26
|
+
getRouteInfo(input: ITransportRouteActionParams): ITransportRouteInfo;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/TransportHttp.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ETransportType, IActionTransportDef, IActionTransportInitialized, IActionTransportReadyData_Base, ITransportRouteActionParams } from "../Transport.types";
|
|
2
|
-
interface IHttpRequestParams {
|
|
2
|
+
export interface IHttpRequestParams {
|
|
3
3
|
url: string;
|
|
4
4
|
headers?: Record<string, string>;
|
|
5
5
|
body?: string;
|
|
@@ -14,4 +14,3 @@ export interface IActionTransportInitialized_Http extends IActionTransportInitia
|
|
|
14
14
|
}
|
|
15
15
|
export interface IActionTransportDef_Http extends IActionTransportDef<ETransportType.http, IActionTransportInitialized_Http> {
|
|
16
16
|
}
|
|
17
|
-
export {};
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { IActionTransportResolvers } from "./Transport.types";
|
|
2
|
+
import { type ETransportType, type ITransportRouteActionParams, type ITransportRouteInfo } from "./Transport.types";
|
|
3
|
+
import type { TransportConnection } from "./TransportConnection";
|
|
4
|
+
/**
|
|
5
|
+
* Context handed to a {@link Transport} definition when a handler builds a live connection from it.
|
|
6
|
+
* Only bidirectional transports (WebSocket / Custom) make use of `resolvers`.
|
|
7
|
+
*/
|
|
8
|
+
export interface ITransportConnectionContext {
|
|
9
|
+
resolvers?: IActionTransportResolvers;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reusable transport definition. Devs construct these (`new HttpTransport({ url })`,
|
|
13
|
+
* `new WebSocketTransport({ url })`, …) and pass them to an `ActionExternalClientHandler`. A single
|
|
14
|
+
* definition can be shared across multiple handlers — each handler builds its own live
|
|
15
|
+
* {@link TransportConnection} via {@link TransportConnection._createConnection}.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class Transport<T extends ETransportType = ETransportType> {
|
|
18
|
+
abstract readonly type: T;
|
|
19
|
+
/** Internal: build a fresh, per-handler live connection from this definition. */
|
|
20
|
+
abstract _createConnection(ctx: ITransportConnectionContext): TransportConnection<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve human-readable info about how a specific action would be routed through this transport
|
|
23
|
+
* (e.g. the request URL/method, or the WebSocket endpoint). Surfaced in the action devtools.
|
|
24
|
+
*/
|
|
25
|
+
abstract getRouteInfo(input: ITransportRouteActionParams): ITransportRouteInfo;
|
|
13
26
|
}
|
|
@@ -4,12 +4,25 @@ import type { ActionPayload_Request } from "../../../../ActionDefinition/Action/
|
|
|
4
4
|
import type { ActionPayload_Result } from "../../../../ActionDefinition/Action/Payload/ActionPayload_Result";
|
|
5
5
|
import type { RunningAction } from "../../../../ActionDefinition/Action/RunningAction";
|
|
6
6
|
import type { RuntimeCoordinate } from "../../../RuntimeCoordinate";
|
|
7
|
-
import type {
|
|
7
|
+
import type { TransportConnection } from "./TransportConnection";
|
|
8
8
|
export declare enum ETransportType {
|
|
9
9
|
ws = "ws",
|
|
10
10
|
http = "http",
|
|
11
11
|
custom = "custom"
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Serializable, display-only description of how an action was routed through a transport. Stored on
|
|
15
|
+
* the action's route items and shown in the devtools external-handler chips. Keep this free of
|
|
16
|
+
* sensitive data (e.g. auth headers) — route items travel over the wire.
|
|
17
|
+
*/
|
|
18
|
+
export interface ITransportRouteInfo {
|
|
19
|
+
type: ETransportType;
|
|
20
|
+
/** Short label for chips, e.g. "POST /resolve_action" or "ws host/resolve_action/ws". */
|
|
21
|
+
summary?: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
method?: string;
|
|
24
|
+
detail?: Record<string, string | number | boolean>;
|
|
25
|
+
}
|
|
13
26
|
export interface IUpdateActionRunConfig_Output {
|
|
14
27
|
timeout?: number;
|
|
15
28
|
}
|
|
@@ -83,7 +96,7 @@ export interface IActionTransportReadyData_Methods extends IActionTransportReady
|
|
|
83
96
|
}
|
|
84
97
|
export interface IActionTransportReady {
|
|
85
98
|
methods: IActionTransportReadyData_Methods;
|
|
86
|
-
transport:
|
|
99
|
+
transport: TransportConnection;
|
|
87
100
|
}
|
|
88
101
|
export type TTransportCache = Map<string, IActionTransportReady | Promise<IActionTransportReady>>;
|
|
89
102
|
export type TOnResolveIncomingRequest = (request: ActionPayload_Request<any>) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Transport } from "./Transport";
|
|
2
|
+
import { type ETransportType, type IActionTransportDef, type IActionTransportInitialized, type IActionTransportReadyData_Base, type IActionTransportReadyData_Methods, type ITransportRouteActionParams, type ITransportRouteInfo, type TTransportStatusInfo } from "./Transport.types";
|
|
3
|
+
/**
|
|
4
|
+
* Live, per-handler transport runtime built from a reusable {@link Transport} definition. Holds the
|
|
5
|
+
* connection-scoped state (ordinal, initialized config, sockets / abort sets) that must not be shared
|
|
6
|
+
* across handlers. Construct these via `definition._createConnection(...)`, never directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class TransportConnection<T extends ETransportType = ETransportType, RP extends ITransportRouteActionParams = ITransportRouteActionParams, RD extends IActionTransportReadyData_Base = IActionTransportReadyData_Base, I extends IActionTransportInitialized<RP, RD> = IActionTransportInitialized<RP, RD>, DEF extends IActionTransportDef<T, I> = IActionTransportDef<T, I>> {
|
|
9
|
+
readonly def: DEF;
|
|
10
|
+
readonly transOrd: number;
|
|
11
|
+
readonly type: T;
|
|
12
|
+
readonly initialized: I;
|
|
13
|
+
/** Backref to the public definition that created this connection (used for devtools route info). */
|
|
14
|
+
definition?: Transport<T>;
|
|
15
|
+
constructor(def: DEF);
|
|
16
|
+
/**
|
|
17
|
+
* Devtools route info for an action routed through this live connection. Defaults to the stateless
|
|
18
|
+
* {@link definition}'s info; connections override to enrich it from live state (e.g. the actual
|
|
19
|
+
* resolved socket URL) when the definition couldn't resolve it on its own.
|
|
20
|
+
*/
|
|
21
|
+
getRouteInfo(input: RP): ITransportRouteInfo | undefined;
|
|
22
|
+
protected abstract _finalizeTransportMethods(inputs: RD): IActionTransportReadyData_Methods;
|
|
23
|
+
protected _getCacheKey(input: RP): string | null;
|
|
24
|
+
getCacheKey(input: RP): string | null;
|
|
25
|
+
getTransport(input: RP): TTransportStatusInfo<IActionTransportReadyData_Methods>;
|
|
26
|
+
protected _processTransportStatus(input: RP): TTransportStatusInfo<IActionTransportReadyData_Methods>;
|
|
27
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ETransportType, type IActionTransportReadyData_Methods, type IActionTransportResolvers, type ITransportRouteActionParams, type ITransportRouteInfo, type TTransportStatusInfo } from "../Transport.types";
|
|
2
|
+
import { TransportConnection } from "../TransportConnection";
|
|
3
3
|
import type { IActionTransportDef_Ws, IActionTransportInitialized_Ws, IActionTransportReadyData_Ws } from "./TransportWebSocket.types";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class WebSocketConnection extends TransportConnection<ETransportType.ws, ITransportRouteActionParams, IActionTransportReadyData_Ws, IActionTransportInitialized_Ws, IActionTransportDef_Ws> {
|
|
5
5
|
private resolvers;
|
|
6
6
|
private _abortSet;
|
|
7
|
+
/** URL of the most recently resolved live socket — surfaced to devtools when the definition can't. */
|
|
8
|
+
private _liveSocketUrl?;
|
|
7
9
|
constructor(def: Omit<IActionTransportDef_Ws, "type">, resolvers?: IActionTransportResolvers);
|
|
8
10
|
protected _getCacheKey(_input: ITransportRouteActionParams): string;
|
|
9
11
|
protected _processTransportStatus(input: ITransportRouteActionParams): TTransportStatusInfo<IActionTransportReadyData_Methods>;
|
|
12
|
+
getRouteInfo(input: ITransportRouteActionParams): ITransportRouteInfo | undefined;
|
|
10
13
|
_finalizeTransportMethods(wsData: IActionTransportReadyData_Ws): IActionTransportReadyData_Methods;
|
|
11
14
|
private _parseActionMessage;
|
|
12
15
|
private _abortAll;
|
package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/WebSocketTransport.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ITransportConnectionContext, Transport } from "../Transport";
|
|
2
|
+
import { ETransportType, type ITransportRouteActionParams, type ITransportRouteInfo, type TUpdateActionRunConfig } from "../Transport.types";
|
|
3
|
+
import type { IActionTransportInitialized_Ws, IActionTransportReadyData_Ws } from "./TransportWebSocket.types";
|
|
4
|
+
import { WebSocketConnection } from "./WebSocketConnection";
|
|
5
|
+
type TMaybeResolved<T> = T | ((input: ITransportRouteActionParams) => T);
|
|
6
|
+
export interface IWebSocketTransportOptions {
|
|
7
|
+
/** WebSocket endpoint URL, either static or derived per action. Optional when `getTransport` is used. */
|
|
8
|
+
url?: TMaybeResolved<string>;
|
|
9
|
+
/** Advanced escape hatch — provide your own socket (e.g. with sub-protocols). Overrides `url`. */
|
|
10
|
+
createWebSocket?: (input: ITransportRouteActionParams) => WebSocket;
|
|
11
|
+
/** Custom (de)serialization of action payloads on the wire. */
|
|
12
|
+
formatMessage?: IActionTransportReadyData_Ws["formatMessage"];
|
|
13
|
+
updateRunConfig?: TUpdateActionRunConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Keys that identify a reusable socket. Defaults to the resolved url, so a single socket is shared
|
|
16
|
+
* across actions to the same endpoint instead of opening one per action.
|
|
17
|
+
*/
|
|
18
|
+
getTransportCacheKey?: (input: ITransportRouteActionParams) => string[];
|
|
19
|
+
/**
|
|
20
|
+
* Advanced escape hatch — full control over readiness/initialization. Use this for contextual
|
|
21
|
+
* support detection (return `{ status: ETransportStatus.unsupported }` when the socket shouldn't be
|
|
22
|
+
* used) or async URL building (return `{ status: ETransportStatus.initializing, initializationPromise }`
|
|
23
|
+
* that resolves to a `ready` socket). When provided, `url` / `createWebSocket` are ignored.
|
|
24
|
+
*/
|
|
25
|
+
getTransport?: IActionTransportInitialized_Ws["getTransport"];
|
|
26
|
+
/** Override the devtools route info for a specific action (useful alongside `getTransport`). */
|
|
27
|
+
getRouteInfo?: (input: ITransportRouteActionParams) => ITransportRouteInfo;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Reusable WebSocket transport definition. Common case is just `new WebSocketTransport({ url })`. The
|
|
31
|
+
* underlying socket is cached (by url, by default) and reused across actions to the same endpoint.
|
|
32
|
+
*/
|
|
33
|
+
export declare class WebSocketTransport extends Transport<ETransportType.ws> {
|
|
34
|
+
private readonly options;
|
|
35
|
+
readonly type = ETransportType.ws;
|
|
36
|
+
constructor(options: IWebSocketTransportOptions);
|
|
37
|
+
private _createSocket;
|
|
38
|
+
_createConnection(ctx: ITransportConnectionContext): WebSocketConnection;
|
|
39
|
+
getRouteInfo(input: ITransportRouteActionParams): ITransportRouteInfo;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionRuntime } from "../../ActionRuntime";
|
|
2
2
|
import { type ActionExternalClientHandler } from "../../Handler/ExternalClient/ActionExternalClientHandler";
|
|
3
|
-
import
|
|
3
|
+
import { CustomTransport } from "../../Handler/ExternalClient/Transport/Custom/CustomTransport";
|
|
4
4
|
import { type ActionLocalHandler } from "../../Handler/Local/ActionLocalHandler";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function _test_createCustomTransport(externalClientRuntime: ActionRuntime): CustomTransport;
|
|
6
6
|
export declare function _test_createActions(): {
|
|
7
7
|
domains: {
|
|
8
8
|
root: import("../../..").ActionRootDomain<import("../../..").IActionRootDomain<"test_root">>;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { IDevtoolsActionEntry, IDevtoolsRouteItem } from "../../core/ActionDevtools.types";
|
|
2
2
|
import { ESize } from "../ui_util/size";
|
|
3
|
+
import type { ITooltipConfig } from "./Tooltip";
|
|
3
4
|
export declare function getExternalLabel(hop: IDevtoolsRouteItem): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Extended transport details (request/WebSocket endpoint) for the external handler — shown on hover
|
|
7
|
+
* only, so the chip/label itself stays short.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTransportTooltip(hop: IDevtoolsRouteItem): ITooltipConfig | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Aggregate transport tooltip for a chip/label that represents one or more external hops (e.g. a
|
|
12
|
+
* grouped child-dispatch chip that accumulates several transports for the same runtime).
|
|
13
|
+
*/
|
|
14
|
+
export declare function getTransportTooltipForHops(hops: IDevtoolsRouteItem[]): ITooltipConfig | undefined;
|
|
4
15
|
interface IHandlerChipsProps {
|
|
5
16
|
entry: IDevtoolsActionEntry;
|
|
6
17
|
size: ESize;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
export interface ITooltipConfig {
|
|
3
3
|
content: ReactNode;
|
|
4
4
|
title?: ReactNode;
|
|
@@ -12,3 +12,13 @@ export declare function Tooltip({ anchor, config, children, }: {
|
|
|
12
12
|
config: ITooltipConfig;
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Wraps inline content so it shows `config` as a hover tooltip. When `config` is null the children
|
|
17
|
+
* render untouched (no hover handlers, no tooltip). Useful for non-Chip text labels that still need
|
|
18
|
+
* the same tooltip treatment as Chips.
|
|
19
|
+
*/
|
|
20
|
+
export declare function HoverTooltip({ config, children, style, }: {
|
|
21
|
+
config?: ITooltipConfig;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,12 @@ export interface IDevtoolsRouteItem {
|
|
|
10
10
|
perId?: string;
|
|
11
11
|
insId?: string;
|
|
12
12
|
};
|
|
13
|
+
/** Transport type string (e.g. "http", "ws", "custom"). */
|
|
13
14
|
transport?: string;
|
|
15
|
+
/** Short transport summary for chips (e.g. "POST /resolve_action"). */
|
|
16
|
+
transportSummary?: string;
|
|
17
|
+
/** Resolved endpoint (request URL / WebSocket URL), when available. */
|
|
18
|
+
transportUrl?: string;
|
|
14
19
|
time: number;
|
|
15
20
|
label?: string;
|
|
16
21
|
}
|
package/build/types/index.d.ts
CHANGED
|
@@ -16,13 +16,13 @@ export type { TActionSchemaOptions, TActionSerializationDefinition, TTransported
|
|
|
16
16
|
export { ActionRuntime } from "./ActionRuntime/ActionRuntime";
|
|
17
17
|
export { ActionExternalClientHandler, createExternalClientHandler, } from "./ActionRuntime/Handler/ExternalClient/ActionExternalClientHandler";
|
|
18
18
|
export * from "./ActionRuntime/Handler/ExternalClient/err_nice_external_client";
|
|
19
|
+
export * from "./ActionRuntime/Handler/ExternalClient/Transport/Custom/CustomTransport";
|
|
19
20
|
export * from "./ActionRuntime/Handler/ExternalClient/Transport/err_nice_transport";
|
|
20
21
|
export * from "./ActionRuntime/Handler/ExternalClient/Transport/err_nice_transport_ws";
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export type { TActionTransportDef } from "./ActionRuntime/Handler/ExternalClient/Transport/Transport.combined.types";
|
|
22
|
+
export { HttpTransport, type IHttpTransportOptions, } from "./ActionRuntime/Handler/ExternalClient/Transport/Http/HttpTransport";
|
|
23
|
+
export { type ITransportConnectionContext, Transport, } from "./ActionRuntime/Handler/ExternalClient/Transport/Transport";
|
|
24
24
|
export * from "./ActionRuntime/Handler/ExternalClient/Transport/Transport.types";
|
|
25
|
-
export
|
|
25
|
+
export { type IWebSocketTransportOptions, WebSocketTransport, } from "./ActionRuntime/Handler/ExternalClient/Transport/WebSocket/WebSocketTransport";
|
|
26
26
|
export { ActionLocalHandler, createLocalHandler, } from "./ActionRuntime/Handler/Local/ActionLocalHandler";
|
|
27
27
|
export * from "./ActionRuntime/RuntimeCoordinate";
|
|
28
28
|
export { EErrId_NiceAction, err_nice_action } from "./errors/err_nice_action";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-code/action",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"build-types": "tsc --project tsconfig.build.json"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@nice-code/common-errors": "0.4.
|
|
48
|
-
"@nice-code/error": "0.4.
|
|
49
|
-
"@nice-code/util": "0.4.
|
|
47
|
+
"@nice-code/common-errors": "0.4.6",
|
|
48
|
+
"@nice-code/error": "0.4.6",
|
|
49
|
+
"@nice-code/util": "0.4.6",
|
|
50
50
|
"@standard-schema/spec": "^1.1.0",
|
|
51
51
|
"@tanstack/react-virtual": "^3.13.26",
|
|
52
52
|
"http-status-codes": "^2.3.0",
|
package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Transport.combined.types.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { IActionTransportDef_Custom } from "./Custom/TransportCustom.types";
|
|
2
|
-
import type { IActionTransportDef_Http } from "./Http/TransportHttp.types";
|
|
3
|
-
import type { IActionTransportDef_Ws } from "./WebSocket/TransportWebSocket.types";
|
|
4
|
-
export type TActionTransportDef = IActionTransportDef_Ws | IActionTransportDef_Http | IActionTransportDef_Custom;
|