@aws-amplify/storage

  • Version 4.1.0
  • Published
  • 8.99 MB
  • 8 dependencies
  • Apache-2.0 license

Install

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

Overview

Storage category of aws-amplify

Index

Variables

variable Storage

const Storage: StorageClass;

    Classes

    class AWSS3Provider

    class AWSS3Provider implements StorageProvider {}
    • Provide storage methods to use AWS S3

    constructor

    constructor(config?: StorageOptions);
    • Initialize Storage with AWS configurations

      Parameter config

      Configuration object for storage

    property CATEGORY

    static CATEGORY: string;

      property PROVIDER_NAME

      static PROVIDER_NAME: string;

        method configure

        configure: (config?: any) => object;
        • Configure Storage part with aws configuration

          Parameter config

          Configuration of the Storage {Object} - Current configuration

        method get

        get: (key: string, config?: any) => Promise<string | Object>;
        • Get a presigned URL of the file or the object data when download:true

          Parameter key

          key of the object

          Parameter config

          - A promise resolves to Amazon S3 presigned URL on success

        method getCategory

        getCategory: () => string;
        • get the category of the plugin

        method getProviderName

        getProviderName: () => string;
        • get provider name of the plugin

        method list

        list: (path: any, config?: any) => Promise<any>;
        • List bucket objects relative to the level and prefix specified

          Parameter path

          the path that contains objects

          Parameter config

          - Promise resolves to list of keys for all objects in path

        method put

        put: (key: string, object: any, config?: any) => Promise<Object>;
        • Put a file in S3 bucket specified to configure method

          Parameter key

          key of the object

          Parameter object

          File to be put in Amazon S3 bucket

          Parameter config

          - promise resolves to object on success

        method remove

        remove: (key: string, config?: any) => Promise<any>;
        • Remove the object for specified key

          Parameter key

          key of the object

          Parameter config

          - Promise resolves upon successful removal of the object

        class StorageClass

        class Storage {}
        • Provide storage methods to use AWS S3

        constructor

        constructor();
        • Initialize Storage

          Parameter config

          Configuration object for storage

        property vault

        vault: Storage;
        • Modifiers

          • @public

        method addPluggable

        addPluggable: (pluggable: StorageProvider) => {};
        • add plugin into Storage category

          Parameter pluggable

          an instance of the plugin

        method cancel

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

          Parameter request

          The request to cancel

          Parameter message

          A message to include in the cancelation exception

        method configure

        configure: (config?: any) => any;
        • Configure Storage

          Parameter config

          Configuration object for storage {Object} - Current configuration

        method get

        get: (key: string, config?: any) => Promise<String | Object>;
        • Get a presigned URL of the file or the object data when download:true

          Parameter key

          key of the object

          Parameter config

          - A promise resolves to either a presigned url or the object

        method getModuleName

        getModuleName: () => string;

          method getPluggable

          getPluggable: (providerName: string) => StorageProvider;
          • Get the plugin object

            Parameter providerName

            the name of the plugin

          method isCancelError

          isCancelError: (error: any) => boolean;

            method list

            list: (path: any, config?: any) => Promise<any>;
            • List bucket objects relative to the level and prefix specified

              Parameter path

              the path that contains objects

              Parameter config

              - Promise resolves to list of keys for all objects in path

            method put

            put: (key: string, object: any, config?: any) => Promise<Object>;
            • Put a file in storage bucket specified to configure method

              Parameter key

              key of the object

              Parameter object

              File to be put in bucket

              Parameter config

              - promise resolves to object on success

            method remove

            remove: (key: string, config?: any) => Promise<any>;
            • Remove the object for specified key

              Parameter key

              key of the object

              Parameter config

              - Promise resolves upon successful removal of the object

            method removePluggable

            removePluggable: (providerName: string) => void;
            • Remove the plugin object

              Parameter providerName

              the name of the plugin

            Interfaces

            interface StorageOptions

            interface StorageOptions {}
            • Storage instance options

            property bucket

            bucket?: string;

              property credentials

              credentials?: object;

                property level

                level?: string;

                  property region

                  region?: string;

                    interface StorageProvider

                    interface StorageProvider {}

                      method cancel

                      cancel: (request: Promise<any>) => void;

                        method configure

                        configure: (config: object) => object;

                          method get

                          get: (key: string, options?: any) => Promise<string | Object>;

                            method getCategory

                            getCategory: () => string;

                              method getProviderName

                              getProviderName: () => string;

                                method list

                                list: (path: any, options?: any) => Promise<any>;

                                  method put

                                  put: (key: string, object: any, options?: any) => Promise<Object>;

                                    method remove

                                    remove: (key: string, options?: any) => Promise<any>;

                                      Package Files (5)

                                      Dependencies (8)

                                      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/storage.

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