@nocobase/plugin-file-manager 2.0.0-alpha.9 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/dist/client/index.d.ts +1 -1
  2. package/dist/client/index.js +1 -1
  3. package/dist/client/models/DisplayPreviewFieldModel.d.ts +1 -0
  4. package/dist/client/models/UploadActionModel.d.ts +3 -1
  5. package/dist/client/schemas/storageTypes/ali-oss.d.ts +12 -0
  6. package/dist/client/schemas/storageTypes/common.d.ts +12 -0
  7. package/dist/client/schemas/storageTypes/index.d.ts +48 -0
  8. package/dist/client/schemas/storageTypes/local.d.ts +12 -0
  9. package/dist/client/schemas/storageTypes/s3.d.ts +12 -0
  10. package/dist/client/schemas/storageTypes/tx-cos.d.ts +12 -0
  11. package/dist/client/templates/file.d.ts +4 -0
  12. package/dist/common/collections/storages.d.ts +11 -0
  13. package/dist/common/collections/storages.js +6 -0
  14. package/dist/externalVersion.js +8 -8
  15. package/dist/locale/de-DE.json +42 -29
  16. package/dist/locale/en-US.json +43 -30
  17. package/dist/locale/es-ES.json +54 -0
  18. package/dist/locale/fr-FR.json +45 -12
  19. package/dist/locale/hu-HU.json +48 -0
  20. package/dist/locale/id-ID.json +48 -0
  21. package/dist/locale/it-IT.json +43 -28
  22. package/dist/locale/ja-JP.json +43 -30
  23. package/dist/locale/ko-KR.json +46 -24
  24. package/dist/locale/nl-NL.json +53 -39
  25. package/dist/locale/pt-BR.json +54 -0
  26. package/dist/locale/ru-RU.json +47 -11
  27. package/dist/locale/tr-TR.json +47 -10
  28. package/dist/locale/uk-UA.json +54 -0
  29. package/dist/locale/vi-VN.json +48 -0
  30. package/dist/locale/zh-CN.json +41 -31
  31. package/dist/locale/zh-TW.json +54 -0
  32. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  33. package/dist/node_modules/@aws-sdk/lib-storage/LICENSE +201 -0
  34. package/dist/node_modules/{multer-s3 → @aws-sdk/lib-storage/dist-cjs}/index.js +574 -6229
  35. package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.browser.js +8 -0
  36. package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.js +10 -0
  37. package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.native.js +8 -0
  38. package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.shared.js +6 -0
  39. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/Upload.js +304 -0
  40. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/bytelength.js +27 -0
  41. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunker.js +24 -0
  42. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getChunkStream.js +24 -0
  43. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getChunkUint8Array.js +19 -0
  44. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getDataReadable.js +11 -0
  45. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getDataReadableStream.js +24 -0
  46. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/index.js +2 -0
  47. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.browser.js +5 -0
  48. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.js +7 -0
  49. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.native.js +5 -0
  50. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.shared.js +3 -0
  51. package/dist/node_modules/@aws-sdk/lib-storage/dist-es/types.js +1 -0
  52. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/Upload.d.ts +59 -0
  53. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/bytelength.d.ts +1 -0
  54. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunker.d.ts +3 -0
  55. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getChunkStream.d.ts +2 -0
  56. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getChunkUint8Array.d.ts +2 -0
  57. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getDataReadable.d.ts +3 -0
  58. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getDataReadableStream.d.ts +1 -0
  59. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/index.d.ts +2 -0
  60. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.browser.d.ts +7 -0
  61. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.d.ts +8 -0
  62. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.native.d.ts +7 -0
  63. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.shared.d.ts +6 -0
  64. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/Upload.d.ts +43 -0
  65. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/bytelength.d.ts +1 -0
  66. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunker.d.ts +6 -0
  67. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getChunkStream.d.ts +6 -0
  68. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getChunkUint8Array.d.ts +5 -0
  69. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getDataReadable.d.ts +4 -0
  70. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getDataReadableStream.d.ts +3 -0
  71. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/index.d.ts +2 -0
  72. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  73. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  74. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  75. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.shared.d.ts +3 -0
  76. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/types.d.ts +22 -0
  77. package/dist/node_modules/@aws-sdk/lib-storage/dist-types/types.d.ts +51 -0
  78. package/dist/node_modules/@aws-sdk/lib-storage/package.json +1 -0
  79. package/dist/node_modules/{multer-s3 → ali-oss}/LICENSE +1 -2
  80. package/dist/node_modules/ali-oss/dist/aliyun-oss-sdk.js +44018 -0
  81. package/dist/node_modules/ali-oss/dist/aliyun-oss-sdk.min.js +4 -0
  82. package/dist/node_modules/ali-oss/lib/browser/bucket.js +296 -0
  83. package/dist/node_modules/ali-oss/lib/browser/client.js +452 -0
  84. package/dist/node_modules/ali-oss/lib/browser/managed-upload.js +360 -0
  85. package/dist/node_modules/ali-oss/lib/browser/object.js +385 -0
  86. package/dist/node_modules/ali-oss/lib/browser/version.js +1 -0
  87. package/dist/node_modules/ali-oss/lib/browser.js +6 -0
  88. package/dist/node_modules/ali-oss/lib/bucket.js +337 -0
  89. package/dist/node_modules/{multer-aliyun-oss/index.js → ali-oss/lib/client.js} +2 -2
  90. package/dist/node_modules/ali-oss/lib/cluster.js +228 -0
  91. package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.d.ts +4 -0
  92. package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.js +14 -0
  93. package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.ts +12 -0
  94. package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.d.ts +4 -0
  95. package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.js +14 -0
  96. package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.ts +12 -0
  97. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketEncryption.js +20 -0
  98. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.d.ts +10 -0
  99. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.js +22 -0
  100. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.ts +21 -0
  101. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketLifecycle.js +13 -0
  102. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketPolicy.js +21 -0
  103. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketTags.js +21 -0
  104. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketWebsite.js +13 -0
  105. package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.d.ts +4 -0
  106. package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.js +23 -0
  107. package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.ts +21 -0
  108. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketEncryption.js +21 -0
  109. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.d.ts +11 -0
  110. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.js +25 -0
  111. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.ts +24 -0
  112. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketLifecycle.js +33 -0
  113. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketPolicy.js +28 -0
  114. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketRequestPayment.js +25 -0
  115. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.d.ts +23 -0
  116. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.js +17 -0
  117. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.ts +34 -0
  118. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketTags.js +23 -0
  119. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketVersioning.js +22 -0
  120. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWebsite.js +28 -0
  121. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.d.ts +1 -0
  122. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.js +20 -0
  123. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.ts +22 -0
  124. package/dist/node_modules/ali-oss/lib/common/bucket/index.js +34 -0
  125. package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.d.ts +5 -0
  126. package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.js +24 -0
  127. package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.ts +23 -0
  128. package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.d.ts +13 -0
  129. package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.js +29 -0
  130. package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.ts +32 -0
  131. package/dist/node_modules/ali-oss/lib/common/bucket/putBucket.js +31 -0
  132. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketEncryption.js +36 -0
  133. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.d.ts +36 -0
  134. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.js +58 -0
  135. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.ts +84 -0
  136. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketLifecycle.js +127 -0
  137. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketPolicy.js +27 -0
  138. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketRequestPayment.js +40 -0
  139. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketTags.js +39 -0
  140. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketVersioning.js +35 -0
  141. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketWebsite.js +50 -0
  142. package/dist/node_modules/ali-oss/lib/common/callback.js +27 -0
  143. package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.d.ts +1 -0
  144. package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.js +52 -0
  145. package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.ts +51 -0
  146. package/dist/node_modules/ali-oss/lib/common/client/initOptions.js +72 -0
  147. package/dist/node_modules/ali-oss/lib/common/image/index.js +5 -0
  148. package/dist/node_modules/ali-oss/lib/common/image/processObjectSave.js +45 -0
  149. package/dist/node_modules/ali-oss/lib/common/multipart-copy.js +240 -0
  150. package/dist/node_modules/ali-oss/lib/common/multipart.js +271 -0
  151. package/dist/node_modules/ali-oss/lib/common/object/asyncSignatureUrl.js +57 -0
  152. package/dist/node_modules/ali-oss/lib/common/object/calculatePostSignature.js +35 -0
  153. package/dist/node_modules/ali-oss/lib/common/object/copyObject.js +74 -0
  154. package/dist/node_modules/ali-oss/lib/common/object/delete.js +22 -0
  155. package/dist/node_modules/ali-oss/lib/common/object/deleteMulti.js +57 -0
  156. package/dist/node_modules/ali-oss/lib/common/object/deleteObjectTagging.js +22 -0
  157. package/dist/node_modules/ali-oss/lib/common/object/generateObjectUrl.js +28 -0
  158. package/dist/node_modules/ali-oss/lib/common/object/get.js +64 -0
  159. package/dist/node_modules/ali-oss/lib/common/object/getACL.js +30 -0
  160. package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.d.ts +1 -0
  161. package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.js +26 -0
  162. package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.ts +25 -0
  163. package/dist/node_modules/ali-oss/lib/common/object/getBucketVersions.js +98 -0
  164. package/dist/node_modules/ali-oss/lib/common/object/getObjectMeta.js +23 -0
  165. package/dist/node_modules/ali-oss/lib/common/object/getObjectTagging.js +34 -0
  166. package/dist/node_modules/ali-oss/lib/common/object/getObjectUrl.js +21 -0
  167. package/dist/node_modules/ali-oss/lib/common/object/getSymlink.js +23 -0
  168. package/dist/node_modules/ali-oss/lib/common/object/head.js +40 -0
  169. package/dist/node_modules/ali-oss/lib/common/object/index.js +26 -0
  170. package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.d.ts +1 -0
  171. package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.js +44 -0
  172. package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.ts +46 -0
  173. package/dist/node_modules/ali-oss/lib/common/object/putACL.js +27 -0
  174. package/dist/node_modules/ali-oss/lib/common/object/putObjectTagging.js +43 -0
  175. package/dist/node_modules/ali-oss/lib/common/object/putSymlink.js +33 -0
  176. package/dist/node_modules/ali-oss/lib/common/object/signatureUrl.js +52 -0
  177. package/dist/node_modules/ali-oss/lib/common/object/signatureUrlV4.js +70 -0
  178. package/dist/node_modules/ali-oss/lib/common/parallel.js +177 -0
  179. package/dist/node_modules/ali-oss/lib/common/signUtils.js +355 -0
  180. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.d.ts +1 -0
  181. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.js +9 -0
  182. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.ts +6 -0
  183. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.d.ts +1 -0
  184. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.js +14 -0
  185. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.ts +12 -0
  186. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.d.ts +1 -0
  187. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.js +49 -0
  188. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.ts +52 -0
  189. package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.d.ts +1 -0
  190. package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.js +30 -0
  191. package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.ts +27 -0
  192. package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.d.ts +1 -0
  193. package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.js +9 -0
  194. package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.ts +5 -0
  195. package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.d.ts +1 -0
  196. package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.js +50 -0
  197. package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.ts +53 -0
  198. package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.d.ts +1 -0
  199. package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.js +7 -0
  200. package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.ts +4 -0
  201. package/dist/node_modules/ali-oss/lib/common/utils/checkValid.d.ts +1 -0
  202. package/dist/node_modules/ali-oss/lib/common/utils/checkValid.js +14 -0
  203. package/dist/node_modules/ali-oss/lib/common/utils/checkValid.ts +9 -0
  204. package/dist/node_modules/ali-oss/lib/common/utils/createRequest.d.ts +8 -0
  205. package/dist/node_modules/ali-oss/lib/common/utils/createRequest.js +139 -0
  206. package/dist/node_modules/ali-oss/lib/common/utils/createRequest.ts +169 -0
  207. package/dist/node_modules/ali-oss/lib/common/utils/dataFix.d.ts +12 -0
  208. package/dist/node_modules/ali-oss/lib/common/utils/dataFix.js +63 -0
  209. package/dist/node_modules/ali-oss/lib/common/utils/dataFix.ts +78 -0
  210. package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.d.ts +2 -0
  211. package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.js +41 -0
  212. package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.ts +47 -0
  213. package/dist/node_modules/ali-oss/lib/common/utils/encodeString.d.ts +1 -0
  214. package/dist/node_modules/ali-oss/lib/common/utils/encodeString.js +12 -0
  215. package/dist/node_modules/ali-oss/lib/common/utils/encodeString.ts +7 -0
  216. package/dist/node_modules/ali-oss/lib/common/utils/encoder.d.ts +2 -0
  217. package/dist/node_modules/ali-oss/lib/common/utils/encoder.js +9 -0
  218. package/dist/node_modules/ali-oss/lib/common/utils/encoder.ts +6 -0
  219. package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.d.ts +1 -0
  220. package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.js +45 -0
  221. package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.ts +41 -0
  222. package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.d.ts +6 -0
  223. package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.js +34 -0
  224. package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.ts +35 -0
  225. package/dist/node_modules/ali-oss/lib/common/utils/formatTag.d.ts +1 -0
  226. package/dist/node_modules/ali-oss/lib/common/utils/formatTag.js +22 -0
  227. package/dist/node_modules/ali-oss/lib/common/utils/formatTag.ts +20 -0
  228. package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.d.ts +1 -0
  229. package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.js +7 -0
  230. package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.ts +3 -0
  231. package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.d.ts +1 -0
  232. package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.js +17 -0
  233. package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.ts +12 -0
  234. package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.d.ts +1 -0
  235. package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.js +18 -0
  236. package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.ts +14 -0
  237. package/dist/node_modules/ali-oss/lib/common/utils/isArray.d.ts +1 -0
  238. package/dist/node_modules/ali-oss/lib/common/utils/isArray.js +6 -0
  239. package/dist/node_modules/ali-oss/lib/common/utils/isArray.ts +3 -0
  240. package/dist/node_modules/ali-oss/lib/common/utils/isBlob.d.ts +1 -0
  241. package/dist/node_modules/ali-oss/lib/common/utils/isBlob.js +7 -0
  242. package/dist/node_modules/ali-oss/lib/common/utils/isBlob.ts +3 -0
  243. package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.d.ts +1 -0
  244. package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.js +7 -0
  245. package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.ts +3 -0
  246. package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.d.ts +1 -0
  247. package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.js +10 -0
  248. package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.ts +6 -0
  249. package/dist/node_modules/ali-oss/lib/common/utils/isFile.d.ts +1 -0
  250. package/dist/node_modules/ali-oss/lib/common/utils/isFile.js +6 -0
  251. package/dist/node_modules/ali-oss/lib/common/utils/isFile.ts +3 -0
  252. package/dist/node_modules/ali-oss/lib/common/utils/isFunction.d.ts +1 -0
  253. package/dist/node_modules/ali-oss/lib/common/utils/isFunction.js +6 -0
  254. package/dist/node_modules/ali-oss/lib/common/utils/isFunction.ts +3 -0
  255. package/dist/node_modules/ali-oss/lib/common/utils/isIP.d.ts +6 -0
  256. package/dist/node_modules/ali-oss/lib/common/utils/isIP.js +14 -0
  257. package/dist/node_modules/ali-oss/lib/common/utils/isIP.ts +12 -0
  258. package/dist/node_modules/ali-oss/lib/common/utils/isObject.d.ts +1 -0
  259. package/dist/node_modules/ali-oss/lib/common/utils/isObject.js +6 -0
  260. package/dist/node_modules/ali-oss/lib/common/utils/isObject.ts +3 -0
  261. package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.d.ts +1 -0
  262. package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.js +14 -0
  263. package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.ts +11 -0
  264. package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.d.ts +1 -0
  265. package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.js +43 -0
  266. package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.ts +37 -0
  267. package/dist/node_modules/ali-oss/lib/common/utils/omit.d.ts +1 -0
  268. package/dist/node_modules/ali-oss/lib/common/utils/omit.js +11 -0
  269. package/dist/node_modules/ali-oss/lib/common/utils/omit.ts +9 -0
  270. package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.d.ts +1 -0
  271. package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.js +21 -0
  272. package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.ts +15 -0
  273. package/dist/node_modules/ali-oss/lib/common/utils/retry.d.ts +1 -0
  274. package/dist/node_modules/ali-oss/lib/common/utils/retry.js +30 -0
  275. package/dist/node_modules/ali-oss/lib/common/utils/retry.ts +26 -0
  276. package/dist/node_modules/ali-oss/lib/common/utils/setRegion.d.ts +3 -0
  277. package/dist/node_modules/ali-oss/lib/common/utils/setRegion.js +20 -0
  278. package/dist/node_modules/ali-oss/lib/common/utils/setRegion.ts +15 -0
  279. package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.d.ts +2 -0
  280. package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.js +36 -0
  281. package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.ts +32 -0
  282. package/dist/node_modules/ali-oss/lib/global.d.ts +6 -0
  283. package/dist/node_modules/ali-oss/lib/image.js +146 -0
  284. package/dist/node_modules/ali-oss/lib/managed-upload.js +380 -0
  285. package/dist/node_modules/ali-oss/lib/object.js +420 -0
  286. package/dist/node_modules/ali-oss/lib/rtmp.js +295 -0
  287. package/dist/node_modules/ali-oss/lib/setConfig.d.ts +3 -0
  288. package/dist/node_modules/ali-oss/lib/setConfig.js +42 -0
  289. package/dist/node_modules/ali-oss/lib/setConfig.ts +52 -0
  290. package/dist/node_modules/ali-oss/lib/sts.js +156 -0
  291. package/dist/node_modules/ali-oss/lib/types/experimental.d.ts +1 -0
  292. package/dist/node_modules/ali-oss/lib/types/experimental.js +2 -0
  293. package/dist/node_modules/ali-oss/lib/types/experimental.ts +1 -0
  294. package/dist/node_modules/ali-oss/node_modules/bowser/.editorconfig +17 -0
  295. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/.name +1 -0
  296. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/bowser.iml +8 -0
  297. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/encodings.xml +6 -0
  298. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/inspectionProfiles/Project_Default.xml +6 -0
  299. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/jsLibraryMappings.xml +8 -0
  300. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-exported-files.xml +8 -0
  301. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-navigator/profiles_settings.xml +3 -0
  302. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-navigator.xml +67 -0
  303. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/misc.xml +6 -0
  304. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/modules.xml +8 -0
  305. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/vcs.xml +6 -0
  306. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/watcherTasks.xml +4 -0
  307. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/workspace.xml +696 -0
  308. package/dist/node_modules/ali-oss/node_modules/bowser/.travis.yml +8 -0
  309. package/dist/node_modules/ali-oss/node_modules/bowser/bower.json +33 -0
  310. package/dist/node_modules/ali-oss/node_modules/bowser/bowser.js +644 -0
  311. package/dist/node_modules/ali-oss/node_modules/bowser/bowser.min.js +6 -0
  312. package/dist/node_modules/ali-oss/node_modules/bowser/package.json +38 -0
  313. package/dist/node_modules/ali-oss/node_modules/bowser/src/bowser.js +644 -0
  314. package/dist/node_modules/ali-oss/node_modules/bowser/test/test.js +151 -0
  315. package/dist/node_modules/ali-oss/node_modules/bowser/typings.d.ts +115 -0
  316. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/ProjectSettings.json +3 -0
  317. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/config/applicationhost.config +1031 -0
  318. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/node-dateformat/v15/.suo +0 -0
  319. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/slnx.sqlite +0 -0
  320. package/dist/node_modules/ali-oss/node_modules/dateformat/lib/dateformat.js +226 -0
  321. package/dist/node_modules/ali-oss/node_modules/dateformat/package.json +30 -0
  322. package/dist/node_modules/ali-oss/node_modules/mime/Mime.js +97 -0
  323. package/dist/node_modules/ali-oss/node_modules/mime/cli.js +46 -0
  324. package/dist/node_modules/ali-oss/node_modules/mime/index.js +4 -0
  325. package/dist/node_modules/ali-oss/node_modules/mime/lite.js +4 -0
  326. package/dist/node_modules/ali-oss/node_modules/mime/package.json +52 -0
  327. package/dist/node_modules/ali-oss/node_modules/mime/types/other.js +1 -0
  328. package/dist/node_modules/ali-oss/node_modules/mime/types/standard.js +1 -0
  329. package/dist/node_modules/ali-oss/package.json +1 -0
  330. package/dist/node_modules/ali-oss/shims/crypto/crypto.js +98 -0
  331. package/dist/node_modules/ali-oss/shims/crypto/helpers.js +36 -0
  332. package/dist/node_modules/ali-oss/shims/crypto/md5.js +152 -0
  333. package/dist/node_modules/ali-oss/shims/crypto/sha.js +91 -0
  334. package/dist/node_modules/ali-oss/shims/crypto/sha256.js +163 -0
  335. package/dist/node_modules/ali-oss/shims/debug.js +3 -0
  336. package/dist/node_modules/ali-oss/shims/is-type-of.js +18 -0
  337. package/dist/node_modules/ali-oss/shims/process.js +35 -0
  338. package/dist/node_modules/ali-oss/shims/stream-http/index.js +82 -0
  339. package/dist/node_modules/ali-oss/shims/stream-http/lib/capability.js +72 -0
  340. package/dist/node_modules/ali-oss/shims/stream-http/lib/request.js +320 -0
  341. package/dist/node_modules/ali-oss/shims/stream-http/lib/response.js +217 -0
  342. package/dist/node_modules/ali-oss/shims/url/index.js +696 -0
  343. package/dist/node_modules/ali-oss/shims/url/util.js +16 -0
  344. package/dist/node_modules/ali-oss/shims/utility.js +25 -0
  345. package/dist/node_modules/ali-oss/shims/xhr.js +798 -0
  346. package/dist/node_modules/mime-match/package.json +1 -1
  347. package/dist/node_modules/mime-types/package.json +1 -1
  348. package/dist/node_modules/mkdirp/package.json +1 -1
  349. package/dist/node_modules/multer-cos/package.json +1 -1
  350. package/dist/node_modules/url-join/package.json +1 -1
  351. package/dist/server/actions/storages.js +4 -6
  352. package/dist/server/server.js +1 -0
  353. package/dist/server/storages/ali-oss.d.ts +15 -1
  354. package/dist/server/storages/ali-oss.js +66 -2
  355. package/dist/server/storages/index.d.ts +1 -0
  356. package/dist/server/storages/local.js +1 -1
  357. package/dist/server/storages/s3.d.ts +10 -3
  358. package/dist/server/storages/s3.js +121 -29
  359. package/dist/server/storages/tx-cos.js +1 -1
  360. package/dist/server/utils.d.ts +1 -0
  361. package/dist/server/utils.js +43 -0
  362. package/package.json +7 -3
  363. package/dist/node_modules/multer-aliyun-oss/package.json +0 -1
  364. package/dist/node_modules/multer-s3/.gitattributes +0 -1
  365. package/dist/node_modules/multer-s3/.travis.yml +0 -6
  366. package/dist/node_modules/multer-s3/package.json +0 -1
  367. package/dist/node_modules/multer-s3/test/basic.js +0 -293
  368. package/dist/node_modules/multer-s3/test/files/a.txt +0 -1
  369. package/dist/node_modules/multer-s3/test/files/test.svg +0 -3
  370. package/dist/node_modules/multer-s3/test/files/test2.svg +0 -9
  371. package/dist/node_modules/multer-s3/test/util/mock-s3.js +0 -17
