Things
What is this?
Things is a RESTful-like domain protocol based on Microvision Chain and MetaID DID protocol. Developers can use Things to create his own domain resource.
How to use?
The API examples listed here are still under development.
Define domain
import { define, use } from '@godeners/things'
const Buzz = define('buzz', {
})
const Buzz = use('buzz')
Use domain
const buzzes = Buzz.list()
const buzzes = Buzz.list({
where: {
title: 'Hello World',
},
})
Buzz.login('0x1234567890')
const myBuzzes = Buzz.myList()
Buzz.login('0x1234567890')
const hasRoot: boolean = Buzz.hasContainer()
Buzz.login('0x1234567890')
await Buzz.createContainer()
const buzz = Buzz.one('0x1234567890')
const buzz = Buzz.first('0x1234567890')
const buzz = Buzz.get('0x1234567890')
const buzz = Buzz.one({
where: {
title: 'Hello World',
},
})
const newBuzz = Buzz.create({
title: 'Hello World',
content: 'This is my first buzz',
})
const updatedBuzz = Buzz.update('0x1234567890', {
title: 'Hello World',
content: 'This is my first buzz',
})
const oldBuzz = Buzz.get('0x1234567890')
const updatedBuzz = oldBuzz.update({
title: 'Hello World',
content: 'This is my first buzz',
})
const deletedBuzz = Buzz.delete('0x1234567890')
oldBuzz.delete()