@nice-code/action 0.7.0 → 0.9.0
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/build/ActionDevtoolsCore-B4s6aGvI.d.ts +79 -0
- package/build/ActionDevtoolsCore-BLeY_N-3.js +159 -0
- package/build/ActionDevtoolsCore-BLeY_N-3.js.map +1 -0
- package/build/ActionDevtoolsCore-Pg7ERO3L.d.ts +79 -0
- package/build/ActionDevtoolsCore-yfJ9tkvl.js +154 -0
- package/build/ActionDevtoolsCore-yfJ9tkvl.js.map +1 -0
- package/build/ActionPayload.types-BN-rXFBK.d.ts +2328 -0
- package/build/ActionPayload.types-D28ELKXC.d.ts +2328 -0
- package/build/RunningAction.types-C176rqHG.js +22 -0
- package/build/RunningAction.types-C176rqHG.js.map +1 -0
- package/build/RunningAction.types-DjCX1xp5.js +39 -0
- package/build/RunningAction.types-DjCX1xp5.js.map +1 -0
- package/build/devtools/browser/index.d.ts +17 -0
- package/build/devtools/browser/index.js +3775 -5814
- package/build/devtools/browser/index.js.map +1 -0
- package/build/devtools/server/index.d.ts +35 -0
- package/build/devtools/server/index.js +97 -255
- package/build/devtools/server/index.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +3877 -3674
- package/build/index.js.map +1 -0
- package/build/react-query/index.d.ts +17 -0
- package/build/react-query/index.js +60 -60
- package/build/react-query/index.js.map +1 -0
- package/package.json +34 -29
- package/build/types/ActionDefinition/Action/Action.combined.types.d.ts +0 -37
- package/build/types/ActionDefinition/Action/ActionBase.d.ts +0 -14
- package/build/types/ActionDefinition/Action/ActionBase.types.d.ts +0 -24
- package/build/types/ActionDefinition/Action/Context/ActionContext.d.ts +0 -25
- package/build/types/ActionDefinition/Action/Context/ActionContext.types.d.ts +0 -35
- package/build/types/ActionDefinition/Action/Core/ActionCore.d.ts +0 -19
- package/build/types/ActionDefinition/Action/Core/ActionCore.types.d.ts +0 -10
- package/build/types/ActionDefinition/Action/Payload/ActionPayload.d.ts +0 -14
- package/build/types/ActionDefinition/Action/Payload/ActionPayload.types.d.ts +0 -110
- package/build/types/ActionDefinition/Action/Payload/ActionPayload_Progress.d.ts +0 -15
- package/build/types/ActionDefinition/Action/Payload/ActionPayload_Request.d.ts +0 -26
- package/build/types/ActionDefinition/Action/Payload/ActionPayload_Result.d.ts +0 -19
- package/build/types/ActionDefinition/Action/RunningAction.d.ts +0 -36
- package/build/types/ActionDefinition/Action/RunningAction.types.d.ts +0 -73
- package/build/types/ActionDefinition/Domain/ActionDomain.d.ts +0 -42
- package/build/types/ActionDefinition/Domain/ActionDomain.types.d.ts +0 -43
- package/build/types/ActionDefinition/Domain/ActionDomainBase.d.ts +0 -14
- package/build/types/ActionDefinition/Domain/ActionRootDomain.d.ts +0 -24
- package/build/types/ActionDefinition/Domain/helpers/createRootActionDomain.d.ts +0 -5
- package/build/types/ActionDefinition/Schema/ActionSchema.d.ts +0 -68
- package/build/types/ActionDefinition/Schema/ActionSchema.types.d.ts +0 -28
- package/build/types/ActionRuntime/ActionDomainManager.d.ts +0 -13
- package/build/types/ActionRuntime/ActionRuntime.d.ts +0 -56
- package/build/types/ActionRuntime/ActionRuntime.types.d.ts +0 -22
- package/build/types/ActionRuntime/ActionRuntimeManager.d.ts +0 -20
- package/build/types/ActionRuntime/Handler/ActionHandler.d.ts +0 -16
- package/build/types/ActionRuntime/Handler/ActionHandler.types.d.ts +0 -65
- package/build/types/ActionRuntime/Handler/ExternalClient/ActionExternalClientHandler.d.ts +0 -45
- package/build/types/ActionRuntime/Handler/ExternalClient/ActionExternalClientHandler.types.d.ts +0 -7
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/ConnectionTransportManager.d.ts +0 -16
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Custom/CustomConnection.d.ts +0 -7
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Custom/CustomTransport.d.ts +0 -43
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Custom/TransportCustom.types.d.ts +0 -11
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/HttpConnection.d.ts +0 -8
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/HttpTransport.d.ts +0 -26
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Http/TransportHttp.types.d.ts +0 -16
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Transport.d.ts +0 -27
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/Transport.types.d.ts +0 -125
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/TransportConnection.d.ts +0 -27
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/TransportWebSocket.types.d.ts +0 -41
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/WebSocketConnection.d.ts +0 -33
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/WebSocketTransport.d.ts +0 -60
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/actionFrameCrypto.d.ts +0 -31
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/actionWireCodec.d.ts +0 -41
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/actionWsHandshake.d.ts +0 -187
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/createBinaryWsAdapter.d.ts +0 -20
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/createBinaryWsSessionFactory.d.ts +0 -31
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/secureWsChannel.d.ts +0 -63
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/WebSocket/ws_util.d.ts +0 -11
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/err_nice_transport.d.ts +0 -36
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/err_nice_transport_ws.d.ts +0 -18
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/helpers/addTransportStatusMetadata.d.ts +0 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/Transport/helpers/createUnsetTransportResolvers.d.ts +0 -2
- package/build/types/ActionRuntime/Handler/ExternalClient/err_nice_external_client.d.ts +0 -5
- package/build/types/ActionRuntime/Handler/Local/ActionLocalHandler.d.ts +0 -55
- package/build/types/ActionRuntime/Handler/Local/ActionLocalHandler.types.d.ts +0 -7
- package/build/types/ActionRuntime/Handler/Server/ActionServerHandler.d.ts +0 -197
- package/build/types/ActionRuntime/Handler/Server/createSecureActionServer.d.ts +0 -71
- package/build/types/ActionRuntime/HandlerCallStack.d.ts +0 -3
- package/build/types/ActionRuntime/Routing/ActionRouter.d.ts +0 -55
- package/build/types/ActionRuntime/Routing/ActionRouter.types.d.ts +0 -20
- package/build/types/ActionRuntime/RuntimeCoordinate.d.ts +0 -58
- package/build/types/ActionRuntime/test/helpers/new_action_test_data.d.ts +0 -207
- package/build/types/ActionRuntime/utils/runtimeCoordinateToStringIds.d.ts +0 -2
- package/build/types/devtools/browser/NiceActionDevtools.d.ts +0 -14
- package/build/types/devtools/browser/components/ActionErrorDisplay.d.ts +0 -5
- package/build/types/devtools/browser/components/CallStackSection.d.ts +0 -8
- package/build/types/devtools/browser/components/ChildDispatchChips.d.ts +0 -6
- package/build/types/devtools/browser/components/Chip.d.ts +0 -22
- package/build/types/devtools/browser/components/DetailSection.d.ts +0 -5
- package/build/types/devtools/browser/components/DomainChip.d.ts +0 -8
- package/build/types/devtools/browser/components/HandlerChips.d.ts +0 -21
- package/build/types/devtools/browser/components/Icon.d.ts +0 -16
- package/build/types/devtools/browser/components/MetaSection.d.ts +0 -4
- package/build/types/devtools/browser/components/NiceErrorDisplay.d.ts +0 -19
- package/build/types/devtools/browser/components/OriginChip.d.ts +0 -15
- package/build/types/devtools/browser/components/PanelChrome.d.ts +0 -41
- package/build/types/devtools/browser/components/RoutingSection.d.ts +0 -5
- package/build/types/devtools/browser/components/RunningTimer.d.ts +0 -7
- package/build/types/devtools/browser/components/SectionLabel.d.ts +0 -4
- package/build/types/devtools/browser/components/StackTraceSection.d.ts +0 -9
- package/build/types/devtools/browser/components/Tooltip.d.ts +0 -24
- package/build/types/devtools/browser/components/action_detail/ActionDetailPanel.d.ts +0 -7
- package/build/types/devtools/browser/components/action_list/ActionEntryRow.d.ts +0 -14
- package/build/types/devtools/browser/components/action_list/ActionInputAndOutputChip.d.ts +0 -11
- package/build/types/devtools/browser/components/action_list/ActionList.d.ts +0 -10
- package/build/types/devtools/browser/components/action_list/IoTooltipContent.d.ts +0 -6
- package/build/types/devtools/browser/components/action_list/action_list.types.d.ts +0 -4
- package/build/types/devtools/browser/components/sourceMapResolver.d.ts +0 -6
- package/build/types/devtools/browser/components/utils.d.ts +0 -22
- package/build/types/devtools/browser/devtools_dock.d.ts +0 -54
- package/build/types/devtools/browser/devtools_storage.d.ts +0 -6
- package/build/types/devtools/browser/index.d.ts +0 -3
- package/build/types/devtools/browser/ui_util/size.d.ts +0 -6
- package/build/types/devtools/core/ActionDevtools.types.d.ts +0 -55
- package/build/types/devtools/core/ActionDevtoolsCore.d.ts +0 -14
- package/build/types/devtools/core/devtools_colors.d.ts +0 -63
- package/build/types/devtools/server/NiceActionServerDevtools.d.ts +0 -30
- package/build/types/devtools/server/index.d.ts +0 -3
- package/build/types/errors/err_nice_action.d.ts +0 -96
- package/build/types/index.d.ts +0 -41
- package/build/types/nice_action.static.d.ts +0 -3
- package/build/types/react-query/hooks/useActionMutation.d.ts +0 -10
- package/build/types/react-query/hooks/useActionQuery.d.ts +0 -17
- package/build/types/react-query/index.d.ts +0 -2
- package/build/types/utils/assertIsActionJson.d.ts +0 -2
- package/build/types/utils/decodeActionFrame.d.ts +0 -17
- package/build/types/utils/getAssumedRuntimeEnvironment.d.ts +0 -2
- package/build/types/utils/hashPayloadData.d.ts +0 -5
- package/build/types/utils/isActionPayload_Any_JsonObject.d.ts +0 -2
- package/build/types/utils/isActionPayload_Progress_JsonObject.d.ts +0 -2
- package/build/types/utils/isActionPayload_Request_JsonObject.d.ts +0 -2
- package/build/types/utils/isActionPayload_Result_JsonObject.d.ts +0 -2
- package/build/types/utils/isAction_Any_Instance.d.ts +0 -3
- package/build/types/utils/isAction_Any_JsonObject.d.ts +0 -2
- package/build/types/utils/isAction_Base_JsonObject.d.ts +0 -2
- package/build/types/utils/isAction_Context_JsonObject.d.ts +0 -2
- package/build/types/utils/isAction_Core_JsonObject.d.ts +0 -2
- package/build/types/utils/typescript/MaybePromise.d.ts +0 -1
- package/build/types/utils/wait.utils.d.ts +0 -13
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import type { ClientCryptoKeyLink, TTypeAndId } from "@nice-code/util";
|
|
2
|
-
import type { IActionRouteItemHandler } from "../../../ActionDefinition/Action/Payload/ActionPayload.types";
|
|
3
|
-
import { type TActionPayload_Any_Instance, type TActionPayload_Any_JsonObject } from "../../../ActionDefinition/Action/Payload/ActionPayload.types";
|
|
4
|
-
import type { ActionPayload_Request } from "../../../ActionDefinition/Action/Payload/ActionPayload_Request";
|
|
5
|
-
import { RunningAction } from "../../../ActionDefinition/Action/RunningAction";
|
|
6
|
-
import type { IActionDomain } from "../../../ActionDefinition/Domain/ActionDomain.types";
|
|
7
|
-
import { ActionRuntime } from "../../ActionRuntime";
|
|
8
|
-
import { type IRuntimeCoordinate, RuntimeCoordinate } from "../../RuntimeCoordinate";
|
|
9
|
-
import type { IHandleActionOptions } from "../ActionHandler.types";
|
|
10
|
-
import { ActionExternalClientHandler } from "../ExternalClient/ActionExternalClientHandler";
|
|
11
|
-
import { ESecurityLevel, type IClientVerifyKeyResolver, type IHandshakeEncryptionKeyMaterial } from "../ExternalClient/Transport/WebSocket/actionWsHandshake";
|
|
12
|
-
import type { IActionTransportReadyData_Ws } from "../ExternalClient/Transport/WebSocket/TransportWebSocket.types";
|
|
13
|
-
/** The codec shape `ActionServerHandler` uses to pack/unpack frames — same as the WS transport's. */
|
|
14
|
-
export type TActionChannelFormatMessage = NonNullable<IActionTransportReadyData_Ws["formatMessage"]>;
|
|
15
|
-
/** How a connection encodes its frames, remembered so we answer each client in its own dialect. */
|
|
16
|
-
export type TActionConnectionEncoding = "json" | "binary";
|
|
17
|
-
/** A connection's restorable identity — what to persist so a binding survives transport eviction. */
|
|
18
|
-
export interface IActionServerConnectionBinding {
|
|
19
|
-
/** Full client coordinate, so `originClient` can be re-injected into frames that omit it. */
|
|
20
|
-
client: IRuntimeCoordinate;
|
|
21
|
-
encoding: TActionConnectionEncoding;
|
|
22
|
-
/**
|
|
23
|
-
* Secure-session state (set once a connection's handshake completes). Persist it alongside the
|
|
24
|
-
* binding so an authenticated/encrypted connection resumes after eviction without re-handshaking —
|
|
25
|
-
* the `keyMaterial` lets the server re-derive the shared key from its own persisted identity.
|
|
26
|
-
*/
|
|
27
|
-
secure?: {
|
|
28
|
-
securityLevel: ESecurityLevel;
|
|
29
|
-
linkedClientId: TTypeAndId;
|
|
30
|
-
keyMaterial?: IHandshakeEncryptionKeyMaterial;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Server-side secure-channel config. When set, each connection negotiates a level from
|
|
35
|
-
* {@link securityLevel}: an `authenticated`/`encrypted` client must complete the handshake (and is then
|
|
36
|
-
* bound to its *authenticated* coordinate) before any action frame is accepted. A `none` client (only
|
|
37
|
-
* when `none` is in the allowed set) is accepted as-is with a self-asserted identity. For the
|
|
38
|
-
* `encrypted` level the codec source should be a session factory (`createFormatMessage`).
|
|
39
|
-
*/
|
|
40
|
-
export interface IActionServerSecurity {
|
|
41
|
-
/**
|
|
42
|
-
* Accepted level(s). A single level is strict; an array is a negotiable allowed set — the server
|
|
43
|
-
* adopts whichever level each client requests (e.g. `[none, authenticated, encrypted]` serves all
|
|
44
|
-
* three over one endpoint).
|
|
45
|
-
*/
|
|
46
|
-
securityLevel: ESecurityLevel | readonly ESecurityLevel[];
|
|
47
|
-
/** This server's crypto identity (verify + exchange key pairs, optionally persisted). */
|
|
48
|
-
link: ClientCryptoKeyLink;
|
|
49
|
-
/** This server's coordinate — its identity to clients during the handshake. */
|
|
50
|
-
localCoordinate: IRuntimeCoordinate;
|
|
51
|
-
/** Wire dictionary version; the handshake rejects a client on a mismatch. */
|
|
52
|
-
dictionaryVersion: string;
|
|
53
|
-
/** Trust decision for a client's verify key (defaults to in-memory TOFU inside the handshake). */
|
|
54
|
-
verifyKeyResolver?: IClientVerifyKeyResolver;
|
|
55
|
-
}
|
|
56
|
-
interface IActionServerHandlerBaseOptions<TConn> {
|
|
57
|
-
/**
|
|
58
|
-
* Coordinate of the *connecting clients* (typically env-only, e.g. `RuntimeCoordinate.env("web_app")`).
|
|
59
|
-
* The runtime's return-path dispatch scores incoming actions' `originClient` against this to pick
|
|
60
|
-
* this handler for sending results/pushes back over the right channel.
|
|
61
|
-
*/
|
|
62
|
-
clientEnv: RuntimeCoordinate;
|
|
63
|
-
/** Write an encoded frame to a specific live connection (e.g. `(ws, frame) => ws.send(frame)`). */
|
|
64
|
-
send: (connection: TConn, frame: string | Uint8Array | ArrayBuffer) => void;
|
|
65
|
-
/** Timeout (ms) applied to server-initiated actions awaiting a client response. */
|
|
66
|
-
defaultTimeout?: number;
|
|
67
|
-
/**
|
|
68
|
-
* Called once when a connection is first bound to a client identity. Use it to persist the binding
|
|
69
|
-
* for transports that can resume after eviction — e.g. a Durable Object's hibernatable WebSocket:
|
|
70
|
-
* `(ws, binding) => ws.serializeAttachment(binding)` — then replay it via {@link ActionServerHandler.rehydrateConnection}
|
|
71
|
-
* when the channel comes back.
|
|
72
|
-
*/
|
|
73
|
-
onConnectionBound?: (connection: TConn, binding: IActionServerConnectionBinding) => void;
|
|
74
|
-
/**
|
|
75
|
-
* Enable the authenticated (optionally encrypted) handshake. When omitted, connections are trusted
|
|
76
|
-
* as-is (identity self-asserted) — fine for dev / trusted networks.
|
|
77
|
-
*/
|
|
78
|
-
security?: IActionServerSecurity;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Provide exactly one codec source:
|
|
82
|
-
* - `formatMessage` — a single shared codec for every connection (stateless, e.g. `createBinaryWsAdapter`).
|
|
83
|
-
* - `createFormatMessage` — a per-connection factory for stateful codecs (e.g.
|
|
84
|
-
* `createBinaryWsSessionFactory`, whose sessions hold correlation + identity state). Required for the
|
|
85
|
-
* leanest binary wire; the handler creates and caches one codec per connection.
|
|
86
|
-
*/
|
|
87
|
-
export type IActionServerHandlerOptions<TConn> = IActionServerHandlerBaseOptions<TConn> & ({
|
|
88
|
-
formatMessage: TActionChannelFormatMessage;
|
|
89
|
-
createFormatMessage?: never;
|
|
90
|
-
} | {
|
|
91
|
-
createFormatMessage: () => TActionChannelFormatMessage;
|
|
92
|
-
formatMessage?: never;
|
|
93
|
-
});
|
|
94
|
-
/**
|
|
95
|
-
* Server-side handler for backends that accept many client connections over a single open channel
|
|
96
|
-
* (WebSockets, Durable Objects, …). It is transport-agnostic: you feed it inbound frames with
|
|
97
|
-
* {@link receive} and tell it how to write outbound frames via the `send` option.
|
|
98
|
-
*
|
|
99
|
-
* Add it alongside your local execution handler:
|
|
100
|
-
* ```ts
|
|
101
|
-
* const serverHandler = createServerHandler({ clientEnv, formatMessage, send: (ws, f) => ws.send(f) });
|
|
102
|
-
* runtime.addHandlers([localHandler, serverHandler]);
|
|
103
|
-
* // per inbound message (e.g. a Durable Object's webSocketMessage):
|
|
104
|
-
* serverHandler.receive(ws, message);
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* Inbound requests route to your local handler; the runtime's return dispatch then calls this
|
|
108
|
-
* handler back (it is an external handler keyed to `clientEnv`) to send the result to the originating
|
|
109
|
-
* connection. The handler keeps a per-connection identity registry so each result lands on the right
|
|
110
|
-
* socket, and remembers each connection's encoding so binary and JSON clients can share the channel.
|
|
111
|
-
*
|
|
112
|
-
* It registers an empty action router, so it is never chosen to *execute* an inbound request — only
|
|
113
|
-
* to ferry results/pushes back out.
|
|
114
|
-
*/
|
|
115
|
-
export declare class ActionServerHandler<TConn = unknown> extends ActionExternalClientHandler {
|
|
116
|
-
private readonly _formatMessage?;
|
|
117
|
-
private readonly _createFormatMessage?;
|
|
118
|
-
private readonly _send;
|
|
119
|
-
private readonly _serverTimeout;
|
|
120
|
-
private _onConnectionBound?;
|
|
121
|
-
/** Incoming-data listeners installed by the runtime (`resolveIncomingActionPayload`). */
|
|
122
|
-
private readonly _incomingListeners;
|
|
123
|
-
private readonly _security?;
|
|
124
|
-
/** Normalized accepted levels; whether `none` (plain) is allowed; whether any level needs a handshake. */
|
|
125
|
-
private readonly _allowedLevels;
|
|
126
|
-
private readonly _noneAllowed;
|
|
127
|
-
private readonly _handshakeMode;
|
|
128
|
-
private readonly _connByClient;
|
|
129
|
-
private readonly _clientByConn;
|
|
130
|
-
private readonly _connEncoding;
|
|
131
|
-
private readonly _codecByConn;
|
|
132
|
-
private readonly _handshakeByConn;
|
|
133
|
-
private readonly _cryptoByConn;
|
|
134
|
-
private readonly _authedConns;
|
|
135
|
-
private readonly _plainConns;
|
|
136
|
-
private readonly _inboundChainByConn;
|
|
137
|
-
private readonly _outboundChainByConn;
|
|
138
|
-
constructor(options: IActionServerHandlerOptions<TConn>);
|
|
139
|
-
/**
|
|
140
|
-
* The codec for a connection: a per-connection session (cached) when a factory was provided, else
|
|
141
|
-
* the single shared `formatMessage`.
|
|
142
|
-
*/
|
|
143
|
-
private _codecFor;
|
|
144
|
-
_setIncomingActionDataListener(listener: (json: TActionPayload_Any_JsonObject<any>) => void): void;
|
|
145
|
-
/**
|
|
146
|
-
* Register (or replace) the connection-bound persistence callback after construction. Used by
|
|
147
|
-
* lifecycle helpers like {@link createHibernatableWsServerAdapter} so persistence and replay are
|
|
148
|
-
* owned by one place instead of being split across the constructor options.
|
|
149
|
-
*/
|
|
150
|
-
setOnConnectionBound(onConnectionBound: (connection: TConn, binding: IActionServerConnectionBinding) => void): void;
|
|
151
|
-
/**
|
|
152
|
-
* Feed one inbound frame from a connection into the runtime. Decodes text or binary, binds the
|
|
153
|
-
* connection to the requesting client's identity, then routes it (requests execute locally;
|
|
154
|
-
* results/progress resolve pending server-initiated actions).
|
|
155
|
-
*/
|
|
156
|
-
receive(connection: TConn, frame: string | ArrayBuffer | Uint8Array): void;
|
|
157
|
-
private _receivePlain;
|
|
158
|
-
private _receiveSecure;
|
|
159
|
-
private _completeServerHandshake;
|
|
160
|
-
/**
|
|
161
|
-
* Ensure an inbound request carries the client's identity and that this connection is bound to it,
|
|
162
|
-
* so its result can be routed back. A session codec omits `originClient` after the first request, so
|
|
163
|
-
* when it's missing we restore it from the (possibly rehydrated) binding instead. (Plain mode only;
|
|
164
|
-
* secure mode binds the authenticated coordinate at handshake time.)
|
|
165
|
-
*/
|
|
166
|
-
private _resolveRequestIdentity;
|
|
167
|
-
/**
|
|
168
|
-
* Restore a connection→client binding without an inbound frame — for transports that resume after
|
|
169
|
-
* eviction. Pair it with the {@link IActionServerHandlerOptions.onConnectionBound} hook: persist
|
|
170
|
-
* the binding there, then replay each live connection here when the channel comes back (e.g. a
|
|
171
|
-
* Durable Object iterating `ctx.getWebSockets()` as it wakes from hibernation).
|
|
172
|
-
*/
|
|
173
|
-
rehydrateConnection(connection: TConn, binding: IActionServerConnectionBinding): void;
|
|
174
|
-
toHandlerRouteItem(): IActionRouteItemHandler;
|
|
175
|
-
/** Forget a connection (call on socket close) so stale entries don't misroute later results. */
|
|
176
|
-
dropConnection(connection: TConn): void;
|
|
177
|
-
/** Live connection for a client coordinate, if currently registered. */
|
|
178
|
-
getConnectionForClient(client: RuntimeCoordinate): TConn | undefined;
|
|
179
|
-
/**
|
|
180
|
-
* Send (and optionally await) a server-initiated action to a specific connected client. Pass the
|
|
181
|
-
* connection token directly (e.g. the `ws`) or a client `RuntimeCoordinate` to look one up.
|
|
182
|
-
*/
|
|
183
|
-
pushToClient<DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string>(runtime: ActionRuntime, target: TConn | RuntimeCoordinate, request: ActionPayload_Request<DOM, ID>, options?: {
|
|
184
|
-
timeout?: number;
|
|
185
|
-
}): RunningAction<DOM, ID>;
|
|
186
|
-
sendReturnPayload(payload: TActionPayload_Any_Instance<any, any>, config: {
|
|
187
|
-
targetLocalRuntime: ActionRuntime;
|
|
188
|
-
}): Promise<boolean>;
|
|
189
|
-
handleActionRequest<DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string>(action: ActionPayload_Request<DOM, ID>, config?: IHandleActionOptions): Promise<RunningAction<DOM, ID>>;
|
|
190
|
-
private _dispatch;
|
|
191
|
-
private _sendPayload;
|
|
192
|
-
private _bindConnection;
|
|
193
|
-
private _resolveConnection;
|
|
194
|
-
private _resolveSingleConnection;
|
|
195
|
-
}
|
|
196
|
-
export declare const createServerHandler: <TConn = unknown>(options: IActionServerHandlerOptions<TConn>) => ActionServerHandler<TConn>;
|
|
197
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { type StorageAdapter } from "@nice-code/util";
|
|
2
|
-
import type { ActionRuntime } from "../../ActionRuntime";
|
|
3
|
-
import type { RuntimeCoordinate } from "../../RuntimeCoordinate";
|
|
4
|
-
import { ESecurityLevel, type IClientVerifyKeyResolver } from "../ExternalClient/Transport/WebSocket/actionWsHandshake";
|
|
5
|
-
import type { ISecureWsChannel } from "../ExternalClient/Transport/WebSocket/secureWsChannel";
|
|
6
|
-
import { ActionServerHandler, type IActionServerConnectionBinding } from "./ActionServerHandler";
|
|
7
|
-
export interface ISecureActionServerHandlerOptions<TConn> {
|
|
8
|
-
/** The shared channel identity (codec + dictionary version) — same one the clients use. */
|
|
9
|
-
channel: ISecureWsChannel;
|
|
10
|
-
/**
|
|
11
|
-
* Coordinate of the *connecting clients* (typically env-only, e.g. `RuntimeCoordinate.env("web_app")`),
|
|
12
|
-
* used to route results/pushes back over this handler.
|
|
13
|
-
*/
|
|
14
|
-
clientEnv: RuntimeCoordinate;
|
|
15
|
-
/** This server's runtime — its coordinate is the server identity presented in the handshake. */
|
|
16
|
-
runtime: ActionRuntime;
|
|
17
|
-
/**
|
|
18
|
-
* One backing store for the server's crypto identity *and* its trust-on-first-use verify-key pins.
|
|
19
|
-
* Their keys don't collide, so a single adapter is enough; back it with persistent storage (e.g. a
|
|
20
|
-
* Durable Object's storage) so identity and pins survive eviction.
|
|
21
|
-
*/
|
|
22
|
-
storageAdapter: StorageAdapter;
|
|
23
|
-
/** Write an encoded frame to a specific live connection (e.g. `(ws, frame) => ws.send(frame)`). */
|
|
24
|
-
send: (connection: TConn, frame: string | Uint8Array | ArrayBuffer) => void;
|
|
25
|
-
/** Accepted level(s); defaults to negotiating any of none/authenticated/encrypted. */
|
|
26
|
-
securityLevel?: ESecurityLevel | readonly ESecurityLevel[];
|
|
27
|
-
/** Trust decision for a client's verify key; defaults to storage-backed TOFU over `storageAdapter`. */
|
|
28
|
-
verifyKeyResolver?: IClientVerifyKeyResolver;
|
|
29
|
-
/** Timeout (ms) applied to server-initiated actions awaiting a client response. */
|
|
30
|
-
defaultTimeout?: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Build an {@link ActionServerHandler} for the secure binary channel with the boilerplate folded in:
|
|
34
|
-
* it creates the {@link ClientCryptoKeyLink} and the storage-backed TOFU resolver from a single
|
|
35
|
-
* `storageAdapter`, installs the channel's per-connection codec, and assembles the `security` block
|
|
36
|
-
* from the runtime coordinate + channel version (accepting all three levels by default).
|
|
37
|
-
*
|
|
38
|
-
* For a hibernatable transport (e.g. a Durable Object), pair it with
|
|
39
|
-
* {@link createHibernatableWsServerAdapter} to wire persistence + replay.
|
|
40
|
-
*/
|
|
41
|
-
export declare function createSecureActionServerHandler<TConn = unknown>(options: ISecureActionServerHandlerOptions<TConn>): ActionServerHandler<TConn>;
|
|
42
|
-
export interface IHibernatableWsServerAdapterOptions<TConn> {
|
|
43
|
-
/** The handler to drive (from {@link createSecureActionServerHandler} or `createServerHandler`). */
|
|
44
|
-
handler: ActionServerHandler<TConn>;
|
|
45
|
-
/** All currently-live connections — replayed on construction to rebuild bindings after a wake. */
|
|
46
|
-
getWebSockets: () => TConn[];
|
|
47
|
-
/** Read a connection's persisted binding (e.g. `(ws) => ws.deserializeAttachment()`). */
|
|
48
|
-
getAttachment: (connection: TConn) => IActionServerConnectionBinding | undefined;
|
|
49
|
-
/** Persist a connection's binding when it is bound (e.g. `(ws, b) => ws.serializeAttachment(b)`). */
|
|
50
|
-
setAttachment: (connection: TConn, binding: IActionServerConnectionBinding) => void;
|
|
51
|
-
}
|
|
52
|
-
export interface IHibernatableWsServerAdapter<TConn> {
|
|
53
|
-
/** Feed one inbound frame from a connection into the handler. */
|
|
54
|
-
receive: (connection: TConn, frame: string | ArrayBuffer | Uint8Array) => void;
|
|
55
|
-
/** Forget a connection (call on socket close/error). */
|
|
56
|
-
drop: (connection: TConn) => void;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Wire the hibernation lifecycle for a server handler on a transport whose sockets outlive process
|
|
60
|
-
* eviction (e.g. a Durable Object's hibernatable WebSockets). It owns persistence end to end:
|
|
61
|
-
* registers `setAttachment` as the handler's connection-bound callback and immediately replays every
|
|
62
|
-
* live connection's stored binding via `getAttachment`, so results/pushes still route after a wake.
|
|
63
|
-
*
|
|
64
|
-
* Construct it once when the handler is built, then forward socket events:
|
|
65
|
-
* ```ts
|
|
66
|
-
* const wsServer = createHibernatableWsServerAdapter({ handler, getWebSockets, getAttachment, setAttachment });
|
|
67
|
-
* // webSocketMessage(ws, msg) => wsServer.receive(ws, msg);
|
|
68
|
-
* // webSocketClose/Error(ws) => wsServer.drop(ws);
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
export declare function createHibernatableWsServerAdapter<TConn>(options: IHibernatableWsServerAdapterOptions<TConn>): IHibernatableWsServerAdapter<TConn>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { INiceActionIdAndDomain } from "../../ActionDefinition/Action/ActionBase.types";
|
|
2
|
-
import type { ActionCore } from "../../ActionDefinition/Action/Core/ActionCore";
|
|
3
|
-
import type { ActionDomain } from "../../ActionDefinition/Domain/ActionDomain";
|
|
4
|
-
import type { IActionDomain } from "../../ActionDefinition/Domain/ActionDomain.types";
|
|
5
|
-
import { ActionDomainManager } from "../ActionDomainManager";
|
|
6
|
-
import type { IHandleActionOptions } from "../Handler/ActionHandler.types";
|
|
7
|
-
import { type IActionRouterContext, type TMatchHandlerKey } from "./ActionRouter.types";
|
|
8
|
-
export declare class ActionRouter<DATA> {
|
|
9
|
-
readonly domainManager: ActionDomainManager;
|
|
10
|
-
private actionRouteData;
|
|
11
|
-
private _context;
|
|
12
|
-
constructor(context: IActionRouterContext);
|
|
13
|
-
/** Copy all routes from another router into this one, replacing any overlapping keys. */
|
|
14
|
-
mergeRouter(actionRouter: ActionRouter<DATA>): void;
|
|
15
|
-
addDomainsFromOther(actionRouter: ActionRouter<DATA>): void;
|
|
16
|
-
/** All FNs registered for an action, ID-specific entries first then domain wildcard. */
|
|
17
|
-
getRouteDataEntriesForAction(action: {
|
|
18
|
-
domain: string;
|
|
19
|
-
id: string;
|
|
20
|
-
}): DATA[];
|
|
21
|
-
/** First FN registered for an action (ID-specific beats domain wildcard). */
|
|
22
|
-
getRouteDataForAction(action: INiceActionIdAndDomain): DATA | undefined;
|
|
23
|
-
private throwNoHandlerForAction;
|
|
24
|
-
getRouteDataEntriesForActionOrThrow(action: INiceActionIdAndDomain, context: IHandleActionOptions): DATA[];
|
|
25
|
-
getRouteDataForActionOrThrow(action: INiceActionIdAndDomain, context: IHandleActionOptions): DATA;
|
|
26
|
-
/** All FNs stored under an exact match key. */
|
|
27
|
-
getForKey(key: TMatchHandlerKey): readonly DATA[];
|
|
28
|
-
/** Every match key that has at least one registered FN. */
|
|
29
|
-
getRegisteredKeys(): TMatchHandlerKey[];
|
|
30
|
-
getDomains(): ActionDomain[];
|
|
31
|
-
/** Register a handler for all actions in a domain, replacing any existing one. */
|
|
32
|
-
forDomain<FOR_DOM extends IActionDomain>(domain: ActionDomain<FOR_DOM>, routeData: DATA): this;
|
|
33
|
-
forAction<ACT_DOM extends IActionDomain, ID extends keyof ACT_DOM["actionSchema"] & string>(action: ActionCore<ACT_DOM, ID>, routeData: DATA): this;
|
|
34
|
-
/** Register a handler for a specific action, replacing any existing one. */
|
|
35
|
-
forActionId<ACT_DOM extends IActionDomain, ID extends keyof ACT_DOM["actionSchema"] & string>(domain: ActionDomain<ACT_DOM>, id: ID, routeData: DATA): this;
|
|
36
|
-
/** Register one handler for several action IDs, replacing any existing ones. */
|
|
37
|
-
forActionIds<ACT_DOM extends IActionDomain, IDS extends ReadonlyArray<keyof ACT_DOM["actionSchema"] & string>>(domain: ActionDomain<ACT_DOM>, ids: IDS, routeData: DATA): this;
|
|
38
|
-
/** Register per-action handlers from a cases map, replacing any existing ones. */
|
|
39
|
-
forDomainActionCases<FOR_DOM extends IActionDomain>(domain: ActionDomain<FOR_DOM>, cases: {
|
|
40
|
-
[ID in keyof FOR_DOM["actionSchema"] & string]?: DATA;
|
|
41
|
-
}): this;
|
|
42
|
-
/** Append a handler for all actions in a domain (accumulates alongside existing). */
|
|
43
|
-
addForDomain<FOR_DOM extends IActionDomain>(domain: ActionDomain<FOR_DOM>, routeData: DATA): this;
|
|
44
|
-
/** Append a handler for a specific action (accumulates alongside existing). */
|
|
45
|
-
addForAction<ACT_DOM extends IActionDomain, ID extends keyof ACT_DOM["actionSchema"] & string>(domain: ActionDomain<ACT_DOM>, id: ID, routeData: DATA): this;
|
|
46
|
-
/** Append one handler for several action IDs (accumulates alongside existing). */
|
|
47
|
-
addForActionIds<ACT_DOM extends IActionDomain, IDS extends ReadonlyArray<keyof ACT_DOM["actionSchema"] & string>>(domain: ActionDomain<ACT_DOM>, ids: IDS, routeData: DATA): this;
|
|
48
|
-
/** Append per-action handlers from a cases map (accumulates alongside existing). */
|
|
49
|
-
addForDomainActionCases<FOR_DOM extends IActionDomain>(domain: ActionDomain<FOR_DOM>, cases: {
|
|
50
|
-
[ID in keyof FOR_DOM["actionSchema"] & string]?: DATA;
|
|
51
|
-
}): this;
|
|
52
|
-
/** Append a handler directly by its raw match key (used when the key is known ahead of time). */
|
|
53
|
-
addForKey(key: TMatchHandlerKey, routeData: DATA): this;
|
|
54
|
-
private _push;
|
|
55
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ActionRuntime } from "../ActionRuntime";
|
|
2
|
-
import type { TActionHandler } from "../Handler/ActionHandler.types";
|
|
3
|
-
/**
|
|
4
|
-
* Format: `dom[${domainName}]id[${actionId | "_"}]`
|
|
5
|
-
* The wildcard `_` matches any action ID within a domain.
|
|
6
|
-
*/
|
|
7
|
-
export type TMatchHandlerKey = `${"dom"}[${string}]id[${string | "_"}]`;
|
|
8
|
-
export declare enum EActionRouterContextType {
|
|
9
|
-
runtime_to_handler = "runtime_to_handler",
|
|
10
|
-
handler_route = "handler_route"
|
|
11
|
-
}
|
|
12
|
-
export interface IActionRouterContext_HandlerRoute {
|
|
13
|
-
contextType: EActionRouterContextType.handler_route;
|
|
14
|
-
handler: TActionHandler;
|
|
15
|
-
}
|
|
16
|
-
export interface IActionRouterContext_RuntimeToHandler {
|
|
17
|
-
contextType: EActionRouterContextType.runtime_to_handler;
|
|
18
|
-
runtime: ActionRuntime;
|
|
19
|
-
}
|
|
20
|
-
export type IActionRouterContext = IActionRouterContext_HandlerRoute | IActionRouterContext_RuntimeToHandler;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export interface IRuntimeCoordinateSpecifics {
|
|
2
|
-
/**
|
|
3
|
-
* A unique and persistent client ID (should stay the same between runtime instance reloads)
|
|
4
|
-
*/
|
|
5
|
-
perId?: string;
|
|
6
|
-
/**
|
|
7
|
-
* A unique instance (or "memory-only") ID (unique for each instance of an action runtime, which should generally
|
|
8
|
-
* not persist between reloads, depending on the architecture)
|
|
9
|
-
*/
|
|
10
|
-
insId?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface IRuntimeCoordinate extends IRuntimeCoordinateSpecifics {
|
|
13
|
-
/**
|
|
14
|
-
* A static runtime environment identifier (e.g. "web_app_v1", "backend_analytics")
|
|
15
|
-
*/
|
|
16
|
-
envId: string;
|
|
17
|
-
}
|
|
18
|
-
export type TRuntimeCoordinateEnvId = `envId[${string}]`;
|
|
19
|
-
export type TRuntimeCoordinateStringId = `${TRuntimeCoordinateEnvId}perId[${string | "_"}]:insId[${string | "_"}]`;
|
|
20
|
-
export interface IRuntimeFullCoordinates extends Required<IRuntimeCoordinate> {
|
|
21
|
-
}
|
|
22
|
-
export declare class RuntimeCoordinate implements IRuntimeCoordinate {
|
|
23
|
-
readonly envId: string;
|
|
24
|
-
readonly perId?: string;
|
|
25
|
-
readonly insId?: string;
|
|
26
|
-
static get unknown(): RuntimeCoordinate;
|
|
27
|
-
static env(envId: string): RuntimeCoordinate;
|
|
28
|
-
withPersistentId(perId: string): RuntimeCoordinate;
|
|
29
|
-
constructor({ envId, perId, insId }: IRuntimeCoordinate);
|
|
30
|
-
specify(specifics: IRuntimeCoordinateSpecifics): RuntimeCoordinate;
|
|
31
|
-
specifyIfUnset(specifics: IRuntimeCoordinateSpecifics): RuntimeCoordinate;
|
|
32
|
-
toJsonObject(): IRuntimeCoordinate;
|
|
33
|
-
isExactlySame(other: IRuntimeCoordinate): boolean;
|
|
34
|
-
isSameFor(other: IRuntimeCoordinate): {
|
|
35
|
-
id: boolean;
|
|
36
|
-
perId: boolean;
|
|
37
|
-
insId: boolean;
|
|
38
|
-
};
|
|
39
|
-
similarityLevel(other: IRuntimeCoordinate): number;
|
|
40
|
-
get stringId(): TRuntimeCoordinateStringId;
|
|
41
|
-
/**
|
|
42
|
-
* Takes the "Runtime Coordinate" and generates a list of full coordinate IDs representing the runtime
|
|
43
|
-
* with decreasing levels of specificity.
|
|
44
|
-
*
|
|
45
|
-
* The first full coordinate ID is the most specific (including instance ID), while the last ID is
|
|
46
|
-
* the least specific (only environment ID).
|
|
47
|
-
*
|
|
48
|
-
* Example output for a RuntimeCoordinate with envId "web_app", perId "user123", and insId "instance456":
|
|
49
|
-
* [
|
|
50
|
-
* "envId[web_app]perId[user123]:insId[instance456]",
|
|
51
|
-
* "envId[web_app]perId[user123]:insId[_]",
|
|
52
|
-
* "envId[web_app]perId[_]:insId[_]"
|
|
53
|
-
* ]
|
|
54
|
-
*
|
|
55
|
-
* @returns a list of "full" runtime coordinate IDs with decreasing accuracy for targeting a runtime.
|
|
56
|
-
*/
|
|
57
|
-
toStringIds(): TRuntimeCoordinateStringId[];
|
|
58
|
-
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { ActionRuntime } from "../../ActionRuntime";
|
|
2
|
-
import { type ActionExternalClientHandler } from "../../Handler/ExternalClient/ActionExternalClientHandler";
|
|
3
|
-
import { CustomTransport } from "../../Handler/ExternalClient/Transport/Custom/CustomTransport";
|
|
4
|
-
import { type ActionLocalHandler } from "../../Handler/Local/ActionLocalHandler";
|
|
5
|
-
export declare function _test_createCustomTransport(externalClientRuntime: ActionRuntime): CustomTransport;
|
|
6
|
-
export declare function _test_createActions(): {
|
|
7
|
-
domains: {
|
|
8
|
-
root: import("../../..").ActionRootDomain<import("../../..").IActionRootDomain<"test_root">>;
|
|
9
|
-
test_dom_user: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
10
|
-
domain: string;
|
|
11
|
-
actions: {
|
|
12
|
-
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
13
|
-
username: string;
|
|
14
|
-
password: string;
|
|
15
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
16
|
-
success: boolean;
|
|
17
|
-
}, any>, readonly []>;
|
|
18
|
-
};
|
|
19
|
-
}>>;
|
|
20
|
-
test_dom_edit_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
21
|
-
domain: string;
|
|
22
|
-
actions: {
|
|
23
|
-
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
24
|
-
docId: string;
|
|
25
|
-
newContent: string;
|
|
26
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
27
|
-
success: boolean;
|
|
28
|
-
}, any>, readonly []>;
|
|
29
|
-
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
30
|
-
docId: string;
|
|
31
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
32
|
-
content: string;
|
|
33
|
-
}, any>, readonly []>;
|
|
34
|
-
};
|
|
35
|
-
}>>;
|
|
36
|
-
test_dom_push_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
37
|
-
domain: string;
|
|
38
|
-
actions: {
|
|
39
|
-
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
40
|
-
docId: string;
|
|
41
|
-
updateContent: string;
|
|
42
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
43
|
-
updated: boolean;
|
|
44
|
-
}, any>, readonly []>;
|
|
45
|
-
};
|
|
46
|
-
}>>;
|
|
47
|
-
};
|
|
48
|
-
actions: {
|
|
49
|
-
action_user_sign_in: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
50
|
-
domain: string;
|
|
51
|
-
actions: {
|
|
52
|
-
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
53
|
-
username: string;
|
|
54
|
-
password: string;
|
|
55
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
56
|
-
success: boolean;
|
|
57
|
-
}, any>, readonly []>;
|
|
58
|
-
};
|
|
59
|
-
}>, "sign_in">;
|
|
60
|
-
action_edit_doc_edit: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
61
|
-
domain: string;
|
|
62
|
-
actions: {
|
|
63
|
-
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
64
|
-
docId: string;
|
|
65
|
-
newContent: string;
|
|
66
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
67
|
-
success: boolean;
|
|
68
|
-
}, any>, readonly []>;
|
|
69
|
-
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
70
|
-
docId: string;
|
|
71
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
72
|
-
content: string;
|
|
73
|
-
}, any>, readonly []>;
|
|
74
|
-
};
|
|
75
|
-
}>, "edit_doc">;
|
|
76
|
-
action_edit_doc_get: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
77
|
-
domain: string;
|
|
78
|
-
actions: {
|
|
79
|
-
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
80
|
-
docId: string;
|
|
81
|
-
newContent: string;
|
|
82
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
83
|
-
success: boolean;
|
|
84
|
-
}, any>, readonly []>;
|
|
85
|
-
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
86
|
-
docId: string;
|
|
87
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
88
|
-
content: string;
|
|
89
|
-
}, any>, readonly []>;
|
|
90
|
-
};
|
|
91
|
-
}>, "get_doc">;
|
|
92
|
-
action_push_doc_update: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
93
|
-
domain: string;
|
|
94
|
-
actions: {
|
|
95
|
-
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
96
|
-
docId: string;
|
|
97
|
-
updateContent: string;
|
|
98
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
99
|
-
updated: boolean;
|
|
100
|
-
}, any>, readonly []>;
|
|
101
|
-
};
|
|
102
|
-
}>, "push_doc_update">;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
export declare const _test_createTestActionRuntimeData: () => {
|
|
106
|
-
domains: {
|
|
107
|
-
root: import("../../..").ActionRootDomain<import("../../..").IActionRootDomain<"test_root">>;
|
|
108
|
-
test_dom_user: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
109
|
-
domain: string;
|
|
110
|
-
actions: {
|
|
111
|
-
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
112
|
-
username: string;
|
|
113
|
-
password: string;
|
|
114
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
115
|
-
success: boolean;
|
|
116
|
-
}, any>, readonly []>;
|
|
117
|
-
};
|
|
118
|
-
}>>;
|
|
119
|
-
test_dom_edit_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
120
|
-
domain: string;
|
|
121
|
-
actions: {
|
|
122
|
-
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
123
|
-
docId: string;
|
|
124
|
-
newContent: string;
|
|
125
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
126
|
-
success: boolean;
|
|
127
|
-
}, any>, readonly []>;
|
|
128
|
-
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
129
|
-
docId: string;
|
|
130
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
131
|
-
content: string;
|
|
132
|
-
}, any>, readonly []>;
|
|
133
|
-
};
|
|
134
|
-
}>>;
|
|
135
|
-
test_dom_push_doc: import("../../..").ActionDomain<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
136
|
-
domain: string;
|
|
137
|
-
actions: {
|
|
138
|
-
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
139
|
-
docId: string;
|
|
140
|
-
updateContent: string;
|
|
141
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
142
|
-
updated: boolean;
|
|
143
|
-
}, any>, readonly []>;
|
|
144
|
-
};
|
|
145
|
-
}>>;
|
|
146
|
-
};
|
|
147
|
-
actions: {
|
|
148
|
-
action_user_sign_in: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
149
|
-
domain: string;
|
|
150
|
-
actions: {
|
|
151
|
-
sign_in: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
152
|
-
username: string;
|
|
153
|
-
password: string;
|
|
154
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
155
|
-
success: boolean;
|
|
156
|
-
}, any>, readonly []>;
|
|
157
|
-
};
|
|
158
|
-
}>, "sign_in">;
|
|
159
|
-
action_edit_doc_edit: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
160
|
-
domain: string;
|
|
161
|
-
actions: {
|
|
162
|
-
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
163
|
-
docId: string;
|
|
164
|
-
newContent: string;
|
|
165
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
166
|
-
success: boolean;
|
|
167
|
-
}, any>, readonly []>;
|
|
168
|
-
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
169
|
-
docId: string;
|
|
170
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
171
|
-
content: string;
|
|
172
|
-
}, any>, readonly []>;
|
|
173
|
-
};
|
|
174
|
-
}>, "edit_doc">;
|
|
175
|
-
action_edit_doc_get: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
176
|
-
domain: string;
|
|
177
|
-
actions: {
|
|
178
|
-
edit_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
179
|
-
docId: string;
|
|
180
|
-
newContent: string;
|
|
181
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
182
|
-
success: boolean;
|
|
183
|
-
}, any>, readonly []>;
|
|
184
|
-
get_doc: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
185
|
-
docId: string;
|
|
186
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
187
|
-
content: string;
|
|
188
|
-
}, any>, readonly []>;
|
|
189
|
-
};
|
|
190
|
-
}>, "get_doc">;
|
|
191
|
-
action_push_doc_update: import("../../..").ActionCore<import("../../..").TActionDomainChildDef<import("../../..").IActionRootDomain<"test_root">, {
|
|
192
|
-
domain: string;
|
|
193
|
-
actions: {
|
|
194
|
-
push_doc_update: import("../../..").ActionSchema<import("../../..").TTransportedValue<{
|
|
195
|
-
docId: string;
|
|
196
|
-
updateContent: string;
|
|
197
|
-
}, any>, import("../../..").TTransportedValue<{
|
|
198
|
-
updated: boolean;
|
|
199
|
-
}, any>, readonly []>;
|
|
200
|
-
};
|
|
201
|
-
}>, "push_doc_update">;
|
|
202
|
-
};
|
|
203
|
-
web_app_to_server_handler: ActionExternalClientHandler;
|
|
204
|
-
web_app_runtime: ActionRuntime;
|
|
205
|
-
server_runtime: ActionRuntime;
|
|
206
|
-
server_action_handler: ActionLocalHandler;
|
|
207
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IDevtoolsActionEntry, TDevtoolsPosition } from "../core/ActionDevtools.types";
|
|
2
|
-
import type { ActionDevtoolsCore } from "../core/ActionDevtoolsCore";
|
|
3
|
-
export interface INiceActionDevtoolsProps {
|
|
4
|
-
core: ActionDevtoolsCore;
|
|
5
|
-
position?: TDevtoolsPosition;
|
|
6
|
-
initialOpen?: boolean;
|
|
7
|
-
/** Show the panel even when NODE_ENV is not "development". */
|
|
8
|
-
forceEnable?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface IEntryGroup {
|
|
11
|
-
representative: IDevtoolsActionEntry;
|
|
12
|
-
rest: IDevtoolsActionEntry[];
|
|
13
|
-
}
|
|
14
|
-
export declare function NiceActionDevtools({ forceEnable, ...props }: INiceActionDevtoolsProps): import("react/jsx-runtime").JSX.Element | null;
|