@nocobase/plugin-api-doc 2.2.0-beta.1 → 2.2.0-beta.2

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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_api_doc_client_v2=self.webpackChunk_nocobase_plugin_api_doc_client_v2||[]).push([["743"],{50:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var r=n(694),i=n(155),l=n.n(i),o=n(401),a=n(488),u=n(240),c=n(375),s=n(59),d=function(e){var t=e.children,n=e.href,r=void 0===n?o.D9:n,a=e.previewTitle,u=s.theme.useToken().token,d=(0,i.useMemo)(function(){return{background:u.colorBgContainer,padding:u.paddingMD,position:"relative"}},[u.colorBgContainer,u.paddingMD]),p=(0,i.useMemo)(function(){return{insetBlockStart:0,insetInlineEnd:0,position:"absolute"}},[]);return l().createElement("div",{style:d},l().createElement("div",{style:p},l().createElement(s.Tooltip,{title:a},l().createElement("a",{href:r,target:"_blank",rel:"noreferrer","aria-label":a},l().createElement(s.Button,{size:"small",icon:l().createElement(c.RightOutlined,null)})))),t)},p=function(){var e=(0,r.useFlowContext)(),t=(0,a.kj)(),n=e.app.getRouteUrl(o.D9);return l().createElement(d,{href:n,previewTitle:t("Preview")},l().createElement(u.default,null))}}}]);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const NAMESPACE = "api-doc";
10
+ export declare const API_DOC_ACL = "pm.api-doc.documentation";
11
+ export declare const DOCUMENTATION_PATH = "/api-documentation";
12
+ export declare const DESTINATION_URL_KEY = "API_DOC:DESTINATION_URL_KEY";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export { default } from './plugin';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-api-doc/client-v2",["ahooks","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-api-doc/client-v2"]=t(require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-api-doc/client-v2"]=t(e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var c,a,u,l={401:function(e,t,n){n.d(t,{CU:function(){return r},D9:function(){return i},Fg:function(){return c},zh:function(){return o}});var r="api-doc",o="pm.api-doc.documentation",i="/api-documentation",c="API_DOC:DESTINATION_URL_KEY"},375:function(e){e.exports=o},485:function(e){e.exports=t},694:function(e){e.exports=i},625:function(t){t.exports=e},59:function(e){e.exports=r},155:function(e){e.exports=n}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={id:e,exports:{}};return l[e].call(n.exports,n,n.exports,f),n.exports}f.m=l,f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,n){return f.f[n](e,t),t},[]))},f.u=function(e){return""+e+"."+({552:"442e30a57deeabe5",645:"f3fe2cb789ceac77",743:"69f0077a0937baa4"})[e]+".js"},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},f.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),a=0;a<c.length;a++){var u=c[a];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-api-doc/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","@nocobase/plugin-api-doc/client-v2:"+n),o.src=e),s[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=s[e];if(delete s[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},f.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.nc=void 0,f.g.importScripts&&(d=f.g.location+"");var s,d,b=f.g.document;if(!d&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(d=b.currentScript.src),!d)){var h=b.getElementsByTagName("script");if(h.length)for(var v=h.length-1;v>-1&&(!d||!/^http(s?):/.test(d));)d=h[v--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");f.p=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f.b=document.baseURI||self.location.href,c={889:0},f.f.j=function(e,t){var n=f.o(c,e)?c[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=f.p+f.u(e),i=Error();f.l(o,function(t){if(f.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==c[e]})){for(n in i)f.o(i,n)&&(f.m[n]=i[n]);a&&a(f)}for(e&&e(t);u<o.length;u++)r=o[u],f.o(c,r)&&c[r]&&c[r][0](),c[r]=0},(u=self.webpackChunk_nocobase_plugin_api_doc_client_v2=self.webpackChunk_nocobase_plugin_api_doc_client_v2||[]).forEach(a.bind(null,0)),u.push=a.bind(null,u.push.bind(u));var y={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-api-doc/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(o);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-api-doc/dist/client-v2/"}f.p=e}(),!function(){f.r(y),f.d(y,{default:function(){return u}});var e=f(485),t=f(401);function n(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function r(e,t,n){return(r=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return r(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var u=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function c(){var e,t;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return e=c,t=arguments,e=o(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(e,t||[],o(this).constructor):e.apply(this,t))}return c.prototype=Object.create(e&&e.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),e&&i(c,e),r=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){return e=this.app.i18n.t("API documentation",{ns:t.CU}),this.pluginSettingsManager.addMenuItem({key:t.CU,title:e,icon:"BookOutlined",aclSnippet:t.zh}),this.pluginSettingsManager.addPageTabItem({menuKey:t.CU,key:"index",title:e,componentLoader:function(){return Promise.all([f.e("645"),f.e("552"),f.e("743")]).then(f.bind(f,50))},aclSnippet:t.zh}),this.router.add("api-documentation",{path:t.D9,componentLoader:function(){return Promise.all([f.e("645"),f.e("552")]).then(f.bind(f,240))}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(o,i){var c=e.apply(t,r);function a(e){n(c,o,i,a,u,"next",e)}function u(e){n(c,o,i,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,r),c}(c(e.Plugin))}(),y}()});
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { NAMESPACE } from './constants';
10
+ export { NAMESPACE };
11
+ export declare function useT(): (key: string, options?: Record<string, unknown>) => string;
12
+ export declare function tExpr(key: string, options?: Record<string, unknown>): string;
@@ -7,6 +7,5 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import 'swagger-ui-dist/swagger-ui.css';
11
10
  declare const Documentation: () => React.JSX.Element;
12
11
  export default Documentation;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import 'swagger-ui-dist/swagger-ui.css';
11
+ type ApiClientLike = {
12
+ request<T = unknown>(options: Record<string, unknown>): Promise<{
13
+ data?: T;
14
+ }>;
15
+ getHeaders(): Record<string, string>;
16
+ auth: {
17
+ getToken(): string | undefined;
18
+ };
19
+ };
20
+ export type DocumentationContentProps = {
21
+ apiClient: ApiClientLike;
22
+ appName?: string;
23
+ t: (key: string) => string;
24
+ };
25
+ declare const DocumentationContent: ({ apiClient, appName, t }: DocumentationContentProps) => React.JSX.Element;
26
+ export default DocumentationContent;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ declare const DocumentationPreview: () => React.JSX.Element;
11
+ export default DocumentationPreview;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { ReactNode } from 'react';
10
+ import React from 'react';
11
+ export type DocumentationPreviewShellProps = {
12
+ children: ReactNode;
13
+ href?: string;
14
+ previewTitle: string;
15
+ };
16
+ declare const DocumentationPreviewShell: ({ children, href, previewTitle, }: DocumentationPreviewShellProps) => React.JSX.Element;
17
+ export default DocumentationPreviewShell;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { Application } from '@nocobase/client-v2';
10
+ import { Plugin } from '@nocobase/client-v2';
11
+ export declare class PluginAPIDocClientV2 extends Plugin<Record<string, never>, Application> {
12
+ load(): Promise<void>;
13
+ }
14
+ export default PluginAPIDocClientV2;
@@ -8,14 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.2.0-beta.1",
12
- "antd": "5.24.2",
11
+ "@nocobase/client": "2.2.0-beta.2",
13
12
  "react": "18.2.0",
14
- "@ant-design/icons": "5.6.1",
15
- "antd-style": "3.7.1",
13
+ "@nocobase/flow-engine": "2.2.0-beta.2",
14
+ "@nocobase/client-v2": "2.2.0-beta.2",
16
15
  "react-i18next": "11.18.6",
17
- "@nocobase/actions": "2.2.0-beta.1",
18
- "@nocobase/server": "2.2.0-beta.1",
19
- "@nocobase/utils": "2.2.0-beta.1",
20
- "@nocobase/database": "2.2.0-beta.1"
16
+ "@nocobase/actions": "2.2.0-beta.2",
17
+ "@nocobase/server": "2.2.0-beta.2",
18
+ "ahooks": "3.7.8",
19
+ "antd": "5.24.2",
20
+ "@ant-design/icons": "5.6.1",
21
+ "@nocobase/utils": "2.2.0-beta.2",
22
+ "@nocobase/database": "2.2.0-beta.2"
21
23
  };
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "API documentation": "API documentation",
3
3
  "Documentation": "Documentation",
4
- "Select a definition": "Select a definition"
5
- }
4
+ "Select a definition": "Select a definition",
5
+ "Preview": "Preview"
6
+ }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "API documentation": "API 文档",
3
3
  "Documentation": "文档",
4
- "Select a definition": "选择端点"
5
- }
4
+ "Select a definition": "选择端点",
5
+ "Preview": "预览"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-api-doc",
3
- "version": "2.2.0-beta.1",
3
+ "version": "2.2.0-beta.2",
4
4
  "displayName": "API documentation",
5
5
  "displayName.ru-RU": "Документация API",
6
6
  "displayName.zh-CN": "API 文档",
@@ -18,7 +18,9 @@
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@nocobase/client": "2.x",
21
+ "@nocobase/client-v2": "2.x",
21
22
  "@nocobase/database": "2.x",
23
+ "@nocobase/flow-engine": "2.x",
22
24
  "@nocobase/server": "2.x"
23
25
  },
24
26
  "repository": {
@@ -26,5 +28,5 @@
26
28
  "url": "git+https://github.com/nocobase/nocobase.git",
27
29
  "directory": "packages/plugins/api-doc"
28
30
  },
29
- "gitHead": "f82fa9d0c3aa8e00e53dd94e404a312483b4866b"
31
+ "gitHead": "2fe3e6a86fc1d0cd039349a68b2e4d1d6945ce45"
30
32
  }