@nice-code/action 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/devtools/browser/index.js +2067 -0
- package/build/devtools/server/index.js +235 -0
- package/build/index.js +51 -21
- package/build/types/ActionDefinition/Action/Payload/ActionPayload_Request.d.ts +1 -0
- package/build/types/ActionDefinition/Action/RunningAction.d.ts +2 -0
- package/build/types/ActionDefinition/Action/RunningAction.types.d.ts +2 -0
- package/build/types/ActionRuntime/ActionRuntime.d.ts +4 -2
- package/build/types/ActionRuntime/HandlerCallStack.d.ts +3 -0
- package/build/types/ActionRuntime/RuntimeCoordinate.d.ts +9 -7
- package/build/types/devtools/browser/NiceActionDevtools.d.ts +8 -0
- package/build/types/devtools/browser/components/ActionDetailPanel.d.ts +7 -0
- package/build/types/devtools/browser/components/ActionEntryRow.d.ts +11 -0
- package/build/types/devtools/browser/components/CallStackSection.d.ts +8 -0
- package/build/types/devtools/browser/components/ChildDispatchChips.d.ts +4 -0
- package/build/types/devtools/browser/components/Chip.d.ts +11 -0
- package/build/types/devtools/browser/components/DetailSection.d.ts +5 -0
- package/build/types/devtools/browser/components/DomainChip.d.ts +14 -0
- package/build/types/devtools/browser/components/HandlerChips.d.ts +10 -0
- package/build/types/devtools/browser/components/MetaSection.d.ts +4 -0
- package/build/types/devtools/browser/components/PanelChrome.d.ts +14 -0
- package/build/types/devtools/browser/components/RoutingSection.d.ts +5 -0
- package/build/types/devtools/browser/components/RunningTimer.d.ts +7 -0
- package/build/types/devtools/browser/components/SectionLabel.d.ts +4 -0
- package/build/types/devtools/browser/components/StackTraceSection.d.ts +5 -0
- package/build/types/devtools/browser/components/utils.d.ts +7 -0
- package/build/types/devtools/browser/index.d.ts +3 -0
- package/build/types/devtools/core/ActionDevtools.types.d.ts +50 -0
- package/build/types/devtools/core/ActionDevtoolsCore.d.ts +14 -0
- package/build/types/devtools/server/NiceActionServerDevtools.d.ts +30 -0
- package/build/types/devtools/server/index.d.ts +3 -0
- package/build/types/index.d.ts +1 -1
- package/package.json +17 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { TActionProgress } from "../../ActionDefinition/Action/Payload/ActionPayload.types";
|
|
2
|
+
export type TDevtoolsActionStatus = "running" | "success" | "failed" | "aborted";
|
|
3
|
+
export type TDevtoolsPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left" | "dock-bottom" | "dock-top" | "dock-left" | "dock-right";
|
|
4
|
+
export interface IDevtoolsRouteItem {
|
|
5
|
+
runtime: {
|
|
6
|
+
envId: string;
|
|
7
|
+
perId?: string;
|
|
8
|
+
insId?: string;
|
|
9
|
+
};
|
|
10
|
+
handlerType: "local" | "external";
|
|
11
|
+
handlerClient?: {
|
|
12
|
+
envId: string;
|
|
13
|
+
perId?: string;
|
|
14
|
+
insId?: string;
|
|
15
|
+
};
|
|
16
|
+
transport?: string;
|
|
17
|
+
time: number;
|
|
18
|
+
}
|
|
19
|
+
export interface IDevtoolsActionMeta {
|
|
20
|
+
timeCreated: number;
|
|
21
|
+
originClient: {
|
|
22
|
+
envId: string;
|
|
23
|
+
perId?: string;
|
|
24
|
+
insId?: string;
|
|
25
|
+
};
|
|
26
|
+
routing: IDevtoolsRouteItem[];
|
|
27
|
+
}
|
|
28
|
+
export interface IDevtoolsActionEntry {
|
|
29
|
+
cuid: string;
|
|
30
|
+
actionId: string;
|
|
31
|
+
domain: string;
|
|
32
|
+
allDomains: string[];
|
|
33
|
+
status: TDevtoolsActionStatus;
|
|
34
|
+
startTime: number;
|
|
35
|
+
endTime?: number;
|
|
36
|
+
input: unknown;
|
|
37
|
+
output?: unknown;
|
|
38
|
+
error?: unknown;
|
|
39
|
+
abortReason?: unknown;
|
|
40
|
+
progressUpdates: TActionProgress[];
|
|
41
|
+
meta: IDevtoolsActionMeta;
|
|
42
|
+
parentCuid?: string;
|
|
43
|
+
callSite?: string;
|
|
44
|
+
errorStack?: string;
|
|
45
|
+
}
|
|
46
|
+
export type TDevtoolsListener = (entries: readonly IDevtoolsActionEntry[]) => void;
|
|
47
|
+
export interface IDevtoolsObservableDomain {
|
|
48
|
+
domain: string;
|
|
49
|
+
addActionListener(listener: (update: any) => void): () => void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IDevtoolsActionEntry, IDevtoolsObservableDomain, TDevtoolsListener } from "./ActionDevtools.types";
|
|
2
|
+
export interface IActionDevtoolsCoreOptions {
|
|
3
|
+
}
|
|
4
|
+
export declare class ActionDevtoolsCore {
|
|
5
|
+
private _entries;
|
|
6
|
+
private _listeners;
|
|
7
|
+
constructor(_options?: IActionDevtoolsCoreOptions);
|
|
8
|
+
attachToDomain(domain: IDevtoolsObservableDomain): () => void;
|
|
9
|
+
getEntries(): readonly IDevtoolsActionEntry[];
|
|
10
|
+
subscribe(listener: TDevtoolsListener): () => void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
private _updateEntry;
|
|
13
|
+
private _notify;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { IDevtoolsObservableDomain } from "../core/ActionDevtools.types";
|
|
2
|
+
export type TServerDevtoolsLogFn = (message: string, data?: Record<string, unknown>) => void;
|
|
3
|
+
export interface IActionServerDevtoolsOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Custom logger function. Defaults to console.log / console.error.
|
|
6
|
+
*/
|
|
7
|
+
logger?: TServerDevtoolsLogFn;
|
|
8
|
+
/**
|
|
9
|
+
* Output format.
|
|
10
|
+
* - "pretty": human-readable lines (default)
|
|
11
|
+
* - "json": newline-delimited JSON for log aggregators
|
|
12
|
+
*/
|
|
13
|
+
format?: "pretty" | "json";
|
|
14
|
+
/**
|
|
15
|
+
* Whether to log action input/output payloads.
|
|
16
|
+
* Disable if payloads may contain sensitive data. Defaults to true.
|
|
17
|
+
*/
|
|
18
|
+
logPayloads?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether devtools are active. Defaults to process.env.NODE_ENV !== "production".
|
|
21
|
+
*/
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare class ActionServerDevtools {
|
|
25
|
+
private readonly _options;
|
|
26
|
+
private readonly _inFlight;
|
|
27
|
+
constructor(options?: IActionServerDevtoolsOptions);
|
|
28
|
+
attachToDomain(domain: IDevtoolsObservableDomain): () => void;
|
|
29
|
+
private _log;
|
|
30
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ActionServerDevtools, type IActionServerDevtoolsOptions, type TServerDevtoolsLogFn, } from "./NiceActionServerDevtools";
|
|
2
|
+
export { ActionDevtoolsCore, type IActionDevtoolsCoreOptions } from "../core/ActionDevtoolsCore";
|
|
3
|
+
export type { IDevtoolsActionEntry, IDevtoolsObservableDomain, TDevtoolsActionStatus, TDevtoolsListener, } from "../core/ActionDevtools.types";
|
package/build/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type { TActionTransportDef } from "./ActionRuntime/Handler/ExternalClient
|
|
|
24
24
|
export * from "./ActionRuntime/Handler/ExternalClient/Transport/Transport.types";
|
|
25
25
|
export * from "./ActionRuntime/Handler/ExternalClient/Transport/WebSocket/TransportWebSocket";
|
|
26
26
|
export { ActionLocalHandler, createLocalHandler, } from "./ActionRuntime/Handler/Local/ActionLocalHandler";
|
|
27
|
-
export
|
|
27
|
+
export * from "./ActionRuntime/RuntimeCoordinate";
|
|
28
28
|
export { EErrId_NiceAction, err_nice_action } from "./errors/err_nice_action";
|
|
29
29
|
export { isActionPayload_Any_JsonObject } from "./utils/isActionPayload_Any_JsonObject";
|
|
30
30
|
export * from "./utils/isActionPayload_Request_JsonObject";
|
package/package.json
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-code/action",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
+
"source": "./src/index.ts",
|
|
8
9
|
"types": "./build/types/index.d.ts",
|
|
9
10
|
"import": "./build/index.js"
|
|
10
11
|
},
|
|
11
12
|
"./react-query": {
|
|
13
|
+
"source": "./src/react-query/index.ts",
|
|
12
14
|
"types": "./build/types/react-query/index.d.ts",
|
|
13
15
|
"import": "./build/react-query/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./devtools/browser": {
|
|
18
|
+
"source": "./src/devtools/browser/index.ts",
|
|
19
|
+
"types": "./build/types/devtools/browser/index.d.ts",
|
|
20
|
+
"import": "./build/devtools/browser/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./devtools/server": {
|
|
23
|
+
"source": "./src/devtools/server/index.ts",
|
|
24
|
+
"types": "./build/types/devtools/server/index.d.ts",
|
|
25
|
+
"import": "./build/devtools/server/index.js"
|
|
14
26
|
}
|
|
15
27
|
},
|
|
16
28
|
"files": [
|
|
@@ -32,15 +44,17 @@
|
|
|
32
44
|
"build-types": "tsc --project tsconfig.build.json"
|
|
33
45
|
},
|
|
34
46
|
"dependencies": {
|
|
35
|
-
"@nice-code/
|
|
36
|
-
"@nice-code/
|
|
47
|
+
"@nice-code/common-errors": "0.2.13",
|
|
48
|
+
"@nice-code/error": "0.2.13",
|
|
37
49
|
"@standard-schema/spec": "^1.1.0",
|
|
50
|
+
"@tanstack/react-virtual": "^3.13.26",
|
|
38
51
|
"http-status-codes": "^2.3.0",
|
|
39
52
|
"nanoid": "^5.1.9",
|
|
40
53
|
"std-env": "^4.1.0"
|
|
41
54
|
},
|
|
42
55
|
"devDependencies": {
|
|
43
56
|
"@tanstack/react-query": "^5.100.3",
|
|
57
|
+
"@types/react": "^19.0.0",
|
|
44
58
|
"msw": "^2.13.6"
|
|
45
59
|
},
|
|
46
60
|
"peerDependencies": {
|