go_core_query

0.1.0 • Public • Published

ccs.go_core_query

The package allows you to connect to the GoCore core via socket or regular http (s) requests. Works in various environments where there is javascript.

Installation

npm i go_core_query --save

Usage

Example

const params = {
    host,
    port,
    path: '',
    https,
    useUUID: true,
    useUUIDAskAgreeFn: (cb) => {
        // Так как на данном этапе мы не можем сделать красивый рендеринг, то здесь запрещаем использование UUID
        // Позже (в Main.js) мы реализуем свою логику и обновим состояние
        // через goCoreAPIInstance?.setUUIDAgree(isAcccept) и другие методы (setUUIDIgnoreAgree)
        cb(false)
    },
    autoAuth: false,
    login:'',
    password:'',
    debug: true,
    debugFull: false,
    afterInitConnect: (socket_) => {
        socket = socket_

        deliverySocket = new Delivery(socket)
        if (!console.logServer && socket){
            console.logServer = (...data)=>{
                socket.emit('logFromClient', data)
            }

            window.onerror = function(message, url, line, col, error) {

                if (!url.includes(serverParams.url)) return

                if (typeof logD === 'function') logD('onerror', message, line, col, error)
                console.error(message, error)
                useLogError({
                    message, line, col, error
                })
            };
        }
    }
}


const goCoreQueryObj = initGoCoreQuery(params)
goCoreQuery = goCoreQueryObj.api
goCoreAPIInstance = goCoreQueryObj.instance

window.goCoreQueryObj = goCoreQueryObj
window.api = goCoreQuery
window.goCoreAPIInstance = goCoreQuery

Contributing

Complex Cloud Solutions LLC

License

ISC

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.0134latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.0134
0.0.720
0.0.710
0.0.700
0.0.690
0.0.680
0.0.670
0.0.660
0.0.650
0.0.640
0.0.620
0.0.610
0.0.600
0.0.592
0.0.580
0.0.570
0.0.560
0.0.551
0.0.540
0.0.530
0.0.520
0.0.510
0.0.500
0.0.490
0.0.480
0.0.470
0.0.460
0.0.451
0.0.440
0.0.430
0.0.421
0.0.410
0.0.400
0.0.390
0.0.380
0.0.370
0.0.360
0.0.350
0.0.340
0.0.330
0.0.320
0.0.310
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.177
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i go_core_query

Homepage

go-core.ru/

Weekly Downloads

88

Version

0.1.0

License

ISC

Unpacked Size

2.61 MB

Total Files

26

Last publish

Collaborators

  • ccsmskru