-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,196 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* deleteBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
export declare function deleteBucketInventory(this: any, bucketName: string, inventoryId: string, options?: any): Promise<{ | ||
status: any; | ||
res: any; | ||
}>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deleteBucketInventory = void 0; | ||
const checkBucketName_1 = require("../utils/checkBucketName"); | ||
/** | ||
* deleteBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
async function deleteBucketInventory(bucketName, inventoryId, options = {}) { | ||
const subres = Object.assign({ inventory: '', inventoryId }, options.subres); | ||
checkBucketName_1.checkBucketName(bucketName); | ||
const params = this._bucketRequestParams('DELETE', bucketName, subres, options); | ||
params.successStatuses = [204]; | ||
const result = await this.request(params); | ||
return { | ||
status: result.status, | ||
res: result.res, | ||
}; | ||
} | ||
exports.deleteBucketInventory = deleteBucketInventory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { checkBucketName } from '../utils/checkBucketName'; | ||
/** | ||
* deleteBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
|
||
export async function deleteBucketInventory(this: any, bucketName: string, inventoryId: string, options: any = {}) { | ||
const subres: any = Object.assign({ inventory: '', inventoryId }, options.subres); | ||
checkBucketName(bucketName); | ||
|
||
const params = this._bucketRequestParams('DELETE', bucketName, subres, options); | ||
params.successStatuses = [204]; | ||
|
||
const result = await this.request(params); | ||
return { | ||
status: result.status, | ||
res: result.res, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* getBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
export declare function getBucketInventory(this: any, bucketName: string, inventoryId: string, options?: any): Promise<{ | ||
status: any; | ||
res: any; | ||
inventory: any; | ||
}>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getBucketInventory = void 0; | ||
const checkBucketName_1 = require("../utils/checkBucketName"); | ||
const formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); | ||
/** | ||
* getBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
async function getBucketInventory(bucketName, inventoryId, options = {}) { | ||
const subres = Object.assign({ inventory: '', inventoryId }, options.subres); | ||
checkBucketName_1.checkBucketName(bucketName); | ||
const params = this._bucketRequestParams('GET', bucketName, subres, options); | ||
params.successStatuses = [200]; | ||
params.xmlResponse = true; | ||
const result = await this.request(params); | ||
return { | ||
status: result.status, | ||
res: result.res, | ||
inventory: formatInventoryConfig_1.formatInventoryConfig(result.data) | ||
}; | ||
} | ||
exports.getBucketInventory = getBucketInventory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { checkBucketName } from '../utils/checkBucketName'; | ||
import { formatInventoryConfig } from '../utils/formatInventoryConfig'; | ||
/** | ||
* getBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
|
||
export async function getBucketInventory(this: any, bucketName: string, inventoryId: string, options: any = {}) { | ||
const subres: any = Object.assign({ inventory: '', inventoryId }, options.subres); | ||
checkBucketName(bucketName); | ||
|
||
const params = this._bucketRequestParams('GET', bucketName, subres, options); | ||
params.successStatuses = [200]; | ||
|
||
params.xmlResponse = true; | ||
const result = await this.request(params); | ||
return { | ||
status: result.status, | ||
res: result.res, | ||
inventory: formatInventoryConfig(result.data) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* listBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
export declare function listBucketInventory(this: any, bucketName: string, options?: any): Promise<{ | ||
isTruncated: boolean; | ||
nextContinuationToken: any; | ||
inventoryList: any; | ||
status: any; | ||
res: any; | ||
}>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.listBucketInventory = void 0; | ||
const checkBucketName_1 = require("../utils/checkBucketName"); | ||
const formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); | ||
/** | ||
* listBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
async function listBucketInventory(bucketName, options = {}) { | ||
const { continuationToken } = options; | ||
const subres = Object.assign({ inventory: '' }, continuationToken && { 'continuation-token': continuationToken }, options.subres); | ||
checkBucketName_1.checkBucketName(bucketName); | ||
const params = this._bucketRequestParams('GET', bucketName, subres, options); | ||
params.successStatuses = [200]; | ||
params.xmlResponse = true; | ||
const result = await this.request(params); | ||
const { data, res, status } = result; | ||
return { | ||
isTruncated: data.IsTruncated === 'true', | ||
nextContinuationToken: data.NextContinuationToken, | ||
inventoryList: formatInventoryConfig_1.formatInventoryConfig(data.InventoryConfiguration, true), | ||
status, | ||
res, | ||
}; | ||
} | ||
exports.listBucketInventory = listBucketInventory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { checkBucketName } from '../utils/checkBucketName'; | ||
import { formatInventoryConfig } from '../utils/formatInventoryConfig'; | ||
/** | ||
* listBucketInventory | ||
* @param {String} bucketName - bucket name | ||
* @param {String} inventoryId | ||
* @param {Object} options | ||
*/ | ||
|
||
export async function listBucketInventory(this: any, bucketName: string, options: any = {}) { | ||
const { continuationToken } = options; | ||
const subres: any = Object.assign({ inventory: '' }, continuationToken && { 'continuation-token': continuationToken }, options.subres); | ||
checkBucketName(bucketName); | ||
|
||
const params = this._bucketRequestParams('GET', bucketName, subres, options); | ||
params.successStatuses = [200]; | ||
|
||
params.xmlResponse = true; | ||
const result = await this.request(params); | ||
const { data, res, status } = result; | ||
return { | ||
isTruncated: data.IsTruncated === 'true', | ||
nextContinuationToken: data.NextContinuationToken, | ||
inventoryList: formatInventoryConfig(data.InventoryConfiguration, true), | ||
status, | ||
res, | ||
}; | ||
} |
Oops, something went wrong.