@redocly/framework-plugin-apigee 0.1.0-next.0 → 0.1.0-next.10
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/CHANGELOG.md +194 -0
- package/README.md +6 -6
- package/lib/.tsbuildinfo +1 -1
- package/lib/client/ApigeeTemplate.d.ts +3 -1
- package/lib/client/ApigeeTemplate.js +1 -1
- package/lib/client/Primitives.d.ts +54 -32
- package/lib/client/Primitives.js +274 -126
- package/lib/client/api.d.ts +0 -1
- package/lib/client/api.js +1 -1
- package/lib/client/context.d.ts +3 -1
- package/lib/client/hooks.d.ts +7 -10
- package/lib/client/hooks.js +1 -1
- package/lib/client/queries.d.ts +28 -0
- package/lib/client/queries.js +1 -0
- package/lib/client/views/AdminView.d.ts +3 -0
- package/lib/client/views/AdminView.js +13 -18
- package/lib/client/views/AppsView.d.ts +7 -4
- package/lib/client/views/AppsView.js +1 -1
- package/lib/client/views/Dialogs.d.ts +10 -1
- package/lib/client/views/Dialogs.js +9 -1
- package/lib/client/views/TeamsView.d.ts +5 -7
- package/lib/client/views/TeamsView.js +1 -1
- package/lib/constants.d.ts +1 -1
- package/lib/constants.js +1 -1
- package/lib/contract.d.ts +13 -0
- package/lib/plugin.d.ts +1 -1
- package/lib/plugin.js +1 -1
- package/lib/server/service.d.ts +5 -2
- package/lib/server/service.js +1 -1
- package/package.json +7 -6
package/lib/client/Primitives.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useIsFetching as b}from"@tanstack/react-query";import{useEffect as u}from"react";import{useNavigate as y}from"react-router";import r,{keyframes as w}from"styled-components";import{Admonition as k}from"@redocly/theme/components/Admonition/Admonition";import{Breadcrumbs as z}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{Button as c}from"@redocly/theme/components/Button/Button";import{Link as T}from"@redocly/theme/components/Link/Link";import{SpinnerLoader as S}from"@redocly/theme/components/Loaders/SpinnerLoader";import{NavigationTab as L}from"@redocly/theme/components/NavigationTabs/NavigationTab";import{Portal as $}from"@redocly/theme/components/Portal/Portal";import{Tag as p}from"@redocly/theme/components/Tag/Tag";import{breakpoints as g}from"@redocly/theme/core/utils/media-css";import{CDNIcon as l}from"@redocly/theme/icons/CDNIcon/CDNIcon";const yr=r.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
max-width: 1200px;
|
|
4
4
|
margin: 0 auto;
|
|
@@ -6,14 +6,14 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
6
6
|
font-size: var(--font-size-base);
|
|
7
7
|
line-height: var(--line-height-base);
|
|
8
8
|
color: var(--text-color-primary);
|
|
9
|
-
`,
|
|
9
|
+
`,E=r.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: flex-start;
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
flex-wrap: wrap;
|
|
14
14
|
gap: var(--spacing-base);
|
|
15
15
|
margin-bottom: var(--spacing-lg);
|
|
16
|
-
`,
|
|
16
|
+
`,j=r.h1`
|
|
17
17
|
margin: 0;
|
|
18
18
|
font-size: var(--font-size-xl);
|
|
19
19
|
line-height: var(--line-height-xl);
|
|
@@ -21,59 +21,48 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
23
|
gap: var(--spacing-sm);
|
|
24
|
-
`,
|
|
24
|
+
`,D=r.p`
|
|
25
25
|
margin: var(--spacing-xxs) 0 0;
|
|
26
26
|
color: var(--text-color-description);
|
|
27
27
|
max-width: 720px;
|
|
28
|
-
`,
|
|
28
|
+
`,P=r.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
gap: var(--spacing-xs);
|
|
32
32
|
flex-wrap: wrap;
|
|
33
|
-
`;function
|
|
33
|
+
`;function R(){return b({queryKey:["apigee"],predicate:t=>t.state.data!==void 0})>0?e("span",{role:"status","aria-label":"Refreshing","data-testid":"apigee-refreshing",children:e(S,{color:"var(--text-color-description)",size:"14px"})}):null}function wr({title:a,description:t,actions:o}){return n(E,{children:[n("div",{children:[n(j,{children:[a,e(R,{})]}),t?e(D,{children:t}):null]}),o?e(P,{children:o}):null]})}const C=r.h2`
|
|
34
34
|
margin: 0 0 var(--spacing-sm);
|
|
35
35
|
font-size: var(--font-size-lg);
|
|
36
36
|
line-height: var(--line-height-lg);
|
|
37
37
|
font-weight: var(--font-weight-semibold);
|
|
38
|
-
`,
|
|
38
|
+
`,kr=r.section`
|
|
39
39
|
margin-top: var(--spacing-xl);
|
|
40
|
-
`,
|
|
40
|
+
`,zr=r.div`
|
|
41
41
|
display: flex;
|
|
42
42
|
align-items: center;
|
|
43
43
|
justify-content: space-between;
|
|
44
44
|
gap: var(--spacing-sm);
|
|
45
45
|
margin-bottom: var(--spacing-sm);
|
|
46
46
|
|
|
47
|
-
${
|
|
47
|
+
${C} {
|
|
48
48
|
margin: 0;
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
51
|
-
|
|
52
|
-
gap: var(--spacing-xxs);
|
|
53
|
-
border-bottom: 1px solid var(--border-color-secondary);
|
|
50
|
+
`,N=r.nav`
|
|
51
|
+
border-bottom: var(--navigation-tabs-bottom-border);
|
|
54
52
|
margin-bottom: var(--spacing-lg);
|
|
55
|
-
`,
|
|
56
|
-
display:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
text-decoration: none;
|
|
65
|
-
border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
|
|
66
|
-
|
|
67
|
-
&:hover {
|
|
68
|
-
color: var(--text-color-primary);
|
|
69
|
-
background: var(--layer-color-hover);
|
|
70
|
-
text-decoration: none;
|
|
71
|
-
}
|
|
72
|
-
`;function X({items:r,active:i}){return o(T,{"aria-label":"Sections",children:r.map(a=>t(S,{to:a.to,$active:a.key===i,"data-testid":`apigee-tab-${a.key}`,children:[a.icon?o(s,{name:a.icon,size:"16px"}):null,a.label,a.count!==void 0&&a.count>0?o(g,{color:"grey",children:a.count}):null]},a.key))})}const Y=e.div`
|
|
53
|
+
`,A=r.ul`
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: var(--navigation-tabs-gap);
|
|
56
|
+
height: var(--navigation-tabs-height);
|
|
57
|
+
margin: 0 0 calc(-1 * var(--navigation-tabs-border-width));
|
|
58
|
+
padding: 0;
|
|
59
|
+
overflow-x: auto;
|
|
60
|
+
scrollbar-width: none;
|
|
61
|
+
`;function Tr({items:a}){return e(N,{"aria-label":"Sections",children:e(A,{children:a.map(t=>e(L,{tab:t},t.link))})})}const B=r.div`
|
|
73
62
|
border: 1px solid var(--border-color-secondary);
|
|
74
63
|
border-radius: var(--border-radius-xl);
|
|
75
64
|
overflow-x: auto;
|
|
76
|
-
`,
|
|
65
|
+
`,I=r.table`
|
|
77
66
|
width: 100%;
|
|
78
67
|
border-collapse: collapse;
|
|
79
68
|
font-size: var(--font-size-base);
|
|
@@ -100,30 +89,241 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
100
89
|
background: var(--layer-color-hover);
|
|
101
90
|
}
|
|
102
91
|
|
|
92
|
+
tbody tr.link {
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
td.chevron {
|
|
97
|
+
width: 1%;
|
|
98
|
+
vertical-align: middle;
|
|
99
|
+
color: var(--text-color-description);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
td a {
|
|
103
|
+
color: var(--text-color-primary);
|
|
104
|
+
font-weight: var(--font-weight-medium);
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
103
108
|
td.actions,
|
|
104
109
|
th.actions {
|
|
110
|
+
position: sticky;
|
|
111
|
+
right: 0;
|
|
105
112
|
text-align: right;
|
|
106
113
|
white-space: nowrap;
|
|
107
114
|
width: 1%;
|
|
115
|
+
background: var(--bg-color);
|
|
116
|
+
box-shadow: inset 1px 0 0 var(--border-color-secondary);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
tbody tr:hover td.actions {
|
|
120
|
+
background: linear-gradient(var(--layer-color-hover), var(--layer-color-hover)), var(--bg-color);
|
|
108
121
|
}
|
|
109
122
|
|
|
110
123
|
td.key {
|
|
111
124
|
min-width: 260px;
|
|
112
125
|
}
|
|
113
|
-
|
|
126
|
+
|
|
127
|
+
@media (max-width: ${g.small}) {
|
|
128
|
+
thead {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
tbody,
|
|
133
|
+
tr,
|
|
134
|
+
td {
|
|
135
|
+
display: block;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
tr {
|
|
139
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
140
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
tbody tr:last-child {
|
|
144
|
+
border-bottom: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
td,
|
|
148
|
+
td.actions,
|
|
149
|
+
td.key {
|
|
150
|
+
position: static;
|
|
151
|
+
width: auto;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
padding: var(--spacing-xxs) 0;
|
|
154
|
+
border-bottom: none;
|
|
155
|
+
text-align: left;
|
|
156
|
+
white-space: normal;
|
|
157
|
+
background: none;
|
|
158
|
+
box-shadow: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
td[data-label]::before {
|
|
162
|
+
content: attr(data-label);
|
|
163
|
+
display: block;
|
|
164
|
+
font-size: var(--font-size-sm);
|
|
165
|
+
line-height: var(--line-height-sm);
|
|
166
|
+
color: var(--text-color-description);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
tbody tr:hover td,
|
|
170
|
+
tbody tr:hover td.actions {
|
|
171
|
+
background: none;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
td.actions:not(:empty) {
|
|
175
|
+
padding-top: var(--spacing-xs);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
tr {
|
|
179
|
+
position: relative;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
td.chevron {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
td.actions.menu {
|
|
187
|
+
position: absolute;
|
|
188
|
+
top: var(--spacing-xs);
|
|
189
|
+
right: var(--spacing-xs);
|
|
190
|
+
padding: 0;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
`,Sr=r(I)`
|
|
194
|
+
@media (max-width: ${g.small}) {
|
|
195
|
+
tr {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-wrap: wrap;
|
|
198
|
+
align-items: flex-start;
|
|
199
|
+
column-gap: var(--spacing-xs);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
tr::after {
|
|
203
|
+
content: '';
|
|
204
|
+
flex-basis: 100%;
|
|
205
|
+
order: 1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
td {
|
|
209
|
+
flex-basis: 100%;
|
|
210
|
+
order: 3;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
td:first-child {
|
|
214
|
+
flex: 1 1 0;
|
|
215
|
+
min-width: 0;
|
|
216
|
+
order: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
td.trail {
|
|
220
|
+
flex: none;
|
|
221
|
+
order: 1;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
td.meta,
|
|
225
|
+
td.actions {
|
|
226
|
+
flex: 0 1 auto;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
order: 2;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
td.meta {
|
|
232
|
+
font-size: var(--font-size-sm);
|
|
233
|
+
line-height: var(--line-height-sm);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
td.actions,
|
|
237
|
+
td.actions:not(:empty) {
|
|
238
|
+
margin-left: auto;
|
|
239
|
+
padding: 0;
|
|
240
|
+
align-self: center;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
td.optional {
|
|
244
|
+
display: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
td[data-label]::before {
|
|
248
|
+
content: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
td.meta[data-label]::before {
|
|
252
|
+
content: attr(data-label) ' ';
|
|
253
|
+
display: inline;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
td.meta:has(~ td.meta)::after {
|
|
257
|
+
content: '·';
|
|
258
|
+
margin-left: var(--spacing-xs);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
`;function Lr({to:a,testId:t,children:o}){const i=y();return e("tr",{className:"link","data-testid":t,onClick:s=>{s.target instanceof Element&&s.target.closest("a")||i(a)},children:o})}const W=r.span`
|
|
114
262
|
color: var(--text-color-description);
|
|
115
263
|
font-size: var(--font-size-sm);
|
|
116
264
|
line-height: var(--line-height-sm);
|
|
117
|
-
|
|
265
|
+
`,$r=r.code`
|
|
118
266
|
font-family: var(--font-family-monospaced);
|
|
119
267
|
font-size: var(--font-size-sm);
|
|
120
268
|
white-space: nowrap;
|
|
121
|
-
`,
|
|
269
|
+
`,Er=r.div`
|
|
122
270
|
display: flex;
|
|
123
271
|
align-items: center;
|
|
124
272
|
gap: var(--spacing-xs);
|
|
125
273
|
flex-wrap: wrap;
|
|
126
|
-
`,
|
|
274
|
+
`,F=r.div`
|
|
275
|
+
min-width: 140px;
|
|
276
|
+
`,jr=r.div`
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
flex-wrap: wrap;
|
|
280
|
+
gap: var(--spacing-xs);
|
|
281
|
+
margin-bottom: var(--spacing-sm);
|
|
282
|
+
|
|
283
|
+
> :first-child {
|
|
284
|
+
flex: 1 1 240px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
> :last-child:not(:first-child, ${F}) {
|
|
288
|
+
margin-left: auto;
|
|
289
|
+
}
|
|
290
|
+
`,M=r.div`
|
|
291
|
+
position: relative;
|
|
292
|
+
max-width: 420px;
|
|
293
|
+
|
|
294
|
+
> svg {
|
|
295
|
+
position: absolute;
|
|
296
|
+
top: 50%;
|
|
297
|
+
left: var(--spacing-sm);
|
|
298
|
+
transform: translateY(-50%);
|
|
299
|
+
pointer-events: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
> input {
|
|
303
|
+
padding-left: calc(var(--spacing-sm) + 22px);
|
|
304
|
+
}
|
|
305
|
+
`;function Dr({value:a,onChange:t,placeholder:o,testId:i}){return n(M,{children:[e(l,{name:"magnifying-glass",size:"14px",color:"var(--text-color-description)"}),e(J,{type:"search",value:a,onChange:s=>t(s.target.value),placeholder:o,"aria-label":o,"data-testid":i})]})}const _=w`
|
|
306
|
+
from { opacity: 1; }
|
|
307
|
+
50% { opacity: 0.45; }
|
|
308
|
+
to { opacity: 1; }
|
|
309
|
+
`,q=r.div`
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
gap: var(--spacing-base);
|
|
313
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
314
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
315
|
+
|
|
316
|
+
&:last-child {
|
|
317
|
+
border-bottom: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
> span {
|
|
321
|
+
height: 12px;
|
|
322
|
+
border-radius: var(--border-radius);
|
|
323
|
+
background: var(--layer-color-hover);
|
|
324
|
+
animation: ${_} 1.4s ease-in-out infinite;
|
|
325
|
+
}
|
|
326
|
+
`;function Pr({label:a,rows:t=4}){return e(B,{role:"status","aria-label":a,"data-testid":"apigee-skeleton",children:Array.from({length:t},(o,i)=>n(q,{children:[e("span",{style:{width:"28%"}}),e("span",{style:{width:"18%"}}),e("span",{style:{flex:1}}),e("span",{style:{width:"10%"}})]},i))})}const H=r.div`
|
|
127
327
|
display: flex;
|
|
128
328
|
flex-direction: column;
|
|
129
329
|
align-items: center;
|
|
@@ -132,7 +332,7 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
132
332
|
border: 1px dashed var(--border-color-primary);
|
|
133
333
|
border-radius: var(--border-radius-xl);
|
|
134
334
|
text-align: center;
|
|
135
|
-
`,
|
|
335
|
+
`,O=r.div`
|
|
136
336
|
width: 48px;
|
|
137
337
|
height: 48px;
|
|
138
338
|
display: grid;
|
|
@@ -140,18 +340,21 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
140
340
|
border: 1px solid var(--border-color-secondary);
|
|
141
341
|
border-radius: var(--border-radius-lg);
|
|
142
342
|
background: var(--layer-color);
|
|
143
|
-
`,
|
|
343
|
+
`,K=r.div`
|
|
144
344
|
font-weight: var(--font-weight-semibold);
|
|
145
|
-
`;function
|
|
345
|
+
`;function U({icon:a,title:t,text:o,action:i}){return n(H,{"data-testid":"apigee-empty",children:[e(O,{children:e(l,{name:a,size:"24px"})}),e(K,{children:t}),o?e(W,{style:{maxWidth:420},children:o}):null,i]})}function Rr({onClear:a}){return e(U,{icon:"magnifying-glass",title:"Nothing matches the filters",action:e(c,{variant:"outlined",onClick:a,children:"Clear filters"})})}const Cr=r.label`
|
|
146
346
|
display: flex;
|
|
147
347
|
flex-direction: column;
|
|
148
348
|
gap: var(--spacing-xxs);
|
|
149
349
|
font-size: var(--font-size-base);
|
|
150
|
-
`,
|
|
350
|
+
`,Y=r.span`
|
|
151
351
|
font-weight: var(--font-weight-medium);
|
|
152
352
|
color: var(--text-color-secondary);
|
|
153
353
|
font-size: var(--font-size-sm);
|
|
154
|
-
`,
|
|
354
|
+
`,G=r.span`
|
|
355
|
+
margin-left: var(--spacing-xxs);
|
|
356
|
+
color: var(--schema-required-color);
|
|
357
|
+
`;function Nr({children:a}){return n(Y,{children:[a,e(G,{"aria-hidden":"true",children:"*"})]})}const v=`
|
|
155
358
|
width: 100%;
|
|
156
359
|
box-sizing: border-box;
|
|
157
360
|
padding: 5px var(--spacing-sm);
|
|
@@ -174,26 +377,24 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
174
377
|
&::placeholder {
|
|
175
378
|
color: var(--text-color-disabled);
|
|
176
379
|
}
|
|
177
|
-
`,
|
|
178
|
-
${
|
|
179
|
-
`,
|
|
180
|
-
${
|
|
380
|
+
`,J=r.input`
|
|
381
|
+
${v}
|
|
382
|
+
`,Ar=r.textarea`
|
|
383
|
+
${v}
|
|
181
384
|
min-height: 72px;
|
|
182
385
|
resize: vertical;
|
|
183
|
-
`,
|
|
184
|
-
${c}
|
|
185
|
-
`,dr=e.div`
|
|
386
|
+
`,Br=r.div`
|
|
186
387
|
display: flex;
|
|
187
388
|
flex-direction: column;
|
|
188
389
|
gap: var(--spacing-xs);
|
|
189
|
-
`,
|
|
390
|
+
`,Ir=r.label`
|
|
190
391
|
display: flex;
|
|
191
392
|
align-items: flex-start;
|
|
192
393
|
gap: var(--spacing-sm);
|
|
193
394
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
194
|
-
border: 1px solid ${({$checked:
|
|
395
|
+
border: 1px solid ${({$checked:a})=>a?"var(--input-border-color-hover)":"var(--border-color-secondary)"};
|
|
195
396
|
border-radius: var(--border-radius-lg);
|
|
196
|
-
background: ${({$checked:
|
|
397
|
+
background: ${({$checked:a})=>a?"var(--layer-color)":"transparent"};
|
|
197
398
|
cursor: pointer;
|
|
198
399
|
|
|
199
400
|
input {
|
|
@@ -205,12 +406,12 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
205
406
|
border-color: var(--input-border-color-hover);
|
|
206
407
|
background: var(--layer-color);
|
|
207
408
|
}
|
|
208
|
-
`,
|
|
409
|
+
`,Wr=r.span`
|
|
209
410
|
display: flex;
|
|
210
411
|
align-items: center;
|
|
211
412
|
gap: var(--spacing-xs);
|
|
212
413
|
font-weight: var(--font-weight-medium);
|
|
213
|
-
`,
|
|
414
|
+
`,Q=r.div`
|
|
214
415
|
position: fixed;
|
|
215
416
|
inset: 0;
|
|
216
417
|
background: var(--bg-color-modal-overlay);
|
|
@@ -219,9 +420,9 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
219
420
|
align-items: center;
|
|
220
421
|
justify-content: center;
|
|
221
422
|
padding: var(--spacing-base);
|
|
222
|
-
`,
|
|
423
|
+
`,V=r.div`
|
|
223
424
|
width: 100%;
|
|
224
|
-
max-width: ${({$wide:
|
|
425
|
+
max-width: ${({$wide:a})=>a?"640px":"480px"};
|
|
225
426
|
max-height: calc(100vh - 64px);
|
|
226
427
|
display: flex;
|
|
227
428
|
flex-direction: column;
|
|
@@ -231,40 +432,39 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
231
432
|
box-shadow: var(--modal-box-shadow);
|
|
232
433
|
overflow: hidden;
|
|
233
434
|
font-family: var(--font-family-base);
|
|
234
|
-
`,
|
|
435
|
+
`,X=r.div`
|
|
235
436
|
display: flex;
|
|
236
437
|
align-items: center;
|
|
237
438
|
justify-content: space-between;
|
|
238
439
|
gap: var(--spacing-sm);
|
|
239
440
|
padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
|
|
240
|
-
`,
|
|
441
|
+
`,Z=r.h2`
|
|
241
442
|
margin: 0;
|
|
242
443
|
font-size: var(--font-size-lg);
|
|
243
444
|
line-height: var(--line-height-lg);
|
|
244
445
|
font-weight: var(--font-weight-semibold);
|
|
245
|
-
`,
|
|
446
|
+
`,rr=r.div`
|
|
246
447
|
display: flex;
|
|
247
448
|
flex-direction: column;
|
|
248
449
|
gap: var(--spacing-base);
|
|
249
450
|
padding: 0 var(--spacing-lg) var(--spacing-md);
|
|
250
451
|
overflow-y: auto;
|
|
251
|
-
`,
|
|
452
|
+
`,er=r.div`
|
|
252
453
|
display: flex;
|
|
253
454
|
justify-content: flex-end;
|
|
254
455
|
gap: var(--spacing-xs);
|
|
255
456
|
padding: var(--spacing-base) var(--spacing-lg);
|
|
256
457
|
border-top: 1px solid var(--border-color-secondary);
|
|
257
|
-
`;function
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
`;function gr({tone:r="info",children:i}){const a=r==="danger"?"circle-xmark":r==="warning"?"triangle-exclamation":r==="success"?"circle-check":"circle-info";return t(C,{$tone:r,role:r==="danger"?"alert":"status","data-testid":`apigee-notice-${r}`,children:[o(s,{name:a,size:"18px",style:{flexShrink:0,marginTop:2}}),o("div",{children:i})]})}const H={approved:"green",pending:"orange",revoked:"red"},N={approved:"Approved",pending:"Pending approval",revoked:"Revoked"};function vr({status:r,label:i}){return o(g,{color:H[r],children:i??N[r]})}const xr=e.dl`
|
|
458
|
+
`;function Fr({title:a,open:t,onClose:o,children:i,footer:s,wide:x,testId:h}){return u(()=>{if(!t)return;const d=f=>{f.key==="Escape"&&o()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t,o]),t?e($,{children:e(Q,{onMouseDown:d=>d.target===d.currentTarget&&o(),children:n(V,{role:"dialog","aria-modal":"true",$wide:x,"data-testid":h,children:[n(X,{children:[e(Z,{children:a}),e(c,{variant:"text",size:"small",onClick:o,"aria-label":"Close",icon:e(l,{name:"xmark",size:"16px"})})]}),e(rr,{children:i}),s?e(er,{children:s}):null]})})}):null}const ar=r.div`
|
|
459
|
+
--admonition-margin: 0;
|
|
460
|
+
`;function Mr({tone:a="info",children:t}){return e(ar,{role:a==="danger"?"alert":"status","data-testid":`apigee-notice-${a}`,children:e(k,{type:a,children:t})})}const m={approved:"green",pending:"orange",revoked:"red"},tr={approved:"Approved",pending:"Pending approval",revoked:"Revoked"},or=r(T)`
|
|
461
|
+
display: inline-flex;
|
|
462
|
+
text-decoration: none;
|
|
463
|
+
|
|
464
|
+
&:hover {
|
|
465
|
+
text-decoration: none;
|
|
466
|
+
}
|
|
467
|
+
`;function _r({status:a}){return e(p,{color:m[a],children:tr[a]})}function qr({name:a,status:t,to:o}){const i=e(p,{color:m[t],variant:"outline",selectable:!!o,children:a});return o?e(or,{to:o,children:i}):i}const Hr=r.dl`
|
|
268
468
|
display: grid;
|
|
269
469
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
270
470
|
gap: var(--spacing-base);
|
|
@@ -297,12 +497,12 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
297
497
|
flex-wrap: wrap;
|
|
298
498
|
overflow-wrap: anywhere;
|
|
299
499
|
}
|
|
300
|
-
`,
|
|
500
|
+
`,Or=r.div`
|
|
301
501
|
display: flex;
|
|
302
502
|
gap: var(--spacing-base);
|
|
303
503
|
flex-wrap: wrap;
|
|
304
504
|
margin-bottom: var(--spacing-lg);
|
|
305
|
-
`,
|
|
505
|
+
`,Kr=r.div`
|
|
306
506
|
flex: 1 1 160px;
|
|
307
507
|
padding: var(--spacing-base) var(--spacing-md);
|
|
308
508
|
border: 1px solid var(--border-color-secondary);
|
|
@@ -315,58 +515,6 @@ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useEffect as b}from"rea
|
|
|
315
515
|
line-height: var(--line-height-xl);
|
|
316
516
|
font-weight: var(--font-weight-semibold);
|
|
317
517
|
}
|
|
318
|
-
`,
|
|
319
|
-
padding: var(--spacing-xl);
|
|
320
|
-
text-align: center;
|
|
321
|
-
color: var(--text-color-description);
|
|
322
|
-
`,hr=e.div`
|
|
323
|
-
display: grid;
|
|
324
|
-
grid-template-columns: 280px minmax(0, 1fr);
|
|
325
|
-
gap: var(--spacing-xl);
|
|
326
|
-
align-items: start;
|
|
327
|
-
|
|
328
|
-
@media (max-width: 960px) {
|
|
329
|
-
grid-template-columns: 1fr;
|
|
330
|
-
}
|
|
331
|
-
`,ur=e.div`
|
|
332
|
-
display: flex;
|
|
333
|
-
align-items: center;
|
|
334
|
-
justify-content: space-between;
|
|
335
|
-
padding: 0 var(--spacing-sm) var(--spacing-xs);
|
|
336
|
-
font-size: var(--font-size-sm);
|
|
337
|
-
font-weight: var(--font-weight-medium);
|
|
338
|
-
color: var(--text-color-secondary);
|
|
339
|
-
`,yr=e(p)`
|
|
340
|
-
display: flex;
|
|
341
|
-
align-items: center;
|
|
342
|
-
justify-content: space-between;
|
|
343
|
-
gap: var(--spacing-xs);
|
|
344
|
-
padding: var(--spacing-xs) var(--spacing-sm);
|
|
345
|
-
border-radius: var(--border-radius-lg);
|
|
346
|
-
color: var(--text-color-primary);
|
|
347
|
-
text-decoration: none;
|
|
348
|
-
background: ${({$active:r})=>r?"var(--layer-color-active)":"transparent"};
|
|
349
|
-
font-weight: ${({$active:r})=>r?"var(--font-weight-medium)":"var(--font-weight-regular)"};
|
|
350
|
-
|
|
351
|
-
&:hover {
|
|
352
|
-
background: var(--layer-color-hover);
|
|
353
|
-
text-decoration: none;
|
|
354
|
-
}
|
|
355
|
-
`,wr=e.span`
|
|
356
|
-
width: 8px;
|
|
357
|
-
height: 8px;
|
|
358
|
-
border-radius: 50%;
|
|
359
|
-
flex-shrink: 0;
|
|
360
|
-
background: ${({$color:r})=>r==="green"?"var(--color-success-base)":r==="orange"?"var(--color-warning-base)":r==="red"?"var(--color-error-base)":"var(--text-color-disabled)"};
|
|
361
|
-
`,zr=e.nav`
|
|
362
|
-
display: flex;
|
|
363
|
-
align-items: center;
|
|
364
|
-
gap: var(--spacing-xs);
|
|
518
|
+
`,Ur=r(z)`
|
|
365
519
|
margin-bottom: var(--spacing-sm);
|
|
366
|
-
|
|
367
|
-
color: var(--text-color-description);
|
|
368
|
-
|
|
369
|
-
a {
|
|
370
|
-
color: inherit;
|
|
371
|
-
}
|
|
372
|
-
`;export{zr as Breadcrumb,cr as CheckItem,lr as CheckItemTitle,dr as CheckList,pr as Dialog,wr as Dot,ar as EmptyState,or as Field,ir as FieldLabel,tr as Input,yr as ListItem,ur as ListTitle,fr as Loading,rr as Mono,$ as Muted,sr as NativeSelect,gr as Notice,xr as Overview,G as Page,J as PageHeader,er as Row,Q as Section,V as SectionHeader,k as SectionTitle,hr as SplitLayout,br as Stat,mr as Stats,vr as StatusTag,Z as Table,Y as TableWrap,X as Tabs,nr as Textarea};
|
|
520
|
+
`;export{Ir as CheckItem,Wr as CheckItemTitle,Br as CheckList,Fr as Dialog,U as EmptyState,Cr as Field,Y as FieldLabel,F as FilterSlot,J as Input,Lr as LinkTableRow,Pr as ListSkeleton,Sr as ListTable,$r as Mono,W as Muted,Rr as NoMatches,Mr as Notice,Hr as Overview,yr as Page,Ur as PageBreadcrumbs,wr as PageHeader,qr as ProductTag,Nr as RequiredLabel,Er as Row,Dr as SearchField,kr as Section,zr as SectionHeader,C as SectionTitle,Kr as Stat,Or as Stats,_r as StatusTag,I as Table,B as TableWrap,Tr as Tabs,Ar as Textarea,jr as Toolbar};
|
package/lib/client/api.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare const apigeeApi: {
|
|
|
15
15
|
deleteKey: (appId: string, consumerKey: string, teamId?: string) => Promise<void>;
|
|
16
16
|
listTeams: () => Promise<Team[]>;
|
|
17
17
|
createTeam: (input: TeamInput) => Promise<Team>;
|
|
18
|
-
getTeam: (teamId: string) => Promise<Team>;
|
|
19
18
|
updateTeam: (teamId: string, input: TeamInput) => Promise<Team>;
|
|
20
19
|
deleteTeam: (teamId: string) => Promise<void>;
|
|
21
20
|
addMember: (teamId: string, input: TeamMemberInput) => Promise<Team>;
|
package/lib/client/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=function(e,n,t,i){function
|
|
1
|
+
var b=function(e,n,t,i){function p(d){return d instanceof t?d:new t(function(r){r(d)})}return new(t||(t=Promise))(function(d,r){function u(m){try{l(i.next(m))}catch(f){r(f)}}function h(m){try{l(i.throw(m))}catch(f){r(f)}}function l(m){m.done?d(m.value):p(m.value).then(u,h)}l((i=i.apply(e,n||[])).next())})};import{withPathPrefix as j}from"@redocly/theme/core/utils";import{APIGEE_ROUTES as o}from"../constants.js";class y extends Error{constructor(n,t){super(t),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ApiRequestError"})}}function s(e,n,t){let i=e;for(const[r,u]of Object.entries(n))i=i.replace(`:${r}`,encodeURIComponent(u));const p=new URLSearchParams;for(const[r,u]of Object.entries(t??{}))u!==void 0&&u!==""&&p.set(r,u);const d=p.toString();return j(d?`${i}?${d}`:i)}function a(e){return b(this,arguments,void 0,function*(n,t={}){var i;const p=yield fetch(n,Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({Accept:"application/json"},t.json!==void 0?{"Content-Type":"application/json"}:{}),(i=t.headers)!==null&&i!==void 0?i:{}),body:t.json!==void 0?JSON.stringify(t.json):t.body}));if(p.status===204)return;const d=yield p.text();let r=null;try{r=d?JSON.parse(d):null}catch{r=null}if(!p.ok){const u=r&&typeof r=="object"&&typeof r.error=="string"?r.error:`Request failed with ${p.status}`;throw new y(p.status,u)}return r})}const c=e=>({team:e}),O={meta:()=>a(s(o.meta,{})),listApps:()=>a(s(o.apps,{})),createApp:e=>a(s(o.apps,{}),{method:"POST",json:e}),updateApp:(e,n,t)=>a(s(o.app,{appId:e},c(t)),{method:"PUT",json:n}),deleteApp:(e,n)=>a(s(o.app,{appId:e},c(n)),{method:"DELETE"}),createKey:(e,n,t)=>a(s(o.appKeys,{appId:e},c(t)),{method:"POST",json:n}),updateKey:(e,n,t,i)=>a(s(o.appKey,{appId:e,consumerKey:n},c(i)),{method:"PUT",json:t}),deleteKey:(e,n,t)=>a(s(o.appKey,{appId:e,consumerKey:n},c(t)),{method:"DELETE"}),listTeams:()=>a(s(o.teams,{})),createTeam:e=>a(s(o.teams,{}),{method:"POST",json:e}),updateTeam:(e,n)=>a(s(o.team,{teamId:e}),{method:"PUT",json:n}),deleteTeam:e=>a(s(o.team,{teamId:e}),{method:"DELETE"}),addMember:(e,n)=>a(s(o.teamMembers,{teamId:e}),{method:"POST",json:n}),setMemberRole:(e,n,t)=>a(s(o.teamMember,{teamId:e,email:n}),{method:"PUT",json:{role:t}}),removeMember:(e,n)=>a(s(o.teamMember,{teamId:e,email:n}),{method:"DELETE"}),adminRequests:()=>a(s(o.adminRequests,{})),adminDecide:(e,n,t)=>a(s(n==="approve"?o.adminRequestApprove:o.adminRequestRevoke,{requestId:e}),{method:"POST",json:t?{note:t}:{}}),adminApps:()=>a(s(o.adminApps,{})),adminAudit:()=>a(s(o.adminAudit,{}))};export{y as ApiRequestError,O as apigeeApi};
|
package/lib/client/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApigeeMeta } from '../contract.js';
|
|
1
|
+
import type { ApigeeMeta, App } from '../contract.js';
|
|
2
2
|
export type ApigeeContextValue = {
|
|
3
3
|
meta: ApigeeMeta;
|
|
4
4
|
/** The apps page slug, without the site path prefix: router links add it. */
|
|
@@ -7,6 +7,8 @@ export type ApigeeContextValue = {
|
|
|
7
7
|
title: string;
|
|
8
8
|
/** A site-relative link under the apps page. */
|
|
9
9
|
link: (path?: string, query?: Record<string, string | undefined>) => string;
|
|
10
|
+
/** The link to an app's page; a team app carries its team, since app names are unique per owner. */
|
|
11
|
+
appLink: (app: App) => string;
|
|
10
12
|
};
|
|
11
13
|
export declare const ApigeeContext: import("react").Context<ApigeeContextValue | null>;
|
|
12
14
|
export declare function useApigee(): ApigeeContextValue;
|
package/lib/client/hooks.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export type AsyncState<T> = {
|
|
2
|
-
data: T | null;
|
|
3
|
-
error: string | null;
|
|
4
|
-
loading: boolean;
|
|
5
|
-
reload: () => void;
|
|
6
|
-
/** Replaces the loaded value without a round trip, after a mutation returned the new state. */
|
|
7
|
-
setData: (value: T | null) => void;
|
|
8
|
-
};
|
|
9
|
-
/** Loads `load()` on mount and whenever `key` changes; the last request wins. */
|
|
10
|
-
export declare function useAsync<T>(load: () => Promise<T>, key: string): AsyncState<T>;
|
|
11
1
|
export type MutationState = {
|
|
12
2
|
pending: boolean;
|
|
13
3
|
error: string | null;
|
|
@@ -16,6 +6,13 @@ export type MutationState = {
|
|
|
16
6
|
};
|
|
17
7
|
/** Runs one mutation at a time and keeps its error for the form that started it. */
|
|
18
8
|
export declare function useMutation(): MutationState;
|
|
9
|
+
export declare function errorMessage(error: unknown): string;
|
|
10
|
+
/** A list filter kept in the query string, so Back returns to the same filtered list. */
|
|
11
|
+
export declare function useSearchParam(name: string): [string, (value: string) => void];
|
|
12
|
+
/** A list's search text, kept per page for the browser session and out of the URL, so typing adds no page views. */
|
|
13
|
+
export declare function useSearchText(): [string, (value: string) => void];
|
|
14
|
+
/** Whether any of `values` contains the search text, ignoring case; an empty search matches all. */
|
|
15
|
+
export declare function matches(search: string, ...values: (string | undefined)[]): boolean;
|
|
19
16
|
export declare function formatDate(value: number | null | undefined): string;
|
|
20
17
|
export declare function formatDateTime(value: number | null | undefined): string;
|
|
21
18
|
export declare function copyText(text: string): Promise<boolean>;
|
package/lib/client/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var l=function(t,n,r,e){function i(o){return o instanceof r?o:new r(function(u){u(o)})}return new(r||(r=Promise))(function(o,u){function c(a){try{f(e.next(a))}catch(d){u(d)}}function p(a){try{f(e.throw(a))}catch(d){u(d)}}function f(a){a.done?o(a.value):i(a.value).then(c,p)}f((e=e.apply(t,n||[])).next())})};import{useCallback as s,useReducer as x,useState as m}from"react";import{useLocation as y,useSearchParams as w}from"react-router";import{ApiRequestError as g}from"./api.js";function D(){const[t,n]=m(!1),[r,e]=m(null),i=s(u=>l(this,void 0,void 0,function*(){n(!0),e(null);try{return yield u()}catch(c){e(S(c));return}finally{n(!1)}}),[]),o=s(()=>e(null),[]);return{pending:t,error:r,clearError:o,run:i}}function S(t){return t instanceof g||t instanceof Error?t.message:String(t)}function T(t){var n;const[r,e]=w(),i=s(o=>e(u=>{const c=new URLSearchParams(u);return o?c.set(t,o):c.delete(t),c},{replace:!0}),[t,e]);return[(n=r.get(t))!==null&&n!==void 0?n:"",i]}const h=new Map;function E(){var t;const{pathname:n}=y(),[,r]=x(i=>i+1,0),e=s(i=>{h.set(n,i),r()},[n]);return[(t=h.get(n))!==null&&t!==void 0?t:"",e]}function C(t,...n){const r=t.trim().toLowerCase();return!r||n.some(e=>e?.toLowerCase().includes(r))}function M(t){return t?new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"\u2014"}function P(t){return t?new Date(t).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}function R(t){return l(this,void 0,void 0,function*(){try{return yield navigator.clipboard.writeText(t),!0}catch{return!1}})}export{R as copyText,S as errorMessage,M as formatDate,P as formatDateTime,C as matches,D as useMutation,T as useSearchParam,E as useSearchText};
|