@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,57 @@
|
|
|
1
|
+
/* eslint-disable object-curly-newline */
|
|
2
|
+
const utility = require('utility');
|
|
3
|
+
const { obj2xml } = require('../utils/obj2xml');
|
|
4
|
+
|
|
5
|
+
const proto = exports;
|
|
6
|
+
|
|
7
|
+
proto.deleteMulti = async function deleteMulti(names, options = {}) {
|
|
8
|
+
const objects = [];
|
|
9
|
+
if (!names || !names.length) {
|
|
10
|
+
throw new Error('names is required');
|
|
11
|
+
}
|
|
12
|
+
for (let i = 0; i < names.length; i++) {
|
|
13
|
+
const object = {};
|
|
14
|
+
if (typeof names[i] === 'string') {
|
|
15
|
+
object.Key = utility.escape(this._objectName(names[i]));
|
|
16
|
+
} else {
|
|
17
|
+
const { key, versionId } = names[i];
|
|
18
|
+
object.Key = utility.escape(this._objectName(key));
|
|
19
|
+
object.VersionId = versionId;
|
|
20
|
+
}
|
|
21
|
+
objects.push(object);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const paramXMLObj = {
|
|
25
|
+
Delete: {
|
|
26
|
+
Quiet: !!options.quiet,
|
|
27
|
+
Object: objects
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const paramXML = obj2xml(paramXMLObj, {
|
|
32
|
+
headers: true
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
options.subres = Object.assign({ delete: '' }, options.subres);
|
|
36
|
+
if (options.versionId) {
|
|
37
|
+
options.subres.versionId = options.versionId;
|
|
38
|
+
}
|
|
39
|
+
const params = this._objectRequestParams('POST', '', options);
|
|
40
|
+
params.mime = 'xml';
|
|
41
|
+
params.content = paramXML;
|
|
42
|
+
params.xmlResponse = true;
|
|
43
|
+
params.successStatuses = [200];
|
|
44
|
+
const result = await this.request(params);
|
|
45
|
+
|
|
46
|
+
const r = result.data;
|
|
47
|
+
let deleted = (r && r.Deleted) || null;
|
|
48
|
+
if (deleted) {
|
|
49
|
+
if (!Array.isArray(deleted)) {
|
|
50
|
+
deleted = [deleted];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
res: result.res,
|
|
55
|
+
deleted: deleted || []
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const proto = exports;
|
|
2
|
+
/**
|
|
3
|
+
* deleteObjectTagging
|
|
4
|
+
* @param {String} name - object name
|
|
5
|
+
* @param {Object} options
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
proto.deleteObjectTagging = async function deleteObjectTagging(name, options = {}) {
|
|
9
|
+
options.subres = Object.assign({ tagging: '' }, options.subres);
|
|
10
|
+
if (options.versionId) {
|
|
11
|
+
options.subres.versionId = options.versionId;
|
|
12
|
+
}
|
|
13
|
+
name = this._objectName(name);
|
|
14
|
+
const params = this._objectRequestParams('DELETE', name, options);
|
|
15
|
+
params.successStatuses = [204];
|
|
16
|
+
const result = await this.request(params);
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
status: result.status,
|
|
20
|
+
res: result.res
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const urlutil = require('url');
|
|
2
|
+
const { isIP } = require('../utils/isIP');
|
|
3
|
+
|
|
4
|
+
const proto = exports;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Get Object url by name
|
|
8
|
+
* @param {String} name - object name
|
|
9
|
+
* @param {String} [baseUrl] - If provide `baseUrl`, will use `baseUrl` instead the default `endpoint and bucket`.
|
|
10
|
+
* @return {String} object url include bucket
|
|
11
|
+
*/
|
|
12
|
+
proto.generateObjectUrl = function generateObjectUrl(name, baseUrl) {
|
|
13
|
+
if (isIP(this.options.endpoint.hostname)) {
|
|
14
|
+
throw new Error('can not get the object URL when endpoint is IP');
|
|
15
|
+
}
|
|
16
|
+
if (!baseUrl) {
|
|
17
|
+
baseUrl = this.options.endpoint.format();
|
|
18
|
+
const copyUrl = urlutil.parse(baseUrl);
|
|
19
|
+
const { bucket } = this.options;
|
|
20
|
+
|
|
21
|
+
copyUrl.hostname = `${bucket}.${copyUrl.hostname}`;
|
|
22
|
+
copyUrl.host = `${bucket}.${copyUrl.host}`;
|
|
23
|
+
baseUrl = copyUrl.format();
|
|
24
|
+
} else if (baseUrl[baseUrl.length - 1] !== '/') {
|
|
25
|
+
baseUrl += '/';
|
|
26
|
+
}
|
|
27
|
+
return baseUrl + this._escape(this._objectName(name));
|
|
28
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const is = require('is-type-of');
|
|
3
|
+
|
|
4
|
+
const proto = exports;
|
|
5
|
+
/**
|
|
6
|
+
* get
|
|
7
|
+
* @param {String} name - object name
|
|
8
|
+
* @param {String | Stream} file
|
|
9
|
+
* @param {Object} options
|
|
10
|
+
* @param {{res}}
|
|
11
|
+
*/
|
|
12
|
+
proto.get = async function get(name, file, options = {}) {
|
|
13
|
+
let writeStream = null;
|
|
14
|
+
let needDestroy = false;
|
|
15
|
+
|
|
16
|
+
if (is.writableStream(file)) {
|
|
17
|
+
writeStream = file;
|
|
18
|
+
} else if (is.string(file)) {
|
|
19
|
+
writeStream = fs.createWriteStream(file);
|
|
20
|
+
needDestroy = true;
|
|
21
|
+
} else {
|
|
22
|
+
// get(name, options)
|
|
23
|
+
options = file;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
options = options || {};
|
|
27
|
+
const isBrowserEnv = process && process.browser;
|
|
28
|
+
const responseCacheControl = options.responseCacheControl === null ? '' : 'no-cache';
|
|
29
|
+
const defaultSubresOptions =
|
|
30
|
+
isBrowserEnv && responseCacheControl ? { 'response-cache-control': responseCacheControl } : {};
|
|
31
|
+
options.subres = Object.assign(defaultSubresOptions, options.subres);
|
|
32
|
+
|
|
33
|
+
if (options.versionId) {
|
|
34
|
+
options.subres.versionId = options.versionId;
|
|
35
|
+
}
|
|
36
|
+
if (options.process) {
|
|
37
|
+
options.subres['x-oss-process'] = options.process;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let result;
|
|
41
|
+
try {
|
|
42
|
+
const params = this._objectRequestParams('GET', name, options);
|
|
43
|
+
params.writeStream = writeStream;
|
|
44
|
+
params.successStatuses = [200, 206, 304];
|
|
45
|
+
|
|
46
|
+
result = await this.request(params);
|
|
47
|
+
|
|
48
|
+
if (needDestroy) {
|
|
49
|
+
writeStream.destroy();
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (needDestroy) {
|
|
53
|
+
writeStream.destroy();
|
|
54
|
+
// should delete the exists file before throw error
|
|
55
|
+
await this._deleteFileSafe(file);
|
|
56
|
+
}
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
res: result.res,
|
|
62
|
+
content: result.data
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const proto = exports;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Get object's ACL
|
|
5
|
+
* @param {String} name the object key
|
|
6
|
+
* @param {Object} options
|
|
7
|
+
* @return {Object}
|
|
8
|
+
*/
|
|
9
|
+
proto.getACL = async function getACL(name, options = {}) {
|
|
10
|
+
options.subres = Object.assign({ acl: '' }, options.subres);
|
|
11
|
+
if (options.versionId) {
|
|
12
|
+
options.subres.versionId = options.versionId;
|
|
13
|
+
}
|
|
14
|
+
name = this._objectName(name);
|
|
15
|
+
|
|
16
|
+
const params = this._objectRequestParams('GET', name, options);
|
|
17
|
+
params.successStatuses = [200];
|
|
18
|
+
params.xmlResponse = true;
|
|
19
|
+
|
|
20
|
+
const result = await this.request(params);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
acl: result.data.AccessControlList.Grant,
|
|
24
|
+
owner: {
|
|
25
|
+
id: result.data.Owner.ID,
|
|
26
|
+
displayName: result.data.Owner.DisplayName
|
|
27
|
+
},
|
|
28
|
+
res: result.res
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAsyncFetch(this: any, taskId: any, options?: any): Promise<object>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAsyncFetch = void 0;
|
|
4
|
+
const formatObjKey_1 = require("../utils/formatObjKey");
|
|
5
|
+
/*
|
|
6
|
+
* getAsyncFetch
|
|
7
|
+
* @param {String} asyncFetch taskId
|
|
8
|
+
* @param {Object} options
|
|
9
|
+
*/
|
|
10
|
+
async function getAsyncFetch(taskId, options = {}) {
|
|
11
|
+
options.subres = Object.assign({ asyncFetch: '' }, options.subres);
|
|
12
|
+
options.headers = options.headers || {};
|
|
13
|
+
const params = this._objectRequestParams('GET', '', options);
|
|
14
|
+
params.headers['x-oss-task-id'] = taskId;
|
|
15
|
+
params.successStatuses = [200];
|
|
16
|
+
params.xmlResponse = true;
|
|
17
|
+
const result = await this.request(params);
|
|
18
|
+
const taskInfo = formatObjKey_1.formatObjKey(result.data.TaskInfo, 'firstLowerCase');
|
|
19
|
+
return {
|
|
20
|
+
res: result.res,
|
|
21
|
+
status: result.status,
|
|
22
|
+
state: result.data.State,
|
|
23
|
+
taskInfo
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.getAsyncFetch = getAsyncFetch;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { formatObjKey } from '../utils/formatObjKey';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* getAsyncFetch
|
|
5
|
+
* @param {String} asyncFetch taskId
|
|
6
|
+
* @param {Object} options
|
|
7
|
+
*/
|
|
8
|
+
export async function getAsyncFetch(this: any, taskId, options: any = {}): Promise<object> {
|
|
9
|
+
options.subres = Object.assign({ asyncFetch: '' }, options.subres);
|
|
10
|
+
options.headers = options.headers || {};
|
|
11
|
+
|
|
12
|
+
const params = this._objectRequestParams('GET', '', options);
|
|
13
|
+
params.headers['x-oss-task-id'] = taskId;
|
|
14
|
+
params.successStatuses = [200];
|
|
15
|
+
params.xmlResponse = true;
|
|
16
|
+
|
|
17
|
+
const result = await this.request(params);
|
|
18
|
+
const taskInfo = formatObjKey(result.data.TaskInfo, 'firstLowerCase');
|
|
19
|
+
return {
|
|
20
|
+
res: result.res,
|
|
21
|
+
status: result.status,
|
|
22
|
+
state: result.data.State,
|
|
23
|
+
taskInfo
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
const proto = exports;
|
|
3
|
+
const { isObject } = require('../utils/isObject');
|
|
4
|
+
const { isArray } = require('../utils/isArray');
|
|
5
|
+
|
|
6
|
+
proto.getBucketVersions = getBucketVersions;
|
|
7
|
+
proto.listObjectVersions = getBucketVersions;
|
|
8
|
+
|
|
9
|
+
async function getBucketVersions(query = {}, options = {}) {
|
|
10
|
+
// prefix, key-marker, max-keys, delimiter, encoding-type, version-id-marker
|
|
11
|
+
if (query.versionIdMarker && query.keyMarker === undefined) {
|
|
12
|
+
throw new Error('A version-id marker cannot be specified without a key marker');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
options.subres = Object.assign({ versions: '' }, options.subres);
|
|
16
|
+
if (options.versionId) {
|
|
17
|
+
options.subres.versionId = options.versionId;
|
|
18
|
+
}
|
|
19
|
+
const params = this._objectRequestParams('GET', '', options);
|
|
20
|
+
params.xmlResponse = true;
|
|
21
|
+
params.successStatuses = [200];
|
|
22
|
+
|
|
23
|
+
params.query = formatQuery(query);
|
|
24
|
+
|
|
25
|
+
const result = await this.request(params);
|
|
26
|
+
let objects = result.data.Version || [];
|
|
27
|
+
let deleteMarker = result.data.DeleteMarker || [];
|
|
28
|
+
const that = this;
|
|
29
|
+
if (objects) {
|
|
30
|
+
if (!Array.isArray(objects)) {
|
|
31
|
+
objects = [objects];
|
|
32
|
+
}
|
|
33
|
+
objects = objects.map(obj => ({
|
|
34
|
+
name: obj.Key,
|
|
35
|
+
url: that._objectUrl(obj.Key),
|
|
36
|
+
lastModified: obj.LastModified,
|
|
37
|
+
isLatest: obj.IsLatest === 'true',
|
|
38
|
+
versionId: obj.VersionId,
|
|
39
|
+
etag: obj.ETag,
|
|
40
|
+
type: obj.Type,
|
|
41
|
+
size: Number(obj.Size),
|
|
42
|
+
storageClass: obj.StorageClass,
|
|
43
|
+
owner: {
|
|
44
|
+
id: obj.Owner.ID,
|
|
45
|
+
displayName: obj.Owner.DisplayName
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
if (deleteMarker) {
|
|
50
|
+
if (!isArray(deleteMarker)) {
|
|
51
|
+
deleteMarker = [deleteMarker];
|
|
52
|
+
}
|
|
53
|
+
deleteMarker = deleteMarker.map(obj => ({
|
|
54
|
+
name: obj.Key,
|
|
55
|
+
lastModified: obj.LastModified,
|
|
56
|
+
versionId: obj.VersionId,
|
|
57
|
+
owner: {
|
|
58
|
+
id: obj.Owner.ID,
|
|
59
|
+
displayName: obj.Owner.DisplayName
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
let prefixes = result.data.CommonPrefixes || null;
|
|
64
|
+
if (prefixes) {
|
|
65
|
+
if (!isArray(prefixes)) {
|
|
66
|
+
prefixes = [prefixes];
|
|
67
|
+
}
|
|
68
|
+
prefixes = prefixes.map(item => item.Prefix);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
res: result.res,
|
|
72
|
+
objects,
|
|
73
|
+
deleteMarker,
|
|
74
|
+
prefixes,
|
|
75
|
+
// attirbute of legacy error
|
|
76
|
+
nextMarker: result.data.NextKeyMarker || null,
|
|
77
|
+
// attirbute of legacy error
|
|
78
|
+
NextVersionIdMarker: result.data.NextVersionIdMarker || null,
|
|
79
|
+
nextKeyMarker: result.data.NextKeyMarker || null,
|
|
80
|
+
nextVersionIdMarker: result.data.NextVersionIdMarker || null,
|
|
81
|
+
isTruncated: result.data.IsTruncated === 'true'
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function camel2Line(name) {
|
|
86
|
+
return name.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function formatQuery(query = {}) {
|
|
90
|
+
const obj = {};
|
|
91
|
+
if (isObject(query)) {
|
|
92
|
+
Object.keys(query).forEach(key => {
|
|
93
|
+
obj[camel2Line(key)] = query[key];
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return obj;
|
|
98
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const proto = exports;
|
|
2
|
+
/**
|
|
3
|
+
* getObjectMeta
|
|
4
|
+
* @param {String} name - object name
|
|
5
|
+
* @param {Object} options
|
|
6
|
+
* @param {{res}}
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
proto.getObjectMeta = async function getObjectMeta(name, options) {
|
|
10
|
+
options = options || {};
|
|
11
|
+
name = this._objectName(name);
|
|
12
|
+
options.subres = Object.assign({ objectMeta: '' }, options.subres);
|
|
13
|
+
if (options.versionId) {
|
|
14
|
+
options.subres.versionId = options.versionId;
|
|
15
|
+
}
|
|
16
|
+
const params = this._objectRequestParams('HEAD', name, options);
|
|
17
|
+
params.successStatuses = [200];
|
|
18
|
+
const result = await this.request(params);
|
|
19
|
+
return {
|
|
20
|
+
status: result.status,
|
|
21
|
+
res: result.res
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const proto = exports;
|
|
2
|
+
const { isObject } = require('../utils/isObject');
|
|
3
|
+
/**
|
|
4
|
+
* getObjectTagging
|
|
5
|
+
* @param {String} name - object name
|
|
6
|
+
* @param {Object} options
|
|
7
|
+
* @return {Object}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
proto.getObjectTagging = async function getObjectTagging(name, options = {}) {
|
|
11
|
+
options.subres = Object.assign({ tagging: '' }, options.subres);
|
|
12
|
+
if (options.versionId) {
|
|
13
|
+
options.subres.versionId = options.versionId;
|
|
14
|
+
}
|
|
15
|
+
name = this._objectName(name);
|
|
16
|
+
const params = this._objectRequestParams('GET', name, options);
|
|
17
|
+
params.successStatuses = [200];
|
|
18
|
+
const result = await this.request(params);
|
|
19
|
+
const Tagging = await this.parseXML(result.data);
|
|
20
|
+
let { Tag } = Tagging.TagSet;
|
|
21
|
+
Tag = Tag && isObject(Tag) ? [Tag] : Tag || [];
|
|
22
|
+
|
|
23
|
+
const tag = {};
|
|
24
|
+
|
|
25
|
+
Tag.forEach(item => {
|
|
26
|
+
tag[item.Key] = item.Value;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
status: result.status,
|
|
31
|
+
res: result.res,
|
|
32
|
+
tag
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { isIP } = require('../utils/isIP');
|
|
2
|
+
|
|
3
|
+
const proto = exports;
|
|
4
|
+
/**
|
|
5
|
+
* Get Object url by name
|
|
6
|
+
* @param {String} name - object name
|
|
7
|
+
* @param {String} [baseUrl] - If provide `baseUrl`,
|
|
8
|
+
* will use `baseUrl` instead the default `endpoint`.
|
|
9
|
+
* @return {String} object url
|
|
10
|
+
*/
|
|
11
|
+
proto.getObjectUrl = function getObjectUrl(name, baseUrl) {
|
|
12
|
+
if (isIP(this.options.endpoint.hostname)) {
|
|
13
|
+
throw new Error('can not get the object URL when endpoint is IP');
|
|
14
|
+
}
|
|
15
|
+
if (!baseUrl) {
|
|
16
|
+
baseUrl = this.options.endpoint.format();
|
|
17
|
+
} else if (baseUrl[baseUrl.length - 1] !== '/') {
|
|
18
|
+
baseUrl += '/';
|
|
19
|
+
}
|
|
20
|
+
return baseUrl + this._escape(this._objectName(name));
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const proto = exports;
|
|
2
|
+
/**
|
|
3
|
+
* getSymlink
|
|
4
|
+
* @param {String} name - object name
|
|
5
|
+
* @param {Object} options
|
|
6
|
+
* @param {{res}}
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
proto.getSymlink = async function getSymlink(name, options = {}) {
|
|
10
|
+
options.subres = Object.assign({ symlink: '' }, options.subres);
|
|
11
|
+
if (options.versionId) {
|
|
12
|
+
options.subres.versionId = options.versionId;
|
|
13
|
+
}
|
|
14
|
+
name = this._objectName(name);
|
|
15
|
+
const params = this._objectRequestParams('GET', name, options);
|
|
16
|
+
params.successStatuses = [200];
|
|
17
|
+
const result = await this.request(params);
|
|
18
|
+
const target = result.res.headers['x-oss-symlink-target'];
|
|
19
|
+
return {
|
|
20
|
+
targetName: decodeURIComponent(target),
|
|
21
|
+
res: result.res
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const { checkEnv } = require('../utils/checkEnv');
|
|
2
|
+
const proto = exports;
|
|
3
|
+
/**
|
|
4
|
+
* head
|
|
5
|
+
* @param {String} name - object name
|
|
6
|
+
* @param {Object} options
|
|
7
|
+
* @param {{res}}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
proto.head = async function head(name, options = {}) {
|
|
11
|
+
checkEnv(
|
|
12
|
+
'Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta'
|
|
13
|
+
);
|
|
14
|
+
options.subres = Object.assign({}, options.subres);
|
|
15
|
+
if (options.versionId) {
|
|
16
|
+
options.subres.versionId = options.versionId;
|
|
17
|
+
}
|
|
18
|
+
const params = this._objectRequestParams('HEAD', name, options);
|
|
19
|
+
params.successStatuses = [200, 304];
|
|
20
|
+
|
|
21
|
+
const result = await this.request(params);
|
|
22
|
+
|
|
23
|
+
const data = {
|
|
24
|
+
meta: null,
|
|
25
|
+
res: result.res,
|
|
26
|
+
status: result.status
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (result.status === 200) {
|
|
30
|
+
Object.keys(result.headers).forEach(k => {
|
|
31
|
+
if (k.indexOf('x-oss-meta-') === 0) {
|
|
32
|
+
if (!data.meta) {
|
|
33
|
+
data.meta = {};
|
|
34
|
+
}
|
|
35
|
+
data.meta[k.substring(11)] = result.headers[k];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return data;
|
|
40
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const merge = require('merge-descriptors');
|
|
2
|
+
|
|
3
|
+
const proto = exports;
|
|
4
|
+
|
|
5
|
+
merge(proto, require('./getSymlink'));
|
|
6
|
+
merge(proto, require('./putSymlink'));
|
|
7
|
+
merge(proto, require('./getObjectMeta'));
|
|
8
|
+
merge(proto, require('./copyObject'));
|
|
9
|
+
merge(proto, require('./calculatePostSignature'));
|
|
10
|
+
merge(proto, require('./getObjectTagging'));
|
|
11
|
+
merge(proto, require('./putObjectTagging'));
|
|
12
|
+
merge(proto, require('./deleteObjectTagging'));
|
|
13
|
+
merge(proto, require('./getBucketVersions'));
|
|
14
|
+
merge(proto, require('./deleteMulti'));
|
|
15
|
+
merge(proto, require('./getACL'));
|
|
16
|
+
merge(proto, require('./putACL'));
|
|
17
|
+
merge(proto, require('./head'));
|
|
18
|
+
merge(proto, require('./delete'));
|
|
19
|
+
merge(proto, require('./get'));
|
|
20
|
+
merge(proto, require('./postAsyncFetch'));
|
|
21
|
+
merge(proto, require('./getAsyncFetch'));
|
|
22
|
+
merge(proto, require('./generateObjectUrl'));
|
|
23
|
+
merge(proto, require('./getObjectUrl'));
|
|
24
|
+
merge(proto, require('./signatureUrl'));
|
|
25
|
+
merge(proto, require('./asyncSignatureUrl'));
|
|
26
|
+
merge(proto, require('./signatureUrlV4'));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function postAsyncFetch(this: any, object: any, url: any, options?: any): Promise<object>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postAsyncFetch = void 0;
|
|
4
|
+
const obj2xml_1 = require("../utils/obj2xml");
|
|
5
|
+
/*
|
|
6
|
+
* postAsyncFetch
|
|
7
|
+
* @param {String} name the object key
|
|
8
|
+
* @param {String} url
|
|
9
|
+
* @param {Object} options
|
|
10
|
+
* {String} options.host
|
|
11
|
+
* {String} options.contentMD5
|
|
12
|
+
* {String} options.callback
|
|
13
|
+
* {String} options.storageClass Standard/IA/Archive
|
|
14
|
+
* {Boolean} options.ignoreSameKey default value true
|
|
15
|
+
*/
|
|
16
|
+
async function postAsyncFetch(object, url, options = {}) {
|
|
17
|
+
options.subres = Object.assign({ asyncFetch: '' }, options.subres);
|
|
18
|
+
options.headers = options.headers || {};
|
|
19
|
+
object = this._objectName(object);
|
|
20
|
+
const { host = '', contentMD5 = '', callback = '', storageClass = '', ignoreSameKey = true } = options;
|
|
21
|
+
const paramXMLObj = {
|
|
22
|
+
AsyncFetchTaskConfiguration: {
|
|
23
|
+
Url: url,
|
|
24
|
+
Object: object,
|
|
25
|
+
Host: host,
|
|
26
|
+
ContentMD5: contentMD5,
|
|
27
|
+
Callback: callback,
|
|
28
|
+
StorageClass: storageClass,
|
|
29
|
+
IgnoreSameKey: ignoreSameKey
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const params = this._objectRequestParams('POST', '', options);
|
|
33
|
+
params.mime = 'xml';
|
|
34
|
+
params.xmlResponse = true;
|
|
35
|
+
params.successStatuses = [200];
|
|
36
|
+
params.content = obj2xml_1.obj2xml(paramXMLObj);
|
|
37
|
+
const result = await this.request(params);
|
|
38
|
+
return {
|
|
39
|
+
res: result.res,
|
|
40
|
+
status: result.status,
|
|
41
|
+
taskId: result.data.TaskId
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
exports.postAsyncFetch = postAsyncFetch;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { obj2xml } from '../utils/obj2xml';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* postAsyncFetch
|
|
5
|
+
* @param {String} name the object key
|
|
6
|
+
* @param {String} url
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
* {String} options.host
|
|
9
|
+
* {String} options.contentMD5
|
|
10
|
+
* {String} options.callback
|
|
11
|
+
* {String} options.storageClass Standard/IA/Archive
|
|
12
|
+
* {Boolean} options.ignoreSameKey default value true
|
|
13
|
+
*/
|
|
14
|
+
export async function postAsyncFetch(this: any, object, url, options: any = {}): Promise<object> {
|
|
15
|
+
options.subres = Object.assign({ asyncFetch: '' }, options.subres);
|
|
16
|
+
options.headers = options.headers || {};
|
|
17
|
+
object = this._objectName(object);
|
|
18
|
+
|
|
19
|
+
const { host = '', contentMD5 = '', callback = '', storageClass = '', ignoreSameKey = true } = options;
|
|
20
|
+
|
|
21
|
+
const paramXMLObj = {
|
|
22
|
+
AsyncFetchTaskConfiguration: {
|
|
23
|
+
Url: url,
|
|
24
|
+
Object: object,
|
|
25
|
+
Host: host,
|
|
26
|
+
ContentMD5: contentMD5,
|
|
27
|
+
Callback: callback,
|
|
28
|
+
StorageClass: storageClass,
|
|
29
|
+
IgnoreSameKey: ignoreSameKey
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const params = this._objectRequestParams('POST', '', options);
|
|
34
|
+
params.mime = 'xml';
|
|
35
|
+
params.xmlResponse = true;
|
|
36
|
+
params.successStatuses = [200];
|
|
37
|
+
params.content = obj2xml(paramXMLObj);
|
|
38
|
+
|
|
39
|
+
const result = await this.request(params);
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
res: result.res,
|
|
43
|
+
status: result.status,
|
|
44
|
+
taskId: result.data.TaskId
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const proto = exports;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Set object's ACL
|
|
5
|
+
* @param {String} name the object key
|
|
6
|
+
* @param {String} acl the object ACL
|
|
7
|
+
* @param {Object} options
|
|
8
|
+
*/
|
|
9
|
+
proto.putACL = async function putACL(name, acl, options) {
|
|
10
|
+
options = options || {};
|
|
11
|
+
options.subres = Object.assign({ acl: '' }, options.subres);
|
|
12
|
+
if (options.versionId) {
|
|
13
|
+
options.subres.versionId = options.versionId;
|
|
14
|
+
}
|
|
15
|
+
options.headers = options.headers || {};
|
|
16
|
+
options.headers['x-oss-object-acl'] = acl;
|
|
17
|
+
name = this._objectName(name);
|
|
18
|
+
|
|
19
|
+
const params = this._objectRequestParams('PUT', name, options);
|
|
20
|
+
params.successStatuses = [200];
|
|
21
|
+
|
|
22
|
+
const result = await this.request(params);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
res: result.res
|
|
26
|
+
};
|
|
27
|
+
};
|