@stigmer/react 0.0.84 → 0.0.86
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/demo/fixtures.d.ts +4 -0
- package/demo/fixtures.d.ts.map +1 -1
- package/demo/fixtures.js +4 -0
- package/demo/fixtures.js.map +1 -1
- package/demo/samples.d.ts +1 -0
- package/demo/samples.d.ts.map +1 -1
- package/demo/samples.js +1 -0
- package/demo/samples.js.map +1 -1
- package/execution/ArtifactPreviewModal.d.ts +78 -18
- package/execution/ArtifactPreviewModal.d.ts.map +1 -1
- package/execution/ArtifactPreviewModal.js +82 -60
- package/execution/ArtifactPreviewModal.js.map +1 -1
- package/execution/index.d.ts +2 -2
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +1 -1
- package/execution/index.js.map +1 -1
- package/index.d.ts +6 -4
- package/index.d.ts.map +1 -1
- package/index.js +4 -2
- package/index.js.map +1 -1
- package/library/ResourceListView.js +1 -1
- package/library/ResourceListView.js.map +1 -1
- package/mcp-server/McpServerConnectDialog.d.ts +51 -0
- package/mcp-server/McpServerConnectDialog.d.ts.map +1 -0
- package/mcp-server/McpServerConnectDialog.js +164 -0
- package/mcp-server/McpServerConnectDialog.js.map +1 -0
- package/mcp-server/McpServerDetailView.js +2 -2
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/McpServerPicker.d.ts.map +1 -1
- package/mcp-server/McpServerPicker.js +7 -1
- package/mcp-server/McpServerPicker.js.map +1 -1
- package/mcp-server/index.d.ts +2 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +1 -0
- package/mcp-server/index.js.map +1 -1
- package/oauth-app/CreateOAuthAppForm.d.ts +41 -0
- package/oauth-app/CreateOAuthAppForm.d.ts.map +1 -0
- package/oauth-app/CreateOAuthAppForm.js +140 -0
- package/oauth-app/CreateOAuthAppForm.js.map +1 -0
- package/oauth-app/OAuthAppDetailPanel.d.ts +43 -0
- package/oauth-app/OAuthAppDetailPanel.d.ts.map +1 -0
- package/oauth-app/OAuthAppDetailPanel.js +202 -0
- package/oauth-app/OAuthAppDetailPanel.js.map +1 -0
- package/oauth-app/OAuthAppListPanel.d.ts +43 -0
- package/oauth-app/OAuthAppListPanel.d.ts.map +1 -0
- package/oauth-app/OAuthAppListPanel.js +79 -0
- package/oauth-app/OAuthAppListPanel.js.map +1 -0
- package/oauth-app/index.d.ts +15 -0
- package/oauth-app/index.d.ts.map +1 -0
- package/oauth-app/index.js +8 -0
- package/oauth-app/index.js.map +1 -0
- package/oauth-app/useCreateOAuthApp.d.ts +39 -0
- package/oauth-app/useCreateOAuthApp.d.ts.map +1 -0
- package/oauth-app/useCreateOAuthApp.js +50 -0
- package/oauth-app/useCreateOAuthApp.js.map +1 -0
- package/oauth-app/useDeleteOAuthApp.d.ts +31 -0
- package/oauth-app/useDeleteOAuthApp.d.ts.map +1 -0
- package/oauth-app/useDeleteOAuthApp.js +43 -0
- package/oauth-app/useDeleteOAuthApp.js.map +1 -0
- package/oauth-app/useOAuthAppList.d.ts +32 -0
- package/oauth-app/useOAuthAppList.d.ts.map +1 -0
- package/oauth-app/useOAuthAppList.js +61 -0
- package/oauth-app/useOAuthAppList.js.map +1 -0
- package/oauth-app/useUpdateOAuthApp.d.ts +38 -0
- package/oauth-app/useUpdateOAuthApp.d.ts.map +1 -0
- package/oauth-app/useUpdateOAuthApp.js +49 -0
- package/oauth-app/useUpdateOAuthApp.js.map +1 -0
- package/package.json +4 -4
- package/src/demo/fixtures.ts +8 -0
- package/src/demo/samples.ts +2 -0
- package/src/execution/ArtifactPreviewModal.tsx +206 -128
- package/src/execution/index.ts +2 -2
- package/src/index.ts +24 -0
- package/src/library/ResourceListView.tsx +8 -8
- package/src/mcp-server/McpServerConnectDialog.tsx +527 -0
- package/src/mcp-server/McpServerDetailView.tsx +2 -1
- package/src/mcp-server/McpServerPicker.tsx +8 -1
- package/src/mcp-server/index.ts +3 -0
- package/src/oauth-app/CreateOAuthAppForm.tsx +449 -0
- package/src/oauth-app/OAuthAppDetailPanel.tsx +671 -0
- package/src/oauth-app/OAuthAppListPanel.tsx +237 -0
- package/src/oauth-app/index.ts +14 -0
- package/src/oauth-app/useCreateOAuthApp.ts +70 -0
- package/src/oauth-app/useDeleteOAuthApp.ts +62 -0
- package/src/oauth-app/useOAuthAppList.ts +84 -0
- package/src/oauth-app/useUpdateOAuthApp.ts +69 -0
- package/styles.css +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
import { VendorApprovalStatus } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/spec_pb";
|
|
7
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
8
|
+
import { useUpdateOAuthApp } from "./useUpdateOAuthApp";
|
|
9
|
+
import { useDeleteOAuthApp } from "./useDeleteOAuthApp";
|
|
10
|
+
/**
|
|
11
|
+
* View and edit panel for an existing OAuth app.
|
|
12
|
+
*
|
|
13
|
+
* In **view mode**, displays all OAuth configuration fields in a
|
|
14
|
+
* structured label/value layout with "Edit" and "Delete" buttons.
|
|
15
|
+
*
|
|
16
|
+
* In **edit mode**, fields become editable inputs. The client secret
|
|
17
|
+
* field shows a placeholder — leave it empty to keep the existing
|
|
18
|
+
* secret, or enter a new value to replace it. "Save" submits the
|
|
19
|
+
* update via {@link useUpdateOAuthApp}; "Cancel" discards changes
|
|
20
|
+
* and returns to view mode.
|
|
21
|
+
*
|
|
22
|
+
* Delete uses an inline confirmation pattern (no modal) to avoid
|
|
23
|
+
* portal/z-index issues for SDK embedders.
|
|
24
|
+
*
|
|
25
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <OAuthAppDetailPanel
|
|
30
|
+
* oauthApp={app}
|
|
31
|
+
* onUpdated={(updated) => refetch()}
|
|
32
|
+
* onDeleted={() => { refetch(); setFlow({ phase: "idle" }); }}
|
|
33
|
+
* onBack={() => setFlow({ phase: "idle" })}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export function OAuthAppDetailPanel({ oauthApp, onUpdated, onDeleted, onBack, className, }) {
|
|
38
|
+
const spec = oauthApp.spec;
|
|
39
|
+
const meta = oauthApp.metadata;
|
|
40
|
+
const { update, isUpdating, error: updateError, clearError: clearUpdateError } = useUpdateOAuthApp();
|
|
41
|
+
const { deleteApp, isDeleting, error: deleteError, clearError: clearDeleteError } = useDeleteOAuthApp();
|
|
42
|
+
const [mode, setMode] = useState("view");
|
|
43
|
+
const [confirmingDelete, setConfirmingDelete] = useState(false);
|
|
44
|
+
// Edit form state — initialized from current resource
|
|
45
|
+
const [provider, setProvider] = useState(spec?.provider ?? "");
|
|
46
|
+
const [clientId, setClientId] = useState(spec?.clientId ?? "");
|
|
47
|
+
const [clientSecret, setClientSecret] = useState("");
|
|
48
|
+
const [authorizationUrl, setAuthorizationUrl] = useState(spec?.authorizationUrl ?? "");
|
|
49
|
+
const [tokenUrl, setTokenUrl] = useState(spec?.tokenUrl ?? "");
|
|
50
|
+
const [scopes, setScopes] = useState(spec?.scopes.join(", ") ?? "");
|
|
51
|
+
const [userinfoUrl, setUserinfoUrl] = useState(spec?.userinfoUrl ?? "");
|
|
52
|
+
const [scopeParameterName, setScopeParameterName] = useState(spec?.scopeParameterName ?? "");
|
|
53
|
+
const [vendorApprovalStatus, setVendorApprovalStatus] = useState(approvalStatusToKey(spec?.vendorApprovalStatus));
|
|
54
|
+
const [vendorApprovalDocsUrl, setVendorApprovalDocsUrl] = useState(spec?.vendorApprovalDocsUrl ?? "");
|
|
55
|
+
const enterEdit = useCallback(() => {
|
|
56
|
+
setProvider(spec?.provider ?? "");
|
|
57
|
+
setClientId(spec?.clientId ?? "");
|
|
58
|
+
setClientSecret("");
|
|
59
|
+
setAuthorizationUrl(spec?.authorizationUrl ?? "");
|
|
60
|
+
setTokenUrl(spec?.tokenUrl ?? "");
|
|
61
|
+
setScopes(spec?.scopes.join(", ") ?? "");
|
|
62
|
+
setUserinfoUrl(spec?.userinfoUrl ?? "");
|
|
63
|
+
setScopeParameterName(spec?.scopeParameterName ?? "");
|
|
64
|
+
setVendorApprovalStatus(approvalStatusToKey(spec?.vendorApprovalStatus));
|
|
65
|
+
setVendorApprovalDocsUrl(spec?.vendorApprovalDocsUrl ?? "");
|
|
66
|
+
clearUpdateError();
|
|
67
|
+
setMode("edit");
|
|
68
|
+
}, [spec, clearUpdateError]);
|
|
69
|
+
const cancelEdit = useCallback(() => {
|
|
70
|
+
clearUpdateError();
|
|
71
|
+
setMode("view");
|
|
72
|
+
}, [clearUpdateError]);
|
|
73
|
+
const handleSave = useCallback(async (e) => {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
clearUpdateError();
|
|
76
|
+
const parsedScopes = scopes
|
|
77
|
+
.split(",")
|
|
78
|
+
.map((s) => s.trim())
|
|
79
|
+
.filter(Boolean);
|
|
80
|
+
try {
|
|
81
|
+
const updated = await update({
|
|
82
|
+
name: meta?.name ?? "",
|
|
83
|
+
slug: meta?.slug,
|
|
84
|
+
org: meta?.org ?? "",
|
|
85
|
+
provider: provider.trim(),
|
|
86
|
+
clientId: clientId.trim(),
|
|
87
|
+
...(clientSecret.trim() && { clientSecret: clientSecret.trim() }),
|
|
88
|
+
authorizationUrl: authorizationUrl.trim(),
|
|
89
|
+
tokenUrl: tokenUrl.trim(),
|
|
90
|
+
...(parsedScopes.length > 0 && { scopes: parsedScopes }),
|
|
91
|
+
...(userinfoUrl.trim() && { userinfoUrl: userinfoUrl.trim() }),
|
|
92
|
+
...(scopeParameterName.trim() && {
|
|
93
|
+
scopeParameterName: scopeParameterName.trim(),
|
|
94
|
+
}),
|
|
95
|
+
...(vendorApprovalStatus !== "unspecified" && {
|
|
96
|
+
vendorApprovalStatus: APPROVAL_STATUS_MAP[vendorApprovalStatus],
|
|
97
|
+
}),
|
|
98
|
+
...(vendorApprovalDocsUrl.trim() && {
|
|
99
|
+
vendorApprovalDocsUrl: vendorApprovalDocsUrl.trim(),
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
setMode("view");
|
|
103
|
+
onUpdated?.(updated);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// error state is managed by useUpdateOAuthApp
|
|
107
|
+
}
|
|
108
|
+
}, [
|
|
109
|
+
meta, provider, clientId, clientSecret, authorizationUrl, tokenUrl,
|
|
110
|
+
scopes, userinfoUrl, scopeParameterName, vendorApprovalStatus,
|
|
111
|
+
vendorApprovalDocsUrl, update, clearUpdateError, onUpdated,
|
|
112
|
+
]);
|
|
113
|
+
const handleDelete = useCallback(async () => {
|
|
114
|
+
const id = meta?.id;
|
|
115
|
+
if (!id)
|
|
116
|
+
return;
|
|
117
|
+
clearDeleteError();
|
|
118
|
+
try {
|
|
119
|
+
await deleteApp(id);
|
|
120
|
+
onDeleted?.();
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// error state is managed by useDeleteOAuthApp
|
|
124
|
+
}
|
|
125
|
+
}, [meta, deleteApp, clearDeleteError, onDeleted]);
|
|
126
|
+
const canSave = provider.trim() !== "" &&
|
|
127
|
+
clientId.trim() !== "" &&
|
|
128
|
+
authorizationUrl.trim() !== "" &&
|
|
129
|
+
tokenUrl.trim() !== "" &&
|
|
130
|
+
!isUpdating;
|
|
131
|
+
const createdAt = oauthApp.status?.audit?.specAudit?.createdAt;
|
|
132
|
+
const updatedAt = oauthApp.status?.audit?.specAudit?.updatedAt;
|
|
133
|
+
return (_jsxs("div", { className: cn("space-y-4", className), children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [onBack && (_jsxs("button", { type: "button", onClick: onBack, className: "text-muted-foreground hover:text-foreground mb-1 flex items-center gap-1 text-xs transition-colors", children: [_jsx(ArrowLeftIcon, {}), "Back to list"] })), _jsx("h3", { className: "text-foreground truncate text-sm font-semibold", children: spec?.provider || meta?.name || "OAuth App" }), meta?.slug && (_jsx("span", { className: "text-muted-foreground font-mono text-xs", children: meta.slug }))] }), mode === "view" && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: enterEdit, className: cn("shrink-0 rounded-md px-2.5 py-1.5 text-xs font-medium", "text-muted-foreground hover:text-foreground hover:bg-accent/50", "transition-colors"), children: "Edit" }), _jsx("button", { type: "button", onClick: () => {
|
|
134
|
+
clearDeleteError();
|
|
135
|
+
setConfirmingDelete(true);
|
|
136
|
+
}, className: cn("shrink-0 rounded-md px-2.5 py-1.5 text-xs font-medium", "text-destructive/70 hover:text-destructive hover:bg-destructive/10", "transition-colors"), children: "Delete" })] }))] }), confirmingDelete && (_jsxs("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-3", role: "alert", children: [_jsx("p", { className: "text-foreground mb-2 text-xs font-medium", children: "Delete this OAuth app?" }), _jsx("p", { className: "text-muted-foreground mb-3 text-[0.65rem]", children: "This action is permanent. Any MCP server overrides referencing this app will lose their binding." }), deleteError && (_jsx("p", { className: "text-destructive mb-2 text-[0.65rem]", role: "alert", children: getUserMessage(deleteError) })), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("button", { type: "button", onClick: handleDelete, disabled: isDeleting, className: cn("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium", "bg-destructive text-destructive-foreground hover:bg-destructive/90", "disabled:pointer-events-none disabled:opacity-40"), children: [isDeleting && _jsx(SpinnerIcon, {}), "Delete permanently"] }), _jsx("button", { type: "button", onClick: () => {
|
|
137
|
+
setConfirmingDelete(false);
|
|
138
|
+
clearDeleteError();
|
|
139
|
+
}, disabled: isDeleting, className: cn("rounded-md px-2.5 py-1.5 text-xs", "text-muted-foreground hover:text-foreground hover:bg-accent/50", "disabled:pointer-events-none disabled:opacity-50"), children: "Cancel" })] })] })), mode === "view" ? (_jsx(ViewMode, { spec: spec, createdAt: createdAt, updatedAt: updatedAt })) : (_jsxs("form", { onSubmit: handleSave, className: "space-y-3", children: [_jsx(FieldInput, { id: "stgm-oauth-edit-provider", label: "Provider", value: provider, onChange: setProvider, placeholder: "e.g. Slack", disabled: isUpdating, required: true }), _jsx(FieldInput, { id: "stgm-oauth-edit-client-id", label: "Client ID", value: clientId, onChange: setClientId, placeholder: "OAuth client identifier", disabled: isUpdating, required: true }), _jsx(FieldInput, { id: "stgm-oauth-edit-client-secret", label: "Client secret", value: clientSecret, onChange: setClientSecret, placeholder: "Leave empty to keep existing secret", type: "password", hint: "Only enter a value to replace the existing secret", disabled: isUpdating }), _jsx(FieldInput, { id: "stgm-oauth-edit-auth-url", label: "Authorization URL", value: authorizationUrl, onChange: setAuthorizationUrl, placeholder: "https://vendor.com/oauth/authorize", disabled: isUpdating, required: true }), _jsx(FieldInput, { id: "stgm-oauth-edit-token-url", label: "Token URL", value: tokenUrl, onChange: setTokenUrl, placeholder: "https://vendor.com/oauth/token", disabled: isUpdating, required: true }), _jsx(FieldInput, { id: "stgm-oauth-edit-scopes", label: "Scopes", value: scopes, onChange: setScopes, placeholder: "read, write, admin", hint: "Comma-separated OAuth scopes", disabled: isUpdating }), _jsx(FieldInput, { id: "stgm-oauth-edit-userinfo-url", label: "Userinfo URL", value: userinfoUrl, onChange: setUserinfoUrl, placeholder: "https://vendor.com/userinfo", hint: "OIDC endpoint for fetching user profile data (optional)", disabled: isUpdating }), _jsx(FieldInput, { id: "stgm-oauth-edit-scope-param", label: "Scope parameter name", value: scopeParameterName, onChange: setScopeParameterName, placeholder: "scope", hint: 'Defaults to "scope". Some vendors use a non-standard name.', disabled: isUpdating }), _jsxs("div", { className: "space-y-1", children: [_jsx("label", { htmlFor: "stgm-oauth-edit-approval-status", className: "text-xs font-medium text-foreground", children: "Vendor approval status" }), _jsxs("select", { id: "stgm-oauth-edit-approval-status", value: vendorApprovalStatus, onChange: (e) => setVendorApprovalStatus(e.target.value), disabled: isUpdating, className: cn("w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-xs text-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: [_jsx("option", { value: "unspecified", children: "Unspecified (treated as approved)" }), _jsx("option", { value: "pending", children: "Pending" }), _jsx("option", { value: "approved", children: "Approved" }), _jsx("option", { value: "rejected", children: "Rejected" })] })] }), _jsx(FieldInput, { id: "stgm-oauth-edit-approval-docs", label: "Vendor approval docs URL", value: vendorApprovalDocsUrl, onChange: setVendorApprovalDocsUrl, placeholder: "https://docs.example.com/byoa", hint: "Help link shown when vendor approval is pending", disabled: isUpdating }), updateError && (_jsx("p", { className: "text-destructive text-[0.65rem]", role: "alert", children: getUserMessage(updateError) })), _jsxs("div", { className: "flex items-center gap-2 pt-1", children: [_jsxs("button", { type: "submit", disabled: !canSave, className: cn("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium", "bg-primary text-primary-foreground hover:bg-primary/90", "disabled:pointer-events-none disabled:opacity-40"), children: [isUpdating && _jsx(SpinnerIcon, {}), "Save changes"] }), _jsx("button", { type: "button", onClick: cancelEdit, disabled: isUpdating, className: cn("rounded-md px-2.5 py-1.5 text-xs", "text-muted-foreground hover:text-foreground hover:bg-accent/50", "disabled:pointer-events-none disabled:opacity-50"), children: "Cancel" })] })] }))] }));
|
|
140
|
+
}
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
// Constants
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
const APPROVAL_STATUS_MAP = {
|
|
145
|
+
pending: VendorApprovalStatus.PENDING,
|
|
146
|
+
approved: VendorApprovalStatus.APPROVED,
|
|
147
|
+
rejected: VendorApprovalStatus.REJECTED,
|
|
148
|
+
};
|
|
149
|
+
const APPROVAL_STATUS_LABELS = {
|
|
150
|
+
[VendorApprovalStatus.UNSPECIFIED]: "Unspecified",
|
|
151
|
+
[VendorApprovalStatus.PENDING]: "Pending",
|
|
152
|
+
[VendorApprovalStatus.APPROVED]: "Approved",
|
|
153
|
+
[VendorApprovalStatus.REJECTED]: "Rejected",
|
|
154
|
+
};
|
|
155
|
+
function approvalStatusToKey(status) {
|
|
156
|
+
switch (status) {
|
|
157
|
+
case VendorApprovalStatus.PENDING:
|
|
158
|
+
return "pending";
|
|
159
|
+
case VendorApprovalStatus.APPROVED:
|
|
160
|
+
return "approved";
|
|
161
|
+
case VendorApprovalStatus.REJECTED:
|
|
162
|
+
return "rejected";
|
|
163
|
+
default:
|
|
164
|
+
return "unspecified";
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
// View mode
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
function ViewMode({ spec, createdAt, updatedAt, }) {
|
|
171
|
+
return (_jsxs("dl", { className: "space-y-2.5", children: [_jsx(Field, { label: "Provider", value: spec?.provider }), _jsx(Field, { label: "Client ID", value: spec?.clientId, mono: true }), _jsx(Field, { label: "Client secret", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" }), _jsx(Field, { label: "Authorization URL", value: spec?.authorizationUrl, mono: true }), _jsx(Field, { label: "Token URL", value: spec?.tokenUrl, mono: true }), spec?.scopes && spec.scopes.length > 0 && (_jsx(Field, { label: "Scopes", value: spec.scopes.join(", "), mono: true })), spec?.userinfoUrl && (_jsx(Field, { label: "Userinfo URL", value: spec.userinfoUrl, mono: true })), spec?.scopeParameterName && (_jsx(Field, { label: "Scope parameter name", value: spec.scopeParameterName, mono: true })), spec?.vendorApprovalStatus !== undefined &&
|
|
172
|
+
spec.vendorApprovalStatus !== VendorApprovalStatus.UNSPECIFIED && (_jsx(Field, { label: "Vendor approval", value: APPROVAL_STATUS_LABELS[spec.vendorApprovalStatus] ??
|
|
173
|
+
"Unknown" })), spec?.vendorApprovalDocsUrl && (_jsx(Field, { label: "Approval docs", value: spec.vendorApprovalDocsUrl, mono: true })), _jsxs("div", { className: "flex gap-6", children: [createdAt && (_jsx(Field, { label: "Created", value: formatDate(timestampDate(createdAt)) })), updatedAt && (_jsx(Field, { label: "Updated", value: formatDate(timestampDate(updatedAt)) }))] })] }));
|
|
174
|
+
}
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
// Shared primitives
|
|
177
|
+
// ---------------------------------------------------------------------------
|
|
178
|
+
function Field({ label, value, mono, }) {
|
|
179
|
+
if (!value)
|
|
180
|
+
return null;
|
|
181
|
+
return (_jsxs("div", { children: [_jsx("dt", { className: "text-muted-foreground text-[0.65rem] font-medium", children: label }), _jsx("dd", { className: cn("text-foreground mt-0.5 break-all text-xs", mono && "font-mono"), children: value })] }));
|
|
182
|
+
}
|
|
183
|
+
function FieldInput({ id, label, value, onChange, placeholder, hint, type = "text", disabled, required, }) {
|
|
184
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx("label", { htmlFor: id, className: "text-xs font-medium text-foreground", children: label }), _jsx("input", { id: id, type: type, value: value, onChange: (e) => onChange(e.target.value), placeholder: placeholder, disabled: disabled, required: required, className: cn("w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-xs text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50") }), hint && (_jsx("p", { className: "text-[0.65rem] text-muted-foreground", children: hint }))] }));
|
|
185
|
+
}
|
|
186
|
+
function formatDate(date) {
|
|
187
|
+
return date.toLocaleDateString(undefined, {
|
|
188
|
+
month: "short",
|
|
189
|
+
day: "numeric",
|
|
190
|
+
year: "numeric",
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
// Icons
|
|
195
|
+
// ---------------------------------------------------------------------------
|
|
196
|
+
function ArrowLeftIcon() {
|
|
197
|
+
return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M10 3L5 8l5 5" }) }));
|
|
198
|
+
}
|
|
199
|
+
function SpinnerIcon() {
|
|
200
|
+
return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=OAuthAppDetailPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthAppDetailPanel.js","sourceRoot":"","sources":["../../src/oauth-app/OAuthAppDetailPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAkB,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAoBxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,SAAS,GACgB;IACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAE/B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAA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AAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,eAAe,GAAG,GACtB,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW;IAClB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,SAAS,EAAC,cAAc,iBACZ,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { OAuthApp } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
2
|
+
/** Props for {@link OAuthAppListPanel}. */
|
|
3
|
+
export interface OAuthAppListPanelProps {
|
|
4
|
+
/** Organization slug to list OAuth apps for. */
|
|
5
|
+
readonly org: string;
|
|
6
|
+
/**
|
|
7
|
+
* Fired when the user wants to view/edit an OAuth app.
|
|
8
|
+
* When provided, rows become interactive with a pencil icon button.
|
|
9
|
+
* When absent, rows remain static (backward compatible).
|
|
10
|
+
*/
|
|
11
|
+
readonly onEdit?: (app: OAuthApp) => void;
|
|
12
|
+
/** Re-expose refetch so parents can trigger a list refresh. */
|
|
13
|
+
readonly onRefetchRef?: (refetch: () => void) => void;
|
|
14
|
+
/** Additional CSS class names for the root container. */
|
|
15
|
+
readonly className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Displays a list of {@link OAuthApp} resources owned by an
|
|
19
|
+
* organization.
|
|
20
|
+
*
|
|
21
|
+
* Each row shows the provider name, client ID (non-secret), and
|
|
22
|
+
* creation date. When `onEdit` is provided, rows include a pencil
|
|
23
|
+
* icon that fires the callback with the selected app — enabling
|
|
24
|
+
* navigation to a detail/edit view.
|
|
25
|
+
*
|
|
26
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <OAuthAppListPanel org="acme" />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <OAuthAppListPanel
|
|
36
|
+
* org="acme"
|
|
37
|
+
* onEdit={(app) => setFlow({ phase: "editing", oauthApp: app })}
|
|
38
|
+
* onRefetchRef={(refetch) => { listRefetchRef.current = refetch; }}
|
|
39
|
+
* />
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function OAuthAppListPanel({ org, onEdit, onRefetchRef, className, }: OAuthAppListPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=OAuthAppListPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthAppListPanel.d.ts","sourceRoot":"","sources":["../../src/oauth-app/OAuthAppListPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAOlF,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,+DAA+D;IAC/D,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACtD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,MAAM,EACN,YAAY,EACZ,SAAS,GACV,EAAE,sBAAsB,2CA4DxB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
5
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { useOAuthAppList } from "./useOAuthAppList";
|
|
7
|
+
/**
|
|
8
|
+
* Displays a list of {@link OAuthApp} resources owned by an
|
|
9
|
+
* organization.
|
|
10
|
+
*
|
|
11
|
+
* Each row shows the provider name, client ID (non-secret), and
|
|
12
|
+
* creation date. When `onEdit` is provided, rows include a pencil
|
|
13
|
+
* icon that fires the callback with the selected app — enabling
|
|
14
|
+
* navigation to a detail/edit view.
|
|
15
|
+
*
|
|
16
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <OAuthAppListPanel org="acme" />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <OAuthAppListPanel
|
|
26
|
+
* org="acme"
|
|
27
|
+
* onEdit={(app) => setFlow({ phase: "editing", oauthApp: app })}
|
|
28
|
+
* onRefetchRef={(refetch) => { listRefetchRef.current = refetch; }}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function OAuthAppListPanel({ org, onEdit, onRefetchRef, className, }) {
|
|
33
|
+
const { oauthApps, isLoading, error, refetch } = useOAuthAppList(org);
|
|
34
|
+
if (onRefetchRef) {
|
|
35
|
+
onRefetchRef(refetch);
|
|
36
|
+
}
|
|
37
|
+
if (isLoading) {
|
|
38
|
+
return (_jsx("div", { className: cn("space-y-2", className), "aria-busy": "true", "aria-label": "Loading OAuth apps", children: Array.from({ length: 2 }, (_, i) => (_jsx("div", { className: "bg-muted/40 h-14 animate-pulse rounded-lg" }, i))) }));
|
|
39
|
+
}
|
|
40
|
+
if (error) {
|
|
41
|
+
return (_jsx("p", { className: cn("text-destructive text-xs", className), role: "alert", children: getUserMessage(error) }));
|
|
42
|
+
}
|
|
43
|
+
if (oauthApps.length === 0) {
|
|
44
|
+
return (_jsx("p", { className: cn("text-muted-foreground py-4 text-center text-xs", className), children: "No OAuth apps configured yet." }));
|
|
45
|
+
}
|
|
46
|
+
return (_jsx("div", { className: cn("space-y-2", className), role: "list", "aria-label": "OAuth apps", children: oauthApps.map((app) => (_jsx(OAuthAppRow, { oauthApp: app, onEdit: onEdit ? () => onEdit(app) : undefined }, app.metadata?.id ?? ""))) }));
|
|
47
|
+
}
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// OAuthAppRow (internal)
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
function OAuthAppRow({ oauthApp, onEdit, }) {
|
|
52
|
+
const provider = oauthApp.spec?.provider || "OAuth App";
|
|
53
|
+
const clientId = oauthApp.spec?.clientId;
|
|
54
|
+
const createdAt = oauthApp.status?.audit?.specAudit?.createdAt;
|
|
55
|
+
return (_jsxs("div", { role: "listitem", className: "flex items-center gap-3 rounded-lg border border-border/60 px-3 py-2.5 transition-colors hover:border-border", children: [_jsx(OAuthIcon, {}), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-sm font-medium text-foreground", children: provider }), clientId && (_jsx("span", { className: "block truncate text-xs font-mono text-muted-foreground", children: clientId }))] }), _jsx("div", { className: "hidden shrink-0 items-center gap-4 text-xs text-muted-foreground sm:flex", children: createdAt && (_jsx("span", { title: `Created ${timestampDate(createdAt).toISOString()}`, children: formatShortDate(timestampDate(createdAt)) })) }), onEdit && (_jsx("button", { type: "button", onClick: onEdit, "aria-label": `Edit ${provider}`, className: cn("shrink-0 rounded p-1", "text-muted-foreground hover:text-foreground hover:bg-accent/50", "transition-colors"), children: _jsx(PencilIcon, {}) }))] }));
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Icons (edit action)
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
function PencilIcon() {
|
|
61
|
+
return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M11 2.5l2.5 2.5L5 13.5H2.5V11L11 2.5z" }) }));
|
|
62
|
+
}
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// Formatting helpers
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
function formatShortDate(date) {
|
|
67
|
+
return date.toLocaleDateString(undefined, {
|
|
68
|
+
month: "short",
|
|
69
|
+
day: "numeric",
|
|
70
|
+
year: "numeric",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Icons
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function OAuthIcon() {
|
|
77
|
+
return (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", className: "shrink-0 text-muted-foreground", children: [_jsx("rect", { x: "2", y: "3", width: "12", height: "10", rx: "2" }), _jsx("path", { d: "M8 7v2" }), _jsx("circle", { cx: "8", cy: "9.5", r: "0.5", fill: "currentColor", stroke: "none" })] }));
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=OAuthAppListPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthAppListPanel.js","sourceRoot":"","sources":["../../src/oauth-app/OAuthAppListPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,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MAAM,GAAG,IAChE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { useOAuthAppList } from "./useOAuthAppList";
|
|
2
|
+
export type { UseOAuthAppListReturn } from "./useOAuthAppList";
|
|
3
|
+
export { useCreateOAuthApp } from "./useCreateOAuthApp";
|
|
4
|
+
export type { UseCreateOAuthAppReturn } from "./useCreateOAuthApp";
|
|
5
|
+
export { useUpdateOAuthApp } from "./useUpdateOAuthApp";
|
|
6
|
+
export type { UseUpdateOAuthAppReturn } from "./useUpdateOAuthApp";
|
|
7
|
+
export { useDeleteOAuthApp } from "./useDeleteOAuthApp";
|
|
8
|
+
export type { UseDeleteOAuthAppReturn } from "./useDeleteOAuthApp";
|
|
9
|
+
export { OAuthAppListPanel } from "./OAuthAppListPanel";
|
|
10
|
+
export type { OAuthAppListPanelProps } from "./OAuthAppListPanel";
|
|
11
|
+
export { CreateOAuthAppForm } from "./CreateOAuthAppForm";
|
|
12
|
+
export type { CreateOAuthAppFormProps } from "./CreateOAuthAppForm";
|
|
13
|
+
export { OAuthAppDetailPanel } from "./OAuthAppDetailPanel";
|
|
14
|
+
export type { OAuthAppDetailPanelProps } from "./OAuthAppDetailPanel";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oauth-app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { useOAuthAppList } from "./useOAuthAppList";
|
|
2
|
+
export { useCreateOAuthApp } from "./useCreateOAuthApp";
|
|
3
|
+
export { useUpdateOAuthApp } from "./useUpdateOAuthApp";
|
|
4
|
+
export { useDeleteOAuthApp } from "./useDeleteOAuthApp";
|
|
5
|
+
export { OAuthAppListPanel } from "./OAuthAppListPanel";
|
|
6
|
+
export { CreateOAuthAppForm } from "./CreateOAuthAppForm";
|
|
7
|
+
export { OAuthAppDetailPanel } from "./OAuthAppDetailPanel";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oauth-app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { OAuthAppInput } from "@stigmer/sdk";
|
|
2
|
+
import type { OAuthApp } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
3
|
+
/** Return value of {@link useCreateOAuthApp}. */
|
|
4
|
+
export interface UseCreateOAuthAppReturn {
|
|
5
|
+
/** Submit an {@link OAuthAppInput} to create a new OAuth app. Resolves with the server-created resource. */
|
|
6
|
+
readonly create: (input: OAuthAppInput) => Promise<OAuthApp>;
|
|
7
|
+
/** `true` while the create request is in flight. */
|
|
8
|
+
readonly isCreating: boolean;
|
|
9
|
+
/** Error from the last failed create, or `null` when healthy. */
|
|
10
|
+
readonly error: Error | null;
|
|
11
|
+
/** Reset `error` to `null`. */
|
|
12
|
+
readonly clearError: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Mutation hook that wraps `oauthapp.create()` with loading and error
|
|
16
|
+
* state.
|
|
17
|
+
*
|
|
18
|
+
* Creates an OAuth app resource within an organization. The caller
|
|
19
|
+
* provides an {@link OAuthAppInput} with the required metadata (name,
|
|
20
|
+
* org) and spec fields (provider, client ID, client secret, OAuth
|
|
21
|
+
* endpoint URLs).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { create, isCreating, error } = useCreateOAuthApp();
|
|
26
|
+
*
|
|
27
|
+
* const app = await create({
|
|
28
|
+
* name: "My Slack App",
|
|
29
|
+
* org: "acme",
|
|
30
|
+
* provider: "Slack",
|
|
31
|
+
* clientId: "123456.789012",
|
|
32
|
+
* clientSecret: "secret",
|
|
33
|
+
* authorizationUrl: "https://slack.com/oauth/v2/authorize",
|
|
34
|
+
* tokenUrl: "https://slack.com/api/oauth.v2.access",
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function useCreateOAuthApp(): UseCreateOAuthAppReturn;
|
|
39
|
+
//# sourceMappingURL=useCreateOAuthApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateOAuthApp.d.ts","sourceRoot":"","sources":["../../src/oauth-app/useCreateOAuthApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAIlF,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,4GAA4G;IAC5G,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CAyB3D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Mutation hook that wraps `oauthapp.create()` with loading and error
|
|
7
|
+
* state.
|
|
8
|
+
*
|
|
9
|
+
* Creates an OAuth app resource within an organization. The caller
|
|
10
|
+
* provides an {@link OAuthAppInput} with the required metadata (name,
|
|
11
|
+
* org) and spec fields (provider, client ID, client secret, OAuth
|
|
12
|
+
* endpoint URLs).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { create, isCreating, error } = useCreateOAuthApp();
|
|
17
|
+
*
|
|
18
|
+
* const app = await create({
|
|
19
|
+
* name: "My Slack App",
|
|
20
|
+
* org: "acme",
|
|
21
|
+
* provider: "Slack",
|
|
22
|
+
* clientId: "123456.789012",
|
|
23
|
+
* clientSecret: "secret",
|
|
24
|
+
* authorizationUrl: "https://slack.com/oauth/v2/authorize",
|
|
25
|
+
* tokenUrl: "https://slack.com/api/oauth.v2.access",
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function useCreateOAuthApp() {
|
|
30
|
+
const stigmer = useStigmer();
|
|
31
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
32
|
+
const [error, setError] = useState(null);
|
|
33
|
+
const clearError = useCallback(() => setError(null), []);
|
|
34
|
+
const create = useCallback(async (input) => {
|
|
35
|
+
setIsCreating(true);
|
|
36
|
+
setError(null);
|
|
37
|
+
try {
|
|
38
|
+
return await stigmer.oauthapp.create(input);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
setError(toError(err));
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
setIsCreating(false);
|
|
46
|
+
}
|
|
47
|
+
}, [stigmer]);
|
|
48
|
+
return { create, isCreating, error, clearError };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=useCreateOAuthApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateOAuthApp.js","sourceRoot":"","sources":["../../src/oauth-app/useCreateOAuthApp.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAAoB,EAAqB,EAAE;QAChD,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { OAuthApp } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
2
|
+
/** Return value of {@link useDeleteOAuthApp}. */
|
|
3
|
+
export interface UseDeleteOAuthAppReturn {
|
|
4
|
+
/** Delete an OAuth app by its resource ID. Resolves with the deleted resource for confirmation display. */
|
|
5
|
+
readonly deleteApp: (id: string) => Promise<OAuthApp>;
|
|
6
|
+
/** `true` while the delete request is in flight. */
|
|
7
|
+
readonly isDeleting: boolean;
|
|
8
|
+
/** Error from the last failed delete, or `null` when healthy. */
|
|
9
|
+
readonly error: Error | null;
|
|
10
|
+
/** Reset `error` to `null`. */
|
|
11
|
+
readonly clearError: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Mutation hook that wraps `oauthapp.delete()` with loading and error
|
|
15
|
+
* state.
|
|
16
|
+
*
|
|
17
|
+
* Deletes an OAuth app by its resource ID. Returns the deleted
|
|
18
|
+
* {@link OAuthApp} on success so callers can confirm which app was
|
|
19
|
+
* removed. The deletion is permanent — any MCP server overrides
|
|
20
|
+
* referencing this app will lose their binding.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { deleteApp, isDeleting, error } = useDeleteOAuthApp();
|
|
25
|
+
*
|
|
26
|
+
* await deleteApp("oauth-app-id-abc123");
|
|
27
|
+
* refetch(); // refresh the list after deletion
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useDeleteOAuthApp(): UseDeleteOAuthAppReturn;
|
|
31
|
+
//# sourceMappingURL=useDeleteOAuthApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteOAuthApp.d.ts","sourceRoot":"","sources":["../../src/oauth-app/useDeleteOAuthApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAIlF,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,2GAA2G;IAC3G,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtD,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CAyB3D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks";
|
|
4
|
+
import { toError } from "../internal/toError";
|
|
5
|
+
/**
|
|
6
|
+
* Mutation hook that wraps `oauthapp.delete()` with loading and error
|
|
7
|
+
* state.
|
|
8
|
+
*
|
|
9
|
+
* Deletes an OAuth app by its resource ID. Returns the deleted
|
|
10
|
+
* {@link OAuthApp} on success so callers can confirm which app was
|
|
11
|
+
* removed. The deletion is permanent — any MCP server overrides
|
|
12
|
+
* referencing this app will lose their binding.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { deleteApp, isDeleting, error } = useDeleteOAuthApp();
|
|
17
|
+
*
|
|
18
|
+
* await deleteApp("oauth-app-id-abc123");
|
|
19
|
+
* refetch(); // refresh the list after deletion
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function useDeleteOAuthApp() {
|
|
23
|
+
const stigmer = useStigmer();
|
|
24
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
25
|
+
const [error, setError] = useState(null);
|
|
26
|
+
const clearError = useCallback(() => setError(null), []);
|
|
27
|
+
const deleteApp = useCallback(async (id) => {
|
|
28
|
+
setIsDeleting(true);
|
|
29
|
+
setError(null);
|
|
30
|
+
try {
|
|
31
|
+
return await stigmer.oauthapp.delete({ resourceId: id });
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
setError(toError(err));
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
setIsDeleting(false);
|
|
39
|
+
}
|
|
40
|
+
}, [stigmer]);
|
|
41
|
+
return { deleteApp, isDeleting, error, clearError };
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=useDeleteOAuthApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteOAuthApp.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{ OAuthApp } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
2
|
+
/** Return value of {@link useOAuthAppList}. */
|
|
3
|
+
export interface UseOAuthAppListReturn {
|
|
4
|
+
/** OAuth apps owned by the organization. Empty while loading or on error. */
|
|
5
|
+
readonly oauthApps: readonly OAuthApp[];
|
|
6
|
+
/** `true` while the initial fetch or a refetch is in flight. */
|
|
7
|
+
readonly isLoading: boolean;
|
|
8
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
9
|
+
readonly error: Error | null;
|
|
10
|
+
/** Discard cached data and re-fetch the list from the server. */
|
|
11
|
+
readonly refetch: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Data hook that fetches all {@link OAuthApp} entries for an organization.
|
|
15
|
+
*
|
|
16
|
+
* Returns every OAuthApp whose `metadata.org` matches the input. In
|
|
17
|
+
* practice these are the BYOA OAuth apps created through the "Bring
|
|
18
|
+
* your own app" flow on MCP server detail pages.
|
|
19
|
+
*
|
|
20
|
+
* Pass `null` for `org` to skip fetching (stable no-op). Useful when
|
|
21
|
+
* the active organization has not been resolved yet.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { oauthApps, isLoading, error } = useOAuthAppList(org);
|
|
26
|
+
*
|
|
27
|
+
* if (isLoading) return <Spinner />;
|
|
28
|
+
* oauthApps.map((app) => app.spec?.provider);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function useOAuthAppList(org: string | null): UseOAuthAppListReturn;
|
|
32
|
+
//# sourceMappingURL=useOAuthAppList.d.ts.map
|