UNPKG

2.49 kBTypeScriptView Raw
1import { BucketsConfigObject, BucketType } from './types';
2/**
3 * Class representing cumulus bucket configuration.
4 */
5declare class BucketsConfig {
6 private readonly buckets;
7 constructor(bucketsJsonObject: BucketsConfigObject);
8 /**
9 * returns key into this.buckets whose object has `name` bucketName
10 * @param {string} bucketName
11 * @returns {string|undefined} desired bucket's key value.
12 */
13 key(bucketName: string): string | undefined;
14 /**
15 * Return bucket type for bucketName
16 * @param {string} bucketName
17 * @returns {string} matching bucket's type
18 */
19 type(bucketName: string): BucketType;
20 /**
21 * returns bucket object who's name field matches bucketName
22 * @param {string} bucketName
23 * @returns {Object} bucket object
24 */
25 bucket(bucketName: string): import("./types").BucketConfig;
26 /**
27 * returns true if bucketName is found in any attatched bucket objects.
28 * @param {string} bucketName
29 * @returns {boolean} truthyness of this bucket existing in the configuration
30 */
31 exists(bucketName: string): boolean;
32 /**
33 * returns true if configKey is found on the top-level config.
34 * @param {string} configKey
35 * @returns {boolean} truthyness of this key existing in the configuration
36 */
37 keyExists(configKey: string): boolean;
38 /**
39 * returns name of bucket attatched to top-level config at configKey.
40 * @param {string} configKey
41 * @returns {string} name of bucket at key.
42 */
43 nameByKey(configKey: string): string;
44 /**
45 * return a list of configured buckets of desired type.
46 *
47 * @param {string/Array} types - types of buckets to return
48 * @returns {Array<Object>} - array of buckets that are of desired types
49 */
50 bucketsOfType(types: BucketType | BucketType[]): import("./types").BucketConfig[];
51 /** @returns {Array} list of private buckets */
52 privateBuckets(): import("./types").BucketConfig[];
53 /** @returns {Array} list of protected buckets */
54 protectedBuckets(): import("./types").BucketConfig[];
55 /** @returns {Array} list of public buckets */
56 publicBuckets(): import("./types").BucketConfig[];
57 /** @returns {Array} list of shared buckets */
58 sharedBuckets(): import("./types").BucketConfig[];
59 /** @returns {Array} list of internal buckets */
60 internalBuckets(): import("./types").BucketConfig[];
61}
62export = BucketsConfig;
63//# sourceMappingURL=BucketsConfig.d.ts.map
\No newline at end of file