signupPOST /auth/:engage/signup Signup a Thing of type :engage, e.g. "Thing", "MedicalCondition", "Vehicle".
engageusername, passwordcurl -X POST http://localhost:5000/auth/MedicalCondition/signup -d name="FleshName" -d username="flesh" -d password="letmein"
Response:
{
"_id": "5f4c3f8171342431cb677148",
"permits": {
"get": "ANON",
"create": "ANON",
"update": "ANON",
"delete": "ANON"
},
"list": [],
"name": "FleshName",
"username": "flesh",
"created": "2020-08-31T00:08:33.534Z",
"thing": "Thing"
}
loginPOST /auth/login/ Login with username and password.
Required Fields: username, password
curl -X POST http://localhost:5000/auth/login -d username="flesh" -d password="letmein"
Response:
{
"_id": "5f4c3f8171342431cb677148",
"name": "FleshName",
"success": true,
"username": "flesh",
"token": "Bearer eyJhbGciOiJIUzI1NiIsInR...."
}
Using Envvars:
set AUTH_RES (curl -X POST http://localhost:5000/auth/login -d username="flesh" -d password="letmein")
set AUTH_RES (curl -X POST http://localhost:5000/auth/Thing/login -d username="flesh" -d password="letmein")
set BEARER (string match -r '(?<=token\"\:\").*(?=\"\})' $AUTH_RES)
set ENGAGED (string match -r '(?<=_id\"\:\").*(?=\"\})' $AUTH_RES)
logout/auth/logout/ Expire the jwt token.
engageGET /:engage/:_id/ View the engaged Thing.
engage, _idcurl -X GET -H "Authorization: $BEARER" "http://localhost:5000/Thing/$ENGAGED/"
Response:
{
"permits": {
"get": "ANON",
"create": "ANON",
"update": "ANON",
"delete": "ANON"
},
"list": [],
"_id": "5f4c3f8171342431cb677148",
"name": "FleshName",
"username": "flesh",
"created": "2020-08-31T00:08:33.534Z",
"thing": "Thing",
"__v": 0
}
updatePATCH /:engage/:_id/ Update the engaged Thing.
engage, _idcurl -X GET -H "Authorization: $BEARER" "http://localhost:5000/Thing/$ENGAGED/"
Response:
{
"permits": {
"get": "ANON",
"create": "ANON",
"update": "ANON",
"delete": "ANON"
},
"list": [],
"_id": "5f4c3f8171342431cb677148",
"name": "FleshName",
"username": "flesh",
"created": "2020-08-31T00:08:33.534Z",
"thing": "Thing",
"__v": 0
}
deleteDELETE /:engage/:_id/ Delete the engaged Thing.
engage, _idcurl -X DELETE -H "Authorization: $BEARER" "http://localhost:5000/Thing/$ENGAGED/"
Response:
{
"permits": {
"get": "ANON",
"create": "ANON",
"update": "ANON",
"delete": "ANON"
}
}
createPOST /:engage/:_id/:T/ Create a new Thing of type :T and adds it to the engaged Thing's list.
engage, _id, Tcurl -X POST -H "Authorization: $BEARER" "http://localhost:5000/Thing/$ENGAGED/MedicalCondition/" -d name="New MedicalCondition in List For $ENGAGED"
Response:
{
"_id": "5f4c4b9671342431cb67714a",
"permits": {
"get": "ANON",
"create": "ANON",
"update": "ANON",
"delete": "ANON"
},
"list": [],
"name": "New MedicalCondition in List For $ENGAGED",
"created": "2020-08-31T01:00:06.391Z",
"createdBy": "$AUTHENTICATED",
"god": "$ENGAGED",
"thing": "MedicalCondition",
"__v": 0
}
listGET /:engage/:_id/list/ View engaged Thing's list.
engage, _idcurl -X GET -H "Authorization: $BEARER" "http://localhost:5000/Thing/$ENGAGED/list/"
Response:
[
{
"_id": "5f4c4ace71342431cb677149",
"name": "New Thing in List For $ENGAGED",
"thing": "T"
},
{
"_id": "5f4c4b9671342431cb67714a",
"name": "New MedicalCondition in List For $ENGAGED",
"thing": "MedicalCondition"
}
]
Settings:
// `bones-mongoose/bones/settings.js`
module.exports = {
slim: {
disambiguatingDescription: 1,
name: 1,
},
}
listofGET /:engage/:_id/listof/:T/ View engaged Thing's list of type :T.
engage, _idcurl -X GET -H "Authorization: $BEARER" "http://localhost:5000/Thing/$ENGAGED/list/MedicalCondition/"
Response:
[
{
"_id": "5f4c4b9671342431cb67714a",
"name": "New MedicalCondition in List For 5f4c3f8171342431cb677148",
"thing": "MedicalCondition"
}
]
Settings:
// `bones-mongoose/bones/settings.js`
module.exports = {
slim: {
disambiguatingDescription: 1,
name: 1,
},
}
schemaGET /schema/:engage/ Get the Meta Schema of type :engage.
engagecurl -X GET -H "Authorization: $BEARER" "http://localhost:5000/schema/Thing/"
Response:
{
"disambiguatingDescription": {
"type": "Text"
},
"name": {
"type": "Text"
}
}
Settings:
// `bones-mongoose/bones/settings.js`
module.exports = {
slim: {
disambiguatingDescription: 1,
name: 1,
},
}