@aws-amplify/api

  • Version 4.0.1
  • Published
  • 1.94 MB
  • 2 dependencies
  • Apache-2.0 license

Install

npm i @aws-amplify/api
yarn add @aws-amplify/api
pnpm add @aws-amplify/api

Overview

Api category of aws-amplify

Index

Variables

variable API

const API: APIClass;

    Classes

    class APIClass

    class APIClass {}
    • Deprecated

      Use RestApi or GraphQLAPI to reduce your application bundle size Export Cloud Logic APIs

    constructor

    constructor(options: any);
    • Initialize API with AWS configuration

      Parameter options

      Configuration object for API

    property Auth

    Auth: any;

      property Cache

      Cache: any;

        property Credentials

        Credentials: any;

          method cancel

          cancel: (request: Promise<any>, message?: string) => boolean;
          • Cancels an inflight request

            Parameter request

            request to cancel {boolean} - A boolean indicating if the request was cancelled

          method configure

          configure: (options: any) => any;
          • Configure API part with aws configurations

            Parameter config

            Configuration of the API {Object} - The current configuration

          method del

          del: (apiName: any, path: any, init: any) => Promise<any>;
          • Make a DEL request

            Parameter apiName

            The api name of the request

            Parameter path

            The path of the request

            Parameter init

            Request extra params {Promise} - A promise that resolves to an object with response status and JSON data, if successful.

          method endpoint

          endpoint: (apiName: any) => Promise<string>;
          • Getting endpoint for API

            Parameter apiName

            The name of the api {string} - The endpoint of the api

          method get

          get: (apiName: any, path: any, init: any) => Promise<any>;
          • Make a GET request

            Parameter apiName

            The api name of the request

            Parameter path

            The path of the request

            Parameter init

            Request extra params {Promise} - A promise that resolves to an object with response status and JSON data, if successful.

          method getGraphqlOperationType

          getGraphqlOperationType: (operation: any) => any;
          • to get the operation type

            Parameter operation

          method getModuleName

          getModuleName: () => string;

            method graphql

            graphql: (
            options: any,
            additionalHeaders?: { [key: string]: string }
            ) => Promise<GraphQLResult> | Observable<object>;
            • Executes a GraphQL operation

              Parameter GraphQL

              Options

              Parameter additionalHeaders

              headers to merge in after any graphql_headers set in the config

              Returns

              {Promise | Observable}

            method head

            head: (apiName: any, path: any, init: any) => Promise<any>;
            • Make a HEAD request

              Parameter apiName

              The api name of the request

              Parameter path

              The path of the request

              Parameter init

              Request extra params {Promise} - A promise that resolves to an object with response status and JSON data, if successful.

            method isCancel

            isCancel: (error: any) => boolean;
            • Checks to see if an error thrown is from an api request cancellation

              Parameter error

              Any error {boolean} - A boolean indicating if the error was from an api request cancellation

            method patch

            patch: (apiName: any, path: any, init: any) => Promise<any>;
            • Make a PATCH request

              Parameter apiName

              The api name of the request

              Parameter path

              The path of the request

              Parameter init

              Request extra params {Promise} - A promise that resolves to an object with response status and JSON data, if successful.

            method post

            post: (apiName: any, path: any, init: any) => Promise<any>;
            • Make a POST request

              Parameter apiName

              The api name of the request

              Parameter path

              The path of the request

              Parameter init

              Request extra params {Promise} - A promise that resolves to an object with response status and JSON data, if successful.

            method put

            put: (apiName: any, path: any, init: any) => Promise<any>;
            • Make a PUT request

              Parameter apiName

              The api name of the request

              Parameter path

              The path of the request

              Parameter init

              Request extra params {Promise} - A promise that resolves to an object with response status and JSON data, if successful.

            Package Files (2)

            Dependencies (2)

            Dev Dependencies (1)

            Peer Dependencies (0)

            No peer dependencies.

            Badge

            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-amplify/api.

            • Markdown
              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@aws-amplify/api)
            • HTML
              <a href="https://www.jsdocs.io/package/@aws-amplify/api"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>