Граф коммитов

29 Коммитов

Автор SHA1 Сообщение Дата
Andrew Hayward 805d099533 Adding filtering functionality to APIs 2013-05-31 11:46:50 +01:00
Mike Larsson 7598610f9d TODO message about removing writable: true in api.js 2013-05-29 09:35:57 -04:00
Mike Larsson 0d65f6f0cc Move arg wrangling down into remote method 2013-05-29 09:33:41 -04:00
Mike Larsson 0b4160fdd5 Adding 409 Conflict error class, differentiating the claim code error reporting a bit 2013-05-29 09:29:25 -04:00
Mike Larsson c573cd64f2 Adding optional options passthrough on api to request methods 2013-05-28 16:18:29 -04:00
Mike Larsson bce2de2dd8 This change allows the api paginate method to pass through empty
data, and introduces a no_data block into the templates to render
a message when no data is found on the badges or programs pages,
instead of erroring out.
2013-05-17 16:45:33 -04:00
Mike Larsson 2615f39d01 Allow api origins to have paths.
Add basic logging wrapper for winston to start using.
Connect express.logger to logger module.
Use example.org instead of origin.org juuuuuust to be safe.
2013-05-17 10:57:48 -04:00
Mike Larsson 23b58c785a Add basic log info statement for API requests 2013-05-17 10:57:47 -04:00
Mike Larsson 3854da7788 Be less cavalier about building api endpoint urls 2013-05-17 10:57:47 -04:00
Mike Larsson ff2e9f62e7 Updating tests to pass with new error handling, and
fix issues uncovered in the process.
2013-05-16 16:52:30 -04:00
Andrew Hayward e4f181b27b Adding another `new` 2013-05-16 16:36:25 +01:00
Andrew Hayward 27fb855579 Adding `new`s. 2013-05-16 16:35:37 +01:00
Andrew Hayward 8a8baf4f89 Don't need logging here 2013-05-16 14:21:05 +01:00
Andrew Hayward f9e0d56aa3 Using new error handling 2013-05-16 14:19:30 +01:00
Mike Larsson 81c0075a2b Error out if trying to paginate unpageable data 2013-05-15 15:38:31 -04:00
Mike Larsson b327dbfbf1 This changes openbadger.js and api.js such that openbadger now
uses api, and the app only has to use openbadger. api(openbadger.x)
calls now look like openbadger.middleware('x'), and otherwise
the same methods are exposed on the openbadger object.

Note that this means api.js has a new usage as well. If you create
a new api, e.g.
  var api = new Api('ORIGIN');
you will have an object with all the get/post/head/etc. helpers
that could also be used if you want to fetch data from an API
without the layer of abstraction that providing additional functions
gives. This usage isn't well tested.
2013-05-15 15:25:41 -04:00
Mike Larsson 9e44593a4e Remove api method lookup by name 2013-05-13 14:53:01 -04:00
Mike Larsson 806412880d Trying to separate api util methods from actual OpenBadger API calls
so utils can be reused for other APIs too, like Aestimia. This also
helps a little bit with testing to avoid testing e.g. pagination
fully on every paginated endpoint (although having a small sanity check
is still advisable).
2013-05-13 14:27:20 -04:00
Andrew Hayward 6fb5744271 Handling API errors in the API 2013-05-10 15:09:16 +01:00
Andrew Hayward 6752704157 More sensible naming of badges 2013-05-09 18:28:41 +01:00
Andrew Hayward 3637cb45c0 Reducing redundant redundancy 2013-05-09 18:27:55 +01:00
Andrew Hayward 9e7281d3e9 Default badge ID 2013-05-09 14:26:15 +01:00
Andrew Hayward 054b3e7067 Adding some method functionality to `remote` 2013-05-09 14:26:04 +01:00
Andrew Hayward 8cac79ee5c Removing redundant setting of content type 2013-05-09 14:24:51 +01:00
Andrew Hayward 607249807d Adding `default_query` parameter to API middleware 2013-05-09 14:24:16 +01:00
Andrew Hayward 6ed8ec038c Moving page size to default query 2013-05-09 14:23:29 +01:00
Andrew Hayward e633ea302f Bailing out - this is a programmer error 2013-05-08 17:52:21 +01:00
Andrew Hayward 3a7c3cc8d8 Changing my mind about data availability 2013-05-08 15:55:23 +01:00
Andrew Hayward aa6bdec4e2 Beginnings of an API 2013-05-08 15:13:14 +01:00