mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
aws-sdk: Provides its own types (#15604)
* aws-sdk: Provides its own types * Make quotes consistent
This commit is contained in:
parent
61f09b2ce8
commit
eae91aa566
@ -24,6 +24,12 @@
|
||||
"sourceRepoURL": "https://github.com/ranisalt/node-argon2",
|
||||
"asOfVersion": "0.15.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "aws-sdk",
|
||||
"typingsPackageName": "aws-sdk",
|
||||
"sourceRepoURL": "https://github.com/aws/aws-sdk-js",
|
||||
"asOfVersion": "2.7.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "axios",
|
||||
"typingsPackageName": "axios",
|
||||
|
||||
@ -1,422 +0,0 @@
|
||||
|
||||
import AWS = require('aws-sdk');
|
||||
|
||||
var str: string;
|
||||
|
||||
var creds: AWS.Credentials;
|
||||
|
||||
creds = new AWS.Credentials(str, str);
|
||||
creds = new AWS.Credentials(str, str, str);
|
||||
str = creds.accessKeyId;
|
||||
|
||||
|
||||
/*
|
||||
* ECS
|
||||
*/
|
||||
var ecs:AWS.ECS
|
||||
|
||||
ecs = new AWS.ECS();
|
||||
ecs = new AWS.ECS({apiVersion: '2012-11-05'});
|
||||
|
||||
ecs.describeClusters({
|
||||
clusters: ['STRING_VALUE', 'STRING_VALUE']
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
ecs.describeTasks({
|
||||
cluster: 'STRING_VALUE',
|
||||
tasks: ['STRING_VALUE', 'STRING_VALUE']
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* SQS
|
||||
*/
|
||||
var sqs:AWS.SQS
|
||||
|
||||
//Default constructor
|
||||
sqs = new AWS.SQS();
|
||||
|
||||
//Locking the API Version
|
||||
sqs = new AWS.SQS({apiVersion: '2012-11-05'});
|
||||
|
||||
// Locking the API Version Globally
|
||||
AWS.config.apiVersions = {
|
||||
sqs: '2012-11-05',
|
||||
// other service API versions
|
||||
};
|
||||
|
||||
sqs.addPermission({
|
||||
AWSAccountIds: [ /* required */
|
||||
'STRING_VALUE',
|
||||
/* more items */
|
||||
],
|
||||
Actions: [ /* required */
|
||||
'STRING_VALUE',
|
||||
/* more items */
|
||||
],
|
||||
Label: 'STRING_VALUE', /* required */
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.changeMessageVisibility({
|
||||
QueueUrl: 'STRING_VALUE', /* required */
|
||||
ReceiptHandle: 'STRING_VALUE', /* required */
|
||||
VisibilityTimeout: 0 /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.changeMessageVisibilityBatch({
|
||||
Entries: [ /* required */
|
||||
{
|
||||
Id: 'STRING_VALUE', /* required */
|
||||
ReceiptHandle: 'STRING_VALUE', /* required */
|
||||
VisibilityTimeout: 0
|
||||
},
|
||||
/* more items */
|
||||
],
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.createQueue({
|
||||
QueueName: 'STRING_VALUE', /* required */
|
||||
Attributes: {
|
||||
someKey: 'STRING_VALUE',
|
||||
/* anotherKey: ... */
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.deleteMessage({
|
||||
QueueUrl: 'STRING_VALUE', /* required */
|
||||
ReceiptHandle: 'STRING_VALUE' /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.deleteMessageBatch({
|
||||
Entries: [ /* required */
|
||||
{
|
||||
Id: 'STRING_VALUE', /* required */
|
||||
ReceiptHandle: 'STRING_VALUE' /* required */
|
||||
},
|
||||
/* more items */
|
||||
],
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.deleteQueue({
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.getQueueAttributes({
|
||||
QueueUrl: 'STRING_VALUE', /* required */
|
||||
AttributeNames: [
|
||||
'Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy',
|
||||
/* more items */
|
||||
]
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.getQueueUrl({
|
||||
QueueName: 'STRING_VALUE', /* required */
|
||||
QueueOwnerAWSAccountId: 'STRING_VALUE'
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.listDeadLetterSourceQueues({
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
}, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.listQueues({
|
||||
QueueNamePrefix: 'STRING_VALUE'
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.purgeQueue({
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
}, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.receiveMessage({
|
||||
QueueUrl: 'STRING_VALUE', /* required */
|
||||
AttributeNames: [
|
||||
'Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy',
|
||||
/* more items */
|
||||
],
|
||||
MaxNumberOfMessages: 0,
|
||||
MessageAttributeNames: [
|
||||
'STRING_VALUE',
|
||||
/* more items */
|
||||
],
|
||||
VisibilityTimeout: 0,
|
||||
WaitTimeSeconds: 0
|
||||
}, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.removePermission({
|
||||
Label: 'STRING_VALUE', /* required */
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
}, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.sendMessage({
|
||||
MessageBody: 'STRING_VALUE', /* required */
|
||||
QueueUrl: 'STRING_VALUE', /* required */
|
||||
DelaySeconds: 0,
|
||||
MessageAttributes: {
|
||||
someKey: {
|
||||
DataType: 'STRING_VALUE', /* required */
|
||||
BinaryListValues: [
|
||||
new Buffer('...') || 'STRING_VALUE',
|
||||
/* more items */
|
||||
],
|
||||
BinaryValue: new Buffer('...') || 'STRING_VALUE',
|
||||
StringListValues: [
|
||||
'STRING_VALUE',
|
||||
/* more items */
|
||||
],
|
||||
StringValue: 'STRING_VALUE'
|
||||
},
|
||||
/* anotherKey: ... */
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.sendMessageBatch({
|
||||
Entries: [ /* required */
|
||||
{
|
||||
Id: 'STRING_VALUE', /* required */
|
||||
MessageBody: 'STRING_VALUE', /* required */
|
||||
DelaySeconds: 0,
|
||||
MessageAttributes: {
|
||||
someKey: {
|
||||
DataType: 'STRING_VALUE', /* required */
|
||||
BinaryListValues: [
|
||||
new Buffer('...') ,
|
||||
/* more items */
|
||||
],
|
||||
BinaryValue: new Buffer('...'),
|
||||
StringListValues: [
|
||||
'STRING_VALUE',
|
||||
/* more items */
|
||||
],
|
||||
StringValue: 'STRING_VALUE'
|
||||
},
|
||||
/* anotherKey: ... */
|
||||
}
|
||||
},
|
||||
/* more items */
|
||||
],
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
sqs.setQueueAttributes({
|
||||
Attributes: { /* required */
|
||||
someKey: 'STRING_VALUE',
|
||||
/* anotherKey: ... */
|
||||
},
|
||||
QueueUrl: 'STRING_VALUE' /* required */
|
||||
}, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
var dynamoDBDocClient:AWS.DynamoDB.DocumentClient;
|
||||
dynamoDBDocClient = new AWS.DynamoDB.DocumentClient();
|
||||
dynamoDBDocClient = new AWS.DynamoDB.DocumentClient({});
|
||||
dynamoDBDocClient.createSet([1, 2, 3], { validate: true });
|
||||
dynamoDBDocClient.get(
|
||||
{
|
||||
TableName: 'TABLE_NAME',
|
||||
Key: { userId: 'abc123', email: 'abc123@abc123.com' }
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
}
|
||||
);
|
||||
dynamoDBDocClient.put(
|
||||
{
|
||||
TableName: 'TABLE_NAME',
|
||||
Item: {
|
||||
userId: 'abc123',
|
||||
email: 'abc123@abc123.com',
|
||||
firstName: 'Matt',
|
||||
lastName: 'Forrester the ' + new Date().getTime()
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
}
|
||||
);
|
||||
dynamoDBDocClient.delete(
|
||||
{
|
||||
TableName: 'TABLE_NAME',
|
||||
Key: {
|
||||
userId: 'abc123',
|
||||
email: 'abc123@abc123.com'
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
}
|
||||
);
|
||||
dynamoDBDocClient.update(
|
||||
{
|
||||
TableName: 'TABLE_NAME',
|
||||
Key: {
|
||||
userId: 'abc123',
|
||||
email: 'abc123@abc123.com'
|
||||
},
|
||||
AttributeUpdates: {
|
||||
thingsWithWheels: {
|
||||
Action: 'PUT',
|
||||
Value: dynamoDBDocClient.createSet(
|
||||
[
|
||||
'SkateBoard',
|
||||
'Skates',
|
||||
'Mountain Bike',
|
||||
'Evolve Electric Skateboard'
|
||||
],
|
||||
{ validate: true }
|
||||
)
|
||||
},
|
||||
age: {
|
||||
Action: 'PUT',
|
||||
Value: 35
|
||||
}
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
}
|
||||
);
|
||||
dynamoDBDocClient.scan(
|
||||
{
|
||||
TableName: 'TABLE_NAME',
|
||||
KeyConditions: {
|
||||
age: {
|
||||
ComparisonOperator: 'EQ',
|
||||
AttributeValueList: [35]
|
||||
}
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
}
|
||||
);
|
||||
dynamoDBDocClient.query(
|
||||
{
|
||||
TableName: 'TABLE_NAME',
|
||||
KeyConditions: {
|
||||
userId: {
|
||||
ComparisonOperator: 'EQ',
|
||||
AttributeValueList: ['abc123']
|
||||
}
|
||||
}
|
||||
},
|
||||
function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
}
|
||||
);
|
||||
|
||||
var kinesis = new AWS.Kinesis();
|
||||
|
||||
var putRecordParam = {
|
||||
Data: new Buffer('...') || 'STRING_VALUE', /* required */
|
||||
PartitionKey: 'STRING_VALUE', /* required */
|
||||
StreamName: 'STRING_VALUE', /* required */
|
||||
ExplicitHashKey: 'STRING_VALUE',
|
||||
SequenceNumberForOrdering: 'STRING_VALUE'
|
||||
};
|
||||
kinesis.putRecord(putRecordParam, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
var putRecordParams = {
|
||||
Records: [ /* required */
|
||||
{
|
||||
Data: new Buffer('...') || 'STRING_VALUE', /* required */
|
||||
PartitionKey: 'STRING_VALUE', /* required */
|
||||
ExplicitHashKey: 'STRING_VALUE'
|
||||
},
|
||||
/* more items */
|
||||
],
|
||||
StreamName: 'STRING_VALUE' /* required */
|
||||
};
|
||||
kinesis.putRecords(putRecordParams, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
|
||||
var increaseStreamRetentionPeriodParams = {
|
||||
RetentionPeriodHours: 0, /* required */
|
||||
StreamName: 'STRING_VALUE' /* required */
|
||||
};
|
||||
kinesis.increaseStreamRetentionPeriod(increaseStreamRetentionPeriodParams, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
2606
types/aws-sdk/index.d.ts
vendored
2606
types/aws-sdk/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"aws-sdk-tests.ts"
|
||||
]
|
||||
}
|
||||
52
types/multer-s3/index.d.ts
vendored
52
types/multer-s3/index.d.ts
vendored
@ -3,32 +3,32 @@
|
||||
// Definitions by: KIM Jaesuck a.k.a. gim tcaesvk <http://github.com/tcaesvk/>
|
||||
// Definitions: https://github.com/DefinitelyType/DefinitelyTyped
|
||||
|
||||
/// <reference types="aws-sdk" />
|
||||
/// <reference types="multer" />
|
||||
import * as AWS from "aws-sdk";
|
||||
import { StorageEngine } from "multer";
|
||||
|
||||
declare module "multer-s3" {
|
||||
import * as AWS from "aws-sdk"
|
||||
|
||||
interface Options {
|
||||
s3: AWS.S3,
|
||||
bucket: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, bucket?: string) => void) => void) | string
|
||||
key?: (req: Express.Request, file: Express.Multer.File, callback: (error: any, key?: string) => void) => void
|
||||
acl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, acl?: string) => void) => void) | string
|
||||
contentType?: (req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void) => void
|
||||
metadata?: (req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: string) => void) => void
|
||||
cacheControl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, cacheControl?: string) => void) => void) | string
|
||||
}
|
||||
|
||||
import * as multer from "multer"
|
||||
|
||||
interface S3Storage {
|
||||
(options?: Options): multer.StorageEngine
|
||||
|
||||
AUTO_CONTENT_TYPE: (req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void) => void
|
||||
DEFAULT_CONTENT_TYPE: (req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string) => void) => void
|
||||
}
|
||||
|
||||
let s3Storage: S3Storage
|
||||
|
||||
export = s3Storage
|
||||
interface Options {
|
||||
s3: AWS.S3;
|
||||
bucket: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, bucket?: string) => void) => void) | string;
|
||||
key?(req: Express.Request, file: Express.Multer.File, callback: (error: any, key?: string) => void): void;
|
||||
acl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, acl?: string) => void) => void) | string;
|
||||
contentType?(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void;
|
||||
metadata?(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: string) => void): void;
|
||||
cacheControl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, cacheControl?: string) => void) => void) | string;
|
||||
}
|
||||
|
||||
interface S3Storage {
|
||||
(options?: Options): StorageEngine;
|
||||
|
||||
AUTO_CONTENT_TYPE(
|
||||
req: Express.Request,
|
||||
file: Express.Multer.File,
|
||||
callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void;
|
||||
DEFAULT_CONTENT_TYPE(
|
||||
req: Express.Request,
|
||||
file: Express.Multer.File,
|
||||
callback: (error: any, mime?: string) => void): void;
|
||||
}
|
||||
|
||||
declare const s3Storage: S3Storage;
|
||||
export = s3Storage;
|
||||
|
||||
@ -1,25 +1,18 @@
|
||||
"use strict";
|
||||
import AWS = require("aws-sdk");
|
||||
import multer = require("multer");
|
||||
import s3Storage = require("multer-s3");
|
||||
|
||||
let accessKeyId: string
|
||||
let secretAccessKey: string
|
||||
let region: string
|
||||
let bucket: string
|
||||
let accessKeyId: string;
|
||||
let secretAccessKey: string;
|
||||
let region: string;
|
||||
let bucket: string;
|
||||
|
||||
import AWS = require("aws-sdk")
|
||||
const s3 = new AWS.S3({ accessKeyId, secretAccessKey, region });
|
||||
|
||||
let s3 = new AWS.S3({
|
||||
accessKeyId: accessKeyId,
|
||||
secretAccessKey: secretAccessKey,
|
||||
region: region,
|
||||
})
|
||||
|
||||
import multer = require("multer")
|
||||
import s3Storage = require("multer-s3")
|
||||
|
||||
let s3Upload = multer({
|
||||
const s3Upload = multer({
|
||||
storage: s3Storage({
|
||||
s3: s3,
|
||||
bucket: bucket,
|
||||
s3,
|
||||
bucket,
|
||||
contentType: s3Storage.AUTO_CONTENT_TYPE,
|
||||
})
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
5
types/multer-s3/package.json
Normal file
5
types/multer-s3/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.37.0"
|
||||
}
|
||||
}
|
||||
1
types/multer-s3/tslint.json
Normal file
1
types/multer-s3/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
35
types/nodemailer-ses-transport/index.d.ts
vendored
35
types/nodemailer-ses-transport/index.d.ts
vendored
@ -3,24 +3,23 @@
|
||||
// Definitions by: Seth Westphal <https://github.com/westy92/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "nodemailer-ses-transport" {
|
||||
import * as AWS from 'aws-sdk';
|
||||
import * as nodemailer from "nodemailer";
|
||||
import * as AWS from "aws-sdk";
|
||||
import { HTTPOptions } from "aws-sdk/lib/config";
|
||||
import * as nodemailer from "nodemailer";
|
||||
|
||||
namespace sesTransport {
|
||||
export interface SesOptions {
|
||||
ses?: AWS.SES;
|
||||
accessKeyId?: string;
|
||||
secretAccessKey?: string;
|
||||
sessionToken?: string;
|
||||
region?: string;
|
||||
httpOptions?: AWS.HttpOptions;
|
||||
rateLimit?: number;
|
||||
maxConnections?: number;
|
||||
}
|
||||
declare namespace sesTransport {
|
||||
interface SesOptions {
|
||||
ses?: AWS.SES;
|
||||
accessKeyId?: string;
|
||||
secretAccessKey?: string;
|
||||
sessionToken?: string;
|
||||
region?: string;
|
||||
httpOptions?: HTTPOptions;
|
||||
rateLimit?: number;
|
||||
maxConnections?: number;
|
||||
}
|
||||
|
||||
function sesTransport(options: sesTransport.SesOptions): nodemailer.Transport;
|
||||
|
||||
export = sesTransport;
|
||||
}
|
||||
|
||||
declare function sesTransport(options: sesTransport.SesOptions): nodemailer.Transport;
|
||||
|
||||
export = sesTransport;
|
||||
|
||||
@ -2,16 +2,16 @@ import * as AWS from 'aws-sdk';
|
||||
import * as nodemailer from "nodemailer";
|
||||
import * as sesTransport from 'nodemailer-ses-transport';
|
||||
|
||||
var opts: sesTransport.SesOptions = {
|
||||
const opts: sesTransport.SesOptions = {
|
||||
ses: new AWS.SES(),
|
||||
rateLimit: 5,
|
||||
maxConnections: 3,
|
||||
};
|
||||
|
||||
var transport: nodemailer.Transport = sesTransport(opts);
|
||||
const transport: nodemailer.Transport = sesTransport(opts);
|
||||
|
||||
// setup e-mail data with unicode symbols
|
||||
var mailOptions: nodemailer.SendMailOptions = {
|
||||
const mailOptions: nodemailer.SendMailOptions = {
|
||||
from: 'Fred Foo ✔ <foo@blurdybloop.com>', // sender address
|
||||
to: 'bar@blurdybloop.com, baz@blurdybloop.com', // list of receivers
|
||||
subject: 'Hello ✔', // Subject line
|
||||
|
||||
5
types/nodemailer-ses-transport/package.json
Normal file
5
types/nodemailer-ses-transport/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.37.0"
|
||||
}
|
||||
}
|
||||
1
types/nodemailer-ses-transport/tslint.json
Normal file
1
types/nodemailer-ses-transport/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
7
types/s3-upload-stream/index.d.ts
vendored
7
types/s3-upload-stream/index.d.ts
vendored
@ -4,17 +4,16 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
/// <reference types="aws-sdk" />
|
||||
|
||||
import * as stream from 'stream';
|
||||
import * as AWS from 'aws-sdk';
|
||||
|
||||
declare namespace s3Stream {
|
||||
export interface S3StreamUploader {
|
||||
upload(destinationDetails: AWS.s3.PutObjectRequest, sessionDetails?: any): S3WriteStream;
|
||||
interface S3StreamUploader {
|
||||
upload(destinationDetails: AWS.S3.PutObjectRequest, sessionDetails?: any): S3WriteStream;
|
||||
}
|
||||
|
||||
export interface S3WriteStream extends stream.Writable {
|
||||
interface S3WriteStream extends stream.Writable {
|
||||
maxPartSize(sizeInBytes: number): void;
|
||||
concurrentParts(numberOfParts: number): void;
|
||||
}
|
||||
|
||||
5
types/s3-upload-stream/package.json
Normal file
5
types/s3-upload-stream/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.37.0"
|
||||
}
|
||||
}
|
||||
@ -2,10 +2,10 @@ import * as fs from 'fs';
|
||||
import * as S3Stream from 's3-upload-stream';
|
||||
import * as AWS from 'aws-sdk';
|
||||
|
||||
var s3Stream = S3Stream(new AWS.S3());
|
||||
const s3Stream = S3Stream(new AWS.S3());
|
||||
|
||||
var read = fs.createReadStream('/path/to/a/file');
|
||||
var upload = s3Stream.upload({
|
||||
const read = fs.createReadStream('/path/to/a/file');
|
||||
const upload = s3Stream.upload({
|
||||
Bucket: "bucket-name",
|
||||
Key: "key-name",
|
||||
ACL: "public-read",
|
||||
|
||||
1
types/s3-upload-stream/tslint.json
Normal file
1
types/s3-upload-stream/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
56
types/sqs-consumer/index.d.ts
vendored
56
types/sqs-consumer/index.d.ts
vendored
@ -3,41 +3,25 @@
|
||||
// Definitions by: Daniel Chao <http://dchao.co/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference types="aws-sdk"/>
|
||||
|
||||
declare module "sqs-consumer" {
|
||||
|
||||
import { SQS } from "aws-sdk";
|
||||
|
||||
module SQSConsumer {
|
||||
|
||||
interface MessageHandler {
|
||||
(message: SQS.Message, done: Function): any;
|
||||
}
|
||||
|
||||
interface ConsumerOpts {
|
||||
queueUrl: string;
|
||||
handleMessage: MessageHandler;
|
||||
region?: string;
|
||||
attributeNames?: string[];
|
||||
messageAttributeNames?: string[];
|
||||
batchSize?: number;
|
||||
visibilityTimeout?: number;
|
||||
waitTimeSeconds?: number;
|
||||
authenticationErrorTimeout?: number;
|
||||
sqs?: SQS;
|
||||
}
|
||||
|
||||
interface Consumer extends NodeJS.EventEmitter {
|
||||
start (): void;
|
||||
stop (): void;
|
||||
}
|
||||
|
||||
interface ConsumerFactory {
|
||||
create(opts: ConsumerOpts): Consumer;
|
||||
}
|
||||
}
|
||||
const Consumer: SQSConsumer.ConsumerFactory;
|
||||
export = Consumer;
|
||||
/// <reference types="node" />
|
||||
import { SQS } from "aws-sdk";
|
||||
|
||||
interface Options {
|
||||
queueUrl: string;
|
||||
handleMessage(message: SQS.Message, done: Function): any;
|
||||
region?: string;
|
||||
attributeNames?: string[];
|
||||
messageAttributeNames?: string[];
|
||||
batchSize?: number;
|
||||
visibilityTimeout?: number;
|
||||
waitTimeSeconds?: number;
|
||||
authenticationErrorTimeout?: number;
|
||||
sqs?: SQS;
|
||||
}
|
||||
|
||||
interface Consumer extends NodeJS.EventEmitter {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
export function create(opts: Options): Consumer;
|
||||
|
||||
5
types/sqs-consumer/package.json
Normal file
5
types/sqs-consumer/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.37.0"
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,16 @@
|
||||
import * as Consumer from "sqs-consumer";
|
||||
|
||||
var app = Consumer.create({
|
||||
const app = Consumer.create({
|
||||
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
|
||||
handleMessage: function (message, done) {
|
||||
handleMessage(message, done) {
|
||||
// do some work with `message`
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
var app2 = Consumer.create({
|
||||
const app2 = Consumer.create({
|
||||
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
|
||||
handleMessage: function(message, done){
|
||||
handleMessage(message, done) {
|
||||
done();
|
||||
},
|
||||
region: "us-west-1",
|
||||
@ -19,7 +19,7 @@ var app2 = Consumer.create({
|
||||
waitTimeSeconds: 50
|
||||
});
|
||||
|
||||
app.on('error', function (err: any) {
|
||||
app.on('error', (err: any) => {
|
||||
console.log(err.message);
|
||||
});
|
||||
|
||||
|
||||
6
types/sqs-consumer/tslint.json
Normal file
6
types/sqs-consumer/tslint.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../tslint.json",
|
||||
"rules": {
|
||||
"ban-types": false
|
||||
}
|
||||
}
|
||||
73
types/sqs-producer/index.d.ts
vendored
73
types/sqs-producer/index.d.ts
vendored
@ -3,49 +3,34 @@
|
||||
// Definitions by: Daniel Chao <http://dchao.co/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference types="aws-sdk"/>
|
||||
/// <reference types="node" />
|
||||
import { SQS } from "aws-sdk";
|
||||
|
||||
declare module "sqs-producer" {
|
||||
|
||||
import { SQS } from "aws-sdk";
|
||||
|
||||
module SQSProducer {
|
||||
|
||||
interface ProducerOpts {
|
||||
queueUrl: string;
|
||||
region?: string;
|
||||
batchSize?: number;
|
||||
sqs?: SQS;
|
||||
}
|
||||
|
||||
interface ProducerCallback<T> {
|
||||
(err?: Error, data?: T): any;
|
||||
}
|
||||
|
||||
interface ProducerMessageAttribute {
|
||||
DataType: "String"|"Binary";
|
||||
StringValue?: string;
|
||||
BinaryValue?: Buffer;
|
||||
}
|
||||
|
||||
interface ProducerMessage {
|
||||
id: string;
|
||||
body: string;
|
||||
messageAttributes?: { [key: string]: ProducerMessageAttribute }
|
||||
delaySeconds?: number;
|
||||
}
|
||||
|
||||
interface ProducerFactory {
|
||||
create(opts: ProducerOpts): Producer;
|
||||
}
|
||||
|
||||
interface Producer {
|
||||
send(messages: string[], cb: ProducerCallback<void>): void;
|
||||
send(messages: ProducerMessage[], cb: ProducerCallback<void>): void;
|
||||
queueSize(cb: ProducerCallback<number>): void;
|
||||
}
|
||||
}
|
||||
|
||||
const Producer: SQSProducer.ProducerFactory;
|
||||
export = Producer;
|
||||
interface Options {
|
||||
queueUrl: string;
|
||||
region?: string;
|
||||
batchSize?: number;
|
||||
sqs?: SQS;
|
||||
}
|
||||
|
||||
type ProducerCallback<T> = (err?: Error, data?: T) => any;
|
||||
|
||||
interface ProducerMessageAttribute {
|
||||
DataType: "String" | "Binary";
|
||||
StringValue?: string;
|
||||
BinaryValue?: Buffer;
|
||||
}
|
||||
|
||||
interface ProducerMessage {
|
||||
id: string;
|
||||
body: string;
|
||||
messageAttributes?: { [key: string]: ProducerMessageAttribute };
|
||||
delaySeconds?: number;
|
||||
}
|
||||
|
||||
interface Producer {
|
||||
send(messages: string[] | ProducerMessage[], cb: ProducerCallback<void>): void;
|
||||
queueSize(cb: ProducerCallback<number>): void;
|
||||
}
|
||||
|
||||
export function create(opts: Options): Producer;
|
||||
|
||||
5
types/sqs-producer/package.json
Normal file
5
types/sqs-producer/package.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"sqs-producer": "^1.5.0"
|
||||
}
|
||||
}
|
||||
@ -2,18 +2,18 @@
|
||||
|
||||
import * as Producer from "sqs-producer";
|
||||
|
||||
var producer = Producer.create({
|
||||
const producer = Producer.create({
|
||||
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
|
||||
region: 'eu-west-1'
|
||||
});
|
||||
|
||||
// send messages to the queue
|
||||
producer.send(['msg1', 'msg2'], function(err) {
|
||||
producer.send(['msg1', 'msg2'], err => {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
// get the current size of the queue
|
||||
producer.queueSize(function (err, size) {
|
||||
producer.queueSize((err, size) => {
|
||||
if (err) console.log(err);
|
||||
|
||||
console.log('There are', size, 'messages on the queue.');
|
||||
@ -23,7 +23,7 @@ producer.queueSize(function (err, size) {
|
||||
producer.send([{
|
||||
id: 'id1',
|
||||
body: 'Hello world'
|
||||
}], function(err) {
|
||||
}], err => {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
@ -44,6 +44,6 @@ producer.send([
|
||||
body: 'Hello world delayed by 5 seconds',
|
||||
delaySeconds: 5
|
||||
}
|
||||
], function(err) {
|
||||
], err => {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
1
types/sqs-producer/tslint.json
Normal file
1
types/sqs-producer/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Loading…
Reference in New Issue
Block a user