@@ -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-10-15T12:28:48.650Z"}
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":"2026-01-04T03:42:30.305Z"}
@@ -1 +1 @@
1
- {"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"3.0.1","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"^1.54.0"},"devDependencies":{"eslint":"8.33.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.27.5","eslint-plugin-markdown":"3.0.0","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"6.1.1","eslint-plugin-standard":"4.1.0","mocha":"10.2.0","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js","mimeScore.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-10-15T12:28:48.976Z"}
1
+ {"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"3.0.1","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"^1.54.0"},"devDependencies":{"eslint":"8.33.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.27.5","eslint-plugin-markdown":"3.0.0","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"6.1.1","eslint-plugin-standard":"4.1.0","mocha":"10.2.0","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js","mimeScore.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2026-01-04T03:42:30.621Z"}
@@ -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-10-15T12:28:54.064Z"}
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":"2026-01-04T03:42:35.310Z"}
@@ -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-10-15T12:29:00.630Z"}
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":"2026-01-04T03:42:41.288Z"}
@@ -1 +1 @@
1
- {"name":"url-join","version":"4.0.1","description":"Join urls and normalize as in path.join.","main":"lib/url-join.js","scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/jfromaniello/url-join.git"},"keywords":["url","join"],"author":"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)","license":"MIT","devDependencies":{"conventional-changelog":"^1.1.10","mocha":"^3.2.0","should":"~1.2.1"},"_lastModified":"2025-10-15T12:28:48.740Z"}
1
+ {"name":"url-join","version":"4.0.1","description":"Join urls and normalize as in path.join.","main":"lib/url-join.js","scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/jfromaniello/url-join.git"},"keywords":["url","join"],"author":"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)","license":"MIT","devDependencies":{"conventional-changelog":"^1.1.10","mocha":"^3.2.0","should":"~1.2.1"},"_lastModified":"2026-01-04T03:42:30.395Z"}
@@ -74,13 +74,11 @@ async function getBasicInfo(context, next) {
74
74
  next();
75
75
  }
