@nocobase/plugin-file-manager 1.9.24 → 1.9.26

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 (279) hide show
  1. package/dist/externalVersion.js +7 -7
  2. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  3. package/dist/node_modules/ali-oss/LICENSE +21 -0
  4. package/dist/node_modules/ali-oss/dist/aliyun-oss-sdk.js +44018 -0
  5. package/dist/node_modules/ali-oss/dist/aliyun-oss-sdk.min.js +4 -0
  6. package/dist/node_modules/ali-oss/lib/browser/bucket.js +296 -0
  7. package/dist/node_modules/ali-oss/lib/browser/client.js +452 -0
  8. package/dist/node_modules/ali-oss/lib/browser/managed-upload.js +360 -0
  9. package/dist/node_modules/ali-oss/lib/browser/object.js +385 -0
  10. package/dist/node_modules/ali-oss/lib/browser/version.js +1 -0
  11. package/dist/node_modules/ali-oss/lib/browser.js +6 -0
  12. package/dist/node_modules/ali-oss/lib/bucket.js +337 -0
  13. package/dist/node_modules/{multer-aliyun-oss/index.js → ali-oss/lib/client.js} +2 -2
  14. package/dist/node_modules/ali-oss/lib/cluster.js +228 -0
  15. package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.d.ts +4 -0
  16. package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.js +14 -0
  17. package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.ts +12 -0
  18. package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.d.ts +4 -0
  19. package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.js +14 -0
  20. package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.ts +12 -0
  21. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketEncryption.js +20 -0
  22. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.d.ts +10 -0
  23. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.js +22 -0
  24. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.ts +21 -0
  25. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketLifecycle.js +13 -0
  26. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketPolicy.js +21 -0
  27. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketTags.js +21 -0
  28. package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketWebsite.js +13 -0
  29. package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.d.ts +4 -0
  30. package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.js +23 -0
  31. package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.ts +21 -0
  32. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketEncryption.js +21 -0
  33. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.d.ts +11 -0
  34. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.js +25 -0
  35. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.ts +24 -0
  36. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketLifecycle.js +33 -0
  37. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketPolicy.js +28 -0
  38. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketRequestPayment.js +25 -0
  39. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.d.ts +23 -0
  40. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.js +17 -0
  41. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.ts +34 -0
  42. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketTags.js +23 -0
  43. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketVersioning.js +22 -0
  44. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWebsite.js +28 -0
  45. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.d.ts +1 -0
  46. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.js +20 -0
  47. package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.ts +22 -0
  48. package/dist/node_modules/ali-oss/lib/common/bucket/index.js +34 -0
  49. package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.d.ts +5 -0
  50. package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.js +24 -0
  51. package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.ts +23 -0
  52. package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.d.ts +13 -0
  53. package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.js +29 -0
  54. package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.ts +32 -0
  55. package/dist/node_modules/ali-oss/lib/common/bucket/putBucket.js +31 -0
  56. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketEncryption.js +36 -0
  57. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.d.ts +36 -0
  58. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.js +58 -0
  59. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.ts +84 -0
  60. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketLifecycle.js +127 -0
  61. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketPolicy.js +27 -0
  62. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketRequestPayment.js +40 -0
  63. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketTags.js +39 -0
  64. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketVersioning.js +35 -0
  65. package/dist/node_modules/ali-oss/lib/common/bucket/putBucketWebsite.js +50 -0
  66. package/dist/node_modules/ali-oss/lib/common/callback.js +27 -0
  67. package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.d.ts +1 -0
  68. package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.js +52 -0
  69. package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.ts +51 -0
  70. package/dist/node_modules/ali-oss/lib/common/client/initOptions.js +72 -0
  71. package/dist/node_modules/ali-oss/lib/common/image/index.js +5 -0
  72. package/dist/node_modules/ali-oss/lib/common/image/processObjectSave.js +45 -0
  73. package/dist/node_modules/ali-oss/lib/common/multipart-copy.js +240 -0
  74. package/dist/node_modules/ali-oss/lib/common/multipart.js +271 -0
  75. package/dist/node_modules/ali-oss/lib/common/object/asyncSignatureUrl.js +57 -0
  76. package/dist/node_modules/ali-oss/lib/common/object/calculatePostSignature.js +35 -0
  77. package/dist/node_modules/ali-oss/lib/common/object/copyObject.js +74 -0
  78. package/dist/node_modules/ali-oss/lib/common/object/delete.js +22 -0
  79. package/dist/node_modules/ali-oss/lib/common/object/deleteMulti.js +57 -0
  80. package/dist/node_modules/ali-oss/lib/common/object/deleteObjectTagging.js +22 -0
  81. package/dist/node_modules/ali-oss/lib/common/object/generateObjectUrl.js +28 -0
  82. package/dist/node_modules/ali-oss/lib/common/object/get.js +64 -0
  83. package/dist/node_modules/ali-oss/lib/common/object/getACL.js +30 -0
  84. package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.d.ts +1 -0
  85. package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.js +26 -0
  86. package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.ts +25 -0
  87. package/dist/node_modules/ali-oss/lib/common/object/getBucketVersions.js +98 -0
  88. package/dist/node_modules/ali-oss/lib/common/object/getObjectMeta.js +23 -0
  89. package/dist/node_modules/ali-oss/lib/common/object/getObjectTagging.js +34 -0
  90. package/dist/node_modules/ali-oss/lib/common/object/getObjectUrl.js +21 -0
  91. package/dist/node_modules/ali-oss/lib/common/object/getSymlink.js +23 -0
  92. package/dist/node_modules/ali-oss/lib/common/object/head.js +40 -0
  93. package/dist/node_modules/ali-oss/lib/common/object/index.js +26 -0
  94. package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.d.ts +1 -0
  95. package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.js +44 -0
  96. package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.ts +46 -0
  97. package/dist/node_modules/ali-oss/lib/common/object/putACL.js +27 -0
  98. package/dist/node_modules/ali-oss/lib/common/object/putObjectTagging.js +43 -0
  99. package/dist/node_modules/ali-oss/lib/common/object/putSymlink.js +33 -0
  100. package/dist/node_modules/ali-oss/lib/common/object/signatureUrl.js +52 -0
  101. package/dist/node_modules/ali-oss/lib/common/object/signatureUrlV4.js +70 -0
  102. package/dist/node_modules/ali-oss/lib/common/parallel.js +177 -0
  103. package/dist/node_modules/ali-oss/lib/common/signUtils.js +355 -0
  104. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.d.ts +1 -0
  105. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.js +9 -0
  106. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.ts +6 -0
  107. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.d.ts +1 -0
  108. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.js +14 -0
  109. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.ts +12 -0
  110. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.d.ts +1 -0
  111. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.js +49 -0
  112. package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.ts +52 -0
  113. package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.d.ts +1 -0
  114. package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.js +30 -0
  115. package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.ts +27 -0
  116. package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.d.ts +1 -0
  117. package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.js +9 -0
  118. package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.ts +5 -0
  119. package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.d.ts +1 -0
  120. package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.js +50 -0
  121. package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.ts +53 -0
  122. package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.d.ts +1 -0
  123. package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.js +7 -0
  124. package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.ts +4 -0
  125. package/dist/node_modules/ali-oss/lib/common/utils/checkValid.d.ts +1 -0
  126. package/dist/node_modules/ali-oss/lib/common/utils/checkValid.js +14 -0
  127. package/dist/node_modules/ali-oss/lib/common/utils/checkValid.ts +9 -0
  128. package/dist/node_modules/ali-oss/lib/common/utils/createRequest.d.ts +8 -0
  129. package/dist/node_modules/ali-oss/lib/common/utils/createRequest.js +139 -0
  130. package/dist/node_modules/ali-oss/lib/common/utils/createRequest.ts +169 -0
  131. package/dist/node_modules/ali-oss/lib/common/utils/dataFix.d.ts +12 -0
  132. package/dist/node_modules/ali-oss/lib/common/utils/dataFix.js +63 -0
  133. package/dist/node_modules/ali-oss/lib/common/utils/dataFix.ts +78 -0
  134. package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.d.ts +2 -0
  135. package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.js +41 -0
  136. package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.ts +47 -0
  137. package/dist/node_modules/ali-oss/lib/common/utils/encodeString.d.ts +1 -0
  138. package/dist/node_modules/ali-oss/lib/common/utils/encodeString.js +12 -0
  139. package/dist/node_modules/ali-oss/lib/common/utils/encodeString.ts +7 -0
  140. package/dist/node_modules/ali-oss/lib/common/utils/encoder.d.ts +2 -0
  141. package/dist/node_modules/ali-oss/lib/common/utils/encoder.js +9 -0
  142. package/dist/node_modules/ali-oss/lib/common/utils/encoder.ts +6 -0
  143. package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.d.ts +1 -0
  144. package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.js +45 -0
  145. package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.ts +41 -0
  146. package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.d.ts +6 -0
  147. package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.js +34 -0
  148. package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.ts +35 -0
  149. package/dist/node_modules/ali-oss/lib/common/utils/formatTag.d.ts +1 -0
  150. package/dist/node_modules/ali-oss/lib/common/utils/formatTag.js +22 -0
  151. package/dist/node_modules/ali-oss/lib/common/utils/formatTag.ts +20 -0
  152. package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.d.ts +1 -0
  153. package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.js +7 -0
  154. package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.ts +3 -0
  155. package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.d.ts +1 -0
  156. package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.js +17 -0
  157. package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.ts +12 -0
  158. package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.d.ts +1 -0
  159. package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.js +18 -0
  160. package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.ts +14 -0
  161. package/dist/node_modules/ali-oss/lib/common/utils/isArray.d.ts +1 -0
  162. package/dist/node_modules/ali-oss/lib/common/utils/isArray.js +6 -0
  163. package/dist/node_modules/ali-oss/lib/common/utils/isArray.ts +3 -0
  164. package/dist/node_modules/ali-oss/lib/common/utils/isBlob.d.ts +1 -0
  165. package/dist/node_modules/ali-oss/lib/common/utils/isBlob.js +7 -0
  166. package/dist/node_modules/ali-oss/lib/common/utils/isBlob.ts +3 -0
  167. package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.d.ts +1 -0
  168. package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.js +7 -0
  169. package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.ts +3 -0
  170. package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.d.ts +1 -0
  171. package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.js +10 -0
  172. package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.ts +6 -0
  173. package/dist/node_modules/ali-oss/lib/common/utils/isFile.d.ts +1 -0
  174. package/dist/node_modules/ali-oss/lib/common/utils/isFile.js +6 -0
  175. package/dist/node_modules/ali-oss/lib/common/utils/isFile.ts +3 -0
  176. package/dist/node_modules/ali-oss/lib/common/utils/isFunction.d.ts +1 -0
  177. package/dist/node_modules/ali-oss/lib/common/utils/isFunction.js +6 -0
  178. package/dist/node_modules/ali-oss/lib/common/utils/isFunction.ts +3 -0
  179. package/dist/node_modules/ali-oss/lib/common/utils/isIP.d.ts +6 -0
  180. package/dist/node_modules/ali-oss/lib/common/utils/isIP.js +14 -0
  181. package/dist/node_modules/ali-oss/lib/common/utils/isIP.ts +12 -0
  182. package/dist/node_modules/ali-oss/lib/common/utils/isObject.d.ts +1 -0
  183. package/dist/node_modules/ali-oss/lib/common/utils/isObject.js +6 -0
  184. package/dist/node_modules/ali-oss/lib/common/utils/isObject.ts +3 -0
  185. package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.d.ts +1 -0
  186. package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.js +14 -0
  187. package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.ts +11 -0
  188. package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.d.ts +1 -0
  189. package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.js +43 -0
  190. package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.ts +37 -0
  191. package/dist/node_modules/ali-oss/lib/common/utils/omit.d.ts +1 -0
  192. package/dist/node_modules/ali-oss/lib/common/utils/omit.js +11 -0
  193. package/dist/node_modules/ali-oss/lib/common/utils/omit.ts +9 -0
  194. package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.d.ts +1 -0
  195. package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.js +21 -0
  196. package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.ts +15 -0
  197. package/dist/node_modules/ali-oss/lib/common/utils/retry.d.ts +1 -0
  198. package/dist/node_modules/ali-oss/lib/common/utils/retry.js +30 -0
  199. package/dist/node_modules/ali-oss/lib/common/utils/retry.ts +26 -0
  200. package/dist/node_modules/ali-oss/lib/common/utils/setRegion.d.ts +3 -0
  201. package/dist/node_modules/ali-oss/lib/common/utils/setRegion.js +20 -0
  202. package/dist/node_modules/ali-oss/lib/common/utils/setRegion.ts +15 -0
  203. package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.d.ts +2 -0
  204. package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.js +36 -0
  205. package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.ts +32 -0
  206. package/dist/node_modules/ali-oss/lib/global.d.ts +6 -0
  207. package/dist/node_modules/ali-oss/lib/image.js +146 -0
  208. package/dist/node_modules/ali-oss/lib/managed-upload.js +380 -0
  209. package/dist/node_modules/ali-oss/lib/object.js +420 -0
  210. package/dist/node_modules/ali-oss/lib/rtmp.js +295 -0
  211. package/dist/node_modules/ali-oss/lib/setConfig.d.ts +3 -0
  212. package/dist/node_modules/ali-oss/lib/setConfig.js +42 -0
  213. package/dist/node_modules/ali-oss/lib/setConfig.ts +52 -0
  214. package/dist/node_modules/ali-oss/lib/sts.js +156 -0
  215. package/dist/node_modules/ali-oss/lib/types/experimental.d.ts +1 -0
  216. package/dist/node_modules/ali-oss/lib/types/experimental.js +2 -0
  217. package/dist/node_modules/ali-oss/lib/types/experimental.ts +1 -0
  218. package/dist/node_modules/ali-oss/node_modules/bowser/.editorconfig +17 -0
  219. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/.name +1 -0
  220. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/bowser.iml +8 -0
  221. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/encodings.xml +6 -0
  222. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/inspectionProfiles/Project_Default.xml +6 -0
  223. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/jsLibraryMappings.xml +8 -0
  224. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-exported-files.xml +8 -0
  225. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-navigator/profiles_settings.xml +3 -0
  226. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-navigator.xml +67 -0
  227. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/misc.xml +6 -0
  228. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/modules.xml +8 -0
  229. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/vcs.xml +6 -0
  230. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/watcherTasks.xml +4 -0
  231. package/dist/node_modules/ali-oss/node_modules/bowser/.idea/workspace.xml +696 -0
  232. package/dist/node_modules/ali-oss/node_modules/bowser/.travis.yml +8 -0
  233. package/dist/node_modules/ali-oss/node_modules/bowser/bower.json +33 -0
  234. package/dist/node_modules/ali-oss/node_modules/bowser/bowser.js +644 -0
  235. package/dist/node_modules/ali-oss/node_modules/bowser/bowser.min.js +6 -0
  236. package/dist/node_modules/ali-oss/node_modules/bowser/package.json +38 -0
  237. package/dist/node_modules/ali-oss/node_modules/bowser/src/bowser.js +644 -0
  238. package/dist/node_modules/ali-oss/node_modules/bowser/test/test.js +151 -0
  239. package/dist/node_modules/ali-oss/node_modules/bowser/typings.d.ts +115 -0
  240. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/ProjectSettings.json +3 -0
  241. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/config/applicationhost.config +1031 -0
  242. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/node-dateformat/v15/.suo +0 -0
  243. package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/slnx.sqlite +0 -0
  244. package/dist/node_modules/ali-oss/node_modules/dateformat/lib/dateformat.js +226 -0
  245. package/dist/node_modules/ali-oss/node_modules/dateformat/package.json +30 -0
  246. package/dist/node_modules/ali-oss/node_modules/mime/Mime.js +97 -0
  247. package/dist/node_modules/ali-oss/node_modules/mime/cli.js +46 -0
  248. package/dist/node_modules/ali-oss/node_modules/mime/index.js +4 -0
  249. package/dist/node_modules/ali-oss/node_modules/mime/lite.js +4 -0
  250. package/dist/node_modules/ali-oss/node_modules/mime/package.json +52 -0
  251. package/dist/node_modules/ali-oss/node_modules/mime/types/other.js +1 -0
  252. package/dist/node_modules/ali-oss/node_modules/mime/types/standard.js +1 -0
  253. package/dist/node_modules/ali-oss/package.json +1 -0
  254. package/dist/node_modules/ali-oss/shims/crypto/crypto.js +98 -0
  255. package/dist/node_modules/ali-oss/shims/crypto/helpers.js +36 -0
  256. package/dist/node_modules/ali-oss/shims/crypto/md5.js +152 -0
  257. package/dist/node_modules/ali-oss/shims/crypto/sha.js +91 -0
  258. package/dist/node_modules/ali-oss/shims/crypto/sha256.js +163 -0
  259. package/dist/node_modules/ali-oss/shims/debug.js +3 -0
  260. package/dist/node_modules/ali-oss/shims/is-type-of.js +18 -0
  261. package/dist/node_modules/ali-oss/shims/process.js +35 -0
  262. package/dist/node_modules/ali-oss/shims/stream-http/index.js +82 -0
  263. package/dist/node_modules/ali-oss/shims/stream-http/lib/capability.js +72 -0
  264. package/dist/node_modules/ali-oss/shims/stream-http/lib/request.js +320 -0
  265. package/dist/node_modules/ali-oss/shims/stream-http/lib/response.js +217 -0
  266. package/dist/node_modules/ali-oss/shims/url/index.js +696 -0
  267. package/dist/node_modules/ali-oss/shims/url/util.js +16 -0
  268. package/dist/node_modules/ali-oss/shims/utility.js +25 -0
  269. package/dist/node_modules/ali-oss/shims/xhr.js +798 -0
  270. package/dist/node_modules/mime-match/package.json +1 -1
  271. package/dist/node_modules/mime-types/package.json +1 -1
  272. package/dist/node_modules/mkdirp/package.json +1 -1
  273. package/dist/node_modules/multer-cos/package.json +1 -1
  274. package/dist/node_modules/multer-s3/package.json +1 -1
  275. package/dist/node_modules/url-join/package.json +1 -1
  276. package/dist/server/storages/ali-oss.d.ts +15 -1
  277. package/dist/server/storages/ali-oss.js +66 -2
  278. package/package.json +3 -3
  279. package/dist/node_modules/multer-aliyun-oss/package.json +0 -1
