discourse_api 0.44.0 → 0.47.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +13 -17
  3. data/.gitignore +0 -19
  4. data/CHANGELOG.md +38 -7
  5. data/discourse_api.gemspec +5 -5
  6. data/examples/bookmark_topic.rb +15 -0
  7. data/examples/category.rb +3 -0
  8. data/examples/invite_users.rb +20 -2
  9. data/examples/manage_api_keys.rb +42 -0
  10. data/examples/notifications.rb +18 -0
  11. data/examples/topic_lists.rb +3 -0
  12. data/lib/discourse_api/api/api_key.rb +15 -9
  13. data/lib/discourse_api/api/categories.rb +41 -13
  14. data/lib/discourse_api/api/invite.rb +67 -2
  15. data/lib/discourse_api/api/notifications.rb +5 -2
  16. data/lib/discourse_api/api/private_messages.rb +10 -3
  17. data/lib/discourse_api/api/search.rb +1 -1
  18. data/lib/discourse_api/api/topics.rb +37 -2
  19. data/lib/discourse_api/api/users.rb +1 -1
  20. data/lib/discourse_api/client.rb +13 -1
  21. data/lib/discourse_api/error.rb +3 -0
  22. data/lib/discourse_api/version.rb +1 -1
  23. data/spec/discourse_api/api/api_key_spec.rb +59 -35
  24. data/spec/discourse_api/api/categories_spec.rb +90 -0
  25. data/spec/discourse_api/api/invite_spec.rb +123 -0
  26. data/spec/discourse_api/api/private_messages_spec.rb +4 -4
  27. data/spec/discourse_api/api/search_spec.rb +2 -2
  28. data/spec/discourse_api/api/topics_spec.rb +71 -0
  29. data/spec/discourse_api/client_spec.rb +15 -0
  30. data/spec/fixtures/api_key.json +12 -0
  31. data/spec/fixtures/list_api_keys.json +14 -0
  32. data/spec/fixtures/notification_success.json +3 -0
  33. data/spec/fixtures/retrieve_invite.json +116 -0
  34. data/spec/fixtures/top.json +108 -0
  35. data/spec/fixtures/topic_posts.json +1 -0
  36. metadata +24 -13
  37. data/spec/fixtures/api.json +0 -12
  38. data/spec/fixtures/generate_master_key.json +0 -7
@@ -34,6 +34,7 @@
34
34
  "read":true,
35
35
  "user_title":null,
36
36
  "actions_summary":[{"id":2,"count":3,"can_act":true}],
37
+ "raw": [{"type":"paragraph","children":[{"text":"This is a raw post I've got white space!... and emojis 😈😈😈😈😈😈"}]}],
37
38
  "moderator":false,
38
39
  "admin":false,
39
40
  "staff":false,
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.44.0
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-11-13 00:00:00.000000000 Z
14
+ date: 2021-07-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -159,28 +159,28 @@ dependencies:
159
159
  requirements:
160
160
  - - "~>"
161
161
  - !ruby/object:Gem::Version
162
- version: '2.0'
162
+ version: '3.0'
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - "~>"
168
168
  - !ruby/object:Gem::Version
169
- version: '2.0'
169
+ version: '3.0'
170
170
  - !ruby/object:Gem::Dependency
171
171
  name: rubocop-discourse
172
172
  requirement: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - ">="
174
+ - - "~>"
175
175
  - !ruby/object:Gem::Version
176
- version: '0'
176
+ version: 2.4.1
177
177
  type: :development
178
178
  prerelease: false
179
179
  version_requirements: !ruby/object:Gem::Requirement
180
180
  requirements:
181
- - - ">="
181
+ - - "~>"
182
182
  - !ruby/object:Gem::Version
183
- version: '0'
183
+ version: 2.4.1
184
184
  description: Discourse API
185
185
  email:
186
186
  - sam.saffron@gmail.com
@@ -204,6 +204,7 @@ files:
204
204
  - discourse_api.gemspec
205
205
  - examples/backups.rb
206
206
  - examples/badges.rb
207
+ - examples/bookmark_topic.rb
207
208
  - examples/category.rb
208
209
  - examples/change_topic_status.rb
209
210
  - examples/create_private_message.rb
@@ -216,6 +217,8 @@ files:
216
217
  - examples/group_set_user_notification_level.rb
217
218
  - examples/groups.rb
218
219
  - examples/invite_users.rb
220
+ - examples/manage_api_keys.rb
221
+ - examples/notifications.rb
219
222
  - examples/polls.rb
220
223
  - examples/post_action.rb
221
224
  - examples/search.rb
@@ -257,6 +260,7 @@ files:
257
260
  - spec/discourse_api/api/categories_spec.rb
258
261
  - spec/discourse_api/api/email_spec.rb
259
262
  - spec/discourse_api/api/groups_spec.rb
263
+ - spec/discourse_api/api/invite_spec.rb
260
264
  - spec/discourse_api/api/notifications_spec.rb
261
265
  - spec/discourse_api/api/params_spec.rb
262
266
  - spec/discourse_api/api/polls_spec.rb
@@ -271,7 +275,7 @@ files:
271
275
  - spec/discourse_api/api/users_spec.rb
