Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions types/aws-sdk2-types/aws-sdk2-types-tests.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as AWS from 'aws-sdk2-types';
function ssm(filter: AWS.SSM.Types.ParameterStringFilter) {
return filter.Key === "Stroustrup";
return filter.Key === 'Stroustrup';
}
function rds(config: AWS.RDSDataService.ClientConfiguration) {
return config.region === "us-east-1" && !!config.computeChecksums;
return config.region === 'us-east-1' && !!config.computeChecksums;
}
function dyn(u: AWS.DynamoDB.Update, doc: AWS.DynamoDB.DocumentClient) {
if (u?.ExpressionAttributeNames) {
u.ExpressionAttributeNames["#n"] = "name";
u.ExpressionAttributeNames['#n'] = 'name';
}
doc.batchWrite({ RequestItems: { table: [{ PutRequest: { Item: { name: "Copilot" } } }] } });
doc.batchWrite({ RequestItems: { table: [{ PutRequest: { Item: { name: 'Copilot' } } }] } });
}
function s3(loc: AWS.S3.S3Location) {
return loc.StorageClass === "STANDARD";
return loc.StorageClass === 'STANDARD';
}
function sqs(x: AWS.SQS.QueueAttributeMap) {
return x["VisibilityTimeout"] === "30";
return x['VisibilityTimeout'] === '30';
}
7,580 changes: 3,948 additions & 3,632 deletions types/aws-sdk2-types/clients/dynamodb.d.ts

Large diffs are not rendered by default.

1,036 changes: 533 additions & 503 deletions types/aws-sdk2-types/clients/rdsdataservice.d.ts

Large diffs are not rendered by default.

12,807 changes: 6,669 additions & 6,138 deletions types/aws-sdk2-types/clients/s3.d.ts

Large diffs are not rendered by default.

4,438 changes: 2,404 additions & 2,034 deletions types/aws-sdk2-types/clients/ses.d.ts

Large diffs are not rendered by default.

1,457 changes: 784 additions & 673 deletions types/aws-sdk2-types/clients/sqs.d.ts

Large diffs are not rendered by default.

19,996 changes: 10,480 additions & 9,516 deletions types/aws-sdk2-types/clients/ssm.d.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions types/aws-sdk2-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

/// <reference types="node" />

import {GlobalConfigInstance} from './lib/config';
import { GlobalConfigInstance } from './lib/config';

export * from './lib/core';
export * from './clients/all';
export var config: GlobalConfigInstance
export * from './lib/core';
export var config: GlobalConfigInstance;

export as namespace AWS;
101 changes: 51 additions & 50 deletions types/aws-sdk2-types/lib/config-base.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import {Agent as httpAgent} from 'http';
import {Agent as httpsAgent} from 'https';
import {AWSError} from './error';
import {Credentials, CredentialsOptions} from './credentials';
import {CredentialProviderChain} from './credentials/credential_provider_chain';
import {Token} from './token';
import {TokenProviderChain} from './token/token_provider_chain';
import { Agent as httpAgent } from 'http';
import { Agent as httpsAgent } from 'https';
import { Credentials, CredentialsOptions } from './credentials';
import { CredentialProviderChain } from './credentials/credential_provider_chain';
import { AWSError } from './error';
import { Token } from './token';
import { TokenProviderChain } from './token/token_provider_chain';

export class ConfigBase extends ConfigurationOptions{
export class ConfigBase extends ConfigurationOptions {
constructor(options?: ConfigurationOptions);
/**
* Loads credentials from the configuration object.
*/
getCredentials(callback: (err: AWSError|null, credentials: Credentials|CredentialsOptions|null) => void): void;
getCredentials(
callback: (err: AWSError | null, credentials: Credentials | CredentialsOptions | null) => void,
): void;
/**
* Loads token from the token object.
*/
getToken(callback: (err: AWSError|null, token: Token|null) => void): void;
getToken(callback: (err: AWSError | null, token: Token | null) => void): void;
/**
* Loads configuration data from a JSON file into this config object.
* Loading configuration will reset all existing configuration on the object.
Expand All @@ -30,7 +32,7 @@ export class ConfigBase extends ConfigurationOptions{
* @param {ConfigurationOptions} options - a map of option keys and values.
* @param {boolean} allowUnknownKeys - Whether unknown keys can be set on the configuration object.
*/
update(options: ConfigurationOptions & {[key: string]: any}, allowUnknownKeys: true): void;
update(options: ConfigurationOptions & { [key: string]: any }, allowUnknownKeys: true): void;
/**
* Updates the current configuration object with new options.
*
Expand Down Expand Up @@ -87,7 +89,7 @@ export interface HTTPOptions {
xhrWithCredentials?: boolean;
}
export interface Logger {
write?: (chunk: any, encoding?: string, callback?: () => void) => void
write?: (chunk: any, encoding?: string, callback?: () => void) => void;
log?: (...messages: any[]) => void;
warn?: (...message: any[]) => void;
}
Expand All @@ -96,174 +98,173 @@ export interface ParamValidation {
* Validates that a value meets the min constraint.
* This is enabled by default when paramValidation is set to true.
*/
min?: boolean
min?: boolean;
/**
* Validates that a value meets the max constraint.
*/
max?: boolean
max?: boolean;
/**
* Validates that a string value matches a regular expression.
*/
pattern?: boolean
pattern?: boolean;
/**
* Validates that a string value matches one of the allowable enum values.
*/
enum?: boolean
enum?: boolean;
}
export interface RetryDelayOptions {
/**
* The base number of milliseconds to use in the exponential backoff for operation retries.
* Defaults to 100 ms.
*/
base?: number
base?: number;
/**
* A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made.
* The base option will be ignored if this option is supplied.
*/
customBackoff?: (retryCount: number, err?: Error) => number
customBackoff?: (retryCount: number, err?: Error) => number;
}

/**
* Common configuration entries to construct a service client.
*/
export abstract class ConfigurationOptions {

/**
* Whether to compute checksums for payload bodies when the service accepts it.
* Currently supported in S3 only.
*/
computeChecksums?: boolean
computeChecksums?: boolean;
/**
* Whether types are converted when parsing response data.
*/
convertResponseTypes?: boolean
convertResponseTypes?: boolean;
/**
* Whether to apply a clock skew correction and retry requests that fail because of an skewed client clock.
*/
correctClockSkew?: boolean
correctClockSkew?: boolean;
/**
* Sets a custom User-Agent string.
* In node environments this will set the User-Agent header, but
* browser environments this will set the X-Amz-User-Agent header.
*/
customUserAgent?: string
customUserAgent?: string;
/**
* The AWS credentials to sign requests with.
*/
credentials?: Credentials|CredentialsOptions|null
credentials?: Credentials | CredentialsOptions | null;
/**
* The provider chain used to resolve credentials if no static credentials property is set.
*/
credentialProvider?: CredentialProviderChain
credentialProvider?: CredentialProviderChain;
/**
* The Token to authenticate requests with.
*/
token?: Token|null
token?: Token | null;
/**
* The provider chain used to resolve token if no static token property is set.
*/
tokenProvider?: TokenProviderChain
tokenProvider?: TokenProviderChain;
/**
* AWS access key ID.
*
* @deprecated
*/
accessKeyId?: string
accessKeyId?: string;
/**
* AWS secret access key.
*
* @deprecated
*/
secretAccessKey?: string
secretAccessKey?: string;
/**
* AWS session token.
*
* @deprecated
*/
sessionToken?: string
sessionToken?: string;
/**
* A set of options to pass to the low-level HTTP request.
*/
httpOptions?: HTTPOptions
httpOptions?: HTTPOptions;
/**
* An object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests.
*/
logger?: Logger
logger?: Logger;
/**
* The maximum amount of redirects to follow for a service request.
*/
maxRedirects?: number
maxRedirects?: number;
/**
* The maximum amount of retries to perform for a service request.
*/
maxRetries?: number
maxRetries?: number;
/**
* Returns whether input parameters should be validated against the operation description before sending the request.
* Defaults to true.
* Pass a map to enable any of the following specific validation features: min|max|pattern|enum
*/
paramValidation?: ParamValidation|boolean
paramValidation?: ParamValidation | boolean;
/**
* The region to send service requests to.
*/
region?: string
region?: string;
/**
* Returns A set of options to configure the retry delay on retryable errors.
*/
retryDelayOptions?: RetryDelayOptions
retryDelayOptions?: RetryDelayOptions;
/**
* Whether the provided endpoint addresses an individual bucket.
* false if it addresses the root API endpoint.
*/
s3BucketEndpoint?: boolean
s3BucketEndpoint?: boolean;
/**
* Whether to disable S3 body signing when using signature version v4.
*/
s3DisableBodySigning?: boolean
s3DisableBodySigning?: boolean;
/**
* Whether to force path style URLs for S3 objects.
*/
s3ForcePathStyle?: boolean
s3ForcePathStyle?: boolean;
/**
* When region is set to 'us-east-1', whether to send s3 request to global endpoints
* or 'us-east-1' regional endpoints. This config is only applicable to S3 client;
* Defaults to 'legacy'
*/
s3UsEast1RegionalEndpoint?: "regional"|"legacy"
s3UsEast1RegionalEndpoint?: 'regional' | 'legacy';
/**
* Whether to override the request region with the region inferred
* from requested resource's ARN. Only available for S3 buckets
* Defaults to `true`
*/
s3UseArnRegion?: boolean
s3UseArnRegion?: boolean;
/**
* Whether the signature to sign requests with (overriding the API configuration) is cached.
*/
signatureCache?: boolean
signatureCache?: boolean;
/**
* The signature version to sign requests with (overriding the API configuration).
* Possible values: 'v2'|'v3'|'v4'
*/
signatureVersion?: "v2"|"v3"|"v4"|string
signatureVersion?: 'v2' | 'v3' | 'v4' | string;
/**
* Whether SSL is enabled for requests.
*/
sslEnabled?: boolean
sslEnabled?: boolean;
/**
* An offset value in milliseconds to apply to all signing times.
*/
systemClockOffset?: number
systemClockOffset?: number;
/**
* Whether to use the Accelerate endpoint with the S3 service.
*/
useAccelerateEndpoint?: boolean
useAccelerateEndpoint?: boolean;
/**
* Whether to validate the CRC32 checksum of HTTP response bodies returned
* by DynamoDB.
*/
dynamoDbCrc32?: boolean;
/**
* Whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by
* Whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by
* the service.
*/
endpointDiscoveryEnabled?: boolean;
Expand All @@ -279,9 +280,9 @@ export abstract class ConfigurationOptions {
hostPrefixEnabled?: boolean;
/**
* Whether to send sts request to global endpoints or
* regional endpoints.
* regional endpoints.
*/
stsRegionalEndpoints?: "legacy"|"regional";
stsRegionalEndpoints?: 'legacy' | 'regional';
/**
* Enables FIPS compatible endpoints.
*/
Expand Down
19 changes: 12 additions & 7 deletions types/aws-sdk2-types/lib/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ConfigurationServicePlaceholders, ConfigurationServiceApiVersions} from './config_service_placeholders';
import {ConfigBase, ConfigurationOptions} from './config-base';
import { ConfigBase, ConfigurationOptions } from './config-base';
import { ConfigurationServiceApiVersions, ConfigurationServicePlaceholders } from './config_service_placeholders';

export class Config extends ConfigBase {
/**
Expand All @@ -21,29 +21,34 @@ export class Config extends ConfigBase {
* @param {ConfigurationOptions} options - a map of option keys and values.
* @param {boolean} allowUnknownKeys - Whether unknown keys can be set on the configuration object.
*/
update(options: ConfigurationOptions & ConfigurationServicePlaceholders & APIVersions & {[key: string]: any}, allowUnknownKeys: true): void;
update(
options: ConfigurationOptions & ConfigurationServicePlaceholders & APIVersions & { [key: string]: any },
allowUnknownKeys: true,
): void;
/**
* Updates the current configuration object with new options.
*
* @param {ConfigurationOptions} options - a map of option keys and values.
* @param {boolean} allowUnknownKeys - Defaults to false. Whether unknown keys can be set on the configuration object.
*/
update(options: ConfigurationOptions & ConfigurationServicePlaceholders & APIVersions, allowUnknownKeys?: false): void;
update(
options: ConfigurationOptions & ConfigurationServicePlaceholders & APIVersions,
allowUnknownKeys?: false,
): void;
}

export type GlobalConfigInstance = Config & ConfigurationServicePlaceholders & APIVersions;


export interface APIVersions {
/**
* A string in YYYY-MM-DD format that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify \'latest\' to use the latest possible version.
*/
apiVersion?: "latest"|string;
apiVersion?: 'latest' | string;
/**
* A map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
*/
apiVersions?: ConfigurationServiceApiVersions;
}

// for backwards compatible client generation
export { ConfigBase } from "./config-base";
export { ConfigBase } from './config-base';
20 changes: 10 additions & 10 deletions types/aws-sdk2-types/lib/config_service_placeholders.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as AWS from '../clients/all';
export abstract class ConfigurationServicePlaceholders {
dynamodb?: AWS.DynamoDB.Types.ClientConfiguration;
rdsdataservice?: AWS.RDSDataService.Types.ClientConfiguration;
s3?: AWS.S3.Types.ClientConfiguration;
ses?: AWS.SES.Types.ClientConfiguration;
ssm?: AWS.SSM.Types.ClientConfiguration;
dynamodb?: AWS.DynamoDB.Types.ClientConfiguration;
rdsdataservice?: AWS.RDSDataService.Types.ClientConfiguration;
s3?: AWS.S3.Types.ClientConfiguration;
ses?: AWS.SES.Types.ClientConfiguration;
ssm?: AWS.SSM.Types.ClientConfiguration;
}
export interface ConfigurationServiceApiVersions {
dynamodb?: AWS.DynamoDB.Types.apiVersion;
rdsdataservice?: AWS.RDSDataService.Types.apiVersion;
s3?: AWS.S3.Types.apiVersion;
ses?: AWS.SES.Types.apiVersion;
ssm?: AWS.SSM.Types.apiVersion;
dynamodb?: AWS.DynamoDB.Types.apiVersion;
rdsdataservice?: AWS.RDSDataService.Types.apiVersion;
s3?: AWS.S3.Types.apiVersion;
ses?: AWS.SES.Types.apiVersion;
ssm?: AWS.SSM.Types.apiVersion;
}
Loading