• Version 4.0.4
  • Published
  • 20 kB
  • No dependencies
  • MIT license


npm i @ovh-api/common
yarn add @ovh-api/common
pnpm add @ovh-api/common


Common class used to enable Ovh Api new calls Syntax



function buildOvhProxy

buildOvhProxy: (ovhEngine: OvhRequestable, path: string) => any;
  • Build Ovh API 2.0 Proxy

    Parameter ovhEngine

    Parameter path


interface ICacheOptions

interface ICacheOptions {}
  • params to configure cache

property count

count?: number;
  • max number of entry in your cache

property silotClass

silotClass?: SlotConstructor;
  • explicite silot construtor used to overwrite in memory default silotCache

property size

size?: number;
  • max memmory used to store your cache

property ttl

ttl?: number;
  • Time to live in second

interface ICacheSilot

interface ICacheSilot {}
  • Public interface of a silot you can have one silot per Ovh API call

property options

options: ICacheOptions;

    method discard

    discard: (path: string) => Promise<boolean>;

      method flush

      flush: () => Promise<void>;

        method get

        get: (path: string) => Promise<any | undefined>;

          method store

          store: (path: string, value: any, size: number) => Promise<boolean>;

            interface OvhRequestable

            interface OvhRequestable {}
            • common interface used to call ovh engine

            method cache

            cache: (template: string, param: ICacheOptions | CacheAction) => Promise<any>;
            • cache controle

            method doRequest

            doRequest: (
            httpMethod: string,
            path: string,
            pathTemplate: string,
            params?: any
            ) => Promise<any>;
            • Execute a request on the API with promise

              Parameter httpMethod

              : The HTTP method GET POST PUT DELETE

              Parameter path

              : The request final path

              Parameter pathTemplate

              : The request path with {pathParams}

              Parameter params

              : The request parameters (passed as query string or body params)

            Type Aliases

            type CacheAction

            type CacheAction = 'flush' | 'disable' | string;
            • 'flush' and 'disable' are the main action, other can be add later

            type OvhParamType

            type OvhParamType = {
            [key: string]: any;
            • all type that should be sent as parameter to Ovh calls

            type SlotConstructor

            type SlotConstructor = new (template: string, options: ICacheOptions) => ICacheSilot;
            • constructor for a silot cache

            Package Files (1)

            Dependencies (0)

            No dependencies.

            Dev Dependencies (1)

            Peer Dependencies (0)

            No peer dependencies.


            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/@ovh-api/common.

            • Markdown
            • HTML
              <a href="https://www.jsdocs.io/package/@ovh-api/common"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>