@redocly/portal-plugin-soap-api 0.21.0-next.15 → 0.21.0-next.17
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 +25 -0
- package/lib/.tsbuildinfo +1 -0
- package/lib/plugin.d.ts +2 -0
- package/lib/plugin.js.map +1 -0
- package/lib/search-facets.d.ts +6 -0
- package/lib/search-facets.js +1 -0
- package/lib/search-facets.js.map +1 -0
- package/lib/search-resolver.d.ts +11 -0
- package/lib/search-resolver.js +1 -0
- package/lib/search-resolver.js.map +1 -0
- package/lib/template.d.ts +12 -0
- package/lib/template.js +9 -0
- package/lib/template.js.map +1 -0
- package/package.json +10 -6
- package/src/plugin.ts +0 -274
- package/src/search-facets.ts +0 -44
- package/src/search-resolver.ts +0 -24
- package/src/template.tsx +0 -98
- package/tsconfig.build.json +0 -12
- package/tsconfig.json +0 -11
package/lib/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOhD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC,MAAM,kBAAkB,GAAG;;;;;;;;;;;qBAWN,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,OAAO;QACL,EAAE,EAAE,MAAM;QACV,oBAAoB,EAAE,CAAC,MAAiB,CAAC;QACzC,OAAO,EAAE;YACP,IAAI,EAAE,CAAO,YAAY,EAAE,OAAO,EAAE,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,SAAS,EAAE,GAAG,CAAC;SACvB,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC;SACtB,WAAW,EAAE;SACb,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB,EAAE,IAAY;IACrD,OAAO,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,kBAAkB,CACzB,IAA2B,EAC3B,YAAoB;IAEpB,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;QACrD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,YAAY,EAAE,CAAC;YAC7D,qDACK,YAAY,CAAC,KAAK,GAClB,YAAY,KACf,KAAK,EAAE,SAAS,IAChB;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function setDocumentSearchFacets(actions: any, documentSearchFacets: {
|
|
2
|
+
[key: string]: string | Set<string>;
|
|
3
|
+
}): void;
|
|
4
|
+
export declare function extractDocumentSearchFacets(actions: any, metadata?: Record<string, unknown>): {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const u="redocly_category",i="API Reference";function S(c,a){var e;const r=c.getSearchFacets();for(const[s,t]of Object.entries(a)){const n=r.get(s);if(n){const o=new Set((e=n.values)!==null&&e!==void 0?e:[]);t instanceof Set?[...t].forEach(f=>n.values=Array.from(o.add(f))):n.values=Array.from(o.add(t))}}c.setSearchFacets(r)}function h(c,a){const e={[u]:i};if(!a)return e;const r=c.getSearchFacets();for(const[s,t]of Object.entries(a))r.has(s)&&(e[s]=String(t));return e}export{h as extractDocumentSearchFacets,S as setDocumentSearchFacets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-facets.js","sourceRoot":"","sources":["../src/search-facets.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C,MAAM,UAAU,uBAAuB,CACrC,OAAY,EACZ,oBAA6D;;IAE7D,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAE/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAChE,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,WAAW,GAAG,IAAI,GAAG,OAAE,KAAK,CAAC,MAAmB,mCAAI,EAAE,CAAC,CAAC;YAC9D,IAAI,KAAK,YAAY,GAAG,EAAE,CAAC;gBACzB,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,OAAY,EACZ,QAAkC;IAElC,MAAM,YAAY,GAA8B;QAC9C,CAAC,kBAAkB,CAAC,EAAE,qBAAqB;KAC5C,CAAC;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,YAAY,CAAC;IAEnC,MAAM,kBAAkB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAErD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAE3C,YAAY,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function searchResolver(actions: any): (route: any, staticData: any) => Promise<{
|
|
2
|
+
id: any;
|
|
3
|
+
url: any;
|
|
4
|
+
title: any;
|
|
5
|
+
text: any;
|
|
6
|
+
facets: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
"redocly::teams-rbac": Record<string, string>;
|
|
10
|
+
"redocly::route-rbac": any;
|
|
11
|
+
}[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=function(u,c,n,o){function r(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(e,t){function f(i){try{d(o.next(i))}catch(l){t(l)}}function p(i){try{d(o.throw(i))}catch(l){t(l)}}function d(i){i.done?e(i.value):r(i.value).then(f,p)}d((o=o.apply(u,c||[])).next())})};import{REDOCLY_ROUTE_RBAC as v,REDOCLY_TEAMS_RBAC as h}from"@redocly/config";import{extractDocumentSearchFacets as m,setDocumentSearchFacets as _}from"./search-facets.js";function x(u){return(c,n)=>s(this,void 0,void 0,function*(){var o,r;const e=c.metadata||{},t=m(u,e);return _(u,t),[{id:c.slug,url:c.slug,title:(o=n?.props)===null||o===void 0?void 0:o.title,text:(r=n?.props)===null||r===void 0?void 0:r.description,facets:t,[h]:n[h],[v]:n[v]}]})}export{x as searchResolver};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-resolver.js","sourceRoot":"","sources":["../src/search-resolver.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE1F,MAAM,UAAU,cAAc,CAAC,OAAY;IACzC,OAAO,CAAO,KAAU,EAAE,UAAe,EAAE,EAAE;;QAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,2BAA2B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC9D,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACzC,MAAM,cAAc,GAAG;YACrB;gBACE,EAAE,EAAE,KAAK,CAAC,IAAI;gBACd,GAAG,EAAE,KAAK,CAAC,IAAI;gBACf,KAAK,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,0CAAE,KAAK;gBAC/B,IAAI,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,0CAAE,WAAW;gBACpC,MAAM;gBACN,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAA2B;gBAC9E,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC;aACrD;SACF,CAAC;QAEF,OAAO,cAAc,CAAC;IACxB,CAAC,CAAA,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type PageProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
wsdl?: string;
|
|
5
|
+
request?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
8
|
+
type SoapDocsProps = {
|
|
9
|
+
pageProps: PageProps;
|
|
10
|
+
};
|
|
11
|
+
declare const Template: React.FC<SoapDocsProps>;
|
|
12
|
+
export default Template;
|
package/lib/template.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from"react";import l from"styled-components";import{saveAs as f}from"file-saver";import{Button as h,CodeBlock as i,H1 as o,useThemeHooks as g}from"@redocly/theme";import{DocumentationLayout as w}from"@redocly/theme/layouts/DocumentationLayout";const x=({pageProps:t})=>{const{useSidebarSiblingsData:a,useCodeHighlight:c}=g(),{nextPage:m,prevPage:r}=a()||{},{highlight:n}=c()||{},s=()=>{const d=t.wsdl||"",u=new Blob([d],{type:"application/wsdl+xml"});f(u,`${t.title||"wsdl"}.wsdl`)};return e.createElement(w,{tableOfContent:void 0,feedback:void 0,nextPage:m,prevPage:r},e.createElement(e.Fragment,null,t.request?e.createElement(e.Fragment,null,e.createElement(o,null,t.title),t.description?e.createElement(b,null,t.description):null,e.createElement(i,{header:{controls:{copy:{}},title:"Request example"},lang:"xml",source:t.request,highlightedHtml:n(t.request||"")})):e.createElement(e.Fragment,null,e.createElement(o,null,t.title),e.createElement(E,null,e.createElement(v,{variant:"primary",size:"small",onClick:s},"Download WSDL"),e.createElement(i,{header:{controls:{copy:{}},title:t.title},lang:"xml",source:t.wsdl,highlightedHtml:n(t.wsdl||"","xml")})))))};var q=x;const E=l.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--spacing-base);
|
|
5
|
+
`,b=l.div`
|
|
6
|
+
margin-bottom: var(--spacing-base);
|
|
7
|
+
`,v=l(h)`
|
|
8
|
+
align-self: flex-end;
|
|
9
|
+
`;export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B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,QAAQ,EAAE;4BACR,IAAI,EAAE,EAAE;yBACT;wBACD,KAAK,EAAE,SAAS,CAAC,KAAK;qBACvB,EACD,IAAI,EAAC,KAAK,EACV,MAAM,EAAE,SAAS,CAAC,IAAI,EACtB,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,GACvD,CACgB,CACnB,CACJ,CAAC,CAAC,CAAC,CACF;YAEE,oBAAC,EAAE,QAAE,SAAS,CAAC,KAAK,CAAM;YACzB,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAC,WAAW,QAAE,SAAS,CAAC,WAAW,CAAe,CAAC,CAAC,CAAC,IAAI;YAElF,oBAAC,SAAS,IACR,MAAM,EAAE;oBACN,QAAQ,EAAE;wBACR,IAAI,EAAE,EAAE;qBACT;oBACD,KAAK,EAAE,iBAAiB;iBACzB,EACD,IAAI,EAAC,KAAK,EACV,MAAM,EAAE,SAAS,CAAC,OAAO,EACzB,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,GACnD,CACD,CACJ,CACA,CACiB,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC;AAExB,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAInC,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE7B,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;CAEpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/portal-plugin-soap-api",
|
|
3
|
-
"version": "0.21.0-next.
|
|
3
|
+
"version": "0.21.0-next.17",
|
|
4
4
|
"description": "SOAP API plugin for Redocly products",
|
|
5
5
|
"author": "team@redocly.com",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"CHANGELOG.md"
|
|
10
|
+
],
|
|
7
11
|
"type": "module",
|
|
8
12
|
"main": "lib/plugin.js",
|
|
9
13
|
"exports": {
|
|
@@ -32,11 +36,11 @@
|
|
|
32
36
|
"rimraf": "5.0.7"
|
|
33
37
|
},
|
|
34
38
|
"peerDependencies": {
|
|
35
|
-
"@redocly/realm": "0.138.0-next.
|
|
36
|
-
"@redocly/redoc": "0.138.0-next.
|
|
37
|
-
"@redocly/redoc-reef": "0.138.0-next.
|
|
38
|
-
"@redocly/redoc-revel": "0.138.0-next.
|
|
39
|
-
"@redocly/theme": "0.70.0-next.
|
|
39
|
+
"@redocly/realm": "0.138.0-next.17",
|
|
40
|
+
"@redocly/redoc": "0.138.0-next.17",
|
|
41
|
+
"@redocly/redoc-reef": "0.138.0-next.17",
|
|
42
|
+
"@redocly/redoc-revel": "0.138.0-next.17",
|
|
43
|
+
"@redocly/theme": "0.70.0-next.11",
|
|
40
44
|
"react": "^19.2.7",
|
|
41
45
|
"react-dom": "^19.2.7"
|
|
42
46
|
},
|
package/src/plugin.ts
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { WSDL, Client } from 'soap';
|
|
2
|
-
import formatXml from 'xml-formatter';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import path, { resolve, join } from 'node:path';
|
|
5
|
-
|
|
6
|
-
import type { ExternalPlugin } from '@redocly/realm/dist/server/types';
|
|
7
|
-
import type { Logger } from '@redocly/realm/dist/server/tools/notifiers/logger';
|
|
8
|
-
import type { Feature } from '@redocly/realm/dist/types';
|
|
9
|
-
import type { RedoclyConfig } from '@redocly/config';
|
|
10
|
-
|
|
11
|
-
import { searchResolver } from './search-resolver.js';
|
|
12
|
-
|
|
13
|
-
const SOAP_TEMPLATE_ID = 'soap-docs';
|
|
14
|
-
|
|
15
|
-
const STUB_SOAP_RESPONSE = `HTTP/1.0 200 OK
|
|
16
|
-
Content-Type: text/xml; charset = utf-8
|
|
17
|
-
Content-Length: 42
|
|
18
|
-
|
|
19
|
-
<?xml version = "1.0"?>
|
|
20
|
-
<SOAP-ENV:Envelope
|
|
21
|
-
xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
|
|
22
|
-
SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">
|
|
23
|
-
|
|
24
|
-
<SOAP-ENV:Body xmlns:m = "http://www.xyz.org/quotation">
|
|
25
|
-
</SOAP-ENV:Body>
|
|
26
|
-
</SOAP-ENV:Envelope>`;
|
|
27
|
-
|
|
28
|
-
export default function soapPlugin(): ExternalPlugin {
|
|
29
|
-
return {
|
|
30
|
-
id: 'soap',
|
|
31
|
-
requiredEntitlements: ['soap' as Feature],
|
|
32
|
-
loaders: {
|
|
33
|
-
wsdl: async (relativePath, context) => {
|
|
34
|
-
const config = await context.getConfig(relativePath);
|
|
35
|
-
const { metadata } = getApiConfigByPath(config.apis, relativePath);
|
|
36
|
-
const content = await context.fs.read(relativePath);
|
|
37
|
-
|
|
38
|
-
const wsdl = (await new Promise((resolve) => {
|
|
39
|
-
const wsdl = new WSDL(content, relativePath, {});
|
|
40
|
-
wsdl.onReady(() => resolve(wsdl));
|
|
41
|
-
})) as WSDL;
|
|
42
|
-
|
|
43
|
-
const info = new Client(wsdl, undefined, {
|
|
44
|
-
httpClient: {
|
|
45
|
-
request: (
|
|
46
|
-
_location: any,
|
|
47
|
-
_data: any,
|
|
48
|
-
cb: (err: any, res: any, body: string) => void,
|
|
49
|
-
): any => {
|
|
50
|
-
cb(undefined, { status: 200 }, STUB_SOAP_RESPONSE);
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
const meta = info.describe();
|
|
55
|
-
const serviceName = Object.keys(meta)[0];
|
|
56
|
-
const bindingName = Object.keys(meta[serviceName])[0];
|
|
57
|
-
const endpoints = meta[serviceName][bindingName];
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
endpoints,
|
|
61
|
-
metadata,
|
|
62
|
-
serviceName,
|
|
63
|
-
info,
|
|
64
|
-
content,
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
processContent: async (actions: any, context: any) => {
|
|
70
|
-
const soapTemplateId = actions.createTemplate(
|
|
71
|
-
SOAP_TEMPLATE_ID,
|
|
72
|
-
fromCurrentDir(import.meta.url, './template.js'),
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
for (const fileInfo of await context.fs.scan(/(\.wsdl)$/)) {
|
|
76
|
-
if (await context.isPathIgnored(fileInfo.relativePath)) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const wsdlRecord = await context.cache.load(fileInfo.relativePath, 'wsdl');
|
|
81
|
-
const { endpoints, metadata, serviceName, info, content } = wsdlRecord.data;
|
|
82
|
-
|
|
83
|
-
for (const endpointName of Object.keys(endpoints ?? {})) {
|
|
84
|
-
/**
|
|
85
|
-
* Add a page for operation
|
|
86
|
-
*/
|
|
87
|
-
actions.addRoute({
|
|
88
|
-
fsPath: fileInfo.relativePath,
|
|
89
|
-
slugSuffix: slugFromEndpoint(endpointName),
|
|
90
|
-
templateId: soapTemplateId,
|
|
91
|
-
getNavText: async () => endpointName,
|
|
92
|
-
getSearchDocuments: searchResolver(actions),
|
|
93
|
-
getStaticData: async () => {
|
|
94
|
-
return {
|
|
95
|
-
props: {
|
|
96
|
-
title: endpointName,
|
|
97
|
-
meta: {},
|
|
98
|
-
endpointName,
|
|
99
|
-
request: await generateRequestExample(
|
|
100
|
-
endpointName,
|
|
101
|
-
info,
|
|
102
|
-
endpoints[endpointName].input,
|
|
103
|
-
context.logger,
|
|
104
|
-
),
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Add a route with general information
|
|
113
|
-
*/
|
|
114
|
-
actions.addRoute({
|
|
115
|
-
fsPath: fileInfo.relativePath,
|
|
116
|
-
templateId: soapTemplateId,
|
|
117
|
-
metadata: {
|
|
118
|
-
type: 'soap',
|
|
119
|
-
title: serviceName,
|
|
120
|
-
description: '',
|
|
121
|
-
tags: ['SOAP'],
|
|
122
|
-
...metadata,
|
|
123
|
-
},
|
|
124
|
-
getSidebar: (route: any) => {
|
|
125
|
-
const operationSidebarItems = [];
|
|
126
|
-
|
|
127
|
-
for (const endpointName of Object.keys(endpoints)) {
|
|
128
|
-
const routeSlug = join(route.slug, slugFromEndpoint(endpointName));
|
|
129
|
-
operationSidebarItems.push({
|
|
130
|
-
type: 'link',
|
|
131
|
-
link: routeSlug,
|
|
132
|
-
label: endpointName,
|
|
133
|
-
routeSlug,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return [
|
|
138
|
-
{
|
|
139
|
-
type: 'link',
|
|
140
|
-
link: route.slug,
|
|
141
|
-
routeSlug: route.slug,
|
|
142
|
-
label: serviceName,
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
type: 'group',
|
|
146
|
-
label: 'Operations',
|
|
147
|
-
items: operationSidebarItems,
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
},
|
|
151
|
-
getNavText: async () => serviceName,
|
|
152
|
-
getSearchDocuments: searchResolver(actions),
|
|
153
|
-
getStaticData: async () => {
|
|
154
|
-
return {
|
|
155
|
-
props: {
|
|
156
|
-
title: serviceName,
|
|
157
|
-
wsdl: formatXml(content, { indentation: ' ' }),
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* function which generates an example request XML
|
|
169
|
-
*/
|
|
170
|
-
const generateRequestExample = async (
|
|
171
|
-
endpointName: string,
|
|
172
|
-
info: any,
|
|
173
|
-
inputParams: any,
|
|
174
|
-
logger: Logger,
|
|
175
|
-
) => {
|
|
176
|
-
const mockInput = mockProperties(endpointName, inputParams, 1, logger);
|
|
177
|
-
|
|
178
|
-
const requestXml = (await new Promise((resolve) => {
|
|
179
|
-
info[endpointName](mockInput, (...params: any[]) => {
|
|
180
|
-
resolve(params[4]);
|
|
181
|
-
});
|
|
182
|
-
})) as string;
|
|
183
|
-
|
|
184
|
-
return formatXml(requestXml, { indentation: ' ', throwOnFailure: false });
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const mockProperties = (
|
|
188
|
-
endpointName: string,
|
|
189
|
-
inputParams: any,
|
|
190
|
-
recursiveLevel: number,
|
|
191
|
-
logger: Logger,
|
|
192
|
-
) => {
|
|
193
|
-
const mockInput: Record<string, any> = {};
|
|
194
|
-
|
|
195
|
-
if (recursiveLevel > 10) {
|
|
196
|
-
return mockInput;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const paramNames = Object.keys(inputParams || {});
|
|
200
|
-
|
|
201
|
-
for (let paramName of paramNames) {
|
|
202
|
-
if (['targetNamespace', 'targetNSAlias'].includes(paramName)) {
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const paramValue = inputParams[paramName];
|
|
207
|
-
|
|
208
|
-
if (paramName.endsWith('[]')) {
|
|
209
|
-
paramName = paramName.slice(0, -2);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (paramValue && typeof paramValue === 'object') {
|
|
213
|
-
mockInput[paramName] = mockProperties(endpointName, paramValue, recursiveLevel + 1, logger);
|
|
214
|
-
} else if (typeof paramValue === 'string') {
|
|
215
|
-
const paramType = paramValue.split(':')[1];
|
|
216
|
-
switch (paramType) {
|
|
217
|
-
case 'string':
|
|
218
|
-
mockInput[paramName] = 'Lorem ipsum';
|
|
219
|
-
break;
|
|
220
|
-
|
|
221
|
-
case 'date':
|
|
222
|
-
mockInput[paramName] = '2023-07-06';
|
|
223
|
-
break;
|
|
224
|
-
|
|
225
|
-
case 'decimal':
|
|
226
|
-
mockInput[paramName] = 42;
|
|
227
|
-
break;
|
|
228
|
-
|
|
229
|
-
default:
|
|
230
|
-
mockInput[paramName] = paramName;
|
|
231
|
-
}
|
|
232
|
-
} else {
|
|
233
|
-
const error = `Can't generate request example. Request param ${paramName} not supported in endpoint ${endpointName}`;
|
|
234
|
-
mockInput[paramName] = { error };
|
|
235
|
-
logger.warn(error);
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return mockInput;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
const slugFromEndpoint = (name: string): string => {
|
|
243
|
-
return name
|
|
244
|
-
.trim()
|
|
245
|
-
.replace(/[^\w-]/g, '-')
|
|
246
|
-
.replaceAll(/-+/g, '-')
|
|
247
|
-
.toLowerCase()
|
|
248
|
-
.replace(/^-|-$/g, '');
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
function __dirname(url: string): string {
|
|
252
|
-
const __filename = fileURLToPath(url);
|
|
253
|
-
return path.dirname(__filename);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function fromCurrentDir(moduleUrl: string, path: string): string {
|
|
257
|
-
return resolve(__dirname(moduleUrl), path);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function getApiConfigByPath(
|
|
261
|
-
apis: RedoclyConfig['apis'],
|
|
262
|
-
relativePath: string,
|
|
263
|
-
): Record<string, any> {
|
|
264
|
-
for (const versionValue of Object.values(apis || {})) {
|
|
265
|
-
if (path.posix.normalize(versionValue.root) === relativePath) {
|
|
266
|
-
return {
|
|
267
|
-
...versionValue.theme,
|
|
268
|
-
...versionValue,
|
|
269
|
-
theme: undefined,
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return {};
|
|
274
|
-
}
|
package/src/search-facets.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const SEARCH_GROUP_FIELD = 'redocly_category';
|
|
2
|
-
const SEARCH_GROUP_NAME_API = 'API Reference';
|
|
3
|
-
|
|
4
|
-
export function setDocumentSearchFacets(
|
|
5
|
-
actions: any,
|
|
6
|
-
documentSearchFacets: { [key: string]: string | Set<string> },
|
|
7
|
-
) {
|
|
8
|
-
const searchFacets = actions.getSearchFacets();
|
|
9
|
-
|
|
10
|
-
for (const [key, value] of Object.entries(documentSearchFacets)) {
|
|
11
|
-
const facet = searchFacets.get(key);
|
|
12
|
-
if (facet) {
|
|
13
|
-
const facetValues = new Set((facet.values as string[]) ?? []);
|
|
14
|
-
if (value instanceof Set) {
|
|
15
|
-
[...value].forEach((v) => (facet.values = Array.from(facetValues.add(v))));
|
|
16
|
-
} else {
|
|
17
|
-
facet.values = Array.from(facetValues.add(value));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
actions.setSearchFacets(searchFacets);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function extractDocumentSearchFacets(
|
|
26
|
-
actions: any,
|
|
27
|
-
metadata?: Record<string, unknown>,
|
|
28
|
-
): { [key: string]: string } {
|
|
29
|
-
const searchFacets: { [key: string]: string } = {
|
|
30
|
-
[SEARCH_GROUP_FIELD]: SEARCH_GROUP_NAME_API,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
if (!metadata) return searchFacets;
|
|
34
|
-
|
|
35
|
-
const targetSearchFacets = actions.getSearchFacets();
|
|
36
|
-
|
|
37
|
-
for (const [key, value] of Object.entries(metadata)) {
|
|
38
|
-
if (!targetSearchFacets.has(key)) continue;
|
|
39
|
-
|
|
40
|
-
searchFacets[key] = String(value);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return searchFacets;
|
|
44
|
-
}
|
package/src/search-resolver.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC } from '@redocly/config';
|
|
2
|
-
|
|
3
|
-
import { extractDocumentSearchFacets, setDocumentSearchFacets } from './search-facets.js';
|
|
4
|
-
|
|
5
|
-
export function searchResolver(actions: any) {
|
|
6
|
-
return async (route: any, staticData: any) => {
|
|
7
|
-
const metadata = route.metadata || {};
|
|
8
|
-
const facets = extractDocumentSearchFacets(actions, metadata);
|
|
9
|
-
setDocumentSearchFacets(actions, facets);
|
|
10
|
-
const searchDocument = [
|
|
11
|
-
{
|
|
12
|
-
id: route.slug,
|
|
13
|
-
url: route.slug,
|
|
14
|
-
title: staticData?.props?.title,
|
|
15
|
-
text: staticData?.props?.description,
|
|
16
|
-
facets,
|
|
17
|
-
[REDOCLY_TEAMS_RBAC]: staticData[REDOCLY_TEAMS_RBAC] as Record<string, string>,
|
|
18
|
-
[REDOCLY_ROUTE_RBAC]: staticData[REDOCLY_ROUTE_RBAC],
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
return searchDocument;
|
|
23
|
-
};
|
|
24
|
-
}
|
package/src/template.tsx
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { saveAs } from 'file-saver';
|
|
4
|
-
import { Button, CodeBlock, H1, useThemeHooks } from '@redocly/theme';
|
|
5
|
-
|
|
6
|
-
import { DocumentationLayout } from '@redocly/theme/layouts/DocumentationLayout';
|
|
7
|
-
|
|
8
|
-
type PageProps = {
|
|
9
|
-
title: string;
|
|
10
|
-
wsdl?: string;
|
|
11
|
-
request?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type SoapDocsProps = {
|
|
16
|
-
pageProps: PageProps;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const Template: React.FC<SoapDocsProps> = ({ pageProps }: SoapDocsProps) => {
|
|
20
|
-
const { useSidebarSiblingsData, useCodeHighlight } = useThemeHooks();
|
|
21
|
-
const { nextPage, prevPage } = useSidebarSiblingsData() || {};
|
|
22
|
-
const { highlight } = useCodeHighlight() || {};
|
|
23
|
-
|
|
24
|
-
const downloadWSDL = () => {
|
|
25
|
-
const wsdlContent = pageProps.wsdl || '';
|
|
26
|
-
const blob = new Blob([wsdlContent], { type: 'application/wsdl+xml' });
|
|
27
|
-
|
|
28
|
-
saveAs(blob, `${pageProps.title || 'wsdl'}.wsdl`);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<DocumentationLayout
|
|
33
|
-
tableOfContent={undefined}
|
|
34
|
-
feedback={undefined}
|
|
35
|
-
nextPage={nextPage}
|
|
36
|
-
prevPage={prevPage}
|
|
37
|
-
>
|
|
38
|
-
<>
|
|
39
|
-
{/* Render page with general information*/}
|
|
40
|
-
{!pageProps.request ? (
|
|
41
|
-
<>
|
|
42
|
-
<H1>{pageProps.title}</H1>
|
|
43
|
-
<MainPageContainer>
|
|
44
|
-
<DownloadButton variant="primary" size="small" onClick={downloadWSDL}>
|
|
45
|
-
Download WSDL
|
|
46
|
-
</DownloadButton>
|
|
47
|
-
<CodeBlock
|
|
48
|
-
header={{
|
|
49
|
-
controls: {
|
|
50
|
-
copy: {},
|
|
51
|
-
},
|
|
52
|
-
title: pageProps.title,
|
|
53
|
-
}}
|
|
54
|
-
lang="xml"
|
|
55
|
-
source={pageProps.wsdl}
|
|
56
|
-
highlightedHtml={highlight(pageProps.wsdl || '', 'xml')}
|
|
57
|
-
/>
|
|
58
|
-
</MainPageContainer>
|
|
59
|
-
</>
|
|
60
|
-
) : (
|
|
61
|
-
<>
|
|
62
|
-
{/* Render a page with operation information */}
|
|
63
|
-
<H1>{pageProps.title}</H1>
|
|
64
|
-
{pageProps.description ? <Description>{pageProps.description}</Description> : null}
|
|
65
|
-
|
|
66
|
-
<CodeBlock
|
|
67
|
-
header={{
|
|
68
|
-
controls: {
|
|
69
|
-
copy: {},
|
|
70
|
-
},
|
|
71
|
-
title: 'Request example',
|
|
72
|
-
}}
|
|
73
|
-
lang="xml"
|
|
74
|
-
source={pageProps.request}
|
|
75
|
-
highlightedHtml={highlight(pageProps.request || '')}
|
|
76
|
-
/>
|
|
77
|
-
</>
|
|
78
|
-
)}
|
|
79
|
-
</>
|
|
80
|
-
</DocumentationLayout>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export default Template;
|
|
85
|
-
|
|
86
|
-
const MainPageContainer = styled.div`
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
gap: var(--spacing-base);
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
|
-
const Description = styled.div`
|
|
93
|
-
margin-bottom: var(--spacing-base);
|
|
94
|
-
`;
|
|
95
|
-
|
|
96
|
-
const DownloadButton = styled(Button)`
|
|
97
|
-
align-self: flex-end;
|
|
98
|
-
`;
|
package/tsconfig.build.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"references": [{ "path": "../theme/tsconfig.build.json" }],
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"noEmit": false,
|
|
6
|
-
"outDir": "lib",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"tsBuildInfoFile": "lib/.tsbuildinfo"
|
|
9
|
-
},
|
|
10
|
-
"extends": "./tsconfig.json",
|
|
11
|
-
"include": ["src"]
|
|
12
|
-
}
|
package/tsconfig.json
DELETED