0.3.1 • Published 1 year ago

@winm2m/argos-api v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@winm2m/argos-api

Description

An API for the Argos project, and also could be used as a library as general CRUD purposes.

Installation

npm install --save @winm2m/argos-api

Usage

const { API } = require('@winm2m/argos-api')

const API_PREFIX = 'https://wherever.you.host'
const API_VERSION = '0.3.1' // current version of this package

const api = new API(API_PREFIX, API_VERSION)

var result

// login
result = await api.login({ email: 'admin', password: 'admin' })
const token = result.token

// upsert ( insert or update )
result = await api.upsert({
  entity: 'sample',
  body: {
    name: 'sample',
    description: 'sample'
  }
})
console.log(`id of new content : ${result.id}`)

// find
const results = await api.find({
  entity: 'sample',
  contains: {
    name: 'sample'
  }
})

// delete
result = await api.delete(result.id)
0.3.1

1 year ago

0.3.0

1 year ago

0.2.3

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

1.0.0

1 year ago