-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
78 lines (78 loc) · 2.75 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
export = AwsSignRequest;
/**
* @typedef { import("superagent").Plugin } Plugin
*/
/**
* @description Helper utility to sign aws request, to invoke aws resources protected by IAM role.
*/
declare class AwsSignRequest {
/**
* @param {string} defaultService - Default service name for the request. (optional)
* @default
*/
constructor(defaultService?: string);
/**
* @description Default service name for the request.
*/
defaultService: string;
/**
* @description AWS region for the request.
*/
region: any;
/**
* @description AWS session credentials used for signing requests.
*/
session: any;
/**
* @description Set aws credentials manually, e.g., env
* @param {aws4.Credentials} credentials - The AWS credentials to set.
* @returns {aws4.Credentials} - The set AWS credentials.
*/
setCredentials(credentials: aws4.Credentials): aws4.Credentials;
/**
* @description Get and set aws credentials from local ~.aws/credentials
* @param {string} profile - The profile name in the credentials file.
* @returns {Promise<aws4.Credentials>} - The set AWS credentials.
*/
setCredentialsFromConfig(profile: string): Promise<aws4.Credentials>;
/**
* @description Get and set aws credentials from environment variables
* @returns {Promise<aws4.Credentials>} - The set AWS credentials.
*/
setCredentialsFromEnv(): Promise<aws4.Credentials>;
/**
* @description Create a session login.
* @param {object} params - The parameters for assuming a role.
* @returns {Promise<void>}
*/
assumeRole(params: object): Promise<void>;
/**
* @description Remove possible previous set session.
*/
removeRole(): void;
/**
* @description Set aws region.
* @param {string} region - The AWS region to set.
* @returns {string} - The set AWS region.
*/
setRegion(region: string): string;
/**
* @description Create custom req.end which intercepts the request and signs it off with all the needed data, returns the original end function.
* @param {string} [requestService] - The service name for the request. (optional)
* @returns {Plugin} - The signRequest function.
*/
add(requestService?: string): Plugin;
/**
* @description Sign the request with the credentials.
* @param {object} request - The request object.
* @param {aws4.Credentials} [credentials] - The AWS credentials to use for signing. (optional)
* @returns {object} - The aws4 signed request object.
*/
sign(request: object, credentials?: aws4.Credentials): object;
#private;
}
declare namespace AwsSignRequest {
export { Plugin };
}
type Plugin = any;
//# sourceMappingURL=index.d.ts.map