OpenVeo Core server

API Docs for: 7.0.0
Show:

ClientProvider

Extends EntityProvider
Module: core-providers

Summary

Defines a ClientProvider to get and save Web Service client applications.

Constructor

ClientProvider

Syntax

ClientProvider

(
  • database
)

Summary

Parameters:

  • database Database

    The database storing the clients

Item Index

Methods

add

Syntax

add

(
  • clients
  • [callback]
)
async

Summary

Adds Web Service client applications.

When adding a client a secret is automatically generated.

Parameters:

  • clients Array

    The list of clients to store with for each client:

    • String name The client name
    • String [id] The client id, generated if not specified
    • Array [scopes] The client scopes
  • [callback] Function optional

    The function to call when it's done

    • Error The error if an error occurred, null otherwise
    • Number The total amount of clients inserted
    • Array The list of added clients

createIndexes

Syntax

createIndexes

(
  • callback
)
async

Summary

Creates clients indexes.

Parameters:

  • callback Function

    Function to call when it's done with :

    • Error An error if something went wrong, null otherwise

updateOne

Syntax

updateOne

(
  • [filter]
  • data
  • [callback]
)
async

Summary

Updates a client.

Parameters:

  • [filter] ResourceFilter optional

    Rules to filter client to update

  • data Object

    The modifications to perform

    • [name] String optional

      The client name

    • [scopes] Array optional

      The client scopes

  • [callback] Function optional

    The function to call when it's done

    • Error The error if an error occurred, null otherwise
    • Number 1 if everything went fine