README
npm-documentation
2020-01-08
First version of the doc (ongoing)
Table of Contents
- Auth
- Tables
- Compute
- Api
- JSON
- Transcoding
- Files
- Notifications
- Logs
- Notifications
- Pictures
- Tags
- [Emails]
- [sendEmail]
- [Posts]
- [alignNextEvent]
- [Tickets]
- [createTicketFromHtml]
- [generateReceipt]
- [Videos]
- [likedByMe]
- [subsUrl]
- [medias]
- landscape_hls_high
- landscape_hls_speed
- notifs_data
- poolKey-dev
- poolKey-prod
- poolKey
- portrait_hls_high
- portrait_hls_speed
- preset_1_0
Generic
auth
validateToken
Validate the user token to the elevenlife authentication.
validateToken(token, callback)
token is a string, it's the authentication token of the user.
callback has two returns like in function(err, data). The username is in data.username.
tables
getItem
To get an object from a database.
getItem(params, callback)
table is a string, the name of the table.
keys is an object, the id of the item, depending on the table.
{
[keyName]: [keyValue]
}
If the key of the table is name and you want the item that have the name qz8712e982e for example :
{
"name": "qz8712e982e"
}
callback has two returns like in function(err, data).
You will find the object wanted in data.Item. If this object doesn't exist, so data.Item doesn't exist too, in the callback.
queryItem
To do a query on a database.
queryItem(params, callback)
table is a string, the name of the table.
index is a string, the name of the index used.
limit is a int, it's the maximum number you can get in the array from this function. Can be null.
expKey is a string, the key to get items, following AWS usage like :
"#userId = :userId"
expressionNames is an object to use good variable names in the exprKey, (Can be null) following AWS usage like :
{
"#userId": "id" /* `id` is the name of the data in the table */
}
expValues is an object to use good variable values in the exprKey, following AWS usage like :
{
":userId": "ze8324IA"
}
forward is a boolean, to get data sorted by the sortKey. Can be null.
lastKey is an object, to get data starting from one object. It needs to be gave exactly as it came from dynamodb the first time. Can be null.
callback has two returns like in function(err, data).
You will find the objects wanted in data.Items as an array. If there isn't any object, or even a single one, the array will be always present. You just need to check how many data are there.
deleteItem
To delete an object in a database.
deleteItem(params, callback)
table is a string, the name of the table.
keys is an object, the id of the item, depending on the table.
{
[keyName]: [keyValue]
}
If the key of the table is name and you want the item that have the name qz8712e982e for example :
{
"name": "qz8712e982e"
}
returnV is a string, if you want to get data from the update, following AWS usage, for example NONE or ALL_NEW.
callback has two returns like in function(err, data).
updateItem
Update an object in a database.
updateItem(params, callback)
table is a string, the name of the table.
keys is an object, the id of the item, depending on the table.
{
[keyName]: [keyValue]
}
If the key of the table is id and you want the item that have the name qz8712e982e for example :
{
"id": "qz8712e982e"
}
conditionVar is a string, the name of the element in the object that needs to exist to do the update. Can be null.
expUpdate is a string, the key to get items, following AWS usage like :
"set #userAge = :userAge"
expNames is an object to use good variable names in the exprKey, (Can be null) following AWS usage like :
{
"#userAge": "age" /* `age` is the name of the data in the table */
}
expValues is an object to use good variable values in the exprKey, following AWS usage like :
{
":userAge": 28
}
returnV is a string, if you want to get data from the update, following AWS usage, for example NONE or ALL_NEW.
callback has two returns like in function(err, data).
createItem
Create an object in a database.
createItem(params, callback)
table is a string, the name of the table.
conditionVar is a string, the name of the element in the object that needs to exist to do the update. Can be null.
item is an object, it's the object you want to put in dynamodb.
callback has two returns like in function(err, data).
scanTable
Scan a table in the database and return every data in it. When scaning a table you can filter the returned data. It's pretty slow
scanTable(params, callback)
table is a string, the name of the table.
expressionNames is an object to use good variable names in the exprKey, (Can be null) following AWS usage like :
{
"#userAge": "age" /* `age` is the name of the data in the table */
}
expressionValues is an object to use good variable values in the exprKey, following AWS usage like :
{
":userAge": 28
}
filterExpression is a string, the key to get items, following AWS usage like :
"#userAge = :userAge"
projectionExpression tells DynamoDB what data to return. If you don't want every data in each object, and only some of the data (like the ID or something)
callback has two returns like in function(err, data).
compute
getItems
Get results from an ES database, only items results.
getItems(params, callback)
index is a string, the name of the string you want to request.
map is a string, the name of the map of the object you want.
size is an int, how many results you want to get.
varBody is an object, it's the query you want to do to ES.
callback has two returns like in function(err, data). data is an array, it's the result of the request.
getRawItems
Get results from an ES database, items and headers.
getRawItems(params, callback)
index is a string, the name of the string you want to request.
map is a string, the name of the map of the object you want.
size is an int, how many results you want to get.
varBody is an object, it's the query you want to do to ES.
callback has two returns like in function(err, data).
getCount
Get how many results would come with this request from an ES database.
getCount(params, callback)
index is a string, the name of the string you want to request.
map is a string, the name of the map of the object you want.
size is an int, how many results you want to get.
varBody is an object, it's the query you want to do to ES.
callback has two returns like in function(err, data).
createItem
Create an object in an ES database.
createItem(params, callback)
index is a string, the name of the string you want to request.
map is a string, the name of the map of the object you want.
id is a string, the id of the object you gonna create in ES.
body is an object, the object you want to create in ES.
callback has two returns like in function(err, data).
deleteItem
Delete an object in an ES database.
deleteItem(params, callback)
index is a string, the name of the string you want to request.
map is a string, the name of the map of the object you want.
id is a string, the id of the object you want to delete in ES.
callback has two returns like in function(err, data).
updateItem
Update an object in an ES database.
updateItem(params, callback)
id is a string, the id of the object you want to update in ES.
index is a string, the name of the string you want to request.
map is a string, the name of the map of the object you want.
body is an object, the update you want to do on the object in ES.
callback has two returns like in function(err, data).
api
pushSocket
To push data to a websocket connection.
pushSocket(params, callback)
domainName is a string, it's the domain the websocket is using.
connectionId is a string, the id of the connection you want to push to.
postData is an object, it's the data you want to push to the websocket.
callback has two returns like in function(err, data).
closeConnection
To push data to a websocket connection.
closeConnection(params, callback)
connectionId is a string, the id of the connection you want to close.
callback has two returns like in function(err, data).
json
validateHeader
Validate if the header has Authorization.
validateHeader(header)
header is an object, is the entire header.
The function return a bool, depending on if it's a valid header for elevenlife functions or not.
validateEmail
Validate an email.
validateEmail(email)
email is a string, the email you want to test.
The function return a bool, depending on if it's a valid email or not.
validatePhone
Validate a phone number.
validatePhone(phone)
phone is a string, the email you want to test.
The function return a bool, depending on if it's a valid phone number or not.
generateId
Generate a ID with only alphanumeric, with lowercase alpha.
generateId(length)
length is an int, the length of the id you want to generate.
The function return the id generated as a string.
transcoding
createConvertJob
To create a mediaconvert job to non streaming files
createConvertJob(fileName, fileBucket, destinationBucket, callback)
fileName is a string, it's the name of the source file.
fileBucket is a string, it's the name of the bucket where the source file is.
destinationBucket is a string, it's the name of the destination bucket where files will be saved.
callback has two returns like in function(err, data).
createHLSJob
createHLSJob(fileName, fileBucket, destinationBucket, orientation, callback)
fileName is a string, it's the name of the source file.
fileBucket is a string, it's the name of the bucket where the source file is.
destinationBucket is a string, it's the name of the destination bucket where files will be saved.
orientation is a string, it can have 2 values landscape or portrait.
callback has two returns like in function(err, data).
files
getObject
Get data from an object in S3.
getObject(params, callback)
file is a string, it's the name of the file you want.
bucket is a string, it's the name of the bucket where the file is.
callback has two returns like in function(err, data).
putObject
Create an object in S3.
putObject(params, callback)
body is the body of the file you want to create.
key is a string, the name of the file you are creating.
bucket is a string, the name of the bucket you are pushing the file to.
contentType is a string, it's the type of the file you are pushing.
contentEncoding is a string, it's optionnal.
region is a string, it's the region where you want to push te file to.
acl is a string, it set the authorizations for the file you are creating.
callback has two returns like in function(err, data).
getSignedUrl
Get a signed URL to handle a S3 object.
getSignedUrl(key, bucketNoGen, action, seconds)
key is a string, the file you want to have a signed url linked to.
bucketNoGen is a string, the name of the bucket where the file is, without the environnement and the region.
seconds is a int, how long it will work.
action is a string, what this url can do.
The function return a string, it's the url.
deleteListWorld
Delete a list of objects in all regions.
deleteListWorld(params, callback)
list is an array, of item that contains name of the file you want to delete. Is here an exemple of an item in the array :
{
"Key": "photo.mp4"
}
bucket is a string, the name of the bucket you are pushing the file to.
callback has two returns like in function(err, data).
deleteList
Delete a list of objects in a single region.
deleteList(params, callback)
list is an array, of item that contains name of the file you want to delete. Is here an exemple of an item in the array :
{
"Key": "photo.mp4"
}
bucket is a string, the name of the bucket you are pushing the file to.
region is a string, the region you want to remove the file from.
callback has two returns like in function(err, data).
copyObject
Copy an object from a S3 bucket to another S3 bucket.
copyObject(params, callback)
srcBucket is a string, the name of the bucket the file you want to copy come.
targetBucket is a string, the name of the bucket of the file you want to copy to.
srcKey is a string, the name of the file you want to copy.
targetKey is a string, the name of the new file created.
acl is a string, it set authorizations for this new file.
metadata is an object, it's metadata of the new file created. Can be null.
callback has two returns like in function(err, data).
makePublic
makePublic(params, callback)
file is a string, the name of the file you want to be public.
bucket is a string, the name of the bucket where the file is.
callback has two returns like in function(err, data).
notifications
createEndpoint
Create a SNS endpoint to push notifications to.
createEndpoint(params, callback)
arn is a string, it's the name of the SNS plateform you want to link the device to.
token is a string, it's the device token gave by APNS or GCM.
attributes is an object, you can set attributes to a SNS endpoint.
userData is an object, you can save data about the user link to this endpoint.
callback has two returns like in function(err, data).
deleteEndpoint
Delete a SNS endpoint.
deleteEndpoint(params, callback)
arn is a string, it's the endpoint you want to delete from SNS.
callback has two returns like in function(err, data).
subscribe
Subscribe a endpoint to a list in SNS.
subscribe(params, callback)
protocol is a string, it's the SNS protocol of the subscription you want to make.
topic is a string, it's the topic you want to subscribe too.
attributes is an object, to set attributes to this subscription.
endpoint is a string, it's the endpoint you want to subscribe to the topic.
returnV is a string, what data you want to get after the operation is done.
callback has two returns like in function(err, data).
unsubscribe
Unsubscribe a endpoint of a list in SNS.
unsubscribe(params, callback)
arn is a string, to delete a subscription from the subscription flow.
callback has two returns like in function(err, data).
publish
Publish a notifications to an endpoint in SNS.
publish(params, callback)
type is a string, what type of data you want to push.
data is an object, it's the data you want to push to the endpoint.
sandbox is a boolean, to know if it's a sandbox environnement or not.
message is a string, it's the message you want to send with the notification.
messageAttributes is an object, to set attributes of this message.
messageStructure is an string, to define how the notifications is.
phoneNumber is a string, the phone number that is subscribed and that you want to publish to.
targetArn is a string, the Arn you want to publish to.
topicArn is a string, the Arn of the topic you want to publish to.
subject is a string, the subject of the notification you are gonna push.
callback has two returns like in function(err, data).
Services for elevenlife API
logs
handleError
Save an error to elevenlife database.
handleError(type, name, fonctionName, event, userId, objectId, errorObject, callback)
type is a string, the type of error. ok, bad or urgent.
name is a string, the name of the error.
fonctionName is a string, the name of the function or api where the error is happening.
event is an object, it's the event input of the function.
userId is a string, the id of the user requesting the function or api.
objectId is a string, the id of the object link to
errorObject is an object, the error object coming from the service that failed.
callback has two returns like in function(err, data).
handleLog
notifications
pushNotifications
Push a notification to a user.
pushNotifications(iosData, androidData, type, isBadge, receiverId, senderId, postUserId, body, postDescr, callback)
iosData is an object, it's the data you want to send to iOs devices.
androidData is an object, it's the data you want to send to android devices.
type is a string, the type of the notification.
isBadge is a boolean, if the notifications need to push the badge counter too.
receiverId is a string, it's the user id of the user receiving the notification.
senderId is a string, it's the user id of the user sending the notification.
postUserId is a string, it's the user id of the user linked to the post or comment linked to the notification. Can be NULL.
body is a string, it's the content of the body of the notification. Can be NULL.
postDescr is a string, it's the description of the post link to the notification. Can be NULL.
callback has two returns like in function(err, data).
pictures
uploadPhoto
Upload a picture to elevenlife backend in S3.
uploadPhoto(params, callback)
file is a string, the name of the file you gonna create.
bucket is a string, the name of the bucket where you want to push the file, without environnement and region.
buf is a string, it's the buffer that is the actual picture file in raw data.
width is an int, it's the size of the picture file you want to create.
quality is an int, it's the quality of the picture file you want to create.
rotation is an int, it's the rotation of the picture file you want to create. Can be NULL.
callback has two returns like in function(err, data).
posts
alignNextEvent
tags
updateTags
Update tags counters for previous and new ones.
updateTags(dataOld, dataNew, action, callback)
dataOld is an array, containing the old tags as strings.
dataNew is an array, containing the new tags as strings.
action is an int, what action this update is coming form, like deleting a post, or creating one, etc..
callback has two returns like in function(err, data).
tickets
createTicketFromHtml
createTicketFromHtml(path, pdfName, htmlName, qrcodeId, mapUrl, address, postTitle, postDescription, sellerName, buyerName, date, productName, options, price, browser, context, callback)
generateReceipt
generateReceipt(buyerName, total, paymentDate, postTitle, thumbnail, sellerName, date, place, cardBrand, paymentName, paymentCard, items, context, callback)
videos
likedByMe
likedByMe(user, video, context, callback)
subsUrl
subsUrl(event, video, context, callback)
medias
medias(post, context, callback)
Datas
landscape_hls_high
Template to build a landscape hls video slow and high quality.
landscape_hls_speed
Template to build a landscape hls video fast and low quality.
notifs_data
String data to build notifications about multiple subjects.
{
"commented": {
"title": {
"fr": "YyY",
"en": "YyY"
},
"body": {
"fr": "👀 XxX a commenté un de tes posts | tap pour ouvrir la discussion...",
"en": "👀 XxX commented on your post | tap to open the discussion..."
}
},
"replied_to_my_comment": {
"title": {
"fr": "XxX | YyY",
"en": "XxX | YyY"
},
"body": {
"fr": "👀 XxX a répondu a un de tes commentaires sur ce post | tap pour ouvrir la discussion...",
"en": "👀 XxX replied to your comment on this post | tap to open the discussion..."
}
},
"liked_my_post": {
"title": {
"fr": "YyY",
"en": "YyY"
},
"body": {
"fr": "⭐️ XxX est interessé par un de tes posts | tap pour savoir...",
"en": "⭐️ XxX is interessed in your post | tap to learn more..."
}
},
"liked_my_comment": {
"title": {
"fr": "XxX | YyY",
"en": "XxX | YyY"
},
"body": {
"fr": "👍🏽 XxX a liké un de tes commentaires sur ce post | tap pour ouvrir la discussion...",
"en": "👍🏽 XxX liked your comment on this post | tap to open the discussion..."
}
},
"replied": {
"title": {
"fr": "YyY",
"en": "YyY"
},
"body": {
"fr": "👀 XxX a replondu a un commentaire sur un de tes post | tap pour ouvrir la discussion...",
"en": "👀 XxX replied to a comment on your post | tap to open the discussion..."
}
},
"commented_after_me": {
"title": {
"fr": "XxX | YyY",
"en": "XxX | YyY"
},
"body": {
"fr": "👀 XxX a aussi commenté sur ce post | tap pour ouvrir la discussion...",
"en": "👀 XxX also commented on this post | tap to open the discussion..."
}
},
"new_chat_message": {
"title": {
"fr": "XxX",
"en": "XxX"
},
"body": {
"fr": "Vous avez recu un nouveau message ✉️ | tap pour ouvrir la discussion...",
"en": "You received a new message ✉️ | tap to open the discussion..."
}
},
"new_chat_message_context": {
"title": {
"fr": "XxX | YyY",
"en": "XxX | YyY"
},
"body": {
"fr": "Vous avez recu un nouveau message ✉️ | tap pour ouvrir la discussion...",
"en": "You received a new message ✉️ | tap to open the discussion..."
}
},
"video_processed": {
"title": {
"fr": "YyY",
"en": "YyY"
},
"body": {
"fr": "✅ Votre post est maintenant disponible | tap pour plus de détails...",
"en": "✅ Your post is now available | tap to learn more..."
}
}
}
poolKey-dev
It's the key of the user pool, to verify user authentication token, for developpement environnement.
poolKey-prod
It's the key of the user pool, to verify user authentication token, for production environnement.
poolKey
It's the key of the user pool, to verify user authentication token, for staging environnement.
portrait_hls_high
Template to build a portrait hls video fast and low quality.
portrait_hls_speed
Template to build a portrait hls video fast and low quality.
presets_1_0
Template to build a non streaming video.
Objects
converter
Converter raw item to formatted data for the client.
activity(activity)
comment(comment)
counter(counter)
member(member)
message(message)
mapFromES(post)
postFromES(post)
post(post)
profile(profile)
tag(tag)
tagPredefined(tag)
validator
Validate objects to check what goes in or goes out of a function.
Auth
Chat
member
member(data, callback)
data is an array of members. Even with only one.
{
"id": {
"type": "string"
},
"peer_user_id": {
"type": "string"
},
"room_id": {
"type": "string"
},
"unread_count": {
"type": "number",
"integer": true,
"min": 0
},
"approved": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
},
"last_message_id": {
"type": "string",
"optional": true
},
"last_message_seen": {
"type": "string",
"optional": true
},
"$strict": true
}
message_create
messageCreate(data, callback)
data is an object. What goes in message create function.
{
"messages": {
"type": "array",
"items": {
"type": "object",
"props": {
"client_message_id": {
"type": "string",
"optional": true
},
"text": {
"type": "string"
}
}
}
},
"room_id": {
"type": "string"
},
"$strict": true
}
message_seen
messageSeen(data, callback)
data is an object. What goes in message seen function.
{
"room_id": {
"type": "string"
},
"message_id": {
"type": "string"
},
"$strict": true
}
message
message(data, callback)
data is an array of message objects. Even with only one.
{
"id": {
"type": "string"
},
"room_id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"client_message_id": {
"type": "string"
},
"time": {
"type": "string"
},
"text": {
"type": "string"
},
"$strict": true
}
room_leave
roomLeave(data, callback)
data is an object. That goes in the leave room function.
{
"room_id": {
"type": "string"
},
"$strict": true
}
room_open
roomOpen(data, callback)
data is the object. That goes in the open room function.
{
"peer_user_id": {
"type": "string"
},
"context": {
"type": "object",
"props": {
"post_id": {
"type": "string"
}
},
"optional": true
},
"$strict": true
}
Content
Map
map
map(data, callback)
data is an object. That goes out of the map functions.
{
"posts": {
"type": "array",
"items": {
"type": "object",
"props": {
"id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"original_location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
},
"description": {
"type": "string"
},
"type": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"like_count": {
"type": "number",
"integer": true,
"min": 0
},
"active": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
},
"comment_count": {
"type": "number",
"integer": true,
"min": 0
},
"time": {
"type": "object",
"props": {
"start": {
"type": "string"
},
"timezone": {
"type": "string"
},
"end": {
"type": "string",
"optional": true
},
"recursive": {
"type": "string",
"optional": true
}
},
"optional": true
},
"place": {
"type": "object",
"props": {
"address": {
"type": "string",
"optional": true
},
"locality": {
"type": "string",
"optional": true
},
"country": {
"type": "string",
"optional": true
},
"name": {
"type": "string",
"optional": true
},
"location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
}
},
"optional": true
},
"media": [
{
"type": "array",
"items": {
"type": "object",
"props": {
"thumbnail_url": {
"type": "url"
},
"media_urls": {
"type": "object",
"props": {
"L": {
"type": "url",
"optional": true
},
"M": {
"type": "url",
"optional": true
},
"T": {
"type": "url",
"optional": true
},
"S": {
"type": "url",
"optional": true
}
}
},
"media_info": {
"type": "object",
"props": {
"height": {
"type": "number"
},
"width": {
"type": "number"
},
"type": {
"type": "string"
}
},
"optional": true
}
}
},
"empty": true
},
{
"type": "array",
"items": {
"type": "object",
"props": {
"thumbnail_url": {
"type": "url"
},
"snapshot_url": {
"type": "url",
"optional": true
},
"media_urls": {
"type": "object",
"props": {
"L4": {
"type": "url",
"optional": true
},
"L5": {
"type": "url",
"optional": true
},
"H4": {
"type": "url",
"optional": true
},
"H5": {
"type": "url",
"optional": true
}
}
},
"media_info": {
"type": "object",
"props": {
"height": {
"type": "number"
},
"width": {
"type": "number"
},
"type": {
"type": "string"
}
},
"optional": true
}
}
},
"empty": true
}
],
"liked_by_me": {
"type": "number",
"optional": true,
"integer": true,
"min": 0,
"max": 1
}
}
}
},
"seq_id": {
"type": "string",
"optional": true
},
"incomplete": {
"type": "boolean",
"optional": true
},
"$strict": true
}
Notifications
counter
counter(data, callback)
data is an array of counter objects. Even with only one.
{
"unread_events": {
"type": "string"
},
"unread_messages": {
"type": "string"
},
"$strict": true
}
event_get
eventsGet(data, callback)
data is an object.
{
"events": {
"type": "array",
"items": {
"type": "object",
"props": {
"id": {
"type": "string"
},
"comment_id": {
"type": "string",
"optional": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"other_user_id": {
"type": "string"
},
"type": {
"type": "string"
},
"post_id": {
"type": "string"
},
"description": {
"type": "string"
},
"tapped": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
}
}
}
},
"seq_id": {
"type": "string",
"optional": true
},
"$strict": true
}
event
event(data, callback)
data is an array of event objects. Even with only one.
{
"id": {
"type": "string"
},
"comment_id": {
"type": "string",
"optional": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"other_user_id": {
"type": "string"
},
"type": {
"type": "string"
},
"post_id": {
"type": "string"
},
"description": {
"type": "string"
},
"tapped": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
},
"$strict": true
}
Posts
comment_create
commentCreate(data, callback)
data is an object.
{
"reply_to_id": {
"type": "string",
"optional": true
},
"post_id": {
"type": "string"
},
"text": {
"type": "string"
},
"$strict": true
}
comment_delete
commentDelete(data, callback)
data is an object.
{
"post_id": {
"type": "string",
"optional": true
},
"comment_id": {
"type": "string"
},
"$strict": true
}
comment_get
commentGet(data, callback)
data is an object.
{
"comments": {
"type": "array",
"items": {
"type": "object",
"props": {
"id": {
"type": "string"
},
"user_id": {
"type": "string",
"optional": true
},
"post_id": {
"type": "string"
},
"text": {
"type": "string",
"optional": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"reply_to_id": {
"type": "string",
"optional": true
},
"reply_count": {
"type": "number",
"optional": true
}
}
}
},
"seq_id": {
"type": "string",
"optional": true
},
"$strict": true
}
comment
comment(data, callback)
data is an array of comments. Even with only one.
{
"id": {
"type": "string"
},
"user_id": {
"type": "string",
"optional": true
},
"post_id": {
"type": "string"
},
"text": {
"type": "string",
"optional": true
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"like_count": {
"type": "number",
"integer": true,
"min": 0
},
"reply_to_id": {
"type": "string",
"optional": true
},
"reply_count": {
"type": "number",
"optional": true
},
"$strict": true
}
like_create
likeCreate(data, callback)
data is an object, what goes in the like content function.
{
"post_id": {
"type": "string"
},
"like": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
},
"comment_id": {
"type": "string",
"optional": true
},
"$strict": true
}
post_create
postCreate(data, callback)
data is an object, what goes in the post create function.
{
"original_location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
},
"optional": true
},
"description": {
"type": "string"
},
"type": {
"type": "string"
},
"time": {
"type": "object",
"props": {
"start": {
"type": "string"
},
"timezone": {
"type": "string"
},
"end": {
"type": "string",
"optional": true
},
"recursive": {
"type": "string",
"optional": true
}
},
"optional": true
},
"place": {
"type": "object",
"props": {
"address": {
"type": "string",
"optional": true
},
"locality": {
"type": "string",
"optional": true
},
"country": {
"type": "string",
"optional": true
},
"name": {
"type": "string",
"optional": true
},
"location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
}
},
"optional": true
},
"$strict": true
}
post_get
postGet(data, callback)
data is an object, what goes in the get posts function.
{
"posts": {
"type": "array",
"items": {
"type": "object",
"props": {
"id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"original_location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
},
"description": {
"type": "string"
},
"type": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"like_count": {
"type": "number",
"integer": true,
"min": 0
},
"active": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
},
"comment_count": {
"type": "number",
"integer": true,
"min": 0
},
"time": {
"type": "object",
"props": {
"start": {
"type": "string"
},
"timezone": {
"type": "string"
},
"end": {
"type": "string",
"optional": true
},
"recursive": {
"type": "string",
"optional": true
}
},
"optional": true
},
"place": {
"type": "object",
"props": {
"address": {
"type": "string",
"optional": true
},
"locality": {
"type": "string",
"optional": true
},
"country": {
"type": "string",
"optional": true
},
"name": {
"type": "string",
"optional": true
},
"location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
}
},
"optional": true
},
"media": [
{
"type": "array",
"items": {
"type": "object",
"props": {
"thumbnail_url": {
"type": "url"
},
"media_urls": {
"type": "object",
"props": {
"L": {
"type": "url",
"optional": true
},
"M": {
"type": "url",
"optional": true
},
"T": {
"type": "url",
"optional": true
},
"S": {
"type": "url",
"optional": true
}
}
},
"media_info": {
"type": "object",
"props": {
"height": {
"type": "number"
},
"width": {
"type": "number"
},
"type": {
"type": "string",
"optional": true
}
},
"optional": true
}
}
},
"empty": true
},
{
"type": "array",
"items": {
"type": "object",
"props": {
"thumbnail_url": {
"type": "url"
},
"snapshot_url": {
"type": "url",
"optional": true
},
"media_urls": {
"type": "object",
"props": {
"L4": {
"type": "url",
"optional": true
},
"L5": {
"type": "url",
"optional": true
},
"H4": {
"type": "url",
"optional": true
},
"H5": {
"type": "url",
"optional": true
}
}
},
"media_info": {
"type": "object",
"props": {
"height": {
"type": "number"
},
"width": {
"type": "number"
},
"type": {
"type": "string",
"optional": true
}
},
"optional": true
}
}
},
"empty": true
},
{
"type": "array",
"items": {
"type": "object",
"props": {
"thumbnail_url": {
"type": "url"
},
"media_urls": {
"type": "object",
"props": {
"HLS1": {
"type": "url",
"optional": true
},
"HLS2": {
"type": "url",
"optional": true
}
}
},
"media_info": {
"type": "object",
"props": {
"height": {
"type": "number"
},
"width": {
"type": "number"
},
"type": {
"type": "string",
"optional": true
}
},
"optional": true
}
}
},
"empty": true
}
],
"liked_by_me": {
"type": "number",
"optional": true,
"integer": true,
"min": 0,
"max": 1
}
}
}
},
"seq_id": {
"type": "string",
"optional": true
},
"$strict": true
}
post_update
postUpdate(data, callback)
data is an object, what goes in the update post function.
{
"post_id": {
"type": "string"
},
"original_location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
},
"optional": true
},
"description": {
"type": "string"
},
"type": {
"type": "string"
},
"time": {
"type": "object",
"props": {
"start": {
"type": "string"
},
"timezone": {
"type": "string"
},
"end": {
"type": "string",
"optional": true
},
"recursive": {
"type": "string",
"optional": true
}
},
"optional": true
},
"place": {
"type": "object",
"props": {
"address": {
"type": "string",
"optional": true
},
"locality": {
"type": "string",
"optional": true
},
"country": {
"type": "string",
"optional": true
},
"name": {
"type": "string",
"optional": true
},
"location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
}
},
"optional": true
},
"$strict": true
}
post
post(data, callback)
data is an array of post objects. Even with only one.
{
"id": {
"type": "string"
},
"user_id": {
"type": "string"
},
"original_location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
},
"description": {
"type": "string"
},
"type": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"like_count": {
"type": "number",
"integer": true,
"min": 0
},
"active": {
"type": "number",
"integer": true,
"min": 0,
"max": 1
},
"comment_count": {
"type": "number",
"integer": true,
"min": 0
},
"time": {
"type": "object",
"props": {
"start": {
"type": "string"
},
"timezone": {
"type": "string"
},
"end": {
"type": "string",
"optional": true
},
"recursive": {
"type": "string",
"optional": true
}
},
"optional": true
},
"place": {
"type": "object",
"props": {
"address": {
"type": "string",
"optional": true
},
"locality": {
"type": "string",
"optional": true
},
"country": {
"type": "string",
"optional": true
},
"name": {
"type": "string",
"optional": true
},
"location": {
"type": "object",
"props": {
"lat": {
"type": "number",
"min": -90,
"max": 90
},
"lon": {
"type": "number",
"min": -180,
"max": 180
}
}
}
},
"optional": true
},
"media": [
{
"type": "array",
"items": {
"type": "object",
"props": {
"thumbnail_url": {
"type": "url"
},
"media_urls": {
"type": "object",
"props": {
"L": {
"type": "url",
"optional": true
},
"M": {
"type": "url",
"optional": true
},
"T": {
"type": "url",
"optional": true
},
"S": {
"type": "url",
"optional": true
}
}
},
"media_info": {
"type": "object",
"props": {
"height": {
"type": "number"
},
"width": {
"type": "number"
},
"type": {
"type": "string",
"optional": true
}
},
"optional": true
}
}
},
"empty": true
},
{
"type": "array",
"items": {
"type": "object",
"props":