@cumulusds/flow-aws-sdk

2.818.4 • Public • Published

aws-sdk libdef

Flow libdef for aws-sdk. The version of this package matches the equivalent aws-sdk version. The types are generated from typescript using flowgen.

To use, add the follow the following lines to the libs section of .flowconfig:

[libs]
node_modules/@cumulusds/flow-aws-sdk/index.js
node_modules/@cumulusds/flow-aws-sdk/clients
node_modules/@cumulusds/flow-aws-sdk/lib

The libdef defines the "aws-sdk" module, exporting several client APIs.

import { Lambda } from "aws-sdk";

function(lambda: Lambda) {
  // $FlowExpectedError[incompatible-call] FunctionName is missing in object literal but exists in Lambda$InvocationRequest.
  lambda.invoke({});
}

The libdef adds name-mangled supporting types (inputs and outputs of APIs) to the global namespace. For example the result of Lambda#invoke is Lambda$InvocationResponse:

// @flow

import { Lambda } from "aws-sdk";

const lambda = new Lambda();

function invokeLambda(message: string, lambdaFunctionName: string): Promise<Lambda$InvocationResponse> {
   return lambda
           .invoke({
              InvocationType: "Event",
              Payload: message,
              FunctionName: lambdaFunctionName,
              LogType: "Tail"
           })
           .promise();
}

The libdef is compatible with flow-bin less than 0.143. In 0.143, import statements are no longer allowed at the toplevel of library files. The flowgen utility needs to be reworked to meet the new requirement.

Use build/upgrade.sh to rebuild this libdef with a new version of aws-sdk.

/@cumulusds/flow-aws-sdk/

    Package Sidebar

    Install

    npm i @cumulusds/flow-aws-sdk

    Weekly Downloads

    220

    Version

    2.818.4

    License

    UNLICENSED

    Unpacked Size

    28.7 MB

    Total Files

    312

    Last publish

    Collaborators

    • coleduval
    • massfordscumulus
    • prabu_2610
    • hadarg
    • joshuanapoli
    • only1chi
    • shirshaksharma
    • birdie697
    • dsumiskum
    • jeffsays
    • payalzanwar
    • omershatil