@kuadrant/kuadrant-backstage-plugin-frontend 0.0.1-test.1-1593c3ec
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 +491 -0
- package/dist/components/ApiAccessCard/ApiAccessCard.esm.js +42 -0
- package/dist/components/ApiAccessCard/ApiAccessCard.esm.js.map +1 -0
- package/dist/components/ApiAccessCard/index.esm.js +2 -0
- package/dist/components/ApiAccessCard/index.esm.js.map +1 -0
- package/dist/components/ApiKeyManagementTab/ApiKeyManagementTab.esm.js +441 -0
- package/dist/components/ApiKeyManagementTab/ApiKeyManagementTab.esm.js.map +1 -0
- package/dist/components/ApiKeyManagementTab/index.esm.js +2 -0
- package/dist/components/ApiKeyManagementTab/index.esm.js.map +1 -0
- package/dist/components/ApiProductInfoCard/ApiProductInfoCard.esm.js +47 -0
- package/dist/components/ApiProductInfoCard/ApiProductInfoCard.esm.js.map +1 -0
- package/dist/components/ApiProductInfoCard/index.esm.js +2 -0
- package/dist/components/ApiProductInfoCard/index.esm.js.map +1 -0
- package/dist/components/ApprovalQueueCard/ApprovalQueueCard.esm.js +349 -0
- package/dist/components/ApprovalQueueCard/ApprovalQueueCard.esm.js.map +1 -0
- package/dist/components/ApprovalQueueCard/index.esm.js +2 -0
- package/dist/components/ApprovalQueueCard/index.esm.js.map +1 -0
- package/dist/components/CreateAPIProductDialog/CreateAPIProductDialog.esm.js +289 -0
- package/dist/components/CreateAPIProductDialog/CreateAPIProductDialog.esm.js.map +1 -0
- package/dist/components/KuadrantPage/KuadrantPage.esm.js +198 -0
- package/dist/components/KuadrantPage/KuadrantPage.esm.js.map +1 -0
- package/dist/components/KuadrantPage/index.esm.js +2 -0
- package/dist/components/KuadrantPage/index.esm.js.map +1 -0
- package/dist/components/PermissionGate/PermissionGate.esm.js +33 -0
- package/dist/components/PermissionGate/PermissionGate.esm.js.map +1 -0
- package/dist/components/PlanPolicyDetailPage/PlanPolicyDetailPage.esm.js +89 -0
- package/dist/components/PlanPolicyDetailPage/PlanPolicyDetailPage.esm.js.map +1 -0
- package/dist/components/PlanPolicyDetailPage/index.esm.js +2 -0
- package/dist/components/PlanPolicyDetailPage/index.esm.js.map +1 -0
- package/dist/hooks/useUserRole.esm.js +49 -0
- package/dist/hooks/useUserRole.esm.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.esm.js +6 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/plugin.esm.js +68 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +13 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import React, { useState, useMemo } from 'react';
|
|
2
|
+
import { useAsync } from 'react-use';
|
|
3
|
+
import { CodeSnippet, Progress, ResponseErrorPanel, Table } from '@backstage/core-components';
|
|
4
|
+
import { Box, Typography, Tabs, Tab, Grid, Button, Dialog, DialogTitle, DialogContent, FormControl, InputLabel, Select, MenuItem, TextField, DialogActions, Chip, IconButton } from '@material-ui/core';
|
|
5
|
+
import { useApi, configApiRef, identityApiRef, fetchApiRef } from '@backstage/core-plugin-api';
|
|
6
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
7
|
+
import VisibilityIcon from '@material-ui/icons/Visibility';
|
|
8
|
+
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
|
9
|
+
import DeleteIcon from '@material-ui/icons/Delete';
|
|
10
|
+
import HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';
|
|
11
|
+
import CancelIcon from '@material-ui/icons/Cancel';
|
|
12
|
+
import AddIcon from '@material-ui/icons/Add';
|
|
13
|
+
|
|
14
|
+
const ApiKeyManagementTab = ({ namespace: propNamespace }) => {
|
|
15
|
+
const { entity } = useEntity();
|
|
16
|
+
const config = useApi(configApiRef);
|
|
17
|
+
const identityApi = useApi(identityApiRef);
|
|
18
|
+
const fetchApi = useApi(fetchApiRef);
|
|
19
|
+
const backendUrl = config.getString("backend.baseUrl");
|
|
20
|
+
const [visibleKeys, setVisibleKeys] = useState(/* @__PURE__ */ new Set());
|
|
21
|
+
const [refresh, setRefresh] = useState(0);
|
|
22
|
+
const [userId, setUserId] = useState("guest");
|
|
23
|
+
const [userEmail, setUserEmail] = useState("");
|
|
24
|
+
const [open, setOpen] = useState(false);
|
|
25
|
+
const [selectedPlan, setSelectedPlan] = useState("");
|
|
26
|
+
const [useCase, setUseCase] = useState("");
|
|
27
|
+
const [creating, setCreating] = useState(false);
|
|
28
|
+
const [createError, setCreateError] = useState(null);
|
|
29
|
+
const httproute = entity.metadata.annotations?.["kuadrant.io/httproute"] || entity.metadata.name;
|
|
30
|
+
const namespace = entity.metadata.annotations?.["kuadrant.io/namespace"] || propNamespace || "default";
|
|
31
|
+
const apiName = httproute;
|
|
32
|
+
useAsync(async () => {
|
|
33
|
+
const identity = await identityApi.getBackstageIdentity();
|
|
34
|
+
const profile = await identityApi.getProfileInfo();
|
|
35
|
+
setUserId(identity.userEntityRef.split("/")[1] || "guest");
|
|
36
|
+
setUserEmail(profile.email || "");
|
|
37
|
+
}, [identityApi]);
|
|
38
|
+
const { value: requests, loading: requestsLoading, error: requestsError } = useAsync(async () => {
|
|
39
|
+
if (!userId) return [];
|
|
40
|
+
const response = await fetchApi.fetch(
|
|
41
|
+
`${backendUrl}/api/kuadrant/requests/my?userId=${userId}&namespace=${namespace}`
|
|
42
|
+
);
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
throw new Error("failed to fetch requests");
|
|
45
|
+
}
|
|
46
|
+
const data = await response.json();
|
|
47
|
+
return (data.items || []).filter(
|
|
48
|
+
(r) => r.spec.apiName === apiName && r.spec.apiNamespace === namespace
|
|
49
|
+
);
|
|
50
|
+
}, [userId, apiName, namespace, refresh, fetchApi]);
|
|
51
|
+
const { value: apiProduct, loading: plansLoading, error: plansError } = useAsync(async () => {
|
|
52
|
+
const response = await fetchApi.fetch(`${backendUrl}/api/kuadrant/apiproducts`);
|
|
53
|
+
if (!response.ok) {
|
|
54
|
+
throw new Error("failed to fetch api products");
|
|
55
|
+
}
|
|
56
|
+
const data = await response.json();
|
|
57
|
+
const product = data.items?.find(
|
|
58
|
+
(p) => p.metadata.namespace === namespace && (p.metadata.name === apiName || p.metadata.name === `${apiName}-api`)
|
|
59
|
+
);
|
|
60
|
+
return product;
|
|
61
|
+
}, [namespace, apiName, fetchApi]);
|
|
62
|
+
const handleDeleteRequest = async (name) => {
|
|
63
|
+
try {
|
|
64
|
+
const response = await fetchApi.fetch(
|
|
65
|
+
`${backendUrl}/api/kuadrant/requests/${namespace}/${name}`,
|
|
66
|
+
{ method: "DELETE" }
|
|
67
|
+
);
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
throw new Error("failed to delete request");
|
|
70
|
+
}
|
|
71
|
+
setRefresh((r) => r + 1);
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.error("error deleting request:", err);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const toggleVisibility = (keyName) => {
|
|
77
|
+
setVisibleKeys((prev) => {
|
|
78
|
+
const newSet = new Set(prev);
|
|
79
|
+
if (newSet.has(keyName)) {
|
|
80
|
+
newSet.delete(keyName);
|
|
81
|
+
} else {
|
|
82
|
+
newSet.add(keyName);
|
|
83
|
+
}
|
|
84
|
+
return newSet;
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const handleRequestAccess = async () => {
|
|
88
|
+
if (!selectedPlan) return;
|
|
89
|
+
setCreating(true);
|
|
90
|
+
setCreateError(null);
|
|
91
|
+
try {
|
|
92
|
+
const response = await fetchApi.fetch(`${backendUrl}/api/kuadrant/requests`, {
|
|
93
|
+
method: "POST",
|
|
94
|
+
headers: {
|
|
95
|
+
"Content-Type": "application/json"
|
|
96
|
+
},
|
|
97
|
+
body: JSON.stringify({
|
|
98
|
+
apiName,
|
|
99
|
+
apiNamespace: namespace,
|
|
100
|
+
userId,
|
|
101
|
+
userEmail,
|
|
102
|
+
planTier: selectedPlan,
|
|
103
|
+
useCase: useCase.trim() || "",
|
|
104
|
+
namespace
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
if (!response.ok) {
|
|
108
|
+
const errorData = await response.json().catch(() => ({}));
|
|
109
|
+
throw new Error(errorData.error || `failed to create request: ${response.status}`);
|
|
110
|
+
}
|
|
111
|
+
setOpen(false);
|
|
112
|
+
setSelectedPlan("");
|
|
113
|
+
setUseCase("");
|
|
114
|
+
setRefresh((r) => r + 1);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
console.error("error creating api key request:", err);
|
|
117
|
+
setCreateError(err instanceof Error ? err.message : "unknown error occurred");
|
|
118
|
+
} finally {
|
|
119
|
+
setCreating(false);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const detailPanelConfig = useMemo(() => [
|
|
123
|
+
{
|
|
124
|
+
render: (data) => {
|
|
125
|
+
const request = data.rowData;
|
|
126
|
+
if (!request?.metadata?.name) {
|
|
127
|
+
return /* @__PURE__ */ React.createElement(Box, null);
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ React.createElement(DetailPanelContent, { request, apiName });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
], [apiName]);
|
|
133
|
+
const DetailPanelContent = ({ request, apiName: api }) => {
|
|
134
|
+
const [selectedLanguage, setSelectedLanguage] = useState(0);
|
|
135
|
+
const hostname = request.status?.apiHostname || `${api}.apps.example.com`;
|
|
136
|
+
return /* @__PURE__ */ React.createElement(Box, { p: 3, bgcolor: "background.default", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6", gutterBottom: true }, "Usage Examples"), /* @__PURE__ */ React.createElement(Typography, { variant: "body2", paragraph: true }, "Use these code examples to test the API with your ", request.spec.planTier, " tier key."), /* @__PURE__ */ React.createElement(Box, { onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React.createElement(
|
|
137
|
+
Tabs,
|
|
138
|
+
{
|
|
139
|
+
value: selectedLanguage,
|
|
140
|
+
onChange: (e, newValue) => {
|
|
141
|
+
e.stopPropagation();
|
|
142
|
+
setSelectedLanguage(newValue);
|
|
143
|
+
},
|
|
144
|
+
indicatorColor: "primary"
|
|
145
|
+
},
|
|
146
|
+
/* @__PURE__ */ React.createElement(Tab, { label: "cURL", onClick: (e) => e.stopPropagation() }),
|
|
147
|
+
/* @__PURE__ */ React.createElement(Tab, { label: "Node.js", onClick: (e) => e.stopPropagation() }),
|
|
148
|
+
/* @__PURE__ */ React.createElement(Tab, { label: "Python", onClick: (e) => e.stopPropagation() }),
|
|
149
|
+
/* @__PURE__ */ React.createElement(Tab, { label: "Go", onClick: (e) => e.stopPropagation() })
|
|
150
|
+
)), /* @__PURE__ */ React.createElement(Box, { mt: 2 }, selectedLanguage === 0 && /* @__PURE__ */ React.createElement(
|
|
151
|
+
CodeSnippet,
|
|
152
|
+
{
|
|
153
|
+
text: `curl -X GET https://${hostname}/api/v1/endpoint \\
|
|
154
|
+
-H "Authorization: Bearer ${request.status?.apiKey}"`,
|
|
155
|
+
language: "bash",
|
|
156
|
+
showCopyCodeButton: true
|
|
157
|
+
}
|
|
158
|
+
), selectedLanguage === 1 && /* @__PURE__ */ React.createElement(
|
|
159
|
+
CodeSnippet,
|
|
160
|
+
{
|
|
161
|
+
text: `const fetch = require('node-fetch');
|
|
162
|
+
|
|
163
|
+
const apiKey = '${request.status?.apiKey}';
|
|
164
|
+
const endpoint = 'https://${hostname}/api/v1/endpoint';
|
|
165
|
+
|
|
166
|
+
fetch(endpoint, {
|
|
167
|
+
method: 'GET',
|
|
168
|
+
headers: {
|
|
169
|
+
'Authorization': \`Bearer \${apiKey}\`
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
.then(response => response.json())
|
|
173
|
+
.then(data => console.log(data))
|
|
174
|
+
.catch(error => console.error('Error:', error));`,
|
|
175
|
+
language: "javascript",
|
|
176
|
+
showCopyCodeButton: true
|
|
177
|
+
}
|
|
178
|
+
), selectedLanguage === 2 && /* @__PURE__ */ React.createElement(
|
|
179
|
+
CodeSnippet,
|
|
180
|
+
{
|
|
181
|
+
text: `import requests
|
|
182
|
+
|
|
183
|
+
api_key = '${request.status?.apiKey}'
|
|
184
|
+
endpoint = 'https://${hostname}/api/v1/endpoint'
|
|
185
|
+
|
|
186
|
+
headers = {
|
|
187
|
+
'Authorization': f'Bearer {api_key}'
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
response = requests.get(endpoint, headers=headers)
|
|
191
|
+
print(response.json())`,
|
|
192
|
+
language: "python",
|
|
193
|
+
showCopyCodeButton: true
|
|
194
|
+
}
|
|
195
|
+
), selectedLanguage === 3 && /* @__PURE__ */ React.createElement(
|
|
196
|
+
CodeSnippet,
|
|
197
|
+
{
|
|
198
|
+
text: `package main
|
|
199
|
+
|
|
200
|
+
import (
|
|
201
|
+
"fmt"
|
|
202
|
+
"net/http"
|
|
203
|
+
"io"
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
func main() {
|
|
207
|
+
apiKey := "${request.status?.apiKey}"
|
|
208
|
+
endpoint := "https://${hostname}/api/v1/endpoint"
|
|
209
|
+
|
|
210
|
+
client := &http.Client{}
|
|
211
|
+
req, _ := http.NewRequest("GET", endpoint, nil)
|
|
212
|
+
req.Header.Add("Authorization", "Bearer " + apiKey)
|
|
213
|
+
|
|
214
|
+
resp, err := client.Do(req)
|
|
215
|
+
if err != nil {
|
|
216
|
+
fmt.Println("Error:", err)
|
|
217
|
+
return
|
|
218
|
+
}
|
|
219
|
+
defer resp.Body.Close()
|
|
220
|
+
|
|
221
|
+
body, _ := io.ReadAll(resp.Body)
|
|
222
|
+
fmt.Println(string(body))
|
|
223
|
+
}`,
|
|
224
|
+
language: "go",
|
|
225
|
+
showCopyCodeButton: true
|
|
226
|
+
}
|
|
227
|
+
)));
|
|
228
|
+
};
|
|
229
|
+
const loading = requestsLoading || plansLoading;
|
|
230
|
+
const error = requestsError || plansError;
|
|
231
|
+
if (loading) {
|
|
232
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
233
|
+
}
|
|
234
|
+
if (error) {
|
|
235
|
+
return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
|
|
236
|
+
}
|
|
237
|
+
const myRequests = requests || [];
|
|
238
|
+
const plans = apiProduct?.spec?.plans || [];
|
|
239
|
+
const pendingRequests = myRequests.filter((r) => !r.status?.phase || r.status.phase === "Pending");
|
|
240
|
+
const approvedRequests = myRequests.filter((r) => r.status?.phase === "Approved");
|
|
241
|
+
const rejectedRequests = myRequests.filter((r) => r.status?.phase === "Rejected");
|
|
242
|
+
const approvedColumns = [
|
|
243
|
+
{
|
|
244
|
+
title: "Plan Tier",
|
|
245
|
+
field: "spec.planTier",
|
|
246
|
+
render: (row) => /* @__PURE__ */ React.createElement(Chip, { label: row.spec.planTier, color: "primary", size: "small" })
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
title: "Approved",
|
|
250
|
+
field: "status.reviewedAt",
|
|
251
|
+
render: (row) => /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, row.status?.reviewedAt ? new Date(row.status.reviewedAt).toLocaleDateString() : "-")
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
title: "API Key",
|
|
255
|
+
field: "status.apiKey",
|
|
256
|
+
searchable: false,
|
|
257
|
+
render: (row) => {
|
|
258
|
+
const isVisible = visibleKeys.has(row.metadata.name);
|
|
259
|
+
const apiKey = row.status?.apiKey || "N/A";
|
|
260
|
+
return /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(
|
|
261
|
+
Typography,
|
|
262
|
+
{
|
|
263
|
+
variant: "body2",
|
|
264
|
+
style: {
|
|
265
|
+
fontFamily: "monospace",
|
|
266
|
+
marginRight: 8
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
isVisible ? apiKey : "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"
|
|
270
|
+
), /* @__PURE__ */ React.createElement(
|
|
271
|
+
IconButton,
|
|
272
|
+
{
|
|
273
|
+
size: "small",
|
|
274
|
+
onClick: () => toggleVisibility(row.metadata.name)
|
|
275
|
+
},
|
|
276
|
+
isVisible ? /* @__PURE__ */ React.createElement(VisibilityOffIcon, null) : /* @__PURE__ */ React.createElement(VisibilityIcon, null)
|
|
277
|
+
));
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
title: "Actions",
|
|
282
|
+
field: "actions",
|
|
283
|
+
searchable: false,
|
|
284
|
+
render: (row) => /* @__PURE__ */ React.createElement(
|
|
285
|
+
IconButton,
|
|
286
|
+
{
|
|
287
|
+
size: "small",
|
|
288
|
+
onClick: () => handleDeleteRequest(row.metadata.name),
|
|
289
|
+
color: "secondary",
|
|
290
|
+
title: "Revoke access and delete key"
|
|
291
|
+
},
|
|
292
|
+
/* @__PURE__ */ React.createElement(DeleteIcon, null)
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
];
|
|
296
|
+
const requestColumns = [
|
|
297
|
+
{
|
|
298
|
+
title: "Status",
|
|
299
|
+
field: "status.phase",
|
|
300
|
+
render: (row) => {
|
|
301
|
+
const phase = row.status?.phase || "Pending";
|
|
302
|
+
const isPending = phase === "Pending";
|
|
303
|
+
return /* @__PURE__ */ React.createElement(
|
|
304
|
+
Chip,
|
|
305
|
+
{
|
|
306
|
+
label: phase,
|
|
307
|
+
size: "small",
|
|
308
|
+
icon: isPending ? /* @__PURE__ */ React.createElement(HourglassEmptyIcon, null) : /* @__PURE__ */ React.createElement(CancelIcon, null),
|
|
309
|
+
color: isPending ? "default" : "secondary"
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
title: "Plan Tier",
|
|
316
|
+
field: "spec.planTier",
|
|
317
|
+
render: (row) => /* @__PURE__ */ React.createElement(Chip, { label: row.spec.planTier, color: "primary", size: "small" })
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
title: "Use Case",
|
|
321
|
+
field: "spec.useCase",
|
|
322
|
+
render: (row) => /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, row.spec.useCase || "-")
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
title: "Requested",
|
|
326
|
+
field: "spec.requestedAt",
|
|
327
|
+
render: (row) => /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, row.spec.requestedAt ? new Date(row.spec.requestedAt).toLocaleDateString() : "-")
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
title: "Reviewed",
|
|
331
|
+
field: "status.reviewedAt",
|
|
332
|
+
render: (row) => {
|
|
333
|
+
if (!row.status?.reviewedAt) return /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, "-");
|
|
334
|
+
return /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, new Date(row.status.reviewedAt).toLocaleDateString());
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
title: "Reason",
|
|
339
|
+
field: "status.reason",
|
|
340
|
+
render: (row) => /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, row.status?.reason || "-")
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
title: "Actions",
|
|
344
|
+
field: "actions",
|
|
345
|
+
searchable: false,
|
|
346
|
+
render: (row) => {
|
|
347
|
+
const isPending = !row.status?.phase || row.status.phase === "Pending";
|
|
348
|
+
if (!isPending) return null;
|
|
349
|
+
return /* @__PURE__ */ React.createElement(
|
|
350
|
+
IconButton,
|
|
351
|
+
{
|
|
352
|
+
size: "small",
|
|
353
|
+
onClick: () => handleDeleteRequest(row.metadata.name),
|
|
354
|
+
color: "secondary"
|
|
355
|
+
},
|
|
356
|
+
/* @__PURE__ */ React.createElement(DeleteIcon, null)
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
];
|
|
361
|
+
return /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Box, { display: "flex", justifyContent: "flex-end", mb: 2 }, /* @__PURE__ */ React.createElement(
|
|
362
|
+
Button,
|
|
363
|
+
{
|
|
364
|
+
variant: "contained",
|
|
365
|
+
color: "primary",
|
|
366
|
+
startIcon: /* @__PURE__ */ React.createElement(AddIcon, null),
|
|
367
|
+
onClick: () => setOpen(true),
|
|
368
|
+
disabled: plans.length === 0
|
|
369
|
+
},
|
|
370
|
+
"Request API Access"
|
|
371
|
+
))), pendingRequests.length > 0 && /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
372
|
+
Table,
|
|
373
|
+
{
|
|
374
|
+
title: "Pending Requests",
|
|
375
|
+
options: {
|
|
376
|
+
paging: false,
|
|
377
|
+
search: false
|
|
378
|
+
},
|
|
379
|
+
columns: requestColumns,
|
|
380
|
+
data: pendingRequests
|
|
381
|
+
}
|
|
382
|
+
)), rejectedRequests.length > 0 && /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
383
|
+
Table,
|
|
384
|
+
{
|
|
385
|
+
title: "Rejected Requests",
|
|
386
|
+
options: {
|
|
387
|
+
paging: false,
|
|
388
|
+
search: false
|
|
389
|
+
},
|
|
390
|
+
columns: requestColumns,
|
|
391
|
+
data: rejectedRequests
|
|
392
|
+
}
|
|
393
|
+
)), approvedRequests.length > 0 && /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
394
|
+
Table,
|
|
395
|
+
{
|
|
396
|
+
key: "api-keys-table",
|
|
397
|
+
title: "API Keys",
|
|
398
|
+
options: {
|
|
399
|
+
paging: false,
|
|
400
|
+
search: false
|
|
401
|
+
},
|
|
402
|
+
columns: approvedColumns,
|
|
403
|
+
data: approvedRequests,
|
|
404
|
+
detailPanel: detailPanelConfig
|
|
405
|
+
}
|
|
406
|
+
))), /* @__PURE__ */ React.createElement(Dialog, { open, onClose: () => setOpen(false), maxWidth: "sm", fullWidth: true }, /* @__PURE__ */ React.createElement(DialogTitle, null, "Request API Access"), /* @__PURE__ */ React.createElement(DialogContent, null, createError && /* @__PURE__ */ React.createElement(Box, { mb: 2, p: 2, bgcolor: "error.main", color: "error.contrastText", borderRadius: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, createError)), /* @__PURE__ */ React.createElement(FormControl, { fullWidth: true, margin: "normal" }, /* @__PURE__ */ React.createElement(InputLabel, null, "Select Plan Tier"), /* @__PURE__ */ React.createElement(
|
|
407
|
+
Select,
|
|
408
|
+
{
|
|
409
|
+
value: selectedPlan,
|
|
410
|
+
onChange: (e) => setSelectedPlan(e.target.value)
|
|
411
|
+
},
|
|
412
|
+
plans.map((plan) => {
|
|
413
|
+
const limitDesc = Object.entries(plan.limits || {}).map(([key, val]) => `${val} per ${key}`).join(", ");
|
|
414
|
+
return /* @__PURE__ */ React.createElement(MenuItem, { key: plan.tier, value: plan.tier }, plan.tier, " ", limitDesc ? `(${limitDesc})` : "");
|
|
415
|
+
})
|
|
416
|
+
)), /* @__PURE__ */ React.createElement(
|
|
417
|
+
TextField,
|
|
418
|
+
{
|
|
419
|
+
label: "Use Case (optional)",
|
|
420
|
+
placeholder: "Describe how you plan to use this API",
|
|
421
|
+
multiline: true,
|
|
422
|
+
rows: 3,
|
|
423
|
+
fullWidth: true,
|
|
424
|
+
margin: "normal",
|
|
425
|
+
value: useCase,
|
|
426
|
+
onChange: (e) => setUseCase(e.target.value),
|
|
427
|
+
helperText: "Explain your intended use of this API for admin review"
|
|
428
|
+
}
|
|
429
|
+
)), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: () => setOpen(false) }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
430
|
+
Button,
|
|
431
|
+
{
|
|
432
|
+
onClick: handleRequestAccess,
|
|
433
|
+
color: "primary",
|
|
434
|
+
disabled: !selectedPlan || creating
|
|
435
|
+
},
|
|
436
|
+
creating ? "Submitting..." : "Submit Request"
|
|
437
|
+
))));
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
export { ApiKeyManagementTab };
|
|
441
|
+
//# sourceMappingURL=ApiKeyManagementTab.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiKeyManagementTab.esm.js","sources":["../../../src/components/ApiKeyManagementTab/ApiKeyManagementTab.tsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport { useAsync } from 'react-use';\nimport {\n Table,\n TableColumn,\n Progress,\n ResponseErrorPanel,\n CodeSnippet,\n} from '@backstage/core-components';\nimport {\n IconButton,\n Typography,\n Box,\n Chip,\n Grid,\n Button,\n Dialog,\n DialogTitle,\n DialogContent,\n DialogActions,\n TextField,\n Select,\n MenuItem,\n FormControl,\n InputLabel,\n Tabs,\n Tab,\n} from '@material-ui/core';\nimport { useApi, configApiRef, identityApiRef, fetchApiRef } from '@backstage/core-plugin-api';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport VisibilityIcon from '@material-ui/icons/Visibility';\nimport VisibilityOffIcon from '@material-ui/icons/VisibilityOff';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport AddIcon from '@material-ui/icons/Add';\nimport { APIKeyRequest } from '../../types/api-management';\n\ninterface APIProduct {\n metadata: {\n name: string;\n namespace: string;\n };\n spec: {\n plans?: Array<{\n tier: string;\n description?: string;\n limits?: any;\n }>;\n };\n}\n\ninterface Plan {\n tier: string;\n limits: any;\n}\n\nexport interface ApiKeyManagementTabProps {\n namespace?: string;\n}\n\nexport const ApiKeyManagementTab = ({ namespace: propNamespace }: ApiKeyManagementTabProps) => {\n const { entity } = useEntity();\n const config = useApi(configApiRef);\n const identityApi = useApi(identityApiRef);\n const fetchApi = useApi(fetchApiRef);\n const backendUrl = config.getString('backend.baseUrl');\n const [visibleKeys, setVisibleKeys] = useState<Set<string>>(new Set());\n const [refresh, setRefresh] = useState(0);\n const [userId, setUserId] = useState<string>('guest');\n const [userEmail, setUserEmail] = useState<string>('');\n const [open, setOpen] = useState(false);\n const [selectedPlan, setSelectedPlan] = useState('');\n const [useCase, setUseCase] = useState('');\n const [creating, setCreating] = useState(false);\n const [createError, setCreateError] = useState<string | null>(null);\n\n const httproute = entity.metadata.annotations?.['kuadrant.io/httproute'] || entity.metadata.name;\n const namespace = entity.metadata.annotations?.['kuadrant.io/namespace'] || propNamespace || 'default';\n const apiName = httproute;\n\n useAsync(async () => {\n const identity = await identityApi.getBackstageIdentity();\n const profile = await identityApi.getProfileInfo();\n setUserId(identity.userEntityRef.split('/')[1] || 'guest');\n setUserEmail(profile.email || '');\n }, [identityApi]);\n\n const { value: requests, loading: requestsLoading, error: requestsError } = useAsync(async () => {\n if (!userId) return [];\n const response = await fetchApi.fetch(\n `${backendUrl}/api/kuadrant/requests/my?userId=${userId}&namespace=${namespace}`\n );\n if (!response.ok) {\n throw new Error('failed to fetch requests');\n }\n const data = await response.json();\n return (data.items || []).filter(\n (r: APIKeyRequest) => r.spec.apiName === apiName && r.spec.apiNamespace === namespace\n );\n }, [userId, apiName, namespace, refresh, fetchApi]);\n\n const { value: apiProduct, loading: plansLoading, error: plansError } = useAsync(async () => {\n const response = await fetchApi.fetch(`${backendUrl}/api/kuadrant/apiproducts`);\n if (!response.ok) {\n throw new Error('failed to fetch api products');\n }\n const data = await response.json();\n\n const product = data.items?.find((p: APIProduct) =>\n p.metadata.namespace === namespace &&\n (p.metadata.name === apiName || p.metadata.name === `${apiName}-api`)\n );\n\n return product;\n }, [namespace, apiName, fetchApi]);\n\n const handleDeleteRequest = async (name: string) => {\n try {\n const response = await fetchApi.fetch(\n `${backendUrl}/api/kuadrant/requests/${namespace}/${name}`,\n { method: 'DELETE' }\n );\n if (!response.ok) {\n throw new Error('failed to delete request');\n }\n setRefresh(r => r + 1);\n } catch (err) {\n console.error('error deleting request:', err);\n }\n };\n\n const toggleVisibility = (keyName: string) => {\n setVisibleKeys(prev => {\n const newSet = new Set(prev);\n if (newSet.has(keyName)) {\n newSet.delete(keyName);\n } else {\n newSet.add(keyName);\n }\n return newSet;\n });\n };\n\n const handleRequestAccess = async () => {\n if (!selectedPlan) return;\n\n setCreating(true);\n setCreateError(null);\n try {\n const response = await fetchApi.fetch(`${backendUrl}/api/kuadrant/requests`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n apiName,\n apiNamespace: namespace,\n userId,\n userEmail,\n planTier: selectedPlan,\n useCase: useCase.trim() || '',\n namespace,\n }),\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new Error(errorData.error || `failed to create request: ${response.status}`);\n }\n\n setOpen(false);\n setSelectedPlan('');\n setUseCase('');\n setRefresh(r => r + 1);\n } catch (err) {\n console.error('error creating api key request:', err);\n setCreateError(err instanceof Error ? err.message : 'unknown error occurred');\n } finally {\n setCreating(false);\n }\n };\n\n const detailPanelConfig = useMemo(() => [\n {\n render: (data: any) => {\n // backstage Table wraps the data in { rowData: actualData }\n const request = data.rowData as APIKeyRequest;\n if (!request?.metadata?.name) {\n return <Box />;\n }\n\n return <DetailPanelContent request={request} apiName={apiName} />;\n },\n },\n ], [apiName]);\n\n // separate component to isolate state\n const DetailPanelContent = ({ request, apiName: api }: { request: APIKeyRequest; apiName: string }) => {\n const [selectedLanguage, setSelectedLanguage] = useState(0);\n const hostname = request.status?.apiHostname || `${api}.apps.example.com`;\n\n return (\n <Box p={3} bgcolor=\"background.default\" onClick={(e) => e.stopPropagation()}>\n <Typography variant=\"h6\" gutterBottom>\n Usage Examples\n </Typography>\n <Typography variant=\"body2\" paragraph>\n Use these code examples to test the API with your {request.spec.planTier} tier key.\n </Typography>\n <Box onClick={(e) => e.stopPropagation()}>\n <Tabs\n value={selectedLanguage}\n onChange={(e, newValue) => {\n e.stopPropagation();\n setSelectedLanguage(newValue);\n }}\n indicatorColor=\"primary\"\n >\n <Tab label=\"cURL\" onClick={(e) => e.stopPropagation()} />\n <Tab label=\"Node.js\" onClick={(e) => e.stopPropagation()} />\n <Tab label=\"Python\" onClick={(e) => e.stopPropagation()} />\n <Tab label=\"Go\" onClick={(e) => e.stopPropagation()} />\n </Tabs>\n </Box>\n <Box mt={2}>\n {selectedLanguage === 0 && (\n <CodeSnippet\n text={`curl -X GET https://${hostname}/api/v1/endpoint \\\\\n -H \"Authorization: Bearer ${request.status?.apiKey}\"`}\n language=\"bash\"\n showCopyCodeButton\n />\n )}\n {selectedLanguage === 1 && (\n <CodeSnippet\n text={`const fetch = require('node-fetch');\n\nconst apiKey = '${request.status?.apiKey}';\nconst endpoint = 'https://${hostname}/api/v1/endpoint';\n\nfetch(endpoint, {\n method: 'GET',\n headers: {\n 'Authorization': \\`Bearer \\${apiKey}\\`\n }\n})\n .then(response => response.json())\n .then(data => console.log(data))\n .catch(error => console.error('Error:', error));`}\n language=\"javascript\"\n showCopyCodeButton\n />\n )}\n {selectedLanguage === 2 && (\n <CodeSnippet\n text={`import requests\n\napi_key = '${request.status?.apiKey}'\nendpoint = 'https://${hostname}/api/v1/endpoint'\n\nheaders = {\n 'Authorization': f'Bearer {api_key}'\n}\n\nresponse = requests.get(endpoint, headers=headers)\nprint(response.json())`}\n language=\"python\"\n showCopyCodeButton\n />\n )}\n {selectedLanguage === 3 && (\n <CodeSnippet\n text={`package main\n\nimport (\n \"fmt\"\n \"net/http\"\n \"io\"\n)\n\nfunc main() {\n apiKey := \"${request.status?.apiKey}\"\n endpoint := \"https://${hostname}/api/v1/endpoint\"\n\n client := &http.Client{}\n req, _ := http.NewRequest(\"GET\", endpoint, nil)\n req.Header.Add(\"Authorization\", \"Bearer \" + apiKey)\n\n resp, err := client.Do(req)\n if err != nil {\n fmt.Println(\"Error:\", err)\n return\n }\n defer resp.Body.Close()\n\n body, _ := io.ReadAll(resp.Body)\n fmt.Println(string(body))\n}`}\n language=\"go\"\n showCopyCodeButton\n />\n )}\n </Box>\n </Box>\n );\n };\n\n const loading = requestsLoading || plansLoading;\n const error = requestsError || plansError;\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const myRequests = (requests || []) as APIKeyRequest[];\n const plans = (apiProduct?.spec?.plans || []) as Plan[];\n\n const pendingRequests = myRequests.filter(r => !r.status?.phase || r.status.phase === 'Pending');\n const approvedRequests = myRequests.filter(r => r.status?.phase === 'Approved');\n const rejectedRequests = myRequests.filter(r => r.status?.phase === 'Rejected');\n\n const approvedColumns: TableColumn<APIKeyRequest>[] = [\n {\n title: 'Plan Tier',\n field: 'spec.planTier',\n render: (row: APIKeyRequest) => (\n <Chip label={row.spec.planTier} color=\"primary\" size=\"small\" />\n ),\n },\n {\n title: 'Approved',\n field: 'status.reviewedAt',\n render: (row: APIKeyRequest) => (\n <Typography variant=\"body2\">\n {row.status?.reviewedAt ? new Date(row.status.reviewedAt).toLocaleDateString() : '-'}\n </Typography>\n ),\n },\n {\n title: 'API Key',\n field: 'status.apiKey',\n searchable: false,\n render: (row: APIKeyRequest) => {\n const isVisible = visibleKeys.has(row.metadata.name);\n const apiKey = row.status?.apiKey || 'N/A';\n\n return (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography\n variant=\"body2\"\n style={{\n fontFamily: 'monospace',\n marginRight: 8,\n }}\n >\n {isVisible ? apiKey : '••••••••••••••••'}\n </Typography>\n <IconButton\n size=\"small\"\n onClick={() => toggleVisibility(row.metadata.name)}\n >\n {isVisible ? <VisibilityOffIcon /> : <VisibilityIcon />}\n </IconButton>\n </Box>\n );\n },\n },\n {\n title: 'Actions',\n field: 'actions',\n searchable: false,\n render: (row: APIKeyRequest) => (\n <IconButton\n size=\"small\"\n onClick={() => handleDeleteRequest(row.metadata.name)}\n color=\"secondary\"\n title=\"Revoke access and delete key\"\n >\n <DeleteIcon />\n </IconButton>\n ),\n },\n ];\n\n const requestColumns: TableColumn<APIKeyRequest>[] = [\n {\n title: 'Status',\n field: 'status.phase',\n render: (row: APIKeyRequest) => {\n const phase = row.status?.phase || 'Pending';\n const isPending = phase === 'Pending';\n return (\n <Chip\n label={phase}\n size=\"small\"\n icon={isPending ? <HourglassEmptyIcon /> : <CancelIcon />}\n color={isPending ? 'default' : 'secondary'}\n />\n );\n },\n },\n {\n title: 'Plan Tier',\n field: 'spec.planTier',\n render: (row: APIKeyRequest) => (\n <Chip label={row.spec.planTier} color=\"primary\" size=\"small\" />\n ),\n },\n {\n title: 'Use Case',\n field: 'spec.useCase',\n render: (row: APIKeyRequest) => (\n <Typography variant=\"body2\">{row.spec.useCase || '-'}</Typography>\n ),\n },\n {\n title: 'Requested',\n field: 'spec.requestedAt',\n render: (row: APIKeyRequest) => (\n <Typography variant=\"body2\">\n {row.spec.requestedAt ? new Date(row.spec.requestedAt).toLocaleDateString() : '-'}\n </Typography>\n ),\n },\n {\n title: 'Reviewed',\n field: 'status.reviewedAt',\n render: (row: APIKeyRequest) => {\n if (!row.status?.reviewedAt) return <Typography variant=\"body2\">-</Typography>;\n return (\n <Typography variant=\"body2\">\n {new Date(row.status.reviewedAt).toLocaleDateString()}\n </Typography>\n );\n },\n },\n {\n title: 'Reason',\n field: 'status.reason',\n render: (row: APIKeyRequest) => (\n <Typography variant=\"body2\">{row.status?.reason || '-'}</Typography>\n ),\n },\n {\n title: 'Actions',\n field: 'actions',\n searchable: false,\n render: (row: APIKeyRequest) => {\n const isPending = !row.status?.phase || row.status.phase === 'Pending';\n if (!isPending) return null;\n return (\n <IconButton\n size=\"small\"\n onClick={() => handleDeleteRequest(row.metadata.name)}\n color=\"secondary\"\n >\n <DeleteIcon />\n </IconButton>\n );\n },\n },\n ];\n\n return (\n <Box p={2}>\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <Box display=\"flex\" justifyContent=\"flex-end\" mb={2}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n startIcon={<AddIcon />}\n onClick={() => setOpen(true)}\n disabled={plans.length === 0}\n >\n Request API Access\n </Button>\n </Box>\n </Grid>\n {pendingRequests.length > 0 && (\n <Grid item>\n <Table\n title=\"Pending Requests\"\n options={{\n paging: false,\n search: false,\n }}\n columns={requestColumns}\n data={pendingRequests}\n />\n </Grid>\n )}\n {rejectedRequests.length > 0 && (\n <Grid item>\n <Table\n title=\"Rejected Requests\"\n options={{\n paging: false,\n search: false,\n }}\n columns={requestColumns}\n data={rejectedRequests}\n />\n </Grid>\n )}\n {approvedRequests.length > 0 && (\n <Grid item>\n <Table\n key=\"api-keys-table\"\n title=\"API Keys\"\n options={{\n paging: false,\n search: false,\n }}\n columns={approvedColumns}\n data={approvedRequests}\n detailPanel={detailPanelConfig}\n />\n </Grid>\n )}\n </Grid>\n\n <Dialog open={open} onClose={() => setOpen(false)} maxWidth=\"sm\" fullWidth>\n <DialogTitle>Request API Access</DialogTitle>\n <DialogContent>\n {createError && (\n <Box mb={2} p={2} bgcolor=\"error.main\" color=\"error.contrastText\" borderRadius={1}>\n <Typography variant=\"body2\">{createError}</Typography>\n </Box>\n )}\n <FormControl fullWidth margin=\"normal\">\n <InputLabel>Select Plan Tier</InputLabel>\n <Select\n value={selectedPlan}\n onChange={(e) => setSelectedPlan(e.target.value as string)}\n >\n {plans.map((plan: Plan) => {\n const limitDesc = Object.entries(plan.limits || {})\n .map(([key, val]) => `${val} per ${key}`)\n .join(', ');\n return (\n <MenuItem key={plan.tier} value={plan.tier}>\n {plan.tier} {limitDesc ? `(${limitDesc})` : ''}\n </MenuItem>\n );\n })}\n </Select>\n </FormControl>\n <TextField\n label=\"Use Case (optional)\"\n placeholder=\"Describe how you plan to use this API\"\n multiline\n rows={3}\n fullWidth\n margin=\"normal\"\n value={useCase}\n onChange={(e) => setUseCase(e.target.value)}\n helperText=\"Explain your intended use of this API for admin review\"\n />\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setOpen(false)}>Cancel</Button>\n <Button\n onClick={handleRequestAccess}\n color=\"primary\"\n disabled={!selectedPlan || creating}\n >\n {creating ? 'Submitting...' : 'Submit Request'}\n </Button>\n </DialogActions>\n </Dialog>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA6DO,MAAM,mBAAsB,GAAA,CAAC,EAAE,SAAA,EAAW,eAA8C,KAAA;AAC7F,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,MAAA,GAAS,OAAO,YAAY,CAAA;AAClC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,SAAA,CAAU,iBAAiB,CAAA;AACrD,EAAA,MAAM,CAAC,WAAa,EAAA,cAAc,IAAI,QAAsB,iBAAA,IAAI,KAAK,CAAA;AACrE,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,CAAC,CAAA;AACxC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAiB,OAAO,CAAA;AACpD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAiB,EAAE,CAAA;AACrD,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,EAAE,CAAA;AACnD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,EAAE,CAAA;AACzC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAwB,IAAI,CAAA;AAElE,EAAA,MAAM,YAAY,MAAO,CAAA,QAAA,CAAS,cAA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AAA,KAAM,UAAW,CAAA,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,MAC1C,UAAW,EAAA;AAAA;AAAA,GAEf,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,OAAS,EAAA,MAAM,OAAQ,CAAA,KAAK,CAAG,EAAA,EAAA,QAAM,CAC7C,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,mBAAA;AAAA,MACT,KAAM,EAAA,SAAA;AAAA,MACN,QAAA,EAAU,CAAC,YAAgB,IAAA;AAAA,KAAA;AAAA,IAE1B,WAAW,eAAkB,GAAA;AAAA,GAElC,CACF,CACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { useApi, configApiRef, fetchApiRef } from '@backstage/core-plugin-api';
|
|
4
|
+
import { InfoCard, Progress, ResponseErrorPanel, Link } from '@backstage/core-components';
|
|
5
|
+
import { Typography, Grid, Box, Chip, Table, TableHead, TableRow, TableCell, TableBody } from '@material-ui/core';
|
|
6
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
7
|
+
|
|
8
|
+
const ApiProductInfoCard = () => {
|
|
9
|
+
const { entity } = useEntity();
|
|
10
|
+
const config = useApi(configApiRef);
|
|
11
|
+
const fetchApi = useApi(fetchApiRef);
|
|
12
|
+
const backendUrl = config.getString("backend.baseUrl");
|
|
13
|
+
const namespace = entity.metadata.annotations?.["kuadrant.io/namespace"];
|
|
14
|
+
const apiProductName = entity.metadata.annotations?.["kuadrant.io/apiproduct"];
|
|
15
|
+
const { value: apiProduct, loading, error } = useAsync(async () => {
|
|
16
|
+
if (!namespace || !apiProductName) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const response = await fetchApi.fetch(
|
|
20
|
+
`${backendUrl}/api/kuadrant/apiproducts/${namespace}/${apiProductName}`
|
|
21
|
+
);
|
|
22
|
+
return await response.json();
|
|
23
|
+
}, [backendUrl, fetchApi, namespace, apiProductName]);
|
|
24
|
+
if (!namespace || !apiProductName) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { title: "API Product Information" }, /* @__PURE__ */ React.createElement(Typography, null, "No APIProduct linked to this API entity"));
|
|
26
|
+
}
|
|
27
|
+
if (loading) {
|
|
28
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { title: "API Product Information" }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
29
|
+
}
|
|
30
|
+
if (error) {
|
|
31
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { title: "API Product Information" }, /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error }));
|
|
32
|
+
}
|
|
33
|
+
if (!apiProduct) {
|
|
34
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { title: "API Product Information" }, /* @__PURE__ */ React.createElement(Typography, null, "APIProduct not found"));
|
|
35
|
+
}
|
|
36
|
+
const { spec } = apiProduct;
|
|
37
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(InfoCard, { title: "API Product Details" }, /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6", gutterBottom: true }, spec.displayName || apiProductName), /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: "textSecondary", paragraph: true }, spec.description), /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center", flexWrap: "wrap", style: { gap: 8 } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement("strong", null, "Version:"), " ", spec.version || "v1"), spec.tags && spec.tags.length > 0 && /* @__PURE__ */ React.createElement(Box, { display: "flex", ml: 2, style: { gap: 4 } }, spec.tags.map((tag) => /* @__PURE__ */ React.createElement(Chip, { key: tag, label: tag, size: "small" }))))))), spec.plans && spec.plans.length > 0 && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(InfoCard, { title: "Available Plans" }, /* @__PURE__ */ React.createElement(Table, { size: "small" }, /* @__PURE__ */ React.createElement(TableHead, null, /* @__PURE__ */ React.createElement(TableRow, null, /* @__PURE__ */ React.createElement(TableCell, null, "Tier"), /* @__PURE__ */ React.createElement(TableCell, null, "Description"), /* @__PURE__ */ React.createElement(TableCell, null, "Rate Limits"))), /* @__PURE__ */ React.createElement(TableBody, null, spec.plans.map((plan) => /* @__PURE__ */ React.createElement(TableRow, { key: plan.tier }, /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement(
|
|
38
|
+
Chip,
|
|
39
|
+
{
|
|
40
|
+
label: plan.tier,
|
|
41
|
+
size: "small"
|
|
42
|
+
}
|
|
43
|
+
)), /* @__PURE__ */ React.createElement(TableCell, null, plan.description || "-"), /* @__PURE__ */ React.createElement(TableCell, null, plan.limits && Object.entries(plan.limits).map(([key, value]) => /* @__PURE__ */ React.createElement(Typography, { key, variant: "body2" }, String(value), " per ", key))))))), spec.planPolicyRef && /* @__PURE__ */ React.createElement(Box, { mt: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: "textSecondary" }, "Managed by PlanPolicy: ", /* @__PURE__ */ React.createElement("strong", null, spec.planPolicyRef.name), " (", spec.planPolicyRef.namespace, ")")))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React.createElement(InfoCard, { title: "Contact Information" }, spec.contact ? /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, spec.contact.team && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement("strong", null, "Team:"), " ", spec.contact.team)), spec.contact.email && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement("strong", null, "Email:"), " ", /* @__PURE__ */ React.createElement(Link, { to: `mailto:${spec.contact.email}` }, spec.contact.email))), spec.contact.slack && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement("strong", null, "Slack:"), " ", spec.contact.slack)))) : /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: "textSecondary" }, "No contact information available")))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, md: 6 }, /* @__PURE__ */ React.createElement(InfoCard, { title: "Documentation" }, spec.documentation ? /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, spec.documentation.docsURL && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement("strong", null, "Documentation:"), " ", /* @__PURE__ */ React.createElement(Link, { to: spec.documentation.docsURL, target: "_blank" }, "View Docs"))), spec.documentation.openAPISpec && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement("strong", null, "OpenAPI Spec:"), " ", /* @__PURE__ */ React.createElement(Link, { to: spec.documentation.openAPISpec, target: "_blank" }, "View Spec"))))) : /* @__PURE__ */ React.createElement(Box, { p: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: "textSecondary" }, "No documentation links available")))));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { ApiProductInfoCard };
|
|
47
|
+
//# sourceMappingURL=ApiProductInfoCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiProductInfoCard.esm.js","sources":["../../../src/components/ApiProductInfoCard/ApiProductInfoCard.tsx"],"sourcesContent":["import React from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useApi, configApiRef, fetchApiRef } from '@backstage/core-plugin-api';\nimport { InfoCard, Link, Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { Grid, Chip, Typography, Box, Table, TableBody, TableCell, TableHead, TableRow } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\n\nexport const ApiProductInfoCard = () => {\n const { entity } = useEntity();\n const config = useApi(configApiRef);\n const fetchApi = useApi(fetchApiRef);\n const backendUrl = config.getString('backend.baseUrl');\n\n const namespace = entity.metadata.annotations?.['kuadrant.io/namespace'];\n const apiProductName = entity.metadata.annotations?.['kuadrant.io/apiproduct'];\n\n const { value: apiProduct, loading, error } = useAsync(async () => {\n if (!namespace || !apiProductName) {\n return null;\n }\n\n const response = await fetchApi.fetch(\n `${backendUrl}/api/kuadrant/apiproducts/${namespace}/${apiProductName}`\n );\n return await response.json();\n }, [backendUrl, fetchApi, namespace, apiProductName]);\n\n if (!namespace || !apiProductName) {\n return (\n <InfoCard title=\"API Product Information\">\n <Typography>No APIProduct linked to this API entity</Typography>\n </InfoCard>\n );\n }\n\n if (loading) {\n return (\n <InfoCard title=\"API Product Information\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard title=\"API Product Information\">\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n if (!apiProduct) {\n return (\n <InfoCard title=\"API Product Information\">\n <Typography>APIProduct not found</Typography>\n </InfoCard>\n );\n }\n\n const { spec } = apiProduct;\n\n return (\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <InfoCard title=\"API Product Details\">\n <Box p={2}>\n <Typography variant=\"h6\" gutterBottom>\n {spec.displayName || apiProductName}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" paragraph>\n {spec.description}\n </Typography>\n <Box display=\"flex\" alignItems=\"center\" flexWrap=\"wrap\" style={{ gap: 8 }}>\n <Typography variant=\"body2\">\n <strong>Version:</strong> {spec.version || 'v1'}\n </Typography>\n {spec.tags && spec.tags.length > 0 && (\n <Box display=\"flex\" ml={2} style={{ gap: 4 }}>\n {spec.tags.map((tag: string) => (\n <Chip key={tag} label={tag} size=\"small\" />\n ))}\n </Box>\n )}\n </Box>\n </Box>\n </InfoCard>\n </Grid>\n\n {spec.plans && spec.plans.length > 0 && (\n <Grid item xs={12}>\n <InfoCard title=\"Available Plans\">\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell>Tier</TableCell>\n <TableCell>Description</TableCell>\n <TableCell>Rate Limits</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {spec.plans.map((plan: any) => (\n <TableRow key={plan.tier}>\n <TableCell>\n <Chip\n label={plan.tier}\n size=\"small\"\n />\n </TableCell>\n <TableCell>{plan.description || '-'}</TableCell>\n <TableCell>\n {plan.limits && Object.entries(plan.limits).map(([key, value]) => (\n <Typography key={key} variant=\"body2\">\n {String(value)} per {key}\n </Typography>\n ))}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n {spec.planPolicyRef && (\n <Box mt={2}>\n <Typography variant=\"caption\" color=\"textSecondary\">\n Managed by PlanPolicy: <strong>{spec.planPolicyRef.name}</strong> ({spec.planPolicyRef.namespace})\n </Typography>\n </Box>\n )}\n </InfoCard>\n </Grid>\n )}\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"Contact Information\">\n {spec.contact ? (\n <Box p={2}>\n <Grid container spacing={2}>\n {spec.contact.team && (\n <Grid item xs={12}>\n <Typography variant=\"body2\">\n <strong>Team:</strong> {spec.contact.team}\n </Typography>\n </Grid>\n )}\n {spec.contact.email && (\n <Grid item xs={12}>\n <Typography variant=\"body2\">\n <strong>Email:</strong> <Link to={`mailto:${spec.contact.email}`}>{spec.contact.email}</Link>\n </Typography>\n </Grid>\n )}\n {spec.contact.slack && (\n <Grid item xs={12}>\n <Typography variant=\"body2\">\n <strong>Slack:</strong> {spec.contact.slack}\n </Typography>\n </Grid>\n )}\n </Grid>\n </Box>\n ) : (\n <Box p={2}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n No contact information available\n </Typography>\n </Box>\n )}\n </InfoCard>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"Documentation\">\n {spec.documentation ? (\n <Box p={2}>\n <Grid container spacing={2}>\n {spec.documentation.docsURL && (\n <Grid item xs={12}>\n <Typography variant=\"body2\">\n <strong>Documentation:</strong>{' '}\n <Link to={spec.documentation.docsURL} target=\"_blank\">\n View Docs\n </Link>\n </Typography>\n </Grid>\n )}\n {spec.documentation.openAPISpec && (\n <Grid item xs={12}>\n <Typography variant=\"body2\">\n <strong>OpenAPI Spec:</strong>{' '}\n <Link to={spec.documentation.openAPISpec} target=\"_blank\">\n View Spec\n </Link>\n </Typography>\n </Grid>\n )}\n </Grid>\n </Box>\n ) : (\n <Box p={2}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n No documentation links available\n </Typography>\n </Box>\n )}\n </InfoCard>\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAOO,MAAM,qBAAqB,MAAM;AACtC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,MAAA,GAAS,OAAO,YAAY,CAAA;AAClC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,SAAA,CAAU,iBAAiB,CAAA;AAErD,EAAA,MAAM,SAAY,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,uBAAuB,CAAA;AACvE,EAAA,MAAM,cAAiB,GAAA,MAAA,CAAO,QAAS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