From d601a20c30d27085caf61a5ebcb9df51f492f0e5 Mon Sep 17 00:00:00 2001 From: Casper Skydt Date: Thu, 23 Jun 2016 08:50:19 +0200 Subject: [PATCH 1/2] Added sns and STS --- aws-sdk/aws-sdk.d.ts | 131 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 1 deletion(-) diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index a13e03fe7a..20f741efca 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -18,6 +18,10 @@ declare module "aws-sdk" { accessKeyId: string; } + export class EnvironmentCredentials extends Credentials { + constructor(profile: string); + } + export interface Logger { write?: (chunk: any, encoding?: string, callback?: () => void) => void; log?: (...messages: any[]) => void; @@ -86,6 +90,8 @@ declare module "aws-sdk" { export interface ClientConfigPartial extends Services { credentials?: Credentials; region?: string; + accessKeyId: string; + secretAccessKey: string; computeChecksums?: boolean; convertResponseTypes?: boolean; logger?: Logger; @@ -138,8 +144,30 @@ declare module "aws-sdk" { export class SNS { constructor(options?: any); - public client: Sns.Client; + publish(request: sns.publishRequestParams, callback: (err: any, data: any) => void): void; } + + export interface publishRequestParams{ + Message: string, + MessageAttributes?: any, + MessageStructure: string, + Subject?: string, + TargetArn?: string, + TopicArn: string + } + + export module sns{ + export interface publishRequestParams{ + Message: string, + MessageAttributes?: any, + MessageStructure: string, + Subject?: string, + TargetArn?: string, + TopicArn: string + } + } + + export class SimpleWorkflow { constructor(options?: any); @@ -152,6 +180,51 @@ declare module "aws-sdk" { getObject(params: s3.GetObjectRequest, callback: (err: any, data: any) => void): void; } + export class STS{ + constructor(options?: any); + + /** + * Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to. + */ + assumeRole(params: sts.AssumeRoleParams, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response. + */ + assumeRoleWithSAML(params: sts.AssumeRoleWithSAMLParams, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider, such as Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible identity provider. + */ + assumeRoleWithWebIdentity(params: sts.AssumeRoleWithWebIdentityParams, callback: (err: any, data: any) => void): void; + + /** + * Creates a credentials object from STS response data containing credentials information. + */ + credentialsFrom(params: sts.CredentialsFromParams, callback: (err: any, data: any) => void): void; + + /** + * Decodes additional information about the authorization status of a request from an encoded message returned in response to an AWS request. + */ + decodeAuthorizationMessage(params: sts.DecodeAuthorizationMessageParams, callback: (err: any, data: any) => void): void; + + /** + * Returns details about the IAM identity whose credentials are used to call the API. + */ + getCallerIdentity(params: {}, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user. + */ + getFederationToken(params: sts.GetFederationTokenParams, callback: (err: any, data: any) => void): void; + + /** + * Returns a set of temporary credentials for an AWS account or IAM user. + */ + getSessionToken(params: sts.GetSessionTokenParams, callback: (err: any, data: any) => void): void; + + } + export class ECS { constructor(options?: any); /** @@ -1345,4 +1418,60 @@ declare module "aws-sdk" { taskDefinition: string; } } + + export module sts { + export interface AssumeRoleParams { + RoleArn: string; + RoleSessionName: string; + DurationSeconds?: number; + ExternalId?: string; + Policy?: string; + SerialNumber?: string; + TokenCode?: string; + } + + export interface AssumeRoleWithSAMLParams { + PrincipalArn: string; + RoleArn: string; + SAMLAssertion: string; + DurationSeconds?: number; + Policy?: string; + } + + export interface AssumeRoleWithWebIdentityParams { + RoleArn: string; + RoleSessionName: string; + WebIdentityToken: string; + DurationSeconds?: number; + Policy?: string; + ProviderId?: string; + } + + export interface CredentialsFromParams { + /** + * Data retrieved from a call to AWS.STS.getFederatedToken, getSessionToken(), assumeRole(), or assumeRoleWithWebIdentity(). + */ + Data: any; + /** + * An optional credentials object to fill instead of creating a new object. Useful when modifying an existing credentials object from a refresh call. + */ + Credentials?: Credentials + } + + export interface DecodeAuthorizationMessageParams { + EncodedMessage: string; + } + + export interface GetFederationTokenParams { + Name: string; + DurationSeconds?: number, + Policy?: string + } + + export interface GetSessionTokenParams { + DurationSeconds: number, + SerialNumber: string; + TokenCode: string; + } + } } From a81bf4083907e52f615cb3da8761db70342d3819 Mon Sep 17 00:00:00 2001 From: Casper Skydt Date: Thu, 23 Jun 2016 08:55:43 +0200 Subject: [PATCH 2/2] Removed duplicat item --- aws-sdk/aws-sdk.d.ts | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index 20f741efca..5946d25982 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -144,31 +144,9 @@ declare module "aws-sdk" { export class SNS { constructor(options?: any); - publish(request: sns.publishRequestParams, callback: (err: any, data: any) => void): void; + publish(request: Sns.PublishRequest, callback: (err: any, data: any) => void): void; } - - export interface publishRequestParams{ - Message: string, - MessageAttributes?: any, - MessageStructure: string, - Subject?: string, - TargetArn?: string, - TopicArn: string - } - - export module sns{ - export interface publishRequestParams{ - Message: string, - MessageAttributes?: any, - MessageStructure: string, - Subject?: string, - TargetArn?: string, - TopicArn: string - } - } - - - + export class SimpleWorkflow { constructor(options?: any); public client: Swf.Client;