API Docs for:
Show:

LoopbackPromised Class

LoopbackPromised

Methods

createClient

(
  • pluralModelName
  • [options]
)
LoopbackClient

creates client for Loopback

Parameters:

  • pluralModelName String
  • [options] Object optional
    • [belongsTo] Object optional

      key: pluralModelName (the "one" side of one-to-many relation), value: id

    • [isUserModel] Boolean optional

      true if user model

    • [accessToken] String optional

      Access Token

    • [debug] Boolean optional

      shows debug log if true

Returns:

createInstance

(
  • lbPromisedInfo
)
LoopbackPromised static

creates an instance

Parameters:

  • lbPromisedInfo LoopbackPromised | Object
    • baseURL String

      base URL of Loopback

    • [logger] Object optional

      logger with info(), warn(), error(), trace().

    • [version] String optional

      version of Loopback API to access

Returns:

createPushManager

(
  • [clientInfo]
)
PushManager public

creates push manager

Parameters:

  • [clientInfo] Object optional
    • [accessToken] String optional

      Access Token

    • [debug] Boolean optional

      shows debug log if true

Returns:

createRelatedClient

(
  • options
)
LoopbackClient

creates related client (one-to-many relation)

Parameters:

  • options Object
    • one String

      the "one" side plural model of one-to-many relationship

    • many String

      the "many" side plural model of one-to-many relationship

    • id Any

      the id of the "one" model

    • [accessToken] String optional

      Access Token

    • [debug] Boolean optional

      shows debug log if true

Returns:

createUserClient

(
  • pluralModelName
  • [clientInfo]
)
LoopbackClient

creates user client for Loopback

Parameters:

  • pluralModelName String
  • [clientInfo] Object optional
    • [accessToken] String optional

      Access Token

    • [debug] Boolean optional

      shows debug log if true

Returns:

isDebugMode

(
  • debug
)
Boolean private static

check environment variable concerning debug

Parameters:

  • debug Boolean

Returns:

Boolean:

shows debug log or not

request

(
  • pluralModelName
  • path
  • params
  • http_method
  • [clientInfo]
)
Promise(Object)

sends request to Loopback

Parameters:

  • pluralModelName String
  • path String
  • params Object

    request parameters

  • http_method String

    {GET|POST|PUT|DELETE|HEAD}

  • [clientInfo] LoopbackClient | Object optional
    • [accessToken] String optional

      Access Token

    • [debug] Boolean optional

      shows debug log if true

Returns:

Promise(Object):

requestStatic

(
  • endpoint
  • [params]
  • http_method
  • [clientInfo]
  • lbPromisedInfo
)
Promise(Object) static

calls rest api directly

Parameters:

  • endpoint String
  • [params] Object optional
  • http_method String

    {GET|POST|PUT|DELETE|HEAD}

  • [clientInfo] LoopbackClient | Object optional
    • [accessToken] String optional

      Access Token

    • [debug] Boolean optional

      shows debug log if true

  • lbPromisedInfo LoopbackPromised | Object
    • baseURL String

      base URL of Loopback

    • [version] String optional

      version of Loopback API to access

    • [logger] Object optional

      logger with info(), warn(), error(), trace().

Returns:

Promise(Object):