plugin-git-manager 1.2.7 → 1.2.9
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/dist/client/{326.03f7202ae14b60ae.js → 326.90c276058682b536.js} +1 -1
- package/dist/client/{878.425af0ab938dd8dc.js → 878.d35dadb55d23e652.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +7 -7
- package/dist/server/actions/review.js +11 -1
- package/package.json +41 -41
- package/src/server/actions/review.ts +1221 -1211
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-acl/client"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):"function"==typeof define&&define.amd?define("plugin-git-manager",["@nocobase/client-v2","react","antd","@nocobase/client","@nocobase/plugin-acl/client","@ant-design/icons","@nocobase/plugin-ai/client"],t):"object"==typeof exports?exports["plugin-git-manager"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-acl/client"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):e["plugin-git-manager"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/plugin-acl/client"],e["@ant-design/icons"],e["@nocobase/plugin-ai/client"])}(self,function(e,t,r,n,o,i,a){return function(){"use strict";var u,l,c,s={375:function(e){e.exports=i},342:function(e){e.exports=n},866:function(t){t.exports=e},79:function(e){e.exports=o},75:function(e){e.exports=a},59:function(e){e.exports=r},155:function(e){e.exports=t}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var r=p[e]={exports:{}};return s[e].call(r.exports,r,r.exports,f),r.exports}f.m=s,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 r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,r){return f.f[r](e,t),t},[]))},f.u=function(e){return""+e+"."+({326:"03f7202ae14b60ae",434:"cd3129f40e8c3e7c",878:"425af0ab938dd8dc"})[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)},d={},f.l=function(e,t,r,n){if(d[e])return void d[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="plugin-git-manager:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","plugin-git-manager:"+r),o.src=e),d[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(s);var n=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.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.g.importScripts&&(y=f.g.location+"");var d,y,g=f.g.document;if(!y&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(y=g.currentScript.src),!y)){var m=g.getElementsByTagName("script");if(m.length)for(var b=m.length-1;b>-1&&(!y||!/^http(s?):/.test(y));)y=m[b--].src}if(!y)throw Error("Automatic publicPath is not supported in this browser");f.p=y.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u={889:0},f.f.j=function(e,t){var r=f.o(u,e)?u[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=u[e]=[t,n]});t.push(r[2]=n);var o=f.p+f.u(e),i=Error();f.l(o,function(t){if(f.o(u,e)&&(0!==(r=u[e])&&(u[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},l=function(e,t){var r,n,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==u[e]})){for(r in i)f.o(i,r)&&(f.m[r]=i[r]);a&&a(f)}for(e&&e(t);l<o.length;l++)n=o[l],f.o(u,n)&&u[n]&&u[n][0](),u[n]=0},(c=self.webpackChunkplugin_git_manager=self.webpackChunkplugin_git_manager||[]).forEach(l.bind(null,0)),c.push=l.bind(null,c.push.bind(c));var h={};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 r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-git-manager/dist/client/")}if(!e){var n=window.__nocobase_modern_client_prefix__||"v",o="/"+(n=String(n).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",a=i.indexOf(o);e=a>=0?i.slice(0,a+1):"/"}e&&(e=e.replace(RegExp("/"+n+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client/"}f.p=e}(),!function(){f.r(h),f.d(h,{PluginGitManagerClient:function(){return A},default:function(){return B}});var e=f(342),t=f(155),r=f.n(t),n=f(59),o=f(375);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,l,"next",e)}function l(e){a(i,n,o,u,l,"throw",e)}u(void 0)})}}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var s={name:"git-repository",menu:{icon:r().createElement(o.BranchesOutlined,null),Component:function(){return r().createElement("span",null,"Git Repository")}},tag:{Component:function(e){var t=e.item;return r().createElement(n.Space,{size:4},r().createElement(o.BranchesOutlined,null),r().createElement("span",null,(null==t?void 0:t.title)||"Repo #".concat(null==t?void 0:t.uid)))}},getContent:function(e,t){var r=t.uid;return u(function(){var t,n,o;return c(this,function(i){switch(i.label){case 0:return[4,e.apiClient.request({url:"gitRepositories:get",params:{filterByTk:r}})];case 1:if(!(o=null==(n=i.sent())||null==(t=n.data)?void 0:t.data))return[2,null];return[2,{type:"git-repository",repositoryId:o.id,name:o.name,repoUrl:o.repoUrl,defaultBranch:o.defaultBranch,status:o.status}]}})})()}},p={name:"git-merge-request",menu:{icon:r().createElement(o.MergeOutlined,null),Component:function(){return r().createElement("span",null,"Git Merge Request")}},tag:{Component:function(e){var t=e.item;return r().createElement(n.Space,{size:4},r().createElement(o.MergeOutlined,null),r().createElement("span",null,(null==t?void 0:t.title)||"MR ".concat(null==t?void 0:t.uid)))}},getContent:function(e,t){var r=t.uid;return u(function(){var t,n,o,i,a,u,s,p;return c(this,function(c){switch(c.label){case 0:if(o=(n=l(String(r||"").split(":"),2))[0],i=n[1],a=Number(o),u=Number(i),!a||!u)return[2,null];return[4,e.apiClient.request({url:"gitManager:mergeRequestDetail",params:{repositoryId:a,mrIid:u}})];case 1:return p=null==(s=c.sent())||null==(t=s.data)?void 0:t.data,[2,{type:"git-merge-request",repositoryId:a,mrIid:u,title:null==p?void 0:p.title,sourceBranch:null==p?void 0:p.sourceBranch,targetBranch:null==p?void 0:p.targetBranch,author:null==p?void 0:p.author,changes:null==p?void 0:p.changes,description:null==p?void 0:p.description,webUrl:null==p?void 0:p.webUrl}]}})})()}},d={name:"git-commit",menu:{icon:r().createElement(o.NodeIndexOutlined,null),Component:function(){return r().createElement("span",null,"Git Commit")}},tag:{Component:function(e){var t=e.item;return r().createElement(n.Space,{size:4},r().createElement(o.NodeIndexOutlined,null),r().createElement("span",null,(null==t?void 0:t.title)||"Commit ".concat(null==t?void 0:t.uid)))}},getContent:function(e,t){var r=t.uid;return u(function(){var t,n,o,i,a,u,s;return c(this,function(c){switch(c.label){case 0:if(o=(n=l(String(r||"").split(":"),2))[0],i=n[1],!(a=Number(o))||!i)return[2,null];return[4,e.apiClient.request({url:"gitManager:commitDetail",params:{repositoryId:a,commitHash:i}})];case 1:return s=null==(u=c.sent())||null==(t=u.data)?void 0:t.data,[2,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({type:"git-commit",repositoryId:a,commitSha:i},s)]}})})()}},y=f(79),g=f.n(y),m=f(866);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function w(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){v(i,n,o,a,u,"next",e)}function u(e){v(i,n,o,a,u,"throw",e)}a(void 0)})}}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||x(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||x(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}}function E(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var k=function(e){var o=e.activeRole,i=(0,m.useApp)().apiClient,a=S((0,t.useState)(!1),2),u=a[0],l=a[1],c=S((0,t.useState)([]),2),s=c[0],p=c[1],f=S((0,t.useState)({read:[],write:[]}),2),d=f[0],y=f[1];(0,t.useEffect)(function(){(null==o?void 0:o.name)&&g()},[null==o?void 0:o.name]);var g=function(){return w(function(){var e,t,r,a,u,c;return E(this,function(s){switch(s.label){case 0:l(!0),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Promise.all([i.request({resource:"gitRepositories",action:"list",params:{paginate:!1,sort:["name"]}}),i.request({url:"gitManager:rolePermissions",method:"get",params:{roleName:o.name}})])];case 2:return a=(r=S.apply(void 0,[s.sent(),2]))[0],c=(null==(u=r[1])||null==(e=u.data)?void 0:e.data)||(null==u?void 0:u.data)||{read:[],write:[]},p((null==a||null==(t=a.data)?void 0:t.data)||[]),y({read:c.read||[],write:c.write||[]}),[3,4];case 3:return console.error(s.sent()),n.message.error("Failed to load repository permissions"),[3,4];case 4:return l(!1),[2]}})})()},b=function(e,t,r){return w(function(){var a,u,l,c;return E(this,function(s){switch(s.label){case 0:var p,f;a=d[t]||[],u=r?j(new Set(j(a).concat([e]))):a.filter(function(t){return t!==e}),p=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){O(e,t,r[t])})}return e}({},d),f=null!=(f=O({},t,u))?f:{},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(f)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(f)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(f,e))}),l=p,c=d,y(l),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.request({url:"gitManager:updateRolePermissions",method:"post",data:{roleName:o.name,values:l}})];case 2:return s.sent(),[3,4];case 3:return s.sent(),n.message.error("Failed to update permissions"),y(c),[3,4];case 4:return[2]}})})()},h=[{title:"Repository Name",dataIndex:"name",key:"name",render:function(e){return r().createElement(n.Typography.Text,{strong:!0},e)}},{title:"Repository URL",dataIndex:"repoUrl",key:"repoUrl",ellipsis:!0,render:function(e){return r().createElement(n.Typography.Text,{type:"secondary"},e)}},{title:"Read (List, Browse Files, View History)",key:"read",width:100,render:function(e,t){return r().createElement(n.Checkbox,{checked:(d.read||[]).includes(t.id),onChange:function(e){return b(t.id,"read",e.target.checked)}})}},{title:"Write (Clone, Pull, Push, Review)",key:"write",width:100,render:function(e,t){return r().createElement(n.Checkbox,{checked:(d.write||[]).includes(t.id),onChange:function(e){return b(t.id,"write",e.target.checked)}})}}];return u&&!s.length?r().createElement(n.Spin,{style:{display:"block",margin:"40px auto"}}):r().createElement("div",{style:{padding:16}},r().createElement("div",{style:{marginBottom:16}},r().createElement(n.Typography.Text,{type:"secondary"},"Configure access permissions for each repository for the role"," ",r().createElement(n.Typography.Text,{strong:!0},(null==o?void 0:o.title)||(null==o?void 0:o.name)),".")),r().createElement(n.Table,{dataSource:s,columns:h,rowKey:"id",pagination:!1,size:"small",bordered:!0}))};function P(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function C(e,t,r){return(C=q()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&T(o,r.prototype),o}).apply(null,arguments)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=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,r)}function r(){return C(e,arguments,_(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),T(r,e)})(e)}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(q=function(){return!!e})()}var M=r().lazy(function(){return Promise.all([f.e("326"),f.e("878")]).then(f.bind(f,205)).then(function(e){return{default:e.GitManagerSettings}})}),R=r().lazy(function(){return f.e("434").then(f.bind(f,33)).then(function(e){return{default:e.RepositoryConfig}})}),A=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=_(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,q()?Reflect.construct(e,t||[],_(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&T(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){return this.app.pluginSettingsManager.add("git-manager",{title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.app.pluginSettingsManager.add("git-manager.repositories",{title:this.t("Repositories"),Component:R,aclSnippet:"pm.plugin-git-manager.repositories"}),this.app.pluginSettingsManager.add("git-manager.manage",{title:this.t("Manage"),Component:M,aclSnippet:"pm.plugin-git-manager.manage"}),(null==(e=this.app.aiManager)?void 0:e.registerWorkContext)&&(e.registerWorkContext("git-repository",s),e.registerWorkContext("git-merge-request",p),e.registerWorkContext("git-commit",d)),(t=this.app.pm.get(g()))&&t.settingsUI.addPermissionsTab(function(e){e.t;var t=e.TabLayout,n=e.activeRole;return{key:"git-manager",label:"Git Manager",sort:25,children:r().createElement(t,null,r().createElement(k,{activeRole:n}))}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){P(i,n,o,a,u,"next",e)}function u(e){P(i,n,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,t),n}(I(e.Plugin)),B=A}(),h}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-acl/client"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):"function"==typeof define&&define.amd?define("plugin-git-manager",["@nocobase/client-v2","react","antd","@nocobase/client","@nocobase/plugin-acl/client","@ant-design/icons","@nocobase/plugin-ai/client"],t):"object"==typeof exports?exports["plugin-git-manager"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-acl/client"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):e["plugin-git-manager"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/plugin-acl/client"],e["@ant-design/icons"],e["@nocobase/plugin-ai/client"])}(self,function(e,t,r,n,o,i,a){return function(){"use strict";var u,l,c,s={375:function(e){e.exports=i},342:function(e){e.exports=n},866:function(t){t.exports=e},79:function(e){e.exports=o},75:function(e){e.exports=a},59:function(e){e.exports=r},155:function(e){e.exports=t}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var r=p[e]={exports:{}};return s[e].call(r.exports,r,r.exports,f),r.exports}f.m=s,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 r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,r){return f.f[r](e,t),t},[]))},f.u=function(e){return""+e+"."+({326:"90c276058682b536",434:"cd3129f40e8c3e7c",878:"d35dadb55d23e652"})[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)},d={},f.l=function(e,t,r,n){if(d[e])return void d[e].push(t);if(void 0!==r)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="plugin-git-manager:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","plugin-git-manager:"+r),o.src=e),d[e]=[t];var c=function(t,r){o.onerror=o.onload=null,clearTimeout(s);var n=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.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.g.importScripts&&(g=f.g.location+"");var d,g,m=f.g.document;if(!g&&m&&(m.currentScript&&"SCRIPT"===m.currentScript.tagName.toUpperCase()&&(g=m.currentScript.src),!g)){var y=m.getElementsByTagName("script");if(y.length)for(var b=y.length-1;b>-1&&(!g||!/^http(s?):/.test(g));)g=y[b--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");f.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u={889:0},f.f.j=function(e,t){var r=f.o(u,e)?u[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=u[e]=[t,n]});t.push(r[2]=n);var o=f.p+f.u(e),i=Error();f.l(o,function(t){if(f.o(u,e)&&(0!==(r=u[e])&&(u[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},l=function(e,t){var r,n,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==u[e]})){for(r in i)f.o(i,r)&&(f.m[r]=i[r]);a&&a(f)}for(e&&e(t);l<o.length;l++)n=o[l],f.o(u,n)&&u[n]&&u[n][0](),u[n]=0},(c=self.webpackChunkplugin_git_manager=self.webpackChunkplugin_git_manager||[]).forEach(l.bind(null,0)),c.push=l.bind(null,c.push.bind(c));var h={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var r=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");r.indexOf("/static/plugins/plugin-git-manager/dist/client/")>=0&&(e=r.replace(/\/[^\/]+$/,"/"))}if(!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/plugin-git-manager/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client/"}f.p=e}(),!function(){f.r(h),f.d(h,{PluginGitManagerClient:function(){return A},default:function(){return B}});var e=f(342),t=f(155),r=f.n(t),n=f(59),o=f(375);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,l,"next",e)}function l(e){a(i,n,o,u,l,"throw",e)}u(void 0)})}}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var s={name:"git-repository",menu:{icon:r().createElement(o.BranchesOutlined,null),Component:function(){return r().createElement("span",null,"Git Repository")}},tag:{Component:function(e){var t=e.item;return r().createElement(n.Space,{size:4},r().createElement(o.BranchesOutlined,null),r().createElement("span",null,(null==t?void 0:t.title)||"Repo #".concat(null==t?void 0:t.uid)))}},getContent:function(e,t){var r=t.uid;return u(function(){var t,n,o;return c(this,function(i){switch(i.label){case 0:return[4,e.apiClient.request({url:"gitRepositories:get",params:{filterByTk:r}})];case 1:if(!(o=null==(n=i.sent())||null==(t=n.data)?void 0:t.data))return[2,null];return[2,{type:"git-repository",repositoryId:o.id,name:o.name,repoUrl:o.repoUrl,defaultBranch:o.defaultBranch,status:o.status}]}})})()}},p={name:"git-merge-request",menu:{icon:r().createElement(o.MergeOutlined,null),Component:function(){return r().createElement("span",null,"Git Merge Request")}},tag:{Component:function(e){var t=e.item;return r().createElement(n.Space,{size:4},r().createElement(o.MergeOutlined,null),r().createElement("span",null,(null==t?void 0:t.title)||"MR ".concat(null==t?void 0:t.uid)))}},getContent:function(e,t){var r=t.uid;return u(function(){var t,n,o,i,a,u,s,p;return c(this,function(c){switch(c.label){case 0:if(o=(n=l(String(r||"").split(":"),2))[0],i=n[1],a=Number(o),u=Number(i),!a||!u)return[2,null];return[4,e.apiClient.request({url:"gitManager:mergeRequestDetail",params:{repositoryId:a,mrIid:u}})];case 1:return p=null==(s=c.sent())||null==(t=s.data)?void 0:t.data,[2,{type:"git-merge-request",repositoryId:a,mrIid:u,title:null==p?void 0:p.title,sourceBranch:null==p?void 0:p.sourceBranch,targetBranch:null==p?void 0:p.targetBranch,author:null==p?void 0:p.author,changes:null==p?void 0:p.changes,description:null==p?void 0:p.description,webUrl:null==p?void 0:p.webUrl}]}})})()}},d={name:"git-commit",menu:{icon:r().createElement(o.NodeIndexOutlined,null),Component:function(){return r().createElement("span",null,"Git Commit")}},tag:{Component:function(e){var t=e.item;return r().createElement(n.Space,{size:4},r().createElement(o.NodeIndexOutlined,null),r().createElement("span",null,(null==t?void 0:t.title)||"Commit ".concat(null==t?void 0:t.uid)))}},getContent:function(e,t){var r=t.uid;return u(function(){var t,n,o,i,a,u,s;return c(this,function(c){switch(c.label){case 0:if(o=(n=l(String(r||"").split(":"),2))[0],i=n[1],!(a=Number(o))||!i)return[2,null];return[4,e.apiClient.request({url:"gitManager:commitDetail",params:{repositoryId:a,commitHash:i}})];case 1:return s=null==(u=c.sent())||null==(t=u.data)?void 0:t.data,[2,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({type:"git-commit",repositoryId:a,commitSha:i},s)]}})})()}},g=f(79),m=f.n(g),y=f(866);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function w(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){v(i,n,o,a,u,"next",e)}function u(e){v(i,n,o,a,u,"throw",e)}a(void 0)})}}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||x(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||x(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}}function E(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var k=function(e){var o=e.activeRole,i=(0,y.useApp)().apiClient,a=S((0,t.useState)(!1),2),u=a[0],l=a[1],c=S((0,t.useState)([]),2),s=c[0],p=c[1],f=S((0,t.useState)({read:[],write:[]}),2),d=f[0],g=f[1];(0,t.useEffect)(function(){(null==o?void 0:o.name)&&m()},[null==o?void 0:o.name]);var m=function(){return w(function(){var e,t,r,a,u,c;return E(this,function(s){switch(s.label){case 0:l(!0),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Promise.all([i.request({resource:"gitRepositories",action:"list",params:{paginate:!1,sort:["name"]}}),i.request({url:"gitManager:rolePermissions",method:"get",params:{roleName:o.name}})])];case 2:return a=(r=S.apply(void 0,[s.sent(),2]))[0],c=(null==(u=r[1])||null==(e=u.data)?void 0:e.data)||(null==u?void 0:u.data)||{read:[],write:[]},p((null==a||null==(t=a.data)?void 0:t.data)||[]),g({read:c.read||[],write:c.write||[]}),[3,4];case 3:return console.error(s.sent()),n.message.error("Failed to load repository permissions"),[3,4];case 4:return l(!1),[2]}})})()},b=function(e,t,r){return w(function(){var a,u,l,c;return E(this,function(s){switch(s.label){case 0:var p,f;a=d[t]||[],u=r?j(new Set(j(a).concat([e]))):a.filter(function(t){return t!==e}),p=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){O(e,t,r[t])})}return e}({},d),f=null!=(f=O({},t,u))?f:{},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(f)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(f)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(f,e))}),l=p,c=d,g(l),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.request({url:"gitManager:updateRolePermissions",method:"post",data:{roleName:o.name,values:l}})];case 2:return s.sent(),[3,4];case 3:return s.sent(),n.message.error("Failed to update permissions"),g(c),[3,4];case 4:return[2]}})})()},h=[{title:"Repository Name",dataIndex:"name",key:"name",render:function(e){return r().createElement(n.Typography.Text,{strong:!0},e)}},{title:"Repository URL",dataIndex:"repoUrl",key:"repoUrl",ellipsis:!0,render:function(e){return r().createElement(n.Typography.Text,{type:"secondary"},e)}},{title:"Read (List, Browse Files, View History)",key:"read",width:100,render:function(e,t){return r().createElement(n.Checkbox,{checked:(d.read||[]).includes(t.id),onChange:function(e){return b(t.id,"read",e.target.checked)}})}},{title:"Write (Clone, Pull, Push, Review)",key:"write",width:100,render:function(e,t){return r().createElement(n.Checkbox,{checked:(d.write||[]).includes(t.id),onChange:function(e){return b(t.id,"write",e.target.checked)}})}}];return u&&!s.length?r().createElement(n.Spin,{style:{display:"block",margin:"40px auto"}}):r().createElement("div",{style:{padding:16}},r().createElement("div",{style:{marginBottom:16}},r().createElement(n.Typography.Text,{type:"secondary"},"Configure access permissions for each repository for the role"," ",r().createElement(n.Typography.Text,{strong:!0},(null==o?void 0:o.title)||(null==o?void 0:o.name)),".")),r().createElement(n.Table,{dataSource:s,columns:h,rowKey:"id",pagination:!1,size:"small",bordered:!0}))};function P(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function C(e,t,r){return(C=q()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&T(o,r.prototype),o}).apply(null,arguments)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=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,r)}function r(){return C(e,arguments,_(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),T(r,e)})(e)}function q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(q=function(){return!!e})()}var M=r().lazy(function(){return Promise.all([f.e("326"),f.e("878")]).then(f.bind(f,205)).then(function(e){return{default:e.GitManagerSettings}})}),R=r().lazy(function(){return f.e("434").then(f.bind(f,33)).then(function(e){return{default:e.RepositoryConfig}})}),A=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=_(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,q()?Reflect.construct(e,t||[],_(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&T(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){return this.app.pluginSettingsManager.add("git-manager",{title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.app.pluginSettingsManager.add("git-manager.repositories",{title:this.t("Repositories"),Component:R,aclSnippet:"pm.plugin-git-manager.repositories"}),this.app.pluginSettingsManager.add("git-manager.manage",{title:this.t("Manage"),Component:M,aclSnippet:"pm.plugin-git-manager.manage"}),(null==(e=this.app.aiManager)?void 0:e.registerWorkContext)&&(e.registerWorkContext("git-repository",s),e.registerWorkContext("git-merge-request",p),e.registerWorkContext("git-commit",d)),(t=this.app.pm.get(m()))&&t.settingsUI.addPermissionsTab(function(e){e.t;var t=e.TabLayout,n=e.activeRole;return{key:"git-manager",label:"Git Manager",sort:25,children:r().createElement(t,null,r().createElement(k,{activeRole:n}))}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){P(i,n,o,a,u,"next",e)}function u(e){P(i,n,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,t),n}(I(e.Plugin)),B=A}(),h}()});
|
package/dist/client-v2/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):"function"==typeof define&&define.amd?define("plugin-git-manager/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/plugin-ai/client"],t):"object"==typeof exports?exports["plugin-git-manager/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):e["plugin-git-manager/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/plugin-ai/client"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,a,u,c={375:function(e){e.exports=r},485:function(t){t.exports=e},75:function(e){e.exports=o},59:function(e){e.exports=n},155:function(e){e.exports=t}},l={};function p(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return c[e].call(n.exports,n,n.exports,p),n.exports}p.m=c,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({326:"42b7b53651ffab3a",434:"5bd7d0a433eaf499",878:"44427151f696954b"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},p.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="plugin-git-manager/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","plugin-git-manager/client-v2:"+n),o.src=e),f[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=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)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(s=p.g.location+"");var f,s,g=p.g.document;if(!s&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(s=g.currentScript.src),!s)){var d=g.getElementsByTagName("script");if(d.length)for(var b=d.length-1;b>-1&&(!s||!/^http(s?):/.test(s));)s=d[b--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");p.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},p.f.j=function(e,t){var n=p.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),a=Error();p.l(o,function(t){if(p.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],a=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==i[e]})){for(n in a)p.o(a,n)&&(p.m[n]=a[n]);u&&u(p)}for(e&&e(t);c<o.length;c++)r=o[c],p.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(u=self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).forEach(a.bind(null,0)),u.push=a.bind(null,u.push.bind(u));var
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):"function"==typeof define&&define.amd?define("plugin-git-manager/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/plugin-ai/client"],t):"object"==typeof exports?exports["plugin-git-manager/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):e["plugin-git-manager/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/plugin-ai/client"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,a,u,c={375:function(e){e.exports=r},485:function(t){t.exports=e},75:function(e){e.exports=o},59:function(e){e.exports=n},155:function(e){e.exports=t}},l={};function p(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return c[e].call(n.exports,n,n.exports,p),n.exports}p.m=c,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({326:"42b7b53651ffab3a",434:"5bd7d0a433eaf499",878:"44427151f696954b"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},p.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="plugin-git-manager/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","plugin-git-manager/client-v2:"+n),o.src=e),f[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=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)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(s=p.g.location+"");var f,s,g=p.g.document;if(!s&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(s=g.currentScript.src),!s)){var d=g.getElementsByTagName("script");if(d.length)for(var b=d.length-1;b>-1&&(!s||!/^http(s?):/.test(s));)s=d[b--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");p.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},p.f.j=function(e,t){var n=p.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),a=Error();p.l(o,function(t){if(p.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],a=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==i[e]})){for(n in a)p.o(a,n)&&(p.m[n]=a[n]);u&&u(p)}for(e&&e(t);c<o.length;c++)r=o[c],p.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(u=self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).forEach(a.bind(null,0)),u.push=a.bind(null,u.push.bind(u));var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-git-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-git-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client-v2/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return u}});var e=p(485);function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}p(155);function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=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,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,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 n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(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||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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(e){return this.pluginSettingsManager.addMenuItem({key:"git-manager",title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"repositories",title:this.t("Repositories"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("434").then(p.bind(p,33)).then(function(e){return{default:e.RepositoryConfig}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"manage",title:this.t("Manage"),aclSnippet:"pm.plugin-git-manager.manage",componentLoader:function(){return Promise.all([p.e("326"),p.e("878")]).then(p.bind(p,205)).then(function(e){return{default:e.GitManagerSettings}})}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(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)}}(i.prototype,n),i}(i(e.Plugin))}(),v}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -11,13 +11,13 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"antd": "5.24.2",
|
|
13
13
|
"@ant-design/icons": "5.6.1",
|
|
14
|
-
"@nocobase/client": "2.1.
|
|
15
|
-
"@nocobase/plugin-acl": "2.1.
|
|
16
|
-
"@nocobase/client-v2": "2.1.
|
|
17
|
-
"@nocobase/server": "2.1.
|
|
14
|
+
"@nocobase/client": "2.1.9",
|
|
15
|
+
"@nocobase/plugin-acl": "2.1.9",
|
|
16
|
+
"@nocobase/client-v2": "2.1.9",
|
|
17
|
+
"@nocobase/server": "2.1.9",
|
|
18
18
|
"sequelize": "6.35.2",
|
|
19
19
|
"dayjs": "1.11.13",
|
|
20
|
-
"@nocobase/plugin-ai": "2.1.
|
|
21
|
-
"@nocobase/actions": "2.1.
|
|
22
|
-
"@nocobase/database": "2.1.
|
|
20
|
+
"@nocobase/plugin-ai": "2.1.9",
|
|
21
|
+
"@nocobase/actions": "2.1.9",
|
|
22
|
+
"@nocobase/database": "2.1.9"
|
|
23
23
|
};
|
|
@@ -42,6 +42,7 @@ var import_gitlab_url = require("../utils/gitlab-url");
|
|
|
42
42
|
var import_redact = require("../utils/redact");
|
|
43
43
|
const WORKER_JOB_GIT_REVIEW_PROCESS = "git-review:process";
|
|
44
44
|
const REVIEW_QUEUE_CHANNEL = "plugin-git-manager.review";
|
|
45
|
+
const REVIEW_WORKER_ALIASES = [REVIEW_QUEUE_CHANNEL, "plugin-git-manager:review:queue"];
|
|
45
46
|
const REVIEW_QUEUE_CONCURRENCY = Math.max(
|
|
46
47
|
1,
|
|
47
48
|
Number.parseInt(process.env.GIT_REVIEW_QUEUE_CONCURRENCY || process.env.GIT_REVIEW_MAX_CONCURRENCY || "3", 10) || 3
|
|
@@ -242,8 +243,17 @@ function createFlowFromSnapshot(snapshot, fallback) {
|
|
|
242
243
|
};
|
|
243
244
|
}
|
|
244
245
|
function isGitReviewWorker(app) {
|
|
246
|
+
return app.serving(WORKER_JOB_GIT_REVIEW_PROCESS) || workerModeServesGitReview();
|
|
247
|
+
}
|
|
248
|
+
function workerModeServesGitReview() {
|
|
245
249
|
const workerMode = process.env.WORKER_MODE || "";
|
|
246
|
-
|
|
250
|
+
const workerModes = workerMode.split(",").map((mode) => mode.trim()).filter(Boolean);
|
|
251
|
+
return workerModes.some((mode) => {
|
|
252
|
+
if (mode === "*" || mode === "worker" || mode === "task" || mode === WORKER_JOB_GIT_REVIEW_PROCESS) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
return REVIEW_WORKER_ALIASES.some((alias) => mode === alias || mode.endsWith(`:${alias}`));
|
|
256
|
+
});
|
|
247
257
|
}
|
|
248
258
|
function clearLocalReviewMemoryQueue(app) {
|
|
249
259
|
var _a, _b, _c, _d, _e;
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "plugin-git-manager",
|
|
3
|
-
"displayName": "Git Manager",
|
|
4
|
-
"displayName.zh-CN": "Git 管理器",
|
|
5
|
-
"description": "Manage Git repositories with PAT authentication - pull, push, fetch, diff, file browsing",
|
|
6
|
-
"version": "1.2.
|
|
7
|
-
"license": "Apache-2.0",
|
|
8
|
-
"main": "dist/server/index.js",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"src",
|
|
12
|
-
"client.js",
|
|
13
|
-
"server.js",
|
|
14
|
-
"client.d.ts",
|
|
15
|
-
"server.d.ts",
|
|
16
|
-
"client-v2.js",
|
|
17
|
-
"client-v2.d.ts"
|
|
18
|
-
],
|
|
19
|
-
"nocobase": {
|
|
20
|
-
"supportedVersions": [
|
|
21
|
-
"2.x"
|
|
22
|
-
],
|
|
23
|
-
"editionLevel": 0
|
|
24
|
-
},
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"@nocobase/client": "2.x",
|
|
27
|
-
"@nocobase/server": "2.x",
|
|
28
|
-
"@nocobase/database": "2.x",
|
|
29
|
-
"@nocobase/test": "2.x",
|
|
30
|
-
"@nocobase/client-v2": "2.x",
|
|
31
|
-
"@nocobase/flow-engine": "2.x"
|
|
32
|
-
},
|
|
33
|
-
"optionalPeerDependencies": {
|
|
34
|
-
"@nocobase/ai": "2.x",
|
|
35
|
-
"@nocobase/plugin-ai": "2.x",
|
|
36
|
-
"@nocobase/plugin-field-markdown-vditor": "2.x"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"simple-git": "^3.27.0"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "plugin-git-manager",
|
|
3
|
+
"displayName": "Git Manager",
|
|
4
|
+
"displayName.zh-CN": "Git 管理器",
|
|
5
|
+
"description": "Manage Git repositories with PAT authentication - pull, push, fetch, diff, file browsing",
|
|
6
|
+
"version": "1.2.9",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"main": "dist/server/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src",
|
|
12
|
+
"client.js",
|
|
13
|
+
"server.js",
|
|
14
|
+
"client.d.ts",
|
|
15
|
+
"server.d.ts",
|
|
16
|
+
"client-v2.js",
|
|
17
|
+
"client-v2.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"nocobase": {
|
|
20
|
+
"supportedVersions": [
|
|
21
|
+
"2.x"
|
|
22
|
+
],
|
|
23
|
+
"editionLevel": 0
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@nocobase/client": "2.x",
|
|
27
|
+
"@nocobase/server": "2.x",
|
|
28
|
+
"@nocobase/database": "2.x",
|
|
29
|
+
"@nocobase/test": "2.x",
|
|
30
|
+
"@nocobase/client-v2": "2.x",
|
|
31
|
+
"@nocobase/flow-engine": "2.x"
|
|
32
|
+
},
|
|
33
|
+
"optionalPeerDependencies": {
|
|
34
|
+
"@nocobase/ai": "2.x",
|
|
35
|
+
"@nocobase/plugin-ai": "2.x",
|
|
36
|
+
"@nocobase/plugin-field-markdown-vditor": "2.x"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"simple-git": "^3.27.0"
|
|
40
|
+
}
|
|
41
|
+
}
|