@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.
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/models/DisplayPreviewFieldModel.d.ts +1 -0
- package/dist/client/models/UploadActionModel.d.ts +3 -1
- package/dist/client/schemas/storageTypes/ali-oss.d.ts +12 -0
- package/dist/client/schemas/storageTypes/common.d.ts +12 -0
- package/dist/client/schemas/storageTypes/index.d.ts +48 -0
- package/dist/client/schemas/storageTypes/local.d.ts +12 -0
- package/dist/client/schemas/storageTypes/s3.d.ts +12 -0
- package/dist/client/schemas/storageTypes/tx-cos.d.ts +12 -0
- package/dist/client/templates/file.d.ts +4 -0
- package/dist/common/collections/storages.d.ts +11 -0
- package/dist/common/collections/storages.js +6 -0
- package/dist/externalVersion.js +8 -8
- package/dist/locale/de-DE.json +42 -29
- package/dist/locale/en-US.json +43 -30
- package/dist/locale/es-ES.json +54 -0
- package/dist/locale/fr-FR.json +45 -12
- package/dist/locale/hu-HU.json +48 -0
- package/dist/locale/id-ID.json +48 -0
- package/dist/locale/it-IT.json +43 -28
- package/dist/locale/ja-JP.json +43 -30
- package/dist/locale/ko-KR.json +46 -24
- package/dist/locale/nl-NL.json +53 -39
- package/dist/locale/pt-BR.json +54 -0
- package/dist/locale/ru-RU.json +47 -11
- package/dist/locale/tr-TR.json +47 -10
- package/dist/locale/uk-UA.json +54 -0
- package/dist/locale/vi-VN.json +48 -0
- package/dist/locale/zh-CN.json +41 -31
- package/dist/locale/zh-TW.json +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
- package/dist/node_modules/@aws-sdk/lib-storage/LICENSE +201 -0
- package/dist/node_modules/{multer-s3 → @aws-sdk/lib-storage/dist-cjs}/index.js +574 -6229
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.browser.js +8 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.js +10 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.native.js +8 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.shared.js +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/Upload.js +304 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/bytelength.js +27 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunker.js +24 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getChunkStream.js +24 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getChunkUint8Array.js +19 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getDataReadable.js +11 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getDataReadableStream.js +24 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/index.js +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.browser.js +5 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.js +7 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.native.js +5 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.shared.js +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/types.js +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/Upload.d.ts +59 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/bytelength.d.ts +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunker.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getChunkStream.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getChunkUint8Array.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getDataReadable.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getDataReadableStream.d.ts +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/index.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.browser.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.d.ts +8 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.native.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.shared.d.ts +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/Upload.d.ts +43 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/bytelength.d.ts +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunker.d.ts +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getChunkStream.d.ts +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getChunkUint8Array.d.ts +5 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getDataReadable.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getDataReadableStream.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/index.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.shared.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/types.d.ts +22 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/types.d.ts +51 -0
- package/dist/node_modules/@aws-sdk/lib-storage/package.json +1 -0
- package/dist/node_modules/{multer-s3 → ali-oss}/LICENSE +1 -2
- package/dist/node_modules/ali-oss/dist/aliyun-oss-sdk.js +44018 -0
- package/dist/node_modules/ali-oss/dist/aliyun-oss-sdk.min.js +4 -0
- package/dist/node_modules/ali-oss/lib/browser/bucket.js +296 -0
- package/dist/node_modules/ali-oss/lib/browser/client.js +452 -0
- package/dist/node_modules/ali-oss/lib/browser/managed-upload.js +360 -0
- package/dist/node_modules/ali-oss/lib/browser/object.js +385 -0
- package/dist/node_modules/ali-oss/lib/browser/version.js +1 -0
- package/dist/node_modules/ali-oss/lib/browser.js +6 -0
- package/dist/node_modules/ali-oss/lib/bucket.js +337 -0
- package/dist/node_modules/{multer-aliyun-oss/index.js → ali-oss/lib/client.js} +2 -2
- package/dist/node_modules/ali-oss/lib/cluster.js +228 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.d.ts +4 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.js +14 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.ts +12 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.d.ts +4 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.js +14 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.ts +12 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketEncryption.js +20 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.d.ts +10 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.js +22 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.ts +21 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketLifecycle.js +13 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketPolicy.js +21 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketTags.js +21 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/deleteBucketWebsite.js +13 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.d.ts +4 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.js +23 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.ts +21 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketEncryption.js +21 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.d.ts +11 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.js +25 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketInventory.ts +24 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketLifecycle.js +33 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketPolicy.js +28 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketRequestPayment.js +25 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.d.ts +23 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.js +17 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketStat.ts +34 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketTags.js +23 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketVersioning.js +22 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWebsite.js +28 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.js +20 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/getBucketWorm.ts +22 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/index.js +34 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.d.ts +5 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.js +24 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.ts +23 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.d.ts +13 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.js +29 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/listBucketInventory.ts +32 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucket.js +31 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketEncryption.js +36 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.d.ts +36 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.js +58 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketInventory.ts +84 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketLifecycle.js +127 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketPolicy.js +27 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketRequestPayment.js +40 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketTags.js +39 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketVersioning.js +35 -0
- package/dist/node_modules/ali-oss/lib/common/bucket/putBucketWebsite.js +50 -0
- package/dist/node_modules/ali-oss/lib/common/callback.js +27 -0
- package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.js +52 -0
- package/dist/node_modules/ali-oss/lib/common/client/getReqUrl.ts +51 -0
- package/dist/node_modules/ali-oss/lib/common/client/initOptions.js +72 -0
- package/dist/node_modules/ali-oss/lib/common/image/index.js +5 -0
- package/dist/node_modules/ali-oss/lib/common/image/processObjectSave.js +45 -0
- package/dist/node_modules/ali-oss/lib/common/multipart-copy.js +240 -0
- package/dist/node_modules/ali-oss/lib/common/multipart.js +271 -0
- package/dist/node_modules/ali-oss/lib/common/object/asyncSignatureUrl.js +57 -0
- package/dist/node_modules/ali-oss/lib/common/object/calculatePostSignature.js +35 -0
- package/dist/node_modules/ali-oss/lib/common/object/copyObject.js +74 -0
- package/dist/node_modules/ali-oss/lib/common/object/delete.js +22 -0
- package/dist/node_modules/ali-oss/lib/common/object/deleteMulti.js +57 -0
- package/dist/node_modules/ali-oss/lib/common/object/deleteObjectTagging.js +22 -0
- package/dist/node_modules/ali-oss/lib/common/object/generateObjectUrl.js +28 -0
- package/dist/node_modules/ali-oss/lib/common/object/get.js +64 -0
- package/dist/node_modules/ali-oss/lib/common/object/getACL.js +30 -0
- package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.js +26 -0
- package/dist/node_modules/ali-oss/lib/common/object/getAsyncFetch.ts +25 -0
- package/dist/node_modules/ali-oss/lib/common/object/getBucketVersions.js +98 -0
- package/dist/node_modules/ali-oss/lib/common/object/getObjectMeta.js +23 -0
- package/dist/node_modules/ali-oss/lib/common/object/getObjectTagging.js +34 -0
- package/dist/node_modules/ali-oss/lib/common/object/getObjectUrl.js +21 -0
- package/dist/node_modules/ali-oss/lib/common/object/getSymlink.js +23 -0
- package/dist/node_modules/ali-oss/lib/common/object/head.js +40 -0
- package/dist/node_modules/ali-oss/lib/common/object/index.js +26 -0
- package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.js +44 -0
- package/dist/node_modules/ali-oss/lib/common/object/postAsyncFetch.ts +46 -0
- package/dist/node_modules/ali-oss/lib/common/object/putACL.js +27 -0
- package/dist/node_modules/ali-oss/lib/common/object/putObjectTagging.js +43 -0
- package/dist/node_modules/ali-oss/lib/common/object/putSymlink.js +33 -0
- package/dist/node_modules/ali-oss/lib/common/object/signatureUrl.js +52 -0
- package/dist/node_modules/ali-oss/lib/common/object/signatureUrlV4.js +70 -0
- package/dist/node_modules/ali-oss/lib/common/parallel.js +177 -0
- package/dist/node_modules/ali-oss/lib/common/signUtils.js +355 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.js +9 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketName.ts +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.js +14 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketNameTest.ts +12 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.js +49 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkBucketTag.ts +52 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.js +30 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkConfigValid.ts +27 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.js +9 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkEnv.ts +5 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.js +50 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkObjectTag.ts +53 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.js +7 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkUserAgent.ts +4 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkValid.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkValid.js +14 -0
- package/dist/node_modules/ali-oss/lib/common/utils/checkValid.ts +9 -0
- package/dist/node_modules/ali-oss/lib/common/utils/createRequest.d.ts +8 -0
- package/dist/node_modules/ali-oss/lib/common/utils/createRequest.js +139 -0
- package/dist/node_modules/ali-oss/lib/common/utils/createRequest.ts +169 -0
- package/dist/node_modules/ali-oss/lib/common/utils/dataFix.d.ts +12 -0
- package/dist/node_modules/ali-oss/lib/common/utils/dataFix.js +63 -0
- package/dist/node_modules/ali-oss/lib/common/utils/dataFix.ts +78 -0
- package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.d.ts +2 -0
- package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.js +41 -0
- package/dist/node_modules/ali-oss/lib/common/utils/deepCopy.ts +47 -0
- package/dist/node_modules/ali-oss/lib/common/utils/encodeString.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/encodeString.js +12 -0
- package/dist/node_modules/ali-oss/lib/common/utils/encodeString.ts +7 -0
- package/dist/node_modules/ali-oss/lib/common/utils/encoder.d.ts +2 -0
- package/dist/node_modules/ali-oss/lib/common/utils/encoder.js +9 -0
- package/dist/node_modules/ali-oss/lib/common/utils/encoder.ts +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.js +45 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatInventoryConfig.ts +41 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.d.ts +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.js +34 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatObjKey.ts +35 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatTag.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatTag.js +22 -0
- package/dist/node_modules/ali-oss/lib/common/utils/formatTag.ts +20 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.js +7 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getStandardRegion.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.js +17 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getStrBytesCount.ts +12 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.js +18 -0
- package/dist/node_modules/ali-oss/lib/common/utils/getUserAgent.ts +14 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isArray.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isArray.js +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isArray.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isBlob.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isBlob.js +7 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isBlob.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.js +7 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isBuffer.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.js +10 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isDingTalk.ts +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isFile.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isFile.js +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isFile.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isFunction.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isFunction.js +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isFunction.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isIP.d.ts +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isIP.js +14 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isIP.ts +12 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isObject.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isObject.js +6 -0
- package/dist/node_modules/ali-oss/lib/common/utils/isObject.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.js +14 -0
- package/dist/node_modules/ali-oss/lib/common/utils/lowercaseKeyHeader.ts +11 -0
- package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.js +43 -0
- package/dist/node_modules/ali-oss/lib/common/utils/obj2xml.ts +37 -0
- package/dist/node_modules/ali-oss/lib/common/utils/omit.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/omit.js +11 -0
- package/dist/node_modules/ali-oss/lib/common/utils/omit.ts +9 -0
- package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.js +21 -0
- package/dist/node_modules/ali-oss/lib/common/utils/policy2Str.ts +15 -0
- package/dist/node_modules/ali-oss/lib/common/utils/retry.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/common/utils/retry.js +30 -0
- package/dist/node_modules/ali-oss/lib/common/utils/retry.ts +26 -0
- package/dist/node_modules/ali-oss/lib/common/utils/setRegion.d.ts +3 -0
- package/dist/node_modules/ali-oss/lib/common/utils/setRegion.js +20 -0
- package/dist/node_modules/ali-oss/lib/common/utils/setRegion.ts +15 -0
- package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.d.ts +2 -0
- package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.js +36 -0
- package/dist/node_modules/ali-oss/lib/common/utils/setSTSToken.ts +32 -0
- package/dist/node_modules/ali-oss/lib/global.d.ts +6 -0
- package/dist/node_modules/ali-oss/lib/image.js +146 -0
- package/dist/node_modules/ali-oss/lib/managed-upload.js +380 -0
- package/dist/node_modules/ali-oss/lib/object.js +420 -0
- package/dist/node_modules/ali-oss/lib/rtmp.js +295 -0
- package/dist/node_modules/ali-oss/lib/setConfig.d.ts +3 -0
- package/dist/node_modules/ali-oss/lib/setConfig.js +42 -0
- package/dist/node_modules/ali-oss/lib/setConfig.ts +52 -0
- package/dist/node_modules/ali-oss/lib/sts.js +156 -0
- package/dist/node_modules/ali-oss/lib/types/experimental.d.ts +1 -0
- package/dist/node_modules/ali-oss/lib/types/experimental.js +2 -0
- package/dist/node_modules/ali-oss/lib/types/experimental.ts +1 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.editorconfig +17 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/.name +1 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/bowser.iml +8 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/encodings.xml +6 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/jsLibraryMappings.xml +8 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-exported-files.xml +8 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-navigator/profiles_settings.xml +3 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/markdown-navigator.xml +67 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/misc.xml +6 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/modules.xml +8 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/vcs.xml +6 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/watcherTasks.xml +4 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.idea/workspace.xml +696 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/.travis.yml +8 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/bower.json +33 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/bowser.js +644 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/bowser.min.js +6 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/package.json +38 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/src/bowser.js +644 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/test/test.js +151 -0
- package/dist/node_modules/ali-oss/node_modules/bowser/typings.d.ts +115 -0
- package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/ProjectSettings.json +3 -0
- package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/config/applicationhost.config +1031 -0
- package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/node-dateformat/v15/.suo +0 -0
- package/dist/node_modules/ali-oss/node_modules/dateformat/.vs/slnx.sqlite +0 -0
- package/dist/node_modules/ali-oss/node_modules/dateformat/lib/dateformat.js +226 -0
- package/dist/node_modules/ali-oss/node_modules/dateformat/package.json +30 -0
- package/dist/node_modules/ali-oss/node_modules/mime/Mime.js +97 -0
- package/dist/node_modules/ali-oss/node_modules/mime/cli.js +46 -0
- package/dist/node_modules/ali-oss/node_modules/mime/index.js +4 -0
- package/dist/node_modules/ali-oss/node_modules/mime/lite.js +4 -0
- package/dist/node_modules/ali-oss/node_modules/mime/package.json +52 -0
- package/dist/node_modules/ali-oss/node_modules/mime/types/other.js +1 -0
- package/dist/node_modules/ali-oss/node_modules/mime/types/standard.js +1 -0
- package/dist/node_modules/ali-oss/package.json +1 -0
- package/dist/node_modules/ali-oss/shims/crypto/crypto.js +98 -0
- package/dist/node_modules/ali-oss/shims/crypto/helpers.js +36 -0
- package/dist/node_modules/ali-oss/shims/crypto/md5.js +152 -0
- package/dist/node_modules/ali-oss/shims/crypto/sha.js +91 -0
- package/dist/node_modules/ali-oss/shims/crypto/sha256.js +163 -0
- package/dist/node_modules/ali-oss/shims/debug.js +3 -0
- package/dist/node_modules/ali-oss/shims/is-type-of.js +18 -0
- package/dist/node_modules/ali-oss/shims/process.js +35 -0
- package/dist/node_modules/ali-oss/shims/stream-http/index.js +82 -0
- package/dist/node_modules/ali-oss/shims/stream-http/lib/capability.js +72 -0
- package/dist/node_modules/ali-oss/shims/stream-http/lib/request.js +320 -0
- package/dist/node_modules/ali-oss/shims/stream-http/lib/response.js +217 -0
- package/dist/node_modules/ali-oss/shims/url/index.js +696 -0
- package/dist/node_modules/ali-oss/shims/url/util.js +16 -0
- package/dist/node_modules/ali-oss/shims/utility.js +25 -0
- package/dist/node_modules/ali-oss/shims/xhr.js +798 -0
- package/dist/node_modules/mime-match/package.json +1 -1
- package/dist/node_modules/mime-types/package.json +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- package/dist/node_modules/multer-cos/package.json +1 -1
- package/dist/node_modules/url-join/package.json +1 -1
- package/dist/server/actions/storages.js +4 -6
- package/dist/server/server.js +1 -0
- package/dist/server/storages/ali-oss.d.ts +15 -1
- package/dist/server/storages/ali-oss.js +66 -2
- package/dist/server/storages/index.d.ts +1 -0
- package/dist/server/storages/local.js +1 -1
- package/dist/server/storages/s3.d.ts +10 -3
- package/dist/server/storages/s3.js +121 -29
- package/dist/server/storages/tx-cos.js +1 -1
- package/dist/server/utils.d.ts +1 -0
- package/dist/server/utils.js +43 -0
- package/package.json +7 -3
- package/dist/node_modules/multer-aliyun-oss/package.json +0 -1
- package/dist/node_modules/multer-s3/.gitattributes +0 -1
- package/dist/node_modules/multer-s3/.travis.yml +0 -6
- package/dist/node_modules/multer-s3/package.json +0 -1
- package/dist/node_modules/multer-s3/test/basic.js +0 -293
- package/dist/node_modules/multer-s3/test/files/a.txt +0 -1
- package/dist/node_modules/multer-s3/test/files/test.svg +0 -3
- package/dist/node_modules/multer-s3/test/files/test2.svg +0 -9
- package/dist/node_modules/multer-s3/test/util/mock-s3.js +0 -17
|
@@ -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,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,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,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
|
+
};
|