@@ -0,0 +1,228 @@
1
+ const Base = require('sdk-base');
2
+ const util = require('util');
3
+ const ready = require('get-ready');
4
+ const copy = require('copy-to');
5
+ const currentIP = require('address').ip();
6
+
7
+ const RR = 'roundRobin';
8
+ const MS = 'masterSlave';
9
+
10
+ module.exports = function (OssClient) {
11
+ function Client(options) {
12
+ if (!(this instanceof Client)) {
13
+ return new Client(options);
14
+ }
15
+
16
+ if (!options || !Array.isArray(options.cluster)) {
17
+ throw new Error('require options.cluster to be an array');
18
+ }
19
+
20
+ Base.call(this);
21
+
22
+ this.clients = [];
23
+ this.availables = {};
24
+
25
+ for (let i = 0; i < options.cluster.length; i++) {
26
+ const opt = options.cluster[i];
27
+ copy(options).pick('timeout', 'agent', 'urllib').to(opt);
28
+ this.clients.push(new OssClient(opt));
29
+ this.availables[i] = true;
30
+ }
31
+
32
+ this.schedule = options.schedule || RR;
33
+ // only read from master, default is false
34
+ this.masterOnly = !!options.masterOnly;
35
+ this.index = 0;
36
+
37
+ const heartbeatInterval = options.heartbeatInterval || 10000;
38
+ this._checkAvailableLock = false;
39
+ this._timerId = this._deferInterval(this._checkAvailable.bind(this, true), heartbeatInterval);
40
+ this._ignoreStatusFile = options.ignoreStatusFile || false;
41
+ this._init();
42
+ }
43
+
44
+ util.inherits(Client, Base);
45
+ const proto = Client.prototype;
46
+ ready.mixin(proto);
47
+
48
+ const GET_METHODS = ['head', 'get', 'getStream', 'list', 'getACL'];
49
+
50
+ const PUT_METHODS = ['put', 'putStream', 'delete', 'deleteMulti', 'copy', 'putMeta', 'putACL'];
51
+
52
+ GET_METHODS.forEach(method => {
53
+ proto[method] = async function (...args) {
54
+ const client = this.chooseAvailable();
55
+ let lastError;
56
+ try {
57
+ return await client[method](...args);
58
+ } catch (err) {
59
+ if (err.status && err.status >= 200 && err.status < 500) {
60
+ // 200 ~ 499 belong to normal response, don't try again
61
+ throw err;
62
+ }
63
+ // < 200 || >= 500 need to retry from other cluser node
64
+ lastError = err;
65
+ }
66
+
67
+ for (let i = 0; i < this.clients.length; i++) {
68
+ const c = this.clients[i];
69
+ if (c !== client) {
70
+ try {
71
+ return await c[method].apply(client, args);
72
+ } catch (err) {
73
+ if (err.status && err.status >= 200 && err.status < 500) {
74
+ // 200 ~ 499 belong to normal response, don't try again
75
+ throw err;
76
+ }
77
+ // < 200 || >= 500 need to retry from other cluser node
78
+ lastError = err;
79
+ }
80
+ }
81
+ }
82
+
83
+ lastError.message += ' (all clients are down)';
84
+ throw lastError;
85
+ };
86
+ });
87
+
88
+ // must cluster node write success
89
+ PUT_METHODS.forEach(method => {
90
+ proto[method] = async function (...args) {
91
+ const res = await Promise.all(this.clients.map(client => client[method](...args)));
92
+ return res[0];
93
+ };
94
+ });
95
+
96
+ proto.signatureUrl = function signatureUrl(/* name */ ...args) {
97
+ const client = this.chooseAvailable();
98
+ return client.signatureUrl(...args);
99
+ };
100
+
101
+ proto.getObjectUrl = function getObjectUrl(/* name, baseUrl */ ...args) {
102
+ const client = this.chooseAvailable();
103
+ return client.getObjectUrl(...args);
104
+ };
105
+
106
+ proto._init = function _init() {
107
+ const that = this;
108
+ (async () => {
109
+ await that._checkAvailable(that._ignoreStatusFile);
110
+ that.ready(true);
111
+ })().catch(err => {
112
+ that.emit('error', err);
113
+ });
114
+ };
115
+
116
+ proto._checkAvailable = async function _checkAvailable(ignoreStatusFile) {
117
+ const name = `._ali-oss/check.status.${currentIP}.txt`;
118
+ if (!ignoreStatusFile) {
119
+ // only start will try to write the file
120
+ await this.put(name, Buffer.from(`check available started at ${Date()}`));
121
+ }
122
+
123
+ if (this._checkAvailableLock) {
124
+ return;
125
+ }
126
+ this._checkAvailableLock = true;
127
+ const downStatusFiles = [];
128
+ for (let i = 0; i < this.clients.length; i++) {
129
+ const client = this.clients[i];
130
+ // check 3 times
131
+ let available = await this._checkStatus(client, name);
132
+ if (!available) {
133
+ // check again
134
+ available = await this._checkStatus(client, name);
135
+ }
136
+ if (!available) {
137
+ // check again
138
+ /* eslint no-await-in-loop: [0] */
139
+ available = await this._checkStatus(client, name);
140
+ if (!available) {
141
+ downStatusFiles.push(client._objectUrl(name));
142
+ }
143
+ }
144
+ this.availables[i] = available;
145
+ }
146
+ this._checkAvailableLock = false;
147
+
148
+ if (downStatusFiles.length > 0) {
149
+ const err = new Error(
150
+ `${downStatusFiles.length} data node down, please check status file: ${downStatusFiles.join(', ')}`
151
+ );
152
+ err.name = 'CheckAvailableError';
153
+ this.emit('error', err);
154
+ }
155
+ };
156
+
157
+ proto._checkStatus = async function _checkStatus(client, name) {
158
+ let available = true;
159
+ try {
160
+ await client.head(name);
161
+ } catch (err) {
162
+ // 404 will be available too
163
+ if (!err.status || err.status >= 500 || err.status < 200) {
164
+ available = false;
165
+ }
166
+ }
167
+ return available;
168
+ };
169
+
170
+ proto.chooseAvailable = function chooseAvailable() {
171
+ if (this.schedule === MS) {
172
+ // only read from master
173
+ if (this.masterOnly) {
174
+ return this.clients[0];
175
+ }
176
+ for (let i = 0; i < this.clients.length; i++) {
177
+ if (this.availables[i]) {
178
+ return this.clients[i];
179
+ }
180
+ }
181
+ // all down, try to use this first one
182
+ return this.clients[0];
183
+ }
184
+
185
+ // RR
186
+ let n = this.clients.length;
187
+ while (n > 0) {
188
+ const i = this._nextRRIndex();
189
+ if (this.availables[i]) {
190
+ return this.clients[i];
191
+ }
192
+ n--;
193
+ }
194
+ // all down, try to use this first one
195
+ return this.clients[0];
196
+ };
197
+
198
+ proto._nextRRIndex = function _nextRRIndex() {
199
+ const index = this.index++;
200
+ if (this.index >= this.clients.length) {
201
+ this.index = 0;
202
+ }
203
+ return index;
204
+ };
205
+
206
+ proto._error = function error(err) {
207
+ if (err) throw err;
208
+ };
209
+
210
+ proto._createCallback = function _createCallback(ctx, gen, cb) {
211
+ return () => {
212
+ cb = cb || this._error;
213
+ gen.call(ctx).then(() => {
214
+ cb();
215
+ }, cb);
216
+ };
217
+ };
218
+ proto._deferInterval = function _deferInterval(gen, timeout, cb) {
219
+ return setInterval(this._createCallback(this, gen, cb), timeout);
220
+ };
221
+
222
+ proto.close = function close() {
223
+ clearInterval(this._timerId);
224
+ this._timerId = null;
225
+ };
226
+
227
+ return Client;
228
+ };
@@ -0,0 +1,4 @@
1
+ export declare function abortBucketWorm(this: any, name: string, options: any): Promise<{
2
+ res: any;
3
+ status: any;
4
+ }>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.abortBucketWorm = void 0;
4
+ const checkBucketName_1 = require("../utils/checkBucketName");
5
+ async function abortBucketWorm(name, options) {
6
+ checkBucketName_1.checkBucketName(name);
7
+ const params = this._bucketRequestParams('DELETE', name, 'worm', options);
8
+ const result = await this.request(params);
9
+ return {
10
+ res: result.res,
11
+ status: result.status
12
+ };
13
+ }
14
+ exports.abortBucketWorm = abortBucketWorm;
@@ -0,0 +1,12 @@
1
+ import { checkBucketName } from '../utils/checkBucketName';
2
+
3
+ export async function abortBucketWorm(this: any, name: string, options) {
4
+ checkBucketName(name);
5
+ const params = this._bucketRequestParams('DELETE', name, 'worm', options);
6
+
7
+ const result = await this.request(params);
8
+ return {
9
+ res: result.res,
10
+ status: result.status
11
+ };
12
+ }
@@ -0,0 +1,4 @@
1
+ export declare function completeBucketWorm(this: any, name: string, wormId: string, options: any): Promise<{
2
+ res: any;
3
+ status: any;
4
+ }>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.completeBucketWorm = void 0;
4
+ const checkBucketName_1 = require("../utils/checkBucketName");
5
+ async function completeBucketWorm(name, wormId, options) {
6
+ checkBucketName_1.checkBucketName(name);
7
+ const params = this._bucketRequestParams('POST', name, { wormId }, options);
8
+ const result = await this.request(params);
9
+ return {
10
+ res: result.res,
11
+ status: result.status
12
+ };
13
+ }
14
+ exports.completeBucketWorm = completeBucketWorm;
@@ -0,0 +1,12 @@
1
+ import { checkBucketName } from '../utils/checkBucketName';
2
+
3
+ export async function completeBucketWorm(this: any, name: string, wormId: string, options) {
4
+ checkBucketName(name);
5
+ const params = this._bucketRequestParams('POST', name, { wormId }, options);
6
+
7
+ const result = await this.request(params);
8
+ return {
9
+ res: result.res,
10
+ status: result.status
11
+ };
12
+ }
@@ -0,0 +1,20 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+ // const jstoxml = require('jstoxml');
5
+ /**
6
+ * deleteBucketEncryption
7
+ * @param {String} bucketName - bucket name
8
+ */
9
+
10
+ proto.deleteBucketEncryption = async function deleteBucketEncryption(bucketName) {
11
+ _checkBucketName(bucketName);
12
+ const params = this._bucketRequestParams('DELETE', bucketName, 'encryption');
13
+ params.successStatuses = [204];
14
+ params.xmlResponse = true;
15
+ const result = await this.request(params);
16
+ return {
17
+ status: result.status,
18
+ res: result.res
19
+ };
20
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * deleteBucketInventory
3
+ * @param {String} bucketName - bucket name
4
+ * @param {String} inventoryId
5
+ * @param {Object} options
6
+ */
7
+ export declare function deleteBucketInventory(this: any, bucketName: string, inventoryId: string, options?: any): Promise<{
8
+ status: any;
9
+ res: any;
10
+ }>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteBucketInventory = void 0;
4
+ const checkBucketName_1 = require("../utils/checkBucketName");
5
+ /**
6
+ * deleteBucketInventory
7
+ * @param {String} bucketName - bucket name
8
+ * @param {String} inventoryId
9
+ * @param {Object} options
10
+ */
11
+ async function deleteBucketInventory(bucketName, inventoryId, options = {}) {
12
+ const subres = Object.assign({ inventory: '', inventoryId }, options.subres);
13
+ checkBucketName_1.checkBucketName(bucketName);
14
+ const params = this._bucketRequestParams('DELETE', bucketName, subres, options);
15
+ params.successStatuses = [204];
16
+ const result = await this.request(params);
17
+ return {
18
+ status: result.status,
19
+ res: result.res
20
+ };
21
+ }
22
+ exports.deleteBucketInventory = deleteBucketInventory;
@@ -0,0 +1,21 @@
1
+ import { checkBucketName } from '../utils/checkBucketName';
2
+ /**
3
+ * deleteBucketInventory
4
+ * @param {String} bucketName - bucket name
5
+ * @param {String} inventoryId
6
+ * @param {Object} options
7
+ */
8
+
9
+ export async function deleteBucketInventory(this: any, bucketName: string, inventoryId: string, options: any = {}) {
10
+ const subres: any = Object.assign({ inventory: '', inventoryId }, options.subres);
11
+ checkBucketName(bucketName);
12
+
13
+ const params = this._bucketRequestParams('DELETE', bucketName, subres, options);
14
+ params.successStatuses = [204];
15
+
16
+ const result = await this.request(params);
17
+ return {
18
+ status: result.status,
19
+ res: result.res
20
+ };
21
+ }
@@ -0,0 +1,13 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+
5
+ proto.deleteBucketLifecycle = async function deleteBucketLifecycle(name, options) {
6
+ _checkBucketName(name);
7
+ const params = this._bucketRequestParams('DELETE', name, 'lifecycle', options);
8
+ params.successStatuses = [204];
9
+ const result = await this.request(params);
10
+ return {
11
+ res: result.res
12
+ };
13
+ };
@@ -0,0 +1,21 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+ /**
5
+ * deleteBucketPolicy
6
+ * @param {String} bucketName - bucket name
7
+ * @param {Object} options
8
+ */
9
+
10
+ proto.deleteBucketPolicy = async function deleteBucketPolicy(bucketName, options = {}) {
11
+ _checkBucketName(bucketName);
12
+
13
+ const params = this._bucketRequestParams('DELETE', bucketName, 'policy', options);
14
+ params.successStatuses = [204];
15
+ const result = await this.request(params);
16
+
17
+ return {
18
+ status: result.status,
19
+ res: result.res
20
+ };
21
+ };
@@ -0,0 +1,21 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+ /**
5
+ * deleteBucketTags
6
+ * @param {String} name - bucket name
7
+ * @param {Object} options
8
+ */
9
+
10
+ proto.deleteBucketTags = async function deleteBucketTags(name, options = {}) {
11
+ _checkBucketName(name);
12
+
13
+ const params = this._bucketRequestParams('DELETE', name, 'tagging', options);
14
+ params.successStatuses = [204];
15
+ const result = await this.request(params);
16
+
17
+ return {
18
+ status: result.status,
19
+ res: result.res
20
+ };
21
+ };
@@ -0,0 +1,13 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+
5
+ proto.deleteBucketWebsite = async function deleteBucketWebsite(name, options) {
6
+ _checkBucketName(name);
7
+ const params = this._bucketRequestParams('DELETE', name, 'website', options);
8
+ params.successStatuses = [204];
9
+ const result = await this.request(params);
10
+ return {
11
+ res: result.res
12
+ };
13
+ };
@@ -0,0 +1,4 @@
1
+ export declare function extendBucketWorm(this: any, name: string, wormId: string, days: string | number, options: any): Promise<{
2
+ res: any;
3
+ status: any;
4
+ }>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extendBucketWorm = void 0;
4
+ const checkBucketName_1 = require("../utils/checkBucketName");
5
+ const obj2xml_1 = require("../utils/obj2xml");
6
+ async function extendBucketWorm(name, wormId, days, options) {
7
+ checkBucketName_1.checkBucketName(name);
8
+ const params = this._bucketRequestParams('POST', name, { wormExtend: '', wormId }, options);
9
+ const paramlXMLObJ = {
10
+ ExtendWormConfiguration: {
11
+ RetentionPeriodInDays: days
12
+ }
13
+ };
14
+ params.mime = 'xml';
15
+ params.content = obj2xml_1.obj2xml(paramlXMLObJ, { headers: true });
16
+ params.successStatuses = [200];
17
+ const result = await this.request(params);
18
+ return {
19
+ res: result.res,
20
+ status: result.status
21
+ };
22
+ }
23
+ exports.extendBucketWorm = extendBucketWorm;
@@ -0,0 +1,21 @@
1
+ import { checkBucketName } from '../utils/checkBucketName';
2
+ import { obj2xml } from '../utils/obj2xml';
3
+
4
+ export async function extendBucketWorm(this: any, name: string, wormId: string, days: string | number, options) {
5
+ checkBucketName(name);
6
+ const params = this._bucketRequestParams('POST', name, { wormExtend: '', wormId }, options);
7
+ const paramlXMLObJ = {
8
+ ExtendWormConfiguration: {
9
+ RetentionPeriodInDays: days
10
+ }
11
+ };
12
+
13
+ params.mime = 'xml';
14
+ params.content = obj2xml(paramlXMLObJ, { headers: true });
15
+ params.successStatuses = [200];
16
+ const result = await this.request(params);
17
+ return {
18
+ res: result.res,
19
+ status: result.status
20
+ };
21
+ }
@@ -0,0 +1,21 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+ /**
5
+ * getBucketEncryption
6
+ * @param {String} bucketName - bucket name
7
+ */
8
+
9
+ proto.getBucketEncryption = async function getBucketEncryption(bucketName) {
10
+ _checkBucketName(bucketName);
11
+ const params = this._bucketRequestParams('GET', bucketName, 'encryption');
12
+ params.successStatuses = [200];
13
+ params.xmlResponse = true;
14
+ const result = await this.request(params);
15
+ const encryption = result.data.ApplyServerSideEncryptionByDefault;
16
+ return {
17
+ encryption,
18
+ status: result.status,
19
+ res: result.res
20
+ };
21
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * getBucketInventory
3
+ * @param {String} bucketName - bucket name
4
+ * @param {String} inventoryId
5
+ * @param {Object} options
6
+ */
7
+ export declare function getBucketInventory(this: any, bucketName: string, inventoryId: string, options?: any): Promise<{
8
+ status: any;
9
+ res: any;
10
+ inventory: any;
11
+ }>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBucketInventory = void 0;
4
+ const checkBucketName_1 = require("../utils/checkBucketName");
5
+ const formatInventoryConfig_1 = require("../utils/formatInventoryConfig");
6
+ /**
7
+ * getBucketInventory
8
+ * @param {String} bucketName - bucket name
9
+ * @param {String} inventoryId
10
+ * @param {Object} options
11
+ */
12
+ async function getBucketInventory(bucketName, inventoryId, options = {}) {
13
+ const subres = Object.assign({ inventory: '', inventoryId }, options.subres);
14
+ checkBucketName_1.checkBucketName(bucketName);
15
+ const params = this._bucketRequestParams('GET', bucketName, subres, options);
16
+ params.successStatuses = [200];
17
+ params.xmlResponse = true;
18
+ const result = await this.request(params);
19
+ return {
20
+ status: result.status,
21
+ res: result.res,
22
+ inventory: formatInventoryConfig_1.formatInventoryConfig(result.data)
23
+ };
24
+ }
25
+ exports.getBucketInventory = getBucketInventory;
@@ -0,0 +1,24 @@
1
+ import { checkBucketName } from '../utils/checkBucketName';
2
+ import { formatInventoryConfig } from '../utils/formatInventoryConfig';
3
+ /**
4
+ * getBucketInventory
5
+ * @param {String} bucketName - bucket name
6
+ * @param {String} inventoryId
7
+ * @param {Object} options
8
+ */
9
+
10
+ export async function getBucketInventory(this: any, bucketName: string, inventoryId: string, options: any = {}) {
11
+ const subres: any = Object.assign({ inventory: '', inventoryId }, options.subres);
12
+ checkBucketName(bucketName);
13
+
14
+ const params = this._bucketRequestParams('GET', bucketName, subres, options);
15
+ params.successStatuses = [200];
16
+
17
+ params.xmlResponse = true;
18
+ const result = await this.request(params);
19
+ return {
20
+ status: result.status,
21
+ res: result.res,
22
+ inventory: formatInventoryConfig(result.data)
23
+ };
24
+ }
@@ -0,0 +1,33 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+ const { isArray } = require('../utils/isArray');
3
+ const { formatObjKey } = require('../utils/formatObjKey');
4
+
5
+ const proto = exports;
6
+
7
+ proto.getBucketLifecycle = async function getBucketLifecycle(name, options) {
8
+ _checkBucketName(name);
9
+ const params = this._bucketRequestParams('GET', name, 'lifecycle', options);
10
+ params.successStatuses = [200];
11
+ params.xmlResponse = true;
12
+ const result = await this.request(params);
13
+ let rules = result.data.Rule || null;
14
+ if (rules) {
15
+ if (!isArray(rules)) {
16
+ rules = [rules];
17
+ }
18
+ rules = rules.map(_ => {
19
+ if (_.ID) {
20
+ _.id = _.ID;
21
+ delete _.ID;
22
+ }
23
+ if (_.Tag && !isArray(_.Tag)) {
24
+ _.Tag = [_.Tag];
25
+ }
26
+ return formatObjKey(_, 'firstLowerCase');
27
+ });
28
+ }
29
+ return {
30
+ rules,
31
+ res: result.res
32
+ };
33
+ };
@@ -0,0 +1,28 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+ /**
5
+ * getBucketPolicy
6
+ * @param {String} bucketName - bucket name
7
+ * @param {Object} options
8
+ */
9
+
10
+ proto.getBucketPolicy = async function getBucketPolicy(bucketName, options = {}) {
11
+ _checkBucketName(bucketName);
12
+
13
+ const params = this._bucketRequestParams('GET', bucketName, 'policy', options);
14
+
15
+ const result = await this.request(params);
16
+ params.successStatuses = [200];
17
+ let policy = null;
18
+
19
+ if (result.res.status === 200) {
20
+ policy = JSON.parse(result.res.data.toString());
21
+ }
22
+
23
+ return {
24
+ policy,
25
+ status: result.status,
26
+ res: result.res
27
+ };
28
+ };
@@ -0,0 +1,25 @@
1
+ const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
2
+
3
+ const proto = exports;
4
+ /**
5
+ * getBucketRequestPayment
6
+ * @param {String} bucketName - bucket name
7
+ * @param {Object} options
8
+ */
9
+
10
+ proto.getBucketRequestPayment = async function getBucketRequestPayment(bucketName, options) {
11
+ options = options || {};
12
+
13
+ _checkBucketName(bucketName);
14
+ const params = this._bucketRequestParams('GET', bucketName, 'requestPayment', options);
15
+ params.successStatuses = [200];
16
+ params.xmlResponse = true;
17
+
18
+ const result = await this.request(params);
19
+
20
+ return {
21
+ status: result.status,
22
+ res: result.res,
23
+ payer: result.data.Payer
24
+ };
25
+ };