Версия:

How to Develop

In the sub-sections, you can find detailed information on everything you need. In addition to the applied articles in this section, please refer to other sections of this documentation for a better understanding of the operation principles, existing mechanisms, and accepted conventions.

Useful Information

Below are points that also appear in other documentation articles but might be useful to you right now:

Monitoring the client-side exchange with the server.

To display the exchange of requests via the api function (formerly socketQuery) in the browser console (DevTools), you need to call the following function in the console once:

debug()
// Will output: 'debug mode ON'

After that, reload the page. The mode is saved in cookies.

The console output for a single method consists of two groups:

Example ➢ User ➢ get_me

{
    "command": "get_me",
    "object": "User",
    "params": {
        "getRoles": false
    }
}

Response received ➢ User ➢ get_me

// Object with request (duplicated because the outgoing object (light green) might have been lost above, as there can be many requests and they are independent).
{
    "command": "get_me",
    "object": "User",
    "params": {
        "getRoles": false
    }
}
// Object with response
{
    "time": 3,
    "start": 1773213403269,
    "toastr": {
        "type": "success",
        "message": "noToastr",
        "title": "Ok"
    },
    "data": {
        "user": {
            "id": 1,
            "firstname": "Ivan",
            ...
        },
        "message_en": "noToastr"
    },
    "errName": "noToastr",
    "type": "success",
    "code": 0,
    "msg": "noToastr",
}

For details on connecting the client to the server, see the API and go_core_query section.

Calling methods from the console

In the interface built into the core, api is available as a global variable, and therefore it can be used directly from the browser console (DevTools). To ensure the request is authorized, first log in to the interface. After that, the authorization header will be attached automatically when the socket connection is established. Example of use:

api({
    command: 'getMe',
    object: 'User'
})