7.0.0 • Published 9 years ago

logworks v7.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Logworks node.js bindings

Node library to access the Logworks API using Immutable collections Expects Fetch and Promise.

Installation

$ npm install logworks

Usage

See https://github.com/logworks/logworks-test

Overview

Every resource is accessed via your logworks instance:

var logworks = require('logworks')('logworks_api_url');
// logworks.{ RESOURCE NAME }.{ METHOD NAME }

Every resource method accepts an optional callback as the last argument:

logworks.logs.create(function(err, log) {
  err; // null if no error ocurred
  log; // Immutable Map with 'id', 'data' and 'entries' where 'data' is an Immutable Map and 'entries' is an Immutable List
}

Additionally, every resource method returns a promise, so you don't have to use the regular callback, e.g:

// Create a new log and then a new entry in that log:
logworks.logs.create().then(function(log) {
  return logworks.entries.create(log.id, {type:'text', data:'Hello World'});
}).then(function(entry) {
  entry; // Immutable map with 'id', 'type', 'data', 'created' and 'updated'
  // New entry was created
}, function(err) {
  // Deal with the error
}); 

Available resources & methods

  • logs

    • create()
    • show(logurl)
    • edit(logid, data)
    • del(logid)
    • generateSignedURL(logid)
  • entries

    • create(logid, {type: "type", data: "data"})
    • edit(logid, entryid, {type: "type", data: "newdata"})
    • del(logid, entryid)

Notes

generateSignedURL generates URLs that can be used to upload images. The response looks like {signedURL: 'foo', url: 'bar'} where url is the url that the image will be accessible on, and signedURL is the url that you should use to upload the image.

7.0.0

9 years ago

6.0.1

9 years ago

6.0.0

9 years ago

5.0.2

9 years ago

5.0.1

9 years ago

5.0.0

9 years ago

4.1.3

9 years ago

4.1.2

9 years ago

4.1.1

9 years ago

4.1.0

9 years ago

4.0.5

9 years ago

4.0.4

9 years ago

4.0.3

9 years ago

4.0.2

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.0.28

9 years ago

3.0.27

9 years ago

3.0.26

9 years ago

3.0.25

9 years ago

3.0.24

9 years ago

3.0.23

9 years ago

3.0.22

9 years ago

3.0.21

9 years ago

3.0.20

9 years ago

3.0.19

9 years ago

3.0.18

9 years ago

3.0.17

9 years ago

3.0.16

9 years ago

3.0.15

9 years ago

3.0.14

9 years ago

3.0.13

9 years ago

3.0.12

9 years ago

3.0.11

9 years ago

3.0.10

9 years ago

3.0.9

9 years ago

3.0.8

9 years ago

3.0.7

9 years ago

3.0.6

9 years ago

3.0.5

9 years ago

3.0.4

9 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago