@@ -460,8 +460,8 @@ try {
460
460
const putObjectResult = await store .put (' your bucket name' , ' your object name' , {
461
461
headers: {
462
462
// The headers of this request
463
- ' header1' : ' value1' ,
464
- ' header2' : ' value2'
463
+ header1: ' value1' ,
464
+ header2: ' value2'
465
465
},
466
466
// The keys of the request headers that need to be calculated into the V4 signature. Please ensure that these additional headers are included in the request headers.
467
467
additionalHeaders: [' additional header1' , ' additional header2' ]
@@ -1489,7 +1489,8 @@ Success will return:
1489
1489
- res {Object} response info
1490
1490
1491
1491
``` ts
1492
- type Field = ' Size | LastModifiedDate | ETag | StorageClass | IsMultipartUploaded | EncryptionStatus' ;
1492
+ type Field =
1493
+ ' Size | LastModifiedDate | ETag | StorageClass | IsMultipartUploaded | EncryptionStatus | ObjectAcl | TaggingCount | ObjectType | Crc64' ;
1493
1494
interface Inventory {
1494
1495
id: string ;
1495
1496
isEnabled: true | false ;
@@ -1538,7 +1539,18 @@ const inventory = {
1538
1539
frequency: ' Daily' , // `WEEKLY` | `Daily`
1539
1540
includedObjectVersions: ' All' , // `All` | `Current`
1540
1541
optionalFields: {
1541
- field: [' Size' , ' LastModifiedDate' , ' ETag' , ' StorageClass' , ' IsMultipartUploaded' , ' EncryptionStatus' ]
1542
+ field: [
1543
+ ' Size' ,
1544
+ ' LastModifiedDate' ,
1545
+ ' ETag' ,
1546
+ ' StorageClass' ,
1547
+ ' IsMultipartUploaded' ,
1548
+ ' EncryptionStatus' ,
1549
+ ' ObjectAcl' ,
1550
+ ' TaggingCount' ,
1551
+ ' ObjectType' ,
1552
+ ' Crc64'
1553
+ ]
1542
1554
}
1543
1555
};
1544
1556
@@ -2671,13 +2683,17 @@ const url = store.signatureUrl('ossdemo.txt', {
2671
2683
console.log(url);
2672
2684
2673
2685
// --------------------------------------------------
2674
- const url = store.signatureUrl('ossdemo.txt', {
2675
- expires: 3600,
2676
- response: {
2677
- 'content-type': 'text/custom',
2678
- 'content-disposition': 'attachment'
2679
- }
2680
- }, false);
2686
+ const url = store.signatureUrl(
2687
+ 'ossdemo.txt',
2688
+ {
2689
+ expires: 3600,
2690
+ response: {
2691
+ 'content-type': 'text/custom',
2692
+ 'content-disposition': 'attachment'
2693
+ }
2694
+ },
2695
+ false
2696
+ );
2681
2697
console.log(url);
2682
2698
2683
2699
// put operation
@@ -2750,13 +2766,17 @@ const url = await store.asyncSignatureUrl('ossdemo.txt', {
2750
2766
});
2751
2767
console.log(url);
2752
2768
// --------------------------------------------------
2753
- const url = await store.asyncSignatureUrl('ossdemo.txt', {
2754
- expires: 3600,
2755
- response: {
2756
- 'content-type': 'text/custom',
2757
- 'content-disposition': 'attachment'
2758
- }
2759
- }, false);
2769
+ const url = await store.asyncSignatureUrl(
2770
+ 'ossdemo.txt',
2771
+ {
2772
+ expires: 3600,
2773
+ response: {
2774
+ 'content-type': 'text/custom',
2775
+ 'content-disposition': 'attachment'
2776
+ }
2777
+ },
2778
+ false
2779
+ );
2760
2780
console.log(url);
2761
2781
// put operation
2762
2782
```
@@ -2799,28 +2819,40 @@ example:
2799
2819
const getObjectUrl = await store.signatureUrlV4('GET', 60, undefined, 'your obejct name');
2800
2820
console.log(getObjectUrl);
2801
2821
// --------------------------------------------------
2802
- const getObjectUrl = await store.signatureUrlV4('GET', 60, {
2803
- headers: {
2804
- 'Cache-Control': 'no-cache'
2822
+ const getObjectUrl = await store.signatureUrlV4(
2823
+ 'GET',
2824
+ 60,
2825
+ {
2826
+ headers: {
2827
+ 'Cache-Control': 'no-cache'
2828
+ },
2829
+ queries: {
2830
+ versionId: 'version ID of your object'
2831
+ }
2805
2832
},
2806
- queries: {
2807
- versionId: 'version ID of your object'
2808
- }
2809
- }, 'your obejct name', ['Cache-Control']);
2833
+ 'your obejct name',
2834
+ ['Cache-Control']
2835
+ );
2810
2836
console.log(getObjectUrl);
2811
2837
2812
2838
// -------------------------------------------------
2813
2839
// PutObject
2814
2840
const putObejctUrl = await store.signatureUrlV4('PUT', 60, undefined, 'your obejct name');
2815
2841
console.log(putObejctUrl);
2816
2842
// --------------------------------------------------
2817
- const putObejctUrl = await store.signatureUrlV4('PUT', 60, {
2818
- headers: {
2819
- 'Content-Type': 'text/plain',
2820
- 'Content-MD5': 'xxx',
2821
- 'Content-Length': 1
2822
- }
2823
- }, 'your obejct name', ['Content-Length']);
2843
+ const putObejctUrl = await store.signatureUrlV4(
2844
+ 'PUT',
2845
+ 60,
2846
+ {
2847
+ headers: {
2848
+ 'Content-Type': 'text/plain',
2849
+ 'Content-MD5': 'xxx',
2850
+ 'Content-Length': 1
2851
+ }
2852
+ },
2853
+ 'your obejct name',
2854
+ ['Content-Length']
2855
+ );
2824
2856
console.log(putObejctUrl);
2825
2857
```
2826
2858
0 commit comments