@nocobase/plugin-action-custom-request 1.0.0-alpha.1 → 1.0.0-alpha.11
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/components/CustomRequestAction.d.ts +8 -0
- package/dist/client/components/CustomRequestActionDesigner.d.ts +8 -0
- package/dist/client/components/index.d.ts +8 -0
- package/dist/client/constants.d.ts +8 -0
- package/dist/client/hooks/index.d.ts +8 -0
- package/dist/client/hooks/useCustomRequestVariableOptions.d.ts +8 -0
- package/dist/client/hooks/useCustomRequestsResource.d.ts +8 -0
- package/dist/client/hooks/useCustomizeRequestActionProps.d.ts +8 -0
- package/dist/client/hooks/useGetCustomRequest.d.ts +8 -0
- package/dist/client/index.d.ts +8 -0
- package/dist/client/index.js +9 -0
- package/dist/client/initializer/CustomRequestInitializer.d.ts +8 -0
- package/dist/client/initializer/index.d.ts +8 -0
- package/dist/client/locale.d.ts +8 -0
- package/dist/client/schemaSettings.d.ts +8 -0
- package/dist/client/schemas/CustomRequestACL.d.ts +8 -0
- package/dist/client/schemas/CustomRequestConfigurationFields.d.ts +8 -0
- package/dist/client/schemas/index.d.ts +8 -0
- package/dist/externalVersion.js +17 -8
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/server/actions/listByCurrentRole.d.ts +8 -0
- package/dist/server/actions/listByCurrentRole.js +9 -0
- package/dist/server/actions/send.d.ts +8 -0
- package/dist/server/actions/send.js +9 -0
- package/dist/server/collections/customRequest.d.ts +8 -0
- package/dist/server/collections/customRequest.js +9 -0
- package/dist/server/collections/customRequestsRoles.d.ts +8 -0
- package/dist/server/collections/customRequestsRoles.js +9 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +9 -0
- package/dist/server/migrations/20240425205017-change-locale-module.d.ts +8 -0
- package/dist/server/migrations/20240425205017-change-locale-module.js +9 -0
- package/dist/server/plugin.d.ts +8 -0
- package/dist/server/plugin.js +9 -0
- package/package.json +2 -2
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
import React from 'react';
|
|
2
10
|
export declare const CustomRequestActionACLDecorator: (props: any) => any;
|
|
3
11
|
export declare const CustomRequestAction: {
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
import { SchemaSettings } from '@nocobase/client';
|
|
2
10
|
import React from 'react';
|
|
3
11
|
export declare function CustomRequestSettingsItem(): React.JSX.Element;
|
|
@@ -1 +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
|
+
*/
|
|
1
9
|
export * from './CustomRequestAction';
|
|
@@ -1 +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
|
+
*/
|
|
1
9
|
export declare const listByCurrentRoleUrl = "customRequests:listByCurrentRole";
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export * from './useCustomizeRequestActionProps';
|
|
2
10
|
export * from './useGetCustomRequest';
|
|
3
11
|
export * from './useCustomRequestVariableOptions';
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export declare const useCustomRequestVariableOptions: () => {
|
|
2
10
|
name: string;
|
|
3
11
|
title: string;
|
|
@@ -1 +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
|
+
*/
|
|
1
9
|
export declare const useCustomRequestsResource: () => import("@nocobase/sdk").IResource;
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export declare const useCustomizeRequestActionProps: () => {
|
|
2
10
|
onClick(e?: any, callBack?: any): Promise<void>;
|
|
3
11
|
};
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export declare const useGetCustomRequest: () => import("@nocobase/client").UseRequestResult<{
|
|
2
10
|
data: {
|
|
3
11
|
options: any;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
import { Plugin } from '@nocobase/client';
|
|
2
10
|
export declare class PluginActionCustomRequestClient extends Plugin {
|
|
3
11
|
load(): Promise<void>;
|
package/dist/client/index.js
CHANGED
|
@@ -1 +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
|
+
|
|
1
10
|
(function(t,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/utils/client"),require("antd"),require("react-router-dom"),require("react"),require("react-i18next"),require("@formily/antd-v5"),require("@formily/shared")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","@formily/react","@nocobase/utils/client","antd","react-router-dom","react","react-i18next","@formily/antd-v5","@formily/shared"],n):(t=typeof globalThis!="undefined"?globalThis:t||self,n(t["@nocobase/plugin-action-custom-request"]={},t.jsxRuntime,t["@nocobase/client"],t["@formily/react"],t["@nocobase/utils"],t.antd,t["react-router-dom"],t.react,t["react-i18next"],t["@formily/antd-v5"],t["@formily/shared"]))})(this,function(t,n,e,c,I,O,D,A,R,E,ee){"use strict";var de=Object.defineProperty,fe=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var Y=(t,n,e)=>n in t?de(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,q=(t,n)=>{for(var e in n||(n={}))$.call(n,e)&&Y(t,e,n[e]);if(M)for(var e of M(n))Q.call(n,e)&&Y(t,e,n[e]);return t},F=(t,n)=>fe(t,ye(n));var Z=(t,n)=>{var e={};for(var c in t)$.call(t,c)&&n.indexOf(c)<0&&(e[c]=t[c]);if(t!=null&&M)for(var c of M(t))n.indexOf(c)<0&&Q.call(t,c)&&(e[c]=t[c]);return e};var g=(t,n,e)=>new Promise((c,I)=>{var O=R=>{try{A(e.next(R))}catch(E){I(E)}},D=R=>{try{A(e.throw(R))}catch(E){I(E)}},A=R=>R.done?c(R.value):Promise.resolve(R.value).then(O,D);A((e=e.apply(t,n)).next())});const L="customRequests:listByCurrentRole";var P=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},z={exports:{}};(function(a,m){(function(l,i){i()})(P,function(){function l(o,r){return typeof r=="undefined"?r={autoBom:!1}:typeof r!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob(["\uFEFF",o],{type:o.type}):o}function i(o,r,h){var u=new XMLHttpRequest;u.open("GET",o),u.responseType="blob",u.onload=function(){v(u.response,r,h)},u.onerror=function(){console.error("could not download file")},u.send()}function d(o){var r=new XMLHttpRequest;r.open("HEAD",o,!1);try{r.send()}catch(h){}return 200<=r.status&&299>=r.status}function y(o){try{o.dispatchEvent(new MouseEvent("click"))}catch(h){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),o.dispatchEvent(r)}}var p=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof P=="object"&&P.global===P?P:void 0,x=p.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),v=p.saveAs||(typeof window!="object"||window!==p?function(){}:"download"in HTMLAnchorElement.prototype&&!x?function(o,r,h){var u=p.URL||p.webkitURL,C=document.createElement("a");r=r||o.name||"download",C.download=r,C.rel="noopener",typeof o=="string"?(C.href=o,C.origin===location.origin?y(C):d(C.href)?i(o,r,h):y(C,C.target="_blank")):(C.href=u.createObjectURL(o),setTimeout(function(){u.revokeObjectURL(C.href)},4e4),setTimeout(function(){y(C)},0))}:"msSaveOrOpenBlob"in navigator?function(o,r,h){if(r=r||o.name||"download",typeof o!="string")navigator.msSaveOrOpenBlob(l(o,h),r);else if(d(o))i(o,r,h);else{var u=document.createElement("a");u.href=o,u.target="_blank",setTimeout(function(){y(u)})}}:function(o,r,h,u){if(u=u||open("","_blank"),u&&(u.document.title=u.document.body.innerText="downloading..."),typeof o=="string")return i(o,r,h);var C=o.type==="application/octet-stream",b=/constructor/i.test(p.HTMLElement)||p.safari,k=/CriOS\/[\d]+/.test(navigator.userAgent);if((k||C&&b||x)&&typeof FileReader!="undefined"){var s=new FileReader;s.onloadend=function(){var S=s.result;S=k?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),u?u.location.href=S:location=S,u=null},s.readAsDataURL(o)}else{var T=p.URL||p.webkitURL,w=T.createObjectURL(o);u?u.location=w:location.href=w,u=null,setTimeout(function(){T.revokeObjectURL(w)},4e4)}});p.saveAs=v.saveAs=v,a.exports=v})})(z);var te=z.exports;const oe=()=>{const a=e.useAPIClient(),m=D.useNavigate(),l=c.useFieldSchema(),i=e.useCompile(),d=c.useForm(),y=e.useRecord(),p=c.useFieldSchema(),x=c.useField(),{setVisible:v}=e.useActionContext(),{modal:o,message:r}=O.App.useApp(),h=e.useDataSourceKey();return{onClick(C,b){return g(this,null,function*(){var S,W;const{skipValidator:k,onSuccess:s}=(S=l==null?void 0:l["x-action-settings"])!=null?S:{},T=l==null?void 0:l["x-action"];k!==!0&&T==="customize:form:request"&&(yield d.submit());let w=q({},y);T==="customize:form:request"&&(w=d.values),(W=x.data)!=null||(x.data={}),x.data.loading=!0;try{const _=yield a.request({url:`/customRequests:send/${p["x-uid"]}`,method:"POST",data:{currentRecord:{dataSourceKey:h,data:w}},responseType:p["x-response-type"]==="stream"?"blob":"json"});if(_.headers["content-disposition"]){const pe=/attachment;\s*filename="([^"]+)"/,X=_.headers["content-disposition"].match(pe);X[1]&&te.saveAs(_.data,X[1])}if(x.data.loading=!1,b&&(b==null||b()),T==="customize:form:request"&&(v==null||v(!1)),!(s!=null&&s.successMessage))return;s!=null&&s.manualClose?o.success({title:i(s==null?void 0:s.successMessage),onOk:()=>g(this,null,function*(){s!=null&&s.redirecting&&(s!=null&&s.redirectTo)&&(I.isURL(s.redirectTo)?window.location.href=s.redirectTo:m(s.redirectTo))})}):(r.success(i(s==null?void 0:s.successMessage)),s!=null&&s.redirecting&&(s!=null&&s.redirectTo)&&(I.isURL(s.redirectTo)?window.location.href=s.redirectTo:m(s.redirectTo)))}finally{x.data.loading=!1}})}}},V=()=>{const m=`customRequests:get/${c.useFieldSchema()["x-uid"]}`;return e.useRequest({url:m,params:{appends:["roles"]}},{manual:!0,cacheKey:m})},B="action-custom-request";function f(a){return`{{t('${a}', { ns: '${B}', nsMode: 'fallback' })}}`}function U(){return R.useTranslation(B,{nsMode:"fallback"})}const se=()=>{const a=e.useCollection_deprecated(),{t:m}=U(),l=e.useCollectionFilterOptions(a),i=e.useCollectionFilterOptions("users",e.DEFAULT_DATA_SOURCE_KEY),d=e.useCompile(),[y,p]=A.useMemo(()=>[d(l),d(i)],[l,i]);return A.useMemo(()=>[{name:"currentRecord",title:m("Current record",{ns:"client"}),children:[...y]},{name:"currentUser",title:m("Current user",{ns:"client"}),children:p},{name:"currentTime",title:m("Current time",{ns:"client"}),children:null}],[y,p])},j=()=>e.useAPIClient().resource("customRequests"),K={type:"object",properties:{method:{type:"string",required:!0,title:f("HTTP method"),"x-decorator-props":{tooltip:f("When the HTTP method is Post, Put or Patch, and this custom request inside the form, the request body will be automatically filled in with the form data")},"x-decorator":"FormItem","x-component":"Select","x-component-props":{showSearch:!1,allowClear:!1,className:"auto-width"},enum:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"PUT",value:"PUT"},{label:"PATCH",value:"PATCH"},{label:"DELETE",value:"DELETE"}],default:"POST"},url:{type:"string",required:!0,title:f("URL"),"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useCustomRequestVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},placeholder:"https://www.nocobase.com"}},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:f("Headers"),description:f('"Content-Type" only support "application/json", and no need to specify'),items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:f("Name")}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.Input","x-component-props":{scope:"{{useCustomRequestVariableOptions}}",fieldNames:{value:"name",label:"title"},useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:f("Add request header"),"x-component":"ArrayItems.Addition"}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:f("Parameters"),items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:f("Name")}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.Input","x-component-props":{scope:"{{useCustomRequestVariableOptions}}",fieldNames:{value:"name",label:"title"},useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:f("Add parameter"),"x-component":"ArrayItems.Addition"}}},data:{type:"string",title:f("Body"),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"Variable.JSON","x-component-props":{scope:"{{useCustomRequestVariableOptions}}",fieldNames:{value:"name",label:"title"},changeOnSelect:!0,autoSize:{minRows:10},placeholder:f("Input request data")},description:f("Only support standard JSON data")},timeout:{type:"number",title:f("Timeout config"),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"InputNumber","x-component-props":{addonAfter:f("ms"),min:1,step:1e3,defaultValue:5e3}},responseType:{type:"string",title:f("Response type"),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"Select",default:"json",enum:[{value:"json",label:"JSON"},{value:"stream",label:"Stream"}]}}},ne={type:"object",properties:{roles:{type:"array",title:f("Roles"),"x-decorator":"FormItem","x-decorator-props":{tooltip:f("If not set, all roles can see this action")},"x-component":"RemoteSelect","x-component-props":{multiple:!0,objectValue:!0,dataSource:e.DEFAULT_DATA_SOURCE_KEY,service:{resource:"roles"},manual:!1,fieldNames:{label:"title",value:"name"}}}}};function H(){var o;const{t:a}=U(),{name:m}=e.useCollection_deprecated(),l=e.useDataSourceKey(),i=c.useFieldSchema(),d=j(),{message:y}=O.App.useApp(),{data:p,refresh:x}=V(),{dn:v}=e.useDesignable();return n.jsx(n.Fragment,{children:n.jsx(e.SchemaSettingsActionModalItem,{title:a("Request settings"),components:{ArrayItems:E.ArrayItems},beforeOpen:()=>!p&&x(),scope:{useCustomRequestVariableOptions:se},schema:K,initialValues:q({},(o=p==null?void 0:p.data)==null?void 0:o.options),onSubmit:r=>g(this,null,function*(){const h=Z(r,[]);return i["x-response-type"]=h.responseType,yield d.updateOrCreate({values:{key:i["x-uid"],options:F(q({},h),{collectionName:m,dataSourceKey:l})},filterKeys:["key"]}),v.emit("patch",{schema:{"x-response-type":h.responseType,"x-uid":i["x-uid"]}}),x(),y.success(a("Saved successfully"))})})})}function G(){var x;const{t:a}=U(),m=c.useFieldSchema(),l=j(),{message:i}=O.App.useApp(),{data:d,refresh:y}=V(),{refresh:p}=e.useRequest({url:L},{manual:!0,cacheKey:L});return n.jsx(n.Fragment,{children:n.jsx(e.SchemaSettingsActionModalItem,{title:a("Access control"),schema:ne,initialValues:{roles:(x=d==null?void 0:d.data)==null?void 0:x.roles},beforeOpen:()=>!d&&y(),onSubmit:o=>g(this,[o],function*({roles:v}){return yield l.updateOrCreate({values:{key:m["x-uid"],roles:v},filterKeys:["key"]}),y(),p(),i.success(a("Saved successfully"))})})})}const re=new e.SchemaSettings({name:"CustomRequestActionSettings",items:[F(q({},e.actionSettingsItems[0]),{children:[...e.actionSettingsItems[0].children,{name:"request settings",Component:H},{name:"accessControl",Component:G}]})]}),ae=()=>{const a=j(),m=c.useFieldSchema();return n.jsx(e.Action.Designer,{linkageAction:!0,schemaSettings:"CustomRequestActionSettings",buttonEditorProps:{isLink:m["x-action"]==="customize:table:request"},linkageRulesProps:{type:"button"},removeButtonProps:{onConfirmOk(){return a.destroy({filterByTk:m["x-uid"]})}}})},ie=a=>{var y;const l=e.useAPIClient().auth.role==="root",i=c.useFieldSchema(),{data:d}=e.useRequest({url:L},{manual:l,cacheKey:L});return!l&&!((y=d==null?void 0:d.data)!=null&&y.includes(i==null?void 0:i["x-uid"]))?null:a.children},ue={"customize:table:request":e.Action.Link},N=a=>{const l=c.useFieldSchema()["x-action"],i=ue[l]||e.Action;return n.jsx(i,F(q({},a),{useProps:oe}))};N.Designer=ae,N.Decorator=ie;const ce=a=>{const m=j(),l={title:'{{ t("Custom request") }}',"x-component":"CustomRequestAction","x-action":"customize:form:request","x-toolbar":"ActionSchemaToolbar","x-settings":"actionSettings:customRequest","x-decorator":"CustomRequestAction.Decorator","x-uid":ee.uid(),"x-action-settings":{onSuccess:{manualClose:!1,redirecting:!1,successMessage:'{{t("Request success")}}'}}},i=e.useSchemaInitializerItem();return n.jsx(e.BlockInitializer,F(q({},i),{item:i,onClick:d=>g(this,null,function*(){yield m.create({values:{key:d["x-uid"]}})}),schema:l}))},me=new e.SchemaSettings({name:"actionSettings:customRequest",items:[{name:"editButton",Component:e.ButtonEditor,useComponentProps(){return{isLink:c.useFieldSchema()["x-action"]==="customize:table:request"}}},{name:"linkageRules",Component:e.SchemaSettingsLinkageRules,useComponentProps(){const{name:a}=e.useCollection(),{linkageRulesProps:m}=e.useSchemaToolbar();return F(q({},m),{collectionName:a})}},{name:"secondConFirm",Component:e.SecondConFirm},{name:"afterSuccessfulSubmission",Component:e.AfterSuccess},{name:"request settings",Component:H},{name:"accessControl",Component:G},{name:"refreshDataBlockRequest",Component:e.RefreshDataBlockRequest,useComponentProps(){return{isPopupAction:!1}}},{name:"delete",sort:100,Component:e.RemoveButton,useComponentProps(){const{removeButtonProps:a}=e.useSchemaToolbar();return a}}]}),le=a=>n.jsx(e.SchemaComponentOptions,{scope:{CustomRequestConfigurationFieldsSchema:K},components:{CustomRequestAction:N,CustomRequestInitializer:ce},children:a.children});class J extends e.Plugin{load(){return g(this,null,function*(){this.app.use(le),this.app.schemaSettingsManager.add(me),this.app.schemaSettingsManager.add(re)})}}t.PluginActionCustomRequestClient=J,t.default=J,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
import React from 'react';
|
|
2
10
|
export declare const CustomRequestInitializer: React.FC<any>;
|
|
@@ -1 +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
|
+
*/
|
|
1
9
|
export * from './CustomRequestInitializer';
|
package/dist/client/locale.d.ts
CHANGED
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export declare const NAMESPACE = "action-custom-request";
|
|
2
10
|
export declare function lang(key: string): string;
|
|
3
11
|
export declare function generateNTemplate(key: string): string;
|
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
import { SchemaSettings } from '@nocobase/client';
|
|
2
10
|
export declare const customizeCustomRequestActionSettings: SchemaSettings<{}>;
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export declare const CustomRequestACLSchema: {
|
|
2
10
|
type: string;
|
|
3
11
|
properties: {
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
export declare const CustomRequestConfigurationFieldsSchema: {
|
|
2
10
|
type: string;
|
|
3
11
|
properties: {
|
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
export * from './CustomRequestConfigurationFields';
|
|
2
10
|
export * from './CustomRequestACL';
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
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
|
+
|
|
1
10
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "1.0.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.0.0-alpha.11",
|
|
3
12
|
"react": "18.2.0",
|
|
4
13
|
"react-i18next": "11.18.6",
|
|
5
14
|
"@formily/react": "2.3.0",
|
|
6
|
-
"@nocobase/logger": "1.0.0-alpha.
|
|
7
|
-
"@nocobase/server": "1.0.0-alpha.
|
|
8
|
-
"@nocobase/test": "1.0.0-alpha.
|
|
15
|
+
"@nocobase/logger": "1.0.0-alpha.11",
|
|
16
|
+
"@nocobase/server": "1.0.0-alpha.11",
|
|
17
|
+
"@nocobase/test": "1.0.0-alpha.11",
|
|
9
18
|
"@formily/antd-v5": "1.1.9",
|
|
10
19
|
"antd": "5.12.8",
|
|
11
|
-
"@nocobase/utils": "1.0.0-alpha.
|
|
20
|
+
"@nocobase/utils": "1.0.0-alpha.11",
|
|
12
21
|
"react-router-dom": "6.21.0",
|
|
13
22
|
"@formily/shared": "2.3.0",
|
|
14
|
-
"@nocobase/actions": "1.0.0-alpha.
|
|
15
|
-
"@nocobase/evaluators": "1.0.0-alpha.
|
|
23
|
+
"@nocobase/actions": "1.0.0-alpha.11",
|
|
24
|
+
"@nocobase/evaluators": "1.0.0-alpha.11",
|
|
16
25
|
"axios": "0.26.1",
|
|
17
|
-
"@nocobase/database": "1.0.0-alpha.
|
|
26
|
+
"@nocobase/database": "1.0.0-alpha.11"
|
|
18
27
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
export * from './server';
|
|
2
10
|
export { default } from './server';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
import { Context } from '@nocobase/actions';
|
|
2
10
|
export declare function listByCurrentRole(ctx: Context): Promise<void>;
|
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
import { Context, Next } from '@nocobase/actions';
|
|
2
10
|
import CustomRequestPlugin from '../plugin';
|
|
3
11
|
export declare function send(this: CustomRequestPlugin, ctx: Context, next: Next): Promise<any>;
|
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
declare const _default: import("@nocobase/database").CollectionOptions;
|
|
2
10
|
export default _default;
|
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,2 +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
|
+
*/
|
|
1
9
|
declare const _default: import("@nocobase/database").CollectionOptions;
|
|
2
10
|
export default _default;
|
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1 +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
|
+
*/
|
|
1
9
|
export { default } from './plugin';
|
package/dist/server/index.js
CHANGED
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __create = Object.create;
|
|
2
11
|
var __defProp = Object.defineProperty;
|
|
3
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
import { Migration } from '@nocobase/server';
|
|
2
10
|
export default class extends Migration {
|
|
3
11
|
on: string;
|
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
import { Logger } from '@nocobase/logger';
|
|
2
10
|
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
3
11
|
export declare class PluginActionCustomRequestServer extends Plugin {
|
package/dist/server/plugin.js
CHANGED
|
@@ -1,3 +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
|
+
|
|
1
10
|
var __defProp = Object.defineProperty;
|
|
2
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-action-custom-request",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/action-custom-request",
|
|
6
6
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/action-custom-request",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@nocobase/server": "1.x",
|
|
23
23
|
"@nocobase/test": "1.x"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "00ffb260456e5a22701fd16c87112a92708d9dc1",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Actions"
|
|
28
28
|
]
|