gooble

command module
v0.0.0-...-460480a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

README

Wooble Service

AYY LMAO!

Installation

docker-compose build && docker-compose up -d

Configuration

docker exec -it gowooble /bin/bash
cd $CONFPATH

#dev.yml for dev environment
#test.yml for tests

cd $HOME/.aws

#credentials for amazon s3 creds

API Resources

Users

POST /v1/users

Content-Type: application/json

{
  "email": <user email address>
  "name": <username>
  "secret": <password>
  "plan": <selected plan>
  "cardToken"?: <card token created by stripe>
  "isCreator"?: <is the use a creator>
}
HTTP/1.1 201 Created
Content-Type: application/json
Location: /tokens

{
  "data": {
    "email": <user email address>
    "name": <username>
    "secret": <password>
    "plan": <selected plan>
    "isCreator"?: <is the use a creator>
  }
}

DELETE /v1/users

Authorization: <user token>
HTTP/1.1 204 NoContent
Authorization: <refreshed token>
Token

POST /v1/tokens

Content-Type: application/json

{
  "email": <user email address>
  "secret": <password>
}
HTTP/1.1 201 Created
Content-Type: application/json

{
  "data": {
    "token": <access token>
  }
}

PUT /v1/tokens

Authorization: <user token>
HTTP/1.1 201 Created
Authorization: <refreshed token>

{
  "data": {
    "token": <access token>
  }
}
Creations

GET /v1/creations

HTTP/1.1 200 OK
Content-Type: application/json

{
  "data": [
    {
      "id": <creation id>
      "title": <creation title>
      "description"?: <creation description>
      "creator": {
        "name": <creator name>
      }
    	"versions": <creation versions>
      "createdAt": <creation date created>
      "updatedAt"?: <creation last updated date
    }
    {
      ...
    }
  ]
}

GET /v1/creations/:creaID

Content-Type: application/json

{
  "data": {
    "id": <creation id>
    "title": <creation title>
    "description"?: <creation description>
    "creator": {
      "name": <creator name>
    }
    "versions": <creation versions>
    "createdAt": <creation date created>
    "updatedAt"?: <creation last updated date
  }
}

POST /v1/creations

Content-Type: application/json
Authorization: <user token>

{
  "title": <creation title>
  "engine"?: <engine, JSES5 default>
}
HTTP/1.1 201 Created
Location: /creations/:<id of the new creation>
Authorization: <refreshed token if expired>

{
  "data": {
    "id": <creation id>
    "title": <creation title>
    "creator": {
      "name": <creator name>
    }
    "versions": <creation versions>
    "createdAt": <creation date created>
    "updatedAt"?: <creation last updated date
  }
}

PUT /v1/creations/:encid It only updates the description and price

Content-Type: application/json
Authorization: <user token>

{
  "engine": <creation engine>
  "title": <creation title>
  "description"?: <creation description>
  "price"?: <creation price>
}
HTTP/1.1 204 NoContent
Location: /creations/:<id of the creation>
Authorization: <refreshed token if expired>

DELETE /v1/creations/:encid Delete the creation if nobody use it, else it will make the creation unlisted by putting its state to 'delete'

Authorization: <user token>
HTTP/1.1 204 NoContent
Authorization: <refreshed token if expired>

GET /v1/creations/:encid/code

Authorization: <user token>
HTTP/1.1 200 OK
Content-Type: application/json
Authorization: <refreshed token if expired>

{
  "data": {
    "script": <script code>
    "document"?: <document code>
    "style"?: <style code>
  }
}

POST /v1/creations/:encid/versions

Content-Type: application/json
Authorization: <user token>

{
  "version": <version to create>
}
HTTP/1.1 204 NoContent
Authorization: <refreshed token if expired>
Location: /creations/<creation id>/code

PUT /v1/creations/:encid/versions Save the last version (only if in draft)

Content-Type: application/json
Authorization: <user token>

{
  "script": <script code>
  "document"?: <document code>
  "style"?: <style code>
}
HTTP/1.1 204 NoContent
Authorization: <refreshed token if expired>
Location: /creations/<creation id>/versions
Packages

GET /v1/packages

Authorization: <user token>
HTTP/1.1 200 OK
Content-Type: application/json
Authorization: <refreshed token if expired>

{
  "data": [
    {
      "id": <package id>
      "title": <package title>
      "referer":[<referer associated to the package>]
      "createdAt": <package creation date>
      "updatedAt"?: <package last update date>
      "creations"?: [...]
    },
    {
      ...
    }
  ]
}

GET /v1/packages/:pkgID

Content-Type: application/json
Authorization: <user token>
HTTP/1.1 200 OK
Content-Type: application/json
Authorization: <refreshed token if expired>

{
  "data": {
    "id": <package id>
    "title": <package title>
    "referer":[<referer associated to the package>]
    "createdAt": <package creation date>
    "updatedAt"?: <package last update date>
    "creations"?: [...]
  }
}

POST /v1/packages

Content-Type: application/json
Authorization: <user token>

{
  "title": <package title>
  "referer"?: [<referer with which the package will work>]
}
HTTP/1.1 201 Created
Content-Type: application/json
Location: /packages/:<id of the new package>
Authorization: <refreshed token if expired>

PUT /v1/packages/:encid

Content-Type: application/json
Authorization: <user token>

{
  "title": <package title>
  "referer"?: [<referer with which the package will work>]
}
HTTP/1.1 204 NoContent
Location: /packages/:<id of the new package>
Authorization: <refreshed token if expired>

PATCH /v1/packages/:encid

Content-Type: application/json
Authorization: <user token>

{
  "title"?: <package title>
  "referer"?: [<referer with which the package will work>]
  "build"?: <build operation, boolean expected>
}
HTTP/1.1 200 OK
Authorization: <refreshed token if expired>

{
  "data":{
    "source"?: <package source (CDN)>
  }
}

DELETE /v1/packages/:encid

Authorization: <user token>
HTTP/1.1 204 NoContent
Authorization: <refreshed token if expired>

POST /v1/packages/:encid/creations

Content-Type: application/json
Authorization: <user token>

{
  "creation": <IDs of creations to push in package>
}
HTTP/1.1 204 NoContent
Location: /v1/packages/:<id of the package>
Authorization: <refreshed token if expired>

DELETE /v1/packages/:encid/creations

Authorization: <user token>
HTTP/1.1 204 NoContent
Authorization: <refreshed token if expired>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL