0.0.15 • Published 2 months ago

direcbase v0.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Direcbase client in Javascript

Setup

Install direcbase via npm in Node.js

npm i direcbase

Usage

DirecAuth - user authentication APIs

Import authentication module

import {direcauth as auth} from 'direcbase'

Login by using email and password

const result = await auth.login({
            "email": email,
            "password": password
        })

Logout

const result = await auth.logout()

Validate token if it was expired or invalidated

const result = await auth.validate()

DirecStore - data query APIs

The data query APIs are chained methods which represent similarly to SQL query syntax Import data query module

import {direcstore as ds} from 'direcbase'

Select query

const result = await ds.select().from('table_name')
    .where('field_name', 'operator', 'value')
    .orderBy('field_name', 'ASC')
    .limit(10)
    .offset(5)
    .onChange((data) => {   
        // data changes handling logic here
    })                         

onChange method is applied for the purpose of listening to data changes in reatime

Insert query

let entry = {
    // ... key-value pairs go here
}
const result = await ds.insert(entry).into('table_name')

Update query

let recordKey = 'abc'
let updateData = {
    // ... key-value pairs go here
}
const result = await ds.update(recordKey).into('table_name').set(updateData)

Delete query

let recordKey = 'abc'
const result = await ds.delete(recordKey).from('table_name')

DirecAdmin - system admin APIs

Import admin module

import { direcadmin as da} from 'direcbase';

List of methods

  • Model admin methods
    • editModel: create or delete a data model (table/view definition)
    • editRules: edit data access rules select/insert/edit/delete for each data model
    • deleteModel: delete a data model
  • User admin methods
    • createUser: create user
    • editUser: edit user data
    • deleteUser: delete user
    • resetUserPwd: reset user password
  • System admin methods
    • getMetrics: get system statistics
    • getEnv: get environment parameters
    • setEnv: set environment parameters

DirecFile - file storage APIs

Coming soon

0.0.15

2 months ago

0.0.11

8 months ago

0.0.12

8 months ago

0.0.13

8 months ago

0.0.14

8 months ago

0.0.10

10 months ago

0.0.9-alpha

12 months ago

0.0.9-beta

12 months ago

0.0.9

12 months ago

0.0.8-beta

1 year ago

0.0.6-alpha

1 year ago

0.0.7-alpha

1 year ago

0.0.5

1 year ago

0.0.8-alpha

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago