Home Reference Source

References

config

summary
public

F seed(): Boolean | Promise

This function will seed an admin user if asked by setting the ADMIN_USER variable to true It will check if the user exists and create it if not

public

V api: {"port": *, "host": *, "secret": *}

API Options

public

V database: {"uri": *, "options": *}

Database uri and options

public

V log: {"level": *, "name": *}

Bunyan logger options

controllers

summary
public

F authenticate(request: Object , reply: Function ): Promise

This function is a wrapper, choosing the right function to authenticate to the API, depending on the grant type

public

F createClient(request: Object , reply: Function ): Promise

This function creates a new client

public

F deleteClient(request: Object , reply: Function ): Promise

This function deletes a given client

public

F detailClient(request: Object , reply: Function ): Promise

This function serves details about a client

public

F listClients(request: Object , reply: Function ): Promise

This function lists the clients

public

F updateClient(request: Object , reply: Function ): Promise

This function update a given client

public

F exporterClientProjects(request: Object , reply: Function ): Promise

This function exports some projects' locale, using the provided type and locale code

public

F exporterProject(request: Object , reply: Function ): Promise

This function exports a project's locale, using the provided type and locale code

public

F exporterProjects(request: Object , reply: Function ): Promise

This function exports some projects' locale, using the provided type and locale code

public

F listExporters(request: Object , reply: Function ): Promise

This function exports the accepted export type

public

F addKeys(request: Object , reply: Function ): Promise

This function add new keys to the project

public

F deleteKeys(request: Object , reply: Function ): Promise

This function deletes the given project's keys

public

F getKeys(request: Object , reply: Function ): Promise

This function retrieves the project's keys

public

F updateKeys(request: Object , reply: Function ): Promise

This function updates the given project's keys

public

F addLocale(request: Object , reply: Function ): Promise

This function add a new locale to the project

public

F deleteLocale(request: Object , reply: Function ): Promise

This function removes the given locale from the project

public

F getLocales(request: Object , reply: Function ): Promise

This function lists all the project's locales

public

F updateLocale(request: Object , reply: Function ): Promise

This function add key's translation to the given locale

public

F updateLocales(request: Object , reply: Function ): Promise

This function add key's translation to the given locale

public

F healthCheck(request: Object , reply: Function ): Promise

This function is an health check, it simply responds OK when requested

public

F createProject(request: Object , reply: Function ): Promise

This function creates a new project, assigning the user creating it to ownership

public

F deleteProject(request: Object , reply: Function ): Promise

This function is used to delete a project

public

F detailProject(request: Object , reply: Function ): Promise

This function returns the project's details

public

F listProjects(request: Object , reply: Function ): Promise

This function lists the projects :

  • If admin, it lists all the projects
  • If user, it lists the user's projects
public

F updateProject(request: Object , reply: Function ): Promise

This function update the given project

public

F addClient(request: Object , reply: Function ): Promise

This function add a new client to the project

public

F deleteClient(request: Object , reply: Function ): Promise

This function removes a client from a project

public

F getClients(request: Object , reply: Function ): Promise

This function lists the project's clients

public

F addUser(request: Object , reply: Function ): Promise

This function add a new user to the project

public

F deleteUser(request: Object , reply: Function ): Promise

This function removes a user from a project

public

F getUsers(request: Object , reply: Function ): Promise

This function lists the project's user

public

F roleProject(request: Object , reply: Function ): Promise

This function gets a user role for a project

public

F updateUser(request: Object , reply: Function ): Promise

This function update a user role to a project

public

F createUser(request: Object , reply: Function ): Promise

This function creates a new user

public

F deleteUser(request: Object , reply: Function ): Promise

This function deletes a given user

public

F detailMe(request: Object , reply: Function ): Promise

This function serves details about the logged user

public

F detailUser(request: Object , reply: Function ): Promise

This function serves details about a user

public

F listUsers(request: Object , reply: Function ): Promise

This function lists the users

public

F updateUser(request: Object , reply: Function ): Promise

This function update a given user

database

summary
public

F index(): Promise

This function connects to the dabase

exporter

summary
public

F android(keys: Array , pKeys: Array ): String

This function exports a locale's keys in android XML format

public

F apple(keys: Array , pKeys: Array ): String

This function exports a locale's keys in apple format

public

F csv(keys: Array , pKeys: Array ): String

This function exports a locale's keys in CSV format

public

F flatjson(keys: Array , pKeys: Array ): String

This function exports a locale's keys in flat json format, meaning that a key some.key will be some.key

public

F getContentType(type: String ): String

Return the content type to use for the given export type

public

F json(keys: Array , pKeys: Array ): String

This function exports a locale's keys in json format, meaning that a key some.key will be in an object some with a key key

public

F yaml(keys: Array , pKeys: Array ): String

This function exports a locale's keys in YAML format

helpers

summary
public

F clientQuery(_id: String , user: Object ): Object

This function is used to create a query for a given user to a given client

public

F clientsListQuery(user: Object , id: String ): Object

This function is used to create a query for a given user to retrieve clients

public

F projectsListQuery(user: Object , isEditor: Boolean ): Object

This function is used to create a query for a given user to retrieve projects

public

F projectsListQueryWithClient(user: Object , _id: String ): Object

This function is used to create a query for a given user to retrieve projects

public

F validateUser(decoded: Object , request: Object , callback: Function ): Void

This function will validate a decoded token by fetching the database for the user or the client

routes

summary
public

F authRoutes(server: Object , options: Object , next: Function ): Promise

This function registers the server's routes for user authentication

public

F clientRoutes(server: Object , options: Object , next: Function ): Promise

This function registers the server's routes for client

public

F exportRoutes(server: Object , options: Object , next: Function ): Promise

This function registers the server's routes for export operations

public

F index(server: Object ): Promise

This function registers the server's routes

public

F miscRoutes(server: Object , options: Object , next: Function ): Promise

This function registers the server's routes for misc operations

public

F projectRoutes(server: Object , options: Object , next: Function ): Promise

This function registers the server's routes for project

public

F userRoutes(server: Object , options: Object , next: Function ): Promise

This function registers the server's routes for user

server

summary
public

F index(): Promise

This functions loads the server's plugins and registers the strategy for authentication