@rahdar/plugin-sdk 2026.10.51 → 2026.10.57
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/package.json +3 -3
- package/peers.json +2 -2
- package/types/kernel/actions/types.d.ts +35 -34
- package/types/kernel/api/paging.d.ts +5 -2
- package/types/kernel/api/request.d.ts +2 -2
- package/types/kernel/api/resourceId.d.ts +32 -0
- package/types/kernel/api/schema.d.ts +1478 -1720
- package/types/kernel/approvals/columns.d.ts +1 -1
- package/types/kernel/auth/api.d.ts +3 -3
- package/types/kernel/auth/useCan.d.ts +8 -8
- package/types/kernel/feature.d.ts +8 -2
- package/types/kernel/keyboard/useKeySequences.d.ts +3 -2
- package/types/kernel/nav/currentView.d.ts +5 -4
- package/types/kernel/registry.d.ts +3 -2
- package/types/kernel/routing/roots.d.ts +4 -1
- package/types/kernel/routing/search.d.ts +7 -0
- package/types/kernel/shell/CommandPalette.d.ts +1 -1
- package/types/kernel/shell/HomeView.d.ts +1 -5
- package/types/kernel/shell/lastPlace.d.ts +1 -1
- package/types/kernel/shell/useClusterSystem.d.ts +11 -0
- package/types/kernel/slots.d.ts +28 -23
- package/types/sdk/index.d.ts +2 -2
- package/types/ui/ConfirmDialog.d.ts +3 -3
- package/types/ui/DescriptionList.d.ts +1 -1
- package/types/ui/EmptyState.d.ts +1 -1
- package/types/ui/HoldToConfirm.d.ts +2 -2
- package/types/ui/LoadingState.d.ts +1 -1
- package/types/ui/NodeOutcomeSummary.d.ts +1 -1
- package/types/ui/Toolbar.d.ts +1 -1
- package/types/ui/capabilityGate.d.ts +7 -6
- package/types/ui/notify.d.ts +1 -1
- package/types/ui/table/DataTable.d.ts +1 -1
- package/types/ui/table/columns.d.ts +9 -0
- package/types/ui/table/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rahdar/plugin-sdk",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.57",
|
|
4
4
|
"description": "Build the UI of a Rahdar plugin: typings for the Rahdar APIs a plugin may use, and a Vite preset.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "19.3.
|
|
36
|
-
"react-dom": "19.3.
|
|
35
|
+
"react": "19.3.1",
|
|
36
|
+
"react-dom": "19.3.1",
|
|
37
37
|
"@mantine/core": "9.7.2",
|
|
38
38
|
"@mantine/hooks": "9.7.2",
|
|
39
39
|
"@tanstack/react-query": "5.104.1",
|
package/peers.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { ResourceRef } from '../api/resourceId.ts';
|
|
2
3
|
import type { components } from '../api/schema.d.ts';
|
|
3
4
|
import type { GateVerdict } from '../../ui/capabilityGate.ts';
|
|
5
|
+
export type { ResourceRef };
|
|
4
6
|
type Schemas = components['schemas'];
|
|
5
7
|
/**
|
|
6
8
|
* The sections of a row's action menu, in the order it shows them (ADR-0107). The list is closed,
|
|
@@ -25,65 +27,65 @@ export type ActionSection = (typeof ACTION_SECTIONS)[number]['id'];
|
|
|
25
27
|
* change the broker (Flow).
|
|
26
28
|
*/
|
|
27
29
|
export type ActionMode = 'act' | 'navigate';
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
snapshot?: Schemas['
|
|
30
|
+
export interface SubscriptionTarget extends ResourceRef {
|
|
31
|
+
/** The canonical id of the destination it is bound to. */
|
|
32
|
+
destination?: string | null;
|
|
33
|
+
snapshot?: Schemas['SubscriptionView'];
|
|
32
34
|
}
|
|
33
|
-
export interface
|
|
34
|
-
|
|
35
|
-
snapshot?: Schemas['AddressView'];
|
|
35
|
+
export interface DestinationTarget extends ResourceRef {
|
|
36
|
+
snapshot?: Schemas['DestinationView'];
|
|
36
37
|
}
|
|
37
|
-
/** Connections,
|
|
38
|
+
/** Connections, channels, consumers and producers are per node; a close needs to know which. */
|
|
38
39
|
interface NodeScoped {
|
|
39
40
|
nodeId: string;
|
|
40
41
|
nodeName: string;
|
|
41
42
|
}
|
|
42
|
-
export interface ConnectionTarget extends NodeScoped {
|
|
43
|
-
connectionId: string;
|
|
43
|
+
export interface ConnectionTarget extends ResourceRef, NodeScoped {
|
|
44
44
|
snapshot?: Schemas['ConnectionView'];
|
|
45
45
|
}
|
|
46
|
-
export interface
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
snapshot?: Schemas['
|
|
46
|
+
export interface ChannelTarget extends ResourceRef, NodeScoped {
|
|
47
|
+
/** The name of the connection the channel belongs to. */
|
|
48
|
+
connection?: string | null;
|
|
49
|
+
snapshot?: Schemas['ChannelView'];
|
|
50
50
|
}
|
|
51
|
-
export interface ConsumerTarget extends NodeScoped {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
export interface ConsumerTarget extends ResourceRef, NodeScoped {
|
|
52
|
+
/** The canonical id of the subscription it consumes from. */
|
|
53
|
+
subscription?: string | null;
|
|
54
|
+
/** The name of the channel it belongs to. */
|
|
55
|
+
channel?: string | null;
|
|
55
56
|
snapshot?: Schemas['ConsumerView'];
|
|
56
57
|
}
|
|
57
|
-
export interface ProducerTarget extends NodeScoped {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
export interface ProducerTarget extends ResourceRef, NodeScoped {
|
|
59
|
+
/** The canonical id of the destination it sends to. */
|
|
60
|
+
destination?: string | null;
|
|
61
|
+
/** The name of the channel it belongs to. */
|
|
62
|
+
channel?: string | null;
|
|
61
63
|
snapshot?: Schemas['ProducerView'];
|
|
62
64
|
}
|
|
63
65
|
export interface MessageTarget {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
/** The subscription the message sits in. */
|
|
67
|
+
subscription: ResourceRef;
|
|
68
|
+
position: string;
|
|
66
69
|
/** The node the message was browsed on; absent for the live node. */
|
|
67
70
|
node?: string;
|
|
68
71
|
}
|
|
69
|
-
export interface
|
|
70
|
-
|
|
71
|
-
snapshot?: Schemas['DivertView'];
|
|
72
|
+
export interface RouteTarget extends ResourceRef {
|
|
73
|
+
snapshot?: Schemas['RouteView'];
|
|
72
74
|
}
|
|
73
75
|
/** A client of the flow view: an identity that may stand for many connections. */
|
|
74
76
|
export interface ClientTarget {
|
|
75
77
|
label: string;
|
|
76
78
|
}
|
|
77
|
-
/** Each resource
|
|
79
|
+
/** Each resource role a row menu or a link can be about, with its target. */
|
|
78
80
|
export interface ActionTargets {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
destination: DestinationTarget;
|
|
82
|
+
subscription: SubscriptionTarget;
|
|
83
|
+
route: RouteTarget;
|
|
81
84
|
connection: ConnectionTarget;
|
|
82
|
-
|
|
85
|
+
channel: ChannelTarget;
|
|
83
86
|
consumer: ConsumerTarget;
|
|
84
87
|
producer: ProducerTarget;
|
|
85
88
|
message: MessageTarget;
|
|
86
|
-
divert: DivertTarget;
|
|
87
89
|
client: ClientTarget;
|
|
88
90
|
}
|
|
89
91
|
export type ActionKind = keyof ActionTargets;
|
|
@@ -111,7 +113,7 @@ export interface ActionHost {
|
|
|
111
113
|
explain(verdict: Blocked, what: string, options?: {
|
|
112
114
|
restoreFocus?: () => void;
|
|
113
115
|
}): void;
|
|
114
|
-
/** Copies `text` and says so; `what` names it ("
|
|
116
|
+
/** Copies `text` and says so; `what` names it ("subscription name"). */
|
|
115
117
|
copy(text: string, what: string): void;
|
|
116
118
|
}
|
|
117
119
|
/** What a row-action contribution is given. */
|
|
@@ -127,4 +129,3 @@ export interface LinkProps<T> {
|
|
|
127
129
|
target: T;
|
|
128
130
|
children: ReactNode;
|
|
129
131
|
}
|
|
130
|
-
export {};
|
|
@@ -33,7 +33,10 @@ export interface ResourceParams {
|
|
|
33
33
|
size?: number;
|
|
34
34
|
}
|
|
35
35
|
export declare function resourceSearch(params: ResourceParams): string;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* One page of a cluster-wide listing (subscriptions, destinations, consumers, …), refetched on the usual interval.
|
|
38
|
+
* `topic` names the stream topic that invalidates it; `path` is the route when that is another word.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useResource<T>(id: string, topic: string, params: ResourceParams, path?: string): UseQueryResult<PagedView<T>, ApiError>;
|
|
38
41
|
/** Rows in the envelope every list endpoint answers with, for the fixtures that stand in for one. */
|
|
39
42
|
export declare function paged<T>(data: T[]): PagedView<T>;
|
|
@@ -29,7 +29,7 @@ export declare class ApiError extends Error {
|
|
|
29
29
|
/** What the server says about an operation it held for approval instead of running. */
|
|
30
30
|
export interface HeldOperation {
|
|
31
31
|
id: string;
|
|
32
|
-
/** What the operation would do, in words, such as `Purge
|
|
32
|
+
/** What the operation would do, in words, such as `Purge subscription "orders" on prod`. */
|
|
33
33
|
summary: string;
|
|
34
34
|
/** When the request lapses unless someone decides it, as an ISO instant. */
|
|
35
35
|
expiresAt: string;
|
|
@@ -81,4 +81,4 @@ export interface LifecycleVars {
|
|
|
81
81
|
dryRun?: boolean;
|
|
82
82
|
override?: boolean;
|
|
83
83
|
}
|
|
84
|
-
export declare function lifecycleQuery(dryRun?: boolean, override?: boolean): string;
|
|
84
|
+
export declare function lifecycleQuery(dryRun?: boolean, override?: boolean, node?: string): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The canonical id of the resource of this kind with this path, outermost segment first. */
|
|
2
|
+
export declare function resourceId(kind: string, ...path: string[]): string;
|
|
3
|
+
/** The kind of a canonical id. */
|
|
4
|
+
export declare function kindOf(id: string): string;
|
|
5
|
+
/** The name of a canonical id: its last segment, decoded. Empty for no id. */
|
|
6
|
+
export declare function nameOf(id: string | null | undefined): string;
|
|
7
|
+
/** What identifies a resource wherever a screen or a plugin is handed one: its canonical id, kind and name. */
|
|
8
|
+
export interface ResourceRef {
|
|
9
|
+
/** The resource's canonical id, which an API call names. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** The id of its kind, such as `artemis.queue`. */
|
|
12
|
+
kind: string;
|
|
13
|
+
/** Its name, which a filter and a copy use. */
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
/** The reference of a canonical id. */
|
|
17
|
+
export declare function refOf(id: string): ResourceRef;
|
|
18
|
+
/** `/resources/{kind}/{path}` of a canonical id, ready to follow with `:pause`, `/messages` and the like. */
|
|
19
|
+
export declare function resourcePath(id: string): string;
|
|
20
|
+
/** The kinds a cluster's system offers, as the cluster view lists them. */
|
|
21
|
+
export type ClusterKinds = ReadonlyArray<{
|
|
22
|
+
id: string;
|
|
23
|
+
resourceClass: string;
|
|
24
|
+
}>;
|
|
25
|
+
/** The roles a screen that holds only a name needs an id for. */
|
|
26
|
+
export type Role = 'SUBSCRIPTION' | 'DESTINATION';
|
|
27
|
+
/** The kind that plays this role in the cluster's system. */
|
|
28
|
+
export declare function kindOfRole(kinds: ClusterKinds | undefined, role: Role): string;
|
|
29
|
+
/** The id of the subscription of this name; for a screen that holds a name and no row (a URL param, a picker). */
|
|
30
|
+
export declare const subscriptionId: (kinds: ClusterKinds | undefined, name: string) => string;
|
|
31
|
+
/** The id of the destination of this name, built as {@link subscriptionId} builds a subscription's. */
|
|
32
|
+
export declare const destinationId: (kinds: ClusterKinds | undefined, name: string) => string;
|