1.6.1 • Published 3 years ago

@devapi/kubik v1.6.1

Weekly downloads
37
License
MIT
Repository
github
Last release
3 years ago

Kubik, the devapi SDK

Features

  • Function to measure the duration of a lambda routine
  • Convert a connector into an SDK.

Examples

Measure the duration of a lambda routine

const { start, finish } = require('kubik')

module.exports.handler = async event => {
  await start()

  // My routine here

  finish()
}

Result:

{
  name: 'Function Duration Time',
  entryType: 'measure',
  startTime: 32.440612,
  duration: 3693.332339
}

Convert a connector into an SDK (beta)

Using the ID of a Automation

const { Kubik, start, finish, setAutomation } = require('./')

module.exports.handler = async event => {
  await start()

  setAutomation('token-12345')

  const kubik = new Kubik({
    user_token: 'id_123'
  })

  const AUTH = 'Bearer dCcrvv4t3Ug05zz-gO34PCt5JBBoSeSdK03_'

  const created_user = await kubik.CONNECTOR.GOREST.users.createUser({
    authorization: AUTH,
    email: 'email@teste2.com',
    first_name: 'first name',
    gender: 'male',
    last_name: 'last name',
    status: 'active'
  })

  console.log(JSON.stringify(created_user, null, 4))

  finish()
}

this.handler()

Result:

{
    "status": 200,
    "data": {
        "_meta": {
            "success": true,
            "code": 200,
            "message": "OK. Everything worked as expected.",
            "rateLimit": {
                "limit": 30,
                "remaining": 29,
                "reset": 2
            }
        },
        "result": {
            "id": "2510",
            "first_name": "first name",
            "last_name": "last name",
            "gender": "male",
            "dob": null,
            "email": "email@teste2.com",
            "phone": null,
            "website": null,
            "address": null,
            "status": "active",
            "_links": {
                "self": {
                    "href": "https://gorest.co.in/public-api/users/2510"
                },
                "edit": {
                    "href": "https://gorest.co.in/public-api/users/2510"
                },
                "avatar": {
                    "href": null
                }
            }
        }
    }
}
1.6.1

3 years ago

1.6.0

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.8

4 years ago

1.1.5

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago