discourse_api 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/examples/invite_users.rb +3 -0
- data/examples/sso.rb +14 -0
- data/examples/topic_lists.rb +4 -0
- data/lib/discourse_api/api/categories.rb +1 -1
- data/lib/discourse_api/api/invite.rb +4 -0
- data/lib/discourse_api/api/notifications.rb +10 -0
- data/lib/discourse_api/api/private_messages.rb +10 -0
- data/lib/discourse_api/api/sso.rb +17 -0
- data/lib/discourse_api/api/topics.rb +12 -0
- data/lib/discourse_api/api/users.rb +3 -3
- data/lib/discourse_api/client.rb +6 -0
- data/lib/discourse_api/version.rb +1 -1
- data/lib/single_sign_on.rb +98 -0
- data/spec/discourse_api/api/categories_spec.rb +2 -8
- data/spec/discourse_api/api/notifications_spec.rb +24 -0
- data/spec/discourse_api/api/private_messages_spec.rb +22 -0
- data/spec/discourse_api/api/search_spec.rb +1 -5
- data/spec/discourse_api/api/topics_spec.rb +30 -17
- data/spec/discourse_api/api/users_spec.rb +48 -12
- data/spec/discourse_api/client_spec.rb +4 -0
- data/spec/fixtures/categories.json +72 -1
- data/spec/fixtures/category_latest_topics.json +92 -1
- data/spec/fixtures/hot.json +113 -1
- data/spec/fixtures/latest.json +115 -1
- data/spec/fixtures/new.json +113 -1
- data/spec/fixtures/notifications.json +16 -0
- data/spec/fixtures/private_messages.json +69 -0
- data/spec/fixtures/search.json +24 -1
- data/spec/fixtures/topic.json +739 -1
- data/spec/fixtures/topic_invite_user.json +3 -0
- data/spec/fixtures/topics_created_by.json +49 -1
- data/spec/fixtures/user.json +65 -1
- data/spec/fixtures/user_update_user.json +3 -0
- data/spec/fixtures/user_update_username.json +3 -0
- metadata +21 -2
@@ -1 +1,49 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"users": [
|
3
|
+
{
|
4
|
+
"id": 1,
|
5
|
+
"username": "test_user",
|
6
|
+
"avatar_template": "//www.gravatar.com/avatar/test.png?s={size}&r=pg&d=identicon"
|
7
|
+
}
|
8
|
+
],
|
9
|
+
"topic_list": {
|
10
|
+
"can_create_topic": true,
|
11
|
+
"draft": null,
|
12
|
+
"draft_key": "new_topic",
|
13
|
+
"draft_sequence": 0,
|
14
|
+
"topics": [
|
15
|
+
{
|
16
|
+
"id": 1,
|
17
|
+
"title": "Test topic #1",
|
18
|
+
"fancy_title": "Test topic #1",
|
19
|
+
"slug": "test-topic-1",
|
20
|
+
"posts_count": 1,
|
21
|
+
"reply_count": 0,
|
22
|
+
"highest_post_number": 1,
|
23
|
+
"image_url": null,
|
24
|
+
"created_at": "2013-07-22T19:27:14.818-04:00",
|
25
|
+
"last_posted_at": "2013-07-22T19:41:49.768-04:00",
|
26
|
+
"bumped": true,
|
27
|
+
"bumped_at": "2013-07-22T19:41:49.768-04:00",
|
28
|
+
"unseen": false,
|
29
|
+
"pinned": false,
|
30
|
+
"visible": true,
|
31
|
+
"closed": false,
|
32
|
+
"archived": false,
|
33
|
+
"views": 68,
|
34
|
+
"like_count": 0,
|
35
|
+
"has_best_of": false,
|
36
|
+
"archetype": "regular",
|
37
|
+
"last_poster_username": "test_user",
|
38
|
+
"category_id": 1,
|
39
|
+
"posters": [
|
40
|
+
{
|
41
|
+
"extras": null,
|
42
|
+
"description": "Original Poster, Most Recent Poster",
|
43
|
+
"user_id": 1
|
44
|
+
}
|
45
|
+
]
|
46
|
+
}
|
47
|
+
]
|
48
|
+
}
|
49
|
+
}
|
data/spec/fixtures/user.json
CHANGED
@@ -1 +1,65 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"user_badges": [],
|
3
|
+
"user": {
|
4
|
+
"id": 1,
|
5
|
+
"username": "test_user",
|
6
|
+
"uploaded_avatar_id": null,
|
7
|
+
"avatar_template": "/letter_avatar/test/{size}/2.png",
|
8
|
+
"name": "Test User",
|
9
|
+
"email": "test_user@example.com",
|
10
|
+
"last_posted_at": null,
|
11
|
+
"last_seen_at": "2014-09-04T08:22:19.370-04:00",
|
12
|
+
"bio_cooked": null,
|
13
|
+
"created_at": "2014-09-04T08:04:25.104-04:00",
|
14
|
+
"can_edit": true,
|
15
|
+
"can_edit_username": true,
|
16
|
+
"can_edit_email": true,
|
17
|
+
"can_edit_name": true,
|
18
|
+
"stats": [
|
19
|
+
{
|
20
|
+
"action_type": 13,
|
21
|
+
"count": 1,
|
22
|
+
"id": null
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"can_send_private_message_to_user": true,
|
26
|
+
"bio_excerpt": "<div class='missing-profile'>test hasn't entered anything in the About Me field of their profile yet</div>",
|
27
|
+
"trust_level": 0,
|
28
|
+
"moderator": false,
|
29
|
+
"admin": false,
|
30
|
+
"title": null,
|
31
|
+
"badge_count": 0,
|
32
|
+
"has_title_badges": false,
|
33
|
+
"custom_fields": {},
|
34
|
+
"number_of_deleted_posts": 0,
|
35
|
+
"number_of_flagged_posts": 0,
|
36
|
+
"number_of_flags_given": 0,
|
37
|
+
"number_of_suspensions": 0,
|
38
|
+
"locale": null,
|
39
|
+
"email_digests": true,
|
40
|
+
"email_private_messages": true,
|
41
|
+
"email_direct": true,
|
42
|
+
"email_always": false,
|
43
|
+
"digest_after_days": 7,
|
44
|
+
"mailing_list_mode": false,
|
45
|
+
"auto_track_topics_after_msecs": 240000,
|
46
|
+
"new_topic_duration_minutes": 2880,
|
47
|
+
"external_links_in_new_tab": false,
|
48
|
+
"dynamic_favicon": false,
|
49
|
+
"enable_quoting": true,
|
50
|
+
"muted_category_ids": [],
|
51
|
+
"tracked_category_ids": [],
|
52
|
+
"watched_category_ids": [],
|
53
|
+
"private_messages_stats": {
|
54
|
+
"all": 1,
|
55
|
+
"mine": 0,
|
56
|
+
"unread": 0
|
57
|
+
},
|
58
|
+
"disable_jump_reply": false,
|
59
|
+
"gravatar_avatar_upload_id": null,
|
60
|
+
"custom_avatar_upload_id": null,
|
61
|
+
"invited_by": null,
|
62
|
+
"custom_groups": [],
|
63
|
+
"featured_user_badge_ids": []
|
64
|
+
}
|
65
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discourse_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -174,19 +174,26 @@ files:
|
|
174
174
|
- examples/disposable_invite_tokens.rb
|
175
175
|
- examples/example.rb
|
176
176
|
- examples/invite_users.rb
|
177
|
+
- examples/sso.rb
|
177
178
|
- examples/topic_lists.rb
|
178
179
|
- examples/update_user.rb
|
179
180
|
- lib/discourse_api.rb
|
180
181
|
- lib/discourse_api/api/categories.rb
|
181
182
|
- lib/discourse_api/api/invite.rb
|
183
|
+
- lib/discourse_api/api/notifications.rb
|
184
|
+
- lib/discourse_api/api/private_messages.rb
|
182
185
|
- lib/discourse_api/api/search.rb
|
186
|
+
- lib/discourse_api/api/sso.rb
|
183
187
|
- lib/discourse_api/api/topics.rb
|
184
188
|
- lib/discourse_api/api/users.rb
|
185
189
|
- lib/discourse_api/client.rb
|
186
190
|
- lib/discourse_api/error.rb
|
187
191
|
- lib/discourse_api/version.rb
|
192
|
+
- lib/single_sign_on.rb
|
188
193
|
- routes.txt
|
189
194
|
- spec/discourse_api/api/categories_spec.rb
|
195
|
+
- spec/discourse_api/api/notifications_spec.rb
|
196
|
+
- spec/discourse_api/api/private_messages_spec.rb
|
190
197
|
- spec/discourse_api/api/search_spec.rb
|
191
198
|
- spec/discourse_api/api/topics_spec.rb
|
192
199
|
- spec/discourse_api/api/users_spec.rb
|
@@ -196,11 +203,16 @@ files:
|
|
196
203
|
- spec/fixtures/hot.json
|
197
204
|
- spec/fixtures/latest.json
|
198
205
|
- spec/fixtures/new.json
|
206
|
+
- spec/fixtures/notifications.json
|
207
|
+
- spec/fixtures/private_messages.json
|
199
208
|
- spec/fixtures/search.json
|
200
209
|
- spec/fixtures/topic.json
|
210
|
+
- spec/fixtures/topic_invite_user.json
|
201
211
|
- spec/fixtures/topics_created_by.json
|
202
212
|
- spec/fixtures/user.json
|
203
213
|
- spec/fixtures/user_create_success.json
|
214
|
+
- spec/fixtures/user_update_user.json
|
215
|
+
- spec/fixtures/user_update_username.json
|
204
216
|
- spec/spec_helper.rb
|
205
217
|
homepage: http://github.com/discourse/discourse_api
|
206
218
|
licenses:
|
@@ -228,6 +240,8 @@ specification_version: 4
|
|
228
240
|
summary: Allows access to the Discourse API
|
229
241
|
test_files:
|
230
242
|
- spec/discourse_api/api/categories_spec.rb
|
243
|
+
- spec/discourse_api/api/notifications_spec.rb
|
244
|
+
- spec/discourse_api/api/private_messages_spec.rb
|
231
245
|
- spec/discourse_api/api/search_spec.rb
|
232
246
|
- spec/discourse_api/api/topics_spec.rb
|
233
247
|
- spec/discourse_api/api/users_spec.rb
|
@@ -237,9 +251,14 @@ test_files:
|
|
237
251
|
- spec/fixtures/hot.json
|
238
252
|
- spec/fixtures/latest.json
|
239
253
|
- spec/fixtures/new.json
|
254
|
+
- spec/fixtures/notifications.json
|
255
|
+
- spec/fixtures/private_messages.json
|
240
256
|
- spec/fixtures/search.json
|
241
257
|
- spec/fixtures/topic.json
|
258
|
+
- spec/fixtures/topic_invite_user.json
|
242
259
|
- spec/fixtures/topics_created_by.json
|
243
260
|
- spec/fixtures/user.json
|
244
261
|
- spec/fixtures/user_create_success.json
|
262
|
+
- spec/fixtures/user_update_user.json
|
263
|
+
- spec/fixtures/user_update_username.json
|
245
264
|
- spec/spec_helper.rb
|