FipamoAdminAPI

FipamoAdminAPI

A can of methods used to edit install settings, navigation pages and content pages

Constructor

new FipamoAdminAPI(baseURL)

Source:
Parameters:
Name Type Default Description
baseURL string null

url of site; uses local when empty

Methods

getInfo(type) → {object}

Promise method for retrieving site and member info
GET /api/v1/settings/:type

Source:
Parameters:
Name Type Description
type string

type of info requested ['site'|'member'];

Returns:
Type:
object

json object that contains data for requested information

info object example

     {
       "message":"message of affirmation!",
       "task":"type of info request",
       "data":json-data-object,
     }
Example
api.getInfo("type").then(data=>{
        console.log("Info Object", data);
})

login(data) → {object}

Promise method for authenticating and starting a session
POST/api/v1/login

Source:
Parameters:
Name Type Description
data Array.<Object>

json object that contains data for set up

Name Type Description
handle string

handle for site user

password string

password for site user

Returns:
Type:
object

json object that contains type and status of login request

     {
       "message":"Example Message of Affirmation or what you're missing!",
       "type":"exampleType",
     }
Example
api.login(data).then(response=>{
   console.log("RESPONSE", response);
})

pageActions(task, form) → {object}

Method for handling page creating and editing
POST/api/v1/page/:task

Source:
Parameters:
Name Type Description
task string

current page action

form Array.<object>

form object that contains info for current page being edited/created

Name Type Description
id string

sequence id for page, leave empty for new page

uuid string

unique identifier for page, leave empty for new page

layout string

current page layout

current_title string

saved url save title for persistence when changing title, leave empty for new page

content string

markdown body of page

title string

current title of page

created string

date page was created, leave empty for new page

slug string

url safe string of page title

tags string

comma separated list of tags

menu boolean

property that indicates page is included in site menu

featured boolean

property that indicates page is featured

published boolean

property that indicates page is public

form_token string

hidden property to authenticate form submission

feature_image input

main image for page

Returns:
Type:
object

json object that contains type and status of page edit request

   {
     "message":"Example Message of Affirmation!",
     "type":"exampleType",
   }
Example
api.pageActions(TASK, data).then(response=>{
   console.log("RESPONSE", response);
})

publish(data) → {object}

Method for retrieving user authorizing user login

Source:
Parameters:
Name Type Description
data Array.<object>

json object that contains task

Name Type Description
task string

publishing task

Returns:
Type:
object

json object that contains type and status of publis request

      {
        "message":"Example Message of Affirmation!",
        "type":"exampleType",
      }
Example
api.publish(TASK).then(response=>{
   console.log("RESPONSE", response);
})

sendMail(message) → {object}

Method for sending mail (if completed in settings)
POST/api/v1/mailer

Source:
Parameters:
Name Type Description
message Array.<object>

json object that contains items to be included in main site navigation

Name Type Description
content string

message to send

Returns:
Type:
object

json object that contains type and status of page edit request

  {
    "message":"Example Message of Affirmation!",
    "type":"exampleType"
  }
Example
api.sendMail(message).then(response=>{
   console.log("RESPONSE", response);
})

sync(task, data) → {object}

Method for saving site and navigation settings
POST/api/v1/settings/:task

Source:
Parameters:
Name Type Description
task string

settings being synced config | navigation

data Array.<object>

json object that contains settings data for [site] or [nav]

Name Type Description
global.base_url string

base url for site [site]

global.title string

site title [site]

global.descriptions string

brief site summary [site]

global.background string

url for site feature image for header [site]

global.private boolean

privacy state for site [disabled] [site]

global.renderOnSave boolean

property for publishing site when page saved [disabled] [site]

global.theme string

current theme for site [site]

global.externalAPI boolean

toggle for external API access [site]

member.handle string

current member handle [site]

member.email string

current member email [site]

email.active string

current email protocol being used [site]

email.smtp.domain string

url of smtp service being [site]

email.smtp.email string

email account of smtp service [site]

email.smtp.password string

password for email of smtp service [site]

email.mailgun.domain string

mailgun domain url [site]

email.mailgun.key string

mailgun key [site]

item.title string

page title [nav]

item.slug string

url safe title [nav]

item.uuid string

unique identifier [nav]

item.path string

directory path to associated markdown file [nav]

Returns:
Type:
object

json object that contains type and status of sync request


  {
    "message":"Example Message of Affirmation!",
    "type":"exampleType",
  }
Example
api.sync(TASK, data).then(response=>{
   console.log("RESPONSE", response);
})