272
276
  - spec/discourse_api/client_spec.rb
273
277
  - spec/fixtures/admin_user.json
274
- - spec/fixtures/api.json
278
+ - spec/fixtures/api_key.json
275
279
  - spec/fixtures/backups.json
276
280
  - spec/fixtures/badges.json
277
281
  - spec/fixtures/categories.json
@@ -280,15 +284,16 @@ files:
280
284
  - spec/fixtures/create_topic_with_tags.json
281
285
  - spec/fixtures/email_list_all.json
282
286
  - spec/fixtures/email_settings.json
283
- - spec/fixtures/generate_master_key.json
284
287
  - spec/fixtures/group.json
285
288
  - spec/fixtures/groups.json
286
289
  - spec/fixtures/hot.json
287
290
  - spec/fixtures/latest.json
291
+ - spec/fixtures/list_api_keys.json
288
292
  - spec/fixtures/members_0.json
289
293
  - spec/fixtures/members_1.json
290
294
  - spec/fixtures/members_2.json
291
295
  - spec/fixtures/new.json
296
+ - spec/fixtures/notification_success.json
292
297
  - spec/fixtures/notifications.json
293
298
  - spec/fixtures/polls_toggle_status.json
294
299
  - spec/fixtures/polls_vote.json
@@ -301,7 +306,9 @@ files:
301
306
  - spec/fixtures/regenerate_api_key.json
302
307
  - spec/fixtures/replies.json
303
308
  - spec/fixtures/replies_and_topics.json
309
+ - spec/fixtures/retrieve_invite.json
304
310
  - spec/fixtures/search.json
311
+ - spec/fixtures/top.json
305
312
  - spec/fixtures/topic.json
306
313
  - spec/fixtures/topic_invite_user.json
307
314
  - spec/fixtures/topic_posts.json
@@ -340,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
347
  - !ruby/object:Gem::Version
341
348
  version: '0'
342
349
  requirements: []
343
- rubygems_version: 3.0.3
350
+ rubygems_version: 3.1.6
344
351
  signing_key:
345
352
  specification_version: 4
346
353
  summary: Allows access to the Discourse API
@@ -351,6 +358,7 @@ test_files:
351
358
  - spec/discourse_api/api/categories_spec.rb
352
359
  - spec/discourse_api/api/email_spec.rb
353
360
  - spec/discourse_api/api/groups_spec.rb
361
+ - spec/discourse_api/api/invite_spec.rb
354
362
  - spec/discourse_api/api/notifications_spec.rb
355
363
  - spec/discourse_api/api/params_spec.rb
356
364
  - spec/discourse_api/api/polls_spec.rb
@@ -365,7 +373,7 @@ test_files:
365
373
  - spec/discourse_api/api/users_spec.rb
366
374
  - spec/discourse_api/client_spec.rb
367
375
  - spec/fixtures/admin_user.json
368
- - spec/fixtures/api.json
376
+ - spec/fixtures/api_key.json
369
377
  - spec/fixtures/backups.json
370
378
  - spec/fixtures/badges.json
371
379
  - spec/fixtures/categories.json
@@ -374,15 +382,16 @@ test_files:
374
382
  - spec/fixtures/create_topic_with_tags.json
375
383
  - spec/fixtures/email_list_all.json
376
384
  - spec/fixtures/email_settings.json
377
- - spec/fixtures/generate_master_key.json
378
385
  - spec/fixtures/group.json
379
386
  - spec/fixtures/groups.json
380
387
  - spec/fixtures/hot.json
381
388
  - spec/fixtures/latest.json
389
+ - spec/fixtures/list_api_keys.json
382
390
  - spec/fixtures/members_0.json
383
391
  - spec/fixtures/members_1.json
384
392
  - spec/fixtures/members_2.json
385
393
  - spec/fixtures/new.json
394
+ - spec/fixtures/notification_success.json
386
395
  - spec/fixtures/notifications.json
387
396
  - spec/fixtures/polls_toggle_status.json
388
397
  - spec/fixtures/polls_vote.json
@@ -395,7 +404,9 @@ test_files:
395
404
  - spec/fixtures/regenerate_api_key.json
396
405
  - spec/fixtures/replies.json
397
406
  - spec/fixtures/replies_and_topics.json
407
+ - spec/fixtures/retrieve_invite.json
398
408
  - spec/fixtures/search.json
409
+ - spec/fixtures/top.json
399
410
  - spec/fixtures/topic.json
400
411
  - spec/fixtures/topic_invite_user.json
401
412
  - spec/fixtures/topic_posts.json
@@ -1,12 +0,0 @@
1
- [
2
- {
3
- "id": 1,
4
- "key": "test_d7fd0429940",
5
- "user": {
6
- "id": 1,
7
- "username": "test_user",
8
- "uploaded_avatar_id": 7,
9
- "avatar_template": "/user_avatar/localhost/test_user/{size}/7.png"
10
- }
11
- }
12
- ]
@@ -1,7 +0,0 @@
1
- {
2
- "api_key": {
3
- "id": 10,
4
- "key": "c999afe41d3a6ed0798a13ef69f90c4cc7d38120818c4a098e402bc5e5ef2085",
5
- "user": null
6
- }
7
- }