@w6w/embed 0.1.1 → 0.2.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/README.md +231 -4
- package/dist/ConfirmModal-RLbZT5_k.js +181 -0
- package/dist/ConfirmModal-RLbZT5_k.js.map +1 -0
- package/dist/CreateFunctionModal-DRsFx-FB.js +221 -0
- package/dist/CreateFunctionModal-DRsFx-FB.js.map +1 -0
- package/dist/DocumentFormModal-BExK1V-B.js +89 -0
- package/dist/DocumentFormModal-BExK1V-B.js.map +1 -0
- package/dist/ImportSpecModal-BDQIf6rg.js +136 -0
- package/dist/ImportSpecModal-BDQIf6rg.js.map +1 -0
- package/dist/W6WEmbedProvider.d.ts +22 -4
- package/dist/WorkflowEditor-DlbVv6Fs.js +854 -0
- package/dist/WorkflowEditor-DlbVv6Fs.js.map +1 -0
- package/dist/api-calls--JHyif6a.js +107 -0
- package/dist/api-calls--JHyif6a.js.map +1 -0
- package/dist/apps-1FNUwbGv.js +77 -0
- package/dist/apps-1FNUwbGv.js.map +1 -0
- package/dist/callables-3mFrMVG_.js +151 -0
- package/dist/callables-3mFrMVG_.js.map +1 -0
- package/dist/chrome/index.d.ts +6 -0
- package/dist/chrome/workspace.d.ts +29 -1
- package/dist/coerce-input-BicYr7nc.js +139 -0
- package/dist/coerce-input-BicYr7nc.js.map +1 -0
- package/dist/connections-CjjYeRqb.js +78 -0
- package/dist/connections-CjjYeRqb.js.map +1 -0
- package/dist/document-sources-C0grrtdq.js +86 -0
- package/dist/document-sources-C0grrtdq.js.map +1 -0
- package/dist/draft/index.d.ts +3 -1
- package/dist/draft/use-callable-draft.d.ts +65 -0
- package/dist/draft/workflow-save.d.ts +3 -0
- package/dist/draft.mjs +9 -5
- package/dist/draft.mjs.map +1 -1
- package/dist/editor/CallableEditorFrame.d.ts +33 -0
- package/dist/editor/EditorShell.d.ts +16 -0
- package/dist/editor/EndpointCards.d.ts +56 -0
- package/dist/editor/EndpointEditor.d.ts +26 -0
- package/dist/editor/FunctionEditor.d.ts +21 -0
- package/dist/editor/InputListEditor.d.ts +29 -0
- package/dist/editor/TargetSelector.d.ts +30 -0
- package/dist/editor/TargetSelector.types.d.ts +62 -0
- package/dist/editor/editor-apps.d.ts +8 -2
- package/dist/editor/types.d.ts +57 -0
- package/dist/editor-apps-BdenSV1o.js +95 -0
- package/dist/editor-apps-BdenSV1o.js.map +1 -0
- package/dist/editor-tools-RxmY5iyi.js +1279 -0
- package/dist/editor-tools-RxmY5iyi.js.map +1 -0
- package/dist/editor.mjs +2 -2166
- package/dist/editor.mjs.map +1 -1
- package/dist/editors/DocumentEditor.d.ts +20 -0
- package/dist/editors/doc-format.d.ts +3 -0
- package/dist/editors.d.ts +12 -0
- package/dist/editors.mjs +1313 -0
- package/dist/editors.mjs.map +1 -0
- package/dist/embed-status.d.ts +20 -0
- package/dist/endpoints-B2ynbZo-.js +227 -0
- package/dist/endpoints-B2ynbZo-.js.map +1 -0
- package/dist/forms/CreateEndpointModal.d.ts +54 -0
- package/dist/forms/CreateFunctionModal.d.ts +55 -0
- package/dist/forms/DocumentFormModal.d.ts +8 -0
- package/dist/forms/SecretsManager.d.ts +12 -0
- package/dist/forms/VarsManager.d.ts +29 -0
- package/dist/forms.d.ts +6 -0
- package/dist/forms.mjs +407 -0
- package/dist/forms.mjs.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +153 -50
- package/dist/index.mjs.map +1 -1
- package/dist/lib/callable-record.d.ts +21 -0
- package/dist/lib/coerce-input.d.ts +6 -0
- package/dist/lib/endpoint-editor.d.ts +23 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/input-coverage.d.ts +28 -0
- package/dist/lib/input-seeding.d.ts +67 -0
- package/dist/lib/rail-settings.d.ts +3 -3
- package/dist/lib/recent-activity.d.ts +128 -0
- package/dist/lib/target-fields.d.ts +168 -0
- package/dist/lib/workflow-blank.d.ts +2 -0
- package/dist/lib.mjs +70 -48
- package/dist/lib.mjs.map +1 -1
- package/dist/lists/ActivitySummary.d.ts +29 -0
- package/dist/lists/CallableKindList.d.ts +34 -0
- package/dist/lists/ConnectionDetail.d.ts +17 -0
- package/dist/lists/ConnectionList.d.ts +16 -0
- package/dist/lists/DocumentList.d.ts +29 -0
- package/dist/lists/EndpointList.d.ts +19 -0
- package/dist/lists/FunctionList.d.ts +18 -0
- package/dist/lists/ReliabilityBoard.d.ts +23 -0
- package/dist/lists/RunHistory.d.ts +11 -0
- package/dist/lists/ServiceDetail.d.ts +20 -0
- package/dist/lists/WorkflowList.d.ts +19 -0
- package/dist/lists/vendor-history.d.ts +40 -0
- package/dist/lists.d.ts +20 -0
- package/dist/lists.mjs +1185 -0
- package/dist/lists.mjs.map +1 -0
- package/dist/project-context-BiCjv_E3.js +25 -0
- package/dist/project-context-BiCjv_E3.js.map +1 -0
- package/dist/project-context.d.ts +15 -1
- package/dist/rail/CallableRail.d.ts +12 -0
- package/dist/rail/CallableWorkspace.d.ts +16 -0
- package/dist/rail/SettingsTool.d.ts +7 -1
- package/dist/rail/settings-sections.d.ts +2 -2
- package/dist/rail-settings-XYGToh00.js +111 -0
- package/dist/rail-settings-XYGToh00.js.map +1 -0
- package/dist/rail.d.ts +11 -0
- package/dist/rail.mjs +35 -0
- package/dist/rail.mjs.map +1 -0
- package/dist/repos/api-calls.d.ts +4 -0
- package/dist/repos/apps.d.ts +14 -0
- package/dist/repos/callables.d.ts +91 -0
- package/dist/repos/connections.d.ts +33 -0
- package/dist/repos/dashboard.d.ts +4 -0
- package/dist/repos/endpoints.d.ts +125 -0
- package/dist/repos/functions.d.ts +79 -0
- package/dist/repos/index.d.ts +10 -0
- package/dist/repos/reliability.d.ts +42 -0
- package/dist/repos/saved-tests.d.ts +46 -0
- package/dist/repos/spec-export.d.ts +23 -0
- package/dist/repos/workflows.d.ts +138 -0
- package/dist/repos.mjs +174 -88
- package/dist/repos.mjs.map +1 -1
- package/dist/settings-rail--GdRMusb.js +33 -0
- package/dist/settings-rail--GdRMusb.js.map +1 -0
- package/dist/slug-C4ktDPdy.js +315 -0
- package/dist/slug-C4ktDPdy.js.map +1 -0
- package/dist/spec-export-Cf3VQSQS.js +176 -0
- package/dist/spec-export-Cf3VQSQS.js.map +1 -0
- package/dist/spec-import-CjmxyZDR.js +465 -0
- package/dist/spec-import-CjmxyZDR.js.map +1 -0
- package/dist/step-tests-CivICmTq.js +18 -0
- package/dist/step-tests-CivICmTq.js.map +1 -0
- package/dist/trigger-preview-VPkrryDl.js +120 -0
- package/dist/trigger-preview-VPkrryDl.js.map +1 -0
- package/dist/use-callable-draft-zHLpcr-b.js +271 -0
- package/dist/use-callable-draft-zHLpcr-b.js.map +1 -0
- package/dist/{use-workflow-draft-oI02dsP-.js → use-workflow-draft-DzAyUeA6.js} +48 -46
- package/dist/use-workflow-draft-DzAyUeA6.js.map +1 -0
- package/dist/vault-BSEWhMYC.js +117 -0
- package/dist/vault-BSEWhMYC.js.map +1 -0
- package/dist/workflow-blank-DyL3_RUA.js +14 -0
- package/dist/workflow-blank-DyL3_RUA.js.map +1 -0
- package/package.json +21 -5
- package/src/styles.css +408 -1
- package/dist/project-context-Dbk0Gr1K.js +0 -16
- package/dist/project-context-Dbk0Gr1K.js.map +0 -1
- package/dist/slug-ByKQgxrf.js +0 -642
- package/dist/slug-ByKQgxrf.js.map +0 -1
- package/dist/spec-import-HgO7ZkLZ.js +0 -898
- package/dist/spec-import-HgO7ZkLZ.js.map +0 -1
- package/dist/use-workflow-draft-oI02dsP-.js.map +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { DashboardStats } from '../repos/dashboard.ts';
|
|
2
|
+
/** One row of the dashboard's "Recent activity" list — the pinned wire shape
|
|
3
|
+
* (`DashboardStats["recent"][number]`, widened by T1.1.2). */
|
|
4
|
+
export type RecentActivityEntry = DashboardStats["recent"][number];
|
|
5
|
+
/** Human labels for the ledger `kind` domain (mirrors the server's `run_log.kind`). */
|
|
6
|
+
export declare const KIND_LABELS: Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* The seven ledger kinds this module KNOWS — the arms the two `Record`s below
|
|
9
|
+
* name explicitly, so a kind added to `run_log.kind` is a compile error here
|
|
10
|
+
* rather than a row silently rendering as another kind (the same reasoning
|
|
11
|
+
* `RESOURCE_DESCRIPTORS` gives for its total `Record`).
|
|
12
|
+
*/
|
|
13
|
+
export type ActivityKind = "workflow" | "workflow_step" | "connection_test" | "node_debug" | "function" | "endpoint" | "action";
|
|
14
|
+
/**
|
|
15
|
+
* The label for a ledger kind. An unrecognised kind falls back to the raw value:
|
|
16
|
+
* `kind` is a wire field and a client can be older than the server that answered
|
|
17
|
+
* it — a raw `"schedule"` reads better than a blank row.
|
|
18
|
+
*/
|
|
19
|
+
export declare function kindLabel(kind: string): string;
|
|
20
|
+
/** Which tile a row renders as: today's row, or one of the three named ones. */
|
|
21
|
+
export type TileVariant = "base" | "function" | "workflow" | "workflow_step";
|
|
22
|
+
/**
|
|
23
|
+
* The kind→variant table. Only the kinds that HAVE a name (or, for a step, an
|
|
24
|
+
* id) to link to move off the base tile — `workflow_step` joined them in R-1,
|
|
25
|
+
* titled `{workflow name} - {step id}` (R-2); endpoint/action rows keep
|
|
26
|
+
* today's look (DC-6). Every other arm is spelled out rather than left to a
|
|
27
|
+
* default, so dropping or adding a kind is a visible edit here.
|
|
28
|
+
*/
|
|
29
|
+
export declare const TILE_VARIANT: Record<ActivityKind, TileVariant>;
|
|
30
|
+
/**
|
|
31
|
+
* The tile a row renders as — the ONE dispatcher `RecentActivityTile` reads.
|
|
32
|
+
* An unknown kind is the base tile, never a missing render: the same
|
|
33
|
+
* older-client-than-server case {@link kindLabel} answers.
|
|
34
|
+
*/
|
|
35
|
+
export declare function tileVariantFor(kind: string): TileVariant;
|
|
36
|
+
/**
|
|
37
|
+
* The list rows the two name maps are built from, structurally: the SDK's
|
|
38
|
+
* `FunctionSummary`/`WorkflowSummary` satisfy these without a cast, and a
|
|
39
|
+
* fixture in the unit test needs no SDK round trip.
|
|
40
|
+
*/
|
|
41
|
+
export interface FunctionNameRow {
|
|
42
|
+
id: string;
|
|
43
|
+
/** The callable name; `null` on a `WorkflowSummary`, never on a Function. */
|
|
44
|
+
key?: string | null;
|
|
45
|
+
displayName?: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface WorkflowNameRow {
|
|
48
|
+
id: string;
|
|
49
|
+
/** The stable slug; every Workflow has one. */
|
|
50
|
+
name?: string | null;
|
|
51
|
+
displayName?: string | null;
|
|
52
|
+
}
|
|
53
|
+
/** `id → display label` for the two kinds whose rows carry a name. */
|
|
54
|
+
export interface ActivityNameMaps {
|
|
55
|
+
functions: ReadonlyMap<string, string>;
|
|
56
|
+
workflows: ReadonlyMap<string, string>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Build the two `id → name` maps a tile resolves its title through.
|
|
60
|
+
*
|
|
61
|
+
* Both lists are the ACCOUNT-scoped reads `useFunctionsQuery()`/
|
|
62
|
+
* `useWorkflowsQuery()` already make (DC-1) — the dashboard's own
|
|
63
|
+
* `recentForAccount` is account-wide, so a project-narrowed list here would
|
|
64
|
+
* label most rows with a raw `fn_…`/`wf_…` id. A missing list (its query still
|
|
65
|
+
* loading, or failed) is an empty map: the tile then falls back to today's
|
|
66
|
+
* title rather than blocking the row.
|
|
67
|
+
*
|
|
68
|
+
* The label is `displayName || key` for a Function and `displayName || name`
|
|
69
|
+
* for a Workflow (the server's own fallback order). A row carrying neither is
|
|
70
|
+
* left OUT of the map rather than mapped to `""`: "in the map" then means
|
|
71
|
+
* exactly "there is a name to link to", which is the rule
|
|
72
|
+
* {@link resolveTileTitle} reads.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildNameMaps(functions?: readonly FunctionNameRow[], workflows?: readonly WorkflowNameRow[]): ActivityNameMaps;
|
|
75
|
+
/** The resource a tile title links to — a studio route kind plus its id. */
|
|
76
|
+
export interface ActivityTileTarget {
|
|
77
|
+
kind: "function" | "workflow";
|
|
78
|
+
id: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ResolvedTileTitle {
|
|
81
|
+
/** What the title reads: the resolved name, else today's `summary`/kind label. */
|
|
82
|
+
text: string;
|
|
83
|
+
/** Where it links, or `null` for a plain, unlinked title. */
|
|
84
|
+
target: ActivityTileTarget | null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The title of one row — the name-as-link rule.
|
|
88
|
+
*
|
|
89
|
+
* A `function`/`workflow` row links ONLY when its id resolves to a name in the
|
|
90
|
+
* maps above. Every other case — a base-variant kind, a `null` id, or an id the
|
|
91
|
+
* list did not carry — is today's plain title (`summary ?? kindLabel(kind)`)
|
|
92
|
+
* with no target, so a failed or still-loading name lookup degrades to the id
|
|
93
|
+
* the row already shows instead of a dead link.
|
|
94
|
+
*
|
|
95
|
+
* A `workflow_step` row (R-1) is the same rule plus the step's own id: a
|
|
96
|
+
* resolved workflow name makes the link, exactly as it does on a `workflow`
|
|
97
|
+
* row, and the title reads `{workflow name} - {step id}` — a spaced ASCII
|
|
98
|
+
* hyphen-minus, R-2. The step id IS the step's name — `core/rfcs/workflow.md`'s
|
|
99
|
+
* `id` is its machine name and the editor's "Rename step" rewrites exactly that
|
|
100
|
+
* — so no definition is fetched and no `notes` is read. When the workflow does
|
|
101
|
+
* NOT resolve the left side is the workflow id itself, then the row's `summary`,
|
|
102
|
+
* then `"Unknown workflow"` — never the kind label, since a title reading
|
|
103
|
+
* "Workflow step" is exactly what R-1 rejected — and the target is `null`: a
|
|
104
|
+
* link only when the name resolved. An absent `stepId` leaves the title as just
|
|
105
|
+
* that left side.
|
|
106
|
+
*/
|
|
107
|
+
export declare function resolveTileTitle(entry: RecentActivityEntry, names: ActivityNameMaps): ResolvedTileTitle;
|
|
108
|
+
/**
|
|
109
|
+
* A row's timestamp in LOCAL time as `YYYY-MM-DD HH:mm:ss`, 24-hour and
|
|
110
|
+
* zero-padded — the exact, sortable, unambiguous stamp a ledger row wants.
|
|
111
|
+
*
|
|
112
|
+
* `toLocaleString` is deliberately NOT reused (what this replaces): its output
|
|
113
|
+
* is locale-dependent ("Jan 5, 7:08 AM", no seconds) and so unreadable as a
|
|
114
|
+
* timestamp. The `get*` accessors, never the `getUTC*` ones, are what make this
|
|
115
|
+
* the viewer's own wall clock. An unparseable value is returned unchanged —
|
|
116
|
+
* better the raw string than `NaN-NaN-NaN`.
|
|
117
|
+
*/
|
|
118
|
+
export declare function formatTimestamp(iso: string): string;
|
|
119
|
+
/**
|
|
120
|
+
* A duration in milliseconds, or `null` when there is nothing to show.
|
|
121
|
+
*
|
|
122
|
+
* Three magnitudes, three units, so the number stays readable at every scale:
|
|
123
|
+
* sub-second in ms, sub-minute in seconds to one decimal, and minutes+seconds
|
|
124
|
+
* above that. `null`/`undefined`/negative/non-finite are all "unknown" — the
|
|
125
|
+
* ledger writes none of them on purpose, and a tile that renders `NaN s` is
|
|
126
|
+
* worse than one that renders nothing (DC-2: historical rows simply omit it).
|
|
127
|
+
*/
|
|
128
|
+
export declare function formatDuration(ms: number | null | undefined): string | null;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers shared by `TargetSelector`'s three arms (rfcs/endpoint.md
|
|
3
|
+
* :339-347 — `EndpointTarget = CallableRef | ActionTarget`) and by
|
|
4
|
+
* `EndpointsPage`'s save gate.
|
|
5
|
+
*
|
|
6
|
+
* Pure and testable by design, mirroring `workflow-validity.ts`'s shape:
|
|
7
|
+
* `@w6w/ui`'s `package.json` `exports["."]` resolves to raw `./src/index.ts`,
|
|
8
|
+
* which re-exports `.tsx` files, so `node --test` throws
|
|
9
|
+
* `ERR_UNKNOWN_FILE_EXTENSION` the moment anything here imports `@w6w/ui` or
|
|
10
|
+
* `@w6w/ui/flow` — even type-only. So this module declares its own local
|
|
11
|
+
* structural (`*Like`) types instead of importing the real ones from
|
|
12
|
+
* `../api/types.ts`, and `isTriggerApp`/`asFieldDefs` (the workflow arm's only
|
|
13
|
+
* dependency on `@w6w/ui/flow`) are **caller-injected** — `TargetSelector.tsx`
|
|
14
|
+
* (unaffected by the JSX constraint) imports the real ones and passes them in.
|
|
15
|
+
*/
|
|
16
|
+
/** The four arms `EndpointTarget` can take; a Function's `impl` takes the
|
|
17
|
+
* first three (D-8) — `"endpoint"` is alias-only, never legal for `Fn.impl`. */
|
|
18
|
+
export type TargetKind = "action" | "function" | "workflow" | "endpoint";
|
|
19
|
+
/** The `action` arm — same `{ uses, with }` shape a Function's `impl` carries. */
|
|
20
|
+
export interface ActionTargetLike {
|
|
21
|
+
kind: "action";
|
|
22
|
+
uses: {
|
|
23
|
+
app: string;
|
|
24
|
+
action: string;
|
|
25
|
+
connection?: string | null;
|
|
26
|
+
};
|
|
27
|
+
with?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
/** The `function`/`workflow` arms — a bare ref, one hop to a CallableRef. */
|
|
30
|
+
export type CallableTargetLike = {
|
|
31
|
+
kind: "function";
|
|
32
|
+
function: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "workflow";
|
|
35
|
+
workflow: string;
|
|
36
|
+
};
|
|
37
|
+
/** The `endpoint` arm — a bare ref to another Endpoint. Alias-only (plan.md
|
|
38
|
+
* §2a): legal for `AliasDef.target`, never for an Endpoint's own `target`
|
|
39
|
+
* (the server refuses it — `admin/endpoints.ts`'s `validateDefinition`). */
|
|
40
|
+
export interface EndpointRefTargetLike {
|
|
41
|
+
kind: "endpoint";
|
|
42
|
+
endpoint: string;
|
|
43
|
+
}
|
|
44
|
+
/** The full local mirror of `EndpointTarget` this module operates on. */
|
|
45
|
+
export type TargetLike = ActionTargetLike | CallableTargetLike | EndpointRefTargetLike;
|
|
46
|
+
/**
|
|
47
|
+
* The action arm of a Function's `impl` — today's `FunctionImplLike` shape,
|
|
48
|
+
* plus the two fields D-8 adds: `kind?: "action"` (absent means "action",
|
|
49
|
+
* unchanged for every Function stored before the union existed) and
|
|
50
|
+
* `outputMap?` (mirrors the action arm's own adapter-out pass, already on
|
|
51
|
+
* `FnActionImpl`/`FunctionActionImpl`).
|
|
52
|
+
*/
|
|
53
|
+
export interface ActionImplLike {
|
|
54
|
+
kind?: "action";
|
|
55
|
+
uses: {
|
|
56
|
+
app: string;
|
|
57
|
+
action: string;
|
|
58
|
+
connection?: string | null;
|
|
59
|
+
};
|
|
60
|
+
with?: Record<string, unknown>;
|
|
61
|
+
outputMap?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A Function's `impl` (D-8, `rfcs/function.md` as amended by TC2) — bound to
|
|
65
|
+
* one app Action, or to another Function/Workflow via `CallableTargetLike`
|
|
66
|
+
* (reused verbatim, never a fourth local mirror), intersected with the same
|
|
67
|
+
* `with`/`outputMap` adapter pair the action arm carries — field-for-field
|
|
68
|
+
* `FnCallableImpl = CallableRef & {with?; outputMap?}` (TC2's pinned type).
|
|
69
|
+
*/
|
|
70
|
+
export type FunctionImplLike = ActionImplLike | (CallableTargetLike & {
|
|
71
|
+
with?: Record<string, unknown>;
|
|
72
|
+
outputMap?: Record<string, unknown>;
|
|
73
|
+
});
|
|
74
|
+
/** A declared action/function param, just enough of it for the projector. */
|
|
75
|
+
export interface ParamLike {
|
|
76
|
+
key: string;
|
|
77
|
+
label?: string;
|
|
78
|
+
type?: string;
|
|
79
|
+
required?: boolean;
|
|
80
|
+
default?: unknown;
|
|
81
|
+
showIf?: ShowIfPredicate;
|
|
82
|
+
}
|
|
83
|
+
/** Visibility predicate — mirroring ActionParam.showIf from @w6w/ui. */
|
|
84
|
+
export interface ShowIfPredicate {
|
|
85
|
+
field: string;
|
|
86
|
+
equals?: unknown;
|
|
87
|
+
in?: unknown[];
|
|
88
|
+
notIn?: unknown[];
|
|
89
|
+
truthy?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** One field of a manual/webhook trigger's `with.fields` (`@w6w/ui/flow`'s `TriggerFieldDef`). */
|
|
92
|
+
export interface TriggerFieldDefLike {
|
|
93
|
+
key?: string;
|
|
94
|
+
type?: string;
|
|
95
|
+
default?: unknown;
|
|
96
|
+
required?: boolean;
|
|
97
|
+
}
|
|
98
|
+
/** A workflow graph step, just enough of it for the trigger-field union (A6). */
|
|
99
|
+
export interface WorkflowStepLike {
|
|
100
|
+
uses?: {
|
|
101
|
+
app?: string;
|
|
102
|
+
};
|
|
103
|
+
with?: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
/** A workflow definition, just enough of it for the trigger-field union. */
|
|
106
|
+
export interface WorkflowLike {
|
|
107
|
+
steps?: unknown;
|
|
108
|
+
}
|
|
109
|
+
/** Everything `fieldsFromWorkflow` needs from `@w6w/ui/flow` but cannot import itself. */
|
|
110
|
+
export interface WorkflowFieldCtx {
|
|
111
|
+
/** `@w6w/ui/flow`'s `isTriggerApp`, injected by the JSX caller. */
|
|
112
|
+
isTriggerApp: (app: string) => boolean;
|
|
113
|
+
/** `@w6w/ui/flow`'s `asFieldDefs`, injected by the JSX caller. */
|
|
114
|
+
asFieldDefs: (fields: unknown) => TriggerFieldDefLike[];
|
|
115
|
+
}
|
|
116
|
+
/** One field of the normalized list `TargetSelector` resolves to (A5). */
|
|
117
|
+
export interface TargetField {
|
|
118
|
+
key: string;
|
|
119
|
+
label: string;
|
|
120
|
+
type: string;
|
|
121
|
+
required?: boolean;
|
|
122
|
+
default?: unknown;
|
|
123
|
+
showIf?: ShowIfPredicate;
|
|
124
|
+
}
|
|
125
|
+
/** One row of an input-contract list (`FunctionInput`/`EndpointInput`'s common shape). */
|
|
126
|
+
export interface InputRowLike {
|
|
127
|
+
key: string;
|
|
128
|
+
label: string;
|
|
129
|
+
type: string;
|
|
130
|
+
required?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/** The concrete ref (`fn_…` / `wf_…` / `ep_…`) a CallableRef/endpoint target
|
|
133
|
+
* currently points at, `""` for `action`. */
|
|
134
|
+
export declare function targetRef(target: TargetLike): string;
|
|
135
|
+
/** Is the target fully chosen? An action needs both halves of its `uses` pair (A9). */
|
|
136
|
+
export declare function targetIsBound(target: TargetLike): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Adapt a Function's `impl` into the shape `TargetSelector` consumes (D-8):
|
|
139
|
+
* an action impl to the `action` arm exactly as before; a CallableRef impl maps
|
|
140
|
+
* its `kind`/`function`|`workflow` across UNCHANGED — deliberately dropping
|
|
141
|
+
* `with`/`outputMap`, which `TargetLike`'s CallableRef arm has no slot for (they
|
|
142
|
+
* survive on `draft.impl` itself; `targetToImpl` restores a default `with` on
|
|
143
|
+
* the way back, so `implToTarget(targetToImpl(x))` round-trips `x`). An
|
|
144
|
+
* absent impl still yields the empty action target.
|
|
145
|
+
*/
|
|
146
|
+
export declare function implToTarget(impl: FunctionImplLike | undefined): ActionTargetLike | CallableTargetLike;
|
|
147
|
+
/**
|
|
148
|
+
* Inverse of {@link implToTarget}, over the widened D-8 domain. Never yields
|
|
149
|
+
* `with: undefined` on EITHER arm — A10: `invoke-function.ts`'s
|
|
150
|
+
* `resolveWith(impl.with, …)` call is unconditional and shared by both arms
|
|
151
|
+
* (the CallableRef arm has its own `with` adapter pass onto the callee's inputs,
|
|
152
|
+
* unlike `uncoveredForEndpoint`'s P3), so an unmapped `with` must still be
|
|
153
|
+
* `{}`, not absent, on a CallableRef impl too.
|
|
154
|
+
*/
|
|
155
|
+
export declare function targetToImpl(target: ActionTargetLike | CallableTargetLike): FunctionImplLike;
|
|
156
|
+
/** Project a list of action/function params into the normalized `TargetField[]` (A5). */
|
|
157
|
+
export declare function paramsToFields(params: ParamLike[]): TargetField[];
|
|
158
|
+
/**
|
|
159
|
+
* A6: project every manual/webhook-trigger step's `with.fields` from a raw
|
|
160
|
+
* workflow graph into the union of `TargetField`s, keyed by `key`, first
|
|
161
|
+
* occurrence wins, order stable (planner D-2: the server broadcasts one
|
|
162
|
+
* `input` object to every trigger identically). A webhook/scheduler step that
|
|
163
|
+
* declares `methods`/`auth` but no `fields` contributes nothing — by reading
|
|
164
|
+
* `with.fields`, not a special case. Unnamed/blank keys are skipped. `default`
|
|
165
|
+
* is not carried for this arm (A5). A missing/garbage graph, or one whose
|
|
166
|
+
* `isTriggerApp` predicate matches nothing, yields `[]` — never a throw.
|
|
167
|
+
*/
|
|
168
|
+
export declare function fieldsFromWorkflow(workflow: WorkflowLike | null | undefined, ctx: WorkflowFieldCtx): TargetField[];
|
package/dist/lib.mjs
CHANGED
|
@@ -1,62 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
2
|
+
import { d as n, i as d, a as c, r as p, b as u, c as m, e as f, s as S, t as g, f as v, v as b, g as w, w as F, h as R } from "./trigger-preview-VPkrryDl.js";
|
|
3
|
+
import { d as x, e as y, i as I, p as A, t as E } from "./document-sources-C0grrtdq.js";
|
|
4
|
+
import { e as P, h as D, a as T, b as C, i as U, m as V, p as k, r as L, s as W, v as _, w as H } from "./rail-settings-XYGToh00.js";
|
|
5
|
+
import { c as j, d as q, i as B, p as G } from "./settings-rail--GdRMusb.js";
|
|
6
|
+
import { A as Y, b as $, f as z, i as J, a as M, c as Q, s as X, u as Z } from "./slug-C4ktDPdy.js";
|
|
7
|
+
import { i as ea, s as sa } from "./spec-import-invalidation-D3retX4Q.js";
|
|
8
|
+
import { b as ta } from "./workflow-blank-DyL3_RUA.js";
|
|
9
|
+
import { I as oa, c as la, f as na, i as da, a as ca, m as pa, p as ua, s as ma, t as fa, b as Sa, d as ga, u as va, e as ba, g as wa } from "./coerce-input-BicYr7nc.js";
|
|
4
10
|
function t(s) {
|
|
5
11
|
const e = new URLSearchParams(s), a = e.get("edit");
|
|
6
12
|
if (a === null || a === "") return null;
|
|
7
13
|
e.delete("edit");
|
|
8
|
-
const
|
|
9
|
-
return { id: a, search:
|
|
14
|
+
const r = e.toString();
|
|
15
|
+
return { id: a, search: r === "" ? "" : `?${r}` };
|
|
10
16
|
}
|
|
11
|
-
function
|
|
17
|
+
function i(s) {
|
|
12
18
|
const a = new URLSearchParams(s).get("run");
|
|
13
19
|
return a != null && a.startsWith("run_") ? a : null;
|
|
14
20
|
}
|
|
15
21
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
Y as ACCOUNT_SLUG_RE,
|
|
23
|
+
oa as INPUT_TYPES,
|
|
24
|
+
ta as blankDefinition,
|
|
25
|
+
$ as buildSnippet,
|
|
26
|
+
j as callableRecord,
|
|
27
|
+
la as coerceInput,
|
|
28
|
+
q as definitionWithPolicy,
|
|
29
|
+
x as documentSampleValues,
|
|
30
|
+
n as duplicateKeyIndexes,
|
|
31
|
+
y as errorHandlerSelfDecision,
|
|
32
|
+
P as evaluateEdit,
|
|
33
|
+
na as fieldsFromWorkflow,
|
|
34
|
+
z as filterKeyInput,
|
|
35
|
+
D as hasDefinitionActions,
|
|
36
|
+
T as hasDelete,
|
|
37
|
+
C as hasVersionHistory,
|
|
38
|
+
da as implToTarget,
|
|
39
|
+
ca as inputsForSave,
|
|
40
|
+
d as invalidReason,
|
|
41
|
+
ea as invalidateImportedCallable,
|
|
42
|
+
I as isCodeRailAvailable,
|
|
43
|
+
J as isEndpointKey,
|
|
44
|
+
c as isExprDefault,
|
|
45
|
+
U as isRowArchived,
|
|
46
|
+
B as isSettingsRailAvailable,
|
|
47
|
+
M as isUrnAddressable,
|
|
48
|
+
Q as isValidAccountSlug,
|
|
36
49
|
t as legacyEditRedirect,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
pa as mergeSeed,
|
|
51
|
+
V as metadataFieldsForKind,
|
|
52
|
+
ua as paramsToFields,
|
|
53
|
+
k as parseImportPaste,
|
|
54
|
+
G as policyFromDefinition,
|
|
55
|
+
A as projectDocumentSources,
|
|
56
|
+
p as readSettings,
|
|
57
|
+
u as readVariables,
|
|
58
|
+
m as readWorkflowStatus,
|
|
59
|
+
L as restoreRailState,
|
|
60
|
+
f as runFormFields,
|
|
61
|
+
i as runParamFromSearch,
|
|
62
|
+
ma as shouldSeed,
|
|
63
|
+
X as slugify,
|
|
48
64
|
W as specCollectionForKind,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
sa as specImportListKey,
|
|
66
|
+
S as stepValid,
|
|
67
|
+
fa as targetIsBound,
|
|
68
|
+
Sa as targetRef,
|
|
69
|
+
ga as targetToImpl,
|
|
70
|
+
E as toSnippetCallable,
|
|
71
|
+
g as triggerInputSeed,
|
|
72
|
+
v as triggerPreviews,
|
|
73
|
+
Z as unavailableReason,
|
|
74
|
+
va as uncoveredForEndpoint,
|
|
75
|
+
ba as uncoveredForFunction,
|
|
76
|
+
wa as uncoveredRequiredKeys,
|
|
77
|
+
b as variablesForSave,
|
|
78
|
+
w as varsRailFor,
|
|
79
|
+
_ as visibleRows,
|
|
80
|
+
H as workflowKeyEditAllowed,
|
|
81
|
+
F as workflowValid,
|
|
82
|
+
R as writeSetting
|
|
61
83
|
};
|
|
62
84
|
//# sourceMappingURL=lib.mjs.map
|
package/dist/lib.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.mjs","sources":["../src/lib/workflow-route.ts"],"sourcesContent":["// T4.1.1 (R-3): `/<account>/<project>/workflows/:id` is the workflow visual\n// editor's canonical URL; the older `workflows?edit=<id>` form survives only as\n// an alias. Parsing that alias is a pure URL question with no React and no\n// router in it, so it lives here — `.ts`, zero imports — rather than inline in\n// `WorkflowsPage.tsx`, which `node --test` cannot load (JSX).\n\n/**\n * Read the legacy `edit` parameter off a location's search string.\n *\n * Returns `null` when there is nothing to redirect: no `edit` key at all, or\n * one that is empty (`?edit=` is not an id). Otherwise `id` is the `edit`\n * value and `search` is the rest of the query — `edit` removed, every other\n * parameter kept in its original order — as a leading-`?` search string, or\n * `\"\"` when nothing is left.\n *\n * legacyEditRedirect(\"?edit=wf_a\") // { id: \"wf_a\", search: \"\" }\n * legacyEditRedirect(\"?edit=wf_a&tab=steps\") // { id: \"wf_a\", search: \"?tab=steps\" }\n */\nexport function legacyEditRedirect(search: string): { id: string; search: string } | null {\n const params = new URLSearchParams(search);\n const id = params.get(\"edit\");\n if (id === null || id === \"\") return null;\n params.delete(\"edit\");\n const rest = params.toString();\n return { id, search: rest === \"\" ? \"\" : `?${rest}` };\n}\n\n// T2.4.2 — the History page's \"open in visual view\" link lands on\n// `workflows/:id?run=<runId>`; `WorkflowsPage` reads the `run` param on mount\n// and seeds `activeRunId` from it (EXTEND, not rebuild — the live-run\n// overlay machinery already handles a terminal run identically to a live\n// one). Guarded to `run_`-prefixed values only, so an unrelated/garbled\n// param (or this file's OWN `edit` alias from a stale link) never gets\n// treated as a run id.\n\n/**\n * Read the `run` query param off a location's search string, honouring it\n * only when it looks like a real run id.\n *\n * runParamFromSearch(\"?run=run_1&x=1\") // \"run_1\"\n * runParamFromSearch(\"?run=\") // null\n * runParamFromSearch(\"?run=wf_1\") // null — not a run id\n * runParamFromSearch(\"\") // null\n */\nexport function runParamFromSearch(search: string): string | null {\n const params = new URLSearchParams(search);\n const run = params.get(\"run\");\n return run?.startsWith(\"run_\") ? run : null;\n}\n"],"names":["legacyEditRedirect","search","params","id","rest","runParamFromSearch","run"],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.mjs","sources":["../src/lib/workflow-route.ts"],"sourcesContent":["// T4.1.1 (R-3): `/<account>/<project>/workflows/:id` is the workflow visual\n// editor's canonical URL; the older `workflows?edit=<id>` form survives only as\n// an alias. Parsing that alias is a pure URL question with no React and no\n// router in it, so it lives here — `.ts`, zero imports — rather than inline in\n// `WorkflowsPage.tsx`, which `node --test` cannot load (JSX).\n\n/**\n * Read the legacy `edit` parameter off a location's search string.\n *\n * Returns `null` when there is nothing to redirect: no `edit` key at all, or\n * one that is empty (`?edit=` is not an id). Otherwise `id` is the `edit`\n * value and `search` is the rest of the query — `edit` removed, every other\n * parameter kept in its original order — as a leading-`?` search string, or\n * `\"\"` when nothing is left.\n *\n * legacyEditRedirect(\"?edit=wf_a\") // { id: \"wf_a\", search: \"\" }\n * legacyEditRedirect(\"?edit=wf_a&tab=steps\") // { id: \"wf_a\", search: \"?tab=steps\" }\n */\nexport function legacyEditRedirect(search: string): { id: string; search: string } | null {\n const params = new URLSearchParams(search);\n const id = params.get(\"edit\");\n if (id === null || id === \"\") return null;\n params.delete(\"edit\");\n const rest = params.toString();\n return { id, search: rest === \"\" ? \"\" : `?${rest}` };\n}\n\n// T2.4.2 — the History page's \"open in visual view\" link lands on\n// `workflows/:id?run=<runId>`; `WorkflowsPage` reads the `run` param on mount\n// and seeds `activeRunId` from it (EXTEND, not rebuild — the live-run\n// overlay machinery already handles a terminal run identically to a live\n// one). Guarded to `run_`-prefixed values only, so an unrelated/garbled\n// param (or this file's OWN `edit` alias from a stale link) never gets\n// treated as a run id.\n\n/**\n * Read the `run` query param off a location's search string, honouring it\n * only when it looks like a real run id.\n *\n * runParamFromSearch(\"?run=run_1&x=1\") // \"run_1\"\n * runParamFromSearch(\"?run=\") // null\n * runParamFromSearch(\"?run=wf_1\") // null — not a run id\n * runParamFromSearch(\"\") // null\n */\nexport function runParamFromSearch(search: string): string | null {\n const params = new URLSearchParams(search);\n const run = params.get(\"run\");\n return run?.startsWith(\"run_\") ? run : null;\n}\n"],"names":["legacyEditRedirect","search","params","id","rest","runParamFromSearch","run"],"mappings":";;;;;;;;;AAkBO,SAASA,EAAmBC,GAAuD;AACxF,QAAMC,IAAS,IAAI,gBAAgBD,CAAM,GACnCE,IAAKD,EAAO,IAAI,MAAM;AAC5B,MAAIC,MAAO,QAAQA,MAAO,GAAI,QAAO;AACrC,EAAAD,EAAO,OAAO,MAAM;AACpB,QAAME,IAAOF,EAAO,SAAA;AACpB,SAAO,EAAE,IAAAC,GAAI,QAAQC,MAAS,KAAK,KAAK,IAAIA,CAAI,GAAA;AAClD;AAmBO,SAASC,EAAmBJ,GAA+B;AAEhE,QAAMK,IADS,IAAI,gBAAgBL,CAAM,EACtB,IAAI,KAAK;AAC5B,SAAOK,KAAA,QAAAA,EAAK,WAAW,UAAUA,IAAM;AACzC;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MouseEvent, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ActivityTileTarget } from '../lib/recent-activity.ts';
|
|
3
|
+
export type { ActivityTileTarget };
|
|
4
|
+
export interface ActivitySummaryProps {
|
|
5
|
+
/** Real `href` for a resolved name; given ⇒ the title is an `<a>` (middle-click, new tab). */
|
|
6
|
+
getHref?: (target: ActivityTileTarget) => string;
|
|
7
|
+
/** A click on a resolved name. Never `preventDefault`ed here: the host decides. */
|
|
8
|
+
onOpen?: (target: ActivityTileTarget, event: MouseEvent<Element>) => void;
|
|
9
|
+
slots?: {
|
|
10
|
+
/** Above everything (after the error banner). */
|
|
11
|
+
header?: ReactNode;
|
|
12
|
+
/** A row of host actions under `header`. */
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/** Replaces the "No runs yet…" copy. */
|
|
15
|
+
empty?: ReactNode;
|
|
16
|
+
/** Between the two headline rows and "Activity over time" (Studio puts its board here). */
|
|
17
|
+
betweenHeadlineAndSeries?: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The account's run statistics and recent activity: "Today" and "Last 7 days" headline cards,
|
|
22
|
+
* "Activity over time" and "Recent activity". Account-scoped (no `project`); it never navigates —
|
|
23
|
+
* opening a resolved name is the host's `onOpen` / `getHref`.
|
|
24
|
+
*
|
|
25
|
+
* Two `/dashboard/stats` requests, deliberately: `today` is `{ from: <local start of day>,
|
|
26
|
+
* bucket: "day" }` and `week` is `{ bucket: "week" }`. The server's only buckets are `day|week`,
|
|
27
|
+
* cut in the database's timezone, so no single request can cut at the viewer's local midnight.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ActivitySummary({ getHref, onOpen, slots }: ActivitySummaryProps): ReactElement;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CallableListProps, CallableListRow } from '@w6w/ui';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { CallableKind } from '../lib/callable-descriptors.ts';
|
|
4
|
+
import { ArchivableRow } from '../lib/rail-settings.ts';
|
|
5
|
+
/**
|
|
6
|
+
* The internal frame the three kind lists (`FunctionList`, `EndpointList`, `WorkflowList`) share:
|
|
7
|
+
* ui's presentational `CallableList` filled with one kind's copy and test ids, the archived
|
|
8
|
+
* decision, and the Import flow. Never re-exported from `./lists` — the public surface is the three
|
|
9
|
+
* kind components.
|
|
10
|
+
*
|
|
11
|
+
* It renders the one `.w6w-embed-root` of the list (a kind's create modal rides in as `children`,
|
|
12
|
+
* inside that root) and navigates nowhere: opening is `onOpen`/`getHref`, an imported row opens
|
|
13
|
+
* through `onOpen` too.
|
|
14
|
+
*/
|
|
15
|
+
export declare function CallableKindList<Row extends {
|
|
16
|
+
id: string;
|
|
17
|
+
} & ArchivableRow>(props: {
|
|
18
|
+
kind: CallableKind;
|
|
19
|
+
/** `undefined` while the list query has not answered. */
|
|
20
|
+
rows: readonly Row[] | undefined;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
/** Everything about a row except the id and the archived flag, which the frame owns. */
|
|
23
|
+
toRow: (row: Row) => Omit<CallableListRow, "id" | "archived">;
|
|
24
|
+
/** Only the Import flow reads it (the workflow list key); `null` means no project. */
|
|
25
|
+
project: string | null;
|
|
26
|
+
onOpen?: (id: string, event?: React.MouseEvent<Element>) => void;
|
|
27
|
+
getHref?: (id: string) => string;
|
|
28
|
+
onCreate: () => void;
|
|
29
|
+
creating?: boolean;
|
|
30
|
+
error?: string | null;
|
|
31
|
+
slots?: CallableListProps["slots"];
|
|
32
|
+
/** The kind's create modal. */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ConnectionDetailProps {
|
|
3
|
+
connectionId: string;
|
|
4
|
+
/** An action row calls `(actionKey)`; one of its saved tests calls `(actionKey, savedTestId)`. */
|
|
5
|
+
onOpenAction: (actionKey: string, savedTestId?: string) => void;
|
|
6
|
+
/** The back affordance renders only when given. */
|
|
7
|
+
onBack?: () => void;
|
|
8
|
+
slots?: {
|
|
9
|
+
/** Replaces the header block. */
|
|
10
|
+
header?: ReactNode;
|
|
11
|
+
/** Appended to the header's buttons. */
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
/** Replaces the not-found state. */
|
|
14
|
+
empty?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function ConnectionDetail({ connectionId, onOpenAction, onBack, slots, }: ConnectionDetailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConnectionListProps as UiConnectionListProps } from '@w6w/ui';
|
|
2
|
+
import { MouseEvent } from 'react';
|
|
3
|
+
export interface ConnectionListProps {
|
|
4
|
+
/** Row click; the host decides whether to `preventDefault` when it also passes `getHref`. */
|
|
5
|
+
onOpen?: (id: string, event: MouseEvent<Element>) => void;
|
|
6
|
+
/** When set, each openable row is a real `<a href>`. */
|
|
7
|
+
getHref?: (id: string) => string;
|
|
8
|
+
/** Label of the default Add button. Default `+ Add connection`. */
|
|
9
|
+
addLabel?: string;
|
|
10
|
+
/**
|
|
11
|
+
* `header` and `empty` pass through. A given `actions` key (even `null`) replaces the default
|
|
12
|
+
* Add button.
|
|
13
|
+
*/
|
|
14
|
+
slots?: UiConnectionListProps["slots"];
|
|
15
|
+
}
|
|
16
|
+
export declare function ConnectionList({ onOpen, getHref, addLabel, slots }: ConnectionListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { DocWithProvenance } from '../repos/documents.ts';
|
|
3
|
+
/** A per-row slot: called once per rendered row with that row's document. */
|
|
4
|
+
export type DocumentRowSlot = (doc: DocWithProvenance) => ReactNode;
|
|
5
|
+
export interface DocumentListRowSlots {
|
|
6
|
+
/** Before the row's main text, inside the open control (e.g. a source icon). */
|
|
7
|
+
lead?: DocumentRowSlot;
|
|
8
|
+
/** The action group of a SHARED row (a shared row has no Edit or Delete). */
|
|
9
|
+
sharedActions?: DocumentRowSlot;
|
|
10
|
+
/** A full-width line under the row (e.g. a per-row error). */
|
|
11
|
+
footer?: DocumentRowSlot;
|
|
12
|
+
}
|
|
13
|
+
export interface DocumentListSlots {
|
|
14
|
+
/** Replaces the section heading and its description (the Add button stays). `null`: none. */
|
|
15
|
+
header?: ReactNode;
|
|
16
|
+
/** Replaces the empty-state copy. `null`: nothing. */
|
|
17
|
+
empty?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export interface DocumentListProps {
|
|
20
|
+
/** Omitted: the provider's project. `null` or `""`: none; nothing is read and writes refuse. */
|
|
21
|
+
project?: string | null;
|
|
22
|
+
/** The host decides what opening a row means; with `getHref` it may `preventDefault`. */
|
|
23
|
+
onOpen?: (id: string, event: MouseEvent<Element>) => void;
|
|
24
|
+
/** Given, a row's main area is a real `<a href>`; its click still calls `onOpen`. */
|
|
25
|
+
getHref?: (id: string) => string;
|
|
26
|
+
slots?: DocumentListSlots;
|
|
27
|
+
rowSlots?: DocumentListRowSlots;
|
|
28
|
+
}
|
|
29
|
+
export declare function DocumentList({ project, onOpen, getHref, slots, rowSlots }: DocumentListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CallableListProps } from '@w6w/ui';
|
|
2
|
+
export interface EndpointListProps {
|
|
3
|
+
/** Project for Import only (the Endpoints list itself is account-wide). Omitted: the provider's. */
|
|
4
|
+
project?: string | null;
|
|
5
|
+
/** A row was clicked, or an import completed. Navigation is the host's. */
|
|
6
|
+
onOpen?: (id: string, event?: React.MouseEvent<Element>) => void;
|
|
7
|
+
/** When set, each row is a real `<a href>`; a click still calls `onOpen`. */
|
|
8
|
+
getHref?: (id: string) => string;
|
|
9
|
+
/** An Endpoint was created from the list's New button; receives the SERVER's id. */
|
|
10
|
+
onCreated?: (id: string) => void;
|
|
11
|
+
slots?: CallableListProps["slots"];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The account's Endpoints: rows from `GET /endpoints`, archived ones behind a Show-archived toggle,
|
|
15
|
+
* an "Unfinished" tag on drafts (no target yet), a New button that creates an Endpoint
|
|
16
|
+
* (create-first: the row is POSTed before any editor exists), and Import. Never navigates — the
|
|
17
|
+
* host wires `onOpen` / `getHref` / `onCreated`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function EndpointList(props: EndpointListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CallableListProps } from '@w6w/ui';
|
|
2
|
+
export interface FunctionListProps {
|
|
3
|
+
/** Project for Import only (the Functions list itself is account-wide). Omitted: the provider's. */
|
|
4
|
+
project?: string | null;
|
|
5
|
+
/** A row was clicked, or an import completed. Navigation is the host's. */
|
|
6
|
+
onOpen?: (id: string, event?: React.MouseEvent<Element>) => void;
|
|
7
|
+
/** When set, each row is a real `<a href>`; a click still calls `onOpen`. */
|
|
8
|
+
getHref?: (id: string) => string;
|
|
9
|
+
/** A Function was created from the list's New button; receives the SERVER's id. */
|
|
10
|
+
onCreated?: (id: string) => void;
|
|
11
|
+
slots?: CallableListProps["slots"];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The account's Functions: rows from `GET /functions`, archived ones behind a Show-archived toggle,
|
|
15
|
+
* a New button that creates a Function (create-first: the row is POSTed before any editor exists),
|
|
16
|
+
* and Import. Never navigates — the host wires `onOpen` / `getHref` / `onCreated`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function FunctionList(props: FunctionListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReliabilityListProps } from '@w6w/ui';
|
|
2
|
+
import { MouseEvent, ReactElement } from 'react';
|
|
3
|
+
export interface ReliabilityBoardProps {
|
|
4
|
+
/** Omitted ⇒ the provider's project; `null`/`""` ⇒ no request and a "select a project" note. */
|
|
5
|
+
project?: string | null;
|
|
6
|
+
variant?: "full" | "compact";
|
|
7
|
+
/** DISPLAY cap passed to the list; never sent to the server (it would falsify "x of y"). */
|
|
8
|
+
limit?: number;
|
|
9
|
+
/** Window size in days: sent with both requests and labels the table column (default 30). */
|
|
10
|
+
days?: number;
|
|
11
|
+
showChart?: boolean;
|
|
12
|
+
getHref?: (appId: string) => string;
|
|
13
|
+
onOpen?: (appId: string, event: MouseEvent<Element>) => void;
|
|
14
|
+
showAllHref?: string;
|
|
15
|
+
onShowAll?: (event: MouseEvent<Element>) => void;
|
|
16
|
+
slots?: ReliabilityListProps["slots"];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One project's service reliability: loads members then status in serial batches of at most ten
|
|
20
|
+
* through `@w6w/embed/repos`, and draws it with `@w6w/ui`'s `ReliabilityList`. Icons come from the
|
|
21
|
+
* rows themselves, so no app-catalog request is made.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ReliabilityBoard({ project, variant, limit, days, showChart, getHref, onOpen, showAllHref, onShowAll, slots, }: ReliabilityBoardProps): ReactElement;
|