@nocobase/plugin-file-manager 1.6.2 → 1.6.3

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.
Files changed (45) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/constants.js +1 -1
  3. package/dist/externalVersion.js +7 -7
  4. package/dist/locale/de-DE.json +41 -0
  5. package/dist/locale/it-IT.json +20 -0
  6. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  7. package/dist/node_modules/mime-match/package.json +1 -1
  8. package/dist/node_modules/mkdirp/package.json +1 -1
  9. package/dist/node_modules/multer-aliyun-oss/package.json +1 -1
  10. package/dist/node_modules/multer-cos/package.json +1 -1
  11. package/dist/node_modules/multer-s3/package.json +1 -1
  12. package/dist/server/actions/attachments.js +1 -4
  13. package/dist/server/utils.js +3 -4
  14. package/package.json +2 -3
  15. package/dist/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  16. package/dist/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
  17. package/dist/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
  18. package/dist/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
  19. package/dist/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
  20. package/dist/node_modules/iconv-lite/.idea/modules.xml +0 -8
  21. package/dist/node_modules/iconv-lite/.idea/vcs.xml +0 -6
  22. package/dist/node_modules/iconv-lite/LICENSE +0 -21
  23. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
  24. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
  25. package/dist/node_modules/iconv-lite/encodings/index.js +0 -23
  26. package/dist/node_modules/iconv-lite/encodings/internal.js +0 -198
  27. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  28. package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  29. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
  30. package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  31. package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  32. package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  33. package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  34. package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  35. package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  36. package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
  37. package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  38. package/dist/node_modules/iconv-lite/encodings/utf16.js +0 -197
  39. package/dist/node_modules/iconv-lite/encodings/utf32.js +0 -319
  40. package/dist/node_modules/iconv-lite/encodings/utf7.js +0 -290
  41. package/dist/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  42. package/dist/node_modules/iconv-lite/lib/index.d.ts +0 -41
  43. package/dist/node_modules/iconv-lite/lib/index.js +0 -1
  44. package/dist/node_modules/iconv-lite/lib/streams.js +0 -109
  45. package/dist/node_modules/iconv-lite/package.json +0 -1
@@ -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"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("react-i18next"),require("@formily/shared"),require("lodash"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager",["@nocobase/client","@ant-design/icons","@formily/react","react","react-i18next","@formily/shared","lodash","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager"]=t(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("react-i18next"),require("@formily/shared"),require("lodash"),require("antd")):e["@nocobase/plugin-file-manager"]=t(e["@nocobase/client"],e["@ant-design/icons"],e["@formily/react"],e.react,e["react-i18next"],e["@formily/shared"],e.lodash,e.antd)}(self,function(e,t,n,o,r,i,a,c){return function(){"use strict";var l,u,p,s={482:function(e){e.exports=t},505:function(e){e.exports=n},875:function(e){e.exports=i},772:function(t){t.exports=e},721:function(e){e.exports=c},467:function(e){e.exports=a},156:function(e){e.exports=o},238:function(e){e.exports=r}},m={};function f(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return s[e](n,n.exports,f),n.exports}f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};f.r(d),f.d(d,{default:function(){return eA},PluginFileManagerClient:function(){return eP}});var y={};f.r(y),f.d(y,{useAttachmentFieldProps:function(){return C},useFileCollectionStorageRules:function(){return F},useStorageRules:function(){return A},useUploadFiles:function(){return w}});var b=f("772"),g=f("156"),x=f.n(g);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}function v(e){var t,n,o,r,i,a,c,l,u,p,s,m,f,d=(t=(0,b.useCollectionField)(),n=(0,b.useCollectionManager)().getCollection(null==t?void 0:t.target),o=(0,b.useCollection)(),r=(0,b.usePlugin)(eA),m=(a=null!=(i=(null==t?void 0:t.storage)||(null==o?void 0:o.getOption("storage"))||(null==n?void 0:n.getOption("storage")))?i:"",c="storages:getBasicInfo/".concat(a),u=(l=(0,b.useRequest)({url:c},{manual:!0,refreshDeps:[a],cacheKey:c})).loading,p=l.data,s=l.run,(0,g.useEffect)(function(){s()},[s]),!u&&(null==p?void 0:p.data)||null),f=r.getStorageType(null==m?void 0:m.type),{storage:m,storageType:f}),y=d.storage,x=d.storageType,v=null==x?void 0:x.useUploadProps,O=(null==v?void 0:v(h({storage:y,rules:y.rules},e)))||{};return h({rules:null==y?void 0:y.rules},O)}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function S(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(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 j(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}}var w=function(){var e=(0,b.useDataBlockRequestGetter)().getDataBlockRequest,t=(0,b.useDataBlockProps)().association,n=(0,b.useActionContext)().setVisible,o=(0,b.useCollection)(),r=(0,b.useSourceId)(),i=(0,g.useMemo)(function(){var e="".concat(o.name,":create");if(t){var n,i,a=(n=t.split("."),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{!a&&null!=r.return&&r.return()}finally{if(c)throw o}}return i}}(n,2)||j(n,i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],l=a[1];e="".concat(c,"/").concat(r,"/").concat(l,":create")}return e},[o.name,t,r]),a=((0,g.useContext)(b.RecordPickerContext)||{}).setSelectedRows,c={},l=0,u={action:i,onChange:function(t){t.forEach(function(n){if("uploading"===n.status&&!c[n.uid]&&(l++,c[n.uid]=!0),"uploading"!==n.status&&c[n.uid]&&(delete c[n.uid],0==--l)){var o,r;null===(r=e())||void 0===r||null===(o=r.refresh)||void 0===o||o.call(r),null==a||a(function(e){return S(e).concat(S(t.filter(function(e){return"done"===e.status}).map(function(e){return e.response.data})))})}}),t.every(function(e){return"done"===e.status})&&n(!1)}},p=v(u);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}({},u,p)},P=f("505");function A(e){var t,n=null!=e?e:"";(0,b.useAPIClient)();var o=(0,P.useField)(),r=(0,b.useRequest)({url:"storages:getBasicInfo/".concat(n)},{manual:!0,refreshDeps:[n],cacheKey:n}),i=r.loading,a=r.data,c=r.run;return(0,g.useEffect)(function(){if("editable"===o.pattern)c()},[o.pattern,c]),!i&&(null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.rules)||null}function C(){var e=(0,b.useCollectionField)(),t="".concat(e.target,":create").concat(e.storage?"?attachmentField=".concat(e.collectionName,".").concat(e.name):""),n=v({action:t});return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}({action:t},n)}function F(){var e=(0,b.useCollectionField)(),t=(0,b.useCollectionManager)().getCollection(null==e?void 0:e.target);return A(null==t?void 0:t.getOption("storage"))}var I=function(e){var t,n;return x().createElement(b.ActionInitializerItem,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}({},e),n=(n={schema:{type:"void","x-action":"create",title:"{{t('Upload')}}","x-designer":"Action.Designer","x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{openMode:"drawer",type:"primary",icon:"UploadOutlined"},properties:{drawer:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Action.Container",properties:{upload:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Upload.DraggerV2","x-use-component-props":"useUploadFiles","x-component-props":{height:"50vh",multiple:!0,listType:"picture"}}}}}}},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},T=function(e){return x().createElement(b.SchemaComponentOptions,{scope:y,components:{UploadActionInitializer:I}},e.children)},E=f("482"),D=f("875"),k=f("721"),R=f("467"),q=f.n(R),_=f("238"),M="file-manager",U={name:"storages",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Storage name", { ns: "'.concat(M,'" })}}'),descriptions:'{{t("Will be used for API", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Storage type", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Select",required:!0,enum:"{{ storageTypeOptions }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:'{{t("Access base URL", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:'{{t("Path", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},{type:"boolean",name:"paranoid",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}}]};var B={type:"object",properties:(l={},u=(0,D.uid)(),p={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:U,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:U},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"CreateStorage","x-component-props":{type:"primary"}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Default storage", { ns: "'.concat(M,'" })}}'),properties:{default:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditStorage","x-component-props":{type:"primary"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete")}}',content:'{{t("Are you sure you want to delete it?")}}'},useAction:"{{cm.useDestroyAction}}"}}}}}}}}}},u in l?Object.defineProperty(l,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[u]=p,l)},K={title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t(\'Base URL for file access, could be your CDN base URL. For example: "https://cdn.nocobase.com".\', { ns: "'.concat(M,'" })}}')},path:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t(\'Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes "/" will be ignored. For example: "user/avatar".\', { ns: "'.concat(M,'" })}}')},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:'{{t("File size limit", { ns: "'.concat(M,'" })}}'),description:'{{t("Minimum from 1 byte, maximum up to 1GB.", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:0x1400000},mimetype:{type:"string",title:'{{t("File type (in MIME type format)", { ns: "'.concat(M,'" })}}'),description:'{{t(\'Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.\', { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default storage", { ns: "'.concat(M,'" })}}')},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Keep file in storage when destroy record", { ns: "'.concat(M,'" })}}')}},G={title:'{{t("Aliyun OSS", { ns: "'.concat(M,'" })}}'),name:"ali-oss",fieldset:{title:K.title,name:K.name,baseUrl:K.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",description:'{{t(\'Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".\', { ns: "'.concat(M,'" })}}'),required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{placeholder:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90"},description:'{{ renderThumbnailRuleDesc("ali-oss") }}'}}},path:K.path,rules:K.rules,default:K.default,paranoid:K.paranoid},thumbnailRuleLink:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4"},W={local:{title:'{{t("Local storage", { ns: "'.concat(M,'" })}}'),name:"local",fieldset:{title:K.title,name:K.name,baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem","x-display":"hidden",default:"/storage/uploads"},options:{type:"object","x-component":"div",properties:{documentRoot:{title:'{{t("Destination", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"Input","x-display":"hidden",default:"storage/uploads"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{addonBefore:"storage/uploads/"}},rules:K.rules,default:K.default,paranoid:K.paranoid}},"ali-oss":G,s3:{title:'{{t("Amazon S3", { ns: "'.concat(M,'" })}}'),name:"s3",fieldset:{title:K.title,name:K.name,baseUrl:K.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},path:K.path,rules:K.rules,default:K.default,paranoid:K.paranoid}},"tx-cos":{title:'{{t("Tencent COS", { ns: "'.concat(M,'" })}}'),name:"tx-cos",fieldset:{title:K.title,name:K.name,baseUrl:K.baseUrl,options:{type:"object","x-component":"fieldset",properties:{Region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:'{{t("SecretId", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:'{{t("SecretKey", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{placeholder:"?imageMogr2/thumbnail/!50p"},description:'{{ renderThumbnailRuleDesc("tx-cos") }}'}}},path:K.path,rules:K.rules,default:K.default,paranoid:K.paranoid},thumbnailRuleLink:"https://cloud.tencent.com/document/product/436/42214"}};function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){V(e,t,n[t])})}return e}function N(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{!a&&null!=r.return&&r.return()}finally{if(c)throw o}}return i}}(e,t)||J(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 H(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||J(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 J(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}}var Q=function(){var e=$((0,g.useState)({}),2),t=e[0],n=e[1],o=(0,b.usePlugin)(eA),r=(0,b.useCompile)(),i=$((0,g.useState)(!1),2),a=i[0],c=i[1],l=(0,_.useTranslation)().t;return x().createElement("div",null,x().createElement(b.ActionContext.Provider,{value:{visible:a,setVisible:c}},x().createElement(k.Dropdown,{menu:{onClick:function(e){var t=o.storageTypes.get(e.key);c(!0),n({type:"object",properties:V({},(0,D.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:t.name}},title:r("{{t('Add new')}}")+" - "+r(t.title),properties:N(L({},q().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}})})})},items:H(o.storageTypes.values()).map(function(e){return{key:e.name,label:r(e.title)}})}},x().createElement(k.Button,{type:"primary",icon:x().createElement(E.PlusOutlined,null)},l("Add new")," ",x().createElement(E.DownOutlined,null))),x().createElement(b.SchemaComponent,{scope:{createOnly:!0},schema:t})))},X=function(){var e=(0,b.useRecord)(),t=$((0,g.useState)({}),2),n=t[0],o=t[1],r=(0,b.usePlugin)(eA),i=(0,b.useCompile)(),a=$((0,g.useState)(!1),2),c=a[0],l=a[1],u=(0,_.useTranslation)().t;return x().createElement("div",null,x().createElement(b.ActionContext.Provider,{value:{visible:c,setVisible:l}},x().createElement("a",{onClick:function(){l(!0);var t=r.storageTypes.get(e.type);t.fieldset.default&&(t.fieldset.default["x-reactions"]=function(e){e.initialValue?e.disabled=!0:e.disabled=!1}),o({type:"object",properties:V({},(0,D.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:L({},e)},title:i("{{t('Edit')}}")+" - "+i(t.title),properties:N(L({},q().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}})})})}},u("Edit")),x().createElement(b.SchemaComponent,{scope:{createOnly:!1},schema:n})))};function Y(e){var t=W[e];return(null==t?void 0:t.thumbnailRule)?x().createElement("div",null,x().createElement("a",{target:"_blank",href:t.thumbnailRuleLink,rel:"noreferrer"},b.i18n.t("See more"))):null}var Z=function(){var e=(0,b.useCompile)(),t=H((0,b.usePlugin)(eA).storageTypes.values()).map(function(t){return{value:t.name,label:e(t.title)}});return x().createElement(k.Card,{bordered:!1},x().createElement(b.SchemaComponent,{components:{CreateStorage:Q,EditStorage:X},scope:{useNewId:function(e){return"".concat(e).concat((0,D.uid)())},storageTypeOptions:t,renderThumbnailRuleDesc:Y},schema:B}))};function ee(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function en(e){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eo(e,t){return(eo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function er(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(er=function(){return!!e})()}var ei=function(e){var t,n,o;function r(){var e,t,n,o,i,a;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),t=this,n=r,o=arguments,n=en(n),et(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,er()?Reflect.construct(n,o||[],en(t).constructor):n.apply(t,o)),"name","attachment"),et(e,"type","object"),et(e,"group","media"),et(e,"title",'{{t("Attachment", { ns: "'.concat(M,'" })}}')),et(e,"isAssociation",!0),et(e,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}}),et(e,"availableTypes",["belongsToMany"]),et(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){et(e,t,n[t])})}return e}({},b.interfacesProperties.defaultProps),a=(a={"uiSchema.x-component-props.accept":{type:"string",title:'{{t("MIME type", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-component-props":{placeholder:"image/*"},"x-decorator":"FormItem",description:"Example: image/png"},"uiSchema.x-component-props.multiple":{type:"boolean","x-content":"{{t('Allow uploading multiple files', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),description:"{{t('Default storage will be used when not selected', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}},a),Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),et(e,"filterable",{children:[{name:"id",title:'{{t("Exists")}}',operators:[{label:'{{t("exists")}}',value:"$exists",noValue:!0},{label:'{{t("not exists")}}',value:"$notExists",noValue:!0}],schema:{title:'{{t("Exists")}}',type:"string","x-component":"Input"}},{name:"filename",title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),operators:b.interfacesProperties.operators.string,schema:{title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}}]}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eo(e,t)}(r,e),t=r,n=[{key:"schemaInitialize",value:function(e,t){var n=t.block;t.field,!e["x-component-props"]&&(e["x-component-props"]={}),["Table","Kanban"].includes(n)&&(e["x-component-props"].size="small"),e["x-use-component-props"]="useAttachmentFieldProps"}},{key:"initialize",value:function(e){!e.through&&(e.through="t_".concat((0,D.uid)())),!e.foreignKey&&(e.foreignKey="f_".concat((0,D.uid)())),!e.otherKey&&(e.otherKey="f_".concat((0,D.uid)())),!e.sourceKey&&(e.sourceKey="id"),!e.targetKey&&(e.targetKey="id")}}],ee(t.prototype,n),r}(b.CollectionFieldInterface);function ea(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ec(e){return(ec=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){ea(e,t,n[t])})}return e}function eu(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ep(e,t){return(ep=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function es(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(es=function(){return!!e})()}var em=function(e){function t(){var e,n,o,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=this,o=t,r=arguments,o=ec(o),ea(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,es()?Reflect.construct(o,r||[],ec(n).constructor):o.apply(n,r)),"name","file"),ea(e,"title",'{{t("File collection", { ns: "'.concat(M,'" })}}')),ea(e,"order",3),ea(e,"color","blue"),ea(e,"default",{createdBy:!0,updatedBy:!0,fields:[{interface:"input",type:"string",name:"title",deletable:!1,uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"filename",deletable:!1,uiSchema:{type:"string",title:'{{t("File name", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:'{{t("Extension name", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:'{{t("Size", { ns: "'.concat(M,'" })}}'),"x-component":"InputNumber","x-read-pretty":!0,"x-component-props":{stringMode:!0,step:"0"}}},{interface:"input",type:"string",name:"mimetype",deletable:!1,uiSchema:{type:"string",title:'{{t("MIME type", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"text",name:"path",deletable:!1,uiSchema:{type:"string",title:'{{t("Path", { ns: "'.concat(M,'" })}}'),"x-component":"TextAreaWithGlobalScope","x-read-pretty":!0}},{interface:"url",type:"text",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"text",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("Preview", { ns: "'.concat(M,'" })}}'),"x-component":"Preview","x-read-pretty":!0}},{comment:"存储引擎",type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,uiSchema:{type:"string",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]}),ea(e,"presetFieldsDisabled",!0),ea(e,"configurableProperties",el(eu(el(eu(el({},(0,b.getConfigurableProperties)("title","name")),{inherits:eu(el({},(0,b.getConfigurableProperties)("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),(0,b.getConfigurableProperties)("category","description")),{storage:{type:"string",name:"storage",title:'{{t("File storage", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),(0,b.getConfigurableProperties)("presetFields"))),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ep(e,t)}(t,e),t}(b.CollectionTemplate),ef=[{value:1,label:"Byte"},{value:1024,label:"KB"},{value:1048576,label:"MB"},{value:0x40000000,label:"GB"}];function ed(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1048576,n=e||t,o=ef.length-1;o>=0;o--){var r=ef[o];if(n%r.value==0)return r}return ef[0]}function ey(e,t,n){return Math.min(Math.max(t,e),n)}function eb(e){var t,n=e.value,o=e.defaultUnit,r=void 0===o?1048576:o,i=e.min,a=void 0===i?1:i,c=e.max,l=void 0===c?0x40000000:c,u=e.step,p=e.onChange,s=null!==(t=e.defaultValue)&&void 0!==t?t:0x1400000,m=ed(s,r),f=s/m.value,d=ed(null!=n?n:s,r),y=null==n?n:n/d.value,b=(0,g.useCallback)(function(e){null==p||p(ey(null==e?e:e*d.value,a,l))},[d.value]),h=(0,g.useCallback)(function(e){null==p||p(ey(y*e,a,l))},[y]);return x().createElement(k.Space.Compact,null,x().createElement(k.InputNumber,{value:y,onChange:b,defaultValue:"".concat(f),step:void 0===u?1:u}),x().createElement(k.Select,{options:ef,value:d.value,onChange:h,className:"auto-width"}))}function eg(e,t,n,o,r,i,a){try{var c=e[i](a),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(o,r)}function ex(e,t,n){return(ex=ew()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&eS(r,n.prototype),r}).apply(null,arguments)}function eh(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ev(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eO(e){return(eO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eS(e,t){return(eS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ej(e){var t="function"==typeof Map?new Map:void 0;return(ej=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).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,o)}function o(){return ex(e,arguments,eO(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),eS(o,e)})(e)}function ew(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ew=function(){return!!e})()}var eP=function(e){var t,n,o;function r(){var e,t,n,o;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),t=this,n=r,o=arguments,n=eO(n),ev(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,ew()?Reflect.construct(n,o||[],eO(t).constructor):n.apply(t,o)),"storageTypes",new Map),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eS(e,t)}(r,e),t=r,n=[{key:"load",value:function(){var e,t=this;return(e=function(){var e;return function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(n){return t.app.dataSourceManager.addFieldInterfaces([ei]),t.app.dataSourceManager.addCollectionTemplates([em]),t.app.use(T),t.app.pluginSettingsManager.add(M,{title:'{{t("File manager", { ns: "'.concat(M,'" })}}'),icon:"FileOutlined",Component:Z,aclSnippet:"pm.file-manager.storages"}),Object.values(W).forEach(function(e){t.registerStorageType(e.name,e)}),null==(e=t.app.schemaInitializerManager.get("table:configureActions"))||e.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return"file"===(0,b.useCollection)().template}}),t.app.addScopes({useAttachmentFieldProps:C,useFileCollectionStorageRules:F}),t.app.addComponents({FileSizeField:eb}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(e){eg(i,o,r,a,c,"next",e)}function c(e){eg(i,o,r,a,c,"throw",e)}a(void 0)})})()}},{key:"registerStorageType",value:function(e,t){this.storageTypes.set(e,t)}},{key:"getStorageType",value:function(e){return this.storageTypes.get(e)}}],eh(t.prototype,n),r}(ej(b.Plugin));ev(eP,"buildInStorage",["local","ali-oss","s3","tx-cos"]);var eA=eP;return d}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("react-i18next"),require("@formily/shared"),require("lodash"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager",["@nocobase/client","@ant-design/icons","@formily/react","react","react-i18next","@formily/shared","lodash","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager"]=t(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("react-i18next"),require("@formily/shared"),require("lodash"),require("antd")):e["@nocobase/plugin-file-manager"]=t(e["@nocobase/client"],e["@ant-design/icons"],e["@formily/react"],e.react,e["react-i18next"],e["@formily/shared"],e.lodash,e.antd)}(self,function(e,t,n,o,r,i,a,c){return function(){"use strict";var l,u,p,s={482:function(e){e.exports=t},505:function(e){e.exports=n},875:function(e){e.exports=i},772:function(t){t.exports=e},721:function(e){e.exports=c},467:function(e){e.exports=a},156:function(e){e.exports=o},238:function(e){e.exports=r}},m={};function f(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return s[e](n,n.exports,f),n.exports}f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};f.r(d),f.d(d,{default:function(){return eC},PluginFileManagerClient:function(){return eA}});var y={};f.r(y),f.d(y,{useAttachmentFieldProps:function(){return C},useFileCollectionStorageRules:function(){return I},useStorageRules:function(){return A},useUploadFiles:function(){return w}});var b=f("772"),g=f("156"),x=f.n(g);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}function v(e){var t,n,o,r,i,a,c,l,u,p,s,m,f,d=(t=(0,b.useCollectionField)(),n=(0,b.useCollectionManager)().getCollection(null==t?void 0:t.target),o=(0,b.useCollection)(),r=(0,b.usePlugin)(eC),m=(a=null!=(i=(null==t?void 0:t.storage)||(null==o?void 0:o.getOption("storage"))||(null==n?void 0:n.getOption("storage")))?i:"",c="storages:getBasicInfo/".concat(a),u=(l=(0,b.useRequest)({url:c},{manual:!0,refreshDeps:[a],cacheKey:c})).loading,p=l.data,s=l.run,(0,g.useEffect)(function(){s()},[s]),!u&&(null==p?void 0:p.data)||null),f=r.getStorageType(null==m?void 0:m.type),{storage:m,storageType:f}),y=d.storage,x=d.storageType,v=null==x?void 0:x.useUploadProps,O=(null==v?void 0:v(h({storage:y,rules:y.rules},e)))||{};return h({rules:null==y?void 0:y.rules},O)}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function S(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(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 j(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}}var w=function(){var e=(0,b.useDataBlockRequestGetter)().getDataBlockRequest,t=(0,b.useDataBlockProps)().association,n=(0,b.useActionContext)().setVisible,o=(0,b.useCollection)(),r=(0,b.useSourceId)(),i=(0,g.useMemo)(function(){var e="".concat(o.name,":create");if(t){var n,i,a=(n=t.split("."),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{!a&&null!=r.return&&r.return()}finally{if(c)throw o}}return i}}(n,2)||j(n,i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],l=a[1];e="".concat(c,"/").concat(r,"/").concat(l,":create")}return e},[o.name,t,r]),a=((0,g.useContext)(b.RecordPickerContext)||{}).setSelectedRows,c={},l=0,u={action:i,onChange:function(t){t.forEach(function(n){if("uploading"===n.status&&!c[n.uid]&&(l++,c[n.uid]=!0),"uploading"!==n.status&&c[n.uid]&&(delete c[n.uid],0==--l)){var o,r;null===(r=e())||void 0===r||null===(o=r.refresh)||void 0===o||o.call(r),null==a||a(function(e){return S(e).concat(S(t.filter(function(e){return"done"===e.status}).map(function(e){return e.response.data})))})}}),t.every(function(e){return"done"===e.status})&&n(!1)}},p=v(u);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}({},u,p)},P=f("505");function A(e){var t,n=null!=e?e:"";(0,b.useAPIClient)();var o=(0,P.useField)(),r=(0,b.useRequest)({url:"storages:getBasicInfo/".concat(n)},{manual:!0,refreshDeps:[n],cacheKey:n}),i=r.loading,a=r.data,c=r.run;return(0,g.useEffect)(function(){if("editable"===o.pattern)c()},[o.pattern,c]),!i&&(null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.rules)||null}function C(){var e=(0,b.useCollectionField)(),t="".concat(e.target,":create").concat(e.storage?"?attachmentField=".concat(e.collectionName,".").concat(e.name):""),n=v({action:t});return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}({action:t},n)}function I(){var e=(0,b.useCollectionField)(),t=(0,b.useCollectionManager)().getCollection(null==e?void 0:e.target);return A(null==t?void 0:t.getOption("storage"))}var F=function(e){var t,n;return x().createElement(b.ActionInitializerItem,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o,r,i;o=e,r=t,i=n[t],r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i})}return e}({},e),n=(n={schema:{type:"void","x-action":"create",title:"{{t('Upload')}}","x-designer":"Action.Designer","x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{openMode:"drawer",type:"primary",icon:"UploadOutlined"},properties:{drawer:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Action.Container",properties:{upload:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Upload.DraggerV2","x-use-component-props":"useUploadFiles","x-component-props":{height:"50vh",multiple:!0,listType:"picture"}}}}}}},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},T=function(e){return x().createElement(b.SchemaComponentOptions,{scope:y,components:{UploadActionInitializer:F}},e.children)},E=f("482"),D=f("875"),k=f("721"),R=f("467"),q=f.n(R),_=f("238"),M="file-manager",U={name:"storages",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Storage name", { ns: "'.concat(M,'" })}}'),descriptions:'{{t("Will be used for API", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Storage type", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Select",required:!0,enum:"{{ storageTypeOptions }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:'{{t("Access base URL", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:'{{t("Path", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},{type:"boolean",name:"paranoid",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}}]};var B={type:"object",properties:(l={},u=(0,D.uid)(),p={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:U,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:U},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"CreateStorage","x-component-props":{type:"primary"}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Default storage", { ns: "'.concat(M,'" })}}'),properties:{default:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditStorage","x-component-props":{type:"primary"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete")}}',content:'{{t("Are you sure you want to delete it?")}}'},useAction:"{{cm.useDestroyAction}}"}}}}}}}}}},u in l?Object.defineProperty(l,u,{value:p,enumerable:!0,configurable:!0,writable:!0}):l[u]=p,l)},K=Number.POSITIVE_INFINITY,G={title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t(\'Base URL for file access, could be your CDN base URL. For example: "https://cdn.nocobase.com".\', { ns: "'.concat(M,'" })}}')},path:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t(\'Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes "/" will be ignored. For example: "user/avatar".\', { ns: "'.concat(M,'" })}}')},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:'{{t("File size limit", { ns: "'.concat(M,'" })}}'),description:'{{t("Minimum from 1 byte, maximum up to 1GB.", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:0x1400000},mimetype:{type:"string",title:'{{t("File type (in MIME type format)", { ns: "'.concat(M,'" })}}'),description:'{{t(\'Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.\', { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default storage", { ns: "'.concat(M,'" })}}')},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Keep file in storage when destroy record", { ns: "'.concat(M,'" })}}')}},W={title:'{{t("Aliyun OSS", { ns: "'.concat(M,'" })}}'),name:"ali-oss",fieldset:{title:G.title,name:G.name,baseUrl:G.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",description:'{{t(\'Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".\', { ns: "'.concat(M,'" })}}'),required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{placeholder:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90"},description:'{{ renderThumbnailRuleDesc("ali-oss") }}'}}},path:G.path,rules:G.rules,default:G.default,paranoid:G.paranoid},thumbnailRuleLink:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4"},z={local:{title:'{{t("Local storage", { ns: "'.concat(M,'" })}}'),name:"local",fieldset:{title:G.title,name:G.name,baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem","x-display":"hidden",default:"/storage/uploads"},options:{type:"object","x-component":"div",properties:{documentRoot:{title:'{{t("Destination", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"Input","x-display":"hidden",default:"storage/uploads"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{addonBefore:"storage/uploads/"}},rules:G.rules,default:G.default,paranoid:G.paranoid}},"ali-oss":W,s3:{title:'{{t("Amazon S3", { ns: "'.concat(M,'" })}}'),name:"s3",fieldset:{title:G.title,name:G.name,baseUrl:G.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},path:G.path,rules:G.rules,default:G.default,paranoid:G.paranoid}},"tx-cos":{title:'{{t("Tencent COS", { ns: "'.concat(M,'" })}}'),name:"tx-cos",fieldset:{title:G.title,name:G.name,baseUrl:G.baseUrl,options:{type:"object","x-component":"fieldset",properties:{Region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:'{{t("SecretId", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:'{{t("SecretKey", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{placeholder:"?imageMogr2/thumbnail/!50p"},description:'{{ renderThumbnailRuleDesc("tx-cos") }}'}}},path:G.path,rules:G.rules,default:G.default,paranoid:G.paranoid},thumbnailRuleLink:"https://cloud.tencent.com/document/product/436/42214"}};function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){L(e,t,n[t])})}return e}function $(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{!a&&null!=r.return&&r.return()}finally{if(c)throw o}}return i}}(e,t)||J(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 H(e){return function(e){if(Array.isArray(e))return V(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||J(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 J(e,t){if(e){if("string"==typeof e)return V(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V(e,t)}}var Q=function(){var e=Y((0,g.useState)({}),2),t=e[0],n=e[1],o=(0,b.usePlugin)(eC),r=(0,b.useCompile)(),i=Y((0,g.useState)(!1),2),a=i[0],c=i[1],l=(0,_.useTranslation)().t;return x().createElement("div",null,x().createElement(b.ActionContext.Provider,{value:{visible:a,setVisible:c}},x().createElement(k.Dropdown,{menu:{onClick:function(e){var t=o.storageTypes.get(e.key);c(!0),n({type:"object",properties:L({},(0,D.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:t.name}},title:r("{{t('Add new')}}")+" - "+r(t.title),properties:$(N({},q().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}})})})},items:H(o.storageTypes.values()).map(function(e){return{key:e.name,label:r(e.title)}})}},x().createElement(k.Button,{type:"primary",icon:x().createElement(E.PlusOutlined,null)},l("Add new")," ",x().createElement(E.DownOutlined,null))),x().createElement(b.SchemaComponent,{scope:{createOnly:!0},schema:t})))},X=function(){var e=(0,b.useRecord)(),t=Y((0,g.useState)({}),2),n=t[0],o=t[1],r=(0,b.usePlugin)(eC),i=(0,b.useCompile)(),a=Y((0,g.useState)(!1),2),c=a[0],l=a[1],u=(0,_.useTranslation)().t;return x().createElement("div",null,x().createElement(b.ActionContext.Provider,{value:{visible:c,setVisible:l}},x().createElement("a",{onClick:function(){l(!0);var t=r.storageTypes.get(e.type);t.fieldset.default&&(t.fieldset.default["x-reactions"]=function(e){e.initialValue?e.disabled=!0:e.disabled=!1}),o({type:"object",properties:L({},(0,D.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:N({},e)},title:i("{{t('Edit')}}")+" - "+i(t.title),properties:$(N({},q().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}})})})}},u("Edit")),x().createElement(b.SchemaComponent,{scope:{createOnly:!1},schema:n})))};function Z(e){var t=z[e];return(null==t?void 0:t.thumbnailRule)?x().createElement("div",null,x().createElement("a",{target:"_blank",href:t.thumbnailRuleLink,rel:"noreferrer"},b.i18n.t("See more"))):null}var ee=function(){var e=(0,b.useCompile)(),t=H((0,b.usePlugin)(eC).storageTypes.values()).map(function(t){return{value:t.name,label:e(t.title)}});return x().createElement(k.Card,{bordered:!1},x().createElement(b.SchemaComponent,{components:{CreateStorage:Q,EditStorage:X},scope:{useNewId:function(e){return"".concat(e).concat((0,D.uid)())},storageTypeOptions:t,renderThumbnailRuleDesc:Z},schema:B}))};function et(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eo(e){return(eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ei(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ei=function(){return!!e})()}var ea=function(e){var t,n,o;function r(){var e,t,n,o,i,a;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),t=this,n=r,o=arguments,n=eo(n),en(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,ei()?Reflect.construct(n,o||[],eo(t).constructor):n.apply(t,o)),"name","attachment"),en(e,"type","object"),en(e,"group","media"),en(e,"title",'{{t("Attachment", { ns: "'.concat(M,'" })}}')),en(e,"isAssociation",!0),en(e,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}}),en(e,"availableTypes",["belongsToMany"]),en(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){en(e,t,n[t])})}return e}({},b.interfacesProperties.defaultProps),a=(a={"uiSchema.x-component-props.accept":{type:"string",title:'{{t("MIME type", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-component-props":{placeholder:"image/*"},"x-decorator":"FormItem",description:"Example: image/png"},"uiSchema.x-component-props.multiple":{type:"boolean","x-content":"{{t('Allow uploading multiple files', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),description:"{{t('Default storage will be used when not selected', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}},a),Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),en(e,"filterable",{children:[{name:"id",title:'{{t("Exists")}}',operators:[{label:'{{t("exists")}}',value:"$exists",noValue:!0},{label:'{{t("not exists")}}',value:"$notExists",noValue:!0}],schema:{title:'{{t("Exists")}}',type:"string","x-component":"Input"}},{name:"filename",title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),operators:b.interfacesProperties.operators.string,schema:{title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}}]}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&er(e,t)}(r,e),t=r,n=[{key:"schemaInitialize",value:function(e,t){var n=t.block;t.field,!e["x-component-props"]&&(e["x-component-props"]={}),["Table","Kanban"].includes(n)&&(e["x-component-props"].size="small"),e["x-use-component-props"]="useAttachmentFieldProps"}},{key:"initialize",value:function(e){!e.through&&(e.through="t_".concat((0,D.uid)())),!e.foreignKey&&(e.foreignKey="f_".concat((0,D.uid)())),!e.otherKey&&(e.otherKey="f_".concat((0,D.uid)())),!e.sourceKey&&(e.sourceKey="id"),!e.targetKey&&(e.targetKey="id")}}],et(t.prototype,n),r}(b.CollectionFieldInterface);function ec(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e){return(el=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){ec(e,t,n[t])})}return e}function ep(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function es(e,t){return(es=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function em(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(em=function(){return!!e})()}var ef=function(e){function t(){var e,n,o,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=this,o=t,r=arguments,o=el(o),ec(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,em()?Reflect.construct(o,r||[],el(n).constructor):o.apply(n,r)),"name","file"),ec(e,"title",'{{t("File collection", { ns: "'.concat(M,'" })}}')),ec(e,"order",3),ec(e,"color","blue"),ec(e,"default",{createdBy:!0,updatedBy:!0,fields:[{interface:"input",type:"string",name:"title",deletable:!1,uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"filename",deletable:!1,uiSchema:{type:"string",title:'{{t("File name", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:'{{t("Extension name", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:'{{t("Size", { ns: "'.concat(M,'" })}}'),"x-component":"InputNumber","x-read-pretty":!0,"x-component-props":{stringMode:!0,step:"0"}}},{interface:"input",type:"string",name:"mimetype",deletable:!1,uiSchema:{type:"string",title:'{{t("MIME type", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"text",name:"path",deletable:!1,uiSchema:{type:"string",title:'{{t("Path", { ns: "'.concat(M,'" })}}'),"x-component":"TextAreaWithGlobalScope","x-read-pretty":!0}},{interface:"url",type:"text",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"text",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("Preview", { ns: "'.concat(M,'" })}}'),"x-component":"Preview","x-read-pretty":!0}},{comment:"存储引擎",type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,uiSchema:{type:"string",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]}),ec(e,"presetFieldsDisabled",!0),ec(e,"configurableProperties",eu(ep(eu(ep(eu({},(0,b.getConfigurableProperties)("title","name")),{inherits:ep(eu({},(0,b.getConfigurableProperties)("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),(0,b.getConfigurableProperties)("category","description")),{storage:{type:"string",name:"storage",title:'{{t("File storage", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),(0,b.getConfigurableProperties)("presetFields"))),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&es(e,t)}(t,e),t}(b.CollectionTemplate),ed=[{value:1,label:"Byte"},{value:1024,label:"KB"},{value:1048576,label:"MB"},{value:0x40000000,label:"GB"}];function ey(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1048576,n=e||t,o=ed.length-1;o>=0;o--){var r=ed[o];if(n%r.value==0)return r}return ed[0]}function eb(e,t,n){return Math.min(Math.max(t,e),n)}function eg(e){var t,n=e.value,o=e.defaultUnit,r=void 0===o?1048576:o,i=e.min,a=void 0===i?1:i,c=e.max,l=void 0===c?K:c,u=e.step,p=e.onChange,s=null!==(t=e.defaultValue)&&void 0!==t?t:0x1400000,m=ey(s,r),f=s/m.value,d=ey(null!=n?n:s,r),y=null==n?n:n/d.value,b=(0,g.useCallback)(function(e){null==p||p(eb(null==e?e:e*d.value,a,l))},[d.value]),h=(0,g.useCallback)(function(e){null==p||p(eb(y*e,a,l))},[y]);return x().createElement(k.Space.Compact,null,x().createElement(k.InputNumber,{value:y,onChange:b,defaultValue:"".concat(f),step:void 0===u?1:u}),x().createElement(k.Select,{options:ed,value:d.value,onChange:h,className:"auto-width"}))}function ex(e,t,n,o,r,i,a){try{var c=e[i](a),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(o,r)}function eh(e,t,n){return(eh=eP()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&ej(r,n.prototype),r}).apply(null,arguments)}function ev(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function eO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eS(e){return(eS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ej(e,t){return(ej=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ew(e){var t="function"==typeof Map?new Map:void 0;return(ew=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).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,o)}function o(){return eh(e,arguments,eS(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),ej(o,e)})(e)}function eP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eP=function(){return!!e})()}var eA=function(e){var t,n,o;function r(){var e,t,n,o;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),t=this,n=r,o=arguments,n=eS(n),eO(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,eP()?Reflect.construct(n,o||[],eS(t).constructor):n.apply(t,o)),"storageTypes",new Map),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ej(e,t)}(r,e),t=r,n=[{key:"load",value:function(){var e,t=this;return(e=function(){var e;return function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(n){return t.app.dataSourceManager.addFieldInterfaces([ea]),t.app.dataSourceManager.addCollectionTemplates([ef]),t.app.use(T),t.app.pluginSettingsManager.add(M,{title:'{{t("File manager", { ns: "'.concat(M,'" })}}'),icon:"FileOutlined",Component:ee,aclSnippet:"pm.file-manager.storages"}),Object.values(z).forEach(function(e){t.registerStorageType(e.name,e)}),null==(e=t.app.schemaInitializerManager.get("table:configureActions"))||e.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return"file"===(0,b.useCollection)().template}}),t.app.addScopes({useAttachmentFieldProps:C,useFileCollectionStorageRules:I}),t.app.addComponents({FileSizeField:eg}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(e){ex(i,o,r,a,c,"next",e)}function c(e){ex(i,o,r,a,c,"throw",e)}a(void 0)})})()}},{key:"registerStorageType",value:function(e,t){this.storageTypes.set(e,t)}},{key:"getStorageType",value:function(e){return this.storageTypes.get(e)}}],ev(t.prototype,n),r}(ew(b.Plugin));eO(eA,"buildInStorage",["local","ali-oss","s3","tx-cos"]);var eC=eA;return d}()});
package/dist/constants.js CHANGED
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(constants_exports);
40
40
  const FILE_FIELD_NAME = "file";
41
41
  const LIMIT_FILES = 1;
42
42
  const FILE_SIZE_LIMIT_MIN = 1;
43
- const FILE_SIZE_LIMIT_MAX = 1024 * 1024 * 1024;
43
+ const FILE_SIZE_LIMIT_MAX = Number.POSITIVE_INFINITY;
44
44
  const FILE_SIZE_LIMIT_DEFAULT = 1024 * 1024 * 20;
45
45
  const STORAGE_TYPE_LOCAL = "local";
46
46
  const STORAGE_TYPE_ALI_OSS = "ali-oss";
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.6.2",
11
+ "@nocobase/client": "1.6.3",
12
12
  "react": "18.2.0",
13
13
  "antd": "5.12.8",
14
14
  "@ant-design/icons": "5.6.1",
@@ -18,12 +18,12 @@ module.exports = {
18
18
  "@formily/antd-v5": "1.1.9",
19
19
  "@formily/core": "2.3.0",
20
20
  "@formily/react": "2.3.0",
21
- "@nocobase/database": "1.6.2",
21
+ "@nocobase/database": "1.6.3",
22
22
  "multer": "1.4.4",
23
- "@nocobase/server": "1.6.2",
24
- "@nocobase/utils": "1.6.2",
25
- "@nocobase/test": "1.6.2",
26
- "@nocobase/actions": "1.6.2",
23
+ "@nocobase/server": "1.6.3",
24
+ "@nocobase/utils": "1.6.3",
25
+ "@nocobase/test": "1.6.3",
26
+ "@nocobase/actions": "1.6.3",
27
27
  "sequelize": "6.35.2",
28
- "@nocobase/plugin-data-source-main": "1.6.2"
28
+ "@nocobase/plugin-data-source-main": "1.6.3"
29
29
  };
@@ -0,0 +1,41 @@
1
+ {
2
+ "File collection": "Dateisammlung",
3
+ "File name": "Dateiname",
4
+ "Extension name": "Erweiterungsname",
5
+ "Size": "Größe",
6
+ "File size limit": "Dateigrößenbegrenzung",
7
+ "Minimum from 1 byte, maximum up to 1GB.": "Minimum 1 Byte, Maximum bis zu 1GB.",
8
+ "File manager": "Dateimanager",
9
+ "Attachment": "Anhang",
10
+ "MIME type": "MIME-Typ",
11
+ "File type (in MIME type format)": "Dateityp (im MIME-Typ-Format)",
12
+ "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Mehrere Typen durch Kommas getrennt, zum Beispiel: \"image/*\", \"image/png\", \"image/*, application/pdf\" usw.",
13
+ "URL": "URL",
14
+ "File storage": "Dateispeicher",
15
+ "Allow uploading multiple files": "Hochladen mehrerer Dateien erlauben",
16
+ "Storage": "Speicher",
17
+ "Storages": "Speicher",
18
+ "Storage display name": "Anzeigename des Speichers",
19
+ "Storage name": "Speichername",
20
+ "Storage type": "Speichertyp",
21
+ "Default storage": "Standardspeicher",
22
+ "Storage base URL": "Basis-URL des Speichers",
23
+ "Access base URL": "Basis-URL für den Zugriff",
24
+ "Base URL for file access, could be your CDN base URL. For example: \"https://cdn.nocobase.com\".": "Basis-URL für den Dateizugriff, könnte Ihre CDN-Basis-URL sein. Zum Beispiel: \"https://cdn.nocobase.com\".",
25
+ "Destination": "Ziel",
26
+ "Use the built-in static file server": "Den integrierten statischen Dateiserver verwenden",
27
+ "Local storage": "Lokaler Speicher",
28
+ "Aliyun OSS": "Aliyun OSS",
29
+ "Amazon S3": "Amazon S3",
30
+ "Tencent COS": "Tencent COS",
31
+ "Region": "Region",
32
+ "Bucket": "Bucket",
33
+ "Path": "Pfad",
34
+ "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Relativer Pfad, in dem die Datei gespeichert wird. Leer lassen als Stammpfad. Die führenden und abschließenden Schrägstriche \"/\" werden ignoriert. Zum Beispiel: \"user/avatar\".",
35
+ "Filename": "Dateiname",
36
+ "Will be used for API": "Wird für API verwendet",
37
+ "Default storage will be used when not selected": "Wenn nicht ausgewählt, wird der Standardspeicher verwendet",
38
+ "Keep file in storage when destroy record": "Datei im Speicher behalten, wenn Datensatz gelöscht wird",
39
+ "See more": "Mehr anzeigen",
40
+ "Aliyun OSS region part of the bucket. For example: \"oss-cn-beijing\".": "Aliyun OSS-Regionsteil des Buckets. Zum Beispiel: \"oss-cn-beijing\"."
41
+ }
@@ -19,4 +19,24 @@
19
19
  "Filename": "Nome file",
20
20
  "See more": "Vedi altro",
21
21
  "Will be used for API": "Sarà utilizzato per l'API"
22
+ {
23
+ "File collection": "Raccolta file",
24
+ "File name": "Nome file",
25
+ "Extension name": "Nome estensione",
26
+ "Size": "Dimensione file",
27
+ "File size limit": "Limite dimensione file",
28
+ "Minimum from 1 byte, maximum up to 1GB.": "Minimo da 1 byte, massimo fino a 1GB.",
29
+ "File type (in MIME type format)": "Tipo di file (in formato MIME)",
30
+ "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Più tipi separati da virgola, ad esempio: \"image/*\", \"image/png\", \"image/*, application/pdf\" ecc.",
31
+ "URL": "URL",
32
+ "File storage": "Archiviazione file",
33
+ "Allow uploading multiple files": "Consenti caricamento di più file",
34
+ "Storage": "Spazio di archiviazione",
35
+ "Storages": "Spazi di archiviazione",
36
+ "Access base URL": "URL base accesso",
37
+ "Base URL for file access, could be your CDN base URL. For example: \"https://cdn.nocobase.com\".": "URL base per l'accesso ai file, potrebbe essere l'URL base del tuo CDN. Ad esempio: \"https://cdn.nocobase.com\".",
38
+ "Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes \"/\" will be ignored. For example: \"user/avatar\".": "Percorso relativo in cui verrà salvato il file. Lasciare vuoto per il percorso radice. Le barre iniziali e finali \"/\" verranno ignorate. Ad esempio: \"user/avatar\".",
39
+ "Default storage will be used when not selected": "Se non selezionato verrà utilizzato lo spazio di archiviazione predefinito",
40
+ "Keep file in storage when destroy record": "Quando elimini il record mantieni il file nello spazio di archiviazione",
41
+ "Aliyun OSS region part of the bucket. For example: \"oss-cn-beijing\".": "Parte della regione Aliyun OSS del bucket. Ad esempio: \"oss-cn-beijing\"."
22
42
  }
@@ -1 +1 @@
1
- {"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.750.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.ts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.ts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.ts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.ts","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.750.0","@aws-sdk/credential-provider-node":"3.750.0","@aws-sdk/middleware-bucket-endpoint":"3.734.0","@aws-sdk/middleware-expect-continue":"3.734.0","@aws-sdk/middleware-flexible-checksums":"3.750.0","@aws-sdk/middleware-host-header":"3.734.0","@aws-sdk/middleware-location-constraint":"3.734.0","@aws-sdk/middleware-logger":"3.734.0","@aws-sdk/middleware-recursion-detection":"3.734.0","@aws-sdk/middleware-sdk-s3":"3.750.0","@aws-sdk/middleware-ssec":"3.734.0","@aws-sdk/middleware-user-agent":"3.750.0","@aws-sdk/region-config-resolver":"3.734.0","@aws-sdk/signature-v4-multi-region":"3.750.0","@aws-sdk/types":"3.734.0","@aws-sdk/util-endpoints":"3.743.0","@aws-sdk/util-user-agent-browser":"3.734.0","@aws-sdk/util-user-agent-node":"3.750.0","@aws-sdk/xml-builder":"3.734.0","@smithy/config-resolver":"^4.0.1","@smithy/core":"^3.1.4","@smithy/eventstream-serde-browser":"^4.0.1","@smithy/eventstream-serde-config-resolver":"^4.0.1","@smithy/eventstream-serde-node":"^4.0.1","@smithy/fetch-http-handler":"^5.0.1","@smithy/hash-blob-browser":"^4.0.1","@smithy/hash-node":"^4.0.1","@smithy/hash-stream-node":"^4.0.1","@smithy/invalid-dependency":"^4.0.1","@smithy/md5-js":"^4.0.1","@smithy/middleware-content-length":"^4.0.1","@smithy/middleware-endpoint":"^4.0.5","@smithy/middleware-retry":"^4.0.6","@smithy/middleware-serde":"^4.0.2","@smithy/middleware-stack":"^4.0.1","@smithy/node-config-provider":"^4.0.1","@smithy/node-http-handler":"^4.0.2","@smithy/protocol-http":"^5.0.1","@smithy/smithy-client":"^4.1.5","@smithy/types":"^4.1.0","@smithy/url-parser":"^4.0.1","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.6","@smithy/util-defaults-mode-node":"^4.0.6","@smithy/util-endpoints":"^3.0.1","@smithy/util-middleware":"^4.0.1","@smithy/util-retry":"^4.0.1","@smithy/util-stream":"^4.1.1","@smithy/util-utf8":"^4.0.0","@smithy/util-waiter":"^4.0.2","tslib":"^2.6.2"},"devDependencies":{"@aws-sdk/signature-v4-crt":"3.750.0","@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.2.2"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2025-03-12T08:56:11.306Z"}
1
+ {"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.750.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.ts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.ts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.ts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.ts","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.750.0","@aws-sdk/credential-provider-node":"3.750.0","@aws-sdk/middleware-bucket-endpoint":"3.734.0","@aws-sdk/middleware-expect-continue":"3.734.0","@aws-sdk/middleware-flexible-checksums":"3.750.0","@aws-sdk/middleware-host-header":"3.734.0","@aws-sdk/middleware-location-constraint":"3.734.0","@aws-sdk/middleware-logger":"3.734.0","@aws-sdk/middleware-recursion-detection":"3.734.0","@aws-sdk/middleware-sdk-s3":"3.750.0","@aws-sdk/middleware-ssec":"3.734.0","@aws-sdk/middleware-user-agent":"3.750.0","@aws-sdk/region-config-resolver":"3.734.0","@aws-sdk/signature-v4-multi-region":"3.750.0","@aws-sdk/types":"3.734.0","@aws-sdk/util-endpoints":"3.743.0","@aws-sdk/util-user-agent-browser":"3.734.0","@aws-sdk/util-user-agent-node":"3.750.0","@aws-sdk/xml-builder":"3.734.0","@smithy/config-resolver":"^4.0.1","@smithy/core":"^3.1.4","@smithy/eventstream-serde-browser":"^4.0.1","@smithy/eventstream-serde-config-resolver":"^4.0.1","@smithy/eventstream-serde-node":"^4.0.1","@smithy/fetch-http-handler":"^5.0.1","@smithy/hash-blob-browser":"^4.0.1","@smithy/hash-node":"^4.0.1","@smithy/hash-stream-node":"^4.0.1","@smithy/invalid-dependency":"^4.0.1","@smithy/md5-js":"^4.0.1","@smithy/middleware-content-length":"^4.0.1","@smithy/middleware-endpoint":"^4.0.5","@smithy/middleware-retry":"^4.0.6","@smithy/middleware-serde":"^4.0.2","@smithy/middleware-stack":"^4.0.1","@smithy/node-config-provider":"^4.0.1","@smithy/node-http-handler":"^4.0.2","@smithy/protocol-http":"^5.0.1","@smithy/smithy-client":"^4.1.5","@smithy/types":"^4.1.0","@smithy/url-parser":"^4.0.1","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.6","@smithy/util-defaults-mode-node":"^4.0.6","@smithy/util-endpoints":"^3.0.1","@smithy/util-middleware":"^4.0.1","@smithy/util-retry":"^4.0.1","@smithy/util-stream":"^4.1.1","@smithy/util-utf8":"^4.0.0","@smithy/util-waiter":"^4.0.2","tslib":"^2.6.2"},"devDependencies":{"@aws-sdk/signature-v4-crt":"3.750.0","@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.2.2"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2025-03-13T23:00:26.192Z"}
@@ -1 +1 @@
1
- {"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2025-03-12T08:56:04.898Z"}
1
+ {"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2025-03-13T23:00:20.030Z"}
@@ -1 +1 @@
1
- {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2025-03-12T08:56:09.875Z"}
1
+ {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2025-03-13T23:00:24.751Z"}
@@ -1 +1 @@
1
- {"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2025-03-12T08:56:09.790Z"}
1
+ {"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2025-03-13T23:00:24.671Z"}
@@ -1 +1 @@
1
- {"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2025-03-12T08:56:16.366Z"}
1
+ {"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2025-03-13T23:00:32.025Z"}
@@ -1 +1 @@
1
- {"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2025-03-12T08:56:12.834Z"}
1
+ {"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2025-03-13T23:00:27.856Z"}
@@ -102,10 +102,7 @@ async function multipart(ctx, next) {
102
102
  },
103
103
  storage: storageInstance.make()
104
104
  };
105
- multerOptions.limits["fileSize"] = Math.min(
106
- Math.max(import_constants.FILE_SIZE_LIMIT_MIN, storage.rules.size ?? import_constants.FILE_SIZE_LIMIT_DEFAULT),
107
- import_constants.FILE_SIZE_LIMIT_MAX
108
- );
105
+ multerOptions.limits["fileSize"] = Math.max(import_constants.FILE_SIZE_LIMIT_MIN, storage.rules.size ?? import_constants.FILE_SIZE_LIMIT_DEFAULT);
109
106
  const upload = (0, import_utils.koaMulter)(multerOptions).single(import_constants.FILE_FIELD_NAME);
110
107
  try {
111
108
  await upload(ctx, () => {
@@ -41,12 +41,11 @@ __export(utils_exports, {
41
41
  getFilename: () => getFilename
42
42
  });
43
43
  module.exports = __toCommonJS(utils_exports);
44
- var import_utils = require("@nocobase/utils");
45
- var import_iconv_lite = __toESM(require("iconv-lite"));
46
44
  var import_path = __toESM(require("path"));
45
+ var import_utils = require("@nocobase/utils");
47
46
  function getFilename(req, file, cb) {
48
- const originalname = import_iconv_lite.default.decode(Buffer.from(file.originalname, "binary"), "utf8");
49
- const baseName = import_path.default.basename(originalname, import_path.default.extname(originalname));
47
+ const originalname = Buffer.from(file.originalname, "binary").toString("utf8");
48
+ const baseName = import_path.default.basename(originalname.replace(/[<>?*|:"\\/]/g, "-"), import_path.default.extname(originalname));
50
49
  cb(null, `${baseName}-${(0, import_utils.uid)(6)}${import_path.default.extname(originalname)}`);
51
50
  }
52
51
  const cloudFilenameGetter = (storage) => (req, file, cb) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-file-manager",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "displayName": "File manager",
5
5
  "displayName.zh-CN": "文件管理器",
6
6
  "description": "Provides files storage services with files collection template and attachment field.",
@@ -20,7 +20,6 @@
20
20
  "@types/multer": "^1.4.5",
21
21
  "antd": "5.x",
22
22
  "cos-nodejs-sdk-v5": "^2.11.14",
23
- "iconv-lite": "^0.6.3",
24
23
  "koa-static": "^5.0.0",
25
24
  "mime-match": "^1.0.2",
26
25
  "mkdirp": "~0.5.4",
@@ -44,5 +43,5 @@
44
43
  "Collections",
45
44
  "Collection fields"
46
45
  ],
47
- "gitHead": "d1f1a2c1a038986f751abdeb82e9df97a2fd9e25"
46
+ "gitHead": "a5236dc36ff3493fee4ced9d99e1889e9de300cf"
48
47
  }
@@ -1,11 +0,0 @@
1
- # Please see the documentation for all configuration options:
2
- # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3
-
4
- version: 2
5
- updates:
6
- - package-ecosystem: "npm"
7
- directory: "/"
8
- schedule:
9
- interval: "daily"
10
- allow:
11
- - dependency-type: production
@@ -1,47 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- <option name="HTML_ENFORCE_QUOTES" value="true" />
6
- </HTMLCodeStyleSettings>
7
- <JSCodeStyleSettings version="0">
8
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
9
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
10
- <option name="FORCE_QUOTE_STYlE" value="true" />
11
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
12
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
- </JSCodeStyleSettings>
15
- <TypeScriptCodeStyleSettings version="0">
16
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
- <option name="FORCE_QUOTE_STYlE" value="true" />
19
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
20
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
21
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
22
- </TypeScriptCodeStyleSettings>
23
- <VueCodeStyleSettings>
24
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
25
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
26
- </VueCodeStyleSettings>
27
- <codeStyleSettings language="HTML">
28
- <option name="SOFT_MARGINS" value="100" />
29
- <indentOptions>
30
- <option name="CONTINUATION_INDENT_SIZE" value="4" />
31
- </indentOptions>
32
- </codeStyleSettings>
33
- <codeStyleSettings language="JavaScript">
34
- <option name="SOFT_MARGINS" value="100" />
35
- </codeStyleSettings>
36
- <codeStyleSettings language="TypeScript">
37
- <option name="SOFT_MARGINS" value="100" />
38
- </codeStyleSettings>
39
- <codeStyleSettings language="Vue">
40
- <option name="SOFT_MARGINS" value="100" />
41
- <indentOptions>
42
- <option name="INDENT_SIZE" value="4" />
43
- <option name="TAB_SIZE" value="4" />
44
- </indentOptions>
45
- </codeStyleSettings>
46
- </code_scheme>
47
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/iconv-lite.iml" filepath="$PROJECT_DIR$/.idea/iconv-lite.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,21 +0,0 @@
1
- Copyright (c) 2011 Alexander Shtuchkin
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-