@redocly/revel 0.139.0-next.6 → 0.139.0-next.7
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 +14 -0
- package/dist/client/app/Sidebar/RequestAccessButton.js +2 -2
- package/dist/server/plugins/dev-onboarding/api/routes/index.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/App.js +4 -4
- package/dist/server/plugins/dev-onboarding/template/AppsList.js +7 -7
- package/dist/server/plugins/dev-onboarding/template/CreateAppDialog.js +3 -3
- package/dist/server/plugins/dev-onboarding/template/components/ApiKeyItem.js +4 -4
- package/dist/server/plugins/dev-onboarding/template/components/ApiLogDetails.js +7 -7
- package/dist/server/plugins/dev-onboarding/template/components/ApiLogs.js +5 -5
- package/dist/server/plugins/dev-onboarding/template/components/ApiLogsActions.js +6 -6
- package/dist/server/plugins/dev-onboarding/template/components/ApisList.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/CreateApiKey.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/DeleteAppDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditApis.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditAppDescriptionDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditAppDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/EditCallbackUrlDialog.js +1 -1
- package/dist/server/plugins/dev-onboarding/template/components/RevokeAPIKey.js +5 -5
- package/dist/server/plugins/dev-onboarding/template/components/RollAPIKey.js +5 -5
- package/dist/server/plugins/dev-onboarding/template/components/UpdateApiKey.js +1 -1
- package/dist/server/plugins/mcp/codemode/prompts.d.ts +0 -1
- package/dist/server/plugins/mcp/codemode/prompts.js +3 -3
- package/dist/server/plugins/mcp/constants.d.ts +0 -2
- package/dist/server/plugins/mcp/constants.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/endpoint-suggestions.d.ts +0 -2
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/endpoint-suggestions.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/eligibility.d.ts +1 -12
- package/dist/server/plugins/mcp/gateway-mcp/eligibility.js +1 -1
- package/dist/server/plugins/mcp/handlers/errors.d.ts +0 -2
- package/dist/server/plugins/mcp/handlers/errors.js +1 -1
- package/dist/server/plugins/mcp/utils.d.ts +0 -8
- package/dist/server/plugins/mcp/utils.js +1 -1
- package/dist/utils/url/api-keys-url.d.ts +11 -0
- package/dist/utils/url/api-keys-url.js +1 -0
- package/package.json +5 -5
- package/dist/server/plugins/mcp/docs-mcp/tools/core/utils.d.ts +0 -3
- package/dist/server/plugins/mcp/docs-mcp/tools/core/utils.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @redocly/revel
|
|
2
2
|
|
|
3
|
+
## 0.139.0-next.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fec5c6c2bdd: Fixed an issue where hovering anywhere in a numbered-list item replaced its number or icon with a link icon.
|
|
8
|
+
- 1b2d2cd0851: Updated `@redocly/openapi-core` to version `2.64.0`.
|
|
9
|
+
- Updated dependencies [c5e11a6d4ff]
|
|
10
|
+
- Updated dependencies [fec5c6c2bdd]
|
|
11
|
+
- Updated dependencies [1b2d2cd0851]
|
|
12
|
+
- Updated dependencies [204627e1fd0]
|
|
13
|
+
- @redocly/api-docs@0.4.0-next.7
|
|
14
|
+
- @redocly/theme@0.71.0-next.4
|
|
15
|
+
- @redocly/portal-plugin-mock-server@0.24.0-next.1
|
|
16
|
+
|
|
3
17
|
## 0.139.0-next.6
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import n,{useEffect as
|
|
1
|
+
import n,{useEffect as C,useState as a}from"react";import I from"styled-components";import{Button as N}from"@redocly/theme/components/Button/Button";import{Admonition as y}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{withPathPrefix as c,getBaseDataAttributes as q}from"@redocly/theme/core/utils";import{usePageData as w}from"../hooks/usePageData";import{usePreloadHistory as b}from"../usePreloadHistory";import{telemetry as k}from"../telemetry/index.js";import{useLoginUrl as x}from"../hooks";import{apiKeysUrl as R}from"../../../utils/url/api-keys-url";const j=e=>{const{apiId:s,status:t,setStatus:i}=e,u=b(),{userData:r}=w("userData")||{},l=x(),[p,m]=a(),[A,g]=a(),[d,E]=a(!0);C(()=>{r?.isAuthenticated&&fetch(R(`/api-products/${s}/access`)).then(f=>f.json().then(o=>{f.ok?(i(o.status),g(o.appId)):m(o.message)}).catch(()=>m("Something went wrong")).finally(()=>E(!1)))},[r?.isAuthenticated,s,i]);const P=()=>{!r?.isAuthenticated&&l?window.location.href=c(l):t==="ACCEPTED"?u.push(c("/apps/"+(A||""))):t==="NONE"&&u.push(c("/apps/?createApp&apiId="+s)),k.sendRequestApiAccessClickedMessage([q("requestApiAccess","button")])},D=(t==="PENDING"||d||p!=null)&&r?.isAuthenticated;return n.createElement(n.Fragment,null,n.createElement(N,{disabled:D,onClick:P,fullWidth:!0,size:"small"},B(t,d,p,!!r?.isAuthenticated)))},B=(e,s,t,i)=>{if(!i)return"Request access";if(s)return"Loading...";if(t)return"Failed to check access";switch(e){case"NONE":return"Request access";case"ACCEPTED":return"Credentials";case"PENDING":return"Pending access..."}return null},z=e=>e==="ACCEPTED"?n.createElement(h,{type:"success",name:"You have access to this API"}):e==="PENDING"?n.createElement(h,{type:"info",name:"You have requested access to this API"}):null,h=I(y)`
|
|
2
2
|
margin-top: 0px;
|
|
3
3
|
margin-bottom: var(--spacing-sm);
|
|
4
|
-
`;export{
|
|
4
|
+
`;export{j as RequestAccessButton,z as renderAdmonition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requireAuthMiddleware as
|
|
1
|
+
import{requireAuthMiddleware as i}from"../middlewares/auth.js";import{integrationsMiddleware as l}from"../middlewares/integrations.js";import{listApps as g,createApp as c,getApp as n,createCredential as o,updateCredential as m,deleteCredential as f,deleteApp as A,updateApp as r,getLogs as C,getLogDetails as b}from"./apps.js";import{getMeta as u}from"./meta.js";import{getApiAccessStatus as I,listApiProducts as M}from"./products.js";import{apiKeysUrl as t}from"../../../../../utils/url/api-keys-url.js";function h(p,e){const a=e.getConfig().developerOnboarding?.adapters||[],d=e.getConfig().access?.rbac||{},s=e.globalData.apiProducts||{};a&&(p.get(t("/meta"),i(),u(e)),p.get(t("/apps"),i(),l(a,s,d),g(e)),p.post(t("/apps"),i(),l(a,s,d),c(e)),p.get(t("/apps/:id"),i(),l(a,s,d),n(e)),p.put(t("/apps/:id"),i(),l(a,s,d),r(e)),p.delete(t("/apps/:id"),i(),l(a,s,d),A(e)),p.post(t("/apps/:id/credentials"),i(),l(a,s,d),o(e)),p.put(t("/apps/:id/credentials/:credentialId"),i(),l(a,s,d),m(e)),p.delete(t("/apps/:id/credentials/:credentialId"),i(),l(a,s,d),f(e)),p.get(t("/apps/:id/logs/:logId"),i(),l(a,s,d),b()),p.get(t("/apps/:id/logs"),i(),l(a,s,d),C()),p.get(t("/api-products"),i(),l(a,s,d),M(e)),p.get(t("/api-products/:id/access"),i(),l(a,s,d),I()))}export{h as installRoutes};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import*as e from"react";import i from"styled-components";import{useQuery as v}from"@tanstack/react-query";import{useParams as x}from"react-router";import{Box as y,Flex as E}from"@redocly/portal-legacy-ui";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTabList as w}from"@redocly/theme/core/hooks";import{useTranslate as T}from"../../../../client/app/hooks";import C from"../../../../client/app/CircularProgress";import{Container as P}from"./components/Container";import
|
|
1
|
+
import*as e from"react";import i from"styled-components";import{useQuery as v}from"@tanstack/react-query";import{useParams as x}from"react-router";import{Box as y,Flex as E}from"@redocly/portal-legacy-ui";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTabList as w}from"@redocly/theme/core/hooks";import{useTranslate as T}from"../../../../client/app/hooks";import C from"../../../../client/app/CircularProgress";import{Container as P}from"./components/Container";import I from"./components/AppOverview";import k from"./components/ApiKeys";import L from"./components/ApiLogs";import _ from"./components/CreateApiKey";import{Description as B}from"./components/Description";import{CallbackUrl as K}from"./components/CallbackUrl";import{apiKeysUrl as S}from"../../../../utils/url/api-keys-url";const z="app-tab-actions-portal",m="api_keys",D="logs";function F(q){const{id:s}=x(),{isLoading:p,error:l,data:t}=v({queryKey:["APP:"+s],queryFn:()=>fetch(S(`/apps/${s}`)).then(r=>r.json())}),{translate:c}=T(),d=r=>a.findIndex(o=>o.id===r),a=[{id:m,name:c("dev.main.tab.appKeys","API keys"),content:e.createElement(e.Fragment,null,e.createElement(k,{credentials:t?.credentials,attributes:t?.attributes}),e.createElement(B,{text:t?.description}),t?.callbackUrl!==void 0&&e.createElement(K,{text:t.callbackUrl})),show:!0},{id:D,name:c("dev.main.tab.logs","Logs"),content:e.createElement(L,null),show:!!t?.supportsLogs}].filter(r=>r.show),[n,g]=e.useState(0),{tabListProps:u,getTabProps:b,getTabPanelProps:f}=w({count:a.length,activeIndex:n,onChange:g}),h=t?.canCreateKey&&n===d(m);return e.createElement(y,{my:"2rem"},e.createElement(P,null,p?e.createElement(E,{justifyContent:"center",mt:"2em"},e.createElement(C,null)):l?e.createElement(A,{type:"danger"},l?.message??"Something went wrong"):t?e.createElement(e.Fragment,null,e.createElement(I,{app:t}),e.createElement(O,null,e.createElement(U,{...u},a.map(({name:r},o)=>e.createElement("span",{key:r,className:n===o?"active":"",...b(o)},r))),e.createElement("div",{id:z}),h&&e.createElement(_,{initialEnabledApis:(t.credentials||[]).flatMap(r=>r.apiProductIds||[])})),e.createElement(j,{...f(n)},a[n].content)):null))}const ae=i.i`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
width: 12px;
|
|
4
4
|
height: 12px;
|
|
5
5
|
background-repeat: no-repeat;
|
|
6
6
|
background-size: 12px 12px;
|
|
7
7
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 451.847 451.847' width='12px' height='12px' %3E%3Cpath d='M225.923 354.706c-8.098 0-16.195-3.092-22.369-9.263L9.27 151.157c-12.359-12.359-12.359-32.397 0-44.751 12.354-12.354 32.388-12.354 44.748 0l171.905 171.915 171.906-171.909c12.359-12.354 32.391-12.354 44.744 0 12.365 12.354 12.365 32.392 0 44.751L248.292 345.449c-6.177 6.172-14.274 9.257-22.369 9.257z' /%3E%3C/svg%3E");
|
|
8
|
-
`,
|
|
8
|
+
`,O=i.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
align-items: end;
|
|
12
|
-
`,
|
|
12
|
+
`,U=i.div`
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
height: 42px;
|
|
@@ -29,4 +29,4 @@ import*as e from"react";import i from"styled-components";import{useQuery as v}fr
|
|
|
29
29
|
}
|
|
30
30
|
`,j=i.div`
|
|
31
31
|
margin-top: var(--spacing-base);
|
|
32
|
-
`;export{ae as ArrowIcon,
|
|
32
|
+
`;export{ae as ArrowIcon,z as TAB_ACTIONS_PORTAL_ID,F as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import*as e from"react";import{useQuery as u}from"@tanstack/react-query";import
|
|
1
|
+
import*as e from"react";import{useQuery as u}from"@tanstack/react-query";import o from"styled-components";import{Outlet as g,useLocation as h,useNavigate as v,useParams as y}from"react-router";import{Flex as x}from"@redocly/portal-legacy-ui";import{Button as w}from"@redocly/theme/components/Button/Button";import{Sidebar as E}from"@redocly/theme/components/Sidebar/Sidebar";import{Admonition as b}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{MenuItem as P}from"@redocly/theme/components/Menu/MenuItem";import{AddIcon as A}from"@redocly/theme/icons/AddIcon/AddIcon";import{useTranslate as C}from"../../../../client/app/hooks";import k from"../../../../client/app/CircularProgress";import{loadAndNavigate as f}from"../../../../client/app/utils/loadAndNavigate";import S from"./components/icons/PlaceholderIcon";import{ButtonWithLoading as L}from"./components/ButtonWithLoading";import{CreateAppDialog as I}from"./CreateAppDialog";import{apiKeysUrl as j}from"../../../../utils/url/api-keys-url";function z(){const{id:n}=y(),s=v(),p=h(),i=e.useRef(null),{translate:a}=C(),{data:r,isLoading:m,isRefetching:l,error:c}=u({refetchOnWindowFocus:!1,queryKey:["APPS"],queryFn:()=>fetch(j("/apps")).then(t=>t.json().then(d=>t.ok?Promise.resolve(d):Promise.reject(d)))});return e.useEffect(()=>{const t=m||l;!n&&r?.length&&!t?f({navigate:s,to:"apps/"+r[0].id+p.search,origin:"browser",options:{replace:!0}}):n&&!t&&!r?.length&&f({navigate:s,to:"apps/"})},[n,r,l]),e.createElement(e.Fragment,null,m||l?e.createElement(x,{justifyContent:"center",mt:"2em"},e.createElement(k,null)):c?e.createElement(b,{type:"danger"},c?.message??"Something went wrong"):r?e.createElement(F,{"data-component-name":"Layout/PageLayout"},n&&e.createElement(E,{growContent:!1,menu:r?.map(t=>e.createElement(P,{key:t.id,item:{label:t.name,link:"apps/"+t.id,items:[],active:n===t.id,hasActiveSubItem:!1}})),header:e.createElement(R,{"data-translation-key":"dev.sidebar.header"},a("dev.sidebar.header","My apps")),footer:e.createElement(w,{variant:"outlined",fullWidth:!0,onClick:()=>i.current.open(),icon:e.createElement(A,null),iconPosition:"right",size:"small","data-translation-key":"dev.sidebar.footer.text"},a("dev.sidebar.footer.text","New application")),versions:null}),!n&&!r.length?e.createElement(D,null,e.createElement(W,null,e.createElement(S,null),e.createElement(q,{"data-translation-key":"dev.newApp.text"},a("dev.newApp.text","Create your first app")),e.createElement(L,{variant:"primary",onClick:()=>i.current.open(),"data-translation-key":"dev.newApp"},a("dev.newApp","New application")))):e.createElement(N,null,e.createElement(g,null)),e.createElement(I,{ref:i})):null)}const F=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
min-height: calc(100vh - var(--navbar-height));
|
|
5
|
-
`,
|
|
5
|
+
`,N=o.div`
|
|
6
6
|
flex: 1 0 0;
|
|
7
7
|
/*
|
|
8
8
|
flex-basis is ignored for nested flex in Chrome, need to set width
|
|
@@ -10,27 +10,27 @@ import*as e from"react";import{useQuery as u}from"@tanstack/react-query";import
|
|
|
10
10
|
*/
|
|
11
11
|
width: 0;
|
|
12
12
|
max-width: 100%;
|
|
13
|
-
`,
|
|
13
|
+
`,D=o.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-grow: 1;
|
|
16
|
-
`,
|
|
16
|
+
`,R=o.div`
|
|
17
17
|
display: flex;
|
|
18
18
|
font-weight: var(--font-weight-regular);
|
|
19
19
|
font-size: var(--font-size-heading-3);
|
|
20
20
|
line-height: var(--line-height-xxlg);
|
|
21
21
|
color: var(--text-color-primary);
|
|
22
22
|
font-family: var(--font-family-base);
|
|
23
|
-
`,
|
|
23
|
+
`,W=o.div`
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
flex-grow: 1;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
align-items: center;
|
|
29
29
|
font-family: var(--font-family-base);
|
|
30
|
-
`,
|
|
30
|
+
`,q=o.div`
|
|
31
31
|
font-weight: var(--font-weight-regular);
|
|
32
32
|
font-size: 28px;
|
|
33
33
|
line-height: 36px;
|
|
34
34
|
color: var(--input-content-placeholder-color);
|
|
35
35
|
padding: var(--spacing-xl) 0 var(--spacing-lg) 0;
|
|
36
|
-
`;export{
|
|
36
|
+
`;export{z as default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import*as e from"react";import{useQueryClient as
|
|
1
|
+
import*as e from"react";import{useQueryClient as B,useMutation as H,useQuery as V}from"@tanstack/react-query";import v from"styled-components";import{Flex as $}from"@redocly/portal-legacy-ui";import{Button as K}from"@redocly/theme/components/Button/Button";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{AppCustomAttributes as Q}from"@redocly/theme/components/ApiOnboarding/AppCustomAttributes";import{withPathPrefix as G}from"@redocly/theme/core/utils";import{usePreloadHistory as W}from"../../../../client/app/usePreloadHistory";import{useTranslate as J}from"../../../../client/app/hooks";import X from"./components/ApisList";import{ButtonWithLoading as Y}from"./components/ButtonWithLoading";import{Dialog as Z}from"./components/Dialog";import{ButtonsContainer as ee}from"./components/RollAPIKey";import{MAX_DESCRIPTION_LENGTH as k,CharacterCounter as te}from"./components/CharacterCounter";import{DialogHelperText as ae,DialogInputMultiline as S,DialogRow as c,DialogRowContent as p,DialogRowTitle as m,DialogTitleInput as re}from"./components/DialogStyledComponents";import{apiKeysUrl as w}from"../../../../utils/url/api-keys-url";const ke=e.forwardRef((oe,P)=>{const{data:I}=V({queryKey:["DEV_ONBOARDING_META"],staleTime:1/0,queryFn:async()=>{const t=await fetch(w("/meta"));if(!t.ok)throw new Error(`Failed to load meta: ${t.status}`);return t.json()}}),d=(I?.adapters||[]).some(t=>t.capabilities.callbackUrls),[r,U]=e.useState(""),[n,D]=e.useState(""),[u,x]=e.useState(void 0),R=B(),[T,N]=e.useState({}),[O,L]=e.useState(!0),[g,h]=e.useState(""),[_,o]=e.useState(!1),E=W(),f=new URLSearchParams(E.location.search),[C,F]=e.useState([]),{translate:a}=J(),y=f.has("createApp");e.useEffect(()=>{y&&o(!0)},[y]);const M=e.useCallback((t,z)=>{N(t),L(z)},[]),l=H({mutationFn:()=>fetch(w("/apps"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:r,name:r,description:n,callbackUrl:d?u:void 0,apiProductIds:C,attributes:T})}).then(t=>t.json()),onSuccess:t=>{t.error?h(t.error):(E.push(G("/apps/"+t.id)),R.invalidateQueries({queryKey:["APPS"]}),s(),h(""))}}),b=()=>o(!0),s=()=>o(!1);e.useImperativeHandle(P,()=>({open:b}));const j=t=>{F(t||[])},q=async()=>{await l.mutateAsync()},i=/^[a-z][a-z0-9._\-$%#\s]*$/gi.test(r);return e.createElement(e.Fragment,null,e.createElement(Z,{open:_,onOpen:b,onClose:s},e.createElement(le,null,e.createElement($,{justifyContent:"space-between",alignItems:"center",mb:"2em"},e.createElement(re,{error:!!r&&!i,value:r,onChange:t=>U(t.target.value),placeholder:a("dev.create.app.dialog.appName.placeholder","App name")}),!!r&&!i&&e.createElement(ne,null,a("dev.create.app.dialog.appName.error","Name must start with a letter and can only contain: letters, numbers, spaces, ., _, -, $, %, #"))),e.createElement(c,null,e.createElement(m,{"data-translation-key":"dev.create.app.dialog.selectAPIs"},a("dev.create.app.dialog.selectAPIs","Select APIs")),e.createElement(p,null,e.createElement(X,{initialEnabledApis:f.getAll("apiId"),onChange:j}))),e.createElement(c,null,e.createElement(m,{"data-translation-key":"dev.create.app.dialog.description"},a("dev.create.app.dialog.description","Description")),e.createElement(p,null,e.createElement(S,{maxLength:k,value:n,onChange:t=>D(t.target.value),placeholder:a("dev.create.app.dialog.description.placeholder","Empty"),rows:6}))),e.createElement(te,null,n.length,"/",k),d&&e.createElement(c,null,e.createElement(m,{"data-translation-key":"dev.create.app.dialog.callbackUrls"},a("dev.create.app.dialog.callbackUrls","Callback URLs")),e.createElement(p,null,e.createElement(S,{value:u,onChange:t=>x(t.target.value),placeholder:a("dev.create.app.dialog.callbackUrls.placeholder","https://example.com/callback"),rows:3}),e.createElement(ae,{"data-translation-key":"dev.create.app.dialog.callbackUrls.hint"},a("dev.create.app.dialog.callbackUrls.hint","Separate multiple URLs with a comma")))),e.createElement(Q,{onChange:M}),l.error?e.createElement(A,{type:"danger"},l.error.message):null,e.createElement(ee,null,e.createElement(K,{onClick:s,size:"large",variant:"text"},a("dev.create.app.dialog.cancel","Cancel")),e.createElement(Y,{variant:"primary",onClick:q,loading:l.isPending,disabled:!O||l.isPending||!i||C.length<1,"data-translation-key":"dev.create.app.dialog.create"},a("dev.create.app.dialog.create","Create application"))),g&&e.createElement(A,{type:"danger"},g))))}),le=v.div`
|
|
2
2
|
width: 664px;
|
|
3
3
|
min-height: 428px;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
`,
|
|
6
|
+
`,ne=v.span`
|
|
7
7
|
padding-top: 5px;
|
|
8
8
|
color: var(--color-error-base);
|
|
9
9
|
font-size: 0.9em;
|
|
10
|
-
`;export{
|
|
10
|
+
`;export{ke as CreateAppDialog};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import*as e from"react";import o from"styled-components";import{useParams as g}from"react-router";import{useMutation as E,useQueryClient as y}from"@tanstack/react-query";import{Flex as
|
|
1
|
+
import*as e from"react";import o from"styled-components";import{useParams as g}from"react-router";import{useMutation as E,useQueryClient as y}from"@tanstack/react-query";import{Flex as m}from"@redocly/portal-legacy-ui";import{Button as x}from"@redocly/theme/components/Button/Button";import{H3 as h}from"@redocly/theme/components/Typography/H3";import{Admonition as v}from"@redocly/theme/markdoc/components/Admonition/Admonition";import k from"./ApiKeyOverview";import{ApiKeyProductsStatus as w}from"./ApiKeyProductStatus";import{UpdateKey as K}from"./UpdateApiKey";import{Dialog as L}from"./Dialog";import{ButtonWithLoading as D}from"./ButtonWithLoading";import{apiKeysUrl as S}from"../../../../../utils/url/api-keys-url";function A(s){const p=y(),{credential:t}=s,{id:r}=g(),[c,a]=e.useState(!1),[u,n]=e.useState(!1),{isPending:i,error:l,mutate:d}=E({mutationKey:["DELETE_CRED"+t.id],mutationFn:()=>fetch(S(`/apps/${r}/credentials/${t.id}`),{method:"DELETE"}),onSuccess:()=>{p.invalidateQueries({queryKey:["APP:"+r]}),n(!1)}}),C=()=>{d()},f=()=>{a(!0)};return e.createElement(e.Fragment,null,e.createElement(O,null,e.createElement(k,{apiKey:t}),e.createElement(w,{apiProductsStatuses:t.apiProductsStatus,secret:t.clientSecret,id:t.id})),e.createElement(K,{credential:t,open:c,onClose:()=>a(!1),onOpen:f}),e.createElement(L,{open:u,onOpen:()=>n(!0),onClose:()=>n(!1)},e.createElement(e.Fragment,null,e.createElement(h,null,"Revoke key"),e.createElement("div",null,"Do you really want to revoke this key?"),l&&e.createElement(v,{type:"danger"},l.message),e.createElement(P,null,e.createElement(x,{onClick:()=>n(!1)},"Cancel"),e.createElement(D,{variant:"primary",onClick:C,disabled:i,loading:i},"Revoke key")))))}const O=o(m)`
|
|
2
2
|
flex-wrap: wrap;
|
|
3
3
|
gap: 32px;
|
|
4
|
-
`,
|
|
4
|
+
`,Z=o.span`
|
|
5
5
|
margin: 14px 6px;
|
|
6
6
|
width: 20px;
|
|
7
7
|
height: 20px;
|
|
8
8
|
background-repeat: no-repeat;
|
|
9
9
|
background-size: 20px 20px;
|
|
10
10
|
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='20' height='20' fill='none' style='mix-blend-mode:multiply'/%3E%3Cpath d='M14.9998 6.25L14.1159 7.13381L16.3572 9.375H7.43657C7.31292 8.77515 7.01623 8.22468 6.58316 7.7916C6.15008 7.35853 5.59961 7.06183 4.99976 6.93819V1.25H3.74976V6.93819C3.04406 7.08229 2.40981 7.46575 1.95431 8.02367C1.4988 8.5816 1.25 9.27974 1.25 10C1.25 10.7203 1.4988 11.4184 1.95431 11.9763C2.40981 12.5343 3.04406 12.9177 3.74976 13.0618V18.75H4.99976V13.0618C5.59961 12.9382 6.15008 12.6415 6.58316 12.2084C7.01623 11.7753 7.31292 11.2248 7.43657 10.625H16.3572L14.1159 12.8662L14.9998 13.75L18.7498 10L14.9998 6.25ZM4.37476 11.875C4.00392 11.875 3.6414 11.765 3.33306 11.559C3.02472 11.353 2.7844 11.0601 2.64248 10.7175C2.50057 10.3749 2.46344 9.99792 2.53578 9.63421C2.60813 9.27049 2.78671 8.9364 3.04893 8.67417C3.31116 8.41195 3.64525 8.23338 4.00896 8.16103C4.37268 8.08868 4.74968 8.12581 5.09229 8.26773C5.4349 8.40964 5.72774 8.64996 5.93376 8.95831C6.13979 9.26665 6.24976 9.62916 6.24976 10C6.24921 10.4971 6.05149 10.9737 5.69998 11.3252C5.34847 11.6767 4.87187 11.8745 4.37476 11.875Z' fill='%231E1E1F'/%3E%3C/svg%3E%0A");
|
|
11
|
-
`,
|
|
11
|
+
`,P=o(m)`
|
|
12
12
|
margin-top: 2em;
|
|
13
13
|
justify-content: flex-end;
|
|
14
14
|
gap: var(--spacing-xs);
|
|
15
|
-
`;export{
|
|
15
|
+
`;export{P as ButtonsWrapper,Z as ConnectSourceIcon,A as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import{useQuery as b}from"@tanstack/react-query";import{useParams as g}from"react-router";import t from"styled-components";import{CodeBlock as f}from"@redocly/theme/components/CodeBlock/CodeBlock";import{fetch as v}from"../../../../../client/app/utils";import y from"./LogStatusCode";import{getReadableDate as h}from"./getReadableDate";import{Headers as E}from"./Headers";function
|
|
1
|
+
import*as e from"react";import{useQuery as b}from"@tanstack/react-query";import{useParams as g}from"react-router";import t from"styled-components";import{CodeBlock as f}from"@redocly/theme/components/CodeBlock/CodeBlock";import{fetch as v}from"../../../../../client/app/utils";import y from"./LogStatusCode";import{getReadableDate as h}from"./getReadableDate";import{Headers as E}from"./Headers";import{apiKeysUrl as x}from"../../../../../utils/url/api-keys-url";function w(m){const{logId:a}=m,[s,p]=e.useState(0),{id:u}=g(),{data:r}=b({refetchOnWindowFocus:!1,queryKey:["API-LOGS-"+a],queryFn:()=>v(x(`/apps/${u}/logs/${a}`)).then(n=>n.json())}),c=[{name:"Request",content:r?.request},{name:"Response",content:r?.response}];if(!a||!r)return e.createElement(d,null);const o=c[s].content;return e.createElement(d,null,e.createElement(k,null,e.createElement(l,null,r.path)),e.createElement(C,null,e.createElement("span",null,"Status"),e.createElement("span",null,e.createElement(y,{statusCode:r.statusCode.toString()})),e.createElement("span",null,"ID"),e.createElement("span",null,r.id),e.createElement("span",null,"Time"),e.createElement("span",null,h(r.timestamp,{hour:"numeric",minute:"numeric",second:"numeric"})),e.createElement("span",null,"IP Address"),e.createElement("span",null,r.ipAddress)),e.createElement(T,null,e.createElement(S,null,c.map(({name:n},i)=>e.createElement(z,{key:n,className:s===i?"active":"",onClick:()=>p(i)},n))),e.createElement(A,null,e.createElement(l,null,"Headers"),Object.keys(o?.headers||{}).length?e.createElement(E,{headers:o?.headers||{}}):e.createElement("span",null,"No headers"))),o?.body&&e.createElement(e.Fragment,null,e.createElement(l,null,"Body"),e.createElement(I,{lang:"json",source:o.body,withLineNumbers:!0})))}const d=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-grow: 1;
|
|
4
4
|
flex-direction: column;
|
|
@@ -9,14 +9,14 @@ import*as e from"react";import{useQuery as b}from"@tanstack/react-query";import{
|
|
|
9
9
|
width: 50%;
|
|
10
10
|
|
|
11
11
|
word-break: break-all;
|
|
12
|
-
`,
|
|
12
|
+
`,k=t.div`
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: space-between;
|
|
15
15
|
`,l=t.div`
|
|
16
16
|
font-weight: var(--font-weight-bold);
|
|
17
17
|
font-size: var(--font-size-base);
|
|
18
18
|
padding: var(--spacing-base) 0;
|
|
19
|
-
`,
|
|
19
|
+
`,C=t.div`
|
|
20
20
|
display: grid;
|
|
21
21
|
row-gap: var(--spacing-sm);
|
|
22
22
|
grid-template-columns: 1fr 2fr;
|
|
@@ -29,9 +29,9 @@ import*as e from"react";import{useQuery as b}from"@tanstack/react-query";import{
|
|
|
29
29
|
> span {
|
|
30
30
|
min-height: 24px;
|
|
31
31
|
}
|
|
32
|
-
`,
|
|
32
|
+
`,T=t.div``,S=t.div`
|
|
33
33
|
display: flex;
|
|
34
|
-
`,
|
|
34
|
+
`,z=t.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-grow: 1;
|
|
37
37
|
justify-content: center;
|
|
@@ -44,7 +44,7 @@ import*as e from"react";import{useQuery as b}from"@tanstack/react-query";import{
|
|
|
44
44
|
&.active {
|
|
45
45
|
border-bottom: 2px solid var(--border-color-primary);
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,A=t.div``,I=t(f)`
|
|
48
48
|
padding: 0;
|
|
49
49
|
background-color: transparent;
|
|
50
50
|
|
|
@@ -66,4 +66,4 @@ import*as e from"react";import{useQuery as b}from"@tanstack/react-query";import{
|
|
|
66
66
|
color: #4478d4;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
`;export{
|
|
69
|
+
`;export{w as default};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import*as a from"react";import v from"react-dom";import{useQuery as y}from"@tanstack/react-query";import{useParams as E}from"react-router";import i from"styled-components";import{fetch as D}from"../../../../../client/app/utils";import L from"../../../../../client/app/CircularProgress";import{TAB_ACTIONS_PORTAL_ID as F}from"../App";import A from"./ApiLogDetails";import x from"./ApiLogItem";import S from"./ApiLogsActions";import{getReadableDate as p}from"./getReadableDate";function
|
|
1
|
+
import*as a from"react";import v from"react-dom";import{useQuery as y}from"@tanstack/react-query";import{useParams as E}from"react-router";import i from"styled-components";import{fetch as D}from"../../../../../client/app/utils";import L from"../../../../../client/app/CircularProgress";import{TAB_ACTIONS_PORTAL_ID as F}from"../App";import A from"./ApiLogDetails";import x from"./ApiLogItem";import S from"./ApiLogsActions";import{getReadableDate as p}from"./getReadableDate";import{apiKeysUrl as C}from"../../../../../utils/url/api-keys-url";function I(){const[o,n]=a.useState(void 0),[e,c]=a.useState({}),s=a.useMemo(()=>w(e),[e]),{id:d}=E(),l=t=>{n(t.id)},u=()=>{const t=new URLSearchParams;return t.append("page","1"),e.api?.length&&e.api.forEach(r=>t.append("api",r.id)),e.method?.length&&e.method?.forEach(r=>t.append("method",r.id)),e.status?.length&&e.status?.forEach(r=>t.append("statusCode",r.id)),e.date?.type==="predefined"&&(e.date.fromDateOffset&&t.append("fromDate",(Date.now()-e.date.fromDateOffset).toString()),e.date.toDateOffset&&t.append("toDate",(Date.now()-e.date.toDateOffset).toString())),e.date?.type==="custom"&&(t.append("fromDate",e.date.fromDate.toString()),t.append("toDate",e.date.toDate.toString())),t.toString()},{data:m,isLoading:f}=y({queryKey:["API-LOGS-"+d,{activeFilters:e}],queryFn:()=>D(C(`/apps/${d}/logs?${u()}`)).then(t=>t.json()).then(t=>{const{data:r,total:h}=t;return h&&n(r[0].id),t}),refetchOnWindowFocus:!1}),g=a.useCallback(t=>c(t),[]);return a.createElement(a.Fragment,null,a.createElement(R,null,a.createElement(S,{onFiltersChange:g,activeFilters:e})),s.length>0?a.createElement(O,null,s.map((t,r)=>a.createElement(k,{key:r},t))):null,f?a.createElement(L,null):m?.data.length?a.createElement(b,null,a.createElement(P,null,m?.data.map(t=>a.createElement(x,{key:t.id,log:t,active:t.id===o,onClick:l}))),a.createElement(A,{logId:o})):a.createElement("p",null,"There are no logs yet."))}const b=i.div`
|
|
2
2
|
display: flex;
|
|
3
|
-
`,
|
|
3
|
+
`,P=i.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-grow: 1;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
border-top: 1px solid var(--border-color-primary);
|
|
8
|
-
`,
|
|
8
|
+
`,O=i.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
gap: var(--spacing-xs);
|
|
11
11
|
margin-bottom: var(--spacing-base);
|
|
12
|
-
`,
|
|
12
|
+
`,k=i.div`
|
|
13
13
|
color: var(--text-color-secondary);
|
|
14
14
|
border-radius: 32px;
|
|
15
15
|
padding: var(--spacing-xxs) var(--spacing-xs);
|
|
16
16
|
background-color: var(--bg-color);
|
|
17
17
|
font-size: var(--font-size-base);
|
|
18
|
-
`,
|
|
18
|
+
`,R=o=>{const n=document.getElementById(F),[e]=a.useState(document.createElement("div"));return a.useEffect(()=>(n?.appendChild(e),()=>{n?.removeChild(e)}),[e,n]),v.createPortal(o.children,e)};function w(o){const n=[];if(o.method?.length&&n.push(...o.method.map(e=>e.name)),o.api?.length&&n.push(...o.api.map(e=>`API: ${e.name}`)),o.status?.length&&n.push(...o.status.map(e=>e.name)),o.date?.type==="predefined")n.push(o.date.name);else if(o.date?.type==="custom"){const e={hour:"numeric",minute:"numeric",second:"numeric"};n.push(`${p(o.date.fromDate,e)} - ${p(o.date.toDate,e)}`)}return n}export{I as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import n,{useMemo as D,useState as O}from"react";import{Popup as h}from"reactjs-popup";import l from"styled-components";import{useQuery as N}from"@tanstack/react-query";import{DateTimeRangePicker as R}from"@wojtekmaj/react-datetimerange-picker";import"@wojtekmaj/react-datetimerange-picker/dist/DateTimeRangePicker.css";import{fetch as S}from"../../../../../client/app/utils";import{PopupMenuUl as I}from"./PopupMenuUl";const
|
|
1
|
+
import n,{useMemo as D,useState as O}from"react";import{Popup as h}from"reactjs-popup";import l from"styled-components";import{useQuery as N}from"@tanstack/react-query";import{DateTimeRangePicker as R}from"@wojtekmaj/react-datetimerange-picker";import"@wojtekmaj/react-datetimerange-picker/dist/DateTimeRangePicker.css";import{fetch as S}from"../../../../../client/app/utils";import{PopupMenuUl as I}from"./PopupMenuUl";import{apiKeysUrl as A}from"../../../../../utils/url/api-keys-url";const y=[{name:"OTHER",id:"OTHER"},{name:"CONNECT",id:"CONNECT"},{name:"DELETE",id:"DELETE"},{name:"GET",id:"GET"},{name:"HEAD",id:"HEAD"},{name:"OPTIONS",id:"OPTIONS"},{name:"PATCH",id:"PATCH"},{name:"POST",id:"POST"},{name:"PUT",id:"PUT"},{name:"TRACE",id:"TRACE"}],P=[{type:"predefined",name:"last 5m",fromDateOffset:1e3*60*5},{type:"predefined",name:"last 1h",fromDateOffset:1e3*60*60},{type:"predefined",name:"last 3h",fromDateOffset:1e3*60*60*3},{type:"predefined",name:"last 12h",fromDateOffset:1e3*60*60*12},{type:"predefined",name:"last 1d",fromDateOffset:1e3*60*60*24},{type:"predefined",name:"last 3d",fromDateOffset:1e3*60*60*24*3},{type:"predefined",name:"last 7d",fromDateOffset:1e3*60*60*24*7},{type:"predefined",name:"last 30d",fromDateOffset:1e3*60*60*24*30}],x=[{name:"100 CONTINUE",id:"100"},{name:"101 SWITCHING PROTOCOLS",id:"101"},{name:"102 PROCESSING",id:"102"},{name:"200 OK",id:"200"},{name:"201 CREATED",id:"201"},{name:"202 ACCEPTED",id:"202"},{name:"203 NON AUTHORITATIVE INFORMATION",id:"203"},{name:"204 NO CONTENT",id:"204"},{name:"205 RESET CONTENT",id:"205"},{name:"206 PARTIAL CONTENT",id:"206"},{name:"207 MULTI STATUS",id:"207"},{name:"300 MULTIPLE CHOICES",id:"300"},{name:"301 MOVED PERMANENTLY",id:"301"},{name:"302 FOUND",id:"302"},{name:"303 SEE OTHER",id:"303"},{name:"304 NOT MODIFIED",id:"304"},{name:"305 USE PROXY",id:"305"},{name:"307 TEMPORARY REDIRECT",id:"307"},{name:"400 BAD REQUEST",id:"400"},{name:"401 UNAUTHORIZED",id:"401"},{name:"402 PAYMENT REQUIRED",id:"402"},{name:"403 FORBIDDEN",id:"403"},{name:"404 NOT FOUND",id:"404"},{name:"405 METHOD NOT ALLOWED",id:"405"},{name:"406 NOT ACCEPTABLE",id:"406"},{name:"407 PROXY AUTHENTICATION REQUIRED",id:"407"},{name:"408 REQUEST TIMEOUT",id:"408"},{name:"409 CONFLICT",id:"409"},{name:"410 GONE",id:"410"},{name:"411 LENGTH REQUIRED",id:"411"},{name:"412 PRECONDITION FAILED",id:"412"},{name:"413 REQUEST ENTITY TOO LARGE",id:"413"},{name:"414 REQUEST URI TOO LONG",id:"414"},{name:"415 UNSUPPORTED MEDIA TYPE",id:"415"},{name:"416 REQUESTED RANGE NOT SATISFIABLE",id:"416"},{name:"417 EXPECTATION FAILED",id:"417"},{name:"422 UNPROCESSABLE ENTITY",id:"422"},{name:"423 LOCKED",id:"423"},{name:"424 FAILED DEPENDENCY",id:"424"},{name:"429 TOO MANY REQUESTS",id:"429"},{name:"500 INTERNAL SERVER ERROR",id:"500"},{name:"501 NOT IMPLEMENTED",id:"501"},{name:"502 BAD GATEWAY",id:"502"},{name:"503 SERVICE UNAVAILABLE",id:"503"},{name:"504 GATEWAY TIMEOUT",id:"504"},{name:"505 HTTP VERSION NOT SUPPORTED",id:"505"},{name:"507 INSUFFICIENT STORAGE",id:"507"}];function U(e){return n.createElement(F,null,n.createElement(M,{onFiltersChange:e.onFiltersChange,activeFilters:e.activeFilters}),n.createElement(w,null))}var Z=n.memo(U);const w=()=>null,M=n.memo(e=>{const{onFiltersChange:d,activeFilters:t}=e,{data:i}=N({queryKey:["API-PRODUCTS"],queryFn:()=>S(A("/api-products")).then(o=>o.json())}),[m,r]=O(),a=()=>r(void 0),s=(o,g)=>{const T={...t,[o]:g};d(T)};return n.createElement(h,{trigger:n.createElement(L,null,"Filter"),position:"bottom right"},n.createElement(b,null,n.createElement(E,{open:m==="api",name:"API name",options:i||[],activeOptions:t.api,onOpen:()=>r("api"),onClose:a,onChange:o=>s("api",o),active:(t.api?.length??0)>0}),n.createElement(E,{open:m==="status",name:"Status",options:x,activeOptions:t.status,onOpen:()=>r("status"),onClose:a,onChange:o=>s("status",o),active:(t.status?.length??0)>0}),n.createElement(E,{open:m==="method",name:"Method",options:y,activeOptions:t.method,onOpen:()=>r("method"),onClose:a,onChange:o=>s("method",o),active:(t.method?.length??0)>0}),n.createElement(E,{name:"Date range",open:m==="date",onOpen:()=>r("date"),onClose:a,active:!!t.date,renderSubmenu:()=>n.createElement(k,{onChange:o=>s("date",o),selectedDateFilter:t.date})}),n.createElement(_,null),n.createElement(Y,{onClick:()=>d({})},"Clear filters")))}),k=e=>{const{selectedDateFilter:d,onChange:t}=e,i=d?.type==="custom",[m,r]=O(!1),[a,s]=O([null,null]),o=a?.[0]?a[0]:null,g=a?.[1]?a[1]:null,T=()=>{if(!a?.[0]&&!a?.[1])return t();const c=a[1]||new Date,p=a[0]||new Date(c.getDate()-1e3*60*60*24);r(!1),t({type:"custom",fromDate:p.getTime(),toDate:c.getTime()})};return n.createElement(v,{onMouseDown:u,onTouchStart:u},n.createElement(E,{open:m,active:i,name:"Custom range",onOpen:()=>r(!0),onClose:()=>r(!1),renderSubmenu:()=>n.createElement(H,null,n.createElement(G,{onClick:T},"Submit"),n.createElement(_,null),n.createElement(R,{isCalendarOpen:!0,format:"yyyy-MM-dd HH:mm",closeWidgets:!1,dayPlaceholder:"DD",monthPlaceholder:"MM",yearPlaceholder:"YYYY",hourPlaceholder:"HH",minutePlaceholder:"mm",disableClock:!0,value:[o,g],onChange:c=>s(c)}))}),P.map(c=>{const p=d?.type==="predefined"&&d.name===c.name;return n.createElement(f,{active:p,key:c.name,onClick:C=>{u(C),t(p?void 0:c)}},c.name)}))},E=e=>{const d=e.activeOptions||[],t=D(()=>new Set(d.map(i=>i.id)),[e.activeOptions]);return n.createElement(h,{open:e.open,onOpen:e.onOpen,onClose:e.onClose,trigger:n.createElement(f,{active:e.active||e.open},e.name),position:"left top",arrow:!1},e.options?n.createElement(v,{onMouseDown:u,onTouchStart:u},e.options?.map(i=>n.createElement(f,{active:t.has(i.id),key:i.id,onClick:m=>{if(e.onChange)if(u(m),t.has(i.id)){const r=[...d],a=r.findIndex(s=>s.id===i.id);r.splice(a,1),e.onChange(r)}else e.onChange([...d,i])}},i.name))):null,e.renderSubmenu?e.renderSubmenu():null)},u=e=>{e.stopPropagation()},L=l.div`
|
|
2
2
|
color: var(--text-color-primary);
|
|
3
3
|
border-radius: var(--border-radius);
|
|
4
4
|
cursor: pointer;
|
|
@@ -11,7 +11,7 @@ import n,{useMemo as D,useState as O}from"react";import{Popup as h}from"reactjs-
|
|
|
11
11
|
&:hover {
|
|
12
12
|
border-color: var(--border-color-primary);
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,F=l.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
gap: var(--spacing-xxs);
|
|
17
17
|
`,b=l(I)`
|
|
@@ -38,7 +38,7 @@ import n,{useMemo as D,useState as O}from"react";import{Popup as h}from"reactjs-
|
|
|
38
38
|
&::-webkit-scrollbar {
|
|
39
39
|
display: none;
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,H=l(v)`
|
|
42
42
|
max-height: unset;
|
|
43
43
|
width: unset;
|
|
44
44
|
padding: 0;
|
|
@@ -137,10 +137,10 @@ import n,{useMemo as D,useState as O}from"react";import{Popup as h}from"reactjs-
|
|
|
137
137
|
${e=>e.active&&`
|
|
138
138
|
background-color: var(--bg-color-raised);
|
|
139
139
|
`}
|
|
140
|
-
`,
|
|
140
|
+
`,Y=l.li`
|
|
141
141
|
opacity: 50%;
|
|
142
142
|
cursor: pointer;
|
|
143
|
-
`,
|
|
143
|
+
`,G=l.li`
|
|
144
144
|
cursor: pointer;
|
|
145
145
|
opacity: 100%;
|
|
146
146
|
font-size: var(--font-size-lg);
|
|
@@ -154,4 +154,4 @@ import n,{useMemo as D,useState as O}from"react";import{Popup as h}from"reactjs-
|
|
|
154
154
|
height: 1px;
|
|
155
155
|
opacity: 0.1;
|
|
156
156
|
list-style: none;
|
|
157
|
-
`;export{
|
|
157
|
+
`;export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as r from"react";import{useQuery as y}from"@tanstack/react-query";import{Admonition as l}from"@redocly/theme/markdoc/components/Admonition/Admonition";import g from"../../../../../client/app/CircularProgress";import{MultiSelect as h}from"./MultiSelect";import{parseCombinedId as m}from"../../utils";function
|
|
1
|
+
import*as r from"react";import{useQuery as y}from"@tanstack/react-query";import{Admonition as l}from"@redocly/theme/markdoc/components/Admonition/Admonition";import g from"../../../../../client/app/CircularProgress";import{MultiSelect as h}from"./MultiSelect";import{parseCombinedId as m}from"../../utils";import{apiKeysUrl as A}from"../../../../../utils/url/api-keys-url";function E(c){const{onChange:i,initialEnabledApis:o}=c,{isLoading:p,error:s,data:a}=y({queryKey:["API-PRODUCTS"],queryFn:async()=>{const e=await fetch(A("/api-products"));try{return await e.json()}catch{throw new Error("Something unexpected happened. Please try again later.")}}}),d=(a||[]).sort((e,n)=>e.name.localeCompare(n.name)),t=(a||[]).filter(e=>{const{id:n}=m(e.id);return o.includes(n)});for(const e of o)t.some(u=>{const{id:f}=m(u.id);return f===e})||t.push({id:e,name:e});return r.useEffect(()=>{t.length>0&&i(t.map(e=>e.id))},[t.length]),p?r.createElement(g,null):s?r.createElement(l,{type:"danger"},s.message):a?.length?r.createElement(h,{options:d.map(e=>({label:e.name,value:e.id})),defaultValue:t.map(e=>({label:e.name,value:e.id})),onChange:i}):r.createElement(l,{type:"warning"},"You don't have access to any API.")}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as C,useQueryClient as v}from"@tanstack/react-query";import{useParams as E}from"react-router";import{Button as m}from"@redocly/theme/components/Button/Button";import{H3 as h}from"@redocly/theme/components/Typography/H3";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as P}from"../../../../../client/app/hooks";import{Dialog as S}from"./Dialog";import D from"./ApisList";import{ButtonWithLoading as O}from"./ButtonWithLoading";import{ButtonsContainer as b}from"./RollAPIKey";import{DialogRow as w,DialogRowTitle as B,DialogRowContent as I,DialogBodyWrapper as R}from"./DialogStyledComponents";function T({initialEnabledApis:r}){const p=v(),[u,o]=e.useState(!1),{translate:t}=P(),{id:i}=E(),{isPending:l,error:s,mutateAsync:y}=C({mutationFn:()=>fetch(`/
|
|
1
|
+
import*as e from"react";import{useMutation as C,useQueryClient as v}from"@tanstack/react-query";import{useParams as E}from"react-router";import{Button as m}from"@redocly/theme/components/Button/Button";import{H3 as h}from"@redocly/theme/components/Typography/H3";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as P}from"../../../../../client/app/hooks";import{Dialog as S}from"./Dialog";import D from"./ApisList";import{ButtonWithLoading as O}from"./ButtonWithLoading";import{ButtonsContainer as b}from"./RollAPIKey";import{DialogRow as w,DialogRowTitle as B,DialogRowContent as I,DialogBodyWrapper as R}from"./DialogStyledComponents";import{apiKeysUrl as K}from"../../../../../utils/url/api-keys-url";function T({initialEnabledApis:r}){const p=v(),[u,o]=e.useState(!1),{translate:t}=P(),{id:i}=E(),{isPending:l,error:s,mutateAsync:y}=C({mutationFn:()=>fetch(K(`/apps/${i}/credentials`),{method:"POST",body:JSON.stringify({apiProductIds:d})}).then(n=>n.json()),onSuccess:()=>{p.invalidateQueries({queryKey:["APP:"+i]})}}),c=()=>o(!0),a=()=>o(!1),g=async()=>{await y(),a()},[d,f]=e.useState(r),k=n=>{f(n||[])};return e.createElement(e.Fragment,null,e.createElement(m,{size:"large",variant:"primary",onClick:c},t("dev.app.key.create","Create key")),e.createElement(S,{open:u,onOpen:c,onClose:a},e.createElement(R,null,e.createElement(h,{"data-translation-key":"dev.create.key.dialog.title"},t("dev.create.key.dialog.title","Create key")),e.createElement(w,null,e.createElement(B,{"data-translation-key":"dev.edit.apis.dialog.selectedAPIs"},t("dev.edit.apis.dialog.selectedAPIs","Selected APIs")),e.createElement(I,null,e.createElement(D,{initialEnabledApis:r,onChange:k}))),s?e.createElement(A,{type:"danger"}," ",s.message," "):null,e.createElement(b,null,e.createElement(m,{onClick:a,"data-translation-key":"dev.create.key.dialog.cancel",variant:"text",size:"large"},t("dev.create.key.dialog.cancel","Cancel")),e.createElement(O,{variant:"primary",onClick:g,disabled:l||d.length<1,loading:l,"data-translation-key":"dev.create.key.dialog.create"},t("dev.create.key.dialog.create","Create key"))))))}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as f,useQueryClient as y}from"@tanstack/react-query";import{useParams as g}from"react-router";import{Button as E}from"@redocly/theme/components/Button/Button";import{H2 as v}from"@redocly/theme/components/Typography/H2";import{Admonition as h}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{
|
|
1
|
+
import*as e from"react";import{useMutation as f,useQueryClient as y}from"@tanstack/react-query";import{useParams as g}from"react-router";import{Button as E}from"@redocly/theme/components/Button/Button";import{H2 as v}from"@redocly/theme/components/Typography/H2";import{Admonition as h}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{withPathPrefix as D}from"@redocly/theme/core/utils";import{usePreloadHistory as P}from"../../../../../client/app/usePreloadHistory";import{useTranslate as C}from"../../../../../client/app/hooks";import{Dialog as k}from"./Dialog";import{ButtonWithLoading as A}from"./ButtonWithLoading";import{ButtonsContainer as w}from"./RollAPIKey";import{apiKeysUrl as x}from"../../../../../utils/url/api-keys-url";const z=e.forwardRef((B,p)=>{const d=P(),{id:a}=g(),{translate:t}=C(),s=y(),[m,o]=e.useState(!1),n=()=>o(!0),r=()=>o(!1);e.useImperativeHandle(p,()=>({open:n}));const c=async()=>{await u(),d.push(D("/apps/"))},{isPending:l,error:i,mutateAsync:u}=f({mutationKey:["DELETE_APP"+a],mutationFn:()=>fetch(x(`/apps/${a}`),{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:["APPS"]})}});return e.createElement(k,{open:m,onOpen:n,onClose:r},e.createElement(e.Fragment,null,e.createElement(v,{"data-translation-key":"dev.delete.app.dialog.title"},t("dev.delete.app.dialog.title","Delete app")),e.createElement("div",{"data-translation-key":"dev.delete.app.dialog.confirmation"},t("dev.delete.app.dialog.confirmation","Do you really want to delete this app?")),i&&e.createElement(h,{type:"danger"},i.message),e.createElement(w,null,e.createElement(E,{onClick:r,"data-translation-key":"dev.delete.app.dialog.cancel",variant:"text",size:"large"},t("dev.delete.app.dialog.cancel","Cancel")),e.createElement(A,{variant:"primary",onClick:c,disabled:l,loading:l,"data-translation-key":"dev.delete.app.dialog.delete"},t("dev.delete.app.dialog.delete","Delete app")))))});export{z as DeleteAppDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as h,useQueryClient as k}from"@tanstack/react-query";import{useParams as I}from"react-router";import{Button as S}from"@redocly/theme/components/Button/Button";import{H2 as b}from"@redocly/theme/components/Typography/H2";import{Admonition as D}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as
|
|
1
|
+
import*as e from"react";import{useMutation as h,useQueryClient as k}from"@tanstack/react-query";import{useParams as I}from"react-router";import{Button as S}from"@redocly/theme/components/Button/Button";import{H2 as b}from"@redocly/theme/components/Typography/H2";import{Admonition as D}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as K}from"../../../../../client/app/hooks";import{Dialog as w}from"./Dialog";import B from"./ApisList";import{ButtonWithLoading as R}from"./ButtonWithLoading";import{ApiKeySecret as T}from"./ApiKeySecret";import{DialogRow as p,DialogRowContent as c,DialogRowTitle as u,DialogBodyWrapper as q}from"./DialogStyledComponents";import{ButtonsContainer as x}from"./RollAPIKey";import{apiKeysUrl as L}from"../../../../../utils/url/api-keys-url";function Q(g){const{initialEnabledApis:n,secret:y,open:E,onClose:a,id:o}=g,{translate:t}=K(),f=k(),{id:l}=I(),{isPending:r,error:s,mutateAsync:v}=h({mutationFn:()=>fetch(L(`/apps/${l}/credentials/${o}`),{method:"PUT",body:JSON.stringify({apiProductIds:[...d]})}).then(i=>i.json()),onSuccess:()=>{f.invalidateQueries({queryKey:["APP:"+l]})}}),A=async()=>{await v(),a()},[d,C]=e.useState(n),P=i=>{C(i||[])},m=o||y;return e.createElement(w,{open:E,onClose:a},e.createElement(q,null,e.createElement(b,{"data-translation-key":"dev.edit.apis.dialog.title"},t("dev.edit.apis.dialog.title","Edit APIs")),e.createElement(p,null,e.createElement(u,{"data-translation-key":"dev.edit.apis.dialog.apiKey"},t("dev.edit.apis.dialog.apiKey","API key")),e.createElement(c,null,m?e.createElement(T,{secret:m}):null)),e.createElement(p,null,e.createElement(u,{"data-translation-key":"dev.edit.apis.dialog.selectedAPIs"},t("dev.edit.apis.dialog.selectedAPIs","Selected APIs")),e.createElement(c,null,e.createElement(B,{initialEnabledApis:n,onChange:P}))),s?e.createElement(D,{type:"danger"}," ",s.message," "):null,e.createElement(x,null,e.createElement(S,{onClick:a,"data-translation-key":"dev.edit.apis.dialog.cancel",variant:"text",size:"large"},t("dev.edit.apis.dialog.cancel","Cancel")),e.createElement(R,{variant:"primary",onClick:A,disabled:r||d.length<1,loading:r,"data-translation-key":"dev.edit.apis.dialog.save"},t("dev.edit.apis.dialog.save","Save")))))}export{Q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as E,useQueryClient as
|
|
1
|
+
import*as e from"react";import{useMutation as E,useQueryClient as f}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as v}from"@redocly/theme/components/Button/Button";import{H2 as D}from"@redocly/theme/components/Typography/H2";import{Admonition as h}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as P}from"../../../../../client/app/hooks";import{Dialog as A}from"./Dialog";import{ButtonWithLoading as k}from"./ButtonWithLoading";import{ButtonsContainer as S}from"./RollAPIKey";import{DialogInputMultiline as K,DialogRow as T,DialogRowContent as w}from"./DialogStyledComponents";import{MAX_DESCRIPTION_LENGTH as d,CharacterCounter as O}from"./CharacterCounter";import{apiKeysUrl as R}from"../../../../../utils/url/api-keys-url";const z=o=>{const{initialDescription:n,open:a,onOpen:i,onClose:t}=o;return e.createElement(A,{open:a,onClose:t,onOpen:i},e.createElement(x,{initialDescription:n,onClose:t}))},x=o=>{const{id:n}=C(),{initialDescription:a,onClose:i}=o,{translate:t}=P(),[r,p]=e.useState(a||""),c=async()=>{await y(),i()},u=s=>{s.key==="Enter"&&!l&&c()},g=f(),{mutateAsync:y,isPending:l,error:m}=E({mutationKey:["UPDATE_APP"+n],mutationFn:()=>fetch(R(`/apps/${n}`),{method:"PUT",body:JSON.stringify({description:r})}),onSettled:()=>{g.invalidateQueries({queryKey:["APP:"+n]})}});return e.createElement(e.Fragment,null,e.createElement(D,{"data-translation-key":"dev.edit.description.dialog.title"},t("dev.edit.description.dialog.title","Change description")),e.createElement(T,null,e.createElement(w,null,e.createElement(K,{maxLength:d,value:r,onChange:s=>p(s.target.value),onKeyPress:u,rows:6,cols:60}))),e.createElement(O,null,r.length,"/",d),m&&e.createElement(h,{type:"danger"},m.message," "),e.createElement(S,null,e.createElement(v,{onClick:i,"data-translation-key":"dev.edit.description.dialog.cancel",variant:"text",size:"large"},t("dev.edit.description.dialog.cancel","Cancel")),e.createElement(k,{variant:"primary",loading:l,onClick:c,disabled:l,"data-translation-key":"dev.edit.description.dialog.save"},t("dev.edit.description.dialog.save","Save changes"))))};export{z as EditAppDescriptionDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as v,useQueryClient as E}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as h}from"@redocly/theme/components/Button/Button";import{H2 as P}from"@redocly/theme/components/Typography/H2";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as
|
|
1
|
+
import*as e from"react";import{useMutation as v,useQueryClient as E}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as h}from"@redocly/theme/components/Button/Button";import{H2 as P}from"@redocly/theme/components/Typography/H2";import{Admonition as A}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as D}from"../../../../../client/app/hooks";import{Dialog as N}from"./Dialog";import{ButtonWithLoading as S}from"./ButtonWithLoading";import{ButtonsContainer as k}from"./RollAPIKey";import{DialogInput as K,DialogRow as w,DialogRowContent as O}from"./DialogStyledComponents";import{apiKeysUrl as R}from"../../../../../utils/url/api-keys-url";const J=e.forwardRef((l,a)=>{const{appName:s,appDisplayName:o}=l,[n,i]=e.useState(!1),r=()=>{i(!0)},t=()=>{i(!1)};return e.useImperativeHandle(a,()=>({open:r})),e.createElement(N,{open:n,onClose:t,onOpen:r},e.createElement(B,{initialName:o||s||"",onClose:t}))}),B=l=>{const{id:a}=C(),{initialName:s,onClose:o}=l,[n,i]=e.useState(s),r=p=>i(p.target.value),{translate:t}=D(),d=async()=>{await f(),o()},g=p=>{p.key==="Enter"&&!m&&u&&d()},y=E(),{mutateAsync:f,isPending:m,error:c}=v({mutationKey:["UPDATE_APP"+a],mutationFn:()=>fetch(R(`/apps/${a}`),{method:"PUT",body:JSON.stringify({name:n})}),onSettled:()=>{y.invalidateQueries({queryKey:["APPS","APP:"+a]})}}),u=/^(?!\s*$).{1,100}$/gi.test(n);return e.createElement(e.Fragment,null,e.createElement(P,{"data-translation-key":"dev.edit.app.dialog.title"},t("dev.edit.app.dialog.title","Change display name")),e.createElement(w,null,e.createElement(O,null,e.createElement(K,{value:n,onChange:r,onKeyPress:g}))),c&&e.createElement(A,{type:"danger"},c.message," "),e.createElement(k,null,e.createElement(h,{onClick:o,"data-translation-key":"dev.edit.app.dialog.cancel",variant:"text",size:"large"},t("dev.edit.app.dialog.cancel","Cancel")),e.createElement(S,{variant:"primary",loading:m,onClick:d,disabled:m||!u,"data-translation-key":"dev.edit.app.dialog.save"},t("dev.edit.app.dialog.save","Save changes"))))};export{J as EditAppDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as y,useQueryClient as
|
|
1
|
+
import*as e from"react";import{useMutation as y,useQueryClient as U}from"@tanstack/react-query";import{useParams as b}from"react-router";import{Button as C}from"@redocly/theme/components/Button/Button";import{H2 as h}from"@redocly/theme/components/Typography/H2";import{Admonition as v}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as f}from"../../../../../client/app/hooks";import{Dialog as E}from"./Dialog";import{ButtonWithLoading as w}from"./ButtonWithLoading";import{ButtonsContainer as P}from"./RollAPIKey";import{DialogHelperText as D,DialogInputMultiline as R,DialogRow as S,DialogRowContent as A}from"./DialogStyledComponents";import{apiKeysUrl as K}from"../../../../../utils/url/api-keys-url";const z=o=>{const{initialCallbackUrl:l,open:r,onOpen:n,onClose:a}=o;return e.createElement(E,{open:r,onClose:a,onOpen:n},e.createElement(T,{initialCallbackUrl:l,onClose:a}))},T=o=>{const{id:l}=b(),{initialCallbackUrl:r,onClose:n}=o,{translate:a}=f(),[c,m]=e.useState(r||""),s=async()=>{await g(),n()},p=t=>{t.key==="Enter"&&!i&&s()},u=U(),{mutateAsync:g,isPending:i,error:d}=y({mutationKey:["UPDATE_APP"+l],mutationFn:async()=>{const t=await fetch(K(`/apps/${l}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({callbackUrl:c})});if(!t.ok){const k=await t.json().catch(()=>null);throw new Error(k?.error||`Request failed with status ${t.status}`)}return t.json()},onSettled:()=>{u.invalidateQueries({queryKey:["APP:"+l]})}});return e.createElement(e.Fragment,null,e.createElement(h,{"data-translation-key":"dev.edit.callbackUrls.dialog.title"},a("dev.edit.callbackUrls.dialog.title","Change callback URLs")),e.createElement(S,null,e.createElement(A,null,e.createElement(R,{value:c,onChange:t=>m(t.target.value),onKeyPress:p,placeholder:a("dev.edit.callbackUrls.dialog.placeholder","https://example.com/callback"),rows:3}),e.createElement(D,{"data-translation-key":"dev.edit.callbackUrls.dialog.hint"},a("dev.edit.callbackUrls.dialog.hint","Separate multiple URLs with a comma")))),d&&e.createElement(v,{type:"danger"},d.message," "),e.createElement(P,null,e.createElement(C,{onClick:n,"data-translation-key":"dev.edit.callbackUrls.dialog.cancel",variant:"text",size:"large"},a("dev.edit.callbackUrls.dialog.cancel","Cancel")),e.createElement(w,{variant:"primary",loading:i,onClick:s,disabled:i,"data-translation-key":"dev.edit.callbackUrls.dialog.save"},a("dev.edit.callbackUrls.dialog.save","Save changes"))))};export{z as EditCallbackUrlDialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import r from"styled-components";import{useMutation as h,useQueryClient as x}from"@tanstack/react-query";import{useParams as A}from"react-router";import{Button as b}from"@redocly/theme/components/Button/Button";import{H2 as I}from"@redocly/theme/components/Typography/H2";import{ErrorIcon as P}from"@redocly/theme/icons/ErrorIcon/ErrorIcon";import{Admonition as C}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as R}from"../../../../../client/app/hooks";import{Dialog as K}from"./Dialog";import{ButtonWithLoading as w}from"./ButtonWithLoading";import{Separator as z}from"./ApiKeys";import{getReadableDate as S}from"./AppOverview";const s=5;function
|
|
1
|
+
import*as e from"react";import r from"styled-components";import{useMutation as h,useQueryClient as x}from"@tanstack/react-query";import{useParams as A}from"react-router";import{Button as b}from"@redocly/theme/components/Button/Button";import{H2 as I}from"@redocly/theme/components/Typography/H2";import{ErrorIcon as P}from"@redocly/theme/icons/ErrorIcon/ErrorIcon";import{Admonition as C}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as R}from"../../../../../client/app/hooks";import{Dialog as K}from"./Dialog";import{ButtonWithLoading as w}from"./ButtonWithLoading";import{Separator as z}from"./ApiKeys";import{getReadableDate as S}from"./AppOverview";import{apiKeysUrl as _}from"../../../../../utils/url/api-keys-url";const s=5;function B({apiKey:{expiresAt:t,clientId:n,clientSecret:o,id:v}}){const{id:i}=A(),k=x(),[y,d]=e.useState(!1),{translate:a}=R(),g=Number(t)>0?S(t):"Never",u=n||o,m=()=>d(!0),l=()=>d(!1),f=async()=>{await E()},{isPending:p,error:c,mutateAsync:E}=h({mutationKey:["REVOKE_API_KEY"+i],mutationFn:()=>fetch(_(`/apps/${i}/credentials/${v}`),{method:"DELETE",body:JSON.stringify({clientId:n,clientSecret:o})}),onSuccess:()=>{k.invalidateQueries({queryKey:["APP:"+i]}),l()}});return e.createElement(e.Fragment,null,e.createElement(F,{onClick:m},e.createElement("span",{"data-translation-key":"dev.app.key.revoke"},a("dev.app.key.revoke","Revoke API key")),e.createElement(P,{size:"24px",color:"#161616"})),e.createElement(K,{open:y,onOpen:m,onClose:l},e.createElement(L,null,e.createElement(e.Fragment,null,e.createElement(I,{"data-translation-key":"dev.revoke.key.dialog.title"},a("dev.revoke.key.dialog.title","Revoke API key")),e.createElement($,null,e.createElement("span",{"data-translation-key":"dev.revoke.key.dialog.apiKey"},a("dev.revoke.key.dialog.apiKey","API key")),e.createElement("span",null,O(u||"")),e.createElement("span",{"data-translation-key":"dev.revoke.key.dialog.expires"},a("dev.revoke.key.dialog.expires","Expires")),e.createElement("span",null,g)),e.createElement(z,null),e.createElement("div",{"data-translation-key":"dev.revoke.key.dialog.confirmation"},a("dev.revoke.key.dialog.confirmation","Are you sure you want to revoke this API key?")),c&&e.createElement(C,{type:"danger"},c.message),e.createElement(D,null,e.createElement(b,{onClick:l,"data-translation-key":"dev.revoke.key.dialog.cancel",variant:"text",size:"large"},a("dev.revoke.key.dialog.cancel","Cancel")),e.createElement(w,{variant:"primary",onClick:f,disabled:p,loading:p,"data-translation-key":"dev.revoke.key.dialog.revoke"},a("dev.revoke.key.dialog.revoke","Revoke API key")))))))}function O(t){if(t.length>s*2){const n=t.slice(0,s),o=t.slice(-s);return`${n} . . . ${o}`}return t}const $=r.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: 1fr 1fr;
|
|
4
4
|
|
|
@@ -11,14 +11,14 @@ import*as e from"react";import r from"styled-components";import{useMutation as h
|
|
|
11
11
|
max-width: 170px;
|
|
12
12
|
word-break: break-all;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
`,D=r.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
justify-content: flex-end;
|
|
17
17
|
align-items: center;
|
|
18
18
|
gap: var(--spacing-base);
|
|
19
19
|
margin-top: auto;
|
|
20
20
|
padding-top: 30px;
|
|
21
|
-
`,
|
|
21
|
+
`,F=r.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
cursor: pointer;
|
|
@@ -34,9 +34,9 @@ import*as e from"react";import r from"styled-components";import{useMutation as h
|
|
|
34
34
|
&:hover {
|
|
35
35
|
background: var(--color-red-2);
|
|
36
36
|
}
|
|
37
|
-
`,
|
|
37
|
+
`,L=r.div`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
min-height: 428px;
|
|
41
41
|
width: 344px;
|
|
42
|
-
`;export{
|
|
42
|
+
`;export{D as ButtonsContainer,B as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import
|
|
1
|
+
import*as e from"react";import l from"styled-components";import{useMutation as E,useQueryClient as x}from"@tanstack/react-query";import{useParams as A}from"react-router";import{Button as b}from"@redocly/theme/components/Button/Button";import{H2 as P}from"@redocly/theme/components/Typography/H2";import{RenewIcon as I}from"@redocly/theme/icons/RenewIcon/RenewIcon";import{Admonition as R}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as C}from"../../../../../client/app/l10n/hooks";import{Dialog as w}from"./Dialog";import{ButtonWithLoading as K}from"./ButtonWithLoading";import{Separator as z}from"./ApiKeys";import{getReadableDate as S}from"./AppOverview";import{apiKeysUrl as _}from"../../../../../utils/url/api-keys-url";const s=5;function B({apiKey:{expiresAt:t,clientId:n,clientSecret:o,id:y}}){const{id:r}=A(),{translate:a}=C(),g=x(),[u,d]=e.useState(!1),f=Number(t)>0?S(t):"Never",v=n||o,m=()=>d(!0),i=()=>d(!1),k=async()=>{await h()},{isPending:p,error:c,mutateAsync:h}=E({mutationKey:["ROLL_API_KEY"+r],mutationFn:()=>fetch(_(`/apps/${r}/credentials/${y}`),{method:"PUT",body:JSON.stringify({clientId:n,clientSecret:o})}),onSuccess:()=>{g.invalidateQueries({queryKey:["APP:"+r]}),i()}});return e.createElement(e.Fragment,null,e.createElement(F,{onClick:m},e.createElement("span",{"data-translation-key":"dev.app.key.roll"},a("dev.app.key.roll","Roll API key")),e.createElement(I,{size:"20px",color:"#161616"})),e.createElement(w,{open:u,onOpen:m,onClose:i},e.createElement(N,null,e.createElement(e.Fragment,null,e.createElement(P,{"data-translation-key":"dev.roll.key.dialog.title"},a("dev.roll.key.dialog.title","Roll API key")),e.createElement(L,null,e.createElement("span",{"data-translation-key":"dev.roll.key.dialog.apiKey"},a("dev.roll.key.dialog.apiKey","API key")),e.createElement("span",null,O(v||"")),e.createElement("span",{"data-translation-key":"dev.roll.key.dialog.expires"},a("dev.roll.key.dialog.expires","Expires")),e.createElement("span",null,f)),e.createElement(z,null),e.createElement("div",{"data-translation-key":"dev.roll.key.dialog.confirmation"},a("dev.roll.key.dialog.confirmation","Are you sure you want to roll this API key?")),c&&e.createElement(R,{type:"danger"},c.message),e.createElement($,null,e.createElement(b,{onClick:i,"data-translation-key":"dev.roll.key.dialog.cancel",variant:"text",size:"large"},a("dev.roll.key.dialog.cancel","Cancel")),e.createElement(K,{variant:"primary",onClick:k,disabled:p,loading:p,"data-translation-key":"dev.roll.key.dialog.roll"},a("dev.roll.key.dialog.roll","Roll API key")))))))}function O(t){if(t.length>s*2){const n=t.slice(0,s),o=t.slice(-s);return`${n} . . . ${o}`}return t}const L=l.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: 1fr 1fr;
|
|
4
4
|
|
|
@@ -11,14 +11,14 @@ import*as e from"react";import o from"styled-components";import{useMutation as E
|
|
|
11
11
|
max-width: 170px;
|
|
12
12
|
word-break: break-all;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
`,$=l.div`
|
|
15
15
|
display: flex;
|
|
16
16
|
justify-content: flex-end;
|
|
17
17
|
align-items: center;
|
|
18
18
|
gap: var(--spacing-base);
|
|
19
19
|
margin-top: auto;
|
|
20
20
|
padding-top: 30px;
|
|
21
|
-
|
|
21
|
+
`,F=l.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
cursor: pointer;
|
|
@@ -34,9 +34,9 @@ import*as e from"react";import o from"styled-components";import{useMutation as E
|
|
|
34
34
|
&:hover {
|
|
35
35
|
background: var(--color-red-2);
|
|
36
36
|
}
|
|
37
|
-
`,
|
|
37
|
+
`,N=l.div`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
min-height: 428px;
|
|
41
41
|
width: 344px;
|
|
42
|
-
`;export{
|
|
42
|
+
`;export{$ as ButtonsContainer,B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useMutation as
|
|
1
|
+
import*as e from"react";import{useMutation as k,useQueryClient as A}from"@tanstack/react-query";import{useParams as C}from"react-router";import{Button as h}from"@redocly/theme/components/Button/Button";import{H3 as v}from"@redocly/theme/components/Typography/H3";import{Admonition as P}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{useTranslate as S}from"../../../../../client/app/l10n/hooks";import{ButtonWithLoading as b}from"./ButtonWithLoading";import{Dialog as U}from"./Dialog";import I from"./ApisList";import{ButtonsWrapper as K}from"./ApiKeyItem";import{apiKeysUrl as T}from"../../../../../utils/url/api-keys-url";function j(m){const p=A(),{credential:a,open:c,onClose:n,onOpen:u}=m,{translate:i}=S(),{id:o}=C(),r=e.useMemo(()=>a.apiProductsStatus?.map(t=>t.apiId||t.id),[a]),[l,y]=e.useState(r),{isPending:d,error:s,mutateAsync:g}=k({mutationKey:["MUTATE_CRED"+o],mutationFn:()=>fetch(T(`/apps/${o}/credentials/${a.id}`),{method:"PUT",body:JSON.stringify({apiProductIds:l,clientId:a.clientId,clientSecret:a.clientSecret})}).then(t=>t.json()),onSuccess:()=>{p.invalidateQueries({queryKey:["APP:"+o]})}}),f=async()=>{await g(),n()},E=t=>{y(t||[])};return e.createElement(e.Fragment,null,e.createElement(U,{open:c,onClose:n,onOpen:u},e.createElement(e.Fragment,null,e.createElement(v,{"data-translation-key":"dev.update.key.dialog.title"},i("dev.update.key.dialog.title","Update key")),e.createElement(I,{initialEnabledApis:r,onChange:E}),s?e.createElement(P,{type:"danger"}," ",s.message," "):null,e.createElement(K,null,e.createElement(h,{onClick:n,"data-translation-key":"dev.update.key.dialog.cancel"},i("dev.update.key.dialog.cancel","Cancel")),e.createElement(b,{variant:"primary",onClick:f,disabled:d||l.length<1,loading:d,"data-translation-key":"dev.update.key.dialog.update"},i("dev.update.key.dialog.update","Update key"))))))}export{j as UpdateKey};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ToolListEntry } from './build-tool-list.js';
|
|
2
|
-
export declare const DESCRIPTION_CHAR_LIMIT = 2048;
|
|
3
2
|
export declare const EXECUTE_ARGS_NOTE = "Both `execute` arguments are required: `code` (the JavaScript to run; return a value to receive it) and `description` (a short human-readable summary of what the code does).";
|
|
4
3
|
/** The first line names the docs at `docsUrl` when the prose with it fits `DESCRIPTION_CHAR_LIMIT`. */
|
|
5
4
|
export declare function buildExecuteDescription(hasFetch: boolean, toolList?: ToolListEntry[], docsUrl?: string): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import{buildToolList as c}from"./build-tool-list.js";const n=2048,m="Both `execute` arguments are required: `code` (the JavaScript to run; return a value to receive it) and `description` (a short human-readable summary of what the code does).",a="Available tools (exact signatures come from `describe-tools`):";function i(e,t){if(t.length===0)return e;const o=n-e.length-a.length-3,s=c(t,o);return s?[e,"",a,s].join(`
|
|
2
2
|
`):e}const u="Run JavaScript in a sandbox against the documentation tools on the global `tools` object.";function r(e,t){return[e,t?"The extra globals are `tools`, `fetch`, `URL`, `URLSearchParams`, and `FormData` - there is no `console`, `setTimeout`, `require`, or Node.js API; all other I/O goes through `tools`.":"The only extra global is `tools` - there is no `fetch`, `console`, `setTimeout`, `require`, or Node.js API; all I/O goes through `tools`.","","Workflow - minimize round-trips; one `describe-tools` call plus one `execute` call covers most requests:","1. Analyze the request and decide which sandbox tools it needs.","2. Call `describe-tools` with those names to get their exact TypeScript signatures - inputs, result shapes, and a worked example. NEVER call `execute` with guessed method names, parameter names, enum values, or result field names: read fields off the declared return types, not from assumptions.","3. Batch everything into a SINGLE script: chain tool calls, pass one call's output into the next, process results in plain JavaScript, and `return` only what the request needs."].join(`
|
|
3
3
|
`)}function g(e,t=[],o){const s=o&&r(`Run JavaScript in a sandbox against the tools for the documentation at ${o}. The tools are on the global \`tools\` object.`,e),l=s&&s.length<=n?s:r(u,e);return i(l,t)}const b=["Get the exact TypeScript signatures of the sandbox tools available to `execute`.","Analyze the user request first, then pass `tools` with only the tool names the request needs (every name is listed in this input schema / description); omit `tools` only when you cannot tell which tools apply.","Always call this before your first `execute` and never guess signatures. Request every tool the task may need in ONE call instead of calling this repeatedly."].join(`
|
|
4
|
-
`);function
|
|
4
|
+
`);function f(e,t=[]){const o=["This server exposes documentation tools (API discovery, endpoint details, security schemes, full-text search) through `describe-tools` and `execute`:","- `describe-tools` returns the exact TypeScript signatures of the sandbox tools.","- `execute` runs JavaScript that calls those tools on the global `tools` object.","Workflow: analyze the request, call `describe-tools` once with `tools` set to only the names it needs, then batch everything into a single `execute` script. Minimize round-trips and never guess tool signatures.",...e?["The sandbox also has a global `fetch` that can call the documented APIs (allow-listed hosts only). Include `fetch` in your `describe-tools` call to get its contract and the list of callable APIs."]:[]].join(`
|
|
5
5
|
`);return i(o,t)}const h=["listApis","getEndpoints"],d=["Example - list the write endpoints of an API:","","```ts","const { items } = await tools.listApis({ filter: 'billing' });","const [api] = items;",`if (!api) return { error: 'no API matches "billing"' };`,"const { endpoints } = await tools.getEndpoints({ name: api.name });","const writes = endpoints.filter((e) => e.method !== 'GET');","return { api: api.name, writes: writes.map((e) => `${e.method} ${e.path}`) };","```"].join(`
|
|
6
|
-
`);function
|
|
6
|
+
`);function x(e){if(h.every(o=>e.includes(o)))return d;const[t]=e;return t?[`Example - call \`${t}\` and return what the request needs:`,"","```ts",`const result = await tools.${t}({ /* the input its signature above declares */ });`,"return result;","```"].join(`
|
|
7
7
|
`):""}const y=["Types named `OpenApi\u2026` are the standard OpenAPI Specification objects.","Payload samples live on a media type object (`requestBody.content[mediaType]`, `responses[code].content[mediaType]`): `.example` holds a single value, `.examples[name].value` a named map, and some descriptions only set `.schema.example`. Read each before concluding a sample is absent."].join(`
|
|
8
|
-
`);export{b as DESCRIBE_TOOLS_DESCRIPTION,
|
|
8
|
+
`);export{b as DESCRIBE_TOOLS_DESCRIPTION,m as EXECUTE_ARGS_NOTE,y as USAGE_NOTES,f as buildCodeModeInstructions,g as buildExecuteDescription,x as buildExecuteExample};
|
|
@@ -10,9 +10,7 @@ export declare const McpErrorCodes: {
|
|
|
10
10
|
readonly InvalidParams: -32602;
|
|
11
11
|
};
|
|
12
12
|
export declare const MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
13
|
-
export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 30000;
|
|
14
13
|
export declare const SSE_KEEPALIVE_INTERVAL_MS = 15000;
|
|
15
|
-
export declare const MAX_DOCUMENTS_PER_CATEGORY = 3;
|
|
16
14
|
export declare const DEFAULT_DOCS_MCP_SERVER_NAME = "Docs MCP server";
|
|
17
15
|
export declare const SUPPORTED_MCP_SCOPES: readonly ['openid', 'profile', 'email', 'offline_access'];
|
|
18
16
|
export declare const CREATE_ANONYMOUS_SESSION_TOOL_NAME = "createAnonymousSession";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const t={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},_=o,
|
|
1
|
+
import{LATEST_PROTOCOL_VERSION as o}from"@modelcontextprotocol/server";const t={Docs:"docs"},r={InternalError:-32603,ServerError:-32e3,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602},_=o,s=15e3,E="Docs MCP server",n=["openid","profile","email","offline_access"],O="createAnonymousSession",c="submit-feedback",S="manageApiCredentials",A={readOnlyHint:!0,destructiveHint:!1,openWorldHint:!1},p="custom-mcp-tools-meta";export{O as CREATE_ANONYMOUS_SESSION_TOOL_NAME,p as CUSTOM_MCP_TOOLS_META_DIR,E as DEFAULT_DOCS_MCP_SERVER_NAME,S as MANAGE_API_CREDENTIALS_TOOL_NAME,_ as MCP_PROTOCOL_VERSION,r as McpErrorCodes,t as McpServerType,A as READ_ONLY_ANNOTATIONS,s as SSE_KEEPALIVE_INTERVAL_MS,c as SUBMIT_FEEDBACK_TOOL_NAME,n as SUPPORTED_MCP_SCOPES};
|
|
@@ -2,8 +2,6 @@ import type { OpenAPIDefinition } from '@redocly/api-docs';
|
|
|
2
2
|
import type { McpMode } from '../../../types.js';
|
|
3
3
|
/** Methods documented and visible at `path`, uppercased. */
|
|
4
4
|
export declare function visibleMethodsAt(definition: OpenAPIDefinition, path: string): string[];
|
|
5
|
-
/** Paths with at least one visible operation. */
|
|
6
|
-
export declare function visiblePaths(definition: OpenAPIDefinition): string[];
|
|
7
5
|
/** The tools that recover a lookup miss. The sandbox calls the same tools by their JS names. */
|
|
8
6
|
export declare function recoveryToolNames(mcpMode?: McpMode): {
|
|
9
7
|
endpoints: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatCandidates as r}from"../../utils/api-name-matching.js";import{visibleOperations as l}from"./utils.js";function i(t,e){return l(t.paths?.[e]).map(([o])=>o.toUpperCase()).sort()}function h(t){return Object.keys(t.paths??{}).filter(e=>i(t,e).length>0).sort()}function c(t){return t==="code"?{endpoints:"tools.getEndpoints",search:"tools.search",listApis:"tools.listApis"}:{endpoints:"get-endpoints",search:"search",listApis:"list-apis"}}function f(t,e,o,n){const s=h(t);if(s.length===0)return"Endpoint not found";const{endpoints:p,search:a}=c(n);return`No path "${o}" in "${e}". Documented paths: ${r(s)}. Call ${p} for the full list, or ${a} with a keyword from the request.`}function m(t,e,o,n){const s=i(t,o);return s.length===0?"Endpoint not found":`"${o}" in "${e}" documents no ${n.toUpperCase()}. Available methods: ${r(s)}.`}export{m as describeMethodMiss,f as describePathMiss,c as recoveryToolNames,i as visibleMethodsAt
|
|
1
|
+
import{formatCandidates as r}from"../../utils/api-name-matching.js";import{visibleOperations as l}from"./utils.js";function i(t,e){return l(t.paths?.[e]).map(([o])=>o.toUpperCase()).sort()}function h(t){return Object.keys(t.paths??{}).filter(e=>i(t,e).length>0).sort()}function c(t){return t==="code"?{endpoints:"tools.getEndpoints",search:"tools.search",listApis:"tools.listApis"}:{endpoints:"get-endpoints",search:"search",listApis:"list-apis"}}function f(t,e,o,n){const s=h(t);if(s.length===0)return"Endpoint not found";const{endpoints:p,search:a}=c(n);return`No path "${o}" in "${e}". Documented paths: ${r(s)}. Call ${p} for the full list, or ${a} with a keyword from the request.`}function m(t,e,o,n){const s=i(t,o);return s.length===0?"Endpoint not found":`"${o}" in "${e}" documents no ${n.toUpperCase()}. Available methods: ${r(s)}.`}export{m as describeMethodMiss,f as describePathMiss,c as recoveryToolNames,i as visibleMethodsAt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OpenAPIDefinition
|
|
1
|
+
import type { OpenAPIDefinition } from '@redocly/api-docs';
|
|
2
2
|
import type { RedoclyConfig } from '@redocly/config';
|
|
3
3
|
/** Whether the gateway fetch capability is on: the feature flag plus none of mcp/docs hidden. */
|
|
4
4
|
export declare function isGatewayCapabilityEnabled(mcp?: RedoclyConfig['mcp']): boolean;
|
|
@@ -8,15 +8,4 @@ export declare function isGatewayCapabilityEnabled(mcp?: RedoclyConfig['mcp']):
|
|
|
8
8
|
* `mcp.apiCalls` config by `getCallableApis`.
|
|
9
9
|
*/
|
|
10
10
|
export declare function isGatewayEligible(info: OpenAPIDefinition['info'] | undefined): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Whether an API docs page advertises the `/mcp` endpoint via an injected root-level x-mcp:
|
|
13
|
-
* the capability is on, the author has not provided their own x-mcp servers, and the API is
|
|
14
|
-
* both gateway-eligible and part of the Docs MCP catalog.
|
|
15
|
-
*/
|
|
16
|
-
export declare function shouldAdvertiseGatewayXMcp(definition: (OpenAPIDefinition & {
|
|
17
|
-
'x-mcp'?: {
|
|
18
|
-
servers?: unknown[];
|
|
19
|
-
};
|
|
20
|
-
}) | undefined, relativePath: string, mcpConfig?: RedoclyConfig['mcp']): boolean;
|
|
21
|
-
export declare function buildGatewayXMcp(url: string): OpenAPIMcp;
|
|
22
11
|
//# sourceMappingURL=eligibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isMcpGatewayEnabled as e}from"../utils/mode.js";import{isDefinitionHidden as t}from"../utils/xmcp-utils.js";function o(i){return e()&&!i?.hide&&!i?.docs?.hide}function r(i){return!t(i,"apiCalls")}export{o as isGatewayCapabilityEnabled,r as isGatewayEligible};
|
|
@@ -19,7 +19,5 @@ export declare class McpClientInputError extends Error {
|
|
|
19
19
|
}
|
|
20
20
|
export declare function createMethodNotAllowedError(requestId?: string | number | null): Response;
|
|
21
21
|
export declare function createInternalServerError(error: Error | string, requestId?: string | number | null): Response;
|
|
22
|
-
export declare function createInvalidRequestError(message?: string, requestId?: string | number | null): Response;
|
|
23
|
-
export declare function createInvalidParamsError(message?: string, requestId?: string | number | null): Response;
|
|
24
22
|
export declare function withErrorHandling<T>(operation: () => Promise<T>, mode?: McpMode): Promise<T | Response>;
|
|
25
23
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{telemetry as c}from"../../../telemetry/index.js";import{McpErrorCodes as o,McpServerType as i}from"../constants.js";import{serverAttributes as d}from"../utils/telemetry-attributes.js";class
|
|
1
|
+
import{telemetry as c}from"../../../telemetry/index.js";import{McpErrorCodes as o,McpServerType as i}from"../constants.js";import{serverAttributes as d}from"../utils/telemetry-attributes.js";class n extends Error{code;data;requestId;constructor(t,r,s,a){super(r),this.name="McpError",this.code=t,this.data=s,this.requestId=a}createErrorResponse(){const t={jsonrpc:"2.0",error:{code:this.code,message:this.message,...this.data?{data:this.data}:{}},id:this.requestId??null},r=u(this.code);return new Response(JSON.stringify(t),{status:r,headers:{"Content-Type":"application/json"}})}}class p extends Error{constructor(t,r){super(t,r),this.name="McpClientInputError"}}function u(e){switch(e){case o.InvalidRequest:case o.InvalidParams:return 400;case o.MethodNotFound:return 404;case o.ServerError:return 405;case o.InternalError:default:return 500}}function f(e){return new n(o.ServerError,"Method not allowed",void 0,e).createErrorResponse()}function l(e,t){const r=e instanceof Error?e.message:String(e);return new n(o.InternalError,"Internal server error mcp",r,t).createErrorResponse()}async function M(e,t="tools"){try{return await e()}catch(r){return c.sendMcpErrorMessage([{...d(i.Docs),message:r?.message||"",stack:r?.stack||"",error_class:r instanceof p?"client_error":"server_error",mode:t}]),l(r)}}export{p as McpClientInputError,n as McpError,l as createInternalServerError,f as createMethodNotAllowedError,M as withErrorHandling};
|
|
@@ -83,12 +83,4 @@ export declare function collectIgnoredRoutes(routes: {
|
|
|
83
83
|
export declare function isMcpInRedirects(redirects?: {
|
|
84
84
|
[key: string]: RedirectConfig;
|
|
85
85
|
}): boolean;
|
|
86
|
-
/** Whether an API definition is part of the Docs MCP catalog (not a localized copy, has public paths, not ignored via mcp.docs.ignore). */
|
|
87
|
-
export declare function isApiIncludedInDocsMcp(relativePath: string, definition: {
|
|
88
|
-
paths?: Record<string, unknown>;
|
|
89
|
-
} | undefined, mcpConfig: {
|
|
90
|
-
docs?: {
|
|
91
|
-
ignore?: readonly string[];
|
|
92
|
-
};
|
|
93
|
-
} | undefined): boolean;
|
|
94
86
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c,{join as f}from"node:path";import a from"picomatch";import{PUBLIC_API_DEFINITIONS_FOLDER as u,L10N_DIR_NAME as l,I18N_DIR_NAME as m}from"../../constants/common.js";import{RESERVED_ROUTES as h}from"../../plugins/get-reserved-routes.js";import{removeL10nPrefix as D}from"../../fs/utils/remove-l10n-prefix.js";import{removeTrailingSlash as A}from"../../../utils/url/remove-trailing-slash.js";import{slash as g}from"../../../utils/path/slash.js";import{canDownloadApiDefinition as d}from"../../utils/rbac.js";function v(e){return e.filter(t=>t.type==="openapi").map(t=>({relativePath:t.relativePath,definition:t.document}))}function T(e){return e.filter(t=>t.type==="graphql").map(t=>({relativePath:t.relativePath,definition:t.document,options:t.options}))}function p(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(p);const t={};for(const i in e)if(Object.hasOwn(e,i)){if(i.toString().startsWith("x-parsed-"))continue;t[i]=p(e[i])}return t}function N(e){return e.reduce((t,i)=>(i.relativePath.startsWith(l)||i.relativePath.startsWith(m)||!i.definition||typeof i.definition!="object"||!("paths"in i.definition)||i.definition?.paths&&Object.keys(i.definition.paths).length>0&&t.push({...i,definition:p(i.definition)}),t),[])}function S(e,t,i,r){const n={};for(const[o,s]of Object.entries(e))d(f(u,s.relativePath),i,r,t)&&(n[o]=s);return n}function b(e,t,i,r){return e.filter(n=>d(f(u,n.relativePath),i,r,t))}function M(e){return e.filter(({relativePath:t})=>!t.startsWith(l)&&!t.startsWith(m)).map(({relativePath:t,options:i})=>({name:i.info?.title||c.basename(t,c.extname(t)),description:i.info?.description,relativePath:t}))}function W(e,t){const i=a(t||[]);return e.filter(({relativePath:r})=>!i(r))}function q(e,t){if(!t?.length)return[];const i=a(t),r=e.filter(({fsPath:n})=>{if(!n)return!1;const o=g(n);return i(o)||i(D(o))}).map(({slug:n})=>A(n));return[...new Set(r)].sort()}function w(e={}){for(const[t,i]of Object.entries(e))if(t===h.mcp||(typeof i=="string"?i:i.to)===h.mcp)return!0;return!1}export{M as buildGraphqlDescriptions,T as bundledGraphqlDocumentsToMcpOpenApi,v as bundledOpenApiDocumentsToMcpOpenApi,q as collectIgnoredRoutes,S as filterApiDescriptionsByRbac,b as filterGraphqlDescriptionsByRbac,W as filterIgnoredApiDescriptions,N as getCleanedUpApiDescriptions,w as isMcpInRedirects};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a developer onboarding API path under the configured path prefix.
|
|
3
|
+
*
|
|
4
|
+
* @param path - The path relative to the api-keys API base (e.g., "/meta", "/apps/:id").
|
|
5
|
+
* @returns The api-keys API path, prefixed with `REDOCLY_PREFIX_PATHS` when it is set.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* apiKeysUrl('/apps/my-app'); // "/api/api-keys/apps/my-app" (or "/prefix/api/api-keys/apps/my-app")
|
|
9
|
+
*/
|
|
10
|
+
export declare function apiKeysUrl(path: string): string;
|
|
11
|
+
//# sourceMappingURL=api-keys-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withPathPrefix as r}from"@redocly/theme/core/utils";function e(i){return r(`/api/api-keys${i}`)}export{e as apiKeysUrl};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/revel",
|
|
3
|
-
"version": "0.139.0-next.
|
|
3
|
+
"version": "0.139.0-next.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@opentelemetry/sdk-trace-web": "2.8.0",
|
|
34
34
|
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
35
35
|
"@redocly/ajv": "8.18.0",
|
|
36
|
-
"@redocly/api-docs": "0.4.0-next.
|
|
36
|
+
"@redocly/api-docs": "0.4.0-next.7",
|
|
37
37
|
"@redocly/config": "0.66.0",
|
|
38
|
-
"@redocly/openapi-core": "2.
|
|
38
|
+
"@redocly/openapi-core": "2.64.0",
|
|
39
39
|
"@redocly/portal-legacy-ui": "0.19.0",
|
|
40
|
-
"@redocly/portal-plugin-mock-server": "0.24.0-next.
|
|
40
|
+
"@redocly/portal-plugin-mock-server": "0.24.0-next.1",
|
|
41
41
|
"@redocly/realm-asyncapi-sdk": "0.16.0",
|
|
42
|
-
"@redocly/theme": "0.71.0-next.
|
|
42
|
+
"@redocly/theme": "0.71.0-next.4",
|
|
43
43
|
"@shikijs/transformers": "3.21.0",
|
|
44
44
|
"@tanstack/react-query": "5.62.3",
|
|
45
45
|
"@tanstack/react-table": "8.21.3",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import c from"node:fs";import f from"node:path";import{MAX_DOCUMENTS_PER_CATEGORY as $}from"../../../constants.js";function j(m,u){return Object.entries(m).map(([h,s])=>{if(!s||s.length===0)return"";const x=s.slice(0,$).map(d=>{const{document:t,highlight:o}=d,p=o?.title||(Array.isArray(t.title)?t.title[0]:t.title);let n=`Document: ${t.title}`;n+=`### [${p}](${t.url})
|
|
2
|
-
|
|
3
|
-
`;let r;if(t.url)try{let e=t.url.startsWith("/")?t.url.slice(1):t.url;const i=e.indexOf("#");i!==-1&&(e=e.substring(0,i));const l=f.extname(e);l&&(e=e.slice(0,-l.length));const y=e+".md",a=f.join(u,y);c.existsSync(a)&&(r=c.readFileSync(a,"utf8"))}catch{}return r||(r=o?.text||(Array.isArray(t.text)?t.text[0]:t.text)),n+=r,t.facets&&(n+=`
|
|
4
|
-
|
|
5
|
-
**Categories:**
|
|
6
|
-
`,Object.entries(t.facets).forEach(([e,i])=>{n+=`- ${e}: ${i}
|
|
7
|
-
`})),n});return`## ${h}
|
|
8
|
-
|
|
9
|
-
${x}`}).join(`
|
|
10
|
-
|
|
11
|
-
`).trim()}export{j as processDocuments};
|