discourse-js
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "discourse-js", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A client-side javascript wrapper for the discourse API.", | ||
@@ -14,3 +14,6 @@ "main": "src/index.js", | ||
"author": "Karl Taylor <karl_taylor@me.com>", | ||
"contributors": ["Dan Williams <dan@workshop.ws> (https://workshop.ws/)", "Josh Taylor <josh@workshop.ws> (https://workshop.ws/)"], | ||
"contributors": [ | ||
"Dan Williams <dan@workshop.ws> (https://workshop.ws/)", | ||
"Josh Taylor <josh@workshop.ws> (https://workshop.ws/)" | ||
], | ||
"license": "MIT", | ||
@@ -17,0 +20,0 @@ "devDependencies": { |
@@ -10,5 +10,9 @@ # Discourse-js | ||
- [API](#api) | ||
- [Categories](#categories) | ||
- [Groups](#groups) | ||
- [Messages](#messages) | ||
- [Notifications](#notifications) | ||
- [Posts](#posts) | ||
- [Topics](#topics) | ||
- [Posts](#posts) | ||
- [Groups](#groups) | ||
- [Users](#users) | ||
- [Local Development](#local-development) | ||
@@ -46,13 +50,33 @@ - [License](#license) | ||
### Topics | ||
### Categories | ||
#### Get a Topic | ||
Todo | ||
--- | ||
### Groups | ||
#### Get Group Members | ||
```js | ||
discourse.topics | ||
.getTopic({ id }) | ||
.then(res => console.log(response)} | ||
.catch(err => console.log(err)) | ||
discourse.groups | ||
.getMembers({ group_name: "group-name" }) | ||
.then(res => console.log(res)) | ||
.catch(err => console.log(err)); | ||
``` | ||
--- | ||
### Messages | ||
Todo | ||
--- | ||
### Notifications | ||
Todo | ||
--- | ||
### Posts | ||
@@ -96,13 +120,21 @@ | ||
### Groups | ||
--- | ||
#### Get Group Members | ||
### Topics | ||
#### Get a Topic | ||
```js | ||
discourse.groups | ||
.getMembers({ group_name: "group-name" }) | ||
.then(res => console.log(res)) | ||
.catch(err => console.log(err)); | ||
discourse.topics | ||
.getTopic({ id }) | ||
.then(res => console.log(response)} | ||
.catch(err => console.log(err)) | ||
``` | ||
--- | ||
### Users | ||
Todo | ||
## Local Development | ||
@@ -109,0 +141,0 @@ |
@@ -1,8 +0,8 @@ | ||
/** Discourse JS */ | ||
import Categories from "./resources/Categories"; | ||
import Groups from "./resources/Groups"; | ||
import Messages from "./resources/Messages"; | ||
import Notifications from "./resources/Notifications"; | ||
import Posts from "./resources/Posts"; | ||
import Topics from "./resources/Topics"; | ||
import Messages from "./resources/Messages"; | ||
import Groups from "./resources/Groups"; | ||
import Categories from "./resources/Categories"; | ||
import Notifications from "./resources/Notifications"; | ||
import Users from "./resources/Users"; | ||
@@ -12,8 +12,9 @@ import { createBody, ApiError } from "./utils"; | ||
const resources = { | ||
Categories, | ||
Groups, | ||
Messages, | ||
Notifications, | ||
Posts, | ||
Topics, | ||
Messages, | ||
Groups, | ||
Categories, | ||
Notifications | ||
Users | ||
}; | ||
@@ -23,3 +24,2 @@ | ||
constructor(apiKey, baseUrl) { | ||
// Set our api key to the Discourse class. | ||
this._API_KEY = apiKey; | ||
@@ -26,0 +26,0 @@ this._BASE_URL = baseUrl; |
135348
78
2024
164
8