@redocly/redoc-reef 0.139.0-next.6 → 0.139.0-next.8
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 +49 -0
- package/dist/client/app/Sidebar/RequestAccessButton.js +2 -2
- package/dist/constants/l10n/langs/ar.js +1 -1
- package/dist/constants/l10n/langs/de.js +1 -1
- package/dist/constants/l10n/langs/en.js +1 -1
- package/dist/constants/l10n/langs/es.js +1 -1
- package/dist/constants/l10n/langs/fr.js +1 -1
- package/dist/constants/l10n/langs/hi.js +1 -1
- package/dist/constants/l10n/langs/it.js +1 -1
- package/dist/constants/l10n/langs/ja.js +1 -1
- package/dist/constants/l10n/langs/ko.js +1 -1
- package/dist/constants/l10n/langs/pl.js +1 -1
- package/dist/constants/l10n/langs/pt-BR.js +1 -1
- package/dist/constants/l10n/langs/pt.js +1 -1
- package/dist/constants/l10n/langs/ru.js +1 -1
- package/dist/constants/l10n/langs/uk.js +1 -1
- package/dist/constants/l10n/langs/zh.js +1 -1
- package/dist/markdoc/helpers/get-inner-text.d.ts +2 -0
- package/dist/markdoc/helpers/get-inner-text.js +2 -2
- package/dist/markdoc/helpers/remove-markdoc-tags.js +1 -1
- package/dist/server/plugins/api-docs/search/get-ai-search-documents.js +67 -67
- package/dist/server/plugins/arazzo-docs/arazzo-doc-loader.js +2 -2
- package/dist/server/plugins/arazzo-docs/index.js +1 -1
- package/dist/server/plugins/catalog-entities/extensions/extractors/api-description/openapi-entities-extractor.js +1 -1
- 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/markdown/index.js +1 -1
- package/dist/server/plugins/markdown/markdoc/plugins/utils.js +1 -1
- package/dist/server/plugins/markdown/search/search-resolver.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/server/plugins/pages/index.js +1 -1
- package/dist/server/plugins/register-page-props.d.ts +1 -1
- package/dist/server/plugins/register-page-props.js +1 -1
- package/dist/server/plugins/sidebars/index.js +1 -1
- package/dist/server/plugins/sidebars/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 +6 -6
- 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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as
|
|
2
|
-
`),
|
|
1
|
+
import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as l}from"./get-variable.js";import{isNode as p}from"./guards/is-node.js";import{isTag as a}from"./guards/is-tag.js";import{isCodeNode as d}from"./guards/is-code-node.js";import{isConditionalNode as c}from"./guards/is-conditional-node.js";import{isExampleNode as u}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as g}from"./guards/is-text-node.js";import{isFunction as N}from"./guards/is-function.js";import{isVariable as T}from"./guards/is-variable.js";import{isPromptNode as b}from"./guards/is-prompt-node.js";function t(f,r={}){const{isTrim:s=!0}=r,i=[];for(const e of f){if(n(e))i.push(String(e));else if(p(e)){if(b(e))continue;if(e.type==="tr"&&i.push(`
|
|
2
|
+
`),g(e)||d(e)||h(e))i.push(t([o(e,"content")],r));else if(u(e))i.push(t(e.children.map(m=>o(m,"content")),r));else{if(c(e)&&r.skipConditionals)continue;if(e.type==="tag"&&r.renderTag){const m=()=>t(e.children,r);i.push(r.renderTag(e,{getBody:m})??m())}else i.push(t(e.children,r))}}else a(e)?i.push(t(e.children,r)):N(e)&&i.push(t(Object.values(e.parameters),r));T(e)&&i.push(t([l(e,r.variables)],r))}return s?i.map(e=>e.trim()).join(" ").trim():i.join(" ")}export{t as getInnerText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from"@markdoc/markdoc";import{skipAgentsOnlyContent as e}from"@redocly/theme/markdoc/tags/visibility";import{getInnerText as t}from"./get-inner-text.js";function a(r){if(!r)return r;const o=n.parse(r);return t([o],{renderTag:e})}export{a as removeMarkdocTags};
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
`+en,sn=G+z;O.push({title:E||"API Overview",description:q,content:on,slug:
|
|
1
|
+
import C from"node:path";import{REDOCLY_TEAMS_RBAC as x}from"@redocly/config";import{nodeTypes as m,contentType as g,isGraphqlFieldsNode as ln,resolveGraphqlItemFields as fn}from"@redocly/api-docs";import{normalizeApiVersion as an}from"../utils/normalize-api-version.js";import{replaceFileExtension as v}from"../utils/replace-file-extension.js";import{isResourcePubliclyAccessible as pn,canDownloadApiDefinition as un,extractTeamsFromScopeItems as dn}from"../../../utils/rbac.js";import{getLlmsTxtMdPathBySlug as H}from"../../../utils/llmstxt/get-llms-txt-md-path-by-slug.js";import{PUBLIC_API_DEFINITIONS_FOLDER as Y}from"../../../constants/common.js";import{GRAPHQL_SPEC_SLUG as hn}from"../../../../constants/common.js";import{ANONYMOUS_AUTH_DETAILS as mn}from"../../../constants/rbac.js";import{toMarkdown as N}from"../../markdown/search/to-markdown.js";import{createRenderTagFn as $n}from"../../markdown/search/create-render-tag-fn.js";import{getLocaleFromRelativePath as yn}from"../../../fs/utils/get-locale-from-relative-path.js";import{getBuildTranslateContext as gn}from"../../../utils/l10n/get-build-translate-context.js";import{llmsTxtLink as w}from"../../search/llmstxt/index.js";import{formatDocumentMetadata as bn}from"../../search/utils.js";import{extractDocumentSearchFacets as In}from"./search-facets.js";import{createApiDocsSearchIndexer as Pn,createLlmDescriptionFormatter as Sn}from"./create-indexer.js";function P(e,s){return s==="openapi"&&"openapi"in e}function K(e,s){return s==="asyncapi"&&"asyncapi"in e}function Xn({items:e,metadata:s,store:c,document:r,specType:n,excludeFromSearch:l,basePath:t,getSearchFacets:i,markdocTags:f}){return async(o,d,p,u)=>{if(l)return;const h={...u.markdocOptions?.tags,...f},{locale:$,translate:nn}=await gn(o.slug,u.getGlobalData?.().l10n),S=$n(h,$,nn),L=u.getConfig(),R=yn(o.fsPath),D=Sn(S),j=Pn(t,D,c?.schemaStore,r,c?.exampleStore,c?.graphqlMeta),V=b=>{for(const a of b)j.addItem(a),a.items?.length&&V(a.items)};V(e);const tn=j.getResult(),F=new Map;for(const b of tn)F.set(b.url,b);const E=typeof s.title=="string"?s.title:void 0,_=an(s.version),k=In(o.metadata||{},E,_,i),A=[],O=[],q=typeof s.description=="string"&&s.description?D(s.description):void 0,G=An(s,q,r,n,D),z=On(n,s,o.fsPath,L),en=Tn(e,L,S),on=G+z+`
|
|
2
|
+
`+en,sn=G+z;O.push({title:E||"API Overview",description:q,content:on,slug:t,fsPath:o.fsPath,includeInLLMsTxt:!0}),A.push({title:E||"API Overview",content:sn,url:t,fsPath:o.fsPath,locale:R,product:o.product?.name,facets:k});const rn=r&&P(r,n)?r.security:void 0,U=b=>{for(const a of b){if(!a.content||!a.link){a.items?.length&&U(a.items);continue}const cn=F.get(a.link),W=a.content.contentType,B=a[x],J=B?dn(B):void 0,Q=J?.length?J:void 0;if(W===g.ITEM){const y=Ln(a,r,n)??X(a,cn,n,_,rn,S,c);if(y){const I=a.label||"";O.push({title:I,description:void 0,content:y,slug:a.link,fsPath:o.fsPath,includeInLLMsTxt:!1}),A.push({title:I,content:y,url:a.link,fsPath:o.fsPath,locale:R,product:o.product?.name,facets:k,rbacTeams:Q})}}else if(W===g.GROUP){const y=Rn(a,L,n,S,c);if(y){const I=a.label||"";O.push({title:I,description:void 0,content:y.llmstxt,slug:a.link,fsPath:o.fsPath,includeInLLMsTxt:!1}),A.push({title:I,content:y.aiSearch,url:a.link,fsPath:o.fsPath,locale:R,product:o.product?.name,facets:k,rbacTeams:Q})}}a.items?.length&&U(a.items)}};return U(e),{async getLLMsTxts(){return O},async getSearchDocuments(){return A}}}}function An(e,s,c,r,n){const l=typeof e.title=="string"?e.title:"",t=typeof e.summary=="string"?e.summary:"",i=typeof e.version=="string"?e.version:"";let f=l?`# ${l}
|
|
3
3
|
|
|
4
|
-
`:"";if(f+=
|
|
4
|
+
`:"";if(f+=s?`${s}
|
|
5
5
|
|
|
6
|
-
`:"",f+=
|
|
6
|
+
`:"",f+=t?`${t}
|
|
7
7
|
|
|
8
|
-
`:"",f+=
|
|
9
|
-
`:"",
|
|
10
|
-
`);const d=
|
|
8
|
+
`:"",f+=i?`Version: ${i}
|
|
9
|
+
`:"",c){if(P(c,r)){const{info:o}=c;o?.license?.name&&(f+=`License: ${o.license.name}
|
|
10
|
+
`);const d=o["x-metadata"],p=bn(d);p&&(f+=`
|
|
11
11
|
Metadata:
|
|
12
12
|
${p}
|
|
13
|
-
`)}else if(K(
|
|
13
|
+
`)}else if(K(c,r)){const{info:o}=c;o?.license?.name&&(f+=`License: ${o.license.name}
|
|
14
14
|
`)}}return f+=`
|
|
15
|
-
`,f+=
|
|
15
|
+
`,f+=Cn(c,r,n),f+=xn(c,r,n),f}function On(e,s,c,r){if(!c)return"";let n,l,t;if(e==="openapi")n=C.posix.join(Y,v(c,".yaml")),l="## Download OpenAPI description",t="OpenAPI definition";else if(e==="asyncapi")n=C.posix.join(Y,v(c,".yaml")),l="## Download AsyncAPI description",t="AsyncAPI definition";else if(e==="graphql"){const o=C.posix.extname(c)||".graphql";n=C.posix.join(hn,v(c,o)),l="## Download GraphQL schema",t="GraphQL schema"}else return"";if(!un(n,r.access?.rbac??{},r.access?.requiresLogin??!1,mn))return"";const f=typeof s.title=="string"&&s.title||t;return`${l}
|
|
16
16
|
|
|
17
|
-
- ${w({title:f,description:void 0,slug:n,siteUrl:
|
|
17
|
+
- ${w({title:f,description:void 0,slug:n,siteUrl:r.seo?.siteUrl})}`}function Cn(e,s,c){if(!e)return"";if(P(e,s)){const{servers:r}=e;if(!r?.length)return"";let n=`## Servers
|
|
18
18
|
|
|
19
|
-
`;for(const
|
|
19
|
+
`;for(const l of r)if(l.description&&(n+=`${c(l.description)}
|
|
20
20
|
`),n+=`\`\`\`
|
|
21
|
-
${
|
|
21
|
+
${l.url}
|
|
22
22
|
\`\`\`
|
|
23
23
|
|
|
24
|
-
`,
|
|
25
|
-
`;for(const[i
|
|
26
|
-
`,
|
|
27
|
-
`),
|
|
24
|
+
`,l.variables){n+=`Variables:
|
|
25
|
+
`;for(const[t,i]of Object.entries(l.variables))n+=`- \`${t}\`${i.description?`: ${c(i.description).replace(/\s+/g," ")}`:""}
|
|
26
|
+
`,i.default&&(n+=` Default: ${JSON.stringify(i.default)}
|
|
27
|
+
`),i.enum&&(n+=` Enum: ${i.enum.map(f=>JSON.stringify(f)).join(", ")}
|
|
28
28
|
`);n+=`
|
|
29
|
-
`}return n}if(K(
|
|
29
|
+
`}return n}if(K(e,s)){const{servers:r}=e;if(!r||!Object.keys(r).length)return"";let n=`## Servers
|
|
30
30
|
|
|
31
|
-
`;for(const[
|
|
31
|
+
`;for(const[l,t]of Object.entries(r))n+=`### ${l}
|
|
32
32
|
|
|
33
|
-
`,
|
|
34
|
-
`),
|
|
35
|
-
`),
|
|
36
|
-
`),
|
|
37
|
-
`),
|
|
33
|
+
`,t.description&&(n+=`${c(t.description)}
|
|
34
|
+
`),t.host&&(n+=`Host: ${t.host}
|
|
35
|
+
`),t.protocol&&(n+=`Protocol: ${t.protocol}
|
|
36
|
+
`),t.protocolVersion&&(n+=`Protocol Version: ${t.protocolVersion}
|
|
37
|
+
`),t.pathname&&(n+=`Pathname: ${t.pathname}
|
|
38
38
|
`),n+=`
|
|
39
|
-
`;return n}return""}function
|
|
40
|
-
|
|
41
|
-
`;for(const[
|
|
42
|
-
|
|
43
|
-
`,
|
|
44
|
-
|
|
45
|
-
`),
|
|
46
|
-
`),
|
|
47
|
-
`),
|
|
48
|
-
`),
|
|
49
|
-
`),
|
|
50
|
-
`),
|
|
51
|
-
`);const f=
|
|
52
|
-
`),"tokenUrl"in
|
|
53
|
-
`),
|
|
54
|
-
`;for(const[d,p]of Object.entries(
|
|
39
|
+
`;return n}return""}function xn(e,s,c){if(!e||!P(e,s))return"";const r=e.components?.securitySchemes;if(!r)return"";let n=`## Security
|
|
40
|
+
|
|
41
|
+
`;for(const[l,t]of Object.entries(r)){if(!t||"$ref"in t)continue;const i=t;n+=`### ${l}
|
|
42
|
+
|
|
43
|
+
`,i.description&&(n+=`${c(i.description)}
|
|
44
|
+
|
|
45
|
+
`),i.type&&(n+=`Type: ${i.type}
|
|
46
|
+
`),i.in&&(n+=`In: ${i.in}
|
|
47
|
+
`),i.name&&(n+=`Name: ${i.name}
|
|
48
|
+
`),i.scheme&&(n+=`Scheme: ${i.scheme}
|
|
49
|
+
`),i.bearerFormat&&(n+=`Bearer Format: ${i.bearerFormat}
|
|
50
|
+
`),i.openIdConnectUrl&&(n+=`OpenID Connect URL: ${i.openIdConnectUrl}
|
|
51
|
+
`);const f=i.flows,o=f?.implicit||f?.password||f?.clientCredentials||f?.authorizationCode;if(o&&("authorizationUrl"in o&&o.authorizationUrl&&(n+=`Authorization URL: ${o.authorizationUrl}
|
|
52
|
+
`),"tokenUrl"in o&&o.tokenUrl&&(n+=`Token URL: ${o.tokenUrl}
|
|
53
|
+
`),o.scopes)){n+=`Scopes:
|
|
54
|
+
`;for(const[d,p]of Object.entries(o.scopes))n+=`- \`${d}\`: ${p}
|
|
55
55
|
`}n+=`
|
|
56
|
-
`}return n}function
|
|
56
|
+
`}return n}function Tn(e,s,c){let r="";const n=(l,t)=>{for(const i of l)if(i.link){if(i.content?.contentType===g.GROUP)r+=`${t} ${i.label||""}
|
|
57
57
|
|
|
58
|
-
`,
|
|
58
|
+
`,i.items?.length&&n(i.items,t+"#");else if(i.content?.contentType===g.ITEM){if(!M(i,s))continue;const f=i,o=f.httpVerb,d=f.httpPath,p=o&&d?`${o.toUpperCase()} ${d}`:i.label||"",u=i.content?T(i.content.children,c):void 0;r+=` - ${w({title:p,description:u?u.slice(0,200):void 0,slug:H(i.link),siteUrl:s.seo?.siteUrl})}`}}};return n(e,"##"),r}function X(e,s,c,r,n,l,t){if(!e.content)return;const i=e,f=e.label||"",o=T(e.content.children,l),d=e.content.meta?.deprecated;let p=`# ${f}${d?" (deprecated)":""}
|
|
59
59
|
|
|
60
|
-
`;if(
|
|
60
|
+
`;if(o&&(p+=`${o}
|
|
61
61
|
|
|
62
|
-
`),
|
|
62
|
+
`),c==="openapi"||c==="asyncapi"){const u=i.httpVerb,h=i.httpPath;u&&h?p+=`Endpoint: ${u.toUpperCase()} ${h}
|
|
63
63
|
`:u&&(p+=`Method: ${u.toUpperCase()}
|
|
64
|
-
`),
|
|
65
|
-
`);const $=Dn(
|
|
66
|
-
`)}return
|
|
67
|
-
`+En(
|
|
68
|
-
`),
|
|
64
|
+
`),r&&(p+=`Version: ${r}
|
|
65
|
+
`);const $=Dn(e.content.children,n);$&&(p+=`Security: ${$}
|
|
66
|
+
`)}return s?.parameters?.length&&c!=="graphql"&&(p+=`
|
|
67
|
+
`+En(s.parameters)+`
|
|
68
|
+
`),c==="graphql"&&(p+=kn(e.content.children,t,l)),p}function Ln(e,s,c){if(e.httpVerb!=="tool"||!s||!P(s,c))return;const r=e.content?.meta?.name,n=r?s["x-mcp"]?.tools?.find(t=>t.name===r):void 0;if(!n)return;let l=`# ${e.label||n.name}
|
|
69
69
|
|
|
70
|
-
`;return typeof n.description=="string"&&n.description&&(
|
|
70
|
+
`;return typeof n.description=="string"&&n.description&&(l+=`${n.description}
|
|
71
71
|
|
|
72
|
-
`),
|
|
72
|
+
`),l+=`## Input schema:
|
|
73
73
|
|
|
74
|
-
`,
|
|
74
|
+
`,l+=`\`\`\`json
|
|
75
75
|
${JSON.stringify(n.inputSchema,null,2)}
|
|
76
76
|
\`\`\`
|
|
77
77
|
|
|
78
|
-
`,n.outputSchema&&(
|
|
78
|
+
`,n.outputSchema&&(l+=`## Output schema:
|
|
79
79
|
|
|
80
|
-
`,
|
|
80
|
+
`,l+=`\`\`\`json
|
|
81
81
|
${JSON.stringify(n.outputSchema,null,2)}
|
|
82
82
|
\`\`\`
|
|
83
83
|
|
|
84
|
-
`),
|
|
84
|
+
`),l}function Rn(e,s,c,r,n){if(!e.content)return;const l=e.label||"",t=T(e.content.children,r);let i=`# ${l}
|
|
85
85
|
|
|
86
|
-
`;if(
|
|
86
|
+
`;if(t&&(i+=`${t}
|
|
87
87
|
|
|
88
|
-
`),
|
|
88
|
+
`),c==="graphql"){let o="";const d=p=>{for(const u of p??[])if(!(!u.content||!M(u,s)))if(u.content.contentType===g.ITEM){const h=X(u,void 0,c,void 0,void 0,r,n);h&&(o+=`${h}
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
`)}else u.content.contentType===g.GROUP&&d(u.items)};return d(
|
|
93
|
-
`;return f&&(
|
|
94
|
-
`),
|
|
95
|
-
`:
|
|
96
|
-
`),
|
|
92
|
+
`)}else u.content.contentType===g.GROUP&&d(u.items)};return d(e.items),{llmstxt:i+o,aiSearch:i}}let f="";if(e.items?.length)for(const o of e.items){if(!o.link||!o.content||o.content.contentType!==g.ITEM||!M(o,s))continue;const d=o,p=d.httpVerb,u=d.httpPath,h=p&&u?`${p.toUpperCase()} ${u}`:o.label||"",$=o.content?T(o.content.children,r):void 0;f+=` - ${w({title:h,description:$?$.slice(0,200):void 0,slug:H(o.link),siteUrl:s.seo?.siteUrl})}`}return{llmstxt:i+f,aiSearch:i}}function Dn(e,s){const c=[],r=n=>{for(const l of n)if(l.nodeType===m.SECURITY){const t=l;for(const i of t.requirements)for(const f of i.schemes)f[x]||f.name&&!c.includes(f.name)&&c.push(f.name)}else(l.nodeType===m.CONTAINER||l.nodeType===m.OVERVIEW_SECTION_WRAPPER)&&r(l.children)};if(r(e),c.length)return c.join(", ");if(s?.length){const n=s.flatMap(l=>Object.keys(l));if(n.length)return[...new Set(n)].join(", ")}}function En(e){const s={};for(const r of e){const n=`${r.place}${r.mediaType?` (${r.mediaType})`:""}`;s[n]||(s[n]=[]),s[n].push(r)}return Object.entries(s).map(([r,n])=>{const l=n.map(t=>{const i=[...t.path||[],t.name],f=Array.isArray(t.description)?t.description.join(" "):t.description;let o=` - \`${i.join(".")}\` (${t.type}${t.required?", required":""})
|
|
93
|
+
`;return f&&(o+=` ${f.trim()}
|
|
94
|
+
`),t.enum?o+=` Enum: ${t.enum.map(d=>JSON.stringify(d)).join(", ")}
|
|
95
|
+
`:t.example&&(o+=` Example: ${t.example}
|
|
96
|
+
`),o});return`## ${Z(r)}:
|
|
97
97
|
|
|
98
|
-
${
|
|
98
|
+
${l.join(`
|
|
99
99
|
`)}`}).join(`
|
|
100
|
-
`)}function kn(
|
|
101
|
-
## ${Z(
|
|
100
|
+
`)}function kn(e,s,c){let r="";const n=l=>{for(const t of l)if(t.nodeType===m.ITEM){const i=ln(t)?fn(t,s??{}):void 0;i&&(r+=Un(i,t.variant,c))}else(t.nodeType===m.CONTAINER||t.nodeType===m.OVERVIEW_SECTION_WRAPPER)&&n(t.children)};return n(e),r}function Un(e,s,c){let n=`
|
|
101
|
+
## ${Z(s==="return-type"?"Return type":s==="graphql-args"||s==="arguments"?"Arguments":s==="graphql-fields"?"Fields":s)}:
|
|
102
102
|
|
|
103
|
-
`;const
|
|
104
|
-
`};if(
|
|
105
|
-
`}else if(!
|
|
103
|
+
`;const l=t=>{const i=t.description?N(Array.isArray(t.description)?t.description:[t.description],{renderTag:c}).trim():"";return` - \`${t.name}\` (${t.type.display})${i?`: ${i}`:""}
|
|
104
|
+
`};if(e.type){const t=e.type.description?N(Array.isArray(e.type.description)?e.type.description:[e.type.description],{renderTag:c}).trim():"";n+=` Type: ${e.type.display}`,t&&(n+=` - ${t}`),n+=`
|
|
105
|
+
`}else if(!e.fields.length)return"";for(const t of e.fields)n+=l(t);return n}function T(e,s){const c=[],r=l=>{for(const t of l)if(t.nodeType===m.MARKDOC){const i=t.content,f=Array.isArray(i)?i:[i],o=N(f,{renderTag:s}).trim();o&&c.push(o)}else(t.nodeType===m.CONTAINER||t.nodeType===m.OVERVIEW_SECTION_WRAPPER)&&r(t.children)};return r(e),c.join(" ").trim()||void 0}function Z(e){return e.charAt(0).toUpperCase()+e.slice(1)}function M(e,s){return s.access?.requiresLogin?!0:pn({slug:e.link||"",[x]:e[x]},s)}export{Xn as getAiDocumentsStore};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import s from"node:path";import{bundle as R,createConfig as I,getTotals as B}from"@redocly/openapi-core";import{CONFIG_FILE_NAME as J}from"../../../constants/common.js";import{deepMerge as L}from"../../../utils/object/deep-merge.js";import{pluralize as $}from"../../../utils/string/pluralize.js";import{getAllApiConfigsByPath as M}from"../get-api-config.js";import{injectDecoratorIntoConfig as W}from"../api-docs/utils/decorators.js";import{ExternalResolver as _}from"../../fs/utils/external-ref-resolver.js";async function Y(o,{fs:n,logger:d,cache:u,getConfig:l,isPathIgnored:f}){let i;try{i=(await u.load(o,"yaml")).data}catch{return[]}if(!i?.arazzo)return d.verbose(`${o} file is not Arazzo document. Skipping`),[];const p=[],e=n.getFileInfo(o),t=await l(s.posix.dirname(o)),x=M(t?.apis,o,t.configPath),D=await f(o);for(const c of x){if(!c.output&&D)continue;const k=t.configPath?s.posix.dirname(t.configPath):".",a=c.output?s.posix.join(k,c.output):o;e&&c.output&&!
|
|
1
|
+
import s from"node:path";import{bundle as R,createConfig as I,getTotals as B}from"@redocly/openapi-core";import{CONFIG_FILE_NAME as J}from"../../../constants/common.js";import{deepMerge as L}from"../../../utils/object/deep-merge.js";import{pluralize as $}from"../../../utils/string/pluralize.js";import{getAllApiConfigsByPath as M}from"../get-api-config.js";import{injectDecoratorIntoConfig as W}from"../api-docs/utils/decorators.js";import{ExternalResolver as _}from"../../fs/utils/external-ref-resolver.js";async function Y(o,{fs:n,logger:d,cache:u,getConfig:l,isPathIgnored:f}){let i;try{i=(await u.load(o,"yaml")).data}catch{return[]}if(!i?.arazzo)return d.verbose(`${o} file is not Arazzo document. Skipping`),[];const p=[],e=n.getFileInfo(o),t=await l(s.posix.dirname(o)),x=M(t?.apis,o,t.configPath),D=await f(o);for(const c of x){if(!c.output&&D)continue;const k=t.configPath?s.posix.dirname(t.configPath):".",a=c.output?s.posix.join(k,c.output):o;e&&c.output&&!n.exists(a)&&n.addVirtualFile(a,e);const m=L(t,{rbac:void 0},c),v=s.resolve(n.cwd,t.realConfigPath||J),w=new _(n),O=await I(W(m,a,n.cwd),{configPath:v,externalRefResolver:w}),h=s.resolve(n.cwd,o),g={config:O,base:s.dirname(h),doc:{source:{absoluteRef:h},parsed:JSON.parse(JSON.stringify(i))}},{bundle:{parsed:N},problems:z,visitorsData:P}=await R({...g,dereference:!0,externalRefResolver:w}),{bundle:{parsed:S}}=await R({...g,doc:{...g.doc,parsed:JSON.parse(JSON.stringify(i))}}),V=P["markdown/markdown"]?.markdocChunks??[],r=B(z),b=[r.errors&&`${r.errors} ${$(r.errors,"error","errors")}`,r.warnings&&`${r.warnings} ${$(r.warnings,"warning","warnings")}`,r.ignored&&`${r.ignored} ignored`].filter(Boolean).join(", ");if(r.errors){const C=z.find(F=>F.severity==="error");throw new Error(`${b} while bundling ${a} definition.
|
|
2
2
|
|
|
3
3
|
${C?.message} at ${C?.location?.[0]?.pointer}
|
|
4
4
|
|
|
5
|
-
`)}r.warnings&&d.warn(`${b} while bundling %rp definition`,a);const j=y(N,t.metadata),A=y(S,t.metadata),E={document:j,documentWithReferences:A,config:m,relativePath:a,realRelativePath:e?.realRelativePath||a,customOutputRelativeFile:c.output&&a,markdocChunks:V,isVirtual:e?.isVirtual??!1};p.push(E)}return p}async function Z(o,n){const{fs:d,cache:u,getConfig:l}=n,f=[];for(const i of
|
|
5
|
+
`)}r.warnings&&d.warn(`${b} while bundling %rp definition`,a);const j=y(N,t.metadata),A=y(S,t.metadata),E={document:j,documentWithReferences:A,config:m,relativePath:a,realRelativePath:e?.realRelativePath||a,customOutputRelativeFile:c.output&&a,markdocChunks:V,isVirtual:e?.isVirtual??!1};p.push(E)}return p}async function Z(o,n){const{fs:d,cache:u,getConfig:l}=n,f=[];for(const i of d.scan(/(\.ya?ml|\.json)$/)){if(!await l(s.posix.dirname(i.relativePath)))continue;let e;try{e=await u.load(i.relativePath,"arazzo-doc")}catch{continue}e.data?.length&&f.push(...e.data.map(t=>({...t,isVirtual:i.isVirtual||t.isVirtual,hash:e.compoundHash})))}return f}function y(o,n){return n?{...o,info:{...o.info,...n}}:o}export{Y as arazzoDocLoader,Z as arazzoDocsLoader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{simplifyAstStructure as h}from"@redocly/api-docs";import{storeDefinitionBundles as p}from"./store-definition-bundles.js";import{arazzoDocLoader as y,arazzoDocsLoader as D}from"./arazzo-doc-loader.js";import{telemetryTraceStep as P}from"../../../cli/telemetry/helpers/trace-step.js";const u="arazzo-docs-";async function $(k){let l=[];return{id:"arazzo",loaders:{"arazzo-doc":y,"arazzo-docs":D},processContent:async(e,o)=>{await P("com.redocly.build.plugin.arazzoDocs",async()=>{for(const t of
|
|
1
|
+
import{simplifyAstStructure as h}from"@redocly/api-docs";import{storeDefinitionBundles as p}from"./store-definition-bundles.js";import{arazzoDocLoader as y,arazzoDocsLoader as D}from"./arazzo-doc-loader.js";import{telemetryTraceStep as P}from"../../../cli/telemetry/helpers/trace-step.js";const u="arazzo-docs-";async function $(k){let l=[];return{id:"arazzo",loaders:{"arazzo-doc":y,"arazzo-docs":D},processContent:async(e,o)=>{await P("com.redocly.build.plugin.arazzoDocs",async()=>{for(const t of o.fs.scan(/(\.ya?ml|\.json)$/))if(!await o.isPathIgnored(t.relativePath))try{const{data:a,compoundHash:n}=await o.cache.load(t.realRelativePath,"arazzo-doc");if(!a?.length)continue;l=a.map(({markdocChunks:r,relativePath:c,isVirtual:s,customOutputRelativeFile:i,realRelativePath:d})=>({chunks:r,relativePath:c,realRelativePath:d,isVirtual:i!=null||t.isVirtual||s})),p(a,e.outdir,n);for(const r of a){const c=`${u}${r.relativePath}`;await e.createSharedData(c,{document:r.document})}}catch(a){console.error(a)}})},afterRoutesCreated:async(e,o)=>{for(const{chunks:t,relativePath:a,isVirtual:n,realRelativePath:r}of l)await o.cache.load(a,{loader:async function(){await o.cache.load(r,"arazzo-doc");for(const{node:s,markdown:i,pointer:d,key:z,relativePath:m}of t){const{ast:f}=await e.parseMarkdoc({input:{content:i,relativePath:d,isVirtual:n},context:o,deps:{sharedDataIds:[`${u}${m}`]}});s[`x-parsed-md-${z}`]={result:h(f)}}},name:"arazzo-markdoc-inline-parser"})}}}export{$ as arazzoDocsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REDOCLY_TEAMS_RBAC as
|
|
1
|
+
import{REDOCLY_TEAMS_RBAC as g}from"@redocly/config";import{removeLeadingSlash as x}from"@redocly/theme/core/utils";import{toKebabCase as p}from"../../../../../../utils/string/to-kebab-case.js";import{promiseMapLimit as S}from"../../../../../utils/async/promise-map-limit.js";import{promiseMapLimitWithStatus as b}from"../../../../../utils/async/promise-map-limit-with-status.js";import{extractTeamsFromScopeItems as R}from"../../../../../utils/rbac.js";import{removeMarkdocTags as w}from"../../../../../../markdoc/helpers/remove-markdoc-tags.js";import{BaseApiEntitiesExtractor as N}from"./base.js";import{OpenapiSchemaResolver as d}from"../../../utils/openapi-schema-resolver.js";import{extractPartsFromComponentsRef as A}from"../../../utils/extract-parts-from-components-ref.js";import{isValidTagName as T}from"../../../utils/is-valid-tag-name.js";const k=["get","post","put","delete","patch"],v=15,O=15;class _ extends N{#e;constructor(e){super("openapi",e),this.#e=e.context.logger}async loadApiDescriptions(){return(await this.actions.loadApiDocuments(this.context)).filter(o=>o.type==="openapi").map(o=>({...o,isVirtual:o.isVirtual??!1}))}mapApiDescriptionToEntity(e,o){const n=x(e.realRelativePath),s=e.document.info.title,t=this.resolveEntityKey({realRelativePath:e.realRelativePath,customKey:e.document["x-redocly-catalog-key"]});return{type:this.type,key:t,title:s,summary:w(typeof e.document.info.description=="string"?e.document.info.description:void 0),tags:e.document.tags?.filter(a=>a.name&&T(a.name)).map(a=>a.name),metadata:{specType:this.specType,descriptionFile:n},version:o}}async processApiDescription(e,o,n,s){if(d.clearSchemaCache(),!e?.document)throw new Error("OpenAPI definition is missing a bundled document");const t=this.getRbacTeamsForDefinition(e.relativePath),a=this.mapApiDescriptionToEntity(e,n);await this.catalogEntitiesService.createEntity({entity:a,sourceFile:e.realRelativePath,fileHash:e.hash,source:"file",isRootEntity:!0,rbacTeams:t,revision:o}),s.delete(`${a.key}:${n}`),await this.#o(e,a.key,a.version,n,o,s,t);const r=this.#n(e.document.paths);if(r.length!==0){const i=(await b(r,v,async({operation:m,path:h,method:f})=>{if(!m.operationId)return;const l=await this.#c(m,h,f,e,a.key,a.version,o,t);s.delete(`${l}:${n}`)},this.#e)).count.failed;i>0&&this.#e.warn(`Extraction completed with ${i} failures out of ${r.length} operations for ${a.key}`)}}#n(e){return Object.entries(e??{}).flatMap(([o,n])=>k.filter(s=>n[s]).map(s=>{const t=n[s];if(!t)throw new Error(`Operation not found for method ${s} on path ${o}`);return{operation:t,path:o,method:s.toUpperCase()}}))}async#o(e,o,n,s,t,a,r){const c=e.document.components?.schemas;if(!c)return;const i=Object.entries(c);i.length!==0&&await S(i,O,async([m,h])=>{const f=`${o}-${p(m)}`,l=await this.#r({schemaName:m,schema:h,description:e,parentKey:o,parentVersion:n,parentRevision:t,rbacTeams:r});a.delete(`${f}:${s}`),l&&await this.catalogEntitiesService.createEntityRelation({sourceKey:o,sourceVersion:n,sourceRevision:t,type:"uses",targetKey:l.key,targetVersion:n,targetRevision:t,sourceFile:e.realRelativePath,fileHash:e.hash})})}async#r({schemaName:e,schema:o,description:n,parentKey:s,parentVersion:t,parentRevision:a,rbacTeams:r}){const c=d.resolveSchemaRefs(o,n.document),i=JSON.stringify(c),m=c[g]?R(c[g]):r,h=R(c["x-rbac"]),f={type:"data-schema",key:`${s}-${p(e)}`,title:e,summary:(typeof c.description=="string"?c.description:c.title)??null,tags:[],metadata:{specType:this.specType,schema:i},version:t};try{return await this.catalogEntitiesService.createEntity({entity:f,sourceFile:n.realRelativePath,fileHash:n.hash,rbacTeams:h.length?h:m,source:"file",revision:a})}catch(l){return this.#e.error(`Failed to create data schema entity for ${e}: ${l instanceof Error?l.message:"Unknown error"}`),null}}async#c(e,o,n,s,t,a,r,c){const i=`${t}-${p(`${e.operationId}`)}`,m=this.#h(e.requestBody??null,s),h=this.#l(e.responses??{},s),f=m.schemaNames,l=h.schemaNames;m.errors.length>0&&this.#e.warn(`Schema extraction errors for operation ${e.operationId}: ${m.errors.join(", ")}`),h.errors.length>0&&this.#e.warn(`Response schema extraction errors for operation ${e.operationId}: ${h.errors.join(", ")}`);const u=f.map(E=>`${t}-${p(E)}`),$=l.map(E=>`${t}-${p(E)}`),y=await this.#p({path:o,method:n,operation:e,requestBodySchemasKeys:u,responseSchemasKeys:$,description:s,parentKey:t,parentVersion:a,parentRevision:r,rbacTeams:c});return y&&await Promise.all([this.#i(f,e.operationId??"",s.realRelativePath,s.hash,t,a,r),this.#m(l,e.operationId??"",s.realRelativePath,s.hash,t,a,r),this.#y({apiOperationKey:y.key,operationRelations:e["x-catalogRelations"],descriptionUniqueKey:t,description:s,parentVersion:a,parentRevision:r})]),i}async#i(e,o,n,s,t,a,r){return e.length===0||!o?[]:await this.#s(e,o,n,s,t,a,r)}async#m(e,o,n,s,t,a,r){return e.length===0||!o?[]:await this.#s(e,o,n,s,t,a,r)}#h(e,o){const n=[],s=[];try{if(e&&"content"in e&&e.content)for(const t of Object.values(e.content)){const a=this.#a(t,o);if(!a)continue;const r=this.#t(a);r?.componentType==="schemas"&&r.componentName&&n.push(r.componentName)}if(e&&e.$ref){const t=this.#t(e.$ref);if(t?.componentType==="requestBodies"&&t.componentName){const a=o.document.components?.requestBodies?.[t.componentName];if(a&&"content"in a)for(const r of Object.values(a.content??{})){const c=this.#a(r,o);if(!c)continue;const i=this.#t(c);i?.componentType==="schemas"&&i.componentName&&n.push(i.componentName)}}}}catch(t){s.push(`Failed to extract request body schemas: ${t instanceof Error?t.message:"Unknown error"}`)}return{schemaNames:[...new Set(n)],errors:s}}#l(e,o){const n=[],s=[];try{for(const t of Object.values(e)){if(t&&"content"in t&&t.content)for(const a of Object.values(t.content)){const r=this.#a(a,o);if(!r)continue;const c=this.#t(r);c?.componentType==="schemas"&&c.componentName&&n.push(c.componentName)}if(t&&t.$ref){const a=this.#t(t.$ref);if(a?.componentType==="responses"&&a.componentName){const r=o.document.components?.responses?.[a.componentName];if(r&&"content"in r)for(const c of Object.values(r.content??{})){const i=this.#a(c,o);if(!i)continue;const m=this.#t(i);m?.componentType==="schemas"&&m.componentName&&n.push(m.componentName)}}}}}catch(t){s.push(`Failed to extract response schemas: ${t instanceof Error?t.message:"Unknown error"}`)}return{schemaNames:[...new Set(n)],errors:s}}#a(e,o){const n=new Set;let s=e;for(;s&&"$ref"in s;){const t=this.#t(s.$ref),a=t?.componentName;if(t?.componentType!=="mediaTypes"||!a||n.has(a))return;n.add(a),s=o.document.components?.mediaTypes?.[a]}return s?.schema?.$ref}#t(e){try{return A(e)}catch{return{componentType:"",componentName:null}}}async#s(e,o,n,s,t,a,r){return e.length===0?[]:await S(e,O,async c=>await this.#f({operationId:o,schemaName:c,descriptionSourceFile:n,descriptionHash:s,parentKey:t,parentVersion:a,parentRevision:r}))}async#f({operationId:e,schemaName:o,descriptionSourceFile:n,descriptionHash:s,parentKey:t,parentVersion:a,parentRevision:r}){const c=`${t}-${p(o)}`;try{return await this.catalogEntitiesService.createEntityRelation({sourceKey:`${t}-${p(e)}`,type:"uses",targetKey:c,sourceFile:n,fileHash:s,sourceVersion:a,targetVersion:a,sourceRevision:r,targetRevision:r}),c}catch(i){throw this.#e.error(`Failed to create relation between operation ${e} and schema ${o}: ${i instanceof Error?i.message:"Unknown error"}`),i}}async#p({path:e,method:o,operation:n,requestBodySchemasKeys:s,responseSchemasKeys:t,description:a,parentKey:r,parentVersion:c,parentRevision:i,rbacTeams:m}){const h=`${n.operationId}`,f=`${r}-${p(h)}`,l=n[g]?R(n[g]):m,u=R(n["x-rbac"]),$={type:"api-operation",key:f,title:h,summary:w(n.summary),tags:n.tags?.filter(y=>T(y)),metadata:{path:e,method:o,payload:s,responses:t},version:c};try{return await this.catalogEntitiesService.createEntity({entity:$,sourceFile:a.realRelativePath,fileHash:a.hash,rbacTeams:u.length>0?u:l,source:"file",revision:i})}catch(y){return this.#e.error(`Failed to create API operation entity for ${h}: ${y instanceof Error?y.message:"Unknown error"}`),null}}async#y({apiOperationKey:e,operationRelations:o,descriptionUniqueKey:n,description:s,parentVersion:t,parentRevision:a}){try{await this.catalogEntitiesService.createEntityRelation({sourceKey:e,type:"partOf",targetKey:n,sourceFile:s.realRelativePath,fileHash:s.hash,sourceVersion:t,targetVersion:t,sourceRevision:a,targetRevision:a}),await this.#u(e,s,o,t,a)}catch(r){this.#e.error(`Failed to create API operation relations for ${e}: ${r instanceof Error?r.message:"Unknown error"}`)}}async#u(e,o,n,s,t){n?.length&&await S(n,v,async a=>{try{this.validateEntityRelationFileSchema(a),await this.catalogEntitiesService.createEntityRelation({sourceKey:e,type:a.type,targetKey:a.key,sourceFile:o.realRelativePath,fileHash:o.hash,sourceVersion:s,targetVersion:"",sourceRevision:t,targetRevision:""})}catch(r){this.context.logger.warn(`Error creating entity relation for operation ${e} based on custom property: ${r instanceof Error?r.message:"Unknown error"}`)}})}}export{_ as OpenApiEntitiesExtractor};
|
|
@@ -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};
|