76
76
  async function check(context, next) {
77
- var _a, _b, _c;
78
- console.log(1111111111, context.db);
79
- const { fileCollectionName } = context.action.params;
80
- console.log(fileCollectionName);
77
+ var _a;
78
+ const { fileCollectionName, storageName: storage_name } = context.action.params;
81
79
  let storage;
82
80
  const fileCollection = context.db.getCollection(fileCollectionName || "attachments");
83
- const storageName = (_a = fileCollection == null ? void 0 : fileCollection.options) == null ? void 0 : _a.storage;
81
+ const storageName = storage_name || ((_a = fileCollection == null ? void 0 : fileCollection.options) == null ? void 0 : _a.storage);
84
82
  if (storageName) {
85
83
  storage = await context.db.getRepository("storages").findOne({
86
84
  where: {
@@ -97,7 +95,7 @@ async function check(context, next) {
97
95
  if (!storage) {
98
96
  context.throw(400, context.t("Storage configuration not found. Please configure a storage provider first."));
99
97
  }
100
- const isSupportToUploadFiles = storage.type !== "s3-compatible" || ((_b = storage.options) == null ? void 0 : _b.baseUrl) && ((_c = storage.options) == null ? void 0 : _c.public);
98
+ const isSupportToUploadFiles = !!fileCollection;
101
99
  const storageInfo = {
102
100
  id: storage.id,
103
101
  title: storage.title,
@@ -248,6 +248,7 @@ class PluginFileManagerServer extends import_server.Plugin {
248
248
  (0, import_actions.default)(this);
249
249
  this.app.acl.allow("attachments", ["upload", "create"], "loggedIn");
250
250
  this.app.acl.allow("storages", "getBasicInfo", "loggedIn");
251
+ this.app.acl.allow("storages", "check", "loggedIn");
251
252
  this.app.acl.appendStrategyResource("attachments");
252
253
  const defaultStorageName = this.storageTypes.get(DEFAULT_STORAGE_TYPE).defaults().name;
253
254
  this.app.acl.addFixedParams("storages", "destroy", () => {
@@ -7,6 +7,19 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { AttachmentModel, StorageType } from '.';
10
+ declare function getRandomFilename(req: any, file: any, cb: any): void;
11
+ declare class AliYunOssStorage {
12
+ client: any;
13
+ getDestination: Function;
14
+ getFilename: Function;
15
+ constructor({ config, destination, filename }: {
16
+ config: any;
17
+ destination?: string;
18
+ filename?: typeof getRandomFilename;
19
+ });
20
+ _handleFile(req: any, file: any, cb: any): any;
21
+ _removeFile(req: any, file: any, cb: any): any;
22
+ }
10
23
  export default class extends StorageType {
11
24
  static defaults(): {
12
25
  title: string;
@@ -20,6 +33,7 @@ export default class extends StorageType {
20
33
  bucket: string;
21
34
  };
22
35
  };
23
- make(): any;
36
+ make(): AliYunOssStorage;
24
37
  delete(records: AttachmentModel[]): Promise<[number, AttachmentModel[]]>;
25
38
  }
39
+ export {};
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,15 +25,78 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
27
  };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var ali_oss_exports = {};
28
38
  __export(ali_oss_exports, {
29
39
  default: () => ali_oss_default
30
40
  });
31
41
  module.exports = __toCommonJS(ali_oss_exports);
42
+ var import_util = require("util");
43
+ var import_path = __toESM(require("path"));
44
+ var import_crypto = __toESM(require("crypto"));
32
45
  var import__ = require(".");
33
46
  var import_constants = require("../../constants");
34
47
  var import_utils = require("../utils");
48
+ const ERROR_NO_CLIENT = new Error("oss client undefined");
49
+ function getRandomFilename(req, file, cb) {
50
+ import_crypto.default.pseudoRandomBytes(16, function(err, raw) {
51
+ cb(err, err ? void 0 : `${raw.toString("hex")}${import_path.default.extname(file.originalname)}`);
52
+ });
53
+ }
54
+ class AliYunOssStorage {
55
+ client;
56
+ getDestination;
57
+ getFilename;
58
+ constructor({ config, destination = "", filename = getRandomFilename }) {
59
+ const OSS = require("ali-oss");
60
+ this.client = new OSS(config);
61
+ this.getDestination = typeof destination === "string" ? (req, file, cb) => cb(null, destination) : destination;
62
+ this.getFilename = filename;
63
+ }
64
+ _handleFile(req, file, cb) {
65
+ if (!this.client) {
66
+ return cb(ERROR_NO_CLIENT);
67
+ }
68
+ const getDestination = (0, import_util.promisify)(this.getDestination);
69
+ const getFilename = (0, import_util.promisify)(this.getFilename);
70
+ let size = 0;
71
+ Promise.all([getDestination(req, file), getFilename(req, file)]).then(([destination, filename]) => {
72
+ file.stream.on("data", (chunk) => {
73
+ size += Buffer.byteLength(chunk);
74
+ });
75
+ const options = {};
76
+ if (file.mimetype === "text/plain") {
77
+ options.mime = "text/plain; charset=utf-8";
78
+ }
79
+ return this.client.putStream(`${destination}/${filename}`, file.stream, options);
80
+ }).then((result) => {
81
+ const { url, name } = result;
82
+ const lastSlashIndex = name.lastIndexOf("/");
83
+ const path = name.substr(0, lastSlashIndex);
84
+ cb(null, {
85
+ destination: path,
86
+ filename: name.substr(lastSlashIndex + 1),
87
+ path,
88
+ size,
89
+ url
90
+ });
91
+ }).catch(cb);
92
+ }
93
+ _removeFile(req, file, cb) {
94
+ if (!this.client) {
95
+ return cb(ERROR_NO_CLIENT);
96
+ }
97
+ this.client.delete(file.filename).then((result) => cb(null, result)).catch(cb);
98
+ }
99
+ }
35
100
  class ali_oss_default extends import__.StorageType {
36
101
  static defaults() {
37
102
  return {
@@ -48,8 +113,7 @@ class ali_oss_default extends import__.StorageType {
48
113
  };
49
114
  }
50
115
  make() {
51
- const createAliOssStorage = require("multer-aliyun-oss");
52
- return new createAliOssStorage({
116
+ return new AliYunOssStorage({
53
117
  config: { timeout: 6e5, ...this.storage.options },
54
118
  filename: (0, import_utils.cloudFilenameGetter)(this.storage)
55
119
  });
@@ -15,6 +15,7 @@ export interface StorageModel {
15
15
  type: string;
16
16
  name: string;
17
17
  baseUrl: string;
18
+ renameMode?: string;
18
19
  options: Record<string, any>;
19
20
  rules?: Record<string, any>;
20
21
  path?: string;
@@ -76,7 +76,7 @@ class local_default extends import__.StorageType {
76
76
  const mkdirp = require("mkdirp");
77
77
  mkdirp(destPath, (err) => cb(err, destPath));
78
78
  },
79
- filename: import_utils2.getFilename
79
+ filename: (0, import_utils2.diskFilenameGetter)(this.storage)
80
80
  });
81
81
  }
82
82
  async delete(records) {
@@ -6,7 +6,8 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { AttachmentModel, StorageType } from '.';
9
+ import { S3Client } from '@aws-sdk/client-s3';
10
+ import { AttachmentModel, StorageModel, StorageType } from '.';
10
11
  export default class extends StorageType {
11
12
  static defaults(): {
12
13
  title: string;
@@ -21,8 +22,14 @@ export default class extends StorageType {
21
22
  };
22
23
  };
23
24
  static filenameKey: string;
24
- make(): any;
25
- calculateContentMD5(body: any): string;
25
+ client: S3Client;
26
+ constructor(storage: StorageModel);
27
+ make(): {
28
+ s3: S3Client;
29
+ _handleFile(req: any, file: any, cb: any): Promise<void>;
30
+ _removeFile(req: any, file: any, cb: any): void;
31
+ };
32
+ getFileURL(file: AttachmentModel, preview?: boolean): string | Promise<string>;
26
33
  deleteS3Objects(bucketName: string, objects: string[]): Promise<{
27
34
  Deleted: any[];
28
35
  }>;
@@ -40,10 +40,20 @@ __export(s3_exports, {
40
40
  });
41
41
  module.exports = __toCommonJS(s3_exports);
42
42
  var import_client_s3 = require("@aws-sdk/client-s3");
43
- var import_crypto = __toESM(require("crypto"));
43
+ var import_lib_storage = require("@aws-sdk/lib-storage");
44
+ var import_url_join = __toESM(require("url-join"));
45
+ var import_utils = require("@nocobase/utils");
46
+ var import_stream = require("stream");
44
47
  var import__ = require(".");
45
48
  var import_constants = require("../../constants");
46
- var import_utils = require("../utils");
49
+ var import_utils2 = require("../utils");
50
+ class CountingStream extends import_stream.Transform {
51
+ size = 0;
52
+ _transform(chunk, encoding, callback) {
53
+ this.size += chunk.length;
54
+ callback(null, chunk);
55
+ }
56
+ }
47
57
  class s3_default extends import__.StorageType {
48
58
  static defaults() {
49
59
  return {
@@ -60,48 +70,130 @@ class s3_default extends import__.StorageType {
60
70
  };
61
71
  }
62
72
  static filenameKey = "key";
63
- make() {
64
- const multerS3 = require("multer-s3");
65
- const { accessKeyId, secretAccessKey, bucket, acl = "public-read", ...options } = this.storage.options;
66
- if (options.endpoint) {
67
- options.forcePathStyle = true;
68
- } else {
69
- options.endpoint = void 0;
70
- }
71
- const s3 = new import_client_s3.S3Client({
73
+ client;
74
+ constructor(storage) {
75
+ super(storage);
76
+ const { accessKeyId, secretAccessKey, ...options } = this.storage.options;
77
+ const params = {
72
78
  ...options,
73
- credentials: {
79
+ requestChecksumCalculation: "WHEN_REQUIRED"
80
+ };
81
+ if (accessKeyId && secretAccessKey) {
82
+ params.credentials = {
74
83
  accessKeyId,
75
84
  secretAccessKey
76
- }
77
- });
78
- return multerS3({
79
- s3,
80
- bucket,
81
- acl,
82
- contentType(req, file, cb) {
83
- if (file.mimetype) {
84
- cb(null, file.mimetype);
85
+ };
86
+ }
87
+ if (options.endpoint) {
88
+ params.forcePathStyle = true;
89
+ } else {
90
+ params.endpoint = void 0;
91
+ }
92
+ this.client = new import_client_s3.S3Client(params);
93
+ this.client.middlewareStack.remove("flexibleChecksumsMiddleware");
94
+ this.client.middlewareStack.remove("flexibleChecksumsInputMiddleware");
95
+ }
96
+ make() {
97
+ const { bucket, acl = "public-read" } = this.storage.options;
98
+ const keyGetter = (0, import_utils2.cloudFilenameGetter)(this.storage);
99
+ const client = this.client;
100
+ const once = (fn) => {
101
+ let called = false;
102
+ return (...args) => {
103
+ if (called) return;
104
+ called = true;
105
+ fn(...args);
106
+ };
107
+ };
108
+ return {
109
+ s3: client,
110
+ async _handleFile(req, file, cb) {
111
+ const done = once(cb);
112
+ let key;
113
+ try {
114
+ key = await new Promise((resolve, reject) => {
115
+ keyGetter(req, file, (err, value) => {
116
+ if (err) {
117
+ reject(err);
118
+ return;
119
+ }
120
+ resolve(value);
121
+ });
122
+ });
123
+ } catch (error) {
124
+ done(error);
85
125
  return;
86
126
  }
87
- multerS3.AUTO_CONTENT_TYPE(req, file, cb);
127
+ try {
128
+ const contentType = file.mimetype || "application/octet-stream";
129
+ const counter = new CountingStream();
130
+ const uploadStream = file.stream.pipe(counter);
131
+ const upload = new import_lib_storage.Upload({
132
+ client,
133
+ params: {
134
+ Bucket: bucket,
135
+ Key: key,
136
+ ACL: acl,
137
+ Body: uploadStream,
138
+ ContentType: contentType
139
+ },
140
+ queueSize: 1,
141
+ leavePartsOnError: false
142
+ });
143
+ const result = await upload.done();
144
+ done(null, {
145
+ size: counter.size,
146
+ bucket,
147
+ key,
148
+ acl,
149
+ contentType,
150
+ etag: result.ETag,
151
+ versionId: result.VersionId
152
+ });
153
+ } catch (error) {
154
+ done(error);
155
+ }
88
156
  },
89
- key: (0, import_utils.cloudFilenameGetter)(this.storage)
90
- });
157
+ _removeFile(req, file, cb) {
158
+ (async () => {
159
+ try {
160
+ await client.send(
161
+ new import_client_s3.DeleteObjectCommand({
162
+ Bucket: bucket,
163
+ Key: file.key
164
+ })
165
+ );
166
+ cb(null);
167
+ } catch (err) {
168
+ cb(err);
169
+ }
170
+ })();
171
+ }
172
+ };
91
173
  }
92
- calculateContentMD5(body) {
93
- const hash = import_crypto.default.createHash("md5").update(body).digest("base64");
94
- return hash;
174
+ getFileURL(file, preview) {
175
+ if (file.url && (0, import_utils.isURL)(file.url)) {
176
+ return super.getFileURL(file, preview);
177
+ }
178
+ const { bucket, endpoint } = this.storage.options;
179
+ const baseUrlHasBucket = endpoint && this.storage.baseUrl && new RegExp(`/${bucket}/?$`).test(this.storage.baseUrl);
180
+ const keys = [
181
+ this.storage.baseUrl,
182
+ endpoint && !baseUrlHasBucket ? bucket : void 0,
183
+ file.path && encodeURI(file.path),
184
+ (0, import_utils2.ensureUrlEncoded)(file.filename),
185
+ preview && this.storage.options.thumbnailRule
186
+ ].filter(Boolean);
187
+ return (0, import_url_join.default)(keys);
95
188
  }
96
189
  async deleteS3Objects(bucketName, objects) {
97
- const { s3 } = this.make();
98
190
  const Deleted = [];
99
191
  for (const Key of objects) {
100
192
  const deleteCommand = new import_client_s3.DeleteObjectCommand({
101
193
  Bucket: bucketName,
102
194
  Key
103
195
  });
104
- await s3.send(deleteCommand);
196
+ await this.client.send(deleteCommand);
105
197
  Deleted.push({ Key });
106
198
  }
107
199
  return {
@@ -56,7 +56,7 @@ class tx_cos_default extends import__.StorageType {
56
56
  ...this.storage.options,
57
57
  dir: (this.storage.path ?? "").replace(/\/+$/, "")
58
58
  },
59
- filename: import_utils2.getFilename
59
+ filename: (0, import_utils2.diskFilenameGetter)(this.storage)
60
60
  });
61
61
  }
62
62
  async delete(records) {
@@ -8,6 +8,7 @@
8
8
  */
9
9
  export declare function getFilename(req: any, file: any, cb: any): void;
10
10
  export declare const cloudFilenameGetter: (storage: any) => (req: any, file: any, cb: any) => void;
11
+ export declare const diskFilenameGetter: (storage: any) => (req: any, file: any, cb: any) => void;
11
12
  export declare function getFileKey(record: any): any;
12
13
  export declare function ensureUrlEncoded(value: any): any;
13
14
  export declare function encodeURL(url: any): any;
@@ -37,6 +37,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
37
37
  var utils_exports = {};
38
38
  __export(utils_exports, {
39
39
  cloudFilenameGetter: () => cloudFilenameGetter,
40
+ diskFilenameGetter: () => diskFilenameGetter,
40
41
  encodeURL: () => encodeURL,
41
42
  ensureUrlEncoded: () => ensureUrlEncoded,
42
43
  getFileKey: () => getFileKey,
@@ -44,6 +45,7 @@ __export(utils_exports, {
44
45
  });
45
46
  module.exports = __toCommonJS(utils_exports);
46
47
  var import_utils = require("@nocobase/utils");
48
+ var import_crypto = __toESM(require("crypto"));
47
49
  var import_path = __toESM(require("path"));
48
50
  var import_url_join = __toESM(require("url-join"));
49
51
  function getFilename(req, file, cb) {
@@ -51,7 +53,29 @@ function getFilename(req, file, cb) {
51
53
  const baseName = import_path.default.basename(originalname.replace(/[<>?*|:"\\/]/g, "-"), import_path.default.extname(originalname));
52
54
  cb(null, `${baseName}-${(0, import_utils.uid)(6)}${import_path.default.extname(originalname)}`);
53
55
  }
56
+ function getOriginalFilename(file) {
57
+ const originalname = Buffer.from(file.originalname, "binary").toString("utf8");
58
+ const extname = import_path.default.extname(originalname);
59
+ const baseName = import_path.default.basename(originalname.replace(/[<>?*|:"\\/]/g, "-"), extname);
60
+ return `${baseName}${extname}`;
61
+ }
54
62
  const cloudFilenameGetter = (storage) => (req, file, cb) => {
63
+ const renameMode = storage.renameMode;
64
+ if (renameMode === "random") {
65
+ import_crypto.default.pseudoRandomBytes(16, function(err, raw) {
66
+ if (err) {
67
+ return cb(err);
68
+ }
69
+ const filename = `${raw.toString("hex")}${import_path.default.extname(file.originalname)}`;
70
+ cb(null, `${storage.path ? `${storage.path.replace(/\/+$/, "")}/` : ""}${filename}`);
71
+ });
72
+ return;
73
+ }
74
+ if (renameMode === "none") {
75
+ const filename = getOriginalFilename(file);
76
+ cb(null, `${storage.path ? `${storage.path.replace(/\/+$/, "")}/` : ""}${filename}`);
77
+ return;
78
+ }
55
79
  getFilename(req, file, (err, filename) => {
56
80
  if (err) {
57
81
  return cb(err);
@@ -59,6 +83,24 @@ const cloudFilenameGetter = (storage) => (req, file, cb) => {
59
83
  cb(null, `${storage.path ? `${storage.path.replace(/\/+$/, "")}/` : ""}${filename}`);
60
84
  });
61
85
  };
86
+ const diskFilenameGetter = (storage) => (req, file, cb) => {
87
+ const renameMode = storage.renameMode;
88
+ if (renameMode === "random") {
89
+ import_crypto.default.pseudoRandomBytes(16, function(err, raw) {
90
+ if (err) {
91
+ return cb(err);
92
+ }
93
+ const filename = `${raw.toString("hex")}${import_path.default.extname(file.originalname)}`;
94
+ cb(null, filename);
95
+ });
96
+ return;
97
+ }
98
+ if (renameMode === "none") {
99
+ cb(null, getOriginalFilename(file));
100
+ return;
101
+ }
102
+ getFilename(req, file, cb);
103
+ };
62
104
  function getFileKey(record) {
63
105
  return (0, import_url_join.default)(record.path || "", record.filename).replace(/^\//, "");
64
106
  }
@@ -87,6 +129,7 @@ function encodeURL(url) {
87
129
  // Annotate the CommonJS export names for ESM import in node:
88
130
  0 && (module.exports = {
89
131
  cloudFilenameGetter,
132
+ diskFilenameGetter,
90
133
  encodeURL,
91
134
  ensureUrlEncoded,
92
135
  getFileKey,
package/package.json CHANGED
@@ -1,16 +1,20 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-file-manager",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.0-beta.2",
4
4
  "displayName": "File manager",
5
+ "displayName.ru-RU": "Менеджер файлов",
5
6
  "displayName.zh-CN": "文件管理器",
6
7
  "description": "Provides files storage services with files collection template and attachment field.",
8
+ "description.ru-RU": "Предоставляет сервисы хранения файлов, шаблон коллекции файлов и поле вложений.",
7
9
  "description.zh-CN": "提供文件存储服务,并提供了文件表模板和附件字段。",
8
10
  "license": "AGPL-3.0",
9
11
  "main": "./dist/server/index.js",
10
12
  "homepage": "https://docs.nocobase.com/handbook/file-manager",
13
+ "homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/file-manager",
11
14
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/file-manager",
12
15
  "devDependencies": {
13
16
  "@aws-sdk/client-s3": "3.750.0",
17
+ "@aws-sdk/lib-storage": "3.750.0",
14
18
  "@formily/antd-v5": "1.x",
15
19
  "@formily/core": "2.x",
16
20
  "@formily/react": "2.x",
@@ -19,6 +23,7 @@
19
23
  "@types/koa-multer": "^1.0.4",
20
24
  "@types/mime-types": "^3.0.1",
21
25
  "@types/multer": "^1.4.5",
26
+ "ali-oss": "^6.1.0",
22
27
  "antd": "5.x",
23
28
  "axios": "^1.7.0",
24
29
  "cos-nodejs-sdk-v5": "^2.11.14",
@@ -27,7 +32,6 @@
27
32
  "mime-types": "^3.0.1",
28
33
  "mkdirp": "~0.5.4",
29
34
  "multer": "^1.4.5-lts.2",
30
- "multer-aliyun-oss": "2.1.3",
31
35
  "multer-cos": "^1.0.3",
32
36
  "multer-s3": "^3.0.1",
33
37
  "multistream": "^4.1.0",
@@ -51,5 +55,5 @@
51
55
  "Collections",
52
56
  "Collection fields"
53
57
  ],
54
- "gitHead": "4a9acf96f21a3aa35bccbd188b942595b09da0a9"
58
+ "gitHead": "b77a33ee933ae6e09d2d5dce017ca15d8552d57b"
55
59
  }
@@ -1 +0,0 @@
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-10-15T12:28:53.976Z"}
@@ -1 +0,0 @@
1
- *.svg text eol=lf
@@ -1,6 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - '6'
4
- - '4'
5
- - '0.12'
6
- - '0.10'
@@ -1 +0,0 @@
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-10-15T12:28:57.089Z"}