@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
package/dist/rail.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@w6w/embed/rail` — place the editor's rail anywhere in a host layout. A curated surface:
|
|
3
|
+
* `<CallableWorkspace>` (the context an editor mounted with `rail={false}` publishes into) and
|
|
4
|
+
* `<CallableRail>` (reads it), plus the `RailTool` type for custom tool lists.
|
|
5
|
+
*/
|
|
6
|
+
export { CallableWorkspace } from './rail/CallableWorkspace.tsx';
|
|
7
|
+
export type { CallableRailKind, CallableWorkspaceProps, } from './rail/CallableWorkspace.tsx';
|
|
8
|
+
export { CallableRail } from './rail/CallableRail.tsx';
|
|
9
|
+
export type { CallableRailProps } from './rail/CallableRail.tsx';
|
|
10
|
+
export type { RailTool } from './chrome/RightRail.tsx';
|
|
11
|
+
export type { RailNavigation } from './rail/rail-env.tsx';
|
package/dist/rail.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as u } from "react";
|
|
4
|
+
import { W as d, R as p, P as m, u as b, a as f, e as v, b as h } from "./editor-tools-RxmY5iyi.js";
|
|
5
|
+
import { r as P, b as j } from "./project-context-BiCjv_E3.js";
|
|
6
|
+
const R = () => {
|
|
7
|
+
};
|
|
8
|
+
function y({
|
|
9
|
+
kind: l,
|
|
10
|
+
id: s,
|
|
11
|
+
project: a,
|
|
12
|
+
onNavigate: i = R,
|
|
13
|
+
children: e
|
|
14
|
+
}) {
|
|
15
|
+
const o = P(a, j()), t = u(() => ({ kind: l, id: s }), [l, s]);
|
|
16
|
+
return /* @__PURE__ */ r(d, { base: t, children: /* @__PURE__ */ r(p, { project: o, onNavigate: i, children: /* @__PURE__ */ r(m, { project: o, children: e }) }) });
|
|
17
|
+
}
|
|
18
|
+
function E({
|
|
19
|
+
kind: l,
|
|
20
|
+
id: s,
|
|
21
|
+
tools: a = v,
|
|
22
|
+
storageKey: i
|
|
23
|
+
}) {
|
|
24
|
+
const e = b(), { project: o } = f();
|
|
25
|
+
if (!e || e.kind !== l || e.id !== s) return null;
|
|
26
|
+
const t = a.filter((c) => c.isAvailable(e));
|
|
27
|
+
if (t.length === 0) return null;
|
|
28
|
+
const n = i ?? (o === null ? null : `w6w.rail.embed.${o}`);
|
|
29
|
+
return /* @__PURE__ */ r("div", { className: "w6w-embed-root", style: { display: "flex", height: "100%", minHeight: 0 }, children: /* @__PURE__ */ r(h, { tools: t, storageKey: n }) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
E as CallableRail,
|
|
33
|
+
y as CallableWorkspace
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=rail.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rail.mjs","sources":["../src/rail/CallableWorkspace.tsx","../src/rail/CallableRail.tsx"],"sourcesContent":["/**\n * `<CallableWorkspace kind id>` — the host-placed workspace a `<CallableRail>` reads. A thin\n * composition of the trio `<WorkflowEditor>` mounts for itself (`WorkspaceProvider`,\n * `RailEnvProvider`, `ProjectExpressionScope`), so there is exactly one workspace context.\n *\n * It publishes the BASE resource `{kind, id}`. An editor mounted inside it with `rail={false}`\n * publishes its richer resource (policy, triggers, `onPolicyChange`), which wins while mounted;\n * when that editor unmounts the base is restored, never cleared (see `WorkspaceProvider`).\n * Renders no DOM of its own.\n */\nimport { type ReactNode, useMemo } from \"react\";\nimport { WorkspaceProvider } from \"../chrome/workspace.tsx\";\nimport { resolveEditorProject, useProvidedProject } from \"../project-context.ts\";\nimport { ProjectExpressionScope } from \"./ExpressionScope.tsx\";\nimport { RailEnvProvider, type RailNavigation } from \"./rail-env.tsx\";\n\nexport type CallableRailKind = \"workflow\" | \"function\" | \"endpoint\";\n\nexport interface CallableWorkspaceProps {\n kind: CallableRailKind;\n id: string;\n /**\n * The project rail tools save into. Omitted: the `<W6WEmbedProvider project>`. `null` or `\"\"`:\n * no project — tools refuse to save (never a fallback to the account default).\n */\n project?: string | null;\n /** Where the host goes after a rail action (archive/delete -> list, import -> imported row). */\n onNavigate?: (to: RailNavigation) => void;\n children?: ReactNode;\n}\n\nconst NOOP = (): void => {};\n\nexport function CallableWorkspace({\n kind,\n id,\n project,\n onNavigate = NOOP,\n children,\n}: CallableWorkspaceProps): ReactNode {\n const resolved = resolveEditorProject(project, useProvidedProject());\n const base = useMemo(() => ({ kind, id }), [kind, id]);\n return (\n <WorkspaceProvider base={base}>\n <RailEnvProvider project={resolved} onNavigate={onNavigate}>\n <ProjectExpressionScope project={resolved}>{children}</ProjectExpressionScope>\n </RailEnvProvider>\n </WorkspaceProvider>\n );\n}\n","/**\n * `<CallableRail kind id>` — the editor's right rail, placeable anywhere inside a\n * `<CallableWorkspace>` (a host drawer, a sidebar). It reads the nearest workspace, renders nothing\n * when the workspace's `{kind, id}` differs or no tool is available for it, and throws outside any\n * workspace (as `useWorkspaceCallable` does).\n *\n * Settings, Code and Error handling all serve workflow, function and endpoint. Error handling on a\n * workflow shows only when an editor published its policy writer (`ctx.onPolicyChange`); on a\n * function/endpoint it is always there (it saves from the cached record when no writer is\n * published). The rail shows exactly what `isAvailable` accepts.\n */\nimport type { ReactNode } from \"react\";\nimport { type RailTool, RightRail } from \"../chrome/RightRail.tsx\";\nimport { useWorkspaceCallable } from \"../chrome/workspace.tsx\";\nimport type { CallableRailKind } from \"./CallableWorkspace.tsx\";\nimport { editorRailTools } from \"./editor-tools.ts\";\nimport { useRailEnv } from \"./rail-env.tsx\";\n\nexport interface CallableRailProps {\n kind: CallableRailKind;\n id: string;\n /** Default {@link editorRailTools}. */\n tools?: readonly RailTool[];\n /** localStorage key for the open tool. Default `w6w.rail.embed.<project>`. */\n storageKey?: string;\n}\n\nexport function CallableRail({\n kind,\n id,\n tools = editorRailTools,\n storageKey,\n}: CallableRailProps): ReactNode {\n const ctx = useWorkspaceCallable();\n const { project } = useRailEnv();\n if (!ctx || ctx.kind !== kind || ctx.id !== id) return null;\n const available = tools.filter((t) => t.isAvailable(ctx));\n if (available.length === 0) return null;\n const key = storageKey ?? (project === null ? null : `w6w.rail.embed.${project}`);\n return (\n <div className=\"w6w-embed-root\" style={{ display: \"flex\", height: \"100%\", minHeight: 0 }}>\n <RightRail tools={available} storageKey={key} />\n </div>\n );\n}\n"],"names":["NOOP","CallableWorkspace","kind","id","project","onNavigate","children","resolved","resolveEditorProject","useProvidedProject","base","useMemo","jsx","WorkspaceProvider","RailEnvProvider","ProjectExpressionScope","CallableRail","tools","editorRailTools","storageKey","ctx","useWorkspaceCallable","useRailEnv","available","t","key","RightRail"],"mappings":";;;;;AA+BA,MAAMA,IAAO,MAAY;AAAC;AAEnB,SAASC,EAAkB;AAAA,EAChC,MAAAC;AAAA,EACA,IAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC,IAAaL;AAAA,EACb,UAAAM;AACF,GAAsC;AACpC,QAAMC,IAAWC,EAAqBJ,GAASK,EAAA,CAAoB,GAC7DC,IAAOC,EAAQ,OAAO,EAAE,MAAAT,GAAM,IAAAC,MAAO,CAACD,GAAMC,CAAE,CAAC;AACrD,SACE,gBAAAS,EAACC,GAAA,EAAkB,MAAAH,GACjB,UAAA,gBAAAE,EAACE,KAAgB,SAASP,GAAU,YAAAF,GAClC,UAAA,gBAAAO,EAACG,GAAA,EAAuB,SAASR,GAAW,UAAAD,EAAA,CAAS,GACvD,GACF;AAEJ;ACtBO,SAASU,EAAa;AAAA,EAC3B,MAAAd;AAAA,EACA,IAAAC;AAAA,EACA,OAAAc,IAAQC;AAAA,EACR,YAAAC;AACF,GAAiC;AAC/B,QAAMC,IAAMC,EAAA,GACN,EAAE,SAAAjB,EAAA,IAAYkB,EAAA;AACpB,MAAI,CAACF,KAAOA,EAAI,SAASlB,KAAQkB,EAAI,OAAOjB,EAAI,QAAO;AACvD,QAAMoB,IAAYN,EAAM,OAAO,CAACO,MAAMA,EAAE,YAAYJ,CAAG,CAAC;AACxD,MAAIG,EAAU,WAAW,EAAG,QAAO;AACnC,QAAME,IAAMN,MAAef,MAAY,OAAO,OAAO,kBAAkBA,CAAO;AAC9E,2BACG,OAAA,EAAI,WAAU,kBAAiB,OAAO,EAAE,SAAS,QAAQ,QAAQ,QAAQ,WAAW,KACnF,UAAA,gBAAAQ,EAACc,GAAA,EAAU,OAAOH,GAAW,YAAYE,GAAK,GAChD;AAEJ;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ApiCallRecord } from '@w6w/sdk/console';
|
|
2
|
+
export declare function useApiCallsQuery(project: string | undefined, appId: string, opts?: {
|
|
3
|
+
limit?: number;
|
|
4
|
+
}): import('@tanstack/react-query').UseQueryResult<NoInfer<import('@w6w/sdk/console').ApiCallRecord[]>, Error>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { W6WClient } from '@w6w/sdk';
|
|
2
|
+
import { ActionDef, AppDetail } from '@w6w/sdk/console';
|
|
3
|
+
export declare const appActionsKey: (id: string) => readonly ["app-actions", string];
|
|
4
|
+
export declare function getAppActions(client: W6WClient, id: string): Promise<ActionDef[]>;
|
|
5
|
+
/** `enabled` defaults to `true`; a selector passes `app !== ""` so an empty app issues nothing. */
|
|
6
|
+
export declare function useAppActionsQuery(id: string, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<ActionDef[]>, Error>;
|
|
7
|
+
export declare const appKey: (id: string) => readonly ["app", string];
|
|
8
|
+
export declare function getApp(client: W6WClient, id: string): Promise<AppDetail>;
|
|
9
|
+
/**
|
|
10
|
+
* `id` accepts `string | undefined`: a detail view's app id is `undefined` until its own
|
|
11
|
+
* connection query resolves, so the caller passes `enabled` (its `!!id` guard) instead of
|
|
12
|
+
* `!`-asserting.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useAppQuery(id: string | undefined, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<AppDetail>, Error>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { W6WClient } from '@w6w/sdk';
|
|
2
|
+
import { CallableKind } from '../lib/callable-kind.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The structural minimum every list row of every kind satisfies — what the shared list chrome
|
|
5
|
+
* (`pages/CallablePage.tsx`) renders and the Settings rail reads by id. Kind-specific widening
|
|
6
|
+
* (`archivedAt`, an Endpoint's `status`/`incomplete`) stays in the kind's own facade, which is
|
|
7
|
+
* where the comment explaining "the SDK does not know this column yet" belongs.
|
|
8
|
+
*/
|
|
9
|
+
export interface CallableRow {
|
|
10
|
+
id: string;
|
|
11
|
+
/** `null` for a Workflow that has no key of its own yet (`WorkflowSummary`'s own
|
|
12
|
+
* type) — never coerced to `""` here, so the list renders exactly what the server sent. */
|
|
13
|
+
key: string | null;
|
|
14
|
+
displayName?: string | null;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
archivedAt?: string | null;
|
|
17
|
+
}
|
|
18
|
+
/** `<coll>` for a kind — the wire segment AND (studio mirrors the wire) the route segment. */
|
|
19
|
+
export declare function callableCollection(kind: CallableKind): string;
|
|
20
|
+
/** The studio route for a kind, or for one of its resources: `"functions"`, `"functions/fn_x"`. */
|
|
21
|
+
export declare function callableRoute(kind: CallableKind, id?: string): string;
|
|
22
|
+
/** The wire path for one resource: `/functions/fn_x`. */
|
|
23
|
+
export declare function callablePath(kind: CallableKind, id: string): string;
|
|
24
|
+
/** The studio route for one resource's History tab/page (T2.3.1/T2.4.1):
|
|
25
|
+
* `"functions/fn_x/history"`. A sibling of {@link callableRoute}, not a
|
|
26
|
+
* hand-written string per call site. */
|
|
27
|
+
export declare function callableHistoryRoute(kind: CallableKind, id: string): string;
|
|
28
|
+
/** `GET /<coll>`'s own query key — the literal `lib/spec-import-invalidation.ts` invalidates. */
|
|
29
|
+
export declare function callableListKey(kind: CallableKind, project?: string): readonly unknown[];
|
|
30
|
+
/**
|
|
31
|
+
* `GET /<coll>`. A `switch`, not a table: the three SDK calls return three different summary
|
|
32
|
+
* types, and the union is what the shared chrome consumes structurally.
|
|
33
|
+
*/
|
|
34
|
+
export declare function listCallables(client: W6WClient, kind: CallableKind, project?: string): Promise<CallableRow[]>;
|
|
35
|
+
/**
|
|
36
|
+
* `GET /<coll>/:id`, each arm returning exactly what that kind's existing repo function returns —
|
|
37
|
+
* Function's `{...function, valid}` splice, Endpoint's `{endpoint, invokeUrl, …}` envelope,
|
|
38
|
+
* Workflow's three-field body — never re-shaped here. The return type is the honest `unknown`:
|
|
39
|
+
* the per-kind reader in the kind's own facade is what narrows it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getCallable(client: W6WClient, kind: CallableKind, id: string): Promise<unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* `POST /<coll>`, normalised to the one thing EVERY caller of a save needs — the saved resource's
|
|
44
|
+
* id and key, for the invalidation below and for a create modal's own "created" callback. The two
|
|
45
|
+
* envelopes (`{endpoint: {id, key}}`, `{workflow: {id, key}}`) and the flat one (`{id, key}`) are
|
|
46
|
+
* unwrapped in the arm that knows its own shape, so no caller outside this module ever has to.
|
|
47
|
+
*
|
|
48
|
+
* Workflow refuses without a `project` for the same reason `repos/workflows.ts`'s own save does:
|
|
49
|
+
* a missing project on a WRITE lands the definition in the account's default project instead of
|
|
50
|
+
* the one the operator is looking at.
|
|
51
|
+
*/
|
|
52
|
+
export declare function saveCallable(client: W6WClient, kind: CallableKind, definition: unknown, options?: {
|
|
53
|
+
project?: string;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
id: string;
|
|
56
|
+
key: string;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* `POST /<coll>/:id/archive`. Function and Endpoint go through the plain `apiClient.request()`
|
|
60
|
+
* escape hatch (T4.1.1/A7/D-I0-7: no typed `@w6w/sdk` method exists, and adding one would drag
|
|
61
|
+
* `packages/wrappers` into this task's scope for an internal route); Workflow keeps the typed
|
|
62
|
+
* `console.workflows.archive` it has had since the rail's DangerZone landed.
|
|
63
|
+
*/
|
|
64
|
+
export declare function archiveCallable(client: W6WClient, kind: CallableKind, id: string): Promise<unknown>;
|
|
65
|
+
/** `DELETE /<coll>/:id` — same split, and the same reasoning, as {@link archiveCallable}. */
|
|
66
|
+
export declare function deleteCallable(client: W6WClient, kind: CallableKind, id: string): Promise<unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* `useQuery` over {@link listCallables}, keyed by {@link callableListKey}. Generic over the row
|
|
69
|
+
* type so a kind's own facade can narrow it to that kind's widened summary (Function's
|
|
70
|
+
* `archivedAt`, Endpoint's `status`/`incomplete`) without a cast at the call site.
|
|
71
|
+
*/
|
|
72
|
+
export declare function useCallableListQuery<Row extends CallableRow = CallableRow>(kind: CallableKind, enabled?: boolean, project?: string): import('@tanstack/react-query').UseQueryResult<NoInfer<Row[]>, Error>;
|
|
73
|
+
/** `useQuery` over {@link getCallable}, keyed by {@link callableKey}. */
|
|
74
|
+
export declare function useCallableQuery<Def = unknown>(kind: CallableKind, id: string, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<Def>, Error>;
|
|
75
|
+
/**
|
|
76
|
+
* `useMutation` over {@link saveCallable}. `onSuccess` routes through the SAME
|
|
77
|
+
* `invalidateSavedCallable` helper every save in studio already uses, with the SAME two keys —
|
|
78
|
+
* the list AND the saved resource — so the Function arm's invalidation is the one
|
|
79
|
+
* `repos/functions.ts` performs today, byte for byte.
|
|
80
|
+
*/
|
|
81
|
+
export declare function useSaveCallableMutation(kind: CallableKind, options?: {
|
|
82
|
+
project?: string;
|
|
83
|
+
}): import('@tanstack/react-query').UseMutationResult<{
|
|
84
|
+
id: string;
|
|
85
|
+
key: string;
|
|
86
|
+
}, Error, unknown, unknown>;
|
|
87
|
+
/** `useMutation` over {@link archiveCallable} — the list key, so the row's archived badge
|
|
88
|
+
* refreshes and the rail's Delete control appears in Archive's place. */
|
|
89
|
+
export declare function useArchiveCallableMutation(kind: CallableKind): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
|
|
90
|
+
/** `useMutation` over {@link deleteCallable}. */
|
|
91
|
+
export declare function useDeleteCallableMutation(kind: CallableKind): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ConnectionSummary, W6WClient } from '@w6w/sdk';
|
|
2
|
+
import { ConnectionTestResult } from '@w6w/sdk/console';
|
|
3
|
+
export type { ConnectionSummary } from '@w6w/sdk';
|
|
4
|
+
export declare const connectionsForAppKey: (appId: string) => readonly ["app-connections", string];
|
|
5
|
+
export declare function listConnectionsForApp(client: W6WClient, appId: string): Promise<ConnectionSummary[]>;
|
|
6
|
+
/**
|
|
7
|
+
* `enabled` defaults to `true`. `TargetSelector` passes `app !== ""` — its original
|
|
8
|
+
* pre-migration guard, preserved exactly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useConnectionsForAppQuery(appId: string, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<ConnectionSummary[]>, Error>;
|
|
11
|
+
export declare const connectionsKey: readonly ["connections"];
|
|
12
|
+
export declare function listConnections(client: W6WClient): Promise<ConnectionSummary[]>;
|
|
13
|
+
export declare function useConnectionsQuery(): import('@tanstack/react-query').UseQueryResult<NoInfer<ConnectionSummary[]>, Error>;
|
|
14
|
+
export declare const connectionKey: (id: string) => readonly ["connection", string];
|
|
15
|
+
export declare function getConnection(client: W6WClient, id: string): Promise<ConnectionSummary>;
|
|
16
|
+
export declare function useConnectionQuery(id: string): import('@tanstack/react-query').UseQueryResult<NoInfer<ConnectionSummary>, Error>;
|
|
17
|
+
export declare function createConnection(client: W6WClient, appId: string, body: {
|
|
18
|
+
authKey: string;
|
|
19
|
+
credential: Record<string, unknown>;
|
|
20
|
+
displayName?: string;
|
|
21
|
+
profile?: Record<string, unknown>;
|
|
22
|
+
}): Promise<ConnectionSummary>;
|
|
23
|
+
/** The write `W6WEmbedProvider` hands the ui adapter as `updateConnection` (the SDK adapter has none). */
|
|
24
|
+
export declare function updateConnection(client: W6WClient, id: string, body: {
|
|
25
|
+
displayName?: string;
|
|
26
|
+
credential?: Record<string, unknown>;
|
|
27
|
+
}): Promise<ConnectionSummary>;
|
|
28
|
+
export declare function useUpdateConnectionMutation(connectionId: string): import('@tanstack/react-query').UseMutationResult<ConnectionSummary, Error, {
|
|
29
|
+
displayName?: string;
|
|
30
|
+
credential?: Record<string, unknown>;
|
|
31
|
+
}, unknown>;
|
|
32
|
+
export declare function useTestConnectionMutation(connectionId: string): import('@tanstack/react-query').UseMutationResult<ConnectionTestResult, Error, void, unknown>;
|
|
33
|
+
export declare function useDeleteConnectionMutation(): import('@tanstack/react-query').UseMutationResult<void, Error, string, unknown>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DashboardStatsParams } from '@w6w/sdk/console';
|
|
2
|
+
export type { DashboardStats, DashboardStatsParams } from '@w6w/sdk/console';
|
|
3
|
+
/** One of the two account-scoped dashboard windows `<ActivitySummary>` renders. */
|
|
4
|
+
export declare function useDashboardStatsQuery(key: "today" | "week", params: DashboardStatsParams): import('@tanstack/react-query').UseQueryResult<NoInfer<import('@w6w/sdk').DashboardStats>, Error>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { W6WClient } from '@w6w/sdk';
|
|
2
|
+
import { EndpointDef as SdkEndpointDef, EndpointSummary as SdkEndpointSummary, EndpointTarget as SdkEndpointTarget } from '@w6w/sdk/console';
|
|
3
|
+
export type { ActionTarget, CallableRef, CallableOnError, ErrorHandlerTarget, EndpointAuthMode, EndpointInput, EndpointInvokeResult, EndpointSecurity, EndpointTarget, ErrorReroute, Exposure, RetryPolicy, } from '@w6w/sdk/console';
|
|
4
|
+
export { SECRET_MASK } from '@w6w/sdk/console';
|
|
5
|
+
/** An Endpoint's OWN target: the alias-only `endpoint` arm excluded, mirroring the
|
|
6
|
+
* server fence in admin/endpoints.ts's validateDefinition. Aliases use the full union
|
|
7
|
+
* (`EndpointTarget`, re-exported above verbatim). */
|
|
8
|
+
export type EndpointOwnTarget = Exclude<SdkEndpointTarget, {
|
|
9
|
+
kind: "endpoint";
|
|
10
|
+
}>;
|
|
11
|
+
export type EndpointDef = Omit<SdkEndpointDef, "target"> & {
|
|
12
|
+
target: EndpointOwnTarget;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* One entry of the `invokeUrls[]` array the server renders on `GET
|
|
16
|
+
* /endpoints/:id` and the `POST /endpoints` 201 (T3.4.1, `admin/endpoints.ts`'s
|
|
17
|
+
* `InvokeUrlEntry` — the shapes are kept in sync by hand, not shared, because
|
|
18
|
+
* `@w6w/sdk` does not type this field yet: it is server-fresh and
|
|
19
|
+
* `packages/wrappers` publishes in lockstep at one `VERSION` across four
|
|
20
|
+
* languages, outside this project's boundary (HITL-10). `entries[0]` is always
|
|
21
|
+
* the platform entry; every entry after it is one of the tenant's domains.
|
|
22
|
+
* `default` mirrors the tenant's stored default domain and, since D-S1
|
|
23
|
+
* (intake T-0.2), it is what CHOOSES the open-on entry: absent an
|
|
24
|
+
* in-session pick, the URL card opens on whichever entry carries it,
|
|
25
|
+
* falling back to `entries[0]` only when no entry does. `resolves` is a
|
|
26
|
+
* static host comparison the server already made; the client never
|
|
27
|
+
* re-derives it.
|
|
28
|
+
*/
|
|
29
|
+
export interface InvokeUrlOption {
|
|
30
|
+
domain: string;
|
|
31
|
+
default: boolean;
|
|
32
|
+
url: string;
|
|
33
|
+
urlByKey?: string;
|
|
34
|
+
resolves: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** The two SDK-typed URL fields, widened with the untyped `invokeUrls[]`
|
|
37
|
+
* array — the ONE seam `getEndpoint`, the save mutation and the editor's own
|
|
38
|
+
* 201 read all widen through, so `EndpointsPage.tsx` never casts. */
|
|
39
|
+
type WithInvokeUrls = {
|
|
40
|
+
invokeUrl: string;
|
|
41
|
+
invokeUrlByKey?: string;
|
|
42
|
+
invokeUrls?: InvokeUrlOption[];
|
|
43
|
+
};
|
|
44
|
+
/** An Endpoint list row — the SDK's own summary (`status`, `incomplete` and `archivedAt` are
|
|
45
|
+
* on it since W-12), read for draft-ness only through {@link isEndpointDraft}. */
|
|
46
|
+
export type EndpointSummary = SdkEndpointSummary;
|
|
47
|
+
/** Is this row a draft — not authorised to dispatch (HITL-7/HITL-8,
|
|
48
|
+
* `rfcs/endpoint.md` § Amendment — 2026-08-14b)? Prefers the server's `status`
|
|
49
|
+
* field (`!== "ready"`), falling back to the older `incomplete` boolean only
|
|
50
|
+
* when `status` is absent (a server that has not shipped it yet). The sole
|
|
51
|
+
* reader of both fields in studio; every "unfinished" UI decision (the
|
|
52
|
+
* list's tag, and any future one) calls this rather than reading either
|
|
53
|
+
* field inline. */
|
|
54
|
+
export declare function isEndpointDraft(ep: Pick<EndpointSummary, "status" | "incomplete">): boolean;
|
|
55
|
+
/** Endpoint definitions carry `manifestVersion: "2"` — the one literal, shared
|
|
56
|
+
* by the editor's blank draft and the create modal's first POST. */
|
|
57
|
+
export declare const ENDPOINT_MANIFEST_VERSION = "2";
|
|
58
|
+
/** The list key {@link useEndpointsQuery} reads — `callables.ts`'s own
|
|
59
|
+
* `callableListKey("endpoint")` (byte-identical `["endpoints"]`), kept as a named export because
|
|
60
|
+
* `repos/spec-import.ts` invalidates it by value. */
|
|
61
|
+
export declare const endpointsKey: readonly unknown[];
|
|
62
|
+
export declare function useEndpointsQuery(enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<SdkEndpointSummary[]>, Error>;
|
|
63
|
+
/** Fetch one Endpoint. Widens the SDK's return once — the server sends
|
|
64
|
+
* `invokeUrls[]` (T3.4.1) that `@w6w/sdk`'s typed `get()` does not know about
|
|
65
|
+
* yet; see {@link WithInvokeUrls}. */
|
|
66
|
+
export declare function getEndpoint(client: W6WClient, id: string): Promise<{
|
|
67
|
+
endpoint: EndpointDef;
|
|
68
|
+
} & WithInvokeUrls>;
|
|
69
|
+
/** The single-resource key — `callables.ts`'s own `callableKey("endpoint", id)` (byte-identical
|
|
70
|
+
* `["endpoint", id]`), kept as a named export because `repos/versions.ts`'s revert arm invalidates
|
|
71
|
+
* it by value. */
|
|
72
|
+
export declare const endpointKey: (id: string) => readonly unknown[];
|
|
73
|
+
/** `TargetSelector`'s `endpoint` arm needs one Endpoint's own `input` contract
|
|
74
|
+
* to project into fields — mirrors `useFunctionQuery`/`useWorkflowQuery`
|
|
75
|
+
* (`repos/functions.ts`/`repos/workflows.ts`) exactly. */
|
|
76
|
+
export declare function useEndpointQuery(id: string, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<{
|
|
77
|
+
endpoint: EndpointDef;
|
|
78
|
+
} & WithInvokeUrls>, Error>;
|
|
79
|
+
/**
|
|
80
|
+
* The Endpoint arm's SAVE — the one delegated name whose `mutationFn` is NOT `callables.ts`'s
|
|
81
|
+
* `saveCallable`: that helper normalises every kind's success envelope down to `{id, key}` for the
|
|
82
|
+
* invalidation below, while this kind's 201 also carries the fresh server-rendered `invokeUrl`/
|
|
83
|
+
* `invokeUrlByKey`/`invokeUrls[]` the editor's URL card renders from (`onSaveSuccess` in
|
|
84
|
+
* `EndpointsPage.tsx`). Its KEYS and its invalidation, though, are the generic pair's — so the
|
|
85
|
+
* "which keys does an Endpoint save refresh" answer still has one home.
|
|
86
|
+
*/
|
|
87
|
+
export declare function useSaveEndpointMutation(): import('@tanstack/react-query').UseMutationResult<{
|
|
88
|
+
endpoint: {
|
|
89
|
+
id: string;
|
|
90
|
+
key: string;
|
|
91
|
+
};
|
|
92
|
+
} & WithInvokeUrls, Error, unknown, unknown>;
|
|
93
|
+
/**
|
|
94
|
+
* The GUARDED Endpoint save: `console.endpoints.upsert(definition, {ifUnmodifiedSince})`, so a
|
|
95
|
+
* save from a stale copy answers `409 endpoint_stale`. Variables and invalidation as
|
|
96
|
+
* {@link useSaveEndpointMutation}'s, plus the required token (`null` opts out explicitly; it is
|
|
97
|
+
* `callableRecord("endpoint", …).updatedAt`, the envelope's TOP-LEVEL `updatedAt`). Resolves the
|
|
98
|
+
* verbatim upsert body (`{endpoint:{id,key}, invokeUrl, …, updatedAt}`). Additive: the unguarded
|
|
99
|
+
* hook's `mutate(definition)` shape is unchanged.
|
|
100
|
+
*/
|
|
101
|
+
export declare function useGuardedSaveEndpointMutation(): import('@tanstack/react-query').UseMutationResult<{
|
|
102
|
+
endpoint: {
|
|
103
|
+
id: string;
|
|
104
|
+
key: string;
|
|
105
|
+
};
|
|
106
|
+
updatedAt: string;
|
|
107
|
+
} & WithInvokeUrls, Error, {
|
|
108
|
+
definition: unknown;
|
|
109
|
+
ifUnmodifiedSince: string | null;
|
|
110
|
+
}, unknown>;
|
|
111
|
+
export declare function invokeEndpoint(client: W6WClient, id: string, input: Record<string, unknown>): Promise<import('@w6w/sdk/console').EndpointInvokeResult>;
|
|
112
|
+
export declare function useInvokeEndpointMutation(): import('@tanstack/react-query').UseMutationResult<import('@w6w/sdk/console').EndpointInvokeResult, Error, {
|
|
113
|
+
id: string;
|
|
114
|
+
input: Record<string, unknown>;
|
|
115
|
+
}, unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* T4.1.1/A7/D-I0-7: `POST /endpoints/:id/archive` — the Endpoint arm of `callables.ts`'s generic
|
|
118
|
+
* pair (the plain `apiClient.request()` escape hatch, NOT a typed `@w6w/sdk` method, which would
|
|
119
|
+
* drag `packages/wrappers` into this task's scope for one internal route). Invalidates
|
|
120
|
+
* `endpointsKey`, so the list's `archivedAt` refreshes and the rail's Delete control appears in
|
|
121
|
+
* Archive's place.
|
|
122
|
+
*/
|
|
123
|
+
export declare function useArchiveEndpointMutation(): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
|
|
124
|
+
/** `DELETE /endpoints/:id` — the Endpoint arm of the same generic pair. */
|
|
125
|
+
export declare function useDeleteEndpointMutation(): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { W6WClient } from '@w6w/sdk';
|
|
2
|
+
import { FunctionSummary as SdkFunctionSummary } from '@w6w/sdk/console';
|
|
3
|
+
export type { FunctionDef, FunctionImpl, FunctionInput, FunctionOutputField, } from '@w6w/sdk/console';
|
|
4
|
+
/** A Function list row — the SDK's own summary (it carries `archivedAt` since W-12). */
|
|
5
|
+
export type FunctionSummary = SdkFunctionSummary;
|
|
6
|
+
/** The list key {@link useFunctionsQuery} reads — `callables.ts`'s own
|
|
7
|
+
* `callableListKey("function")`, kept as a named export because
|
|
8
|
+
* `lib/spec-import-invalidation.ts` invalidates it by value. */
|
|
9
|
+
export declare const functionsKey: readonly unknown[];
|
|
10
|
+
/** Function definitions carry `manifestVersion: "2"` - the one literal, shared
|
|
11
|
+
* by the editor's blank draft and the create modal's first POST. */
|
|
12
|
+
export declare const FUNCTION_MANIFEST_VERSION = "2";
|
|
13
|
+
export declare function listFunctions(client: W6WClient): Promise<SdkFunctionSummary[]>;
|
|
14
|
+
export declare function useFunctionsQuery(enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<SdkFunctionSummary[]>, Error>;
|
|
15
|
+
export declare const functionKey: (id: string) => readonly unknown[];
|
|
16
|
+
/** The Function arm's own reader: the SDK's typed `get`, whose `{...function, valid}` splice is
|
|
17
|
+
* what `FunctionEditor` hydrates its draft from (pin 5 — the server computes `valid`; studio
|
|
18
|
+
* never reimplements the check). */
|
|
19
|
+
export declare function getFunction(client: W6WClient, id: string): Promise<import('@w6w/sdk/console').FunctionRead>;
|
|
20
|
+
export declare function useFunctionQuery(id: string, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<import('@w6w/sdk/console').FunctionDef & {
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}>, Error>;
|
|
23
|
+
export declare function useSaveFunctionMutation(): import('@tanstack/react-query').UseMutationResult<{
|
|
24
|
+
id: string;
|
|
25
|
+
key: string;
|
|
26
|
+
}, Error, unknown, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* The GUARDED Function save: `console.functions.upsert(definition, {ifUnmodifiedSince})`, so a
|
|
29
|
+
* save made from a stale copy answers `409 function_stale` instead of overwriting the newer one.
|
|
30
|
+
* `ifUnmodifiedSince` is REQUIRED in the variables (pass `null` to opt out explicitly) so a call
|
|
31
|
+
* site cannot forget the token; it is the `updatedAt` of the copy the definition was edited from
|
|
32
|
+
* (`callableRecord("function", …).updatedAt`). Same invalidation as {@link useSaveFunctionMutation}
|
|
33
|
+
* (list + the saved resource's key); resolves `{id, key, updatedAt}`. Additive: the unguarded
|
|
34
|
+
* hook's `mutate(definition)` shape is unchanged.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useGuardedSaveFunctionMutation(): import('@tanstack/react-query').UseMutationResult<{
|
|
37
|
+
id: string;
|
|
38
|
+
key: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}, Error, {
|
|
41
|
+
definition: unknown;
|
|
42
|
+
ifUnmodifiedSince: string | null;
|
|
43
|
+
}, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* One test invoke's result: the Function's own output, plus the platform's
|
|
46
|
+
* record of the attempt.
|
|
47
|
+
*
|
|
48
|
+
* The two are kept apart rather than merged because they answer different
|
|
49
|
+
* questions, and merging them is what the invocation envelope exists to stop:
|
|
50
|
+
* a vendor payload reading `{"statusCode": 202}` is SendGrid describing its own
|
|
51
|
+
* request, while `status` here is whether w6w considered the call a success.
|
|
52
|
+
* The frame fields are optional — an older server sends only the output.
|
|
53
|
+
*/
|
|
54
|
+
export interface FunctionInvokeResult {
|
|
55
|
+
output: unknown;
|
|
56
|
+
invocationId?: string;
|
|
57
|
+
status?: string;
|
|
58
|
+
durationMs?: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* `fn_…` ids are already URN-shaped, so the base dispatcher resolves them
|
|
62
|
+
* directly — no id translation. `isFunctionRun` narrows the open
|
|
63
|
+
* `RunEnvelope`; a `fn_…` URN can only ever resolve to the `function` arm
|
|
64
|
+
* server-side, so the `else` branch is defensive, not a real code path.
|
|
65
|
+
*/
|
|
66
|
+
export declare function invokeFunction(client: W6WClient, id: string, inputs: Record<string, unknown>): Promise<FunctionInvokeResult>;
|
|
67
|
+
export declare function useInvokeFunctionMutation(): import('@tanstack/react-query').UseMutationResult<FunctionInvokeResult, Error, {
|
|
68
|
+
id: string;
|
|
69
|
+
inputs: Record<string, unknown>;
|
|
70
|
+
}, unknown>;
|
|
71
|
+
/**
|
|
72
|
+
* T4.1.1/A7/D-I0-7: `POST /functions/:id/archive`, `DELETE /functions/:id` — the Function arm of
|
|
73
|
+
* `callables.ts`'s generic pair (the plain `apiClient.request()` escape hatch, NOT a typed
|
|
74
|
+
* `@w6w/sdk` method, which would drag `packages/wrappers` into this task's scope for two internal
|
|
75
|
+
* routes). Both invalidate `functionsKey`, so the list's `archivedAt` refreshes and the rail's
|
|
76
|
+
* Delete control appears in Archive's place.
|
|
77
|
+
*/
|
|
78
|
+
export declare function useArchiveFunctionMutation(): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
|
|
79
|
+
export declare function useDeleteFunctionMutation(): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
|
package/dist/repos/index.d.ts
CHANGED
|
@@ -20,3 +20,13 @@ export * from '../lib/new-id.ts';
|
|
|
20
20
|
export * from '../lib/callable-descriptors.ts';
|
|
21
21
|
export * from '../lib/callable-kind.ts';
|
|
22
22
|
export * from './spec-import.ts';
|
|
23
|
+
export * from './callables.ts';
|
|
24
|
+
export * from './functions.ts';
|
|
25
|
+
export * from './endpoints.ts';
|
|
26
|
+
export * from './spec-export.ts';
|
|
27
|
+
export * from './apps.ts';
|
|
28
|
+
export * from './connections.ts';
|
|
29
|
+
export * from './saved-tests.ts';
|
|
30
|
+
export * from './reliability.ts';
|
|
31
|
+
export * from './dashboard.ts';
|
|
32
|
+
export * from './api-calls.ts';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReliabilityComponentReport, ReliabilityErrorMix, ReliabilityService, ReliabilityServiceMembers, ReliabilityServices, ReliabilityTimelineEntry } from '@w6w/sdk/console';
|
|
2
|
+
export type { ReliabilityComponentReport, ReliabilityErrorMix, ReliabilityService, ReliabilityServiceMembers, ReliabilityServices, ReliabilityTimelineEntry, };
|
|
3
|
+
/** A single bounded status request. Callers must pass at most ten app ids. */
|
|
4
|
+
export declare function useReliabilityQuery(project: string | undefined, appIds: readonly string[], days?: number, limit?: number): import('@tanstack/react-query').UseQueryResult<NoInfer<ReliabilityServices>, Error>;
|
|
5
|
+
/**
|
|
6
|
+
* Discover a project's service ids, then request their status in batches of at most ten.
|
|
7
|
+
* Membership discovery is identifier-only; every status request names the app ids it may inspect.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useProjectReliabilityQuery(project: string | undefined, days?: number): {
|
|
10
|
+
data: {
|
|
11
|
+
services: never[];
|
|
12
|
+
account: string;
|
|
13
|
+
window: {
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
days: number;
|
|
17
|
+
};
|
|
18
|
+
uptimeMeans: string;
|
|
19
|
+
definition: {
|
|
20
|
+
id: string;
|
|
21
|
+
version: string;
|
|
22
|
+
source: string;
|
|
23
|
+
};
|
|
24
|
+
appIds: string[];
|
|
25
|
+
} | {
|
|
26
|
+
services: ReliabilityService[];
|
|
27
|
+
account: string;
|
|
28
|
+
window: {
|
|
29
|
+
from: string;
|
|
30
|
+
to: string;
|
|
31
|
+
days: number;
|
|
32
|
+
};
|
|
33
|
+
uptimeMeans: string;
|
|
34
|
+
definition: {
|
|
35
|
+
id: string;
|
|
36
|
+
version: string;
|
|
37
|
+
source: string;
|
|
38
|
+
};
|
|
39
|
+
} | undefined;
|
|
40
|
+
error: Error | null;
|
|
41
|
+
isLoading: boolean;
|
|
42
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { W6WClient } from '@w6w/sdk';
|
|
2
|
+
import { SavedTest, TestRunSummary } from '@w6w/sdk/console';
|
|
3
|
+
export type { SavedTest, TestRunSummary } from '@w6w/sdk/console';
|
|
4
|
+
export declare const savedTestsKey: (connId: string) => readonly ["saved-tests", string];
|
|
5
|
+
export declare function listSavedTests(client: W6WClient, connId: string): Promise<SavedTest[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Shared by BOTH `ConnectionDetailPage.tsx` and `ConnectionActionPage.tsx` —
|
|
8
|
+
* the action page deliberately "just subscribes" to the SAME cache entry
|
|
9
|
+
* the list page already populates (no `getSavedTest` method exists). Both call
|
|
10
|
+
* sites MUST go through this hook (or `savedTestsKey` directly) so the key
|
|
11
|
+
* is byte-identical; a hand-spelled second key here would silently defeat
|
|
12
|
+
* the sharing and either double-fetch or leave the tester reading a cold,
|
|
13
|
+
* empty cache.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useSavedTestsQuery(connId: string): import('@tanstack/react-query').UseQueryResult<NoInfer<SavedTest[]>, Error>;
|
|
16
|
+
export declare const testRunsKey: (connId: string) => readonly ["test-runs", string];
|
|
17
|
+
export declare function listTestRuns(client: W6WClient, connId: string): Promise<TestRunSummary[]>;
|
|
18
|
+
/** `retry: false` baked in — matches the sole pre-migration caller's original option
|
|
19
|
+
* (`ConnectionDetailPage.tsx`'s comment: a load failure must not retry-storm the page). */
|
|
20
|
+
export declare function useTestRunsQuery(connId: string): import('@tanstack/react-query').UseQueryResult<NoInfer<TestRunSummary[]>, Error>;
|
|
21
|
+
export declare function createSavedTest(client: W6WClient, connId: string, body: {
|
|
22
|
+
actionKey: string;
|
|
23
|
+
name: string;
|
|
24
|
+
values: Record<string, unknown>;
|
|
25
|
+
}): Promise<SavedTest>;
|
|
26
|
+
export declare function updateSavedTest(client: W6WClient, connId: string, id: string, patch: {
|
|
27
|
+
name?: string;
|
|
28
|
+
values?: Record<string, unknown>;
|
|
29
|
+
}): Promise<SavedTest>;
|
|
30
|
+
export declare function deleteSavedTest(client: W6WClient, connId: string, id: string): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* The SDK returns the REAL created `SavedTestRun` (T2.6.1's design). `@w6w/ui`'s
|
|
33
|
+
* `W6WApi.recordTestRun` is pinned `Promise<void>` (`provider.tsx:168-177`) —
|
|
34
|
+
* discard here, in the repo/adaptation layer, not in the SDK. Verified this
|
|
35
|
+
* discard is load-bearing, not decorative: a scratch `tsc --strict` check
|
|
36
|
+
* confirms `Promise<SavedTestRun>` does NOT structurally satisfy
|
|
37
|
+
* `Promise<void>` (TS's void-return leniency does not extend through a
|
|
38
|
+
* `Promise<T>` wrapper).
|
|
39
|
+
*/
|
|
40
|
+
export declare function recordTestRun(client: W6WClient, connId: string, body: {
|
|
41
|
+
savedTestId?: string | null;
|
|
42
|
+
actionKey: string;
|
|
43
|
+
ok: boolean;
|
|
44
|
+
summary?: string;
|
|
45
|
+
result?: unknown;
|
|
46
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The collections that carry a `/spec` export route — `specCollectionForKind`
|
|
2
|
+
* (`../lib/rail-settings.ts`) is the sole producer of this type's values. */
|
|
3
|
+
export type SpecCollection = "functions" | "endpoints";
|
|
4
|
+
/**
|
|
5
|
+
* Mirrors T2.1.1's `SpecDocument`, also mirrored by `repos/spec-import.ts`'s
|
|
6
|
+
* `SpecImportDocument` for the sibling import route: the portable document a
|
|
7
|
+
* `GET /<kind>/:id/spec` export produces. Not a bare `FunctionDef`/`EndpointDef`
|
|
8
|
+
* — `id` is deleted server-side (`admin/spec.ts:96-108`) and connection/var
|
|
9
|
+
* references ride as re-bindable `rebind` entries, never live ids.
|
|
10
|
+
*/
|
|
11
|
+
export interface SpecDocument {
|
|
12
|
+
specVersion: string;
|
|
13
|
+
kind: "function" | "endpoint" | "workflow";
|
|
14
|
+
callable: Record<string, unknown>;
|
|
15
|
+
rebind: unknown[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `GET /<collection>/:id/spec`. `collection` is `null` for a kind the Export
|
|
19
|
+
* button never renders on (`specCollectionForKind`'s `workflow`/`connection`
|
|
20
|
+
* arms) — passing `null` disables the query regardless of `enabled`, so a
|
|
21
|
+
* caller need not re-derive that guard itself.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useSpecQuery(collection: SpecCollection | null, id: string, enabled: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<SpecDocument>, Error>;
|